@mappedin/mappedin-js 6.0.1-alpha.2 → 6.0.1-alpha.4

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [6.0.1-alpha.4](https://github.com/MappedIn/mappedin-core-sdk/compare/@mappedin/maker-sdk@6.0.1-alpha.3...@mappedin/maker-sdk@6.0.1-alpha.4) (2024-02-27)
7
+
8
+ **Note:** Version bump only for package @mappedin/maker-sdk
9
+
10
+ ## [6.0.1-alpha.3](https://github.com/MappedIn/mappedin-core-sdk/compare/@mappedin/maker-sdk@6.0.1-alpha.2...@mappedin/maker-sdk@6.0.1-alpha.3) (2024-02-27)
11
+
12
+ **Note:** Version bump only for package @mappedin/maker-sdk
13
+
6
14
  ## [6.0.1-alpha.2](https://github.com/MappedIn/mappedin-core-sdk/compare/@mappedin/maker-sdk@6.0.1-alpha.1...@mappedin/maker-sdk@6.0.1-alpha.2) (2024-02-27)
7
15
 
8
16
  **Note:** Version bump only for package @mappedin/maker-sdk
@@ -1 +1 @@
1
- import{A as Re,B as Ne,C as be,D as Se,N as z,P as _e,Qa as v,V as k,Y as Ue,aa as Le,ca as O,e as de,j as ge,k as xe,l as me,m as Te,n as ye,o as we,p as Me,q as Ie,r as Ae,ra as F,x as Ee}from"./chunk-SVP2SCIT.js";import{a as pe}from"./chunk-VSBVGSLC.js";import{a as T}from"./chunk-J5IUISYU.js";pe();var Ce={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]},ee=class ee{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Y(e)}),this.register(function(e){return new j(e)}),this.register(function(e){return new W(e)}),this.register(function(e){return new X(e)}),this.register(function(e){return new J(e)}),this.register(function(e){return new Z(e)}),this.register(function(e){return new K(e)}),this.register(function(e){return new q(e)}),this.register(function(e){return new Q(e)}),this.register(function(e){return new $(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,s,n,t){let r=new G,i=[];for(let o=0,a=this.pluginCallbacks.length;o<a;o++)i.push(this.pluginCallbacks[o](r));r.setPlugins(i),r.write(e,s,t).catch(n)}parseAsync(e,s){let n=this;return new Promise(function(t,r){n.parse(e,t,r,s)})}};T(ee,"GLTFExporter");var P=ee,g={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},H="KHR_mesh_quantization",N={};N[Te]=g.NEAREST;N[ye]=g.NEAREST_MIPMAP_NEAREST;N[we]=g.NEAREST_MIPMAP_LINEAR;N[Me]=g.LINEAR;N[Ie]=g.LINEAR_MIPMAP_NEAREST;N[Ae]=g.LINEAR_MIPMAP_LINEAR;N[xe]=g.CLAMP_TO_EDGE;N[ge]=g.REPEAT;N[me]=g.MIRRORED_REPEAT;var Oe={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},Fe=new Le,ve=12,He=1179937895,Ve=2,De=8,Ge=1313821514,Ye=5130562;function D(c,e){return c.length===e.length&&c.every(function(s,n){return s===e[n]})}T(D,"equalArray");function je(c){return new TextEncoder().encode(c).buffer}T(je,"stringToArrayBuffer");function Ke(c){return D(c.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}T(Ke,"isIdentityMatrix");function qe(c,e,s){let n={min:new Array(c.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(c.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let t=e;t<e+s;t++)for(let r=0;r<c.itemSize;r++){let i;c.itemSize>4?i=c.array[t*c.itemSize+r]:(r===0?i=c.getX(t):r===1?i=c.getY(t):r===2?i=c.getZ(t):r===3&&(i=c.getW(t)),c.normalized===!0&&(i=z.normalize(i,c.array))),n.min[r]=Math.min(n.min[r],i),n.max[r]=Math.max(n.max[r],i)}return n}T(qe,"getMinMax");function Be(c){return Math.ceil(c/4)*4}T(Be,"getPaddedBufferSize");function V(c,e=0){let s=Be(c.byteLength);if(s!==c.byteLength){let n=new Uint8Array(s);if(n.set(new Uint8Array(c)),e!==0)for(let t=c.byteLength;t<s;t++)n[t]=e;return n.buffer}return c}T(V,"getPaddedArrayBuffer");function ze(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}T(ze,"getCanvas");function Pe(c,e){if(c.toBlob!==void 0)return new Promise(n=>c.toBlob(n,e));let s;return e==="image/jpeg"?s=.92:e==="image/webp"&&(s=.8),c.convertToBlob({type:e,quality:s})}T(Pe,"getToBlobPromise");var se=class se{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,s,n={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);let t=this,r=t.buffers,i=t.json;n=t.options;let o=t.extensionsUsed,a=t.extensionsRequired,u=new Blob(r,{type:"application/octet-stream"}),d=Object.keys(o),l=Object.keys(a);if(d.length>0&&(i.extensionsUsed=d),l.length>0&&(i.extensionsRequired=l),i.buffers&&i.buffers.length>0&&(i.buffers[0].byteLength=u.size),n.binary===!0){let m=new FileReader;m.readAsArrayBuffer(u),m.onloadend=function(){let f=V(m.result),p=new DataView(new ArrayBuffer(De));p.setUint32(0,f.byteLength,!0),p.setUint32(4,Ye,!0);let h=V(je(JSON.stringify(i)),32),w=new DataView(new ArrayBuffer(De));w.setUint32(0,h.byteLength,!0),w.setUint32(4,Ge,!0);let y=new ArrayBuffer(ve),S=new DataView(y);S.setUint32(0,He,!0),S.setUint32(4,Ve,!0);let x=ve+w.byteLength+h.byteLength+p.byteLength+f.byteLength;S.setUint32(8,x,!0);let M=new Blob([y,w,h,p,f],{type:"application/octet-stream"}),I=new FileReader;I.readAsArrayBuffer(M),I.onloadend=function(){s(I.result)}}}else if(i.buffers&&i.buffers.length>0){let m=new FileReader;m.readAsDataURL(u),m.onloadend=function(){let f=m.result;i.buffers[0].uri=f,s(i)}}else s(i)}serializeUserData(e,s){if(Object.keys(e.userData).length===0)return;let n=this.options,t=this.extensionsUsed;try{let r=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&r.gltfExtensions){s.extensions===void 0&&(s.extensions={});for(let i in r.gltfExtensions)s.extensions[i]=r.gltfExtensions[i],t[i]=!0;delete r.gltfExtensions}Object.keys(r).length>0&&(s.extras=r)}catch(r){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+r.message)}}getUID(e,s=!1){if(this.uids.has(e)===!1){let t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(s)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new k;for(let t=0,r=e.count;t<r;t++)if(Math.abs(n.fromBufferAttribute(e,t).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let s=this.cache;if(s.attributesNormalized.has(e))return s.attributesNormalized.get(e);let n=e.clone(),t=new k;for(let r=0,i=n.count;r<i;r++)t.fromBufferAttribute(n,r),t.x===0&&t.y===0&&t.z===0?t.setX(1):t.normalize(),n.setXYZ(r,t.x,t.y,t.z);return s.attributesNormalized.set(e,n),n}applyTextureTransform(e,s){let n=!1,t={};(s.offset.x!==0||s.offset.y!==0)&&(t.offset=s.offset.toArray(),n=!0),s.rotation!==0&&(t.rotation=s.rotation,n=!0),(s.repeat.x!==1||s.repeat.y!==1)&&(t.scale=s.repeat.toArray(),n=!0),n&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=t,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,s){if(e===s)return e;function n(f){return f.encoding===Se?T(function(h){return h<.04045?h*.0773993808:Math.pow(h*.9478672986+.0521327014,2.4)},"SRGBToLinear"):T(function(h){return h},"LinearToLinear")}T(n,"getEncodingConversion"),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures.");let t=e?e.image:null,r=s?s.image:null,i=Math.max(t?t.width:0,r?r.width:0),o=Math.max(t?t.height:0,r?r.height:0),a=ze();a.width=i,a.height=o;let u=a.getContext("2d");u.fillStyle="#00ffff",u.fillRect(0,0,i,o);let d=u.getImageData(0,0,i,o);if(t){u.drawImage(t,0,0,i,o);let f=n(e),p=u.getImageData(0,0,i,o).data;for(let h=2;h<p.length;h+=4)d.data[h]=f(p[h]/256)*256}if(r){u.drawImage(r,0,0,i,o);let f=n(s),p=u.getImageData(0,0,i,o).data;for(let h=1;h<p.length;h+=4)d.data[h]=f(p[h]/256)*256}u.putImageData(d,0,0);let m=(e||s).clone();return m.source=new _e(a),m.encoding=be,m}processBuffer(e){let s=this.json,n=this.buffers;return s.buffers||(s.buffers=[{byteLength:0}]),n.push(e),0}processBufferView(e,s,n,t,r){let i=this.json;i.bufferViews||(i.bufferViews=[]);let o;switch(s){case g.BYTE:case g.UNSIGNED_BYTE:o=1;break;case g.SHORT:case g.UNSIGNED_SHORT:o=2;break;default:o=4}let a=Be(t*e.itemSize*o),u=new DataView(new ArrayBuffer(a)),d=0;for(let f=n;f<n+t;f++)for(let p=0;p<e.itemSize;p++){let h;e.itemSize>4?h=e.array[f*e.itemSize+p]:(p===0?h=e.getX(f):p===1?h=e.getY(f):p===2?h=e.getZ(f):p===3&&(h=e.getW(f)),e.normalized===!0&&(h=z.normalize(h,e.array))),s===g.FLOAT?u.setFloat32(d,h,!0):s===g.INT?u.setInt32(d,h,!0):s===g.UNSIGNED_INT?u.setUint32(d,h,!0):s===g.SHORT?u.setInt16(d,h,!0):s===g.UNSIGNED_SHORT?u.setUint16(d,h,!0):s===g.BYTE?u.setInt8(d,h):s===g.UNSIGNED_BYTE&&u.setUint8(d,h),d+=o}let l={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:a};return r!==void 0&&(l.target=r),r===g.ARRAY_BUFFER&&(l.byteStride=e.itemSize*o),this.byteOffset+=a,i.bufferViews.push(l),{id:i.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let s=this,n=s.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(t){let r=new FileReader;r.readAsArrayBuffer(e),r.onloadend=function(){let i=V(r.result),o={buffer:s.processBuffer(i),byteOffset:s.byteOffset,byteLength:i.byteLength};s.byteOffset+=i.byteLength,t(n.bufferViews.push(o)-1)}})}processAccessor(e,s,n,t){let r=this.json,i={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"},o;if(e.array.constructor===Float32Array)o=g.FLOAT;else if(e.array.constructor===Int32Array)o=g.INT;else if(e.array.constructor===Uint32Array)o=g.UNSIGNED_INT;else if(e.array.constructor===Int16Array)o=g.SHORT;else if(e.array.constructor===Uint16Array)o=g.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)o=g.BYTE;else if(e.array.constructor===Uint8Array)o=g.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),t===void 0&&(t=e.count),t===0)return null;let a=qe(e,n,t),u;s!==void 0&&(u=e===s.index?g.ELEMENT_ARRAY_BUFFER:g.ARRAY_BUFFER);let d=this.processBufferView(e,o,n,t,u),l={bufferView:d.id,byteOffset:d.byteOffset,componentType:o,count:t,max:a.max,min:a.min,type:i[e.itemSize]};return e.normalized===!0&&(l.normalized=!0),r.accessors||(r.accessors=[]),r.accessors.push(l)-1}processImage(e,s,n,t="image/png"){if(e!==null){let r=this,i=r.cache,o=r.json,a=r.options,u=r.pending;i.images.has(e)||i.images.set(e,{});let d=i.images.get(e),l=t+":flipY/"+n.toString();if(d[l]!==void 0)return d[l];o.images||(o.images=[]);let m={mimeType:t},f=ze();f.width=Math.min(e.width,a.maxTextureSize),f.height=Math.min(e.height,a.maxTextureSize);let p=f.getContext("2d");if(n===!0&&(p.translate(0,f.height),p.scale(1,-1)),e.data!==void 0){s!==Ee&&console.error("GLTFExporter: Only RGBAFormat is supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let w=new Uint8ClampedArray(e.height*e.width*4);for(let y=0;y<w.length;y+=4)w[y+0]=e.data[y+0],w[y+1]=e.data[y+1],w[y+2]=e.data[y+2],w[y+3]=e.data[y+3];p.putImageData(new ImageData(w,e.width,e.height),0,0)}else p.drawImage(e,0,0,f.width,f.height);a.binary===!0?u.push(Pe(f,t).then(w=>r.processBufferViewImage(w)).then(w=>{m.bufferView=w})):f.toDataURL!==void 0?m.uri=f.toDataURL(t):u.push(Pe(f,t).then(w=>new FileReader().readAsDataURL(w)).then(w=>{m.uri=w}));let h=o.images.push(m)-1;return d[l]=h,h}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){let s=this.json;s.samplers||(s.samplers=[]);let n={magFilter:N[e.magFilter],minFilter:N[e.minFilter],wrapS:N[e.wrapS],wrapT:N[e.wrapT]};return s.samplers.push(n)-1}processTexture(e){let s=this.cache,n=this.json;if(s.textures.has(e))return s.textures.get(e);n.textures||(n.textures=[]);let t=e.userData.mimeType;t==="image/webp"&&(t="image/png");let r={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,t)};e.name&&(r.name=e.name),this._invokeAll(function(o){o.writeTexture&&o.writeTexture(e,r)});let i=n.textures.push(r)-1;return s.textures.set(e,i),i}processMaterial(e){let s=this.cache,n=this.json;if(s.materials.has(e))return s.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;n.materials||(n.materials=[]);let t={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let r=e.color.toArray().concat([e.opacity]);if(D(r,[1,1,1,1])||(t.pbrMetallicRoughness.baseColorFactor=r),e.isMeshStandardMaterial?(t.pbrMetallicRoughness.metallicFactor=e.metalness,t.pbrMetallicRoughness.roughnessFactor=e.roughness):(t.pbrMetallicRoughness.metallicFactor=.5,t.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){let o=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),a={index:this.processTexture(o)};this.applyTextureTransform(a,o),t.pbrMetallicRoughness.metallicRoughnessTexture=a}if(e.map){let o={index:this.processTexture(e.map)};this.applyTextureTransform(o,e.map),t.pbrMetallicRoughness.baseColorTexture=o}if(e.emissive){let o=e.emissive;if(Math.max(o.r,o.g,o.b)>0&&(t.emissiveFactor=e.emissive.toArray()),e.emissiveMap){let u={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(u,e.emissiveMap),t.emissiveTexture=u}}if(e.normalMap){let o={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(o.scale=e.normalScale.x),this.applyTextureTransform(o,e.normalMap),t.normalTexture=o}if(e.aoMap){let o={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(o.strength=e.aoMapIntensity),this.applyTextureTransform(o,e.aoMap),t.occlusionTexture=o}e.transparent?t.alphaMode="BLEND":e.alphaTest>0&&(t.alphaMode="MASK",t.alphaCutoff=e.alphaTest),e.side===de&&(t.doubleSided=!0),e.name!==""&&(t.name=e.name),this.serializeUserData(e,t),this._invokeAll(function(o){o.writeMaterial&&o.writeMaterial(e,t)});let i=n.materials.push(t)-1;return s.materials.set(e,i),i}processMesh(e){let s=this.cache,n=this.json,t=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,M=e.material.length;x<M;x++)t.push(e.material[x].uuid);else t.push(e.material.uuid);let r=t.join(":");if(s.meshes.has(r))return s.meshes.get(r);let i=e.geometry,o;e.isLineSegments?o=g.LINES:e.isLineLoop?o=g.LINE_LOOP:e.isLine?o=g.LINE_STRIP:e.isPoints?o=g.POINTS:o=e.material.wireframe?g.LINES:g.TRIANGLES;let a={},u={},d=[],l=[],m={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},f=i.getAttribute("normal");f!==void 0&&!this.isNormalizedNormalAttribute(f)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.setAttribute("normal",this.createNormalizedNormalAttribute(f)));let p=null;for(let x in i.attributes){if(x.slice(0,5)==="morph")continue;let M=i.attributes[x];if(x=m[x]||x.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(x)||(x="_"+x),s.attributes.has(this.getUID(M))){u[x]=s.attributes.get(this.getUID(M));continue}p=null;let A=M.array;x==="JOINTS_0"&&!(A instanceof Uint16Array)&&!(A instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),p=new O(new Uint16Array(A),M.itemSize,M.normalized));let R=this.processAccessor(p||M,i);R!==null&&(x.startsWith("_")||this.detectMeshQuantization(x,M),u[x]=R,s.attributes.set(this.getUID(M),R))}if(f!==void 0&&i.setAttribute("normal",f),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){let x=[],M=[],I={};if(e.morphTargetDictionary!==void 0)for(let A in e.morphTargetDictionary)I[e.morphTargetDictionary[A]]=A;for(let A=0;A<e.morphTargetInfluences.length;++A){let R={},he=!1;for(let U in i.morphAttributes){if(U!=="position"&&U!=="normal"){he||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),he=!0);continue}let b=i.morphAttributes[U][A],B=U.toUpperCase(),L=i.attributes[U];if(s.attributes.has(this.getUID(b,!0))){R[B]=s.attributes.get(this.getUID(b,!0));continue}let C=b.clone();if(!i.morphTargetsRelative)for(let E=0,ke=b.count;E<ke;E++)for(let _=0;_<b.itemSize;_++)_===0&&C.setX(E,b.getX(E)-L.getX(E)),_===1&&C.setY(E,b.getY(E)-L.getY(E)),_===2&&C.setZ(E,b.getZ(E)-L.getZ(E)),_===3&&C.setW(E,b.getW(E)-L.getW(E));R[B]=this.processAccessor(C,i),s.attributes.set(this.getUID(L,!0),R[B])}l.push(R),x.push(e.morphTargetInfluences[A]),e.morphTargetDictionary!==void 0&&M.push(I[A])}a.weights=x,M.length>0&&(a.extras={},a.extras.targetNames=M)}let h=Array.isArray(e.material);if(h&&i.groups.length===0)return null;let w=h?e.material:[e.material],y=h?i.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,M=y.length;x<M;x++){let I={mode:o,attributes:u};if(this.serializeUserData(i,I),l.length>0&&(I.targets=l),i.index!==null){let R=this.getUID(i.index);(y[x].start!==void 0||y[x].count!==void 0)&&(R+=":"+y[x].start+":"+y[x].count),s.attributes.has(R)?I.indices=s.attributes.get(R):(I.indices=this.processAccessor(i.index,i,y[x].start,y[x].count),s.attributes.set(R,I.indices)),I.indices===null&&delete I.indices}let A=this.processMaterial(w[y[x].materialIndex]);A!==null&&(I.material=A),d.push(I)}a.primitives=d,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,a)});let S=n.meshes.push(a)-1;return s.meshes.set(r,S),S}detectMeshQuantization(e,s){if(this.extensionsUsed[H])return;let n;switch(s.array.constructor){case Int8Array:n="byte";break;case Uint8Array:n="unsigned byte";break;case Int16Array:n="short";break;case Uint16Array:n="unsigned short";break;default:return}s.normalized&&(n+=" normalized");let t=e.split("_",1)[0];Ce[t]&&Ce[t].includes(n)&&(this.extensionsUsed[H]=!0,this.extensionsRequired[H]=!0)}processCamera(e){let s=this.json;s.cameras||(s.cameras=[]);let n=e.isOrthographicCamera,t={type:n?"orthographic":"perspective"};return n?t.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:t.perspective={aspectRatio:e.aspect,yfov:z.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(t.name=e.type),s.cameras.push(t)-1}processAnimation(e,s){let n=this.json,t=this.nodeMap;n.animations||(n.animations=[]),e=P.Utils.mergeMorphTargetTracks(e.clone(),s);let r=e.tracks,i=[],o=[];for(let a=0;a<r.length;++a){let u=r[a],d=v.parseTrackName(u.name),l=v.findNode(s,d.nodeName),m=Oe[d.propertyName];if(d.objectName==="bones"&&(l.isSkinnedMesh===!0?l=l.skeleton.getBoneByName(d.objectIndex):l=void 0),!l||!m)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',u.name),null;let f=1,p=u.values.length/u.times.length;m===Oe.morphTargetInfluences&&(p/=l.morphTargetInfluences.length);let h;u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(h="CUBICSPLINE",p/=3):u.getInterpolation()===Re?h="STEP":h="LINEAR",o.push({input:this.processAccessor(new O(u.times,f)),output:this.processAccessor(new O(u.values,p)),interpolation:h}),i.push({sampler:o.length-1,target:{node:t.get(l),path:m}})}return n.animations.push({name:e.name||"clip_"+n.animations.length,samplers:o,channels:i}),n.animations.length-1}processSkin(e){let s=this.json,n=this.nodeMap,t=s.nodes[n.get(e)],r=e.skeleton;if(r===void 0)return null;let i=e.skeleton.bones[0];if(i===void 0)return null;let o=[],a=new Float32Array(r.bones.length*16),u=new Ue;for(let l=0;l<r.bones.length;++l)o.push(n.get(r.bones[l])),u.copy(r.boneInverses[l]),u.multiply(e.bindMatrix).toArray(a,l*16);return s.skins===void 0&&(s.skins=[]),s.skins.push({inverseBindMatrices:this.processAccessor(new O(a,16)),joints:o,skeleton:n.get(i)}),t.skin=s.skins.length-1}processNode(e){let s=this.json,n=this.options,t=this.nodeMap;s.nodes||(s.nodes=[]);let r={};if(n.trs){let o=e.quaternion.toArray(),a=e.position.toArray(),u=e.scale.toArray();D(o,[0,0,0,1])||(r.rotation=o),D(a,[0,0,0])||(r.translation=a),D(u,[1,1,1])||(r.scale=u)}else e.matrixAutoUpdate&&e.updateMatrix(),Ke(e.matrix)===!1&&(r.matrix=e.matrix.elements);if(e.name!==""&&(r.name=String(e.name)),this.serializeUserData(e,r),e.isMesh||e.isLine||e.isPoints){let o=this.processMesh(e);o!==null&&(r.mesh=o)}else e.isCamera&&(r.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){let o=[];for(let a=0,u=e.children.length;a<u;a++){let d=e.children[a];if(d.visible||n.onlyVisible===!1){let l=this.processNode(d);l!==null&&o.push(l)}}o.length>0&&(r.children=o)}this._invokeAll(function(o){o.writeNode&&o.writeNode(e,r)});let i=s.nodes.push(r)-1;return t.set(e,i),i}processScene(e){let s=this.json,n=this.options;s.scenes||(s.scenes=[],s.scene=0);let t={};e.name!==""&&(t.name=e.name),s.scenes.push(t);let r=[];for(let i=0,o=e.children.length;i<o;i++){let a=e.children[i];if(a.visible||n.onlyVisible===!1){let u=this.processNode(a);u!==null&&r.push(u)}}r.length>0&&(t.nodes=r),this.serializeUserData(e,t)}processObjects(e){let s=new F;s.name="AuxScene";for(let n=0;n<e.length;n++)s.children.push(e[n]);this.processScene(s)}processInput(e){let s=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(t){t.beforeParse&&t.beforeParse(e)});let n=[];for(let t=0;t<e.length;t++)e[t]instanceof F?this.processScene(e[t]):n.push(e[t]);n.length>0&&this.processObjects(n);for(let t=0;t<this.skins.length;++t)this.processSkin(this.skins[t]);for(let t=0;t<s.animations.length;++t)this.processAnimation(s.animations[t],e[0]);this._invokeAll(function(t){t.afterParse&&t.afterParse(e)})}_invokeAll(e){for(let s=0,n=this.plugins.length;s<n;s++)e(this.plugins[s])}};T(se,"GLTFWriter");var G=se,te=class te{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,s){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}let n=this.writer,t=n.json,r=n.extensionsUsed,i={};e.name&&(i.name=e.name),i.color=e.color.toArray(),i.intensity=e.intensity,e.isDirectionalLight?i.type="directional":e.isPointLight?(i.type="point",e.distance>0&&(i.range=e.distance)):e.isSpotLight&&(i.type="spot",e.distance>0&&(i.range=e.distance),i.spot={},i.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,i.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),r[this.name]||(t.extensions=t.extensions||{},t.extensions[this.name]={lights:[]},r[this.name]=!0);let o=t.extensions[this.name].lights;o.push(i),s.extensions=s.extensions||{},s.extensions[this.name]={light:o.length-1}}};T(te,"GLTFLightExtension");var Y=te,ne=class ne{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,s){if(!e.isMeshBasicMaterial)return;let t=this.writer.extensionsUsed;s.extensions=s.extensions||{},s.extensions[this.name]={},t[this.name]=!0,s.pbrMetallicRoughness.metallicFactor=0,s.pbrMetallicRoughness.roughnessFactor=.9}};T(ne,"GLTFMaterialsUnlitExtension");var j=ne,ie=class ie{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;let n=this.writer,t=n.extensionsUsed,r={};if(r.clearcoatFactor=e.clearcoat,e.clearcoatMap){let i={index:n.processTexture(e.clearcoatMap)};n.applyTextureTransform(i,e.clearcoatMap),r.clearcoatTexture=i}if(r.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let i={index:n.processTexture(e.clearcoatRoughnessMap)};n.applyTextureTransform(i,e.clearcoatRoughnessMap),r.clearcoatRoughnessTexture=i}if(e.clearcoatNormalMap){let i={index:n.processTexture(e.clearcoatNormalMap)};n.applyTextureTransform(i,e.clearcoatNormalMap),r.clearcoatNormalTexture=i}s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(ie,"GLTFMaterialsClearcoatExtension");var K=ie,re=class re{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;let n=this.writer,t=n.extensionsUsed,r={};if(r.iridescenceFactor=e.iridescence,e.iridescenceMap){let i={index:n.processTexture(e.iridescenceMap)};n.applyTextureTransform(i,e.iridescenceMap),r.iridescenceTexture=i}if(r.iridescenceIor=e.iridescenceIOR,r.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],r.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let i={index:n.processTexture(e.iridescenceThicknessMap)};n.applyTextureTransform(i,e.iridescenceThicknessMap),r.iridescenceThicknessTexture=i}s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(re,"GLTFMaterialsIridescenceExtension");var q=re,oe=class oe{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,t=n.extensionsUsed,r={};if(r.transmissionFactor=e.transmission,e.transmissionMap){let i={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(i,e.transmissionMap),r.transmissionTexture=i}s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(oe,"GLTFMaterialsTransmissionExtension");var W=oe,ae=class ae{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,t=n.extensionsUsed,r={};if(r.thicknessFactor=e.thickness,e.thicknessMap){let i={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(i,e.thicknessMap),r.thicknessTexture=i}r.attenuationDistance=e.attenuationDistance,r.attenuationColor=e.attenuationColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(ae,"GLTFMaterialsVolumeExtension");var X=ae,ce=class ce{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;let t=this.writer.extensionsUsed,r={};r.ior=e.ior,s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(ce,"GLTFMaterialsIorExtension");var J=ce,ue=class ue{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(Fe)&&!e.specularIntensityMap&&!e.specularColorTexture)return;let n=this.writer,t=n.extensionsUsed,r={};if(e.specularIntensityMap){let i={index:n.processTexture(e.specularIntensityMap)};n.applyTextureTransform(i,e.specularIntensityMap),r.specularTexture=i}if(e.specularColorMap){let i={index:n.processTexture(e.specularColorMap)};n.applyTextureTransform(i,e.specularColorMap),r.specularColorTexture=i}r.specularFactor=e.specularIntensity,r.specularColorFactor=e.specularColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(ue,"GLTFMaterialsSpecularExtension");var Z=ue,le=class le{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;let n=this.writer,t=n.extensionsUsed,r={};if(e.sheenRoughnessMap){let i={index:n.processTexture(e.sheenRoughnessMap)};n.applyTextureTransform(i,e.sheenRoughnessMap),r.sheenRoughnessTexture=i}if(e.sheenColorMap){let i={index:n.processTexture(e.sheenColorMap)};n.applyTextureTransform(i,e.sheenColorMap),r.sheenColorTexture=i}r.sheenRoughnessFactor=e.sheenRoughness,r.sheenColorFactor=e.sheenColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(le,"GLTFMaterialsSheenExtension");var Q=le,fe=class fe{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,s){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;let t=this.writer.extensionsUsed,r={};r.emissiveStrength=e.emissiveIntensity,s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(fe,"GLTFMaterialsEmissiveStrengthExtension");var $=fe;P.Utils={insertKeyframe:function(c,e){let n=c.getValueSize(),t=new c.TimeBufferType(c.times.length+1),r=new c.ValueBufferType(c.values.length+n),i=c.createInterpolant(new c.ValueBufferType(n)),o;if(c.times.length===0){t[0]=e;for(let a=0;a<n;a++)r[a]=0;o=0}else if(e<c.times[0]){if(Math.abs(c.times[0]-e)<.001)return 0;t[0]=e,t.set(c.times,1),r.set(i.evaluate(e),0),r.set(c.values,n),o=0}else if(e>c.times[c.times.length-1]){if(Math.abs(c.times[c.times.length-1]-e)<.001)return c.times.length-1;t[t.length-1]=e,t.set(c.times,0),r.set(c.values,0),r.set(i.evaluate(e),c.values.length),o=t.length-1}else for(let a=0;a<c.times.length;a++){if(Math.abs(c.times[a]-e)<.001)return a;if(c.times[a]<e&&c.times[a+1]>e){t.set(c.times.slice(0,a+1),0),t[a+1]=e,t.set(c.times.slice(a+1),a+2),r.set(c.values.slice(0,(a+1)*n),0),r.set(i.evaluate(e),(a+1)*n),r.set(c.values.slice((a+1)*n),(a+2)*n),o=a+1;break}}return c.times=t,c.values=r,o},mergeMorphTargetTracks:function(c,e){let s=[],n={},t=c.tracks;for(let r=0;r<t.length;++r){let i=t[r],o=v.parseTrackName(i.name),a=v.findNode(e,o.nodeName);if(o.propertyName!=="morphTargetInfluences"||o.propertyIndex===void 0){s.push(i);continue}if(i.createInterpolant!==i.InterpolantFactoryMethodDiscrete&&i.createInterpolant!==i.InterpolantFactoryMethodLinear){if(i.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),i=i.clone(),i.setInterpolation(Ne)}let u=a.morphTargetInfluences.length,d=a.morphTargetDictionary[o.propertyIndex];if(d===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+o.propertyIndex);let l;if(n[a.uuid]===void 0){l=i.clone();let f=new l.ValueBufferType(u*l.times.length);for(let p=0;p<l.times.length;p++)f[p*u+d]=l.values[p];l.name=(o.nodeName||"")+".morphTargetInfluences",l.values=f,n[a.uuid]=l,s.push(l);continue}let m=i.createInterpolant(new i.ValueBufferType(1));l=n[a.uuid];for(let f=0;f<l.times.length;f++)l.values[f*u+d]=m.evaluate(l.times[f]);for(let f=0;f<i.times.length;f++){let p=this.insertKeyframe(l,i.times[f]);l.values[p*u+d]=i.values[f]}}return c.tracks=s,c}};export{P as GLTFExporter};
1
+ import{A as Re,B as Ne,C as be,D as Se,N as z,P as _e,Qa as v,V as k,Y as Ue,aa as Le,ca as O,e as de,j as ge,k as xe,l as me,m as Te,n as ye,o as we,p as Me,q as Ie,r as Ae,ra as F,x as Ee}from"./chunk-RKURC6O7.js";import{a as pe}from"./chunk-JJHKNDAJ.js";import{a as T}from"./chunk-J5IUISYU.js";pe();var Ce={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]},ee=class ee{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Y(e)}),this.register(function(e){return new j(e)}),this.register(function(e){return new W(e)}),this.register(function(e){return new X(e)}),this.register(function(e){return new J(e)}),this.register(function(e){return new Z(e)}),this.register(function(e){return new K(e)}),this.register(function(e){return new q(e)}),this.register(function(e){return new Q(e)}),this.register(function(e){return new $(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,s,n,t){let r=new G,i=[];for(let o=0,a=this.pluginCallbacks.length;o<a;o++)i.push(this.pluginCallbacks[o](r));r.setPlugins(i),r.write(e,s,t).catch(n)}parseAsync(e,s){let n=this;return new Promise(function(t,r){n.parse(e,t,r,s)})}};T(ee,"GLTFExporter");var P=ee,g={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},H="KHR_mesh_quantization",N={};N[Te]=g.NEAREST;N[ye]=g.NEAREST_MIPMAP_NEAREST;N[we]=g.NEAREST_MIPMAP_LINEAR;N[Me]=g.LINEAR;N[Ie]=g.LINEAR_MIPMAP_NEAREST;N[Ae]=g.LINEAR_MIPMAP_LINEAR;N[xe]=g.CLAMP_TO_EDGE;N[ge]=g.REPEAT;N[me]=g.MIRRORED_REPEAT;var Oe={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},Fe=new Le,ve=12,He=1179937895,Ve=2,De=8,Ge=1313821514,Ye=5130562;function D(c,e){return c.length===e.length&&c.every(function(s,n){return s===e[n]})}T(D,"equalArray");function je(c){return new TextEncoder().encode(c).buffer}T(je,"stringToArrayBuffer");function Ke(c){return D(c.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}T(Ke,"isIdentityMatrix");function qe(c,e,s){let n={min:new Array(c.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(c.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let t=e;t<e+s;t++)for(let r=0;r<c.itemSize;r++){let i;c.itemSize>4?i=c.array[t*c.itemSize+r]:(r===0?i=c.getX(t):r===1?i=c.getY(t):r===2?i=c.getZ(t):r===3&&(i=c.getW(t)),c.normalized===!0&&(i=z.normalize(i,c.array))),n.min[r]=Math.min(n.min[r],i),n.max[r]=Math.max(n.max[r],i)}return n}T(qe,"getMinMax");function Be(c){return Math.ceil(c/4)*4}T(Be,"getPaddedBufferSize");function V(c,e=0){let s=Be(c.byteLength);if(s!==c.byteLength){let n=new Uint8Array(s);if(n.set(new Uint8Array(c)),e!==0)for(let t=c.byteLength;t<s;t++)n[t]=e;return n.buffer}return c}T(V,"getPaddedArrayBuffer");function ze(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}T(ze,"getCanvas");function Pe(c,e){if(c.toBlob!==void 0)return new Promise(n=>c.toBlob(n,e));let s;return e==="image/jpeg"?s=.92:e==="image/webp"&&(s=.8),c.convertToBlob({type:e,quality:s})}T(Pe,"getToBlobPromise");var se=class se{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,s,n={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);let t=this,r=t.buffers,i=t.json;n=t.options;let o=t.extensionsUsed,a=t.extensionsRequired,u=new Blob(r,{type:"application/octet-stream"}),d=Object.keys(o),l=Object.keys(a);if(d.length>0&&(i.extensionsUsed=d),l.length>0&&(i.extensionsRequired=l),i.buffers&&i.buffers.length>0&&(i.buffers[0].byteLength=u.size),n.binary===!0){let m=new FileReader;m.readAsArrayBuffer(u),m.onloadend=function(){let f=V(m.result),p=new DataView(new ArrayBuffer(De));p.setUint32(0,f.byteLength,!0),p.setUint32(4,Ye,!0);let h=V(je(JSON.stringify(i)),32),w=new DataView(new ArrayBuffer(De));w.setUint32(0,h.byteLength,!0),w.setUint32(4,Ge,!0);let y=new ArrayBuffer(ve),S=new DataView(y);S.setUint32(0,He,!0),S.setUint32(4,Ve,!0);let x=ve+w.byteLength+h.byteLength+p.byteLength+f.byteLength;S.setUint32(8,x,!0);let M=new Blob([y,w,h,p,f],{type:"application/octet-stream"}),I=new FileReader;I.readAsArrayBuffer(M),I.onloadend=function(){s(I.result)}}}else if(i.buffers&&i.buffers.length>0){let m=new FileReader;m.readAsDataURL(u),m.onloadend=function(){let f=m.result;i.buffers[0].uri=f,s(i)}}else s(i)}serializeUserData(e,s){if(Object.keys(e.userData).length===0)return;let n=this.options,t=this.extensionsUsed;try{let r=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&r.gltfExtensions){s.extensions===void 0&&(s.extensions={});for(let i in r.gltfExtensions)s.extensions[i]=r.gltfExtensions[i],t[i]=!0;delete r.gltfExtensions}Object.keys(r).length>0&&(s.extras=r)}catch(r){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+r.message)}}getUID(e,s=!1){if(this.uids.has(e)===!1){let t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(s)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new k;for(let t=0,r=e.count;t<r;t++)if(Math.abs(n.fromBufferAttribute(e,t).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let s=this.cache;if(s.attributesNormalized.has(e))return s.attributesNormalized.get(e);let n=e.clone(),t=new k;for(let r=0,i=n.count;r<i;r++)t.fromBufferAttribute(n,r),t.x===0&&t.y===0&&t.z===0?t.setX(1):t.normalize(),n.setXYZ(r,t.x,t.y,t.z);return s.attributesNormalized.set(e,n),n}applyTextureTransform(e,s){let n=!1,t={};(s.offset.x!==0||s.offset.y!==0)&&(t.offset=s.offset.toArray(),n=!0),s.rotation!==0&&(t.rotation=s.rotation,n=!0),(s.repeat.x!==1||s.repeat.y!==1)&&(t.scale=s.repeat.toArray(),n=!0),n&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=t,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,s){if(e===s)return e;function n(f){return f.encoding===Se?T(function(h){return h<.04045?h*.0773993808:Math.pow(h*.9478672986+.0521327014,2.4)},"SRGBToLinear"):T(function(h){return h},"LinearToLinear")}T(n,"getEncodingConversion"),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures.");let t=e?e.image:null,r=s?s.image:null,i=Math.max(t?t.width:0,r?r.width:0),o=Math.max(t?t.height:0,r?r.height:0),a=ze();a.width=i,a.height=o;let u=a.getContext("2d");u.fillStyle="#00ffff",u.fillRect(0,0,i,o);let d=u.getImageData(0,0,i,o);if(t){u.drawImage(t,0,0,i,o);let f=n(e),p=u.getImageData(0,0,i,o).data;for(let h=2;h<p.length;h+=4)d.data[h]=f(p[h]/256)*256}if(r){u.drawImage(r,0,0,i,o);let f=n(s),p=u.getImageData(0,0,i,o).data;for(let h=1;h<p.length;h+=4)d.data[h]=f(p[h]/256)*256}u.putImageData(d,0,0);let m=(e||s).clone();return m.source=new _e(a),m.encoding=be,m}processBuffer(e){let s=this.json,n=this.buffers;return s.buffers||(s.buffers=[{byteLength:0}]),n.push(e),0}processBufferView(e,s,n,t,r){let i=this.json;i.bufferViews||(i.bufferViews=[]);let o;switch(s){case g.BYTE:case g.UNSIGNED_BYTE:o=1;break;case g.SHORT:case g.UNSIGNED_SHORT:o=2;break;default:o=4}let a=Be(t*e.itemSize*o),u=new DataView(new ArrayBuffer(a)),d=0;for(let f=n;f<n+t;f++)for(let p=0;p<e.itemSize;p++){let h;e.itemSize>4?h=e.array[f*e.itemSize+p]:(p===0?h=e.getX(f):p===1?h=e.getY(f):p===2?h=e.getZ(f):p===3&&(h=e.getW(f)),e.normalized===!0&&(h=z.normalize(h,e.array))),s===g.FLOAT?u.setFloat32(d,h,!0):s===g.INT?u.setInt32(d,h,!0):s===g.UNSIGNED_INT?u.setUint32(d,h,!0):s===g.SHORT?u.setInt16(d,h,!0):s===g.UNSIGNED_SHORT?u.setUint16(d,h,!0):s===g.BYTE?u.setInt8(d,h):s===g.UNSIGNED_BYTE&&u.setUint8(d,h),d+=o}let l={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:a};return r!==void 0&&(l.target=r),r===g.ARRAY_BUFFER&&(l.byteStride=e.itemSize*o),this.byteOffset+=a,i.bufferViews.push(l),{id:i.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let s=this,n=s.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(t){let r=new FileReader;r.readAsArrayBuffer(e),r.onloadend=function(){let i=V(r.result),o={buffer:s.processBuffer(i),byteOffset:s.byteOffset,byteLength:i.byteLength};s.byteOffset+=i.byteLength,t(n.bufferViews.push(o)-1)}})}processAccessor(e,s,n,t){let r=this.json,i={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"},o;if(e.array.constructor===Float32Array)o=g.FLOAT;else if(e.array.constructor===Int32Array)o=g.INT;else if(e.array.constructor===Uint32Array)o=g.UNSIGNED_INT;else if(e.array.constructor===Int16Array)o=g.SHORT;else if(e.array.constructor===Uint16Array)o=g.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)o=g.BYTE;else if(e.array.constructor===Uint8Array)o=g.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),t===void 0&&(t=e.count),t===0)return null;let a=qe(e,n,t),u;s!==void 0&&(u=e===s.index?g.ELEMENT_ARRAY_BUFFER:g.ARRAY_BUFFER);let d=this.processBufferView(e,o,n,t,u),l={bufferView:d.id,byteOffset:d.byteOffset,componentType:o,count:t,max:a.max,min:a.min,type:i[e.itemSize]};return e.normalized===!0&&(l.normalized=!0),r.accessors||(r.accessors=[]),r.accessors.push(l)-1}processImage(e,s,n,t="image/png"){if(e!==null){let r=this,i=r.cache,o=r.json,a=r.options,u=r.pending;i.images.has(e)||i.images.set(e,{});let d=i.images.get(e),l=t+":flipY/"+n.toString();if(d[l]!==void 0)return d[l];o.images||(o.images=[]);let m={mimeType:t},f=ze();f.width=Math.min(e.width,a.maxTextureSize),f.height=Math.min(e.height,a.maxTextureSize);let p=f.getContext("2d");if(n===!0&&(p.translate(0,f.height),p.scale(1,-1)),e.data!==void 0){s!==Ee&&console.error("GLTFExporter: Only RGBAFormat is supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let w=new Uint8ClampedArray(e.height*e.width*4);for(let y=0;y<w.length;y+=4)w[y+0]=e.data[y+0],w[y+1]=e.data[y+1],w[y+2]=e.data[y+2],w[y+3]=e.data[y+3];p.putImageData(new ImageData(w,e.width,e.height),0,0)}else p.drawImage(e,0,0,f.width,f.height);a.binary===!0?u.push(Pe(f,t).then(w=>r.processBufferViewImage(w)).then(w=>{m.bufferView=w})):f.toDataURL!==void 0?m.uri=f.toDataURL(t):u.push(Pe(f,t).then(w=>new FileReader().readAsDataURL(w)).then(w=>{m.uri=w}));let h=o.images.push(m)-1;return d[l]=h,h}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){let s=this.json;s.samplers||(s.samplers=[]);let n={magFilter:N[e.magFilter],minFilter:N[e.minFilter],wrapS:N[e.wrapS],wrapT:N[e.wrapT]};return s.samplers.push(n)-1}processTexture(e){let s=this.cache,n=this.json;if(s.textures.has(e))return s.textures.get(e);n.textures||(n.textures=[]);let t=e.userData.mimeType;t==="image/webp"&&(t="image/png");let r={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,t)};e.name&&(r.name=e.name),this._invokeAll(function(o){o.writeTexture&&o.writeTexture(e,r)});let i=n.textures.push(r)-1;return s.textures.set(e,i),i}processMaterial(e){let s=this.cache,n=this.json;if(s.materials.has(e))return s.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;n.materials||(n.materials=[]);let t={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let r=e.color.toArray().concat([e.opacity]);if(D(r,[1,1,1,1])||(t.pbrMetallicRoughness.baseColorFactor=r),e.isMeshStandardMaterial?(t.pbrMetallicRoughness.metallicFactor=e.metalness,t.pbrMetallicRoughness.roughnessFactor=e.roughness):(t.pbrMetallicRoughness.metallicFactor=.5,t.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){let o=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),a={index:this.processTexture(o)};this.applyTextureTransform(a,o),t.pbrMetallicRoughness.metallicRoughnessTexture=a}if(e.map){let o={index:this.processTexture(e.map)};this.applyTextureTransform(o,e.map),t.pbrMetallicRoughness.baseColorTexture=o}if(e.emissive){let o=e.emissive;if(Math.max(o.r,o.g,o.b)>0&&(t.emissiveFactor=e.emissive.toArray()),e.emissiveMap){let u={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(u,e.emissiveMap),t.emissiveTexture=u}}if(e.normalMap){let o={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(o.scale=e.normalScale.x),this.applyTextureTransform(o,e.normalMap),t.normalTexture=o}if(e.aoMap){let o={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(o.strength=e.aoMapIntensity),this.applyTextureTransform(o,e.aoMap),t.occlusionTexture=o}e.transparent?t.alphaMode="BLEND":e.alphaTest>0&&(t.alphaMode="MASK",t.alphaCutoff=e.alphaTest),e.side===de&&(t.doubleSided=!0),e.name!==""&&(t.name=e.name),this.serializeUserData(e,t),this._invokeAll(function(o){o.writeMaterial&&o.writeMaterial(e,t)});let i=n.materials.push(t)-1;return s.materials.set(e,i),i}processMesh(e){let s=this.cache,n=this.json,t=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,M=e.material.length;x<M;x++)t.push(e.material[x].uuid);else t.push(e.material.uuid);let r=t.join(":");if(s.meshes.has(r))return s.meshes.get(r);let i=e.geometry,o;e.isLineSegments?o=g.LINES:e.isLineLoop?o=g.LINE_LOOP:e.isLine?o=g.LINE_STRIP:e.isPoints?o=g.POINTS:o=e.material.wireframe?g.LINES:g.TRIANGLES;let a={},u={},d=[],l=[],m={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},f=i.getAttribute("normal");f!==void 0&&!this.isNormalizedNormalAttribute(f)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.setAttribute("normal",this.createNormalizedNormalAttribute(f)));let p=null;for(let x in i.attributes){if(x.slice(0,5)==="morph")continue;let M=i.attributes[x];if(x=m[x]||x.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(x)||(x="_"+x),s.attributes.has(this.getUID(M))){u[x]=s.attributes.get(this.getUID(M));continue}p=null;let A=M.array;x==="JOINTS_0"&&!(A instanceof Uint16Array)&&!(A instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),p=new O(new Uint16Array(A),M.itemSize,M.normalized));let R=this.processAccessor(p||M,i);R!==null&&(x.startsWith("_")||this.detectMeshQuantization(x,M),u[x]=R,s.attributes.set(this.getUID(M),R))}if(f!==void 0&&i.setAttribute("normal",f),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){let x=[],M=[],I={};if(e.morphTargetDictionary!==void 0)for(let A in e.morphTargetDictionary)I[e.morphTargetDictionary[A]]=A;for(let A=0;A<e.morphTargetInfluences.length;++A){let R={},he=!1;for(let U in i.morphAttributes){if(U!=="position"&&U!=="normal"){he||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),he=!0);continue}let b=i.morphAttributes[U][A],B=U.toUpperCase(),L=i.attributes[U];if(s.attributes.has(this.getUID(b,!0))){R[B]=s.attributes.get(this.getUID(b,!0));continue}let C=b.clone();if(!i.morphTargetsRelative)for(let E=0,ke=b.count;E<ke;E++)for(let _=0;_<b.itemSize;_++)_===0&&C.setX(E,b.getX(E)-L.getX(E)),_===1&&C.setY(E,b.getY(E)-L.getY(E)),_===2&&C.setZ(E,b.getZ(E)-L.getZ(E)),_===3&&C.setW(E,b.getW(E)-L.getW(E));R[B]=this.processAccessor(C,i),s.attributes.set(this.getUID(L,!0),R[B])}l.push(R),x.push(e.morphTargetInfluences[A]),e.morphTargetDictionary!==void 0&&M.push(I[A])}a.weights=x,M.length>0&&(a.extras={},a.extras.targetNames=M)}let h=Array.isArray(e.material);if(h&&i.groups.length===0)return null;let w=h?e.material:[e.material],y=h?i.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,M=y.length;x<M;x++){let I={mode:o,attributes:u};if(this.serializeUserData(i,I),l.length>0&&(I.targets=l),i.index!==null){let R=this.getUID(i.index);(y[x].start!==void 0||y[x].count!==void 0)&&(R+=":"+y[x].start+":"+y[x].count),s.attributes.has(R)?I.indices=s.attributes.get(R):(I.indices=this.processAccessor(i.index,i,y[x].start,y[x].count),s.attributes.set(R,I.indices)),I.indices===null&&delete I.indices}let A=this.processMaterial(w[y[x].materialIndex]);A!==null&&(I.material=A),d.push(I)}a.primitives=d,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,a)});let S=n.meshes.push(a)-1;return s.meshes.set(r,S),S}detectMeshQuantization(e,s){if(this.extensionsUsed[H])return;let n;switch(s.array.constructor){case Int8Array:n="byte";break;case Uint8Array:n="unsigned byte";break;case Int16Array:n="short";break;case Uint16Array:n="unsigned short";break;default:return}s.normalized&&(n+=" normalized");let t=e.split("_",1)[0];Ce[t]&&Ce[t].includes(n)&&(this.extensionsUsed[H]=!0,this.extensionsRequired[H]=!0)}processCamera(e){let s=this.json;s.cameras||(s.cameras=[]);let n=e.isOrthographicCamera,t={type:n?"orthographic":"perspective"};return n?t.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:t.perspective={aspectRatio:e.aspect,yfov:z.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(t.name=e.type),s.cameras.push(t)-1}processAnimation(e,s){let n=this.json,t=this.nodeMap;n.animations||(n.animations=[]),e=P.Utils.mergeMorphTargetTracks(e.clone(),s);let r=e.tracks,i=[],o=[];for(let a=0;a<r.length;++a){let u=r[a],d=v.parseTrackName(u.name),l=v.findNode(s,d.nodeName),m=Oe[d.propertyName];if(d.objectName==="bones"&&(l.isSkinnedMesh===!0?l=l.skeleton.getBoneByName(d.objectIndex):l=void 0),!l||!m)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',u.name),null;let f=1,p=u.values.length/u.times.length;m===Oe.morphTargetInfluences&&(p/=l.morphTargetInfluences.length);let h;u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(h="CUBICSPLINE",p/=3):u.getInterpolation()===Re?h="STEP":h="LINEAR",o.push({input:this.processAccessor(new O(u.times,f)),output:this.processAccessor(new O(u.values,p)),interpolation:h}),i.push({sampler:o.length-1,target:{node:t.get(l),path:m}})}return n.animations.push({name:e.name||"clip_"+n.animations.length,samplers:o,channels:i}),n.animations.length-1}processSkin(e){let s=this.json,n=this.nodeMap,t=s.nodes[n.get(e)],r=e.skeleton;if(r===void 0)return null;let i=e.skeleton.bones[0];if(i===void 0)return null;let o=[],a=new Float32Array(r.bones.length*16),u=new Ue;for(let l=0;l<r.bones.length;++l)o.push(n.get(r.bones[l])),u.copy(r.boneInverses[l]),u.multiply(e.bindMatrix).toArray(a,l*16);return s.skins===void 0&&(s.skins=[]),s.skins.push({inverseBindMatrices:this.processAccessor(new O(a,16)),joints:o,skeleton:n.get(i)}),t.skin=s.skins.length-1}processNode(e){let s=this.json,n=this.options,t=this.nodeMap;s.nodes||(s.nodes=[]);let r={};if(n.trs){let o=e.quaternion.toArray(),a=e.position.toArray(),u=e.scale.toArray();D(o,[0,0,0,1])||(r.rotation=o),D(a,[0,0,0])||(r.translation=a),D(u,[1,1,1])||(r.scale=u)}else e.matrixAutoUpdate&&e.updateMatrix(),Ke(e.matrix)===!1&&(r.matrix=e.matrix.elements);if(e.name!==""&&(r.name=String(e.name)),this.serializeUserData(e,r),e.isMesh||e.isLine||e.isPoints){let o=this.processMesh(e);o!==null&&(r.mesh=o)}else e.isCamera&&(r.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){let o=[];for(let a=0,u=e.children.length;a<u;a++){let d=e.children[a];if(d.visible||n.onlyVisible===!1){let l=this.processNode(d);l!==null&&o.push(l)}}o.length>0&&(r.children=o)}this._invokeAll(function(o){o.writeNode&&o.writeNode(e,r)});let i=s.nodes.push(r)-1;return t.set(e,i),i}processScene(e){let s=this.json,n=this.options;s.scenes||(s.scenes=[],s.scene=0);let t={};e.name!==""&&(t.name=e.name),s.scenes.push(t);let r=[];for(let i=0,o=e.children.length;i<o;i++){let a=e.children[i];if(a.visible||n.onlyVisible===!1){let u=this.processNode(a);u!==null&&r.push(u)}}r.length>0&&(t.nodes=r),this.serializeUserData(e,t)}processObjects(e){let s=new F;s.name="AuxScene";for(let n=0;n<e.length;n++)s.children.push(e[n]);this.processScene(s)}processInput(e){let s=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(t){t.beforeParse&&t.beforeParse(e)});let n=[];for(let t=0;t<e.length;t++)e[t]instanceof F?this.processScene(e[t]):n.push(e[t]);n.length>0&&this.processObjects(n);for(let t=0;t<this.skins.length;++t)this.processSkin(this.skins[t]);for(let t=0;t<s.animations.length;++t)this.processAnimation(s.animations[t],e[0]);this._invokeAll(function(t){t.afterParse&&t.afterParse(e)})}_invokeAll(e){for(let s=0,n=this.plugins.length;s<n;s++)e(this.plugins[s])}};T(se,"GLTFWriter");var G=se,te=class te{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,s){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}let n=this.writer,t=n.json,r=n.extensionsUsed,i={};e.name&&(i.name=e.name),i.color=e.color.toArray(),i.intensity=e.intensity,e.isDirectionalLight?i.type="directional":e.isPointLight?(i.type="point",e.distance>0&&(i.range=e.distance)):e.isSpotLight&&(i.type="spot",e.distance>0&&(i.range=e.distance),i.spot={},i.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,i.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),r[this.name]||(t.extensions=t.extensions||{},t.extensions[this.name]={lights:[]},r[this.name]=!0);let o=t.extensions[this.name].lights;o.push(i),s.extensions=s.extensions||{},s.extensions[this.name]={light:o.length-1}}};T(te,"GLTFLightExtension");var Y=te,ne=class ne{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,s){if(!e.isMeshBasicMaterial)return;let t=this.writer.extensionsUsed;s.extensions=s.extensions||{},s.extensions[this.name]={},t[this.name]=!0,s.pbrMetallicRoughness.metallicFactor=0,s.pbrMetallicRoughness.roughnessFactor=.9}};T(ne,"GLTFMaterialsUnlitExtension");var j=ne,ie=class ie{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;let n=this.writer,t=n.extensionsUsed,r={};if(r.clearcoatFactor=e.clearcoat,e.clearcoatMap){let i={index:n.processTexture(e.clearcoatMap)};n.applyTextureTransform(i,e.clearcoatMap),r.clearcoatTexture=i}if(r.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let i={index:n.processTexture(e.clearcoatRoughnessMap)};n.applyTextureTransform(i,e.clearcoatRoughnessMap),r.clearcoatRoughnessTexture=i}if(e.clearcoatNormalMap){let i={index:n.processTexture(e.clearcoatNormalMap)};n.applyTextureTransform(i,e.clearcoatNormalMap),r.clearcoatNormalTexture=i}s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(ie,"GLTFMaterialsClearcoatExtension");var K=ie,re=class re{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;let n=this.writer,t=n.extensionsUsed,r={};if(r.iridescenceFactor=e.iridescence,e.iridescenceMap){let i={index:n.processTexture(e.iridescenceMap)};n.applyTextureTransform(i,e.iridescenceMap),r.iridescenceTexture=i}if(r.iridescenceIor=e.iridescenceIOR,r.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],r.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let i={index:n.processTexture(e.iridescenceThicknessMap)};n.applyTextureTransform(i,e.iridescenceThicknessMap),r.iridescenceThicknessTexture=i}s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(re,"GLTFMaterialsIridescenceExtension");var q=re,oe=class oe{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,t=n.extensionsUsed,r={};if(r.transmissionFactor=e.transmission,e.transmissionMap){let i={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(i,e.transmissionMap),r.transmissionTexture=i}s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(oe,"GLTFMaterialsTransmissionExtension");var W=oe,ae=class ae{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,t=n.extensionsUsed,r={};if(r.thicknessFactor=e.thickness,e.thicknessMap){let i={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(i,e.thicknessMap),r.thicknessTexture=i}r.attenuationDistance=e.attenuationDistance,r.attenuationColor=e.attenuationColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(ae,"GLTFMaterialsVolumeExtension");var X=ae,ce=class ce{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;let t=this.writer.extensionsUsed,r={};r.ior=e.ior,s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(ce,"GLTFMaterialsIorExtension");var J=ce,ue=class ue{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(Fe)&&!e.specularIntensityMap&&!e.specularColorTexture)return;let n=this.writer,t=n.extensionsUsed,r={};if(e.specularIntensityMap){let i={index:n.processTexture(e.specularIntensityMap)};n.applyTextureTransform(i,e.specularIntensityMap),r.specularTexture=i}if(e.specularColorMap){let i={index:n.processTexture(e.specularColorMap)};n.applyTextureTransform(i,e.specularColorMap),r.specularColorTexture=i}r.specularFactor=e.specularIntensity,r.specularColorFactor=e.specularColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(ue,"GLTFMaterialsSpecularExtension");var Z=ue,le=class le{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;let n=this.writer,t=n.extensionsUsed,r={};if(e.sheenRoughnessMap){let i={index:n.processTexture(e.sheenRoughnessMap)};n.applyTextureTransform(i,e.sheenRoughnessMap),r.sheenRoughnessTexture=i}if(e.sheenColorMap){let i={index:n.processTexture(e.sheenColorMap)};n.applyTextureTransform(i,e.sheenColorMap),r.sheenColorTexture=i}r.sheenRoughnessFactor=e.sheenRoughness,r.sheenColorFactor=e.sheenColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(le,"GLTFMaterialsSheenExtension");var Q=le,fe=class fe{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,s){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;let t=this.writer.extensionsUsed,r={};r.emissiveStrength=e.emissiveIntensity,s.extensions=s.extensions||{},s.extensions[this.name]=r,t[this.name]=!0}};T(fe,"GLTFMaterialsEmissiveStrengthExtension");var $=fe;P.Utils={insertKeyframe:function(c,e){let n=c.getValueSize(),t=new c.TimeBufferType(c.times.length+1),r=new c.ValueBufferType(c.values.length+n),i=c.createInterpolant(new c.ValueBufferType(n)),o;if(c.times.length===0){t[0]=e;for(let a=0;a<n;a++)r[a]=0;o=0}else if(e<c.times[0]){if(Math.abs(c.times[0]-e)<.001)return 0;t[0]=e,t.set(c.times,1),r.set(i.evaluate(e),0),r.set(c.values,n),o=0}else if(e>c.times[c.times.length-1]){if(Math.abs(c.times[c.times.length-1]-e)<.001)return c.times.length-1;t[t.length-1]=e,t.set(c.times,0),r.set(c.values,0),r.set(i.evaluate(e),c.values.length),o=t.length-1}else for(let a=0;a<c.times.length;a++){if(Math.abs(c.times[a]-e)<.001)return a;if(c.times[a]<e&&c.times[a+1]>e){t.set(c.times.slice(0,a+1),0),t[a+1]=e,t.set(c.times.slice(a+1),a+2),r.set(c.values.slice(0,(a+1)*n),0),r.set(i.evaluate(e),(a+1)*n),r.set(c.values.slice((a+1)*n),(a+2)*n),o=a+1;break}}return c.times=t,c.values=r,o},mergeMorphTargetTracks:function(c,e){let s=[],n={},t=c.tracks;for(let r=0;r<t.length;++r){let i=t[r],o=v.parseTrackName(i.name),a=v.findNode(e,o.nodeName);if(o.propertyName!=="morphTargetInfluences"||o.propertyIndex===void 0){s.push(i);continue}if(i.createInterpolant!==i.InterpolantFactoryMethodDiscrete&&i.createInterpolant!==i.InterpolantFactoryMethodLinear){if(i.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),i=i.clone(),i.setInterpolation(Ne)}let u=a.morphTargetInfluences.length,d=a.morphTargetDictionary[o.propertyIndex];if(d===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+o.propertyIndex);let l;if(n[a.uuid]===void 0){l=i.clone();let f=new l.ValueBufferType(u*l.times.length);for(let p=0;p<l.times.length;p++)f[p*u+d]=l.values[p];l.name=(o.nodeName||"")+".morphTargetInfluences",l.values=f,n[a.uuid]=l,s.push(l);continue}let m=i.createInterpolant(new i.ValueBufferType(1));l=n[a.uuid];for(let f=0;f<l.times.length;f++)l.values[f*u+d]=m.evaluate(l.times[f]);for(let f=0;f<i.times.length;f++){let p=this.insertKeyframe(l,i.times[f]);l.values[p*u+d]=i.values[f]}}return c.tracks=s,c}};export{P as GLTFExporter};
@@ -1 +1 @@
1
- import{N as C}from"./chunk-SVP2SCIT.js";import{a as S}from"./chunk-VSBVGSLC.js";import{a as o,f as e}from"./chunk-J5IUISYU.js";S();var F,y,P=class P{constructor(t){e(this,"_currentStats",{fps:0,ms:0,mb:0});e(this,"view");e(this,"timer");e(this,"counter");e(this,"onFPSChangeArray");e(this,"onFPSChangeIndex");e(this,"lastFPS",0);e(this,"SECONDS_TO_DECIDE",3);e(this,"MIN_FPS",38);e(this,"CRITICAL_FPS",24);e(this,"MAX_FPS",120);e(this,"MAX_MS",200);e(this,"MAX_MB",(((y=(F=window.performance)==null?void 0:F.memory)==null?void 0:y.jsHeapSizeLimit)||1/0)/1048576);e(this,"updateMappedinDevtools",o(()=>{let t="__MAPPEDIN_DEVTOOLS__";window[t]=window[t]||{};let i=window[t];i.showPerformancePanelArray=i.showPerformancePanelArray||[],i.hidePerformancePanelArray=i.hidePerformancePanelArray||[],i.showPerformancePanelArray.push(()=>this.showPerformancePanel()),i.hidePerformancePanelArray.push(()=>this.hidePerformancePanel())},"updateMappedinDevtools"));let{MAX_FPS:i,MAX_MS:n,MAX_MB:a}=this,s={fps:i,ms:n,mb:a};this.view=new d(t.debug,t.container,s),this.timer=new c,this.counter=new u,this.onFPSChangeArray=t.onFPSChangeArray,this.onFPSChangeIndex=t.dynamicPerformance?t.onFPSChangeArray.length:-1,this.updateMappedinDevtools()}static getDefaultOnFPSChangeArray(t){let{effectComposer:i}=t.renderer.implementation;return[()=>{i==null||i.setAntialiasConfiguration({antialias:!1}),t.paths.pathSegments.forEach(({arrowAnimationTween:n})=>{n.stop()});for(let n in t.polygonMeshesById){let{material:a}=t.polygonMeshesById[n];a.map&&(a.map.anisotropy=1,a.needsUpdate=!0)}t.tryRendering()},()=>{i==null||i.setAmbientOcclusionConfiguration({aoEnabled:!1}),t.tryRendering()}]}updateStats(t){var n,a;let i=((a=(n=window.performance)==null?void 0:n.memory)==null?void 0:a.usedJSHeapSize)||0;this._currentStats.fps=Math.min(t,this.MAX_FPS),this._currentStats.ms=Math.min(1e3/t,this.MAX_MS),this._currentStats.mb=Math.min(i/1048576,this.MAX_MB),this.view.updatePanels(this._currentStats)}isFPSSpiked(t){return Math.abs(this.lastFPS-t)/this.lastFPS>.1}updateOnFPSChangeIndex(t,i){let n=this.onFPSChangeIndex;return i&&n>0?n=0:t&&(n=n-1),this.onFPSChangeIndex=C.clamp(n,-1,this.onFPSChangeArray.length),this.onFPSChangeIndex}handleFPSChange(t,i){let n=this.onFPSChangeIndex,a=this.updateOnFPSChangeIndex(t,i),s=this.onFPSChangeArray[a];!s||a===n||s(this.currentStats)}update(){let{fps:t,duration:i}=this.timer.update();if(i>=1e3){if(!this.isFPSSpiked(t)){let{lowFPS:n,criticalFPS:a}=this.counter.update(t,this.MIN_FPS,this.CRITICAL_FPS,this.SECONDS_TO_DECIDE);this.updateStats(t),this.handleFPSChange(n,a)}this.lastFPS=t,this.timer.reset()}}get currentStats(){return{...this._currentStats}}get dom(){return this.view.dom}hidePerformancePanel(){this.view.hidePerformancePanel()}showPerformancePanel(){this.view.showPerformancePanel()}};o(P,"PerformanceController");var b=P,m=class m{constructor(){e(this,"beginTime",performance.now());e(this,"frames",0);e(this,"duration",0)}reset(){this.duration=0,this.frames=0}update(){let t=performance.now(),i=t-this.beginTime;return this.frames++,this.duration+=i,this.beginTime=t,{duration:this.duration,fps:this.frames/(this.duration/1e3)}}};o(m,"PerformanceTimer");var c=m,f=class f{constructor(){e(this,"criticalFpsCounter",0);e(this,"lowFpsCounter",0);e(this,"highFpsCounter",0)}update(t,i,n,a){let s=t<i,h=t<n;return this.criticalFpsCounter=h?this.criticalFpsCounter+1:0,this.lowFpsCounter=s?this.lowFpsCounter+1:0,this.highFpsCounter=s?0:this.highFpsCounter+1,this.lowFpsCounter===a?(this.lowFpsCounter=0,this.criticalFpsCounter===a?(this.criticalFpsCounter=0,{lowFPS:!0,highFPS:!1,criticalFPS:!0}):{lowFPS:!0,highFPS:!1,criticalFPS:!1}):this.highFpsCounter===a?(this.highFpsCounter=0,{lowFPS:!1,highFPS:!0,criticalFPS:!1}):(s?this.highFpsCounter=0:(this.lowFpsCounter=0,this.criticalFpsCounter=0),{lowFPS:!1,highFPS:!1,criticalFPS:!1})}};o(f,"PerformanceCounter");var u=f,g=class g{constructor(t,i,n){e(this,"mode",-1);e(this,"panels",[]);e(this,"appContainer");e(this,"maxValues");e(this,"debug");e(this,"stats");e(this,"container");var a;this.debug=t,this.appContainer=i,this.maxValues=n,this.container=this.createContainer(),this.addPanel(new l({name:"FPS",foregroundColor:"#0ff",backgroundColor:"#002"})),this.addPanel(new l({name:"MS",foregroundColor:"#0f0",backgroundColor:"#020"})),(a=window.performance)!=null&&a.memory&&this.addPanel(new l({name:"MB",foregroundColor:"#f08",backgroundColor:"#201"})),this.debug&&this.showPerformancePanel()}createContainer(){let t=document.createElement("div");return t.style.cssText="position:absolute;top:0;right:0;cursor:pointer;opacity:0.9;z-index:10000",t.addEventListener("click",i=>{i.preventDefault(),this.showPanel(++this.mode%this.panels.length)}),t}addPanel(t){this.panels.push(t),this.container.appendChild(t.dom)}showPanel(t){this.panels.forEach((i,n)=>{i.dom.style.display=n===t?"block":"none"}),this.mode=t}hidePerformancePanel(){this.container.parentNode&&(this.debug=!1,this.appContainer.removeChild(this.container))}showPerformancePanel(){this.container.parentNode||(this.debug=!0,this.stats&&this.updatePanels(this.stats),this.appContainer.appendChild(this.container))}updatePanels(t){this.stats=t,this.debug&&this.panels.forEach((i,n)=>{n===0?i.update(t.fps,this.maxValues.fps):n===1?i.update(t.ms,this.maxValues.ms):n===2&&i.update(t.mb,this.maxValues.mb)})}get dom(){return this.container}};o(g,"PerformanceView");var d=g,v=class v{constructor(t){this.config=t;e(this,"min",1/0);e(this,"max",0);e(this,"canvas");e(this,"context");e(this,"PR",Math.round(window.devicePixelRatio||1));e(this,"WIDTH",80*this.PR);e(this,"HEIGHT",48*this.PR);e(this,"TEXT_X",3*this.PR);e(this,"TEXT_Y",2*this.PR);e(this,"GRAPH_X",3*this.PR);e(this,"GRAPH_Y",15*this.PR);e(this,"GRAPH_WIDTH",74*this.PR);e(this,"GRAPH_HEIGHT",30*this.PR);this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.setupCanvas()}setupCanvas(){this.canvas.dataset.name=this.config.name,this.canvas.width=this.WIDTH,this.canvas.height=this.HEIGHT,this.canvas.style.width="".concat(this.WIDTH/this.PR,"px"),this.canvas.style.height="".concat(this.HEIGHT/this.PR,"px"),this.context.font="bold ".concat(9*this.PR,"px Helvetica,Arial,sans-serif"),this.context.textBaseline="top",this.context.fillStyle=this.config.backgroundColor,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.config.foregroundColor,this.context.fillText(this.config.name,this.TEXT_X,this.TEXT_Y),this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=this.config.backgroundColor,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT)}get dom(){return this.canvas}update(t,i){this.min=Math.min(this.min,t),this.max=Math.max(this.max,t);let{context:n,WIDTH:a,GRAPH_Y:s,GRAPH_WIDTH:h,GRAPH_HEIGHT:p,PR:r}=this;n.fillStyle=this.config.backgroundColor,n.globalAlpha=1,n.fillRect(0,0,a,s),n.fillStyle=this.config.foregroundColor,n.fillText("".concat(Math.round(t)," ").concat(this.config.name," (").concat(Math.round(this.min),"-").concat(Math.round(this.max),")"),this.TEXT_X,this.TEXT_Y),n.drawImage(this.canvas,this.GRAPH_X+r,this.GRAPH_Y,h-r,p,this.GRAPH_X,this.GRAPH_Y,h-r,p),n.fillRect(this.GRAPH_X+h-r,this.GRAPH_Y,r,p),n.fillStyle=this.config.backgroundColor,n.globalAlpha=.9,n.fillRect(this.GRAPH_X+h-r,this.GRAPH_Y,r,Math.round((1-t/i)*p))}};o(v,"Panel");var l=v;export{b as PerformanceController,d as PerformanceView};
1
+ import{N as C}from"./chunk-RKURC6O7.js";import{a as S}from"./chunk-JJHKNDAJ.js";import{a as o,f as e}from"./chunk-J5IUISYU.js";S();var F,y,P=class P{constructor(t){e(this,"_currentStats",{fps:0,ms:0,mb:0});e(this,"view");e(this,"timer");e(this,"counter");e(this,"onFPSChangeArray");e(this,"onFPSChangeIndex");e(this,"lastFPS",0);e(this,"SECONDS_TO_DECIDE",3);e(this,"MIN_FPS",38);e(this,"CRITICAL_FPS",24);e(this,"MAX_FPS",120);e(this,"MAX_MS",200);e(this,"MAX_MB",(((y=(F=window.performance)==null?void 0:F.memory)==null?void 0:y.jsHeapSizeLimit)||1/0)/1048576);e(this,"updateMappedinDevtools",o(()=>{let t="__MAPPEDIN_DEVTOOLS__";window[t]=window[t]||{};let i=window[t];i.showPerformancePanelArray=i.showPerformancePanelArray||[],i.hidePerformancePanelArray=i.hidePerformancePanelArray||[],i.showPerformancePanelArray.push(()=>this.showPerformancePanel()),i.hidePerformancePanelArray.push(()=>this.hidePerformancePanel())},"updateMappedinDevtools"));let{MAX_FPS:i,MAX_MS:n,MAX_MB:a}=this,s={fps:i,ms:n,mb:a};this.view=new d(t.debug,t.container,s),this.timer=new c,this.counter=new u,this.onFPSChangeArray=t.onFPSChangeArray,this.onFPSChangeIndex=t.dynamicPerformance?t.onFPSChangeArray.length:-1,this.updateMappedinDevtools()}static getDefaultOnFPSChangeArray(t){let{effectComposer:i}=t.renderer.implementation;return[()=>{i==null||i.setAntialiasConfiguration({antialias:!1}),t.paths.pathSegments.forEach(({arrowAnimationTween:n})=>{n.stop()});for(let n in t.polygonMeshesById){let{material:a}=t.polygonMeshesById[n];a.map&&(a.map.anisotropy=1,a.needsUpdate=!0)}t.tryRendering()},()=>{i==null||i.setAmbientOcclusionConfiguration({aoEnabled:!1}),t.tryRendering()}]}updateStats(t){var n,a;let i=((a=(n=window.performance)==null?void 0:n.memory)==null?void 0:a.usedJSHeapSize)||0;this._currentStats.fps=Math.min(t,this.MAX_FPS),this._currentStats.ms=Math.min(1e3/t,this.MAX_MS),this._currentStats.mb=Math.min(i/1048576,this.MAX_MB),this.view.updatePanels(this._currentStats)}isFPSSpiked(t){return Math.abs(this.lastFPS-t)/this.lastFPS>.1}updateOnFPSChangeIndex(t,i){let n=this.onFPSChangeIndex;return i&&n>0?n=0:t&&(n=n-1),this.onFPSChangeIndex=C.clamp(n,-1,this.onFPSChangeArray.length),this.onFPSChangeIndex}handleFPSChange(t,i){let n=this.onFPSChangeIndex,a=this.updateOnFPSChangeIndex(t,i),s=this.onFPSChangeArray[a];!s||a===n||s(this.currentStats)}update(){let{fps:t,duration:i}=this.timer.update();if(i>=1e3){if(!this.isFPSSpiked(t)){let{lowFPS:n,criticalFPS:a}=this.counter.update(t,this.MIN_FPS,this.CRITICAL_FPS,this.SECONDS_TO_DECIDE);this.updateStats(t),this.handleFPSChange(n,a)}this.lastFPS=t,this.timer.reset()}}get currentStats(){return{...this._currentStats}}get dom(){return this.view.dom}hidePerformancePanel(){this.view.hidePerformancePanel()}showPerformancePanel(){this.view.showPerformancePanel()}};o(P,"PerformanceController");var b=P,m=class m{constructor(){e(this,"beginTime",performance.now());e(this,"frames",0);e(this,"duration",0)}reset(){this.duration=0,this.frames=0}update(){let t=performance.now(),i=t-this.beginTime;return this.frames++,this.duration+=i,this.beginTime=t,{duration:this.duration,fps:this.frames/(this.duration/1e3)}}};o(m,"PerformanceTimer");var c=m,f=class f{constructor(){e(this,"criticalFpsCounter",0);e(this,"lowFpsCounter",0);e(this,"highFpsCounter",0)}update(t,i,n,a){let s=t<i,h=t<n;return this.criticalFpsCounter=h?this.criticalFpsCounter+1:0,this.lowFpsCounter=s?this.lowFpsCounter+1:0,this.highFpsCounter=s?0:this.highFpsCounter+1,this.lowFpsCounter===a?(this.lowFpsCounter=0,this.criticalFpsCounter===a?(this.criticalFpsCounter=0,{lowFPS:!0,highFPS:!1,criticalFPS:!0}):{lowFPS:!0,highFPS:!1,criticalFPS:!1}):this.highFpsCounter===a?(this.highFpsCounter=0,{lowFPS:!1,highFPS:!0,criticalFPS:!1}):(s?this.highFpsCounter=0:(this.lowFpsCounter=0,this.criticalFpsCounter=0),{lowFPS:!1,highFPS:!1,criticalFPS:!1})}};o(f,"PerformanceCounter");var u=f,g=class g{constructor(t,i,n){e(this,"mode",-1);e(this,"panels",[]);e(this,"appContainer");e(this,"maxValues");e(this,"debug");e(this,"stats");e(this,"container");var a;this.debug=t,this.appContainer=i,this.maxValues=n,this.container=this.createContainer(),this.addPanel(new l({name:"FPS",foregroundColor:"#0ff",backgroundColor:"#002"})),this.addPanel(new l({name:"MS",foregroundColor:"#0f0",backgroundColor:"#020"})),(a=window.performance)!=null&&a.memory&&this.addPanel(new l({name:"MB",foregroundColor:"#f08",backgroundColor:"#201"})),this.debug&&this.showPerformancePanel()}createContainer(){let t=document.createElement("div");return t.style.cssText="position:absolute;top:0;right:0;cursor:pointer;opacity:0.9;z-index:10000",t.addEventListener("click",i=>{i.preventDefault(),this.showPanel(++this.mode%this.panels.length)}),t}addPanel(t){this.panels.push(t),this.container.appendChild(t.dom)}showPanel(t){this.panels.forEach((i,n)=>{i.dom.style.display=n===t?"block":"none"}),this.mode=t}hidePerformancePanel(){this.container.parentNode&&(this.debug=!1,this.appContainer.removeChild(this.container))}showPerformancePanel(){this.container.parentNode||(this.debug=!0,this.stats&&this.updatePanels(this.stats),this.appContainer.appendChild(this.container))}updatePanels(t){this.stats=t,this.debug&&this.panels.forEach((i,n)=>{n===0?i.update(t.fps,this.maxValues.fps):n===1?i.update(t.ms,this.maxValues.ms):n===2&&i.update(t.mb,this.maxValues.mb)})}get dom(){return this.container}};o(g,"PerformanceView");var d=g,v=class v{constructor(t){this.config=t;e(this,"min",1/0);e(this,"max",0);e(this,"canvas");e(this,"context");e(this,"PR",Math.round(window.devicePixelRatio||1));e(this,"WIDTH",80*this.PR);e(this,"HEIGHT",48*this.PR);e(this,"TEXT_X",3*this.PR);e(this,"TEXT_Y",2*this.PR);e(this,"GRAPH_X",3*this.PR);e(this,"GRAPH_Y",15*this.PR);e(this,"GRAPH_WIDTH",74*this.PR);e(this,"GRAPH_HEIGHT",30*this.PR);this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.setupCanvas()}setupCanvas(){this.canvas.dataset.name=this.config.name,this.canvas.width=this.WIDTH,this.canvas.height=this.HEIGHT,this.canvas.style.width="".concat(this.WIDTH/this.PR,"px"),this.canvas.style.height="".concat(this.HEIGHT/this.PR,"px"),this.context.font="bold ".concat(9*this.PR,"px Helvetica,Arial,sans-serif"),this.context.textBaseline="top",this.context.fillStyle=this.config.backgroundColor,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.config.foregroundColor,this.context.fillText(this.config.name,this.TEXT_X,this.TEXT_Y),this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=this.config.backgroundColor,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT)}get dom(){return this.canvas}update(t,i){this.min=Math.min(this.min,t),this.max=Math.max(this.max,t);let{context:n,WIDTH:a,GRAPH_Y:s,GRAPH_WIDTH:h,GRAPH_HEIGHT:p,PR:r}=this;n.fillStyle=this.config.backgroundColor,n.globalAlpha=1,n.fillRect(0,0,a,s),n.fillStyle=this.config.foregroundColor,n.fillText("".concat(Math.round(t)," ").concat(this.config.name," (").concat(Math.round(this.min),"-").concat(Math.round(this.max),")"),this.TEXT_X,this.TEXT_Y),n.drawImage(this.canvas,this.GRAPH_X+r,this.GRAPH_Y,h-r,p,this.GRAPH_X,this.GRAPH_Y,h-r,p),n.fillRect(this.GRAPH_X+h-r,this.GRAPH_Y,r,p),n.fillStyle=this.config.backgroundColor,n.globalAlpha=.9,n.fillRect(this.GRAPH_X+h-r,this.GRAPH_Y,r,Math.round((1-t/i)*p))}};o(v,"Panel");var l=v;export{b as PerformanceController,d as PerformanceView};
@@ -1 +1 @@
1
- import{a as hn}from"./chunk-VSBVGSLC.js";import{a as u}from"./chunk-J5IUISYU.js";hn();var ln={},Qn=u(function(n,r,t,e,i){var a=new Worker(ln[r]||(ln[r]=URL.createObjectURL(new Blob([n+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(o){var f=o.data,v=f.$e$;if(v){var s=new Error(v[0]);s.code=v[1],s.stack=v[2],i(s,null)}else i(null,f)},a.postMessage(t,e),a},"wk"),D=Uint8Array,q=Uint16Array,gr=Uint32Array,yr=new D([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),wr=new D([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ur=new D([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xn=u(function(n,r){for(var t=new q(31),e=0;e<31;++e)t[e]=r+=1<<n[e-1];for(var i=new gr(t[30]),e=1;e<30;++e)for(var a=t[e];a<t[e+1];++a)i[a]=a-t[e]<<5|e;return[t,i]},"freb"),zn=xn(yr,2),dr=zn[0],Or=zn[1];dr[28]=258,Or[258]=28;var An=xn(wr,0),Mn=An[0],Yr=An[1],Dr=new q(32768);for(E=0;E<32768;++E)tr=(E&43690)>>>1|(E&21845)<<1,tr=(tr&52428)>>>2|(tr&13107)<<2,tr=(tr&61680)>>>4|(tr&3855)<<4,Dr[E]=((tr&65280)>>>8|(tr&255)<<8)>>>1;var tr,E,X=u(function(n,r,t){for(var e=n.length,i=0,a=new q(r);i<e;++i)n[i]&&++a[n[i]-1];var o=new q(r);for(i=0;i<r;++i)o[i]=o[i-1]+a[i-1]<<1;var f;if(t){f=new q(1<<r);var v=15-r;for(i=0;i<e;++i)if(n[i])for(var s=i<<4|n[i],h=r-n[i],c=o[n[i]-1]++<<h,y=c|(1<<h)-1;c<=y;++c)f[Dr[c]>>>v]=s}else for(f=new q(e),i=0;i<e;++i)n[i]&&(f[i]=Dr[o[n[i]-1]++]>>>15-n[i]);return f},"hMap"),ir=new D(288);for(E=0;E<144;++E)ir[E]=8;var E;for(E=144;E<256;++E)ir[E]=9;var E;for(E=256;E<280;++E)ir[E]=7;var E;for(E=280;E<288;++E)ir[E]=8;var E,cr=new D(32);for(E=0;E<32;++E)cr[E]=5;var E,Tn=X(ir,9,0),Un=X(ir,9,1),Dn=X(cr,5,0),Sn=X(cr,5,1),Zr=u(function(n){for(var r=n[0],t=1;t<n.length;++t)n[t]>r&&(r=n[t]);return r},"max"),V=u(function(n,r,t){var e=r/8|0;return(n[e]|n[e+1]<<8)>>(r&7)&t},"bits"),kr=u(function(n,r){var t=r/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(r&7)},"bits16"),Sr=u(function(n){return(n+7)/8|0},"shft"),d=u(function(n,r,t){(r==null||r<0)&&(r=0),(t==null||t>n.length)&&(t=n.length);var e=new(n.BYTES_PER_ELEMENT==2?q:n.BYTES_PER_ELEMENT==4?gr:D)(t-r);return e.set(n.subarray(r,t)),e},"slc"),at={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},Cn=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],g=u(function(n,r,t){var e=new Error(r||Cn[n]);if(e.code=n,Error.captureStackTrace&&Error.captureStackTrace(e,g),!t)throw e;return e},"err"),Cr=u(function(n,r,t){var e=n.length;if(!e||t&&t.f&&!t.l)return r||new D(0);var i=!r||t,a=!t||t.i;t||(t={}),r||(r=new D(e*3));var o=u(function(Ir){var Tr=r.length;if(Ir>Tr){var vr=new D(Math.max(Tr*2,Ir));vr.set(r),r=vr}},"cbuf"),f=t.f||0,v=t.p||0,s=t.b||0,h=t.l,c=t.d,y=t.m,z=t.n,w=e*8;do{if(!h){f=V(n,v,1);var x=V(n,v+1,3);if(v+=3,x)if(x==1)h=Un,c=Sn,y=9,z=5;else if(x==2){var U=V(n,v,31)+257,m=V(n,v+10,15)+4,B=U+V(n,v+5,31)+1;v+=14;for(var C=new D(B),M=new D(19),p=0;p<m;++p)M[Ur[p]]=V(n,v+p*3,7);v+=m*3;for(var P=Zr(M),S=(1<<P)-1,R=X(M,P,1),p=0;p<B;){var O=R[V(n,v,S)];v+=O&15;var l=O>>>4;if(l<16)C[p++]=l;else{var k=0,F=0;for(l==16?(F=3+V(n,v,3),v+=2,k=C[p-1]):l==17?(F=3+V(n,v,7),v+=3):l==18&&(F=11+V(n,v,127),v+=7);F--;)C[p++]=k}}var L=C.subarray(0,U),Z=C.subarray(U);y=Zr(L),z=Zr(Z),h=X(L,y,1),c=X(Z,z,1)}else g(1);else{var l=Sr(v)+4,A=n[l-4]|n[l-3]<<8,T=l+A;if(T>e){a&&g(0);break}i&&o(s+A),r.set(n.subarray(l,T),s),t.b=s+=A,t.p=v=T*8,t.f=f;continue}if(v>w){a&&g(0);break}}i&&o(s+131072);for(var G=(1<<y)-1,H=(1<<z)-1,j=v;;j=v){var k=h[kr(n,v)&G],Q=k>>>4;if(v+=k&15,v>w){a&&g(0);break}if(k||g(2),Q<256)r[s++]=Q;else if(Q==256){j=v,h=null;break}else{var Y=Q-254;if(Q>264){var p=Q-257,_=yr[p];Y=V(n,v,(1<<_)-1)+dr[p],v+=_}var rr=c[kr(n,v)&H],J=rr>>>4;rr||g(3),v+=rr&15;var Z=Mn[J];if(J>3){var _=wr[J];Z+=kr(n,v)&(1<<_)-1,v+=_}if(v>w){a&&g(0);break}i&&o(s+131072);for(var $=s+Y;s<$;s+=4)r[s]=r[s-Z],r[s+1]=r[s+1-Z],r[s+2]=r[s+2-Z],r[s+3]=r[s+3-Z];s=$}}t.l=h,t.p=j,t.b=s,t.f=f,h&&(f=1,t.m=y,t.d=c,t.n=z)}while(!f);return s==r.length?r:d(r,0,s)},"inflt"),nr=u(function(n,r,t){t<<=r&7;var e=r/8|0;n[e]|=t,n[e+1]|=t>>>8},"wbits"),hr=u(function(n,r,t){t<<=r&7;var e=r/8|0;n[e]|=t,n[e+1]|=t>>>8,n[e+2]|=t>>>16},"wbits16"),Gr=u(function(n,r){for(var t=[],e=0;e<n.length;++e)n[e]&&t.push({s:e,f:n[e]});var i=t.length,a=t.slice();if(!i)return[er,0];if(i==1){var o=new D(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(B,C){return B.f-C.f}),t.push({s:-1,f:25001});var f=t[0],v=t[1],s=0,h=1,c=2;for(t[0]={s:-1,f:f.f+v.f,l:f,r:v};h!=i-1;)f=t[t[s].f<t[c].f?s++:c++],v=t[s!=h&&t[s].f<t[c].f?s++:c++],t[h++]={s:-1,f:f.f+v.f,l:f,r:v};for(var y=a[0].s,e=1;e<i;++e)a[e].s>y&&(y=a[e].s);var z=new q(y+1),w=Lr(t[h-1],z,0);if(w>r){var e=0,x=0,l=w-r,A=1<<l;for(a.sort(function(C,M){return z[M.s]-z[C.s]||C.f-M.f});e<i;++e){var T=a[e].s;if(z[T]>r)x+=A-(1<<w-z[T]),z[T]=r;else break}for(x>>>=l;x>0;){var U=a[e].s;z[U]<r?x-=1<<r-z[U]++-1:++e}for(;e>=0&&x;--e){var m=a[e].s;z[m]==r&&(--z[m],++x)}w=r}return[new D(z),w]},"hTree"),Lr=u(function(n,r,t){return n.s==-1?Math.max(Lr(n.l,r,t+1),Lr(n.r,r,t+1)):r[n.s]=t},"ln"),Wr=u(function(n){for(var r=n.length;r&&!n[--r];);for(var t=new q(++r),e=0,i=n[0],a=1,o=u(function(v){t[e++]=v},"w"),f=1;f<=r;++f)if(n[f]==i&&f!=r)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=n[f]}return[t.subarray(0,e),r]},"lc"),lr=u(function(n,r){for(var t=0,e=0;e<r.length;++e)t+=n[e]*r[e];return t},"clen"),Pr=u(function(n,r,t){var e=t.length,i=Sr(r+2);n[i]=e&255,n[i+1]=e>>>8,n[i+2]=n[i]^255,n[i+3]=n[i+1]^255;for(var a=0;a<e;++a)n[i+a+4]=t[a];return(i+4+e)*8},"wfblk"),jr=u(function(n,r,t,e,i,a,o,f,v,s,h){nr(r,h++,t),++i[256];for(var c=Gr(i,15),y=c[0],z=c[1],w=Gr(a,15),x=w[0],l=w[1],A=Wr(y),T=A[0],U=A[1],m=Wr(x),B=m[0],C=m[1],M=new q(19),p=0;p<T.length;++p)M[T[p]&31]++;for(var p=0;p<B.length;++p)M[B[p]&31]++;for(var P=Gr(M,7),S=P[0],R=P[1],O=19;O>4&&!S[Ur[O-1]];--O);var k=s+5<<3,F=lr(i,ir)+lr(a,cr)+o,L=lr(i,y)+lr(a,x)+o+14+3*O+lr(M,S)+(2*M[16]+3*M[17]+7*M[18]);if(k<=F&&k<=L)return Pr(r,h,n.subarray(v,v+s));var Z,G,H,j;if(nr(r,h,1+(L<F)),h+=2,L<F){Z=X(y,z,0),G=y,H=X(x,l,0),j=x;var Q=X(S,R,0);nr(r,h,U-257),nr(r,h+5,C-1),nr(r,h+10,O-4),h+=14;for(var p=0;p<O;++p)nr(r,h+3*p,S[Ur[p]]);h+=3*O;for(var Y=[T,B],_=0;_<2;++_)for(var rr=Y[_],p=0;p<rr.length;++p){var J=rr[p]&31;nr(r,h,Q[J]),h+=S[J],J>15&&(nr(r,h,rr[p]>>>5&127),h+=rr[p]>>>12)}}else Z=Tn,G=ir,H=Dn,j=cr;for(var p=0;p<f;++p)if(e[p]>255){var J=e[p]>>>18&31;hr(r,h,Z[J+257]),h+=G[J+257],J>7&&(nr(r,h,e[p]>>>23&31),h+=yr[J]);var $=e[p]&31;hr(r,h,H[$]),h+=j[$],$>3&&(hr(r,h,e[p]>>>5&8191),h+=wr[$])}else hr(r,h,Z[e[p]]),h+=G[e[p]];return hr(r,h,Z[256]),h+G[256]},"wblk"),En=new gr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),er=new D(0),Fn=u(function(n,r,t,e,i,a){var o=n.length,f=new D(e+o+5*(1+Math.ceil(o/7e3))+i),v=f.subarray(e,f.length-i),s=0;if(!r||o<8)for(var h=0;h<=o;h+=65535){var c=h+65535;c>=o&&(v[s>>3]=a),s=Pr(v,s+1,n.subarray(h,c))}else{for(var y=En[r-1],z=y>>>13,w=y&8191,x=(1<<t)-1,l=new q(32768),A=new q(x+1),T=Math.ceil(t/3),U=2*T,m=u(function(qr){return(n[qr]^n[qr+1]<<T^n[qr+2]<<U)&x},"hsh"),B=new gr(25e3),C=new q(288),M=new q(32),p=0,P=0,h=0,S=0,R=0,O=0;h<o;++h){var k=m(h),F=h&32767,L=A[k];if(l[F]=L,A[k]=F,R<=h){var Z=o-h;if((p>7e3||S>24576)&&Z>423){s=jr(n,v,0,B,C,M,P,S,O,h-O,s),S=p=P=0,O=h;for(var G=0;G<286;++G)C[G]=0;for(var G=0;G<30;++G)M[G]=0}var H=2,j=0,Q=w,Y=F-L&32767;if(Z>2&&k==m(h-Y))for(var _=Math.min(z,Z)-1,rr=Math.min(32767,h),J=Math.min(258,Z);Y<=rr&&--Q&&F!=L;){if(n[h+H]==n[h+H-Y]){for(var $=0;$<J&&n[h+$]==n[h+$-Y];++$);if($>H){if(H=$,j=Y,$>_)break;for(var Ir=Math.min(Y,$-2),Tr=0,G=0;G<Ir;++G){var vr=h-Y+G+32768&32767,Kn=l[vr],sn=vr-Kn+32768&32767;sn>Tr&&(Tr=sn,L=vr)}}}F=L,L=l[F],Y+=F-L+32768&32767}if(j){B[S++]=268435456|Or[H]<<18|Yr[j];var un=Or[H]&31,vn=Yr[j]&31;P+=yr[un]+wr[vn],++C[257+un],++M[vn],R=h+H,++p}else B[S++]=n[h],++C[n[h]]}}s=jr(n,v,a,B,C,M,P,S,O,h-O,s),!a&&s&7&&(s=Pr(v,s+1,er))}return d(f,0,e+Sr(s)+i)},"dflt"),In=function(){for(var n=new Int32Array(256),r=0;r<256;++r){for(var t=r,e=9;--e;)t=(t&1&&-306674912)^t>>>1;n[r]=t}return n}(),mr=u(function(){var n=-1;return{p:function(r){for(var t=n,e=0;e<r.length;++e)t=In[t&255^r[e]]^t>>>8;n=t},d:function(){return~n}}},"crc"),br=u(function(){var n=1,r=0;return{p:function(t){for(var e=n,i=r,a=t.length|0,o=0;o!=a;){for(var f=Math.min(o+2655,a);o<f;++o)i+=e+=t[o];e=(e&65535)+15*(e>>16),i=(i&65535)+15*(i>>16)}n=e,r=i},d:function(){return n%=65521,r%=65521,(n&255)<<24|n>>>8<<16|(r&255)<<8|r>>>8}}},"adler"),ur=u(function(n,r,t,e,i){return Fn(n,r.level==null?6:r.level,r.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):12+r.mem,t,e,!i)},"dopt"),Er=u(function(n,r){var t={};for(var e in n)t[e]=n[e];for(var e in r)t[e]=r[e];return t},"mrg"),cn=u(function(n,r,t){for(var e=n(),i=n.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<e.length;++o){var f=e[o],v=a[o];if(typeof f=="function"){r+=";"+v+"=";var s=f.toString();if(f.prototype)if(s.indexOf("[native code]")!=-1){var h=s.indexOf(" ",8)+1;r+=s.slice(h,s.indexOf("(",h))}else{r+=s;for(var c in f.prototype)r+=";"+v+".prototype."+c+"="+f.prototype[c].toString()}else r+=s}else t[v]=f}return[r,t]},"wcln"),Br=[],Vn=u(function(n){var r=[];for(var t in n)n[t].buffer&&r.push((n[t]=new n[t].constructor(n[t])).buffer);return r},"cbfs"),Bn=u(function(n,r,t,e){var i;if(!Br[t]){for(var a="",o={},f=n.length-1,v=0;v<f;++v)i=cn(n[v],a,o),a=i[0],o=i[1];Br[t]=cn(n[f],a,o)}var s=Er({},Br[t][1]);return Qn(Br[t][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+r.toString()+"}",t,s,Vn(s),e)},"wrkr"),xr=u(function(){return[D,q,gr,yr,wr,Ur,dr,Mn,Un,Sn,Dr,Cn,X,Zr,V,kr,Sr,d,g,Cr,Fr,fr,_r]},"bInflt"),zr=u(function(){return[D,q,gr,yr,wr,Ur,Or,Yr,Tn,ir,Dn,cr,Dr,En,er,X,nr,hr,Gr,Lr,Wr,lr,Pr,jr,Sr,d,Fn,ur,$r,fr]},"bDflt"),Zn=u(function(){return[rn,tn,I,mr,In]},"gze"),kn=u(function(){return[nn,Ln]},"guze"),Gn=u(function(){return[en,I,br]},"zle"),On=u(function(){return[Pn]},"zule"),fr=u(function(n){return postMessage(n,[n.buffer])},"pbf"),_r=u(function(n){return n&&n.size&&new D(n.size)},"gu8"),Ar=u(function(n,r,t,e,i,a){var o=Bn(t,e,i,function(f,v){o.terminate(),a(f,v)});return o.postMessage([n,r],r.consume?[n.buffer]:[]),function(){o.terminate()}},"cbify"),b=u(function(n){return n.ondata=function(r,t){return postMessage([r,t],[r.buffer])},function(r){return n.push(r.data[0],r.data[1])}},"astrm"),Mr=u(function(n,r,t,e,i){var a,o=Bn(n,e,i,function(f,v){f?(o.terminate(),r.ondata.call(r,f)):(v[1]&&o.terminate(),r.ondata.call(r,f,v[0],v[1]))});o.postMessage(t),r.push=function(f,v){r.ondata||g(5),a&&r.ondata(g(4,0,1),null,!!v),o.postMessage([f,a=v],[f.buffer])},r.terminate=function(){o.terminate()}},"astrmify"),W=u(function(n,r){return n[r]|n[r+1]<<8},"b2"),N=u(function(n,r){return(n[r]|n[r+1]<<8|n[r+2]<<16|n[r+3]<<24)>>>0},"b4"),Hr=u(function(n,r){return N(n,r)+N(n,r+4)*4294967296},"b8"),I=u(function(n,r,t){for(;t;++r)n[r]=t,t>>>=8},"wbytes"),rn=u(function(n,r){var t=r.filename;if(n[0]=31,n[1]=139,n[2]=8,n[8]=r.level<2?4:r.level==9?2:0,n[9]=3,r.mtime!=0&&I(n,4,Math.floor(new Date(r.mtime||Date.now())/1e3)),t){n[3]=8;for(var e=0;e<=t.length;++e)n[e+10]=t.charCodeAt(e)}},"gzh"),nn=u(function(n){(n[0]!=31||n[1]!=139||n[2]!=8)&&g(6,"invalid gzip data");var r=n[3],t=10;r&4&&(t+=n[10]|(n[11]<<8)+2);for(var e=(r>>3&1)+(r>>4&1);e>0;e-=!n[t++]);return t+(r&2)},"gzs"),Ln=u(function(n){var r=n.length;return(n[r-4]|n[r-3]<<8|n[r-2]<<16|n[r-1]<<24)>>>0},"gzl"),tn=u(function(n){return 10+(n.filename&&n.filename.length+1||0)},"gzhl"),en=u(function(n,r){var t=r.level,e=t==0?0:t<6?1:t==9?3:2;n[0]=120,n[1]=e<<6|(e?32-2*e:1)},"zlh"),Pn=u(function(n){((n[0]&15)!=8||n[0]>>>4>7||(n[0]<<8|n[1])%31)&&g(6,"invalid zlib data"),n[1]&32&&g(6,"invalid zlib data: preset dictionaries not supported")},"zlv");function an(n,r){return!r&&typeof n=="function"&&(r=n,n={}),this.ondata=r,n}u(an,"AsyncCmpStrm");var ar=function(){function n(r,t){!t&&typeof r=="function"&&(t=r,r={}),this.ondata=t,this.o=r||{}}return u(n,"Deflate"),n.prototype.p=function(r,t){this.ondata(ur(r,this.o,0,0,!t),t)},n.prototype.push=function(r,t){this.ondata||g(5),this.d&&g(4),this.d=t,this.p(r,t||!1)},n}();var Xn=function(){function n(r,t){Mr([zr,function(){return[b,ar]}],this,an.call(this,r,t),function(e){var i=new ar(e.data);onmessage=b(i)},6)}return u(n,"AsyncDeflate"),n}();function dn(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[zr],function(e){return fr($r(e.data[0],e.data[1]))},0,t)}u(dn,"deflate");function $r(n,r){return ur(n,r||{},0,0)}u($r,"deflateSync");var K=function(){function n(r){this.s={},this.p=new D(0),this.ondata=r}return u(n,"Inflate"),n.prototype.e=function(r){this.ondata||g(5),this.d&&g(4);var t=this.p.length,e=new D(t+r.length);e.set(this.p),e.set(r,t),this.p=e},n.prototype.c=function(r){this.d=this.s.i=r||!1;var t=this.s.b,e=Cr(this.p,this.o,this.s);this.ondata(d(e,t,this.s.b),this.d),this.o=d(e,this.s.b-32768),this.s.b=this.o.length,this.p=d(this.p,this.s.p/8|0),this.s.p&=7},n.prototype.push=function(r,t){this.e(r),this.c(t)},n}();var Nn=function(){function n(r){this.ondata=r,Mr([xr,function(){return[b,K]}],this,0,function(){var t=new K;onmessage=b(t)},7)}return u(n,"AsyncInflate"),n}();function Rn(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[xr],function(e){return fr(Fr(e.data[0],_r(e.data[1])))},1,t)}u(Rn,"inflate");function Fr(n,r){return Cr(n,r)}u(Fr,"inflateSync");var pn=function(){function n(r,t){this.c=mr(),this.l=0,this.v=1,ar.call(this,r,t)}return u(n,"Gzip"),n.prototype.push=function(r,t){ar.prototype.push.call(this,r,t)},n.prototype.p=function(r,t){this.c.p(r),this.l+=r.length;var e=ur(r,this.o,this.v&&tn(this.o),t&&8,!t);this.v&&(rn(e,this.o),this.v=0),t&&(I(e,e.length-8,this.c.d()),I(e,e.length-4,this.l)),this.ondata(e,t)},n}();var ot=function(){function n(r,t){Mr([zr,Zn,function(){return[b,ar,pn]}],this,an.call(this,r,t),function(e){var i=new pn(e.data);onmessage=b(i)},8)}return u(n,"AsyncGzip"),n}();function ft(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[zr,Zn,function(){return[gn]}],function(e){return fr(gn(e.data[0],e.data[1]))},2,t)}u(ft,"gzip");function gn(n,r){r||(r={});var t=mr(),e=n.length;t.p(n);var i=ur(n,r,tn(r),8),a=i.length;return rn(i,r),I(i,a-8,t.d()),I(i,a-4,e),i}u(gn,"gzipSync");var Jr=function(){function n(r){this.v=1,K.call(this,r)}return u(n,"Gunzip"),n.prototype.push=function(r,t){if(K.prototype.e.call(this,r),this.v){var e=this.p.length>3?nn(this.p):4;if(e>=this.p.length&&!t)return;this.p=this.p.subarray(e),this.v=0}t&&(this.p.length<8&&g(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),K.prototype.c.call(this,t)},n}();var bn=function(){function n(r){this.ondata=r,Mr([xr,kn,function(){return[b,K,Jr]}],this,0,function(){var t=new Jr;onmessage=b(t)},9)}return u(n,"AsyncGunzip"),n}();function _n(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[xr,kn,function(){return[Kr]}],function(e){return fr(Kr(e.data[0]))},3,t)}u(_n,"gunzip");function Kr(n,r){return Cr(n.subarray(nn(n),-8),r||new D(Ln(n)))}u(Kr,"gunzipSync");var yn=function(){function n(r,t){this.c=br(),this.v=1,ar.call(this,r,t)}return u(n,"Zlib"),n.prototype.push=function(r,t){ar.prototype.push.call(this,r,t)},n.prototype.p=function(r,t){this.c.p(r);var e=ur(r,this.o,this.v&&2,t&&4,!t);this.v&&(en(e,this.o),this.v=0),t&&I(e,e.length-4,this.c.d()),this.ondata(e,t)},n}();var st=function(){function n(r,t){Mr([zr,Gn,function(){return[b,ar,yn]}],this,an.call(this,r,t),function(e){var i=new yn(e.data);onmessage=b(i)},10)}return u(n,"AsyncZlib"),n}();function ut(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[zr,Gn,function(){return[wn]}],function(e){return fr(wn(e.data[0],e.data[1]))},4,t)}u(ut,"zlib");function wn(n,r){r||(r={});var t=br();t.p(n);var e=ur(n,r,2,4);return en(e,r),I(e,e.length-4,t.d()),e}u(wn,"zlibSync");var Qr=function(){function n(r){this.v=1,K.call(this,r)}return u(n,"Unzlib"),n.prototype.push=function(r,t){if(K.prototype.e.call(this,r),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}t&&(this.p.length<4&&g(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),K.prototype.c.call(this,t)},n}();var rt=function(){function n(r){this.ondata=r,Mr([xr,On,function(){return[b,K,Qr]}],this,0,function(){var t=new Qr;onmessage=b(t)},11)}return u(n,"AsyncUnzlib"),n}();function nt(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[xr,On,function(){return[Vr]}],function(e){return fr(Vr(e.data[0],_r(e.data[1])))},5,t)}u(nt,"unzlib");function Vr(n,r){return Cr((Pn(n),n.subarray(2,-4)),r)}u(Vr,"unzlibSync");var tt=function(){function n(r){this.G=Jr,this.I=K,this.Z=Qr,this.ondata=r}return u(n,"Decompress"),n.prototype.push=function(r,t){if(this.ondata||g(5),this.s)this.s.push(r,t);else{if(this.p&&this.p.length){var e=new D(this.p.length+r.length);e.set(this.p),e.set(r,this.p.length)}else this.p=r;if(this.p.length>2){var i=this,a=u(function(){i.ondata.apply(i,arguments)},"cb");this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(a):(this.p[0]&15)!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(a):new this.Z(a),this.s.push(this.p,t),this.p=null}}},n}();var vt=function(){function n(r){this.G=bn,this.I=Nn,this.Z=rt,this.ondata=r}return u(n,"AsyncDecompress"),n.prototype.push=function(r,t){tt.prototype.push.call(this,r,t)},n}();function ht(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),n[0]==31&&n[1]==139&&n[2]==8?_n(n,r,t):(n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31?Rn(n,r,t):nt(n,r,t)}u(ht,"decompress");function lt(n,r){return n[0]==31&&n[1]==139&&n[2]==8?Kr(n,r):(n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31?Fr(n,r):Vr(n,r)}u(lt,"decompressSync");var on=u(function(n,r,t,e){for(var i in n){var a=n[i],o=r+i,f=e;Array.isArray(a)&&(f=Er(e,a[1]),a=a[0]),a instanceof D?t[o]=[a,f]:(t[o+="/"]=[new D(0),f],on(a,o,t,e))}},"fltn"),mn=typeof TextEncoder<"u"&&new TextEncoder,Xr=typeof TextDecoder<"u"&&new TextDecoder,$n=0;try{Xr.decode(er,{stream:!0}),$n=1}catch{}var qn=u(function(n){for(var r="",t=0;;){var e=n[t++],i=(e>127)+(e>223)+(e>239);if(t+i>n.length)return[r,d(n,t-1)];i?i==3?(e=((e&15)<<18|(n[t++]&63)<<12|(n[t++]&63)<<6|n[t++]&63)-65536,r+=String.fromCharCode(55296|e>>10,56320|e&1023)):i&1?r+=String.fromCharCode((e&31)<<6|n[t++]&63):r+=String.fromCharCode((e&15)<<12|(n[t++]&63)<<6|n[t++]&63):r+=String.fromCharCode(e)}},"dutf8"),ct=function(){function n(r){this.ondata=r,$n?this.t=new TextDecoder:this.p=er}return u(n,"DecodeUTF8"),n.prototype.push=function(r,t){if(this.ondata||g(5),t=!!t,this.t){this.ondata(this.t.decode(r,{stream:!0}),t),t&&(this.t.decode().length&&g(8),this.t=null);return}this.p||g(4);var e=new D(this.p.length+r.length);e.set(this.p),e.set(r,this.p.length);var i=qn(e),a=i[0],o=i[1];t?(o.length&&g(8),this.p=null):this.p=o,this.ondata(a,t)},n}();var pt=function(){function n(r){this.ondata=r}return u(n,"EncodeUTF8"),n.prototype.push=function(r,t){this.ondata||g(5),this.d&&g(4),this.ondata(sr(r),this.d=t||!1)},n}();function sr(n,r){if(r){for(var t=new D(n.length),e=0;e<n.length;++e)t[e]=n.charCodeAt(e);return t}if(mn)return mn.encode(n);for(var i=n.length,a=new D(n.length+(n.length>>1)),o=0,f=u(function(h){a[o++]=h},"w"),e=0;e<i;++e){if(o+5>a.length){var v=new D(o+8+(i-e<<1));v.set(a),a=v}var s=n.charCodeAt(e);s<128||r?f(s):s<2048?(f(192|s>>6),f(128|s&63)):s>55295&&s<57344?(s=65536+(s&1047552)|n.charCodeAt(++e)&1023,f(240|s>>18),f(128|s>>12&63),f(128|s>>6&63),f(128|s&63)):(f(224|s>>12),f(128|s>>6&63),f(128|s&63))}return d(a,0,o)}u(sr,"strToU8");function Hn(n,r){if(r){for(var t="",e=0;e<n.length;e+=16384)t+=String.fromCharCode.apply(null,n.subarray(e,e+16384));return t}else{if(Xr)return Xr.decode(n);var i=qn(n),a=i[0],o=i[1];return o.length&&g(8),a}}u(Hn,"strFromU8");var Yn=u(function(n){return n==1?3:n<6?2:n==9?1:0},"dbf"),Wn=u(function(n,r){return r+30+W(n,r+26)+W(n,r+28)},"slzh"),jn=u(function(n,r,t){var e=W(n,r+28),i=Hn(n.subarray(r+46,r+46+e),!(W(n,r+8)&2048)),a=r+46+e,o=N(n,r+20),f=t&&o==4294967295?Jn(n,a):[o,N(n,r+24),N(n,r+42)],v=f[0],s=f[1],h=f[2];return[W(n,r+10),v,s,i,a+W(n,r+30)+W(n,r+32),h]},"zh"),Jn=u(function(n,r){for(;W(n,r)!=1;r+=4+W(n,r+2));return[Hr(n,r+12),Hr(n,r+4),Hr(n,r+20)]},"z64e"),or=u(function(n){var r=0;if(n)for(var t in n){var e=n[t].length;e>65535&&g(9),r+=e+4}return r},"exfl"),pr=u(function(n,r,t,e,i,a,o,f){var v=e.length,s=t.extra,h=f&&f.length,c=or(s);I(n,r,o!=null?33639248:67324752),r+=4,o!=null&&(n[r++]=20,n[r++]=t.os),n[r]=20,r+=2,n[r++]=t.flag<<1|(a==null&&8),n[r++]=i&&8,n[r++]=t.compression&255,n[r++]=t.compression>>8;var y=new Date(t.mtime==null?Date.now():t.mtime),z=y.getFullYear()-1980;if((z<0||z>119)&&g(10),I(n,r,z<<25|y.getMonth()+1<<21|y.getDate()<<16|y.getHours()<<11|y.getMinutes()<<5|y.getSeconds()>>>1),r+=4,a!=null&&(I(n,r,t.crc),I(n,r+4,a),I(n,r+8,t.size)),I(n,r+12,v),I(n,r+14,c),r+=16,o!=null&&(I(n,r,h),I(n,r+6,t.attrs),I(n,r+10,o),r+=14),n.set(e,r),r+=v,c)for(var w in s){var x=s[w],l=x.length;I(n,r,+w),I(n,r+2,l),n.set(x,r+4),r+=4+l}return h&&(n.set(f,r),r+=h),r},"wzh"),fn=u(function(n,r,t,e,i){I(n,r,101010256),I(n,r+8,t),I(n,r+10,t),I(n,r+12,e),I(n,r+16,i)},"wzf"),Nr=function(){function n(r){this.filename=r,this.c=mr(),this.size=0,this.compression=0}return u(n,"ZipPassThrough"),n.prototype.process=function(r,t){this.ondata(null,r,t)},n.prototype.push=function(r,t){this.ondata||g(5),this.c.p(r),this.size+=r.length,t&&(this.crc=this.c.d()),this.process(r,t||!1)},n}();var gt=function(){function n(r,t){var e=this;t||(t={}),Nr.call(this,r),this.d=new ar(t,function(i,a){e.ondata(null,i,a)}),this.compression=8,this.flag=Yn(t.level)}return u(n,"ZipDeflate"),n.prototype.process=function(r,t){try{this.d.push(r,t)}catch(e){this.ondata(e,null,t)}},n.prototype.push=function(r,t){Nr.prototype.push.call(this,r,t)},n}();var yt=function(){function n(r,t){var e=this;t||(t={}),Nr.call(this,r),this.d=new Xn(t,function(i,a,o){e.ondata(i,a,o)}),this.compression=8,this.flag=Yn(t.level),this.terminate=this.d.terminate}return u(n,"AsyncZipDeflate"),n.prototype.process=function(r,t){this.d.push(r,t)},n.prototype.push=function(r,t){Nr.prototype.push.call(this,r,t)},n}();var wt=function(){function n(r){this.ondata=r,this.u=[],this.d=1}return u(n,"Zip"),n.prototype.add=function(r){var t=this;if(this.ondata||g(5),this.d&2)this.ondata(g(4+(this.d&1)*8,0,1),null,!1);else{var e=sr(r.filename),i=e.length,a=r.comment,o=a&&sr(a),f=i!=r.filename.length||o&&a.length!=o.length,v=i+or(r.extra)+30;i>65535&&this.ondata(g(11,0,1),null,!1);var s=new D(v);pr(s,0,r,e,f);var h=[s],c=u(function(){for(var l=0,A=h;l<A.length;l++){var T=A[l];t.ondata(null,T,!1)}h=[]},"pAll_1"),y=this.d;this.d=0;var z=this.u.length,w=Er(r,{f:e,u:f,o,t:function(){r.terminate&&r.terminate()},r:function(){if(c(),y){var l=t.u[z+1];l?l.r():t.d=1}y=1}}),x=0;r.ondata=function(l,A,T){if(l)t.ondata(l,A,T),t.terminate();else if(x+=A.length,h.push(A),T){var U=new D(16);I(U,0,134695760),I(U,4,r.crc),I(U,8,x),I(U,12,r.size),h.push(U),w.c=x,w.b=v+x+16,w.crc=r.crc,w.size=r.size,y&&w.r(),y=1}else y&&c()},this.u.push(w)}},n.prototype.end=function(){var r=this;if(this.d&2){this.ondata(g(4+(this.d&1)*8,0,1),null,!0);return}this.d?this.e():this.u.push({r:function(){r.d&1&&(r.u.splice(-1,1),r.e())},t:function(){}}),this.d=3},n.prototype.e=function(){for(var r=0,t=0,e=0,i=0,a=this.u;i<a.length;i++){var o=a[i];e+=46+o.f.length+or(o.extra)+(o.o?o.o.length:0)}for(var f=new D(e+22),v=0,s=this.u;v<s.length;v++){var o=s[v];pr(f,r,o,o.f,o.u,o.c,t,o.o),r+=46+o.f.length+or(o.extra)+(o.o?o.o.length:0),t+=o.b}fn(f,r,this.u.length,e,t),this.ondata(null,f,!0),this.d=2},n.prototype.terminate=function(){for(var r=0,t=this.u;r<t.length;r++){var e=t[r];e.t()}this.d=2},n}();function mt(n,r,t){t||(t=r,r={}),typeof t!="function"&&g(7);var e={};on(n,"",e,r);var i=Object.keys(e),a=i.length,o=0,f=0,v=a,s=new Array(a),h=[],c=u(function(){for(var l=0;l<h.length;++l)h[l]()},"tAll"),y=u(function(l,A){Rr(function(){t(l,A)})},"cbd");Rr(function(){y=t});var z=u(function(){var l=new D(f+22),A=o,T=f-o;f=0;for(var U=0;U<v;++U){var m=s[U];try{var B=m.c.length;pr(l,f,m,m.f,m.u,B);var C=30+m.f.length+or(m.extra),M=f+C;l.set(m.c,M),pr(l,o,m,m.f,m.u,B,f,m.m),o+=16+C+(m.m?m.m.length:0),f=M+B}catch(p){return y(p,null)}}fn(l,o,s.length,T,A),y(null,l)},"cbf");a||z();for(var w=u(function(l){var A=i[l],T=e[A],U=T[0],m=T[1],B=mr(),C=U.length;B.p(U);var M=sr(A),p=M.length,P=m.comment,S=P&&sr(P),R=S&&S.length,O=or(m.extra),k=m.level==0?0:8,F=u(function(L,Z){if(L)c(),y(L,null);else{var G=Z.length;s[l]=Er(m,{size:C,crc:B.d(),c:Z,f:M,m:S,u:p!=A.length||S&&P.length!=R,compression:k}),o+=30+p+O+G,f+=76+2*(p+O)+(R||0)+G,--a||z()}},"cbl");if(p>65535&&F(g(11,0,1),null),!k)F(null,U);else if(C<16e4)try{F(null,$r(U,m))}catch(L){F(L,null)}else h.push(dn(U,m,F))},"_loop_1"),x=0;x<v;++x)w(x);return c}u(mt,"zip");function xt(n,r){r||(r={});var t={},e=[];on(n,"",t,r);var i=0,a=0;for(var o in t){var f=t[o],v=f[0],s=f[1],h=s.level==0?0:8,c=sr(o),y=c.length,z=s.comment,w=z&&sr(z),x=w&&w.length,l=or(s.extra);y>65535&&g(11);var A=h?$r(v,s):v,T=A.length,U=mr();U.p(v),e.push(Er(s,{size:v.length,crc:U.d(),c:A,f:c,m:w,u:y!=o.length||w&&z.length!=x,o:i,compression:h})),i+=30+y+l+T,a+=76+2*(y+l)+(x||0)+T}for(var m=new D(a+22),B=i,C=a-i,M=0;M<e.length;++M){var c=e[M];pr(m,c.o,c,c.f,c.u,c.c.length);var p=30+c.f.length+or(c.extra);m.set(c.c,c.o+p),pr(m,i,c,c.f,c.u,c.c.length,c.o,c.m),i+=16+p+(c.m?c.m.length:0)}return fn(m,i,e.length,C,B),m}u(xt,"zipSync");var et=function(){function n(){}return u(n,"UnzipPassThrough"),n.prototype.push=function(r,t){this.ondata(null,r,t)},n.compression=0,n}();var zt=function(){function n(){var r=this;this.i=new K(function(t,e){r.ondata(null,t,e)})}return u(n,"UnzipInflate"),n.prototype.push=function(r,t){try{this.i.push(r,t)}catch(e){this.ondata(e,null,t)}},n.compression=8,n}();var At=function(){function n(r,t){var e=this;t<32e4?this.i=new K(function(i,a){e.ondata(null,i,a)}):(this.i=new Nn(function(i,a,o){e.ondata(i,a,o)}),this.terminate=this.i.terminate)}return u(n,"AsyncUnzipInflate"),n.prototype.push=function(r,t){this.i.terminate&&(r=d(r,0)),this.i.push(r,t)},n.compression=8,n}();var Mt=function(){function n(r){this.onfile=r,this.k=[],this.o={0:et},this.p=er}return u(n,"Unzip"),n.prototype.push=function(r,t){var e=this;if(this.onfile||g(5),this.p||g(4),this.c>0){var i=Math.min(this.c,r.length),a=r.subarray(0,i);if(this.c-=i,this.d?this.d.push(a,!this.c):this.k[0].push(a),r=r.subarray(i),r.length)return this.push(r,t)}else{var o=0,f=0,v=void 0,s=void 0;this.p.length?r.length?(s=new D(this.p.length+r.length),s.set(this.p),s.set(r,this.p.length)):s=this.p:s=r;for(var h=s.length,c=this.c,y=c&&this.d,z=u(function(){var A,T=N(s,f);if(T==67324752){o=1,v=f,w.d=null,w.c=0;var U=W(s,f+6),m=W(s,f+8),B=U&2048,C=U&8,M=W(s,f+26),p=W(s,f+28);if(h>f+30+M+p){var P=[];w.k.unshift(P),o=2;var S=N(s,f+18),R=N(s,f+22),O=Hn(s.subarray(f+30,f+=30+M),!B);S==4294967295?(A=C?[-2]:Jn(s,f),S=A[0],R=A[1]):C&&(S=-1),f+=p,w.c=S;var k,F={name:O,compression:m,start:function(){if(F.ondata||g(5),!S)F.ondata(null,er,!0);else{var L=e.o[m];L||F.ondata(g(14,"unknown compression type "+m,1),null,!1),k=S<0?new L(O):new L(O,S,R),k.ondata=function(j,Q,Y){F.ondata(j,Q,Y)};for(var Z=0,G=P;Z<G.length;Z++){var H=G[Z];k.push(H,!1)}e.k[0]==P&&e.c?e.d=k:k.push(er,!0)}},terminate:function(){k&&k.terminate&&k.terminate()}};S>=0&&(F.size=S,F.originalSize=R),w.onfile(F)}return"break"}else if(c){if(T==134695760)return v=f+=12+(c==-2&&8),o=3,w.c=0,"break";if(T==33639248)return v=f-=4,o=3,w.c=0,"break"}},"_loop_2"),w=this;f<h-4;++f){var x=z();if(x==="break")break}if(this.p=er,c<0){var l=o?s.subarray(0,v-12-(c==-2&&8)-(N(s,v-16)==134695760&&4)):s.subarray(0,f);y?y.push(l,!!o):this.k[+(o==2)].push(l)}if(o&2)return this.push(s.subarray(f),t);this.p=s.subarray(f)}t&&(this.c&&g(13),this.p=null)},n.prototype.register=function(r){this.o[r.compression]=r},n}();var Rr=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(n){n()};function Tt(n,r,t){t||(t=r,r={}),typeof t!="function"&&g(7);var e=[],i=u(function(){for(var x=0;x<e.length;++x)e[x]()},"tAll"),a={},o=u(function(x,l){Rr(function(){t(x,l)})},"cbd");Rr(function(){o=t});for(var f=n.length-22;N(n,f)!=101010256;--f)if(!f||n.length-f>65558)return o(g(13,0,1),null),i;var v=W(n,f+8);if(v){var s=v,h=N(n,f+16),c=h==4294967295;if(c){if(f=N(n,f-12),N(n,f)!=101075792)return o(g(13,0,1),null),i;s=v=N(n,f+32),h=N(n,f+48)}for(var y=r&&r.filter,z=u(function(x){var l=jn(n,h,c),A=l[0],T=l[1],U=l[2],m=l[3],B=l[4],C=l[5],M=Wn(n,C);h=B;var p=u(function(S,R){S?(i(),o(S,null)):(R&&(a[m]=R),--v||o(null,a))},"cbl");if(!y||y({name:m,size:T,originalSize:U,compression:A}))if(!A)p(null,d(n,M,M+T));else if(A==8){var P=n.subarray(M,M+T);if(T<32e4)try{p(null,Fr(P,new D(U)))}catch(S){p(S,null)}else e.push(Rn(P,{size:U},p))}else p(g(14,"unknown compression type "+A,1),null);else p(null,null)},"_loop_3"),w=0;w<s;++w)z(w)}else o(null,{});return i}u(Tt,"unzip");function Ut(n,r){for(var t={},e=n.length-22;N(n,e)!=101010256;--e)(!e||n.length-e>65558)&&g(13);var i=W(n,e+8);if(!i)return{};var a=N(n,e+16),o=a==4294967295;o&&(e=N(n,e-12),N(n,e)!=101075792&&g(13),i=N(n,e+32),a=N(n,e+48));for(var f=r&&r.filter,v=0;v<i;++v){var s=jn(n,a,o),h=s[0],c=s[1],y=s[2],z=s[3],w=s[4],x=s[5],l=Wn(n,x);a=w,(!f||f({name:z,size:c,originalSize:y,compression:h}))&&(h?h==8?t[z]=Fr(n.subarray(l,l+c),new D(y)):g(14,"unknown compression type "+h):t[z]=d(n,l,l+c))}return t}u(Ut,"unzipSync");export{ot as AsyncCompress,vt as AsyncDecompress,Xn as AsyncDeflate,bn as AsyncGunzip,ot as AsyncGzip,Nn as AsyncInflate,At as AsyncUnzipInflate,rt as AsyncUnzlib,yt as AsyncZipDeflate,st as AsyncZlib,pn as Compress,ct as DecodeUTF8,tt as Decompress,ar as Deflate,pt as EncodeUTF8,at as FlateErrorCode,Jr as Gunzip,pn as Gzip,K as Inflate,Mt as Unzip,zt as UnzipInflate,et as UnzipPassThrough,Qr as Unzlib,wt as Zip,gt as ZipDeflate,Nr as ZipPassThrough,yn as Zlib,ft as compress,gn as compressSync,ht as decompress,lt as decompressSync,dn as deflate,$r as deflateSync,_n as gunzip,Kr as gunzipSync,ft as gzip,gn as gzipSync,Rn as inflate,Fr as inflateSync,Hn as strFromU8,sr as strToU8,Tt as unzip,Ut as unzipSync,nt as unzlib,Vr as unzlibSync,mt as zip,xt as zipSync,ut as zlib,wn as zlibSync};
1
+ import{a as hn}from"./chunk-JJHKNDAJ.js";import{a as u}from"./chunk-J5IUISYU.js";hn();var ln={},Qn=u(function(n,r,t,e,i){var a=new Worker(ln[r]||(ln[r]=URL.createObjectURL(new Blob([n+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(o){var f=o.data,v=f.$e$;if(v){var s=new Error(v[0]);s.code=v[1],s.stack=v[2],i(s,null)}else i(null,f)},a.postMessage(t,e),a},"wk"),D=Uint8Array,q=Uint16Array,gr=Uint32Array,yr=new D([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),wr=new D([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ur=new D([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xn=u(function(n,r){for(var t=new q(31),e=0;e<31;++e)t[e]=r+=1<<n[e-1];for(var i=new gr(t[30]),e=1;e<30;++e)for(var a=t[e];a<t[e+1];++a)i[a]=a-t[e]<<5|e;return[t,i]},"freb"),zn=xn(yr,2),dr=zn[0],Or=zn[1];dr[28]=258,Or[258]=28;var An=xn(wr,0),Mn=An[0],Yr=An[1],Dr=new q(32768);for(E=0;E<32768;++E)tr=(E&43690)>>>1|(E&21845)<<1,tr=(tr&52428)>>>2|(tr&13107)<<2,tr=(tr&61680)>>>4|(tr&3855)<<4,Dr[E]=((tr&65280)>>>8|(tr&255)<<8)>>>1;var tr,E,X=u(function(n,r,t){for(var e=n.length,i=0,a=new q(r);i<e;++i)n[i]&&++a[n[i]-1];var o=new q(r);for(i=0;i<r;++i)o[i]=o[i-1]+a[i-1]<<1;var f;if(t){f=new q(1<<r);var v=15-r;for(i=0;i<e;++i)if(n[i])for(var s=i<<4|n[i],h=r-n[i],c=o[n[i]-1]++<<h,y=c|(1<<h)-1;c<=y;++c)f[Dr[c]>>>v]=s}else for(f=new q(e),i=0;i<e;++i)n[i]&&(f[i]=Dr[o[n[i]-1]++]>>>15-n[i]);return f},"hMap"),ir=new D(288);for(E=0;E<144;++E)ir[E]=8;var E;for(E=144;E<256;++E)ir[E]=9;var E;for(E=256;E<280;++E)ir[E]=7;var E;for(E=280;E<288;++E)ir[E]=8;var E,cr=new D(32);for(E=0;E<32;++E)cr[E]=5;var E,Tn=X(ir,9,0),Un=X(ir,9,1),Dn=X(cr,5,0),Sn=X(cr,5,1),Zr=u(function(n){for(var r=n[0],t=1;t<n.length;++t)n[t]>r&&(r=n[t]);return r},"max"),V=u(function(n,r,t){var e=r/8|0;return(n[e]|n[e+1]<<8)>>(r&7)&t},"bits"),kr=u(function(n,r){var t=r/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(r&7)},"bits16"),Sr=u(function(n){return(n+7)/8|0},"shft"),d=u(function(n,r,t){(r==null||r<0)&&(r=0),(t==null||t>n.length)&&(t=n.length);var e=new(n.BYTES_PER_ELEMENT==2?q:n.BYTES_PER_ELEMENT==4?gr:D)(t-r);return e.set(n.subarray(r,t)),e},"slc"),at={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},Cn=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],g=u(function(n,r,t){var e=new Error(r||Cn[n]);if(e.code=n,Error.captureStackTrace&&Error.captureStackTrace(e,g),!t)throw e;return e},"err"),Cr=u(function(n,r,t){var e=n.length;if(!e||t&&t.f&&!t.l)return r||new D(0);var i=!r||t,a=!t||t.i;t||(t={}),r||(r=new D(e*3));var o=u(function(Ir){var Tr=r.length;if(Ir>Tr){var vr=new D(Math.max(Tr*2,Ir));vr.set(r),r=vr}},"cbuf"),f=t.f||0,v=t.p||0,s=t.b||0,h=t.l,c=t.d,y=t.m,z=t.n,w=e*8;do{if(!h){f=V(n,v,1);var x=V(n,v+1,3);if(v+=3,x)if(x==1)h=Un,c=Sn,y=9,z=5;else if(x==2){var U=V(n,v,31)+257,m=V(n,v+10,15)+4,B=U+V(n,v+5,31)+1;v+=14;for(var C=new D(B),M=new D(19),p=0;p<m;++p)M[Ur[p]]=V(n,v+p*3,7);v+=m*3;for(var P=Zr(M),S=(1<<P)-1,R=X(M,P,1),p=0;p<B;){var O=R[V(n,v,S)];v+=O&15;var l=O>>>4;if(l<16)C[p++]=l;else{var k=0,F=0;for(l==16?(F=3+V(n,v,3),v+=2,k=C[p-1]):l==17?(F=3+V(n,v,7),v+=3):l==18&&(F=11+V(n,v,127),v+=7);F--;)C[p++]=k}}var L=C.subarray(0,U),Z=C.subarray(U);y=Zr(L),z=Zr(Z),h=X(L,y,1),c=X(Z,z,1)}else g(1);else{var l=Sr(v)+4,A=n[l-4]|n[l-3]<<8,T=l+A;if(T>e){a&&g(0);break}i&&o(s+A),r.set(n.subarray(l,T),s),t.b=s+=A,t.p=v=T*8,t.f=f;continue}if(v>w){a&&g(0);break}}i&&o(s+131072);for(var G=(1<<y)-1,H=(1<<z)-1,j=v;;j=v){var k=h[kr(n,v)&G],Q=k>>>4;if(v+=k&15,v>w){a&&g(0);break}if(k||g(2),Q<256)r[s++]=Q;else if(Q==256){j=v,h=null;break}else{var Y=Q-254;if(Q>264){var p=Q-257,_=yr[p];Y=V(n,v,(1<<_)-1)+dr[p],v+=_}var rr=c[kr(n,v)&H],J=rr>>>4;rr||g(3),v+=rr&15;var Z=Mn[J];if(J>3){var _=wr[J];Z+=kr(n,v)&(1<<_)-1,v+=_}if(v>w){a&&g(0);break}i&&o(s+131072);for(var $=s+Y;s<$;s+=4)r[s]=r[s-Z],r[s+1]=r[s+1-Z],r[s+2]=r[s+2-Z],r[s+3]=r[s+3-Z];s=$}}t.l=h,t.p=j,t.b=s,t.f=f,h&&(f=1,t.m=y,t.d=c,t.n=z)}while(!f);return s==r.length?r:d(r,0,s)},"inflt"),nr=u(function(n,r,t){t<<=r&7;var e=r/8|0;n[e]|=t,n[e+1]|=t>>>8},"wbits"),hr=u(function(n,r,t){t<<=r&7;var e=r/8|0;n[e]|=t,n[e+1]|=t>>>8,n[e+2]|=t>>>16},"wbits16"),Gr=u(function(n,r){for(var t=[],e=0;e<n.length;++e)n[e]&&t.push({s:e,f:n[e]});var i=t.length,a=t.slice();if(!i)return[er,0];if(i==1){var o=new D(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(B,C){return B.f-C.f}),t.push({s:-1,f:25001});var f=t[0],v=t[1],s=0,h=1,c=2;for(t[0]={s:-1,f:f.f+v.f,l:f,r:v};h!=i-1;)f=t[t[s].f<t[c].f?s++:c++],v=t[s!=h&&t[s].f<t[c].f?s++:c++],t[h++]={s:-1,f:f.f+v.f,l:f,r:v};for(var y=a[0].s,e=1;e<i;++e)a[e].s>y&&(y=a[e].s);var z=new q(y+1),w=Lr(t[h-1],z,0);if(w>r){var e=0,x=0,l=w-r,A=1<<l;for(a.sort(function(C,M){return z[M.s]-z[C.s]||C.f-M.f});e<i;++e){var T=a[e].s;if(z[T]>r)x+=A-(1<<w-z[T]),z[T]=r;else break}for(x>>>=l;x>0;){var U=a[e].s;z[U]<r?x-=1<<r-z[U]++-1:++e}for(;e>=0&&x;--e){var m=a[e].s;z[m]==r&&(--z[m],++x)}w=r}return[new D(z),w]},"hTree"),Lr=u(function(n,r,t){return n.s==-1?Math.max(Lr(n.l,r,t+1),Lr(n.r,r,t+1)):r[n.s]=t},"ln"),Wr=u(function(n){for(var r=n.length;r&&!n[--r];);for(var t=new q(++r),e=0,i=n[0],a=1,o=u(function(v){t[e++]=v},"w"),f=1;f<=r;++f)if(n[f]==i&&f!=r)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=n[f]}return[t.subarray(0,e),r]},"lc"),lr=u(function(n,r){for(var t=0,e=0;e<r.length;++e)t+=n[e]*r[e];return t},"clen"),Pr=u(function(n,r,t){var e=t.length,i=Sr(r+2);n[i]=e&255,n[i+1]=e>>>8,n[i+2]=n[i]^255,n[i+3]=n[i+1]^255;for(var a=0;a<e;++a)n[i+a+4]=t[a];return(i+4+e)*8},"wfblk"),jr=u(function(n,r,t,e,i,a,o,f,v,s,h){nr(r,h++,t),++i[256];for(var c=Gr(i,15),y=c[0],z=c[1],w=Gr(a,15),x=w[0],l=w[1],A=Wr(y),T=A[0],U=A[1],m=Wr(x),B=m[0],C=m[1],M=new q(19),p=0;p<T.length;++p)M[T[p]&31]++;for(var p=0;p<B.length;++p)M[B[p]&31]++;for(var P=Gr(M,7),S=P[0],R=P[1],O=19;O>4&&!S[Ur[O-1]];--O);var k=s+5<<3,F=lr(i,ir)+lr(a,cr)+o,L=lr(i,y)+lr(a,x)+o+14+3*O+lr(M,S)+(2*M[16]+3*M[17]+7*M[18]);if(k<=F&&k<=L)return Pr(r,h,n.subarray(v,v+s));var Z,G,H,j;if(nr(r,h,1+(L<F)),h+=2,L<F){Z=X(y,z,0),G=y,H=X(x,l,0),j=x;var Q=X(S,R,0);nr(r,h,U-257),nr(r,h+5,C-1),nr(r,h+10,O-4),h+=14;for(var p=0;p<O;++p)nr(r,h+3*p,S[Ur[p]]);h+=3*O;for(var Y=[T,B],_=0;_<2;++_)for(var rr=Y[_],p=0;p<rr.length;++p){var J=rr[p]&31;nr(r,h,Q[J]),h+=S[J],J>15&&(nr(r,h,rr[p]>>>5&127),h+=rr[p]>>>12)}}else Z=Tn,G=ir,H=Dn,j=cr;for(var p=0;p<f;++p)if(e[p]>255){var J=e[p]>>>18&31;hr(r,h,Z[J+257]),h+=G[J+257],J>7&&(nr(r,h,e[p]>>>23&31),h+=yr[J]);var $=e[p]&31;hr(r,h,H[$]),h+=j[$],$>3&&(hr(r,h,e[p]>>>5&8191),h+=wr[$])}else hr(r,h,Z[e[p]]),h+=G[e[p]];return hr(r,h,Z[256]),h+G[256]},"wblk"),En=new gr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),er=new D(0),Fn=u(function(n,r,t,e,i,a){var o=n.length,f=new D(e+o+5*(1+Math.ceil(o/7e3))+i),v=f.subarray(e,f.length-i),s=0;if(!r||o<8)for(var h=0;h<=o;h+=65535){var c=h+65535;c>=o&&(v[s>>3]=a),s=Pr(v,s+1,n.subarray(h,c))}else{for(var y=En[r-1],z=y>>>13,w=y&8191,x=(1<<t)-1,l=new q(32768),A=new q(x+1),T=Math.ceil(t/3),U=2*T,m=u(function(qr){return(n[qr]^n[qr+1]<<T^n[qr+2]<<U)&x},"hsh"),B=new gr(25e3),C=new q(288),M=new q(32),p=0,P=0,h=0,S=0,R=0,O=0;h<o;++h){var k=m(h),F=h&32767,L=A[k];if(l[F]=L,A[k]=F,R<=h){var Z=o-h;if((p>7e3||S>24576)&&Z>423){s=jr(n,v,0,B,C,M,P,S,O,h-O,s),S=p=P=0,O=h;for(var G=0;G<286;++G)C[G]=0;for(var G=0;G<30;++G)M[G]=0}var H=2,j=0,Q=w,Y=F-L&32767;if(Z>2&&k==m(h-Y))for(var _=Math.min(z,Z)-1,rr=Math.min(32767,h),J=Math.min(258,Z);Y<=rr&&--Q&&F!=L;){if(n[h+H]==n[h+H-Y]){for(var $=0;$<J&&n[h+$]==n[h+$-Y];++$);if($>H){if(H=$,j=Y,$>_)break;for(var Ir=Math.min(Y,$-2),Tr=0,G=0;G<Ir;++G){var vr=h-Y+G+32768&32767,Kn=l[vr],sn=vr-Kn+32768&32767;sn>Tr&&(Tr=sn,L=vr)}}}F=L,L=l[F],Y+=F-L+32768&32767}if(j){B[S++]=268435456|Or[H]<<18|Yr[j];var un=Or[H]&31,vn=Yr[j]&31;P+=yr[un]+wr[vn],++C[257+un],++M[vn],R=h+H,++p}else B[S++]=n[h],++C[n[h]]}}s=jr(n,v,a,B,C,M,P,S,O,h-O,s),!a&&s&7&&(s=Pr(v,s+1,er))}return d(f,0,e+Sr(s)+i)},"dflt"),In=function(){for(var n=new Int32Array(256),r=0;r<256;++r){for(var t=r,e=9;--e;)t=(t&1&&-306674912)^t>>>1;n[r]=t}return n}(),mr=u(function(){var n=-1;return{p:function(r){for(var t=n,e=0;e<r.length;++e)t=In[t&255^r[e]]^t>>>8;n=t},d:function(){return~n}}},"crc"),br=u(function(){var n=1,r=0;return{p:function(t){for(var e=n,i=r,a=t.length|0,o=0;o!=a;){for(var f=Math.min(o+2655,a);o<f;++o)i+=e+=t[o];e=(e&65535)+15*(e>>16),i=(i&65535)+15*(i>>16)}n=e,r=i},d:function(){return n%=65521,r%=65521,(n&255)<<24|n>>>8<<16|(r&255)<<8|r>>>8}}},"adler"),ur=u(function(n,r,t,e,i){return Fn(n,r.level==null?6:r.level,r.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):12+r.mem,t,e,!i)},"dopt"),Er=u(function(n,r){var t={};for(var e in n)t[e]=n[e];for(var e in r)t[e]=r[e];return t},"mrg"),cn=u(function(n,r,t){for(var e=n(),i=n.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<e.length;++o){var f=e[o],v=a[o];if(typeof f=="function"){r+=";"+v+"=";var s=f.toString();if(f.prototype)if(s.indexOf("[native code]")!=-1){var h=s.indexOf(" ",8)+1;r+=s.slice(h,s.indexOf("(",h))}else{r+=s;for(var c in f.prototype)r+=";"+v+".prototype."+c+"="+f.prototype[c].toString()}else r+=s}else t[v]=f}return[r,t]},"wcln"),Br=[],Vn=u(function(n){var r=[];for(var t in n)n[t].buffer&&r.push((n[t]=new n[t].constructor(n[t])).buffer);return r},"cbfs"),Bn=u(function(n,r,t,e){var i;if(!Br[t]){for(var a="",o={},f=n.length-1,v=0;v<f;++v)i=cn(n[v],a,o),a=i[0],o=i[1];Br[t]=cn(n[f],a,o)}var s=Er({},Br[t][1]);return Qn(Br[t][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+r.toString()+"}",t,s,Vn(s),e)},"wrkr"),xr=u(function(){return[D,q,gr,yr,wr,Ur,dr,Mn,Un,Sn,Dr,Cn,X,Zr,V,kr,Sr,d,g,Cr,Fr,fr,_r]},"bInflt"),zr=u(function(){return[D,q,gr,yr,wr,Ur,Or,Yr,Tn,ir,Dn,cr,Dr,En,er,X,nr,hr,Gr,Lr,Wr,lr,Pr,jr,Sr,d,Fn,ur,$r,fr]},"bDflt"),Zn=u(function(){return[rn,tn,I,mr,In]},"gze"),kn=u(function(){return[nn,Ln]},"guze"),Gn=u(function(){return[en,I,br]},"zle"),On=u(function(){return[Pn]},"zule"),fr=u(function(n){return postMessage(n,[n.buffer])},"pbf"),_r=u(function(n){return n&&n.size&&new D(n.size)},"gu8"),Ar=u(function(n,r,t,e,i,a){var o=Bn(t,e,i,function(f,v){o.terminate(),a(f,v)});return o.postMessage([n,r],r.consume?[n.buffer]:[]),function(){o.terminate()}},"cbify"),b=u(function(n){return n.ondata=function(r,t){return postMessage([r,t],[r.buffer])},function(r){return n.push(r.data[0],r.data[1])}},"astrm"),Mr=u(function(n,r,t,e,i){var a,o=Bn(n,e,i,function(f,v){f?(o.terminate(),r.ondata.call(r,f)):(v[1]&&o.terminate(),r.ondata.call(r,f,v[0],v[1]))});o.postMessage(t),r.push=function(f,v){r.ondata||g(5),a&&r.ondata(g(4,0,1),null,!!v),o.postMessage([f,a=v],[f.buffer])},r.terminate=function(){o.terminate()}},"astrmify"),W=u(function(n,r){return n[r]|n[r+1]<<8},"b2"),N=u(function(n,r){return(n[r]|n[r+1]<<8|n[r+2]<<16|n[r+3]<<24)>>>0},"b4"),Hr=u(function(n,r){return N(n,r)+N(n,r+4)*4294967296},"b8"),I=u(function(n,r,t){for(;t;++r)n[r]=t,t>>>=8},"wbytes"),rn=u(function(n,r){var t=r.filename;if(n[0]=31,n[1]=139,n[2]=8,n[8]=r.level<2?4:r.level==9?2:0,n[9]=3,r.mtime!=0&&I(n,4,Math.floor(new Date(r.mtime||Date.now())/1e3)),t){n[3]=8;for(var e=0;e<=t.length;++e)n[e+10]=t.charCodeAt(e)}},"gzh"),nn=u(function(n){(n[0]!=31||n[1]!=139||n[2]!=8)&&g(6,"invalid gzip data");var r=n[3],t=10;r&4&&(t+=n[10]|(n[11]<<8)+2);for(var e=(r>>3&1)+(r>>4&1);e>0;e-=!n[t++]);return t+(r&2)},"gzs"),Ln=u(function(n){var r=n.length;return(n[r-4]|n[r-3]<<8|n[r-2]<<16|n[r-1]<<24)>>>0},"gzl"),tn=u(function(n){return 10+(n.filename&&n.filename.length+1||0)},"gzhl"),en=u(function(n,r){var t=r.level,e=t==0?0:t<6?1:t==9?3:2;n[0]=120,n[1]=e<<6|(e?32-2*e:1)},"zlh"),Pn=u(function(n){((n[0]&15)!=8||n[0]>>>4>7||(n[0]<<8|n[1])%31)&&g(6,"invalid zlib data"),n[1]&32&&g(6,"invalid zlib data: preset dictionaries not supported")},"zlv");function an(n,r){return!r&&typeof n=="function"&&(r=n,n={}),this.ondata=r,n}u(an,"AsyncCmpStrm");var ar=function(){function n(r,t){!t&&typeof r=="function"&&(t=r,r={}),this.ondata=t,this.o=r||{}}return u(n,"Deflate"),n.prototype.p=function(r,t){this.ondata(ur(r,this.o,0,0,!t),t)},n.prototype.push=function(r,t){this.ondata||g(5),this.d&&g(4),this.d=t,this.p(r,t||!1)},n}();var Xn=function(){function n(r,t){Mr([zr,function(){return[b,ar]}],this,an.call(this,r,t),function(e){var i=new ar(e.data);onmessage=b(i)},6)}return u(n,"AsyncDeflate"),n}();function dn(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[zr],function(e){return fr($r(e.data[0],e.data[1]))},0,t)}u(dn,"deflate");function $r(n,r){return ur(n,r||{},0,0)}u($r,"deflateSync");var K=function(){function n(r){this.s={},this.p=new D(0),this.ondata=r}return u(n,"Inflate"),n.prototype.e=function(r){this.ondata||g(5),this.d&&g(4);var t=this.p.length,e=new D(t+r.length);e.set(this.p),e.set(r,t),this.p=e},n.prototype.c=function(r){this.d=this.s.i=r||!1;var t=this.s.b,e=Cr(this.p,this.o,this.s);this.ondata(d(e,t,this.s.b),this.d),this.o=d(e,this.s.b-32768),this.s.b=this.o.length,this.p=d(this.p,this.s.p/8|0),this.s.p&=7},n.prototype.push=function(r,t){this.e(r),this.c(t)},n}();var Nn=function(){function n(r){this.ondata=r,Mr([xr,function(){return[b,K]}],this,0,function(){var t=new K;onmessage=b(t)},7)}return u(n,"AsyncInflate"),n}();function Rn(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[xr],function(e){return fr(Fr(e.data[0],_r(e.data[1])))},1,t)}u(Rn,"inflate");function Fr(n,r){return Cr(n,r)}u(Fr,"inflateSync");var pn=function(){function n(r,t){this.c=mr(),this.l=0,this.v=1,ar.call(this,r,t)}return u(n,"Gzip"),n.prototype.push=function(r,t){ar.prototype.push.call(this,r,t)},n.prototype.p=function(r,t){this.c.p(r),this.l+=r.length;var e=ur(r,this.o,this.v&&tn(this.o),t&&8,!t);this.v&&(rn(e,this.o),this.v=0),t&&(I(e,e.length-8,this.c.d()),I(e,e.length-4,this.l)),this.ondata(e,t)},n}();var ot=function(){function n(r,t){Mr([zr,Zn,function(){return[b,ar,pn]}],this,an.call(this,r,t),function(e){var i=new pn(e.data);onmessage=b(i)},8)}return u(n,"AsyncGzip"),n}();function ft(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[zr,Zn,function(){return[gn]}],function(e){return fr(gn(e.data[0],e.data[1]))},2,t)}u(ft,"gzip");function gn(n,r){r||(r={});var t=mr(),e=n.length;t.p(n);var i=ur(n,r,tn(r),8),a=i.length;return rn(i,r),I(i,a-8,t.d()),I(i,a-4,e),i}u(gn,"gzipSync");var Jr=function(){function n(r){this.v=1,K.call(this,r)}return u(n,"Gunzip"),n.prototype.push=function(r,t){if(K.prototype.e.call(this,r),this.v){var e=this.p.length>3?nn(this.p):4;if(e>=this.p.length&&!t)return;this.p=this.p.subarray(e),this.v=0}t&&(this.p.length<8&&g(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),K.prototype.c.call(this,t)},n}();var bn=function(){function n(r){this.ondata=r,Mr([xr,kn,function(){return[b,K,Jr]}],this,0,function(){var t=new Jr;onmessage=b(t)},9)}return u(n,"AsyncGunzip"),n}();function _n(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[xr,kn,function(){return[Kr]}],function(e){return fr(Kr(e.data[0]))},3,t)}u(_n,"gunzip");function Kr(n,r){return Cr(n.subarray(nn(n),-8),r||new D(Ln(n)))}u(Kr,"gunzipSync");var yn=function(){function n(r,t){this.c=br(),this.v=1,ar.call(this,r,t)}return u(n,"Zlib"),n.prototype.push=function(r,t){ar.prototype.push.call(this,r,t)},n.prototype.p=function(r,t){this.c.p(r);var e=ur(r,this.o,this.v&&2,t&&4,!t);this.v&&(en(e,this.o),this.v=0),t&&I(e,e.length-4,this.c.d()),this.ondata(e,t)},n}();var st=function(){function n(r,t){Mr([zr,Gn,function(){return[b,ar,yn]}],this,an.call(this,r,t),function(e){var i=new yn(e.data);onmessage=b(i)},10)}return u(n,"AsyncZlib"),n}();function ut(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[zr,Gn,function(){return[wn]}],function(e){return fr(wn(e.data[0],e.data[1]))},4,t)}u(ut,"zlib");function wn(n,r){r||(r={});var t=br();t.p(n);var e=ur(n,r,2,4);return en(e,r),I(e,e.length-4,t.d()),e}u(wn,"zlibSync");var Qr=function(){function n(r){this.v=1,K.call(this,r)}return u(n,"Unzlib"),n.prototype.push=function(r,t){if(K.prototype.e.call(this,r),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}t&&(this.p.length<4&&g(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),K.prototype.c.call(this,t)},n}();var rt=function(){function n(r){this.ondata=r,Mr([xr,On,function(){return[b,K,Qr]}],this,0,function(){var t=new Qr;onmessage=b(t)},11)}return u(n,"AsyncUnzlib"),n}();function nt(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[xr,On,function(){return[Vr]}],function(e){return fr(Vr(e.data[0],_r(e.data[1])))},5,t)}u(nt,"unzlib");function Vr(n,r){return Cr((Pn(n),n.subarray(2,-4)),r)}u(Vr,"unzlibSync");var tt=function(){function n(r){this.G=Jr,this.I=K,this.Z=Qr,this.ondata=r}return u(n,"Decompress"),n.prototype.push=function(r,t){if(this.ondata||g(5),this.s)this.s.push(r,t);else{if(this.p&&this.p.length){var e=new D(this.p.length+r.length);e.set(this.p),e.set(r,this.p.length)}else this.p=r;if(this.p.length>2){var i=this,a=u(function(){i.ondata.apply(i,arguments)},"cb");this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(a):(this.p[0]&15)!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(a):new this.Z(a),this.s.push(this.p,t),this.p=null}}},n}();var vt=function(){function n(r){this.G=bn,this.I=Nn,this.Z=rt,this.ondata=r}return u(n,"AsyncDecompress"),n.prototype.push=function(r,t){tt.prototype.push.call(this,r,t)},n}();function ht(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),n[0]==31&&n[1]==139&&n[2]==8?_n(n,r,t):(n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31?Rn(n,r,t):nt(n,r,t)}u(ht,"decompress");function lt(n,r){return n[0]==31&&n[1]==139&&n[2]==8?Kr(n,r):(n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31?Fr(n,r):Vr(n,r)}u(lt,"decompressSync");var on=u(function(n,r,t,e){for(var i in n){var a=n[i],o=r+i,f=e;Array.isArray(a)&&(f=Er(e,a[1]),a=a[0]),a instanceof D?t[o]=[a,f]:(t[o+="/"]=[new D(0),f],on(a,o,t,e))}},"fltn"),mn=typeof TextEncoder<"u"&&new TextEncoder,Xr=typeof TextDecoder<"u"&&new TextDecoder,$n=0;try{Xr.decode(er,{stream:!0}),$n=1}catch{}var qn=u(function(n){for(var r="",t=0;;){var e=n[t++],i=(e>127)+(e>223)+(e>239);if(t+i>n.length)return[r,d(n,t-1)];i?i==3?(e=((e&15)<<18|(n[t++]&63)<<12|(n[t++]&63)<<6|n[t++]&63)-65536,r+=String.fromCharCode(55296|e>>10,56320|e&1023)):i&1?r+=String.fromCharCode((e&31)<<6|n[t++]&63):r+=String.fromCharCode((e&15)<<12|(n[t++]&63)<<6|n[t++]&63):r+=String.fromCharCode(e)}},"dutf8"),ct=function(){function n(r){this.ondata=r,$n?this.t=new TextDecoder:this.p=er}return u(n,"DecodeUTF8"),n.prototype.push=function(r,t){if(this.ondata||g(5),t=!!t,this.t){this.ondata(this.t.decode(r,{stream:!0}),t),t&&(this.t.decode().length&&g(8),this.t=null);return}this.p||g(4);var e=new D(this.p.length+r.length);e.set(this.p),e.set(r,this.p.length);var i=qn(e),a=i[0],o=i[1];t?(o.length&&g(8),this.p=null):this.p=o,this.ondata(a,t)},n}();var pt=function(){function n(r){this.ondata=r}return u(n,"EncodeUTF8"),n.prototype.push=function(r,t){this.ondata||g(5),this.d&&g(4),this.ondata(sr(r),this.d=t||!1)},n}();function sr(n,r){if(r){for(var t=new D(n.length),e=0;e<n.length;++e)t[e]=n.charCodeAt(e);return t}if(mn)return mn.encode(n);for(var i=n.length,a=new D(n.length+(n.length>>1)),o=0,f=u(function(h){a[o++]=h},"w"),e=0;e<i;++e){if(o+5>a.length){var v=new D(o+8+(i-e<<1));v.set(a),a=v}var s=n.charCodeAt(e);s<128||r?f(s):s<2048?(f(192|s>>6),f(128|s&63)):s>55295&&s<57344?(s=65536+(s&1047552)|n.charCodeAt(++e)&1023,f(240|s>>18),f(128|s>>12&63),f(128|s>>6&63),f(128|s&63)):(f(224|s>>12),f(128|s>>6&63),f(128|s&63))}return d(a,0,o)}u(sr,"strToU8");function Hn(n,r){if(r){for(var t="",e=0;e<n.length;e+=16384)t+=String.fromCharCode.apply(null,n.subarray(e,e+16384));return t}else{if(Xr)return Xr.decode(n);var i=qn(n),a=i[0],o=i[1];return o.length&&g(8),a}}u(Hn,"strFromU8");var Yn=u(function(n){return n==1?3:n<6?2:n==9?1:0},"dbf"),Wn=u(function(n,r){return r+30+W(n,r+26)+W(n,r+28)},"slzh"),jn=u(function(n,r,t){var e=W(n,r+28),i=Hn(n.subarray(r+46,r+46+e),!(W(n,r+8)&2048)),a=r+46+e,o=N(n,r+20),f=t&&o==4294967295?Jn(n,a):[o,N(n,r+24),N(n,r+42)],v=f[0],s=f[1],h=f[2];return[W(n,r+10),v,s,i,a+W(n,r+30)+W(n,r+32),h]},"zh"),Jn=u(function(n,r){for(;W(n,r)!=1;r+=4+W(n,r+2));return[Hr(n,r+12),Hr(n,r+4),Hr(n,r+20)]},"z64e"),or=u(function(n){var r=0;if(n)for(var t in n){var e=n[t].length;e>65535&&g(9),r+=e+4}return r},"exfl"),pr=u(function(n,r,t,e,i,a,o,f){var v=e.length,s=t.extra,h=f&&f.length,c=or(s);I(n,r,o!=null?33639248:67324752),r+=4,o!=null&&(n[r++]=20,n[r++]=t.os),n[r]=20,r+=2,n[r++]=t.flag<<1|(a==null&&8),n[r++]=i&&8,n[r++]=t.compression&255,n[r++]=t.compression>>8;var y=new Date(t.mtime==null?Date.now():t.mtime),z=y.getFullYear()-1980;if((z<0||z>119)&&g(10),I(n,r,z<<25|y.getMonth()+1<<21|y.getDate()<<16|y.getHours()<<11|y.getMinutes()<<5|y.getSeconds()>>>1),r+=4,a!=null&&(I(n,r,t.crc),I(n,r+4,a),I(n,r+8,t.size)),I(n,r+12,v),I(n,r+14,c),r+=16,o!=null&&(I(n,r,h),I(n,r+6,t.attrs),I(n,r+10,o),r+=14),n.set(e,r),r+=v,c)for(var w in s){var x=s[w],l=x.length;I(n,r,+w),I(n,r+2,l),n.set(x,r+4),r+=4+l}return h&&(n.set(f,r),r+=h),r},"wzh"),fn=u(function(n,r,t,e,i){I(n,r,101010256),I(n,r+8,t),I(n,r+10,t),I(n,r+12,e),I(n,r+16,i)},"wzf"),Nr=function(){function n(r){this.filename=r,this.c=mr(),this.size=0,this.compression=0}return u(n,"ZipPassThrough"),n.prototype.process=function(r,t){this.ondata(null,r,t)},n.prototype.push=function(r,t){this.ondata||g(5),this.c.p(r),this.size+=r.length,t&&(this.crc=this.c.d()),this.process(r,t||!1)},n}();var gt=function(){function n(r,t){var e=this;t||(t={}),Nr.call(this,r),this.d=new ar(t,function(i,a){e.ondata(null,i,a)}),this.compression=8,this.flag=Yn(t.level)}return u(n,"ZipDeflate"),n.prototype.process=function(r,t){try{this.d.push(r,t)}catch(e){this.ondata(e,null,t)}},n.prototype.push=function(r,t){Nr.prototype.push.call(this,r,t)},n}();var yt=function(){function n(r,t){var e=this;t||(t={}),Nr.call(this,r),this.d=new Xn(t,function(i,a,o){e.ondata(i,a,o)}),this.compression=8,this.flag=Yn(t.level),this.terminate=this.d.terminate}return u(n,"AsyncZipDeflate"),n.prototype.process=function(r,t){this.d.push(r,t)},n.prototype.push=function(r,t){Nr.prototype.push.call(this,r,t)},n}();var wt=function(){function n(r){this.ondata=r,this.u=[],this.d=1}return u(n,"Zip"),n.prototype.add=function(r){var t=this;if(this.ondata||g(5),this.d&2)this.ondata(g(4+(this.d&1)*8,0,1),null,!1);else{var e=sr(r.filename),i=e.length,a=r.comment,o=a&&sr(a),f=i!=r.filename.length||o&&a.length!=o.length,v=i+or(r.extra)+30;i>65535&&this.ondata(g(11,0,1),null,!1);var s=new D(v);pr(s,0,r,e,f);var h=[s],c=u(function(){for(var l=0,A=h;l<A.length;l++){var T=A[l];t.ondata(null,T,!1)}h=[]},"pAll_1"),y=this.d;this.d=0;var z=this.u.length,w=Er(r,{f:e,u:f,o,t:function(){r.terminate&&r.terminate()},r:function(){if(c(),y){var l=t.u[z+1];l?l.r():t.d=1}y=1}}),x=0;r.ondata=function(l,A,T){if(l)t.ondata(l,A,T),t.terminate();else if(x+=A.length,h.push(A),T){var U=new D(16);I(U,0,134695760),I(U,4,r.crc),I(U,8,x),I(U,12,r.size),h.push(U),w.c=x,w.b=v+x+16,w.crc=r.crc,w.size=r.size,y&&w.r(),y=1}else y&&c()},this.u.push(w)}},n.prototype.end=function(){var r=this;if(this.d&2){this.ondata(g(4+(this.d&1)*8,0,1),null,!0);return}this.d?this.e():this.u.push({r:function(){r.d&1&&(r.u.splice(-1,1),r.e())},t:function(){}}),this.d=3},n.prototype.e=function(){for(var r=0,t=0,e=0,i=0,a=this.u;i<a.length;i++){var o=a[i];e+=46+o.f.length+or(o.extra)+(o.o?o.o.length:0)}for(var f=new D(e+22),v=0,s=this.u;v<s.length;v++){var o=s[v];pr(f,r,o,o.f,o.u,o.c,t,o.o),r+=46+o.f.length+or(o.extra)+(o.o?o.o.length:0),t+=o.b}fn(f,r,this.u.length,e,t),this.ondata(null,f,!0),this.d=2},n.prototype.terminate=function(){for(var r=0,t=this.u;r<t.length;r++){var e=t[r];e.t()}this.d=2},n}();function mt(n,r,t){t||(t=r,r={}),typeof t!="function"&&g(7);var e={};on(n,"",e,r);var i=Object.keys(e),a=i.length,o=0,f=0,v=a,s=new Array(a),h=[],c=u(function(){for(var l=0;l<h.length;++l)h[l]()},"tAll"),y=u(function(l,A){Rr(function(){t(l,A)})},"cbd");Rr(function(){y=t});var z=u(function(){var l=new D(f+22),A=o,T=f-o;f=0;for(var U=0;U<v;++U){var m=s[U];try{var B=m.c.length;pr(l,f,m,m.f,m.u,B);var C=30+m.f.length+or(m.extra),M=f+C;l.set(m.c,M),pr(l,o,m,m.f,m.u,B,f,m.m),o+=16+C+(m.m?m.m.length:0),f=M+B}catch(p){return y(p,null)}}fn(l,o,s.length,T,A),y(null,l)},"cbf");a||z();for(var w=u(function(l){var A=i[l],T=e[A],U=T[0],m=T[1],B=mr(),C=U.length;B.p(U);var M=sr(A),p=M.length,P=m.comment,S=P&&sr(P),R=S&&S.length,O=or(m.extra),k=m.level==0?0:8,F=u(function(L,Z){if(L)c(),y(L,null);else{var G=Z.length;s[l]=Er(m,{size:C,crc:B.d(),c:Z,f:M,m:S,u:p!=A.length||S&&P.length!=R,compression:k}),o+=30+p+O+G,f+=76+2*(p+O)+(R||0)+G,--a||z()}},"cbl");if(p>65535&&F(g(11,0,1),null),!k)F(null,U);else if(C<16e4)try{F(null,$r(U,m))}catch(L){F(L,null)}else h.push(dn(U,m,F))},"_loop_1"),x=0;x<v;++x)w(x);return c}u(mt,"zip");function xt(n,r){r||(r={});var t={},e=[];on(n,"",t,r);var i=0,a=0;for(var o in t){var f=t[o],v=f[0],s=f[1],h=s.level==0?0:8,c=sr(o),y=c.length,z=s.comment,w=z&&sr(z),x=w&&w.length,l=or(s.extra);y>65535&&g(11);var A=h?$r(v,s):v,T=A.length,U=mr();U.p(v),e.push(Er(s,{size:v.length,crc:U.d(),c:A,f:c,m:w,u:y!=o.length||w&&z.length!=x,o:i,compression:h})),i+=30+y+l+T,a+=76+2*(y+l)+(x||0)+T}for(var m=new D(a+22),B=i,C=a-i,M=0;M<e.length;++M){var c=e[M];pr(m,c.o,c,c.f,c.u,c.c.length);var p=30+c.f.length+or(c.extra);m.set(c.c,c.o+p),pr(m,i,c,c.f,c.u,c.c.length,c.o,c.m),i+=16+p+(c.m?c.m.length:0)}return fn(m,i,e.length,C,B),m}u(xt,"zipSync");var et=function(){function n(){}return u(n,"UnzipPassThrough"),n.prototype.push=function(r,t){this.ondata(null,r,t)},n.compression=0,n}();var zt=function(){function n(){var r=this;this.i=new K(function(t,e){r.ondata(null,t,e)})}return u(n,"UnzipInflate"),n.prototype.push=function(r,t){try{this.i.push(r,t)}catch(e){this.ondata(e,null,t)}},n.compression=8,n}();var At=function(){function n(r,t){var e=this;t<32e4?this.i=new K(function(i,a){e.ondata(null,i,a)}):(this.i=new Nn(function(i,a,o){e.ondata(i,a,o)}),this.terminate=this.i.terminate)}return u(n,"AsyncUnzipInflate"),n.prototype.push=function(r,t){this.i.terminate&&(r=d(r,0)),this.i.push(r,t)},n.compression=8,n}();var Mt=function(){function n(r){this.onfile=r,this.k=[],this.o={0:et},this.p=er}return u(n,"Unzip"),n.prototype.push=function(r,t){var e=this;if(this.onfile||g(5),this.p||g(4),this.c>0){var i=Math.min(this.c,r.length),a=r.subarray(0,i);if(this.c-=i,this.d?this.d.push(a,!this.c):this.k[0].push(a),r=r.subarray(i),r.length)return this.push(r,t)}else{var o=0,f=0,v=void 0,s=void 0;this.p.length?r.length?(s=new D(this.p.length+r.length),s.set(this.p),s.set(r,this.p.length)):s=this.p:s=r;for(var h=s.length,c=this.c,y=c&&this.d,z=u(function(){var A,T=N(s,f);if(T==67324752){o=1,v=f,w.d=null,w.c=0;var U=W(s,f+6),m=W(s,f+8),B=U&2048,C=U&8,M=W(s,f+26),p=W(s,f+28);if(h>f+30+M+p){var P=[];w.k.unshift(P),o=2;var S=N(s,f+18),R=N(s,f+22),O=Hn(s.subarray(f+30,f+=30+M),!B);S==4294967295?(A=C?[-2]:Jn(s,f),S=A[0],R=A[1]):C&&(S=-1),f+=p,w.c=S;var k,F={name:O,compression:m,start:function(){if(F.ondata||g(5),!S)F.ondata(null,er,!0);else{var L=e.o[m];L||F.ondata(g(14,"unknown compression type "+m,1),null,!1),k=S<0?new L(O):new L(O,S,R),k.ondata=function(j,Q,Y){F.ondata(j,Q,Y)};for(var Z=0,G=P;Z<G.length;Z++){var H=G[Z];k.push(H,!1)}e.k[0]==P&&e.c?e.d=k:k.push(er,!0)}},terminate:function(){k&&k.terminate&&k.terminate()}};S>=0&&(F.size=S,F.originalSize=R),w.onfile(F)}return"break"}else if(c){if(T==134695760)return v=f+=12+(c==-2&&8),o=3,w.c=0,"break";if(T==33639248)return v=f-=4,o=3,w.c=0,"break"}},"_loop_2"),w=this;f<h-4;++f){var x=z();if(x==="break")break}if(this.p=er,c<0){var l=o?s.subarray(0,v-12-(c==-2&&8)-(N(s,v-16)==134695760&&4)):s.subarray(0,f);y?y.push(l,!!o):this.k[+(o==2)].push(l)}if(o&2)return this.push(s.subarray(f),t);this.p=s.subarray(f)}t&&(this.c&&g(13),this.p=null)},n.prototype.register=function(r){this.o[r.compression]=r},n}();var Rr=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(n){n()};function Tt(n,r,t){t||(t=r,r={}),typeof t!="function"&&g(7);var e=[],i=u(function(){for(var x=0;x<e.length;++x)e[x]()},"tAll"),a={},o=u(function(x,l){Rr(function(){t(x,l)})},"cbd");Rr(function(){o=t});for(var f=n.length-22;N(n,f)!=101010256;--f)if(!f||n.length-f>65558)return o(g(13,0,1),null),i;var v=W(n,f+8);if(v){var s=v,h=N(n,f+16),c=h==4294967295;if(c){if(f=N(n,f-12),N(n,f)!=101075792)return o(g(13,0,1),null),i;s=v=N(n,f+32),h=N(n,f+48)}for(var y=r&&r.filter,z=u(function(x){var l=jn(n,h,c),A=l[0],T=l[1],U=l[2],m=l[3],B=l[4],C=l[5],M=Wn(n,C);h=B;var p=u(function(S,R){S?(i(),o(S,null)):(R&&(a[m]=R),--v||o(null,a))},"cbl");if(!y||y({name:m,size:T,originalSize:U,compression:A}))if(!A)p(null,d(n,M,M+T));else if(A==8){var P=n.subarray(M,M+T);if(T<32e4)try{p(null,Fr(P,new D(U)))}catch(S){p(S,null)}else e.push(Rn(P,{size:U},p))}else p(g(14,"unknown compression type "+A,1),null);else p(null,null)},"_loop_3"),w=0;w<s;++w)z(w)}else o(null,{});return i}u(Tt,"unzip");function Ut(n,r){for(var t={},e=n.length-22;N(n,e)!=101010256;--e)(!e||n.length-e>65558)&&g(13);var i=W(n,e+8);if(!i)return{};var a=N(n,e+16),o=a==4294967295;o&&(e=N(n,e-12),N(n,e)!=101075792&&g(13),i=N(n,e+32),a=N(n,e+48));for(var f=r&&r.filter,v=0;v<i;++v){var s=jn(n,a,o),h=s[0],c=s[1],y=s[2],z=s[3],w=s[4],x=s[5],l=Wn(n,x);a=w,(!f||f({name:z,size:c,originalSize:y,compression:h}))&&(h?h==8?t[z]=Fr(n.subarray(l,l+c),new D(y)):g(14,"unknown compression type "+h):t[z]=d(n,l,l+c))}return t}u(Ut,"unzipSync");export{ot as AsyncCompress,vt as AsyncDecompress,Xn as AsyncDeflate,bn as AsyncGunzip,ot as AsyncGzip,Nn as AsyncInflate,At as AsyncUnzipInflate,rt as AsyncUnzlib,yt as AsyncZipDeflate,st as AsyncZlib,pn as Compress,ct as DecodeUTF8,tt as Decompress,ar as Deflate,pt as EncodeUTF8,at as FlateErrorCode,Jr as Gunzip,pn as Gzip,K as Inflate,Mt as Unzip,zt as UnzipInflate,et as UnzipPassThrough,Qr as Unzlib,wt as Zip,gt as ZipDeflate,Nr as ZipPassThrough,yn as Zlib,ft as compress,gn as compressSync,ht as decompress,lt as decompressSync,dn as deflate,$r as deflateSync,_n as gunzip,Kr as gunzipSync,ft as gzip,gn as gzipSync,Rn as inflate,Fr as inflateSync,Hn as strFromU8,sr as strToU8,Tt as unzip,Ut as unzipSync,nt as unzlib,Vr as unzlibSync,mt as zip,xt as zipSync,ut as zlib,wn as zlibSync};
@@ -1 +1 @@
1
- import{b as a}from"./chunk-J5IUISYU.js";var e,c=a(()=>{e={env:{NODE_ENV:"production",npm_package_version:"6.0.1-alpha.2"}}});export{c as a,e as b};
1
+ import{b as a}from"./chunk-J5IUISYU.js";var e,c=a(()=>{e={env:{NODE_ENV:"production",npm_package_version:"6.0.1-alpha.4"}}});export{c as a,e as b};
@@ -1 +1 @@
1
- import{a as z}from"./chunk-VSBVGSLC.js";import{a as h,c as J}from"./chunk-J5IUISYU.js";var ue=J((ve,D)=>{"use strict";z();D.exports=C;D.exports.default=C;function C(e,t,n){n=n||2;var r=t&&t.length,x=r?t[0]*n:e.length,i=N(e,0,x,n,!0),u=[];if(!i||i.next===i.prev)return u;var f,o,v,c,l,s,g;if(r&&(i=Y(e,t,i,n)),e.length>80*n){f=v=e[0],o=c=e[1];for(var Z=n;Z<x;Z+=n)l=e[Z],s=e[Z+1],l<f&&(f=l),s<o&&(o=s),l>v&&(v=l),s>c&&(c=s);g=Math.max(v-f,c-o),g=g!==0?32767/g:0}return L(i,u,n,f,o,g,0),u}h(C,"earcut");function N(e,t,n,r,x){var i,u;if(x===B(e,t,n,r)>0)for(i=t;i<n;i+=r)u=K(i,e[i],e[i+1],u);else for(i=n-r;i>=t;i-=r)u=K(i,e[i],e[i+1],u);return u&&E(u,u.next)&&(H(u),u=u.next),u}h(N,"linkedList");function a(e,t){if(!e)return e;t||(t=e);var n=e,r;do if(r=!1,!n.steiner&&(E(n,n.next)||w(n.prev,n,n.next)===0)){if(H(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}h(a,"filterPoints");function L(e,t,n,r,x,i,u){if(e){!u&&i&&ee(e,r,x,i);for(var f=e,o,v;e.prev!==e.next;){if(o=e.prev,v=e.next,i?I(e,r,x,i):j(e)){t.push(o.i/n|0),t.push(e.i/n|0),t.push(v.i/n|0),H(e),e=v.next,f=v.next;continue}if(e=v,e===f){u?u===1?(e=S(a(e),t,n),L(e,t,n,r,x,i,2)):u===2&&X(e,t,n,r,x,i):L(a(e),t,n,r,x,i,1);break}}}}h(L,"earcutLinked");function j(e){var t=e.prev,n=e,r=e.next;if(w(t,n,r)>=0)return!1;for(var x=t.x,i=n.x,u=r.x,f=t.y,o=n.y,v=r.y,c=x<i?x<u?x:u:i<u?i:u,l=f<o?f<v?f:v:o<v?o:v,s=x>i?x>u?x:u:i>u?i:u,g=f>o?f>v?f:v:o>v?o:v,Z=r.next;Z!==t;){if(Z.x>=c&&Z.x<=s&&Z.y>=l&&Z.y<=g&&F(x,f,i,o,u,v,Z.x,Z.y)&&w(Z.prev,Z,Z.next)>=0)return!1;Z=Z.next}return!0}h(j,"isEar");function I(e,t,n,r){var x=e.prev,i=e,u=e.next;if(w(x,i,u)>=0)return!1;for(var f=x.x,o=i.x,v=u.x,c=x.y,l=i.y,s=u.y,g=f<o?f<v?f:v:o<v?o:v,Z=c<l?c<s?c:s:l<s?l:s,M=f>o?f>v?f:v:o>v?o:v,k=c>l?c>s?c:s:l>s?l:s,V=P(g,Z,t,n,r),G=P(M,k,t,n,r),p=e.prevZ,y=e.nextZ;p&&p.z>=V&&y&&y.z<=G;){if(p.x>=g&&p.x<=M&&p.y>=Z&&p.y<=k&&p!==x&&p!==u&&F(f,c,o,l,v,s,p.x,p.y)&&w(p.prev,p,p.next)>=0||(p=p.prevZ,y.x>=g&&y.x<=M&&y.y>=Z&&y.y<=k&&y!==x&&y!==u&&F(f,c,o,l,v,s,y.x,y.y)&&w(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;p&&p.z>=V;){if(p.x>=g&&p.x<=M&&p.y>=Z&&p.y<=k&&p!==x&&p!==u&&F(f,c,o,l,v,s,p.x,p.y)&&w(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;y&&y.z<=G;){if(y.x>=g&&y.x<=M&&y.y>=Z&&y.y<=k&&y!==x&&y!==u&&F(f,c,o,l,v,s,y.x,y.y)&&w(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}h(I,"isEarHashed");function S(e,t,n){var r=e;do{var x=r.prev,i=r.next.next;!E(x,i)&&U(x,r,r.next,i)&&_(x,i)&&_(i,x)&&(t.push(x.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),H(r),H(r.next),r=e=i),r=r.next}while(r!==e);return a(r)}h(S,"cureLocalIntersections");function X(e,t,n,r,x,i){var u=e;do{for(var f=u.next.next;f!==u.prev;){if(u.i!==f.i&&re(u,f)){var o=W(u,f);u=a(u,u.next),o=a(o,o.next),L(u,t,n,r,x,i,0),L(o,t,n,r,x,i,0);return}f=f.next}u=u.next}while(u!==e)}h(X,"splitEarcut");function Y(e,t,n,r){var x=[],i,u,f,o,v;for(i=0,u=t.length;i<u;i++)f=t[i]*r,o=i<u-1?t[i+1]*r:e.length,v=N(e,f,o,r,!1),v===v.next&&(v.steiner=!0),x.push(te(v));for(x.sort(q),i=0;i<x.length;i++)n=m(x[i],n);return n}h(Y,"eliminateHoles");function q(e,t){return e.x-t.x}h(q,"compareX");function m(e,t){var n=b(e,t);if(!n)return t;var r=W(n,e);return a(r,r.next),a(n,n.next)}h(m,"eliminateHole");function b(e,t){var n=t,r=e.x,x=e.y,i=-1/0,u;do{if(x<=n.y&&x>=n.next.y&&n.next.y!==n.y){var f=n.x+(x-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(f<=r&&f>i&&(i=f,u=n.x<n.next.x?n:n.next,f===r))return u}n=n.next}while(n!==t);if(!u)return null;var o=u,v=u.x,c=u.y,l=1/0,s;n=u;do r>=n.x&&n.x>=v&&r!==n.x&&F(x<c?r:i,x,v,c,x<c?i:r,x,n.x,n.y)&&(s=Math.abs(x-n.y)/(r-n.x),_(n,e)&&(s<l||s===l&&(n.x>u.x||n.x===u.x&&d(u,n)))&&(u=n,l=s)),n=n.next;while(n!==o);return u}h(b,"findHoleBridge");function d(e,t){return w(e.prev,e,t.prev)<0&&w(t.next,e,e.next)<0}h(d,"sectorContainsSector");function ee(e,t,n,r){var x=e;do x.z===0&&(x.z=P(x.x,x.y,t,n,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next;while(x!==e);x.prevZ.nextZ=null,x.prevZ=null,ne(x)}h(ee,"indexCurve");function ne(e){var t,n,r,x,i,u,f,o,v=1;do{for(n=e,e=null,i=null,u=0;n;){for(u++,r=n,f=0,t=0;t<v&&(f++,r=r.nextZ,!!r);t++);for(o=v;f>0||o>0&&r;)f!==0&&(o===0||!r||n.z<=r.z)?(x=n,n=n.nextZ,f--):(x=r,r=r.nextZ,o--),i?i.nextZ=x:e=x,x.prevZ=i,i=x;n=r}i.nextZ=null,v*=2}while(u>1);return e}h(ne,"sortLinked");function P(e,t,n,r,x){return e=(e-n)*x|0,t=(t-r)*x|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}h(P,"zOrder");function te(e){var t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}h(te,"getLeftmost");function F(e,t,n,r,x,i,u,f){return(x-u)*(t-f)>=(e-u)*(i-f)&&(e-u)*(r-f)>=(n-u)*(t-f)&&(n-u)*(i-f)>=(x-u)*(r-f)}h(F,"pointInTriangle");function re(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!xe(e,t)&&(_(e,t)&&_(t,e)&&ie(e,t)&&(w(e.prev,e,t.prev)||w(e,t.prev,t))||E(e,t)&&w(e.prev,e,e.next)>0&&w(t.prev,t,t.next)>0)}h(re,"isValidDiagonal");function w(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}h(w,"area");function E(e,t){return e.x===t.x&&e.y===t.y}h(E,"equals");function U(e,t,n,r){var x=A(w(e,t,n)),i=A(w(e,t,r)),u=A(w(n,r,e)),f=A(w(n,r,t));return!!(x!==i&&u!==f||x===0&&T(e,n,t)||i===0&&T(e,r,t)||u===0&&T(n,e,r)||f===0&&T(n,t,r))}h(U,"intersects");function T(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}h(T,"onSegment");function A(e){return e>0?1:e<0?-1:0}h(A,"sign");function xe(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&U(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}h(xe,"intersectsPolygon");function _(e,t){return w(e.prev,e,e.next)<0?w(e,t,e.next)>=0&&w(e,e.prev,t)>=0:w(e,t,e.prev)<0||w(e,e.next,t)<0}h(_,"locallyInside");function ie(e,t){var n=e,r=!1,x=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&n.next.y!==n.y&&x<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}h(ie,"middleInside");function W(e,t){var n=new Q(e.i,e.x,e.y),r=new Q(t.i,t.x,t.y),x=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=x,x.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}h(W,"splitPolygon");function K(e,t,n,r){var x=new Q(e,t,n);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}h(K,"insertNode");function H(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}h(H,"removeNode");function Q(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}h(Q,"Node");C.deviation=function(e,t,n,r){var x=t&&t.length,i=x?t[0]*n:e.length,u=Math.abs(B(e,0,i,n));if(x)for(var f=0,o=t.length;f<o;f++){var v=t[f]*n,c=f<o-1?t[f+1]*n:e.length;u-=Math.abs(B(e,v,c,n))}var l=0;for(f=0;f<r.length;f+=3){var s=r[f]*n,g=r[f+1]*n,Z=r[f+2]*n;l+=Math.abs((e[s]-e[Z])*(e[g+1]-e[s+1])-(e[s]-e[g])*(e[Z+1]-e[s+1]))}return u===0&&l===0?0:Math.abs((l-u)/u)};function B(e,t,n,r){for(var x=0,i=t,u=n-r;i<n;i+=r)x+=(e[u]-e[i])*(e[i+1]+e[u+1]),u=i;return x}h(B,"signedArea");C.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,x=0;x<e.length;x++){for(var i=0;i<e[x].length;i++)for(var u=0;u<t;u++)n.vertices.push(e[x][i][u]);x>0&&(r+=e[x-1].length,n.holes.push(r))}return n}});var fe=J((O,R)=>{z();(function(e,t){typeof O=="object"&&typeof R<"u"?R.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.TinyQueue=t())})(O,function(){"use strict";var e=h(function(r,x){if(r===void 0&&(r=[]),x===void 0&&(x=t),this.data=r,this.length=this.data.length,this.compare=x,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)},"TinyQueue");e.prototype.push=h(function(r){this.data.push(r),this.length++,this._up(this.length-1)},"push"),e.prototype.pop=h(function(){if(this.length!==0){var r=this.data[0],x=this.data.pop();return this.length--,this.length>0&&(this.data[0]=x,this._down(0)),r}},"pop"),e.prototype.peek=h(function(){return this.data[0]},"peek"),e.prototype._up=h(function(r){for(var x=this,i=x.data,u=x.compare,f=i[r];r>0;){var o=r-1>>1,v=i[o];if(u(f,v)>=0)break;i[r]=v,r=o}i[r]=f},"_up"),e.prototype._down=h(function(r){for(var x=this,i=x.data,u=x.compare,f=this.length>>1,o=i[r];r<f;){var v=(r<<1)+1,c=i[v],l=v+1;if(l<this.length&&u(i[l],c)<0&&(v=l,c=i[l]),u(c,o)>=0)break;i[r]=c,r=v}i[r]=o},"_down");function t(n,r){return n<r?-1:n>r?1:0}return h(t,"defaultCompare"),e})});export{fe as a,ue as b};
1
+ import{a as z}from"./chunk-JJHKNDAJ.js";import{a as h,c as J}from"./chunk-J5IUISYU.js";var ue=J((ve,D)=>{"use strict";z();D.exports=C;D.exports.default=C;function C(e,t,n){n=n||2;var r=t&&t.length,x=r?t[0]*n:e.length,i=N(e,0,x,n,!0),u=[];if(!i||i.next===i.prev)return u;var f,o,v,c,l,s,g;if(r&&(i=Y(e,t,i,n)),e.length>80*n){f=v=e[0],o=c=e[1];for(var Z=n;Z<x;Z+=n)l=e[Z],s=e[Z+1],l<f&&(f=l),s<o&&(o=s),l>v&&(v=l),s>c&&(c=s);g=Math.max(v-f,c-o),g=g!==0?32767/g:0}return L(i,u,n,f,o,g,0),u}h(C,"earcut");function N(e,t,n,r,x){var i,u;if(x===B(e,t,n,r)>0)for(i=t;i<n;i+=r)u=K(i,e[i],e[i+1],u);else for(i=n-r;i>=t;i-=r)u=K(i,e[i],e[i+1],u);return u&&E(u,u.next)&&(H(u),u=u.next),u}h(N,"linkedList");function a(e,t){if(!e)return e;t||(t=e);var n=e,r;do if(r=!1,!n.steiner&&(E(n,n.next)||w(n.prev,n,n.next)===0)){if(H(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}h(a,"filterPoints");function L(e,t,n,r,x,i,u){if(e){!u&&i&&ee(e,r,x,i);for(var f=e,o,v;e.prev!==e.next;){if(o=e.prev,v=e.next,i?I(e,r,x,i):j(e)){t.push(o.i/n|0),t.push(e.i/n|0),t.push(v.i/n|0),H(e),e=v.next,f=v.next;continue}if(e=v,e===f){u?u===1?(e=S(a(e),t,n),L(e,t,n,r,x,i,2)):u===2&&X(e,t,n,r,x,i):L(a(e),t,n,r,x,i,1);break}}}}h(L,"earcutLinked");function j(e){var t=e.prev,n=e,r=e.next;if(w(t,n,r)>=0)return!1;for(var x=t.x,i=n.x,u=r.x,f=t.y,o=n.y,v=r.y,c=x<i?x<u?x:u:i<u?i:u,l=f<o?f<v?f:v:o<v?o:v,s=x>i?x>u?x:u:i>u?i:u,g=f>o?f>v?f:v:o>v?o:v,Z=r.next;Z!==t;){if(Z.x>=c&&Z.x<=s&&Z.y>=l&&Z.y<=g&&F(x,f,i,o,u,v,Z.x,Z.y)&&w(Z.prev,Z,Z.next)>=0)return!1;Z=Z.next}return!0}h(j,"isEar");function I(e,t,n,r){var x=e.prev,i=e,u=e.next;if(w(x,i,u)>=0)return!1;for(var f=x.x,o=i.x,v=u.x,c=x.y,l=i.y,s=u.y,g=f<o?f<v?f:v:o<v?o:v,Z=c<l?c<s?c:s:l<s?l:s,M=f>o?f>v?f:v:o>v?o:v,k=c>l?c>s?c:s:l>s?l:s,V=P(g,Z,t,n,r),G=P(M,k,t,n,r),p=e.prevZ,y=e.nextZ;p&&p.z>=V&&y&&y.z<=G;){if(p.x>=g&&p.x<=M&&p.y>=Z&&p.y<=k&&p!==x&&p!==u&&F(f,c,o,l,v,s,p.x,p.y)&&w(p.prev,p,p.next)>=0||(p=p.prevZ,y.x>=g&&y.x<=M&&y.y>=Z&&y.y<=k&&y!==x&&y!==u&&F(f,c,o,l,v,s,y.x,y.y)&&w(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;p&&p.z>=V;){if(p.x>=g&&p.x<=M&&p.y>=Z&&p.y<=k&&p!==x&&p!==u&&F(f,c,o,l,v,s,p.x,p.y)&&w(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;y&&y.z<=G;){if(y.x>=g&&y.x<=M&&y.y>=Z&&y.y<=k&&y!==x&&y!==u&&F(f,c,o,l,v,s,y.x,y.y)&&w(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}h(I,"isEarHashed");function S(e,t,n){var r=e;do{var x=r.prev,i=r.next.next;!E(x,i)&&U(x,r,r.next,i)&&_(x,i)&&_(i,x)&&(t.push(x.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),H(r),H(r.next),r=e=i),r=r.next}while(r!==e);return a(r)}h(S,"cureLocalIntersections");function X(e,t,n,r,x,i){var u=e;do{for(var f=u.next.next;f!==u.prev;){if(u.i!==f.i&&re(u,f)){var o=W(u,f);u=a(u,u.next),o=a(o,o.next),L(u,t,n,r,x,i,0),L(o,t,n,r,x,i,0);return}f=f.next}u=u.next}while(u!==e)}h(X,"splitEarcut");function Y(e,t,n,r){var x=[],i,u,f,o,v;for(i=0,u=t.length;i<u;i++)f=t[i]*r,o=i<u-1?t[i+1]*r:e.length,v=N(e,f,o,r,!1),v===v.next&&(v.steiner=!0),x.push(te(v));for(x.sort(q),i=0;i<x.length;i++)n=m(x[i],n);return n}h(Y,"eliminateHoles");function q(e,t){return e.x-t.x}h(q,"compareX");function m(e,t){var n=b(e,t);if(!n)return t;var r=W(n,e);return a(r,r.next),a(n,n.next)}h(m,"eliminateHole");function b(e,t){var n=t,r=e.x,x=e.y,i=-1/0,u;do{if(x<=n.y&&x>=n.next.y&&n.next.y!==n.y){var f=n.x+(x-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(f<=r&&f>i&&(i=f,u=n.x<n.next.x?n:n.next,f===r))return u}n=n.next}while(n!==t);if(!u)return null;var o=u,v=u.x,c=u.y,l=1/0,s;n=u;do r>=n.x&&n.x>=v&&r!==n.x&&F(x<c?r:i,x,v,c,x<c?i:r,x,n.x,n.y)&&(s=Math.abs(x-n.y)/(r-n.x),_(n,e)&&(s<l||s===l&&(n.x>u.x||n.x===u.x&&d(u,n)))&&(u=n,l=s)),n=n.next;while(n!==o);return u}h(b,"findHoleBridge");function d(e,t){return w(e.prev,e,t.prev)<0&&w(t.next,e,e.next)<0}h(d,"sectorContainsSector");function ee(e,t,n,r){var x=e;do x.z===0&&(x.z=P(x.x,x.y,t,n,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next;while(x!==e);x.prevZ.nextZ=null,x.prevZ=null,ne(x)}h(ee,"indexCurve");function ne(e){var t,n,r,x,i,u,f,o,v=1;do{for(n=e,e=null,i=null,u=0;n;){for(u++,r=n,f=0,t=0;t<v&&(f++,r=r.nextZ,!!r);t++);for(o=v;f>0||o>0&&r;)f!==0&&(o===0||!r||n.z<=r.z)?(x=n,n=n.nextZ,f--):(x=r,r=r.nextZ,o--),i?i.nextZ=x:e=x,x.prevZ=i,i=x;n=r}i.nextZ=null,v*=2}while(u>1);return e}h(ne,"sortLinked");function P(e,t,n,r,x){return e=(e-n)*x|0,t=(t-r)*x|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}h(P,"zOrder");function te(e){var t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}h(te,"getLeftmost");function F(e,t,n,r,x,i,u,f){return(x-u)*(t-f)>=(e-u)*(i-f)&&(e-u)*(r-f)>=(n-u)*(t-f)&&(n-u)*(i-f)>=(x-u)*(r-f)}h(F,"pointInTriangle");function re(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!xe(e,t)&&(_(e,t)&&_(t,e)&&ie(e,t)&&(w(e.prev,e,t.prev)||w(e,t.prev,t))||E(e,t)&&w(e.prev,e,e.next)>0&&w(t.prev,t,t.next)>0)}h(re,"isValidDiagonal");function w(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}h(w,"area");function E(e,t){return e.x===t.x&&e.y===t.y}h(E,"equals");function U(e,t,n,r){var x=A(w(e,t,n)),i=A(w(e,t,r)),u=A(w(n,r,e)),f=A(w(n,r,t));return!!(x!==i&&u!==f||x===0&&T(e,n,t)||i===0&&T(e,r,t)||u===0&&T(n,e,r)||f===0&&T(n,t,r))}h(U,"intersects");function T(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}h(T,"onSegment");function A(e){return e>0?1:e<0?-1:0}h(A,"sign");function xe(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&U(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}h(xe,"intersectsPolygon");function _(e,t){return w(e.prev,e,e.next)<0?w(e,t,e.next)>=0&&w(e,e.prev,t)>=0:w(e,t,e.prev)<0||w(e,e.next,t)<0}h(_,"locallyInside");function ie(e,t){var n=e,r=!1,x=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&n.next.y!==n.y&&x<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}h(ie,"middleInside");function W(e,t){var n=new Q(e.i,e.x,e.y),r=new Q(t.i,t.x,t.y),x=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=x,x.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}h(W,"splitPolygon");function K(e,t,n,r){var x=new Q(e,t,n);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}h(K,"insertNode");function H(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}h(H,"removeNode");function Q(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}h(Q,"Node");C.deviation=function(e,t,n,r){var x=t&&t.length,i=x?t[0]*n:e.length,u=Math.abs(B(e,0,i,n));if(x)for(var f=0,o=t.length;f<o;f++){var v=t[f]*n,c=f<o-1?t[f+1]*n:e.length;u-=Math.abs(B(e,v,c,n))}var l=0;for(f=0;f<r.length;f+=3){var s=r[f]*n,g=r[f+1]*n,Z=r[f+2]*n;l+=Math.abs((e[s]-e[Z])*(e[g+1]-e[s+1])-(e[s]-e[g])*(e[Z+1]-e[s+1]))}return u===0&&l===0?0:Math.abs((l-u)/u)};function B(e,t,n,r){for(var x=0,i=t,u=n-r;i<n;i+=r)x+=(e[u]-e[i])*(e[i+1]+e[u+1]),u=i;return x}h(B,"signedArea");C.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,x=0;x<e.length;x++){for(var i=0;i<e[x].length;i++)for(var u=0;u<t;u++)n.vertices.push(e[x][i][u]);x>0&&(r+=e[x-1].length,n.holes.push(r))}return n}});var fe=J((O,R)=>{z();(function(e,t){typeof O=="object"&&typeof R<"u"?R.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.TinyQueue=t())})(O,function(){"use strict";var e=h(function(r,x){if(r===void 0&&(r=[]),x===void 0&&(x=t),this.data=r,this.length=this.data.length,this.compare=x,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)},"TinyQueue");e.prototype.push=h(function(r){this.data.push(r),this.length++,this._up(this.length-1)},"push"),e.prototype.pop=h(function(){if(this.length!==0){var r=this.data[0],x=this.data.pop();return this.length--,this.length>0&&(this.data[0]=x,this._down(0)),r}},"pop"),e.prototype.peek=h(function(){return this.data[0]},"peek"),e.prototype._up=h(function(r){for(var x=this,i=x.data,u=x.compare,f=i[r];r>0;){var o=r-1>>1,v=i[o];if(u(f,v)>=0)break;i[r]=v,r=o}i[r]=f},"_up"),e.prototype._down=h(function(r){for(var x=this,i=x.data,u=x.compare,f=this.length>>1,o=i[r];r<f;){var v=(r<<1)+1,c=i[v],l=v+1;if(l<this.length&&u(i[l],c)<0&&(v=l,c=i[l]),u(c,o)>=0)break;i[r]=c,r=v}i[r]=o},"_down");function t(n,r){return n<r?-1:n>r?1:0}return h(t,"defaultCompare"),e})});export{fe as a,ue as b};