@mappedin/react-sdk 6.0.1-beta.10
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/LICENSE.txt +104 -0
- package/README.md +48 -0
- package/THIRD_PARTY_LICENSES.txt +26149 -0
- package/lib/esm/GLTFExporter-XOP3B7V5.js +1 -0
- package/lib/esm/GLTFLoader-HKCKJXQO.js +1 -0
- package/lib/esm/browser-4BG3CNXW.js +1 -0
- package/lib/esm/chunk-A6QTJRY4.js +1 -0
- package/lib/esm/chunk-CBWWQFNR.js +1 -0
- package/lib/esm/chunk-GLHDHW4V.js +1 -0
- package/lib/esm/chunk-TKFKQMTK.js +1 -0
- package/lib/esm/chunk-TOAXR4PM.js +1 -0
- package/lib/esm/chunk-X4O3T5J7.js +1 -0
- package/lib/esm/index.css +1 -0
- package/lib/esm/index.d.ts +25494 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/inspector-OZDC5DPH.css +1 -0
- package/lib/esm/inspector-UEEF2NXG.js +1 -0
- package/lib/esm/internal-RLMP6WAM.js +1 -0
- package/lib/esm/outdoor-context-v4-6FK55GUT.js +1 -0
- package/package.json +38 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as Ye,D,G as W,J as Ke,M as _,O as je,Pa as z,Q as qe,Qa as Ze,S as Xe,U as We,X as Je,Z as P,c as _e,d as Ce,e as Ue,f as ve,g as Le,h as Oe,i as De,j as Pe,k as ze,l as Be,n as Fe,na as Y,o as ke,oa as Qe,p as He,t as Ve,u as V,w as G,z as Ge}from"./chunk-TKFKQMTK.js";import{a as T,j as H}from"./chunk-GLHDHW4V.js";H();H();var B,J,U,K;function j(c,e=1/0,s=null){J||(J=new We(2,2,1,1)),U||(U=new qe({uniforms:{blitTexture:new Ze(c)},vertexShader:"\n varying vec2 vUv;\n void main(){\n vUv = uv;\n gl_Position = vec4(position.xy * 1.0,0.,.999999);\n }",fragmentShader:"\n uniform sampler2D blitTexture; \n varying vec2 vUv;\n\n void main(){ \n gl_FragColor = vec4(vUv.xy, 0, 1);\n \n #ifdef IS_SRGB\n gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) );\n #else\n gl_FragColor = texture2D( blitTexture, vUv);\n #endif\n }"})),U.uniforms.blitTexture.value=c,U.defines.IS_SRGB=c.colorSpace==V,U.needsUpdate=!0,K||(K=new je(J,U),K.frustrumCulled=!1);let r=new Xe,t=new P;t.add(K),s===null&&(s=B=new Je({antialias:!1}));let i=Math.min(c.image.width,e),n=Math.min(c.image.height,e);s.setSize(i,n),s.clear(),s.render(t,r);let o=document.createElement("canvas"),a=o.getContext("2d");o.width=i,o.height=n,a.drawImage(s.domElement,0,0,i,n);let u=new Qe(o);return u.minFilter=c.minFilter,u.magFilter=c.magFilter,u.wrapS=c.wrapS,u.wrapT=c.wrapT,u.name=c.name,B&&(B.forceContextLoss(),B.dispose(),B=null),u}T(j,"decompress");var $e={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"]},pe=class pe{constructor(){this.pluginCallbacks=[],this.register(function(e){return new ee(e)}),this.register(function(e){return new se(e)}),this.register(function(e){return new re(e)}),this.register(function(e){return new ie(e)}),this.register(function(e){return new oe(e)}),this.register(function(e){return new ae(e)}),this.register(function(e){return new te(e)}),this.register(function(e){return new ne(e)}),this.register(function(e){return new ce(e)}),this.register(function(e){return new ue(e)}),this.register(function(e){return new le(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new he(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,r,t){let i=new $,n=[];for(let o=0,a=this.pluginCallbacks.length;o<a;o++)n.push(this.pluginCallbacks[o](i));i.setPlugins(n),i.write(e,s,t).catch(r)}parseAsync(e,s){let r=this;return new Promise(function(t,i){r.parse(e,t,i,s)})}};T(pe,"GLTFExporter");var q=pe,x={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},Q="KHR_mesh_quantization",b={};b[Le]=x.NEAREST;b[Oe]=x.NEAREST_MIPMAP_NEAREST;b[De]=x.NEAREST_MIPMAP_LINEAR;b[Pe]=x.LINEAR;b[ze]=x.LINEAR_MIPMAP_NEAREST;b[Be]=x.LINEAR_MIPMAP_LINEAR;b[Ue]=x.CLAMP_TO_EDGE;b[Ce]=x.REPEAT;b[ve]=x.MIRRORED_REPEAT;var es={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},cs=new Ke,ss=12,us=1179937895,ls=2,ts=8,fs=1313821514,hs=5130562;function F(c,e){return c.length===e.length&&c.every(function(s,r){return s===e[r]})}T(F,"equalArray");function ps(c){return new TextEncoder().encode(c).buffer}T(ps,"stringToArrayBuffer");function ds(c){return F(c.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}T(ds,"isIdentityMatrix");function gs(c,e,s){let r={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 i=0;i<c.itemSize;i++){let n;c.itemSize>4?n=c.array[t*c.itemSize+i]:(i===0?n=c.getX(t):i===1?n=c.getY(t):i===2?n=c.getZ(t):i===3&&(n=c.getW(t)),c.normalized===!0&&(n=G.normalize(n,c.array))),r.min[i]=Math.min(r.min[i],n),r.max[i]=Math.max(r.max[i],n)}return r}T(gs,"getMinMax");function is(c){return Math.ceil(c/4)*4}T(is,"getPaddedBufferSize");function Z(c,e=0){let s=is(c.byteLength);if(s!==c.byteLength){let r=new Uint8Array(s);if(r.set(new Uint8Array(c)),e!==0)for(let t=c.byteLength;t<s;t++)r[t]=e;return r.buffer}return c}T(Z,"getPaddedArrayBuffer");function ns(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}T(ns,"getCanvas");function rs(c,e){if(c.toBlob!==void 0)return new Promise(r=>c.toBlob(r,e));let s;return e==="image/jpeg"?s=.92:e==="image/webp"&&(s=.8),c.convertToBlob({type:e,quality:s})}T(rs,"getToBlobPromise");var de=class de{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,r={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);let t=this,i=t.buffers,n=t.json;r=t.options;let o=t.extensionsUsed,a=t.extensionsRequired,u=new Blob(i,{type:"application/octet-stream"}),p=Object.keys(o),f=Object.keys(a);if(p.length>0&&(n.extensionsUsed=p),f.length>0&&(n.extensionsRequired=f),n.buffers&&n.buffers.length>0&&(n.buffers[0].byteLength=u.size),r.binary===!0){let m=new FileReader;m.readAsArrayBuffer(u),m.onloadend=function(){let l=Z(m.result),d=new DataView(new ArrayBuffer(ts));d.setUint32(0,l.byteLength,!0),d.setUint32(4,hs,!0);let h=Z(ps(JSON.stringify(n)),32),w=new DataView(new ArrayBuffer(ts));w.setUint32(0,h.byteLength,!0),w.setUint32(4,fs,!0);let M=new ArrayBuffer(ss),N=new DataView(M);N.setUint32(0,us,!0),N.setUint32(4,ls,!0);let k=ss+w.byteLength+h.byteLength+d.byteLength+l.byteLength;N.setUint32(8,k,!0);let g=new Blob([M,w,h,d,l],{type:"application/octet-stream"}),y=new FileReader;y.readAsArrayBuffer(g),y.onloadend=function(){s(y.result)}}}else if(n.buffers&&n.buffers.length>0){let m=new FileReader;m.readAsDataURL(u),m.onloadend=function(){let l=m.result;n.buffers[0].uri=l,s(n)}}else s(n)}serializeUserData(e,s){if(Object.keys(e.userData).length===0)return;let r=this.options,t=this.extensionsUsed;try{let i=JSON.parse(JSON.stringify(e.userData));if(r.includeCustomExtensions&&i.gltfExtensions){s.extensions===void 0&&(s.extensions={});for(let n in i.gltfExtensions)s.extensions[n]=i.gltfExtensions[n],t[n]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(s.extras=i)}catch(i){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+i.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 r=new D;for(let t=0,i=e.count;t<i;t++)if(Math.abs(r.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 r=e.clone(),t=new D;for(let i=0,n=r.count;i<n;i++)t.fromBufferAttribute(r,i),t.x===0&&t.y===0&&t.z===0?t.setX(1):t.normalize(),r.setXYZ(i,t.x,t.y,t.z);return s.attributesNormalized.set(e,r),r}applyTextureTransform(e,s){let r=!1,t={};(s.offset.x!==0||s.offset.y!==0)&&(t.offset=s.offset.toArray(),r=!0),s.rotation!==0&&(t.rotation=s.rotation,r=!0),(s.repeat.x!==1||s.repeat.y!==1)&&(t.scale=s.repeat.toArray(),r=!0),r&&(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 r(l){return l.colorSpace===V?T(function(h){return h<.04045?h*.0773993808:Math.pow(h*.9478672986+.0521327014,2.4)},"SRGBToLinear"):T(function(h){return h},"LinearToLinear")}T(r,"getEncodingConversion"),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof Y&&(e=j(e)),s instanceof Y&&(s=j(s));let t=e?e.image:null,i=s?s.image:null,n=Math.max(t?t.width:0,i?i.width:0),o=Math.max(t?t.height:0,i?i.height:0),a=ns();a.width=n,a.height=o;let u=a.getContext("2d");u.fillStyle="#00ffff",u.fillRect(0,0,n,o);let p=u.getImageData(0,0,n,o);if(t){u.drawImage(t,0,0,n,o);let l=r(e),d=u.getImageData(0,0,n,o).data;for(let h=2;h<d.length;h+=4)p.data[h]=l(d[h]/256)*256}if(i){u.drawImage(i,0,0,n,o);let l=r(s),d=u.getImageData(0,0,n,o).data;for(let h=1;h<d.length;h+=4)p.data[h]=l(d[h]/256)*256}u.putImageData(p,0,0);let m=(e||s).clone();return m.source=new Ge(a),m.colorSpace=Ve,m.channel=(e||s).channel,e&&s&&e.channel!==s.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),m}processBuffer(e){let s=this.json,r=this.buffers;return s.buffers||(s.buffers=[{byteLength:0}]),r.push(e),0}processBufferView(e,s,r,t,i){let n=this.json;n.bufferViews||(n.bufferViews=[]);let o;switch(s){case x.BYTE:case x.UNSIGNED_BYTE:o=1;break;case x.SHORT:case x.UNSIGNED_SHORT:o=2;break;default:o=4}let a=is(t*e.itemSize*o),u=new DataView(new ArrayBuffer(a)),p=0;for(let l=r;l<r+t;l++)for(let d=0;d<e.itemSize;d++){let h;e.itemSize>4?h=e.array[l*e.itemSize+d]:(d===0?h=e.getX(l):d===1?h=e.getY(l):d===2?h=e.getZ(l):d===3&&(h=e.getW(l)),e.normalized===!0&&(h=G.normalize(h,e.array))),s===x.FLOAT?u.setFloat32(p,h,!0):s===x.INT?u.setInt32(p,h,!0):s===x.UNSIGNED_INT?u.setUint32(p,h,!0):s===x.SHORT?u.setInt16(p,h,!0):s===x.UNSIGNED_SHORT?u.setUint16(p,h,!0):s===x.BYTE?u.setInt8(p,h):s===x.UNSIGNED_BYTE&&u.setUint8(p,h),p+=o}let f={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:a};return i!==void 0&&(f.target=i),i===x.ARRAY_BUFFER&&(f.byteStride=e.itemSize*o),this.byteOffset+=a,n.bufferViews.push(f),{id:n.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let s=this,r=s.json;return r.bufferViews||(r.bufferViews=[]),new Promise(function(t){let i=new FileReader;i.readAsArrayBuffer(e),i.onloadend=function(){let n=Z(i.result),o={buffer:s.processBuffer(n),byteOffset:s.byteOffset,byteLength:n.byteLength};s.byteOffset+=n.byteLength,t(r.bufferViews.push(o)-1)}})}processAccessor(e,s,r,t){let i=this.json,n={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"},o;if(e.array.constructor===Float32Array)o=x.FLOAT;else if(e.array.constructor===Int32Array)o=x.INT;else if(e.array.constructor===Uint32Array)o=x.UNSIGNED_INT;else if(e.array.constructor===Int16Array)o=x.SHORT;else if(e.array.constructor===Uint16Array)o=x.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)o=x.BYTE;else if(e.array.constructor===Uint8Array)o=x.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(r===void 0&&(r=0),(t===void 0||t===1/0)&&(t=e.count),t===0)return null;let a=gs(e,r,t),u;s!==void 0&&(u=e===s.index?x.ELEMENT_ARRAY_BUFFER:x.ARRAY_BUFFER);let p=this.processBufferView(e,o,r,t,u),f={bufferView:p.id,byteOffset:p.byteOffset,componentType:o,count:t,max:a.max,min:a.min,type:n[e.itemSize]};return e.normalized===!0&&(f.normalized=!0),i.accessors||(i.accessors=[]),i.accessors.push(f)-1}processImage(e,s,r,t="image/png"){if(e!==null){let i=this,n=i.cache,o=i.json,a=i.options,u=i.pending;n.images.has(e)||n.images.set(e,{});let p=n.images.get(e),f=t+":flipY/"+r.toString();if(p[f]!==void 0)return p[f];o.images||(o.images=[]);let m={mimeType:t},l=ns();l.width=Math.min(e.width,a.maxTextureSize),l.height=Math.min(e.height,a.maxTextureSize);let d=l.getContext("2d");if(r===!0&&(d.translate(0,l.height),d.scale(1,-1)),e.data!==void 0){s!==Fe&&console.error("GLTFExporter: Only RGBAFormat is supported.",s),(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 M=0;M<w.length;M+=4)w[M+0]=e.data[M+0],w[M+1]=e.data[M+1],w[M+2]=e.data[M+2],w[M+3]=e.data[M+3];d.putImageData(new ImageData(w,e.width,e.height),0,0)}else if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap)d.drawImage(e,0,0,l.width,l.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement or ImageBitmap.");a.binary===!0?u.push(rs(l,t).then(w=>i.processBufferViewImage(w)).then(w=>{m.bufferView=w})):l.toDataURL!==void 0?m.uri=l.toDataURL(t):u.push(rs(l,t).then(w=>new FileReader().readAsDataURL(w)).then(w=>{m.uri=w}));let h=o.images.push(m)-1;return p[f]=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 r={magFilter:b[e.magFilter],minFilter:b[e.minFilter],wrapS:b[e.wrapS],wrapT:b[e.wrapT]};return s.samplers.push(r)-1}processTexture(e){let r=this.options,t=this.cache,i=this.json;if(t.textures.has(e))return t.textures.get(e);i.textures||(i.textures=[]),e instanceof Y&&(e=j(e,r.maxTextureSize));let n=e.userData.mimeType;n==="image/webp"&&(n="image/png");let o={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,n)};e.name&&(o.name=e.name),this._invokeAll(function(u){u.writeTexture&&u.writeTexture(e,o)});let a=i.textures.push(o)-1;return t.textures.set(e,a),a}processMaterial(e){let s=this.cache,r=this.json;if(s.materials.has(e))return s.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.materials=[]);let t={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let i=e.color.toArray().concat([e.opacity]);if(F(i,[1,1,1,1])||(t.pbrMetallicRoughness.baseColorFactor=i),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),channel:o.channel};this.applyTextureTransform(a,o),t.pbrMetallicRoughness.metallicRoughnessTexture=a}if(e.map){let o={index:this.processTexture(e.map),texCoord:e.map.channel};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),texCoord:e.emissiveMap.channel};this.applyTextureTransform(u,e.emissiveMap),t.emissiveTexture=u}}if(e.normalMap){let o={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};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:e.aoMap.channel};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===_e&&(t.doubleSided=!0),e.name!==""&&(t.name=e.name),this.serializeUserData(e,t),this._invokeAll(function(o){o.writeMaterial&&o.writeMaterial(e,t)});let n=r.materials.push(t)-1;return s.materials.set(e,n),n}processMesh(e){let s=this.cache,r=this.json,t=[e.geometry.uuid];if(Array.isArray(e.material))for(let g=0,y=e.material.length;g<y;g++)t.push(e.material[g].uuid);else t.push(e.material.uuid);let i=t.join(":");if(s.meshes.has(i))return s.meshes.get(i);let n=e.geometry,o;e.isLineSegments?o=x.LINES:e.isLineLoop?o=x.LINE_LOOP:e.isLine?o=x.LINE_STRIP:e.isPoints?o=x.POINTS:o=e.material.wireframe?x.LINES:x.TRIANGLES;let a={},u={},p=[],f=[],m={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},l=n.getAttribute("normal");l!==void 0&&!this.isNormalizedNormalAttribute(l)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),n.setAttribute("normal",this.createNormalizedNormalAttribute(l)));let d=null;for(let g in n.attributes){if(g.slice(0,5)==="morph")continue;let y=n.attributes[g];if(g=m[g]||g.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(g)||(g="_"+g),s.attributes.has(this.getUID(y))){u[g]=s.attributes.get(this.getUID(y));continue}d=null;let A=y.array;g==="JOINTS_0"&&!(A instanceof Uint16Array)&&!(A instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),d=new _(new Uint16Array(A),y.itemSize,y.normalized));let E=this.processAccessor(d||y,n);E!==null&&(g.startsWith("_")||this.detectMeshQuantization(g,y),u[g]=E,s.attributes.set(this.getUID(y),E))}if(l!==void 0&&n.setAttribute("normal",l),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){let g=[],y=[],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 E={},Se=!1;for(let v in n.morphAttributes){if(v!=="position"&&v!=="normal"){Se||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),Se=!0);continue}let S=n.morphAttributes[v][A],X=v.toUpperCase(),L=n.attributes[v];if(s.attributes.has(this.getUID(S,!0))){E[X]=s.attributes.get(this.getUID(S,!0));continue}let O=S.clone();if(!n.morphTargetsRelative)for(let R=0,os=S.count;R<os;R++)for(let C=0;C<S.itemSize;C++)C===0&&O.setX(R,S.getX(R)-L.getX(R)),C===1&&O.setY(R,S.getY(R)-L.getY(R)),C===2&&O.setZ(R,S.getZ(R)-L.getZ(R)),C===3&&O.setW(R,S.getW(R)-L.getW(R));E[X]=this.processAccessor(O,n),s.attributes.set(this.getUID(L,!0),E[X])}f.push(E),g.push(e.morphTargetInfluences[A]),e.morphTargetDictionary!==void 0&&y.push(I[A])}a.weights=g,y.length>0&&(a.extras={},a.extras.targetNames=y)}let h=Array.isArray(e.material);if(h&&n.groups.length===0)return null;let w=!1;if(h&&n.index===null){let g=[];for(let y=0,I=n.attributes.position.count;y<I;y++)g[y]=y;n.setIndex(g),w=!0}let M=h?e.material:[e.material],N=h?n.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let g=0,y=N.length;g<y;g++){let I={mode:o,attributes:u};if(this.serializeUserData(n,I),f.length>0&&(I.targets=f),n.index!==null){let E=this.getUID(n.index);(N[g].start!==void 0||N[g].count!==void 0)&&(E+=":"+N[g].start+":"+N[g].count),s.attributes.has(E)?I.indices=s.attributes.get(E):(I.indices=this.processAccessor(n.index,n,N[g].start,N[g].count),s.attributes.set(E,I.indices)),I.indices===null&&delete I.indices}let A=this.processMaterial(M[N[g].materialIndex]);A!==null&&(I.material=A),p.push(I)}w===!0&&n.setIndex(null),a.primitives=p,r.meshes||(r.meshes=[]),this._invokeAll(function(g){g.writeMesh&&g.writeMesh(e,a)});let k=r.meshes.push(a)-1;return s.meshes.set(i,k),k}detectMeshQuantization(e,s){if(this.extensionsUsed[Q])return;let r;switch(s.array.constructor){case Int8Array:r="byte";break;case Uint8Array:r="unsigned byte";break;case Int16Array:r="short";break;case Uint16Array:r="unsigned short";break;default:return}s.normalized&&(r+=" normalized");let t=e.split("_",1)[0];$e[t]&&$e[t].includes(r)&&(this.extensionsUsed[Q]=!0,this.extensionsRequired[Q]=!0)}processCamera(e){let s=this.json;s.cameras||(s.cameras=[]);let r=e.isOrthographicCamera,t={type:r?"orthographic":"perspective"};return r?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:G.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 r=this.json,t=this.nodeMap;r.animations||(r.animations=[]),e=q.Utils.mergeMorphTargetTracks(e.clone(),s);let i=e.tracks,n=[],o=[];for(let a=0;a<i.length;++a){let u=i[a],p=z.parseTrackName(u.name),f=z.findNode(s,p.nodeName),m=es[p.propertyName];if(p.objectName==="bones"&&(f.isSkinnedMesh===!0?f=f.skeleton.getBoneByName(p.objectIndex):f=void 0),!f||!m)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',u.name),null;let l=1,d=u.values.length/u.times.length;m===es.morphTargetInfluences&&(d/=f.morphTargetInfluences.length);let h;u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(h="CUBICSPLINE",d/=3):u.getInterpolation()===ke?h="STEP":h="LINEAR",o.push({input:this.processAccessor(new _(u.times,l)),output:this.processAccessor(new _(u.values,d)),interpolation:h}),n.push({sampler:o.length-1,target:{node:t.get(f),path:m}})}return r.animations.push({name:e.name||"clip_"+r.animations.length,samplers:o,channels:n}),r.animations.length-1}processSkin(e){let s=this.json,r=this.nodeMap,t=s.nodes[r.get(e)],i=e.skeleton;if(i===void 0)return null;let n=e.skeleton.bones[0];if(n===void 0)return null;let o=[],a=new Float32Array(i.bones.length*16),u=new W;for(let f=0;f<i.bones.length;++f)o.push(r.get(i.bones[f])),u.copy(i.boneInverses[f]),u.multiply(e.bindMatrix).toArray(a,f*16);return s.skins===void 0&&(s.skins=[]),s.skins.push({inverseBindMatrices:this.processAccessor(new _(a,16)),joints:o,skeleton:r.get(n)}),t.skin=s.skins.length-1}processNode(e){let s=this.json,r=this.options,t=this.nodeMap;s.nodes||(s.nodes=[]);let i={};if(r.trs){let o=e.quaternion.toArray(),a=e.position.toArray(),u=e.scale.toArray();F(o,[0,0,0,1])||(i.rotation=o),F(a,[0,0,0])||(i.translation=a),F(u,[1,1,1])||(i.scale=u)}else e.matrixAutoUpdate&&e.updateMatrix(),ds(e.matrix)===!1&&(i.matrix=e.matrix.elements);if(e.name!==""&&(i.name=String(e.name)),this.serializeUserData(e,i),e.isMesh||e.isLine||e.isPoints){let o=this.processMesh(e);o!==null&&(i.mesh=o)}else e.isCamera&&(i.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 p=e.children[a];if(p.visible||r.onlyVisible===!1){let f=this.processNode(p);f!==null&&o.push(f)}}o.length>0&&(i.children=o)}this._invokeAll(function(o){o.writeNode&&o.writeNode(e,i)});let n=s.nodes.push(i)-1;return t.set(e,n),n}processScene(e){let s=this.json,r=this.options;s.scenes||(s.scenes=[],s.scene=0);let t={};e.name!==""&&(t.name=e.name),s.scenes.push(t);let i=[];for(let n=0,o=e.children.length;n<o;n++){let a=e.children[n];if(a.visible||r.onlyVisible===!1){let u=this.processNode(a);u!==null&&i.push(u)}}i.length>0&&(t.nodes=i),this.serializeUserData(e,t)}processObjects(e){let s=new P;s.name="AuxScene";for(let r=0;r<e.length;r++)s.children.push(e[r]);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 r=[];for(let t=0;t<e.length;t++)e[t]instanceof P?this.processScene(e[t]):r.push(e[t]);r.length>0&&this.processObjects(r);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,r=this.plugins.length;s<r;s++)e(this.plugins[s])}};T(de,"GLTFWriter");var $=de,ge=class ge{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 r=this.writer,t=r.json,i=r.extensionsUsed,n={};e.name&&(n.name=e.name),n.color=e.color.toArray(),n.intensity=e.intensity,e.isDirectionalLight?n.type="directional":e.isPointLight?(n.type="point",e.distance>0&&(n.range=e.distance)):e.isSpotLight&&(n.type="spot",e.distance>0&&(n.range=e.distance),n.spot={},n.spot.innerConeAngle=(1-e.penumbra)*e.angle,n.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."),i[this.name]||(t.extensions=t.extensions||{},t.extensions[this.name]={lights:[]},i[this.name]=!0);let o=t.extensions[this.name].lights;o.push(n),s.extensions=s.extensions||{},s.extensions[this.name]={light:o.length-1}}};T(ge,"GLTFLightExtension");var ee=ge,xe=class xe{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(xe,"GLTFMaterialsUnlitExtension");var se=xe,me=class me{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;let r=this.writer,t=r.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){let n={index:r.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};r.applyTextureTransform(n,e.clearcoatMap),i.clearcoatTexture=n}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let n={index:r.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};r.applyTextureTransform(n,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=n}if(e.clearcoatNormalMap){let n={index:r.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};r.applyTextureTransform(n,e.clearcoatNormalMap),i.clearcoatNormalTexture=n}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(me,"GLTFMaterialsClearcoatExtension");var te=me,Te=class Te{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;let r=this.writer,t=r.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){let n={index:r.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};r.applyTextureTransform(n,e.iridescenceMap),i.iridescenceTexture=n}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let n={index:r.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};r.applyTextureTransform(n,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=n}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Te,"GLTFMaterialsIridescenceExtension");var ne=Te,ye=class ye{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let r=this.writer,t=r.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){let n={index:r.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};r.applyTextureTransform(n,e.transmissionMap),i.transmissionTexture=n}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(ye,"GLTFMaterialsTransmissionExtension");var re=ye,we=class we{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let r=this.writer,t=r.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){let n={index:r.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};r.applyTextureTransform(n,e.thicknessMap),i.thicknessTexture=n}i.attenuationDistance=e.attenuationDistance,i.attenuationColor=e.attenuationColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(we,"GLTFMaterialsVolumeExtension");var ie=we,Me=class Me{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,i={};i.ior=e.ior,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Me,"GLTFMaterialsIorExtension");var oe=Me,Ie=class Ie{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(cs)&&!e.specularIntensityMap&&!e.specularColorMap)return;let r=this.writer,t=r.extensionsUsed,i={};if(e.specularIntensityMap){let n={index:r.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};r.applyTextureTransform(n,e.specularIntensityMap),i.specularTexture=n}if(e.specularColorMap){let n={index:r.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};r.applyTextureTransform(n,e.specularColorMap),i.specularColorTexture=n}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Ie,"GLTFMaterialsSpecularExtension");var ae=Ie,Ae=class Ae{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;let r=this.writer,t=r.extensionsUsed,i={};if(e.sheenRoughnessMap){let n={index:r.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};r.applyTextureTransform(n,e.sheenRoughnessMap),i.sheenRoughnessTexture=n}if(e.sheenColorMap){let n={index:r.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};r.applyTextureTransform(n,e.sheenColorMap),i.sheenColorTexture=n}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Ae,"GLTFMaterialsSheenExtension");var ce=Ae,Re=class Re{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;let r=this.writer,t=r.extensionsUsed,i={};if(e.anisotropyMap){let n={index:r.processTexture(e.anisotropyMap)};r.applyTextureTransform(n,e.anisotropyMap),i.anisotropyTexture=n}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Re,"GLTFMaterialsAnisotropyExtension");var ue=Re,Ee=class Ee{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,i={};i.emissiveStrength=e.emissiveIntensity,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Ee,"GLTFMaterialsEmissiveStrengthExtension");var le=Ee,be=class be{constructor(e){this.writer=e,this.name="EXT_materials_bump"}writeMaterial(e,s){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;let r=this.writer,t=r.extensionsUsed,i={};if(e.bumpMap){let n={index:r.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};r.applyTextureTransform(n,e.bumpMap),i.bumpTexture=n}i.bumpFactor=e.bumpScale,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(be,"GLTFMaterialsBumpExtension");var fe=be,Ne=class Ne{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,s){if(!e.isInstancedMesh)return;let r=this.writer,t=e,i=new Float32Array(t.count*3),n=new Float32Array(t.count*4),o=new Float32Array(t.count*3),a=new W,u=new D,p=new Ye,f=new D;for(let l=0;l<t.count;l++)t.getMatrixAt(l,a),a.decompose(u,p,f),u.toArray(i,l*3),p.toArray(n,l*4),f.toArray(o,l*3);let m={TRANSLATION:r.processAccessor(new _(i,3)),ROTATION:r.processAccessor(new _(n,4)),SCALE:r.processAccessor(new _(o,3))};t.instanceColor&&(m._COLOR_0=r.processAccessor(t.instanceColor)),s.extensions=s.extensions||{},s.extensions[this.name]={attributes:m},r.extensionsUsed[this.name]=!0,r.extensionsRequired[this.name]=!0}};T(Ne,"GLTFMeshGpuInstancing");var he=Ne;q.Utils={insertKeyframe:function(c,e){let r=c.getValueSize(),t=new c.TimeBufferType(c.times.length+1),i=new c.ValueBufferType(c.values.length+r),n=c.createInterpolant(new c.ValueBufferType(r)),o;if(c.times.length===0){t[0]=e;for(let a=0;a<r;a++)i[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),i.set(n.evaluate(e),0),i.set(c.values,r),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),i.set(c.values,0),i.set(n.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),i.set(c.values.slice(0,(a+1)*r),0),i.set(n.evaluate(e),(a+1)*r),i.set(c.values.slice((a+1)*r),(a+2)*r),o=a+1;break}}return c.times=t,c.values=i,o},mergeMorphTargetTracks:function(c,e){let s=[],r={},t=c.tracks;for(let i=0;i<t.length;++i){let n=t[i],o=z.parseTrackName(n.name),a=z.findNode(e,o.nodeName);if(o.propertyName!=="morphTargetInfluences"||o.propertyIndex===void 0){s.push(n);continue}if(n.createInterpolant!==n.InterpolantFactoryMethodDiscrete&&n.createInterpolant!==n.InterpolantFactoryMethodLinear){if(n.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."),n=n.clone(),n.setInterpolation(He)}let u=a.morphTargetInfluences.length,p=a.morphTargetDictionary[o.propertyIndex];if(p===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+o.propertyIndex);let f;if(r[a.uuid]===void 0){f=n.clone();let l=new f.ValueBufferType(u*f.times.length);for(let d=0;d<f.times.length;d++)l[d*u+p]=f.values[d];f.name=(o.nodeName||"")+".morphTargetInfluences",f.values=l,r[a.uuid]=f,s.push(f);continue}let m=n.createInterpolant(new n.ValueBufferType(1));f=r[a.uuid];for(let l=0;l<f.times.length;l++)f.values[l*u+p]=m.evaluate(f.times[l]);for(let l=0;l<n.times.length;l++){let d=this.insertKeyframe(f,n.times[l]);f.values[d*u+p]=n.values[l]}}return c.tracks=s,c}};export{q as GLTFExporter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as ae}from"./chunk-A6QTJRY4.js";import{$ as bt,A as $,Aa as Ut,Ba as se,C as ee,Ca as re,D,Da as ie,E as _t,Ea as jt,F as Et,Fa as Kt,G as j,Ga as oe,Ha as Ft,I as te,Ia as Vt,J as L,Ja as Xt,K as V,Ka as Gt,L as H,M as X,Ma as B,N as xt,Na as zt,O as St,Pa as qt,S as yt,V as wt,W as G,_ as Nt,aa as Mt,b as ct,ba as It,c as ut,d as F,da as Lt,e as lt,ea as Ot,f as ft,fa as Ct,g as dt,h as ht,ha as Dt,i as pt,ia as Pt,j as W,ja as kt,k as mt,ka as Ht,l as Y,la as Bt,ma as vt,o as At,p as Q,r as gt,s as Tt,u as k,v as N,w as Rt,x as Z,xa as ne,y as J,ya as b}from"./chunk-TKFKQMTK.js";import{a as p,j as at}from"./chunk-GLHDHW4V.js";at();var He=class He extends Kt{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new pe(e)}),this.register(function(e){return new Se(e)}),this.register(function(e){return new ye(e)}),this.register(function(e){return new we(e)}),this.register(function(e){return new Ae(e)}),this.register(function(e){return new ge(e)}),this.register(function(e){return new Te(e)}),this.register(function(e){return new Re(e)}),this.register(function(e){return new he(e)}),this.register(function(e){return new _e(e)}),this.register(function(e){return new me(e)}),this.register(function(e){return new xe(e)}),this.register(function(e){return new Ee(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new Ne(e)}),this.register(function(e){return new be(e)})}load(t,e,r,n){let s=this,i;if(this.resourcePath!=="")i=this.resourcePath;else if(this.path!==""){let c=B.extractUrlBase(t);i=B.resolveURL(c,this.path)}else i=B.extractUrlBase(t);this.manager.itemStart(t);let a=p(function(c){n?n(c):console.error(c),s.manager.itemError(t),s.manager.itemEnd(t)},"_onError"),o=new oe(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(c){try{s.parse(c,i,function(l){e(l),s.manager.itemEnd(t)},a)}catch(l){a(l)}},r,a)}setDRACOLoader(t){return this.dracoLoader=t,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return this.pluginCallbacks.indexOf(t)===-1&&this.pluginCallbacks.push(t),this}unregister(t){return this.pluginCallbacks.indexOf(t)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,r,n){let s,i={},a={},o=new TextDecoder;if(typeof t=="string")s=JSON.parse(t);else if(t instanceof ArrayBuffer)if(o.decode(new Uint8Array(t,0,4))===$t){try{i[g.KHR_BINARY_GLTF]=new Me(t)}catch(u){n&&n(u);return}s=JSON.parse(i[g.KHR_BINARY_GLTF].content)}else s=JSON.parse(o.decode(t));else s=t;if(s.asset===void 0||s.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new ke(s,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let l=0;l<this.pluginCallbacks.length;l++){let u=this.pluginCallbacks[l](c);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[u.name]=u,i[u.name]=!0}if(s.extensionsUsed)for(let l=0;l<s.extensionsUsed.length;++l){let u=s.extensionsUsed[l],f=s.extensionsRequired||[];switch(u){case g.KHR_MATERIALS_UNLIT:i[u]=new de;break;case g.KHR_DRACO_MESH_COMPRESSION:i[u]=new Ie(s,this.dracoLoader);break;case g.KHR_TEXTURE_TRANSFORM:i[u]=new Le;break;case g.KHR_MESH_QUANTIZATION:i[u]=new Oe;break;default:f.indexOf(u)>=0&&a[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}c.setExtensions(i),c.setPlugins(a),c.parse(r,n)}parseAsync(t,e){let r=this;return new Promise(function(n,s){r.parse(t,e,n,s)})}};p(He,"GLTFLoader");var Wt=He;function en(){let h={};return{get:function(t){return h[t]},add:function(t,e){h[t]=e},remove:function(t){delete h[t]},removeAll:function(){h={}}}}p(en,"GLTFRegistry");var g={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"},Be=class Be{constructor(t){this.parser=t,this.name=g.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let t=this.parser,e=this.parser.json.nodes||[];for(let r=0,n=e.length;r<n;r++){let s=e[r];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&t._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(t){let e=this.parser,r="light:"+t,n=e.cache.get(r);if(n)return n;let s=e.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[t],c,l=new L(16777215);o.color!==void 0&&l.setRGB(o.color[0],o.color[1],o.color[2],N);let u=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new Gt(l),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new Xt(l),c.distance=u;break;case"spot":c=new Vt(l),c.distance=u,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),c.decay=2,C(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=e.createUniqueName(o.name||"light_"+t),n=Promise.resolve(c),e.cache.add(r,n),n}getDependency(t,e){if(t==="light")return this._loadLight(e)}createNodeAttachment(t){let e=this,r=this.parser,s=r.json.nodes[t],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(o){return r._getNodeRef(e.cache,a,o)})}};p(Be,"GLTFLightsExtension");var fe=Be,ve=class ve{constructor(){this.name=g.KHR_MATERIALS_UNLIT}getMaterialType(){return H}extendParams(t,e,r){let n=[];t.color=new L(1,1,1),t.opacity=1;let s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){let i=s.baseColorFactor;t.color.setRGB(i[0],i[1],i[2],N),t.opacity=i[3]}s.baseColorTexture!==void 0&&n.push(r.assignTexture(t,"map",s.baseColorTexture,k))}return Promise.all(n)}};p(ve,"GLTFMaterialsUnlitExtension");var de=ve,Ue=class Ue{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(t,e){let n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=n.extensions[this.name].emissiveStrength;return s!==void 0&&(e.emissiveIntensity=s),Promise.resolve()}};p(Ue,"GLTFMaterialsEmissiveStrengthExtension");var he=Ue,je=class je{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];if(i.clearcoatFactor!==void 0&&(e.clearcoat=i.clearcoatFactor),i.clearcoatTexture!==void 0&&s.push(r.assignTexture(e,"clearcoatMap",i.clearcoatTexture)),i.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=i.clearcoatRoughnessFactor),i.clearcoatRoughnessTexture!==void 0&&s.push(r.assignTexture(e,"clearcoatRoughnessMap",i.clearcoatRoughnessTexture)),i.clearcoatNormalTexture!==void 0&&(s.push(r.assignTexture(e,"clearcoatNormalMap",i.clearcoatNormalTexture)),i.clearcoatNormalTexture.scale!==void 0)){let a=i.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new Z(a,a)}return Promise.all(s)}};p(je,"GLTFMaterialsClearcoatExtension");var pe=je,Ke=class Ke{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_IRIDESCENCE}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return i.iridescenceFactor!==void 0&&(e.iridescence=i.iridescenceFactor),i.iridescenceTexture!==void 0&&s.push(r.assignTexture(e,"iridescenceMap",i.iridescenceTexture)),i.iridescenceIor!==void 0&&(e.iridescenceIOR=i.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),i.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=i.iridescenceThicknessMinimum),i.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=i.iridescenceThicknessMaximum),i.iridescenceThicknessTexture!==void 0&&s.push(r.assignTexture(e,"iridescenceThicknessMap",i.iridescenceThicknessTexture)),Promise.all(s)}};p(Ke,"GLTFMaterialsIridescenceExtension");var me=Ke,Fe=class Fe{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_SHEEN}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[];e.sheenColor=new L(0,0,0),e.sheenRoughness=0,e.sheen=1;let i=n.extensions[this.name];if(i.sheenColorFactor!==void 0){let a=i.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],N)}return i.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=i.sheenRoughnessFactor),i.sheenColorTexture!==void 0&&s.push(r.assignTexture(e,"sheenColorMap",i.sheenColorTexture,k)),i.sheenRoughnessTexture!==void 0&&s.push(r.assignTexture(e,"sheenRoughnessMap",i.sheenRoughnessTexture)),Promise.all(s)}};p(Fe,"GLTFMaterialsSheenExtension");var Ae=Fe,Ve=class Ve{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return i.transmissionFactor!==void 0&&(e.transmission=i.transmissionFactor),i.transmissionTexture!==void 0&&s.push(r.assignTexture(e,"transmissionMap",i.transmissionTexture)),Promise.all(s)}};p(Ve,"GLTFMaterialsTransmissionExtension");var ge=Ve,Xe=class Xe{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_VOLUME}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];e.thickness=i.thicknessFactor!==void 0?i.thicknessFactor:0,i.thicknessTexture!==void 0&&s.push(r.assignTexture(e,"thicknessMap",i.thicknessTexture)),e.attenuationDistance=i.attenuationDistance||1/0;let a=i.attenuationColor||[1,1,1];return e.attenuationColor=new L().setRGB(a[0],a[1],a[2],N),Promise.all(s)}};p(Xe,"GLTFMaterialsVolumeExtension");var Te=Xe,Ge=class Ge{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_IOR}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=n.extensions[this.name];return e.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}};p(Ge,"GLTFMaterialsIorExtension");var Re=Ge,ze=class ze{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_SPECULAR}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];e.specularIntensity=i.specularFactor!==void 0?i.specularFactor:1,i.specularTexture!==void 0&&s.push(r.assignTexture(e,"specularIntensityMap",i.specularTexture));let a=i.specularColorFactor||[1,1,1];return e.specularColor=new L().setRGB(a[0],a[1],a[2],N),i.specularColorTexture!==void 0&&s.push(r.assignTexture(e,"specularColorMap",i.specularColorTexture,k)),Promise.all(s)}};p(ze,"GLTFMaterialsSpecularExtension");var _e=ze,qe=class qe{constructor(t){this.parser=t,this.name=g.EXT_MATERIALS_BUMP}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return e.bumpScale=i.bumpFactor!==void 0?i.bumpFactor:1,i.bumpTexture!==void 0&&s.push(r.assignTexture(e,"bumpMap",i.bumpTexture)),Promise.all(s)}};p(qe,"GLTFMaterialsBumpExtension");var Ee=qe,We=class We{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_ANISOTROPY}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return i.anisotropyStrength!==void 0&&(e.anisotropy=i.anisotropyStrength),i.anisotropyRotation!==void 0&&(e.anisotropyRotation=i.anisotropyRotation),i.anisotropyTexture!==void 0&&s.push(r.assignTexture(e,"anisotropyMap",i.anisotropyTexture)),Promise.all(s)}};p(We,"GLTFMaterialsAnisotropyExtension");var xe=We,Ye=class Ye{constructor(t){this.parser=t,this.name=g.KHR_TEXTURE_BASISU}loadTexture(t){let e=this.parser,r=e.json,n=r.textures[t];if(!n.extensions||!n.extensions[this.name])return null;let s=n.extensions[this.name],i=e.options.ktx2Loader;if(!i){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,s.source,i)}};p(Ye,"GLTFTextureBasisUExtension");var Se=Ye,Qe=class Qe{constructor(t){this.parser=t,this.name=g.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){let e=this.name,r=this.parser,n=r.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;let i=s.extensions[e],a=n.images[i.source],o=r.textureLoader;if(a.uri){let c=r.options.manager.getHandler(a.uri);c!==null&&(o=c)}return this.detectSupport().then(function(c){if(c)return r.loadTextureImage(t,i.source,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){let e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}};p(Qe,"GLTFTextureWebPExtension");var ye=Qe,Ze=class Ze{constructor(t){this.parser=t,this.name=g.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(t){let e=this.name,r=this.parser,n=r.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;let i=s.extensions[e],a=n.images[i.source],o=r.textureLoader;if(a.uri){let c=r.options.manager.getHandler(a.uri);c!==null&&(o=c)}return this.detectSupport().then(function(c){if(c)return r.loadTextureImage(t,i.source,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){let e=new Image;e.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}};p(Ze,"GLTFTextureAVIFExtension");var we=Ze,Je=class Je{constructor(t){this.name=g.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){let e=this.parser.json,r=e.bufferViews[t];if(r.extensions&&r.extensions[this.name]){let n=r.extensions[this.name],s=this.parser.getDependency("buffer",n.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){let o=n.byteOffset||0,c=n.byteLength||0,l=n.count,u=n.byteStride,f=new Uint8Array(a,o,c);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(l,u,f,n.mode,n.filter).then(function(d){return d.buffer}):i.ready.then(function(){let d=new ArrayBuffer(l*u);return i.decodeGltfBuffer(new Uint8Array(d),l,u,f,n.mode,n.filter),d})})}else return null}};p(Je,"GLTFMeshoptCompression");var Ne=Je,$e=class $e{constructor(t){this.name=g.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){let e=this.parser.json,r=e.nodes[t];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;let n=e.meshes[r.mesh];for(let c of n.primitives)if(c.mode!==S.TRIANGLES&&c.mode!==S.TRIANGLE_STRIP&&c.mode!==S.TRIANGLE_FAN&&c.mode!==void 0)return null;let i=r.extensions[this.name].attributes,a=[],o={};for(let c in i)a.push(this.parser.getDependency("accessor",i[c]).then(l=>(o[c]=l,o[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(t)),Promise.all(a).then(c=>{let l=c.pop(),u=l.isGroup?l.children:[l],f=c[0].count,d=[];for(let m of u){let R=new j,A=new D,T=new ee,E=new D(1,1,1),x=new Ct(m.geometry,m.material,f);for(let _=0;_<f;_++)o.TRANSLATION&&A.fromBufferAttribute(o.TRANSLATION,_),o.ROTATION&&T.fromBufferAttribute(o.ROTATION,_),o.SCALE&&E.fromBufferAttribute(o.SCALE,_),x.setMatrixAt(_,R.compose(A,T,E));for(let _ in o)if(_==="_COLOR_0"){let w=o[_];x.instanceColor=new Ot(w.array,w.itemSize,w.normalized)}else _!=="TRANSLATION"&&_!=="ROTATION"&&_!=="SCALE"&&m.geometry.setAttribute(_,o[_]);te.prototype.copy.call(x,m),this.parser.assignFinalMaterial(x),d.push(x)}return l.isGroup?(l.clear(),l.add(...d),l):d[0]}))}};p($e,"GLTFMeshGpuInstancing");var be=$e,$t="glTF",K=12,Yt={JSON:1313821514,BIN:5130562},et=class et{constructor(t){this.name=g.KHR_BINARY_GLTF,this.content=null,this.body=null;let e=new DataView(t,0,K),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==$t)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-K,s=new DataView(t,K),i=0;for(;i<n;){let a=s.getUint32(i,!0);i+=4;let o=s.getUint32(i,!0);if(i+=4,o===Yt.JSON){let c=new Uint8Array(t,K+i,a);this.content=r.decode(c)}else if(o===Yt.BIN){let c=K+i;this.body=t.slice(c,c+a)}i+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}};p(et,"GLTFBinaryExtension");var Me=et,tt=class tt{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=g.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){let r=this.json,n=this.dracoLoader,s=t.extensions[this.name].bufferView,i=t.extensions[this.name].attributes,a={},o={},c={};for(let l in i){let u=De[l]||l.toLowerCase();a[u]=i[l]}for(let l in t.attributes){let u=De[l]||l.toLowerCase();if(i[l]!==void 0){let f=r.accessors[t.attributes[l]],d=v[f.componentType];c[u]=d.name,o[u]=f.normalized===!0}}return e.getDependency("bufferView",s).then(function(l){return new Promise(function(u,f){n.decodeDracoFile(l,function(d){for(let m in d.attributes){let R=d.attributes[m],A=o[m];A!==void 0&&(R.normalized=A)}u(d)},a,c,N,f)})})}};p(tt,"GLTFDracoMeshCompressionExtension");var Ie=tt,nt=class nt{constructor(){this.name=g.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return(e.texCoord===void 0||e.texCoord===t.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(t=t.clone(),e.texCoord!==void 0&&(t.channel=e.texCoord),e.offset!==void 0&&t.offset.fromArray(e.offset),e.rotation!==void 0&&(t.rotation=e.rotation),e.scale!==void 0&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}};p(nt,"GLTFTextureTransformExtension");var Le=nt,st=class st{constructor(){this.name=g.KHR_MESH_QUANTIZATION}};p(st,"GLTFMeshQuantizationExtension");var Oe=st,rt=class rt extends Ut{constructor(t,e,r,n){super(t,e,r,n)}copySampleValue_(t){let e=this.resultBuffer,r=this.sampleValues,n=this.valueSize,s=t*n*3+n;for(let i=0;i!==n;i++)e[i]=r[s+i];return e}interpolate_(t,e,r,n){let s=this.resultBuffer,i=this.sampleValues,a=this.valueSize,o=a*2,c=a*3,l=n-e,u=(r-e)/l,f=u*u,d=f*u,m=t*c,R=m-c,A=-2*d+3*f,T=d-f,E=1-A,x=T-f+u;for(let _=0;_!==a;_++){let w=i[R+_+a],M=i[R+_+o]*l,y=i[m+_+a],U=i[m+_]*l;s[_]=E*w+x*M+A*y+T*U}return s}};p(rt,"GLTFCubicSplineInterpolant");var z=rt,tn=new ee,it=class it extends z{interpolate_(t,e,r,n){let s=super.interpolate_(t,e,r,n);return tn.fromArray(s).normalize().toArray(s),s}};p(it,"GLTFCubicSplineQuaternionInterpolant");var Ce=it,S={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},v={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Qt={9728:dt,9729:W,9984:ht,9985:mt,9986:pt,9987:Y},Zt={33071:lt,33648:ft,10497:F},ce={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},De={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},O={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},nn={CUBICSPLINE:void 0,LINEAR:Q,STEP:At},ue={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function sn(h){return h.DefaultMaterial===void 0&&(h.DefaultMaterial=new ne({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ct})),h.DefaultMaterial}p(sn,"createDefaultMaterial");function P(h,t,e){for(let r in e.extensions)h[r]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=e.extensions[r])}p(P,"addUnknownExtensionsToUserData");function C(h,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(h.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}p(C,"assignExtrasToUserData");function rn(h,t,e){let r=!1,n=!1,s=!1;for(let c=0,l=t.length;c<l;c++){let u=t[c];if(u.POSITION!==void 0&&(r=!0),u.NORMAL!==void 0&&(n=!0),u.COLOR_0!==void 0&&(s=!0),r&&n&&s)break}if(!r&&!n&&!s)return Promise.resolve(h);let i=[],a=[],o=[];for(let c=0,l=t.length;c<l;c++){let u=t[c];if(r){let f=u.POSITION!==void 0?e.getDependency("accessor",u.POSITION):h.attributes.position;i.push(f)}if(n){let f=u.NORMAL!==void 0?e.getDependency("accessor",u.NORMAL):h.attributes.normal;a.push(f)}if(s){let f=u.COLOR_0!==void 0?e.getDependency("accessor",u.COLOR_0):h.attributes.color;o.push(f)}}return Promise.all([Promise.all(i),Promise.all(a),Promise.all(o)]).then(function(c){let l=c[0],u=c[1],f=c[2];return r&&(h.morphAttributes.position=l),n&&(h.morphAttributes.normal=u),s&&(h.morphAttributes.color=f),h.morphTargetsRelative=!0,h})}p(rn,"addMorphTargets");function on(h,t){if(h.updateMorphTargets(),t.weights!==void 0)for(let e=0,r=t.weights.length;e<r;e++)h.morphTargetInfluences[e]=t.weights[e];if(t.extras&&Array.isArray(t.extras.targetNames)){let e=t.extras.targetNames;if(h.morphTargetInfluences.length===e.length){h.morphTargetDictionary={};for(let r=0,n=e.length;r<n;r++)h.morphTargetDictionary[e[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}p(on,"updateMorphTargets");function an(h){let t,e=h.extensions&&h.extensions[g.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+le(e.attributes):t=h.indices+":"+le(h.attributes)+":"+h.mode,h.targets!==void 0)for(let r=0,n=h.targets.length;r<n;r++)t+=":"+le(h.targets[r]);return t}p(an,"createPrimitiveKey");function le(h){let t="",e=Object.keys(h).sort();for(let r=0,n=e.length;r<n;r++)t+=e[r]+":"+h[e[r]]+";";return t}p(le,"createAttributesKey");function Pe(h){switch(h){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}p(Pe,"getNormalizedComponentScale");function cn(h){return h.search(/\.jpe?g($|\?)/i)>0||h.search(/^data\:image\/jpeg/)===0?"image/jpeg":h.search(/\.webp($|\?)/i)>0||h.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}p(cn,"getImageURIMimeType");var un=new j,ot=class ot{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new en,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,n=!1,s=-1;typeof navigator<"u"&&(r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,n=navigator.userAgent.indexOf("Firefox")>-1,s=n?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||r||n&&s<98?this.textureLoader=new Ft(this.options.manager):this.textureLoader=new zt(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new oe(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){let r=this,n=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(i){return i._markDefs&&i._markDefs()}),Promise.all(this._invokeAll(function(i){return i.beforeRoot&&i.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(i){let a={scene:i[0][n.scene||0],scenes:i[0],animations:i[1],cameras:i[2],asset:n.asset,parser:r,userData:{}};return P(s,a,n),C(a,n),Promise.all(r._invokeAll(function(o){return o.afterRoot&&o.afterRoot(a)})).then(function(){t(a)})}).catch(e)}_markDefs(){let t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[];for(let n=0,s=e.length;n<s;n++){let i=e[n].joints;for(let a=0,o=i.length;a<o;a++)t[i[a]].isBone=!0}for(let n=0,s=t.length;n<s;n++){let i=t[n];i.mesh!==void 0&&(this._addNodeRef(this.meshCache,i.mesh),i.skin!==void 0&&(r[i.mesh].isSkinnedMesh=!0)),i.camera!==void 0&&this._addNodeRef(this.cameraCache,i.camera)}}_addNodeRef(t,e){e!==void 0&&(t.refs[e]===void 0&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)}_getNodeRef(t,e,r){if(t.refs[e]<=1)return r;let n=r.clone(),s=p((i,a)=>{let o=this.associations.get(i);o!=null&&this.associations.set(a,o);for(let[c,l]of i.children.entries())s(l,a.children[c])},"updateMappings");return s(r,n),n.name+="_instance_"+t.uses[e]++,n}_invokeOne(t){let e=Object.values(this.plugins);e.push(this);for(let r=0;r<e.length;r++){let n=t(e[r]);if(n)return n}return null}_invokeAll(t){let e=Object.values(this.plugins);e.unshift(this);let r=[];for(let n=0;n<e.length;n++){let s=t(e[n]);s&&r.push(s)}return r}getDependency(t,e){let r=t+":"+e,n=this.cache.get(r);if(!n){switch(t){case"scene":n=this.loadScene(e);break;case"node":n=this._invokeOne(function(s){return s.loadNode&&s.loadNode(e)});break;case"mesh":n=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(e)});break;case"accessor":n=this.loadAccessor(e);break;case"bufferView":n=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(e)});break;case"buffer":n=this.loadBuffer(e);break;case"material":n=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(e)});break;case"texture":n=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(e)});break;case"skin":n=this.loadSkin(e);break;case"animation":n=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(e)});break;case"camera":n=this.loadCamera(e);break;default:if(n=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(t,e)}),!n)throw new Error("Unknown type: "+t);break}this.cache.add(r,n)}return n}getDependencies(t){let e=this.cache.get(t);if(!e){let r=this,n=this.json[t+(t==="mesh"?"es":"s")]||[];e=Promise.all(n.map(function(s,i){return r.getDependency(t,i)})),this.cache.add(t,e)}return e}loadBuffer(t){let e=this.json.buffers[t],r=this.fileLoader;if(e.type&&e.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(e.uri===void 0&&t===0)return Promise.resolve(this.extensions[g.KHR_BINARY_GLTF].body);let n=this.options;return new Promise(function(s,i){r.load(B.resolveURL(e.uri,n.path),s,void 0,function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})}loadBufferView(t){let e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then(function(r){let n=e.byteLength||0,s=e.byteOffset||0;return r.slice(s,s+n)})}loadAccessor(t){let e=this,r=this.json,n=this.json.accessors[t];if(n.bufferView===void 0&&n.sparse===void 0){let i=ce[n.type],a=v[n.componentType],o=n.normalized===!0,c=new a(n.count*i);return Promise.resolve(new X(c,i,o))}let s=[];return n.bufferView!==void 0?s.push(this.getDependency("bufferView",n.bufferView)):s.push(null),n.sparse!==void 0&&(s.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(s).then(function(i){let a=i[0],o=ce[n.type],c=v[n.componentType],l=c.BYTES_PER_ELEMENT,u=l*o,f=n.byteOffset||0,d=n.bufferView!==void 0?r.bufferViews[n.bufferView].byteStride:void 0,m=n.normalized===!0,R,A;if(d&&d!==u){let T=Math.floor(f/d),E="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+T+":"+n.count,x=e.cache.get(E);x||(R=new c(a,T*d,n.count*d/l),x=new Nt(R,d/l),e.cache.add(E,x)),A=new bt(x,o,f%d/l,m)}else a===null?R=new c(n.count*o):R=new c(a,f,n.count*o),A=new X(R,o,m);if(n.sparse!==void 0){let T=ce.SCALAR,E=v[n.sparse.indices.componentType],x=n.sparse.indices.byteOffset||0,_=n.sparse.values.byteOffset||0,w=new E(i[1],x,n.sparse.count*T),M=new c(i[2],_,n.sparse.count*o);a!==null&&(A=new X(A.array.slice(),A.itemSize,A.normalized));for(let y=0,U=w.length;y<U;y++){let I=w[y];if(A.setX(I,M[y*o]),o>=2&&A.setY(I,M[y*o+1]),o>=3&&A.setZ(I,M[y*o+2]),o>=4&&A.setW(I,M[y*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return A})}loadTexture(t){let e=this.json,r=this.options,s=e.textures[t].source,i=e.images[s],a=this.textureLoader;if(i.uri){let o=r.manager.getHandler(i.uri);o!==null&&(a=o)}return this.loadTextureImage(t,s,a)}loadTextureImage(t,e,r){let n=this,s=this.json,i=s.textures[t],a=s.images[e],o=(a.uri||a.bufferView)+":"+i.sampler;if(this.textureCache[o])return this.textureCache[o];let c=this.loadImageSource(e,r).then(function(l){l.flipY=!1,l.name=i.name||a.name||"",l.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(l.name=a.uri);let f=(s.samplers||{})[i.sampler]||{};return l.magFilter=Qt[f.magFilter]||W,l.minFilter=Qt[f.minFilter]||Y,l.wrapS=Zt[f.wrapS]||F,l.wrapT=Zt[f.wrapT]||F,n.associations.set(l,{textures:t}),l}).catch(function(){return null});return this.textureCache[o]=c,c}loadImageSource(t,e){let r=this,n=this.json,s=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(u=>u.clone());let i=n.images[t],a=self.URL||self.webkitURL,o=i.uri||"",c=!1;if(i.bufferView!==void 0)o=r.getDependency("bufferView",i.bufferView).then(function(u){c=!0;let f=new Blob([u],{type:i.mimeType});return o=a.createObjectURL(f),o});else if(i.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");let l=Promise.resolve(o).then(function(u){return new Promise(function(f,d){let m=f;e.isImageBitmapLoader===!0&&(m=p(function(R){let A=new $(R);A.needsUpdate=!0,f(A)},"onLoad")),e.load(B.resolveURL(u,s.path),m,void 0,d)})}).then(function(u){return c===!0&&a.revokeObjectURL(o),u.userData.mimeType=i.mimeType||cn(i.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),u});return this.sourceCache[t]=l,l}assignTexture(t,e,r,n){let s=this;return this.getDependency("texture",r.index).then(function(i){if(!i)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(i=i.clone(),i.channel=r.texCoord),s.extensions[g.KHR_TEXTURE_TRANSFORM]){let a=r.extensions!==void 0?r.extensions[g.KHR_TEXTURE_TRANSFORM]:void 0;if(a){let o=s.associations.get(i);i=s.extensions[g.KHR_TEXTURE_TRANSFORM].extendTexture(i,a),s.associations.set(i,o)}}return n!==void 0&&(i.colorSpace=n),t[e]=i,i})}assignFinalMaterial(t){let e=t.geometry,r=t.material,n=e.attributes.tangent===void 0,s=e.attributes.color!==void 0,i=e.attributes.normal===void 0;if(t.isPoints){let a="PointsMaterial:"+r.uuid,o=this.cache.get(a);o||(o=new Bt,V.prototype.copy.call(o,r),o.color.copy(r.color),o.map=r.map,o.sizeAttenuation=!1,this.cache.add(a,o)),r=o}else if(t.isLine){let a="LineBasicMaterial:"+r.uuid,o=this.cache.get(a);o||(o=new Dt,V.prototype.copy.call(o,r),o.color.copy(r.color),o.map=r.map,this.cache.add(a,o)),r=o}if(n||s||i){let a="ClonedMaterial:"+r.uuid+":";n&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),i&&(a+="flat-shading:");let o=this.cache.get(a);o||(o=r.clone(),s&&(o.vertexColors=!0),i&&(o.flatShading=!0),n&&(o.normalScale&&(o.normalScale.y*=-1),o.clearcoatNormalScale&&(o.clearcoatNormalScale.y*=-1)),this.cache.add(a,o),this.associations.set(o,this.associations.get(r))),r=o}t.material=r}getMaterialType(){return ne}loadMaterial(t){let e=this,r=this.json,n=this.extensions,s=r.materials[t],i,a={},o=s.extensions||{},c=[];if(o[g.KHR_MATERIALS_UNLIT]){let u=n[g.KHR_MATERIALS_UNLIT];i=u.getMaterialType(),c.push(u.extendParams(a,s,e))}else{let u=s.pbrMetallicRoughness||{};if(a.color=new L(1,1,1),a.opacity=1,Array.isArray(u.baseColorFactor)){let f=u.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],N),a.opacity=f[3]}u.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",u.baseColorTexture,k)),a.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,a.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(c.push(e.assignTexture(a,"metalnessMap",u.metallicRoughnessTexture)),c.push(e.assignTexture(a,"roughnessMap",u.metallicRoughnessTexture))),i=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(t)}),c.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(t,a)})))}s.doubleSided===!0&&(a.side=ut);let l=s.alphaMode||ue.OPAQUE;if(l===ue.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,l===ue.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&i!==H&&(c.push(e.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new Z(1,1),s.normalTexture.scale!==void 0)){let u=s.normalTexture.scale;a.normalScale.set(u,u)}if(s.occlusionTexture!==void 0&&i!==H&&(c.push(e.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&i!==H){let u=s.emissiveFactor;a.emissive=new L().setRGB(u[0],u[1],u[2],N)}return s.emissiveTexture!==void 0&&i!==H&&c.push(e.assignTexture(a,"emissiveMap",s.emissiveTexture,k)),Promise.all(c).then(function(){let u=new i(a);return s.name&&(u.name=s.name),C(u,s),e.associations.set(u,{materials:t}),s.extensions&&P(n,u,s),u})}createUniqueName(t){let e=qt.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){let e=this,r=this.extensions,n=this.primitiveCache;function s(a){return r[g.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(o){return Jt(o,a,e)})}p(s,"createDracoPrimitive");let i=[];for(let a=0,o=t.length;a<o;a++){let c=t[a],l=an(c),u=n[l];if(u)i.push(u.promise);else{let f;c.extensions&&c.extensions[g.KHR_DRACO_MESH_COMPRESSION]?f=s(c):f=Jt(new xt,c,e),n[l]={primitive:c,promise:f},i.push(f)}}return Promise.all(i)}loadMesh(t){let e=this,r=this.json,n=this.extensions,s=r.meshes[t],i=s.primitives,a=[];for(let o=0,c=i.length;o<c;o++){let l=i[o].material===void 0?sn(this.cache):this.getDependency("material",i[o].material);a.push(l)}return a.push(e.loadGeometries(i)),Promise.all(a).then(function(o){let c=o.slice(0,o.length-1),l=o[o.length-1],u=[];for(let d=0,m=l.length;d<m;d++){let R=l[d],A=i[d],T,E=c[d];if(A.mode===S.TRIANGLES||A.mode===S.TRIANGLE_STRIP||A.mode===S.TRIANGLE_FAN||A.mode===void 0)T=s.isSkinnedMesh===!0?new Mt(R,E):new St(R,E),T.isSkinnedMesh===!0&&T.normalizeSkinWeights(),A.mode===S.TRIANGLE_STRIP?T.geometry=ae(T.geometry,gt):A.mode===S.TRIANGLE_FAN&&(T.geometry=ae(T.geometry,Tt));else if(A.mode===S.LINES)T=new kt(R,E);else if(A.mode===S.LINE_STRIP)T=new Pt(R,E);else if(A.mode===S.LINE_LOOP)T=new Ht(R,E);else if(A.mode===S.POINTS)T=new vt(R,E);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+A.mode);Object.keys(T.geometry.morphAttributes).length>0&&on(T,s),T.name=e.createUniqueName(s.name||"mesh_"+t),C(T,s),A.extensions&&P(n,T,A),e.assignFinalMaterial(T),u.push(T)}for(let d=0,m=u.length;d<m;d++)e.associations.set(u[d],{meshes:t,primitives:d});if(u.length===1)return s.extensions&&P(n,u[0],s),u[0];let f=new G;s.extensions&&P(n,f,s),e.associations.set(f,{meshes:t});for(let d=0,m=u.length;d<m;d++)f.add(u[d]);return f})}loadCamera(t){let e,r=this.json.cameras[t],n=r[r.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return r.type==="perspective"?e=new yt(Rt.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):r.type==="orthographic"&&(e=new wt(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),r.name&&(e.name=this.createUniqueName(r.name)),C(e,r),Promise.resolve(e)}loadSkin(t){let e=this.json.skins[t],r=[];for(let n=0,s=e.joints.length;n<s;n++)r.push(this._loadNodeShallow(e.joints[n]));return e.inverseBindMatrices!==void 0?r.push(this.getDependency("accessor",e.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(n){let s=n.pop(),i=n,a=[],o=[];for(let c=0,l=i.length;c<l;c++){let u=i[c];if(u){a.push(u);let f=new j;s!==null&&f.fromArray(s.array,c*16),o.push(f)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new Lt(a,o)})}loadAnimation(t){let e=this.json,r=this,n=e.animations[t],s=n.name?n.name:"animation_"+t,i=[],a=[],o=[],c=[],l=[];for(let u=0,f=n.channels.length;u<f;u++){let d=n.channels[u],m=n.samplers[d.sampler],R=d.target,A=R.node,T=n.parameters!==void 0?n.parameters[m.input]:m.input,E=n.parameters!==void 0?n.parameters[m.output]:m.output;R.node!==void 0&&(i.push(this.getDependency("node",A)),a.push(this.getDependency("accessor",T)),o.push(this.getDependency("accessor",E)),c.push(m),l.push(R))}return Promise.all([Promise.all(i),Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(l)]).then(function(u){let f=u[0],d=u[1],m=u[2],R=u[3],A=u[4],T=[];for(let E=0,x=f.length;E<x;E++){let _=f[E],w=d[E],M=m[E],y=R[E],U=A[E];if(_===void 0)continue;_.updateMatrix&&_.updateMatrix();let I=r._createAnimationTracks(_,w,M,y,U);if(I)for(let q=0;q<I.length;q++)T.push(I[q])}return new jt(s,void 0,T)})}createNodeMesh(t){let e=this.json,r=this,n=e.nodes[t];return n.mesh===void 0?null:r.getDependency("mesh",n.mesh).then(function(s){let i=r._getNodeRef(r.meshCache,n.mesh,s);return n.weights!==void 0&&i.traverse(function(a){if(a.isMesh)for(let o=0,c=n.weights.length;o<c;o++)a.morphTargetInfluences[o]=n.weights[o]}),i})}loadNode(t){let e=this.json,r=this,n=e.nodes[t],s=r._loadNodeShallow(t),i=[],a=n.children||[];for(let c=0,l=a.length;c<l;c++)i.push(r.getDependency("node",a[c]));let o=n.skin===void 0?Promise.resolve(null):r.getDependency("skin",n.skin);return Promise.all([s,Promise.all(i),o]).then(function(c){let l=c[0],u=c[1],f=c[2];f!==null&&l.traverse(function(d){d.isSkinnedMesh&&d.bind(f,un)});for(let d=0,m=u.length;d<m;d++)l.add(u[d]);return l})}_loadNodeShallow(t){let e=this.json,r=this.extensions,n=this;if(this.nodeCache[t]!==void 0)return this.nodeCache[t];let s=e.nodes[t],i=s.name?n.createUniqueName(s.name):"",a=[],o=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(t)});return o&&a.push(o),s.camera!==void 0&&a.push(n.getDependency("camera",s.camera).then(function(c){return n._getNodeRef(n.cameraCache,s.camera,c)})),n._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(t)}).forEach(function(c){a.push(c)}),this.nodeCache[t]=Promise.all(a).then(function(c){let l;if(s.isBone===!0?l=new It:c.length>1?l=new G:c.length===1?l=c[0]:l=new te,l!==c[0])for(let u=0,f=c.length;u<f;u++)l.add(c[u]);if(s.name&&(l.userData.name=s.name,l.name=i),C(l,s),s.extensions&&P(r,l,s),s.matrix!==void 0){let u=new j;u.fromArray(s.matrix),l.applyMatrix4(u)}else s.translation!==void 0&&l.position.fromArray(s.translation),s.rotation!==void 0&&l.quaternion.fromArray(s.rotation),s.scale!==void 0&&l.scale.fromArray(s.scale);return n.associations.has(l)||n.associations.set(l,{}),n.associations.get(l).nodes=t,l}),this.nodeCache[t]}loadScene(t){let e=this.extensions,r=this.json.scenes[t],n=this,s=new G;r.name&&(s.name=n.createUniqueName(r.name)),C(s,r),r.extensions&&P(e,s,r);let i=r.nodes||[],a=[];for(let o=0,c=i.length;o<c;o++)a.push(n.getDependency("node",i[o]));return Promise.all(a).then(function(o){for(let l=0,u=o.length;l<u;l++)s.add(o[l]);let c=p(l=>{let u=new Map;for(let[f,d]of n.associations)(f instanceof V||f instanceof $)&&u.set(f,d);return l.traverse(f=>{let d=n.associations.get(f);d!=null&&u.set(f,d)}),u},"reduceAssociations");return n.associations=c(s),s})}_createAnimationTracks(t,e,r,n,s){let i=[],a=t.name?t.name:t.uuid,o=[];O[s.path]===O.weights?t.traverse(function(f){f.morphTargetInfluences&&o.push(f.name?f.name:f.uuid)}):o.push(a);let c;switch(O[s.path]){case O.weights:c=se;break;case O.rotation:c=re;break;case O.position:case O.scale:c=ie;break;default:switch(r.itemSize){case 1:c=se;break;case 2:case 3:default:c=ie;break}break}let l=n.interpolation!==void 0?nn[n.interpolation]:Q,u=this._getArrayFromAccessor(r);for(let f=0,d=o.length;f<d;f++){let m=new c(o[f]+"."+O[s.path],e.array,u,l);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),i.push(m)}return i}_getArrayFromAccessor(t){let e=t.array;if(t.normalized){let r=Pe(e.constructor),n=new Float32Array(e.length);for(let s=0,i=e.length;s<i;s++)n[s]=e[s]*r;e=n}return e}_createCubicSplineTrackInterpolant(t){t.createInterpolant=p(function(r){let n=this instanceof re?Ce:z;return new n(this.times,this.values,this.getValueSize()/3,r)},"InterpolantFactoryMethodGLTFCubicSpline"),t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}};p(ot,"GLTFParser");var ke=ot;function ln(h,t,e){let r=t.attributes,n=new _t;if(r.POSITION!==void 0){let a=e.json.accessors[r.POSITION],o=a.min,c=a.max;if(o!==void 0&&c!==void 0){if(n.set(new D(o[0],o[1],o[2]),new D(c[0],c[1],c[2])),a.normalized){let l=Pe(v[a.componentType]);n.min.multiplyScalar(l),n.max.multiplyScalar(l)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;let s=t.targets;if(s!==void 0){let a=new D,o=new D;for(let c=0,l=s.length;c<l;c++){let u=s[c];if(u.POSITION!==void 0){let f=e.json.accessors[u.POSITION],d=f.min,m=f.max;if(d!==void 0&&m!==void 0){if(o.setX(Math.max(Math.abs(d[0]),Math.abs(m[0]))),o.setY(Math.max(Math.abs(d[1]),Math.abs(m[1]))),o.setZ(Math.max(Math.abs(d[2]),Math.abs(m[2]))),f.normalized){let R=Pe(v[f.componentType]);o.multiplyScalar(R)}a.max(o)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}h.boundingBox=n;let i=new Et;n.getCenter(i.center),i.radius=n.min.distanceTo(n.max)/2,h.boundingSphere=i}p(ln,"computeBounds");function Jt(h,t,e){let r=t.attributes,n=[];function s(i,a){return e.getDependency("accessor",i).then(function(o){h.setAttribute(a,o)})}p(s,"assignAttributeAccessor");for(let i in r){let a=De[i]||i.toLowerCase();a in h.attributes||n.push(s(r[i],a))}if(t.indices!==void 0&&!h.index){let i=e.getDependency("accessor",t.indices).then(function(a){h.setIndex(a)});n.push(i)}return J.workingColorSpace!==N&&"COLOR_0"in r&&console.warn('THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "'.concat(J.workingColorSpace,'" not supported.')),C(h,t),ln(h,t,e),Promise.all(n).then(function(){return t.targets!==void 0?rn(h,t.targets,e):h})}p(Jt,"addPrimitiveAttributes");export{Wt as GLTFLoader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u,j as hn}from"./chunk-GLHDHW4V.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"),U=Uint8Array,q=Uint16Array,gr=Uint32Array,yr=new U([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 U([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 U([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],l=o[n[i]-1]++<<h,y=l|(1<<h)-1;l<=y;++l)f[Dr[l]>>>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 U(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 U(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:U)(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 U(0);var i=!r||t,a=!t||t.i;t||(t={}),r||(r=new U(e*3));var o=u(function(Ir){var Tr=r.length;if(Ir>Tr){var vr=new U(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,l=t.d,y=t.m,z=t.n,x=e*8;do{if(!h){f=V(n,v,1);var A=V(n,v+1,3);if(v+=3,A)if(A==1)h=Un,l=Sn,y=9,z=5;else if(A==2){var M=V(n,v,31)+257,m=V(n,v+10,15)+4,B=M+V(n,v+5,31)+1;v+=14;for(var C=new U(B),D=new U(19),c=0;c<m;++c)D[Ur[c]]=V(n,v+c*3,7);v+=m*3;for(var G=Zr(D),S=(1<<G)-1,R=X(D,G,1),c=0;c<B;){var Z=R[V(n,v,S)];v+=Z&15;var p=Z>>>4;if(p<16)C[c++]=p;else{var O=0,F=0;for(p==16?(F=3+V(n,v,3),v+=2,O=C[c-1]):p==17?(F=3+V(n,v,7),v+=3):p==18&&(F=11+V(n,v,127),v+=7);F--;)C[c++]=O}}var P=C.subarray(0,M),k=C.subarray(M);y=Zr(P),z=Zr(k),h=X(P,y,1),l=X(k,z,1)}else g(1);else{var p=Sr(v)+4,w=n[p-4]|n[p-3]<<8,T=p+w;if(T>e){a&&g(0);break}i&&o(s+w),r.set(n.subarray(p,T),s),t.b=s+=w,t.p=v=T*8,t.f=f;continue}if(v>x){a&&g(0);break}}i&&o(s+131072);for(var L=(1<<y)-1,H=(1<<z)-1,j=v;;j=v){var O=h[kr(n,v)&L],Q=O>>>4;if(v+=O&15,v>x){a&&g(0);break}if(O||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 c=Q-257,_=yr[c];Y=V(n,v,(1<<_)-1)+dr[c],v+=_}var rr=l[kr(n,v)&H],J=rr>>>4;rr||g(3),v+=rr&15;var k=Mn[J];if(J>3){var _=wr[J];k+=kr(n,v)&(1<<_)-1,v+=_}if(v>x){a&&g(0);break}i&&o(s+131072);for(var $=s+Y;s<$;s+=4)r[s]=r[s-k],r[s+1]=r[s+1-k],r[s+2]=r[s+2-k],r[s+3]=r[s+3-k];s=$}}t.l=h,t.p=j,t.b=s,t.f=f,h&&(f=1,t.m=y,t.d=l,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 U(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,l=2;for(t[0]={s:-1,f:f.f+v.f,l:f,r:v};h!=i-1;)f=t[t[s].f<t[l].f?s++:l++],v=t[s!=h&&t[s].f<t[l].f?s++:l++],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),x=Lr(t[h-1],z,0);if(x>r){var e=0,A=0,p=x-r,w=1<<p;for(a.sort(function(C,D){return z[D.s]-z[C.s]||C.f-D.f});e<i;++e){var T=a[e].s;if(z[T]>r)A+=w-(1<<x-z[T]),z[T]=r;else break}for(A>>>=p;A>0;){var M=a[e].s;z[M]<r?A-=1<<r-z[M]++-1:++e}for(;e>=0&&A;--e){var m=a[e].s;z[m]==r&&(--z[m],++A)}x=r}return[new U(z),x]},"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 l=Gr(i,15),y=l[0],z=l[1],x=Gr(a,15),A=x[0],p=x[1],w=Wr(y),T=w[0],M=w[1],m=Wr(A),B=m[0],C=m[1],D=new q(19),c=0;c<T.length;++c)D[T[c]&31]++;for(var c=0;c<B.length;++c)D[B[c]&31]++;for(var G=Gr(D,7),S=G[0],R=G[1],Z=19;Z>4&&!S[Ur[Z-1]];--Z);var O=s+5<<3,F=lr(i,ir)+lr(a,cr)+o,P=lr(i,y)+lr(a,A)+o+14+3*Z+lr(D,S)+(2*D[16]+3*D[17]+7*D[18]);if(O<=F&&O<=P)return Pr(r,h,n.subarray(v,v+s));var k,L,H,j;if(nr(r,h,1+(P<F)),h+=2,P<F){k=X(y,z,0),L=y,H=X(A,p,0),j=A;var Q=X(S,R,0);nr(r,h,M-257),nr(r,h+5,C-1),nr(r,h+10,Z-4),h+=14;for(var c=0;c<Z;++c)nr(r,h+3*c,S[Ur[c]]);h+=3*Z;for(var Y=[T,B],_=0;_<2;++_)for(var rr=Y[_],c=0;c<rr.length;++c){var J=rr[c]&31;nr(r,h,Q[J]),h+=S[J],J>15&&(nr(r,h,rr[c]>>>5&127),h+=rr[c]>>>12)}}else k=Tn,L=ir,H=Dn,j=cr;for(var c=0;c<f;++c)if(e[c]>255){var J=e[c]>>>18&31;hr(r,h,k[J+257]),h+=L[J+257],J>7&&(nr(r,h,e[c]>>>23&31),h+=yr[J]);var $=e[c]&31;hr(r,h,H[$]),h+=j[$],$>3&&(hr(r,h,e[c]>>>5&8191),h+=wr[$])}else hr(r,h,k[e[c]]),h+=L[e[c]];return hr(r,h,k[256]),h+L[256]},"wblk"),En=new gr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),er=new U(0),Fn=u(function(n,r,t,e,i,a){var o=n.length,f=new U(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 l=h+65535;l>=o&&(v[s>>3]=a),s=Pr(v,s+1,n.subarray(h,l))}else{for(var y=En[r-1],z=y>>>13,x=y&8191,A=(1<<t)-1,p=new q(32768),w=new q(A+1),T=Math.ceil(t/3),M=2*T,m=u(function(qr){return(n[qr]^n[qr+1]<<T^n[qr+2]<<M)&A},"hsh"),B=new gr(25e3),C=new q(288),D=new q(32),c=0,G=0,h=0,S=0,R=0,Z=0;h<o;++h){var O=m(h),F=h&32767,P=w[O];if(p[F]=P,w[O]=F,R<=h){var k=o-h;if((c>7e3||S>24576)&&k>423){s=jr(n,v,0,B,C,D,G,S,Z,h-Z,s),S=c=G=0,Z=h;for(var L=0;L<286;++L)C[L]=0;for(var L=0;L<30;++L)D[L]=0}var H=2,j=0,Q=x,Y=F-P&32767;if(k>2&&O==m(h-Y))for(var _=Math.min(z,k)-1,rr=Math.min(32767,h),J=Math.min(258,k);Y<=rr&&--Q&&F!=P;){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,L=0;L<Ir;++L){var vr=h-Y+L+32768&32767,Kn=p[vr],sn=vr-Kn+32768&32767;sn>Tr&&(Tr=sn,P=vr)}}}F=P,P=p[F],Y+=F-P+32768&32767}if(j){B[S++]=268435456|Or[H]<<18|Yr[j];var un=Or[H]&31,vn=Yr[j]&31;G+=yr[un]+wr[vn],++C[257+un],++D[vn],R=h+H,++c}else B[S++]=n[h],++C[n[h]]}}s=jr(n,v,a,B,C,D,G,S,Z,h-Z,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 l in f.prototype)r+=";"+v+".prototype."+l+"="+f.prototype[l].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[U,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[U,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 U(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 U(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 U(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 U(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 U(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 U?t[o]=[a,f]:(t[o+="/"]=[new U(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 U(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 U(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 U(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 U(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,l=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<0&&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!=-1&&(I(n,r,t.crc),I(n,r+4,a<0?-a-2:a),I(n,r+8,t.size)),I(n,r+12,v),I(n,r+14,l),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,l)for(var x in s){var A=s[x],p=A.length;I(n,r,+x),I(n,r+2,p),n.set(A,r+4),r+=4+p}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 U(v);pr(s,0,r,e,f,-1);var h=[s],l=u(function(){for(var p=0,w=h;p<w.length;p++){var T=w[p];t.ondata(null,T,!1)}h=[]},"pAll_1"),y=this.d;this.d=0;var z=this.u.length,x=Er(r,{f:e,u:f,o,t:function(){r.terminate&&r.terminate()},r:function(){if(l(),y){var p=t.u[z+1];p?p.r():t.d=1}y=1}}),A=0;r.ondata=function(p,w,T){if(p)t.ondata(p,w,T),t.terminate();else if(A+=w.length,h.push(w),T){var M=new U(16);I(M,0,134695760),I(M,4,r.crc),I(M,8,A),I(M,12,r.size),h.push(M),x.c=A,x.b=v+A+16,x.crc=r.crc,x.size=r.size,y&&x.r(),y=1}else y&&l()},this.u.push(x)}},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 U(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-2,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=[],l=u(function(){for(var p=0;p<h.length;++p)h[p]()},"tAll"),y=u(function(p,w){Rr(function(){t(p,w)})},"cbd");Rr(function(){y=t});var z=u(function(){var p=new U(f+22),w=o,T=f-o;f=0;for(var M=0;M<v;++M){var m=s[M];try{var B=m.c.length;pr(p,f,m,m.f,m.u,B);var C=30+m.f.length+or(m.extra),D=f+C;p.set(m.c,D),pr(p,o,m,m.f,m.u,B,f,m.m),o+=16+C+(m.m?m.m.length:0),f=D+B}catch(c){return y(c,null)}}fn(p,o,s.length,T,w),y(null,p)},"cbf");a||z();for(var x=u(function(p){var w=i[p],T=e[w],M=T[0],m=T[1],B=mr(),C=M.length;B.p(M);var D=sr(w),c=D.length,G=m.comment,S=G&&sr(G),R=S&&S.length,Z=or(m.extra),O=m.level==0?0:8,F=u(function(P,k){if(P)l(),y(P,null);else{var L=k.length;s[p]=Er(m,{size:C,crc:B.d(),c:k,f:D,m:S,u:c!=w.length||S&&G.length!=R,compression:O}),o+=30+c+Z+L,f+=76+2*(c+Z)+(R||0)+L,--a||z()}},"cbl");if(c>65535&&F(g(11,0,1),null),!O)F(null,M);else if(C<16e4)try{F(null,$r(M,m))}catch(P){F(P,null)}else h.push(dn(M,m,F))},"_loop_1"),A=0;A<v;++A)x(A);return l}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,l=sr(o),y=l.length,z=s.comment,x=z&&sr(z),A=x&&x.length,p=or(s.extra);y>65535&&g(11);var w=h?$r(v,s):v,T=w.length,M=mr();M.p(v),e.push(Er(s,{size:v.length,crc:M.d(),c:w,f:l,m:x,u:y!=o.length||x&&z.length!=A,o:i,compression:h})),i+=30+y+p+T,a+=76+2*(y+p)+(A||0)+T}for(var m=new U(a+22),B=i,C=a-i,D=0;D<e.length;++D){var l=e[D];pr(m,l.o,l,l.f,l.u,l.c.length);var c=30+l.f.length+or(l.extra);m.set(l.c,l.o+c),pr(m,i,l,l.f,l.u,l.c.length,l.o,l.m),i+=16+c+(l.m?l.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 U(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,l=this.c,y=l&&this.d,z=u(function(){var w,T=N(s,f);if(T==67324752){o=1,v=f,x.d=null,x.c=0;var M=W(s,f+6),m=W(s,f+8),B=M&2048,C=M&8,D=W(s,f+26),c=W(s,f+28);if(h>f+30+D+c){var G=[];x.k.unshift(G),o=2;var S=N(s,f+18),R=N(s,f+22),Z=Hn(s.subarray(f+30,f+=30+D),!B);S==4294967295?(w=C?[-2]:Jn(s,f),S=w[0],R=w[1]):C&&(S=-1),f+=c,x.c=S;var O,F={name:Z,compression:m,start:function(){if(F.ondata||g(5),!S)F.ondata(null,er,!0);else{var P=e.o[m];P||F.ondata(g(14,"unknown compression type "+m,1),null,!1),O=S<0?new P(Z):new P(Z,S,R),O.ondata=function(j,Q,Y){F.ondata(j,Q,Y)};for(var k=0,L=G;k<L.length;k++){var H=L[k];O.push(H,!1)}e.k[0]==G&&e.c?e.d=O:O.push(er,!0)}},terminate:function(){O&&O.terminate&&O.terminate()}};S>=0&&(F.size=S,F.originalSize=R),x.onfile(F)}return"break"}else if(l){if(T==134695760)return v=f+=12+(l==-2&&8),o=3,x.c=0,"break";if(T==33639248)return v=f-=4,o=3,x.c=0,"break"}},"_loop_2"),x=this;f<h-4;++f){var A=z();if(A==="break")break}if(this.p=er,l<0){var p=o?s.subarray(0,v-12-(l==-2&&8)-(N(s,v-16)==134695760&&4)):s.subarray(0,f);y?y.push(p,!!o):this.k[+(o==2)].push(p)}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 p=0;p<e.length;++p)e[p]()},"tAll"),a={},o=u(function(p,w){Rr(function(){t(p,w)})},"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),l=h==4294967295||s==65535;if(l){var y=N(n,f-12);l=N(n,y)==101075792,l&&(s=v=N(n,y+32),h=N(n,y+48))}for(var z=r&&r.filter,x=u(function(p){var w=jn(n,h,l),T=w[0],M=w[1],m=w[2],B=w[3],C=w[4],D=w[5],c=Wn(n,D);h=C;var G=u(function(R,Z){R?(i(),o(R,null)):(Z&&(a[B]=Z),--v||o(null,a))},"cbl");if(!z||z({name:B,size:M,originalSize:m,compression:T}))if(!T)G(null,d(n,c,c+M));else if(T==8){var S=n.subarray(c,c+M);if(M<32e4)try{G(null,Fr(S,new U(m)))}catch(R){G(R,null)}else e.push(Rn(S,{size:m},G))}else G(g(14,"unknown compression type "+T,1),null);else G(null,null)},"_loop_3"),A=0;A<s;++A)x(A)}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||i==65535;if(o){var f=N(n,e-12);o=N(n,f)==101075792,o&&(i=N(n,f+32),a=N(n,f+48))}for(var v=r&&r.filter,s=0;s<i;++s){var h=jn(n,a,o),l=h[0],y=h[1],z=h[2],x=h[3],A=h[4],p=h[5],w=Wn(n,p);a=A,(!v||v({name:x,size:y,originalSize:z,compression:l}))&&(l?l==8?t[x]=Fr(n.subarray(w,w+y),new U(z)):g(14,"unknown compression type "+l):t[x]=d(n,w,w+y))}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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{M as B,N as y,q as w,r as x,s as b}from"./chunk-TKFKQMTK.js";import{a as g,j as A}from"./chunk-GLHDHW4V.js";A();function R(o,l=!1){let r=o[0].index!==null,f=new Set(Object.keys(o[0].attributes)),i=new Set(Object.keys(o[0].morphAttributes)),c={},e={},h=o[0].morphTargetsRelative,u=new y,d=0;for(let t=0;t<o.length;++t){let s=o[t],a=0;if(r!==(s.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let n in s.attributes){if(!f.has(n))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+'. All geometries must have compatible attributes; make sure "'+n+'" attribute exists among all geometries, or in none of them.'),null;c[n]===void 0&&(c[n]=[]),c[n].push(s.attributes[n]),a++}if(a!==f.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". Make sure all geometries have the same number of attributes."),null;if(h!==s.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let n in s.morphAttributes){if(!i.has(n))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". .morphAttributes must be consistent throughout all geometries."),null;e[n]===void 0&&(e[n]=[]),e[n].push(s.morphAttributes[n])}if(l){let n;if(r)n=s.index.count;else if(s.attributes.position!==void 0)n=s.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". The geometry must have either an index or a position attribute"),null;u.addGroup(d,n,t),d+=n}}if(r){let t=0,s=[];for(let a=0;a<o.length;++a){let n=o[a].index;for(let m=0;m<n.count;++m)s.push(n.getX(m)+t);t+=o[a].attributes.position.count}u.setIndex(s)}for(let t in c){let s=T(c[t]);if(!s)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" attribute."),null;u.setAttribute(t,s)}for(let t in e){let s=e[t][0].length;if(s===0)break;u.morphAttributes=u.morphAttributes||{},u.morphAttributes[t]=[];for(let a=0;a<s;++a){let n=[];for(let p=0;p<e[t].length;++p)n.push(e[t][p][a]);let m=T(n);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" morphAttribute."),null;u.morphAttributes[t].push(m)}}return u}g(R,"mergeGeometries");function T(o){let l,r,f,i=-1,c=0;for(let d=0;d<o.length;++d){let t=o[d];if(l===void 0&&(l=t.array.constructor),l!==t.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(r===void 0&&(r=t.itemSize),r!==t.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(f===void 0&&(f=t.normalized),f!==t.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=t.gpuType),i!==t.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;c+=t.count*r}let e=new l(c),h=new B(e,r,f),u=0;for(let d=0;d<o.length;++d){let t=o[d];if(t.isInterleavedBufferAttribute){let s=u/r;for(let a=0,n=t.count;a<n;a++)for(let m=0;m<r;m++){let p=t.getComponent(a,m);h.setComponent(a+s,m,p)}}else e.set(t.array,u);u+=t.count*r}return i!==void 0&&(h.gpuType=i),h}g(T,"mergeAttributes");function X(o,l){if(l===w)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(l===b||l===x){let r=o.getIndex();if(r===null){let e=[],h=o.getAttribute("position");if(h!==void 0){for(let u=0;u<h.count;u++)e.push(u);o.setIndex(e),r=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}let f=r.count-2,i=[];if(l===b)for(let e=1;e<=f;e++)i.push(r.getX(0)),i.push(r.getX(e)),i.push(r.getX(e+1));else for(let e=0;e<f;e++)e%2===0?(i.push(r.getX(e)),i.push(r.getX(e+1)),i.push(r.getX(e+2))):(i.push(r.getX(e+2)),i.push(r.getX(e+1)),i.push(r.getX(e)));i.length/3!==f&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let c=o.clone();return c.setIndex(i),c.clearGroups(),c}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",l),o}g(X,"toTrianglesDrawMode");export{R as a,X as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o,b as Zr,j as ze}from"./chunk-GLHDHW4V.js";var As=Zr((ke,de)=>{ze();var Dr=200,nr="__lodash_hash_undefined__",zr=800,Vr=16,sr=9007199254740991,ar="[object Arguments]",Lr="[object Array]",Ur="[object AsyncFunction]",Br="[object Boolean]",Wr="[object Date]",qr="[object Error]",ir="[object Function]",Hr="[object GeneratorFunction]",Gr="[object Map]",Yr="[object Number]",Jr="[object Null]",or="[object Object]",Fr="[object Proxy]",Kr="[object RegExp]",Xr="[object Set]",Qr="[object String]",en="[object Undefined]",tn="[object WeakMap]",rn="[object ArrayBuffer]",nn="[object DataView]",sn="[object Float32Array]",an="[object Float64Array]",on="[object Int8Array]",cn="[object Int16Array]",un="[object Int32Array]",dn="[object Uint8Array]",ln="[object Uint8ClampedArray]",fn="[object Uint16Array]",hn="[object Uint32Array]",pn=/[\\^$.*+?()[\]{}|]/g,mn=/^\[object .+?Constructor\]$/,gn=/^(?:0|[1-9]\d*)$/,x={};x[sn]=x[an]=x[on]=x[cn]=x[un]=x[dn]=x[ln]=x[fn]=x[hn]=!0;x[ar]=x[Lr]=x[rn]=x[Br]=x[nn]=x[Wr]=x[qr]=x[ir]=x[Gr]=x[Yr]=x[or]=x[Kr]=x[Xr]=x[Qr]=x[tn]=!1;var cr=typeof global=="object"&&global&&global.Object===Object&&global,yn=typeof self=="object"&&self&&self.Object===Object&&self,Se=cr||yn||Function("return this")(),ur=typeof ke=="object"&&ke&&!ke.nodeType&&ke,Te=ur&&typeof de=="object"&&de&&!de.nodeType&&de,dr=Te&&Te.exports===ur,it=dr&&cr.process,Yt=function(){try{var t=Te&&Te.require&&Te.require("util").types;return t||it&&it.binding&&it.binding("util")}catch{}}(),Jt=Yt&&Yt.isTypedArray;function lr(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}o(lr,"apply");function vn(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}o(vn,"baseTimes");function _n(t){return function(e){return t(e)}}o(_n,"baseUnary");function bn(t,e){return t==null?void 0:t[e]}o(bn,"getValue");function xn(t,e){return function(r){return t(e(r))}}o(xn,"overArg");var wn=Array.prototype,kn=Function.prototype,Ue=Object.prototype,ot=Se["__core-js_shared__"],Be=kn.toString,$=Ue.hasOwnProperty,Ft=function(){var t=/[^.]+$/.exec(ot&&ot.keys&&ot.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),fr=Ue.toString,Tn=Be.call(Object),On=RegExp("^"+Be.call($).replace(pn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=dr?Se.Buffer:void 0,Kt=Se.Symbol,Xt=Se.Uint8Array,Qt=Ve?Ve.allocUnsafe:void 0,hr=xn(Object.getPrototypeOf,Object),er=Object.create,Sn=Ue.propertyIsEnumerable,Cn=wn.splice,q=Kt?Kt.toStringTag:void 0,Le=function(){try{var t=pt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),jn=Ve?Ve.isBuffer:void 0,tr=Math.max,En=Date.now,pr=pt(Se,"Map"),Oe=pt(Object,"create"),An=function(){function t(){}return o(t,"object"),function(e){if(!M(e))return{};if(er)return er(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function H(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(H,"Hash");function In(){this.__data__=Oe?Oe(null):{},this.size=0}o(In,"hashClear");function Nn(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}o(Nn,"hashDelete");function Rn(t){var e=this.__data__;if(Oe){var r=e[t];return r===nr?void 0:r}return $.call(e,t)?e[t]:void 0}o(Rn,"hashGet");function Mn(t){var e=this.__data__;return Oe?e[t]!==void 0:$.call(e,t)}o(Mn,"hashHas");function $n(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Oe&&e===void 0?nr:e,this}o($n,"hashSet");H.prototype.clear=In;H.prototype.delete=Nn;H.prototype.get=Rn;H.prototype.has=Mn;H.prototype.set=$n;function Z(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(Z,"ListCache");function Zn(){this.__data__=[],this.size=0}o(Zn,"listCacheClear");function Pn(t){var e=this.__data__,r=We(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Cn.call(e,r,1),--this.size,!0}o(Pn,"listCacheDelete");function Dn(t){var e=this.__data__,r=We(e,t);return r<0?void 0:e[r][1]}o(Dn,"listCacheGet");function zn(t){return We(this.__data__,t)>-1}o(zn,"listCacheHas");function Vn(t,e){var r=this.__data__,n=We(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}o(Vn,"listCacheSet");Z.prototype.clear=Zn;Z.prototype.delete=Pn;Z.prototype.get=Dn;Z.prototype.has=zn;Z.prototype.set=Vn;function le(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(le,"MapCache");function Ln(){this.size=0,this.__data__={hash:new H,map:new(pr||Z),string:new H}}o(Ln,"mapCacheClear");function Un(t){var e=He(this,t).delete(t);return this.size-=e?1:0,e}o(Un,"mapCacheDelete");function Bn(t){return He(this,t).get(t)}o(Bn,"mapCacheGet");function Wn(t){return He(this,t).has(t)}o(Wn,"mapCacheHas");function qn(t,e){var r=He(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}o(qn,"mapCacheSet");le.prototype.clear=Ln;le.prototype.delete=Un;le.prototype.get=Bn;le.prototype.has=Wn;le.prototype.set=qn;function fe(t){var e=this.__data__=new Z(t);this.size=e.size}o(fe,"Stack");function Hn(){this.__data__=new Z,this.size=0}o(Hn,"stackClear");function Gn(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}o(Gn,"stackDelete");function Yn(t){return this.__data__.get(t)}o(Yn,"stackGet");function Jn(t){return this.__data__.has(t)}o(Jn,"stackHas");function Fn(t,e){var r=this.__data__;if(r instanceof Z){var n=r.__data__;if(!pr||n.length<Dr-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new le(n)}return r.set(t,e),this.size=r.size,this}o(Fn,"stackSet");fe.prototype.clear=Hn;fe.prototype.delete=Gn;fe.prototype.get=Yn;fe.prototype.has=Jn;fe.prototype.set=Fn;function Kn(t,e){var r=lt(t),n=!r&&dt(t),s=!r&&!n&&_r(t),a=!r&&!n&&!s&&xr(t),c=r||n||s||a,i=c?vn(t.length,String):[],u=i.length;for(var l in t)(e||$.call(t,l))&&!(c&&(l=="length"||s&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||yr(l,u)))&&i.push(l);return i}o(Kn,"arrayLikeKeys");function ct(t,e,r){(r!==void 0&&!Ge(t[e],r)||r===void 0&&!(e in t))&&ft(t,e,r)}o(ct,"assignMergeValue");function Xn(t,e,r){var n=t[e];(!($.call(t,e)&&Ge(n,r))||r===void 0&&!(e in t))&&ft(t,e,r)}o(Xn,"assignValue");function We(t,e){for(var r=t.length;r--;)if(Ge(t[r][0],e))return r;return-1}o(We,"assocIndexOf");function ft(t,e,r){e=="__proto__"&&Le?Le(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}o(ft,"baseAssignValue");var Qn=ls();function qe(t){return t==null?t===void 0?en:Jr:q&&q in Object(t)?fs(t):vs(t)}o(qe,"baseGetTag");function rr(t){return Ce(t)&&qe(t)==ar}o(rr,"baseIsArguments");function es(t){if(!M(t)||gs(t))return!1;var e=gt(t)?On:mn;return e.test(ws(t))}o(es,"baseIsNative");function ts(t){return Ce(t)&&br(t.length)&&!!x[qe(t)]}o(ts,"baseIsTypedArray");function rs(t){if(!M(t))return ys(t);var e=vr(t),r=[];for(var n in t)n=="constructor"&&(e||!$.call(t,n))||r.push(n);return r}o(rs,"baseKeysIn");function ht(t,e,r,n,s){t!==e&&Qn(e,function(a,c){if(s||(s=new fe),M(a))ns(t,e,c,r,ht,n,s);else{var i=n?n(ut(t,c),a,c+"",t,e,s):void 0;i===void 0&&(i=a),ct(t,c,i)}},wr)}o(ht,"baseMerge");function ns(t,e,r,n,s,a,c){var i=ut(t,r),u=ut(e,r),l=c.get(u);if(l){ct(t,r,l);return}var p=a?a(i,u,r+"",t,e,c):void 0,w=p===void 0;if(w){var ue=lt(u),W=!ue&&_r(u),Gt=!ue&&!W&&xr(u);p=u,ue||W||Gt?lt(i)?p=i:ks(i)?p=cs(i):W?(w=!1,p=as(u,!0)):Gt?(w=!1,p=os(u,!0)):p=[]:Ts(u)||dt(u)?(p=i,dt(i)?p=Os(i):(!M(i)||gt(i))&&(p=hs(u))):w=!1}w&&(c.set(u,p),s(p,u,n,a,c),c.delete(u)),ct(t,r,p)}o(ns,"baseMergeDeep");function mr(t,e){return bs(_s(t,e,kr),t+"")}o(mr,"baseRest");var ss=Le?function(t,e){return Le(t,"toString",{configurable:!0,enumerable:!1,value:js(e),writable:!0})}:kr;function as(t,e){if(e)return t.slice();var r=t.length,n=Qt?Qt(r):new t.constructor(r);return t.copy(n),n}o(as,"cloneBuffer");function is(t){var e=new t.constructor(t.byteLength);return new Xt(e).set(new Xt(t)),e}o(is,"cloneArrayBuffer");function os(t,e){var r=e?is(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}o(os,"cloneTypedArray");function cs(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}o(cs,"copyArray");function us(t,e,r,n){var s=!r;r||(r={});for(var a=-1,c=e.length;++a<c;){var i=e[a],u=n?n(r[i],t[i],i,r,t):void 0;u===void 0&&(u=t[i]),s?ft(r,i,u):Xn(r,i,u)}return r}o(us,"copyObject");function ds(t){return mr(function(e,r){var n=-1,s=r.length,a=s>1?r[s-1]:void 0,c=s>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(s--,a):void 0,c&&ps(r[0],r[1],c)&&(a=s<3?void 0:a,s=1),e=Object(e);++n<s;){var i=r[n];i&&t(e,i,n,a)}return e})}o(ds,"createAssigner");function ls(t){return function(e,r,n){for(var s=-1,a=Object(e),c=n(e),i=c.length;i--;){var u=c[t?i:++s];if(r(a[u],u,a)===!1)break}return e}}o(ls,"createBaseFor");function gr(t,e,r,n,s,a){return M(t)&&M(e)&&(a.set(e,t),ht(t,e,void 0,gr,a),a.delete(e)),t}o(gr,"customDefaultsMerge");function He(t,e){var r=t.__data__;return ms(e)?r[typeof e=="string"?"string":"hash"]:r.map}o(He,"getMapData");function pt(t,e){var r=bn(t,e);return es(r)?r:void 0}o(pt,"getNative");function fs(t){var e=$.call(t,q),r=t[q];try{t[q]=void 0;var n=!0}catch{}var s=fr.call(t);return n&&(e?t[q]=r:delete t[q]),s}o(fs,"getRawTag");function hs(t){return typeof t.constructor=="function"&&!vr(t)?An(hr(t)):{}}o(hs,"initCloneObject");function yr(t,e){var r=typeof t;return e=e==null?sr:e,!!e&&(r=="number"||r!="symbol"&&gn.test(t))&&t>-1&&t%1==0&&t<e}o(yr,"isIndex");function ps(t,e,r){if(!M(r))return!1;var n=typeof e;return(n=="number"?mt(r)&&yr(e,r.length):n=="string"&&e in r)?Ge(r[e],t):!1}o(ps,"isIterateeCall");function ms(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}o(ms,"isKeyable");function gs(t){return!!Ft&&Ft in t}o(gs,"isMasked");function vr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ue;return t===r}o(vr,"isPrototype");function ys(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}o(ys,"nativeKeysIn");function vs(t){return fr.call(t)}o(vs,"objectToString");function _s(t,e,r){return e=tr(e===void 0?t.length-1:e,0),function(){for(var n=arguments,s=-1,a=tr(n.length-e,0),c=Array(a);++s<a;)c[s]=n[e+s];s=-1;for(var i=Array(e+1);++s<e;)i[s]=n[s];return i[e]=r(c),lr(t,this,i)}}o(_s,"overRest");function ut(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}o(ut,"safeGet");var bs=xs(ss);function xs(t){var e=0,r=0;return function(){var n=En(),s=Vr-(n-r);if(r=n,s>0){if(++e>=zr)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}o(xs,"shortOut");function ws(t){if(t!=null){try{return Be.call(t)}catch{}try{return t+""}catch{}}return""}o(ws,"toSource");function Ge(t,e){return t===e||t!==t&&e!==e}o(Ge,"eq");var dt=rr(function(){return arguments}())?rr:function(t){return Ce(t)&&$.call(t,"callee")&&!Sn.call(t,"callee")},lt=Array.isArray;function mt(t){return t!=null&&br(t.length)&&!gt(t)}o(mt,"isArrayLike");function ks(t){return Ce(t)&&mt(t)}o(ks,"isArrayLikeObject");var _r=jn||Es;function gt(t){if(!M(t))return!1;var e=qe(t);return e==ir||e==Hr||e==Ur||e==Fr}o(gt,"isFunction");function br(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=sr}o(br,"isLength");function M(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}o(M,"isObject");function Ce(t){return t!=null&&typeof t=="object"}o(Ce,"isObjectLike");function Ts(t){if(!Ce(t)||qe(t)!=or)return!1;var e=hr(t);if(e===null)return!0;var r=$.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Be.call(r)==Tn}o(Ts,"isPlainObject");var xr=Jt?_n(Jt):ts;function Os(t){return us(t,wr(t))}o(Os,"toPlainObject");var Ss=mr(function(t){return t.push(void 0,gr),lr(Cs,void 0,t)});function wr(t){return mt(t)?Kn(t,!0):rs(t)}o(wr,"keysIn");var Cs=ds(function(t,e,r,n){ht(t,e,r,n)});function js(t){return function(){return t}}o(js,"constant");function kr(t){return t}o(kr,"identity");function Es(){return!1}o(Es,"stubFalse");de.exports=Ss});ze();var b;(function(t){t.assertEqual=s=>s;function e(s){}o(e,"assertIs"),t.assertIs=e;function r(s){throw new Error}o(r,"assertNever"),t.assertNever=r,t.arrayToEnum=s=>{let a={};for(let c of s)a[c]=c;return a},t.getValidEnumValues=s=>{let a=t.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),c={};for(let i of a)c[i]=s[i];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(a){return s[a]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let a=[];for(let c in s)Object.prototype.hasOwnProperty.call(s,c)&&a.push(c);return a},t.find=(s,a)=>{for(let c of s)if(a(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(c=>typeof c=="string"?"'".concat(c,"'"):c).join(a)}o(n,"joinValues"),t.joinValues=n,t.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(b||(b={}));var vt;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(vt||(vt={}));var h=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),V=o(t=>{switch(typeof t){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(t)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(t)?h.array:t===null?h.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?h.promise:typeof Map<"u"&&t instanceof Map?h.map:typeof Set<"u"&&t instanceof Set?h.set:typeof Date<"u"&&t instanceof Date?h.date:h.object;default:return h.unknown}},"getParsedType"),d=b.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Is=o(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),et=class et extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(a){return a.message},n={_errors:[]},s=o(a=>{for(let c of a.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let i=n,u=0;for(;u<c.path.length;){let l=c.path[u];u===c.path.length-1?(i[l]=i[l]||{_errors:[]},i[l]._errors.push(r(c))):i[l]=i[l]||{_errors:[]},i=i[l],u++}}},"processError");return s(this),n}static assert(e){if(!(e instanceof et))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};o(et,"ZodError");var C=et;C.create=t=>new C(t);var ye=o((t,e)=>{let r;switch(t.code){case d.invalid_type:t.received===h.undefined?r="Required":r="Expected ".concat(t.expected,", received ").concat(t.received);break;case d.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(t.expected,b.jsonStringifyReplacer));break;case d.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(b.joinValues(t.keys,", "));break;case d.invalid_union:r="Invalid input";break;case d.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(b.joinValues(t.options));break;case d.invalid_enum_value:r="Invalid enum value. Expected ".concat(b.joinValues(t.options),", received '").concat(t.received,"'");break;case d.invalid_arguments:r="Invalid function arguments";break;case d.invalid_return_type:r="Invalid function return type";break;case d.invalid_date:r="Invalid date";break;case d.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r='Invalid input: must include "'.concat(t.validation.includes,'"'),typeof t.validation.position=="number"&&(r="".concat(r," at one or more positions greater than or equal to ").concat(t.validation.position))):"startsWith"in t.validation?r='Invalid input: must start with "'.concat(t.validation.startsWith,'"'):"endsWith"in t.validation?r='Invalid input: must end with "'.concat(t.validation.endsWith,'"'):b.assertNever(t.validation):t.validation!=="regex"?r="Invalid ".concat(t.validation):r="Invalid";break;case d.too_small:t.type==="array"?r="Array must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"more than"," ").concat(t.minimum," element(s)"):t.type==="string"?r="String must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"over"," ").concat(t.minimum," character(s)"):t.type==="number"?r="Number must be ".concat(t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than ").concat(t.minimum):t.type==="date"?r="Date must be ".concat(t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(t.minimum))):r="Invalid input";break;case d.too_big:t.type==="array"?r="Array must contain ".concat(t.exact?"exactly":t.inclusive?"at most":"less than"," ").concat(t.maximum," element(s)"):t.type==="string"?r="String must contain ".concat(t.exact?"exactly":t.inclusive?"at most":"under"," ").concat(t.maximum," character(s)"):t.type==="number"?r="Number must be ".concat(t.exact?"exactly":t.inclusive?"less than or equal to":"less than"," ").concat(t.maximum):t.type==="bigint"?r="BigInt must be ".concat(t.exact?"exactly":t.inclusive?"less than or equal to":"less than"," ").concat(t.maximum):t.type==="date"?r="Date must be ".concat(t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(t.maximum))):r="Invalid input";break;case d.custom:r="Invalid input";break;case d.invalid_intersection_types:r="Intersection results could not be merged";break;case d.not_multiple_of:r="Number must be a multiple of ".concat(t.multipleOf);break;case d.not_finite:r="Number must be finite";break;default:r=e.defaultError,b.assertNever(t)}return{message:r}},"errorMap"),Sr=ye;function Ns(t){Sr=t}o(Ns,"setErrorMap");function Ye(){return Sr}o(Ye,"getErrorMap");var Je=o(t=>{let{data:e,path:r,errorMaps:n,issueData:s}=t,a=[...r,...s.path||[]],c={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let i="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)i=l(c,{data:e,defaultError:i}).message;return{...s,path:a,message:i}},"makeIssue"),Rs=[];function f(t,e){let r=Ye(),n=Je({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===ye?void 0:ye].filter(s=>!!s)});t.common.issues.push(n)}o(f,"addIssueToContext");var tt=class tt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let s of r){if(s.status==="aborted")return y;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r){let a=await s.key,c=await s.value;n.push({key:a,value:c})}return tt.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:a,value:c}=s;if(a.status==="aborted"||c.status==="aborted")return y;a.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(n[a.value]=c.value)}return{status:e.value,value:n}}};o(tt,"ParseStatus");var k=tt,y=Object.freeze({status:"aborted"}),pe=o(t=>({status:"dirty",value:t}),"DIRTY"),T=o(t=>({status:"valid",value:t}),"OK"),_t=o(t=>t.status==="aborted","isAborted"),bt=o(t=>t.status==="dirty","isDirty"),$e=o(t=>t.status==="valid","isValid"),Ze=o(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync");function Fe(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}o(Fe,"__classPrivateFieldGet");function Cr(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r}o(Cr,"__classPrivateFieldSet");var m;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(m||(m={}));var je,Ee,wt=class wt{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};o(wt,"ParseInputLazyPath");var A=wt,Tr=o((t,e)=>{if($e(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new C(t.common.issues);return this._error=r,this._error}}},"handleResult");function v(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return e?{errorMap:e,description:s}:{errorMap:o((c,i)=>{var u,l;let{message:p}=t;return c.code==="invalid_enum_value"?{message:p!=null?p:i.defaultError}:typeof i.data>"u"?{message:(u=p!=null?p:n)!==null&&u!==void 0?u:i.defaultError}:c.code!=="invalid_type"?{message:i.defaultError}:{message:(l=p!=null?p:r)!==null&&l!==void 0?l:i.defaultError}},"customMap"),description:s}}o(v,"processCreateParams");var kt=class kt{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return V(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:V(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:V(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Ze(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let s={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},a=this._parseSync({data:e,path:s.path,parent:s});return Tr(s,a)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(Ze(s)?s:Promise.resolve(s));return Tr(n,a)}refine(e,r){let n=o(s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r,"getIssueProperties");return this._refinement((s,a)=>{let c=e(s),i=o(()=>a.addIssue({code:d.custom,...n(s)}),"setError");return typeof Promise<"u"&&c instanceof Promise?c.then(u=>u?!0:(i(),!1)):c?!0:(i(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new j({schema:this,typeName:g.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return E.create(this,this._def)}nullable(){return R.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return z.create(this,this._def)}promise(){return B.create(this,this._def)}or(e){return ee.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new j({...v(this._def),schema:this,typeName:g.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new ie({...v(this._def),innerType:this,defaultValue:r,typeName:g.ZodDefault})}brand(){return new Pe({typeName:g.ZodBranded,type:this,...v(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new oe({...v(this._def),innerType:this,catchValue:r,typeName:g.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return De.create(this,e)}readonly(){return ce.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(kt,"ZodType");var _=kt,Ms=/^c[^\s-]{8,}$/i,$s=/^[0-9a-z]+$/,Zs=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ps=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ds=/^[a-z0-9_-]{21}$/i,zs=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Vs=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ls="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",yt,Us=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Bs=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Ws=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jr="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",qs=new RegExp("^".concat(jr,"$"));function Er(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e="".concat(e,"\\.\\d{").concat(t.precision,"}"):t.precision==null&&(e="".concat(e,"(\\.\\d+)?")),e}o(Er,"timeRegexSource");function Hs(t){return new RegExp("^".concat(Er(t),"$"))}o(Hs,"timeRegex");function Ar(t){let e="".concat(jr,"T").concat(Er(t)),r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e="".concat(e,"(").concat(r.join("|"),")"),new RegExp("^".concat(e,"$"))}o(Ar,"datetimeRegex");function Gs(t,e){return!!((e==="v4"||!e)&&Us.test(t)||(e==="v6"||!e)&&Bs.test(t))}o(Gs,"isValidIP");var G=class G extends _{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.string){let a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:h.string,received:a.parsedType}),y}let n=new k,s;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),f(s,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),f(s,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let c=e.data.length>a.value,i=e.data.length<a.value;(c||i)&&(s=this._getOrReturnCtx(e,s),c?f(s,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&f(s,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Vs.test(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{validation:"email",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")yt||(yt=new RegExp(Ls,"u")),yt.test(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{validation:"emoji",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Ps.test(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{validation:"uuid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Ds.test(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{validation:"nanoid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Ms.test(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{validation:"cuid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")$s.test(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{validation:"cuid2",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Zs.test(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{validation:"ulid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),f(s,{validation:"url",code:d.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{validation:"regex",code:d.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),f(s,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),f(s,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),f(s,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Ar(a).test(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{code:d.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?qs.test(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{code:d.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?Hs(a).test(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{code:d.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?zs.test(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{validation:"duration",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Gs(e.data,a.version)||(s=this._getOrReturnCtx(e,s),f(s,{validation:"ip",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Ws.test(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{validation:"base64",code:d.invalid_string,message:a.message}),n.dirty()):b.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:d.invalid_string,...m.errToObj(n)})}_addCheck(e){return new G({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...m.errToObj(e)})}url(e){return this._addCheck({kind:"url",...m.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...m.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...m.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...m.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...m.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...m.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...m.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...m.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...m.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...m.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...m.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...m.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...m.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...m.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...m.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...m.errToObj(r)})}nonempty(e){return this.min(1,m.errToObj(e))}trim(){return new G({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new G({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new G({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};o(G,"ZodString");var L=G;L.create=t=>{var e;return new L({checks:[],typeName:g.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...v(t)})};function Ys(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,a=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return a%c/Math.pow(10,s)}o(Ys,"floatSafeRemainder");var Ae=class Ae extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==h.number){let a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:h.number,received:a.parsedType}),y}let n,s=new k;for(let a of this._def.checks)a.kind==="int"?b.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?Ys(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.not_finite,message:a.message}),s.dirty()):b.assertNever(a);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,m.toString(r))}gt(e,r){return this.setLimit("min",e,!1,m.toString(r))}lte(e,r){return this.setLimit("max",e,!0,m.toString(r))}lt(e,r){return this.setLimit("max",e,!1,m.toString(r))}setLimit(e,r,n,s){return new Ae({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:m.toString(s)}]})}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:m.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:m.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:m.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:m.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:m.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&b.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};o(Ae,"ZodNumber");var Y=Ae;Y.create=t=>new Y({checks:[],typeName:g.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...v(t)});var Ie=class Ie extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==h.bigint){let a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:h.bigint,received:a.parsedType}),y}let n,s=new k;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):b.assertNever(a);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,m.toString(r))}gt(e,r){return this.setLimit("min",e,!1,m.toString(r))}lte(e,r){return this.setLimit("max",e,!0,m.toString(r))}lt(e,r){return this.setLimit("max",e,!1,m.toString(r))}setLimit(e,r,n,s){return new Ie({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:m.toString(s)}]})}_addCheck(e){return new Ie({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:m.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};o(Ie,"ZodBigInt");var J=Ie;J.create=t=>{var e;return new J({checks:[],typeName:g.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...v(t)})};var Tt=class Tt extends _{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){let n=this._getOrReturnCtx(e);return f(n,{code:d.invalid_type,expected:h.boolean,received:n.parsedType}),y}return T(e.data)}};o(Tt,"ZodBoolean");var F=Tt;F.create=t=>new F({typeName:g.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...v(t)});var rt=class rt extends _{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.date){let a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:h.date,received:a.parsedType}),y}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_date}),y}let n=new k,s;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),f(s,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),f(s,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):b.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new rt({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:m.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};o(rt,"ZodDate");var K=rt;K.create=t=>new K({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:g.ZodDate,...v(t)});var Ot=class Ot extends _{_parse(e){if(this._getType(e)!==h.symbol){let n=this._getOrReturnCtx(e);return f(n,{code:d.invalid_type,expected:h.symbol,received:n.parsedType}),y}return T(e.data)}};o(Ot,"ZodSymbol");var ve=Ot;ve.create=t=>new ve({typeName:g.ZodSymbol,...v(t)});var St=class St extends _{_parse(e){if(this._getType(e)!==h.undefined){let n=this._getOrReturnCtx(e);return f(n,{code:d.invalid_type,expected:h.undefined,received:n.parsedType}),y}return T(e.data)}};o(St,"ZodUndefined");var X=St;X.create=t=>new X({typeName:g.ZodUndefined,...v(t)});var Ct=class Ct extends _{_parse(e){if(this._getType(e)!==h.null){let n=this._getOrReturnCtx(e);return f(n,{code:d.invalid_type,expected:h.null,received:n.parsedType}),y}return T(e.data)}};o(Ct,"ZodNull");var Q=Ct;Q.create=t=>new Q({typeName:g.ZodNull,...v(t)});var jt=class jt extends _{constructor(){super(...arguments),this._any=!0}_parse(e){return T(e.data)}};o(jt,"ZodAny");var U=jt;U.create=t=>new U({typeName:g.ZodAny,...v(t)});var Et=class Et extends _{constructor(){super(...arguments),this._unknown=!0}_parse(e){return T(e.data)}};o(Et,"ZodUnknown");var D=Et;D.create=t=>new D({typeName:g.ZodUnknown,...v(t)});var At=class At extends _{_parse(e){let r=this._getOrReturnCtx(e);return f(r,{code:d.invalid_type,expected:h.never,received:r.parsedType}),y}};o(At,"ZodNever");var I=At;I.create=t=>new I({typeName:g.ZodNever,...v(t)});var It=class It extends _{_parse(e){if(this._getType(e)!==h.undefined){let n=this._getOrReturnCtx(e);return f(n,{code:d.invalid_type,expected:h.void,received:n.parsedType}),y}return T(e.data)}};o(It,"ZodVoid");var _e=It;_e.create=t=>new _e({typeName:g.ZodVoid,...v(t)});var me=class me extends _{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==h.array)return f(r,{code:d.invalid_type,expected:h.array,received:r.parsedType}),y;if(s.exactLength!==null){let c=r.data.length>s.exactLength.value,i=r.data.length<s.exactLength.value;(c||i)&&(f(r,{code:c?d.too_big:d.too_small,minimum:i?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(f(r,{code:d.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(f(r,{code:d.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,i)=>s.type._parseAsync(new A(r,c,r.path,i)))).then(c=>k.mergeArray(n,c));let a=[...r.data].map((c,i)=>s.type._parseSync(new A(r,c,r.path,i)));return k.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new me({...this._def,minLength:{value:e,message:m.toString(r)}})}max(e,r){return new me({...this._def,maxLength:{value:e,message:m.toString(r)}})}length(e,r){return new me({...this._def,exactLength:{value:e,message:m.toString(r)}})}nonempty(e){return this.min(1,e)}};o(me,"ZodArray");var z=me;z.create=(t,e)=>new z({type:t,minLength:null,maxLength:null,exactLength:null,typeName:g.ZodArray,...v(e)});function he(t){if(t instanceof O){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=E.create(he(n))}return new O({...t._def,shape:()=>e})}else return t instanceof z?new z({...t._def,type:he(t.element)}):t instanceof E?E.create(he(t.unwrap())):t instanceof R?R.create(he(t.unwrap())):t instanceof N?N.create(t.items.map(e=>he(e))):t}o(he,"deepPartialify");var S=class S extends _{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=b.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==h.object){let l=this._getOrReturnCtx(e);return f(l,{code:d.invalid_type,expected:h.object,received:l.parsedType}),y}let{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:c}=this._getCached(),i=[];if(!(this._def.catchall instanceof I&&this._def.unknownKeys==="strip"))for(let l in s.data)c.includes(l)||i.push(l);let u=[];for(let l of c){let p=a[l],w=s.data[l];u.push({key:{status:"valid",value:l},value:p._parse(new A(s,w,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof I){let l=this._def.unknownKeys;if(l==="passthrough")for(let p of i)u.push({key:{status:"valid",value:p},value:{status:"valid",value:s.data[p]}});else if(l==="strict")i.length>0&&(f(s,{code:d.unrecognized_keys,keys:i}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let p of i){let w=s.data[p];u.push({key:{status:"valid",value:p},value:l._parse(new A(s,w,s.path,p)),alwaysSet:p in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let p of u){let w=await p.key,ue=await p.value;l.push({key:w,value:ue,alwaysSet:p.alwaysSet})}return l}).then(l=>k.mergeObjectSync(n,l)):k.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new S({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var s,a,c,i;let u=(c=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,r,n).message)!==null&&c!==void 0?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(i=m.errToObj(e).message)!==null&&i!==void 0?i:u}:{message:u}}}:{}})}strip(){return new S({...this._def,unknownKeys:"strip"})}passthrough(){return new S({...this._def,unknownKeys:"passthrough"})}extend(e){return new S({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new S({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:g.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new S({...this._def,catchall:e})}pick(e){let r={};return b.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new S({...this._def,shape:()=>r})}omit(e){let r={};return b.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new S({...this._def,shape:()=>r})}deepPartial(){return he(this)}partial(e){let r={};return b.objectKeys(this.shape).forEach(n=>{let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}),new S({...this._def,shape:()=>r})}required(e){let r={};return b.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof E;)a=a._def.innerType;r[n]=a}}),new S({...this._def,shape:()=>r})}keyof(){return Ir(b.objectKeys(this.shape))}};o(S,"ZodObject");var O=S;O.create=(t,e)=>new O({shape:()=>t,unknownKeys:"strip",catchall:I.create(),typeName:g.ZodObject,...v(e)});O.strictCreate=(t,e)=>new O({shape:()=>t,unknownKeys:"strict",catchall:I.create(),typeName:g.ZodObject,...v(e)});O.lazycreate=(t,e)=>new O({shape:t,unknownKeys:"strip",catchall:I.create(),typeName:g.ZodObject,...v(e)});var Nt=class Nt extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(a){for(let i of a)if(i.result.status==="valid")return i.result;for(let i of a)if(i.result.status==="dirty")return r.common.issues.push(...i.ctx.common.issues),i.result;let c=a.map(i=>new C(i.ctx.common.issues));return f(r,{code:d.invalid_union,unionErrors:c}),y}if(o(s,"handleResults"),r.common.async)return Promise.all(n.map(async a=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(s);{let a,c=[];for(let u of n){let l={...r,common:{...r.common,issues:[]},parent:null},p=u._parseSync({data:r.data,path:r.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:l}),l.common.issues.length&&c.push(l.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let i=c.map(u=>new C(u));return f(r,{code:d.invalid_union,unionErrors:i}),y}}get options(){return this._def.options}};o(Nt,"ZodUnion");var ee=Nt;ee.create=(t,e)=>new ee({options:t,typeName:g.ZodUnion,...v(e)});var P=o(t=>t instanceof re?P(t.schema):t instanceof j?P(t.innerType()):t instanceof ne?[t.value]:t instanceof se?t.options:t instanceof ae?b.objectValues(t.enum):t instanceof ie?P(t._def.innerType):t instanceof X?[void 0]:t instanceof Q?[null]:t instanceof E?[void 0,...P(t.unwrap())]:t instanceof R?[null,...P(t.unwrap())]:t instanceof Pe||t instanceof ce?P(t.unwrap()):t instanceof oe?P(t._def.innerType):[],"getDiscriminator"),nt=class nt extends _{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==h.object)return f(r,{code:d.invalid_type,expected:h.object,received:r.parsedType}),y;let n=this.discriminator,s=r.data[n],a=this.optionsMap.get(s);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(f(r,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=new Map;for(let a of r){let c=P(a.shape[e]);if(!c.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let i of c){if(s.has(i))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(i)));s.set(i,a)}}return new nt({typeName:g.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...v(n)})}};o(nt,"ZodDiscriminatedUnion");var Ke=nt;function xt(t,e){let r=V(t),n=V(e);if(t===e)return{valid:!0,data:t};if(r===h.object&&n===h.object){let s=b.objectKeys(e),a=b.objectKeys(t).filter(i=>s.indexOf(i)!==-1),c={...t,...e};for(let i of a){let u=xt(t[i],e[i]);if(!u.valid)return{valid:!1};c[i]=u.data}return{valid:!0,data:c}}else if(r===h.array&&n===h.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let a=0;a<t.length;a++){let c=t[a],i=e[a],u=xt(c,i);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return r===h.date&&n===h.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}o(xt,"mergeValues");var Rt=class Rt extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=o((a,c)=>{if(_t(a)||_t(c))return y;let i=xt(a.value,c.value);return i.valid?((bt(a)||bt(c))&&r.dirty(),{status:r.value,value:i.data}):(f(n,{code:d.invalid_intersection_types}),y)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,c])=>s(a,c)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};o(Rt,"ZodIntersection");var te=Rt;te.create=(t,e,r)=>new te({left:t,right:e,typeName:g.ZodIntersection,...v(r)});var st=class st extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.array)return f(n,{code:d.invalid_type,expected:h.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return f(n,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&n.data.length>this._def.items.length&&(f(n,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((c,i)=>{let u=this._def.items[i]||this._def.rest;return u?u._parse(new A(n,c,n.path,i)):null}).filter(c=>!!c);return n.common.async?Promise.all(a).then(c=>k.mergeArray(r,c)):k.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new st({...this._def,rest:e})}};o(st,"ZodTuple");var N=st;N.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new N({items:t,typeName:g.ZodTuple,rest:null,...v(e)})};var Ne=class Ne extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.object)return f(n,{code:d.invalid_type,expected:h.object,received:n.parsedType}),y;let s=[],a=this._def.keyType,c=this._def.valueType;for(let i in n.data)s.push({key:a._parse(new A(n,i,n.path,i)),value:c._parse(new A(n,n.data[i],n.path,i)),alwaysSet:i in n.data});return n.common.async?k.mergeObjectAsync(r,s):k.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof _?new Ne({keyType:e,valueType:r,typeName:g.ZodRecord,...v(n)}):new Ne({keyType:L.create(),valueType:e,typeName:g.ZodRecord,...v(r)})}};o(Ne,"ZodRecord");var Xe=Ne,Mt=class Mt extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.map)return f(n,{code:d.invalid_type,expected:h.map,received:n.parsedType}),y;let s=this._def.keyType,a=this._def.valueType,c=[...n.data.entries()].map(([i,u],l)=>({key:s._parse(new A(n,i,n.path,[l,"key"])),value:a._parse(new A(n,u,n.path,[l,"value"]))}));if(n.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let u of c){let l=await u.key,p=await u.value;if(l.status==="aborted"||p.status==="aborted")return y;(l.status==="dirty"||p.status==="dirty")&&r.dirty(),i.set(l.value,p.value)}return{status:r.value,value:i}})}else{let i=new Map;for(let u of c){let l=u.key,p=u.value;if(l.status==="aborted"||p.status==="aborted")return y;(l.status==="dirty"||p.status==="dirty")&&r.dirty(),i.set(l.value,p.value)}return{status:r.value,value:i}}}};o(Mt,"ZodMap");var be=Mt;be.create=(t,e,r)=>new be({valueType:e,keyType:t,typeName:g.ZodMap,...v(r)});var Re=class Re extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.set)return f(n,{code:d.invalid_type,expected:h.set,received:n.parsedType}),y;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(f(n,{code:d.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(f(n,{code:d.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let a=this._def.valueType;function c(u){let l=new Set;for(let p of u){if(p.status==="aborted")return y;p.status==="dirty"&&r.dirty(),l.add(p.value)}return{status:r.value,value:l}}o(c,"finalizeSet");let i=[...n.data.values()].map((u,l)=>a._parse(new A(n,u,n.path,l)));return n.common.async?Promise.all(i).then(u=>c(u)):c(i)}min(e,r){return new Re({...this._def,minSize:{value:e,message:m.toString(r)}})}max(e,r){return new Re({...this._def,maxSize:{value:e,message:m.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};o(Re,"ZodSet");var xe=Re;xe.create=(t,e)=>new xe({valueType:t,minSize:null,maxSize:null,typeName:g.ZodSet,...v(e)});var ge=class ge extends _{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==h.function)return f(r,{code:d.invalid_type,expected:h.function,received:r.parsedType}),y;function n(i,u){return Je({data:i,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ye(),ye].filter(l=>!!l),issueData:{code:d.invalid_arguments,argumentsError:u}})}o(n,"makeArgsIssue");function s(i,u){return Je({data:i,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ye(),ye].filter(l=>!!l),issueData:{code:d.invalid_return_type,returnTypeError:u}})}o(s,"makeReturnsIssue");let a={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof B){let i=this;return T(async function(...u){let l=new C([]),p=await i._def.args.parseAsync(u,a).catch(W=>{throw l.addIssue(n(u,W)),l}),w=await Reflect.apply(c,this,p);return await i._def.returns._def.type.parseAsync(w,a).catch(W=>{throw l.addIssue(s(w,W)),l})})}else{let i=this;return T(function(...u){let l=i._def.args.safeParse(u,a);if(!l.success)throw new C([n(u,l.error)]);let p=Reflect.apply(c,this,l.data),w=i._def.returns.safeParse(p,a);if(!w.success)throw new C([s(p,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ge({...this._def,args:N.create(e).rest(D.create())})}returns(e){return new ge({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new ge({args:e||N.create([]).rest(D.create()),returns:r||D.create(),typeName:g.ZodFunction,...v(n)})}};o(ge,"ZodFunction");var Qe=ge,$t=class $t extends _{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};o($t,"ZodLazy");var re=$t;re.create=(t,e)=>new re({getter:t,typeName:g.ZodLazy,...v(e)});var Zt=class Zt extends _{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return f(r,{received:r.data,code:d.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}};o(Zt,"ZodLiteral");var ne=Zt;ne.create=(t,e)=>new ne({value:t,typeName:g.ZodLiteral,...v(e)});function Ir(t,e){return new se({values:t,typeName:g.ZodEnum,...v(e)})}o(Ir,"createZodEnum");var Me=class Me extends _{constructor(){super(...arguments),je.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return f(r,{expected:b.joinValues(n),received:r.parsedType,code:d.invalid_type}),y}if(Fe(this,je,"f")||Cr(this,je,new Set(this._def.values),"f"),!Fe(this,je,"f").has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return f(r,{received:r.data,code:d.invalid_enum_value,options:n}),y}return T(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Me.create(e,{...this._def,...r})}exclude(e,r=this._def){return Me.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};o(Me,"ZodEnum");var se=Me;je=new WeakMap;se.create=Ir;var Pt=class Pt extends _{constructor(){super(...arguments),Ee.set(this,void 0)}_parse(e){let r=b.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==h.string&&n.parsedType!==h.number){let s=b.objectValues(r);return f(n,{expected:b.joinValues(s),received:n.parsedType,code:d.invalid_type}),y}if(Fe(this,Ee,"f")||Cr(this,Ee,new Set(b.getValidEnumValues(this._def.values)),"f"),!Fe(this,Ee,"f").has(e.data)){let s=b.objectValues(r);return f(n,{received:n.data,code:d.invalid_enum_value,options:s}),y}return T(e.data)}get enum(){return this._def.values}};o(Pt,"ZodNativeEnum");var ae=Pt;Ee=new WeakMap;ae.create=(t,e)=>new ae({values:t,typeName:g.ZodNativeEnum,...v(e)});var Dt=class Dt extends _{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==h.promise&&r.common.async===!1)return f(r,{code:d.invalid_type,expected:h.promise,received:r.parsedType}),y;let n=r.parsedType===h.promise?r.data:Promise.resolve(r.data);return T(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};o(Dt,"ZodPromise");var B=Dt;B.create=(t,e)=>new B({type:t,typeName:g.ZodPromise,...v(e)});var zt=class zt extends _{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===g.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:c=>{f(n,c),c.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){let c=s.transform(n.data,a);if(n.common.async)return Promise.resolve(c).then(async i=>{if(r.value==="aborted")return y;let u=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});return u.status==="aborted"?y:u.status==="dirty"||r.value==="dirty"?pe(u.value):u});{if(r.value==="aborted")return y;let i=this._def.schema._parseSync({data:c,path:n.path,parent:n});return i.status==="aborted"?y:i.status==="dirty"||r.value==="dirty"?pe(i.value):i}}if(s.type==="refinement"){let c=o(i=>{let u=s.refinement(i,a);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i},"executeRefinement");if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?y:(i.status==="dirty"&&r.dirty(),c(i.value),{status:r.value,value:i.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>i.status==="aborted"?y:(i.status==="dirty"&&r.dirty(),c(i.value).then(()=>({status:r.value,value:i.value}))))}if(s.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!$e(c))return c;let i=s.transform(c.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>$e(c)?Promise.resolve(s.transform(c.value,a)).then(i=>({status:r.value,value:i})):c);b.assertNever(s)}};o(zt,"ZodEffects");var j=zt;j.create=(t,e,r)=>new j({schema:t,typeName:g.ZodEffects,effect:e,...v(r)});j.createWithPreprocess=(t,e,r)=>new j({schema:e,effect:{type:"preprocess",transform:t},typeName:g.ZodEffects,...v(r)});var Vt=class Vt extends _{_parse(e){return this._getType(e)===h.undefined?T(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Vt,"ZodOptional");var E=Vt;E.create=(t,e)=>new E({innerType:t,typeName:g.ZodOptional,...v(e)});var Lt=class Lt extends _{_parse(e){return this._getType(e)===h.null?T(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Lt,"ZodNullable");var R=Lt;R.create=(t,e)=>new R({innerType:t,typeName:g.ZodNullable,...v(e)});var Ut=class Ut extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===h.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};o(Ut,"ZodDefault");var ie=Ut;ie.create=(t,e)=>new ie({innerType:t,typeName:g.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});var Bt=class Bt extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ze(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new C(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new C(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};o(Bt,"ZodCatch");var oe=Bt;oe.create=(t,e)=>new oe({innerType:t,typeName:g.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});var Wt=class Wt extends _{_parse(e){if(this._getType(e)!==h.nan){let n=this._getOrReturnCtx(e);return f(n,{code:d.invalid_type,expected:h.nan,received:n.parsedType}),y}return{status:"valid",value:e.data}}};o(Wt,"ZodNaN");var we=Wt;we.create=t=>new we({typeName:g.ZodNaN,...v(t)});var Js=Symbol("zod_brand"),qt=class qt extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};o(qt,"ZodBranded");var Pe=qt,at=class at extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return o(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?y:a.status==="dirty"?(r.dirty(),pe(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})},"handleAsync")();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?y:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new at({in:e,out:r,typeName:g.ZodPipeline})}};o(at,"ZodPipeline");var De=at,Ht=class Ht extends _{_parse(e){let r=this._def.innerType._parse(e),n=o(s=>($e(s)&&(s.value=Object.freeze(s.value)),s),"freeze");return Ze(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};o(Ht,"ZodReadonly");var ce=Ht;ce.create=(t,e)=>new ce({innerType:t,typeName:g.ZodReadonly,...v(e)});function Nr(t,e={},r){return t?U.create().superRefine((n,s)=>{var a,c;if(!t(n)){let i=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(c=(a=i.fatal)!==null&&a!==void 0?a:r)!==null&&c!==void 0?c:!0,l=typeof i=="string"?{message:i}:i;s.addIssue({code:"custom",...l,fatal:u})}}):U.create()}o(Nr,"custom");var Fs={object:O.lazycreate},g;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(g||(g={}));var Ks=o((t,e={message:"Input not instance of ".concat(t.name)})=>Nr(r=>r instanceof t,e),"instanceOfType"),Rr=L.create,Mr=Y.create,Xs=we.create,Qs=J.create,$r=F.create,ea=K.create,ta=ve.create,ra=X.create,na=Q.create,sa=U.create,aa=D.create,ia=I.create,oa=_e.create,ca=z.create,ua=O.create,da=O.strictCreate,la=ee.create,fa=Ke.create,ha=te.create,pa=N.create,ma=Xe.create,ga=be.create,ya=xe.create,va=Qe.create,_a=re.create,ba=ne.create,xa=se.create,wa=ae.create,ka=B.create,Or=j.create,Ta=E.create,Oa=R.create,Sa=j.createWithPreprocess,Ca=De.create,ja=o(()=>Rr().optional(),"ostring"),Ea=o(()=>Mr().optional(),"onumber"),Aa=o(()=>$r().optional(),"oboolean"),Ia={string:t=>L.create({...t,coerce:!0}),number:t=>Y.create({...t,coerce:!0}),boolean:t=>F.create({...t,coerce:!0}),bigint:t=>J.create({...t,coerce:!0}),date:t=>K.create({...t,coerce:!0})},Na=y,$a=Object.freeze({__proto__:null,defaultErrorMap:ye,setErrorMap:Ns,getErrorMap:Ye,makeIssue:Je,EMPTY_PATH:Rs,addIssueToContext:f,ParseStatus:k,INVALID:y,DIRTY:pe,OK:T,isAborted:_t,isDirty:bt,isValid:$e,isAsync:Ze,get util(){return b},get objectUtil(){return vt},ZodParsedType:h,getParsedType:V,ZodType:_,datetimeRegex:Ar,ZodString:L,ZodNumber:Y,ZodBigInt:J,ZodBoolean:F,ZodDate:K,ZodSymbol:ve,ZodUndefined:X,ZodNull:Q,ZodAny:U,ZodUnknown:D,ZodNever:I,ZodVoid:_e,ZodArray:z,ZodObject:O,ZodUnion:ee,ZodDiscriminatedUnion:Ke,ZodIntersection:te,ZodTuple:N,ZodRecord:Xe,ZodMap:be,ZodSet:xe,ZodFunction:Qe,ZodLazy:re,ZodLiteral:ne,ZodEnum:se,ZodNativeEnum:ae,ZodPromise:B,ZodEffects:j,ZodTransformer:j,ZodOptional:E,ZodNullable:R,ZodDefault:ie,ZodCatch:oe,ZodNaN:we,BRAND:Js,ZodBranded:Pe,ZodPipeline:De,ZodReadonly:ce,custom:Nr,Schema:_,ZodSchema:_,late:Fs,get ZodFirstPartyTypeKind(){return g},coerce:Ia,any:sa,array:ca,bigint:Qs,boolean:$r,date:ea,discriminatedUnion:fa,effect:Or,enum:xa,function:va,instanceof:Ks,intersection:ha,lazy:_a,literal:ba,map:ga,nan:Xs,nativeEnum:wa,never:ia,null:na,nullable:Oa,number:Mr,object:ua,oboolean:Aa,onumber:Ea,optional:Ta,ostring:ja,pipeline:Ca,preprocess:Sa,promise:ka,record:ma,set:ya,strictObject:da,string:Rr,symbol:ta,transformer:Or,tuple:pa,undefined:ra,union:la,unknown:aa,void:oa,NEVER:Na,ZodIssueCode:d,quotelessJson:Is,ZodError:C});export{As as a,$a as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var h=Object.create;var f=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var m=(b,a,c)=>a in b?f(b,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):b[a]=c;var r=(b,a)=>f(b,"name",{value:a,configurable:!0});var n=(b,a)=>()=>(b&&(a=b(b=0)),a);var s=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports),t=(b,a)=>{for(var c in a)f(b,c,{get:a[c],enumerable:!0})},o=(b,a,c,d)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of j(a))!l.call(b,e)&&e!==c&&f(b,e,{get:()=>a[e],enumerable:!(d=i(a,e))||d.enumerable});return b};var u=(b,a,c)=>(c=b!=null?h(k(b)):{},o(a||!b||!b.__esModule?f(c,"default",{value:b,enumerable:!0}):c,b));var v=(b,a,c)=>(m(b,typeof a!="symbol"?a+"":a,c),c),g=(b,a,c)=>{if(!a.has(b))throw TypeError("Cannot "+c)};var w=(b,a,c)=>(g(b,a,"read from private field"),c?c.call(b):a.get(b)),x=(b,a,c)=>{if(a.has(b))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(b):a.set(b,c)},y=(b,a,c,d)=>(g(b,a,"write to private field"),d?d.call(b,c):a.set(b,c),c);var z=(b,a,c)=>(g(b,a,"access private method"),c);var C,q=n(()=>{C={env:{NODE_ENV:"production",npm_package_version:"6.0.1-beta.10"}}});export{r as a,s as b,t as c,u as d,v as e,w as f,x as g,y as h,z as i,q as j,C as k};
|