rayvo 0.0.1 → 0.0.2
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/README.md +76 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +11868 -0
- package/dist/index.js +1 -0
- package/dist/index.umd.js +1 -0
- package/package.json +41 -39
- package/vite.config.ts +0 -73
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("webgpu-utils");let t=0;function e(){return crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,A=>{const t=16*Math.random()|0;return("x"===A?t:3&t|8).toString(16)})}const i=e();function s(A){return A<.04045?.0773993808*A:Math.pow(.9478672986*A+.0521327014,2.4)}const n=globalThis.document?function(){return document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}:function(){return new OffscreenCanvas(1,1)};let r;class a{static noSupportCanvas="undefined"==typeof HTMLCanvasElement&&"undefined"==typeof OffscreenCanvas;static getDataURL(A,t="image/png"){if(/^data:/i.test(A.src)||a.noSupportCanvas)return A.src;if(A instanceof HTMLCanvasElement)return A.toDataURL(t);{r??=n(),r.width=A.width,r.height=A.height;const e=r.getContext("2d");return A instanceof ImageData?e.putImageData(A,0,0):e.drawImage(A,0,0,A.width,A.height),r.toDataURL(t)}}static sRGBToLinear(A){if("undefined"!=typeof HTMLImageElement&&A instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&A instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&A instanceof ImageBitmap){const t=n();t.width=A.width,t.height=A.height;const e=t.getContext("2d");e.drawImage(A,0,0,A.width,A.height);const i=e.getImageData(0,0,A.width,A.height),r=i.data;for(let A=0,n=r.length;A<n;A++)r[A]=255*s(r[A]/255);return e.putImageData(i,0,0),t}if(A.data){const t=A.data.slice(0);if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)for(let A=0,e=t.length;A<e;A++)t[A]=Math.floor(255*s(t[A]/255));else for(let A=0,e=t.length;A<e;A++)t[A]=s(t[A]);return{data:t,width:A.width,height:A.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),A}}const o=Object.prototype.toString;function l(A){return null!=A&&"[object Object]"===o.call(A)}class c{isSharedViews=!0;#A;view;f32;i32;u32;u8;i8;i16;u16;f16=null;byteOffset=0;#t;callback;static BYTES_PER_ELEMENT=1;constructor(A,t){this.callback=t?.callback,this.byteOffset=t?.byteOffset??0,this.#t=t?.byteLength,this.#e("number"==typeof A?new ArrayBuffer(A):A)}get length(){return this.byteLength}get byteLength(){return this.#t??this.#A.byteLength-this.byteOffset}get buffer(){return this.#A}set buffer(A){this.#e(A,"buffer")}#e(A,t){this.#A=A;const e=this.byteOffset,i=this.#t??A.byteLength-e;this.view=new DataView(A,e,i),this.f32=new Float32Array(A,e,i>>2),this.i32=new Int32Array(A,e,i>>2),this.u32=new Uint32Array(A,e,i>>2),this.u8=new Uint8Array(A,e,i),this.i8=new Int8Array(A,e,i),this.i16=new Int16Array(A,e,i>>1),this.u16=new Uint16Array(A,e,i>>1),"undefined"!=typeof Float16Array&&(this.f16=new Float16Array(A,e,i>>1)),t&&this.callback?.(this,t)}rebind(A,t,e){this.byteOffset=t,this.#t=e,this.#e(A)}resize(A){if(0!==this.byteOffset)throw new Error("SharedViews.resize requires byteOffset === 0");const t=this.#t;if(A===this.#A.byteLength&&(null==t||t===A))return;const e=this.#A.transfer(A);null!=t&&(this.#t=A),this.#e(e,"resize")}set(A,t=0,e="f32"){this.getView(e).set(A,t)}getUseView(A,t=0,e){const i=this.getView(A);if(0===t&&null==e)return i;const s=i.BYTES_PER_ELEMENT,n=Math.ceil(t/s),r=null!=e?Math.ceil((t+e)/s):void 0;return i.subarray(n,r)}static getUseView(A,t,e=0,i){const s=this.getView(A,t);if(0===e&&null==i)return s;const n=s.BYTES_PER_ELEMENT,r=Math.ceil(e/n),a=null!=i?Math.ceil((e+i)/n):void 0;return s.subarray(r,a)}static getView(A,t){const{buffer:e,byteOffset:i,byteLength:s}=A;switch(t){case"f32":default:return new Float32Array(e,i,s>>2);case"i32":return new Int32Array(e,i,s>>2);case"u32":return new Uint32Array(e,i,s>>2);case"f16":return"undefined"!=typeof Float16Array?new Float16Array(e,i,s>>1):new Float32Array(e,i,s>>2);case"u8":return new Uint8Array(e,i,s);case"i8":return new Int8Array(e,i,s);case"i16":return new Int16Array(e,i,s>>1);case"u16":return new Uint16Array(e,i,s>>1)}}getView(A){switch(A){case"f32":default:return this.f32;case"i32":return this.i32;case"u32":return this.u32;case"f16":return this.f16||this.f32;case"u8":return this.u8;case"i8":return this.i8;case"i16":return this.i16;case"u16":return this.u16}}copy(A){this.u8.set(A.u8)}[Symbol.iterator](){return this.u8[Symbol.iterator]()}}function h(A){return A?A[0].toUpperCase()+A.slice(1):""}function u(A,t){return Math.ceil(t/A)*A}const g=A=>{A?.dispose?.(),A?.destroy?.()},d=new class{#i;#s;#n=new WeakMap;#r=new Set;constructor(A){this.#i=A??g,this.#s=new FinalizationRegistry(A=>{this.#r.delete(A)&&this.#a(A)})}#a(A){"function"==typeof A?A():this.#i(A)}register(A,t){const e=this.#n.get(A)||new Set;e.add(t),this.#n.set(A,e),this.#r.add(t),this.#s.register(A,t,A)}unregister(A,t){this.#s.unregister(A);const e=this.#n.get(A);if(e&&e.size>0){const i=this.#r;t?i.delete(t):(e.forEach(A=>{i.delete(A)}),e.clear()),0===e.size&&this.#n.delete(A)}}clear(){for(const A of this.#r)this.#a(A);this.#r.clear(),this.#n=new WeakMap}};class p{_listeners=new Map;has;on;off;emit;constructor(){this.has=this.hasEventListener,this.on=this.addEventListener,this.off=this.removeEventListener,this.emit=this.dispatchEvent}addEventListener(A,t){const e=this._listeners;e.has(A)||e.set(A,[]);const i=e.get(A);-1===i.indexOf(t)&&i.push(t)}hasEventListener(A,t){const e=this._listeners.get(A);return void 0!==e&&-1!==e.indexOf(t)}removeEventListener(A,t){const e=this._listeners.get(A);if(void 0!==e){const A=e.indexOf(t);-1!==A&&e.splice(A,1)}}dispatchEvent(A,...t){const e=this._listeners.get(A);if(void 0!==e){const A=e.slice(0);for(let e=0,i=A.length;e<i;e++)A[e].apply(this,t)}}removeAllListeners(A){return A?this._listeners.get(A)&&this._listeners.delete(A):this._listeners.clear(),this}}var f=(A=>(A[A.VISIBLE=1]="VISIBLE",A[A.LOCAL_DIRTY=2]="LOCAL_DIRTY",A[A.WORLD_DIRTY=4]="WORLD_DIRTY",A[A.NEED_RENDER=8]="NEED_RENDER",A[A.LEVEL_SHIFT=4]="LEVEL_SHIFT",A[A.LEVEL_MASK=496]="LEVEL_MASK",A[A.UPLOAD_DIRTY=512]="UPLOAD_DIRTY",A[A.DIRTY_VISIBLE=1024]="DIRTY_VISIBLE",A[A.DIRTY_ATTRIBUTE=2048]="DIRTY_ATTRIBUTE",A[A.DIRTY_DATA=4096]="DIRTY_DATA",A[A.DIRTY_INDEX=8192]="DIRTY_INDEX",A[A.DIRTY_STRUCTURE=16384]="DIRTY_STRUCTURE",A[A.EFFECTIVE_VISIBLE=32768]="EFFECTIVE_VISIBLE",A[A.REPARENT_PENDING=65536]="REPARENT_PENDING",A[A.DIRTY_PIPELINE=131072]="DIRTY_PIPELINE",A[A.DIRTY_MORPH=262144]="DIRTY_MORPH",A[A.DIRTY_MATRIX=6]="DIRTY_MATRIX",A[A.DIRTY_ALL=162822]="DIRTY_ALL",A))(f||{});const m=424960,C=424966;class w{isDirty=!0;depObject=null;dirtyTypes=f.DIRTY_DATA;offset;#o;#l;constructor(A=0,t=0,e,i=0){e||=new Float32Array(2),this.offset=i,this.#l=e,this.#o=0===i&&2===e.length?e:e.subarray(i,i+2),0===i?(e[0]=A,e[1]=t):(e[i]=A,e[i+1]=t)}onChangeCallback(){this.isDirty||(this.isDirty=!0,this.depObject?.onChangeCallback(this.dirtyTypes))}resetDirty(){this.isDirty=!1}setTypeData(A,t){const e=t??this.offset;this.#l===A&&this.offset===e||(this.offset=e,this.#l=A,this.#o=0===e&&2===A.length?A:A.subarray(e,e+2))}get width(){return this.#l[this.offset]}set width(A){this.#l[this.offset]=A,this.onChangeCallback()}get height(){return this.#l[this.offset+1]}set height(A){this.#l[this.offset+1]=A,this.onChangeCallback()}get x(){return this.#l[this.offset]}set x(A){this.#l[this.offset]=A,this.onChangeCallback()}get y(){return this.#l[this.offset+1]}set y(A){this.#l[this.offset+1]=A,this.onChangeCallback()}get z(){return 0}set(A,t){const e=this.offset,i=this.#l;return 0===e?(i[0]=A,i[1]=t):(i[e]=A,i[e+1]=t),this.onChangeCallback(),this}applyMatrix3(A){const t=this.x,e=this.y,i=A.elements;return this.set(i[0]*t+i[3]*e+i[6],i[1]*t+i[4]*e+i[7]),this}get elements(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+2),this.#o)}get data(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+2),this.#o)}copy(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?(e[0]=i[0],e[1]=i[1]):(e[t]=i[0],e[t+1]=i[1]),this.onChangeCallback(),this}clone(){const A=this.offset,t=this.#l;return new w(t[A],t[A+1])}add(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?(e[0]+=i[0],e[1]+=i[1]):(e[t]+=i[0],e[t+1]+=i[1]),this.onChangeCallback(),this}sub(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?(e[0]-=i[0],e[1]-=i[1]):(e[t]-=i[0],e[t+1]-=i[1]),this.onChangeCallback(),this}multiplyScalar(A){const t=this.offset,e=this.#l;return 0===t?(e[0]*=A,e[1]*=A):(e[t]*=A,e[t+1]*=A),this.onChangeCallback(),this}equals(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?i[0]===e[0]&&i[1]===e[1]:i[0]===e[t]&&i[1]===e[t+1]}fromArray(A,t=0){const e=this.offset,i=this.#l;return 0===e?(i[0]=A[t],i[1]=A[t+1]):(i[e]=A[t],i[e+1]=A[t+1]),this.onChangeCallback(),this}toArray(A=[],t=0){const e=this.elements;return A[t]=e[0],A[t+1]=e[1],A}setValue(A){return Array.isArray(A)||A?.buffer?.byteLength>=0?this.fromArray(A):this.copy(A),this}getValue(){return this}[Symbol.iterator](){return this.elements[Symbol.iterator]()}}class y{isDirty=!0;depObject=null;dirtyTypes=f.DIRTY_DATA;offset;#o;#l;constructor(A=0,t=0,e=0,i,s=0){i||=new Float32Array(3),this.offset=s,this.#l=i,this.#o=0===s&&3===i.length?i:i.subarray(s,s+3),0===s?(i[0]=A,i[1]=t,i[2]=e):(i[s]=A,i[s+1]=t,i[s+2]=e)}onChangeCallback(){this.isDirty||(this.isDirty=!0,this.depObject?.onChangeCallback(this.dirtyTypes))}resetDirty(){this.isDirty=!1}setTypeData(A,t){const e=t??this.offset;this.#l===A&&this.offset===e||(this.offset=e,this.#l=A,this.#o=0===e&&3===A.length?A:A.subarray(e,e+3))}get x(){return this.#l[this.offset]}set x(A){this.#l[this.offset]=A,this.onChangeCallback()}get y(){return this.#l[this.offset+1]}set y(A){this.#l[this.offset+1]=A,this.onChangeCallback()}get z(){return this.#l[this.offset+2]}set z(A){this.#l[this.offset+2]=A,this.onChangeCallback()}get elements(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+3),this.#o)}get data(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+3),this.#o)}set(A,t,e){const i=this.offset,s=this.#l;return 0===i?(s[0]=A,s[1]=t,s[2]=e):(s[i]=A,s[i+1]=t,s[i+2]=e),this.onChangeCallback(),this}copy(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?(e[0]=i[0],e[1]=i[1],e[2]=i[2]):(e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2]),this.onChangeCallback(),this}clone(){const A=this.offset,t=this.#l;return new y(t[A],t[A+1],t[A+2])}add(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?(e[0]+=i[0],e[1]+=i[1],e[2]+=i[2]):(e[t]+=i[0],e[t+1]+=i[1],e[t+2]+=i[2]),this.onChangeCallback(),this}sub(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?(e[0]-=i[0],e[1]-=i[1],e[2]-=i[2]):(e[t]-=i[0],e[t+1]-=i[1],e[t+2]-=i[2]),this.onChangeCallback(),this}multiplyScalar(A){const t=this.offset,e=this.#l;return 0===t?(e[0]*=A,e[1]*=A,e[2]*=A):(e[t]*=A,e[t+1]*=A,e[t+2]*=A),this.onChangeCallback(),this}divideScalar(A){return this.multiplyScalar(1/A)}dot(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?e[0]*i[0]+e[1]*i[1]+e[2]*i[2]:e[t]*i[0]+e[t+1]*i[1]+e[t+2]*i[2]}cross(A){const t=this.offset,e=this.#l,i=A.elements;let s,n,r;0===t?(s=e[0],n=e[1],r=e[2]):(s=e[t],n=e[t+1],r=e[t+2]);const a=i[0],o=i[1],l=i[2];return 0===t?(e[0]=n*l-r*o,e[1]=r*a-s*l,e[2]=s*o-n*a):(e[t]=n*l-r*o,e[t+1]=r*a-s*l,e[t+2]=s*o-n*a),this.onChangeCallback(),this}crossVectors(A,t){const e=this.offset,i=this.#l,s=A.elements,n=t.elements,r=s[0],a=s[1],o=s[2],l=n[0],c=n[1],h=n[2];return 0===e?(i[0]=a*h-o*c,i[1]=o*l-r*h,i[2]=r*c-a*l):(i[e]=a*h-o*c,i[e+1]=o*l-r*h,i[e+2]=r*c-a*l),this.onChangeCallback(),this}length(){return Math.sqrt(this.lengthSq())}lengthSq(){const A=this.offset,t=this.#l;if(0===A){const A=t[0],e=t[1],i=t[2];return A*A+e*e+i*i}{const e=t[A],i=t[A+1],s=t[A+2];return e*e+i*i+s*s}}normalize(){const A=this.length();return A>0&&this.divideScalar(A),this}distanceTo(A){return Math.sqrt(this.distanceToSquared(A))}distanceToSquared(A){const t=this.offset,e=this.#l,i=A.elements;if(0===t){const A=e[0]-i[0],t=e[1]-i[1],s=e[2]-i[2];return A*A+t*t+s*s}{const A=e[t]-i[0],s=e[t+1]-i[1],n=e[t+2]-i[2];return A*A+s*s+n*n}}negate(){const A=this.offset,t=this.#l;return 0===A?(t[0]=-t[0],t[1]=-t[1],t[2]=-t[2]):(t[A]=-t[A],t[A+1]=-t[A+1],t[A+2]=-t[A+2]),this.onChangeCallback(),this}translate(A,t,e){const i=this.offset,s=this.#l;return 0===i?(s[0]+=A,s[1]+=t,s[2]+=e):(s[i]+=A,s[i+1]+=t,s[i+2]+=e),this.onChangeCallback(),this}lerp(A,t){const e=this.offset,i=this.#l,s=A.elements;return 0===e?(i[0]+=(s[0]-i[0])*t,i[1]+=(s[1]-i[1])*t,i[2]+=(s[2]-i[2])*t):(i[e]+=(s[0]-i[e])*t,i[e+1]+=(s[1]-i[e+1])*t,i[e+2]+=(s[2]-i[e+2])*t),this.onChangeCallback(),this}applyMatrix4(A){const t=this.offset,e=this.#l,i=A.data;if(0===t){const A=e[0],t=e[1],s=e[2],n=1/(i[3]*A+i[7]*t+i[11]*s+i[15]);e[0]=(i[0]*A+i[4]*t+i[8]*s+i[12])*n,e[1]=(i[1]*A+i[5]*t+i[9]*s+i[13])*n,e[2]=(i[2]*A+i[6]*t+i[10]*s+i[14])*n}else{const A=e[t],s=e[t+1],n=e[t+2],r=1/(i[3]*A+i[7]*s+i[11]*n+i[15]);e[t]=(i[0]*A+i[4]*s+i[8]*n+i[12])*r,e[t+1]=(i[1]*A+i[5]*s+i[9]*n+i[13])*r,e[t+2]=(i[2]*A+i[6]*s+i[10]*n+i[14])*r}return this.onChangeCallback(),this}applyQuaternion(A){const t=this.offset,e=this.#l,i=A.elements,s=i[0],n=i[1],r=i[2],a=i[3];if(0===t){const A=e[0],t=e[1],i=e[2],o=a*A+n*i-r*t,l=a*t+r*A-s*i,c=a*i+s*t-n*A,h=-s*A-n*t-r*i;e[0]=o*a+h*-s+l*-r-c*-n,e[1]=l*a+h*-n+c*-s-o*-r,e[2]=c*a+h*-r+o*-n-l*-s}else{const A=e[t],i=e[t+1],o=e[t+2],l=a*A+n*o-r*i,c=a*i+r*A-s*o,h=a*o+s*i-n*A,u=-s*A-n*i-r*o;e[t]=l*a+u*-s+c*-r-h*-n,e[t+1]=c*a+u*-n+h*-s-l*-r,e[t+2]=h*a+u*-r+l*-n-c*-s}return this.onChangeCallback(),this}transformDirection(A){const t=this.offset,e=this.#l,i=A.elements;if(0===t){const A=e[0],t=e[1],s=e[2];e[0]=i[0]*A+i[4]*t+i[8]*s,e[1]=i[1]*A+i[5]*t+i[9]*s,e[2]=i[2]*A+i[6]*t+i[10]*s}else{const A=e[t],s=e[t+1],n=e[t+2];e[t]=i[0]*A+i[4]*s+i[8]*n,e[t+1]=i[1]*A+i[5]*s+i[9]*n,e[t+2]=i[2]*A+i[6]*s+i[10]*n}return this.onChangeCallback(),this}equals(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]:i[0]===e[t]&&i[1]===e[t+1]&&i[2]===e[t+2]}fromArray(A,t=0){const e=this.offset,i=this.#l;return 0===e?(i[0]=A[t],i[1]=A[t+1],i[2]=A[t+2]):(i[e]=A[t],i[e+1]=A[t+1],i[e+2]=A[t+2]),this.onChangeCallback(),this}toArray(A=[],t=0){const e=this.elements;return A[t]=e[0],A[t+1]=e[1],A[t+2]=e[2],A}setValue(A){return Array.isArray(A)||A?.buffer?.byteLength>=0?this.fromArray(A):this.copy(A),this}getValue(){return this}fromBufferAttribute(A,t){return this.fromArray(A.dataView.view,t*A.stride+A.typeInfo.offset),this}[Symbol.iterator](){return this.elements[Symbol.iterator]()}static ZERO=Object.freeze(new y(0,0,0));static ONE=Object.freeze(new y(1,1,1));static UP=Object.freeze(new y(0,1,0));static DOWN=Object.freeze(new y(0,-1,0));static FORWARD=Object.freeze(new y(0,0,-1));static BACK=Object.freeze(new y(0,0,1));static LEFT=Object.freeze(new y(-1,0,0));static RIGHT=Object.freeze(new y(1,0,0))}class B{isDirty=!0;depObject=null;dirtyTypes=f.DIRTY_DATA;offset;#o;#l;constructor(A=0,t=0,e=0,i=1,s,n=0){s||=new Float32Array(4),this.offset=n,this.#l=s,this.#o=0===n&&4===s.length?s:s.subarray(n,n+4),0===n?(s[0]=A,s[1]=t,s[2]=e,s[3]=i):(s[n]=A,s[n+1]=t,s[n+2]=e,s[n+3]=i)}onChangeCallback(){this.isDirty||(this.isDirty=!0,this.depObject?.onChangeCallback(this.dirtyTypes))}resetDirty(){this.isDirty=!1}setTypeData(A,t){const e=t??this.offset;this.#l===A&&this.offset===e||(this.offset=e,this.#l=A,this.#o=0===e&&4===A.length?A:A.subarray(e,e+4))}get x(){return this.#l[this.offset]}set x(A){this.#l[this.offset]=A,this.onChangeCallback()}get y(){return this.#l[this.offset+1]}set y(A){this.#l[this.offset+1]=A,this.onChangeCallback()}get z(){return this.#l[this.offset+2]}set z(A){this.#l[this.offset+2]=A,this.onChangeCallback()}get w(){return this.#l[this.offset+3]}set w(A){this.#l[this.offset+3]=A,this.onChangeCallback()}get elements(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+4),this.#o)}get data(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+4),this.#o)}set(A,t,e,i){const s=this.offset,n=this.#l;return 0===s?(n[0]=A,n[1]=t,n[2]=e,n[3]=i):(n[s]=A,n[s+1]=t,n[s+2]=e,n[s+3]=i),this.onChangeCallback(),this}copy(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3]??1):(e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3]??1),this.onChangeCallback(),this}clone(){const A=this.offset,t=this.#l;return new B(t[A],t[A+1],t[A+2],t[A+3])}add(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?(e[0]+=i[0],e[1]+=i[1],e[2]+=i[2],e[3]+=i[3]):(e[t]+=i[0],e[t+1]+=i[1],e[t+2]+=i[2],e[t+3]+=i[3]),this.onChangeCallback(),this}sub(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?(e[0]-=i[0],e[1]-=i[1],e[2]-=i[2],e[3]-=i[3]):(e[t]-=i[0],e[t+1]-=i[1],e[t+2]-=i[2],e[t+3]-=i[3]),this.onChangeCallback(),this}multiplyScalar(A){const t=this.offset,e=this.#l;return 0===t?(e[0]*=A,e[1]*=A,e[2]*=A,e[3]*=A):(e[t]*=A,e[t+1]*=A,e[t+2]*=A,e[t+3]*=A),this.onChangeCallback(),this}equals(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]&&i[3]===e[3]:i[0]===e[t]&&i[1]===e[t+1]&&i[2]===e[t+2]&&i[3]===e[t+3]}fromArray(A,t=0){const e=this.offset,i=this.#l;return 0===e?(i[0]=A[t],i[1]=A[t+1],i[2]=A[t+2],i[3]=A[t+3]):(i[e]=A[t],i[e+1]=A[t+1],i[e+2]=A[t+2],i[e+3]=A[t+3]),this.onChangeCallback(),this}toArray(A=[],t=0){const e=this.elements;return A[t]=e[0],A[t+1]=e[1],A[t+2]=e[2],A[t+3]=e[3],A}setValue(A){return Array.isArray(A)||A?.buffer?.byteLength>=0?this.fromArray(A):this.copy(A),this}getValue(){return this}[Symbol.iterator](){return this.elements[Symbol.iterator]()}}class I{isDirty=!0;depObject=null;dirtyTypes=f.DIRTY_DATA;offset;#o;#l;constructor(A,t,e,i,s,n=0){s||=new Float32Array(4),this.offset=n,this.#l=s,this.#o=0===n&&4===s.length?s:s.subarray(n,n+4),null!=A?this.set(A,t,e,i):this.identity()}onChangeCallback(){this.isDirty||(this.isDirty=!0,this.depObject?.onChangeCallback(this.dirtyTypes))}resetDirty(){this.isDirty=!1}setTypeData(A,t){const e=t??this.offset;this.#l===A&&this.offset===e||(this.offset=e,this.#l=A,this.#o=0===e&&4===A.length?A:A.subarray(e,e+4))}get elements(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+4),this.#o)}get data(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+4),this.#o)}set(A,t,e,i){const s=this.offset,n=this.#l;return 0===s?(n[0]=A,n[2]=t,n[1]=e,n[3]=i):(n[s+0]=A,n[s+2]=t,n[s+1]=e,n[s+3]=i),this.onChangeCallback(),this}identity(){return this.set(1,0,0,1),this}equals(A){const t=this.offset,e=this.#l,i=A.elements;if(0===t){for(let s=0;s<4;s++)if(e[s]!==i[s])return!1}else for(let s=0;s<4;s++)if(e[t+s]!==i[s])return!1;return!0}copy(A){return this.#l.set(A.elements,this.offset),this.onChangeCallback(),this}clone(){return(new I).copy(this)}fromArray(A,t=0){const e=this.offset,i=this.#l;if(0===e)for(let s=0;s<4;s++)i[s]=A[s+t];else for(let s=0;s<4;s++)i[e+s]=A[s+t];return this.onChangeCallback(),this}toArray(A=[],t=0){const e=this.offset,i=this.#l;return 0===e?(A[t]=i[0],A[t+1]=i[1],A[t+2]=i[2],A[t+3]=i[3]):(A[t]=i[e+0],A[t+1]=i[e+1],A[t+2]=i[e+2],A[t+3]=i[e+3]),A}setValue(A){return Array.isArray(A)||A?.buffer?.byteLength>=0?this.fromArray(A):this.copy(A),this}getValue(){return this}[Symbol.iterator](){return this.data[Symbol.iterator]()}}class Q{isDirty=!0;depObject=null;dirtyTypes=f.DIRTY_DATA;offset;#o;#l;constructor(A,t,e,i,s,n,r,a,o,l,c=0){l||=new Float32Array(9),this.offset=c,this.#l=l,this.#o=0===c&&9===l.length?l:l.subarray(c,c+9),null!=A?this.set(A,t,e,i,s,n,r,a,o):this.identity()}onChangeCallback(){this.isDirty||(this.isDirty=!0,this.depObject?.onChangeCallback(this.dirtyTypes))}resetDirty(){this.isDirty=!1}setTypeData(A,t){const e=t??this.offset;this.#l===A&&this.offset===e||(this.offset=e,this.#l=A,this.#o=0===e&&9===A.length?A:A.subarray(e,e+9))}get elements(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+9),this.#o)}get data(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+9),this.#o)}set(A,t,e,i,s,n,r,a,o){const l=this.offset,c=this.#l;return 0===l?(c[0]=A,c[1]=i,c[2]=r,c[3]=t,c[4]=s,c[5]=a,c[6]=e,c[7]=n,c[8]=o):(c[l+0]=A,c[l+1]=i,c[l+2]=r,c[l+3]=t,c[l+4]=s,c[l+5]=a,c[l+6]=e,c[l+7]=n,c[l+8]=o),this.onChangeCallback(),this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}equals(A){const t=this.offset,e=this.#l,i=A.elements;if(0===t){for(let s=0;s<9;s++)if(e[s]!==i[s])return!1}else for(let s=0;s<9;s++)if(e[t+s]!==i[s])return!1;return!0}copy(A){return this.#l.set(A.elements,this.offset),this.onChangeCallback(),this}setFromMatrix4(A){const t=A.data;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this.onChangeCallback(),this}invert(){const A=this.offset,t=this.#l,e=t[A+0],i=t[A+1],s=t[A+2],n=t[A+3],r=t[A+4],a=t[A+5],o=t[A+6],l=t[A+7],c=t[A+8],h=c*r-a*l,u=a*o-c*n,g=l*n-r*o,d=e*h+i*u+s*g;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);const p=1/d;return 0===A?(t[0]=h*p,t[1]=(s*l-c*i)*p,t[2]=(a*i-s*r)*p,t[3]=u*p,t[4]=(c*e-s*o)*p,t[5]=(s*n-a*e)*p,t[6]=g*p,t[7]=(i*o-l*e)*p,t[8]=(r*e-i*n)*p):(t[A+0]=h*p,t[A+1]=(s*l-c*i)*p,t[A+2]=(a*i-s*r)*p,t[A+3]=u*p,t[A+4]=(c*e-s*o)*p,t[A+5]=(s*n-a*e)*p,t[A+6]=g*p,t[A+7]=(i*o-l*e)*p,t[A+8]=(r*e-i*n)*p),this.onChangeCallback(),this}setUvTransform(A,t,e,i,s,n,r){const a=Math.cos(s),o=Math.sin(s);return this.set(e*a,e*o,-e*(a*n+o*r)+n+A,-i*o,i*a,-i*(-o*n+a*r)+r+t,0,0,1)}transpose(){let A;const t=this.offset,e=this.#l;return 0===t?(A=e[1],e[1]=e[3],e[3]=A,A=e[2],e[2]=e[6],e[6]=A,A=e[5],e[5]=e[7],e[7]=A):(A=e[t+1],e[t+1]=e[t+3],e[t+3]=A,A=e[t+2],e[t+2]=e[t+6],e[t+6]=A,A=e[t+5],e[t+5]=e[t+7],e[t+7]=A),this.onChangeCallback(),this}transposeIntoArray(A){const t=this.offset,e=this.#l;return 0===t?(A[0]=e[0],A[1]=e[3],A[2]=e[6],A[3]=e[1],A[4]=e[4],A[5]=e[7],A[6]=e[2],A[7]=e[5],A[8]=e[8]):(A[0]=e[t+0],A[1]=e[t+3],A[2]=e[t+6],A[3]=e[t+1],A[4]=e[t+4],A[5]=e[t+7],A[6]=e[t+2],A[7]=e[t+5],A[8]=e[t+8]),this}getNormalMatrix(A){return this.setFromMatrix4(A).invert().transpose()}clone(){return(new Q).copy(this)}fromArray(A,t=0){const e=this.offset,i=this.#l;if(0===e)for(let s=0;s<9;s++)i[s]=A[s+t];else for(let s=0;s<9;s++)i[e+s]=A[s+t];return this.onChangeCallback(),this}toArray(A=[],t=0){const e=this.offset,i=this.#l;return 0===e?(A[t]=i[0],A[t+1]=i[1],A[t+2]=i[2],A[t+3]=i[3],A[t+4]=i[4],A[t+5]=i[5],A[t+6]=i[6],A[t+7]=i[7],A[t+8]=i[8]):(A[t]=i[e+0],A[t+1]=i[e+1],A[t+2]=i[e+2],A[t+3]=i[e+3],A[t+4]=i[e+4],A[t+5]=i[e+5],A[t+6]=i[e+6],A[t+7]=i[e+7],A[t+8]=i[e+8]),A}setValue(A){return Array.isArray(A)||A?.buffer?.byteLength>=0?this.fromArray(A):this.copy(A),this}getValue(){return this}transformVector2(A,t){const e=this.offset,i=this.#l;return 0===e?[i[0]*A+i[3]*t,i[1]*A+i[4]*t]:[i[e+0]*A+i[e+3]*t,i[e+1]*A+i[e+4]*t]}transformVector3(A,t,e){const i=this.offset,s=this.#l;return 0===i?[s[0]*A+s[3]*t+s[6]*e,s[1]*A+s[4]*t+s[7]*e,s[2]*A+s[5]*t+s[8]*e]:[s[i+0]*A+s[i+3]*t+s[i+6]*e,s[i+1]*A+s[i+4]*t+s[i+7]*e,s[i+2]*A+s[i+5]*t+s[i+8]*e]}applyToVertexView(A,t,e,i,s=0){const n=this.offset,r=this.#l;if(2===i)if(0===n)for(let a=0;a<e;a++){const e=a*t+s,i=A[e],n=A[e+1];A[e]=r[0]*i+r[3]*n,A[e+1]=r[1]*i+r[4]*n}else for(let a=0;a<e;a++){const e=a*t+s,i=A[e],o=A[e+1];A[e]=r[n+0]*i+r[n+3]*o,A[e+1]=r[n+1]*i+r[n+4]*o}else if(0===n)for(let a=0;a<e;a++){const e=a*t+s,i=A[e],n=A[e+1],o=A[e+2];A[e]=r[0]*i+r[3]*n+r[6]*o,A[e+1]=r[1]*i+r[4]*n+r[7]*o,A[e+2]=r[2]*i+r[5]*n+r[8]*o}else for(let a=0;a<e;a++){const e=a*t+s,i=A[e],o=A[e+1],l=A[e+2];A[e]=r[n+0]*i+r[n+3]*o+r[n+6]*l,A[e+1]=r[n+1]*i+r[n+4]*o+r[n+7]*l,A[e+2]=r[n+2]*i+r[n+5]*o+r[n+8]*l}return this}[Symbol.iterator](){return this.data[Symbol.iterator]()}}const E=new y(0,0,0),x=new y(1,1,1),D=new y,M=new y,b=new y,S=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class v{isDirty=!0;depObject=null;dirtyTypes=f.DIRTY_DATA;offset;#o;#l;constructor(A,t=0){A||=new Float32Array(S),this.offset=t,this.#l=A,this.#o=0===t&&16===A.length?A:A.subarray(t,t+16)}onChangeCallback(){this.isDirty||(this.isDirty=!0,this.depObject?.onChangeCallback(this.dirtyTypes))}resetDirty(){this.isDirty=!1}setTypeData(A,t){const e=t??this.offset;this.#l===A&&this.offset===e||(this.offset=e,this.#l=A,this.#o=0===e&&16===A.length?A:A.subarray(e,e+16))}get elements(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+16),this.#o)}get data(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+16),this.#o)}identity(){const A=this.offset,t=this.#l;return 0===A?(t[0]=1,t[4]=0,t[8]=0,t[12]=0,t[1]=0,t[5]=1,t[9]=0,t[13]=0,t[2]=0,t[6]=0,t[10]=1,t[14]=0,t[3]=0,t[7]=0,t[11]=0,t[15]=1):(t[A+0]=1,t[A+4]=0,t[A+8]=0,t[A+12]=0,t[A+1]=0,t[A+5]=1,t[A+9]=0,t[A+13]=0,t[A+2]=0,t[A+6]=0,t[A+10]=1,t[A+14]=0,t[A+3]=0,t[A+7]=0,t[A+11]=0,t[A+15]=1),this.onChangeCallback(),this}equals(A){const t=this.offset,e=this.#l,i=A.elements;if(0===t){for(let s=0;s<16;s++)if(e[s]!==i[s])return!1}else for(let s=0;s<16;s++)if(e[t+s]!==i[s])return!1;return!0}copy(A){return this.#l.set(A.data,this.offset),this.onChangeCallback(),this}clone(){const A=new v;return A.elements.set(this.elements),A}multiply(A){return this.multiplyMatrices(this,A)}premultiply(A){return this.multiplyMatrices(A,this)}multiplyMatrices(A,t){const e=A.data,i=t.data,s=this.offset,n=this.#l,r=e[0],a=e[4],o=e[8],l=e[12],c=e[1],h=e[5],u=e[9],g=e[13],d=e[2],p=e[6],f=e[10],m=e[14],C=e[3],w=e[7],y=e[11],B=e[15],I=i[0],Q=i[4],E=i[8],x=i[12],D=i[1],M=i[5],b=i[9],S=i[13],v=i[2],T=i[6],U=i[10],N=i[14],P=i[3],O=i[7],F=i[11],k=i[15];return 0===s?(n[0]=r*I+a*D+o*v+l*P,n[4]=r*Q+a*M+o*T+l*O,n[8]=r*E+a*b+o*U+l*F,n[12]=r*x+a*S+o*N+l*k,n[1]=c*I+h*D+u*v+g*P,n[5]=c*Q+h*M+u*T+g*O,n[9]=c*E+h*b+u*U+g*F,n[13]=c*x+h*S+u*N+g*k,n[2]=d*I+p*D+f*v+m*P,n[6]=d*Q+p*M+f*T+m*O,n[10]=d*E+p*b+f*U+m*F,n[14]=d*x+p*S+f*N+m*k,n[3]=C*I+w*D+y*v+B*P,n[7]=C*Q+w*M+y*T+B*O,n[11]=C*E+w*b+y*U+B*F,n[15]=C*x+w*S+y*N+B*k):(n[s+0]=r*I+a*D+o*v+l*P,n[s+4]=r*Q+a*M+o*T+l*O,n[s+8]=r*E+a*b+o*U+l*F,n[s+12]=r*x+a*S+o*N+l*k,n[s+1]=c*I+h*D+u*v+g*P,n[s+5]=c*Q+h*M+u*T+g*O,n[s+9]=c*E+h*b+u*U+g*F,n[s+13]=c*x+h*S+u*N+g*k,n[s+2]=d*I+p*D+f*v+m*P,n[s+6]=d*Q+p*M+f*T+m*O,n[s+10]=d*E+p*b+f*U+m*F,n[s+14]=d*x+p*S+f*N+m*k,n[s+3]=C*I+w*D+y*v+B*P,n[s+7]=C*Q+w*M+y*T+B*O,n[s+11]=C*E+w*b+y*U+B*F,n[s+15]=C*x+w*S+y*N+B*k),this.onChangeCallback(),this}setPosition(A,t,e){const i=this.offset,s=this.#l;if(A instanceof y){const t=A.elements;0===i?(s[12]=t[0],s[13]=t[1],s[14]=t[2]):(s[i+12]=t[0],s[i+13]=t[1],s[i+14]=t[2])}else 0===i?(s[12]=A,s[13]=t,s[14]=e):(s[i+12]=A,s[i+13]=t,s[i+14]=e);return this.onChangeCallback(),this}makeTranslation(A,t,e){this.identity();const i=this.offset,s=this.#l;return 0===i?(s[12]=A,s[13]=t,s[14]=e):(s[i+12]=A,s[i+13]=t,s[i+14]=e),this.onChangeCallback(),this}makeRotationX(A){const t=Math.cos(A),e=Math.sin(A),i=this.offset,s=this.#l;return 0===i?(s[0]=1,s[4]=0,s[8]=0,s[12]=0,s[1]=0,s[5]=t,s[9]=-e,s[13]=0,s[2]=0,s[6]=e,s[10]=t,s[14]=0,s[3]=0,s[7]=0,s[11]=0,s[15]=1):(s[i+0]=1,s[i+4]=0,s[i+8]=0,s[i+12]=0,s[i+1]=0,s[i+5]=t,s[i+9]=-e,s[i+13]=0,s[i+2]=0,s[i+6]=e,s[i+10]=t,s[i+14]=0,s[i+3]=0,s[i+7]=0,s[i+11]=0,s[i+15]=1),this.onChangeCallback(),this}makeRotationY(A){const t=Math.cos(A),e=Math.sin(A),i=this.offset,s=this.#l;return 0===i?(s[0]=t,s[4]=0,s[8]=e,s[12]=0,s[1]=0,s[5]=1,s[9]=0,s[13]=0,s[2]=-e,s[6]=0,s[10]=t,s[14]=0,s[3]=0,s[7]=0,s[11]=0,s[15]=1):(s[i+0]=t,s[i+4]=0,s[i+8]=e,s[i+12]=0,s[i+1]=0,s[i+5]=1,s[i+9]=0,s[i+13]=0,s[i+2]=-e,s[i+6]=0,s[i+10]=t,s[i+14]=0,s[i+3]=0,s[i+7]=0,s[i+11]=0,s[i+15]=1),this.onChangeCallback(),this}makeRotationZ(A){const t=Math.cos(A),e=Math.sin(A),i=this.offset,s=this.#l;return 0===i?(s[0]=t,s[4]=-e,s[8]=0,s[12]=0,s[1]=e,s[5]=t,s[9]=0,s[13]=0,s[2]=0,s[6]=0,s[10]=1,s[14]=0,s[3]=0,s[7]=0,s[11]=0,s[15]=1):(s[i+0]=t,s[i+4]=-e,s[i+8]=0,s[i+12]=0,s[i+1]=e,s[i+5]=t,s[i+9]=0,s[i+13]=0,s[i+2]=0,s[i+6]=0,s[i+10]=1,s[i+14]=0,s[i+3]=0,s[i+7]=0,s[i+11]=0,s[i+15]=1),this.onChangeCallback(),this}makeScale(A,t,e){const i=this.offset,s=this.#l;return 0===i?(s[0]=A,s[4]=0,s[8]=0,s[12]=0,s[1]=0,s[5]=t,s[9]=0,s[13]=0,s[2]=0,s[6]=0,s[10]=e,s[14]=0,s[3]=0,s[7]=0,s[11]=0,s[15]=1):(s[i+0]=A,s[i+4]=0,s[i+8]=0,s[i+12]=0,s[i+1]=0,s[i+5]=t,s[i+9]=0,s[i+13]=0,s[i+2]=0,s[i+6]=0,s[i+10]=e,s[i+14]=0,s[i+3]=0,s[i+7]=0,s[i+11]=0,s[i+15]=1),this.onChangeCallback(),this}compose(A,t,e){const i=A.elements,s=t.elements,n=e.elements,r=this.offset,a=this.#l,o=s[0],l=s[1],c=s[2],h=s[3],u=o+o,g=l+l,d=c+c,p=o*u,f=o*g,m=o*d,C=l*g,w=l*d,y=c*d,B=h*u,I=h*g,Q=h*d,E=n[0],x=n[1],D=n[2];return 0===r?(a[0]=(1-(C+y))*E,a[1]=(f+Q)*E,a[2]=(m-I)*E,a[3]=0,a[4]=(f-Q)*x,a[5]=(1-(p+y))*x,a[6]=(w+B)*x,a[7]=0,a[8]=(m+I)*D,a[9]=(w-B)*D,a[10]=(1-(p+C))*D,a[11]=0,a[12]=i[0],a[13]=i[1],a[14]=i[2],a[15]=1):(a[r+0]=(1-(C+y))*E,a[r+1]=(f+Q)*E,a[r+2]=(m-I)*E,a[r+3]=0,a[r+4]=(f-Q)*x,a[r+5]=(1-(p+y))*x,a[r+6]=(w+B)*x,a[r+7]=0,a[r+8]=(m+I)*D,a[r+9]=(w-B)*D,a[r+10]=(1-(p+C))*D,a[r+11]=0,a[r+12]=i[0],a[r+13]=i[1],a[r+14]=i[2],a[r+15]=1),this.onChangeCallback(),this}decompose(A,t,e){const i=this.offset,s=this.#l;let n=Math.sqrt(s[i+0]*s[i+0]+s[i+1]*s[i+1]+s[i+2]*s[i+2]);const r=Math.sqrt(s[i+4]*s[i+4]+s[i+5]*s[i+5]+s[i+6]*s[i+6]),a=Math.sqrt(s[i+8]*s[i+8]+s[i+9]*s[i+9]+s[i+10]*s[i+10]);this.determinant()<0&&(n=-n),A.set(s[i+12],s[i+13],s[i+14]);const o=0!==n?1/n:0,l=0!==r?1/r:0,c=0!==a?1/a:0,h=s[i+0]*o,u=s[i+4]*l,g=s[i+8]*c,d=s[i+1]*o,p=s[i+5]*l,f=s[i+9]*c,m=s[i+2]*o,C=s[i+6]*l,w=s[i+10]*c,y=h+p+w;if(y>0){const A=.5/Math.sqrt(y+1);t.set((C-f)*A,(g-m)*A,(d-u)*A,.25/A)}else if(h>p&&h>w){const A=2*Math.sqrt(1+h-p-w);t.set(.25*A,(u+d)/A,(g+m)/A,(C-f)/A)}else if(p>w){const A=2*Math.sqrt(1+p-h-w);t.set((u+d)/A,.25*A,(f+C)/A,(g-m)/A)}else{const A=2*Math.sqrt(1+w-h-p);t.set((g+m)/A,(f+C)/A,.25*A,(d-u)/A)}return e.set(n,r,a),this}determinant(){const A=this.offset,t=this.#l,e=t[A+0],i=t[A+4],s=t[A+8],n=t[A+12],r=t[A+1],a=t[A+5],o=t[A+9],l=t[A+13],c=t[A+2],h=t[A+6],u=t[A+10],g=t[A+14];return t[A+3]*(+n*o*h-s*l*h-n*a*u+i*l*u+s*a*g-i*o*g)+t[A+7]*(+e*o*g-e*l*u+n*r*u-s*r*g+s*l*c-n*o*c)+t[A+11]*(+e*l*h-e*a*g-n*r*h+i*r*g+n*a*c-i*l*c)+t[A+15]*(-s*a*c-e*o*h+e*a*u+s*r*h-i*r*u+i*o*c)}invert(){const A=this.offset,t=this.#l,e=t[A+0],i=t[A+1],s=t[A+2],n=t[A+3],r=t[A+4],a=t[A+5],o=t[A+6],l=t[A+7],c=t[A+8],h=t[A+9],u=t[A+10],g=t[A+11],d=t[A+12],p=t[A+13],f=t[A+14],m=t[A+15],C=h*f*l-p*u*l+p*o*g-a*f*g-h*o*m+a*u*m,w=d*u*l-c*f*l-d*o*g+r*f*g+c*o*m-r*u*m,y=c*p*l-d*h*l+d*a*g-r*p*g-c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Q,t[A+8]=y*Q,t[A+9]=(d*h*n-c*p*n-d*i*g+e*p*g+c*i*m-e*h*m)*Q,t[A+10]=(r*p*n-d*a*n+d*i*l-e*p*l-r*i*m+e*a*m)*Q,t[A+11]=(c*a*n-r*h*n-c*i*l+e*h*l+r*i*g-e*a*g)*Q,t[A+12]=B*Q,t[A+13]=(c*p*s-d*h*s+d*i*u-e*p*u-c*i*f+e*h*f)*Q,t[A+14]=(d*a*s-r*p*s-d*i*o+e*p*o+r*i*f-e*a*f)*Q,t[A+15]=(r*h*s-c*a*s+c*i*o-e*h*o-r*i*u+e*a*u)*Q),this.onChangeCallback(),this}transpose(){const A=this.offset,t=this.#l;let e;return 0===A?(e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e):(e=t[A+1],t[A+1]=t[A+4],t[A+4]=e,e=t[A+2],t[A+2]=t[A+8],t[A+8]=e,e=t[A+6],t[A+6]=t[A+9],t[A+9]=e,e=t[A+3],t[A+3]=t[A+12],t[A+12]=e,e=t[A+7],t[A+7]=t[A+13],t[A+13]=e,e=t[A+11],t[A+11]=t[A+14],t[A+14]=e),this.onChangeCallback(),this}makeRotationFromQuaternion(A){return this.compose(E,A,x)}makePerspective(A,t,e,i,s,n){const r=this.offset,a=this.#l;if(void 0===s){const s=A,n=t,o=e,l=i,c=1/Math.tan(s/2),h=l===1/0?0:1/(l-o),u=l===1/0?o:l*o*h;0===r?(a[0]=c/n,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=c,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=o*h,a[11]=-1,a[12]=0,a[13]=0,a[14]=u,a[15]=0):(a[r+0]=c/n,a[r+1]=0,a[r+2]=0,a[r+3]=0,a[r+4]=0,a[r+5]=c,a[r+6]=0,a[r+7]=0,a[r+8]=0,a[r+9]=0,a[r+10]=o*h,a[r+11]=-1,a[r+12]=0,a[r+13]=0,a[r+14]=u,a[r+15]=0),this.onChangeCallback()}else{const o=2*s/(t-A),l=2*s/(e-i),c=(t+A)/(t-A),h=(e+i)/(e-i),u=n===1/0?0:1/(n-s),g=s*u,d=n===1/0?s:n*s*u;0===r?(a[0]=o,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=g,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0):(a[r+0]=o,a[r+4]=0,a[r+8]=c,a[r+12]=0,a[r+1]=0,a[r+5]=l,a[r+9]=h,a[r+13]=0,a[r+2]=0,a[r+6]=0,a[r+10]=g,a[r+14]=d,a[r+3]=0,a[r+7]=0,a[r+11]=-1,a[r+15]=0),this.onChangeCallback()}return this}makeOrthographic(A,t,e,i,s,n){const r=this.offset,a=this.#l,o=1/(t-A),l=1/(e-i),c=1/(n-s);return 0===r?(a[0]=2*o,a[4]=0,a[8]=0,a[12]=-(t+A)*o,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-(e+i)*l,a[2]=0,a[6]=0,a[10]=c,a[14]=n*c,a[3]=0,a[7]=0,a[11]=0,a[15]=1):(a[r+0]=2*o,a[r+4]=0,a[r+8]=0,a[r+12]=-(t+A)*o,a[r+1]=0,a[r+5]=2*l,a[r+9]=0,a[r+13]=-(e+i)*l,a[r+2]=0,a[r+6]=0,a[r+10]=c,a[r+14]=n*c,a[r+3]=0,a[r+7]=0,a[r+11]=0,a[r+15]=1),this.onChangeCallback(),this}lookAt(A,t,e){const i=this.offset,s=this.#l,n=b.copy(A).sub(t);0===n.lengthSq()&&(n.z=1),n.normalize();const r=D.crossVectors(e,n);0===r.lengthSq()&&(1===Math.abs(e.z)?n.x+=1e-4:n.z+=1e-4,n.normalize(),r.crossVectors(e,n)),r.normalize();const a=M.crossVectors(n,r),o=r.elements,l=a.elements,c=n.elements;return 0===i?(s[0]=o[0],s[4]=l[0],s[8]=c[0],s[1]=o[1],s[5]=l[1],s[9]=c[1],s[2]=o[2],s[6]=l[2],s[10]=c[2]):(s[i+0]=o[0],s[i+4]=l[0],s[i+8]=c[0],s[i+1]=o[1],s[i+5]=l[1],s[i+9]=c[1],s[i+2]=o[2],s[i+6]=l[2],s[i+10]=c[2]),this.onChangeCallback(),this}fromArray(A,t=0){const e=this.offset,i=this.#l;if(0===e)for(let s=0;s<16;s++)i[s]=A[t+s];else for(let s=0;s<16;s++)i[e+s]=A[t+s];return this.onChangeCallback(),this}toArray(A=[],t=0){const e=this.offset,i=this.#l;if(0===e)for(let s=0;s<16;s++)A[t+s]=i[s];else for(let s=0;s<16;s++)A[t+s]=i[e+s];return A}setValue(A){return Array.isArray(A)||A?.buffer?.byteLength>=0?this.fromArray(A):this.copy(A),this}getValue(){return this}getMaxScaleOnAxis(){const A=this.offset,t=this.#l;if(0===A){const A=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],e=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(A,e,i))}const e=t[A+0]*t[A+0]+t[A+1]*t[A+1]+t[A+2]*t[A+2],i=t[A+4]*t[A+4]+t[A+5]*t[A+5]+t[A+6]*t[A+6],s=t[A+8]*t[A+8]+t[A+9]*t[A+9]+t[A+10]*t[A+10];return Math.sqrt(Math.max(e,i,s))}applyToVertexView(A,t,e,i=0){const s=this.offset,n=this.#l;if(0===s)for(let r=0;r<e;r++){const e=r*t+i,s=A[e],a=A[e+1],o=A[e+2];A[e]=n[0]*s+n[4]*a+n[8]*o+n[12],A[e+1]=n[1]*s+n[5]*a+n[9]*o+n[13],A[e+2]=n[2]*s+n[6]*a+n[10]*o+n[14]}else for(let r=0;r<e;r++){const e=r*t+i,a=A[e],o=A[e+1],l=A[e+2];A[e]=n[s+0]*a+n[s+4]*o+n[s+8]*l+n[s+12],A[e+1]=n[s+1]*a+n[s+5]*o+n[s+9]*l+n[s+13],A[e+2]=n[s+2]*a+n[s+6]*o+n[s+10]*l+n[s+14]}return this}transformToDirectionView(A,t,e,i=0){const s=this.offset,n=this.#l;if(0===s)for(let r=0;r<e;r++){const e=r*t+i,s=A[e],a=A[e+1],o=A[e+2];A[e]=n[0]*s+n[4]*a+n[8]*o,A[e+1]=n[1]*s+n[5]*a+n[9]*o,A[e+2]=n[2]*s+n[6]*a+n[10]*o}else for(let r=0;r<e;r++){const e=r*t+i,a=A[e],o=A[e+1],l=A[e+2];A[e]=n[s+0]*a+n[s+4]*o+n[s+8]*l,A[e+1]=n[s+1]*a+n[s+5]*o+n[s+9]*l,A[e+2]=n[s+2]*a+n[s+6]*o+n[s+10]*l}return this}[Symbol.iterator](){return this.data[Symbol.iterator]()}}class T{isDirty=!0;depObject=null;dirtyTypes=f.DIRTY_DATA;offset;#o;#l;constructor(A=0,t=0,e=0,i=1,s,n=0){s||=new Float32Array(4),this.offset=n,this.#l=s,this.#o=0===n&&4===s.length?s:s.subarray(n,n+4),0===n?(s[0]=A,s[1]=t,s[2]=e,s[3]=i):(s[n]=A,s[n+1]=t,s[n+2]=e,s[n+3]=i)}onChangeCallback(){this.isDirty||(this.isDirty=!0,this.depObject?.onChangeCallback(this.dirtyTypes))}resetDirty(){this.isDirty=!1}setTypeData(A,t){const e=t??this.offset;this.#l===A&&this.offset===e||(this.offset=e,this.#l=A,this.#o=0===e&&4===A.length?A:A.subarray(e,e+4))}get x(){return this.#l[this.offset]}set x(A){this.#l[this.offset]=A,this.onChangeCallback()}get y(){return this.#l[this.offset+1]}set y(A){this.#l[this.offset+1]=A,this.onChangeCallback()}get z(){return this.#l[this.offset+2]}set z(A){this.#l[this.offset+2]=A,this.onChangeCallback()}get w(){return this.#l[this.offset+3]}set w(A){this.#l[this.offset+3]=A,this.onChangeCallback()}get elements(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+4),this.#o)}get data(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+4),this.#o)}set(A,t,e,i){const s=this.offset,n=this.#l;return 0===s?(n[0]=A,n[1]=t,n[2]=e,n[3]=i):(n[s]=A,n[s+1]=t,n[s+2]=e,n[s+3]=i),this.onChangeCallback(),this}copy(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3]):(e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3]),this.onChangeCallback(),this}clone(){const A=this.offset,t=this.#l;return new T(t[A],t[A+1],t[A+2],t[A+3])}identity(){return this.set(0,0,0,1)}setFromAxisAngle(A,t){const e=this.offset,i=this.#l,s=A.elements,n=t/2,r=Math.sin(n);return 0===e?(i[0]=s[0]*r,i[1]=s[1]*r,i[2]=s[2]*r,i[3]=Math.cos(n)):(i[e]=s[0]*r,i[e+1]=s[1]*r,i[e+2]=s[2]*r,i[e+3]=Math.cos(n)),this.onChangeCallback(),this}setFromEuler(A){const t=this.offset,e=this.#l,i=A.elements,s=i[0],n=i[1],r=i[2],a=A.order||"XYZ",o=Math.cos(s/2),l=Math.cos(n/2),c=Math.cos(r/2),h=Math.sin(s/2),u=Math.sin(n/2),g=Math.sin(r/2);switch(a){case"XYZ":0===t?(e[0]=h*l*c+o*u*g,e[1]=o*u*c-h*l*g,e[2]=o*l*g+h*u*c,e[3]=o*l*c-h*u*g):(e[t]=h*l*c+o*u*g,e[t+1]=o*u*c-h*l*g,e[t+2]=o*l*g+h*u*c,e[t+3]=o*l*c-h*u*g);break;case"YXZ":0===t?(e[0]=h*l*c+o*u*g,e[1]=o*u*c-h*l*g,e[2]=o*l*g-h*u*c,e[3]=o*l*c+h*u*g):(e[t]=h*l*c+o*u*g,e[t+1]=o*u*c-h*l*g,e[t+2]=o*l*g-h*u*c,e[t+3]=o*l*c+h*u*g);break;case"ZXY":0===t?(e[0]=h*l*c-o*u*g,e[1]=o*u*c+h*l*g,e[2]=o*l*g+h*u*c,e[3]=o*l*c-h*u*g):(e[t]=h*l*c-o*u*g,e[t+1]=o*u*c+h*l*g,e[t+2]=o*l*g+h*u*c,e[t+3]=o*l*c-h*u*g);break;case"ZYX":0===t?(e[0]=h*l*c-o*u*g,e[1]=o*u*c+h*l*g,e[2]=o*l*g-h*u*c,e[3]=o*l*c+h*u*g):(e[t]=h*l*c-o*u*g,e[t+1]=o*u*c+h*l*g,e[t+2]=o*l*g-h*u*c,e[t+3]=o*l*c+h*u*g);break;case"YZX":0===t?(e[0]=h*l*c+o*u*g,e[1]=o*u*c+h*l*g,e[2]=o*l*g-h*u*c,e[3]=o*l*c-h*u*g):(e[t]=h*l*c+o*u*g,e[t+1]=o*u*c+h*l*g,e[t+2]=o*l*g-h*u*c,e[t+3]=o*l*c-h*u*g);break;case"XZY":0===t?(e[0]=h*l*c-o*u*g,e[1]=o*u*c-h*l*g,e[2]=o*l*g+h*u*c,e[3]=o*l*c+h*u*g):(e[t]=h*l*c-o*u*g,e[t+1]=o*u*c-h*l*g,e[t+2]=o*l*g+h*u*c,e[t+3]=o*l*c+h*u*g)}return this.onChangeCallback(),this}setFromRotationMatrix(A){const t=this.offset,e=this.#l,i=A.data,s=i[0],n=i[4],r=i[8],a=i[1],o=i[5],l=i[9],c=i[2],h=i[6],u=i[10],g=s+o+u;if(g>0){const A=.5/Math.sqrt(g+1);0===t?(e[3]=.25/A,e[0]=(h-l)*A,e[1]=(r-c)*A,e[2]=(a-n)*A):(e[t+3]=.25/A,e[t]=(h-l)*A,e[t+1]=(r-c)*A,e[t+2]=(a-n)*A)}else if(s>o&&s>u){const A=2*Math.sqrt(1+s-o-u);0===t?(e[3]=(h-l)/A,e[0]=.25*A,e[1]=(n+a)/A,e[2]=(r+c)/A):(e[t+3]=(h-l)/A,e[t]=.25*A,e[t+1]=(n+a)/A,e[t+2]=(r+c)/A)}else if(o>u){const A=2*Math.sqrt(1+o-s-u);0===t?(e[3]=(r-c)/A,e[0]=(n+a)/A,e[1]=.25*A,e[2]=(l+h)/A):(e[t+3]=(r-c)/A,e[t]=(n+a)/A,e[t+1]=.25*A,e[t+2]=(l+h)/A)}else{const A=2*Math.sqrt(1+u-s-o);0===t?(e[3]=(a-n)/A,e[0]=(r+c)/A,e[1]=(l+h)/A,e[2]=.25*A):(e[t+3]=(a-n)/A,e[t]=(r+c)/A,e[t+1]=(l+h)/A,e[t+2]=.25*A)}return this.onChangeCallback(),this}multiply(A){return this.multiplyQuaternions(this,A)}premultiply(A){return this.multiplyQuaternions(A,this)}multiplyQuaternions(A,t){const e=this.offset,i=this.#l,s=A.elements,n=t.elements,r=s[0],a=s[1],o=s[2],l=s[3],c=n[0],h=n[1],u=n[2],g=n[3];return 0===e?(i[0]=r*g+l*c+a*u-o*h,i[1]=a*g+l*h+o*c-r*u,i[2]=o*g+l*u+r*h-a*c,i[3]=l*g-r*c-a*h-o*u):(i[e]=r*g+l*c+a*u-o*h,i[e+1]=a*g+l*h+o*c-r*u,i[e+2]=o*g+l*u+r*h-a*c,i[e+3]=l*g-r*c-a*h-o*u),this.onChangeCallback(),this}length(){return Math.sqrt(this.lengthSq())}lengthSq(){const A=this.offset,t=this.#l;return 0===A?t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]:t[A]*t[A]+t[A+1]*t[A+1]+t[A+2]*t[A+2]+t[A+3]*t[A+3]}normalize(){const A=this.offset,t=this.#l;let e=this.length();return 0===e?0===A?(t[0]=0,t[1]=0,t[2]=0,t[3]=1):(t[A]=0,t[A+1]=0,t[A+2]=0,t[A+3]=1):(e=1/e,0===A?(t[0]*=e,t[1]*=e,t[2]*=e,t[3]*=e):(t[A]*=e,t[A+1]*=e,t[A+2]*=e,t[A+3]*=e)),this.onChangeCallback(),this}invert(){return this.conjugate()}conjugate(){const A=this.offset,t=this.#l;return 0===A?(t[0]*=-1,t[1]*=-1,t[2]*=-1):(t[A]*=-1,t[A+1]*=-1,t[A+2]*=-1),this.onChangeCallback(),this}dot(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?e[0]*i[0]+e[1]*i[1]+e[2]*i[2]+e[3]*i[3]:e[t]*i[0]+e[t+1]*i[1]+e[t+2]*i[2]+e[t+3]*i[3]}slerp(A,t){if(0===t)return this;if(1===t)return this.copy(A);const e=A.elements,i=this.offset,s=this.#l;let n,r,a,o;0===i?(n=s[0],r=s[1],a=s[2],o=s[3]):(n=s[i],r=s[i+1],a=s[i+2],o=s[i+3]);let l=o*e[3]+n*e[0]+r*e[1]+a*e[2];if(l<0?(0===i?(s[3]=-e[3],s[0]=-e[0],s[1]=-e[1],s[2]=-e[2]):(s[i+3]=-e[3],s[i]=-e[0],s[i+1]=-e[1],s[i+2]=-e[2]),l=-l):this.copy(A),l>=1)return 0===i?(s[3]=o,s[0]=n,s[1]=r,s[2]=a):(s[i+3]=o,s[i]=n,s[i+1]=r,s[i+2]=a),this;const c=1-l*l;if(c<=Number.EPSILON){const A=1-t;return 0===i?(s[3]=A*o+t*s[3],s[0]=A*n+t*s[0],s[1]=A*r+t*s[1],s[2]=A*a+t*s[2]):(s[i+3]=A*o+t*s[i+3],s[i]=A*n+t*s[i],s[i+1]=A*r+t*s[i+1],s[i+2]=A*a+t*s[i+2]),this.normalize(),this}const h=Math.sqrt(c),u=Math.atan2(h,l),g=Math.sin((1-t)*u)/h,d=Math.sin(t*u)/h;return 0===i?(s[3]=o*g+s[3]*d,s[0]=n*g+s[0]*d,s[1]=r*g+s[1]*d,s[2]=a*g+s[2]*d):(s[i+3]=o*g+s[i+3]*d,s[i]=n*g+s[i]*d,s[i+1]=r*g+s[i+1]*d,s[i+2]=a*g+s[i+2]*d),this.onChangeCallback(),this}equals(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]&&i[3]===e[3]:i[0]===e[t]&&i[1]===e[t+1]&&i[2]===e[t+2]&&i[3]===e[t+3]}fromArray(A,t=0){const e=this.offset,i=this.#l;return 0===e?(i[0]=A[t],i[1]=A[t+1],i[2]=A[t+2],i[3]=A[t+3]):(i[e]=A[t],i[e+1]=A[t+1],i[e+2]=A[t+2],i[e+3]=A[t+3]),this.onChangeCallback(),this}toArray(A=[],t=0){const e=this.elements;return A[t]=e[0],A[t+1]=e[1],A[t+2]=e[2],A[t+3]=e[3],A}setValue(A){return Array.isArray(A)||A?.buffer?.byteLength>=0?this.fromArray(A):this.copy(A),this}getValue(){return this}[Symbol.iterator](){return this.elements[Symbol.iterator]()}static IDENTITY=Object.freeze(new T(0,0,0,1))}class U{isDirty=!0;order;depObject=null;dirtyTypes=f.DIRTY_DATA;offset;#o;#l;constructor(A=0,t=0,e=0,i="XYZ",s,n=0){s||=new Float32Array(3),this.offset=n,this.#l=s,this.#o=0===n&&3===s.length?s:s.subarray(n,n+3),this.order=i,0===n?(s[0]=A,s[1]=t,s[2]=e):(s[n]=A,s[n+1]=t,s[n+2]=e)}onChangeCallback(){this.isDirty||(this.isDirty=!0,this.depObject?.onChangeCallback(this.dirtyTypes))}resetDirty(){this.isDirty=!1}setTypeData(A,t){const e=t??this.offset;this.#l===A&&this.offset===e||(this.offset=e,this.#l=A,this.#o=0===e&&3===A.length?A:A.subarray(e,e+3))}get x(){return this.#l[this.offset]}set x(A){this.#l[this.offset]=A,this.onChangeCallback()}get y(){return this.#l[this.offset+1]}set y(A){this.#l[this.offset+1]=A,this.onChangeCallback()}get z(){return this.#l[this.offset+2]}set z(A){this.#l[this.offset+2]=A,this.onChangeCallback()}get elements(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+3),this.#o)}get data(){const A=this.#o,t=this.#l;return A.buffer===t.buffer?A:(this.#o=this.#l.subarray(this.offset,this.offset+3),this.#o)}set(A,t,e,i){const s=this.offset,n=this.#l;return 0===s?(n[0]=A,n[1]=t,n[2]=e):(n[s]=A,n[s+1]=t,n[s+2]=e),void 0!==i&&(this.order=i),this.onChangeCallback(),this}equals(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]&&A.order===this.order:i[0]===e[t]&&i[1]===e[t+1]&&i[2]===e[t+2]&&A.order===this.order}copy(A){const t=this.offset,e=this.#l,i=A.elements;return 0===t?(e[0]=i[0],e[1]=i[1],e[2]=i[2]):(e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2]),this.order=A.order,this.onChangeCallback(),this}clone(){const A=this.offset,t=this.#l;return new U(t[A],t[A+1],t[A+2],this.order)}setFromQuaternion(A){const t=A.elements;let e,i,s,n;t?(e=t[0],i=t[1],s=t[2],n=t[3]):(e=A.x,i=A.y,s=A.z,n=A.w);const r=e+e,a=i+i,o=s+s,l=e*r,c=e*a,h=e*o,u=i*a,g=i*o,d=s*o,p=n*r,f=n*a,m=n*o,C=1-(u+d),w=c-m,y=h+f,B=c+m,I=1-(l+d),Q=g-p,E=h-f,x=g+p,D=1-(l+u),M=this.order;let b,S,v;switch(M){case"XYZ":default:S=Math.asin(N(y,-1,1)),Math.abs(y)<.9999999?(b=Math.atan2(-Q,D),v=Math.atan2(-w,C)):(b=Math.atan2(x,I),v=0);break;case"YXZ":b=Math.asin(-N(Q,-1,1)),Math.abs(Q)<.9999999?(S=Math.atan2(y,D),v=Math.atan2(B,I)):(S=Math.atan2(-E,C),v=0);break;case"ZXY":b=Math.asin(N(x,-1,1)),Math.abs(x)<.9999999?(S=Math.atan2(-E,D),v=Math.atan2(-w,I)):(S=0,v=Math.atan2(B,C));break;case"ZYX":S=Math.asin(-N(E,-1,1)),Math.abs(E)<.9999999?(b=Math.atan2(x,D),v=Math.atan2(B,C)):(b=0,v=Math.atan2(-w,I));break;case"YZX":v=Math.asin(N(B,-1,1)),Math.abs(B)<.9999999?(b=Math.atan2(-Q,I),S=Math.atan2(-E,C)):(b=0,S=Math.atan2(y,D));break;case"XZY":v=Math.asin(-N(w,-1,1)),Math.abs(w)<.9999999?(b=Math.atan2(x,I),S=Math.atan2(y,C)):(b=Math.atan2(-Q,D),S=0)}return this.set(b,S,v,M)}setFromRotationMatrix(A){const t=A.data,e=t[0],i=t[4],s=t[8],n=t[1],r=t[5],a=t[9],o=t[2],l=t[6],c=t[10],h=this.order;let u,g,d;switch(h){case"XYZ":default:g=Math.asin(N(s,-1,1)),Math.abs(s)<.9999999?(u=Math.atan2(-a,c),d=Math.atan2(-i,e)):(u=Math.atan2(l,r),d=0);break;case"YXZ":u=Math.asin(-N(a,-1,1)),Math.abs(a)<.9999999?(g=Math.atan2(s,c),d=Math.atan2(n,r)):(g=Math.atan2(-o,e),d=0);break;case"ZXY":u=Math.asin(N(l,-1,1)),Math.abs(l)<.9999999?(g=Math.atan2(-o,c),d=Math.atan2(-i,r)):(g=0,d=Math.atan2(n,e));break;case"ZYX":g=Math.asin(-N(o,-1,1)),Math.abs(o)<.9999999?(u=Math.atan2(l,c),d=Math.atan2(n,e)):(u=0,d=Math.atan2(-i,r));break;case"YZX":d=Math.asin(N(n,-1,1)),Math.abs(n)<.9999999?(u=Math.atan2(-a,r),g=Math.atan2(-o,e)):(u=0,g=Math.atan2(s,c));break;case"XZY":d=Math.asin(-N(i,-1,1)),Math.abs(i)<.9999999?(u=Math.atan2(l,r),g=Math.atan2(s,e)):(u=Math.atan2(-a,c),g=0)}return this.set(u,g,d,h)}reorder(A){const t={x:0,y:0,z:0,w:1},e=this.elements,i=e[0],s=e[1],n=e[2],r=Math.cos(i/2),a=Math.cos(s/2),o=Math.cos(n/2),l=Math.sin(i/2),c=Math.sin(s/2),h=Math.sin(n/2);switch(this.order){case"XYZ":t.x=l*a*o+r*c*h,t.y=r*c*o-l*a*h,t.z=r*a*h+l*c*o,t.w=r*a*o-l*c*h;break;case"YXZ":t.x=l*a*o+r*c*h,t.y=r*c*o-l*a*h,t.z=r*a*h-l*c*o,t.w=r*a*o+l*c*h;break;case"ZXY":t.x=l*a*o-r*c*h,t.y=r*c*o+l*a*h,t.z=r*a*h+l*c*o,t.w=r*a*o-l*c*h;break;case"ZYX":t.x=l*a*o-r*c*h,t.y=r*c*o+l*a*h,t.z=r*a*h-l*c*o,t.w=r*a*o+l*c*h;break;case"YZX":t.x=l*a*o+r*c*h,t.y=r*c*o+l*a*h,t.z=r*a*h-l*c*o,t.w=r*a*o-l*c*h;break;case"XZY":t.x=l*a*o-r*c*h,t.y=r*c*o-l*a*h,t.z=r*a*h+l*c*o,t.w=r*a*o+l*c*h}return this.order=A,this.setFromQuaternion(t)}getValue(){return this}}function N(A,t,e){return Math.max(t,Math.min(e,A))}class P{isDirty=!0;depObject=null;dirtyTypes=f.DIRTY_DATA;offset;_elements;_typeData;constructor(A,t,e,i,s=0){i||=new Float32Array(3),this.offset=s,this._typeData=i,this._elements=0===s&&3===i.length?i:i.subarray(s,s+3),0===s?(i[0]=1,i[1]=1,i[2]=1):(i[s]=1,i[s+1]=1,i[s+2]=1),"number"==typeof A&&null!=t&&null!=e?this.setRGB(A,t,e):"number"==typeof A?this.setHex(A):"string"==typeof A?this.setStyle(A):null!=A&&this.copy(A)}onChangeCallback(){this.isDirty||(this.isDirty=!0,this.depObject?.onChangeCallback(this.dirtyTypes))}resetDirty(){this.isDirty=!1}setTypeData(A,t){const e=t??this.offset;this._typeData===A&&this.offset===e||(this.offset=e,this._typeData=A,this._elements=0===e&&3===A.length?A:A.subarray(e,e+3))}get r(){return this._typeData[this.offset]}set r(A){this._typeData[this.offset]=A,this.onChangeCallback()}get g(){return this._typeData[this.offset+1]}set g(A){this._typeData[this.offset+1]=A,this.onChangeCallback()}get b(){return this._typeData[this.offset+2]}set b(A){this._typeData[this.offset+2]=A,this.onChangeCallback()}get elements(){const A=this._elements,t=this._typeData;return A.buffer===t.buffer?A:(this._elements=this._typeData.subarray(this.offset,this.offset+3),this._elements)}get data(){const A=this._elements,t=this._typeData;return A.buffer===t.buffer?A:(this._elements=this._typeData.subarray(this.offset,this.offset+3),this._elements)}set(A,t,e){if(void 0===t&&void 0===e){const t=A;t instanceof P?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t)}else this.setRGB(A,t??1,e??1);return this}setRGB(A,t,e){const i=this.offset,s=this._typeData;return 0===i?(s[0]=A,s[1]=t,s[2]=e):(s[i]=A,s[i+1]=t,s[i+2]=e),this.onChangeCallback(),this}setHex(A){const t=this.offset,e=this._typeData;return A=Math.floor(A),0===t?(e[0]=(A>>16&255)/255,e[1]=(A>>8&255)/255,e[2]=(255&A)/255):(e[t]=(A>>16&255)/255,e[t+1]=(A>>8&255)/255,e[t+2]=(255&A)/255),this.onChangeCallback(),this}setStyle(A){const t=/^#([A-Fa-f\d]{3}|[A-Fa-f\d]{6})$/.exec(A);if(t){const A=t[1];if(3===A.length){const t=this.offset,e=this._typeData;0===t?(e[0]=parseInt(A.charAt(0),16)/15,e[1]=parseInt(A.charAt(1),16)/15,e[2]=parseInt(A.charAt(2),16)/15):(e[t]=parseInt(A.charAt(0),16)/15,e[t+1]=parseInt(A.charAt(1),16)/15,e[t+2]=parseInt(A.charAt(2),16)/15)}else this.setHex(parseInt(A,16));this.onChangeCallback()}return this}copy(A){const t=this.offset,e=this._typeData,i=A.elements;return 0===t?(e[0]=i[0],e[1]=i[1],e[2]=i[2]):(e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2]),this.onChangeCallback(),this}clone(){const A=this.offset,t=this._typeData;return new P(t[A],t[A+1],t[A+2])}multiplyScalar(A){const t=this.offset,e=this._typeData;return 0===t?(e[0]*=A,e[1]*=A,e[2]*=A):(e[t]*=A,e[t+1]*=A,e[t+2]*=A),this.onChangeCallback(),this}equals(A){const t=this.offset,e=this._typeData,i=A.elements;return 0===t?i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]:i[0]===e[t]&&i[1]===e[t+1]&&i[2]===e[t+2]}fromArray(A,t=0){const e=this.offset,i=this._typeData;return 0===e?(i[0]=A[t],i[1]=A[t+1],i[2]=A[t+2]):(i[e]=A[t],i[e+1]=A[t+1],i[e+2]=A[t+2]),this.onChangeCallback(),this}toArray(A=[],t=0){const e=this.elements;return A[t]=e[0],A[t+1]=e[1],A[t+2]=e[2],A}setValue(A){return Array.isArray(A)||A?.buffer?.byteLength>=0?this.fromArray(A):this.copy(A),this}getValue(){return this}[Symbol.iterator](){return this.elements[Symbol.iterator]()}}class O extends P{constructor(A,t,e,i=1,s,n=0){super(A,t,e,s??new Float32Array(4),n);const r=this._typeData,a=this.offset;this._elements=r.subarray(a,a+4),0===a?r[3]=i:r[a+3]=i}get a(){return this._typeData[this.offset+3]}set a(A){this._typeData[this.offset+3]=A,this.onChangeCallback()}setTypeData(A,t){const e=t??this.offset;this._typeData===A&&this.offset===e||(this.offset=e,this._typeData=A,this._elements=0===e&&4===A.length?A:A.subarray(e,e+4))}get elements(){const A=this._elements,t=this._typeData;return A.buffer===t.buffer?A:(this._elements=t.subarray(this.offset,this.offset+4),this._elements)}get data(){const A=this._elements,t=this._typeData;return A.buffer===t.buffer?A:(this._elements=t.subarray(this.offset,this.offset+4),this._elements)}set(A,t,e,i=1){const s=this.offset,n=this._typeData;return 0===s?(n[0]=A,n[1]=t,n[2]=e,n[3]=i):(n[s]=A,n[s+1]=t,n[s+2]=e,n[s+3]=i),this.onChangeCallback(),this}setRGBA(A,t,e,i){const s=this.offset,n=this._typeData;return 0===s?(n[0]=A,n[1]=t,n[2]=e,n[3]=i):(n[s]=A,n[s+1]=t,n[s+2]=e,n[s+3]=i),this.onChangeCallback(),this}copy(A){const t=this.offset,e=this._typeData,i=A.elements,s=i.length>3?i[3]:1;return 0===t?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=s):(e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=s),this.onChangeCallback(),this}clone(){const A=this.offset,t=this._typeData;return new O(t[A],t[A+1],t[A+2],t[A+3])}multiplyScalar(A){const t=this.offset,e=this._typeData;return 0===t?(e[0]*=A,e[1]*=A,e[2]*=A,e[3]*=A):(e[t]*=A,e[t+1]*=A,e[t+2]*=A,e[t+3]*=A),this.onChangeCallback(),this}equals(A){const t=this.offset,e=this._typeData,i=A.elements;return 0===t?i[3]===e[3]&&i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]:i[3]===e[t+3]&&i[0]===e[t]&&i[1]===e[t+1]&&i[2]===e[t+2]}fromArray(A,t=0){const e=this.offset,i=this._typeData;return 0===e?(i[0]=A[t],i[1]=A[t+1],i[2]=A[t+2],i[3]=A[t+3]):(i[e]=A[t],i[e+1]=A[t+1],i[e+2]=A[t+2],i[e+3]=A[t+3]),this.onChangeCallback(),this}setValue(A){return Array.isArray(A)||A?.buffer?.byteLength>=0?this.fromArray(A):this.copy(A),this}toArray(A=[],t=0){const e=this.elements;return A[t]=e[0],A[t+1]=e[1],A[t+2]=e[2],A[t+3]=e[3],A}}class F{isDirty=!0;depObject=null;dirtyTypes=f.DIRTY_DATA;count;offset=0;#o;#c=0;constructor(A,t=0){"number"==typeof A?(this.count=A,this.#o=new Float32Array(4*this.count),t=0):(this.count=A.length/4,this.#o=A,this.offset=t),this.#c=0|this.count,this.isDirty=!1}get activeCount(){return this.#c}set activeCount(A){const t=0|this.count;let e=0|A;e<0?e=0:e>t&&(e=t),e!==this.#c&&(this.#c=e,this.onChangeCallback())}get elements(){return this.#o}setTypeData(A,t){const e=t??this.offset;this.#o===A&&this.offset===e||(this.#o=A,this.offset=e)}onChangeCallback(){this.isDirty||(this.isDirty=!0,this.depObject?.onChangeCallback(this.dirtyTypes))}resetDirty(){this.isDirty=!1}set(A,t,e,i,s){const n=4*A+this.offset,r=this.#o;return r[n]=t,r[n+1]=e,r[n+2]=i,r[n+3]=s,this.onChangeCallback(),this}setFromNormalAndCoplanarPoint(A,t,e){const i=t.x,s=t.y,n=t.z,r=1/(Math.sqrt(i*i+s*s+n*n)||1),a=i*r,o=s*r,l=n*r;return this.set(A,a,o,l,-(a*e.x+o*e.y+l*e.z))}flip(A){const t=4*A+this.offset,e=this.#o;return e[t]=-e[t],e[t+1]=-e[t+1],e[t+2]=-e[t+2],e[t+3]=-e[t+3],this.onChangeCallback(),this}clear(A){const t=this.#o,e=this.offset;if(null==A)for(let i=0,s=this.count;i<s;i++){const A=4*i+e;t[A]=0,t[A+1]=0,t[A+2]=0,t[A+3]=0}else{const i=4*A+e;t[i]=0,t[i+1]=0,t[i+2]=0,t[i+3]=0}return this.onChangeCallback(),this}copy(A){const t=0|this.count,e=0|A.count,i=e<t?e:t,s=this.#o,n=0|this.offset,r=0|A.offset;i>0&&s.set(A.elements.subarray(r,r+4*i),n);const a=n+4*i,o=n+4*t;a<o&&s.fill(0,a,o);let l=0|A.activeCount;return l<0?l=0:l>i&&(l=i),this.#c=l,this.onChangeCallback(),this}setValue(A){if(A instanceof F)this.copy(A);else{const t=this.#o,e=0|this.offset,i=0|this.count,s=A.length/4|0,n=s<i?s:i,r=4*n;for(let o=0;o<r;o++)t[e+o]=A[o];const a=e+4*i;for(let A=e+r;A<a;A++)t[A]=0;this.#c=n,this.onChangeCallback()}return this}getValue(){return this}}const k=Math.PI/180,R=180/Math.PI;class L{isDirty=!0;#l=null;#o=null;depObject=null;dirtyTypes=f.DIRTY_DATA;offset=0;isSingleNumber=!1;constructor(A,t=0,e=!1){this.offset=t,this.isSingleNumber=e,this.#l=this.toElements(A),0===this.offset?this.#o=this.#l:this.#o=this.#l?.subarray(this.offset)??null}toElements(A){if(A.byteLength>=0)return A;if(Array.isArray(A)){const t=A[0];if(null==t||"number"==typeof t)return new Float32Array(A);if(null!=t.elements){const e=t.elements.length,i=new Float32Array(A.length*e);for(let t=0,s=A.length;t<s;t++)i.set(A[t].elements,t*e);return i}return null}const t=typeof A;return"number"===t?(this.isSingleNumber=!0,new Float32Array([A])):"boolean"===t?(this.isSingleNumber=!0,new Float32Array([A?1:0])):A}onChangeCallback(){this.isDirty||(this.isDirty=!0,this.depObject?.onChangeCallback(this.dirtyTypes))}resetDirty(){this.isDirty=!1}setTypeData(A,t){const e=t??this.offset;this.#l===A&&this.offset===e||(this.offset=e,this.#l=A,this.#o=0===e?A:A?.subarray(e)??null)}get elements(){const A=this.#o,t=this.#l;return A?.buffer===t?.buffer?A:(0===this.offset?this.#o=t:this.#o=t?.subarray(this.offset)??null,this.#o)}setValue(A){let t=this.#l;null==A?t=null:this.isSingleNumber?(t??=new Float32Array(1),t[this.offset]=A):t=null!=A.buffer?A:new Float32Array(A??0),this.#l=t,null==t||0===this.offset?this.#o=t:this.#o=t.subarray(this.offset),this.onChangeCallback()}getValue(){return this.isSingleNumber?this.#l?.[this.offset]:this.#l}set(A,t){return this.#l[this.offset+A]=t,this.onChangeCallback(),this}get(A){return this.#l[this.offset+A]}fromArray(A){const t=this.offset,e=this.#l;if(0===t)for(let i=0,s=Math.min(e.length,A.length);i<s;i++)e[i]=A[i];else for(let i=0,s=Math.min(e.length-t,A.length);i<s;i++)e[t+i]=A[i];return this.onChangeCallback(),this}}const j={MAP_READ:1,MAP_WRITE:2,COPY_SRC:4,COPY_DST:8,INDEX:16,VERTEX:32,UNIFORM:64,STORAGE:128,INDIRECT:256,QUERY_RESOLVE:512};var z=(A=>(A[A.VERTEX=1]="VERTEX",A[A.FRAGMENT=2]="FRAGMENT",A[A.COMPUTE=4]="COMPUTE",A[A.ALL=7]="ALL",A))(z||{}),G=(A=>(A.PointList="point-list",A.LineList="line-list",A.LineStrip="line-strip",A.TriangleList="triangle-list",A.TriangleStrip="triangle-strip",A))(G||{}),Y=(A=>(A.Never="never",A.Less="less",A.Equal="equal",A.LessEqual="less-equal",A.Greater="greater",A.NotEqual="not-equal",A.GreaterEqual="greater-equal",A.Always="always",A))(Y||{});const H={Store:"store",Discard:"discard"},K={Load:"load",Clear:"clear"},V={Uint16:"uint16",Uint32:"uint32"},J={uint8:{format:"uint8",wgslType:"u32",size:1,type:"u8",align:1,normalized:!1,elements:1,view:Uint8Array},uint8x2:{format:"uint8x2",wgslType:"vec2u",size:2,type:"u8",align:2,normalized:!1,elements:2,view:Uint8Array},uint8x4:{format:"uint8x4",wgslType:"vec4u",size:4,type:"u8",align:4,normalized:!1,elements:4,view:Uint8Array},sint8:{format:"sint8",wgslType:"i32",size:1,type:"i8",align:1,normalized:!1,elements:1,view:Int8Array},sint8x2:{format:"sint8x2",wgslType:"vec2i",size:2,type:"i8",align:2,normalized:!1,elements:2,view:Int8Array},sint8x4:{format:"sint8x4",wgslType:"vec4i",size:4,type:"i8",align:4,normalized:!1,elements:4,view:Int8Array},unorm8:{format:"unorm8",wgslType:"f32",size:1,type:"u8",align:1,normalized:!0,elements:1,view:Uint8Array},unorm8x2:{format:"unorm8x2",wgslType:"vec2f",size:2,type:"u8",align:2,normalized:!0,elements:2,view:Uint8Array},unorm8x4:{format:"unorm8x4",wgslType:"vec4f",size:4,type:"u8",align:4,normalized:!0,elements:4,view:Uint8Array},snorm8:{format:"snorm8",wgslType:"f32",size:1,type:"i8",align:1,normalized:!0,elements:1,view:Int8Array},snorm8x2:{format:"snorm8x2",wgslType:"vec2f",size:2,type:"i8",align:2,normalized:!0,elements:2,view:Int8Array},snorm8x4:{format:"snorm8x4",wgslType:"vec4f",size:4,type:"i8",align:4,normalized:!0,elements:4,view:Int8Array},uint16:{format:"uint16",wgslType:"u32",size:2,type:"u16",align:2,normalized:!1,elements:1,view:Uint16Array},uint16x2:{format:"uint16x2",wgslType:"vec2u",size:4,type:"u16",align:4,normalized:!1,elements:2,view:Uint16Array},uint16x4:{format:"uint16x4",wgslType:"vec4u",size:8,type:"u16",align:4,normalized:!1,elements:4,view:Uint16Array},sint16:{format:"sint16",wgslType:"i32",size:2,type:"i16",align:2,normalized:!1,elements:1,view:Int16Array},sint16x2:{format:"sint16x2",wgslType:"vec2i",size:4,type:"i16",align:4,normalized:!1,elements:2,view:Int16Array},sint16x4:{format:"sint16x4",wgslType:"vec4i",size:8,type:"i16",align:4,normalized:!1,elements:4,view:Int16Array},unorm16:{format:"unorm16",wgslType:"f32",size:2,type:"u16",align:2,normalized:!0,elements:1,view:Uint16Array},unorm16x2:{format:"unorm16x2",wgslType:"vec2f",size:4,type:"u16",align:4,normalized:!0,elements:2,view:Uint16Array},unorm16x4:{format:"unorm16x4",wgslType:"vec4f",size:8,type:"u16",align:4,normalized:!0,elements:4,view:Uint16Array},snorm16:{format:"snorm16",wgslType:"f32",size:2,type:"i16",align:2,normalized:!0,elements:1,view:Int16Array},snorm16x2:{format:"snorm16x2",wgslType:"vec2f",size:4,type:"i16",align:4,normalized:!0,elements:2,view:Int16Array},snorm16x4:{format:"snorm16x4",wgslType:"vec4f",size:8,type:"i16",align:4,normalized:!0,elements:4,view:Int16Array},float16:{format:"float16",wgslType:"f32",size:2,type:"f16",align:2,normalized:!1,elements:1,view:Float16Array},float16x2:{format:"float16x2",wgslType:"vec2f",size:4,type:"f16",align:4,normalized:!1,elements:2,view:Float16Array},float16x4:{format:"float16x4",wgslType:"vec4f",size:8,type:"f16",align:4,normalized:!1,elements:4,view:Float16Array},float32:{format:"float32",wgslType:"f32",size:4,type:"f32",align:4,normalized:!1,elements:1,view:Float32Array},float32x2:{format:"float32x2",wgslType:"vec2f",size:8,type:"f32",align:4,normalized:!1,elements:2,view:Float32Array},float32x3:{format:"float32x3",wgslType:"vec3f",size:12,type:"f32",align:4,normalized:!1,elements:3,view:Float32Array},float32x4:{format:"float32x4",wgslType:"vec4f",size:16,type:"f32",align:4,normalized:!1,elements:4,view:Float32Array},uint32:{format:"uint32",wgslType:"u32",size:4,type:"u32",align:4,normalized:!1,elements:1,view:Uint32Array},uint32x2:{format:"uint32x2",wgslType:"vec2u",size:8,type:"u32",align:4,normalized:!1,elements:2,view:Uint32Array},uint32x3:{format:"uint32x3",wgslType:"vec3u",size:12,type:"u32",align:4,normalized:!1,elements:3,view:Uint32Array},uint32x4:{format:"uint32x4",wgslType:"vec4u",size:16,type:"u32",align:4,normalized:!1,elements:4,view:Uint32Array},sint32:{format:"sint32",wgslType:"i32",size:4,type:"i32",align:4,normalized:!1,elements:1,view:Int32Array},sint32x2:{format:"sint32x2",wgslType:"vec2i",size:8,type:"i32",align:4,normalized:!1,elements:2,view:Int32Array},sint32x3:{format:"sint32x3",wgslType:"vec3i",size:12,type:"i32",align:4,normalized:!1,elements:3,view:Int32Array},sint32x4:{format:"sint32x4",wgslType:"vec4i",size:16,type:"i32",align:4,normalized:!1,elements:4,view:Int32Array},bgra:{format:"unorm8x4-bgra",wgslType:"vec4f",size:4,type:"u8",align:4,normalized:!0,elements:4,view:Uint8Array},unorm8x4bgra:{format:"unorm8x4-bgra",wgslType:"vec4f",size:4,type:"u8",align:4,normalized:!0,elements:4,view:Uint8Array},unorm10:{format:"unorm10-10-10-2",wgslType:"vec4f",size:4,type:"u32",align:4,normalized:!0,elements:1,view:Uint32Array},unorm1010102:{format:"unorm10-10-10-2",wgslType:"vec4f",size:4,type:"u32",align:4,normalized:!0,elements:1,view:Uint32Array},mat2:{format:"float32x2",wgslType:"mat2x2<f32>",size:16,type:"f32",align:4,normalized:!1,elements:4,view:Float32Array,locationCount:2,rowFormat:"float32x2",rowSize:8},mat3:{format:"float32x3",wgslType:"mat3x3<f32>",size:36,type:"f32",align:4,normalized:!1,elements:9,view:Float32Array,locationCount:3,rowFormat:"float32x3",rowSize:12},mat4:{format:"float32x4",wgslType:"mat4x4<f32>",size:64,type:"f32",align:4,normalized:!1,elements:16,view:Float32Array,locationCount:4,rowFormat:"float32x4",rowSize:16}},W={R8Unorm:"r8unorm",R8Snorm:"r8snorm",R8Uint:"r8uint",R8Sint:"r8sint",R16Unorm:"r16unorm",R16Snorm:"r16snorm",R16Uint:"r16uint",R16Sint:"r16sint",R16Float:"r16float",RG8Unorm:"rg8unorm",RG8Snorm:"rg8snorm",RG8Uint:"rg8uint",RG8Sint:"rg8sint",R32Uint:"r32uint",R32Sint:"r32sint",R32Float:"r32float",RG16Unorm:"rg16unorm",RG16Snorm:"rg16snorm",RG16Uint:"rg16uint",RG16Sint:"rg16sint",RG16Float:"rg16float",RGBA8Unorm:"rgba8unorm",RGBA8UnormSRGB:"rgba8unorm-srgb",RGBA8Snorm:"rgba8snorm",RGBA8Uint:"rgba8uint",RGBA8Sint:"rgba8sint",BGRA8Unorm:"bgra8unorm",BGRA8UnormSRGB:"bgra8unorm-srgb",RGB9E5UFloat:"rgb9e5ufloat",RGB10A2Uint:"rgb10a2uint",RGB10A2Unorm:"rgb10a2unorm",RG11B10UFloat:"rg11b10ufloat",RG32Uint:"rg32uint",RG32Sint:"rg32sint",RG32Float:"rg32float",RGBA16Unorm:"rgba16unorm",RGBA16Snorm:"rgba16snorm",RGBA16Uint:"rgba16uint",RGBA16Sint:"rgba16sint",RGBA16Float:"rgba16float",RGBA32Uint:"rgba32uint",RGBA32Sint:"rgba32sint",RGBA32Float:"rgba32float",Stencil8:"stencil8",Depth16Unorm:"depth16unorm",Depth24Plus:"depth24plus",Depth24PlusStencil8:"depth24plus-stencil8",Depth32Float:"depth32float",Depth32FloatStencil8:"depth32float-stencil8",BC1RGBAUnorm:"bc1-rgba-unorm",BC1RGBAUnormSRGB:"bc1-rgba-unorm-srgb",BC2RGBAUnorm:"bc2-rgba-unorm",BC2RGBAUnormSRGB:"bc2-rgba-unorm-srgb",BC3RGBAUnorm:"bc3-rgba-unorm",BC3RGBAUnormSRGB:"bc3-rgba-unorm-srgb",BC4RUnorm:"bc4-r-unorm",BC4RSnorm:"bc4-r-snorm",BC5RGUnorm:"bc5-rg-unorm",BC5RGSnorm:"bc5-rg-snorm",BC6HRGBUFloat:"bc6h-rgb-ufloat",BC6HRGBFloat:"bc6h-rgb-float",BC7RGBAUnorm:"bc7-rgba-unorm",BC7RGBAUnormSRGB:"bc7-rgba-unorm-srgb",ETC2RGB8Unorm:"etc2-rgb8unorm",ETC2RGB8UnormSRGB:"etc2-rgb8unorm-srgb",ETC2RGB8A1Unorm:"etc2-rgb8a1unorm",ETC2RGB8A1UnormSRGB:"etc2-rgb8a1unorm-srgb",ETC2RGBA8Unorm:"etc2-rgba8unorm",ETC2RGBA8UnormSRGB:"etc2-rgba8unorm-srgb",EACR11Unorm:"eac-r11unorm",EACR11Snorm:"eac-r11snorm",EACRG11Unorm:"eac-rg11unorm",EACRG11Snorm:"eac-rg11snorm",ASTC4x4Unorm:"astc-4x4-unorm",ASTC4x4UnormSRGB:"astc-4x4-unorm-srgb",ASTC5x4Unorm:"astc-5x4-unorm",ASTC5x4UnormSRGB:"astc-5x4-unorm-srgb",ASTC5x5Unorm:"astc-5x5-unorm",ASTC5x5UnormSRGB:"astc-5x5-unorm-srgb",ASTC6x5Unorm:"astc-6x5-unorm",ASTC6x5UnormSRGB:"astc-6x5-unorm-srgb",ASTC6x6Unorm:"astc-6x6-unorm",ASTC6x6UnormSRGB:"astc-6x6-unorm-srgb",ASTC8x5Unorm:"astc-8x5-unorm",ASTC8x5UnormSRGB:"astc-8x5-unorm-srgb",ASTC8x6Unorm:"astc-8x6-unorm",ASTC8x6UnormSRGB:"astc-8x6-unorm-srgb",ASTC8x8Unorm:"astc-8x8-unorm",ASTC8x8UnormSRGB:"astc-8x8-unorm-srgb",ASTC10x5Unorm:"astc-10x5-unorm",ASTC10x5UnormSRGB:"astc-10x5-unorm-srgb",ASTC10x6Unorm:"astc-10x6-unorm",ASTC10x6UnormSRGB:"astc-10x6-unorm-srgb",ASTC10x8Unorm:"astc-10x8-unorm",ASTC10x8UnormSRGB:"astc-10x8-unorm-srgb",ASTC10x10Unorm:"astc-10x10-unorm",ASTC10x10UnormSRGB:"astc-10x10-unorm-srgb",ASTC12x10Unorm:"astc-12x10-unorm",ASTC12x10UnormSRGB:"astc-12x10-unorm-srgb",ASTC12x12Unorm:"astc-12x12-unorm",ASTC12x12UnormSRGB:"astc-12x12-unorm-srgb"},q={ClampToEdge:"clamp-to-edge",Repeat:"repeat",MirrorRepeat:"mirror-repeat"},X={Linear:"linear",Nearest:"nearest"},Z={Uniform:{key:"Uniform",bufferType:"uniform",access:"<uniform>",usage:j.UNIFORM|j.COPY_DST},Storage:{key:"Storage",bufferType:"storage",access:"<storage, read_write>",usage:j.STORAGE|j.COPY_DST|j.COPY_SRC},ReadWrite:{key:"ReadWrite",bufferType:"storage",access:"<storage, read_write>",textureAccess:"read-write",textureAccessWgsl:"read_write",usage:j.STORAGE|j.COPY_DST|j.COPY_SRC},ReadOnly:{key:"ReadOnly",bufferType:"read-only-storage",access:"<storage, read>",textureAccess:"read-only",textureAccessWgsl:"read",usage:j.STORAGE|j.COPY_DST},WriteOnly:{key:"WriteOnly",bufferType:"storage",access:"<storage, write>",textureAccess:"write-only",textureAccessWgsl:"write",usage:j.STORAGE|j.COPY_SRC}},_=(A,t=0,e,i=0,s=void 0,n=!0)=>{if("number"==typeof e)A[t]=e;else if(n){const n=e.length;if(s??=n,0===i&&s===n)A.set(e,t);else for(let r=Math.min(s+i,n);i<r;)A[t++]=e[i++]}else{const n=e.length;s??=n;for(let r=Math.min(s+i,n);i<r;)A[t]=e[i++],t+=4}},$=(A,t=0,e,i=0,s=void 0,n=!0)=>{if("number"==typeof e)A[t]=e;else if(n){const n=e.length;if(s??=n,0===i&&s===n)A.set(e,t);else for(let r=Math.min(s+i,n);i<r;)A[t++]=e[i++]}else{const n=e.length;s??=n;for(let r=Math.min(s+i,n);i<r;)A[t]=e[i++],t+=8}},AA=(A,t=0,e,i=0,s=void 0,n=!0)=>{const r=e.length;if(s??=r,n)if(0===i&&s===r)A.set(e,t);else for(let a=Math.min(s+i,r);i<a;)A[t++]=e[i++];else for(let a=Math.min(s+i,r);i<a;)A[t]=e[i++],A[t+1]=e[i++],t+=4},tA=(A,t=0,e,i=0,s=void 0,n=!0)=>{const r=e.length;s??=r;for(let a=Math.min(s+i,r);i<a;)A[t]=e[i++],A[t+1]=e[i++],A[t+2]=e[i++],t+=4},eA=(A,t=0,e,i=0,s=-1)=>{const n=e.length;if(s??=n,0===i&&s===n)A.set(e,t);else for(let r=Math.min(s+i,n);i<r;)A[t++]=e[i++]},iA=(A,t=0,e,i=0,s=void 0,n=!0)=>{const r=e.length;if(s??=r,n)if(0===i&&s===r)A.set(e,t);else for(let a=Math.min(s+i,r);i<a;)A[t++]=e[i++];else for(let a=Math.min(s+i,r);i<a;)A[t]=e[i++],A[t+1]=e[i++],A[t+2]=e[i++],A[t+3]=e[i++],t+=8},sA=(A,t=0,e,i=0,s=void 0,n=!0)=>{const r=e.length;if(s??=r,n)if(0===i&&s===r)A.set(e,t);else for(let a=Math.min(s+i,r);i<a;)A[t++]=e[i++];else for(let a=Math.min(s+i,r);i<a;)A[t]=e[i++],A[t+1]=e[i++],A[t+2]=e[i++],A[t+3]=e[i++],A[t+4]=e[i++],A[t+5]=e[i++],t+=8},nA=(A,t=0,e,i=0,s=-1)=>{const n=e.length;if(s??=n,0===i&&s===n)A.set(e,t);else for(let r=Math.min(s+i,n);i<r;)A[t++]=e[i++]},rA=(A,t=0,e,i=0,s=void 0,n=!0)=>{const r=e.length;s??=r;for(let a=Math.min(s+i,r);i<a;)A[t]=e[i++],A[t+1]=e[i++],A[t+2]=e[i++],A[t+4]=e[i++],A[t+5]=e[i++],A[t+6]=e[i++],t+=8},aA=(A,t=0,e,i=0,s=void 0,n=!0)=>{const r=e.length;s??=r;for(let a=Math.min(s+i,r);i<a;)A[t]=e[i++],A[t+1]=e[i++],A[t+2]=e[i++],A[t+4]=e[i++],A[t+5]=e[i++],A[t+6]=e[i++],A[t+8]=e[i++],A[t+9]=e[i++],A[t+10]=e[i++],A[t+12]=e[i++],A[t+13]=e[i++],A[t+14]=e[i++],t+=16},oA=(A,t=0,e)=>new L(A,t),lA=(A,t=0,e=!1)=>new L(A,t,!e),cA=(A,t=0,e)=>e?new L(A,t):new w(0,0,A,t),hA=(A,t=0,e)=>e?new L(A,t):new y(0,0,0,A,t),uA=(A,t=0,e)=>e?new L(A,t):new B(0,0,0,0,A,t),gA=(A,t=0,e)=>e?new L(A,t):new I(0,0,0,0,A,t),dA=(A,t=0,e)=>e?new L(A,t):new Q(0,0,0,0,0,0,0,0,0,A,t),pA=(A,t=0,e)=>e?new L(A,t):new v(A,t),fA={i32:{format:"i32",alias:"i32",type:"i32",size:4,align:4,itemElements:1,elements:1,view:Int32Array,initCpuData:lA,setData:_},u32:{format:"u32",alias:"u32",type:"u32",size:4,align:4,itemElements:1,elements:1,view:Uint32Array,initCpuData:lA,setData:_},f32:{format:"f32",alias:"f32",type:"f32",size:4,align:4,itemElements:1,elements:1,view:Float32Array,initCpuData:lA,setData:_},f16:{format:"f16",alias:"f16",type:"f16",size:2,align:2,itemElements:1,elements:1,view:Float16Array,initCpuData:lA,setData:$},i16:{format:"i16",alias:"i16",type:"i16",size:2,align:2,itemElements:1,elements:1,view:Int16Array,initCpuData:lA,setData:$},u16:{format:"u16",alias:"u16",type:"u16",size:2,align:2,itemElements:1,elements:1,view:Uint16Array,initCpuData:lA,setData:$},bool:{format:"bool",alias:"u32",type:"u32",size:4,align:4,itemElements:1,elements:1,view:Uint32Array,initCpuData:lA,setData:(A,t=0,e,i=0,s=void 0,n=!0)=>{if("number"==typeof e)A[t]=e?1:0;else if(n){const n=e.length;if(s??=n,0===i&&s===n)A.set(e,t);else for(let r=Math.min(s+i,n);i<r;)A[t++]=e[i++]?1:0}else{const n=e.length;s??=n;for(let r=Math.min(s+i,n);i<r;)A[t]=e[i++]?1:0,t+=4}}},vec2f:{format:"vec2<f32>",alias:"vec2f",type:"f32",size:8,align:8,itemElements:2,elements:2,view:Float32Array,initCpuData:cA,setData:AA},vec2u:{format:"vec2<u32>",alias:"vec2u",type:"u32",size:8,align:8,itemElements:2,elements:2,view:Uint32Array,initCpuData:cA,setData:AA},vec2i:{format:"vec2<i32>",alias:"vec2i",type:"i32",size:8,align:8,itemElements:2,elements:2,view:Int32Array,initCpuData:cA,setData:AA},vec2h:{format:"vec2<f16>",alias:"vec2h",type:"f16",size:4,align:4,itemElements:2,elements:2,view:Float16Array,initCpuData:cA,setData:(A,t=0,e,i=0,s=void 0,n=!0)=>{const r=e.length;if(s??=r,n)if(0===i&&s===r)A.set(e,t);else for(let a=Math.min(s+i,r);i<a;)A[t++]=e[i++];else for(let a=Math.min(s+i,r);i<a;)A[t]=e[i++],A[t+1]=e[i++],t+=8}},vec3f:{format:"vec3<f32>",alias:"vec3f",type:"f32",size:12,align:16,itemElements:3,elements:3,view:Float32Array,initCpuData:hA,setData:tA},vec3u:{format:"vec3<u32>",alias:"vec3u",type:"u32",size:12,align:16,itemElements:3,elements:3,view:Uint32Array,initCpuData:hA,setData:tA},vec3i:{format:"vec3<i32>",alias:"vec3i",type:"i32",size:12,align:16,itemElements:3,elements:3,view:Int32Array,initCpuData:hA,setData:tA},vec3h:{format:"vec3<f16>",alias:"vec3h",type:"f16",size:6,align:8,itemElements:3,elements:3,view:Float16Array,initCpuData:hA,setData:(A,t=0,e,i=0,s=void 0,n=!0)=>{const r=n?4:8,a=e.length;s??=a;for(let o=Math.min(s+i,a);i<o;)A[t]=e[i++],A[t+1]=e[i++],A[t+2]=e[i++],t+=r}},vec4f:{format:"vec4<f32>",alias:"vec4f",type:"f32",size:16,align:16,itemElements:4,elements:4,view:Float32Array,initCpuData:uA,setData:eA},vec4u:{format:"vec4<u32>",alias:"vec4u",type:"u32",size:16,align:16,itemElements:4,elements:4,view:Uint32Array,initCpuData:uA,setData:eA},vec4i:{format:"vec4<i32>",alias:"vec4i",type:"i32",size:16,align:16,itemElements:4,elements:4,view:Int32Array,initCpuData:uA,setData:eA},vec4h:{format:"vec4<f16>",alias:"vec4h",type:"f16",size:8,align:8,itemElements:4,elements:4,view:Float16Array,initCpuData:uA,setData:iA},mat2x2f:{format:"mat2x2<f32>",alias:"mat2x2f",type:"f32",size:16,align:8,itemElements:2,elements:4,view:Float32Array,initCpuData:gA,setData:eA},mat2x2h:{format:"mat2x2<f16>",alias:"mat2x2h",type:"f16",size:8,align:4,itemElements:2,elements:4,view:Float16Array,initCpuData:gA,setData:iA},mat3x2f:{format:"mat3x2<f32>",alias:"mat3x2f",type:"f32",size:24,align:8,itemElements:2,elements:6,view:Float32Array,initCpuData:oA,setData:sA},mat3x2h:{format:"mat3x2<f16>",alias:"mat3x2h",type:"f16",size:12,align:4,itemElements:2,elements:6,view:Float16Array,initCpuData:oA,setData:sA},mat4x2f:{format:"mat4x2<f32>",alias:"mat4x2f",type:"f32",size:32,align:8,itemElements:2,elements:8,view:Float32Array,initCpuData:oA,setData:nA},mat4x2h:{format:"mat4x2<f16>",alias:"mat4x2h",type:"f16",size:16,align:4,itemElements:2,elements:8,view:Float16Array,initCpuData:oA,setData:nA},mat2x3f:{format:"mat2x3<f32>",alias:"mat2x3f",type:"f32",size:32,align:16,itemElements:3,elements:6,view:Float32Array,initCpuData:oA,setData:rA},mat2x3h:{format:"mat2x3<f16>",alias:"mat2x3h",type:"f16",size:16,align:8,itemElements:3,elements:6,view:Float16Array,initCpuData:oA,setData:rA},mat3x3f:{format:"mat3x3<f32>",alias:"mat3x3f",type:"f32",size:48,align:16,itemElements:3,elements:9,view:Float32Array,initCpuData:dA,setData:(A,t=0,e,i=0,s=void 0,n=!0)=>{const r=e.length;s??=r;for(let a=Math.min(s+i,r);i<a;)A[t]=e[i++],A[t+1]=e[i++],A[t+2]=e[i++],A[t+4]=e[i++],A[t+5]=e[i++],A[t+6]=e[i++],A[t+8]=e[i++],A[t+9]=e[i++],A[t+10]=e[i++],t+=12}},mat3x3h:{format:"mat3x3<f16>",alias:"mat3x3h",type:"f16",size:24,align:8,itemElements:3,elements:9,view:Float16Array,initCpuData:dA,setData:(A,t=0,e,i=0,s=void 0,n=!0)=>{const r=n?12:16,a=e.length;s??=a;for(let o=Math.min(s+i,a);i<o;)A[t]=e[i++],A[t+1]=e[i++],A[t+2]=e[i++],A[t+4]=e[i++],A[t+5]=e[i++],A[t+6]=e[i++],A[t+8]=e[i++],A[t+9]=e[i++],A[t+10]=e[i++],t+=r}},mat4x3f:{format:"mat4x3<f32>",alias:"mat4x3f",type:"f32",size:64,align:16,itemElements:3,elements:12,view:Float32Array,initCpuData:oA,setData:aA},mat4x3h:{format:"mat4x3<f16>",alias:"mat4x3h",type:"f16",size:32,align:8,itemElements:3,elements:12,view:Float16Array,initCpuData:oA,setData:aA},mat2x4f:{format:"mat2x4<f32>",alias:"mat2x4f",type:"f32",size:32,align:16,itemElements:4,elements:8,view:Float32Array,initCpuData:oA,setData:nA},mat2x4h:{format:"mat2x4<f16>",alias:"mat2x4h",type:"f16",size:16,align:8,itemElements:4,elements:8,view:Float16Array,initCpuData:oA,setData:nA},mat3x4f:{format:"mat3x4<f32>",alias:"mat3x4f",type:"f32",size:48,align:16,itemElements:4,elements:12,view:Float32Array,initCpuData:oA,setData:nA},mat3x4h:{format:"mat3x4<f16>",alias:"mat3x4h",type:"f16",size:24,align:8,itemElements:4,elements:12,view:Float16Array,initCpuData:oA,setData:(A,t=0,e,i=0,s=-1,n=!0)=>{const r=e.length;if(s??=r,n)if(0===i&&s===r)A.set(e,t);else for(let a=Math.min(s+i,r);i<a;)A[t++]=e[i++];else for(let a=Math.min(s+i,r);i<a;)A[t]=e[i++],A[t+1]=e[i++],A[t+2]=e[i++],A[t+3]=e[i++],A[t+4]=e[i++],A[t+5]=e[i++],A[t+6]=e[i++],A[t+7]=e[i++],A[t+8]=e[i++],A[t+9]=e[i++],A[t+10]=e[i++],A[t+11]=e[i++],t+=16}},mat4x4f:{format:"mat4x4<f32>",alias:"mat4x4f",type:"f32",size:64,align:16,itemElements:4,elements:16,view:Float32Array,initCpuData:pA,setData:nA},mat4x4h:{format:"mat4x4<f16>",alias:"mat4x4h",type:"f16",size:32,align:8,itemElements:4,elements:16,view:Float16Array,initCpuData:pA,setData:nA}},mA={Filtering:"filtering",NonFiltering:"non-filtering",Comparison:"comparison"};var CA=(A=>(A.Float="float",A.UnfilterableFloat="unfilterable-float",A.Depth="depth",A.SInt="sint",A.UInt="uint",A))(CA||{}),wA=(A=>(A[A.RGBAFormat=0]="RGBAFormat",A[A.RGBFormat=1]="RGBFormat",A[A.RedFormat=2]="RedFormat",A[A.RGFormat=3]="RGFormat",A[A.DepthFormat=4]="DepthFormat",A[A.DepthStencilFormat=5]="DepthStencilFormat",A[A.BGRAFormat=6]="BGRAFormat",A))(wA||{}),yA=(A=>(A[A.NormByteType=0]="NormByteType",A[A.UnNormByteType=1]="UnNormByteType",A[A.ByteType=2]="ByteType",A[A.UnByteType=3]="UnByteType",A[A.NormShortType=4]="NormShortType",A[A.UnNormShortType=5]="UnNormShortType",A[A.ShortType=6]="ShortType",A[A.UnShortType=7]="UnShortType",A[A.IntType=8]="IntType",A[A.UnIntType=9]="UnIntType",A[A.HalfFloatType=10]="HalfFloatType",A[A.FloatType=11]="FloatType",A[A.HDRFloat=12]="HDRFloat",A[A.CustomFloat=13]="CustomFloat",A))(yA||{});const BA=function(){const A={0:{0:{format:W.RGBA8Snorm,sampleType:"float",filterable:!0,dataType:Int8Array,byte:4,baseWgslType:"f32"},1:{format:W.RGBA8Unorm,srgbFormat:W.RGBA8UnormSRGB,sampleType:"float",filterable:!0,dataType:Uint8Array,byte:4,baseWgslType:"f32"},2:{format:W.RGBA8Sint,sampleType:"sint",filterable:!1,dataType:Int8Array,byte:4,baseWgslType:"i32"},3:{format:W.RGBA8Uint,sampleType:"uint",filterable:!1,dataType:Uint8Array,byte:4,baseWgslType:"u32"},4:{format:W.RGBA16Snorm,sampleType:"unfilterable-float",filterable:!1,dataType:Int16Array,byte:8,baseWgslType:"f32"},5:{format:W.RGBA16Unorm,sampleType:"unfilterable-float",filterable:!1,dataType:Uint16Array,byte:8,baseWgslType:"f32"},6:{format:W.RGBA16Sint,sampleType:"sint",filterable:!1,dataType:Int16Array,byte:8,baseWgslType:"i32"},7:{format:W.RGBA16Uint,sampleType:"uint",filterable:!1,dataType:Uint16Array,byte:8,baseWgslType:"u32"},8:{format:W.RGBA32Sint,sampleType:"sint",filterable:!1,dataType:Int32Array,byte:16,baseWgslType:"i32"},9:{format:W.RGBA32Uint,sampleType:"uint",filterable:!1,dataType:Uint32Array,byte:16,baseWgslType:"u32"},10:{format:W.RGBA16Float,sampleType:"float",filterable:!0,dataType:Float16Array,byte:8,baseWgslType:"f32"},11:{format:W.RGBA32Float,sampleType:"float",filterable:!1,dataType:Float32Array,byte:16,baseWgslType:"f32"}},1:{12:{format:W.RGB9E5UFloat,sampleType:"float",filterable:!0,alpha:!1,dataType:Uint32Array,byte:4,block:{byteLength:4,width:1,height:1},baseWgslType:"f32"},9:{format:W.RGB10A2Uint,sampleType:"uint",filterable:!1,dataType:Uint32Array,byte:4,baseWgslType:"u32"},13:{format:W.RGB10A2Unorm,sampleType:"float",filterable:!0,dataType:Uint32Array,byte:4,baseWgslType:"f32"},11:{format:W.RG11B10UFloat,sampleType:"float",filterable:!0,dataType:Uint32Array,byte:4,baseWgslType:"f32"}},2:{0:{format:W.R8Snorm,sampleType:"float",filterable:!0,dataType:Int8Array,byte:1,baseWgslType:"f32"},1:{format:W.R8Unorm,sampleType:"float",filterable:!0,dataType:Uint8Array,byte:1,baseWgslType:"f32"},2:{format:W.R8Sint,sampleType:"sint",filterable:!1,dataType:Int8Array,byte:1,baseWgslType:"i32"},3:{format:W.R8Uint,sampleType:"uint",filterable:!1,dataType:Uint8Array,byte:1,baseWgslType:"u32"},4:{format:W.R16Snorm,sampleType:"unfilterable-float",filterable:!1,dataType:Int16Array,byte:2,baseWgslType:"f32"},5:{format:W.R16Unorm,sampleType:"unfilterable-float",filterable:!1,dataType:Uint16Array,byte:2,baseWgslType:"f32"},6:{format:W.R16Sint,sampleType:"sint",filterable:!1,dataType:Int16Array,byte:2,baseWgslType:"i32"},7:{format:W.R16Uint,sampleType:"uint",filterable:!1,dataType:Uint16Array,byte:2,baseWgslType:"u32"},8:{format:W.R32Sint,sampleType:"sint",filterable:!1,dataType:Int32Array,byte:4,baseWgslType:"i32"},9:{format:W.R32Uint,sampleType:"uint",filterable:!1,dataType:Uint32Array,byte:4,baseWgslType:"u32"},10:{format:W.R16Float,sampleType:"float",filterable:!0,dataType:Float16Array,byte:2,baseWgslType:"f32"},11:{format:W.R32Float,sampleType:"float",filterable:!1,dataType:Float32Array,byte:4,baseWgslType:"f32"}},3:{0:{format:W.RG8Snorm,sampleType:"float",filterable:!0,dataType:Int8Array,byte:2,baseWgslType:"f32"},1:{format:W.RG8Unorm,sampleType:"float",filterable:!0,dataType:Uint8Array,byte:2,baseWgslType:"f32"},2:{format:W.RG8Sint,sampleType:"sint",filterable:!1,dataType:Int8Array,byte:2,baseWgslType:"i32"},3:{format:W.RG8Uint,sampleType:"uint",filterable:!1,dataType:Uint8Array,byte:2,baseWgslType:"u32"},4:{format:W.RG16Snorm,sampleType:"unfilterable-float",filterable:!1,dataType:Int16Array,byte:4,baseWgslType:"f32"},5:{format:W.RG16Unorm,sampleType:"unfilterable-float",filterable:!1,dataType:Uint16Array,byte:4,baseWgslType:"f32"},6:{format:W.RG16Sint,sampleType:"sint",filterable:!1,dataType:Int16Array,byte:4,baseWgslType:"i32"},7:{format:W.RG16Uint,sampleType:"uint",filterable:!1,dataType:Uint16Array,byte:4,baseWgslType:"u32"},8:{format:W.RG32Sint,sampleType:"sint",filterable:!1,dataType:Int32Array,byte:8,baseWgslType:"i32"},9:{format:W.RG32Uint,sampleType:"uint",filterable:!1,dataType:Uint32Array,byte:8,baseWgslType:"u32"},10:{format:W.RG16Float,sampleType:"float",filterable:!0,dataType:Float16Array,byte:4,baseWgslType:"f32"},11:{format:W.RG32Float,sampleType:"float",filterable:!1,dataType:Float32Array,byte:8,baseWgslType:"f32"}},4:{7:{format:W.Depth16Unorm,sampleType:"depth",filterable:!0,dataType:Uint16Array,byte:2,baseWgslType:"f32"},9:{format:W.Depth24Plus,sampleType:"depth",filterable:!0,dataType:Uint32Array,byte:4,baseWgslType:"f32"},11:{format:W.Depth32Float,sampleType:"depth",filterable:!0,dataType:Float32Array,byte:4,baseWgslType:"f32"}},5:{3:{format:W.Stencil8,sampleType:"depth",filterable:!1,dataType:Uint8Array,byte:1,baseWgslType:"f32"},9:{format:W.Depth24PlusStencil8,sampleType:"depth",filterable:!0,dataType:Uint32Array,byte:4,baseWgslType:"f32"},11:{format:W.Depth32FloatStencil8,sampleType:"depth",filterable:!0,dataType:Float32Array,byte:4,baseWgslType:"f32",valid:A=>A.features.has(MA.Depth32FloatStencil8)}},6:{1:{format:W.BGRA8Unorm,srgbFormat:W.BGRA8UnormSRGB,sampleType:"float",filterable:!0,dataType:Uint8Array,byte:4,baseWgslType:"f32"}}};return Object.entries(A).forEach(([A,t])=>{const e=Number(A);Object.entries(t).forEach(([A,t])=>{const i=t,s=Number(A);i.index=e,i.iname=wA[e],i.index2=s,i.iname2=yA[s],i.isCompress=!1})}),A}();var IA=(A=>(A[A.BC1RGBAUnorm=0]="BC1RGBAUnorm",A[A.BC2RGBAUnorm=1]="BC2RGBAUnorm",A[A.BC3RGBAUnorm=2]="BC3RGBAUnorm",A[A.BC4RUnorm=3]="BC4RUnorm",A[A.BC4RSnorm=4]="BC4RSnorm",A[A.BC5RGUnorm=5]="BC5RGUnorm",A[A.BC5RGSnorm=6]="BC5RGSnorm",A[A.BC6HRGBUFloat=7]="BC6HRGBUFloat",A[A.BC6HRGBFloat=8]="BC6HRGBFloat",A[A.BC7RGBAUnorm=9]="BC7RGBAUnorm",A[A.ETC2RGB8Unorm=10]="ETC2RGB8Unorm",A[A.ETC2RGB8A1Unorm=11]="ETC2RGB8A1Unorm",A[A.ETC2RGBA8Unorm=12]="ETC2RGBA8Unorm",A[A.EACR11Unorm=13]="EACR11Unorm",A[A.EACR11Snorm=14]="EACR11Snorm",A[A.EACRG11Unorm=15]="EACRG11Unorm",A[A.EACRG11Snorm=16]="EACRG11Snorm",A[A.ASTC4x4Unorm=17]="ASTC4x4Unorm",A[A.ASTC5x4Unorm=18]="ASTC5x4Unorm",A[A.ASTC5x5Unorm=19]="ASTC5x5Unorm",A[A.ASTC6x5Unorm=20]="ASTC6x5Unorm",A[A.ASTC6x6Unorm=21]="ASTC6x6Unorm",A[A.ASTC8x5Unorm=22]="ASTC8x5Unorm",A[A.ASTC8x6Unorm=23]="ASTC8x6Unorm",A[A.ASTC8x8Unorm=24]="ASTC8x8Unorm",A[A.ASTC10x5Unorm=25]="ASTC10x5Unorm",A[A.ASTC10x6Unorm=26]="ASTC10x6Unorm",A[A.ASTC10x8Unorm=27]="ASTC10x8Unorm",A[A.ASTC10x10Unorm=28]="ASTC10x10Unorm",A[A.ASTC12x10Unorm=29]="ASTC12x10Unorm",A[A.ASTC12x12Unorm=30]="ASTC12x12Unorm",A))(IA||{});const QA=function(){const A={0:{format:W.BC1RGBAUnorm,srgbFormat:W.BC1RGBAUnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:8,width:4,height:4},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-bc-sliced-3d",validFeature:"texture-compression-bc"},1:{format:W.BC2RGBAUnorm,srgbFormat:W.BC2RGBAUnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:4,height:4},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-bc-sliced-3d",validFeature:"texture-compression-bc"},2:{format:W.BC3RGBAUnorm,srgbFormat:W.BC3RGBAUnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:4,height:4},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-bc-sliced-3d",validFeature:"texture-compression-bc"},3:{format:W.BC4RUnorm,sampleType:"float",filterable:!0,block:{byteLength:8,width:4,height:4},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-bc-sliced-3d",validFeature:"texture-compression-bc"},4:{format:W.BC4RSnorm,sampleType:"float",filterable:!0,block:{byteLength:8,width:4,height:4},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-bc-sliced-3d",validFeature:"texture-compression-bc"},5:{format:W.BC5RGUnorm,sampleType:"float",filterable:!0,block:{byteLength:16,width:4,height:4},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-bc-sliced-3d",validFeature:"texture-compression-bc"},6:{format:W.BC5RGSnorm,sampleType:"float",filterable:!0,block:{byteLength:16,width:4,height:4},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-bc-sliced-3d",validFeature:"texture-compression-bc"},7:{format:W.BC6HRGBUFloat,sampleType:"float",filterable:!0,block:{byteLength:16,width:4,height:4},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-bc-sliced-3d",validFeature:"texture-compression-bc"},8:{format:W.BC6HRGBFloat,sampleType:"float",filterable:!0,block:{byteLength:16,width:4,height:4},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-bc-sliced-3d",validFeature:"texture-compression-bc"},9:{format:W.BC7RGBAUnorm,srgbFormat:W.BC7RGBAUnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:4,height:4},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-bc-sliced-3d",validFeature:"texture-compression-bc"},10:{format:W.ETC2RGB8Unorm,srgbFormat:W.ETC2RGB8UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:8,width:4,height:4},isCan3D:!1,isCan:!1,validFeature:"texture-compression-etc2"},11:{format:W.ETC2RGB8A1Unorm,srgbFormat:W.ETC2RGB8A1UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:8,width:4,height:4},isCan3D:!1,isCan:!1,validFeature:"texture-compression-etc2"},12:{format:W.ETC2RGBA8Unorm,srgbFormat:W.ETC2RGBA8UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:4,height:4},isCan3D:!1,isCan:!1,validFeature:"texture-compression-etc2"},13:{format:W.EACR11Unorm,sampleType:"float",filterable:!0,block:{byteLength:8,width:4,height:4},isCan3D:!1,isCan:!1,validFeature:"texture-compression-etc2"},14:{format:W.EACR11Snorm,sampleType:"float",filterable:!0,block:{byteLength:8,width:4,height:4},isCan3D:!1,isCan:!1,validFeature:"texture-compression-etc2"},15:{format:W.EACRG11Unorm,sampleType:"float",filterable:!0,block:{byteLength:16,width:4,height:4},isCan3D:!1,isCan:!1,validFeature:"texture-compression-etc2"},16:{format:W.EACRG11Snorm,sampleType:"float",filterable:!0,block:{byteLength:16,width:4,height:4},isCan3D:!1,isCan:!1,validFeature:"texture-compression-etc2"},17:{format:W.ASTC4x4Unorm,srgbFormat:W.ASTC4x4UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:4,height:4},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-astc-sliced-3d",validFeature:"texture-compression-astc"},18:{format:W.ASTC5x4Unorm,srgbFormat:W.ASTC5x4UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:5,height:4},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-astc-sliced-3d",validFeature:"texture-compression-astc"},19:{format:W.ASTC5x5Unorm,srgbFormat:W.ASTC5x5UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:5,height:5},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-astc-sliced-3d",validFeature:"texture-compression-astc"},20:{format:W.ASTC6x5Unorm,srgbFormat:W.ASTC6x5UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:6,height:5},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-astc-sliced-3d",validFeature:"texture-compression-astc"},21:{format:W.ASTC6x6Unorm,srgbFormat:W.ASTC6x6UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:6,height:6},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-astc-sliced-3d",validFeature:"texture-compression-astc"},22:{format:W.ASTC8x5Unorm,srgbFormat:W.ASTC8x5UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:8,height:5},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-astc-sliced-3d",validFeature:"texture-compression-astc"},23:{format:W.ASTC8x6Unorm,srgbFormat:W.ASTC8x6UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:8,height:6},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-astc-sliced-3d",validFeature:"texture-compression-astc"},24:{format:W.ASTC8x8Unorm,srgbFormat:W.ASTC8x8UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:8,height:8},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-astc-sliced-3d",validFeature:"texture-compression-astc"},25:{format:W.ASTC10x5Unorm,srgbFormat:W.ASTC10x5UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:10,height:5},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-astc-sliced-3d",validFeature:"texture-compression-astc"},26:{format:W.ASTC10x6Unorm,srgbFormat:W.ASTC10x6UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:10,height:6},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-astc-sliced-3d",validFeature:"texture-compression-astc"},27:{format:W.ASTC10x8Unorm,srgbFormat:W.ASTC10x8UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:10,height:8},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-astc-sliced-3d",validFeature:"texture-compression-astc"},28:{format:W.ASTC10x10Unorm,srgbFormat:W.ASTC10x10UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:10,height:10},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-astc-sliced-3d",validFeature:"texture-compression-astc"},29:{format:W.ASTC12x10Unorm,srgbFormat:W.ASTC12x10UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:12,height:10},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-astc-sliced-3d",validFeature:"texture-compression-astc"},30:{format:W.ASTC12x12Unorm,srgbFormat:W.ASTC12x12UnormSRGB,sampleType:"float",filterable:!0,block:{byteLength:16,width:12,height:12},isCan3D:!1,isCan:!1,valid3DFeature:"texture-compression-astc-sliced-3d",validFeature:"texture-compression-astc"}};return Object.entries(A).forEach(([A,t])=>{const e=t,i=Number(A);e.index=i,e.iname=IA[i],e.isCompress=!0}),A}(),EA=function(){const A={},t={},e=function(e){const i=e.format,s=A[i];e.formatKey=s,null!=s&&(t[s]=e),t[i]=e},i=function(A){(A?.format?[A]:Object.values(A)).forEach(A=>{e(A),A.srgbFormat&&e({...A,format:A.srgbFormat})})};return Object.entries(W).forEach(([t,e])=>{A[e]=t}),Object.values(BA).forEach(i),Object.values(QA).forEach(i),t}(),xA={OneD:"1d",TwoD:"2d",ThreeD:"3d"},DA={OneD:"1d",TwoD:"2d",TwoDArray:"2d-array",Cube:"cube",CubeArray:"cube-array",ThreeD:"3d"},MA={DepthClipControl:"depth-clip-control",Depth32FloatStencil8:"depth32float-stencil8",TextureCompressionBC:"texture-compression-bc",TextureCompressionETC2:"texture-compression-etc2",TextureCompressionASTC:"texture-compression-astc",TimestampQuery:"timestamp-query",IndirectFirstInstance:"indirect-first-instance",ShaderF16:"shader-f16",RG11B10UFloat:"rg11b10ufloat-renderable",BGRA8UNormStorage:"bgra8unorm-storage",Float32Filterable:"float32-filterable",ClipDistances:"clip-distances",DualSourceBlending:"dual-source-blending",Subgroups:"subgroups",SubgroupsF16:"subgroups-f16",PrimitiveIndex:"primitive-index",CoreFeaturesAndLimits:"core-features-and-limits",TextureCompressionBCSliced3D:"texture-compression-bc-sliced-3d",TextureCompressionASTCSliced3D:"texture-compression-astc-sliced-3d",Float32Blendable:"float32-blendable",TextureComponentSwizzle:"texture-component-swizzle",TextureFormatsTier1:"texture-formats-tier1",TextureFormatsTier2:"texture-formats-tier2"},bA={NoColorSpace:"",SRGBColorSpace:"srgb",LinearSRGBColorSpace:"srgb-linear",LinearTransfer:"linear",SRGBTransfer:"srgb"},SA={NoToneMapping:0,LinearToneMapping:1,ReinhardToneMapping:2,CineonToneMapping:3,ACESFilmicToneMapping:4,CustomToneMapping:5,AgXToneMapping:6,NeutralToneMapping:7};function vA(A,t,e=0){const i=A.locationCount??1;if(1===i)return[{shaderLocation:t,offset:e,format:A.format}];const s=A.rowFormat,n=A.rowSize,r=new Array(i);for(let a=0;a<i;a++)r[a]={shaderLocation:t+a,offset:e+a*n,format:s};return r}function TA(A){const t=A.attributes;let e=!1;for(let s=0;s<t.length;s++)if((t[s].locationCount??1)>1){e=!0;break}if(!e)return A;const i=[];for(let s=0;s<t.length;s++){const A=t[s],e=A.locationCount??1;if(1===e){i.push(A);continue}const n=A.rowFormat??A.format,r=A.rowSize??0,a=J[n],o=a?.wgslType??"vec4f",l=vA({locationCount:e,rowFormat:n,rowSize:r,format:A.format},A.shaderLocation,A.offset);for(let t=0;t<e;t++)i.push({...l[t],attrName:`${A.attrName}${t}`,wgslType:o})}return{...A,attributes:i}}class UA extends c{isStructBuffer=!0;isChunkLayout=!1;count;capacity;stride;typeMap=new Map;updateRanges=[];#h;#u=[];constructor(A,t,e){const i=e?.isChunkLayout||!1,{types:s,stride:n}=i?function(A,t){const e=new Map;let i=0,s=0;return A.forEach(A=>{const n=J[A.format],r={...A,...n,byteOffset:0,byteStride:0,offset:0,stride:0,dataView:null,isChunkLayout:!0},a=r.view.BYTES_PER_ELEMENT;r.byteStride=u(4,r.size),r.byteOffset=i,r.stride=r.byteStride/a,r.offset=i/a,i+=r.byteStride*t,s+=r.byteStride,e.set(r.name,r)}),{types:e,stride:s,length:i}}(t,A):function(A){const t=new Map,e=[],i=[],s=[];A.forEach(A=>{const t=J[A.format],n={...A,...t,byteOffset:0,byteStride:0,offset:0,stride:0,dataView:null,isChunkLayout:!1};switch(n.align){case 1:e.push(n);break;case 2:i.push(n);break;default:s.push(n)}});let n=0,r=0,a=null,o=s.length;for(;n<o;)a=s[n++],a.byteOffset=r,a.offset=r/a.view.BYTES_PER_ELEMENT,r+=a.size,t.set(a.name,a);for(n=0,o=i.length;n<o;)a=i[n++],a.byteOffset=r,a.offset=r/a.view.BYTES_PER_ELEMENT,r+=a.size,t.set(a.name,a);for(n=0,o=e.length;n<o;)a=e[n++],a.byteOffset=r,a.offset=r/a.view.BYTES_PER_ELEMENT,r+=a.size,t.set(a.name,a);const l=u(4,r);return t.forEach(A=>{A.byteStride=l,A.stride=l/A.view.BYTES_PER_ELEMENT}),{types:t,stride:l}}(t);super(n*A),this.#h=t.slice(),this.count=A,this.capacity=A,this.isChunkLayout=i,this.stride=n,this.typeMap=s,this.callback=(A,t)=>{"buffer"!==t&&"resize"!==t&&"transfer"!==t||this.typeMap.forEach(A=>{A.dataView=this.getView(A.type)})},s.forEach(A=>{A.dataView=this.getView(A.type)})}resize(A){if(A<0&&(A=0),A===this.count)return this;if(A<=this.capacity)return this.count=A,this.#g(!1),this;const t=Math.max(A,1.2*this.capacity|0),e=this.isChunkLayout;return this.isChunkLayout?this.#d(t,this.count):super.resize(this.stride*t),this.capacity=t,this.count=A,this.#g(e),this}shrinkToFit(){const A=this.count;return this.capacity<=A||(this.isChunkLayout?this.#d(A,A):super.resize(this.stride*A),this.capacity=A,this.isChunkLayout&&this.#g(!0)),this}bindAttribute(A){const t=this.#u;for(let e=0;e<t.length;e++){const i=t[e].deref();if(i===A)return;if(!i){const A=t.pop();A&&e<t.length&&(t[e]=A),e--}}t.push(new WeakRef(A))}unbindAttribute(A){const t=this.#u;for(let e=0;e<t.length;e++){const i=t[e].deref();if(i===A||!i){const s=t.pop();if(s&&e<t.length&&(t[e]=s),i===A)return;e--}}}#g(A){const t=this.#u;let e=A;for(let n=0;n<t.length;n++){const A=t[n].deref();if(!A){const A=t.pop();A&&n<t.length&&(t[n]=A),n--;continue}A.isDirty||(e=!0),A.syncFromBuffer()}if(!e)return;const i=A?f.DIRTY_STRUCTURE:f.DIRTY_DATA,s=new Set;for(let n=0;n<t.length;n++){const A=t[n].deref();A&&A.forEachDependent(A=>{s.has(A)||(s.add(A),A.onChangeCallback(i))})}}#d(A,t){const e=this.u8,i=new ArrayBuffer(this.stride*A),s=new Uint8Array(i);let n=0;for(const r of this.typeMap.values()){const i=t*r.byteStride,a=r.byteOffset;s.set(e.subarray(a,a+i),n),r.byteOffset=n,r.offset=n/r.view.BYTES_PER_ELEMENT,n+=r.byteStride*A}this.buffer=i}getAccessor(A){return this.typeMap.get(A)}setX(A,t,e){const i=this.typeMap.get(A);if(i)return i.dataView[i.offset+t*i.stride]=e,this;console.error(`StructAttributeBuffer setX ${A} not found`)}setY(A,t,e){const i=this.typeMap.get(A);if(i)return i.dataView[i.offset+t*i.stride+1]=e,this;console.error(`StructAttributeBuffer setY ${A} not found`)}setZ(A,t,e){const i=this.typeMap.get(A);if(i)return i.dataView[i.offset+t*i.stride+2]=e,this;console.error(`StructAttributeBuffer setZ ${A} not found`)}setW(A,t,e){const i=this.typeMap.get(A);if(i)return i.dataView[i.offset+t*i.stride+3]=e,this;console.error(`StructAttributeBuffer setW ${A} not found`)}setXY(A,t,e,i){const s=this.typeMap.get(A);if(!s)return void console.error(`StructAttributeBuffer setXY ${A} not found`);const n=s.dataView,r=s.offset+t*s.stride;return n[r]=e,n[r+1]=i,this}setXYZ(A,t,e,i,s){const n=this.typeMap.get(A);if(!n)return void console.error(`StructAttributeBuffer setXYZ ${A} not found`);const r=n.dataView,a=n.offset+t*n.stride;return r[a]=e,r[a+1]=i,r[a+2]=s,this}setXYZW(A,t,e,i,s,n){const r=this.typeMap.get(A);if(!r)return void console.error(`StructAttributeBuffer setXYZW ${A} not found`);const a=r.dataView,o=r.offset+t*r.stride;return a[o]=e,a[o+1]=i,a[o+2]=s,a[o+3]=n,this}getX(A,t){const e=this.typeMap.get(A);if(e)return e.dataView[e.offset+t*e.stride];console.error(`StructAttributeBuffer getX ${A} not found`)}getY(A,t){const e=this.typeMap.get(A);if(e)return e.dataView[e.offset+t*e.stride+1];console.error(`StructAttributeBuffer getY ${A} not found`)}getZ(A,t){const e=this.typeMap.get(A);if(e)return e.dataView[e.offset+t*e.stride+2];console.error(`StructAttributeBuffer getZ ${A} not found`)}getW(A,t){const e=this.typeMap.get(A);if(e)return e.dataView[e.offset+t*e.stride+3];console.error(`StructAttributeBuffer getW ${A} not found`)}getXY(A,t){const e=this.typeMap.get(A);if(!e)return void console.error(`StructAttributeBuffer getXY ${A} not found`);const i=e.dataView,s=e.offset+t*e.stride;return[i[s],i[s+1]]}getXYZ(A,t){const e=this.typeMap.get(A);if(!e)return void console.error(`StructAttributeBuffer getXYZ ${A} not found`);const i=e.dataView,s=e.offset+t*e.stride;return[i[s],i[s+1],i[s+2]]}getXYZW(A,t){const e=this.typeMap.get(A);if(!e)return void console.error(`StructAttributeBuffer getXYZW ${A} not found`);const i=e.dataView,s=e.offset+t*e.stride;return[i[s],i[s+1],i[s+2],i[s+3]]}setArray(A,t,e=0){const i=this.typeMap.get(A);if(!i)return void console.error(`StructAttributeBuffer setArray ${A} not found`);const s=i.dataView,n=i.elements,r=i.stride,a=Math.floor(t.length/n),o=i.offset+e*r;if(!this.isChunkLayout&&1!==this.typeMap.size||r!==n)for(let l=0;l<a;l++){const A=o+l*r;for(let e=0;e<n;e++)s[A+e]=t[l*n+e]}else s.set(t,o);return this}addUpdateRange(A,t,e){return this.updateRanges.push({start:A,count:t,name:e}),this}clearUpdateRanges(){return this.updateRanges.length=0,this}copy(A){if(this.isChunkLayout!==A.isChunkLayout||this.stride!==A.stride||this.typeMap.size!==A.typeMap.size)throw new Error("VertexStructBuffer.copy: layout mismatch");for(const[t,e]of A.typeMap){const A=this.typeMap.get(t);if(!A||A.format!==e.format)throw new Error("VertexStructBuffer.copy: layout mismatch")}return A.count>this.capacity&&this.resize(A.count),this.#p(A),this}#p(A){if(A.isChunkLayout)for(const[t,e]of A.typeMap){const i=this.typeMap.get(t);if(!i)continue;const s=A.count*e.byteStride;this.u8.set(A.u8.subarray(e.byteOffset,e.byteOffset+s),i.byteOffset)}else this.u8.set(A.u8.subarray(0,A.stride*A.count));this.count=A.count}copyAt(A,t,e){const i=this.u8,s=t.u8;A*=this.stride,e*=t.stride;for(let n=0,r=this.stride;n<r;n++)i[A+n]=s[e+n];return this}clone(){const A=new UA(this.count,this.#h,{isChunkLayout:this.isChunkLayout});return A.#p(this),A}toJSON(){return{count:this.count,stride:this.stride,typeMap:this.typeMap}}}function NA(A){const t=A.colors;if(2!==t.length)return!1;const e=t[0].format,i=t[1].format;return"rgba16float"===e&&("r16float"===i||"rgba16float"===i)}let PA="",OA=null;function FA(A){return"r16float"===A||"r32float"===A?"f32":A.includes("uint")?"vec4u":A.includes("sint")?"vec4i":"vec4f"}function kA(A){const t=A.getFragmentLayoutCacheKey();if(OA&&PA===t)return OA;const e=function(A){const t=A.getColorFormats(),e=t.length,i=new Array(e);for(let s=0;s<e;s++){const e=t[s];i[s]={location:s,field:`m${s}`,wgslType:FA(e),format:e,writeMask:A.getColorWriteMask(s)}}return i}(A);if(0===e.length)throw new Error("FragmentLayout: RenderContext 无 color attachment");const i=A.getFragmentBuiltins();if(i.fragDepth&&!A.depth)throw new Error("FragmentLayout: fragDepth 需要 RenderContext.depth === true");if(i.sampleMask&&A.sampleCount<2)throw new Error("FragmentLayout: sampleMask 需要 sampleCount > 1");const s={colors:e,builtins:i,mode:1!==e.length||i.fragDepth||i.sampleMask?"struct":"scalar"};return PA=t,OA=s,s}function RA(A,t,e,i){const s=A.indexOf(t);if(s<0||A.indexOf(t,s+t.length)>=0)throw new Error(`lightingVariant: ${i}`);return A.slice(0,s)+e+A.slice(s+t.length)}let LA=10;const jA=[];let zA="",GA=-1,YA=!0;function HA(A){YA=A}const KA=/\bapplyPhong\b/,VA=/\bapplyLambert\b/,JA=/\bapplyToon(?:Tex(?:Family)?)?\b/,WA=/\bapplyShadow\b/,qA=/\bapplyVolume\b/,XA=/\bapplyLambert\b|\bapplyPhong\b|\bapplyToon(?:Tex(?:Family)?)?\b|\bapplyShadow\b|\bapplyVolume\b|\bapplyLighting(?:Baked)?\b|\bapplyPhysical\b/,ZA=new Set(["applyLambert","applyPhong","applyToon","applyToonTex","applyToonTexFamily","applyShadow","applyVolume","applyLighting","applyLightingBaked","applyPhysical"]),_A=[];function $A(A){const t=_A.length;if(0===t)return null;let e=null;for(let i=0;i<t;i++){const t=_A[i];if(t.re.test(A)){if(e)throw new Error("ShaderAssembler: 一个材质只能调用一个自定义着色函数");e=t.wgsl}}return e}function At(A,t=-1){return-1==t?(t=jA.length,jA.push(A),LA++,GA=-1):jA[t]=A,t}function tt(){if(GA===LA)return zA;let A="";for(let t=0,e=jA.length;t<e;t++){const e=jA[t];e&&(A+=` case ${t}u: {\n${e}\n }\n`)}return zA=`${et}\n\tfn shadeLightAt(\n\t P: vec3f, N: vec3f, V: vec3f,\n\t off: u32,\n\t albedo: vec3f, roughness: f32, metal: f32,\n\t F0: vec3f,\n\t) -> vec3f {\n let kind = u32(lights[off].y);\n switch (kind) {\n${A} default: { return vec3f(0.0); }\n }\n}\n${it}`,GA=LA,zA}const et="\nconst LIGHT_NONE: u32 = 0xffffffffu;\n\nfn lightWorldPos(pool: u32) -> vec3f {\n let M = worldMatrices[pool];\n return M[3].xyz;\n}\n\nfn lightWorldDirNegZ(pool: u32) -> vec3f {\n let M = worldMatrices[pool];\n return -normalize(M[2].xyz);\n}\n\nfn lightWorldUp(pool: u32) -> vec3f {\n let M = worldMatrices[pool];\n return normalize(M[1].xyz);\n}\n\nfn lightWorldRight(pool: u32) -> vec3f {\n let M = worldMatrices[pool];\n return normalize(M[0].xyz);\n}\n\n// Heitz LTC:表 UV 与 Three RectAreaLightTexturesLib 同一张 64²。\nfn ltcUv(N: vec3f, V: vec3f, roughness: f32) -> vec2f {\n let nv = saturate(dot(N, V));\n return vec2f(roughness, sqrt(max(1.0 - nv, 0.0))) * (63.0 / 64.0) + vec2f(0.5 / 64.0);\n}\n\nfn ltcClippedSphereFormFactor(f: vec3f) -> f32 {\n let l = length(f);\n return max((l * l + f.z) / (l + 1.0), 0.0);\n}\n\nfn ltcEdgeVectorFormFactor(v1: vec3f, v2: vec3f) -> vec3f {\n let x = dot(v1, v2);\n let y = abs(x);\n let a = (0.8543985 + (0.4965155 + 0.0145206 * y) * y);\n let b = (3.4175940 + (4.1616724 + y) * y);\n let v = a / b;\n // select 替代 if:2×2 像素四边形上控制流一致,代数与原分支相同。\n let thetaSin = select(0.5 * inverseSqrt(max(1.0 - x * x, 1e-7)) - v, v, x > 0.0);\n return cross(v1, v2) * thetaSin;\n}\n\nfn ltcIsBackface(P: vec3f, p0: vec3f, p1: vec3f, p3: vec3f) -> bool {\n return dot(cross(p1 - p0, p3 - p0), P - p0) < 0.0;\n}\n\n// 单次边积分;spec / diff 只差 mat。\nfn ltcFormFactor(mat: mat3x3f, d0: vec3f, d1: vec3f, d2: vec3f, d3: vec3f) -> f32 {\n let c0 = normalize(mat * d0);\n let c1 = normalize(mat * d1);\n let c2 = normalize(mat * d2);\n let c3 = normalize(mat * d3);\n var ff = ltcEdgeVectorFormFactor(c0, c1);\n ff += ltcEdgeVectorFormFactor(c1, c2);\n ff += ltcEdgeVectorFormFactor(c2, c3);\n ff += ltcEdgeVectorFormFactor(c3, c0);\n return ltcClippedSphereFormFactor(ff);\n}\n\n// 高光+漫反一次求。调用方已丢背面。xy = specFF / diffFF。\nfn ltcEvaluateDual(N: vec3f, V: vec3f, P: vec3f, mInv: mat3x3f, p0: vec3f, p1: vec3f, p2: vec3f, p3: vec3f) -> vec2f {\n var t1u = V - N * dot(V, N);\n if (dot(t1u, t1u) < 1e-8) {\n t1u = select(vec3f(1.0, 0.0, 0.0), vec3f(0.0, 1.0, 0.0), abs(N.x) > 0.5);\n }\n let T1 = normalize(t1u);\n let T2 = -cross(N, T1);\n let basis = transpose(mat3x3f(T1, T2, N));\n let d0 = p0 - P;\n let d1 = p1 - P;\n let d2 = p2 - P;\n let d3 = p3 - P;\n return vec2f(ltcFormFactor(mInv * basis, d0, d1, d2, d3), ltcFormFactor(basis, d0, d1, d2, d3));\n}\n\n\t\t// F0 在 applyLighting 算一次。GGX 高光(与 Three MeshStandard 同形);\n\t\t// D 不含 1/π:漫反射也没除 π,灯强度不必再 ×π。\n\t\tfn shadePunctual(\n\t\t N: vec3f, V: vec3f, L: vec3f, radiance: vec3f,\n\t\t albedo: vec3f, roughness: f32, metal: f32,\n\t\t F0: vec3f,\n\t\t) -> vec3f {\n\t\t let ndl = max(dot(N, L), 0.0);\n\t\t if (ndl <= 0.0) { return vec3f(0.0); }\n\t\t let diffuseCol = albedo * (1.0 - metal);\n\t\t if (roughness >= 0.99) {\n\t\t return diffuseCol * ndl * radiance;\n\t\t }\n\t\t let ndv = max(dot(N, V), 1e-4);\n\t\t let H = normalize(L + V);\n\t\t let ndh = max(dot(N, H), 0.0);\n\t\t let VoH = max(dot(V, H), 0.0);\n\t\t let F = F0 + (vec3f(1.0) - F0) * pow(1.0 - VoH, 5.0);\n\t\t let a = max(roughness * roughness, 0.002);\n\t\t let a2 = a * a;\n\t\t let d = ndh * ndh * (a2 - 1.0) + 1.0;\n\t\t let D = a2 / max(d * d, 1e-7);\n\t\t let k = (roughness + 1.0) * (roughness + 1.0) * 0.125;\n\t\t let G = (ndv / (ndv * (1.0 - k) + k)) * (ndl / (ndl * (1.0 - k) + k));\n\t\t let spec = D * F * G / max(4.0 * ndl * ndv, 1e-4);\n\t\t let diffuse = diffuseCol * ndl * (vec3f(1.0) - F);\n\t\t return (diffuse + spec * ndl) * radiance;\n\t\t}\n\n\t// 默认 decay=2:1/d²,避免 per-light pow。\n\tfn distanceFalloff(dist: f32, decay: f32) -> f32 {\n\t let d = max(dist, 1e-4);\n\t if (decay == 2.0) { return 1.0 / (d * d); }\n\t return 1.0 / pow(d, decay);\n\t}\n\n\tfn punctualAtten(dist: f32, radius: f32, decay: f32) -> f32 {\n\t var att = distanceFalloff(dist, decay);\n\t if (radius > 0.0) {\n\t let x = saturate(max(dist, 1e-4) / radius);\n\t let x2 = x * x;\n\t att *= saturate(1.0 - x2 * x2);\n\t }\n\t return att;\n\t}\n",it="\n\t// 世界格开地址:与 CPU/WASM hash 同一组质数。空槽 count==0;命中后 offs 从 base+4。\n\tfn hashWorldCell(ix: i32, iy: i32, iz: i32) -> u32 {\n\t let h = (u32(ix) * 73856093u) ^ (u32(iy) * 19349663u) ^ (u32(iz) * 83492791u);\n\t return h & clusterParams.hashMask;\n\t}\n\n\t// 只查本格,禁止读邻格(像素成本 ×8~27 会卡)。格边缝靠 CPU 全局能量序先到先得消掉。\n\tfn worldClusterBase(P: vec3f) -> u32 {\n\t let s = clusterParams.cellSize;\n\t if (s <= 0.0 || clusterParams.stride < 5u) { return 0xffffffffu; }\n\t let c = vec3i(floor(P / s));\n\t let mask = clusterParams.hashMask;\n\t let stride = clusterParams.stride;\n\t var h = hashWorldCell(c.x, c.y, c.z);\n\t for (var i = 0u; i < 64u; i++) {\n\t let base = h * stride;\n\t let cnt = clusterCells[base + 3u];\n\t if (cnt == 0u) { return 0xffffffffu; }\n\t if (bitcast<i32>(clusterCells[base]) == c.x\n\t && bitcast<i32>(clusterCells[base + 1u]) == c.y\n\t && bitcast<i32>(clusterCells[base + 2u]) == c.z) {\n\t return base;\n\t }\n\t h = (h + 1u) & mask;\n\t }\n\t return 0xffffffffu;\n\t}\n\n\t\tfn shadowCompare(uv: vec2f, z: f32) -> f32 {\n\t\t // Cluster 的 cell 判断对像素非均匀;Compare 要导数、必须均匀 CF。Level 锁 mip0,允许非均匀。\n\t\t return textureSampleCompareLevel(shadowAtlas, shadowSampler, uv, z);\n\t\t}\n\n\t\tfn shadowTileInv() -> f32 {\n\t\t return 1.0 / max(shadowTable.biasPad.w, 1.0);\n\t\t}\n\n\t\tfn shadowTileOrigin(row: u32) -> vec2f {\n\t\t let g = max(u32(shadowTable.biasPad.w + 0.5), 1u);\n\t\t let inv = 1.0 / f32(g);\n\t\t return vec2f(f32(row % g), f32(row / g)) * inv;\n\t\t}\n\n\t\tfn shadowAtlasUv(row: u32, ndcXy: vec2f) -> vec2f {\n\t\t var uv = ndcXy * vec2f(0.5, -0.5) + vec2f(0.5);\n\t\t let pad = shadowTable.biasPad.y * 8.0;\n\t\t uv = clamp(uv, vec2f(pad), vec2f(1.0 - pad));\n\t\t let inv = shadowTileInv();\n\t\t return uv * inv + shadowTileOrigin(row);\n\t\t}\n\n\t\tfn shadowFade(ndc: vec3f, flags: u32) -> f32 {\n\t\t let ndcEdge = max(abs(ndc.x), abs(ndc.y));\n\t\t let inZ = ndc.z >= 0.0 && ndc.z <= 1.0;\n\t\t let fade = 1.0 - smoothstep(0.92, 1.0, ndcEdge);\n\t\t let on = (flags & 1u) != 0u && inZ;\n\t\t return select(0.0, fade, on);\n\t\t}\n\n\t\tfn shadowAtlasUvFace(row: u32, face: u32, ndcXy: vec2f) -> vec2f {\n\t\t var uv = ndcXy * vec2f(0.5, -0.5) + vec2f(0.5);\n\t\t let pad = shadowTable.biasPad.y * 8.0;\n\t\t uv = clamp(uv, vec2f(pad), vec2f(1.0 - pad));\n\t\t let fu = (f32(face % 3u) + uv.x) / 3.0;\n\t\t let fv = (f32(face / 3u) + uv.y) / 2.0;\n\t\t let inv = shadowTileInv();\n\t\t return vec2f(fu, fv) * inv + shadowTileOrigin(row);\n\t\t}\n\n\t\tfn cubemapFace(d: vec3f) -> u32 {\n\t\t let a = abs(d);\n\t\t if (a.x >= a.y && a.x >= a.z) { return select(1u, 0u, d.x >= 0.0); }\n\t\t if (a.y >= a.z) { return select(3u, 2u, d.y >= 0.0); }\n\t\t return select(5u, 4u, d.z >= 0.0);\n\t\t}\n\n\t\tfn shadowPcf(uv: vec2f, z: f32) -> f32 {\n\t\t let texel = shadowTable.biasPad.y;\n\t\t var s = shadowCompare(uv, z);\n\t\t s += shadowCompare(uv + vec2f(texel, 0.0), z);\n\t\t s += shadowCompare(uv + vec2f(-texel, 0.0), z);\n\t\t s += shadowCompare(uv + vec2f(0.0, texel), z);\n\t\t s += shadowCompare(uv + vec2f(0.0, -texel), z);\n\t\t return s * 0.2;\n\t\t}\n\n\t\t// Dir 可选 3×3(flags bit2);步长 2 texel。\n\t\tfn shadowPcf3(uv: vec2f, z: f32) -> f32 {\n\t\t let t = shadowTable.biasPad.y * 2;\n\t\t var s = 0.0;\n\t\t s += shadowCompare(uv + vec2f(-t, -t), z);\n\t\t s += shadowCompare(uv + vec2f(0.0, -t), z);\n\t\t s += shadowCompare(uv + vec2f(t, -t), z);\n\t\t s += shadowCompare(uv + vec2f(-t, 0.0), z);\n\t\t s += shadowCompare(uv, z);\n\t\t s += shadowCompare(uv + vec2f(t, 0.0), z);\n\t\t s += shadowCompare(uv + vec2f(-t, t), z);\n\t\t s += shadowCompare(uv + vec2f(0.0, t), z);\n\t\t s += shadowCompare(uv + vec2f(t, t), z);\n\t\t return s * 0.11111111;\n\t\t}\n\n\t\tfn shadowReceiver(P: vec3f, N: vec3f) -> vec3f {\n\t\t return P + N * shadowTable.biasPad.z;\n\t\t}\n\n\t\tfn sampleCubeShadow(flags: u32, off: u32, P: vec3f, N: vec3f) -> f32 {\n\t\t let row = (flags >> 8u) & 255u;\n\t\t let Pb = shadowReceiver(P, N);\n\t\t let Lp = lightWorldPos(u32(lights[off].x));\n\t\t let d = Pb - Lp;\n\t\t if (dot(d, d) < 1e-10) { return 1.0; }\n\t\t let face = cubemapFace(d);\n\t\t let h = shadowTable.cubeVP[row * 6u + face] * vec4f(Pb, 1.0);\n\t\t let ndc = h.xyz / max(h.w, 1e-6);\n\t\t let uv = shadowAtlasUvFace(row, face, ndc.xy);\n\t\t let z = ndc.z + shadowTable.biasPad.x;\n\t\t let inZ = ndc.z >= 0.0 && ndc.z <= 1.0;\n\t\t let on = (flags & 1u) != 0u && inZ;\n\t\t return mix(1.0, shadowPcf(uv, z), select(0.0, 1.0, on));\n\t\t}\n\n\t\tfn shadowNearCompare(uv: vec2f, z: f32) -> f32 {\n\t\t return textureSampleCompareLevel(shadowNear, shadowSampler, uv, z);\n\t\t}\n\n\t\tfn shadowNearPcf(uv: vec2f, z: f32) -> f32 {\n\t\t let texel = 1.0 / 2048.0;\n\t\t var s = shadowNearCompare(uv, z);\n\t\t s += shadowNearCompare(uv + vec2f(texel, 0.0), z);\n\t\t s += shadowNearCompare(uv + vec2f(-texel, 0.0), z);\n\t\t s += shadowNearCompare(uv + vec2f(0.0, texel), z);\n\t\t s += shadowNearCompare(uv + vec2f(0.0, -texel), z);\n\t\t return s * 0.2;\n\t\t}\n\n\t\tfn shadowNearPcf3(uv: vec2f, z: f32) -> f32 {\n\t\t let t = 2.0 / 2048.0;\n\t\t var s = 0.0;\n\t\t s += shadowNearCompare(uv + vec2f(-t, -t), z);\n\t\t s += shadowNearCompare(uv + vec2f(0.0, -t), z);\n\t\t s += shadowNearCompare(uv + vec2f(t, -t), z);\n\t\t s += shadowNearCompare(uv + vec2f(-t, 0.0), z);\n\t\t s += shadowNearCompare(uv, z);\n\t\t s += shadowNearCompare(uv + vec2f(t, 0.0), z);\n\t\t s += shadowNearCompare(uv + vec2f(-t, t), z);\n\t\t s += shadowNearCompare(uv + vec2f(0.0, t), z);\n\t\t s += shadowNearCompare(uv + vec2f(t, t), z);\n\t\t return s * 0.11111111;\n\t\t}\n\n\t\tfn shadowNearTap(ndc: vec3f, pcf3: bool, bias: f32) -> f32 {\n\t\t var uv = ndc.xy * vec2f(0.5, -0.5) + vec2f(0.5);\n\t\t let pad = 8.0 / 2048.0;\n\t\t uv = clamp(uv, vec2f(pad), vec2f(1.0 - pad));\n\t\t let z = ndc.z + bias;\n\t\t if (pcf3) {\n\t\t return shadowNearPcf3(uv, z);\n\t\t }\n\t\t return shadowNearPcf(uv, z);\n\t\t}\n\n\t\tfn sampleShadowTap(flags: u32, P: vec3f, N: vec3f) -> f32 {\n\t\t let row = (flags >> 8u) & 255u;\n\t\t let Pb = shadowReceiver(P, N);\n\t\t let baseVp = shadowTable.cubeVP[row * 6u];\n\t\t let h = baseVp * vec4f(Pb, 1.0);\n\t\t let ndc = h.xyz / max(h.w, 1e-6);\n\t\t let fade = shadowFade(ndc, flags);\n\t\t let pcf3 = (flags & 4u) != 0u;\n\t\t let baseBias = shadowTable.tileBias[row].x;\n\t\t let nearBlendStart = 0.96875; // 离边缘 32 个 2048-map texel。\n\t\t var nearNdc = vec3f(2.0);\n\t\t var nearEdge = 2.0;\n\t\t var nearBias = 0.0;\n\t\t var nearValid = false;\n\t\t if ((flags & 8u) != 0u) {\n\t\t let nearVp = shadowTable.cubeVP[row * 6u + 1u];\n\t\t let nh = nearVp * vec4f(Pb, 1.0);\n\t\t nearNdc = nh.xyz / max(nh.w, 1e-6);\n\t\t nearEdge = max(abs(nearNdc.x), abs(nearNdc.y));\n\t\t nearBias = shadowTable.tileBias[row].y;\n\t\t nearValid = nearNdc.z >= 0.0 && nearNdc.z <= 1.0 && nearEdge < 1.0;\n\t\t if (nearValid && nearEdge <= nearBlendStart) {\n\t\t return mix(1.0, shadowNearTap(nearNdc, pcf3, nearBias), fade);\n\t\t }\n\t\t }\n\t\t let uv = shadowAtlasUv(row, ndc.xy);\n\t\t let z = ndc.z + baseBias;\n\t\t // 禁止 select(pcf, pcf3):两核都会求值。flags 对本灯全像素均匀。\n\t\t var s: f32;\n\t\t if (pcf3) {\n\t\t s = shadowPcf3(uv, z);\n\t\t } else {\n\t\t s = shadowPcf(uv, z);\n\t\t }\n\t\t if (nearValid) {\n\t\t let w = 1.0 - smoothstep(nearBlendStart, 1.0, nearEdge);\n\t\t s = mix(s, shadowNearTap(nearNdc, pcf3, nearBias), w);\n\t\t }\n\t\t return mix(1.0, s, fade);\n\t\t}\n\n\t\tfn sampleShadowTap1(flags: u32, P: vec3f, N: vec3f) -> f32 {\n\t\t let row = (flags >> 8u) & 255u;\n\t\t let Pb = shadowReceiver(P, N);\n\t\t let h = shadowTable.cubeVP[row * 6u] * vec4f(Pb, 1.0);\n\t\t let ndc = h.xyz / max(h.w, 1e-6);\n\t\t let uv = shadowAtlasUv(row, ndc.xy);\n\t\t let z = ndc.z + shadowTable.biasPad.x;\n\t\t return mix(1.0, shadowCompare(uv, z), shadowFade(ndc, flags));\n\t\t}\n\n\t\tfn sampleShadow(off: u32, P: vec3f, N: vec3f) -> f32 {\n\t\t let flags = u32(lights[off].z);\n\t\t if ((flags & 1u) == 0u) { return 1.0; }\n\t\t if ((flags & 2u) != 0u) { return sampleCubeShadow(flags, off, P, N); }\n\t\t return sampleShadowTap(flags, P, N);\n\t\t}\n\n\t\tfn sampleShadowLocal(off: u32, P: vec3f, N: vec3f) -> f32 {\n\t\t let flags = u32(lights[off].z);\n\t\t if ((flags & 1u) == 0u) { return 1.0; }\n\t\t if ((flags & 2u) != 0u) { return sampleCubeShadow(flags, off, P, N); }\n\t\t return sampleShadowTap1(flags, P, N);\n\t\t}\n\n\t\tfn applyIbl(\n\t\t N: vec3f, V: vec3f,\n\t\t albedo: vec3f, roughness: f32, metal: f32, F0: vec3f,\n\t\t) -> vec3f {\n\t\t let intensity = sceneParams.iblIntensity;\n\t\t if (intensity <= 0.0) { return vec3f(0.0); }\n\t\t let nv = max(dot(N, V), 0.0);\n\t\t let R = reflect(-V, N);\n\t\t let irr = textureSampleLevel(envIrradiance, envSampler, N, 0.0).rgb;\n\t\t let lod = roughness * roughness * sceneParams.iblMaxLod;\n\t\t let rad = textureSampleLevel(envRadiance, envSampler, R, lod).rgb;\n\t\t let brdf = textureSampleLevel(envBrdfLut, envSampler, vec2f(nv, roughness), 0.0).rg;\n\t\t var specEnv = rad;\n\t\t if (sceneParams.iblMaxLod < 0.5) {\n\t\t specEnv = mix(rad, irr, roughness * roughness);\n\t\t }\n\t\t let diffuse = irr * albedo * (1.0 - metal);\n\t\t let spec = specEnv * (F0 * brdf.x + brdf.y);\n\t\t return (diffuse + spec) * intensity;\n\t\t}\n\n\t\tfn shadeLocalAt(\n\t\t P: vec3f, N: vec3f, V: vec3f,\n\t\t off: u32,\n\t\t albedo: vec3f, roughness: f32, metal: f32,\n\t\t F0: vec3f,\n\t\t) -> vec3f {\n\t\t var local = shadeLightAt(P, N, V, off, albedo, roughness, metal, F0);\n\t\t // Rect 等不投影:flags bit0=0,跳过 PCF / cube 阴影。\n\t\t if ((u32(lights[off].z) & 1u) != 0u) {\n\t\t local *= sampleShadowLocal(off, P, N);\n\t\t }\n\t\t return local;\n\t\t}\n\n\t\t// 与 Light.LOCAL_DIRECT_MAX=32 同步。i 是循环下标、像素间均匀:if 只读一槽。\n\t\tfn localDirectOff(i: u32) -> u32 {\n\t\t let k = i & 3u;\n\t\t let bank = i >> 2u;\n\t\t if (bank == 0u) { return lightHeader.localSlots0[k]; }\n\t\t if (bank == 1u) { return lightHeader.localSlots1[k]; }\n\t\t if (bank == 2u) { return lightHeader.localSlots2[k]; }\n\t\t if (bank == 3u) { return lightHeader.localSlots3[k]; }\n\t\t if (bank == 4u) { return lightHeader.localSlots4[k]; }\n\t\t if (bank == 5u) { return lightHeader.localSlots5[k]; }\n\t\t if (bank == 6u) { return lightHeader.localSlots6[k]; }\n\t\t return lightHeader.localSlots7[k];\n\t\t}\n\n\t\tfn shadeSceneLights(\n\t\t P: vec3f, N: vec3f, V: vec3f,\n\t\t albedo: vec3f, roughness: f32, metal: f32, F0: vec3f,\n\t\t) -> vec3f {\n\t\t var rgb = albedo * lightHeader.ambient;\n\t\t let hemiSlot = lightHeader.hemiSlot;\n\t\t if (hemiSlot != LIGHT_NONE) {\n\t\t rgb += shadeLightAt(P, N, V, hemiSlot, albedo, roughness, metal, F0);\n\t\t }\n\t\t let dirCount = min(lightHeader.dirCount, 4u);\n\t\t for (var i = 0u; i < dirCount; i++) {\n\t\t let off = lightHeader.dirSlots[i];\n\t\t rgb += shadeLightAt(P, N, V, off, albedo, roughness, metal, F0) * sampleShadow(off, P, N);\n\t\t }\n\t\t let unbCount = min(lightHeader.unboundedCount, 4u);\n\t\t for (var i = 0u; i < unbCount; i++) {\n\t\t let off = lightHeader.unbSlots[i];\n\t\t rgb += shadeLocalAt(P, N, V, off, albedo, roughness, metal, F0);\n\t\t }\n\t\t let nLocal = lightHeader.localCount;\n\t\t if (nLocal > 0u && nLocal <= 32u) {\n\t\t for (var i = 0u; i < nLocal; i++) {\n\t\t rgb += shadeLocalAt(P, N, V, localDirectOff(i), albedo, roughness, metal, F0);\n\t\t }\n\t\t } else if (nLocal > 0u) {\n\t\t let base = worldClusterBase(P);\n\t\t if (base != 0xffffffffu) {\n\t\t let maxPer = clusterParams.maxPerCell;\n\t\t let cnt = min(clusterCells[base + 3u], maxPer);\n\t\t for (var i = 0u; i < cnt; i++) {\n\t\t let off = clusterCells[base + 4u + i];\n\t\t rgb += shadeLocalAt(P, N, V, off, albedo, roughness, metal, F0);\n\t\t }\n\t\t }\n\t\t }\n\t\t return rgb;\n\t\t}\n\n\t\tfn applySceneFog(rgbIn: vec3f, P: vec3f) -> vec3f {\n\t\t if (sceneParams.fogEnabled > 0.5) {\n\t\t let d = distance(P, camera.cameraPosition);\n\t\t var fogT: f32;\n\t\t if (sceneParams.fogMode > 0.5) {\n\t\t let dd = sceneParams.fogDensity * d;\n\t\t fogT = 1.0 - exp(-dd * dd);\n\t\t } else {\n\t\t fogT = saturate((d - sceneParams.fogNear) / max(sceneParams.fogFar - sceneParams.fogNear, 1e-4));\n\t\t }\n\t\t return mix(rgbIn, sceneParams.fogColor, fogT);\n\t\t }\n\t\t return rgbIn;\n\t\t}\n\n\t\tfn applyLighting(\n\t\t P: vec3f, N: vec3f, V: vec3f,\n\t\t albedo: vec3f, roughness: f32, metal: f32,\n\t\t clipPos: vec4f,\n\t\t) -> vec3f {\n\t\t return applyLightingBaked(P, N, V, albedo, roughness, metal, clipPos, vec3f(0.0));\n\t\t}\n\n\t\tfn applyLightingBaked(\n\t\t P: vec3f, N: vec3f, V: vec3f,\n\t\t albedo: vec3f, roughness: f32, metal: f32,\n\t\t clipPos: vec4f,\n\t\t bakedIrradiance: vec3f,\n\t\t) -> vec3f {\n\t\t let F0 = mix(vec3f(0.04), albedo, metal);\n\t\t var rgb = shadeSceneLights(P, N, V, albedo, roughness, metal, F0);\n\t\t rgb += applyIbl(N, V, albedo, roughness, metal, F0);\n\t\t rgb += bakedIrradiance * albedo * (1.0 - metal);\n\t\t return applySceneFog(rgb, P);\n\t\t}\n";function st(A){return A.includes("applyToonTexFamily(")?"family":/\bapplyToonTex\(/.test(A)?"tex":/\bapplyToon\(/.test(A)?"analytic":null}LA++,GA=-1;const nt=new WeakMap;class rt{isSampler=!0;depObjects=new Set;#f=q.ClampToEdge;#m=q.ClampToEdge;#C=q.ClampToEdge;#w=X.Linear;#y=X.Linear;#B=X.Linear;#I=1;#Q;#E;#x;#D;#M=!1;#b=null;gpuSampler=null;#S=null;wgslType="sampler";constructor(A={}){this.setValues(A,!1)}get wrapS(){return this.#f}set wrapS(A){this.#v("wrapS",A)}get wrapT(){return this.#m}set wrapT(A){this.#v("wrapT",A)}get wrapR(){return this.#C}set wrapR(A){this.#v("wrapR",A)}get magFilter(){return this.#w}set magFilter(A){this.#v("magFilter",A)}get minFilter(){return this.#y}set minFilter(A){this.#v("minFilter",A)}get mipmapFilter(){return this.#B}set mipmapFilter(A){this.#v("mipmapFilter",A)}get maxAnisotropy(){return this.#I}set maxAnisotropy(A){this.#v("maxAnisotropy",A)}get compareFunction(){return this.#Q}set compareFunction(A){this.#v("compareFunction",A)}get lodMinClamp(){return this.#E}set lodMinClamp(A){this.#v("lodMinClamp",A)}get lodMaxClamp(){return this.#x}set lodMaxClamp(A){this.#v("lodMaxClamp",A)}get bindingType(){return this.#D}set bindingType(A){this.#v("bindingType",A)}#v(A,t){switch(A){case"wrapS":if(this.#f===t)return;this.#f=t;break;case"wrapT":if(this.#m===t)return;this.#m=t;break;case"wrapR":if(this.#C===t)return;this.#C=t;break;case"magFilter":if(this.#w===t)return;this.#w=t;break;case"minFilter":if(this.#y===t)return;this.#y=t;break;case"mipmapFilter":if(this.#B===t)return;this.#B=t;break;case"maxAnisotropy":if(this.#I===t)return;this.#I=t;break;case"compareFunction":if(this.#Q===t)return;this.#Q=t;break;case"lodMinClamp":if(this.#E===t)return;this.#E=t;break;case"lodMaxClamp":if(this.#x===t)return;this.#x=t;break;case"bindingType":if(this.#D===t)return;this.#D=t}this.gpuSampler=null,this.#S=null,this.#b=null,this.#M||this.onChangeCallback()}setBindingType(A,t=!0){return A===this.#D||(this.#D=A,this.gpuSampler=null,this.#S=null,this.#b=null,t&&this.onChangeCallback()),this}setValues(A={},t=!0){const e=void 0!==A.compareFunction?A.compareFunction??void 0:this.compareFunction,i=null!=A.wrapS&&A.wrapS!==this.wrapS||null!=A.wrapT&&A.wrapT!==this.wrapT||null!=A.wrapR&&A.wrapR!==this.wrapR||null!=A.magFilter&&A.magFilter!==this.magFilter||null!=A.minFilter&&A.minFilter!==this.minFilter||null!=A.mipmapFilter&&A.mipmapFilter!==this.mipmapFilter||null!=A.maxAnisotropy&&A.maxAnisotropy!==this.maxAnisotropy||e!==this.compareFunction||null!=A.lodMinClamp&&A.lodMinClamp!==this.lodMinClamp||null!=A.lodMaxClamp&&A.lodMaxClamp!==this.lodMaxClamp||null!=A.bindingType&&A.bindingType!==this.bindingType;return this.#M=!0,this.wrapS=A.wrapS??this.wrapS,this.wrapT=A.wrapT??this.wrapT,this.wrapR=A.wrapR??this.wrapR,this.magFilter=A.magFilter??this.magFilter,this.minFilter=A.minFilter??this.minFilter,this.mipmapFilter=A.mipmapFilter??this.mipmapFilter,this.maxAnisotropy=A.maxAnisotropy??this.maxAnisotropy,this.compareFunction=e,this.lodMinClamp=A.lodMinClamp??this.lodMinClamp,this.lodMaxClamp=A.lodMaxClamp??this.lodMaxClamp,this.bindingType=A.bindingType??this.bindingType,this.#M=!1,i&&(this.gpuSampler=null,this.#S=null,t&&this.onChangeCallback()),this}get layoutType(){if(null!=this.compareFunction)return mA.Comparison;if(this.bindingType===mA.Comparison)throw new Error("comparison sampler requires compareFunction");return null!=this.bindingType?this.bindingType:this.magFilter===X.Linear||this.minFilter===X.Linear||this.mipmapFilter===X.Linear||this.maxAnisotropy>1?mA.Filtering:mA.NonFiltering}getDescriptor(){const A=this.layoutType===mA.NonFiltering,t=A?X.Nearest:this.magFilter,e=A?X.Nearest:this.minFilter,i=A?X.Nearest:this.mipmapFilter,s=t===X.Linear&&e===X.Linear&&i===X.Linear;return{addressModeU:this.wrapS,addressModeV:this.wrapT,addressModeW:this.wrapR,magFilter:t,minFilter:e,mipmapFilter:i,lodMinClamp:this.lodMinClamp,lodMaxClamp:this.lodMaxClamp,compare:this.compareFunction,maxAnisotropy:s?Math.min(16,Math.max(1,Math.floor(this.maxAnisotropy))):1}}assertCompatibleWithSampleType(A){if((A===CA.SInt||A===CA.UInt||A===CA.UnfilterableFloat)&&this.layoutType===mA.Filtering)throw new Error(`Sampler layout "filtering" is incompatible with texture sampleType "${A}"; use non-filtering (nearest) sampler`)}generateLayout(){const A=this.layoutType;return this.wgslType=A===mA.Comparison?"sampler_comparison":"sampler",{type:A}}getDescriptorKey(){const A=this.#b;if(null!=A)return A;const t=this.getDescriptor(),e=[t.addressModeU,t.addressModeV,t.addressModeW,t.magFilter,t.minFilter,t.mipmapFilter,t.lodMinClamp??0,t.lodMaxClamp??32,t.compare??"",t.maxAnisotropy??1,this.layoutType].join("|");return this.#b=e,e}createSampler(A){if(this.gpuSampler&&this.#S===A)return this.gpuSampler;const t=this.getDescriptorKey();let e=nt.get(A);e||(e=new Map,nt.set(A,e));let i=e.get(t);return i||(i=A.createSampler(this.getDescriptor()),e.set(t,i)),this.#S=A,this.gpuSampler=i}onChangeCallback(A=f.DIRTY_STRUCTURE){const t=this.depObjects;for(const e of t){const i=e.deref();null!=i?i.onChangeCallback?.(A):t.delete(e)}}}let at=0;function ot(A){return null!=A&&"[object Object]"===Object.prototype.toString.call(A)}class lt{id=++at;isSource=!0;dataReady=!0;version=0;data;#T;#U;#N;constructor(A=null){this.data=A}replaceData(A){this.#T=void 0,this.#U=void 0,this.#N=void 0,this.data=A}get width(){return null!=this.#T?this.#T:null==(A=Array.isArray(this.data)?this.data[0]:this.data)?0:A.naturalWidth||A.videoWidth||A.displayWidth||A.width||0;var A}set width(A){this.#T=A,null==this.data?this.data={width:A}:ot(this.data)&&(this.data.width=A)}get height(){return null!=this.#U?this.#U:null==(A=Array.isArray(this.data)?this.data[0]:this.data)?0:A.naturalHeight||A.videoHeight||A.displayHeight||A.height||0;var A}set height(A){this.#U=A,null==this.data?this.data={height:A}:ot(this.data)&&(this.data.height=A)}get depth(){return null!=this.#N?this.#N:Array.isArray(this.data)?this.data.length:this.data?.depth??1}set depth(A){this.#N=A,null==this.data?this.data={depth:A}:ot(this.data)&&(this.data.depth=A)}setSize(A,t,e=1){if(this.#T=A,this.#U=t,this.#N=e,null==this.data||ot(this.data)){const i=this.data??={};i.width=A,i.height=t,i.depth=e}return this}getSize(A){const t=this.data;return null==A?null==t?[0,0,0]:[this.width,this.height,this.depth]:null==t?A.set(0,0,0):A.set(this.width,this.height,this.depth)}}function ct(A){if(null==A)return!1;if(Array.isArray(A))return A.length>0&&A.every(ct);if(ArrayBuffer.isView(A)||null!=A.data)return!1;const t=Object.prototype.toString.call(A);return"[object ImageBitmap]"===t||"[object HTMLCanvasElement]"===t||"[object OffscreenCanvas]"===t||"[object HTMLImageElement]"===t||"[object HTMLVideoElement]"===t||"[object VideoFrame]"===t||"function"==typeof A.getContext||"number"==typeof A.naturalWidth||"number"==typeof A.videoWidth||"number"==typeof A.displayWidth&&"function"==typeof A.close}function ht(A,t,e,i,s,n,r=0){if(0===(t.usage&GPUTextureUsage.COPY_DST))throw new Error("Typed texture upload requires GPUTextureUsage.COPY_DST");const a=t.sampleConfig,o=a.block??{byteLength:a.byte,width:1,height:1},l=Math.ceil(n.width/o.width),c=Math.ceil((n.height??1)/o.height),h=l*o.byteLength,u=h*c*(n.depthOrArrayLayers??1);if(i.byteLength<u)throw new RangeError(`Texture mip ${s} data is too small: ${i.byteLength} < ${u} bytes`);A.queue.writeTexture({texture:e,mipLevel:s,origin:{x:0,y:0,z:r}},i,{bytesPerRow:h,rowsPerImage:c},n)}function ut(A,t,e,i,s){A.queue.copyExternalImageToTexture({source:i,flipY:t.flipY},{texture:e,origin:{x:0,y:0,z:s},premultipliedAlpha:t.premultiplyAlpha,colorSpace:"srgb"},{width:t.width,height:t.height,depthOrArrayLayers:1})}var gt=(A=>(A[A.UVMapping=300]="UVMapping",A[A.CubeReflectionMapping=301]="CubeReflectionMapping",A[A.CubeRefractionMapping=302]="CubeRefractionMapping",A[A.EquirectangularReflectionMapping=303]="EquirectangularReflectionMapping",A[A.EquirectangularRefractionMapping=304]="EquirectangularRefractionMapping",A[A.CubeUVReflectionMapping=305]="CubeUVReflectionMapping",A))(gt||{});let dt=0;class pt{id=++dt;isTexture=!0;name=`Texture-${this.id}`;sampler;ownsSampler;depObjects=new Set;texture=null;#S=null;externalTexture=null;view=null;dimension=xA.TwoD;formatType=wA.RGBAFormat;format;usage=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC;levels=1;sampleCount=1;dataType=yA.UnNormByteType;textureWgslType="texture_2d<f32>";viewDimension="2d";channel=0;mapping=300;offset=new w(0,0);repeat=new w(1,1);center=new w(0,0);rotation=0;matrixAutoUpdate=!0;matrix=new Q;useMipmaps=!0;generateMipmaps=!0;#P=null;flipY=!0;colorSpace=bA.NoColorSpace;source;mipmaps=[];premultiplyAlpha=!1;isCube=!1;isArray=!1;isExternalTexture=!1;isStorageTexture=!1;isDepthTexture=!1;isCompressedTexture=!1;viewFormats;sampleConfig=null;resolveTargetTexture=null;viewParams={};requestedFormat;configurationReady=!1;isDirty=!0;constructor(A=null,t={}){this.ownsSampler=null==t.sampler,this.sampler=t.sampler??new rt({...t,bindingType:t.bindingType??mt(t)}),this.source=new lt(A),this.setValues(t)}setValues(A={}){const t=null!=A.formatType&&A.formatType!==this.formatType||null!=A.format&&A.format!==this.requestedFormat||null!=A.dataType&&A.dataType!==this.dataType||null!=A.colorSpace&&A.colorSpace!==this.colorSpace||null!=A.useMipmaps&&A.useMipmaps!==this.useMipmaps||null!=A.generateMipmaps&&A.generateMipmaps!==this.generateMipmaps||null!=A.sampleCount&&(A.sampleCount>1?4:1)!==this.sampleCount||null!=A.levels&&A.levels!==this.#P||null!=A.usage&&A.usage!==this.usage||null!=A.viewFormats&&A.viewFormats!==this.viewFormats||null!=A.isCube&&A.isCube!==this.isCube,e=null!=A.viewParams&&A.viewParams!==this.viewParams,i=null!=A.flipY&&A.flipY!==this.flipY||null!=A.premultiplyAlpha&&A.premultiplyAlpha!==this.premultiplyAlpha;return this.mapping=A.mapping??this.mapping,this.channel=A.channel??this.channel,null==A.sampler&&this.sampler.setValues(A),this.flipY=A.flipY??this.flipY,this.premultiplyAlpha=A.premultiplyAlpha??this.premultiplyAlpha,this.useMipmaps=A.useMipmaps??this.useMipmaps,this.generateMipmaps=A.generateMipmaps??this.generateMipmaps,this.colorSpace=A.colorSpace??this.colorSpace,this.formatType=A.formatType??this.formatType,this.dataType=A.dataType??this.dataType,this.sampleCount=(A.sampleCount??this.sampleCount)>1?4:1,null!=A.levels&&(this.#P=A.levels),this.levels=A.levels??this.levels,this.usage=A.usage??this.usage,this.viewFormats=A.viewFormats??this.viewFormats,this.viewParams=A.viewParams??this.viewParams,null!=A.isCube&&(this.isCube=A.isCube),null!=A.format?this.requestedFormat=A.format:null==A.formatType&&null==A.dataType||(this.requestedFormat=void 0),!this.ownsSampler||null==A.format&&null==A.formatType&&null==A.dataType||this.sampler.setBindingType(mt({format:this.requestedFormat,formatType:this.formatType,dataType:this.dataType}),!1),t?(this.sampleConfig=null,this.configurationReady=!1,this.destroyTexture()):e&&this.destroyView(),(t||e)&&this.onChangeCallback(f.DIRTY_STRUCTURE),i&&!t&&this.invalidateContent(),this}get image(){return this.source.data}set image(A){const t=this.source;if(t.data===A)return;const e=t.width,i=t.height,s=t.depth||1;t.replaceData(A);const n=t.depth||1;this.isExternalTexture||e!==t.width||i!==t.height||s!==n?this.invalidateTextureResource():this.invalidateContent()}get width(){return this.source.width}set width(A){this.source.width!==A&&(this.source.width=A,this.invalidateTextureResource())}get height(){return this.source.height}set height(A){this.source.height!==A&&(this.source.height=A,this.invalidateTextureResource())}get depth(){return this.source.depth||1}set depth(A){this.source.depth!==A&&(this.source.depth=A,this.invalidateTextureResource())}setSize(A=1,t=1,e=1){return this.width===A&&this.height===t&&this.depth===e||(this.source.setSize(A,t,e),this.invalidateTextureResource()),this}applyUsageRender(){const A=this.usage|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING;return A===this.usage||(this.usage=A,this.invalidateTextureResource()),this}setUsage(A){return this.usage===A||(this.usage=A,this.invalidateTextureResource()),this}getEffectiveSampleType(A){this.prepareConfiguration();const t=this.sampleConfig;let e=t.sampleType;return e!==CA.Float||t.filterable||A?.device?.features.has("float32-filterable")||(e=CA.UnfilterableFloat),this.isDepthTexture&&A?.compatibilityMode&&(e=CA.UnfilterableFloat),e}assertCompatibleSampler(A,t){A.assertCompatibleWithSampleType(this.getEffectiveSampleType(t))}get mipLevelCount(){if(this.sampleCount>1)return 1;if(!this.useMipmaps)return this.levels;const A=this.getMaximumMipLevelCount(),t=this.#P;return null==t?A:Math.min(Math.max(1,t),A)}getMaximumMipLevelCount(){let A=this.width;return this.dimension!==xA.OneD&&(A=Math.max(A,this.height)),this.dimension===xA.ThreeD&&(A=Math.max(A,this.depth)),Math.floor(Math.log2(A))+1}prepareConfiguration(){if(this.configurationReady)return this;const A=null==this.requestedFormat?void 0:EA[this.requestedFormat],t=this.isCompressedTexture?QA[this.formatType]:BA[this.formatType]?.[this.dataType],e=A??t;if(null==e)throw new Error(`Unsupported texture format configuration: format=${this.format}, formatType=${this.formatType}, dataType=${this.dataType}`);let i=e;if(this.colorSpace===bA.SRGBColorSpace&&null==this.requestedFormat&&i.srgbFormat){const A=EA[i.srgbFormat];A&&(i=A)}this.sampleConfig=i,this.format=i.format,this.formatType=i.index,this.dataType=i.index2;const s=this.dimension,n=this.image;if(null==n&&!this.isExternalTexture)throw new Error("Texture source must define width and height before GPU resource creation");const r=this.source.width||0,a=this.source.height||0,o=this.source.depth??1,l=this.isCube;s!==xA.OneD&&s!==xA.ThreeD||(this.sampleCount=1);const c=this.mipLevelCount;if(!this.isExternalTexture&&(r<1||a<1||o<1))throw new Error(`Texture extent must be positive, received ${r}x${a}x${o}`);if(l&&o%6!=0)throw new Error(`Cube texture layer count must be a multiple of 6, received ${o}`);if(l&&r!==a)throw new Error(`Cube texture width and height must match, received ${r}x${a}`);if(l&&!this.isArray&&6!==o)throw new Error(`Non-array cube texture must have exactly 6 layers, received ${this.depth}`);if(this.isStorageTexture&&l)throw new Error("Storage texture views cannot use cube or cube-array dimensions");if(s===xA.OneD){if(1!==a||1!==o)throw new Error("1D textures require height=1, depth=1");if(this.isCompressedTexture||this.isDepthTexture)throw new Error("1D textures cannot use compressed or depth/stencil formats")}if(s===xA.ThreeD&&(this.isCompressedTexture||this.isDepthTexture))throw new Error("3D textures cannot use compressed or depth/stencil formats");if(this.sampleCount>1){if(s!==xA.TwoD||1!==o||1!==c||this.isStorageTexture)throw new Error("Multisampled textures require dimension=2d, depth=1, mipLevelCount=1 and no STORAGE_BINDING");this.usage|=GPUTextureUsage.RENDER_ATTACHMENT}const h=i.block;if(null!=h&&(h.width>1||h.height>1)&&(r%h.width!==0||a%h.height!==0))throw new Error(`Compressed texture size ${r}x${a} must be a multiple of texel block ${h.width}x${h.height}`);const u=this.getMaximumMipLevelCount();if(!Number.isInteger(c)||c<1||c>u)throw new Error(`Invalid mipLevelCount ${c}; expected an integer in [1, ${u}]`);if(this.generateMipmaps&&c>1&&0===this.mipmaps.length){if(s!==xA.TwoD||this.isCompressedTexture||this.isDepthTexture||this.isStorageTexture||i.sampleType!==CA.Float||!i.filterable)throw new Error(`Automatic mipmap generation is unsupported for ${this.format} ${s}; provide explicit mipmaps or set generateMipmaps/useMipmaps to false`);this.usage|=GPUTextureUsage.RENDER_ATTACHMENT}if(ct(n)&&(this.usage|=GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT),0!==(this.usage&GPUTextureUsage.RENDER_ATTACHMENT)&&s!==xA.TwoD)throw new Error("GPUTextureUsage.RENDER_ATTACHMENT requires dimension=2d");return this.viewDimension=this.resolveViewDimension(),this.configurationReady=!0,this}resolveViewDimension(){return this.isCube?this.isArray?"cube-array":"cube":this.isArray?`${this.dimension}-array`:this.dimension}generateTextureLayout(A,t){this.prepareConfiguration();const e=this.sampleConfig,i=this.viewDimension,s=e.format,n=this.sampleCount>1;let r=this.getEffectiveSampleType(t);if(this.isStorageTexture){const t=A.access,e=t.textureAccess??"write-only",n=t.textureAccessWgsl??"write";return this.textureWgslType=`texture_storage_${i}<${s}, ${n}>`.replace(/-/g,"_"),{storageTexture:{access:e,format:s,viewDimension:i}}}if(this.isExternalTexture)return this.textureWgslType="texture_external",{externalTexture:{}};if(this.isDepthTexture)this.textureWgslType=n?"texture_depth_multisampled_2d":`texture_depth_${i.replace("-","_")}`;else{const A=e.baseWgslType;this.textureWgslType=n?`texture_multisampled_2d<${A}>`:`texture_${i.replace("-","_")}<${A}>`}return{texture:{sampleType:r,viewDimension:i,multisampled:n}}}getTextureDescriptor(){this.prepareConfiguration();const A=this.source;return{format:this.format,dimension:this.dimension,size:{width:A.width,height:A.height,depthOrArrayLayers:A.depth},usage:this.usage,mipLevelCount:this.mipLevelCount,sampleCount:this.sampleCount,viewFormats:this.viewFormats}}createTexture(A){return this.isExternalTexture?this.externalTexture=A.importExternalTexture({source:this.image}):this.texture&&this.#S===A?this.texture:(this.texture&&(this.destroyView(),this.texture.destroy(),this.texture=null,this.isDirty=!0),this.#S=A,this.texture=A.createTexture(this.getTextureDescriptor()))}ensureUploaded(t){if(this.isExternalTexture)throw new Error("External textures cannot be uploaded; call createTexture() each frame");const e=this.createTexture(t);return this.isDirty?(function(t,e,i){let s=!1;if(e.mipmaps.length>0){for(let A=0,s=e.mipmaps.length;A<s;A++){const s=e.mipmaps[A];if(null==s?.data||!ArrayBuffer.isView(s.data))throw new Error(`Texture mip ${A} must provide TypedArray data`);ht(t,e,i,s.data,A,{width:s.width??Math.max(1,e.width>>A),height:s.height??Math.max(1,e.height>>A),depthOrArrayLayers:s.depth??(e.dimension===xA.ThreeD?Math.max(1,e.depth>>A):e.depth)})}s=!0}else{const A=e.image,n=A?.data;if(ArrayBuffer.isView(n))ht(t,e,i,n,0,{width:e.width,height:e.height,depthOrArrayLayers:e.depth}),s=!0;else if(Array.isArray(A)){for(let n=0,r=A.length;n<r;n++){const r=A[n];if(Array.isArray(r?.mipmaps)){for(let A=0,s=r.mipmaps.length;A<s;A++){const s=r.mipmaps[A];if(null==s?.data||!ArrayBuffer.isView(s.data))throw new Error(`Texture cube layer ${n} mip ${A} must provide TypedArray data`);ht(t,e,i,s.data,A,{width:s.width??Math.max(1,e.width>>A),height:s.height??Math.max(1,e.height>>A),depthOrArrayLayers:1},n)}s=!0}else{if(!ct(r))throw new Error(`Texture array layer ${n} is not a GPU external image source`);ut(t,e,i,r,n)}}s=A.length>0}else ct(A)&&(ut(t,e,i,A,0),s=!0)}s&&e.generateMipmaps&&e.mipLevelCount>1&&0===e.mipmaps.length&&A.generateMipmap(t,i,e.viewDimension)}(t,this,e),this.isDirty=!1,e):e}destroyTexture(){this.destroyView(),this.texture?.destroy(),this.texture=null,this.#S=null,this.externalTexture=null,this.isDirty=!0}createView(A,t){if(this.isExternalTexture)throw new Error("GPUExternalTexture does not expose GPUTextureView");const e=this.createTexture(A);return null!=t?e.createView({...this.viewParams,dimension:this.viewDimension,...t}):this.view??=e.createView({...this.viewParams,dimension:this.viewDimension})}updateView(A){this.destroyView(),A&&(this.createTexture(A),this.createView(A)),this.onChangeCallback(f.DIRTY_STRUCTURE)}updateTexture(A){this.destroyTexture(),A&&(this.isExternalTexture?this.createTexture(A):(this.ensureUploaded(A),this.createView(A))),this.onChangeCallback(f.DIRTY_STRUCTURE)}destroyView(){this.view=null}destroy(){this.destroyTexture()}invalidateContent(){this.isDirty=!0,this.onChangeCallback(f.DIRTY_DATA)}invalidateTextureResource(){this.sampleConfig=null,this.configurationReady=!1,this.destroyTexture(),this.onChangeCallback(f.DIRTY_STRUCTURE)}onChangeCallback(A=f.DIRTY_STRUCTURE){const t=this.depObjects;for(const e of t){const i=e.deref();null!=i?i.onChangeCallback(A):t.delete(e)}}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}transformUv(A){return 300!==this.mapping||(this.matrixAutoUpdate&&this.updateMatrix(),A.applyMatrix3(this.matrix),A.x=ft(A.x,this.sampler.wrapS),A.y=ft(A.y,this.sampler.wrapT),this.flipY&&(A.y=1-A.y)),A}}function ft(A,t){if(A>=0&&A<=1)return A;switch(t){case q.Repeat:return A-Math.floor(A);case q.ClampToEdge:return A<0?0:1;case q.MirrorRepeat:return 1===Math.abs(Math.floor(A)%2)?Math.ceil(A)-A:A-Math.floor(A);default:return A}}function mt(A){const t=A.formatType??wA.RGBAFormat,e=null!=A.format?EA[A.format]:BA[t]?.[A.dataType??yA.UnNormByteType]??QA[t];if(e?.sampleType===CA.SInt||e?.sampleType===CA.UInt||!1===e?.filterable)return mA.NonFiltering}const Ct=(A,t=0,e,i=0,s=void 0,n=!0)=>{const r=e.length;if(s??=r,0===i&&s===r)A.set(e,t);else for(let a=Math.min(s+i,r);i<a;)A[t++]=e[i++]};class wt{typeInfo={name:"",format:"",alias:"",type:"u8",size:0,align:0,elements:0,itemElements:0,view:c,cpuStride:0,cpuTotalElements:0,setData:Ct};optimizeMemory=!1;fields=new Map;isStructDefinition=!0;hasDynamicArray=!1;useStandardLayout=!1;wgslCode={mainStruct:"",chunkStruct:"",structVars:""};dirtyWatch=((A={})=>{const t=new Set,e=A;return A.add||=A=>{t.add(A)},A.delete||=A=>{t.delete(A)},A.clear||=()=>{t.clear()},A.has||=A=>t.has(A),new Proxy(e,{get:(A,t)=>A[t],set:(A,e,i)=>(A[e]=i,i&&t.forEach(A=>{A[e]=i}),!0)})})({isChanged:!0});get name(){return this.typeInfo.name}constructor(A,t,e){const i=this.typeInfo;i.name=A,i.alias=A,i.format=A,this.optimizeMemory=e?.optimizeMemory||!1,this.useStandardLayout=e?.useStandardLayout||!1,t.forEach(A=>{this.addField(A)})}addField(A){if(this.fields.has(A.name))return void console.error(`StructDef ${this.name} has already defined field ${A.name}`);const t=A.format?.isStructDefinition;t&&this.useStandardLayout!==A.format.useStandardLayout&&(A={...A,format:A.format.clone(this.useStandardLayout)}),this.fields.set(A.name,A),this.dirtyWatch.isChanged=!0;const e=A.format?.isStructDefinition?A.format:void 0;e&&e!==this&&e.dirtyWatch.add(this.dirtyWatch)}removeField(A){const t=this.fields.get(A);this.fields.delete(A),this.dirtyWatch.isChanged=!0;const e=t?.format?.isStructDefinition?t?.format:void 0;if(e&&e!==this){for(const A of this.fields.values())if(A.format===e)return;e.dirtyWatch.delete(this.dirtyWatch)}}getField(A){return this.fields.get(A)}#O(A,t=!1){const e=A.format,i=A.isDynamicArray,s=A.isArray||i,n=i?0:A.count||1,r=!!e?.isStructDefinition;let a,o,l,c,h,g,d,p,f=i,m=0,C=0,w=0,y=0;if(r){d=e,d.dirtyWatch.isChanged&&d.computeLayout();const A=d.typeInfo;p=d.typeInfo,a=t?p.align:Math.max(16,p.align),h=u(a,p.size),o=h*n,g=o,l=h,c=h,m=c*n,C=o,f=f||d.hasDynamicArray,w=A.cpuStride,y=A.cpuTotalElements*n}else p=fA[e],a=t||!s?p.align:Math.max(16,p.align),h=s?u(a,p.size):p.size,o=h*n,g=o,c=p.elements,m=c*n,l=h/p.view.BYTES_PER_ELEMENT,C=l*n,w=c,y=m;if(!t&&s){const t=u(r?d.typeInfo.align:p.align,r?d.typeInfo.size:p.size);if(h!==t)throw new Error(`StructDef ${this.name} field '${A.name}': uniform array element stride ${h} does not match WGSL stride ${t}. Use an element whose stride is a multiple of 16, or set useStandardLayout`)}return{...p,byteStride:h,byteOffset:0,offset:0,stride:l,align:a,size:o,bytes:g,totalElements:m,elements:c,gpuTotalElements:C,needPadding:!1,isArray:s,count:n,hasDynamicArray:f,isDynamicArray:i,isStandardLayout:t,isStruct:r,cpuStride:w,cpuTotalElements:y,cpuOffset:0,_readed:!1}}computeLayout(){const A=this.useStandardLayout,t=this.wgslCode,e=this.fields,i=Array.from(e.values()),s=[];t.mainStruct="",t.chunkStruct="",t.structVars="",e.clear();let n=0,r=0,a=0;if(this.optimizeMemory){const t=[],o=[],l=[],c=[],h=[],g=[];for(let e=0,n=i.length;e<n;e++){const n=i[e],r=this.#O(n,A),{align:a,size:u}=r;n.meta=r,r.hasDynamicArray?s.push(n):2===a?t.push(n):4===a?o.push(n):8===a&&u%8==0?l.push(n):8===a?c.push(n):16===a&&u%16==0?h.push(n):g.push(n)}if(s.length>1)throw new Error(`StructDef ${this.name} has multiple dynamic array fields, this may cause performance issues`);const d=(A,t,e)=>{for(let i=0,s=A.length;i<s;i++){const s=A[i],n=s.meta;if(!n._readed&&(n.size-t)%e===0)return n._readed=!0,s}};let p=0,f=h.length,m=!0;for(f>0&&(r=16);p<f;){const A=h[p++],t=A.meta,i=t.view.BYTES_PER_ELEMENT||1;t._readed=!0,t.byteOffset=n,t.offset=n/i,t.cpuOffset=a/i,n+=t.size,a+=t.cpuTotalElements*i,e.set(A.name,A)}for(p=0,f=g.length,m=!0,f>0&&(r=16);p<f;){const A=g[p++],i=A.meta,s=i.view.BYTES_PER_ELEMENT||1;if(n=u(16,n),a=u(s,a),i._readed=!0,i.byteOffset=n,i.offset=n/s,i.cpuOffset=a/s,n+=i.size,a+=i.cpuTotalElements*s,e.set(A.name,A),m&&n%16==12){const A=d(o,4,16)||d(t,4,16);if(A){const t=A.meta,i=t.view.BYTES_PER_ELEMENT||1;t.byteOffset=n,t.offset=n/i,t.cpuOffset=a/i,n+=t.size,a+=t.cpuTotalElements*i,e.set(A.name,A)}else m=!1}}for(p=0,f=l.length,m=!0,f>0&&(r=Math.max(r,8));p<f;){const A=l[p++],t=A.meta,i=t.view.BYTES_PER_ELEMENT||1;n=u(8,n),a=u(i,a),t._readed=!0,t.byteOffset=n,t.offset=n/i,t.cpuOffset=a/i,n+=t.size,a+=t.cpuTotalElements*i,e.set(A.name,A)}for(p=0,f=c.length,m=!0,f>0&&(r=Math.max(r,8));p<f;){const A=c[p++],i=A.meta,s=i.view.BYTES_PER_ELEMENT||1;if(!i._readed&&(n=u(8,n),a=u(s,a),i._readed=!0,i.byteOffset=n,i.offset=n/s,i.cpuOffset=a/s,n+=i.size,a+=i.cpuTotalElements*s,e.set(A.name,A),m&&n%8==6)){const A=d(t,2,8);if(A){const t=A.meta,i=t.view.BYTES_PER_ELEMENT||1;a=u(i,a),t.byteOffset=n,t.offset=n/i,t.cpuOffset=a/i,n+=t.size,a+=t.cpuTotalElements*i,e.set(A.name,A)}else m=!1}}for(p=0,f=o.length,f>0&&(r=Math.max(r,4));p<f;){const A=o[p++],t=A.meta,i=t.view.BYTES_PER_ELEMENT||1;t._readed||(n=u(4,n),a=u(i,a),t._readed=!0,t.byteOffset=n,t.offset=n/i,t.cpuOffset=a/i,n+=t.size,a+=t.cpuTotalElements*i,e.set(A.name,A))}for(p=0,f=t.length,f>0&&(r=Math.max(r,2));p<f;){const A=t[p++],i=A.meta,s=i.view.BYTES_PER_ELEMENT||1;i._readed||(n=u(2,n),a=u(s,a),i._readed=!0,i.byteOffset=n,i.offset=n/s,i.cpuOffset=a/s,n+=i.size,a+=i.cpuTotalElements*s,e.set(A.name,A))}s.forEach(A=>{const t=A.meta,i=t.view.BYTES_PER_ELEMENT||1,{align:s,size:o}=t;n=u(s,n),a=u(i,a),t.byteOffset=n,t.offset=n/i,t.cpuOffset=a/i,n+=o,a+=t.cpuTotalElements*i,r<s&&(r=s),e.set(A.name,A)})}else{for(let t=0,o=i.length;t<o;t++){const o=i[t],l=this.#O(o,A);if(o.meta=l,l.hasDynamicArray)s.push(o);else{const{align:A,size:t}=l,i=l.view.BYTES_PER_ELEMENT||1;n=u(A,n),a=u(i,a),l.byteOffset=n,l.offset=n/i,l.cpuOffset=a/i,n+=t,a+=l.cpuTotalElements*i,e.set(o.name,o),r<A&&(r=A)}}if(s.length>1)throw new Error(`StructDef ${this.name} has multiple dynamic array fields, this may cause performance issues`);s.forEach(A=>{const t=A.meta,{align:i,size:s}=t,o=t.view.BYTES_PER_ELEMENT||1;n=u(i,n),a=u(o,a),t.byteOffset=n,t.offset=n/o,t.cpuOffset=a/o,n+=s,a+=t.cpuTotalElements*o,r<i&&(r=i),e.set(A.name,A)})}const o=this.typeInfo,l=u(r,n);o.align=r,o.bytes=l,o.size=l,o.stride=l,o.totalElements=l,o.gpuTotalElements=l,o.elements=l;let c=!0;for(const h of e.values()){const A=h.meta,t=A.view.BYTES_PER_ELEMENT||1;if(A.size!==A.cpuTotalElements*t){c=!1;break}}o.cpuStride=c?l:a,o.cpuTotalElements=c?l:a,o.needPadding=o.bytes!==o.cpuTotalElements,this.hasDynamicArray=s.length>0,this.dirtyWatch.isChanged=!1}setData(A,t,e,i,s,n){this.typeInfo.setData(A,t,e,i,s,n)}set(A,t){const e=this.fields;if(l(t))for(const i in t){const s=e.get(i);if(!s)continue;const n=s.meta,r=t[i],a=A.getUseView?.(n.type,n.byteOffset,n.bytes)??c.getUseView(A,n.type,n.byteOffset,n.bytes);n.isStruct?s.format.set(a,r):n.setData(a,0,r,0,void 0,n.isStandardLayout||!n.isArray)}else A.set(t,0,"u8")}generateStructs(A=new Set){const t=this.name;if(A.has(t))return;A.add(t);let e="",i="";for(const s of this.fields.values()){const t=s.meta,{isStruct:n,isArray:r,count:a,alias:o,hasDynamicArray:l}=t;let c;if(n){const i=s.format.generateStructs(A);c=t.format,i&&(e+=i.chunkStruct+i.mainStruct)}else c=o;let h="";if(!this.useStandardLayout&&(n||r)){const A=n?s.format:void 0,e=A?A.typeInfo.align:fA[s.format].align,i=[];t.align!==e&&i.push(`@align(${t.align})`),A&&!r&&t.byteStride!==A.typeInfo.size&&i.push(`@size(${t.byteStride})`),i.length>0&&(h=`${i.join(" ")} `)}const u=r?l?`array<${c}>`:`array<${c}, ${a}>`:c;i+=` ${h}${s.name}: ${u},\n`}return i=`struct ${t} {\n${i}};\n\n`,{chunkStruct:e,mainStruct:i}}toWGSLStructs(){this.dirtyWatch.isChanged&&this.computeLayout();const A=this.wgslCode;if(!A.mainStruct){const{mainStruct:t,chunkStruct:e}=this.generateStructs()||{};A.mainStruct=t,A.chunkStruct=e}return`${A.chunkStruct}\n\n${A.mainStruct}`}clone(A){if((A=!!A)===this.useStandardLayout)return this;const t=[];for(const e of this.fields.values()){const i={name:e.name,format:e.format,access:e.access,count:e.count,isArray:e.isArray,isDynamicArray:e.isDynamicArray};i.format?.isStructDefinition&&(i.format=i.format.clone(A)),t.push(i)}return new wt(this.name,t,{optimizeMemory:this.optimizeMemory,useStandardLayout:A})}}class yt extends c{isStructBuffer=!0;stride=0;maxCount=0;growFactor=0;fitFactor=0;count=0;freeStack;freeTop;_maxIndex=-1;_isCalcMaxIndex=!1;usedBits;structDef;isAutoGrow=!1;isAutoShrink=!1;depObjects=new Set;constructor(A,t,e){const i=(e?.isStandardLayout??t?.useStandardLayout)||!1;let s=e?.stride||1;t&&"string"==typeof t?t=new wt("default",[{name:"default",format:t}],{useStandardLayout:i}):t&&i!==t.useStandardLayout&&(t=t.clone(i)),t?.computeLayout(),s=Math.max(s,t?.typeInfo?.size??1);let n,r=0,a=0;"number"==typeof A?(r=Math.max(0,0|A),n=new ArrayBuffer(s*r)):(n=A,a=e?.byteOffset??0,r=e?.count??Math.floor((n.byteLength-a)/s),r=Math.max(0,0|r)),super(n,{byteOffset:a,byteLength:s*r}),this.count=r,this.structDef=t,this.stride=s,this.maxCount=e?.maxCount??Number.MAX_SAFE_INTEGER,this.growFactor=e?.growFactor??1.2,this.fitFactor=e?.fitFactor??.2,this.isAutoGrow=e?.isAutoGrow??!0,this.isAutoShrink=e?.isAutoShrink??!1;let o=0;e?.enableFreeList?(o=r,this.usedBits=new Uint8Array(r)):(o=0,this.usedBits=null);const l=new Uint32Array(o);for(let c=o-1;c>=0;c--)l[o-1-c]=c;this.freeStack=l,this.freeTop=o}get maxIndex(){let A=this._maxIndex;const t=this._isCalcMaxIndex&&this.usedBits;if(t){for(A--;A>=0&&0===t[A];)A--;this._maxIndex=A,this._isCalcMaxIndex=!1}return A}calcCapacity(){return 256*Math.floor(this.maxIndex/256+2)}registerDepObject(A){this.depObjects.add(A)}unregisterDepObject(A){this.depObjects.delete(A)}free(A){const t=this.usedBits;t&&0!==t[A]&&(t[A]=0,this.freeStack[this.freeTop++]=A,A===this._maxIndex&&(this._isCalcMaxIndex=!0),this.isAutoShrink&&this.shrinkToFit(0))}allocate(){const A=this.usedBits;if(!A)return-1;if(!(0!==this.freeTop||this.isAutoGrow&&this.ensureCapacity(this.count+1)&&0!==this.freeTop))return-1;const t=this.freeStack[--this.freeTop];return A[t]=1,t>=this._maxIndex&&(this._maxIndex=t,this._isCalcMaxIndex=!1),t}getFieldView(A,t){const e=this.structDef.fields.get(t),i=e?.meta;if(i)return this.getUseView(i.type,A*this.stride+i.byteOffset,i.bytes)}getFieldTypeViewInfo(A,t){const e=this.structDef.fields.get(A),i=e?.meta;if(!i)return;const s=this.getView(i.type),n=s.BYTES_PER_ELEMENT;return{view:s,offset:Math.floor((t*this.stride+i.byteOffset)/n),length:Math.ceil(i.bytes/n),type:i.type}}ensureCapacity(A){if(A<0||A<=this.count||A>this.maxCount)return!1;let t=Math.max(A,256*Math.ceil(this.count*this.growFactor/256));return t>this.maxCount&&(t=this.maxCount),this.resizeTo(t),!0}shrinkToFit(A=0){const t=this.count,e=Math.max(A,this.maxIndex+256);return!(e>=t||e/t>this.fitFactor||(this.resizeTo(e),0))}resizeTo(A){const t=this.count;t!==A&&(super.resize(A*this.stride),this.count=A,this.syncCapacityState(t,A))}syncDepObjects(){const A=this.depObjects;A.forEach(t=>{const e=t?.deref();null!=e?e.transfer?.():A.delete(t)})}syncCapacityState(A,t){const e=this.usedBits;if(!e)return!1;if(t>A){this.usedBits=new Uint8Array(e.buffer.transfer(t));const i=new Uint32Array(this.freeStack.buffer.transfer(4*t));this.freeStack=i;let s=this.freeTop;for(let e=t-1;e>=A;e--)i[s++]=e;return this.freeTop=s,this.syncDepObjects(),!0}let i=0;const s=this.freeStack;for(let n=0,r=this.freeTop;n<r;n++){const A=s[n];A<t&&(s[i++]=A)}return this.freeTop=i,this.freeStack=new Uint32Array(s.buffer.transfer(4*t)),this.usedBits=new Uint8Array(e.buffer.transfer(t)),this.syncDepObjects(),!0}clone(){const A=new yt(this.count,this.structDef,{isAutoGrow:this.isAutoGrow,isAutoShrink:this.isAutoShrink,growFactor:this.growFactor,fitFactor:this.fitFactor,maxCount:this.maxCount,stride:this.stride,enableFreeList:!!this.usedBits,count:this.count,byteOffset:this.byteOffset}),t=this.usedBits;return t&&(A.usedBits=new Uint8Array(t)),A.u8.set(this.u8),A.freeStack.set(this.freeStack),A.freeTop=this.freeTop,A._maxIndex=this._maxIndex,A._isCalcMaxIndex=this._isCalcMaxIndex,A}}class Bt extends c{isStructBuffer=!0;structDef;values=new Map;onChangeCallback=()=>{};isSameBuffer=!1;constructor(A,t){const e=(t?.isStandardLayout??A.useStandardLayout)||!1;e!==A.useStandardLayout&&(A=A.clone(e)),A.computeLayout(),super(A.typeInfo.size),this.structDef=A}initValuesObject(A=!1){const t=this.values,e=this.structDef,i=e.fields;if(A&&e.typeInfo.bytes===e.typeInfo.cpuTotalElements){this.isSameBuffer=!0;for(const[A,e]of i.entries()){const i=e.meta,s=(e.initCpuData||i.initCpuData)(this.getView(i.type),i.offset,i.isArray);s.depObject=this,t.set(A,s)}}else{this.isSameBuffer=!1;for(const[A,e]of i.entries()){const i=e.meta,s=(e.initCpuData||i.initCpuData)(new i.view(i.totalElements),0,i.isArray);s.depObject=this,t.set(A,s)}}}getFieldView(A){const t=this.structDef.fields.get(A);if(!t)return;const e=t.meta;return this.getUseView(e.type,e.byteOffset,e.bytes)}setValues(A){this.structDef.set(this,A)}clone(){const A=new Bt(this.structDef);return A.u8.set(this.u8),A}}class It{static pending=[];static pendingSet=new Set;static createBuffer(A,t){return t.createBuffer(A)}static release(A,t){null==t||this.pendingSet.has(t)||(this.pendingSet.add(t),this.pending.push({device:A,buffer:t,framesLeft:3}))}static#F=!1;static tick(){if(this.#F)return;const A=this.pendingSet,t=this.pending,e=t.length;if(0===e)return;this.#F=!0,queueMicrotask(()=>{this.#F=!1});let i=0;for(let s=0;s<e;s++){const e=t[s];--e.framesLeft>0?t[i++]=e:(A.delete(e.buffer),e.buffer.destroy())}t.length=i}static flush(A){const t=this.pending,e=this.pendingSet;if(null==A){for(let A=0,e=t.length;A<e;A++)t[A].buffer.destroy();return t.length=0,void e.clear()}let i=0;for(let s=0,n=t.length;s<n;s++){const n=t[s];null==n.device||n.device===A?(e.delete(n.buffer),n.buffer.destroy()):t[i++]=n}t.length=i}}async function Qt(A){try{const t=A.info??await(A.requestAdapterInfo?.());if(t)return[t.vendor||"",t.architecture||"",t.device||"",t.description||""].join("|")}catch{}return"unknown-adapter"}const Et=new Map;function xt(A,t,e){try{const i=Et.get(A+t)||globalThis.localStorage?.getItem(A+t);if(!i)return null;const s=JSON.parse(i);return s?.version!==e?null:s}catch{return null}}const Dt=[256,4096,65536,262144,1<<20,2<<20,3<<20,4128768,4<<20,8<<20,16<<20];let Mt=null,bt=Dt,St=Dt.map(function(A){return A>=4<<20?56e-5+2e-7*A:384e-7+3e-7*A}),vt=3072e-7,Tt=0,Ut=128;function Nt(){const A=(St[2]-St[1])/(bt[2]-bt[1]),t=A>0?St[0]-A*bt[0]:0,e=vt-(t>0?t:0);var i;Tt=e>0?e:0,Ut=A>0&&t>0?(i=Math.round(t/A))<4?4:i>65536?65536:i:128}function Pt(A){const t=function(A){const t=bt,e=St,i=t.length-1;let s=1;for(;s<i&&t[s]<A;)s++;s>=2&&e[s]<e[s-1]&&A<t[s]&&s--;const n=e[s-1]+(A-t[s-1])*(e[s]-e[s-1])/(t[s]-t[s-1]);return n>0?n:e[0]}(A);return A>=4194304?t:t+Tt}async function Ot(A){if(Mt)return Mt;const t=xt("uploadCostProfile.v4:",await Qt(A),4);var e,i,s;return t&&(i=t).reliable&&i.sizes?.length===Dt.length&&i.ms?.length===Dt.length&&(s=i.callMs)>function(A,t){const e=(t[2]-t[1])/(A[2]-A[1]);if(!(e>0))return 0;const i=t[0]-e*A[0];return i>0?i:0}(i.sizes,i.ms)&&s<.02&&(Mt=e=t,bt=e.sizes,St=e.ms,vt=e.callMs,Nt()),Mt}Nt();let Ft=0;const kt={},Rt=[];class Lt{id=++Ft;isBinding=!0;fixedSlot;name="";updateRanges=[];visibility;access;typeInfo;isArray=!1;count=0;isDynamicArray=!1;isStandardLayout=!1;isAtomic=!1;isUniformBuffer=!1;isStorageBuffer=!1;isSampler=!1;isSampledTexture=!1;isStorageTexture=!1;isStructBinding=!1;value=null;dataView={offset:0,size:void 0,view:null,buffer:null,ownsBuffer:!1,dataOffset:0,sampler:null,texture:null};WGSL_FRAGMENT="";depObjects=new Set;weakSelf=new WeakRef(this);constructor(A,t,e,i={}){const s=i.count||0;this.name=A,this.visibility=i.visibility??z.ALL,this.access={...Z[i.access||"Uniform"]},this.access.usage=i.usage??this.access.usage,this.isDynamicArray=i.isDynamicArray||!1,this.isArray=s>1||this.isDynamicArray||i.isArray||!1,this.count=s>0?s:this.isArray?0:1,this.isAtomic=i.isAtomic||!1,this.isStandardLayout=i.isStandardLayout||"uniform"!==this.access.bufferType,this.fixedSlot=i.fixedSlot,this.initTypeInfo(e),null==t&&this.isArray&&this.count>0&&(t=new this.typeInfo.view(this.typeInfo.elements)),this.setValue(t)}get isDirty(){return this.value?.isDirty??!1}set isDirty(A){this.value&&(this.value.isDirty=A)}setWgslFragment(A){this.WGSL_FRAGMENT=A}initTypeInfo(A){A||=`${h(this.name||"")}`;const t=this.count||(this.isArray?0:1),e=fA[A],i=this.isStandardLayout||!this.isArray?u(e.align,e.size):u(16,Math.max(e.align,e.size)),s=i*t,n=e.view.BYTES_PER_ELEMENT||1,r=i/n;this.typeInfo={...e,name:this.name,format:A,offset:0,stride:r,byteOffset:0,byteStride:i,bytes:s,needPadding:r!=e.elements,dataView:null,isChunkLayout:!1,totalElements:e.elements*t,gpuTotalElements:s/n}}onChangeCallback(A){const t=this.depObjects;A??=f.DIRTY_DATA,t.forEach(e=>{const i=e.deref();null!=i?i.onChangeCallback(A):t.delete(e)})}resetDirty(){return this.value&&(this.value.isDirty=!1),this}isSkipBinding(){return null==this.value}shaderIoAttrs(){return Rt}shaderIoCacheKey(){const A=this.shaderIoAttrs();return A.length?`${this.name}:${A.join(",")};`:""}getSlotCount(){return 1}setValue(A){const t=this.value;if(null==A)this.value=null,t&&(t.depObject=null,this.onChangeCallback(f.DIRTY_STRUCTURE));else if(t)t.setValue(A);else{let t=null;t=null!=A.getValue&&null!=A.setValue?A:new L(A),t.depObject=this,this.value=t,t.isDirty||this.onChangeCallback(f.DIRTY_STRUCTURE)}}getValue(){return this.value?.getValue()}setVisibility(A){this.visibility=A}setUsage(A){this.access.usage=A}setAccess(A){this.access={...Z[A]}}setBaseType(A){this.typeInfo.format=A}getType(){const A=this.isAtomic?`atomic<${this.typeInfo.format}>`:this.typeInfo.format;return this.isArray?this.isDynamicArray?`array<${A}>`:`array<${A}, ${this.count}>`:A}generateShader(A,t,e){const i=this.access;return`${this.WGSL_FRAGMENT}\n@group(${A}) @binding(${t}) var${i.access??""} ${this.name}:${this.getType()};\n`}generateLayout(A,t,e){return[{binding:t,visibility:this.visibility}]}generateBinding(A,t,e){return[{binding:t,resource:this.dataView}]}dispose(){this.depObjects.clear()}}class jt extends Lt{gpuDevice=null;rebuildGpu=!1;constructor(A,t,e,i=kt){if(super(A,t,e,i),"uniform"===this.access.bufferType){if(this.isUniformBuffer=!0,this.isDynamicArray)throw new Error(`UniformStorageBinding ${A} can not be dynamic array`)}else this.isStorageBuffer=!0}calcWgslType(A=1){const t=this.typeInfo;t.bytes=t.byteStride*A,t.gpuTotalElements=t.stride*A,t.totalElements=t.elements*A,this.count=A}setCount(A,t=!1){this.calcWgslType(A),this.dataView.size=this.typeInfo.bytes,t&&(this.clearUpdateRanges(),this.setUpdateRange(0,A))}setValue(A){if(super.setValue(A),this.isDynamicArray){const A=this.value,t=A?A.isPadded?Math.floor(A.elements.length/this.typeInfo.stride):Math.floor(A.elements.length/this.typeInfo.elements):0;if(t!==this.count)return void this.setCount(t,!0)}this.clearUpdateRanges(),this.setUpdateRange(0,this.count)}setValueAt(A,t,e){const i=this.value,s=this.typeInfo,n=s.elements,r=i.elements,a=Math.min(t.length,e);if(a%n!==0)throw new Error(`UniformStorageBinding ${this.name}.setValueAt data length must be a multiple of ${n}`);const o=a/n;if(A<0||A+o>this.count)throw new RangeError(`UniformStorageBinding ${this.name}.setValueAt range out of bounds`);s.needPadding&&i.isPadded?s.setData(r,A*s.stride,t,0,a,this.isStandardLayout||!this.isArray):r.set(t,A*s.elements),this.setUpdateRange(A,o),i.isDirty||(i.isDirty=!0,this.onChangeCallback(f.DIRTY_DATA))}setUpdateRange(A,t){if(A<0||t<=0||A+t>this.count)return;const e=this.updateRanges??=[],i=this.typeInfo.byteStride,s=i>0&&"storage"!==this.access.bufferType?Math.ceil(Ut/i):1;let n=A,r=A+t,a=0;for(let o=0,l=e.length;o<l;o++){const A=e[o],t=A.start+A.count;A.start-r>=s||n-t>=s?e[a++]=A:(n=Math.min(n,A.start),r=Math.max(r,t))}e[a++]={start:n,count:r-n},e.length=a}clearUpdateRanges(){this.updateRanges.length=0}createCPUBuffer(){const A=this.typeInfo,t=this.dataView,{view:e,dataOffset:i}=t;if(null!=e&&e.length>=A.gpuTotalElements+i)return e;{const e=new A.view(A.gpuTotalElements);return t.view=e,t.dataOffset=0,e}}getSameValueBuffer(A){const t=this.typeInfo;return null==A||A.byteOffset||A.length!==t.gpuTotalElements?null:(this.dataView.dataOffset=0,A instanceof t.view?A:new t.view(A))}updateCPUBufferPartial(A,t,e){const i=this.isStandardLayout||!this.isArray,s=this.dataView,n=this.typeInfo,r=n.setData,a=n.elements,o=n.stride,l=s.dataOffset,c=t.elements;for(let h=0,u=e.length;h<u;h++){const{start:t,count:s}=e[h];r(A,l+t*o,c,t*a,s*a,i)}}updateCPUBuffer(){if(!this.isDirty)return;const A=this.value,t=this.dataView,e=t.view,i=A.elements;if(null!=e?.buffer&&i?.buffer===e?.buffer)return;const s=this.typeInfo;if(null!=e&&e.byteLength<e.buffer.byteLength||null!=e&&null!=i&&e.length>=s.gpuTotalElements+t.dataOffset)return void(A.isPadded?e.set(i,t.dataOffset):s.setData(e,t.dataOffset,i,0,s.totalElements,this.isStandardLayout||!this.isArray));let n=this.getSameValueBuffer(i);null==n?(n=this.createCPUBuffer(),A.isPadded?t.view?.set(i,t.dataOffset):s.setData(n,t.dataOffset,i,0,s.totalElements,this.isStandardLayout||!this.isArray)):t.view=n}createGPUBuffer(A,t=!1){const e=this.dataView,{buffer:i,offset:s}=e;let n=this.typeInfo.bytes;this.isUniformBuffer&&(n=u(16,Math.max(n,16)));const r=s+n;if(null!=i&&i.size>=r&&!this.rebuildGpu)return this.gpuDevice=A,i;this.rebuildGpu=!1,null!=i&&e.ownsBuffer&&It.release(A,i);const a=A.createBuffer({label:"Uniform_Storage_"+this.name,usage:this.access.usage,size:r,mappedAtCreation:t});return e.buffer=a,e.ownsBuffer=!0,this.gpuDevice=A,a}releaseOwnedGpuBuffer(){const A=this.dataView,t=A.buffer;t&&A.ownsBuffer&&(It.release(this.gpuDevice,t),A.buffer=null,A.ownsBuffer=!1)}dispose(){super.dispose(),this.releaseOwnedGpuBuffer()}updateGPUBufferPartial(A,t,e){const{view:i,offset:s,buffer:n,dataOffset:r}=t,a=this.typeInfo.stride,o=i.BYTES_PER_ELEMENT||1,l=i instanceof c?i.u8:i,h=A.queue;if(2!==o)for(let c=0,u=e.length;c<u;c++){const A=e[c],t=A.start*a,i=s+t*o,u=A.count*a;h.writeBuffer(n,i,l,r+t,u)}else{const A=Math.min((t.size||this.typeInfo.bytes)>>1,(l?.length??0)-r);for(let t=0,i=e.length;t<i;t++){const i=e[t];let o=i.start*a,c=i.count*a;s+2*o&2&&o>0&&(o--,c++),1&c&&o+c<A&&c++,h.writeBuffer(n,s+2*o,l,r+o,c)}}this.clearUpdateRanges()}updateGPUBuffer(A){if(!this.isDirty)return;const t=this.dataView,e=this.updateRanges,i=this.typeInfo,s=t.buffer,n=e.length;if(this.createGPUBuffer(A),this.isDirty=!1,n>0&&t.buffer===s&&(1!==n||0!==e[0].start||e[0].count!==this.count)){let s="storage"===this.access.bufferType;if(!s){const A=i.byteStride;let r=0;for(let t=0;t<n;t++)r+=Pt(e[t].count*A);s=r<Pt(t.size||i.bytes)}if(s)return void this.updateGPUBufferPartial(A,t,e)}this.clearUpdateRanges();const r=t.view;if(!r||!i.bytes)return;const a=r.BYTES_PER_ELEMENT||1,o=t.size||i.bytes||r.byteLength-t.dataOffset*a,l=r instanceof c?r.u8:r;A.queue.writeBuffer(t.buffer,t.offset,l,t.dataOffset,o/a|0)}generateLayout(A,t,e){return[{binding:t,visibility:this.visibility,buffer:{type:this.access.bufferType,hasDynamicOffset:null!=this.dataView.dynamicOffset}}]}generateBinding(A,t,e){const i=this.dataView;i.buffer??=this.createGPUBuffer(e.device);const s=i.buffer;let n=i.size??this.typeInfo.bytes;if(this.isUniformBuffer)n=Math.min(u(16,Math.max(n,16)),s.size-(i.offset||0));else if(this.isDynamicArray&&s){const A=i.size||s.size;n=Math.min(A,s.size-(i.offset||0))}return[{binding:t,resource:{buffer:i.buffer,offset:i.offset,size:n}}]}}class zt extends jt{constructor(A,t=0,e="f32",i={}){const s=t||0;i.count??=s?.length??null,super(A,s,e,i)}}class Gt extends jt{constructor(A,t=new w,e="f32",i={}){if(null==i.count)if(Array.isArray(t)){const A=null!=t[0]?.elements;i.count=A?t.length:Math.ceil(t.length/2)}else t?.buffer?.byteLength>=0&&(i.count=Math.ceil(t.length/2));super(A,t,`vec2${e[0]}`,i)}}class Yt extends jt{constructor(A,t=new y,e="f32",i={}){if(null==i.count)if(Array.isArray(t)){const A=null!=t[0]?.elements;i.count=A?t.length:Math.ceil(t.length/3)}else t?.buffer?.byteLength>=0&&(i.count=Math.ceil(t.length/3));super(A,t,`vec3${e[0]}`,i)}}class Ht extends jt{constructor(A,t=new B,e="f32",i={}){if(null==i.count)if(Array.isArray(t)){const A=null!=t[0]?.elements;i.count=A?t.length:Math.ceil(t.length/4)}else t?.buffer?.byteLength>=0&&(i.count=Math.ceil(t.length/4));super(A,t,`vec4${e[0]}`,i)}}class Kt extends jt{constructor(A,t=new P,e="f32",i={}){if(null==i.count)if(Array.isArray(t)){const A=null!=t[0]?.elements;i.count=A?t.length:Math.ceil(t.length/3)}else t?.buffer?.byteLength>=0&&(i.count=Math.ceil(t.length/3));super(A,t,`vec3${e[0]}`,i)}}class Vt extends jt{constructor(A,t=new O,e="f32",i={}){if(null==i.count)if(Array.isArray(t)){const A=null!=t[0]?.elements;i.count=A?t.length:Math.ceil(t.length/4)}else t?.buffer?.byteLength>=0&&(i.count=Math.ceil(t.length/4));super(A,t,`vec4${e[0]}`,i)}}class Jt extends jt{constructor(A,t=new v,e="f32",i={}){if(null==i.count)if(Array.isArray(t)){const A=null!=t[0]?.elements;i.count=A?t.length:Math.ceil(t.length/16)}else t?.buffer?.byteLength>=0&&(i.count=Math.ceil(t.length/16));super(A,t,`mat4x4${e[0]}`,i)}}class Wt extends Lt{isSampler=!0;samplerLayout;constructor(A,t=null,e){super(A,t,"sampler",e)}initTypeInfo(A){this.typeInfo={name:this.name,format:"sampler",align:0,size:0,elements:0,itemElements:0,offset:0,byteOffset:0,byteStride:0,stride:0,bytes:0,needPadding:!1,dataView:null,isChunkLayout:!1,totalElements:0,gpuTotalElements:0}}setValue(A){const t=this.value;null!=A?t!==A&&(t&&(t.depObjects.delete(this.weakSelf),this.clearGpuHandles()),A.depObjects.add(this.weakSelf),this.value=A,this.onChangeCallback(f.DIRTY_STRUCTURE)):t&&(t.depObjects.delete(this.weakSelf),this.clearGpuHandles(),this.value=null,this.onChangeCallback(f.DIRTY_STRUCTURE))}getValue(){return this.value}updateCPUBuffer(){}updateGPUBuffer(A){}clearGpuHandles(){this.dataView.sampler=null,this.samplerLayout=void 0}getType(){return this.typeInfo.format}generateShader(A,t,e){return`${this.WGSL_FRAGMENT}\n@group(${A}) @binding(${t}) var ${this.name}:${this.getType()};\n`}generateLayout(A,t,e){const i=this.value;return this.samplerLayout=i.generateLayout(),this.setBaseType(i.wgslType),[{binding:t,visibility:this.visibility,sampler:this.samplerLayout}]}generateBinding(A,t,e){const i=this.value,s=this.dataView;return null!=s.sampler&&s.sampler===i.gpuSampler||(s.sampler=i.createSampler(e.device)),[{binding:t,resource:s.sampler}]}}class qt extends Lt{isSampledTexture=!0;isStorageTexture=!1;#k="uv";#R="attribute";#L=!1;#j="vec4f(1.0)";#z=!1;#G=null;_tbInit;constructor(A,t=null,e){super(A,t,"texture_2d<f32>",e),t?.isStorageTexture&&(this.isStorageTexture=!0,this.isSampledTexture=!1),this._tbInit=!0,t?.isCube&&(this.#R="normal")}initTypeInfo(A){this.typeInfo={name:this.name,format:"texture_2d<f32>",align:0,size:0,elements:0,itemElements:0,offset:0,byteOffset:0,byteStride:0,stride:0,bytes:0,needPadding:!1,dataView:null,isChunkLayout:!1,totalElements:0,gpuTotalElements:0}}shaderIoAttrs(){return this.isSkipBinding()||this.#z||"attribute"!==this.#R?Rt:this.#G??=[this.#k]}shaderIoCacheKey(){const A=this.#z?`${this.name}:defer;`:"";return"uv"===this.#k&&"attribute"===this.#R&&"vec4f(1.0)"===this.#j?A:`${this.name}:${this.#k}:${this.#R}:${this.#j};${A}`}get coordAttr(){return this.#k}set coordAttr(A){A!==this.#k&&(this.#k=A,this.#G=null,this.onChangeCallback(f.DIRTY_PIPELINE))}get coordSpace(){return this.#R}set coordSpace(A){A===this.#R&&this.#L||(this.#R=A,this.#L=!0,this.#G=null,this.onChangeCallback(f.DIRTY_PIPELINE))}get emptySample(){return this.#j}set emptySample(A){A!==this.#j&&(this.#j=A,this.onChangeCallback(f.DIRTY_PIPELINE))}get deferSample(){return this.#z}set deferSample(A){A!==this.#z&&(this.#z=A,this.#G=null,this.onChangeCallback(f.DIRTY_PIPELINE))}get texCoord(){const A=this.#k;if("uv"===A)return 0;if(A.startsWith("uv")){const t=+A.slice(2);if(t>=2)return t-1}return 0}set texCoord(A){const t=0|A;this.coordAttr=t<=0?"uv":`uv${t+1}`}setValue(A){const t=this.value;null!=A?t!==A&&(t&&(t.depObjects.delete(this.weakSelf),this.clearGpuHandles()),A.depObjects.add(this.weakSelf),this.value=A,this.isStorageTexture=!!A.isStorageTexture,this.isSampledTexture=!this.isStorageTexture,this._tbInit&&(this.#G=null,this.#L||(this.#R=A.isCube?"normal":"attribute")),this.onChangeCallback(f.DIRTY_STRUCTURE)):t&&(t.depObjects.delete(this.weakSelf),this.clearGpuHandles(),this.value=null,this.isSampledTexture=!0,this.isStorageTexture=!1,this._tbInit&&(this.#G=null,this.#L||(this.#R="attribute")),this.onChangeCallback(f.DIRTY_STRUCTURE))}getValue(){return this.value}updateCPUBuffer(){}updateGPUBuffer(A){const t=this.value;t?.isDirty&&!t.isExternalTexture&&t.ensureUploaded(A)}clearGpuHandles(){this.dataView.texture=null}getType(){return this.typeInfo.format}generateShader(A,t,e){return`${this.WGSL_FRAGMENT}\n@group(${A}) @binding(${t}) var ${this.name}:${this.getType()};\n`}generateLayout(A,t,e){const i=this.value,s=i.generateTextureLayout(this,e);return this.setBaseType(i.textureWgslType),this.isStorageTexture=!!i.isStorageTexture,this.isSampledTexture=!this.isStorageTexture,this.isSampledTexture&&!i.isExternalTexture&&null!=i.sampler&&i.assertCompatibleSampler(i.sampler,e),[{binding:t,visibility:this.visibility,...s}]}generateBinding(A,t,e){const i=this.value,s=this.dataView;return i.isExternalTexture?(s.texture=i.createTexture(e.device),[{binding:t,resource:s.texture}]):(i.ensureUploaded(e.device),null!=s.texture&&s.texture===i.view||(s.texture=i.createView(e.device)),[{binding:t,resource:s.texture}])}updateTexture(A){this.value?.updateTexture(A)}}class Xt extends jt{fields=new Map;structDef;mode="struct";isStructBinding=!0;isTrySameBuffer;#Y=!0;get isDirty(){return this.#Y}set isDirty(A){this.#Y=A;for(const t of this.fields.values())t.isDirty=A}constructor(A,t,e={}){super(A,null,e.baseWgslType||"",e),this.mode=e.mode||"struct",this.structDef=new wt(this.typeInfo.name,[],e),this.structDef.useStandardLayout=this.isStandardLayout,this.isTrySameBuffer=e.isTrySameBuffer??!0,t.forEach(A=>{this.addField(A)})}get isSameBuffer(){return this.isTrySameBuffer&&this.typeInfo.bytes===this.typeInfo.cpuTotalElements}initTypeInfo(A,t){A=A||`${h(this.name||"")}`,this.typeInfo={name:A,format:A,alias:A,type:"u8",align:0,size:0,elements:0,itemElements:0,view:c,setData:()=>{},offset:0,stride:0,byteOffset:0,byteStride:0,dataView:null,isChunkLayout:!1,bytes:0,needPadding:!1,totalElements:0,gpuTotalElements:0}}getFields(){return this.fields}addField(A){const t=A.name,e=this.fields;if(e.has(t))return void console.error(`StructUniformStorageBinding ${this.name} has already defined field ${t}`);const i=A.typeInfo;A.depObjects?.add(this.weakSelf),e.set(t,A),A.isStructBinding?this.structDef.addField({name:A.name,format:A.structDef,count:A.count,isArray:A.isArray,isDynamicArray:A.isDynamicArray}):this.structDef.addField({name:A.name,access:A.access?.key,format:i.format,count:A.count,isArray:A.isArray,isDynamicArray:A.isDynamicArray}),this.onChangeCallback(f.DIRTY_STRUCTURE)}removeField(A){const t=this.fields.get(A);t&&(t.depObjects?.delete(this.weakSelf),this.fields.delete(A)),this.structDef.removeField(A),this.onChangeCallback(f.DIRTY_STRUCTURE)}getField(A){return this.fields.get(A)}resetDirty(){return this.isDirty=!1,this}onChangeCallback(A){this.#Y=!0;const t=this.depObjects;A??=f.DIRTY_DATA,t.forEach(e=>{const i=e.deref();null!=i?i.onChangeCallback(A):t.delete(e)})}setValue(A){const t=this.fields;if(l(A))for(const e in A){const i=t.get(e);i&&i.setValue(A[e])}}getValue(){const A={};for(const t of this.fields.values())A[t.name]=t.getValue();return A}isSkipBinding(){for(const A of this.fields.values())if(null!=A.getValue())return!1;return!0}getSlotCount(){return"bindings"===this.mode?this.fields.size:1}syncDataViewInfo(A,t){const e=this.fields,i=this.isStandardLayout,s=this.dataView.offset||0;if(t??=this.dataView.view,this.isTrySameBuffer&&this.typeInfo.bytes===this.typeInfo.cpuTotalElements){const n=A.fields;for(const[A,r]of e){const e=n.get(A),a=e?.meta;if(!a)throw new Error(`StructUniformStorageBinding ${this.name} has no field ${A}`);if(r.isStructBinding){const A=r.dataView;A.view=t,A.offset=s+a.byteOffset,A.size=a.size,A.dataOffset=0,A.ownsBuffer=!1,r.isStandardLayout=i,r instanceof Xt&&r.syncDataViewInfo(r.structDef,t)}else{const A=r.value;if(null==A)continue;const e=t.getView(a.type),i=a.cpuTotalElements||a.totalElements||0,n=A.elements,o=a.offset+s/(e.BYTES_PER_ELEMENT||1);null!=n&&i>0&&e.set(n.subarray(0,i),o),A.setTypeData(e,o)}}}else for(const[n,r]of A.fields){const A=e.get(n);if(!A)continue;const a=r.meta,o=A.dataView;A.isStructBinding?(o.view=t,o.offset=s+a.byteOffset,o.size=a.size,o.dataOffset=o.offset,o.ownsBuffer=!1,A.isStandardLayout=i):(o.offset=s+a.byteOffset,o.size=a.size,o.dataOffset=0,o.ownsBuffer=!1,o.view=t.getUseView(a.type,o.offset,a.size),A.isStandardLayout=i)}}computeLayout(){const A=this.structDef;A.dirtyWatch.isChanged?(A.computeLayout(),Object.assign(this.typeInfo,A.typeInfo),this.dataView.size=A.typeInfo.bytes,super.createCPUBuffer(),this.syncDataViewInfo(A)):this.typeInfo.bytes&&null!=this.dataView.view||(super.createCPUBuffer(),this.syncDataViewInfo(A))}createGPUBuffer(A){return this.computeLayout(),super.createGPUBuffer(A)}updateCPUBuffer(){if(this.computeLayout(),this.isTrySameBuffer&&this.typeInfo.bytes===this.typeInfo.cpuTotalElements){const A=this.dataView.view?.buffer;for(const t of this.fields.values()){if(!t.isDirty)continue;if(this.#Y=!0,t.isStructBinding){t.updateCPUBuffer();continue}const e=t.value?.elements;if(null!=A&&null!=e&&e.buffer!==A){this.syncDataViewInfo(this.structDef);break}}}else for(const A of this.fields.values())A.isDirty&&(A.updateCPUBuffer(),this.#Y=!0)}updateGPUBuffer(A){this.#Y&&(this.computeLayout(),0===this.updateRanges.length&&this.typeInfo.bytes>0&&this.setUpdateRange(0,Math.max(this.count,1)),super.updateGPUBuffer(A))}generateShader(A,t,e){if("bindings"===this.mode){let i=`${this.WGSL_FRAGMENT}\n`;return this.fields.forEach(s=>{i+=s.generateShader(A,t++,e)}),i}const i=`${this.WGSL_FRAGMENT}\n`+this.structDef.toWGSLStructs(),s=super.generateShader(A,t,e);if("struct-module"===this.mode){const A=this.name;let t="\n";for(const e of this.fields.values())t+=`var<private> ${e.name} = ${A}.${e.name};\n`;return i+s+t}return i+s}generateLayout(A,t,e){if("bindings"===this.mode){const i=[];return this.fields.forEach(s=>{i.push(...s.generateLayout(A,t++,e))}),i}return this.computeLayout(),super.generateLayout(A,t,e)}generateBinding(A,t,e){if("bindings"===this.mode){const A=[];return this.fields.forEach(e=>{A.push({binding:t++,resource:e.dataView})}),A}return this.computeLayout(),super.generateBinding(A,t,e)}}class Zt extends jt{fields=new Map;structDef;mode="struct";isStructBinding=!0;isStructBufferBinding=!0;isTrySameBuffer;#Y=!0;get isDirty(){return this.#Y}set isDirty(A){this.#Y=A;for(const t of this.fields.values())t.isDirty=A}get isSameBuffer(){return this.isTrySameBuffer&&this.typeInfo.bytes===this.typeInfo.cpuTotalElements}constructor(A,t,e={}){let i=t;t instanceof wt?(i=t,t=e.isArray||e.isDynamicArray||e.count?new yt(e.count??0,i,e):new Bt(i,{isStandardLayout:e.isStandardLayout})):(i=t.structDef,i.dirtyWatch.isChanged&&i.computeLayout()),super(A,null,i.typeInfo.format||"",e),this.mode=e.mode||"struct",this.structDef=i,this.dataView.view=t,this.isTrySameBuffer=e.isTrySameBuffer??!0;const s=this.typeInfo;Object.assign(s,i.typeInfo);const n=i.typeInfo.bytes||i.typeInfo.size||0;s.byteStride=n,s.size=n,this.isArray||this.isDynamicArray?this.calcWgslType(Math.max(this.count,1)):s.bytes=n,this.dataView.size=s.bytes,this.initValues()}setCount(A,t=!1){super.setCount(A,t),this.dataView.size=this.typeInfo.bytes}getFields(){return this.fields}isSkipBinding(){return!1}getSlotCount(){return"bindings"===this.mode?this.structDef.fields.size:1}initTypeInfo(A,t){A=A||`${h(this.name||"")}`,this.typeInfo={name:A,format:A,alias:A,type:"u8",align:0,size:0,elements:0,itemElements:0,view:c,setData:()=>{},offset:0,stride:0,byteOffset:0,byteStride:0,dataView:null,isChunkLayout:!1,bytes:0,needPadding:!1,totalElements:0,gpuTotalElements:0}}initValues(){const A=this.fields,t=this.structDef,e=t.fields,i=t.typeInfo;if(this.isTrySameBuffer&&i.bytes===i.cpuTotalElements){const t=this.dataView.view;for(const[i,s]of e.entries()){const e=s.meta;if(e.isStruct){const s=new L(t.getView(e.type),e.offset);s.depObject=this,A.set(i,s)}else{const n=(s.initCpuData||e.initCpuData)(t.getView(e.type),e.offset,e.isArray);n.depObject=this,A.set(i,n)}}}else for(const[s,n]of e.entries()){const t=n.meta;if(t.isStruct){const e=new L(new t.view(t.cpuTotalElements),0);e.depObject=this,A.set(s,e)}else{const e=(n.initCpuData||t.initCpuData)(new t.view(t.totalElements),0,t.isArray);e.depObject=this,A.set(s,e)}}}computeLayout(){const A=this.structDef;if(A.dirtyWatch.isChanged){const t=this.typeInfo;A.computeLayout(),Object.assign(t,A.typeInfo);const e=A.typeInfo.bytes||A.typeInfo.size||0;t.byteStride=e,t.size=e,this.isArray||this.isDynamicArray?this.calcWgslType(Math.max(this.count,1)):t.bytes=e,this.dataView.size=t.bytes}}createGPUBuffer(A){return this.computeLayout(),super.createGPUBuffer(A)}resetDirty(){return this.isDirty=!1,this}onChangeCallback(A){this.#Y=!0;const t=this.depObjects;A??=f.DIRTY_DATA,t.forEach(e=>{const i=e.deref();null!=i?i.onChangeCallback(A):t.delete(e)})}updateCPUBuffer(){if(!this.isDirty)return;this.computeLayout();const A=this.structDef,t=A.typeInfo;if(this.isTrySameBuffer&&t.bytes===t.cpuTotalElements)return;const e=A.fields,i=this.dataView.view,s=this.fields;for(const[n,r]of e.entries()){const A=s.get(n);if(null==A)continue;const t=r.meta;t.setData(i.getView(t.type),t.offset,A.elements,0,t.totalElements,t.isStandardLayout||!t.isArray)}}generateShader(A,t,e){const i=this.access,s=this.structDef.fields;if("bindings"===this.mode){let e=`${this.WGSL_FRAGMENT}\n`;for(const[n,r]of s.entries()){const s=r.meta,a=s.isArray,o=s.hasDynamicArray,l=a?o?`array<${s.alias}>`:`array<${s.alias}, ${s.count}>`:s.alias;e+=`@group(${A}) @binding(${t++}) var${i.access} ${n}:${l};\n`}return e}const n=`${this.WGSL_FRAGMENT}\n`+this.structDef.toWGSLStructs(),r=super.generateShader(A,t,e);if("struct-module"===this.mode){const A=this.name;let t="\n";for(const e of s.keys())t+=`var<private> ${e} = ${A}.${e};\n`;return n+r+t}return n+r}generateLayout(A,t,e){const i=this.visibility,s=this.access,n=null!=this.dataView.dynamicOffset;if("bindings"===this.mode){const A=[],e=this.structDef.fields;for(const r of e.values())A.push({binding:t++,visibility:i,buffer:{type:s.bufferType,hasDynamicOffset:n}});return A}return[{binding:t,visibility:i,buffer:{type:s.bufferType,hasDynamicOffset:n}}]}generateBinding(A,t,e){if("bindings"===this.mode){const A=[],e=this.structDef.fields,i=this.dataView,s=i.buffer;for(const n of e.values()){const e=n.meta;A.push({binding:t++,resource:{buffer:s,offset:i.offset+e.byteOffset,size:e.bytes}})}return A}{const A=this.dataView;return A.buffer??=this.createGPUBuffer(e.device),[{binding:t,resource:A}]}}}var _t=(A=>(A[A.Mega=1]="Mega",A[A.Morph=2]="Morph",A[A.Skin=4]="Skin",A))(_t||{});function $t(A,t,e){return A?1:(t?2:0)|(e?4:0)}function Ae(A,t,e,i){let s=t;for(const[,n]of A){const A=n.fixedSlot,t=A??s;n.isSkipBinding()||0===(n.visibility&e)||i(n,t),null==A&&(s+=n.getSlotCount())}}class te extends Lt{isSampledTexture=!0;constructor(A,t){super(A,null,"texture_2d<f32>",{visibility:z.VERTEX,fixedSlot:t})}initTypeInfo(A){this.typeInfo={name:this.name,format:A??"texture_2d<f32>",align:0,size:0,elements:0,itemElements:0,offset:0,byteOffset:0,byteStride:0,stride:0,bytes:0,needPadding:!1,dataView:null,isChunkLayout:!1,totalElements:0,gpuTotalElements:0}}generateShader(A,t){return`${this.WGSL_FRAGMENT}\n@group(${A}) @binding(${this.fixedSlot}) var ${this.name}: ${this.getType()};\n`}isSkipBinding(){return!1}attachView(A){this.dataView.texture=A}generateLayout(A,t){return[{binding:this.fixedSlot,visibility:this.visibility,texture:{sampleType:"unfilterable-float",viewDimension:"2d",multisampled:!1}}]}generateBinding(A,t){return[{binding:this.fixedSlot,resource:this.dataView.texture}]}}class ee extends Lt{isStorageBuffer=!0;fixedSlot;constructor(A,t,e,i=""){super(A,null,"u32",{visibility:z.VERTEX,access:"ReadOnly",isDynamicArray:!0}),this.fixedSlot=t,this.typeInfo.format=e,this.WGSL_FRAGMENT=i}isSkipBinding(){return!1}attachBuffer(A){const t=this.dataView;t.buffer=A,t.offset=0,t.size=A.size}generateShader(A,t){return super.generateShader(A,this.fixedSlot)}generateLayout(A,t){return[{binding:this.fixedSlot,visibility:this.visibility,buffer:{type:"read-only-storage"}}]}generateBinding(A,t){return[{binding:this.fixedSlot,resource:{buffer:this.dataView.buffer}}]}}class ie{type="Group3";id;mask;bindingStartIndex=0;#H=new Map;morphAtlas=new te("morphAtlas",8);morphHeap=new ee("morphHeap",9,"u32");bonePalette=new te("bonePalette",12);skinActive=new ee("skinActive",13,"vec2u");geometryVb=new ee("geometryVb",4,"u32");geometryIb=new ee("geometryIb",5,"u32");constructor(A){this.mask=A,this.id=A;const t=this.#H;1&A&&(t.set("geometryVb",this.geometryVb),t.set("geometryIb",this.geometryIb)),2&A&&(t.set("morphAtlas",this.morphAtlas),t.set("morphHeap",this.morphHeap)),4&A&&(t.set("bonePalette",this.bonePalette),t.set("skinActive",this.skinActive))}getBindings(){return this.#H}attachGeometryMeta(A){this.#H.set("geometryMeta",A)}attachResources(A){const t=this.mask;2&t&&(this.morphAtlas.attachView(A.morphAtlas),this.morphHeap.attachBuffer(A.morphHeap)),4&t&&(this.bonePalette.attachView(A.bonePalette),this.skinActive.attachBuffer(A.skinActive)),1&t&&(this.geometryVb.attachBuffer(A.geometryVb),this.geometryIb.attachBuffer(A.geometryIb))}}class se extends c{unitBytes;maxCount;growFactor;fitFactor;capacity=0;used=0;isAutoGrow;isAutoShrink;get liveCount(){return this.slots.size}slots=new Map;nextSlotId=1;freeData=new Uint32Array(16);freeCount=0;destroyed=!1;isTransferDirty=!1;_highWater=0;_isCalcHighWater=!1;constructor(A){const t=0|A.unitBytes;if(t<=0||3&t)throw new Error("GrowableHeapBuffer: unitBytes must be positive multiple of 4");const e=Math.max(1,A.count||64);super(e*t),this.unitBytes=t,this.maxCount=Math.max(e,A.maxCount??1048576),this.growFactor=A.growFactor??1.2,this.fitFactor=A.fitFactor??.2,this.isAutoGrow=A.isAutoGrow??!0,this.isAutoShrink=A.isAutoShrink??!1,this.capacity=e,this.used=0,this.freeData[0]=0,this.freeData[1]=e,this.freeCount=1}allocate(A){if(this.destroyed||A<=0)return-1;const t=this.#K(A);if(t<0)return-1;const e=this.nextSlotId++;this.slots.set(e,{offset:t,size:A});const i=t+A;return i>this._highWater&&(this._highWater=i,this._isCalcHighWater=!1),e}free(A){const t=this.slots.get(A);t&&(this.slots.delete(A),this.used-=t.size,t.offset+t.size>=this._highWater&&(this._isCalcHighWater=!0),this.#V(t.offset,t.size),this.isAutoShrink&&this.shrinkToFit())}shrinkToFit(A=0){if(this.destroyed||this.fitFactor<=0)return!1;const t=this.capacity,e=this.#J(),i=Math.max(A,e+64);return!(i>=t||i/t>this.fitFactor)&&this.#W(i)}getOffset(A){return this.slots.get(A)?.offset??-1}getSize(A){return this.slots.get(A)?.size??0}isLive(A){return!this.destroyed&&this.slots.has(A)}dispose(){this.destroyed||(this.destroyed=!0,this.slots.clear(),this.freeCount=0,this.used=0,this.capacity=0,this._highWater=0,this._isCalcHighWater=!1,this.freeData=null,super.resize(0))}#K(A){let t=this.#q(A);return t>=0?t:this.isAutoGrow&&this.#X(A)?this.#q(A):-1}#X(A){const t=this.used+A,e=this.capacity;if(t>this.maxCount)return!1;let i=Math.ceil(Math.max(t,e*this.growFactor+64));return i=Math.min(i,this.maxCount),!(i<=e)&&this.#W(i)}#W(A){const t=this.capacity;if(A===t||A<0)return!1;try{super.resize(A*this.unitBytes)}catch{return!1}return this.isTransferDirty=!0,A>t?(this.capacity=A,this.#V(t,A-t),!0):(this.#Z(A),this.capacity=A,!0)}#J(){if(!this._isCalcHighWater)return this._highWater;const A=this.capacity,t=this.freeCount;let e=A;if(t>0){const i=this.freeData,s=2*(t-1),n=i[s+0];n+i[s+1]===A&&(e=n)}return this._highWater=e,this._isCalcHighWater=!1,e}#Z(A){const t=this.freeData;let e=0;for(let i=0,s=this.freeCount;i<s;i++){const s=2*i,n=t[s+0],r=t[s+1];if(n>=A)continue;const a=Math.min(n+r,A)-n;if(a<=0)continue;const o=2*e;t[o+0]=n,t[o+1]=a,e++}this.freeCount=e}#q(A){const t=this.freeData,e=this.freeCount;for(let i=0;i<e;i++){const s=2*i,n=t[s+1];if(n<A)continue;const r=t[s+0];return n===A?(t.copyWithin(s,s+2,2*e),this.freeCount=e-1):(t[s+0]=r+A,t[s+1]=n-A),this.used+=A,r}return-1}#V(A,t){if(t<=0)return;2*this.freeCount>=this.freeData.length&&this.#_();let e=this.freeData,i=this.freeCount,s=0;for(;s<i&&e[2*s+0]<A;)s++;const n=2*s;if(e.copyWithin(n+2,n,2*i),e[n+0]=A,e[n+1]=t,i=++this.freeCount,s+1<i){const A=2*s,t=2*(s+1);e[A+0]+e[A+1]===e[t+0]&&(e[A+1]+=e[t+1],e.copyWithin(t,t+2,2*i),i=--this.freeCount)}if(s>0){e=this.freeData,i=this.freeCount;const A=2*(s-1),t=2*s;e[A+0]+e[A+1]===e[t+0]&&(e[A+1]+=e[t+1],e.copyWithin(t,t+2,2*i),this.freeCount=i-1)}}#_(){const A=this.freeData.length/2,t=Math.max(Math.ceil(A*this.growFactor),A+1);this.freeData=new Uint32Array(this.freeData.buffer.transfer(2*t*4))}}function ne(A,t,e,i,s,n){if(s<=0)return;s>1&&i.subarray(0,s).sort();const r=n*e.BYTES_PER_ELEMENT,a=i[0],o=i[s-1],l=Pt((o-a+1)*r);if(s*Pt(r)>=l){let c=0,h=a,u=a;for(let A=1;A<s;A++){const t=i[A];t<=u+1?u=t:(c+=Pt((u-h+1)*r),h=u=t)}if(c+=Pt((u-h+1)*r),c>=l)return void A.writeBuffer(t,a*r,e,a*n,(o-a+1)*n)}let c=a,h=c;for(let u=1;u<s;u++){const s=i[u];s<=h+1?h=s:(A.writeBuffer(t,c*r,e,c*n,(h-c+1)*n),c=h=s)}A.writeBuffer(t,c*r,e,c*n,(h-c+1)*n)}const re=j.STORAGE|j.COPY_DST,ae=z.VERTEX|z.FRAGMENT;class oe{heap;binding;device;dirtyIds;dirtyCount=0;get gpuView(){return this.heap.f32}get gpuBuffer(){return this.binding.dataView.buffer}constructor(A,t=64){this.device=A,this.heap=new se({unitBytes:16,count:t,maxCount:65534,growFactor:1.5,fitFactor:.35,isAutoGrow:!0}),this.binding=new Ht("clipPlaneSets",this.heap.f32,"f32",{access:"ReadOnly",isArray:!0,isDynamicArray:!0,count:t,usage:re,visibility:ae}),this.binding.setCount(t,!0),this.dirtyIds=new Uint32Array(2*t)}shrinkToFit(A=0){const t=this.heap;if(!t.shrinkToFit(A))return!1;const e=t.capacity,i=this.dirtyIds;return 2*this.dirtyCount<=e&&i.length>e&&(this.dirtyIds=new Uint32Array(i.buffer.transfer(4*e))),!0}allocate(A){const t=Math.min(Math.max(0|A,0),16);return this.heap.allocate(1+t)}free(A){if(A<0)return;const t=this.heap,e=t.slots.get(A);if(!e)return;const i=e.offset;t.f32[4*i]=0,t.free(A),this.writeDirty(i)}writeState(A,t){if(A<0)return;const e=this.heap,i=e.slots.get(A);if(!i)return;const s=e.f32,n=4*i.offset;let r=!1;if(null!=t.enabled){const A=t.enabled?1:0;s[n+1]!==A&&(s[n+1]=A,r=!0)}if(null!=t.clipIntersection){const A=t.clipIntersection?1:0;s[n+2]!==A&&(s[n+2]=A,r=!0)}null!=t.count&&s[n+0]!==t.count&&(s[n+0]=t.count,r=!0),r&&this.writeDirty(i.offset)}getState(A){if(A<0)return null;const t=this.heap,e=t.slots.get(A);if(!e)return null;const i=4*e.offset,s=t.f32;return{enabled:1===s[i+1],clipIntersection:1===s[i+2],count:s[i+0]}}write(A,t){if(A<0)return;const e=this.heap,i=e.slots.get(A);if(!i)return;const s=0|Math.min(t.count,16),n=1+s,r=i.size;if(n>r)throw new Error("ClipPlaneMeta: plane count exceeds the limit");let a=0|t.activeCount;a<0?a=0:a>s&&(a=s);const o=i.offset,l=e.f32;l[4*o]=a;const c=0|t.offset;l.set(t.elements.subarray(c,c+4*s),4*o+4);for(let h=0;h<r;h++)this.writeDirty(o+h)}writeDirty(A){if(A<0)return;let t=this.dirtyIds;this.dirtyCount>=t.length&&(this.dirtyIds=new Uint32Array(t.buffer.transfer(4*Math.max(t.length<<1,this.heap.capacity))),t=this.dirtyIds),t[this.dirtyCount++]=A}update(A){const t=this.device;null!=t&&t!==A&&this.releaseGPU(t),this.device=A;const e=this.heap,i=this.binding;let s=i.dataView.buffer;const n=e.capacity,r=!s||n>i.count||e.isTransferDirty;if(!r&&0===this.dirtyCount)return!1;i.dataView.view=e.f32;let a=!1;return r&&(a=!0,i.setCount(n,!0),s=i.createGPUBuffer(A),e.isTransferDirty=!1),this.flushDirty(a,A,s,n),a}flushDirty(A,t,e,i){const s=this.heap.f32;A?t.queue.writeBuffer(e,0,s,0,4*i):ne(t.queue,e,s,this.dirtyIds,this.dirtyCount,4),this.dirtyCount=0}releaseGPU(A){if(null!=A&&null!=this.device&&this.device!==A)return;const t=this.binding.dataView,e=t.buffer;e&&(It.release(this.device,e),t.buffer=null,t.ownsBuffer=!1)}dispose(){this.releaseGPU(),this.heap.dispose(),this.binding.dispose?.(),this.heap=null,this.dirtyIds=null,this.dirtyCount=0,this.device=null}}const le=(()=>{const A=new Map;for(const t of Object.values(J))t.locationCount||A.set(t.format,t);return A})(),ce=new Map([[J.mat2.wgslType,J.mat2],[J.mat3.wgslType,J.mat3],[J.mat4.wgslType,J.mat4]]),he={u8:1,i8:1,u16:2,i16:2,f16:2,f32:4,u32:4,i32:4},ue=z.VERTEX|z.FRAGMENT,ge=z.COMPUTE,de={position:0,color:1,uv:2,normal:3,tangent:4,uv2:5,instanceMatrix:8,instanceColor:12};let pe=6;const fe={};function me(A){return de[A]??fe[A]}function Ce(A,t){if(null!=de[A])return de[A];if(null!=fe[A])return fe[A];let e=t??pe++;for(;e>=8&&e<=12;)e=pe++;return fe[A]=e,e}function we(A){let t="",e=0,i=A.length;for(;e<i;)if("/"!==A[e]||"/"!==A[e+1]){if("/"===A[e]&&"*"===A[e+1]){e+=2;let s=1;for(;e<i&&s>0;)"/"!==A[e]||"*"!==A[e+1]?"*"!==A[e]||"/"!==A[e+1]?e++:(s--,e+=2):(s++,e+=2);t+=" ";continue}t+=A[e++]}else for(e+=2;e<i&&"\n"!==A[e];)e++;return t}const ye={};function Be(A,t,e,i,s){return"sint"===e||"uint"===e||"unfilterable-float"===e?`let dims = vec2i(textureDimensions(${A})); return vec4f(textureLoad(${A}, clamp(vec2i(suv * vec2f(dims)), vec2i(0), dims - vec2i(1)), ${i}, 0));`:"depth"===e?`return vec4f(textureSampleLevel(${A}, ${t}, suv, ${i}, 0.0));`:s<=1?`return textureSampleLevel(${A}, ${t}, suv, ${i}, 0.0);`:`return textureSampleGrad(${A}, ${t}, suv, ${i}, uvDx, uvDy);`}const Ie=/\b(?:in|out)\.v([A-Z][A-Za-z0-9]*)\b/g,Qe=/\bin\.([A-Za-z_][A-Za-z0-9]*)\b/g;function Ee(A){return"v"+A.charAt(0).toUpperCase()+A.slice(1)}function xe(A,t){return"color"===t?"vec4f(1.0)":"u32"===A?"0u":"i32"===A?"0i":`${A}()`}function De(A){const t=A.getBinding("material");return null!=t?.getField?.("planarProjector")}function Me(A,t){return"attribute"!==A.coordSpace?A.coordSpace:t&&"uv"===A.coordAttr?"planar":"attribute"}const be=new Set(["clipPosition","clipDistances","vNormal","vWorldPos","vColor","vDepthZW","materialRow","clipHeapOffset"]),Se=[{ident:"frontFacing",identRe:/\bfrontFacing\b/,builtin:"front_facing",wgslType:"bool"},{ident:"sampleIndex",identRe:/\bsampleIndex\b/,builtin:"sample_index",wgslType:"u32",needMsaa:!0},{ident:"sampleMaskIn",identRe:/\bsampleMaskIn\b/,builtin:"sample_mask",wgslType:"u32",needMsaa:!0},{ident:"primitiveIndex",identRe:/\bprimitiveIndex\b/,builtin:"primitive_index",wgslType:"u32",enable:"primitive_index"},{ident:"subgroupInvocationId",identRe:/\bsubgroupInvocationId\b/,builtin:"subgroup_invocation_id",wgslType:"u32",enable:"subgroups"},{ident:"subgroupSize",identRe:/\bsubgroupSize\b/,builtin:"subgroup_size",wgslType:"u32",enable:"subgroups"}],ve=[{ident:"globalInvocationId",identRe:/\bglobalInvocationId\b/,builtin:"global_invocation_id",wgslType:"vec3u"},{ident:"globalInvocationIndex",identRe:/\bglobalInvocationIndex\b/,builtin:"global_invocation_index",wgslType:"u32",requires:"linear_indexing"},{ident:"localInvocationId",identRe:/\blocalInvocationId\b/,builtin:"local_invocation_id",wgslType:"vec3u"},{ident:"localInvocationIndex",identRe:/\blocalInvocationIndex\b/,builtin:"local_invocation_index",wgslType:"u32"},{ident:"workgroupId",identRe:/\bworkgroupId\b/,builtin:"workgroup_id",wgslType:"vec3u"},{ident:"workgroupIndex",identRe:/\bworkgroupIndex\b/,builtin:"workgroup_index",wgslType:"u32",requires:"linear_indexing"},{ident:"numWorkgroups",identRe:/\bnumWorkgroups\b/,builtin:"num_workgroups",wgslType:"vec3u"},{ident:"subgroupInvocationId",identRe:/\bsubgroupInvocationId\b/,builtin:"subgroup_invocation_id",wgslType:"u32",enable:"subgroups"},{ident:"subgroupSize",identRe:/\bsubgroupSize\b/,builtin:"subgroup_size",wgslType:"u32",enable:"subgroups"},{ident:"subgroupId",identRe:/\bsubgroupId\b/,builtin:"subgroup_id",wgslType:"u32",enable:"subgroups",requires:"subgroup_id"},{ident:"numSubgroups",identRe:/\bnumSubgroups\b/,builtin:"num_subgroups",wgslType:"u32",enable:"subgroups",requires:"subgroup_id"}];function Te(A,t){let e;const i=t.getAttribute("color");e=i?"vec4f"===i.typeInfo.wgslType||4===i.typeInfo.elements?"\n out.vColor = in.color;":"\n out.vColor = vec4f(in.color, 1.0);":"\n out.vColor = vec4f(1.0);";const s="instanced"===A.drawKind&&A.hasInstanceColor&&!0===A.material?.vertexColors?A.mesh?.instanceColor:void 0;return s&&(e+="vec4f"===s.typeInfo.wgslType||4===s.typeInfo.elements?"\n if (instancedObject.colorStride != 0u) {\n let _cb = instancedObject.colorF32Base + instId * instancedObject.colorStride;\n out.vColor *= vec4f(instancedF32[_cb], instancedF32[_cb + 1u], instancedF32[_cb + 2u], instancedF32[_cb + 3u]);\n }":"\n if (instancedObject.colorStride != 0u) {\n let _cb = instancedObject.colorF32Base + instId * instancedObject.colorStride;\n out.vColor *= vec4f(instancedF32[_cb], instancedF32[_cb + 1u], instancedF32[_cb + 2u], 1.0);\n }"),e}function Ue(A,t,e){switch(A){case"f32":return`bitcast<f32>(megaU32(${e}))`;case"u32":return`megaU32(${e})`;case"i32":return`bitcast<i32>(megaU32(${e}))`;case"f16":return`megaF16(${e})`;case"u16":return t?`f32(megaU16(${e})) / 65535.0`:`megaU16(${e})`;case"i16":return t?`max(f32(megaI16(${e})) / 32767.0, -1.0)`:`megaI16(${e})`;case"u8":return t?`f32(megaU8(${e})) / 255.0`:`megaU8(${e})`;case"i8":return t?`max(f32(megaI8(${e})) / 127.0, -1.0)`:`megaI8(${e})`;default:return"0.0"}}function Ne(A,t,e,i,s){const n=ce.get(e);if(n){const t=n.rowSize,r=n.locationCount,a=t>>>2,o=[];for(let A=0;A<r;A++){const e=[];for(let s=0;s<a;s++)e.push(Ue("f32",!1,`(${i} + ${A*t+4*s}u)`));o.push(1===a?e[0]:`vec${a}f(${e.join(", ")})`)}return`${s}in.${A} = ${e}(${o.join(", ")});\n`}if("unorm8x4-bgra"===t||"bgra"===t)return`${s}in.${A} = unpack4x8unorm(megaU32(${i})).zyxw;\n`;if("unorm10-10-10-2"===t||"unorm10"===t)return`${s}in.${A} = megaUnpackUnorm1010102(megaU32(${i}));\n`;if("unorm8x4"===t)return`${s}in.${A} = unpack4x8unorm(megaU32(${i}));\n`;if("snorm8x4"===t)return`${s}in.${A} = unpack4x8snorm(megaU32(${i}));\n`;if("float16x2"===t)return`${s}in.${A} = unpack2x16float(megaU32(${i}));\n`;if("unorm16x2"===t)return`${s}in.${A} = unpack2x16unorm(megaU32(${i}));\n`;if("snorm16x2"===t)return`${s}in.${A} = unpack2x16snorm(megaU32(${i}));\n`;if("float16x4"===t)return`${s}in.${A} = vec4f(unpack2x16float(megaU32(${i})), unpack2x16float(megaU32(${i} + 4u)));\n`;if("unorm16x4"===t)return`${s}in.${A} = vec4f(unpack2x16unorm(megaU32(${i})), unpack2x16unorm(megaU32(${i} + 4u)));\n`;if("snorm16x4"===t)return`${s}in.${A} = vec4f(unpack2x16snorm(megaU32(${i})), unpack2x16snorm(megaU32(${i} + 4u)));\n`;const r=le.get(t);if(!r)return`${s}in.${A} = ${e}();\n`;const a=r.type,o=r.elements,l=r.normalized,c=he[a]??4,h=[];for(let u=0;u<o;u++)h.push(Ue(a,l,0===u?i:`(${i} + ${u*c}u)`));return 1===o?`${s}in.${A} = ${h[0]};\n`:`${s}in.${A} = ${e}(${h.join(", ")});\n`}function Pe(A,t=!1){const e=t?"sampleTextureLod0":"sampleTexture",i=A.materialTable;if(!i)return"";const s=i.heaps,n=i.samplerHandles;if(0===s.length||0===n.length)return`fn ${e}(_uv: vec2f, _uvScale: vec2f, _texHandle: u32, _sampHandle: u32, empty: vec4f) -> vec4f {\n return empty;\n }`;const r=s[0],a=A=>t?1:A??1,o="let suv = uv * uvScale;\n ",l=!t&&s.some(A=>{return t=A.sampleType,e=A.mipLevelCount??1,"sint"!==t&&"uint"!==t&&"unfilterable-float"!==t&&"depth"!==t&&e>1;var t,e})?"let uvDx = dpdx(uv) * uvScale;\n let uvDy = dpdy(uv) * uvScale;\n ":"";if(1===s.length&&1===n.length)return`fn ${e}(uv: vec2f, uvScale: vec2f, texHandle: u32, _sampHandle: u32, empty: vec4f) -> vec4f {\n ${o}${l}if (texHandle == 0u) { return empty; }\n ${Be("texHeap0","sampHeap0",r.sampleType,"i32(texHandle & 0xffffu)",a(r.mipLevelCount))}\n }`;let c=`fn ${e}(uv: vec2f, uvScale: vec2f, texHandle: u32, sampHandle: u32, empty: vec4f) -> vec4f {\n ${o}${l}if (texHandle == 0u) { return empty; }\n let heap = (texHandle >> 16u) & 0xffu;\n let layer = i32(texHandle & 0xffffu);`;for(let h=0,u=s.length;h<u;h++)for(let A=0,t=n.length;A<t;A++){const t=Be(`texHeap${h}`,`sampHeap${A}`,s[h].sampleType,"layer",a(s[h].mipLevelCount));c+=`if (heap == ${h}u && sampHandle == ${n[A]}u) { ${t} }\n`}return c+=`${Be("texHeap0","sampHeap0",r.sampleType,"layer",a(r.mipLevelCount))}}`,c}function Oe(A){let t=-1;for(let e=0,i=A.length;e<i;e++){const i=A[e].attributes;for(const A of i){const e=A.shaderLocation+(A.locationCount??1)-1;e>t&&(t=e)}}return t+1}function Fe(A,t){if("instanced"!==t.drawKind)return!1;const e=t.geometry;if(!e||e.getVertexSlots().length>=A.device.limits.maxVertexBuffers)throw new Error("ShaderAssembler: instanced packed Mi needs a free vertex buffer slot");return!0}const ke={resolveCommon:(A,t)=>{const e=Fe(A,t),i=t.hasNodeBind?"instancedObject.handlePool":"instancedObject.poolIndex",s=t.hasNodeBind?" * instancedObject.nodeBind":"";let n=e?`var<private> _packedMi: mat4x4<f32>;\n fn unpackPackedMi(p0: vec4f, p1: vec4f, p2: vec4f) -> mat4x4<f32> {\n return mat4x4<f32>(\n vec4f(p0.xyz, 0.0),\n vec4f(p1.xyz, 0.0),\n vec4f(p2.xyz, 0.0),\n vec4f(p0.w, p1.w, p2.w, 1.0),\n );\n }\n fn resolveWorld(_ii: u32) -> mat4x4<f32> {\n return worldMatrices[${i}] * _packedMi${s};\n }`:"fn resolveWorld(ii: u32) -> mat4x4<f32> {\n let poolIndex = instanceIndices[ii];\n return worldMatrices[poolIndex];\n }";if(t.isSupportFamily){const A=t.material?.getBinding("gradientMap"),e=null==A||A.isSkipBinding()?"":`\n${Pe(t,!0)}`;n+=`\n fn materialRowForInstance(instanceIndex: u32) -> u32 {\n let poolIndex = instanceIndices[instanceIndex];\n return instanceMeta[poolIndex].materialSlot;\n }\n fn resolveMaterial(row: u32) -> MaterialRow {\n return materials[row];\n }\n ${Pe(t)}${e}`}return n}};function Re(A,t,e){return`let ${e}A = ${A}[0].xyz;\n let ${e}B = ${A}[1].xyz;\n let ${e}C = ${A}[2].xyz;\n let ${e}BC = cross(${e}B, ${e}C);\n let ${e}Cof = mat3x3f(${e}BC, cross(${e}C, ${e}A), cross(${e}A, ${e}B)) * in.normal;\n ${t} = normalize(select(-${e}Cof, ${e}Cof, dot(${e}A, ${e}BC) >= 0.0));`}function Le(A,t,e){return"normal"===t?"normalize(in.vNormal)":"planar"===t?"planarMapUv(in.vWorldPos, material.planarProjector)":e.attributes.has(A.coordAttr)?`in.${Ee(A.coordAttr)}`:"vec2f(0.0)"}class je{constructor(){}assembleRender(A){const{camera:t,scene:e,common:i,renderer:s,renderObject:n,pipeline:r}=A,a=n.material,o=n.geometry;if(!a||!o)throw new Error("ShaderAssembler.assembleRender: RenderBucket missing material/geometry");const l=n.materialBindingProvider??a,c=this.generateBindingsDecl(t,0,s,ue),h=e?this.generateBindingsDecl(e,0,s,ue):"",u=this.generateBindingsDecl(l,1,s,ue),g=this.generateBindingsDecl(i,2,s,ue),d=n.isMegaPull,p="instanced"===n.drawKind,f=n.hasMorph&&!d,m=n.hasSkin&&!d,C=f&&n.morphHasNormal,w=o.hasAttribute("normal"),y=(m&&o.getAttribute("skinIndex")?.typeInfo.wgslType.includes("u"))??!1,B=$t(d,f,m),I=B?r.ensureGroup3Provider(B):null,Q=I?this.generateBindingsDecl(I,3,s,ue):"",E=p?"instancedObject.poolIndex":"instanceIndices[instanceIndex]",x=f?function(A,t){return"fn morphLoad(linear: u32, width: u32) -> vec3f {\n let uv = vec2i(i32(linear % width), i32(linear / width));\n return textureLoad(morphAtlas, uv, 0).xyz;\n}\n\n"+(A?`struct MorphAcc {\n pos: vec3f,\n nrm: vec3f,\n}\n\nfn morphAccumulate(vid: u32, instanceIndex: u32) -> MorphAcc {\n var out = MorphAcc(vec3f(0.0), vec3f(0.0));\n let poolIndex = ${t};\n let heapOffset = instanceMeta[poolIndex].materialSlot;\n if (heapOffset == 0xffffffffu) { return out; }\n let ib = heapOffset * 2u;\n let pairCount = morphHeap[ib];\n let vertexCount = morphHeap[ib + 1u];\n let span = morphHeap[ib + 2u];\n if (vid >= vertexCount || pairCount == 0u) { return out; }\n let atlasWidth = textureDimensions(morphAtlas).x;\n for (var i = 0u; i < pairCount; i++) {\n let p = ib + 4u + i * 2u;\n let targetIndex = morphHeap[p];\n let weight = bitcast<f32>(morphHeap[p + 1u]);\n let base = targetIndex * span + vid;\n out.pos += morphLoad(base, atlasWidth) * weight;${A?"\n out.nrm += morphLoad(base + vertexCount, atlasWidth) * weight;":""}\n }\n return out;\n}`:`fn morphAccumulate(vid: u32, instanceIndex: u32) -> vec3f {\n var out = vec3f(0.0);\n let poolIndex = ${t};\n let heapOffset = instanceMeta[poolIndex].materialSlot;\n if (heapOffset == 0xffffffffu) { return out; }\n let ib = heapOffset * 2u;\n let pairCount = morphHeap[ib];\n let vertexCount = morphHeap[ib + 1u];\n let span = morphHeap[ib + 2u];\n if (vid >= vertexCount || pairCount == 0u) { return out; }\n let atlasWidth = textureDimensions(morphAtlas).x;\n for (var i = 0u; i < pairCount; i++) {\n let p = ib + 4u + i * 2u;\n let targetIndex = morphHeap[p];\n let weight = bitcast<f32>(morphHeap[p + 1u]);\n out += morphLoad(targetIndex * span + vid, atlasWidth) * weight;\n }\n return out;\n}`)}(C,E):"",D=m?function(A){return`fn loadBone(base: u32, bone: u32, dim: u32) -> mat4x4f {\n let t = base * 4u + bone * 4u;\n let x = i32(t % dim);\n let y = i32(t / dim);\n let c0 = textureLoad(bonePalette, vec2i(x, y), 0);\n let c1 = textureLoad(bonePalette, vec2i(x + 1, y), 0);\n let c2 = textureLoad(bonePalette, vec2i(x + 2, y), 0);\n let c3 = textureLoad(bonePalette, vec2i(x + 3, y), 0);\n return mat4x4f(c0, c1, c2, c3);\n}\n\n\nfn skinMatrix(instanceIndex: u32, joints: vec4u, weights: vec4f) -> mat4x4f {\n let poolIndex = ${A};\n let sid = instanceMeta[poolIndex].flags & 0xffffu;\n if (sid == 0xffffu) { return mat4x4f(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0); }\n let rec = skinActive[sid];\n if (rec.y == 0u) { return mat4x4f(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0); }\n let maxJoint = max(max(joints.x, joints.y), max(joints.z, joints.w));\n if (maxJoint >= rec.y) { return mat4x4f(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0); }\n let b = rec.x;\n let dim = textureDimensions(bonePalette).x;\n return weights.x * loadBone(b, joints.x, dim)\n + weights.y * loadBone(b, joints.y, dim)\n + weights.z * loadBone(b, joints.z, dim)\n + weights.w * loadBone(b, joints.w, dim);\n}\n`}(E):"",M=p?n.mesh:void 0,b=M?this.generateBindingsDecl(M,3,s,ue):"",S=d?null:n.mesh?.vertexStreams??null,v=Fe(s,n);let T=0;v&&(T=Oe(o.getVertexSlots()));const U=v?`, @location(${N=T}) packed0: vec4f, @location(${N+1}) packed1: vec4f, @location(${N+2}) packed2: vec4f`:"";var N;const P=d?function(A,t=!1){return`\nfn megaU32(byteOff: u32) -> u32 {\n return geometryVb[byteOff >> 2u];\n}\nfn megaU8(byteOff: u32) -> u32 {\n return (megaU32(byteOff) >> ((byteOff & 3u) * 8u)) & 0xffu;\n}\nfn megaI8(byteOff: u32) -> i32 {\n return bitcast<i32>(megaU8(byteOff) << 24u) >> 24u;\n}\nfn megaU16(byteOff: u32) -> u32 {\n return (megaU32(byteOff) >> ((byteOff & 3u) * 8u)) & 0xffffu;\n}\nfn megaI16(byteOff: u32) -> i32 {\n return bitcast<i32>(megaU16(byteOff) << 16u) >> 16u;\n}\nfn megaF16(byteOff: u32) -> f32 {\n let pair = unpack2x16float(megaU32(byteOff & ~3u));\n return select(pair.x, pair.y, (byteOff & 2u) != 0u);\n}\nfn megaUnpackUnorm1010102(w: u32) -> vec4f {\n return vec4f(\n f32(w & 0x3ffu) / 1023.0,\n f32((w >> 10u) & 0x3ffu) / 1023.0,\n f32((w >> 20u) & 0x3ffu) / 1023.0,\n f32(w >> 30u) / 3.0,\n );\n}\n${t?"fn megaLoadIndex(geo: GeometryMeta, vertexIndex: u32) -> u32 {\n // 每个三角形 (a,b,c) → (a,b)(b,c)(c,a)。vertexIndex 是边端点,不是三角形下标。\n let slot = vertexIndex % 6u;\n let corner = slot >> 1u;\n let e = select(corner, (corner + 1u) % 3u, (slot & 1u) != 0u);\n let srcI = geo.firstIndex + (vertexIndex / 6u) * 3u + e;\n if (geo.indexCount == 0u) {\n return srcI;\n }\n if (geo.indexFormat == 1u) {\n return geometryIb[(geo.ibOffset + srcI * 4u) >> 2u] + geo.baseVertex;\n }\n let byteOff = geo.ibOffset + srcI * 2u;\n let word = geometryIb[byteOff >> 2u];\n let raw = select(word & 0xffffu, word >> 16u, (byteOff & 2u) != 0u);\n return raw + geo.baseVertex;\n}":"fn megaLoadIndex(geo: GeometryMeta, vertexIndex: u32) -> u32 {\n if (geo.indexCount == 0u) {\n return geo.firstIndex + vertexIndex;\n }\n let i = geo.firstIndex + vertexIndex;\n if (geo.indexFormat == 1u) {\n return geometryIb[(geo.ibOffset + i * 4u) >> 2u] + geo.baseVertex;\n }\n let byteOff = geo.ibOffset + i * 2u;\n let word = geometryIb[byteOff >> 2u];\n let raw = select(word & 0xffffu, word >> 16u, (byteOff & 2u) != 0u);\n return raw + geo.baseVertex;\n}"}\n`}(0,n.wireframe):"";let O=we(a.buildShader(s,n,r,ke,!0));const F=O,k=!/\bstruct\s+VertexOutput\s*\{/.test(O),R=n?.clipPipelineMode??"off",L=k&&"off"!==R,j=L?R:null,z=function(A,t,e){const i=A.material,s=A.geometry,n=De(i);let r=!0===i.needsLighting,a=r||n||"hybrid"===e||"soft"===e;/\bapplyVolume\b/.test(t)&&(r=!1);let o=!1,l=!0===i.vertexColors&&(s.attributes.has("color")||"instanced"===A.drawKind&&A.hasInstanceColor);const c=new Set;for(const f of i.getBindings().values()){if(f.isSkipBinding())continue;if(f.isSampledTexture&&!f.isStorageTexture){const A=Me(f,n);if("normal"===A){r=!0;continue}if("planar"===A){a=!0;continue}}const A=f.shaderIoAttrs();for(let t=0,e=A.length;t<e;t++)s.attributes.has(A[t])&&c.add(A[t])}let h;for(Ie.lastIndex=0;null!==(h=Ie.exec(t));){const A=h[1];"WorldPos"!==A?"Normal"!==A?"Color"!==A?"DepthZW"!==A?c.add(A.charAt(0).toLowerCase()+A.slice(1)):o=!0:l=!0:r=!0:a=!0}const u=[];for(const f of c)"position"!==f&&"normal"!==f&&"color"!==f&&u.push(f);u.sort();const g=[];A.isSupportFamily&&g.push({ident:"materialRow",type:"u32",interpolate:"flat",vsAssign:"flatRow"}),r&&g.push({ident:"vNormal",type:"vec3f",vsAssign:"worldNormal",attr:"normal"});for(let f=0,m=u.length;f<m;f++){const A=u[f],t=s.getAttribute(A)?.typeInfo.wgslType??"vec2f",e="u32"===t||"i32"===t||t.endsWith("u")||t.endsWith("i");g.push({ident:Ee(A),type:t,interpolate:e?"flat":void 0,vsAssign:"passthrough",attr:A})}if(l&&g.push({ident:"vColor",type:"vec4f",vsAssign:"color",attr:"color"}),"hybrid"!==e&&"soft"!==e||g.push({ident:"clipHeapOffset",type:"u32",interpolate:"flat",vsAssign:"clipHeap"}),a&&g.push({ident:"vWorldPos",type:"vec3f",vsAssign:"worldPos"}),o&&g.push({ident:"vDepthZW",type:"vec2f",vsAssign:"depthZW"}),g.length>16)throw new Error(`ShaderAssembler: inter-stage locations ${g.length} > 16`);const d=new Set(["position"]);for(let f=0,m=g.length;f<m;f++){const A=g[f].attr;A&&d.add(A)}let p;for(A.hasSkin&&(d.add("skinIndex"),d.add("skinWeight"),s.attributes.has("normal")&&d.add("normal")),A.hasMorph&&A.morphHasNormal&&d.add("normal"),Qe.lastIndex=0;null!==(p=Qe.exec(t));){const A=p[1];s.attributes.has(A)&&d.add(A)}return{varyings:g,vsReadSet:d,hasColor:l}}(n,O,j);a.extraVaryings.length>0&&function(A,t,e){if(!e)throw new Error("ShaderAssembler: extraVaryings 需要默认 VertexOutput");const i=new Map;for(let n=0;n<t.length;n++){const A=t[n],e=A.assign.trim().replace(/;+\s*$/,"");if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(A.name)||be.has(A.name)||i.has(A.name)||!A.type||!e)throw new Error(`ShaderAssembler: varying '${A.name}' 不可用`);i.set(A.name,{name:A.name,type:A.type,assign:e})}const s=A.varyings;for(let n=s.length-1;n>=0;n--)i.has(s[n].ident)&&s.splice(n,1);for(const n of i.values()){const t="u32"===n.type||"i32"===n.type||n.type.endsWith("u")||n.type.endsWith("i");s.push({ident:n.name,type:n.type,interpolate:t?"flat":void 0,vsAssign:"extra",expr:n.assign});const e=/\bin\.([A-Za-z_][A-Za-z0-9]*)\b/g;let i;for(;null!==(i=e.exec(n.assign));)A.vsReadSet.add(i[1])}if(s.length>16)throw new Error(`ShaderAssembler: inter-stage locations ${s.length} > 16`)}(z,a.extraVaryings,k);const G=this.generateVertexInputStruct(o,!0,!d,p||d?null:S,d?z.vsReadSet:void 0),Y=function(A,t,e){const i=[];let s=!1,n=!1,r=!1;for(let o=0,l=Se.length;o<l;o++){const t=Se[o];t.identRe.test(A)&&(i.push(`@builtin(${t.builtin}) ${t.ident}: ${t.wgslType}`),t.needMsaa?s=!0:"primitive_index"===t.enable?n=!0:"subgroups"===t.enable&&(r=!0))}if(s&&t.sampleCount<2)throw new Error("ShaderAssembler: sampleIndex / sampleMaskIn 需要 RenderContext.sampleCount > 1");if(n&&!e.features.has(MA.PrimitiveIndex))throw new Error("ShaderAssembler: primitiveIndex 需要 GPUFeatureName.PrimitiveIndex (primitive-index)");if(r&&!e.features.has(MA.Subgroups))throw new Error("ShaderAssembler: subgroupInvocationId / subgroupSize 需要 GPUFeatureName.Subgroups");const a=[];return n&&a.push("enable primitive_index;"),r&&a.push("enable subgroups;"),{params:i.length>0?`, ${i.join(", ")}`:"",directives:a.length>0?a.join("\n"):""}}(O,n.renderContext,s.device),H=A.fragmentLayout??kA(n.renderContext);NA(H)&&(O=O.replace(/\bstruct\s+FragmentOutput\s*\{[\s\S]*?\}\s*;?/g,""));const K=/\bstruct\s+FragmentOutput\s*\{/.test(O),{returnType:V,injectStruct:J}=K?{returnType:"FragmentOutput",injectStruct:""}:function(A){if("scalar"===A.mode){const t=A.colors[0];return{returnType:`@location(${t.location}) ${t.wgslType}`,injectStruct:""}}const t=[];for(let e=0,i=A.colors.length;e<i;e++){const i=A.colors[e];t.push(`@location(${i.location}) ${i.field}: ${i.wgslType},`)}return A.builtins.fragDepth&&t.push("@builtin(frag_depth) fragDepth: f32,"),A.builtins.sampleMask&&t.push("@builtin(sample_mask) sampleMask: u32,"),{returnType:"FragmentOutput",injectStruct:`struct FragmentOutput {\n${t.join("\n")}\n};\n`}}(H),W=function(A,t,e,i,s,n,r,a,o,l,c,h){const u=c.length>0&&!s,g=n||r||u,d=s?`@vertex fn vertexMain(@builtin(instance_index) instanceIndex: u32, @builtin(vertex_index) vertexIndex: u32${h}) -> VertexOutput`:`@vertex fn vertexMain(${g?"@builtin(instance_index) instanceIndex: u32, @builtin(vertex_index) vertexIndex: u32, inSrc: VertexInput":"@builtin(instance_index) instanceIndex: u32, @builtin(vertex_index) vertexIndex: u32, in: VertexInput"}${h}) -> VertexOutput`;let p="";return n?p+=a?"var in = inSrc;\n let morph = morphAccumulate(vertexIndex, instanceIndex);\n in.position = in.position + morph.pos;\n in.normal = normalize(in.normal + morph.nrm);\n ":"var in = inSrc;\n in.position = in.position + morphAccumulate(vertexIndex, instanceIndex);\n ":g&&(p+="var in = inSrc;\n "),r&&(p+=`${l?"let j = in.skinIndex;":"let j = vec4u(u32(in.skinIndex.x), u32(in.skinIndex.y), u32(in.skinIndex.z), u32(in.skinIndex.w));"}\n let skin = skinMatrix(instanceIndex, j, in.skinWeight);\n in.position = (skin * vec4f(in.position, 1.0)).xyz;\n ${o?`${Re("skin","in.normal","_s")}\n `:""}`),u&&(p+=`${c}\n `),p+=function(A,t,e,i,s=""){const n=A.geometry,r=i?"_packedMi = unpackPackedMi(packed0, packed1, packed2);\n ":"";let a;A.isMegaPull?(a=function(A,t,e){let i="out.clipPosition = vec4f(0.0, 0.0, 2.0, 1.0);\n";const s=t.varyings;for(let n=0,r=s.length;n<r;n++){const A=s[n];i+=`out.${A.ident} = ${xe(A.type,A.vsAssign)};\n`}return"hybrid"===e&&(i+=`out.clipDistances = array<f32, 8>(${Array(8).fill("0.0").join(", ")});\n`),`var out: VertexOutput;\n let _megaPoolIndex = instanceIndices[instanceIndex];\n let _megaGeo = geometryMeta[instanceMeta[_megaPoolIndex].geometrySlot];\n ${A.wireframe?"let _megaSrc = select(_megaGeo.vertexCount, _megaGeo.indexCount, _megaGeo.indexCount > 0u);\n let _megaDrawCount = (_megaSrc / 3u) * 6u;":"let _megaDrawCount = select(_megaGeo.vertexCount, _megaGeo.indexCount, _megaGeo.indexCount > 0u);"}\n if (vertexIndex >= _megaDrawCount) {\n ${i}return out;\n }\n var in: VertexInput;\n${function(A,t,e){const i=A.getVertexSlots();let s=`${t}let vtx = megaLoadIndex(_megaGeo, vertexIndex);\n`;for(let n=0;n<i.length;n++){const A=i[n],r=A.arrayStride>>>0;for(const i of A.attributes){if(!e.has(i.attrName))continue;const A=`(_megaGeo.vbOffset${n} + vtx * ${r}u + ${i.offset>>>0}u)`;s+=Ne(i.attrName,i.format,i.wgslType,A,t)}}return s}(A.geometry," ",t.vsReadSet)}\n`}(A,t,e),a+=r,s&&(a+=`${s}\n `),a+=A.isSupportFamily?"let worldMatrix = resolveWorld(instanceIndex);\n let materialRow = materialRowForInstance(instanceIndex);\n let materialRowData = resolveMaterial(materialRow);\n let material = materialRowData.material;\n out.materialRow = materialRow;":"let worldMatrix = resolveWorld(instanceIndex);"):"instanced"===A.drawKind?(a=r+"var out: VertexOutput;\n let worldMatrix = resolveWorld(instanceIndex);",A.hasInstanceColor&&!0===A.material?.vertexColors&&(a+="\n let instId = instancedVisible[instancedObject.visibleBase + instanceIndex];")):(a=r,a+=A.isSupportFamily?"var out: VertexOutput;\n let worldMatrix = resolveWorld(instanceIndex);\n let materialRow = materialRowForInstance(instanceIndex);\n let materialRowData = resolveMaterial(materialRow);\n let material = materialRowData.material;\n out.materialRow = materialRow;":"var out: VertexOutput;\n let worldMatrix = resolveWorld(instanceIndex);");const o="hybrid"===e||"soft"===e;o&&(a+="\n let _clipWorldPos = (worldMatrix * vec4f(in.position, 1.0)).xyz;",a+="instanced"===A.drawKind?"\n let _clipHeapOffset = instancedObject.clipPacked;":"\n let _clipHeapOffset = clipHeapOffsetForInstance(instanceIndex);",a+="\n out.clipHeapOffset = _clipHeapOffset;",a+="\n out.vWorldPos = _clipWorldPos;","hybrid"===e&&(a+="\n out.clipDistances = evaluateClipDistances(_clipWorldPos, _clipHeapOffset);"));const l=t.varyings;for(let c=0,h=l.length;c<h;c++){const t=l[c];switch(t.vsAssign){case"flatRow":case"clipHeap":case"depthZW":break;case"worldPos":o||(a+="\n out.vWorldPos = (worldMatrix * vec4f(in.position, 1.0)).xyz;");break;case"worldNormal":a+=n.attributes.has("normal")?`\n ${Re("worldMatrix","out.vNormal","_n")}`:"\n out.vNormal = vec3f(0.0, 0.0, 1.0);";break;case"color":a+=Te(A,n);break;case"passthrough":a+=n.attributes.has(t.attr)?`\n out.${t.ident} = in.${t.attr};`:`\n out.${t.ident} = ${xe(t.type)};`;break;case"extra":a+=`\n out.${t.ident} = ${t.expr};`}}return a}(A,t,e,i,u?"":c),{signature:d,body:p}}(n,z,j,v,d,f,m,C,w,y,a.vertexDisplaceWgsl,U),q=`@fragment fn fragmentMain(${"hybrid"===j?"in: FragmentInput":"in: VertexOutput"}${Y.params}) -> ${V}`;let X=O.replace(/(?:@vertex\s*)?fn\s+vertexMain\b[^{}]*\{/,()=>{const A=k?`${function(A,t,e){let i="",s=0;const n=t.varyings;for(let r=0,a=n.length;r<a;r++){const A=n[r];i+=`@location(${s++})${"flat"===A.interpolate?" @interpolate(flat)":""} ${A.ident}: ${A.type},\n`}return"hybrid"===e?`struct VertexOutput {\n@builtin(position) clipPosition: vec4f,\n@builtin(clip_distances) clipDistances: array<f32, 8>,\n${i}};\nstruct FragmentInput {\n@builtin(position) clipPosition: vec4f,\n${i}};`:`struct VertexOutput {\n@builtin(position) clipPosition: vec4f,\n${i}};`}(0,z,j)}\n`:"";return`${A}${W.signature} {\n ${W.body}\n `});if(X===O)throw new Error("ShaderAssembler: missing vertexMain entry to rewrite");const Z=X.replace(/(?:@fragment\s*)?fn\s+fragmentMain\b[^{}]*\{/,()=>`${J}${q} {\n ${function(A,t,e){const i=A.material,s=A.geometry,n=De(i),r=A.isSupportFamily;let a=r?"let materialRowData = resolveMaterial(in.materialRow);\n let material = materialRowData.material;\n":"";for(const o of i.getBindings().values()){if(!o.isSampledTexture||o.isStorageTexture)continue;const A=o.name,t=o;if(t.deferSample)continue;const e=t.emptySample;if(o.isSkipBinding()){a+=` let ${A}Sample = ${e};\n`;continue}const l=Me(t,n);if(r&&"normal"===l)throw new Error(`ShaderAssembler: family 2d-array heap 不支持 coordSpace='normal'(binding '${A}')`);const c=Le(t,l,s);if(r)a+=` let ${A}Sample = sampleTexture(${c}, materialRowData.${A}UvScale, materialRowData.${A}Index, materialRowData.${A}SamplerIndex, ${e});\n`;else{const t=i.getBinding(`${A}Sampler`);a+=t&&!t.isSkipBinding()?` let ${A}Sample = textureSample(${A}, ${A}Sampler, ${c});\n`:` let ${A}Sample = ${e};\n`}}return a+=t.hasColor?" let vertexColor = in.vColor;\n":" let vertexColor = vec4f(1.0);\n","hybrid"===e?a+=" softClipDiscard(in.vWorldPos, in.clipHeapOffset, 8u);\n":"soft"===e&&(a+=" softClipDiscard(in.vWorldPos, in.clipHeapOffset, 0u);\n"),a}(n,z,j)}\n `);if(Z===X)throw new Error("ShaderAssembler: missing fragmentMain entry to rewrite");O=Z,K||"struct"!==H.mode||(O=function(A,t){const e=/@fragment\s+fn\s+fragmentMain\b[^{]*\{/.exec(A);if(!e||null==e.index)return A;const i=e.index+e[0].length;let s=1,n=i;const r=A.length;for(;n<r&&s>0;){const t=A.charCodeAt(n++);123===t?s++:125===t&&s--}if(0!==s)return A;const a=n-1,o=A.slice(i,a),l=NA(t);if(!l&&/\bFragmentOutput\b/.test(o))return A;const c=l?function(A,t){const e="f32"===t.colors[1].wgslType?"_oitA":"vec4f(_oitA)",i=[];t.builtins.fragDepth&&i.push("in.clipPosition.z"),t.builtins.sampleMask&&i.push("0xffffffffu");const s=i.length>0?`, ${i.join(", ")}`:"";return A.replace(/\breturn\s+([^;]+);/g,(A,t)=>{const i=t.trim(),n=/^FragmentOutput\s*\(/.test(i)?function(A){const t=A.indexOf("(");if(t<0)return null;let e=1,i=t+1;const s=i,n=A.length;for(;i<n&&e>0;){const t=A.charCodeAt(i);if(40===t)e++;else if(41===t){if(e--,0===e)break}else if(44===t&&1===e)break;i++}if(1!==e&&0!==e)return null;const r=A.slice(s,i).trim();return r.length>0?r:null}(i):null;return`let _oitC = (${n??i});\n let _oitA = _oitC.a;\n let _oitW = wboitWeight(in.clipPosition.z, _oitA);\n return FragmentOutput(vec4f(_oitC.rgb * _oitA * _oitW, _oitA * _oitW), ${e}${s});`})}(o,t):o.replace(/\breturn\s+([^;]+);/g,(A,e)=>`return ${function(A,t){const e=[],i=t.colors;for(let s=0,n=i.length;s<n;s++)e.push(0===s?A:`${i[s].wgslType}(0)`);return t.builtins.fragDepth&&e.push("in.clipPosition.z"),t.builtins.sampleMask&&e.push("0xffffffffu"),`FragmentOutput(${e.join(", ")})`}(e.trim(),t)};`);return c===o?A:A.slice(0,i)+c+A.slice(a)}(O,H));const _=[];L&&"hybrid"===R&&_.push("enable clip_distances;"),Y.directives&&_.push(Y.directives),a.injectWgslFragment&&_.push(a.injectWgslFragment),O=O.replace(/camera\.viewProjectionMatrix\s*\*\s*([^;]+);/g,"stableClip($1);");const $=O.includes("stableClip(")||O.includes("stableView(");_.push("// ── group(0): camera ──",c),$&&_.push("\nfn dropOneDecimal(x: f32) -> f32 {\n let bits = bitcast<u32>(x);\n return bitcast<f32>((bits + 0x8u) & 0xFFFFFFF0u);\n}\nfn dropOneDecimal3(v: vec3f) -> vec3f {\n return vec3f(dropOneDecimal(v.x), dropOneDecimal(v.y), dropOneDecimal(v.z));\n}\nfn stableView(worldPos: vec3f) -> vec4f {\n let rel = dropOneDecimal3(worldPos - camera.cameraPosition);\n var viewPos = camera.viewMatrix * vec4f(rel, 0.0);\n viewPos.w = 1.0;\n return viewPos;\n}\nfn stableClip(worldPoint: vec4f) -> vec4f {\n let rel = dropOneDecimal3(worldPoint.xyz - camera.cameraPosition * worldPoint.w);\n return camera.viewProjectionMatrix * vec4f(rel, 0.0) + camera.projectionMatrix[3] * worldPoint.w;\n}\n"),h&&_.push("// ── group(0): scene ──",h),L&&_.push("// ── clip helpers ──",function(A){if("off"===A)return"";const t="\nconst CLIP_NONE: u32 = 65535u;\nconst CLIP_MAX_PLANES: u32 = 16u;\n\n/** InstanceMeta.flags>>16 → clipPlaneSets 堆内 vec4 offset。 */\nfn clipHeapOffsetForInstance(ii: u32) -> u32 {\n let poolIndex = instanceIndices[ii];\n return instanceMeta[poolIndex].flags >> 16u;\n}\n\n/**\n * 默认模式:任一平面外侧即 discard;hybrid 从第 9 个平面继续。\n * clipIntersection:全部平面都在外侧才 discard;HW 不参与,始终从 0 扫全部。\n */\nfn softClipDiscard(worldPos: vec3f, heapOffset: u32, start: u32) {\n // .y 是全局启用开关,关闭裁剪直接返回\n if (heapOffset == CLIP_NONE) { return; }\n let state = clipPlaneSets[heapOffset];\n if (state.y == 0.0) { return; }\n let n = min(u32(state.x), CLIP_MAX_PLANES);\n if (n == 0u) { return; }\n let wp = vec4f(worldPos, 1.0);\n\n if (state.z != 0.0) {\n for (var i = 0u; i < n; i++) {\n // 只要有一个平面不在外侧,就不满足“全部在外”的裁剪条件。\n if (dot(wp, clipPlaneSets[heapOffset + 1u + i]) >= 0.0) { return; }\n }\n discard;\n return;\n }\n\n var i = start;\n loop {\n if (i >= n) { break; }\n if (dot(wp, clipPlaneSets[heapOffset + 1u + i]) < 0.0) { discard; }\n i = i + 1u;\n }\n}\n";return"soft"===A?t:`\nconst CLIP_INACTIVE: f32 = 1e30;\nconst CLIP_HW_SLOTS: u32 = 8u;\n${t}\n\nfn evaluateClipDistances(worldPos: vec3f, heapOffset: u32) -> array<f32, 8> {\n var cd: array<f32, 8>;\n for (var i = 0u; i < CLIP_HW_SLOTS; i++) { cd[i] = CLIP_INACTIVE; }\n // .y 是全局启用开关,关闭裁剪直接返回\n if (heapOffset == CLIP_NONE) { return cd; }\n let state = clipPlaneSets[heapOffset];\n if (state.y == 0.0) { return cd; }\n // intersection 无法表达为独立 clip distances,交给 FS 从 0 扫全部平面。\n if (state.z != 0.0) { return cd; }\n let n = min(u32(state.x), CLIP_HW_SLOTS);\n let wp = vec4f(worldPos, 1.0);\n for (var i = 0u; i < n; i++) {\n cd[i] = dot(wp, clipPlaneSets[heapOffset + 1u + i]);\n }\n return cd;\n}\n`}(R)),De(a)&&_.push("// ── planar map uv ──","fn planarMapUv(worldPos: vec3f, projector: mat4x4f) -> vec2f {\n let c = projector * vec4f(worldPos, 1.0);\n if (abs(c.w) < 1e-5) { return vec2f(-1.0); }\n return c.xy / c.w;\n}\n"),NA(H)&&_.push("// ── wboit weight ──","fn wboitWeight(z: f32, a: f32) -> f32 {\n return a * clamp(pow(min(1.0, a * 10.0) + 0.01, 3.0) * 1e8 * pow(z * 0.9 + 0.1, 3.0), 1e-2, 3e3);\n}\n"),_.push("// ── group(1): material ──",u,"// ── group(2): common ──",g),Q&&_.push("// ── group(3): engine ──",Q),b&&_.push("// ── group(3): instanced object ──",b),x&&_.push("// ── morph helpers ──",x),D&&_.push("// ── skin helpers ──",D),_.push("// ── common contracts ──",ke.resolveCommon(s,n,r,!0),"// ── vertex input ──",G),P&&_.push("// ── mega pull helpers ──",P),function(A,t,e){const i=$A(t);if(!e){if(i)throw new Error("ShaderAssembler: registerMaterialShade 必须在创建材质之前调用");return}if(qA.test(t)){if(i)throw new Error("ShaderAssembler: 自定义着色不要和 applyVolume 写在一起");if(WA.test(t)||KA.test(t)||JA.test(t)||VA.test(t)||/\bapplyLighting(?:Baked)?\b|\bapplyPhysical\b/.test(t))throw new Error("ShaderAssembler: applyVolume 不要和其它光照函数写在一起");return A.push("// ── lighting ──",function(A){const t=A.indexOf("fn shadePunctual(");if(t<0||A.indexOf("fn shadePunctual(",t+1)>=0)throw new Error("Volume: shadePunctual missing");let e=0,i=-1;for(let o=A.indexOf("{",t);o>=0&&o<A.length;o++){const t=A.charCodeAt(o);if(123===t)e++;else if(125===t&&(e--,0===e)){i=o+1;break}}if(!(i>t?A.slice(t,i):"").includes("roughness >= 0.99"))throw new Error("Volume: shadePunctual is not the GGX body");let s=A.slice(0,t)+"\nfn shadePunctual(\n N: vec3f, V: vec3f, L: vec3f, radiance: vec3f,\n albedo: vec3f, roughness: f32, metal: f32,\n F0: vec3f,\n) -> vec3f {\n return albedo * radiance;\n}\n"+A.slice(i);const n="if (ltcIsBackface(P, p0, p1, p3)) { return vec3f(0.0); }",r=s.indexOf(n);if(r<0)return s;if(s.indexOf(n,r+56)>=0)throw new Error("Volume: rect marker duplicated");const a=s.indexOf("return albedo * (1.0 - metal) * rad * ff.y + fresnel * rad * ff.x;",r);if(a<0)throw new Error("Volume: rect return missing");return s=s.slice(0,r)+"if (ltcIsBackface(P, p0, p1, p3)) { return vec3f(0.0); }\n let rad = color * (intensity * win);\n let c0 = normalize(p0 - P);\n let c1 = normalize(p1 - P);\n let c2 = normalize(p2 - P);\n let c3 = normalize(p3 - P);\n var ffv = ltcEdgeVectorFormFactor(c0, c1);\n ffv += ltcEdgeVectorFormFactor(c1, c2);\n ffv += ltcEdgeVectorFormFactor(c2, c3);\n ffv += ltcEdgeVectorFormFactor(c3, c0);\n return albedo * rad * ltcClippedSphereFormFactor(abs(ffv));"+s.slice(a+66),s}(tt())),void A.push("\nfn volumeDirect(P: vec3f, albedo: vec3f) -> vec3f {\n let N = vec3f(0.0);\n let V = vec3f(0.0, 0.0, 1.0);\n let F0 = vec3f(0.0);\n var rgb = vec3f(0.0);\n let dirCount = min(lightHeader.dirCount, 4u);\n for (var i = 0u; i < dirCount; i++) {\n let off = lightHeader.dirSlots[i];\n rgb += shadeLightAt(P, N, V, off, albedo, 1.0, 0.0, F0) * sampleShadow(off, P, N);\n }\n let unbCount = min(lightHeader.unboundedCount, 4u);\n for (var i = 0u; i < unbCount; i++) {\n let off = lightHeader.unbSlots[i];\n rgb += shadeLocalAt(P, N, V, off, albedo, 1.0, 0.0, F0);\n }\n let nLocal = lightHeader.localCount;\n if (nLocal > 0u && nLocal <= 32u) {\n for (var i = 0u; i < nLocal; i++) {\n rgb += shadeLocalAt(P, N, V, localDirectOff(i), albedo, 1.0, 0.0, F0);\n }\n } else if (nLocal > 0u) {\n let base = worldClusterBase(P);\n if (base != 0xffffffffu) {\n let maxPer = clusterParams.maxPerCell;\n let cnt = min(clusterCells[base + 3u], maxPer);\n for (var i = 0u; i < cnt; i++) {\n let off = clusterCells[base + 4u + i];\n rgb += shadeLocalAt(P, N, V, off, albedo, 1.0, 0.0, F0);\n }\n }\n }\n return rgb;\n}\n\nfn applyVolume(\n entry: vec3f, exit: vec3f,\n albedo: vec3f, density: f32, emissive: vec3f,\n stepsIn: f32, dither: f32, fragXy: vec2f,\n) -> vec4f {\n let delta = exit - entry;\n let rayLen = length(delta);\n let sigma = max(density, 0.0);\n if (rayLen < 1e-4 || sigma <= 0.0) { return vec4f(0.0); }\n let steps = min(max(u32(stepsIn + 0.5), 1u), 16u);\n let stepLen = rayLen / f32(steps);\n let dir = delta / rayLen;\n let ign = fract(52.9829189 * fract(dot(fragXy, vec2f(0.06711056, 0.00583715))));\n let jitter = mix(0.5, ign, saturate(dither));\n var T = 1.0;\n var rgb = vec3f(0.0);\n for (var i = 0u; i < 16u; i++) {\n if (i >= steps || T < 0.004) { break; }\n let travelled = min((f32(i) + jitter) * stepLen, rayLen);\n let P = entry + dir * travelled;\n rgb += volumeDirect(P, albedo) * sigma * stepLen * T;\n T *= exp(-sigma * stepLen);\n }\n let absorb = 1.0 - T;\n if (absorb < 1e-4) { return vec4f(0.0); }\n var constant = albedo * lightHeader.ambient;\n let hemiSlot = lightHeader.hemiSlot;\n if (hemiSlot != LIGHT_NONE) {\n constant += shadeLightAt(exit, vec3f(0.0), vec3f(0.0, 0.0, 1.0), hemiSlot, albedo, 1.0, 0.0, vec3f(0.0));\n }\n let iblI = sceneParams.iblIntensity;\n if (iblI > 0.0) {\n constant += textureSampleLevel(envIrradiance, envSampler, vec3f(0.0, 1.0, 0.0), 0.0).rgb * albedo * iblI;\n }\n rgb += constant * absorb + emissive * (absorb / max(sigma, 1e-4));\n // 混合是 src.rgb * a + dst * (1-a)。这里除回 a,硬件再乘回去才是 inScatter + dst * T。\n return vec4f(applySceneFog(rgb / absorb, exit), absorb);\n}\n")}const s=function(A,t){const e=t.includes("pbrAo ="),i=function(A){const t={clearcoat:A.includes("physCc ="),sheen:A.includes("physSheen ="),anisotropy:A.includes("physAniso ="),transmission:A.includes("physTrans ="),iridescence:A.includes("physIri ="),retro:A.includes("physRetro =")};return t.clearcoat||t.sheen||t.anisotropy||t.transmission||t.iridescence||t.retro?t:null}(t);if(!e&&!i)return A;let s=A;return e&&(s=function(A){let t=`var<private> pbrAo: f32 = 1.0;\n${A}`;return t=RA(t,"var rgb = albedo * lightHeader.ambient;","var rgb = albedo * lightHeader.ambient * pbrAo;","ambient"),t=RA(t,"let diffuse = irr * albedo * (1.0 - metal);","let diffuse = irr * albedo * (1.0 - metal) * pbrAo;","ibl diffuse"),t=RA(t,"let spec = specEnv * (F0 * brdf.x + brdf.y);","let specOcc = saturate(pow(max(dot(N, V), 0.0) + pbrAo, exp2(-16.0 * roughness - 1.0)) - 1.0 + pbrAo);\n let spec = specEnv * (F0 * brdf.x + brdf.y) * specOcc;","ibl spec"),t=RA(t,"rgb += bakedIrradiance * albedo * (1.0 - metal);","rgb += bakedIrradiance * albedo * (1.0 - metal) * pbrAo;","baked"),t}(s)),i&&(s=function(A,t){let e=function(A,t){const e=A.indexOf("fn shadePunctual(");if(e<0)throw new Error("lightingVariant: shadePunctual missing");let i=e;const s=A.lastIndexOf("// F0 在 applyLighting",e);s>=0&&e-s<240&&(i=s);let n=0,r=-1;for(let a=A.indexOf("{",e);a>=0&&a<A.length;a++){const t=A.charCodeAt(a);if(123===t)n++;else if(125===t&&(n--,0===n)){r=a+1;break}}if(r<0||!A.slice(i,r).includes("roughness >= 0.99"))throw new Error("lightingVariant: shadePunctual is not the GGX body");return A.slice(0,i)+t+A.slice(r)}(A,function(A){const t=[];A.clearcoat&&t.push("var<private> physCcN: vec3f = vec3f(0.0, 1.0, 0.0);","var<private> physCc: f32 = 0.0;","var<private> physCcRough: f32 = 0.0;"),A.sheen&&t.push("var<private> physSheen: f32 = 0.0;","var<private> physSheenColor: vec3f = vec3f(0.0);","var<private> physSheenRough: f32 = 1.0;"),A.anisotropy&&t.push("var<private> physT: vec3f = vec3f(1.0, 0.0, 0.0);","var<private> physB: vec3f = vec3f(0.0, 0.0, 1.0);","var<private> physAniso: f32 = 0.0;"),A.transmission&&t.push("var<private> physTrans: f32 = 0.0;","var<private> physAtten: vec3f = vec3f(1.0);"),A.iridescence&&t.push("var<private> physIri: vec3f = vec3f(0.04);","var<private> physIriW: f32 = 0.0;"),A.retro&&t.push("var<private> physRetro: f32 = 0.0;");const e=A.transmission?"\n diffuseCol *= (1.0 - saturate(physTrans));":"",i=A.anisotropy?"let at = max(mix(a, 1.0, saturate(physAniso)), 0.002);\n let ab = max(a * (1.0 - saturate(physAniso)), 0.002);\n let td = dot(physT, H);\n let bd = dot(physB, H);\n let ax = at * ab;\n let hv = vec3f(ab * td, at * bd, ax * ndh);\n let hv2 = max(dot(hv, hv), 1e-7);\n let w2 = ax / hv2;\n let D = ax * w2 * w2;":"let d = ndh * ndh * (a2 - 1.0) + 1.0;\n let D = a2 / max(d * d, 1e-7);",s=A.iridescence?"\n F = mix(F, physIri, saturate(physIriW));":"",n=A.retro?"\n let Vr = reflect(-V, N);\n let Hr = normalize(L + Vr);\n let ndhR = max(dot(N, Hr), 0.0);\n let dR = ndhR * ndhR * (a2 - 1.0) + 1.0;\n let DR = a2 / max(dR * dR, 1e-7);\n let vohr = max(dot(Vr, Hr), 0.0);\n let FR = F0 + (vec3f(1.0) - F0) * pow(1.0 - vohr, 5.0);\n let ndvR = max(dot(N, Vr), 1e-4);\n let GR = (ndvR / (ndvR * (1.0 - k) + k)) * (ndl / (ndl * (1.0 - k) + k));\n let specR = DR * FR * GR / max(4.0 * ndl * ndvR, 1e-4);\n spec = mix(spec, specR, saturate(physRetro));":"",r=!(A.sheen||A.anisotropy||A.retro||A.iridescence),a=A.sheen?"\n let sheenR = max(physSheenRough, 0.07);\n let invA = 1.0 / sheenR;\n let sin2 = max(1.0 - ndhS * ndhS, 0.0078125);\n let Ds = (2.0 + invA) * pow(sin2, invA * 0.5) * 0.5;\n let Vs = saturate(1.0 / (4.0 * (ndl + ndvS - ndl * ndvS)));\n let sheenRgb = physSheenColor * physSheen * Ds * Vs;\n let sheenA = saturate(1.0 - sheenR);\n let sheenMax = max(physSheenColor.r, max(physSheenColor.g, physSheenColor.b)) * physSheen;\n base *= saturate(1.0 - sheenMax * sheenA);\n base += sheenRgb * ndl * radiance;":"",o=A.sheen?"let ndvS = max(dot(N, V), 1e-4);\n let Hs = normalize(L + V);\n let ndhS = max(dot(N, Hs), 0.0);":"",l=A.clearcoat?"\n let ccN = physCcN;\n let ccNdl = max(dot(ccN, L), 0.0);\n let ccNv = max(dot(ccN, V), 1e-4);\n let ccF = 0.04 + 0.96 * pow(1.0 - ccNv, 5.0);\n let ccW = saturate(physCc) * ccF;\n base *= (1.0 - ccW);\n if (ccNdl > 0.0) {\n let ccH = normalize(L + V);\n let ccNdh = max(dot(ccN, ccH), 0.0);\n let ccVoh = max(dot(V, ccH), 0.0);\n let ccFres = vec3f(0.04 + 0.96 * pow(1.0 - ccVoh, 5.0));\n let cr = saturate(physCcRough);\n let ca = max(cr * cr, 0.002);\n let ca2 = ca * ca;\n let cd = ccNdh * ccNdh * (ca2 - 1.0) + 1.0;\n let cD = ca2 / max(cd * cd, 1e-7);\n let ck = (cr + 1.0) * (cr + 1.0) * 0.125;\n let cG = (ccNv / (ccNv * (1.0 - ck) + ck)) * (ccNdl / (ccNdl * (1.0 - ck) + ck));\n let cSpec = cD * ccFres * cG / max(4.0 * ccNdl * ccNv, 1e-4);\n base += cSpec * ccNdl * radiance * physCc;\n }":"",c=A.clearcoat?"":"if (ndl <= 0.0) { return vec3f(0.0); }\n ";return`${t.join("\n")}\nfn shadePunctual(\n N: vec3f, V: vec3f, L: vec3f, radiance: vec3f,\n albedo: vec3f, roughness: f32, metal: f32,\n F0: vec3f,\n) -> vec3f {\n let ndl = max(dot(N, L), 0.0);\n ${c}var diffuseCol = albedo * (1.0 - metal);${e}\n var base = vec3f(0.0);\n if (ndl > 0.0) {\n ${r?"if (roughness >= 0.99) {\n base = diffuseCol * ndl * radiance;\n } else {":""}\n let ndv = max(dot(N, V), 1e-4);\n let H = normalize(L + V);\n let ndh = max(dot(N, H), 0.0);\n let VoH = max(dot(V, H), 0.0);\n var F = F0 + (vec3f(1.0) - F0) * pow(1.0 - VoH, 5.0);${s}\n let a = max(roughness * roughness, 0.002);\n ${A.anisotropy&&!A.retro?"":"let a2 = a * a;"}\n ${i}\n let k = (roughness + 1.0) * (roughness + 1.0) * 0.125;\n let G = (ndv / (ndv * (1.0 - k) + k)) * (ndl / (ndl * (1.0 - k) + k));\n var spec = D * F * G / max(4.0 * ndl * ndv, 1e-4);${n}\n let diffuse = diffuseCol * ndl * (vec3f(1.0) - F);\n base = (diffuse + spec * ndl) * radiance;\n ${r?"}":""}\n ${o}${a}\n }${l}\n return base;\n}\n`}(t));return t.transmission&&(e=RA(e,"return albedo * (1.0 - metal) * rad * ff.y + fresnel * rad * ff.x;","return albedo * (1.0 - metal) * (1.0 - saturate(physTrans)) * rad * ff.y + fresnel * rad * ff.x;","rect diffuse")),e}(s,i)),s}(tt(),t);if(WA.test(t)){if(i)throw new Error("ShaderAssembler: 自定义着色不要和 applyShadow 写在一起");if(KA.test(t)||JA.test(t)||VA.test(t)||/\bapplyLighting(?:Baked)?\b|\bapplyPhysical\b/.test(t))throw new Error("ShaderAssembler: applyShadow 不要和其它光照函数写在一起");return A.push("// ── lighting ──",s),void A.push("\nfn applyShadow(P: vec3f, N: vec3f) -> f32 {\n var shadow = 1.0;\n let dirCount = min(lightHeader.dirCount, 4u);\n for (var i = 0u; i < dirCount; i++) {\n shadow *= sampleShadow(lightHeader.dirSlots[i], P, N);\n if (shadow <= 0.0) { return shadow; }\n }\n let unbCount = min(lightHeader.unboundedCount, 4u);\n for (var i = 0u; i < unbCount; i++) {\n shadow *= sampleShadowLocal(lightHeader.unbSlots[i], P, N);\n if (shadow <= 0.0) { return shadow; }\n }\n let nLocal = lightHeader.localCount;\n if (nLocal > 0u && nLocal <= 32u) {\n for (var i = 0u; i < nLocal; i++) {\n shadow *= sampleShadowLocal(localDirectOff(i), P, N);\n if (shadow <= 0.0) { return shadow; }\n }\n } else if (nLocal > 0u) {\n let base = worldClusterBase(P);\n if (base != 0xffffffffu) {\n let maxPer = clusterParams.maxPerCell;\n let cnt = min(clusterCells[base + 3u], maxPer);\n for (var i = 0u; i < cnt; i++) {\n shadow *= sampleShadowLocal(clusterCells[base + 4u + i], P, N);\n if (shadow <= 0.0) { return shadow; }\n }\n }\n }\n return shadow;\n}\n")}if(KA.test(t)){if(i)throw new Error("ShaderAssembler: 自定义着色不要和 applyPhong 写在一起");if(JA.test(t))throw new Error("ShaderAssembler: applyToon 不要和 applyPhong 写在一起");return A.push("// ── lighting ──",function(A){const t=A.indexOf("fn shadePunctual(");if(t<0)throw new Error("Phong: shadePunctual missing");let e=t;const i=A.lastIndexOf("// F0 在 applyLighting",t);i>=0&&t-i<240&&(e=i);let s=0,n=-1;for(let o=A.indexOf("{",t);o>=0&&o<A.length;o++){const t=A.charCodeAt(o);if(123===t)s++;else if(125===t&&(s--,0===s)){n=o+1;break}}if(n<0||!A.slice(e,n).includes("roughness >= 0.99"))throw new Error("Phong: shadePunctual is not the GGX body");const r="fresnel * rad * ff.x",a=A.slice(0,e)+"\nvar<private> phongShine: f32 = 1.0;\nvar<private> phongStrength: f32 = 1.0;\nvar<private> phongScale: f32 = 1.0;\n\nfn shadePunctual(\n N: vec3f, V: vec3f, L: vec3f, radiance: vec3f,\n albedo: vec3f, roughness: f32, metal: f32,\n F0: vec3f,\n) -> vec3f {\n let ndl = saturate(dot(N, L));\n if (ndl <= 0.0) { return vec3f(0.0); }\n let diffuseCol = albedo * (1.0 - metal);\n let H = normalize(L + V);\n let ndh = saturate(dot(N, H));\n let voh = saturate(dot(V, H));\n let F = F0 + (vec3f(1.0) - F0) * pow(1.0 - voh, 5.0);\n let spec = F * phongScale * pow(ndh, phongShine) * phongStrength;\n return (diffuseCol + spec) * ndl * radiance;\n}\n"+A.slice(n);if(!a.includes(r))throw new Error("Phong: rect fresnel missing");return a.replace(r,"fresnel * rad * ff.x * phongStrength")}(s)),void A.push("\nfn applyPhongIbl(N: vec3f, albedo: vec3f) -> vec3f {\n let intensity = sceneParams.iblIntensity;\n if (intensity <= 0.0) { return vec3f(0.0); }\n return textureSampleLevel(envIrradiance, envSampler, N, 0.0).rgb * albedo * intensity;\n}\n\nfn applyPhong(\n P: vec3f, N: vec3f, V: vec3f,\n albedo: vec3f,\n specular: vec3f,\n shininess: f32,\n specStrength: f32,\n bakedIrradiance: vec3f,\n) -> vec3f {\n let shine = max(shininess, 1e-4);\n phongShine = shine;\n phongStrength = specStrength;\n phongScale = 0.25 * (shine * 0.5 + 1.0);\n let rough = sqrt(saturate(2.0 / (shine + 2.0)));\n var rgb = shadeSceneLights(P, N, V, albedo, rough, 0.0, specular);\n rgb += applyPhongIbl(N, albedo);\n rgb += bakedIrradiance * albedo;\n return applySceneFog(rgb, P);\n}\n")}if(JA.test(t)){if(i)throw new Error("ShaderAssembler: 自定义着色不要和 applyToon 写在一起");if(VA.test(t))throw new Error("ShaderAssembler: applyToon 不要和 applyLambert 写在一起");return A.push("// ── lighting ──",function(A,t){const e=st(t);if(!e)throw new Error("Toon: applyToon missing");const i=A.indexOf("fn shadePunctual(");if(i<0)throw new Error("Toon: shadePunctual missing");let s=i;const n=A.lastIndexOf("// F0 在 applyLighting",i);n>=0&&i-n<240&&(s=n);let r=0,a=-1;for(let u=A.indexOf("{",i);u>=0&&u<A.length;u++){const t=A.charCodeAt(u);if(123===t)r++;else if(125===t&&(r--,0===r)){a=u+1;break}}if(a<0||!A.slice(s,a).includes("roughness >= 0.99"))throw new Error("Toon: shadePunctual is not the GGX body");const o="family"===e?"var<private> toonGradScale: vec2f;\nvar<private> toonGradTex: u32;\nvar<private> toonGradSamp: u32;\nfn toonRamp(N: vec3f, L: vec3f) -> f32 {\n let coord = dot(N, L) * 0.5 + 0.5;\n return sampleTextureLod0(vec2f(coord, 0.0), toonGradScale, toonGradTex, toonGradSamp, vec4f(0.0)).r;\n}\n":"tex"===e?"fn toonRamp(N: vec3f, L: vec3f) -> f32 {\n let coord = dot(N, L) * 0.5 + 0.5;\n return textureSampleLevel(gradientMap, gradientMapSampler, vec2f(coord, 0.0), 0.0).r;\n}\n":"var<private> toonDx: vec3f;\nvar<private> toonDy: vec3f;\nfn toonRamp(N: vec3f, L: vec3f) -> f32 {\n let coord = dot(N, L) * 0.5 + 0.5;\n let fw = (abs(dot(toonDx, L)) + abs(dot(toonDy, L))) * 0.25;\n let aa = max(fw, 1e-5);\n return mix(0.7, 1.0, smoothstep(0.7 - aa, 0.7 + aa, coord));\n}\n";let l=A.slice(0,s)+o+"fn shadePunctual(\n N: vec3f, V: vec3f, L: vec3f, radiance: vec3f,\n albedo: vec3f, roughness: f32, metal: f32,\n F0: vec3f,\n) -> vec3f {\n return albedo * toonRamp(N, L) * radiance;\n}\n"+A.slice(a);if(t.includes("pbrAo =")){const A="shadeLightAt(P, N, V, hemiSlot, albedo, roughness, metal, F0)",t=l.indexOf(A);if(t<0||l.indexOf(A,t+A.length)>=0)throw new Error("Toon: hemi AO");l=l.slice(0,t)+A+" * pbrAo"+l.slice(t+A.length)}const c="let uv = ltcUv(N, V, roughness);\n let t1 = textureSampleLevel(ltcMat, ltcSampler, uv, 0.0);\n let t2 = textureSampleLevel(ltcAmp, ltcSampler, uv, 0.0);\n let mInv = mat3x3f(vec3f(t1.x, 0.0, t1.y), vec3f(0.0, 1.0, 0.0), vec3f(t1.z, 0.0, t1.w));\n let ff = ltcEvaluateDual(N, V, P, mInv, p0, p1, p2, p3);\n let rad = color * (intensity * win);\n let fresnel = F0 * t2.x + (vec3f(1.0) - F0) * t2.y;\n return albedo * (1.0 - metal) * rad * ff.y + fresnel * rad * ff.x;",h=l.indexOf(c);if(h>=0){if(l.indexOf(c,h+507)>=0)throw new Error("Toon: rect block duplicated");const A="let rad = color * (intensity * win);\n var t1u = V - N * dot(V, N);\n if (dot(t1u, t1u) < 1e-8) {\n t1u = select(vec3f(1.0, 0.0, 0.0), vec3f(0.0, 1.0, 0.0), abs(N.x) > 0.5);\n }\n let T1 = normalize(t1u);\n let T2 = -cross(N, T1);\n let basis = transpose(mat3x3f(T1, T2, N));\n let d0 = p0 - P;\n let d1 = p1 - P;\n let d2 = p2 - P;\n let d3 = p3 - P;\n let diff = ltcFormFactor(basis, d0, d1, d2, d3);\n return albedo * rad * diff * toonRamp(N, (C - P) / max(distC, 1e-4));";l=l.slice(0,h)+A+l.slice(h+507)}return l}(s,t)),void A.push(function(A){const t=st(A);if(!t)throw new Error("Toon: applyToon missing");const e=A.includes("pbrAo ="),i=A.includes("lightMapSample"),s=e?" * pbrAo":"";return`\nfn applyToonIbl(N: vec3f, albedo: vec3f) -> vec3f {\n let intensity = sceneParams.iblIntensity;\n if (intensity <= 0.0) { return vec3f(0.0); }\n return textureSampleLevel(envIrradiance, envSampler, N, 0.0).rgb * albedo * intensity;\n}\n\nfn ${"family"===t?"applyToonTexFamily":"tex"===t?"applyToonTex":"applyToon"}(${"analytic"===t?"P: vec3f, N: vec3f, V: vec3f, dNdx: vec3f, dNdy: vec3f, albedo: vec3f"+(i?", baked: vec3f":""):"family"===t?`P: vec3f, N: vec3f, V: vec3f, albedo: vec3f${i?", baked: vec3f":""}, gradScale: vec2f, gradTex: u32, gradSamp: u32`:"P: vec3f, N: vec3f, V: vec3f, albedo: vec3f"+(i?", baked: vec3f":"")}) -> vec3f {\n ${"analytic"===t?"toonDx = dNdx;\n toonDy = dNdy;\n ":"family"===t?"toonGradScale = gradScale;\n toonGradTex = gradTex;\n toonGradSamp = gradSamp;\n ":""}var rgb = shadeSceneLights(P, N, V, albedo, 1.0, 0.0, vec3f(0.04));\n rgb += applyToonIbl(N, albedo)${s};\n ${i?`rgb += baked * albedo${s};\n `:""}return rgb;\n}\n`}(t))}if(i){if(VA.test(t))throw new Error("ShaderAssembler: 自定义着色不要和 applyLambert 写在一起");if(s!==tt())throw new Error("ShaderAssembler: 自定义着色不要和 applyPhysical 写在一起");A.push("// ── lighting ──",s,i)}else A.push("// ── lighting ──",s),VA.test(t)&&A.push("\nfn applyLambertIbl(N: vec3f, albedo: vec3f) -> vec3f {\n let intensity = sceneParams.iblIntensity;\n if (intensity <= 0.0) { return vec3f(0.0); }\n return textureSampleLevel(envIrradiance, envSampler, N, 0.0).rgb * albedo * intensity;\n}\n\nfn applyLambert(\n P: vec3f, N: vec3f, V: vec3f,\n albedo: vec3f,\n bakedIrradiance: vec3f,\n) -> vec3f {\n var rgb = shadeSceneLights(P, N, V, albedo, 1.0, 0.0, vec3f(0.04));\n rgb += applyLambertIbl(N, albedo);\n rgb += bakedIrradiance * albedo;\n return applySceneFog(rgb, P);\n}\n")}(_,F,a.needsLighting),_.push("// ── material shader ──",O);const AA=_.join("\n");return a.onBeforeCompile?.(AA,n,s,!0)||AA}assembleCompute(A){const{pipeline:t,camera:e,common:i,renderer:s,computeObject:n}=A,r=n.material,a=r.entryPoint;if(!a)throw new Error("ShaderAssembler.assembleCompute: material.entryPoint 为空");const[o,l,c]=r.workgroupSize,h=e?this.generateBindingsDecl(e,0,s,ge):"",u=this.generateBindingsDecl(r,1,s,ge),g=this.generateBindingsDecl(i,2,s,ge);let d=we(r.buildShader(s,n,t,ye,!1));const p=r.injectWgslFragment?we(r.injectWgslFragment):"",f=function(A,t){const e=[];let i=!1,s=!1,n=!1;for(let o=0,l=ve.length;o<l;o++){const t=ve[o];t.identRe.test(A)&&(e.push(`@builtin(${t.builtin}) ${t.ident}: ${t.wgslType}`),"subgroups"===t.enable&&(i=!0),"linear_indexing"===t.requires?s=!0:"subgroup_id"===t.requires&&(n=!0))}if(i&&!t.features.has(MA.Subgroups))throw new Error("ShaderAssembler: subgroup* builtins 需要 GPUFeatureName.Subgroups");const r="undefined"!=typeof navigator?navigator.gpu?.wgslLanguageFeatures:void 0;if(s&&!r?.has("linear_indexing"))throw new Error("ShaderAssembler: globalInvocationIndex / workgroupIndex 需要 wgslLanguageFeatures.linear_indexing");if(n&&!r?.has("subgroup_id"))throw new Error("ShaderAssembler: subgroupId / numSubgroups 需要 wgslLanguageFeatures.subgroup_id");const a=[];return i&&a.push("enable subgroups;"),s&&a.push("requires linear_indexing;"),n&&a.push("requires subgroup_id;"),{params:e.join(", "),directives:a.length>0?a.join("\n"):""}}(p?`${p}\n${d}`:d,s.device),m=`@compute @workgroup_size(${o}, ${l}, ${c})\nfn ${a}(${f.params})`,C=new RegExp(`(?:(?:@compute|@workgroup_size\\([^)]*\\))\\s*)*fn\\s+${w=a,w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b[^{}]*\\{`);var w;const y=d.replace(C,()=>`${m} {`);if(y===d)throw new Error(`ShaderAssembler: missing compute entry "${a}" to rewrite`);d=y;const B=[];f.directives&&B.push(f.directives),p&&B.push(p),h&&B.push("// ── group(0): camera ──",h),B.push("// ── group(1): material ──",u,"// ── group(2): common ──",g,"// ── compute entry ──",d);const I=B.join("\n");return r.onBeforeCompile(I,n,s,!1)||I}assembleShadowEncode(A){const{material:t,common:e,renderer:i,entryWgsl:s,object:n}=A,r=this.generateBindingsDecl(t,1,i,ue),a=this.generateBindingsDecl(e,2,i,ue),o=n?this.generateBindingsDecl(n,3,i,ue):"",l=["// ── group(1): shadow encode ──",r,"// ── group(2): world ──",a];return o&&l.push("// ── group(3): instanced object ──",o),l.push("// ── shadow vs ──",s),l.join("\n")}assembleWboitComposite(A){const{material:t,renderer:e,entryWgsl:i}=A,s=["// ── group(1): fullscreen ──",this.generateBindingsDecl(t,1,e,ue)];return/\bfn\s+vertexMain\b/.test(i)||s.push("// ── fullscreen vs ──","\n@vertex fn vertexMain(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4f {\n let x = f32(i32(vi & 1u) * 4 - 1);\n let y = f32(i32(vi >> 1u) * 4 - 1);\n return vec4f(x, y, 0.0, 1.0);\n}\n"),s.push("// ── composite ──",i),s.join("\n")}generateBindingsDecl(A,t,e,i){let s="";return Ae(A.getBindings(),A.bindingStartIndex??0,i,(A,i)=>{s+=A.generateShader(t,i,e)}),s}generateVertexInputStruct(A,t=!0,e=!0,i=null,s){let n="";const r=A=>{for(const t of A)for(const A of t.attributes)s&&!s.has(A.attrName)||(n+=e?` @location(${A.shaderLocation}) ${A.attrName}: ${A.wgslType},\n`:` ${A.attrName}: ${A.wgslType},\n`)};return r(A.getVertexSlots()),i&&r(i.getVertexSlots().map(TA)),n||(n=" _pad: u32,\n"),t?`\n struct VertexInput {\n${n} };\n `:n}}function ze(A){let t=2166136261;for(let e=0,i=A.length;e<i;e++)t^=A.charCodeAt(e),t=Math.imul(t,16777619);return t>>>0}function Ge(A,t){return t.wireframe&&(A.topology||G.TriangleList)===G.TriangleList}function Ye(A,t){return Ge(A,t)?G.LineList:A.topology||G.TriangleList}function He(A,t,e,i,s,n="off"){const r=Ye(A,t);let a="";"triangle-strip"!==r&&"line-strip"!==r||(a=e.index?.view instanceof Uint32Array?"|u32":"|u16");const o=t.needsLighting?`|lit:${LA}`:"";return`r|${A.getCacheKey()}|${t.getCacheKey()}|${e.getCacheKey()}|${r}${a}|${i.getCacheKey()}|clip:${n}${o}`}class Ke extends Map{type="MapProxy";dirtyTypes=f.DIRTY_DATA;onChangeCallback;constructor(A,t){super(A),this.onChangeCallback=t}set(A,t){return this.get(A)===t||(super.set(A,t),this.onChangeCallback?.(this.dirtyTypes)),this}delete(A){if(!this.has(A))return!1;const t=super.delete(A);return t&&this.onChangeCallback?.(this.dirtyTypes),t}clear(){0!==this.size&&(super.clear(),this.onChangeCallback?.(this.dirtyTypes))}}const Ve="function"==typeof structuredClone,Je=j.STORAGE|j.COPY_DST|j.COPY_SRC,We=z.VERTEX|z.COMPUTE|z.FRAGMENT,qe=4294967295;class Xe{device;binding;cpuView;maxCount;transformMeta;wasm;get gpuBuffer(){return this.binding.dataView.buffer}constructor(A,t=16384,e,i){const s=i.capacity,n=new Float32Array(i.memory.buffer,i.worldByteOffset,16*s);this.cpuView=n,this.maxCount=s,this.wasm=i,this.transformMeta=e,this.device=A,this.binding=new Jt("worldMatrices",n,"f32",{visibility:We,access:"ReadOnly",isArray:!0,isDynamicArray:!0,usage:Je,count:s}),this.binding.setCount(Math.max(t,e.calcCapacity()),!0)}adoptGrown(){const A=this.wasm,t=A.capacity,e=new Float32Array(A.memory.buffer,A.worldByteOffset,16*t);this.cpuView=e,this.maxCount=t,this.binding.dataView.view=e}read(A){if(A<0||A>=this.maxCount)return;const t=16*A;return this.cpuView.subarray(t,t+16)}releaseGPU(A){if(null!=A&&null!=this.device&&this.device!==A)return;const t=this.binding.dataView,e=t.buffer;e&&(It.release(this.device,e),t.buffer=null,t.ownsBuffer=!1),this.device=void 0}update(A){const t=this.device;null!=t&&t!==A&&this.releaseGPU(t),this.device=A;const e=this.binding,i=this.transformMeta;let s=e.dataView.buffer,n=e.count,r=!1;if(!s||i.maxIndex>=n){r=!0;const t=this.maxCount;n=Math.min(t,Math.max(i.calcCapacity(),i.maxIndex+1,1)),e.setCount(n,!0),s=e.createGPUBuffer(A)}return this.flushDirty(r,A,s,n),r}flushDirty(A,t,e,i){const s=this.cpuView;if(A)t.queue.writeBuffer(e,0,s,0,16*i);else{const A=this.wasm.uploadRangeView,i=A[2];if(i<=0)return;const n=A[0],r=A[1]-n+1,a=t.queue;if(A[2]=0,i/r>.6)return void a.writeBuffer(e,64*n,s,16*n,16*r);ne(a,e,s,this.wasm.orderView,i,16)}}dispose(){this.releaseGPU(),this.binding.dispose?.()}}const Ze=new wt("TransformNode",[{name:"quaternion",format:"vec4f"},{name:"position",format:"vec3f"},{name:"flags",format:"u32"},{name:"scale",format:"vec3f"},{name:"parentIndex",format:"u32"}],{useStandardLayout:!0});Ze.computeLayout();var _e=(A=>(A[A.Quaternion=0]="Quaternion",A[A.Position=4]="Position",A[A.Flags=7]="Flags",A[A.Scale=8]="Scale",A[A.ParentIndex=11]="ParentIndex",A))(_e||{});const $e=Ze.typeInfo.bytes>>2;class Ai extends yt{wasm;onSlotGrow=null;#$=[];constructor(A,t){const e=t.capacity;super(t.memory.buffer,Ze,{byteOffset:t.transformByteOffset,count:e,enableFreeList:!0,isAutoGrow:!1}),this.wasm=t,this.maxCount=e}resizeTo(A){}allocate(){if(0===this.freeTop){const A=this.onSlotGrow;if(!A||!A(this.count+1)||0===this.freeTop)return-1}return super.allocate()}free(A){this.#$[A]=void 0,super.free(A)}bindOwner(A,t){this.#$[A]=t}unbindOwner(A){this.#$[A]=void 0}adoptGrown(){const A=this.wasm,t=A.capacity,e=this.count,i=A.memory.buffer;t===e&&this.buffer===i||(this.rebind(i,A.transformByteOffset,t*this.stride),t>e&&this.#AA(e,t),this.count=t,this.maxCount=t)}rebindOwners(){const A=this.#$;for(let t=0,e=A.length;t<e;t++){const e=A[t];if(void 0===e)continue;const i=e.deref();void 0!==i?i.rebindWasmViews():A[t]=void 0}}#AA(A,t){const e=this.usedBits;if(!e)return;const i=new Uint8Array(t);i.set(e),this.usedBits=i;const s=new Uint32Array(t),n=this.freeTop;n>0&&s.set(this.freeStack.subarray(0,n));let r=n;for(let a=t-1;a>=A;a--)s[r++]=a;this.freeStack=s,this.freeTop=r}write(A,t){A<0||A>=this.maxCount||this.u32.set(t,A*$e)}read(A){if(A<0||A>=this.maxCount)return;const t=A*$e,e=this.u32;return{quaternion:e.subarray(t+0,t+0+4),position:e.subarray(t+4,t+4+3),flags:e[t+7],scale:e.subarray(t+8,t+8+3),parentIndex:e[t+11]}}dispose(){}}class ti extends c{isSingleTransformMeta=!0;structDef;constructor(A){super(A||Ze.typeInfo.bytes),this.structDef=Ze}getFieldView(A){const t=this.structDef.fields.get(A);if(!t)return;const e=t.meta;return this.getUseView(e.type,e.byteOffset,e.bytes)}}function ei(A){const t=A.length;if(0!==t){for(let e=0;e<t;e++){const t=A[e];A[e]=void 0,t()}A.length=0}}class ii{worldStore=null;addedList=[];removedList=[];structureList=[];pipelineList=[];visibleList=[];morphList=[];geometryList=[];materialList=[];_materialList=[];_geometryList=[];addedLightList=[];removedLightList=[];lightList=[];casterFlagList=[];dirtyEpoch=0;worldUpdateCount=0;#tA;#eA;#iA=0;#sA;#nA;#rA=[];constructor(){this.#tA=new Uint32Array(0),this.#eA=new Uint8Array(0),this.#sA=new Array(2e4),this.#nA=new Uint32Array(2e4);const A=this.#rA;d.register(this,function(A){return()=>ei(A)}(A))}#aA(A){const t=this.#eA,e=new Uint8Array(Math.max(A+1,t.length<<1));e.set(t),this.#eA=e}addMaterial(A){if(-1!==A._dirtySlot)return;const t=this._materialList;A._dirtySlot=t.length,t.push(A)}removeMaterial(A){if(-1===A._dirtySlot)return;const t=this._materialList;this.swapRemove(t,A)&&t.pop()}addGeometry(A){if(-1!==A._dirtySlot)return;const t=this._geometryList;A._dirtySlot=t.length,t.push(A)}removeGeometry(A){if(-1===A._dirtySlot)return;const t=this._geometryList;this.swapRemove(t,A)&&t.pop()}add(A,t){if(A._dirtyEpoch===this.dirtyEpoch)return;const e=A.poolIndex;if(e<0||null==A.worldStore)return;e>=this.#eA.length&&this.#aA(e);const i=this.#eA,s=i[e];1&s?(2&s||this.#oA(A,e),i[e]=9):(i[e]=4,this.#oA(A,e)),A._dirtyEpoch=this.dirtyEpoch}remove(A){const t=A.poolIndex;if(t<0||null==A.worldStore)return;t>=this.#eA.length&&this.#aA(t);const e=this.#eA,i=e[t];if(1===i)e[t]=3,A._dirtyEpoch=-1,this.#oA(A,t);else if(1&i)A._dirtyEpoch=-1,e[t]=3;else if(4&i){const i=A._dirtySlot,s=this.#iA-1;this.swapRemove(this.#sA,A,this.#iA)&&(i!==s&&i>=0&&(this.#nA[i]=this.#nA[s]),this.#iA--),e[t]=0}}#oA(A,t){const e=this.#iA;let i=this.#nA;if(e>=i.length){const A=new Uint32Array(Math.max(e+1,i.length<<1));A.set(i),i=this.#nA=A}A._dirtySlot=e,this.#sA[e]=A,i[e]=t,this.#iA=e+1}deferFree(A){this.#rA.push(A)}drainDeferredFrees(){ei(this.#rA)}swapRemove(A,t,e=A.length){const i=t._dirtySlot,s=e-1;let n=!1;if(i>=0&&i<=s&&A[i]===t){if(i!==s){const t=A[s];t._dirtySlot=i,A[i]=t}A[s]=void 0,n=!0}return t._dirtySlot=-1,null!=t._dirtyEpoch&&(t._dirtyEpoch=-1),n}commit(A){const t=A.worldStore,e=t.graph,i=t.wasm,s=t.transformMeta.u32,n=f.LOCAL_DIRTY|f.WORLD_DIRTY,r=f.DIRTY_STRUCTURE,a=f.DIRTY_PIPELINE,o=f.DIRTY_VISIBLE,l=f.DIRTY_MORPH,c=f.EFFECTIVE_VISIBLE,h=f.REPARENT_PENDING,u=f.DIRTY_DATA,g=this.#eA,d=this.#sA,p=this.addedList,m=this.removedList,w=this.structureList,y=this.pipelineList,B=this.visibleList,I=this.morphList,Q=this.addedLightList,E=this.removedLightList,x=this.lightList,D=this.#iA;let M=this.#tA;M.length<D&&(M=this.#tA=new Uint32Array(Math.max(D,M.length<<1)));const b=this.#nA;let S=0,v=0;const T=4294967295;for(let f=0,C=D;f<C;f++){const A=d[f],t=b[f],e=s[t*$e+_e.Flags],i=g[t];if(A._dirtySlot=-1,8&i){if(g[t]=1,A.isCanRender)e&r?w.push(A):e&a?(y.push(A),e&l&&I.push(A)):(e&o&&B.push(A),e&l&&I.push(A));else if(A.isLight){const t=e&(r|u|n|o);if(t){const e=A;e.lightDirty=t,x.push(e)}}}else{if(2&i){g[t]=0,A._queueDs=null,b[f]=T,A.isCanRender?m.push(A):A.isLight&&E.push(A);continue}4&i&&(g[t]=1,A.isCanRender?p.push(A):A.isLight&&Q.push(A))}e&h&&(M[v++]=t)}v>0&&e.flushReparentPending(M,v);const U=i.rootsView;for(let f=0,N=D;f<N;f++){const A=b[f];if(A===T)continue;const t=A*$e+_e.Flags,e=s[t];e&c?(e&n&&(U[S++]=A),s[t]=-424967&e):s[t]=e&~(C&~n)}S>0?(e.batchUpdate(U,S),this.worldUpdateCount=0|i.uploadRangeView[2]):this.worldUpdateCount=0,d.fill(void 0,0,D),this.#iA=0,this.dirtyEpoch++,this.#lA(this.materialList,this._materialList),this.#lA(this.geometryList,this._geometryList)}flushFrameQueues(){this.structureList.length=0,this.pipelineList.length=0,this.addedList.length=0,this.visibleList.length=0,this.morphList.length=0,this.removedList.length=0,this.addedLightList.length=0,this.removedLightList.length=0,this.lightList.length=0,this.casterFlagList.length=0}clear(){const A=this._materialList;for(let e=0,i=A.length;e<i;e++)A[e]._dirtySlot=-1;const t=this._geometryList;for(let e=0,i=t.length;e<i;e++)t[e]._dirtySlot=-1;A.length=0,t.length=0,this.geometryList.length=0,this.materialList.length=0,this.flushFrameQueues(),this.#sA=new Array(2e4),this.#nA=new Uint32Array(2e4),this.#eA.fill(0),this.#iA=0,this.worldUpdateCount=0,this.dirtyEpoch++}#lA(A,t){const e=A.length=t.length;for(let i=0;i<e;i++){const e=t[i];e._dirtySlot=-1,A[i]=e}t.length=0}}class si{type="BaseNode";uuid=function(){return`${i}-${t++}`}();weakSelf=new WeakRef(this);version=0;depObjects=new Set;dirtyTypes=f.DIRTY_ALL;_cacheKey="";#H=new Map;constructor(){}onChangeCallback(A){const t=this.dirtyTypes;if(t&A)return;A&f.DIRTY_STRUCTURE&&(this._cacheKey="",this.version++),this.dirtyTypes=t|A;const e=this.depObjects;for(const i of e){const t=i.deref();null!=t?t.onChangeCallback(A):e.delete(i)}}resetState(){this.dirtyTypes=-424961&this.dirtyTypes,this.#H.forEach(A=>{A.resetDirty?.()})}getBindings(){return this.#H}getCacheKey(){if(this._cacheKey)return this._cacheKey;const A=[];for(const[,t]of this.#H)t.isSkipBinding()||A.push(`${t.name}:${t.typeInfo?.format??"u"}`);return A.sort(),this._cacheKey=A.length?`${this.type}|bg:${A.join(";")}`:this.type,this._cacheKey}getBinding(A){return this.#H.get(A)}addBinding(A,t=!0){const e=this.#H;return e.has(A.name)?(console.warn(`Material: '${A.name}' is already set.`),!1):(e.set(A.name,A),t&&A.depObjects?.add?.(this.weakSelf),!0)}removeBinding(A){this.#H.delete(A.name),A.depObjects?.delete?.(this.weakSelf)}setProperty(A,t,e=!0,i){const s=t?.isBinding;if(e&&s&&!this.addBinding(t))return;const n=s&&t.isStructBufferBinding?t:null;n&&n.getFields().forEach((A,t)=>{Object.defineProperty(this,t,{get:()=>A,set(t){A.setValue(t)},configurable:!1,enumerable:!0})}),s?Object.defineProperty(this,A,{get:()=>t.getValue(),set(A){t.setValue(A)},configurable:!1,enumerable:!0}):Object.defineProperty(this,A,{get:()=>t,set:A=>{t!==A&&("function"==typeof t?.setValue&&"function"==typeof t?.getValue&&t?.depObjects?.size>-1?(t.depObjects.delete(this.weakSelf),t=A,A?.depObjects?.add(this.weakSelf),this.onChangeCallback(f.DIRTY_ATTRIBUTE)):(t=A,this.onChangeCallback(f.DIRTY_ATTRIBUTE)))},configurable:!1,enumerable:!0}),i?.(t)}setValues(A){if(null!=A){for(const t in A){const e=A[t];null!=e&&(t in this?this[t]=e:console.warn(`Material: '${t}' is not a property of ${this.type}.`))}return this}}}const ni=new WeakMap;function ri(A,t,e){let i=ni.get(A);i||(i=new p,ni.set(A,i)),i.on(t,e)}function ai(A,t,e){ni.get(A)?.off(t,e)}function oi(A,t,e){const i=ni.get(A)?._listeners.get(t);if(!i)return;const s=i.slice(0);for(let n=0,r=s.length;n<r;n++)s[n].call(A,e)}function li(A,t){const e=ni.get(A)?._listeners.get(t);return!!e&&e.length>0}let ci=0;const hi=new T,ui=new y,gi=new y,di=new v,pi=new y(1,0,0),fi=new y(0,1,0),mi=new y(0,0,1),Ci=new y,wi=new T,yi=[];function Bi(A,t){return()=>A.free(t)}class Ii extends y{version=0;flags;constructor(A=0,t=0,e=0,i,s=0,n){super(A,t,e,i,s),this.flags=n}onChangeCallback(){this.version++,this.flags[this.offset+3]&f.DIRTY_MATRIX||this.depObject?.onChangeCallback(f.DIRTY_MATRIX)}}class Qi extends y{version=0;flags;constructor(A=0,t=0,e=0,i,s=0,n){super(A,t,e,i,s),this.flags=n}onChangeCallback(){this.version++,this.flags[this.offset-1]&f.DIRTY_MATRIX||this.depObject?.onChangeCallback(f.DIRTY_MATRIX)}}class Ei extends T{version=0;flags;constructor(A=0,t=0,e=0,i=1,s,n=0,r){super(A,t,e,i,s,n),this.flags=r}onChangeCallback(){this.version++,this.flags[this.offset+7]&f.DIRTY_MATRIX||this.depObject?.onChangeCallback(f.DIRTY_MATRIX)}}class xi extends U{version=0;constructor(A=0,t=0,e=0,i="XYZ",s){super(A,t,e,i,s)}onChangeCallback(){this.isDirty||(this.version++,this.depObject?.onChangeCallback(f.DIRTY_MATRIX))}}class Di extends v{constructor(A){super(A)}onChangeCallback(){this.isDirty||this.depObject?.onChangeCallback(f.DIRTY_MATRIX)}}class Mi extends si{id=ci++;type="Object3D";isObject3D=!0;isCanRender=!1;isCamera=!1;isScene=!1;isMesh=!1;isClippingMesh=!1;isLight=!1;isGroup=!1;isInstancedMesh=!1;isInstancedDraw=!1;hasNodeBind=!1;isInstancedModel=!1;#cA;#hA;#uA;#gA;poolIndex=-1;#dA;#pA;#fA;#mA=0;name="";children=[];up=new y(0,1,0);dirtySystem=null;_dirtySlot=-1;_dirtyEpoch=-1;_childIndex=-1;_queueDs=null;userData=null;dirtyTypes;#CA;#wA=new Array(3);#yA=!1;worldStore=null;poseSkeleton=null;clipSetId=-1;#BA=void 0;#IA=(A=0,t,e)=>{const i=12*A,s=t?.cpuView,n=new v(s,16*A);s&&n.identity();const r=i+_e.Flags,a=i+_e.ParentIndex,o=e.u32,l=e.f32,c=new Ii(0,0,0,l,i+_e.Position,o),h=new Ei(0,0,0,1,l,i+_e.Quaternion,o),u=new Qi(1,1,1,l,i+_e.Scale,o),g=new xi,d=new Di,p=o.subarray(r,r+1);o[a]=qe,p[0]=f.DIRTY_ALL|f.VISIBLE|f.EFFECTIVE_VISIBLE|f.DIRTY_MATRIX,c.depObject=this,u.depObject=this,h.depObject=this,g.depObject={onChangeCallback:A=>{h.setFromEuler(g),g.version=h.version}},d.depObject={onChangeCallback:A=>{d.decompose(c,h,u)}},g.isDirty=!1,this.poolIndex=A,this.dirtyTypes=p,this.#cA=h,this.#hA=c,this.#uA=u,this.#gA=g,this.#dA=n,this.#pA=d,this.#mA=a,this.#CA=e,e.bindOwner?.(A,this.weakSelf)};rebindWasmViews(){const A=this.poolIndex,t=this.worldStore?.worldMatrixMeta;if(!t||A<0)return;const e=this.#CA,i=12*A,s=e.u32,n=e.f32,r=this.#hA,a=this.#cA,o=this.#uA;r.setTypeData(n,i+_e.Position),r.flags=s,a.setTypeData(n,i+_e.Quaternion),a.flags=s,o.setTypeData(n,i+_e.Scale),o.flags=s,this.dirtyTypes=s.subarray(i+_e.Flags,i+_e.Flags+1),this.#dA.setTypeData(t.cpuView,16*A)}#QA=(A=0,t,e)=>{const i=e.f32,s=e.u32,n=12*A,r=16*A,a=12*this.poolIndex,o=this.#dA;let l=t?.cpuView;l?l.set(o.elements,r):l=o.elements.slice(0,16),o.setTypeData(l,r),i.set(this.#CA.f32.subarray(a,a+12),n);const c=this.#hA,h=this.#cA,u=this.#uA,g=n+_e.Flags,d=n+_e.ParentIndex;c.setTypeData(i,n+_e.Position),c.flags=s,h.setTypeData(i,n+_e.Quaternion),h.flags=s,u.setTypeData(i,n+_e.Scale),u.flags=s,s[d]=qe,this.dirtyTypes=s.subarray(g,g+1),this.poolIndex=A,this.#CA=e,this.#mA=d,e.bindOwner?.(A,this.weakSelf)};switchStore(A){const t=this.#EA;if(t&&A){const t=A.worldMatrixMeta,e=A.transformMeta,i=e.allocate();if(-1===i)throw new Error("Failed to allocate memory for Object3D");return this.#IA(i,t,e),this.worldStore=A,this.#BA=Bi(e,i),void d.register(this,this.#BA)}if(t){const A=new ti;return this.#IA(0,null,A),void(this.worldStore=null)}if(this.isCamera)return void console.warn(this.type+" Object3D is camera, not need world store");const e=this.worldStore;if(A!=e){if(A&&!e){const t=A.transformMeta,e=t.allocate();if(-1===e)throw new Error("Failed to allocate memory for Object3D");return this.worldStore=A,this.#QA(e,A.worldMatrixMeta,t),this.#BA=Bi(t,e),void d.register(this,this.#BA)}if(!A&&e)return e.transformMeta.unbindOwner(this.poolIndex),this.#QA(0,null,new ti),d.unregister(this,this.#BA),this.#BA?.(),this.#BA=null,void(this.worldStore=null);if(A)throw new Error("Cannot switch worldStore when worldStore is not null")}}#EA=!0;constructor(A=null){super(),this.switchStore(A?.worldStore||null),this.#EA=!1}get quaternion(){return this.#cA}get position(){return this.#hA}get scale(){return this.#uA}get rotation(){const A=this.#gA,t=this.#cA;return A.version!==t.version&&(t.version>Number.MAX_SAFE_INTEGER-1e4&&(t.version=1),A.isDirty=!0,A.setFromQuaternion(t),A.isDirty=!1,A.version=t.version),A}set rotation(A){this.#gA.set(A.x,A.y,A.z,A.order)}get matrixWorld(){const A=this.worldStore;return A?(A.graph.resolveWorld(this.poolIndex),this.#dA):(this.#xA(),this.#dA)}readMatrixWorld(){return null!=this.worldStore?(0!==(this.dirtyTypes[0]&(f.LOCAL_DIRTY|f.WORLD_DIRTY))&&this.worldStore.graph.resolveWorld(this.poolIndex),this.#dA):this.matrixWorld}get visible(){return 0!==(this.dirtyTypes[0]&f.VISIBLE)}set visible(A){const t=this.dirtyTypes,e=t[0];if(0!==(e&f.VISIBLE)===A)return;const i=A?e|f.VISIBLE:e&~f.VISIBLE;t[0]=i|f.UPLOAD_DIRTY|f.DIRTY_VISIBLE|f.REPARENT_PENDING,A&&(t[0]|=f.WORLD_DIRTY),this.dirtySystem?.add(this)}get matrix(){const A=this.#pA,t=this.#hA,e=this.#cA,i=this.#uA,s=this.#wA;return t.version==s[0]&&e.version==s[1]&&i.version==s[2]||(A.isDirty=!0,A.compose(t,e,i),A.isDirty=!1,s[0]=t.version,s[1]=e.version,s[2]=i.version),A}set matrix(A){A.decompose(this.#hA,this.#cA,this.#uA)}get parent(){return this.#fA}set parent(A){if(this.#yA)return this.#fA=null,void console.error("Object3D.parent: object already destroyed");const t=this.#fA;if(t===A)return;const e=this.worldStore||A?.worldStore||null;e&&this.switchStore(e);const i=this.worldStore,s=this.poolIndex,n=this.dirtySystem,r=this.#CA.u32;if(t&&i&&t.worldStore===i&&i.graph.unlinkChild(t.poolIndex,s),A){if(this.#fA=A,this.dirtyTypes[0]|=f.WORLD_DIRTY|f.REPARENT_PENDING,i&&A.worldStore===i){const t=A.poolIndex;r[this.#mA]=t,i.graph.linkChild(t,s)}else i?r[this.#mA]=qe:(r[this.#mA]=A.poolIndex,this.#wA[0]=0);const t=A.dirtySystem;if(n!==t)Mi.applyDirtySystemToSubtree(this,n,t,e),this.isCanRender||t?.add(this);else if(t){t.add(this);const e=A.clipSetId;(this.isClippingMesh||this.clipSetId!==e||this.children.length>0)&&Mi.applySelfClippingMesh(this)}}else this.#fA=null,this.dirtySystem=null,this._childIndex=-1,this.#wA[0]=0,this.dirtyTypes[0]|=f.WORLD_DIRTY|f.REPARENT_PENDING,r[this.#mA]=qe,this.isClippingMesh||(this.clipSetId=-1),n&&Mi.applyDirtySystemToSubtree(this,n,null,e)}bindTransformParent(A){const t=this.worldStore??A?.worldStore??null;t&&this.worldStore!==t&&this.switchStore(t);const e=this.worldStore;if(!e)return void(this.dirtyTypes[0]|=f.WORLD_DIRTY|f.REPARENT_PENDING);if(!A||A.worldStore!==e)return;const i=this.#CA.u32,s=this.#mA,n=A.poolIndex;if(i[s]===n)return;const r=this.poolIndex,a=i[s];a!==qe&&e.graph.unlinkChild(a,r),i[s]=n,this.dirtyTypes[0]|=f.WORLD_DIRTY|f.REPARENT_PENDING,e.graph.linkChild(n,r),this.dirtySystem?.add(this)}resetPQSDirtyFlags(){this.worldStore||(this.#cA.isDirty=!1,this.#hA.isDirty=!1,this.#uA.isDirty=!1)}static applySelfClippingMesh(A){const t=A.parent;if(!t)return;if(0===A.children.length){if(A.isClippingMesh)A.pClipSetId=t.clipSetId;else{const e=t.clipSetId;A.clipSetId!==e&&(A.clipSetId=e,A.isCanRender&&A.onChangeCallback(f.DIRTY_PIPELINE))}return}const e=[A];for(;e.length>0;){const A=e.pop();if(!A)continue;const t=A.parent;if(t)if(A.isClippingMesh)A.pClipSetId=t.clipSetId;else{const e=A.clipSetId,i=t.clipSetId;e!==i&&(A.clipSetId=i,A.isCanRender&&A.onChangeCallback(f.DIRTY_PIPELINE))}const i=A.children,s=i.length;if(s>0)for(let n=0;n<s;n++)e.push(i[n])}}static applyDirtySystemToSubtree(A,t,e,i){let s=[A];if(e)for(;s.length>0;){const A=s.pop();if(!A)continue;t?.remove(A),A._dirtyEpoch=-1,A.dirtySystem=e;const n=A.parent;if(!i||A.worldStore||A.isCamera?n&&!A.isCamera&&A.worldStore===i&&n.worldStore===i&&A.bindTransformParent(n):(A.switchStore(i),n&&n.worldStore===i&&A.bindTransformParent(n)),A.isLight)e.add(A);else if(A.isCanRender){const t=A,s=t.material;null!=s&&s.dirtySystem!==e&&(s.dirtySystem=e);const n=t.geometry;null!=n&&(n.dirtySystem!==e&&(n.dirtySystem=e),i&&n.switchStore(i));const r=t.vertexStreams;null!=r&&r.dirtySystem!==e&&(r.dirtySystem=e),e.add(A)}if(n)if(A.isClippingMesh)A.pClipSetId=n.clipSetId;else{const t=n.clipSetId;A.clipSetId!==t&&(A.clipSetId=t)}const r=A.children,a=r.length;if(a>0)for(let t=0;t<a;t++)s.push(r[t])}else for(;s.length>0;){const A=s.pop();if(!A)continue;t?.remove(A),A._dirtyEpoch=-1,A.dirtySystem=null,null!==t&&A._dirtySlot>=0&&(A._queueDs=t);const e=A.children,i=e.length;if(i>0)for(let t=0;t<i;t++)s.push(e[t])}}onChangeCallback(A){this.dirtyTypes[0]|=A&C;const t=this.poseSkeleton;t&&A&f.DIRTY_MATRIX&&(t.poseDirty=!0),A&f.DIRTY_STRUCTURE&&(this._cacheKey="",this.version++);const e=this.dirtySystem;e&&this._dirtyEpoch!==e.dirtyEpoch&&e.add(this)}resetState(){this.dirtyTypes[0]&=-424961,this.getBindings().forEach(A=>{A.resetDirty?.()})}dispose(){this.isScene&&this.#DA();const A=this.dirtySystem??this._queueDs,t=this.#BA;this.removeFromParent(),this.clear(),A&&this.poolIndex>=0&&A.remove(this),A&&t&&this._dirtySlot>=0?A.deferFree(t):t&&t(),this.poolIndex=-1,this.dirtySystem=null,this._queueDs=null,this.#hA=null,this.#cA=null,this.#uA=null,this.#gA=null,this.#pA=null,this.#dA=null,this.#fA=null,this.#CA=null,this.dirtyTypes=null,this.worldStore=null,this.#BA=null,this.#yA=!0,d.unregister(this)}#DA(){const A=function(A){let t=A;for(;t;){if(t.isScene)return t.renderer??null;t=t.parent}return null}(this);if(!A)return;const t=null!=A.currentRenderContext,e=yi,i=e.length;e.push(this);try{for(;e.length>i;){const i=e.pop();i.isCanRender&&(t?A.deferReleaseDraw(i):A.releaseDraw(i));const s=i.children;for(let A=0,t=s.length;A<t;A++)e.push(s[A])}}finally{e.length=i}}add(A){if(this.#yA)return console.error("Object3D.add: object already destroyed"),this;if(A===this)return console.error("Object3D.add: object cannot be added as a child of itself"),this;if(A&&A.isObject3D){let t=this.#fA;for(;t;){if(t===A)return console.error("Object3D.add: object is an ancestor of this"),this;t=t.parent}const e=A.parent;if(null!=e){const t=e.children,i=A._childIndex,s=t.length-1;if(i>=0&&i<=s&&t[i]===A){if(i!==s){const A=t[s];t[i]=A,A._childIndex=i}t.length=s}}A.parent=this;const i=this.children;A._childIndex=i.length,i.push(A)}else console.error("Object3D.add: object not an instance of THREE.Object3D");return this}remove(A){const t=this.children,e=A._childIndex,i=t.length;if(e>=0&&e<i&&t[e]===A){A.parent=null,A._childIndex=-1;const s=i-1;if(e!==s){const A=t[s];t[e]=A,A._childIndex=e}t.length=s}return this}removeFromParent(){return this.parent?.remove(this),this}clear(){const A=this.children;for(let t=0,e=A.length;t<e;t++)A[t].parent=null;return this.children=[],this}updateWorldMatrix(A=!1,t=!1){if(this.worldStore){const e=this.worldStore.graph,i=this.poolIndex;if(t){if(A){const A=this.#fA;null!=A&&e.resolveWorld(A.poolIndex)}e.resolveSubtree(i)}else A?e.resolveWorld(i):e.computeWorld(i)}else{if(A){const A=this.#fA;null!=A&&A.updateWorldMatrix(!0,!1)}if(this.#xA(),t){const A=this.children;for(let t=0,e=A.length;t<e;t++)A[t].updateWorldMatrix(!1,!0)}}}#xA(){const A=this.#dA;A.compose(this.#hA,this.#cA,this.#uA);const t=this.#fA;t&&A.premultiply(t.matrixWorld)}getWorldPosition(A=new y){const t=this.matrixWorld.data;return A.set(t[12],t[13],t[14])}getWorldQuaternion(A=new T){return this.matrixWorld.decompose(Ci,A,Ci),A}getWorldScale(A=new y){return this.matrixWorld.decompose(Ci,wi,A),A}lookAt(A,t,e){A instanceof y?gi.copy(A):gi.set(A,t,e);const i=this.matrixWorld.data;ui.set(i[12],i[13],i[14]),this.isCamera||this.isLight?di.lookAt(ui,gi,this.up):di.lookAt(gi,ui,this.up);const s=this.#fA,n=this.#cA;return n.setFromRotationMatrix(di),s&&(s.getWorldQuaternion(hi),n.premultiply(hi.invert())),this}traverse(A){A(this);const t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].traverse(A)}traverseVisible(A){if(!this.visible)return;A(this);const t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].traverseVisible(A)}traverseAncestors(A){const t=this.parent;null!=t&&(A(t),t.traverseAncestors(A))}getObjectById(A){return this.getObjectByProperty("id",A)}getObjectByName(A){return this.getObjectByProperty("name",A)}getObjectByProperty(A,t){if(this[A]===t)return this;const e=this.children;for(let i=0,s=e.length;i<s;i++){const s=e[i].getObjectByProperty(A,t);if(null!=s)return s}}getObjectsByProperty(A,t,e=[]){this[A]===t&&e.push(this);const i=this.children;for(let s=0,n=i.length;s<n;s++)i[s].getObjectsByProperty(A,t,e);return e}onBeforeUpdate(...A){}onAfterUpdateGPU(...A){}onBeforeRender(...A){}onAfterRender(...A){}raycast(...A){}on(A,t){return ri(this,A,t),this}off(A,t){return ai(this,A,t),this}applyMatrix4(A){return di.multiplyMatrices(A,this.matrix),di.decompose(this.#hA,this.#cA,this.#uA),this}applyQuaternion(A){return this.#cA.premultiply(A),this}setRotationFromAxisAngle(A,t){return this.#cA.setFromAxisAngle(A,t),this}setRotationFromEuler(A){return this.#cA.setFromEuler(A),this}setRotationFromMatrix(A){return this.#cA.setFromRotationMatrix(A),this}setRotationFromQuaternion(A){return this.#cA.copy(A),this}rotateOnAxis(A,t){return hi.setFromAxisAngle(A,t),this.#cA.multiply(hi),this}rotateOnWorldAxis(A,t){return hi.setFromAxisAngle(A,t),this.#cA.premultiply(hi),this}rotateX(A){return this.rotateOnAxis(pi,A)}rotateY(A){return this.rotateOnAxis(fi,A)}rotateZ(A){return this.rotateOnAxis(mi,A)}translateOnAxis(A,t){return ui.copy(A).applyQuaternion(this.#cA),this.#hA.add(ui.multiplyScalar(t)),this}translateX(A){return this.translateOnAxis(pi,A)}translateY(A){return this.translateOnAxis(fi,A)}translateZ(A){return this.translateOnAxis(mi,A)}localToWorld(A){return A.applyMatrix4(this.matrixWorld)}worldToLocal(A){return A.applyMatrix4(di.copy(this.matrixWorld).invert())}getWorldDirection(A=new y){const t=this.matrixWorld.data;return A.set(-t[8],-t[9],-t[10]).normalize()}clone(A=!0){return(new this.constructor).copy(this,A)}copy(A,t=!0){if(this.name=A.name,this.up.copy(A.up),this.#hA.copy(A.position),this.#cA.copy(A.quaternion),this.#uA.copy(A.scale),this.dirtyTypes[0]|=C,this.visible=A.visible,this.userData=function(A){return A&&"object"==typeof A?Ve?structuredClone(A):JSON.parse(JSON.stringify(A)):A}(A.userData),t){const t=A.children;for(let A=0,e=t.length;A<e;A++)this.add(t[A].clone(!0))}return this}toJSON(){return null}}const bi=new Map([[Int8Array,["sint8","snorm8"]],[Uint8Array,["uint8","unorm8"]],[Uint8ClampedArray,["uint8","unorm8"]],[Int16Array,["sint16","snorm16"]],[Uint16Array,["uint16","unorm16"]],[Int32Array,["sint32","snorm32"]],[Uint32Array,["uint32","unorm32"]],[Float32Array,["float32","float32"]],[Float16Array,["float16","float16"]]]);function Si(A,t,e=!1){return"unorm10"===t?"unorm1010102":"bgra"===t?"unorm8x4bgra":"mat2"===t||"mat3"===t||"mat4"===t?t:`${bi.get(A)[e?1:0]}${t>1?`x${t}`:""}`}class vi{#MA;typeInfo;isBufferAttribute=!0;stepMode="vertex";skipGpu=!1;count;capacity;stride;dataView={view:null,size:0};updateRanges=[];isDirty=!0;serial=0;depObjects=new Set;DIRTY_TYPE=f.DIRTY_DATA;constructor(A,t=3,e=!1,i=!1){if(A instanceof UA)return new Ti(A,t);if("unorm10"===t&&new.target!==Ri)return new Ri(A);if("bgra"===t&&new.target!==ki)return new ki(A);let s;const n="number"==typeof A;s=null==A||n||Array.isArray(A)?Si(Float32Array,t,e):Si(A.constructor,t,e);const r=J[s];if(!r)throw new Error(`AttributeBinding format ${s} not found`);const a=i?r.size:u(4,r.size),o={name:"",...r,byteOffset:0,byteStride:a,offset:0,stride:a/r.view.BYTES_PER_ELEMENT,dataView:null,isChunkLayout:!1};if(this.stride=o.stride,this.typeInfo=o,n){const t=this.dataView,e=A*o.byteStride;t.view=new o.view(new ArrayBuffer(e)),t.size=e,this.count=A}else this.count=Math.ceil((A?.length??0)/o.elements),this.set(A??[]);this.capacity=this.count}get name(){return this.#MA}set name(A){this.typeInfo.name=A,this.#MA=A}get view(){return this.dataView.view}onChangeCallback(){const A=this.depObjects,t=this.DIRTY_TYPE;this.serial++,this.isDirty=!0,A.forEach(e=>{const i=e.deref();null!=i?i.onChangeCallback(t):A.delete(e)})}resetDirty(){return this.isDirty=!1,this}resize(A){if(A<0||A===this.count)return this;const t=this.typeInfo,e=this.capacity,i=this.dataView,s=t.byteStride;if(A<=e)return this.count=A,i.size=A*s,this.isDirty||this.onChangeCallback(),this;const n=Math.max(A,1.2*e|0),r=i.view.buffer.transfer(n*s);return i.view=new t.view(r),i.size=A*s,this.capacity=n,this.count=A,this.isDirty||this.onChangeCallback(),this}shrinkToFit(){const A=this.count;if(this.capacity<=A)return this;const t=this.dataView,e=this.typeInfo,i=A*e.byteStride,s=t.view.buffer.transfer(i);return t.view=new e.view(s),t.size=i,this.capacity=A,this}setX(A,t){return this.dataView.view[A*this.stride]=t,this.isDirty||this.onChangeCallback(),this}setY(A,t){return this.dataView.view[A*this.stride+1]=t,this.isDirty||this.onChangeCallback(),this}setZ(A,t){return this.dataView.view[A*this.stride+2]=t,this.isDirty||this.onChangeCallback(),this}setW(A,t){return this.dataView.view[A*this.stride+3]=t,this.isDirty||this.onChangeCallback(),this}setXY(A,t,e){const i=this.dataView.view,s=A*this.stride;return i[s]=t,i[s+1]=e,this.isDirty||this.onChangeCallback(),this}setXYZ(A,t,e,i){const s=this.dataView.view,n=A*this.stride;return s[n]=t,s[n+1]=e,s[n+2]=i,this.isDirty||this.onChangeCallback(),this}setXYZW(A,t,e,i,s){const n=this.dataView.view,r=A*this.stride;return n[r]=t,n[r+1]=e,n[r+2]=i,n[r+3]=s,this.isDirty||this.onChangeCallback(),this}getX(A){return this.dataView.view[A*this.stride]}getY(A){return this.dataView.view[A*this.stride+1]}getZ(A){return this.dataView.view[A*this.stride+2]}getW(A){return this.dataView.view[A*this.stride+3]}getXY(A){const t=this.dataView.view,e=A*this.stride;return[t[e],t[e+1]]}getXYZ(A){const t=this.dataView.view,e=A*this.stride;return[t[e],t[e+1],t[e+2]]}getXYZW(A){const t=this.dataView.view,e=A*this.stride;return[t[e],t[e+1],t[e+2],t[e+3]]}set(A){const t=this.stride,e=this.typeInfo,i=this.dataView,s=e.elements,n=Math.ceil(A.length/s);n>this.capacity&&this.resize(n),this.count=n;let r=i.view;if(s===t)r?r.set(A):(i.view=r=A instanceof e.view?A:new e.view(A),this.capacity=n);else{r||(i.view=r=new e.view(new ArrayBuffer(n*e.byteStride)),this.capacity=n);for(let e=0;e<n;e++)for(let i=0;i<s;i++)r[e*t+i]=A[e*s+i]}return i.size=n*e.byteStride,this.isDirty||this.onChangeCallback(),this}setArray(A,t=0){const e=this.typeInfo,i=this.stride,s=this.dataView,n=e.elements;let r=s.view;if(n===i)r.set(A,t);else{const e=Math.floor(A.length/n);for(let s=0;s<e;s++)for(let e=0;e<n;e++)r[s*i+e+t]=A[s*n+e]}return this.isDirty||this.onChangeCallback(),this}readIntoVector3(A,t){const e=this.dataView.view,i=this.stride;return t.fromArray(e,A*i),this}readIntoVector4(A,t){const e=this.dataView.view,i=this.stride;return t.fromArray(e,A*i),this}readIntoMatrix3(A,t){const e=this.dataView.view,i=this.stride;return t.fromArray(e,A*i),this}readIntoMatrix4(A,t){const e=this.dataView.view,i=this.stride;return t.fromArray(e,A*i),this}forEach(A,t=0,e=this.count){const i=this.dataView.view,s=this.stride,n=Math.min(e,this.count);for(let r=t;r<n;r++)A(i,r*s,r);return this.isDirty||this.onChangeCallback(),this}addUpdateRange(A,t){return this.updateRanges.push({start:A,count:t}),this}clearUpdateRanges(){return this.updateRanges.length=0,this}applyMatrix3(A){return A.applyToVertexView(this.dataView.view,this.stride,this.count,2===this.typeInfo.elements?2:3),this.isDirty||this.onChangeCallback(),this}applyMatrix4(A){return A.applyToVertexView(this.dataView.view,this.stride,this.count),this.isDirty||this.onChangeCallback(),this}applyNormalMatrix(A){return A.applyToVertexView(this.dataView.view,this.stride,this.count,3),this.isDirty||this.onChangeCallback(),this}transformDirection(A){return A.transformToDirectionView(this.dataView.view,this.stride,this.count),this.isDirty||this.onChangeCallback(),this}computeBoundingBox(){const A=this.dataView.view,t=this.stride,e=this.count;let i=1/0,s=1/0,n=1/0,r=-1/0,a=-1/0,o=-1/0;for(let d=0;d<e;d++){const e=d*t,l=A[e],c=A[e+1],h=A[e+2];l<i&&(i=l),c<s&&(s=c),h<n&&(n=h),l>r&&(r=l),c>a&&(a=c),h>o&&(o=h)}const l=(i+r)/2,c=(s+a)/2,h=(n+o)/2;let u=0;for(let d=0;d<e;d++){const e=d*t,i=A[e]-l,s=A[e+1]-c,n=A[e+2]-h,r=i*i+s*s+n*n;r>u&&(u=r)}const g=u>0?Math.sqrt(u):0;return{min:new y(i,s,n),max:new y(r,a,o),center:new B(l,c,h,g)}}computeVertexNormals(A,t=!0){const e=this.dataView.view,i=this.stride,s=this.count,n=new Float32Array(3*s);if(null!=A&&A.count>0){const t=A.view,s=A.stride,r=A.count,a=A.typeInfo?.offset??0;for(let A=0;A<r;A+=3){const r=a+A*s,o=t[r],l=t[r+s],c=t[r+2*s],h=o*i,u=l*i,g=c*i,d=e[h],p=e[h+1],f=e[h+2],m=e[u],C=e[u+1],w=e[u+2],y=e[g]-m,B=e[g+1]-C,I=e[g+2]-w,Q=d-m,E=p-C,x=f-w,D=B*x-I*E,M=I*Q-y*x,b=y*E-B*Q,S=3*o,v=3*l,T=3*c;n[S]+=D,n[S+1]+=M,n[S+2]+=b,n[v]+=D,n[v+1]+=M,n[v+2]+=b,n[T]+=D,n[T+1]+=M,n[T+2]+=b}}else for(let r=0;r<s;r+=3){const A=r*i,t=(r+1)*i,s=(r+2)*i,a=e[A],o=e[A+1],l=e[A+2],c=e[t],h=e[t+1],u=e[t+2],g=e[s]-c,d=e[s+1]-h,p=e[s+2]-u,f=a-c,m=o-h,C=l-u,w=d*C-p*m,y=p*f-g*C,B=g*m-d*f,I=3*r,Q=3*(r+1),E=3*(r+2);n[I]=w,n[I+1]=y,n[I+2]=B,n[Q]=w,n[Q+1]=y,n[Q+2]=B,n[E]=w,n[E+1]=y,n[E+2]=B}if(t)for(let r=0;r<s;r++){const A=3*r,t=n[A],e=n[A+1],i=n[A+2],s=t*t+e*e+i*i;if(s>0){const r=1/Math.sqrt(s);n[A]=t*r,n[A+1]=e*r,n[A+2]=i*r}}return n}computeTangents(A,t,e,i){const s=this.dataView.view,n=this.stride,r=this.count,a=new Float32Array(4*r);if(null==A||0===A.count||null==t||null==e)return a;const o=A.view,l=A.stride,c=A.typeInfo?.offset??0,h=t.view,u=t.stride,g=t.typeInfo?.offset??0,d=e.view,p=e.stride,f=e.typeInfo?.offset??0,m=new Float32Array(3*r),C=new Float32Array(3*r),w=null!=i&&i.length>0?i:[{start:0,count:A.count}],y=A.count;for(let B=0;B<w.length;B++){const A=w[B].start,t=A+w[B].count;for(let e=A;e+2<y&&e<t;e+=3){const A=c+e*l,t=o[A],i=o[A+l],a=o[A+2*l];if(t>=r||i>=r||a>=r)continue;const h=t*n,u=i*n,g=a*n,w=s[h],y=s[h+1],B=s[h+2],I=s[u]-w,Q=s[u+1]-y,E=s[u+2]-B,x=s[g]-w,D=s[g+1]-y,M=s[g+2]-B,b=d[f+t*p],S=d[f+t*p+1],v=d[f+i*p]-b,T=d[f+i*p+1]-S,U=d[f+a*p]-b,N=d[f+a*p+1]-S,P=1/(v*N-U*T);if(!Number.isFinite(P))continue;const O=(I*N-x*T)*P,F=(Q*N-D*T)*P,k=(E*N-M*T)*P,R=(x*v-I*U)*P,L=(D*v-Q*U)*P,j=(M*v-E*U)*P,z=3*t,G=3*i,Y=3*a;m[z]+=O,m[z+1]+=F,m[z+2]+=k,m[G]+=O,m[G+1]+=F,m[G+2]+=k,m[Y]+=O,m[Y+1]+=F,m[Y+2]+=k,C[z]+=R,C[z+1]+=L,C[z+2]+=j,C[G]+=R,C[G+1]+=L,C[G+2]+=j,C[Y]+=R,C[Y+1]+=L,C[Y+2]+=j}}for(let B=0;B<r;B++){const A=3*B,t=m[A],e=m[A+1],i=m[A+2];if(t*t+e*e+i*i<=0)continue;const s=g+B*u,n=h[s],r=h[s+1],o=h[s+2],l=n*t+r*e+o*i;let c=t-n*l,d=e-r*l,p=i-o*l;const f=c*c+d*d+p*p;if(f>0){const A=1/Math.sqrt(f);c*=A,d*=A,p*=A}const w=o*t-n*i,y=n*e-r*t,I=(r*i-o*e)*C[A]+w*C[A+1]+y*C[A+2]<0?-1:1,Q=4*B;a[Q]=c,a[Q+1]=d,a[Q+2]=p,a[Q+3]=I}return a}computeVertexNormalize(){const A=this.view,t=this.stride,e=this.count;for(let i=0;i<e;i++){const e=i*t,s=A[e],n=A[e+1],r=A[e+2],a=s*s+n*n+r*r;if(a>0){const t=1/Math.sqrt(a);A[e]=s*t,A[e+1]=n*t,A[e+2]=r*t}}return this.isDirty||this.onChangeCallback(),this}copy(A){return this.typeInfo={...A.typeInfo},this.skipGpu=A.skipGpu,this.stepMode=A.stepMode,this.count=A.count,this.capacity=A.capacity,this.stride=A.stride,this.dataView.view=A.dataView.view.slice(0),this.dataView.size=A.dataView.size,this.name=A.name,this.isDirty||this.onChangeCallback(),this}copyAt(A,t,e){const i=this.stride,s=this.dataView.view,n=t.dataView.view;A*=i,e*=t.stride;for(let r=0;r<i;r++)s[A+r]=n[e+r];this.isDirty||this.onChangeCallback()}clone(){const A=this.typeInfo,t=A.elements,e=A.byteStride===A.size&&!!(3&A.size);let i;if(this.stride===t)i=this.dataView.view.slice(0,this.count*t);else{const e=new A.view(this.count*t),s=this.dataView.view,n=this.stride,r=this.count;for(let A=0;A<r;A++){const i=A*n,r=A*t;for(let A=0;A<t;A++)e[r+A]=s[i+A]}i=e}const s="mat4x4<f32>"===A.wgslType?"mat4":"mat3x3<f32>"===A.wgslType?"mat3":"mat2x2<f32>"===A.wgslType?"mat2":t,n=new vi(i,s,A.normalized,e);return n.stepMode=this.stepMode,n.skipGpu=this.skipGpu,this.name&&(n.name=this.name),n}toJSON(){return{name:this.name,typeInfo:this.typeInfo,count:this.count,stride:this.stride,view:this.dataView.view,updateRanges:this.updateRanges}}}class Ti{isBufferAttribute=!0;isStructBufferAttribute=!0;stepMode="vertex";name;typeInfo;#bA;#SA=!1;updateRanges=[];dataView={view:null,size:0};isDirty=!0;depObjects=new Set;DIRTY_TYPE=f.DIRTY_DATA;constructor(A,t){const e=A.typeMap.get(t);if(!e)throw new Error(`AttributeBinding ${t} format not found`);if(("unorm10-10-10-2"===e.format||"unorm10"===e.format)&&new.target!==Ui)return new Ui(A,t);this.name=t,this.typeInfo=e;const i=this;Object.defineProperty(this.dataView,"view",{get:()=>i.typeInfo.dataView,set(A){i.#bA.setArray(i.name,A)}}),this.#vA(A),this.dataView.size=e.dataView.byteLength}#vA(A){if(this.#SA){if(this.#bA===A)return;this.#bA.unbindAttribute(this)}this.#bA=A,this.#SA=!0,A.bindAttribute(this)}syncFromBuffer(){const A=this.typeInfo.dataView;this.dataView.size=A?A.byteLength:0,this.isDirty=!0}forEachDependent(A){const t=this.depObjects;for(const e of t){const i=e.deref();null!=i?A(i):t.delete(e)}}get view(){return this.typeInfo.dataView}get count(){return this.#bA.count}get capacity(){return this.#bA.capacity}get data(){return this.#bA}get stride(){return this.typeInfo.stride}onChangeCallback(){const A=this.depObjects,t=this.DIRTY_TYPE;this.isDirty=!0,A.forEach(e=>{const i=e.deref();null!=i?i.onChangeCallback(t):A.delete(e)})}resetDirty(){return this.isDirty=!1,this}resize(A){return this.#bA.resize(A),this.dataView.size=this.typeInfo.dataView.byteLength,this.isDirty||this.onChangeCallback(),this}shrinkToFit(){return this.#bA.shrinkToFit(),this.dataView.size=this.typeInfo.dataView.byteLength,this}setX(A,t){const e=this.typeInfo;return e.dataView[e.offset+A*e.stride]=t,this.isDirty||this.onChangeCallback(),this}setY(A,t){const e=this.typeInfo;return e.dataView[e.offset+A*e.stride+1]=t,this.isDirty||this.onChangeCallback(),this}setZ(A,t){const e=this.typeInfo;return e.dataView[e.offset+A*e.stride+2]=t,this.isDirty||this.onChangeCallback(),this}setW(A,t){const e=this.typeInfo;return e.dataView[e.offset+A*e.stride+3]=t,this.isDirty||this.onChangeCallback(),this}setXY(A,t,e){const i=this.typeInfo,s=i.dataView,n=i.offset+A*i.stride;return s[n]=t,s[n+1]=e,this.isDirty||this.onChangeCallback(),this}setXYZ(A,t,e,i){const s=this.typeInfo,n=s.dataView,r=s.offset+A*s.stride;return n[r]=t,n[r+1]=e,n[r+2]=i,this.isDirty||this.onChangeCallback(),this}setXYZW(A,t,e,i,s){const n=this.typeInfo,r=n.dataView,a=n.offset+A*n.stride;return r[a]=t,r[a+1]=e,r[a+2]=i,r[a+3]=s,this.isDirty||this.onChangeCallback(),this}getX(A){const t=this.typeInfo;return t.dataView[t.offset+A*t.stride]}getY(A){const t=this.typeInfo;return t.dataView[t.offset+A*t.stride+1]}getZ(A){const t=this.typeInfo;return t.dataView[t.offset+A*t.stride+2]}getW(A){const t=this.typeInfo;return t.dataView[t.offset+A*t.stride+3]}getXY(A){const t=this.typeInfo,e=t.dataView,i=t.offset+A*t.stride;return[e[i],e[i+1]]}getXYZ(A){const t=this.typeInfo,e=t.dataView,i=t.offset+A*t.stride;return[e[i],e[i+1],e[i+2]]}getXYZW(A){const t=this.typeInfo,e=t.dataView,i=t.offset+A*t.stride;return[e[i],e[i+1],e[i+2],e[i+3]]}addUpdateRange(A,t){return this.updateRanges.push({start:A,count:t}),this}clearUpdateRanges(){return this.updateRanges.length=0,this}setArray(A){const t=Math.ceil(A.length/this.typeInfo.elements);return t>this.count&&this.resize(t),this.#bA.setArray(this.name,A),this.isDirty||this.onChangeCallback(),this}set(A,t=0){return this.#bA.setArray(this.name,A,t),this.isDirty||this.onChangeCallback(),this}readIntoVector3(A,t){const e=this.typeInfo,i=this.view,s=e.stride,n=e.offset;return t.fromArray(i,n+A*s),this}readIntoVector4(A,t){const e=this.typeInfo,i=this.view,s=e.stride,n=e.offset;return t.fromArray(i,n+A*s),this}readIntoMatrix3(A,t){const e=this.typeInfo,i=this.view,s=e.stride,n=e.offset;return t.fromArray(i,n+A*s),this}readIntoMatrix4(A,t){const e=this.typeInfo,i=this.view,s=e.stride,n=e.offset;return t.fromArray(i,n+A*s),this}forEach(A,t=0,e=this.count){const i=this.typeInfo.dataView,s=this.stride,n=this.typeInfo.offset,r=Math.min(e,this.count);for(let a=t;a<r;a++)A(i,n+a*s,a);return this.isDirty||this.onChangeCallback(),this}computeBoundingBox(){const A=this.view,t=this.typeInfo,e=t.offset,i=t.stride,s=this.count;let n=1/0,r=1/0,a=1/0,o=-1/0,l=-1/0,c=-1/0;for(let f=0;f<s;f++){const t=e+f*i,s=A[t],h=A[t+1],u=A[t+2];s<n&&(n=s),h<r&&(r=h),u<a&&(a=u),s>o&&(o=s),h>l&&(l=h),u>c&&(c=u)}const h=(n+o)/2,u=(r+l)/2,g=(a+c)/2;let d=0;for(let f=0;f<s;f++){const t=e+f*i,s=A[t]-h,n=A[t+1]-u,r=A[t+2]-g,a=s*s+n*n+r*r;a>d&&(d=a)}const p=d>0?Math.sqrt(d):0;return{min:new y(n,r,a),max:new y(o,l,c),center:new B(h,u,g,p)}}computeVertexNormals(A,t=!0){const e=this.view,i=this.count,s=this.typeInfo.offset,n=this.typeInfo.stride,r=new Float32Array(3*i);if(null!=A&&A.count>0){const t=A.view,i=A.stride,a=A.count,o=A.typeInfo?.offset??0;for(let A=0;A<a;A+=3){const a=o+A*i,l=t[a],c=t[a+i],h=t[a+2*i],u=s+l*n,g=s+c*n,d=s+h*n,p=e[u],f=e[u+1],m=e[u+2],C=e[g],w=e[g+1],y=e[g+2],B=e[d]-C,I=e[d+1]-w,Q=e[d+2]-y,E=p-C,x=f-w,D=m-y,M=I*D-Q*x,b=Q*E-B*D,S=B*x-I*E,v=3*l,T=3*c,U=3*h;r[v]+=M,r[v+1]+=b,r[v+2]+=S,r[T]+=M,r[T+1]+=b,r[T+2]+=S,r[U]+=M,r[U+1]+=b,r[U+2]+=S}}else for(let a=0;a<i;a+=3){const A=s+a*n,t=A+n,i=A+2*n,o=e[A],l=e[A+1],c=e[A+2],h=e[t],u=e[t+1],g=e[t+2],d=e[i]-h,p=e[i+1]-u,f=e[i+2]-g,m=o-h,C=l-u,w=c-g,y=p*w-f*C,B=f*m-d*w,I=d*C-p*m,Q=3*a,E=3*(a+1),x=3*(a+2);r[Q]=y,r[Q+1]=B,r[Q+2]=I,r[E]=y,r[E+1]=B,r[E+2]=I,r[x]=y,r[x+1]=B,r[x+2]=I}if(t)for(let a=0;a<i;a++){const A=3*a,t=r[A],e=r[A+1],i=r[A+2],s=t*t+e*e+i*i;if(s>0){const n=1/Math.sqrt(s);r[A]=t*n,r[A+1]=e*n,r[A+2]=i*n}}return r}computeTangents(A,t,e,i){const s=this.view,n=this.typeInfo.offset,r=this.stride,a=this.count,o=new Float32Array(4*a),l=A.view,c=A.stride,h=A.typeInfo?.offset??0,u=t.view,g=t.stride,d=t.typeInfo?.offset??0,p=e.view,f=e.stride,m=e.typeInfo?.offset??0,C=new Float32Array(3*a),w=new Float32Array(3*a),y=null!=i&&i.length>0?i:[{start:0,count:A.count}],B=A.count;for(let I=0;I<y.length;I++){const A=y[I].start,t=A+y[I].count;for(let e=A;e+2<B&&e<t;e+=3){const A=h+e*c,t=l[A],i=l[A+c],o=l[A+2*c];if(t>=a||i>=a||o>=a)continue;const u=n+t*r,g=n+i*r,d=n+o*r,y=s[u],B=s[u+1],I=s[u+2],Q=s[g]-y,E=s[g+1]-B,x=s[g+2]-I,D=s[d]-y,M=s[d+1]-B,b=s[d+2]-I,S=p[m+t*f],v=p[m+t*f+1],T=p[m+i*f]-S,U=p[m+i*f+1]-v,N=p[m+o*f]-S,P=p[m+o*f+1]-v,O=1/(T*P-N*U);if(!Number.isFinite(O))continue;const F=(Q*P-D*U)*O,k=(E*P-M*U)*O,R=(x*P-b*U)*O,L=(D*T-Q*N)*O,j=(M*T-E*N)*O,z=(b*T-x*N)*O,G=3*t,Y=3*i,H=3*o;C[G]+=F,C[G+1]+=k,C[G+2]+=R,C[Y]+=F,C[Y+1]+=k,C[Y+2]+=R,C[H]+=F,C[H+1]+=k,C[H+2]+=R,w[G]+=L,w[G+1]+=j,w[G+2]+=z,w[Y]+=L,w[Y+1]+=j,w[Y+2]+=z,w[H]+=L,w[H+1]+=j,w[H+2]+=z}}for(let I=0;I<a;I++){const A=3*I,t=C[A],e=C[A+1],i=C[A+2];if(t*t+e*e+i*i<=0)continue;const s=d+I*g,n=u[s],r=u[s+1],a=u[s+2],l=n*t+r*e+a*i;let c=t-n*l,h=e-r*l,p=i-a*l;const f=c*c+h*h+p*p;if(f>0){const A=1/Math.sqrt(f);c*=A,h*=A,p*=A}const m=a*t-n*i,y=n*e-r*t,B=(r*i-a*e)*w[A]+m*w[A+1]+y*w[A+2]<0?-1:1,Q=4*I;o[Q]=c,o[Q+1]=h,o[Q+2]=p,o[Q+3]=B}return o}computeVertexNormalize(){const A=this.typeInfo.offset,t=this.typeInfo.stride,e=this.view,i=this.count;for(let s=0;s<i;s++){const i=A+s*t,n=e[i],r=e[i+1],a=e[i+2],o=n*n+r*r+a*a;if(o>0){const A=1/Math.sqrt(o);e[i]=n*A,e[i+1]=r*A,e[i+2]=a*A}}return this.isDirty||this.onChangeCallback(),this}applyMatrix3(A){const{offset:t,elements:e,stride:i,dataView:s}=this.typeInfo;return e<2?(console.warn("StructBufferAttribute applyMatrix4 elements < 3, skip"),this):(A.applyToVertexView(s,i,this.count,e,t),this.isDirty||this.onChangeCallback(),this)}applyMatrix4(A){const{offset:t,elements:e,stride:i,dataView:s}=this.typeInfo;return e<3?(console.warn("StructBufferAttribute applyMatrix4 elements < 3, skip"),this):(A.applyToVertexView(s,i,this.count,t),this.isDirty||this.onChangeCallback(),this)}applyNormalMatrix(A){const{offset:t,elements:e,stride:i,dataView:s}=this.typeInfo;return e<3?(console.warn("StructBufferAttribute applyNormalMatrix elements < 3, skip"),this):(A.applyToVertexView(s,i,this.count,e,t),this.isDirty||this.onChangeCallback(),this)}transformDirection(A){const{offset:t,elements:e,stride:i,dataView:s}=this.typeInfo;return e<3?(console.warn("StructBufferAttribute transformDirection elements < 3, skip"),this):(A.transformToDirectionView(s,i,this.count,t),this.isDirty||this.onChangeCallback(),this)}copy(A){return this.#vA(A.#bA.clone()),this.typeInfo=this.#bA.typeMap.get(A.name),this.dataView.size=this.typeInfo.dataView.byteLength,this.name=A.name,this.stepMode=A.stepMode,this.updateRanges=[],this.isDirty||this.onChangeCallback(),this}copyAt(A,t,e){const i=this.typeInfo,s=t.typeInfo,n=i.elements,r=i.offset+A*i.stride,a=s.offset+e*s.stride,o=i.dataView,l=s.dataView;for(let c=0;c<n;c++)o[r+c]=l[a+c];this.isDirty||this.onChangeCallback()}clone(){const A=new Ti(this.#bA.clone(),this.name);return A.stepMode=this.stepMode,A}toJSON(){return{name:this.name,typeInfo:this.typeInfo,count:this.count,stride:this.stride,data:this.#bA.toJSON(),view:this.view,updateRanges:this.updateRanges}}}class Ui extends Ti{setX(A,t){const e=this.view,i=this.typeInfo.offset+A*this.stride;return e[i]=4294966272&e[i]|1023&t,this.isDirty||this.onChangeCallback(),this}setY(A,t){const e=this.view,i=this.typeInfo.offset+A*this.stride;return e[i]=4293919743&e[i]|(1023&t)<<10,this.isDirty||this.onChangeCallback(),this}setZ(A,t){const e=this.view,i=this.typeInfo.offset+A*this.stride;return e[i]=3222274047&e[i]|(1023&t)<<20,this.isDirty||this.onChangeCallback(),this}setW(A,t){const e=this.view,i=this.typeInfo.offset+A*this.stride;return e[i]=1073741823&e[i]|(3&t)<<30,this.isDirty||this.onChangeCallback(),this}setXY(A,t,e){const i=this.view,s=this.typeInfo.offset+A*this.stride;return i[s]=4293918720&i[s]|1023&t|(1023&e)<<10,this.isDirty||this.onChangeCallback(),this}setXYZ(A,t,e,i){const s=this.view,n=this.typeInfo.offset+A*this.stride;return s[n]=3221225472&s[n]|1023&t|(1023&e)<<10|(1023&i)<<20,this.isDirty||this.onChangeCallback(),this}setXYZW(A,t,e,i,s){return this.view[this.typeInfo.offset+A*this.stride]=1023&t|(1023&e)<<10|(1023&i)<<20|(3&s)<<30,this.isDirty||this.onChangeCallback(),this}getX(A){return 1023&this.view[this.typeInfo.offset+A*this.stride]}getY(A){return this.view[this.typeInfo.offset+A*this.stride]>>>10&1023}getZ(A){return this.view[this.typeInfo.offset+A*this.stride]>>>20&1023}getW(A){return this.view[this.typeInfo.offset+A*this.stride]>>>30&3}getXY(A){const t=this.view[this.typeInfo.offset+A*this.stride];return[1023&t,t>>>10&1023]}getXYZ(A){const t=this.view[this.typeInfo.offset+A*this.stride];return[1023&t,t>>>10&1023,t>>>20&1023]}getXYZW(A){const t=this.view[this.typeInfo.offset+A*this.stride];return[1023&t,t>>>10&1023,t>>>20&1023,t>>>30&3]}setNormal(A,t,e,i){const s=1023*(.5*t+.5)+.5|0,n=1023*(.5*e+.5)+.5|0,r=1023*(.5*i+.5)+.5|0;return this.view[this.typeInfo.offset+A*this.stride]=1023&s|(1023&n)<<10|(1023&r)<<20,this.isDirty||this.onChangeCallback(),this}getNormal(A){const t=this.view[this.typeInfo.offset+A*this.stride];return[(1023&t)/1023*2-1,(t>>>10&1023)/1023*2-1,(t>>>20&1023)/1023*2-1]}setTangent(A,t,e,i,s){const n=1023*(.5*t+.5)+.5|0,r=1023*(.5*e+.5)+.5|0,a=1023*(.5*i+.5)+.5|0,o=3*(.5*s+.5)+.5|0;return this.view[this.typeInfo.offset+A*this.stride]=1023&n|(1023&r)<<10|(1023&a)<<20|(3&o)<<30,this.isDirty||this.onChangeCallback(),this}getTangent(A){const t=this.view[this.typeInfo.offset+A*this.stride];return[(1023&t)/1023*2-1,(t>>>10&1023)/1023*2-1,(t>>>20&1023)/1023*2-1,(t>>>30&3)/3*2-1]}copyAt(A,t,e){const i=this.typeInfo.offset+A*this.stride,s=t.typeInfo,n=s.offset+e*s.stride;this.view[i]=t.view[n],this.isDirty||this.onChangeCallback()}}class Ni extends vi{constructor(A,t=1,e=!1){A&&A instanceof Uint8Array||(A=new Uint8Array(A??0)),super(A,t,e)}}class Pi extends vi{constructor(A,t=1,e=!1,i=!1){A&&A instanceof Uint16Array||(A=new Uint16Array(A??0)),super(A,t,e,i)}}class Oi extends vi{constructor(A,t=1,e=!1){A&&A instanceof Uint32Array||(A=new Uint32Array(A??0)),super(A,t,e)}}class Fi extends vi{constructor(A,t=1,e=!1){A&&A instanceof Float32Array||(A=new Float32Array(A??0)),super(A,t,e)}}class ki extends vi{constructor(A){A&&A instanceof Uint8Array||(A=new Uint8Array(A??0)),super(A,"bgra",!0)}setB(A,t){return this.setX(A,t)}getB(A){return this.getX(A)}setG(A,t){return this.setY(A,t)}getG(A){return this.getY(A)}setR(A,t){return this.setZ(A,t)}getR(A){return this.getZ(A)}setA(A,t){return this.setW(A,t)}getA(A){return this.getW(A)}setBGRA(A,t,e,i,s){const n=this.dataView.view,r=A*this.stride;return n[r]=t,n[r+1]=e,n[r+2]=i,n[r+3]=s,this.isDirty||this.onChangeCallback(),this}setRGBA(A,t,e,i,s){const n=this.dataView.view,r=A*this.stride;return n[r]=i,n[r+1]=e,n[r+2]=t,n[r+3]=s,this.isDirty||this.onChangeCallback(),this}getBGRA(A){const t=this.dataView.view,e=A*this.stride;return[t[e],t[e+1],t[e+2],t[e+3]]}getRGBA(A){const t=this.dataView.view,e=A*this.stride;return[t[e+2],t[e+1],t[e],t[e+3]]}setRGBAFloat(A,t,e,i,s){const n=this.dataView.view,r=A*this.stride;return n[r]=255*i+.5|0,n[r+1]=255*e+.5|0,n[r+2]=255*t+.5|0,n[r+3]=255*s+.5|0,this.isDirty||this.onChangeCallback(),this}getRGBAFloat(A){const t=this.dataView.view,e=A*this.stride,i=1/255;return[t[e+2]*i,t[e+1]*i,t[e]*i,t[e+3]*i]}}class Ri extends vi{constructor(A){A&&A instanceof Uint32Array||(A=new Uint32Array(A??0)),super(A,"unorm10",!0)}static pack(A,t,e,i){return 1023*A+.5&1023|(1023*t+.5&1023)<<10|(1023*e+.5&1023)<<20|(3*i+.5&3)<<30}static unpack(A){return[(1023&A)/1023,(A>>>10&1023)/1023,(A>>>20&1023)/1023,(A>>>30&3)/3]}static packSigned(A,t,e,i){return Ri.pack(.5*A+.5,.5*t+.5,.5*e+.5,.5*i+.5)}static unpackSigned(A){return[(1023&A)/1023*2-1,(A>>>10&1023)/1023*2-1,(A>>>20&1023)/1023*2-1,(A>>>30&3)/3*2-1]}setX(A,t){const e=this.dataView.view,i=A*this.stride;return e[i]=4294966272&e[i]|1023&t,this.isDirty||this.onChangeCallback(),this}setY(A,t){const e=this.dataView.view,i=A*this.stride;return e[i]=4293919743&e[i]|(1023&t)<<10,this.isDirty||this.onChangeCallback(),this}setZ(A,t){const e=this.dataView.view,i=A*this.stride;return e[i]=3222274047&e[i]|(1023&t)<<20,this.isDirty||this.onChangeCallback(),this}setW(A,t){const e=this.dataView.view,i=A*this.stride;return e[i]=1073741823&e[i]|(3&t)<<30,this.isDirty||this.onChangeCallback(),this}setXY(A,t,e){const i=this.dataView.view,s=A*this.stride;return i[s]=4293918720&i[s]|1023&t|(1023&e)<<10,this.isDirty||this.onChangeCallback(),this}setXYZ(A,t,e,i){const s=this.dataView.view,n=A*this.stride;return s[n]=3221225472&s[n]|1023&t|(1023&e)<<10|(1023&i)<<20,this.isDirty||this.onChangeCallback(),this}setXYZW(A,t,e,i,s){return this.dataView.view[A*this.stride]=1023&t|(1023&e)<<10|(1023&i)<<20|(3&s)<<30,this.isDirty||this.onChangeCallback(),this}getX(A){return 1023&this.dataView.view[A*this.stride]}getY(A){return this.dataView.view[A*this.stride]>>>10&1023}getZ(A){return this.dataView.view[A*this.stride]>>>20&1023}getW(A){return this.dataView.view[A*this.stride]>>>30&3}getXY(A){const t=this.dataView.view[A*this.stride];return[1023&t,t>>>10&1023]}getXYZ(A){const t=this.dataView.view[A*this.stride];return[1023&t,t>>>10&1023,t>>>20&1023]}getXYZW(A){const t=this.dataView.view[A*this.stride];return[1023&t,t>>>10&1023,t>>>20&1023,t>>>30&3]}setNormal(A,t,e,i){const s=1023*(.5*t+.5)+.5|0,n=1023*(.5*e+.5)+.5|0,r=1023*(.5*i+.5)+.5|0;return this.dataView.view[A*this.stride]=1023&s|(1023&n)<<10|(1023&r)<<20,this.isDirty||this.onChangeCallback(),this}getNormal(A){const t=this.dataView.view[A*this.stride];return[(1023&t)/1023*2-1,(t>>>10&1023)/1023*2-1,(t>>>20&1023)/1023*2-1]}setTangent(A,t,e,i,s){const n=1023*(.5*t+.5)+.5|0,r=1023*(.5*e+.5)+.5|0,a=1023*(.5*i+.5)+.5|0,o=3*(.5*s+.5)+.5|0;return this.dataView.view[A*this.stride]=1023&n|(1023&r)<<10|(1023&a)<<20|(3&o)<<30,this.isDirty||this.onChangeCallback(),this}getTangent(A){const t=this.dataView.view[A*this.stride];return[(1023&t)/1023*2-1,(t>>>10&1023)/1023*2-1,(t>>>20&1023)/1023*2-1,(t>>>30&3)/3*2-1]}}const Li=new WeakMap;function ji(A){const t=A/3|0;return t>0?6*t:0}function zi(A){const t=Li.get(A);t&&(t.buffer.destroy(),Li.delete(A))}function Gi(A,t){return A.view[(0|A.typeInfo.offset)+t*A.stride]}let Yi=0;const Hi=new v,Ki=new Q,Vi=new Mi;class Ji extends Map{constructor(A){super(),this.owner=A}set(A,t){const e=super.get(A);if(e===t)return this;const i=this.owner;return e?.depObjects?.delete?.(i.weakSelf),t.name??=A,t.depObjects?.add?.(i.weakSelf),t.DIRTY_TYPE=f.DIRTY_DATA,super.set(A,t),i.markMorphStructureDirty(),this}delete(A){const t=super.get(A);return!(!t||!super.delete(A)||(t.depObjects?.delete?.(this.owner.weakSelf),this.owner.markMorphStructureDirty(),0))}clear(){if(0===this.size)return;const A=this.owner,t=A.weakSelf;for(const e of this.values())e.depObjects?.delete?.(t);super.clear(),A.markMorphStructureDirty()}}class Wi{id=Yi++;uuid=e();isBufferGeometry=!0;role="mesh";isDynamic=!0;freeze(){return this.isDynamic=!1,this.dirtyTypes&=~f.DIRTY_STRUCTURE,this}get isFrozen(){return!this.isDynamic}assertMutableLayout(A){if(!this.isDynamic)throw new Error(`BufferGeometry is frozen (${A}): attribute list and vertex/index counts are immutable`)}name="";type="BufferGeometry";_cacheKey="";#TA=null;#UA=new Map;index=null;morphAttributes;morphNormals;#NA=!1;morphVersion=0;get morphTargetsRelative(){return this.#NA}set morphTargetsRelative(A){this.#NA!==A&&(this.#NA=A,this.morphVersion++,this.onChangeCallback(f.DIRTY_DATA))}drawRange={start:0,count:1/0};#PA;#OA=!1;boundIndex=-1;version=0;depObjects=new Set;dirtyTypes=f.DIRTY_ALL;_dirtySlot=-1;dirtySystem=null;weakSelf=new WeakRef(this);worldStore=null;#BA=null;#FA=!1;switchStore(A){if("stream"===this.role)throw new Error("BufferGeometry.role=stream cannot switchStore");if(this.#FA)throw new Error("BufferGeometry is disposed");const t=this.worldStore;if(t!=A){if(!t&&A){const t=A.boundingMeta,e=t.allocate();if(-1===e)throw new Error("Failed to allocate memory for BufferGeometry");const i=this.#PA.center,s=4*e;return t.f32.set(i.elements,s),i.setTypeData(t.f32,s),this.boundIndex=e,this.worldStore=A,this.#BA=()=>{t.free(e)},t.registerDepObject(this.weakSelf),this.#OA&&t.writeDirty(e),void d.register(this,this.#BA)}if(t&&!A){const A=t.boundingMeta,e=4*this.boundIndex;return this.#PA.center.setTypeData(A.f32.slice(e,e+4),0),this.#BA?.(),this.#BA=null,this.worldStore=null,this.boundIndex=-1,A.unregisterDepObject(this.weakSelf),void d.unregister(this)}throw new Error("Cannot switch worldStore when worldStore is not null")}}transfer(){const A=this.boundIndex,t=this.worldStore;A<0||!t||this.#PA.center.setTypeData(t.boundingMeta.f32,4*this.boundIndex)}constructor(){const A=new B(0,0,0,0);this.#PA={min:new y,max:new y,center:A},this.morphAttributes=new Ji(this),this.morphNormals=new Ji(this)}markMorphStructureDirty(){this.morphVersion++;const A=this.#OA;this.onChangeCallback(f.DIRTY_STRUCTURE),this.#OA=A}get boundingBox(){return this.#OA?this.#PA:null}set boundingBox(A){const t=this.#PA;null==A?(t.min.set(0,0,0),t.max.set(0,0,0),t.center.set(0,0,0,0),this.#OA=!1):(t.min.copy(A.min),t.max.copy(A.max),t.center.copy(A.center),this.worldStore?.boundingMeta.writeDirty(this.boundIndex),this.#OA=!0)}get attributes(){return this.#UA}getVertexSlots(){if(this.#TA)return this.#TA;const A=new Map,t=[];for(const[e,i]of this.#UA){if(i.skipGpu)continue;let s=me(e);null==s&&(s=Ce(e));const n=i.typeInfo,r=n.format,a=n.locationCount??1,o={shaderLocation:s,offset:0,format:r,attrName:e,wgslType:n.wgslType};a>1&&(o.locationCount=a,o.rowFormat=n.rowFormat,o.rowSize=n.rowSize);const l=!0===i.isStructBufferAttribute;if(l&&!n.isChunkLayout){const r=i.dataView.view.buffer;let a=A.get(r);a||(a={arrayStride:n.byteStride,stepMode:i.stepMode??"vertex",bindByteOffset:0,attrName:e,attributes:[],minLoc:s,wgslType:n.wgslType},A.set(r,a),t.push(a)),o.offset=n.byteOffset||0,a.attributes.push(o),s<a.minLoc&&(a.minLoc=s)}else{const A=l&&n.isChunkLayout;o.offset=A?0:n.byteOffset||0,t.push({arrayStride:n.byteStride,stepMode:i.stepMode??"vertex",bindByteOffset:A?n.byteOffset:0,attrName:e,attributes:[o],minLoc:s,wgslType:n.wgslType})}}t.sort((A,t)=>A.minLoc-t.minLoc);for(const e of t)e.attributes.sort((A,t)=>A.shaderLocation-t.shaderLocation);return this.#TA=t,t}getCacheKey(){const A=this._cacheKey;if(A)return A;const t=[];for(const[e,i]of this.#UA){const A=i.typeInfo;t.push(`${e}:${A.format}:${A.byteStride}:${A.byteOffset}:${i.stepMode}`)}return t.sort(),this._cacheKey=t.length?t.join("|"):"none"}onChangeCallback(A){const t=!!(A&(f.DIRTY_DATA|f.DIRTY_INDEX));if(A&f.DIRTY_STRUCTURE)this._cacheKey="",this.#TA=null,this.#OA=!1,this.version++;else if(t){const A=this.#UA.get("position");this.#OA&&A?.isDirty&&(this.#OA=!1);let t=!1;for(const e of this.morphAttributes.values())if(e.isDirty){t=!0;break}if(!t)for(const e of this.morphNormals.values())if(e.isDirty){t=!0;break}if(!t&&this.morphAttributes.size>0&&!this.#NA){const e=this.#UA.get("normal");t=!!A?.isDirty||this.morphNormals.size>0&&!!e?.isDirty}t&&this.morphVersion++}if(this.dirtyTypes&A&&-1!==this._dirtySlot)return;this.dirtyTypes|=A;const e=this.depObjects;if(t&&!(this.dirtyTypes&f.DIRTY_STRUCTURE)){if(!this.dirtySystem)return;if(0===e.size)return void(this.dirtySystem=null);let A=!1;for(const t of e){const i=t.deref();if(null!=i){if(i.dirtySystem){A=!0;break}}else e.delete(t)}return void(A?this.dirtySystem.addGeometry(this):this.dirtySystem=null)}this.dirtySystem?.removeGeometry(this);for(const i of e){const t=i.deref();null!=t?t.onChangeCallback(A):e.delete(i)}}resetState(){this.dirtyTypes&=-424961,this.#UA.forEach(A=>{A.isDirty&&(A.isDirty=!1)}),this.index?.resetDirty()}getIndex(){return this.index}setIndex(A){if("stream"===this.role)throw new Error("BufferGeometry.role=stream cannot setIndex");const t=this.index;let e=null;if(null!=A&&(e=A.isBufferAttribute?function(A){const t=A.typeInfo;if(!t||t.byteStride===t.size||"uint16"!==t.format||1!==t.elements)return A;const e=A.count,i=new Uint16Array(e),s=A.view,n=A.stride,r=0|t.offset;for(let a=0;a<e;a++)i[a]=s[r+a*n];return new Pi(i,1,!1,!0)}(A):function(A){for(let t=A.length-1;t>=0;--t)if(A[t]>=65535)return!0;return!1}(A)?new Oi(A,1):new Pi(A,1,!1,!0)),e===t)return this;if(!this.isDynamic)if(null==t||null==e)this.assertMutableLayout(null==e?"setIndex(null)":"setIndex(index)");else if(t.capacity!==e.capacity)throw new Error("BufferGeometry is frozen (setIndex): index capacity cannot change");t?.depObjects?.delete?.(this.weakSelf),e&&(e.depObjects?.add?.(this.weakSelf),e.DIRTY_TYPE=f.DIRTY_INDEX),this.index=e;const i=this.#OA;return this.onChangeCallback(f.DIRTY_STRUCTURE),this.#OA=i,this}setAttribute(A,t){if(null==t)return this.deleteAttribute(A);t.name??=A;const e=this.#UA,i=e.get(A);if(!this.isDynamic&&(null==i&&e.size>0&&this.assertMutableLayout(`setAttribute(${A})`),i&&i!==t&&i.capacity!==t.capacity))throw new Error(`BufferGeometry is frozen (setAttribute ${A}): vertex capacity cannot change`);if(i?.depObjects?.delete?.(this.weakSelf),e.set(A,t),t.depObjects?.add?.(this.weakSelf),i!==t){const t="position"!==A&&this.#OA;this.onChangeCallback(f.DIRTY_STRUCTURE),t&&(this.#OA=!0)}return this}getAttribute(A){return this.#UA.get(A)}deleteAttribute(A){this.assertMutableLayout(`deleteAttribute(${A})`);const t=this.#UA,e=t.get(A);if(e){t.delete(A),e.depObjects?.delete?.(this.weakSelf);const i="position"!==A&&this.#OA;this.onChangeCallback(f.DIRTY_STRUCTURE),i&&(this.#OA=!0)}return this}hasAttribute(A){return this.#UA.has(A)}setDrawRange(A,t){const e=this.drawRange;e.start===A&&e.count===t||(e.start=A,e.count=t,this.onChangeCallback(f.DIRTY_DATA))}applyMatrix4(A){const t=this.#UA,e=t.get("position"),i=null!=this.boundingBox;e&&(e.applyMatrix4(A),this.boundingBox=null);const s=t.get("normal"),n=this.morphAttributes,r=this.morphNormals,a=n.size>0;if(s||a&&r.size>0){const t=Ki.getNormalMatrix(A);if(s&&s.applyNormalMatrix(t),a)for(const A of r.values())A.applyNormalMatrix(t)}const o=t.get("tangent");if(o&&o.transformDirection(A),a)if(this.#NA)for(const l of n.values())l.transformDirection(A);else for(const l of n.values())l.applyMatrix4(A);return i&&this.computeBoundingBox(),this}applyQuaternion(A){return this.applyMatrix4(Hi.makeRotationFromQuaternion(A)),this}rotateX(A){return this.applyMatrix4(Hi.makeRotationX(A)),this}rotateY(A){return this.applyMatrix4(Hi.makeRotationY(A)),this}rotateZ(A){return this.applyMatrix4(Hi.makeRotationZ(A)),this}translate(A,t,e){return this.applyMatrix4(Hi.makeTranslation(A,t,e)),this}scale(A,t,e){return this.applyMatrix4(Hi.makeScale(A,t,e)),this}lookAt(A){return Vi.lookAt(A),this.applyMatrix4(Vi.matrix),this}center(){const A=this.boundingBox??this.computeBoundingBox();if(!A)return this;const t=A.center;return this.translate(-t.x,-t.y,-t.z),this}setArray(A){const t=this.#UA.get("position");return t?(t.set(A),this):this}setFromPoints(A){let t=this.#UA.get("position");if(t){A.length!==t.count&&(this.isDynamic||this.assertMutableLayout("setFromPoints"),t.resize(A.length));const e=A.length,i=t.view,s=t.stride,n=t.typeInfo?.offset??0;for(let t=0;t<e;t++){const e=A[t],r=n+t*s;i[r]=e.x,i[r+1]=e.y,i[r+2]=e.z??0}t.isDirty||t.onChangeCallback()}else{const e=A.length;t=new Fi(3*e,3);const i=t.view,s=t.stride,n=t.typeInfo?.offset??0;if(A[0]instanceof y)for(let t=0;t<e;t++){const e=A[t],r=n+t*s;i[r]=e.x,i[r+1]=e.y,i[r+2]=e.z}else for(let t=0;t<e;t++){const e=A[t],r=n+t*s;i[r]=e.x,i[r+1]=e.y,i[r+2]=0}this.setAttribute("position",t)}return this}normalizeNormals(){const A=this.#UA.get("normal");return A?(A.computeVertexNormalize(),this):this}assignBoundingBox(A,t,e,i,s,n,r,a,o,l){const c=this.#PA;return c.min.set(A,t,e),c.max.set(i,s,n),c.center.set(r,a,o,l),this.worldStore?.boundingMeta.writeDirty(this.boundIndex),this.#OA=!0,c}computeBoundingBox(){const A=this.#UA.get("position");if(!A)return this.boundingBox=null,null;if(0===A.count)return this.assignBoundingBox(0,0,0,0,0,0,0,0,0,0);const t=A.view,e=A.stride,i=0|A.typeInfo.offset,s=A.count;let n=1/0,r=1/0,a=1/0,o=-1/0,l=-1/0,c=-1/0;for(let f=0;f<s;f++){const A=i+f*e,s=t[A],h=t[A+1],u=t[A+2];s<n&&(n=s),h<r&&(r=h),u<a&&(a=u),s>o&&(o=s),h>l&&(l=h),u>c&&(c=u)}const h=(n+o)/2,u=(r+l)/2,g=(a+c)/2;let d=0;for(let f=0;f<s;f++){const A=i+f*e,s=t[A]-h,n=t[A+1]-u,r=t[A+2]-g,a=s*s+n*n+r*r;a>d&&(d=a)}const p=d>0?Math.sqrt(d):0;return this.assignBoundingBox(n,r,a,o,l,c,h,u,g,p)}computeTangents(){const A=this.#UA,t=A.get("position"),e=A.get("normal"),i=A.get("uv"),s=this.index;if(!(t&&e&&i&&s&&0!==s.count))return;const n=t.computeTangents(s,e,i,void 0);this.setAttribute("tangent",new Fi(n,4))}computeVertexNormals(A=!1){const t=this.#UA.get("position");if(!t)return;const e=t.computeVertexNormals(this.index??void 0,A);this.setAttribute("normal",new Fi(e,3))}dispose(){if(this.#FA)return;zi(this);const A=this.weakSelf;for(const e of this.#UA.values())e.depObjects?.delete?.(A);this.index?.depObjects?.delete?.(A);for(const e of this.morphAttributes.values())e.depObjects?.delete?.(A);for(const e of this.morphNormals.values())e.depObjects?.delete?.(A);let t=!1;for(const e of this.depObjects)if(e.deref()){t=!0;break}t||this.switchStore(null),this.#FA=!0}clone(){return(new this.constructor).copy(this)}copy(A){this.name=A.name,this.type=A.type;const t=A.isDynamic,e=A.role;this.isDynamic=!0,this.role="mesh";const i=new Map,s=A=>{const t=A;if(t.isStructBufferAttribute){const A=t.data;let e=i.get(A);e||(e=A.clone(),i.set(A,e));const s=new Ti(e,t.name);return s.stepMode=t.stepMode,s}return A.clone()};this.setIndex(A.index?s(A.index):null);for(const[n,r]of A.attributes)this.setAttribute(n,s(r));for(const[n,r]of A.morphAttributes)this.morphAttributes.set(n,s(r));for(const[n,r]of A.morphNormals)this.morphNormals.set(n,s(r));return this.morphTargetsRelative=A.morphTargetsRelative,this.drawRange=A.drawRange?{...A.drawRange}:{start:0,count:1/0},this.role=e,this.isDynamic=t,t||(this.dirtyTypes&=~f.DIRTY_STRUCTURE),this}toJSON(){}}let qi=null,Xi=!1,Zi=null,_i=0;function $i(){_i++}function As(){_i>0&&_i--,0===_i&&(ts=null)}let ts=null;function es(A){return A.typeInfo?.offset??0}const is=new v,ss=new y,ns=new y,rs=new y;let as=0;const os=new y,ls=new y,cs=new y,hs=new y,us=new y,gs=new y,ds=new y,ps=new y,fs=new y,ms=new y,Cs=new y,ws=new y,ys=new y,Bs=new w,Is=new y,Qs=new y,Es=new y,xs=new y,Ds=new y,Ms=new y,bs=new y,Ss=1e-10;function vs(A,t,e,i,s,n,r){gs.copy(i).sub(e),ds.copy(s).sub(e),ps.crossVectors(gs,ds);let a,o=t.dot(ps);if(o>0){if(n)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}fs.copy(A).sub(e),ms.crossVectors(fs,ds);const l=a*t.dot(ms);if(l<0)return null;const c=a*t.dot(gs.cross(fs));if(c<0)return null;if(l+c>o)return null;const h=-a*fs.dot(ps);if(h<0)return null;const u=h/o;return r.set(A.x+t.x*u,A.y+t.y*u,A.z+t.z*u),u}function Ts(A){const t=A.typeInfo;return t?.offset??0}const Us={mesh:null,raycaster:null,intersects:null,rayOriginLocal:null,rayDirectionLocal:null,matrixWorld:null,posView:null,posStride:0,posOffset:0,side:"front",needUV:!1,needNormal:!1,needBarycoord:!1,uvAttr:void 0,normalAttr:void 0,uvOffset:0,normalOffset:0,instanceId:void 0,closestOnly:!1,maxDist:1/0};function Ns(A,t,e,i,s,n,r){A.object=Us.mesh,A.point.copy(ws),A.distance=n,A.faceIndex=s;const a=A.face;a?(a.a=t,a.b=e,a.c=i,a.materialIndex=0):A.face={a:t,b:e,c:i,materialIndex:0};const o=Us.instanceId;null!=o?A.instanceId=o:null!=A.instanceId&&(A.instanceId=void 0),Us.needBarycoord&&r&&(A.barycoord?A.barycoord.copy(ys):A.barycoord=ys.clone());const l=Us.uvAttr;if(Us.needUV&&l&&r){!function(A,t,e,i,s,n,r,a){const o=e+i*t,l=e+s*t,c=e+n*t,h=r.x,u=r.y,g=r.z;a.x=A[o]*h+A[l]*u+A[c]*g,a.y=A[o+1]*h+A[l+1]*u+A[c+1]*g}(l.view,l.stride,Us.uvOffset,t,e,i,ys,Bs);const s=A.uv;s&&"function"==typeof s.copy?s.copy(Bs):s?(s.x=Bs.x,s.y=Bs.y):A.uv=Bs.clone()}const c=Us.normalAttr,h=Us.rayDirectionLocal;Us.needNormal&&c&&r&&(function(A,t,e,i,s,n,r,a){const o=e+i*t,l=e+s*t,c=e+n*t,h=r.x,u=r.y,g=r.z;a.set(A[o]*h+A[l]*u+A[c]*g,A[o+1]*h+A[l+1]*u+A[c+1]*g,A[o+2]*h+A[l+2]*u+A[c+2]*g)}(c.view,c.stride,Us.normalOffset,t,e,i,ys,Is),Is.dot(h)>0&&Is.negate(),A.normal?A.normal.copy(Is):A.normal=Is.clone())}function Ps(A,t,e,i){const s=Us.posView,n=Us.posOffset,r=Us.posStride;cs.set(s[n+A*r],s[n+A*r+1],s[n+A*r+2]),hs.set(s[n+t*r],s[n+t*r+1],s[n+t*r+2]),us.set(s[n+e*r],s[n+e*r+1],s[n+e*r+2]);const a=Us.rayOriginLocal,o=Us.rayDirectionLocal;if(null===("back"===Us.side?vs(a,o,us,hs,cs,!0,Cs):vs(a,o,cs,hs,us,"front"===Us.side,Cs)))return!1;const l=Us.raycaster;ws.copy(Cs).applyMatrix4(Us.matrixWorld);const c=l.ray.origin.distanceTo(ws);if(c<l.near)return!1;if(Us.closestOnly&&Us.intersects.length>0?c>=Us.maxDist:c>Us.maxDist)return!1;const h=Us.needBarycoord||Us.needUV||Us.needNormal?function(A,t,e,i,s){Qs.copy(i).sub(t),Es.copy(e).sub(t),xs.copy(A).sub(t);const n=Qs.dot(Qs),r=Qs.dot(Es),a=Qs.dot(xs),o=Es.dot(Es),l=Es.dot(xs),c=n*o-r*r;if(0===c)return s.set(0,0,0),null;const h=1/c,u=(o*a-r*l)*h,g=(n*l-r*a)*h;return s.set(1-u-g,g,u),s}(Cs,cs,hs,us,ys):null,u=Us.intersects;if(Us.closestOnly){let s=u[0];return s||(s={object:Us.mesh,point:ws.clone(),distance:c},u.push(s)),Ns(s,A,t,e,i,c,h),Us.maxDist=c,!0}const g={object:Us.mesh,point:ws.clone(),distance:c,face:{a:A,b:t,c:e,materialIndex:0},faceIndex:i};return Ns(g,A,t,e,i,c,h),u.push(g),!0}class Os extends Mi{type="Mesh";isMesh=!0;isCanRender=!0;depObjects=null;_cacheKey="";count=1;#kA=!1;get castShadow(){return this.#kA}set castShadow(A){const t=!!A;this.#kA!==t&&(this.#kA=t,this.dirtySystem?.casterFlagList.push(this))}morphTargetInfluences;morphTargetDictionary;get skeleton(){return this.poseSkeleton}set skeleton(A){this.poseSkeleton!==A&&(this.poseSkeleton=A,this.onChangeCallback(f.DIRTY_STRUCTURE))}#RA;#LA;_vertexStreams=null;topology=G.TriangleList;weakSelf=new WeakRef(this);constructor(A,t){super(),this.geometry=A,this.material=t}get geometry(){return this.#RA}set geometry(A){const t=this.#RA;if(t===A)return;const e=this.dirtySystem;t?.depObjects.delete(this.weakSelf),this.#RA=A,A?.depObjects.add(this.weakSelf),null!=e&&null!=A&&(A.dirtySystem!==e&&(A.dirtySystem=e),this.worldStore&&A.switchStore(this.worldStore)),this.onChangeCallback(f.DIRTY_STRUCTURE)}get vertexStreams(){return this._vertexStreams}set vertexStreams(A){const t=this._vertexStreams;if(t!==A){if(t?.depObjects.delete(this.weakSelf),this._vertexStreams=A,A){A.role="stream",A.depObjects.add(this.weakSelf);const t=this.dirtySystem;null!=t&&A.dirtySystem!==t&&(A.dirtySystem=t)}this.onChangeCallback(f.DIRTY_STRUCTURE)}}get material(){return this.#LA}set material(A){const t=this.#LA;if(t===A)return;const e=this.dirtySystem;t?.depObjects.delete(this.weakSelf),this.#LA=A,A?.depObjects?.add(this.weakSelf),null!=e&&null!=A&&A.dirtySystem!==e&&(A.dirtySystem=e),this.onChangeCallback(f.DIRTY_STRUCTURE)}getCacheKey(){const A=this._cacheKey;if(A)return A;const t=this._vertexStreams;return this._cacheKey=t?`${this.type}|vs:${t.getCacheKey()}`:this.type,this._cacheKey}setMorphInfluence(A,t){let e=this.morphTargetInfluences;for(e||(e=this.morphTargetInfluences=[]);e.length<=A;)e.push(0);const i=e[A];if(i===t)return this;const s=function(A,t){for(let e=0,i=A.length;e<i;e++)if(e!==t&&0!==A[e])return!0;return!1}(e,A);return e[A]=t,this.#jA((0!==i||s)!==(0!==t||s)),this}setMorphInfluences(A){let t=this.morphTargetInfluences;t||(t=this.morphTargetInfluences=[]);const e=Fs(t),i=A.length;let s=t.length!==i;s&&(t.length=i);for(let n=0;n<i;n++){const e=A[n]??0;t[n]!==e&&(t[n]=e,s=!0)}return s&&this.#jA(e!==Fs(t)),this}#jA(A){this.dirtyTypes[0]|=A?f.DIRTY_STRUCTURE:f.DIRTY_MORPH,this.dirtySystem?.add(this)}updateMorphTargets(A=!0){const t=this.geometry.morphAttributes,e=this.morphTargetDictionary,i=this.morphTargetInfluences,s={},n=[];let r=0;for(const a of t.keys()){s[a]=r;const A=null==e?r:e[a];n.push(null==A?0:i?.[A]??0),r++}this.morphTargetDictionary=s,this.morphTargetInfluences=n,A&&this.#jA(Fs(i)!==Fs(n))}getVertexPosition(A,t){const e=this.geometry,i=e.getAttribute("position");if(!i||A<0||A>=i.count)return t.set(0,0,0),t;t.fromBufferAttribute(i,A);const s=e.morphAttributes,n=this.morphTargetInfluences;if(!n?.length||0===s.size)return t;const r=e.morphTargetsRelative;Ds.set(0,0,0);let a=0;for(const o of s.values()){if(a>=n.length)break;const e=n[a++];0!==e&&o?.view&&(Ms.fromBufferAttribute(o,A),r?(Ds.x+=Ms.x*e,Ds.y+=Ms.y*e,Ds.z+=Ms.z*e):(Ms.sub(t),Ds.x+=Ms.x*e,Ds.y+=Ms.y*e,Ds.z+=Ms.z*e))}return t.add(Ds),t}raycast(A,t){const e=this.geometry,i=this.material,s=this.matrixWorld;if(null==i)return;const n=e.boundingBox??e.computeBoundingBox();if(!n)return;const r=n.center;if(rs.set(r.x,r.y,r.z),as=r.w,rs.applyMatrix4(s),as*=s.getMaxScaleOnAxis(),ss.copy(A.ray.origin),ns.copy(A.ray.direction),ls.copy(ss),ls.x+=ns.x*A.near,ls.y+=ns.y*A.near,ls.z+=ns.z*A.near,ss.copy(ls),rs.distanceToSquared(ss)>as*as){const t=function(A,t,e,i,s){bs.copy(e).sub(A);const n=bs.dot(t),r=bs.dot(bs)-n*n,a=i*i;if(r>a)return null;const o=Math.sqrt(a-r),l=n-o,c=n+o;return c<0?null:l<0?(s.copy(A),s.x+=t.x*c,s.y+=t.y*c,s.z+=t.z*c,s):(s.copy(A),s.x+=t.x*l,s.y+=t.y*l,s.z+=t.z*l,s)}(ss,ns,rs,as,os);if(null==t)return;if(ss.distanceToSquared(os)>(A.far-A.near)**2)return}if(is.copy(s).invert(),ss.copy(A.ray.origin),ns.copy(A.ray.direction),ss.applyMatrix4(is),ns.transformDirection(is),null==e.boundingBox||function(A,t,e){const i=1/(t.x||Ss),s=1/(t.y||Ss),n=1/(t.z||Ss);let r=i>=0?(e.min.x-A.x)*i:(e.max.x-A.x)*i,a=i>=0?(e.max.x-A.x)*i:(e.min.x-A.x)*i;const o=s>=0?(e.min.y-A.y)*s:(e.max.y-A.y)*s,l=s>=0?(e.max.y-A.y)*s:(e.min.y-A.y)*s;if(r>l||o>a)return!1;(o>r||Number.isNaN(r))&&(r=o),(l<a||Number.isNaN(a))&&(a=l);const c=n>=0?(e.min.z-A.z)*n:(e.max.z-A.z)*n,h=n>=0?(e.max.z-A.z)*n:(e.min.z-A.z)*n;return!(r>h||c>a)&&((c>r||Number.isNaN(r))&&(r=c),(h<a||Number.isNaN(a))&&(a=h),a>=0)}(ss,ns,e.boundingBox)){$i();try{this._computeIntersections(A,t,ss,ns)}finally{As()}}}_computeIntersections(A,t,e,i,s,n){const r=this.geometry,a=r.getAttribute("position");if(!a)return;const o=!0===A.closestOnly,l=!1!==A.firstHitOnly&&!o,c=!0===A.needUV,h=!0===A.needNormal,u=!0===A.needBarycoord,g=c?r.getAttribute("uv"):void 0,d=h?r.getAttribute("normal"):void 0,p=r.drawRange;Us.mesh=this,Us.raycaster=A,Us.intersects=t,Us.rayOriginLocal=e,Us.rayDirectionLocal=i,Us.matrixWorld=s??this.matrixWorld,Us.instanceId=n,Us.posView=a.view,Us.posStride=a.stride,Us.posOffset=Ts(a),Us.side=this.material?.side??"front",Us.needUV=c,Us.needNormal=h,Us.needBarycoord=u,Us.uvAttr=g,Us.normalAttr=d,Us.uvOffset=g?Ts(g):0,Us.normalOffset=d?Ts(d):0,Us.closestOnly=o,Us.maxDist=o&&t.length>0?t[0].distance:A.far;const f=Math.max(0,p.start),m=r.index;if(o){const s=null!==m;let n,r;if(null!==m)n=Math.min(m.count,p.start+p.count),r=n>f?Math.ceil((n-f)/3):0;else{const A=Math.min(a.count,p.start+p.count),t=Math.min(A,a.count-2),e=t>f?Math.ceil((t-f)/3):0;n=f+3*e,r=e}const o=A.ray.origin,l=function(A){const t=qi?1024:16384;if(A.triCount<t)return!1;if((A.end-A.start)%3!=0)return!1;const e=function(){if(Xi)return null;if(qi)return qi;try{const A=function(A){const t=globalThis;if("function"==typeof t.atob){const e=t.atob(A),i=new Uint8Array(e.length);for(let A=0;A<e.length;A++)i[A]=e.charCodeAt(A);return i}return new Uint8Array(t.Buffer.from(A,"base64"))}("AGFzbQEAAAABVgpgA39/fwF/YAJ/fwF/YAJ/fwBgAAF/YAN/f38AYAF/AGAEf39/fwF/YBF/fHx8fHx8fHx8fHx8fHx8fwBgAX8Bf2AQfHx8fHx8fHx8fHx/f39/fwF/AykoBAUHAAgDAwMDAwMDAQkEAgICBAEGAQYEAgIFAQICBAIAAQABAgICAgQFAXABEhIFAwEAEQYJAX8BQYCAwAALB2kKBm1lbW9yeQIABmhpdF9pYQAFBmhpdF9pYgAGBmhpdF9pYwAHB2hpdF90cmkACAdpZHhfcHRyAAkHbWF0X3B0cgAKB3Bvc19wdHIACwdwcmVwYXJlAAwPcmF5Y2FzdF9jbG9zZXN0AA0JFwEAQQELERUTGiAhIiMkJSYaGxwdGBkfDAECCqN7KO8BAQR/IwBBEGsiBCQAIARBBGohAyA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AQACoAAACxBAAACQAAAGFzc2VydGlvbiBmYWlsZWQ6IHBzaXplIDw9IHNpemUgKyBtYXhfb3ZlcmhlYWQAAOYAEAAqAAAAtwQAAA0AAAByd2xvY2sgb3ZlcmZsb3dlZCByZWFkIGxvY2tzNwAQAF0AAAAVAAAALAAAAAAAAAAIAAAABAAAABAAAAADAAAADAAAAAQAAAARAAAAcndsb2NrIGhhcyBub3QgYmVlbiBsb2NrZWQgZm9yIHJlYWRpbmcAADcAEABdAAAAPgAAAAkAQdSHwAALBP////8="),t=new WebAssembly.Instance(new WebAssembly.Module(A.buffer),{});return qi=t.exports,qi}catch{return Xi=!0,qi=null,null}}();if(!e)return!1;if(!(A.matrix.length>=16))return!1;const i=0|A.position.count,s=A.indexed&&A.index?0|A.index.count:0;if(!function(A,t,e,i){const s=ts;return!!s&&s.posView===A.view&&s.vertCount===e&&s.posStride===A.stride&&s.posOffset===es(A)&&(null==t?null===s.indexView&&s.indexCount===i:s.indexView===t.view&&s.indexCount===i&&s.indexStride===t.stride&&s.indexOffset===es(t))}(A.position,A.index,i,s)&&!function(A,t,e,i,s){if(i<=0||i>5e6||s>15e6)return!1;if(0===A.prepare(i,s))return!1;const n=A.memory.buffer,r=new Float32Array(n,A.pos_ptr(),3*i),a=t.view,o=t.stride,l=es(t);if(3===o&&0===l&&a instanceof Float32Array)r.set(a.subarray(0,3*i));else for(let c=0;c<i;c++){const A=l+c*o,t=3*c;r[t]=a[A],r[t+1]=a[A+1],r[t+2]=a[A+2]}if(s>0&&e){const t=new Uint32Array(n,A.idx_ptr(),s),i=e.view,r=e.stride,a=es(e);if(1===r&&0===a&&i instanceof Uint32Array)t.set(i.subarray(0,s));else for(let A=0;A<s;A++)t[A]=i[a+A*r]}return ts={posView:a,indexView:e?e.view:null,vertCount:i,indexCount:s,posStride:o,posOffset:l,indexStride:e?e.stride:0,indexOffset:e?es(e):0},!0}(e,A.position,A.indexed?A.index:null,i,s))return!1;let n=Zi;null!==n&&n.buffer===e.memory.buffer||(n=Zi=new Float32Array(e.memory.buffer,e.mat_ptr(),16));const r=A.matrix;for(let l=0;l<16;l++)n[l]=r[l];const a="back"===A.side?1:"front"===A.side?0:2,o=e.raycast_closest(A.ox,A.oy,A.oz,A.dx,A.dy,A.dz,A.wx,A.wy,A.wz,A.near,A.maxDist,a,A.hasClosest?1:0,A.start>>>0,A.end>>>0,A.indexed?1:0);return 0===_i&&(ts=null),0===o?null:{ia:e.hit_ia()>>>0,ib:e.hit_ib()>>>0,ic:e.hit_ic()>>>0,tri:e.hit_tri()>>>0}}({position:a,index:m,start:f,end:n,indexed:s,ox:e.x,oy:e.y,oz:e.z,dx:i.x,dy:i.y,dz:i.z,wx:o.x,wy:o.y,wz:o.z,matrix:Us.matrixWorld.data,near:A.near,maxDist:Us.maxDist,hasClosest:t.length>0,side:Us.side,triCount:r});if(!1!==l&&(!l||Ps(l.ia,l.ib,l.ic,l.tri)))return}if(null!==m){const A=Math.min(m.count,p.start+p.count),t=m.view,e=m.stride,i=Ts(m);for(let s=f;s<A;s+=3)if(Ps(t[i+s*e],t[i+(s+1)*e],t[i+(s+2)*e],s/3|0)&&l)return;return}const C=Math.min(a.count,p.start+p.count),w=Math.min(C,a.count-2);for(let y=f;y<w;y+=3)if(Ps(y,y+1,y+2,y/3|0)&&l)return}getWorldBoundingSphere(){const A=this.geometry,t=A.boundingBox??A.computeBoundingBox();if(!t)return null;this.updateWorldMatrix(!0,!1);const e=t.center,i=this.matrixWorld.getMaxScaleOnAxis()*e.w,s=new y(e.x,e.y,e.z);return s.applyMatrix4(this.matrixWorld),{center:s,radius:i}}dispose(){const A=this.weakSelf;this.#RA?.depObjects.delete(A),this.#LA?.depObjects.delete(A),this._vertexStreams?.depObjects.delete(A),super.dispose()}copy(A,t=!0){return super.copy(A,t),this.geometry=A.geometry,this.material=A.material,this.castShadow=A.castShadow,this.vertexStreams=A.vertexStreams?A.vertexStreams.clone():null,this.morphTargetDictionary=A.morphTargetDictionary?{...A.morphTargetDictionary}:void 0,A.morphTargetInfluences?this.setMorphInfluences(A.morphTargetInfluences):this.morphTargetInfluences=void 0,this.skeleton=A.skeleton,this}}function Fs(A){if(!A)return!1;for(let t=0,e=A.length;t<e;t++)if(0!==A[t])return!0;return!1}function ks(A){return Fs(A.morphTargetInfluences)}const Rs=new wt("GeometryMeta",[{name:"vbOffset0",format:"u32"},{name:"vbOffset1",format:"u32"},{name:"vbOffset2",format:"u32"},{name:"vbOffset3",format:"u32"},{name:"vbSize0",format:"u32"},{name:"vbSize1",format:"u32"},{name:"vbSize2",format:"u32"},{name:"vbSize3",format:"u32"},{name:"ibOffset",format:"u32"},{name:"ibSize",format:"u32"},{name:"vertexCount",format:"u32"},{name:"indexCount",format:"u32"},{name:"firstIndex",format:"u32"},{name:"baseVertex",format:"u32"},{name:"indexFormat",format:"u32"},{name:"flags",format:"u32"},{name:"layoutId",format:"u32"},{name:"slotCount",format:"u32"}],{useStandardLayout:!0});Rs.computeLayout();var Ls=(A=>(A[A.VbOffset0=0]="VbOffset0",A[A.VbOffset1=1]="VbOffset1",A[A.VbOffset2=2]="VbOffset2",A[A.VbOffset3=3]="VbOffset3",A[A.VbSize0=4]="VbSize0",A[A.VbSize1=5]="VbSize1",A[A.VbSize2=6]="VbSize2",A[A.VbSize3=7]="VbSize3",A[A.IbOffset=8]="IbOffset",A[A.IbSize=9]="IbSize",A[A.VertexCount=10]="VertexCount",A[A.IndexCount=11]="IndexCount",A[A.FirstIndex=12]="FirstIndex",A[A.BaseVertex=13]="BaseVertex",A[A.IndexFormat=14]="IndexFormat",A[A.Flags=15]="Flags",A[A.LayoutId=16]="LayoutId",A[A.SlotCount=17]="SlotCount",A))(Ls||{});const js=Rs.typeInfo.bytes,zs=js>>2;var Gs=(A=>(A[A.ALIVE=1]="ALIVE",A))(Gs||{}),Ys=(A=>(A[A.Uint16=0]="Uint16",A[A.Uint32=1]="Uint32",A))(Ys||{});const Hs=j.STORAGE|j.COPY_DST|j.COPY_SRC,Ks=z.VERTEX;class Vs extends yt{device;binding;dirtyIds;dirtyCount=0;isTransferDirty=!1;get cpuView(){return this.u32}get gpuBuffer(){return this.binding.dataView.buffer}constructor(A=1024){super(A,Rs,{isStandardLayout:!0,count:A,enableFreeList:!1,isAutoGrow:!0,fitFactor:.3}),this.binding=new Zt("geometryMeta",this,{visibility:Ks,access:"ReadOnly",isArray:!0,isDynamicArray:!0,usage:Hs,count:A,fixedSlot:6}),this.binding.setCount(A,!0),this.dirtyIds=new Uint32Array(A)}resizeTo(A){A!==this.count&&(this.resize(A*js),this.count=A,this.isTransferDirty=!0,this.binding.dataView.view=this,this.dirtyIds.length<A&&(this.dirtyIds=new Uint32Array(A)))}writeDirty(A){if(A<0||A>=this.count)return;let t=this.dirtyIds;if(this.dirtyCount>=t.length){const A=Math.max(t.length<<1,this.dirtyCount+1);this.dirtyIds=t=new Uint32Array(t.buffer.transfer(4*A))}t[this.dirtyCount++]=A}write(A,t){A<0||(this.ensureCapacity(A+1),this.u32.set(t,A*zs),this.writeDirty(A))}read(A){if(A<0||A>=this.count)return;const t=A*zs,e=this.u32,i=e[t+17]>>>0,s=new Array(i),n=new Array(i);for(let r=0;r<i;r++)s[r]=e[t+0+r],n[r]=e[t+4+r];return{vbOffsets:s,vbSizes:n,slotCount:i,ibOffset:e[t+8],ibSize:e[t+9],vertexCount:e[t+10],indexCount:e[t+11],firstIndex:e[t+12],baseVertex:e[t+13],indexFormat:e[t+14],flags:e[t+15],layoutId:e[t+16]}}clear(A){A<0||A>=this.count||(this.u32[A*zs+15]=0,this.writeDirty(A))}update(A){const t=this.device;null!=t&&t!==A&&this.releaseGPU(t),this.device=A;const e=this.binding;let i=e.dataView.buffer,s=e.count,n=!1;return(!i||this.isTransferDirty||this.count>s)&&(n=!0,s=Math.max(this.count,1),e.setCount(s,!0),e.dataView.view=this,i=e.createGPUBuffer(A),this.isTransferDirty=!1),this.flushDirty(n,A,i,s),n}flushDirty(A,t,e,i){const s=this.u32;A?t.queue.writeBuffer(e,0,s,0,i*zs):ne(t.queue,e,s,this.dirtyIds,this.dirtyCount,zs),this.dirtyCount=0}releaseGPU(A){if(null!=A&&null!=this.device&&this.device!==A)return;const t=this.binding.dataView,e=t.buffer;e&&(It.release(this.device,e),t.buffer=null,t.ownsBuffer=!1),this.device=void 0}dispose(){this.releaseGPU(),this.binding.dispose?.()}}const Js=1024;class Ws{device;initialCapacity;maxCapacity;usage;alignMask;growFactor;releaseDelayFrames;label;active=null;capacity=0;usedBytes=0;freeData=new Uint32Array(16);freeCount=0;freeCapacity=8;slotCapacity=Js;slotData=new Uint32Array(4096);slotFlags=new Uint8Array(Js);freeSlotIds=new Int32Array(Js);freeSlotCount=0;nextSlotId=1;liveCount=0;pendingFrees=[];pendingDestroys=[];alignWord=new Uint8Array(4);alignScratch=new Uint8Array(64);destroyed=!1;onFlipped=null;constructor(A,t){const e=0|t.align;if(e<=0||e&e-1)throw new Error("GrowableLayoutBuffer: align must be power of 2");const i=0|t.initialCapacity,s=0|t.maxCapacity;if(i<65536||i%e!==0)throw new Error("GrowableLayoutBuffer: invalid initialCapacity");if(s<i||s%e!==0)throw new Error("GrowableLayoutBuffer: invalid maxCapacity");this.device=A,this.initialCapacity=i,this.maxCapacity=s,this.usage=t.usage,this.alignMask=e-1,this.growFactor=t.growFactor??2,this.releaseDelayFrames=Math.max(0,t.releaseDelayFrames??3),this.label=t.label??"GrowableLayout"}get activeBuffer(){if(!this.active)throw new Error("GrowableLayoutBuffer: no active buffer");return this.active}alloc(A,t){if(this.destroyed||A<=0)return!1;const e=A+this.alignMask&~this.alignMask;return this.ensureActive(),!!this.takeFromFreelist(e,t)||!!this.repackToCapacity(e)&&this.takeFromFreelist(e,t)}free(A,t){!this.destroyed&&this.isLive(A,t)&&(this.releaseDelayFrames<=0?this.retire(A,t):this.pendingFrees.push({id:A,generation:t,framesLeft:this.releaseDelayFrames}))}beginFrame(){this.destroyed||(this.tickPendingFrees(),this.tickPendingDestroys(),this.maybeCompact())}update(A,t,e,i=0,s=0,n=-1){this.assertLive(A,t);const r=4*A,a=this.slotData[r+2],o=n<0?e.byteLength-s:n;if(s<0||o<0||s+o>e.byteLength)throw new Error("GrowableLayoutBuffer.update: source out of range");if(i<0||i+o>a)throw new Error("GrowableLayoutBuffer.update: out of range");if(0===o)return;const l=this.slotData[r+1]+i,c=e.byteOffset+s;3&l||3&c||3&o?this.writeAligned(l,e,c,o,this.slotData[r+1],a):this.device.queue.writeBuffer(this.active,l,e.buffer,c,o)}writeAligned(A,t,e,i,s,n){const r=s+n,a=t.byteOffset,o=new Uint8Array(t.buffer,a,t.byteLength),l=this.device.queue,c=this.active;let h=A,u=e,g=i;if(3&h){const A=-4&h,t=h-A;if(A<s||A+4>r)throw new Error("GrowableLayoutBuffer.update: alignment exceeds slot");const e=u-t;if(e<a)throw new Error("GrowableLayoutBuffer.update: alignment exceeds source");this.fillAlignWord(o,e-a),l.writeBuffer(c,A,this.alignWord.buffer,this.alignWord.byteOffset,4);const i=Math.min(g,4-t);h+=i,u+=i,g-=i}if(3&u&&g>0){const A=g+3&-4;if(3&h||h+A>r)throw new Error("GrowableLayoutBuffer.update: alignment exceeds slot");const t=u-a,e=Math.max(0,Math.min(A,o.length-t)),i=this.scratchBytes(A);return e>0&&i.set(o.subarray(t,t+e),0),e<A&&i.fill(0,e,A),void l.writeBuffer(c,h,i.buffer,i.byteOffset,A)}const d=-4&g;if(d>0&&(l.writeBuffer(c,h,t.buffer,u,d),h+=d,u+=d,g-=d),g>0){if(3&h||h+4>r)throw new Error("GrowableLayoutBuffer.update: alignment exceeds slot");this.fillAlignWord(o,u-a),l.writeBuffer(c,h,this.alignWord.buffer,this.alignWord.byteOffset,4)}}scratchBytes(A){let t=this.alignScratch;return t.byteLength<A&&(t=new Uint8Array(Math.max(A,t.byteLength<<1)),this.alignScratch=t),t}fillAlignWord(A,t){const e=this.alignWord,i=A.length;e[0]=t<i?A[t]:0,e[1]=t+1<i?A[t+1]:0,e[2]=t+2<i?A[t+2]:0,e[3]=t+3<i?A[t+3]:0}bind(A,t,e){this.assertLive(A,t);const i=4*A;e.buffer=this.active,e.offset=this.slotData[i+1],e.size=this.slotData[i+2]}writeStats(A){let t=0;const e=this.freeData;for(let i=0,s=this.freeCount;i<s;i++)t+=e[2*i+1];A.capacity=this.capacity,A.usedBytes=this.usedBytes,A.freeBytes=t,A.liveAllocations=this.liveCount,A.totalGpuBytes=this.capacity}destroy(){if(!this.destroyed){this.destroyed=!0,this.pendingFrees.length=0;for(const A of this.pendingDestroys)A.buffer.destroy();this.pendingDestroys.length=0,this.active?.destroy(),this.active=null,this.slotFlags.fill(0),this.freeSlotCount=0,this.freeCount=0,this.liveCount=0,this.usedBytes=0,this.onFlipped=null}}ensureActive(){this.active||(this.active=this.device.createBuffer({size:this.initialCapacity,usage:this.usage,label:this.label}),this.capacity=this.initialCapacity,this.freeData[0]=0,this.freeData[1]=this.capacity,this.freeCount=1)}liveByteSize(){const A=this.slotFlags,t=this.slotData;let e=0;for(let i=1,s=this.nextSlotId;i<s;i++)1&A[i]&&(e+=t[4*i+2]);return e}repackToCapacity(A){const t=this.liveByteSize();t!==this.usedBytes&&(this.usedBytes=t);let e,i=Math.max(t+A,Math.ceil(Math.max(t,1)*this.growFactor),this.initialCapacity);if(i=i+this.alignMask&~this.alignMask,i>this.maxCapacity&&(i=this.maxCapacity,t+A>i))return!1;if(0===A&&i>=this.capacity)return!1;try{e=this.device.createBuffer({size:i,usage:this.usage,label:this.label})}catch{return!1}const s=this.device,n=s.createCommandEncoder({label:`${this.label}-repack`}),r=this.slotData,a=this.slotFlags,o=this.active;let l=0;for(let c=1,h=this.nextSlotId;c<h;c++){if(!(1&a[c]))continue;const A=4*c,t=r[A+1],i=r[A+2];i>0&&n.copyBufferToBuffer(o,t,e,l,i),r[A+1]=l,l+=i}return s.queue.submit([n.finish()]),this.pendingDestroys.push({buffer:o,framesLeft:Math.max(1,this.releaseDelayFrames)}),this.active=e,this.capacity=i,this.usedBytes=l,this.freeData[0]=l,this.freeData[1]=i-l,this.freeCount=i>l?1:0,this.onFlipped?.(),!0}maybeCompact(){!this.active||this.capacity<=this.initialCapacity||this.usedBytes/this.capacity>=.3||this.repackToCapacity(0)}takeFromFreelist(A,t){const e=this.freeData,i=this.freeCount,s=this.capacity;for(let n=0;n<i;n++){const r=2*n,a=e[r+1];if(a<A)continue;const o=e[r+0];if(o+A>s)continue;a===A?(e.copyWithin(r,r+2,2*i),this.freeCount=i-1):(e[r+0]=o+A,e[r+1]=a-A);const l=this.allocSlotId(),c=this.slotData,h=this.slotFlags,u=4*l;let g=c[u+3]+1>>>0;return 0===g&&(g=1),c[u+1]=o,c[u+2]=A,c[u+3]=g,h[l]=1,this.liveCount++,this.usedBytes+=A,t.id=l,t.generation=g,t.buffer=this.active,t.offset=o,t.size=A,!0}return!1}returnBlock(A,t){this.freeCount===this.freeCapacity&&this.growFreeList();let e=this.freeData,i=this.freeCount,s=0;for(;s<i&&e[2*s+0]<A;)s++;const n=2*s;if(e.copyWithin(n+2,n,2*i),e[n+0]=A,e[n+1]=t,i=++this.freeCount,s+1<i){const A=2*s,t=2*(s+1);e[A+0]+e[A+1]===e[t+0]&&(e[A+1]+=e[t+1],e.copyWithin(t,t+2,2*i),i=--this.freeCount)}if(s>0){e=this.freeData,i=this.freeCount;const A=2*(s-1),t=2*s;e[A+0]+e[A+1]===e[t+0]&&(e[A+1]+=e[t+1],e.copyWithin(t,t+2,2*i),this.freeCount=i-1)}}retire(A,t){if(!this.isLive(A,t))return;const e=4*A,i=this.slotData[e+1],s=this.slotData[e+2];this.slotFlags[A]=0,this.liveCount--,this.freeSlotIds[this.freeSlotCount++]=A,this.usedBytes=Math.max(0,this.usedBytes-s),this.returnBlock(i,s)}tickPendingFrees(){const A=this.pendingFrees;let t=0;for(let e=0;e<A.length;e++){const i=A[e];--i.framesLeft>0?A[t++]=i:this.retire(i.id,i.generation)}A.length=t}tickPendingDestroys(){const A=this.pendingDestroys;let t=0;for(let e=0,i=A.length;e<i;e++){const i=A[e];--i.framesLeft>0?A[t++]=i:i.buffer.destroy()}A.length=t}isLive(A,t){return!this.destroyed&&A>0&&A<this.slotCapacity&&this.slotData[4*A+3]===t&&!!(1&this.slotFlags[A])}assertLive(A,t){if(!this.isLive(A,t))throw new Error("GrowableLayoutBuffer: invalid handle")}allocSlotId(){if(this.freeSlotCount>0)return this.freeSlotIds[--this.freeSlotCount];const A=this.nextSlotId;return A>=this.slotCapacity&&this.growSlots(),this.nextSlotId=A+1,A}growSlots(){const A=this.slotCapacity<<1;this.slotData=new Uint32Array(this.slotData.buffer.transfer(4*A*4)),this.slotFlags=new Uint8Array(this.slotFlags.buffer.transfer(A)),this.freeSlotIds=new Int32Array(this.freeSlotIds.buffer.transfer(4*A)),this.slotCapacity=A}growFreeList(){const A=this.freeCapacity<<1;this.freeData=new Uint32Array(this.freeData.buffer.transfer(2*A*4)),this.freeCapacity=A}}function qs(A,t){const e=A.limits?.maxBufferSize;return"number"==typeof e&&e>0?e:t}class Xs extends Ws{constructor(A,t=33554432,e){const i=e??Math.min(268435456,qs(A,268435456));super(A,{initialCapacity:t,maxCapacity:Math.max(t,i),usage:j.VERTEX|j.STORAGE|j.COPY_DST|j.COPY_SRC,align:4,label:"VBGrowable"})}}class Zs extends Ws{constructor(A,t=8388608,e){const i=e??Math.min(268435456,qs(A,268435456));super(A,{initialCapacity:t,maxCapacity:Math.max(t,i),usage:j.INDEX|j.STORAGE|j.COPY_DST|j.COPY_SRC,align:4,label:"IBGrowable"})}}function _s(A,t,e,i,s,n){const r=e.dataView.view,a=e.stride,o=e.typeInfo.offset,l=i.dataView.view,c=i.stride,h=i.typeInfo.offset;let u=4*t;for(let g=0;g<s;g++,u+=4){const t=o+g*a;let e=r[t],i=r[t+1],s=r[t+2];if(!n){const A=h+g*c;e-=l[A],i-=l[A+1],s-=l[A+2]}A[u]=e,A[u+1]=i,A[u+2]=s}}function $s(A){return A.isStructBufferAttribute?A.data:A}function An(A){const t=0|A.dataView.size,e=(0|A.capacity)*(0|A.typeInfo.byteStride)|0;return Math.max(t,e,16)}function tn(A){return ze(A.getCacheKey())}class en{geometryMeta;pools=new Map;byId=new Map;residencies=new Map;dirtyQueue=[];scratch={id:0,generation:0,buffer:null,offset:0,size:0};bindScratch={buffer:null,offset:0,size:0};relocFlag=new Set;rangeLo=[];rangeHi=[];singleAttrScratch=[];vbStatsScratch={capacity:0,usedBytes:0,freeBytes:0,liveAllocations:0,totalGpuBytes:0};ibStatsScratch={capacity:0,usedBytes:0,freeBytes:0,liveAllocations:0,totalGpuBytes:0};device;drawVersion=1;drawDirtySlotsWrite=[];drawDirtySlotsRead=[];drawDirtyFlag=new Set;constructor(A,t){this.device=A,this.geometryMeta=t}peekDrawDirtySlots(){return this.drawDirtySlotsWrite}consumeDrawDirtySlots(){this.drawDirtyFlag.clear();const A=this.drawDirtySlotsWrite;return this.drawDirtySlotsWrite=this.drawDirtySlotsRead,this.drawDirtySlotsRead=A,this.drawDirtySlotsWrite.length=0,A}#zA(A){A<0||this.drawDirtyFlag.has(A)||(this.drawDirtyFlag.add(A),this.drawDirtySlotsWrite.push(A))}beginFrame(){for(const A of this.pools.values())A.vb.beginFrame(),A.ib.beginFrame()}writeStats(A){A.layoutCount=this.pools.size,A.geometryCount=this.byId.size,A.residencyCount=this.residencies.size,A.capacityBytes=0,A.usedBytes=0,A.freeBytes=0,A.liveAllocations=0,A.totalGpuBytes=0;const t=this.vbStatsScratch,e=this.ibStatsScratch;for(const i of this.pools.values())i.vb.writeStats(t),i.ib.writeStats(e),A.capacityBytes+=t.capacity+e.capacity,A.usedBytes+=t.usedBytes+e.usedBytes,A.freeBytes+=t.freeBytes+e.freeBytes,A.liveAllocations+=t.liveAllocations+e.liveAllocations,A.totalGpuBytes+=t.totalGpuBytes+e.totalGpuBytes}getLayoutPools(A){return this.pools.get(A)??null}getVertexBinds(A,t){const e=this.byId.get(A.id);if(!e)return 0;const i=e.slots,s=i.length,n=this.bindScratch;for(let r=0;r<s;r++){const A=i[r],e=A.residency;e.pool.bind(e.id,e.generation,n);let s=t[r];s||(s={buffer:n.buffer,offset:0,size:0},t[r]=s),s.buffer=n.buffer,s.offset=n.offset+A.bindByteOffset>>>0,s.size=Math.max(0,n.size-A.bindByteOffset)>>>0}return s}getMorphAtlas(A){const t=this.byId.get(A.id);return t?.morphAtlas&&t.morphAtlasView?{view:t.morphAtlasView,texture:t.morphAtlas}:null}getGroup3BindGroup(A,t,e,i,s){if(0===(t&_t.Morph))throw new Error("getGroup3BindGroup: morph(+skin) only; skin-only uses BonePaletteStore.getBindGroup");const n=this.byId.get(A.id);if(!n?.morphAtlas||!n.morphAtlasView)return null;if(0===(t&_t.Skin)){if(n.morphBindGroup&&n.morphBindGroupAtlas===n.morphAtlas&&n.morphBindGroupHeap===i.morphHeap)return n.morphBindGroup;const A=s.createGroup3BindGroup(t,e,{morphAtlas:n.morphAtlasView,morphHeap:i.morphHeap});return n.morphBindGroup=A,n.morphBindGroupAtlas=n.morphAtlas,n.morphBindGroupHeap=i.morphHeap??null,A}if(n.morphSkinBindGroup&&n.morphSkinBindGroupAtlas===n.morphAtlas&&n.morphSkinBindGroupHeap===i.morphHeap&&n.morphSkinBindGroupPalette===i.paletteTex&&n.morphSkinBindGroupSkin===i.skinActive)return n.morphSkinBindGroup;const r=s.createGroup3BindGroup(t,e,{morphAtlas:n.morphAtlasView,morphHeap:i.morphHeap,bonePalette:i.bonePalette,skinActive:i.skinActive});return n.morphSkinBindGroup=r,n.morphSkinBindGroupAtlas=n.morphAtlas,n.morphSkinBindGroupHeap=i.morphHeap??null,n.morphSkinBindGroupPalette=i.paletteTex??null,n.morphSkinBindGroupSkin=i.skinActive??null,r}invalidateMorphBindGroups(){for(const A of this.byId.values())(A.morphAtlas||A.morphBindGroup||A.morphSkinBindGroup)&&(A.morphBindGroup=null,A.morphBindGroupAtlas=null,A.morphBindGroupHeap=null,A.morphSkinBindGroup=null,A.morphSkinBindGroupAtlas=null,A.morphSkinBindGroupHeap=null,A.morphSkinBindGroupPalette=null,A.morphSkinBindGroupSkin=null)}invalidateMorphSkinBindGroups(){for(const A of this.byId.values())A.morphSkinBindGroup&&(A.morphSkinBindGroup=null,A.morphSkinBindGroupAtlas=null,A.morphSkinBindGroupHeap=null,A.morphSkinBindGroupPalette=null,A.morphSkinBindGroupSkin=null)}invalidateMegaBindGroups(){for(const A of this.pools.values())A.megaBindGroup=null,A.megaBindGroupVb=null,A.megaBindGroupIb=null,A.megaBindGroupMeta=null}hasGeometry(A){return this.byId.has(A)}ensure(A){let t=this.byId.get(A.id);const e=A.version;if(t&&t.structureVersion===e)return void t.refCount++;const i=t?t.refCount:0;t&&this.#GA(A.id,t),t=this.#YA(A,e),t.refCount=i+1,this.byId.set(A.id,t),this.#HA(t,!0);const s=A.boundIndex;this.#zA(s),s>=0&&this.drawVersion++,A.dirtyTypes&=-424961}release(A){const t=this.byId.get(A.id);if(!t)return;if(--t.refCount>0)return;const e=A.boundIndex;this.geometryMeta.clear(e),this.#GA(A.id,t),this.byId.delete(A.id),this.#zA(e),e>=0&&this.drawVersion++}uploadDirtyGeometries(A){this.#KA(A);const t=this.relocFlag,e=this.dirtyQueue,i=this.byId;t.clear();for(let n=0,r=e.length;n<r;n++){const A=e[n],i=A.frameAttrs;if(A.dirtyQueued=!1,A.refCount<=0)i.length=0;else if(this.#VA(A)){if(this.#JA(A)){const e=A.geoIds;for(let A=0,i=e.length;A<i;A++)t.add(e[A])}this.#WA(A)}else i.length=0}e.length=0;let s=!1;for(let n=0,r=A.length;n<r;n++){const e=A[n],r=i.get(e.id);if(r){const A=t.delete(e.id);this.#HA(r,A)&&(this.#zA(r.geometry.boundIndex),s=!0),(r.morphAtlas||e.morphAttributes.size>0)&&this.#qA(r)}-1===e._dirtySlot&&(e.dirtyTypes&=-424961)}for(const n of t){const A=i.get(n);A&&this.#HA(A,!0)&&(this.#zA(A.geometry.boundIndex),s=!0)}t.clear(),s&&this.drawVersion++}dispose(){const A=this.pools,t=this.byId,e=this.geometryMeta;for(const i of[...t.keys()]){const A=t.get(i);A.refCount=1,e.clear(A.geometry.boundIndex),this.#GA(i,A),t.delete(i)}this.residencies.clear(),this.dirtyQueue.length=0;for(const i of A.values())i.vb.destroy(),i.ib.destroy();A.clear()}#KA(A){const t=this.byId;for(let e=0,i=A.length;e<i;e++){const i=A[e],s=t.get(i.id);s&&("stream"===i.role||i.boundingBox||i.computeBoundingBox(),this.#XA(s))}}#XA(A){const t=A.geometry,e=this.residencies,i=this.dirtyQueue;for(const[,n]of t.attributes)n.isDirty&&(n.skipGpu?(n.isDirty=!1,n.updateRanges.length=0):this.#ZA(e.get($s(n)),n,i));const s=t.index;s&&s.isDirty&&this.#ZA(e.get($s(s)),s,i)}#ZA(A,t,e){let i=A??null;for(;i;)i.refCount>0&&(i.frameAttrs.indexOf(t)<0&&i.frameAttrs.push(t),i.dirtyQueued||(i.dirtyQueued=!0,e.push(i))),i=i.next}#VA(A){if(A.canonical.isDirty)return!0;const t=A.frameAttrs;for(let e=0,i=t.length;e<i;e++)if(t[e].isDirty)return!0;return!1}#_A(A){let t=this.pools.get(A);if(t)return t;const e=new Xs(this.device),i=new Zs(this.device),s=()=>{this.#$A(A)};return e.onFlipped=s,i.onFlipped=s,t={vb:e,ib:i,bindingVersion:0,megaBindGroup:null,megaBindGroupVb:null,megaBindGroupIb:null,megaBindGroupMeta:null},this.pools.set(A,t),t}#$A(A){let t=!1;for(const i of this.byId.values())i.layoutId===A&&this.#HA(i,!0)&&(this.#zA(i.geometry.boundIndex),t=!0);const e=this.pools.get(A);e&&(e.megaBindGroup=null,e.megaBindGroupVb=null,e.megaBindGroupIb=null,e.megaBindGroupMeta=null,e.bindingVersion++),t&&this.drawVersion++}#WA(A){const t=A.frameAttrs,e=A.canonical;for(let i=0,s=t.length;i<s;i++){const A=t[i];A.isDirty=!1,A.updateRanges.length=0}t.length=0,e.isDirty=!1,e.updateRanges.length=0}#HA(A,t){const e=A.geometry.boundIndex;if(e<0){if(t){const t=this.bindScratch,e=A.slots;for(let A=0,s=e.length;A<s;A++){const i=e[A].residency;i.pool.bind(i.id,i.generation,t),i.offset=t.offset,i.capacity=t.size}const i=A.indexResidency;i&&(i.pool.bind(i.id,i.generation,t),i.offset=t.offset,i.capacity=t.size)}return!1}const i=this.geometryMeta;i.ensureCapacity(e+1);const s=e*zs,n=i.u32,r=this.bindScratch,a=A.slots,o=a.length;let l=0,c=0,h=0,u=0,g=0,d=0,p=0,f=0;for(let U=0;U<o;U++){const A=a[U],t=A.residency;if(t.pool.bind(t.id,t.generation,r),t.offset=r.offset,t.capacity=r.size,U>=4)continue;const e=t.offset+A.bindByteOffset>>>0,i=Math.max(0,t.capacity-A.bindByteOffset)>>>0;0===U?(l=e,g=i):1===U?(c=e,d=i):2===U?(h=e,p=i):(u=e,f=i)}let m=0,C=0,w=0,y=Ys.Uint32;if(A.indexAttr&&A.indexResidency){const t=A.indexResidency;t.pool.bind(t.id,t.generation,r),t.offset=r.offset,t.capacity=r.size,m=t.offset>>>0,C=t.logicalSize>>>0,w=A.indexAttr.count,y=A.indexAttr.dataView.view instanceof Uint16Array?Ys.Uint16:Ys.Uint32}const B=A.positionAttr?.count??(o>0?a[0].residency.canonical.count:0);let I=B>>>0,Q=w>>>0,E=0;const x=A.geometry.drawRange;if(0!==x.start||Number.isFinite(x.count))if(E=0|x.start,E<0&&(E=0),w>0){E>w&&(E=w);const A=w-E,t=Number.isFinite(x.count)?0|x.count:A;Q=(t<0?0:t>A?A:t)>>>0}else{E>B&&(E=B);const A=B-E,t=Number.isFinite(x.count)?0|x.count:A;I=(t<0?0:t>A?A:t)>>>0,Q=0}const D=Gs.ALIVE,M=A.layoutId>>>0,b=Math.min(o,4)>>>0,S=n[s+Ls.SlotCount]!==b||n[s+Ls.VbOffset0]!==l||n[s+Ls.VbOffset1]!==c||n[s+Ls.VbOffset2]!==h||n[s+Ls.VbOffset3]!==u||n[s+Ls.VbSize0]!==g||n[s+Ls.VbSize1]!==d||n[s+Ls.VbSize2]!==p||n[s+Ls.VbSize3]!==f||n[s+Ls.IbOffset]!==m||n[s+Ls.IbSize]!==C||n[s+Ls.IndexFormat]!==y,v=n[s+Ls.VertexCount]!==I||n[s+Ls.IndexCount]!==Q||n[s+Ls.FirstIndex]!==E||0!==n[s+Ls.BaseVertex]||n[s+Ls.Flags]!==D,T=n[s+Ls.LayoutId]!==M;if(!S&&!v&&!T)return!1;if(n[s+Ls.VbOffset0]=l,n[s+Ls.VbOffset1]=c,n[s+Ls.VbOffset2]=h,n[s+Ls.VbOffset3]=u,n[s+Ls.VbSize0]=g,n[s+Ls.VbSize1]=d,n[s+Ls.VbSize2]=p,n[s+Ls.VbSize3]=f,n[s+Ls.IbOffset]=m,n[s+Ls.IbSize]=C,n[s+Ls.VertexCount]=I,n[s+Ls.IndexCount]=Q,n[s+Ls.FirstIndex]=E,n[s+Ls.BaseVertex]=0,n[s+Ls.IndexFormat]=y,n[s+Ls.Flags]=D,n[s+Ls.LayoutId]=M,n[s+Ls.SlotCount]=b,i.writeDirty(e),S){const t=this.pools.get(A.layoutId);t&&t.bindingVersion++}return v||S||T}#YA(A,t){const e=A.getVertexSlots(),i=this.device.limits.maxVertexBuffers;if(e.length>i)throw new Error(`GeometryTableManager: slotCount ${e.length} > maxVertexBuffers ${i}`);const s=tn(A),n=this.#_A(s),r=e.length,a=new Array(r),o=A.attributes,l=A.id;for(let d=0;d<r;d++){const A=e[d],t=o.get(A.attrName),i=this.#At(t,n.vb,l);a[d]={residency:i,bindByteOffset:A.bindByteOffset}}let c=null,h=null;const u=A.index;u&&(c=u,h=this.#At(u,n.ib,l));const g={refCount:1,structureVersion:t,layoutId:s,geometry:A,slots:a,indexResidency:h,indexAttr:c,positionAttr:o.get("position")??null,morphAtlas:null,morphAtlasView:null,morphAtlasWidth:0,morphAtlasHeight:0,morphVersion:-1,morphBindGroup:null,morphBindGroupAtlas:null,morphBindGroupHeap:null,morphSkinBindGroup:null,morphSkinBindGroupAtlas:null,morphSkinBindGroupHeap:null,morphSkinBindGroupPalette:null,morphSkinBindGroupSkin:null};for(const[,d]of o)d.skipGpu&&d.isDirty&&(d.isDirty=!1,d.updateRanges.length=0);return this.#qA(g),g}#GA(A,t){const e=t.slots;for(let i=0,s=e.length;i<s;i++)this.#tt(e[i].residency,A);t.indexResidency&&this.#tt(t.indexResidency,A),e.length=0,t.indexResidency=null,t.indexAttr=null,t.positionAttr=null,t.morphBindGroup=null,t.morphBindGroupAtlas=null,t.morphBindGroupHeap=null,t.morphSkinBindGroup=null,t.morphSkinBindGroupAtlas=null,t.morphSkinBindGroupHeap=null,t.morphSkinBindGroupPalette=null,t.morphSkinBindGroupSkin=null,t.morphAtlas?.destroy(),t.morphAtlas=null,t.morphAtlasView=null,t.morphAtlasWidth=0,t.morphAtlasHeight=0,t.morphVersion=-1}#qA(A){const t=A.geometry;if(t.morphAttributes.size<=0)return void(A.morphAtlas&&(A.morphAtlas.destroy(),A.morphAtlas=null,A.morphAtlasView=null,A.morphAtlasWidth=0,A.morphAtlasHeight=0,A.morphVersion=t.morphVersion,A.morphBindGroup=null,A.morphBindGroupAtlas=null,A.morphBindGroupHeap=null,A.morphSkinBindGroup=null,A.morphSkinBindGroupAtlas=null,A.morphSkinBindGroupHeap=null,A.morphSkinBindGroupPalette=null,A.morphSkinBindGroupSkin=null));if(A.morphAtlas&&A.morphVersion===t.morphVersion)return;const e=function(A,t){const e=A.getAttribute("position"),i=A.morphAttributes.size;if(!A.index&&0!==A.drawRange.start)throw new Error("packMorphAtlasU32: non-indexed morph requires drawRange.start === 0");const s=e?.count??0;if(!e||0===i||s<=0)throw new Error("packMorphAtlasU32: geometry has no position, morphAttributes, or vertices");const n=A.morphNormals.size>0&&A.hasAttribute("normal"),r=s*(n?2:1),a=i*r,o=32*Math.floor(t/32),l=Math.ceil(a/t),c=Math.ceil(Math.sqrt(a)),h=32*Math.ceil(Math.max(l,c)/32);if(o<32||h>o)throw new Error(`packMorphAtlasU32: ${a} texels exceed ${t}x${t} atlas limit`);const u=Math.max(1,Math.ceil(a/h)),g=new Uint32Array(h*u*2),d=new Float16Array(g.buffer),p=A.morphTargetsRelative,f=A.getAttribute("normal"),m=A.morphNormals;let C=0;for(const[w,y]of A.morphAttributes){if(y.count<s)throw new Error(`packMorphAtlasU32: morph target "${w}" count ${y.count} < position.count ${s}`);if(_s(d,C*r,y,e,s,p),n){const A=m.get(w);if(A){if(A.count<s)throw new Error(`packMorphAtlasU32: morphNormals "${w}" count ${A.count} < position.count ${s}`);_s(d,C*r+s,A,f,s,p)}}C++}return{packed:g,width:h,height:u,vertexCount:s,targetCount:i}}(t,this.device.limits.maxTextureDimension2D),i=!A.morphAtlas||A.morphAtlasWidth!==e.width||A.morphAtlasHeight!==e.height;i&&(A.morphAtlas?.destroy(),A.morphAtlas=this.device.createTexture({label:`morphAtlas[${t.id}]`,size:{width:e.width,height:e.height},format:"rgba16float",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST}),A.morphAtlasView=A.morphAtlas.createView({dimension:"2d"}),A.morphAtlasWidth=e.width,A.morphAtlasHeight=e.height),this.device.queue.writeTexture({texture:A.morphAtlas},e.packed,{bytesPerRow:8*e.width,rowsPerImage:e.height},{width:e.width,height:e.height}),A.morphVersion=t.morphVersion,i&&(A.morphBindGroup=null,A.morphBindGroupAtlas=null,A.morphBindGroupHeap=null,A.morphSkinBindGroup=null,A.morphSkinBindGroupAtlas=null,A.morphSkinBindGroupHeap=null,A.morphSkinBindGroupPalette=null,A.morphSkinBindGroupSkin=null);for(const s of t.morphAttributes.values())s.isDirty=!1,s.updateRanges.length=0;for(const s of t.morphNormals.values())s.isDirty=!1,s.updateRanges.length=0}#At(A,t,e){const i=$s(A),s=this.residencies;let n=s.get(i),r=n??null;for(;r;){if(r.pool===t)return r.refCount++,r.geoIds.indexOf(e)<0&&r.geoIds.push(e),A.isDirty&&(r.frameAttrs.indexOf(A)<0&&r.frameAttrs.push(A),r.dirtyQueued||(r.dirtyQueued=!0,this.dirtyQueue.push(r))),r;r=r.next}const a=An(A),o=this.scratch;if(!t.alloc(a,o))throw new Error("GeometryTableManager: growable alloc failed");return r={key:i,pool:t,canonical:A,id:o.id,generation:o.generation,capacity:o.size,offset:o.offset,logicalSize:0|A.dataView.size,refCount:1,dirtyQueued:!1,geoIds:[e],frameAttrs:[],next:n??null},this.#et(r),n?A.isDirty&&this.#ZA(n,A,this.dirtyQueue):(A.isDirty=!1,A.updateRanges.length=0),s.set(i,r),r}#tt(A,t){const e=A.geoIds,i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.length--),--A.refCount>0||(A.frameAttrs.length=0,A.dirtyQueued=!1,A.pool.free(A.id,A.generation),this.#it(A))}#it(A){const t=this.residencies,e=A.key;let i=t.get(e)??null;if(i===A){const i=A.next;return A.next=null,void(i?t.set(e,i):t.delete(e))}for(;i;){const t=i.next;if(t===A)return i.next=A.next,void(A.next=null);i=t}A.next=null}#JA(A){const t=A.canonical,e=0|t.dataView.size;if(A.logicalSize=e,e<=A.capacity)return this.#st(A),!1;const i=Math.max(e,A.capacity+256,An(t)),s=this.scratch;if(!A.pool.alloc(i,s))throw new Error("GeometryTableManager: growable realloc failed");return A.pool.free(A.id,A.generation),A.id=s.id,A.generation=s.generation,A.capacity=s.size,A.offset=s.offset,this.#et(A),!0}#et(A){const t=A.canonical,e=t.dataView.view,i=Math.min(0|t.dataView.size,e.byteLength);i<=0||A.pool.update(A.id,A.generation,e,0,0,i)}#st(A){const t=A.canonical.dataView.view;if(this.#nt(A))return void this.#et(A);const e=this.rangeLo,i=this.rangeHi;if(0===e.length)return void this.#et(A);this.#rt(e,i);const s=e.length;for(let n=0;n<s;n++){const s=e[n],r=i[n]-s;if(!(r<=0)){if(s+r>t.byteLength)return void this.#et(A);A.pool.update(A.id,A.generation,t,s,s,r)}}}#nt(A){const t=this.rangeLo,e=this.rangeHi;t.length=0,e.length=0;const i=A.frameAttrs;let s;if(i.length>0)s=i;else{if(!A.canonical.isDirty)return!0;{const t=this.singleAttrScratch;t[0]=A.canonical,t.length=1,s=t}}let n=!1;for(let r=0,a=s.length;r<a;r++){const A=s[r];if(!A.isDirty)continue;n=!0;const i=A.updateRanges,a=0|A.typeInfo.byteStride;if(0===i.length||a<=0)return!0;for(let s=0;s<i.length;s++){const A=i[s],n=(0|A.start)*a,r=n+(0|A.count)*a;r<=n||(t.push(n),e.push(r))}}return!n}#rt(A,t){const e=A.length;if(e<=1)return;for(let s=1;s<e;s++){const e=A[s],i=t[s];let n=s-1;for(;n>=0&&A[n]>e;)A[n+1]=A[n],t[n+1]=t[n],n--;A[n+1]=e,t[n+1]=i}let i=0;for(let s=1;s<e;s++)A[s]<=t[i]?t[s]>t[i]&&(t[i]=t[s]):(i++,A[i]=A[s],t[i]=t[s]);A.length=i+1,t.length=i+1}}function sn(A){return A<=256?0:A<=1024?1:A<=4096?2:A<=16384?3:4}class nn{batchId=-1;geometrySlot=-1;material;geometry;bucket;members=[];base=-1;segmentCapacity=0;count=0;indexed=!1;mega=!1;megaSizeBin=-1;maxIndexCount=0;encodeIndex=-1;layoutEpoch=-1;skipCull=!1}const rn=new wt("InstanceMeta",[{name:"geometrySlot",format:"u32"},{name:"materialSlot",format:"u32"},{name:"drawGroupId",format:"u32"},{name:"flags",format:"u32"}],{useStandardLayout:!0});rn.computeLayout();var an=(A=>(A[A.GeometrySlot=0]="GeometrySlot",A[A.MaterialSlot=1]="MaterialSlot",A[A.DrawGroupId=2]="DrawGroupId",A[A.Flags=3]="Flags",A))(an||{});const on=j.STORAGE|j.COPY_DST|j.COPY_SRC,ln=z.VERTEX|z.COMPUTE;var cn=(A=>(A[A.ALIVE=1]="ALIVE",A[A.VISIBLE=2]="VISIBLE",A))(cn||{});function hn(A,t){return(3&A|(1073741823&t)<<2)>>>0}function un(A){if(A<0)return 65535;if(A>65534)throw new Error("InstanceMeta: skinSid exceeds u16");return A}function gn(A=-1,t=-1){const e=t<0?65535:65535&t;return(un(A)|e<<16)>>>0}class dn extends yt{device;binding;dirtyIds;dirtyCount=0;transformMeta;get maxIndex(){return this.transformMeta.maxIndex}get gpuBuffer(){return this.binding.dataView.buffer}get cpuView(){return this.u32}constructor(A,t=16384,e){const i=e.maxCount;super(i,rn,{isStandardLayout:!0,count:i,enableFreeList:!1}),this.maxCount=i,this.device=A,this.transformMeta=e,this.binding=new Zt("instanceMeta",this,{visibility:ln,access:"ReadOnly",isArray:!0,isDynamicArray:!0,usage:on,count:i}),this.binding.setCount(Math.max(t,e.calcCapacity()),!0),this.dirtyIds=new Uint32Array(i)}growTo(A){if(A<=this.count)return;const t=this.dirtyIds,e=this.dirtyCount;super.resize(A*this.stride),this.count=A,this.maxCount=A;const i=Math.min(e,t.length),s=new Uint32Array(Math.max(A,i));i>0&&s.set(t.subarray(0,i)),this.dirtyIds=s,this.dirtyCount=i}writeDirty(A){let t=this.dirtyIds;if(this.dirtyCount>=t.length){const A=Math.max(t.length<<1,this.dirtyCount+1);this.dirtyIds=t=new Uint32Array(t.buffer.transfer(4*A))}t[this.dirtyCount++]=A}ensureCapacity(A){return!1}shrinkToFit(A=0){return!1}resizeTo(A){}write(A,t){A<0||A>=this.maxCount||(this.u32.set(t,4*A),this.writeDirty(A))}write4(A,t,e,i,s){if(A<0||A>=this.maxCount)return;const n=4*A,r=this.u32;r[n+0]=t,r[n+1]=e,r[n+2]=i,r[n+3]=s,this.writeDirty(A)}writePayload(A,t){if(A<0||A>=this.maxCount)return;const e=4*A+1,i=t>>>0;this.u32[e]!==i&&(this.u32[e]=i,this.writeDirty(A))}writeVisible(A,t){if(A<0||A>=this.maxCount)return;const e=4*A+2,i=this.u32,s=i[e];if(!(1&s))return;const n=t?2|s:-3&s;n!==s&&(i[e]=n>>>0,this.writeDirty(A))}writeClipSetId(A,t){if(A<0||A>=this.maxCount)return;const e=4*A+3,i=this.u32,s=i[e],n=(65535&s|(t<0?65535:65535&t)<<16)>>>0;n!==s&&(i[e]=n,this.writeDirty(A))}writeSkinSid(A,t){if(A<0||A>=this.maxCount)return;const e=4*A+3,i=this.u32,s=i[e],n=(4294901760&s|un(t))>>>0;n!==s&&(i[e]=n,this.writeDirty(A))}writeDrawGroupId(A,t){if(A<0||A>=this.maxCount)return;const e=4*A+2,i=this.u32,s=(3&i[e]|(1073741823&t)<<2)>>>0;i[e]!==s&&(i[e]=s,this.writeDirty(A))}writeFlags(A,t){if(A<0||A>=this.maxCount)return;const e=4*A+3,i=this.u32,s=t>>>0;i[e]!==s&&(i[e]=s,this.writeDirty(A))}writeDrawGroupAndFlags(A,t,e){if(A<0||A>=this.maxCount)return;const i=4*A,s=this.u32,n=t>>>0,r=e>>>0,a=i+2,o=i+3;s[a]===n&&s[o]===r||(s[a]=n,s[o]=r,this.writeDirty(A))}read(A){if(A<0||A>=this.maxCount)return;const t=4*A;return this.u32.subarray(t,t+4)}clear(A){if(A<0||A>=this.maxCount)return;const t=4*A+2;this.u32[t]=(-4&this.u32[t])>>>0,this.writeDirty(A)}update(A=this.device){const t=this.binding;let e=t.dataView.buffer,i=t.count,s=!1;return(!e||this.maxIndex>=i)&&(s=!0,i=Math.min(this.count,Math.max(this.transformMeta.calcCapacity(),this.maxIndex+1,1)),t.setCount(i,!0),e=t.createGPUBuffer(A)),this.flushDirty(s,A,e,i),s}flushDirty(A,t,e,i){const s=this.u32;A?t.queue.writeBuffer(e,0,s,0,4*i):ne(t.queue,e,s,this.dirtyIds,this.dirtyCount,4),this.dirtyCount=0}dispose(){this.gpuBuffer?.destroy?.(),this.binding.dispose?.()}}function pn(A,t,e){const i=t.uniqueSlots;if(i<=1)return"hw";if(e?.gpuReliable){let s=function(A,t){return t.gpuNsPerHwDraw*A.uniqueSlots+t.gpuNsPerHwVert*A.shadedHw}(t,e);const n=function(A,t){return t.gpuNsPerPullDraw*Math.max(1,A.pullDraws)+t.gpuNsPerPullVert*A.workPull}(t,e);return e.encodeReliable&&e.encodeMsPerHwDraw>0&&(s+=1e6*e.encodeMsPerHwDraw*i),"hw"===A?1.05*n<s?"pull":"hw":1.05*s<n?"hw":"pull"}if(i>=(e?.encodeReliable?e.gForce:2048))return"pull";const s=fn(t);return"hw"===A?s&&i>=8?"pull":"hw":!s&&i<=4?"hw":"pull"}function fn(A){const t=A.uniqueSlots;return!(t<=1)&&t>Math.max(0,A.workPull-A.workHw)/65536}let mn=null;async function Cn(A){if(mn)return mn;const t=function(A){const t=xt("sail.familySupplyProfile.v2:",A,2);return t&&(!t.gpuReliable||t.gpuNsPerHwVert>0&&t.gpuNsPerPullVert>0)?t:null}(await Qt(A));return t&&(mn=t),mn}function wn(A,t){const e=t.morphAttributes.size,i=null!=A.skeleton;if(i&&(!t.hasAttribute("skinIndex")||!t.hasAttribute("skinWeight")))throw new Error("resolveBucketDrawKind: skeleton requires skinIndex and skinWeight attributes");return A.isInstancedDraw?"instanced":e>0&&ks(A)||i||t.getVertexSlots().length>4?"rich":"indirect"}function yn(A,t,e=!1,i=!1,s=!1,n=!1){if("instanced"===A){let A="|instanced";return e&&(A+=i?"|morph|morphN=1":"|morph"),s&&(A+="|skin"),n&&(A+="|nodeBind"),A+="|pMiVb",A}if("rich"===A){let A="|rich";return e&&(A+=i?"|morph|morphN=1":"|morph"),s&&(A+="|skin"),A}return t?"|family|mega=1":"|legacy-material"}function Bn(A){if(!A)return"";const t=A.heaps,e=A.samplerHandles,i=t.length,s=e.length;let n=`|hs:${i}:${s}`;for(let r=0;r<i;r++){const A=t[r];n+=`:${A.sampleType}:${(A.mipLevelCount??1)>1?1:0}`}return i>0&&(1!==i||1!==s)&&(n+=`|sh:${e.join(",")}`),n}function In(A,t){return t?`${A}|tab:${t.heapSetKey}`:A}function Qn(A,t){return A?ji(t):t}class En{pipelineKey="";layoutId=0;renderContext;passVariants=null;topology;wireframe=!1;variant=null;altVariant=null;materialTable=null;sourceMaterial=null;repMaterial=null;repGeometry=null;repMesh=null;megaBatches=null;megaSlotBatch=null;megaSlotRefCount=null;legacyBatches=null;encodeBatches=[];encodeOrderDirty=!0;encodeVersion=1;bucketId=-1;memberCount=0;clipPipelineMode="off";supply="hw";desiredSupply="hw";drawKind="indirect";hasMorph=!1;morphHasNormal=!1;hasSkin=!1;hasNodeBind=!1;get isSupportFamily(){return!!this.materialTable}get isMegaPull(){return!!this.materialTable&&"pull"===this.supply}get material(){return this.sourceMaterial??this.repMaterial??void 0}get materialBindingProvider(){return this.materialTable?this.materialTable:this.material}get geometry(){return this.repGeometry??void 0}get hasInstanceColor(){return"instanced"===this.drawKind&&!!this.mesh?.instanceColor}get mesh(){return this.repMesh??void 0}constructor(A,t=G.TriangleList){this.renderContext=A,this.topology=t}assignContract(A){if(this.materialTable=A,A)return this.megaBatches=new Array(5).fill(null),this.megaSlotBatch=new Map,void(this.megaSlotRefCount=new Map);this.legacyBatches=new Map}forEachBatch(A){if(this.materialTable){if("pull"===this.supply){const t=this.megaBatches;for(let e=0;e<5;e++){const i=t[e];i&&A(i)}return}for(const t of this.megaSlotBatch.values())A(t)}else for(const t of this.legacyBatches.values())for(const e of t.values())A(e)}collectGeometrySlotBatches(A,t){if(this.materialTable){const e=this.megaSlotBatch.get(A);return void(e&&e.members.length>0&&t.push(e))}const e=this.legacyBatches.get(A);if(e)for(const i of e.values())i.members.length>0&&t.push(i)}clearMembers(){const A=this.encodeBatches;for(let e=0,i=A.length;e<i;e++)A[e].encodeIndex=-1;const t=this.megaBatches;if(t){for(let A=0;A<5;A++)t[A]=null;this.megaSlotBatch.clear(),this.megaSlotRefCount.clear()}this.legacyBatches?.clear(),this.encodeBatches.length=0,this.encodeOrderDirty=!0,this.encodeVersion++,this.memberCount=0,this.supply="hw",this.desiredSupply="hw",this.altVariant=null,this.repGeometry=null,this.repMesh=null,this.repMaterial=null,this.sourceMaterial=null}appendEncodeBatch(A){A.encodeIndex>=0||(A.encodeIndex=this.encodeBatches.length,this.encodeBatches.push(A))}removeEncodeBatch(A){const t=A.encodeIndex;if(t<0)return;const e=this.encodeBatches,i=e.length-1;if(t<i){const A=e[i];e[t]=A,A.encodeIndex=t}e.length=i,A.encodeIndex=-1}ensureEncodeOrder(){if(!this.encodeOrderDirty)return;const A=this.encodeBatches;for(let t=0,e=A.length;t<e;t++)A[t].encodeIndex=-1;A.length=0,this.forEachBatch(t=>{t.members.length<=0||(t.encodeIndex=A.length,A.push(t))}),this.encodeOrderDirty=!1}}class xn{bucketByPipelineKey=new Map;list=[];freeIds=[];materialBgCache=new WeakMap;legacyMaterialRefs=new Map;_materialBindingVersion=1;membersByPoolIndex=new Array;memberByMesh=new Map;freeBatchIds=[];pendingFreeBatchIds=[];nextBatchId=0;batchCountAlive=0;_batchVersion=1;deviceClipMode="hybrid";addedMembers=[];removedMembers=[];morphMembers=[];morphMembershipEpoch=0;freeMorphSlots=[];nextMorphSlot=0;skinMembers=[];skinMembershipEpoch=0;skinMemberIndices=new Map;instanceMeta=null;megaSyncBatches=[];familySupplyDirty=!1;familySlotScratch=[];familyBucketScratch=[];familyBinRefs=new Float64Array(5);familyBinMax=new Float64Array(5);familySupplyStats={uniqueSlots:0,workHw:0,workPull:0,pullDraws:0,shadedHw:0};get slots(){return this.list}get batchIdCapacity(){return this.nextBatchId}get materialBindingVersion(){return this._materialBindingVersion}get batchVersion(){return this._batchVersion}getEncodeBatchCount(){const A=this.list;let t=0;for(let e=0,i=A.length;e<i;e++){const i=A[e];i&&(t+=i.encodeBatches.length)}return t}getBatchCount(){return this.batchCountAlive}markAllPipelineDirty(){const A=this.list;for(let t=0,e=A.length;t<e;t++){const e=A[t];e&&e.forEachBatch(A=>{const t=A.members;for(let e=0,i=t.length;e<i;e++)t[e].mesh.onChangeCallback(f.DIRTY_PIPELINE)})}}getBucketForMesh(A){const t=this.getMemberForMesh(A);return t?t.batch.bucket:void 0}getMemberAtPoolIndex(A){if(!(A<0||A>=this.membersByPoolIndex.length))return this.membersByPoolIndex[A]}getMemberForMesh(A){const t=this.memberByMesh.get(A);if(t)return this.membersByPoolIndex[t.poolIndex]===t?t:void this.memberByMesh.delete(A)}getMaterialBindGroup(A,t){const e=this.materialBgCache.get(A)?.get(t),i=A.getBindGroupCacheToken?.()??null;if(e&&e.token===i)return e.bindGroup}setMaterialBindGroup(A,t,e){let i=this.materialBgCache.get(A);i||(i=new Map,this.materialBgCache.set(A,i)),i.set(t,{token:A.getBindGroupCacheToken?.()??null,bindGroup:e}),this._materialBindingVersion++}hasLegacyMaterial(A){return this.legacyMaterialRefs.has(A)}uploadDirtyMaterials(A,t,e){const i=this.legacyMaterialRefs;for(let s=0,n=t.length;s<n;s++){const n=t[s];i.has(n)&&n.update(A,e)}}getOrCreateForMesh(A,t,e,i,s=null){const n=wn(A,e),r="indirect"===n?s:null,a=e.morphAttributes.size>0&&ks(A),o=null!=A.skeleton,l=A.hasNodeBind,c=a&&e.morphNormals.size>0&&e.hasAttribute("normal"),h=yn(n,r,a,c,o,l),u=A.clipSetId<0?"off":this.deviceClipMode;let g=He(A,t,e,i,0,u)+h;const d=Bn(r);d&&(g+=d);const p=In(g,r);let f=this.bucketByPipelineKey.get(p);if(!f){f=new En(i,Ye(A,t)),f.wireframe=Ge(A,t),f.pipelineKey=g,f.clipPipelineMode=u,f.layoutId=tn(e),f.drawKind=n,f.hasMorph=a,f.morphHasNormal=c,f.hasSkin=o,f.hasNodeBind=l,f.assignContract(r),f.sourceMaterial=r?t:null,f.repMaterial=r?null:t,f.repGeometry=e,f.repMesh=A;const s=this.freeIds.length?this.freeIds.pop():this.list.length;f.bucketId=s,this.list[s]=f,this.bucketByPipelineKey.set(p,f)}return f}paintVariantScratch(A,t,e,i,s,n){const r=wn(t,i),a="indirect"===r?n:null,o=i.morphAttributes.size>0&&ks(t),l=null!=t.skeleton,c=t.hasNodeBind,h=o&&i.morphNormals.size>0&&i.hasAttribute("normal"),u=t.clipSetId<0?"off":this.deviceClipMode;let g=He(t,e,i,s,0,u)+yn(r,a,o,h,l,c);const d=Bn(a);d&&(g+=d),A.renderContext=s,A.topology=Ye(t,e),A.wireframe=Ge(t,e),A.pipelineKey=g,A.clipPipelineMode=u,A.layoutId=tn(i),A.drawKind=r,A.hasMorph=o,A.morphHasNormal=h,A.hasSkin=l,A.hasNodeBind=c,A.materialTable=a,A.sourceMaterial=a?e:null,A.repMaterial=a?null:e,A.repGeometry=i,A.repMesh=t,A.supply=this.bucketByPipelineKey.get(In(g,a))?.supply??"hw",A.memberCount=0,A.variant=null,A.altVariant=null}holdMaterialBindGroup(A,t){const e=this.materialBgCache.get(A)?.get(t);e&&(e.token=A.getBindGroupCacheToken?.()??null)}#at(A,t,e){const i=e.boundIndex;if(A.materialTable){const s=A.megaSlotBatch.get(i);if(s)return s.geometry=e,s.geometrySlot=i,s.material=t,s;if("pull"===A.supply){const i=Qn(A.wireframe,xn.geoDrawVertexCount(e));return this.#ot(A,sn(i),t,e)}return this.#lt(A,i,t,e,!1,-1)}const s=A.legacyBatches;let n=s.get(i);n||(n=new Map,s.set(i,n));let r=n.get(t);return r||(r=this.#lt(A,i,t,e,!1,-1),n.set(t,r)),r}#ot(A,t,e,i){const s=i.boundIndex,n=A.megaBatches;let r=n[t];return r?(r.geometry=i,r.geometrySlot=s,r.material=e):(r=this.#lt(A,s,e,i,!0,t),n[t]=r),r}#lt(A,t,e,i,s,n){const r=new nn;return r.batchId=this.freeBatchIds.length?this.freeBatchIds.pop():this.nextBatchId++,r.geometrySlot=t,r.material=e,r.geometry=i,r.bucket=A,r.mega=s,r.megaSizeBin=n,r.skipCull="instanced"===A.drawKind,this.batchCountAlive++,r}static geoDrawVertexCount(A){const t=A.index;if(t&&t.count>0)return t.count;const e=A.attributes.get("position");return e?.count??0}addMember(A,t,e,i){const s=t.poolIndex;if(s<0)throw new Error("RenderBuckets.addMember: invalid poolIndex");const n=this.membersByPoolIndex;if(s>=n.length&&(n.length=Math.max(s+1,n.length<<1)),n[s])throw new Error("RenderBuckets.addMember: poolIndex already occupied");const r=this.#at(A,e,i),a=!(!A.materialTable||!r.mega||0!==r.members.length),o={mesh:t,geometry:i,material:e,vertexStreams:t.vertexStreams,poolIndex:s,batchMemberIndex:r.members.length,sourceSlot:-1,batch:r,morphMemberIndex:-1,morphSlot:4294967295};if(A.memberCount++,r.members.push(o),this.#ct(o),this.#ht(o),A.materialTable){const t=Qn(A.wireframe,xn.geoDrawVertexCount(i));r.mega&&sn(t)===r.megaSizeBin&&t>r.maxIndexCount&&(r.maxIndexCount=t,this.familySupplyDirty=!0),this.#ut(A,i.boundIndex,r),(a||"pull"===A.supply)&&(this.familySupplyDirty=!0)}return n[s]=o,this.addedMembers.push(o),this.memberByMesh.set(t,o),e.gpuUseCount++,A.materialTable||this.legacyMaterialRefs.set(e,(this.legacyMaterialRefs.get(e)??0)+1),o}releaseMember(A,t){const e=this.getMemberForMesh(t);return e&&e.batch.bucket===A?this.#gt(e):null}releaseDrawMember(A){const t=A.poolIndex;return t<0||t>=this.membersByPoolIndex.length||this.membersByPoolIndex[t]!==A?null:this.#gt(A)}#gt(A){const t=A.poolIndex,e=A.batch.bucket,i=A.material;if(i.onDrawGpuUseDropped(),!e.materialTable){const A=this.legacyMaterialRefs,t=A.get(i);null!=t&&(t<=1?A.delete(i):A.set(i,t-1))}this.membersByPoolIndex[t]=void 0,this.memberByMesh.delete(A.mesh),this.#dt(A),this.#pt(A),e.memberCount--,this.removedMembers.push(A);const s=A.batch,n=A.batchMemberIndex,r=s.members.length-1;if(n<r){const A=s.members[r];s.members[n]=A,A.batchMemberIndex=n}if(s.members.length=r,e.materialTable&&(this.#ft(e,A.geometry.boundIndex),s.mega&&0===r?(s.maxIndexCount=0,this.familySupplyDirty=!0):"pull"===e.supply&&(this.familySupplyDirty=!0)),e.repMesh===A.mesh){const A=e.memberCount>0?s.members[0]??this.#mt(e):null;e.repMesh=A?.mesh??null,e.repGeometry=A?.geometry??null,e.sourceMaterial||(e.repMaterial=A?.material??null)}return A}#mt(A){let t=null;return A.forEachBatch(A=>{null===t&&A.members.length>0&&(t=A.members[0])}),t}#ct(A){A.batch.bucket.hasMorph&&(A.morphSlot=this.freeMorphSlots.pop()??this.nextMorphSlot++,A.morphMemberIndex=this.morphMembers.length,this.morphMembers.push(A),this.morphMembershipEpoch++)}#dt(A){const t=A.morphMemberIndex;if(t<0)return;const e=this.morphMembers,i=e.length-1;if(t<i){const A=e[i];e[t]=A,A.morphMemberIndex=t}e.length=i,A.morphMemberIndex=-1,this.freeMorphSlots.push(A.morphSlot),A.morphSlot=4294967295,this.morphMembershipEpoch++}getSkinSid(A){return this.skinMemberIndices.get(A)??-1}#ht(A){const t=A.mesh.skeleton;if(!t)return;const e=this.skinMembers.length;if(e>65534)throw new Error("RenderBuckets: skinSid exceeds u16");this.skinMemberIndices.set(A,e),this.skinMembers.push({member:A,skeleton:t}),this.instanceMeta?.writeSkinSid(A.poolIndex,e),this.skinMembershipEpoch++}#pt(A){const t=this.skinMemberIndices.get(A);if(null==t)return;this.skinMemberIndices.delete(A);const e=this.skinMembers,i=e.length-1,s=this.instanceMeta;if(t<i){const A=e[i];e[t]=A,this.skinMemberIndices.set(A.member,t),s?.writeSkinSid(A.member.poolIndex,t)}e.length=i,s&&s.cpuView[4*A.poolIndex+an.DrawGroupId]&cn.ALIVE&&s.writeSkinSid(A.poolIndex,-1),this.skinMembershipEpoch++}release(A){const t=this.membersByPoolIndex,e=this.memberByMesh,i=this.pendingFreeBatchIds,s=this.removedMembers,n=this.legacyMaterialRefs,r=!A.materialTable;let a=0;const o=A=>{const o=A.members;for(let i=0,a=o.length;i<a;i++){const A=o[i],a=A.material;if(a.onDrawGpuUseDropped(),r){const A=n.get(a);null!=A&&(A<=1?n.delete(a):n.set(a,A-1))}t[A.poolIndex]===A&&(t[A.poolIndex]=void 0),e.delete(A.mesh),this.#dt(A),this.#pt(A),s.push(A)}i.push(A.batchId),this.batchCountAlive--,a++};if(A.materialTable){const t=new Set,e=A=>{A&&!t.has(A)&&(t.add(A),o(A))};for(const s of A.megaSlotBatch.values())e(s);const i=A.megaBatches;for(let A=0;A<5;A++)e(i[A])}else A.forEachBatch(o);a>0&&this._batchVersion++,A.materialTable&&(this.familySupplyDirty=!0),A.clearMembers(),A.variant=null,A.altVariant=null,A.passVariants=null,this.bucketByPipelineKey.delete(In(A.pipelineKey,A.materialTable)),this.list[A.bucketId]=null,this.freeIds.push(A.bucketId)}flushMemberDeltas(){this.addedMembers.length=0,this.removedMembers.length=0,this.megaSyncBatches.length=0;const A=this.freeBatchIds,t=this.pendingFreeBatchIds;for(let e=0,i=t.length;e<i;e++)A.push(t[e]);t.length=0}evaluateFamilySupply(A,t,e){if(!this.familySupplyDirty)return;const i=this.list,s=this.familyBucketScratch;s.length=0;for(let u=0,g=i.length;u<g;u++){const A=i[u];A&&A.materialTable&&0!==A.memberCount&&s.push(A)}if(0===s.length)return void(this.familySupplyDirty=!1);let n=0;const r=mn,a=r?.encodeReliable?r.hwDrawBudget:256,o=r?.encodeReliable?r.gForce:2048,l=this.familySupplyStats;for(let u=0,g=s.length;u<g;u++){const t=s[u];this.#Ct(t,A,l),t.desiredSupply=t.hasMorph||t.hasSkin?"hw":pn(t.supply,l,r),"hw"===t.desiredSupply&&(n+=t.megaSlotRefCount.size)}if(n>a){s.sort((A,t)=>t.megaSlotRefCount.size-A.megaSlotRefCount.size);for(let t=0,e=s.length;t<e&&n>a;t++){const e=s[t];"hw"===e.desiredSupply&&(e.hasMorph||e.hasSkin||e.megaSlotRefCount.size<=1||(this.#Ct(e,A,l),fn(l)&&(e.desiredSupply="pull",n-=e.megaSlotRefCount.size)))}}let c=0;for(let u=0,g=s.length;u<g;u++){const A=s[u];if(A.supply===A.desiredSupply||!A.variant)continue;const i="pull"===A.desiredSupply&&A.megaSlotRefCount.size>=o;!i&&c>=1&&A.altVariant||this.#wt(A,t,e)&&!i&&c++}let h=!1;for(let u=0,g=s.length;u<g;u++)if(s[u].desiredSupply!==s[u].supply){h=!0;break}this.familySupplyDirty=h,s.length=0}#Ct(A,t,e){const i=A.megaSlotRefCount.size,s=t.u32,n=t.count,r="pull"===A.supply,a=this.familyBinRefs,o=this.familyBinMax;r||(a.fill(0),o.fill(0));let l=0,c=0;for(const[g,d]of A.megaSlotRefCount){let t=0,e=0;if(g>=0&&g<n){const i=g*zs;t=s[i+Ls.VertexCount];const n=s[i+Ls.IndexCount];e=Qn(A.wireframe,n>0?n:t)}if(l+=d*t,c+=d*e,!r&&d>0&&e>0){const A=sn(e);a[A]+=d,e>o[A]&&(o[A]=e)}}let h=0,u=0;if(r){const t=A.megaBatches;for(let A=0;A<5;A++){const e=t[A];e&&e.members.length>0&&(u++,h+=e.members.length*e.maxIndexCount)}}else for(let g=0;g<5;g++){const A=a[g];A>0&&(u++,h+=A*o[g])}return u<1&&(u=1),e.uniqueSlots=i,e.workHw=l,e.workPull=h,e.pullDraws=u,e.shadedHw=c,e}#wt(A,t,e){const i=A.desiredSupply;if(i===A.supply)return!1;const s=A.supply;let n=A.altVariant;if(!n){A.supply=i;try{n=e.requestVariant(A,!0)}finally{A.supply=s}if(!n)return!1}if("pull"===i){const e=this.familySlotScratch;e.length=0;const i=A.megaSlotRefCount,s=A.megaSlotBatch;for(const A of i.keys())e.push(A);for(let n=0,r=e.length;n<r;n++){const i=e[n],r=s.get(i);if(!r||r.mega)continue;const a=r.geometry,o=Qn(A.wireframe,xn.geoDrawVertexCount(a)),l=this.#ot(A,sn(o),r.material,a);this.#yt(r,l,i,o,t),0===r.members.length&&(A.removeEncodeBatch(r),this.pendingFreeBatchIds.push(r.batchId),this.batchCountAlive--)}e.length=0}else{const e=A.megaBatches,i=A.megaSlotBatch;for(let s=0;s<5;s++){const n=e[s];if(!n||0===n.members.length)continue;const r=n.members;for(let e=0,s=r.length;e<s;e++){const s=r[e],n=s.geometry.boundIndex;let a=i.get(n);a&&!a.mega||(a=this.#lt(A,n,s.material,s.geometry,!1,-1),i.set(n,a),this.#Bt(a)),s.batch=a,s.batchMemberIndex=a.members.length,a.members.push(s),t.writeDrawGroupId(s.poolIndex,a.batchId)}r.length=0,n.maxIndexCount=0,A.removeEncodeBatch(n),this.#Bt(n)}}const r=A.variant;A.supply=i,r!==n&&(A.altVariant=r,A.variant=n);const a=A.passVariants;if(a){for(const A of a.values())e.releaseVariant(A);A.passVariants=null}return A.encodeVersion++,!0}rebinMegaDirtyGeometries(A,t,e){const i=A.length;if(0===i)return;const s=t.u32,n=t.count,r=this.list;for(let a=0;a<i;a++){const t=A[a];let i=0,o=-1;if(t>=0&&t<n){const A=t*zs;if(s[A+Ls.Flags]&Gs.ALIVE){const t=s[A+Ls.IndexCount];i=t>0?t:s[A+Ls.VertexCount],o=s[A+Ls.LayoutId]}}for(let A=0,s=r.length;A<s;A++){const s=r[A];if(!s||!s.materialTable||0===s.memberCount)continue;if("pull"!==s.supply)continue;if(o>=0&&s.layoutId!==o)continue;const n=Qn(s.wireframe,i);this.#It(s,t,n,sn(n),e)&&(this.familySupplyDirty=!0)}}}#It(A,t,e,i,s){const n=A.megaSlotBatch.get(t);if(!n)return!1;if(n.megaSizeBin===i)return e>n.maxIndexCount&&(n.maxIndexCount=e,this.#Bt(n),!0);const r=this.#ot(A,i,n.material,n.geometry);return this.#yt(n,r,t,e,s),!0}#yt(A,t,e,i,s){if(A===t)return void(i>A.maxIndexCount&&(A.maxIndexCount=i,this.#Bt(A)));const n=A.bucket,r=A.members;let a=0;for(;a<r.length;){const A=r[a];if(A.geometry.boundIndex!==e){a++;continue}const i=r.length-1;a<i&&(r[a]=r[i],r[a].batchMemberIndex=a),r.length=i,A.batch=t,A.batchMemberIndex=t.members.length,t.members.push(A),s.writeDrawGroupId(A.poolIndex,t.batchId)}n.megaSlotBatch.set(e,t),0===A.members.length&&(A.maxIndexCount=0),i>t.maxIndexCount&&(t.maxIndexCount=i),this.#Bt(A),this.#Bt(t)}#ut(A,t,e){if(t<0)return;const i=A.megaSlotRefCount,s=i.get(t)??0;0===s&&(A.megaSlotBatch.set(t,e),this.familySupplyDirty=!0),i.set(t,s+1)}#ft(A,t){if(t<0)return;const e=A.megaSlotRefCount,i=(e.get(t)??0)-1;i<=0?(e.delete(t),A.megaSlotBatch.delete(t),this.familySupplyDirty=!0):e.set(t,i)}#Bt(A){this.megaSyncBatches.push(A)}clear(){for(const A of this.memberByMesh.values())A.material.onDrawGpuUseDropped();this.bucketByPipelineKey.clear(),this.list.length=0,this.freeIds.length=0,this.legacyMaterialRefs.clear(),this.materialBgCache=new WeakMap,this._materialBindingVersion++,this.membersByPoolIndex.fill(void 0),this.memberByMesh.clear(),this.freeBatchIds.length=0,this.pendingFreeBatchIds.length=0,this.addedMembers.length=0,this.removedMembers.length=0;for(let A=0,t=this.morphMembers.length;A<t;A++){const t=this.morphMembers[A];t.morphMemberIndex=-1,t.morphSlot=4294967295}this.morphMembers.length=0,this.freeMorphSlots.length=0,this.nextMorphSlot=0,this.morphMembershipEpoch++,this.skinMembers.length=0,this.skinMemberIndices.clear(),this.skinMembershipEpoch++,this.megaSyncBatches.length=0,this.familySupplyDirty=!1,this.nextBatchId=0,this.batchCountAlive=0,this._batchVersion++}dispose(){this.clear()}}function Dn(A){return A.materialTable?`${A.pipelineKey}|${A.isMegaPull?"pull":"hw"}`:A.pipelineKey}function Mn(A){return`${A.pipelineKey}|${A.isMegaPull?"hw":"pull"}`}const bn=new Map;let Sn=1;function vn(A,t,e){return(4095&A)<<20|(255&function(A){let t=bn.get(A);return void 0!==t||(t=Sn++,bn.set(A,t)),t}(t))<<12|4095&e}class Tn{renderer;device;shaderAssembler=new je;cache=new Map;#Qt=new Map;#Et=new Set;#xt=null;computeCache=new Map;#Dt=[];#Mt=[];#bt=[];#St=16;#vt=0;emptyBindGroupLayout=null;emptyBindGroup=null;group3Providers=new Map;group3Layouts=new Map;group3ObjectLayouts=new Map;instancedGroup3BG=new Map;megaDummyIb=null;#Tt=null;#Ut=!1;bindCache={render:{cameraSceneLayout:new WeakMap,cameraSceneBindGroup:new WeakMap,commonLayout:new WeakMap,commonBindGroup:new WeakMap},compute:{cameraSceneLayout:new WeakMap,cameraSceneBindGroup:new WeakMap,commonLayout:new WeakMap,commonBindGroup:new WeakMap}};#Nt(A){return A?this.bindCache.render:this.bindCache.compute}activeScene=null;activeCamera=null;activeCommonSence=null;activeCullComputeSence=null;constructor(A){this.renderer=A,this.device=A.device}beginCameraCopyPass(A){this.#Tt=A,this.#Ut=!1}endCameraCopyPass(){this.#Tt=null,this.#Ut=!1}prefetchRenderCamera(A){null!=this.#Tt&&(this.getCameraBG(A,!0),this.#Ut=!0)}unlockCameraUpload(){this.#Ut=!1}setScene(A){this.activeScene=A}setCommonSence(A){this.activeCommonSence=A}setCamera(A){this.activeCamera=A}setCullComputeSence(A){this.activeCullComputeSence=A}ensureCameraSceneLayout(A,t,e=!0){const i=this.#Nt(e).cameraSceneLayout,s=`${A.getCacheKey()}|${t.getCacheKey()}`;let n=i.get(t);if(n&&n.version===s)return n.layout;const r=this.createBGL(0,A,0,e,t);return n={layout:r,version:s},i.set(t,n),r}ensureCameraSceneBindGroup(A,t,e=!1,i=!0){const s=this.#Nt(i).cameraSceneBindGroup;let n=s.get(t);const r=`${A.getCacheKey()}|${t.getCacheKey()}`;if(n&&!e&&n.version===r)return this.#Pt(A,n.camera),n.bindGroup;n?.camera?.dispose();const a=this.ensureCameraSceneLayout(A,t,i),o=A.clone(!1),l=this.createBindGroup(0,a,o,0,i,t);return this.#Pt(A,o),s.set(t,{bindGroup:l,version:r,camera:o}),l}#Pt(A,t){if(this.#Ut)return;const e=this.#Tt,i=t.getCameraUniforms(),s=A.getCameraUniforms();if(s.updateCPUBuffer(),null==e)return i.copy(s),i.isDirty=!0,void i.updateGPUBuffer(this.device);s.createGPUBuffer(this.device),s.updateGPUBuffer(this.device),i.createGPUBuffer(this.device);const n=s.dataView,r=i.dataView,a=n.buffer,o=r.buffer,l=-4&Math.min(a.size-(0|n.offset),o.size-(0|r.offset));e.copyBufferToBuffer(a,0|n.offset,o,0|r.offset,l),i.isDirty=!1}ensureCommonSenceLayout(A,t=!0){A??=t?this.activeCommonSence:this.activeCullComputeSence||this.activeCommonSence;const e=A.getCacheKey(),i=this.#Nt(t).commonLayout;let s=i.get(A);if(s&&s.version===e)return s.layout;t&&s&&this.#vt++;const n=this.createBGL(2,A,0,t);return s={layout:n,version:e},i.set(A,s),n}ensureCommonSenceBindGroup(A,t=!1,e=!0){A??=e?this.activeCommonSence:this.activeCullComputeSence||this.activeCommonSence;const i=A.getCacheKey(),s=this.#Nt(e).commonBindGroup;let n=s.get(A);if(n&&!t&&n.version===i)return n.bindGroup;const r=this.ensureCommonSenceLayout(A,e),a=this.createBindGroup(2,r,A,0,e);return s.set(A,{bindGroup:a,version:i}),a}getCommonSenceBGL(A,t=!0){return this.ensureCommonSenceLayout(A,t)}getCommonSenceBG(A,t=!1,e=!0){return this.ensureCommonSenceBindGroup(A,t,e)}get worldLayoutGen(){return this.#vt}clearCommonSenceBG(A,t=!0){A??=t?this.activeCommonSence:this.activeCullComputeSence||this.activeCommonSence,this.#Nt(t).commonBindGroup.delete(A)}getCameraBG(A,t=!0){return this.ensureCameraSceneBindGroup(A??this.activeCamera,this.activeScene,!1,t)}getCameraBGL(A,t=!0){return this.ensureCameraSceneLayout(A??this.activeCamera,this.activeScene,t)}setVariantHooks(A){this.#xt=A.ready??null}variantKey(A){return Dn(A)}hasVariantKey(A){return this.cache.has(A)}isVariantInflight(A){return this.#Qt.has(A)}isVariantFailed(A){return this.#Et.has(A)}requestVariant(A,t=!1){const e=Dn(A),i=this.cache.get(e);return i?(i.refCount++,i):(this.#Ot(e,A,t,!0),null)}warmVariant(A){const t=Dn(A);this.cache.has(t)||this.#Et.has(t)||this.#Qt.has(t)||this.#Ot(t,A,!1,!1)}async compileVariantsAsync(A){const t=new Set(this.#Qt.keys());A();const e=[];for(const[i,s]of this.#Qt)t.has(i)||e.push(s.pipeline);0!==e.length&&await Promise.all(e.map(A=>A.then(()=>{},()=>{})))}ensurePassVariant(A,t,e=t.getCacheKey()){const i=A.variant;if(!i)return null;if(i.attachmentKey===e)return i;const s=A.material;if(s&&s.dirtyTypes&f.DIRTY_STRUCTURE)return null;const n=A.passVariants,r=n?.get(e);if(r)return r;const a=A.mesh,o=A.geometry;if(!a||!s||!o)return i;const l=A.renderContext,c=A.pipelineKey;A.renderContext=t;let h=He(a,s,o,t,0,A.clipPipelineMode)+yn(A.drawKind,A.materialTable,A.hasMorph,A.morphHasNormal,A.hasSkin,A.hasNodeBind);const u=Bn(A.materialTable);u&&(h+=u),A.pipelineKey=h;try{const t=Dn(A),i=this.cache.get(t);if(i){i.refCount++;let t=A.passVariants;return t||(t=new Map,A.passVariants=t),t.set(e,i),i}return this.#Et.has(t)||this.#Ot(t,A,!1,!1),null}finally{A.renderContext=l,A.pipelineKey=c}}#Ot(A,t,e,i){if(this.cache.has(A)||this.#Et.has(A))return;let s=this.#Qt.get(A);if(!s){const e=this.describeVariant(t),i=this.device.createRenderPipelineAsync(e.descriptor);s={draft:e,pipeline:i,buckets:null,alts:null},this.#Qt.set(A,s),i.then(t=>this.#Ft(A,s,t),t=>{console.error("PipelineCache: async pipeline failed",t),this.#kt(A,s)})}i&&(e?s.alts??=new Set:s.buckets??=new Set).add(t)}#Ft(A,t,e){if(this.#Qt.get(A)!==t)return;this.#Qt.delete(A);let i=this.cache.get(A);i||(i=function(A,t){return{variantId:A.variantId,pipeline:t,pipelineLayout:A.pipelineLayout,materialBGL:A.materialBGL,cameraBGL:A.cameraBGL,group3Mask:A.group3Mask,group3BGL:A.group3BGL,stageMask:A.stageMask,attachmentKey:A.attachmentKey,refCount:0}}(t.draft,e),this.cache.set(A,i));const s=t.buckets;if(s)for(const r of s)r.variant||0===r.memberCount||Dn(r)!==A||(r.variant=i,i.refCount++);const n=t.alts;if(n)for(const r of n)r.variant&&!r.altVariant&&0!==r.memberCount&&Mn(r)===A&&(r.altVariant=i,i.refCount++);this.#xt?.(A)}#kt(A,t){this.#Qt.get(A)===t&&(this.#Qt.delete(A),this.#Et.add(A),this.#xt?.(A))}dropUnreferenced(A){const t=this.cache.get(A);t&&t.refCount<=0&&this.cache.delete(A)}releaseVariant(A){A&&--A.refCount<=0&&this.cache.delete(A.variantId)}describeVariant(A){const t=this.device,e=this.renderer,i=A.material,s=A.geometry;if(!i||!s)throw new Error("PipelineCache.createVariant: bucket has no material/geometry");const n=Dn(A),r=A.isMegaPull,a="instanced"===A.drawKind,o=a?A.mesh:void 0,l=A.renderContext,c=r?null:A.mesh?.vertexStreams??null;let h=r?[]:a?[...s.getVertexSlots()]:c?[...s.getVertexSlots(),...c.getVertexSlots().map(TA)]:s.getVertexSlots();const u=t.limits.maxVertexBuffers;if(a){if(h.length>=u)throw new Error("PipelineCache: instanced packed Mi needs a free vertex buffer slot");const A=Oe(h);h=[...h,{arrayStride:48,stepMode:"instance",attributes:[{shaderLocation:A,offset:0,format:"float32x4"},{shaderLocation:A+1,offset:16,format:"float32x4"},{shaderLocation:A+2,offset:32,format:"float32x4"}]}]}if(h.length>u)throw new Error(`PipelineCache: vertexBuffers ${h.length} > maxVertexBuffers ${u}`);const g=this.activeCommonSence,d=this.activeScene,p=this.activeCamera,f=this.getCameraBGL(p,!0),m=A.materialBindingProvider??i,C=this.createBGL(1,m,0,!0),w=this.getCommonSenceBGL(g,!0),y=$t(r,A.hasMorph,A.hasSkin);let B=null;o&&y?B=this.getGroup3ObjectBGL(y,o):y?B=this.getGroup3BGL(y):o&&(B=this.createBGL(3,o,0,!0));const I=[f,C,w];B&&I.push(B);const Q=t.createPipelineLayout({label:`PL[${n.substring(0,30)}]`,bindGroupLayouts:I}),E=kA(l),x=this.shaderAssembler.assembleRender({camera:p,scene:d,common:g,renderer:e,renderObject:A,pipeline:this,fragmentLayout:E}),D=t.createShaderModule({label:`SM[${n.substring(0,20)}]`,code:x,compilationHints:[{entryPoint:"vertexMain",layout:Q},{entryPoint:"fragmentMain",layout:Q}]}),M=A.topology,b=i.side,S="triangle-strip"===M||"line-strip"===M,v=s.index?.view,T=NA(E);let U;if(l.depth){if(U={format:(l.depthTexture??l.getDepthTexture()).format??"depth32float",depthWriteEnabled:!T&&i.depthWrite,depthCompare:i.depthTest?i.depthCompare??"greater":"always"},l.stencil){const A=!T&&i.stencilWrite;U.stencilFront=A?i.stencilFront:void 0,U.stencilBack=A?i.stencilBack:void 0,U.stencilReadMask=i.stencilReadMask,U.stencilWriteMask=A?i.stencilWriteMask:0}i.depthOffset&&(U.depthBias=-i.depthBias,U.depthBiasSlopeScale=-i.depthBiasSlopeScale,U.depthBiasClamp=-i.depthBiasClamp)}const N={color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}},P={color:{srcFactor:"one",dstFactor:"one",operation:"add"},alpha:{srcFactor:"one",dstFactor:"one",operation:"add"}},O={color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"},alpha:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}},F={color:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"}},k=E.colors[1]?.format,R=function(A,t){const e=A.colors,i=e.length,s=new Array(i);for(let n=0;n<i;n++){const A=e[n];if(A.location!==n)throw new Error(`FragmentLayout: 期望连续 @location 0..${i-1},收到 location ${A.location} at index ${n}`);const r={format:A.format,blend:t(n)};15!==A.writeMask&&(r.writeMask=A.writeMask),s[n]=r}return s}(E,A=>T?0===A?P:"r16float"===k?O:F:0===A&&i.transparent?N:void 0);return{descriptor:{label:`RP[${n.substring(0,20)}]`,layout:Q,vertex:{module:D,entryPoint:"vertexMain",buffers:h},fragment:{module:D,entryPoint:"fragmentMain",targets:R},primitive:{topology:M,cullMode:"double"===b?"none":"back"===b?"front":"back",frontFace:"ccw",stripIndexFormat:!r&&S&&v?v instanceof Uint16Array?"uint16":"uint32":void 0},depthStencil:U,multisample:{count:l.sampleCount,alphaToCoverageEnabled:l.sampleCount>1&&i.alphaToCoverage}},variantId:n,pipelineLayout:Q,materialBGL:C,cameraBGL:f,group3Mask:y,group3BGL:B,stageMask:ue,attachmentKey:l.getCacheKey(),refCount:0}}ensureGroup3Provider(A){let t=this.group3Providers.get(A);return t||(t=new ie(A),this.group3Providers.set(A,t)),A&_t.Mega&&t.attachGeometryMeta(this.renderer.worldStore.geometryMeta.binding),t}getGroup3BGL(A){let t=this.group3Layouts.get(A);return t||(t=this.createBGL(3,this.ensureGroup3Provider(A),0,!0),this.group3Layouts.set(A,t),t)}createGroup3BindGroup(A,t,e,i){const s=this.ensureGroup3Provider(A);return s.attachResources(e),this.createBindGroup(3,t,s,0,!0,null,i)}getGroup3ObjectBGL(A,t){const e=t,i=`${A}|${"function"==typeof e.getCacheKey?e.getCacheKey():t.id}`;let s=this.group3ObjectLayouts.get(i);if(s)return s;const n=this.ensureGroup3Provider(A);return s=this.createBGL(3,n,0,!0,null,t),this.group3ObjectLayouts.set(i,s),s}getInstancedGroup3BindGroup(A,t,e,i){const s=e.getBindGroupCacheToken?.(),n=s?.object??null,r=s?.visible??null,a=s?.visSize??0,o=s?.mats??null,l=s?.matsOff??0,c=s?.matsSize??0,h=s?.f32??null,u=s?.f32Off??0,g=s?.f32Size??0,d=i.morphAtlasTex??null,p=this.instancedGroup3BG.get(e);if(p&&p.layout===A&&p.heap===(i.morphHeap??null)&&p.atlas===d&&p.palette===(i.paletteTex??null)&&p.skin===(i.skinActive??null)&&p.objectBuf===n&&p.visibleBuf===r&&p.visSize===a&&p.matsBuf===o&&p.matsOff===l&&p.matsSize===c&&p.f32Buf===h&&p.f32Off===u&&p.f32Size===g)return p.bg;const f=t?this.createGroup3BindGroup(t,A,i,e):this.createBindGroup(3,A,e,0,!0);return this.instancedGroup3BG.set(e,{bg:f,layout:A,heap:i.morphHeap??null,atlas:d,palette:i.paletteTex??null,skin:i.skinActive??null,objectBuf:n,visibleBuf:r,visSize:a,matsBuf:o,matsOff:l,matsSize:c,f32Buf:h,f32Off:u,f32Size:g}),f}clearInstancedGroup3BG(A){A?this.instancedGroup3BG.delete(A):this.instancedGroup3BG.clear()}#Rt(){return this.megaDummyIb||(this.megaDummyIb=this.device.createBuffer({label:"megaDummyIb",size:16,usage:j.STORAGE})),this.megaDummyIb}getMegaPoolsBG(A){const t=A.vb.activeBuffer,e=A.ib.active??this.#Rt(),i=this.renderer.worldStore.geometryMeta.gpuBuffer;if(A.megaBindGroup&&A.megaBindGroupVb===t&&A.megaBindGroupIb===e&&A.megaBindGroupMeta===i)return A.megaBindGroup;this.renderer.worldStore.geometryMeta.binding.dataView.buffer=i;const s=this.createGroup3BindGroup(_t.Mega,this.getGroup3BGL(_t.Mega),{geometryVb:t,geometryIb:e});return A.megaBindGroup=s,A.megaBindGroupVb=t,A.megaBindGroupIb=e,A.megaBindGroupMeta=i,s}assembleRenderShader(A){const t=this.activeCommonSence,e=this.activeCamera;if(!(t&&e&&A.material&&A.geometry))return null;const i=kA(A.renderContext);return this.shaderAssembler.assembleRender({camera:e,scene:this.activeScene,common:t,renderer:this.renderer,renderObject:A,pipeline:this,fragmentLayout:i})}createBGL(A,t,e,i=!0,s,n){const r=i?ue:ge,a=[],o=this.renderer;Ae(t.getBindings(),t.bindingStartIndex??e,r,(t,e)=>{a.push(...t.generateLayout(A,e,o))}),s&&Ae(s.getBindings(),s.bindingStartIndex??0,r,(t,e)=>{a.push(...t.generateLayout(A,e,o))}),n&&Ae(n.getBindings(),n.bindingStartIndex??0,r,(t,e)=>{a.push(...t.generateLayout(A,e,o))});const l=s?`BGL_${A}_${t.type}_${t.id}+Scene_${s.id}_S${r}`:n?`BGL_${A}_${t.type}_${t.id}+${n.type}_${n.id}_S${r}`:`BGL_${A}_${t.type}_${t.id}_S${r}`;return this.device.createBindGroupLayout({label:l,entries:a})}createBindGroup(A,t,e,i,s=!0,n,r){const a=s?ue:ge,o=[],l=this.renderer;return Ae(e.getBindings(),e.bindingStartIndex??i,a,(t,e)=>{o.push(...t.generateBinding(A,e,l))}),n&&Ae(n.getBindings(),n.bindingStartIndex??0,a,(t,e)=>{o.push(...t.generateBinding(A,e,l))}),r&&Ae(r.getBindings(),r.bindingStartIndex??0,a,(t,e)=>{o.push(...t.generateBinding(A,e,l))}),this.device.createBindGroup({layout:t,entries:o})}createMaterialBindGroup(A,t){const e=0===(A.stageMask&ge);return this.createBindGroup(1,A.materialBGL,t,0,e)}getComputeVariant(A){const t=A.pipelineKey||A.computePipelineKey(),e=this.computeCache;let i=e.get(t);return i?(i.refCount++,i):(i=this.createComputeVariant(A),i.refCount=1,e.set(t,i),i)}createComputeVariant(A){const t=this.device,e=A.material,i=A.pipelineKey,s=A.isNeedCamera,n=A.isNeedWorldStore,r=this.activeCullComputeSence||this.activeCommonSence||void 0,a=n?r:{type:"Empty",getBindings:()=>new Map},o=s?this.getCameraBGL(void 0,!1):this.getEmptyBGL(),l=this.createBGL(1,e,0,!1),c=n?this.getCommonSenceBGL(r,!1):this.getEmptyBGL(),h=t.createPipelineLayout({label:`CPL[${i.substring(0,30)}]`,bindGroupLayouts:[o,l,c]}),u=this.shaderAssembler.assembleCompute({pipeline:this,camera:s?this.activeCamera:null,common:a,renderer:this.renderer,computeObject:A}),g=t.createShaderModule({label:`CSM[${i.substring(0,20)}]`,code:u,compilationHints:[{entryPoint:e.entryPoint,layout:h}]}),d=t.createComputePipeline({label:`CP[${i.substring(0,20)}]`,layout:h,compute:{module:g,entryPoint:e.entryPoint}});return{variantId:i,pipeline:d,pipelineLayout:h,contextBGL:c,materialBGL:l,cameraBGL:s?o:null,stageMask:ge,refCount:0}}registerDepthKind(A){const t=A.reservedId??this.#St++;return this.#Dt[t]||(this.#Dt[t]={spec:{material:A.material,entryWgsl:A.entryWgsl,group3:A.group3},bgl:null,g3bgl:null,layout:null,module:null,builtWorldGen:-1}),t}registerFullscreenKind(A){const t=A.reservedId,e=null!=t?t:this.#bt.pop()??this.#St++;return this.#Mt[e]||(this.#Mt[e]={spec:A,bgl:null,layout:null,module:null}),e}releaseFullscreenKind(A){A<16||this.#Mt[A]&&(delete this.#Mt[A],this.#bt.push(A))}createDepthEncode(A,t,e,i){const s=this.#Dt[A];if(!s)throw new Error(`PipelineCache.createDepthEncode: unknown kind ${A}`);return this.#Lt(s,A),this.device.createRenderPipeline({label:`RP[depth:${A}]`,layout:s.layout,vertex:{module:s.module,entryPoint:"vs_main",buffers:[{arrayStride:t,stepMode:"vertex",attributes:[{shaderLocation:0,offset:i,format:e}]}]},primitive:{topology:"triangle-list",cullMode:"none"},depthStencil:{format:"depth32float",depthWriteEnabled:!0,depthCompare:"greater",depthBias:0,depthBiasSlopeScale:0,depthBiasClamp:0}})}createFullscreen(A,t,e=1){const i=this.#Mt[A];if(!i)throw new Error(`PipelineCache.createFullscreen: unknown kind ${A}`);i.bgl??=this.createBGL(1,i.spec.material,0,!0),i.layout??=this.device.createPipelineLayout({label:`PL[fs:${A}]`,bindGroupLayouts:[this.getEmptyBGL(),i.bgl]}),i.module||(i.module=this.device.createShaderModule({label:`SM[fs:${A}]`,code:this.shaderAssembler.assembleWboitComposite({pipeline:this,material:i.spec.material,renderer:this.renderer,entryWgsl:i.spec.entryWgsl})}));const s=i.spec.sampleCountFixed??e,n=i.spec.blend,r=i.spec.depthStencil;return this.device.createRenderPipeline({label:`RP[fs:${A}]`,layout:i.layout,vertex:{module:i.module,entryPoint:"vertexMain",buffers:[]},fragment:{module:i.module,entryPoint:"fragmentMain",targets:[{format:t,...n?{blend:n}:{}}]},primitive:{topology:"triangle-list",cullMode:"none"},...r?{depthStencil:r}:{},multisample:{count:s}})}createSystemBindGroup(A,t){const e=this.#Dt[A];if(e){const A=this.#jt(e);return this.createBindGroup(1,A,t,0,!0)}const i=this.#Mt[A];if(!i)throw new Error(`PipelineCache.createSystemBindGroup: unknown kind ${A}`);return i.bgl??=this.createBGL(1,i.spec.material,0,!0),this.createBindGroup(1,i.bgl,t,0,!0)}getSystemGroup3BGL(A){const t=this.#Dt[A];return t?.spec.group3?(t.g3bgl??=this.createBGL(3,t.spec.group3,0,!0),t.g3bgl):null}#jt(A){if(A.bgl)return A.bgl;const t=A.spec.material,e=this.#Dt;for(let i=0,s=e.length;i<s;i++){const s=e[i];if(s&&s!==A&&s.spec.material===t&&s.bgl)return A.bgl=s.bgl,A.bgl}return A.bgl=this.createBGL(1,t,0,!0),A.bgl}#Lt(A,t){if(this.#jt(A),A.spec.group3&&(A.g3bgl??=this.createBGL(3,A.spec.group3,0,!0)),A.builtWorldGen!==this.#vt&&(A.module=null,A.layout=null),A.module||(A.module=this.device.createShaderModule({label:`SM[depth:${t}]`,code:this.shaderAssembler.assembleShadowEncode({pipeline:this,material:A.spec.material,common:this.activeCommonSence,renderer:this.renderer,entryWgsl:A.spec.entryWgsl,object:A.spec.group3})})),!A.layout){const e=this.getCommonSenceBGL(void 0,!0),i=A.spec.group3?[this.getEmptyBGL(),A.bgl,e,A.g3bgl]:[this.getEmptyBGL(),A.bgl,e];A.layout=this.device.createPipelineLayout({label:`PL[depth:${t}]`,bindGroupLayouts:i}),A.builtWorldGen=this.#vt}}getEmptyBGL(){return this.emptyBindGroupLayout||(this.emptyBindGroupLayout=this.device.createBindGroupLayout({label:"EmptyBGL",entries:[]})),this.emptyBindGroupLayout}getEmptyBG(){return this.emptyBindGroup||(this.emptyBindGroup=this.device.createBindGroup({label:"EmptyBG",layout:this.getEmptyBGL(),entries:[]})),this.emptyBindGroup}dispose(){this.cache.clear(),this.computeCache.clear(),this.#Dt.length=0,this.#Mt.length=0,this.#bt.length=0,this.#St=16,this.#vt=0,this.emptyBindGroupLayout=null,this.emptyBindGroup=null,this.megaDummyIb?.destroy(),this.group3Providers.clear(),this.group3Layouts.clear(),this.group3ObjectLayouts.clear(),this.instancedGroup3BG.clear(),this.#Tt=null}}const Un={AfterShadow:0,AfterOpaque:1,AfterTransparent:2,Present:3,AfterPresent:4};class Nn{one=null;many=null;get empty(){return null===this.one&&null===this.many}add(A){if(this.one===A)return!1;const t=this.many;return!(t&&t.indexOf(A)>=0||(null===this.one&&null===t?(this.one=A,0):null!==this.one?(this.many=[this.one,A],this.one=null,0):(t.push(A),0)))}remove(A){if(this.one===A)return this.one=null,!0;const t=this.many;if(!t)return!1;const e=t.indexOf(A);return!(e<0||(t.splice(e,1),1===t.length?(this.one=t[0],this.many=null):0===t.length&&(this.many=null),0))}hasActive(){const A=this.one;if(null!==A)return A.active;const t=this.many;if(null===t)return!1;for(let e=0,i=t.length;e<i;e++)if(t[e].active)return!0;return!1}needsHdr(){const A=this.one;if(null!==A)return A.active&&!0===A.needsHdr;const t=this.many;if(null===t)return!1;for(let e=0,i=t.length;e<i;e++){const A=t[e];if(A.active&&A.needsHdr)return!0}return!1}run(A){const t=this.one;if(null!==t)return void(t.active&&t.execute(A));const e=this.many;if(null!==e)for(let i=0,s=e.length;i<s;i++){const t=e[i];t.active&&t.execute(A)}}collectActive(A){A.length=0;const t=this.one;if(null!==t)return void(t.active&&A.push(t));const e=this.many;if(null!==e)for(let i=0,s=e.length;i<s;i++){const t=e[i];t.active&&A.push(t)}}detachAll(){const A=this.one,t=this.many;if(this.one=null,this.many=null,null==A){if(null!==t)for(let e=0,i=t.length;e<i;e++)t[e].onDetach?.()}else A.onDetach?.()}forEach(A){const t=this.one;if(null!==t)return void A(t);const e=this.many;if(null!==e)for(let i=0,s=e.length;i<s;i++)A(e[i])}}class Pn{isPostProcessing=!0;toneMapping;exposure;bloom;bloomStrength;bloomThreshold;constructor(A){this.toneMapping=A?.toneMapping??SA.ACESFilmicToneMapping,this.exposure=A?.exposure??1,this.bloom=A?.bloom??!1,this.bloomStrength=A?.bloomStrength??.8,this.bloomThreshold=A?.bloomThreshold??1}}let On=0;var Fn=(A=>(A.Front="front",A.Back="back",A.Double="double",A))(Fn||{});function kn(A,t){return A.compare===t.compare&&(A.failOp??"keep")===(t.failOp??"keep")&&(A.depthFailOp??"keep")===(t.depthFailOp??"keep")&&(A.passOp??"keep")===(t.passOp??"keep")}class Rn extends si{id=On++;type="ShaderNode";name="";buildShader;visible=!0;_defines;_features;_side="front";_wireframe=!1;_alphaToCoverage=!1;_depthTest=!0;_depthWrite=!0;_depthCompare=Y.Greater;_stencilWrite=!1;_stencilFront={compare:Y.Less};_stencilBack={compare:Y.Less};_stencilReadMask=0;_stencilWriteMask=0;_depthOffset=!1;_depthBias=0;_depthBiasSlopeScale=0;_depthBiasClamp=0;_shaderKey=0;needsLighting=!1;get side(){return this._side}set side(A){A!==this._side&&(this._side=A,this.onChangeCallback(f.DIRTY_PIPELINE))}get wireframe(){return this._wireframe}set wireframe(A){A!==this._wireframe&&(this._wireframe=A,this.onChangeCallback(f.DIRTY_PIPELINE))}get alphaToCoverage(){return this._alphaToCoverage}set alphaToCoverage(A){A!==this._alphaToCoverage&&(this._alphaToCoverage=A,this.onChangeCallback(f.DIRTY_PIPELINE))}get depthTest(){return this._depthTest}set depthTest(A){A!==this._depthTest&&(this._depthTest=A,this.onChangeCallback(f.DIRTY_PIPELINE))}get depthWrite(){return this._depthWrite}set depthWrite(A){A!==this._depthWrite&&(this._depthWrite=A,this.onChangeCallback(f.DIRTY_PIPELINE))}get depthCompare(){return this._depthCompare}set depthCompare(A){A!==this._depthCompare&&(this._depthCompare=A,this.onChangeCallback(f.DIRTY_PIPELINE))}get stencilWrite(){return this._stencilWrite}set stencilWrite(A){A!==this._stencilWrite&&(this._stencilWrite=A,this.onChangeCallback(f.DIRTY_PIPELINE))}get stencilFront(){return this._stencilFront}set stencilFront(A){kn(this._stencilFront,A)||(this._stencilFront={...A},this.onChangeCallback(f.DIRTY_PIPELINE))}get stencilBack(){return this._stencilBack}set stencilBack(A){kn(this._stencilBack,A)||(this._stencilBack={...A},this.onChangeCallback(f.DIRTY_PIPELINE))}get stencilReadMask(){return this._stencilReadMask}set stencilReadMask(A){A!==this._stencilReadMask&&(this._stencilReadMask=A,this.onChangeCallback(f.DIRTY_PIPELINE))}get stencilWriteMask(){return this._stencilWriteMask}set stencilWriteMask(A){A!==this._stencilWriteMask&&(this._stencilWriteMask=A,this.onChangeCallback(f.DIRTY_PIPELINE))}get depthOffset(){return this._depthOffset}set depthOffset(A){A!==this._depthOffset&&(this._depthOffset=A,this.onChangeCallback(f.DIRTY_PIPELINE))}get depthBias(){return this._depthBias}set depthBias(A){A!==this._depthBias&&(this._depthBias=A,this.onChangeCallback(f.DIRTY_PIPELINE))}get depthBiasSlopeScale(){return this._depthBiasSlopeScale}set depthBiasSlopeScale(A){A!==this._depthBiasSlopeScale&&(this._depthBiasSlopeScale=A,this.onChangeCallback(f.DIRTY_PIPELINE))}get depthBiasClamp(){return this._depthBiasClamp}set depthBiasClamp(A){A!==this._depthBiasClamp&&(this._depthBiasClamp=A,this.onChangeCallback(f.DIRTY_PIPELINE))}get features(){return this._features}get defines(){return this._defines}constructor(A){super();const t=A=>{this.onChangeCallback(A)};this._features=new Ke(A?.features,t),this._defines=new Ke(A?.defines,t),this._defines.dirtyTypes=f.DIRTY_STRUCTURE,this._features.dirtyTypes=f.DIRTY_STRUCTURE,this.buildShader=this.createShaderFn(A?.shader)}createShaderFn(A){if(!A)return this._shaderKey=0,this.needsLighting=!1,()=>"";const t="function"==typeof A,e=t?A.toString():A;return this._shaderKey=ze(e),this.needsLighting=function(A){return XA.test(A)||null!=$A(A)}(e),t?A:new Function("renderer","renderObject","pipeline","commonFunctions","isRender",`return (${A})();`)}onBeforeCompile(A,t,e,i){return A}toJSON(){}clone(){return(new this.constructor).copy(this)}copy(A){this.name=A.name,this.visible=A.visible,this.buildShader=A.buildShader,this._shaderKey=A._shaderKey,this.needsLighting=A.needsLighting,this.onBeforeCompile=A.onBeforeCompile,this._side=A._side,this._wireframe=A._wireframe,this._alphaToCoverage=A._alphaToCoverage,this._depthTest=A._depthTest,this._depthWrite=A._depthWrite,this._depthCompare=A._depthCompare,this._stencilWrite=A._stencilWrite,this._stencilFront={...A._stencilFront},this._stencilBack={...A._stencilBack},this._stencilReadMask=A._stencilReadMask,this._stencilWriteMask=A._stencilWriteMask,this._depthOffset=A._depthOffset,this._depthBias=A._depthBias,this._depthBiasSlopeScale=A._depthBiasSlopeScale,this._depthBiasClamp=A._depthBiasClamp,this._defines.clear();for(const[t,e]of A._defines)this._defines.set(t,e);this._features.clear();for(const[t,e]of A._features)this._features.set(t,e);return this._cacheKey="",this.onChangeCallback(f.DIRTY_STRUCTURE),this}}class Ln extends pt{isDepthTexture=!0;constructor(A=1,t=1,e=1,i={magFilter:X.Nearest,minFilter:X.Nearest,formatType:wA.DepthFormat,dataType:yA.UnIntType}){super({width:A,height:t,depth:e},i),this.useMipmaps=!1,this.flipY=!1,this.usage|=GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}}class jn extends pt{isCube=!0;isCubeTexture=!0;constructor(A=[],t={mapping:gt.CubeReflectionMapping}){super(A,t),this.mapping=t.mapping??gt.CubeReflectionMapping,null==t.flipY&&(this.flipY=!1)}get images(){return this.image}set images(A){this.image=A}}class zn extends pt{isCompressedTexture=!0;constructor(A=[],t,e,i){super(null,i),this.flipY=!1,this.useMipmaps=!1,this.mipmaps=A,this.image={width:t,height:e}}get mipLevelCount(){return this.mipmaps?.length||1}}function Gn(A,t,e,i,s){let n=t;const r={width:e,height:i,get data(){return n},set data(t){t!==n&&(n=t,A.isDirty=!0,A.onChangeCallback(f.DIRTY_DATA))}};return void 0!==s&&(r.depth=s),r}class Yn extends pt{isDataTexture=!0;constructor(A=null,t=1,e=1,i={magFilter:X.Nearest,minFilter:X.Nearest}){super(null,i),this.image=Gn(this,A,t,e),this.useMipmaps=!1,this.flipY=!1}}class Hn extends pt{isVideoTexture=!0;isExternalTexture=!0;frameCallbackId=null;#zt=!1;constructor(A,t={magFilter:X.Linear,minFilter:X.Linear}){if(super(A,t),this.useMipmaps=!1,"function"==typeof A?.requestVideoFrameCallback){const t=()=>{this.#zt||(this.externalTexture=null,this.onChangeCallback(f.DIRTY_STRUCTURE),this.frameCallbackId=A.requestVideoFrameCallback(t))};this.frameCallbackId=A.requestVideoFrameCallback(t)}}destroy(){this.#zt=!0;const A=this.image;null!=this.frameCallbackId&&"function"==typeof A?.cancelVideoFrameCallback&&(A.cancelVideoFrameCallback(this.frameCallbackId),this.frameCallbackId=null),super.destroy()}}function Kn(A,t,e){if(A.isTexture)return A.createView(t);const i=A;return"bgra8unorm-srgb"===e||"rgba8unorm-srgb"===e?i.createView({format:e}):i.createView()}function Vn(A,t,e,i){if(!A.isTexture)return Kn(A,t);const s=A;return"3d"===s.dimension||!s.isCube&&!s.isArray&&s.depth<=1&&0===i?s.createView(t):s.createView(t,{dimension:"2d",baseArrayLayer:e,arrayLayerCount:1,baseMipLevel:i,mipLevelCount:1})}let Jn=0;class Wn{name;id=Jn++;device;canvasContext=null;format;isCanvasRender=!1;clearColor;clearColorValue;depth;clearDepth;clearDepthValue;depthReadOnly;stencil;clearStencil;clearStencilValue;stencilReadOnly;sampleCount;keepMsaaColor=!1;textures=[];depthTexture=null;#Gt=!0;manualColorAttachments=!1;textureDepth;#Yt=null;#Ht=null;#Kt=null;#Vt={fragDepth:!1,sampleMask:!1};#Jt="";#Wt="";#qt=new Map;width;height;viewport;viewportValue;scissor;scissorValue;multiview=!1;baseTextureParams;descriptor;#Xt="";#Zt;#_t=!0;#$t=!1;encoder=null;passEncoder=null;ownsEncoder=!1;activeLayer=0;activeMipmapLevel=0;constructor(A,t={},e){if(this.device=A,this.name=t.name||"default",t.canvas){if(this.isCanvasRender=!0,this.canvasContext=t.canvas.getContext("webgpu"),!this.canvasContext)throw new Error("Failed to get WebGPU canvas context");this.format=t.format||navigator.gpu.getPreferredCanvasFormat();const{configureFormat:e,viewFormats:s}="bgra8unorm-srgb"===(i=this.format)?{configureFormat:"bgra8unorm",viewFormats:["bgra8unorm-srgb"]}:"rgba8unorm-srgb"===i?{configureFormat:"rgba8unorm",viewFormats:["rgba8unorm-srgb"]}:{configureFormat:i,viewFormats:void 0};this.canvasContext.configure({device:A,format:e,viewFormats:s,usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING,colorSpace:t.colorSpace||"srgb",toneMapping:{mode:t.toneMapping||"standard"},alphaMode:t.alpha?"premultiplied":"opaque"})}else this.isCanvasRender=t.isCanvasRender??!1,this.format=t.format||W.RGBA8Unorm;var i;if(this.clearColor=t.clearColor??!0,this.clearColorValue=t.clearColorValue??{r:0,g:0,b:0,a:1},this.depth=t.depth??!0,this.clearDepth=t.clearDepth??!0,this.clearDepthValue=t.clearDepthValue??0,this.depthReadOnly=t.depthReadOnly??!1,this.stencil=t.stencil??!1,this.clearStencil=t.clearStencil??!0,this.clearStencilValue=t.clearStencilValue??1,this.stencilReadOnly=t.stencilReadOnly??!1,this.sampleCount=t.sampleCount>1?4:1,this.textureDepth=+(e?.depth??1),this.multiview=t.multiview??!1,this.sampleCount>1&&this.textureDepth>1)throw new Error("depth must be 1 when sampleCount > 1");this.baseTextureParams={...e,minFilter:e?.minFilter||X.Linear,useMipmaps:e?.useMipmaps||!1,flipY:e?.flipY||!1,sampleCount:this.sampleCount};const s=t.width||0,n=t.height||0;this.width=s,this.height=n,this.viewport=t.viewport??!1,this.viewportValue=new B(0,0,s,n),this.scissorValue=new B(0,0,s,n),this.scissor=t.scissor??!1,this.textures=new Array(t.count||1)}createTextures(){const A=this.textures,t=this.width,e=this.height,i=this.textureDepth,s=this.sampleCount,n=this.baseTextureParams;let r=!1;for(let a=this.isCanvasRender?1:0,o=A.length;a<o;a++){const o=A[a];o&&o.width===t&&o.height===e&&o.depth===i&&(o.sampleCount>1?4:1)===s||(r=!0,o&&(o.destroy(),o.resolveTargetTexture?.destroy()),A[a]=new pt({width:t,height:e,depth:i},{...n,sampleCount:s,format:this.format,generateMipmaps:!1}),A[a].applyUsageRender(),A[a].prepareConfiguration())}r&&(this.#Jt="",this.#Wt="",this.#qt.clear())}#Ae(A,t,e){if("3d"===A.dimension||!A.isCube&&!A.isArray&&A.depth<=1&&0===e)return Vn(A,this.device,t,e);const i=e<<16|t>>>0;let s=this.#qt.get(A);s||(s=new Map,this.#qt.set(A,s));let n=s.get(i);return n||(n=Vn(A,this.device,t,e),s.set(i,n)),n}get texture(){return this.textures[0]}set texture(A){this.textures[0]=A}setActiveAttachment(A=0,t=0){const e=this.activeLayer,i=this.activeMipmapLevel;e===A&&i===t||(this.activeLayer=A,this.activeMipmapLevel=t,this.#$t=!0)}beginRenderPass(A){const t=this.device;A?(this.encoder=A,this.ownsEncoder=!1):(this.encoder=t.createCommandEncoder({label:`RenderContext_${this.name}_${this.id}`}),this.ownsEncoder=!0);const e=this.encoder.beginRenderPass(this.getRenderPassDescriptor());if(this.viewport){const{x:A,y:t,z:i,w:s,minDepth:n=0,maxDepth:r=1}=this.viewportValue;e.setViewport(A,t,i,s,n,r)}if(this.scissor){const{x:A,y:t,z:i,w:s}=this.scissorValue;e.setScissorRect(A,t,i,s)}return this.passEncoder=e,e}finish(){if(this.passEncoder?.end(),this.passEncoder=null,!this.ownsEncoder)return this.encoder=null,null;const A=this.encoder.finish();return this.encoder=null,A}getColorTexture(){let A,t;if(this.sampleCount>1){let e=this.textures[0];e?.isTexture&&e.width===this.width&&e.height===this.height||(e?.destroy?.(),e=new pt({width:this.width,height:this.height,depth:1},{format:this.format,sampleCount:this.sampleCount}),e.usage=GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC),A=e,t=this.canvasContext.getCurrentTexture()}else A=this.canvasContext.getCurrentTexture();return A.resolveTargetTexture=t,A}getCompositeColorAttachment(){const A=this.device,t=this.format,e=this.sampleCount>1?4:1;if(this.isCanvasRender){const i=this.getColorTexture();this.textures[0]=i;const s=i.resolveTargetTexture;return{view:Kn(i,A,t),resolveTarget:null==s?void 0:Kn(s,A,t),format:t,sampleCount:e}}const i=this.textures[0],s=0|this.activeLayer,n=0|this.activeMipmapLevel,r=this.#Ae(i,s,n),a=i.resolveTargetTexture;let o;return e>1&&a&&(o=a.isTexture?this.#Ae(a,s,n):Vn(a,A,s,n)),{view:r,resolveTarget:o,format:i.format||t,sampleCount:e}}getColorFormats(){const A=this.textures,t=[],e=this.format;for(let i=0,s=A.length;i<s;i++){if(0===i&&this.isCanvasRender){t.push(e);continue}const s=A[i];s&&!s.format&&s.prepareConfiguration(),t.push(s?.format||e)}return t}getColorSlotName(A){const t=this.#Yt?.[A];return t||(0===A?"color":`c${A}`)}setColorSlotName(A,t){const e=this.textures.length;if(A<0||A>=e)throw new Error(`Color attachment index ${A} out of bounds (count=${e})`);if(!t)throw new Error("Color slot name must be non-empty");let i=this.#Yt;if(i){if(i.length<e)for(let s=i.length;s<e;s++)i.push(null)}else i=new Array(e).fill(null);this.#Yt=i,i[A]=t}getColorWriteMask(A){const t=this.#Ht?.[A];return t??15}setColorWriteMask(A,t){const e=this.textures.length;if(A<0||A>=e)throw new Error(`Color attachment index ${A} out of bounds (count=${e})`);const i=15&t;let s=this.#Ht;if(s){if(s.length<e)for(let n=s.length;n<e;n++)s.push(null)}else s=new Array(e).fill(null);this.#Ht=s,(null==s[A]?15:s[A])!==i&&(s[A]=15===i?null:i,this.#Jt="",this.#Wt="")}getFragmentBuiltins(){const A=this.#Vt;return{fragDepth:A.fragDepth,sampleMask:A.sampleMask}}setFragmentBuiltins(A){const t={fragDepth:!!A?.fragDepth,sampleMask:!!A?.sampleMask},e=this.#Vt;e.fragDepth===t.fragDepth&&e.sampleMask===t.sampleMask||(this.#Vt=t,this.#Jt="",this.#Wt="")}getFragmentLayoutCacheKey(){if(this.#Jt)return this.#Jt;const A=this.#Ht,t=this.getColorFormats(),e=t.length;let i="";for(let n=0;n<e;n++)n&&(i+=","),i+=`${n}:${t[n]}:${A?.[n]?.toString(16)??"0"}`;const s=this.#Vt;return this.#Jt=`${i||"none"}|bd:${s.fragDepth?1:0}|sm:${s.sampleMask?1:0}`}getRenderBundleEncoderDescriptor(){const A=this.getBundleCompatibleKey();if(A===this.#Xt)return this.#Zt;const t=this.#te()||void 0;return this.#Xt=A,this.#Zt={colorFormats:this.getColorFormats(),depthStencilFormat:t,sampleCount:this.sampleCount,depthReadOnly:this.depthReadOnly,stencilReadOnly:this.stencilReadOnly}}setColorAttachment(A,t,e){const i=this.textures;if(A>=i.length)throw new Error(`Color attachment index ${A} out of bounds`);const s=i[A];s&&this.#qt.delete(s),s?.destroy(),s?.resolveTargetTexture?.destroy(),i[A]=t,t.resolveTargetTexture=e||t.resolveTargetTexture,this.#Jt="",this.#Wt="",this.#$t=!0}getRenderPassDescriptor(){if(this.descriptor&&!this.#_t){if(this.#$t)return this.descriptor.colorAttachments=this.getColorDescriptor(),this.#$t=!1,this.descriptor;if(this.isCanvasRender){const A=this.canvasContext.getCurrentTexture(),t=Kn(A,this.device,this.format),e=this.descriptor.colorAttachments[0];this.sampleCount>1?e.resolveTarget=t:(e.view=t,this.textures[0]=A)}return this.descriptor}const A={colorAttachments:this.getColorDescriptor(),depthStencilAttachment:this.getDepthDescriptor()};return this.descriptor=A,this.#_t=!1,this.#$t=!1,A}getColorDescriptor(){const A=[],t=this.clearColorValue,e=this.#Kt,i=this.clearColor?K.Clear:K.Load,s=this.textures,n=this.device;let r=0;if(this.#_t&&!this.manualColorAttachments&&this.createTextures(),this.isCanvasRender){const a=this.getColorTexture();s[0]=a;const o=a.resolveTargetTexture;A.push({view:Kn(a,n,this.format),resolveTarget:null==o?void 0:Kn(o,n,this.format),clearValue:e?.[0]??t,loadOp:i,storeOp:H.Store}),r=1}const a=this.multiview&&this.textureDepth>1?void 0:this.activeLayer,o=this.activeLayer,l=this.activeMipmapLevel;for(let c=s.length;r<c;r++){const c=s[r],h=c.resolveTargetTexture,u=this.#Ae(c,o,l),g=null==h?void 0:h.isTexture?this.#Ae(h,o,l):Vn(h,n,o,l);A.push({view:u,resolveTarget:g,depthSlice:"3d"===c.dimension?a:void 0,clearValue:e?.[r]??t,loadOp:i,storeOp:null==g||this.keepMsaaColor?H.Store:H.Discard})}return A}getDepthDescriptor(){const A={};if(this.depth&&(A.depthReadOnly=this.depthReadOnly,this.depthReadOnly||(A.depthStoreOp=H.Store,this.clearDepth?(A.depthClearValue=this.clearDepthValue,A.depthLoadOp=K.Clear):A.depthLoadOp=K.Load)),this.stencil&&(A.stencilReadOnly=this.stencilReadOnly,this.stencilReadOnly||(A.stencilStoreOp=H.Store,this.clearStencil?(A.stencilClearValue=this.clearStencilValue,A.stencilLoadOp=K.Clear):A.stencilLoadOp=K.Load)),this.depth||this.stencil)return A.view||=this.getDepthTexture().createView(this.device),A}getDepthTexture(){let A,t,e=this.width,i=this.height,s=this.depthTexture;const n=this.multiview?this.textureDepth:1;if(this.stencil?(A=wA.DepthStencilFormat,t=yA.UnIntType):this.depth&&(A=wA.DepthFormat,t=yA.FloatType),null==s){if(!this.#Gt)throw new Error("RenderContext.getDepthTexture: 共享深度为空");return s=new Ln(e,i,n,{...this.baseTextureParams,formatType:A,dataType:t,sampleCount:this.sampleCount,isCube:!1}),this.depthTexture=s,s.prepareConfiguration(),this.#Wt="",s}const r=s.format,a=this.stencil?"depth24plus-stencil8":"depth32float",o=null==r||r===a;return s.width===e&&s.height===i&&s.depth===n&&s.sampleCount===this.sampleCount&&!s.isCube&&o?s:this.#Gt?(s.destroy(),s.width=e,s.height=i,s.depth=n,s.setValues({formatType:A,dataType:t,sampleCount:this.sampleCount,isCube:!1}),s.prepareConfiguration(),this.#Wt="",s):s}#te(){return this.depth||this.stencil?(this.depthTexture??this.getDepthTexture()).format:""}getCacheKey(){return this.#Wt?this.#Wt:this.#Wt=`${this.isCanvasRender?1:0}|${this.getFragmentLayoutCacheKey()}|s${this.sampleCount}|df:${this.#te()}`}getBundleCompatibleKey(){return`${this.getCacheKey()}|dr${this.depthReadOnly?1:0}|sr${this.stencilReadOnly?1:0}`}setSize(A,t,e=this.textureDepth){this.width===A&&this.height===t&&this.textureDepth===e||(this.width=A,this.height=t,this.textureDepth=e,this.viewportValue.set(0,0,A,t),this.scissorValue.set(0,0,A,t),this.#_t=!0,this.#Wt="",this.#Jt="",this.#Gt&&this.depthTexture&&this.getDepthTexture())}invalidateAttachments(){this.#_t=!0,this.#Wt="",this.#Jt="",this.descriptor=void 0}shareDepthFrom(A){const t=A.depth?A.getDepthTexture():null,e=A.stencil,i=!t||t.width===this.width&&t.height===this.height&&t.sampleCount===this.sampleCount;this.depthTexture===t&&!this.#Gt&&this.depth===!!t&&this.stencil===e&&this.stencilReadOnly===e&&i||(this.depthTexture=t,this.#Gt=!1,this.depth=!!t,this.stencil=e,this.stencilReadOnly=e,this.#Wt="",this.invalidateAttachments())}setColorClearValue(A,t){const e=this.textures.length;if(A<0||A>=e)throw new Error(`Color attachment index ${A} out of bounds (count=${e})`);let i=this.#Kt;if(i){if(i.length<e)for(let s=i.length;s<e;s++)i.push(null)}else i=new Array(e).fill(null),this.#Kt=i;i[A]=t}setViewport(A,t,e,i,s=0,n=1){const r=this.viewportValue;r.set(A,t,e,i),r.minDepth=s,r.maxDepth=n,this.viewport&&this.passEncoder&&this.passEncoder.setViewport(A,t,e,i,s,n)}setScissor(A,t,e,i){this.scissorValue.set(A,t,e,i),this.scissor&&this.passEncoder&&this.passEncoder.setScissorRect(A,t,e,i)}syncAttachmentLoadOps(){const A=this.descriptor;if(null==A)return;const t=this.clearColor?K.Clear:K.Load,e=A.colorAttachments;if(e)for(let s=0,n=e.length;s<n;s++){const A=e[s];A&&(A.loadOp=t,A.resolveTarget&&(A.storeOp=this.keepMsaaColor||this.isCanvasRender?H.Store:H.Discard))}const i=A.depthStencilAttachment;null!=i&&(this.depth&&null!=i.depthLoadOp&&(i.depthLoadOp=this.clearDepth?K.Clear:K.Load),this.stencil&&void 0!==i.stencilLoadOp&&(i.stencilLoadOp=this.clearStencil?K.Clear:K.Load))}dispose(){for(let A=0;A<this.textures.length;A++)this.textures[A]?.destroy?.();this.#Gt&&this.depthTexture?.destroy(),this.depthTexture=null,this.textures.length=0,this.#Ht=null,this.#Yt=null,this.#Jt="",this.#Wt="",this.#qt.clear(),this.passEncoder=null,this.encoder=null,this.canvasContext?.unconfigure(),this.canvasContext=null}}const qn=W.RGBA16Float;class Xn extends Rn{type="PostProcess";colorBinding;exposureBinding;toneMappingBinding;paramsBinding;constructor(){super(),this.colorBinding=new qt("color",null),this.exposureBinding=new zt("exposure",1,"f32",{access:"Uniform"}),this.toneMappingBinding=new zt("toneMapping",4,"u32",{access:"Uniform"}),this.paramsBinding=new Xt("post",[this.exposureBinding,this.toneMappingBinding],{access:"Uniform",mode:"struct"}),this.addBinding(this.colorBinding),this.addBinding(this.paramsBinding)}attach(A){this.colorBinding.setValue(A)}sync(A,t){this.exposureBinding.setValue(A.exposure),this.toneMappingBinding.setValue(0|A.toneMapping);const e=this.paramsBinding;e.isDirty=!0,e.updateCPUBuffer(),e.updateGPUBuffer(t),this.colorBinding.updateGPUBuffer(t)}}class Zn extends Rn{type="BloomFilter";colorBinding;thresholdBinding;paramsBinding;constructor(){super(),this.colorBinding=new qt("color",null),this.thresholdBinding=new zt("threshold",1,"f32",{access:"Uniform"}),this.paramsBinding=new Xt("post",[this.thresholdBinding],{access:"Uniform",mode:"struct"}),this.addBinding(this.colorBinding),this.addBinding(this.paramsBinding)}attach(A){this.colorBinding.setValue(A)}sync(A,t){this.thresholdBinding.setValue(t);const e=this.paramsBinding;e.isDirty=!0,e.updateCPUBuffer(),e.updateGPUBuffer(A),this.colorBinding.updateGPUBuffer(A)}}class _n extends Rn{type="BloomUpsample";colorBinding;currentBinding;constructor(){super(),this.colorBinding=new qt("color",null),this.currentBinding=new qt("current",null),this.addBinding(this.colorBinding),this.addBinding(this.currentBinding)}attach(A,t){this.colorBinding.setValue(A),this.currentBinding.setValue(t)}sync(A){this.colorBinding.updateGPUBuffer(A),this.currentBinding.updateGPUBuffer(A)}}class $n extends Rn{type="BloomComposite";colorBinding;bloomBinding;samplerBinding;exposureBinding;toneMappingBinding;bloomStrengthBinding;paramsBinding;constructor(A){super(),this.colorBinding=new qt("color",null),this.bloomBinding=new qt("bloom",null),this.samplerBinding=new Wt("bloomSampler",A),this.exposureBinding=new zt("exposure",1,"f32",{access:"Uniform"}),this.toneMappingBinding=new zt("toneMapping",4,"u32",{access:"Uniform"}),this.bloomStrengthBinding=new zt("bloomStrength",.8,"f32",{access:"Uniform"}),this.paramsBinding=new Xt("post",[this.exposureBinding,this.toneMappingBinding,this.bloomStrengthBinding],{access:"Uniform",mode:"struct"}),this.addBinding(this.colorBinding),this.addBinding(this.bloomBinding),this.addBinding(this.samplerBinding),this.addBinding(this.paramsBinding)}attach(A,t){this.colorBinding.setValue(A),this.bloomBinding.setValue(t)}sync(A,t){this.exposureBinding.setValue(A.exposure),this.toneMappingBinding.setValue(0|A.toneMapping),this.bloomStrengthBinding.setValue(A.bloomStrength);const e=this.paramsBinding;e.isDirty=!0,e.updateCPUBuffer(),e.updateGPUBuffer(t),this.colorBinding.updateGPUBuffer(t),this.bloomBinding.updateGPUBuffer(t)}}class Ar{sceneRC=null;node=new Xn;bloomSampler=new rt({magFilter:X.Linear,minFilter:X.Linear,mipmapFilter:X.Nearest,wrapS:q.ClampToEdge,wrapT:q.ClampToEdge,wrapR:q.ClampToEdge});filterNode;upsampleNode;compositeNode;colorTex=null;sampleColor=null;blitBg=null;blitBgToken=null;bloomLevels=[];bloomUpLevels=[];bloomKey=null;compositeBg=null;compositeBgToken=null;#ee=!1;#ie=!1;#se=!1;#ne=!1;#re=null;#ae="";#oe=null;#le=null;#ce=null;#he="";#ue=new Map;#ge=new Map;constructor(){this.filterNode=new Zn,this.upsampleNode=new _n,this.compositeNode=new $n(this.bloomSampler)}prepare(A,t){const e=Math.max(1,0|t.width),i=Math.max(1,0|t.height),s=t.sampleCount>1?4:1;let n=this.sceneRC;if(n){const A=n.width!==e||n.height!==i,t=n.sampleCount!==s;A&&n.setSize(e,i),t&&(n.sampleCount=s,n.invalidateAttachments()),(A||t||!this.colorTex)&&this.#de(n,e,i,s)}else n=new Wn(A,{name:"post-scene",format:qn,count:1,width:e,height:i,sampleCount:s,depth:!0,stencil:t.stencil,clearColor:t.clearColor,clearColorValue:t.clearColorValue,clearDepth:t.clearDepth,clearStencil:t.clearStencil}),n.manualColorAttachments=!0,this.sceneRC=n,this.#de(n,e,i,s);if(n.depthReadOnly=!1,n.clearColor=t.clearColor,n.clearColorValue=t.clearColorValue,n.clearDepth=t.clearDepth,n.clearStencil=t.clearStencil,n.keepMsaaColor=t.keepMsaaColor,n.shareDepthFrom(t),n.depthReadOnly=!1,n.viewport=t.viewport,n.scissor=t.scissor,t.viewport){const A=t.viewportValue;n.setViewport(A.x,A.y,A.z,A.w,A.minDepth??0,A.maxDepth??1)}if(t.scissor){const A=t.scissorValue;n.setScissor(A.x,A.y,A.z,A.w)}return n.syncAttachmentLoadOps(),this.node.attach(this.sampleColor),n}blit(A,t,e,i){const s=this.sampleColor;s&&this.#pe(A,t.getCompositeColorAttachment(),e,i,s)}blitTo(A,t,e,i){const s=this.sampleColor;s&&this.#pe(A,t,e,i,s)}get colorSample(){return this.sampleColor}#pe(A,t,e,i,s){!function(A){return!0===A.bloom&&A.bloomStrength>0}(i)?this.#fe(A,t,e,i,s):this.#me(A,t,e,i,s)}finishIfOpen(){const A=this.sceneRC;A?.passEncoder&&A.finish()}dispose(){this.#Ce(),this.colorTex?.resolveTargetTexture?.destroy(),this.colorTex=null,this.sampleColor=null,this.blitBg=null,this.blitBgToken=null,this.sceneRC?.dispose(),this.sceneRC=null}#fe(A,t,e,i,s){const n=e.device;this.node.attach(s),this.node.sync(i,n),this.#we(e);const r=`${t.format}|s${t.sampleCount}`;let a=this.#re;a&&this.#ae===r||(a=e.createFullscreen(4,t.format,t.sampleCount),this.#re=a,this.#ae=r);const o=`${s.id}|${s.width}x${s.height}|${s.format}`;let l=this.blitBg;l&&this.blitBgToken===o||(l=e.createSystemBindGroup(4,this.node),this.blitBg=l,this.blitBgToken=o);const c=A.beginRenderPass({label:"PostProcess",colorAttachments:[{view:t.view,...t.resolveTarget?{resolveTarget:t.resolveTarget}:{},loadOp:"clear",storeOp:"store",clearValue:{r:0,g:0,b:0,a:1}}]});c.setPipeline(a),c.setBindGroup(0,e.getEmptyBG()),c.setBindGroup(1,l),c.draw(3),c.end()}#me(A,t,e,i,s){const n=e.device;this.#ye(n,s.width,s.height);const r=this.bloomLevels;if(r.length<3)return;this.filterNode.attach(s),this.#Be(e);let a=this.#oe;a||(a=e.createFullscreen(5,qn,1),this.#oe=a),this.upsampleNode.attach(r[r.length-1],r[r.length-2]),this.#Ie(e);let o=this.#le;o||(o=e.createFullscreen(6,qn,1),this.#le=o);const l=e.getEmptyBG();this.#Qe(A,e,a,l,s,r[0],i.bloomThreshold,"BloomExtract");for(let m=0;m<r.length-1;m++)this.#Qe(A,e,a,l,r[m],r[m+1],0,"BloomDown");let c=r[r.length-1];for(let m=r.length-1;m>1;m--){const t=this.bloomUpLevels[m-1];t&&(this.#Ee(A,e,o,l,c,r[m-1],t),c=t)}const h=this.bloomUpLevels[1];if(!h)return;this.compositeNode.attach(s,h),this.compositeNode.sync(i,n),this.#xe(e);const u=`${t.format}|s${t.sampleCount}`;let g=this.#ce;g&&this.#he===u||(g=e.createFullscreen(7,t.format,t.sampleCount),this.#ce=g,this.#he=u);const d=`${s.id}|${h.id}|${s.width}x${s.height}`;let p=this.compositeBg;p&&this.compositeBgToken===d||(p=e.createSystemBindGroup(7,this.compositeNode),this.compositeBg=p,this.compositeBgToken=d);const f=A.beginRenderPass({label:"BloomComposite",colorAttachments:[{view:t.view,...t.resolveTarget?{resolveTarget:t.resolveTarget}:{},loadOp:"clear",storeOp:"store",clearValue:{r:0,g:0,b:0,a:1}}]});f.setPipeline(g),f.setBindGroup(0,l),f.setBindGroup(1,p),f.draw(3),f.end()}#Qe(A,t,e,i,s,n,r,a){this.filterNode.attach(s),this.filterNode.sync(t.device,r);const o=`${s.id}|${s.width}x${s.height}|${s.format}`;let l=this.#ue.get(o);l||(l=t.createSystemBindGroup(5,this.filterNode),this.#ue.set(o,l));const c=A.beginRenderPass({label:a,colorAttachments:[{view:n.createView(t.device),loadOp:"clear",storeOp:"store",clearValue:{r:0,g:0,b:0,a:0}}]});c.setPipeline(e),c.setBindGroup(0,i),c.setBindGroup(1,l),c.draw(3),c.end()}#Ee(A,t,e,i,s,n,r){this.upsampleNode.attach(s,n),this.upsampleNode.sync(t.device);const a=`${s.id}|${n.id}|${s.width}x${s.height}|${s.format}|${n.width}x${n.height}|${n.format}`;let o=this.#ge.get(a);o||(o=t.createSystemBindGroup(6,this.upsampleNode),this.#ge.set(a,o));const l=A.beginRenderPass({label:"BloomUp",colorAttachments:[{view:r.createView(t.device),loadOp:"clear",storeOp:"store",clearValue:{r:0,g:0,b:0,a:0}}]});l.setPipeline(e),l.setBindGroup(0,i),l.setBindGroup(1,o),l.draw(3),l.end()}#we(A){this.#ee||(A.registerFullscreenKind({material:this.node,entryWgsl:"\nfn saturate3(c: vec3f) -> vec3f {\n return clamp(c, vec3f(0.0), vec3f(1.0));\n}\n\nfn reinhard(c: vec3f) -> vec3f {\n return c / (c + vec3f(1.0));\n}\n\nfn cineon(color: vec3f) -> vec3f {\n let x = max(vec3f(0.0), color - vec3f(0.004));\n return saturate3((x * (6.2 * x + 0.5)) / (x * (6.2 * x + 1.7) + 0.06));\n}\n\nfn acesFilmic(x: vec3f) -> vec3f {\n let a = 2.51;\n let b = 0.03;\n let c = 2.43;\n let d = 0.59;\n let e = 0.14;\n return saturate3((x * (a * x + b)) / (x * (c * x + d) + e));\n}\n\nfn agx(color: vec3f) -> vec3f {\n let min_ev = -12.47393;\n let max_ev = 4.026069;\n var c = max(color, vec3f(0.0));\n c = log2(c + vec3f(1e-6));\n c = clamp((c - min_ev) / (max_ev - min_ev), vec3f(0.0), vec3f(1.0));\n let x2 = c * c;\n let x4 = x2 * x2;\n return saturate3(15.5 * x4 * x2 - 40.14 * x4 * c + 31.96 * x4 - 6.868 * x2 * c + 0.4298 * x2 + 0.00232 * c);\n}\n\nfn pbrNeutral(color: vec3f) -> vec3f {\n let startCompression = 0.8 - 0.04;\n let desaturation = 0.15;\n let x = min(color.r, min(color.g, color.b));\n let offset = select(0.04, x - 6.25 * x * x, x < 0.08);\n var c = color - vec3f(offset);\n let peak = max(c.r, max(c.g, c.b));\n if (peak < startCompression) {\n return c;\n }\n let d = 1.0 - startCompression;\n let newPeak = 1.0 - d * d / (peak + d - startCompression);\n c = c * (newPeak / peak);\n let g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0);\n return mix(c, vec3f(newPeak), g);\n}\n\n@fragment fn fragmentMain(@builtin(position) pos: vec4f) -> @location(0) vec4f {\n let ip = vec2i(pos.xy);\n let src = textureLoad(color, ip, 0);\n var c = src.rgb * post.exposure;\n let mode = post.toneMapping;\n if (mode == 2u) {\n c = reinhard(c);\n } else if (mode == 3u) {\n c = cineon(c);\n } else if (mode == 4u) {\n c = acesFilmic(c);\n } else if (mode == 6u) {\n c = agx(c);\n } else if (mode == 7u) {\n c = pbrNeutral(c);\n } else {\n c = saturate3(c);\n }\n return vec4f(c, src.a);\n}\n",reservedId:4}),this.#ee=!0)}#Be(A){this.#ie||(A.registerFullscreenKind({material:this.filterNode,entryWgsl:"\nfn loadPx(p: vec2i) -> vec4f {\n let s = vec2i(textureDimensions(color));\n let q = clamp(p, vec2i(0), max(s - vec2i(1), vec2i(0)));\n return textureLoad(color, q, 0);\n}\n\nfn sampleAt(srcPos: vec2f) -> vec4f {\n let p = srcPos - vec2f(0.5);\n let i = vec2i(floor(p));\n let f = fract(p);\n let a = loadPx(i);\n let b = loadPx(i + vec2i(1, 0));\n let c = loadPx(i + vec2i(0, 1));\n let d = loadPx(i + vec2i(1, 1));\n return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);\n}\n\n@fragment fn fragmentMain(@builtin(position) pos: vec4f) -> @location(0) vec4f {\n let p = pos.xy * 2.0;\n var value = sampleAt(p) * 0.125;\n value += (sampleAt(p + vec2f(-2.0, 2.0)) + sampleAt(p + vec2f(2.0, 2.0))\n + sampleAt(p + vec2f(-2.0, -2.0)) + sampleAt(p + vec2f(2.0, -2.0))) * 0.03125;\n value += (sampleAt(p + vec2f(0.0, 2.0)) + sampleAt(p + vec2f(-2.0, 0.0))\n + sampleAt(p + vec2f(2.0, 0.0)) + sampleAt(p + vec2f(0.0, -2.0))) * 0.0625;\n value += (sampleAt(p + vec2f(-1.0, 1.0)) + sampleAt(p + vec2f(1.0, 1.0))\n + sampleAt(p + vec2f(-1.0, -1.0)) + sampleAt(p + vec2f(1.0, -1.0))) * 0.125;\n let c = value.rgb;\n let knee = post.threshold;\n if (knee <= 0.0) {\n return vec4f(c, 1.0);\n }\n let lum = dot(c, vec3f(0.2126, 0.7152, 0.0722));\n let w = smoothstep(max(knee * 0.5, 0.0), knee + 4.0, lum);\n return vec4f(c * w, 1.0);\n}\n",sampleCountFixed:1,reservedId:5}),this.#ie=!0)}#Ie(A){this.#se||(A.registerFullscreenKind({material:this.upsampleNode,entryWgsl:"\nfn loadPx(p: vec2i) -> vec4f {\n let s = vec2i(textureDimensions(color));\n let q = clamp(p, vec2i(0), max(s - vec2i(1), vec2i(0)));\n return textureLoad(color, q, 0);\n}\n\nfn loadCur(p: vec2i) -> vec4f {\n let s = vec2i(textureDimensions(current));\n let q = clamp(p, vec2i(0), max(s - vec2i(1), vec2i(0)));\n return textureLoad(current, q, 0);\n}\n\nfn sampleAt(srcPos: vec2f) -> vec4f {\n let p = srcPos - vec2f(0.5);\n let i = vec2i(floor(p));\n let f = fract(p);\n let a = loadPx(i);\n let b = loadPx(i + vec2i(1, 0));\n let c = loadPx(i + vec2i(0, 1));\n let d = loadPx(i + vec2i(1, 1));\n return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);\n}\n\n@fragment fn fragmentMain(@builtin(position) pos: vec4f) -> @location(0) vec4f {\n let p = pos.xy * 0.5;\n var value = sampleAt(p) * 0.25;\n value += (sampleAt(p + vec2f(0.0, 1.0)) + sampleAt(p + vec2f(-1.0, 0.0))\n + sampleAt(p + vec2f(1.0, 0.0)) + sampleAt(p + vec2f(0.0, -1.0))) * 0.125;\n value += (sampleAt(p + vec2f(-1.0, 1.0)) + sampleAt(p + vec2f(1.0, 1.0))\n + sampleAt(p + vec2f(-1.0, -1.0)) + sampleAt(p + vec2f(1.0, -1.0))) * 0.0625;\n return value + loadCur(vec2i(pos.xy));\n}\n",sampleCountFixed:1,reservedId:6}),this.#se=!0)}#xe(A){this.#ne||(A.registerFullscreenKind({material:this.compositeNode,entryWgsl:"\nfn saturate3(c: vec3f) -> vec3f {\n return clamp(c, vec3f(0.0), vec3f(1.0));\n}\n\nfn reinhard(c: vec3f) -> vec3f {\n return c / (c + vec3f(1.0));\n}\n\nfn cineon(color: vec3f) -> vec3f {\n let x = max(vec3f(0.0), color - vec3f(0.004));\n return saturate3((x * (6.2 * x + 0.5)) / (x * (6.2 * x + 1.7) + 0.06));\n}\n\nfn acesFilmic(x: vec3f) -> vec3f {\n let a = 2.51;\n let b = 0.03;\n let c = 2.43;\n let d = 0.59;\n let e = 0.14;\n return saturate3((x * (a * x + b)) / (x * (c * x + d) + e));\n}\n\nfn agx(color: vec3f) -> vec3f {\n let min_ev = -12.47393;\n let max_ev = 4.026069;\n var c = max(color, vec3f(0.0));\n c = log2(c + vec3f(1e-6));\n c = clamp((c - min_ev) / (max_ev - min_ev), vec3f(0.0), vec3f(1.0));\n let x2 = c * c;\n let x4 = x2 * x2;\n return saturate3(15.5 * x4 * x2 - 40.14 * x4 * c + 31.96 * x4 - 6.868 * x2 * c + 0.4298 * x2 + 0.00232 * c);\n}\n\nfn pbrNeutral(color: vec3f) -> vec3f {\n let startCompression = 0.8 - 0.04;\n let desaturation = 0.15;\n let x = min(color.r, min(color.g, color.b));\n let offset = select(0.04, x - 6.25 * x * x, x < 0.08);\n var c = color - vec3f(offset);\n let peak = max(c.r, max(c.g, c.b));\n if (peak < startCompression) {\n return c;\n }\n let d = 1.0 - startCompression;\n let newPeak = 1.0 - d * d / (peak + d - startCompression);\n c = c * (newPeak / peak);\n let g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0);\n return mix(c, vec3f(newPeak), g);\n}\n\n@fragment fn fragmentMain(@builtin(position) pos: vec4f) -> @location(0) vec4f {\n let ip = vec2i(pos.xy);\n let src = textureLoad(color, ip, 0);\n let uv = pos.xy / vec2f(textureDimensions(color));\n let b = textureSampleLevel(bloom, bloomSampler, uv, 0.0).rgb;\n var c = (src.rgb + b * post.bloomStrength * 0.05) * post.exposure;\n let mode = post.toneMapping;\n if (mode == 2u) {\n c = reinhard(c);\n } else if (mode == 3u) {\n c = cineon(c);\n } else if (mode == 4u) {\n c = acesFilmic(c);\n } else if (mode == 6u) {\n c = agx(c);\n } else if (mode == 7u) {\n c = pbrNeutral(c);\n } else {\n c = saturate3(c);\n }\n return vec4f(c, src.a);\n}\n",reservedId:7}),this.#ne=!0)}#ye(A,t,e){const i=function(A,t){const e=Math.max(Math.min(A,t)>>1,2),i=Math.floor(Math.log2(e));return Math.min(12,Math.max(4,i+1))}(t,e),s=`${t}x${e}x${i}`;if(this.bloomKey!==s||this.bloomLevels.length!==i||this.bloomUpLevels.length!==i){this.#Ce(A);for(let s=0;s<i;s++){const n=Math.max(1,t>>s+1),r=Math.max(1,e>>s+1);this.bloomLevels.push(er(A,n,r)),this.bloomUpLevels.push(s>=1&&s<i-1?er(A,n,r):null)}this.bloomKey=s}}#Ce(A){if(this.#ue.clear(),this.#ge.clear(),this.compositeBg=null,this.compositeBgToken=null,!this.bloomLevels.length&&!this.bloomUpLevels.length)return;const t=this.bloomLevels.slice();for(let e=0;e<this.bloomUpLevels.length;e++){const A=this.bloomUpLevels[e];A&&t.push(A)}if(this.bloomLevels=[],this.bloomUpLevels=[],this.bloomKey=null,A)A.queue.onSubmittedWorkDone().then(()=>{for(let A=0;A<t.length;A++)t[A].destroy()});else for(let e=0;e<t.length;e++)t[e].destroy()}#de(A,t,e,i){this.#Ce(A.device);const s=tr(A.device,t,e,i,qn),n=s.resolveTargetTexture??s;n.isDirty=!1,A.setColorAttachment(0,s,n===s?void 0:n),this.colorTex=s,this.sampleColor=n,A.setColorSlotName(0,"hdr"),A.invalidateAttachments(),this.blitBg=null,this.blitBgToken=null}}function tr(A,t,e,i,s){const n=new pt({width:t,height:e,depth:1},{format:s,sampleCount:i,generateMipmaps:!1,useMipmaps:!1,flipY:!1,minFilter:X.Nearest,magFilter:X.Nearest});n.applyUsageRender(),n.isDirty=!1,n.prepareConfiguration();try{n.createTexture(A)}catch(r){throw n.destroy(),r}if(i>1)try{n.resolveTargetTexture=tr(A,t,e,1,s)}catch(r){throw n.destroy(),r}return n}function er(A,t,e){const i=new pt({width:t,height:e,depth:1},{format:qn,sampleCount:1,generateMipmaps:!1,useMipmaps:!1,flipY:!1,minFilter:X.Linear,magFilter:X.Linear,wrapS:q.ClampToEdge,wrapT:q.ClampToEdge});i.applyUsageRender(),i.isDirty=!1,i.prepareConfiguration();try{i.createTexture(A)}catch(s){throw i.destroy(),s}return i}const ir=W.RGBA16Float,sr=W.R16Float;class nr extends Rn{type="WboitComposite";accumBinding;revealageBinding;constructor(){super(),this.accumBinding=new qt("accum",null),this.revealageBinding=new qt("revealage",null),this.addBinding(this.accumBinding),this.addBinding(this.revealageBinding)}attach(A,t){this.accumBinding.setValue(A),this.revealageBinding.setValue(t)}}class rr{accumRC=null;node=new nr;accumTex=null;revealTex=null;sampleAccum=null;sampleReveal=null;revealFormat=sr;compositeBg=null;compositeBgToken=null;#De=!1;#Me=null;#be="";prepare(A,t){const e=Math.max(1,0|t.width),i=Math.max(1,0|t.height),s=t.sampleCount>1?4:1;let n=this.accumRC;if(n){const A=n.width!==e||n.height!==i,t=n.sampleCount!==s;A&&n.setSize(e,i),t&&(n.sampleCount=s,n.invalidateAttachments()),(A||t||!this.accumTex)&&this.#Se(n,e,i,s)}else n=new Wn(A,{name:"wboit",format:ir,count:2,width:e,height:i,sampleCount:s,depth:!0,depthReadOnly:!0,clearDepth:!1,clearColor:!0,clearColorValue:{r:0,g:0,b:0,a:0},stencil:!1}),n.manualColorAttachments=!0,this.accumRC=n,this.#Se(n,e,i,s);if(n.depthReadOnly=!0,n.clearDepth=!1,n.clearColor=!0,n.shareDepthFrom(t),n.viewport=t.viewport,n.scissor=t.scissor,t.viewport){const A=t.viewportValue;n.setViewport(A.x,A.y,A.z,A.w,A.minDepth??0,A.maxDepth??1)}if(t.scissor){const A=t.scissorValue;n.setScissor(A.x,A.y,A.z,A.w)}return this.node.attach(this.sampleAccum,this.sampleReveal),n}composite(A,t,e){const i=this.sampleAccum,s=this.sampleReveal;if(!i||!s)return;const n=t.getCompositeColorAttachment();this.#ve(e);const r=`${n.format}|s${n.sampleCount}`;let a=this.#Me;a&&this.#be===r||(a=e.createFullscreen(3,n.format,n.sampleCount),this.#Me=a,this.#be=r);const o=`${i.id}|${s.id}|${i.width}x${i.height}|${i.format}|${s.format}`;let l=this.compositeBg;l&&this.compositeBgToken===o||(l=e.createSystemBindGroup(3,this.node),this.compositeBg=l,this.compositeBgToken=o);const c=A.beginRenderPass({label:"WboitComposite",colorAttachments:[{view:n.view,...n.resolveTarget?{resolveTarget:n.resolveTarget}:{},loadOp:"load",storeOp:"store"}]});if(c.setPipeline(a),c.setBindGroup(0,e.getEmptyBG()),c.setBindGroup(1,l),t.viewport){const A=t.viewportValue;c.setViewport(A.x,A.y,A.z,A.w,A.minDepth??0,A.maxDepth??1)}if(t.scissor){const A=t.scissorValue;c.setScissorRect(A.x,A.y,A.z,A.w)}c.draw(3),c.end()}finishIfOpen(){const A=this.accumRC;A?.passEncoder&&A.finish()}dispose(){this.accumTex?.resolveTargetTexture?.destroy(),this.revealTex?.resolveTargetTexture?.destroy(),this.accumTex=null,this.revealTex=null,this.sampleAccum=null,this.sampleReveal=null,this.compositeBg=null,this.compositeBgToken=null,this.#De=!1,this.#Me=null,this.#be="",this.accumRC?.dispose(),this.accumRC=null}#ve(A){this.#De||(A.registerFullscreenKind({material:this.node,entryWgsl:"\n@fragment fn fragmentMain(@builtin(position) pos: vec4f) -> @location(0) vec4f {\n let ip = vec2i(pos.xy);\n let a = textureLoad(accum, ip, 0);\n let r = textureLoad(revealage, ip, 0).r;\n let alpha = 1.0 - r;\n let avg = a.rgb / max(a.a, 1e-5);\n return vec4f(avg * alpha, alpha);\n}\n",blend:{color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}},reservedId:3}),this.#De=!0)}#Se(A,t,e,i){const s=A.device,n=ar(s,t,e,i,ir);let r;try{r=ar(s,t,e,i,this.revealFormat)}catch{this.revealFormat=ir,r=ar(s,t,e,i,ir)}const a=n.resolveTargetTexture??n,o=r.resolveTargetTexture??r;a.isDirty=!1,o.isDirty=!1,A.setColorAttachment(0,n,a===n?void 0:a),A.setColorAttachment(1,r,o===r?void 0:o),this.accumTex=n,this.revealTex=r,this.sampleAccum=a,this.sampleReveal=o,A.setColorClearValue(0,{r:0,g:0,b:0,a:0}),A.setColorClearValue(1,{r:1,g:1,b:1,a:1}),A.setColorSlotName(0,"accum"),A.setColorSlotName(1,"revealage"),A.invalidateAttachments(),this.compositeBg=null,this.compositeBgToken=null}}function ar(A,t,e,i,s){const n=new pt({width:t,height:e,depth:1},{format:s,sampleCount:i,generateMipmaps:!1,useMipmaps:!1,flipY:!1,minFilter:X.Nearest,magFilter:X.Nearest});n.applyUsageRender(),n.isDirty=!1,n.prepareConfiguration();try{n.createTexture(A)}catch(r){throw n.destroy(),r}if(i>1)try{n.resolveTargetTexture=ar(A,t,e,1,s)}catch(r){throw n.destroy(),r}return n}class or{post=null;wboitReplaced=!1;ownedWboit=!1;hasRegistered=!1;needsHdr=!1;hasAfterShadow=!1;hasAfterOpaque=!1;hasAfterTransparent=!1;hasPresentUser=!1;hasAfterPresent=!1;frameDrawRC=null;frameSawTransparent=!1;#Te=null;#Ue=null;#Ne=null;#Pe=new Nn;#Oe=new Nn;#Fe=new Nn;#ke=new Nn;#Re=new Nn;#Le={};#je=null;#ze=null;#Ge=null;#Ye=[];#He=[null,null];#Ke="";get transparentPass(){return this.#Te}setPost(A){const t=A?.isPostProcessing?A:null;t!==this.post&&(this.post=t,t||this.needsHdr||this.#Ve())}setTransparentPass(A){A!==this.#Te&&(this.#Te?.dispose(),this.#Te=A,this.wboitReplaced=null!=A,this.ownedWboit=!1)}use(A,t,e,i){const s=this.#Je(A.slot);if(!s)throw new Error(`WebGPURenderer.use: 未知槽 ${A.slot}`);const n=s.add(A);this.hasRegistered=!0,n&&i&&e&&A.onAttach?.(e,t),this.refresh()}remove(A){const t=this.#Je(A.slot);return!(!t||!t.remove(A)||(A.onDetach?.(),this.hasRegistered=!(this.#Pe.empty&&this.#Oe.empty&&this.#Fe.empty&&this.#ke.empty&&this.#Re.empty),this.refresh(),this.post||this.needsHdr||this.#Ve(),0))}refresh(){const A=this.#ke.hasActive();this.hasAfterShadow=this.#Pe.hasActive(),this.hasAfterOpaque=this.#Oe.hasActive(),this.hasAfterTransparent=this.#Fe.hasActive(),this.hasPresentUser=A,this.hasAfterPresent=this.#Re.hasActive(),this.needsHdr=A||this.#Pe.needsHdr()||this.#Oe.needsHdr()||this.#Fe.needsHdr()||this.#Re.needsHdr()}rebind(A,t){if(!this.hasRegistered)return;const e=e=>{e.onDetach?.(),e.onAttach?.(A,t)};this.#Pe.forEach(e),this.#Oe.forEach(e),this.#Fe.forEach(e),this.#ke.forEach(e),this.#Re.forEach(e)}releaseHdrIfIdle(A){A||this.needsHdr||!this.#Ue||this.#Ve()}capture(A,t,e){this.#je=A,this.#ze=t,this.#Ge=e}prepare(A,t){return(this.#Ue??=new Ar).prepare(A,t)}runAfterShadow(A,t,e,i){this.#We(A,t,e,i)&&this.#Pe.run(this.#Le)}runAfterOpaque(A,t,e,i,s){this.#We(A,t,e,i)&&(this.#Le.coverMsaa=s,this.#Oe.run(this.#Le))}prepareTransparent(A,t){const e=this.#Te??=new rr;return this.wboitReplaced||(this.ownedWboit=!0),e.prepare(A,t)}compositeTransparent(A,t,e){this.#Te.composite(A,t,e)}runAfterTransparent(A,t,e,i){this.#We(A,t,e,i)&&this.#Fe.run(this.#Le)}dropIdleTransparent(){this.#Te?.dispose(),this.#Te=null,this.ownedWboit=!1}finishTransparentIfOpen(){this.#Te?.finishIfOpen()}finishPostIfOpen(){this.#Ue?.finishIfOpen()}present(A,t,e,i,s,n,r){!this.hasPresentUser&&e?(this.#Ue??=new Ar).blit(A,t,r,e):(this.needsHdr||this.hasPresentUser)&&this.#qe(A,t,e,s,n,r),this.hasAfterPresent&&this.#We(A,i,n,r)&&this.#Re.run(this.#Le)}presentArray(A,t,e,i,s,n,r){if(!this.hasRegistered&&this.post&&t.isCanvasRender){const e=this.#Ue??=new Ar;return e.prepare(s,t),void e.blit(A,t,n,this.post)}if(!t.isCanvasRender||!this.hasRegistered)return;this.#je=e,this.#ze=i,this.#Ge=t;const a=this.frameDrawRC??t,o=0|t.width,l=0|t.height;a.setViewport(0,0,o,l),a.setScissor(0,0,o,l),a!==t&&(t.setViewport(0,0,o,l),t.setScissor(0,0,o,l)),this.hasAfterOpaque&&this.runAfterOpaque(A,a,s,n,!1),this.hasAfterTransparent&&this.frameSawTransparent&&this.runAfterTransparent(A,a,s,n),this.present(A,t,this.post,a,r,s,n)}detach(){if(!this.hasRegistered)return;const A=A=>{try{A.detachAll()}catch(t){console.error("[WebGPURenderer] plugin onDetach",t)}};A(this.#Pe),A(this.#Oe),A(this.#Fe),A(this.#ke),A(this.#Re),this.hasRegistered=!1,this.hasAfterShadow=!1,this.hasAfterOpaque=!1,this.hasAfterTransparent=!1,this.hasPresentUser=!1,this.hasAfterPresent=!1,this.needsHdr=!1}disposeTargets(A,t){this.#Te?.dispose(),this.wboitReplaced||(this.#Te=null),this.ownedWboit=!1,this.#Ue?.dispose(),this.#Ue=null,this.#Xe(A,t)}#Ve(){this.#Ue?.dispose(),this.#Ue=null}#Je(A){return A===Un.AfterShadow?this.#Pe:A===Un.AfterOpaque?this.#Oe:A===Un.AfterTransparent?this.#Fe:A===Un.Present?this.#ke:A===Un.AfterPresent?this.#Re:null}#We(A,t,e,i){const s=this.#je,n=this.#ze;if(!s||!n)return!1;const r=this.#Le,a=this.#Ge??t;return r.encoder=A,r.device=e,r.cache=i,r.scene=s,r.camera=n,r.sceneRC=t,r.presentRC=a,r.color=this.#Ue?.colorSample??null,r.depth=t.depthTexture,r.colorIn=r.color,r.colorOut=null,r.isLastPresent=!1,r.coverMsaa=!1,!0}#qe(A,t,e,i,s,n){const r=this.#Ue,a=this.#Ye;this.#ke.collectActive(a);const o=a.length;if(0===o)return void(e?(this.#Ue??=new Ar).blit(A,t,n,e):this.needsHdr&&r&&r.blit(A,t,n,this.#Ne??=new Pn));const l=r?.colorSample;if(!l)return;if(!this.#We(A,i??t,s,n))return;const c=this.#Le;let h=e;if(!h)for(let f=0;f<o;f++)if(a[f].needsTonemap){h=this.#Ne??=new Pn;break}if(1===o&&!h)return c.colorIn=l,c.colorOut=t.getCompositeColorAttachment(),c.isLastPresent=!0,void a[0].execute(c);const u=l.width,g=l.height;let d=l,p=0;if(h){const t=this.#Ze(s,0,u,g);r.blitTo(A,this.#_e(s,t),n,h),d=t,p=1}for(let f=0;f<o;f++){const A=f===o-1;if(c.colorIn=d,A)c.colorOut=t.getCompositeColorAttachment(),c.isLastPresent=!0;else{const A=this.#Ze(s,p,u,g);c.colorOut=this.#_e(s,A),c.isLastPresent=!1,d=A,p^=1}a[f].execute(c)}}#_e(A,t){return{view:t.createView(A),format:t.format,sampleCount:1}}#Ze(A,t,e,i){const s=`${e}x${i}`;this.#Ke!==s&&(this.#Xe(A,!1),this.#Ke=s);let n=this.#He[t];return n||(n=function(A,t,e){const i=new pt({width:t,height:e,depth:1},{format:W.RGBA16Float,sampleCount:1,generateMipmaps:!1,useMipmaps:!1,flipY:!1,minFilter:X.Linear,magFilter:X.Linear,wrapS:q.ClampToEdge,wrapT:q.ClampToEdge});i.applyUsageRender(),i.isDirty=!1,i.prepareConfiguration();try{i.createTexture(A)}catch(s){throw i.destroy(),s}return i}(A,e,i),this.#He[t]=n),n}#Xe(A,t){const e=this.#He[0],i=this.#He[1];if(this.#He[0]=null,this.#He[1]=null,this.#Ke="",!e&&!i)return;const s=()=>{e?.destroy(),i?.destroy()};A&&!t?A.queue.onSubmittedWorkDone().then(s,s):s()}}class lr{constructor(A){this.renderObjects=A}#$e=[];#tA=null;#Ai=new Map;#ti=new Set;#ei=null;#ii;#si;#ni;#ri;#ai;#oi;bind(A){this.#ii=A.device,this.#si=A.pipelineCache,this.#ni=A.worldStore,this.#ri=A.geometryTables,this.#ai=A.materialTables,this.#oi=A.textureTables,A.pipelineCache.setVariantHooks({ready:A=>this.#xt(A)})}sync(A,t,e,i,s,n,r,a,o,l){let c=performance.now();this.syncRemoved(A),a.drainDeferredFrees();let h=performance.now();o.syncRemoved+=h-c,c=h,this.#ri.beginFrame(),this.#oi.beginFrame(),this.#ai.beginFrame(),h=performance.now(),o.geometryBeginFrame+=h-c,c=h,this.syncAdded(t,r),h=performance.now(),o.syncAdded+=h-c,c=h,this.syncStructure(e,r),h=performance.now(),o.syncStructure+=h-c,c=h,this.#ai.noteDirtyTextures(n),this.syncPipeline(i,r),h=performance.now(),o.syncPipeline+=h-c,l.prepareStart=h,this.syncVisible(s),h=performance.now(),o.prepareSyncDirty+=h-l.prepareStart,l.cursor=h}syncRemoved(A){for(let t=0,e=A.length;t<e;t++)this.deactivateMesh(A[t])}syncAdded(A,t){for(let e=0,i=A.length;e<i;e++)this.#li(A[e],t)}syncStructure(A,t){const e=this.renderObjects;for(let i=0,s=A.length;i<s;i++){const s=A[i];e.getBucketForMesh(s)&&(this.#ci(s,t,f.DIRTY_STRUCTURE)||(this.deactivateMesh(s),this.#li(s,t)))}}syncPipeline(A,t){const e=A.length;if(0===e)return;const i=this.renderObjects,s=this.#si,n=this.#ni.instanceMeta,r=this.#ii,a=this.#$e;a.length=0;for(let o=0;o<e;o++){const e=A[o],l=e.material,c=i.getMemberForMesh(e),h=e.geometry;if(!c||!l||!h){l&&this.#hi(l,!1,r,a);continue}if(this.#ci(e,t,f.DIRTY_PIPELINE)){this.#hi(l,!!c.batch.bucket.materialTable,r,a);continue}const u=c.batch.bucket,g=!!u.materialTable,d=i.getOrCreateForMesh(e,l,h,t,u.materialTable),p=cn.ALIVE|(e.visible?cn.VISIBLE:0);if(d!==u&&i.releaseDrawMember(c)){0===u.memberCount&&(s.releaseVariant(u.variant),s.releaseVariant(u.altVariant),u.variant=null,u.altVariant=null,i.release(u));const A=i.addMember(d,e,l,h),t=d.hasMorph||u.hasMorph?4294967295:n.cpuView[4*e.poolIndex+1];n.write4(e.poolIndex,h.boundIndex,t,hn(p,A.batch.batchId),gn(i.getSkinSid(A),this.#ui(e.clipSetId))),d.variant??=s.requestVariant(d)}else n.writeFlags(e.poolIndex,gn(i.getSkinSid(c),this.#ui(e.clipSetId)));this.#hi(l,g,r,a)}a.length>0&&(this.#ai.uploadDirtyMaterials(a),a.length=0)}syncVisible(A){const t=this.renderObjects,e=this.#ni.instanceMeta;for(let i=0,s=A.length;i<s;i++){const s=A[i];t.getBucketForMesh(s)&&e.writeVisible(s.poolIndex,s.visible)}}deactivateMesh(A){this.#Ai.delete(A);const t=this.renderObjects.getMemberForMesh(A);t&&this.#gi(t)}#hi(A,t,e,i){const s=f.DIRTY_PIPELINE,n=f.DIRTY_DATA;if(!(A.dirtyTypes&s))return;if(A.dirtyTypes&=~s,!(A.dirtyTypes&n))return;const r=t||A.isSupportFamily;this.renderObjects.hasLegacyMaterial(A)?A.update(e,this.#ai):r||A.update(e),r&&i.push(A)}#ci(A,t,e){this.#ei=t;const i=this.#di(A,t);if(!i)return!1;const s=this.#si,{key:n,old:r}=i;if(s.hasVariantKey(n))return this.#Ai.delete(A),!1;if(s.isVariantFailed(n))return this.#Ai.delete(A),this.#pi(A.material),!0;this.#fi(r);const a=this.#Ai.get(A);if(a&&a.inflightKey!==n&&s.isVariantInflight(a.inflightKey))return a.flag=e,!0;const o=A.material;return o&&this.#mi(o)?(s.isVariantInflight(n)||s.warmVariant(this.#tA),this.#ti.add(n),this.#Ai.set(A,{flag:e,inflightKey:n}),!0):(this.#Ai.delete(A),!0)}#xt(A){if(!this.#ti.delete(A))return;if(0===this.#Ai.size)return void this.#si.dropUnreferenced(A);const t=this.#ei;if(!t)return void this.#si.dropUnreferenced(A);const e=this.#si;let i=!1;for(const[s,n]of this.#Ai){const r=this.#di(s,t);if(!r){this.#Ai.delete(s),this.#pi(s.material);continue}const{key:a,old:o}=r;if(e.hasVariantKey(a)){this.#Ai.delete(s),a===A&&(i=!0),this.#Ci(s,n.flag);continue}if(e.isVariantFailed(a)){this.#Ai.delete(s),this.#pi(s.material);continue}if(e.isVariantInflight(n.inflightKey)&&n.inflightKey!==a){this.#fi(o);continue}const l=s.material;l&&this.#mi(l)?(e.isVariantInflight(a)||e.warmVariant(this.#tA),this.#ti.add(a),n.inflightKey=a,this.#fi(o)):(this.#Ai.delete(s),this.#pi(l))}i||e.dropUnreferenced(A)}#pi(A){if(A){for(const t of this.#Ai.keys())if(t.material===A)return;this.#ai.abandonPrepared(A.id)}}#Ci(A,t){const e=A.dirtySystem;e&&(A.dirtyTypes[0]|=t,e.add(A))}#di(A,t){const e=this.renderObjects.getMemberForMesh(A),i=A.material,s=A.geometry;if(!e||!i||!s)return null;const n=e.batch.bucket,r=this.#wi(t);return this.renderObjects.paintVariantScratch(r,A,i,s,t,n.materialTable),{key:this.#si.variantKey(r),old:n}}#mi(A){const t=this.#tA;if(!t||"indirect"!==t.drawKind||!A.isSupportFamily)return!0;const e=this.#ai.preparePool(A);return!!e&&(t.materialTable=e,t.sourceMaterial=A,t.repMaterial=null,!0)}#fi(A){if(A.materialTable)return;const t=A.materialBindingProvider,e=A.variant;t&&e&&this.renderObjects.holdMaterialBindGroup(t,e.materialBGL)}#wi(A){let t=this.#tA;return t||(t=this.#tA=new En(A)),t}#ui(A){return A<0?-1:this.#ni.clipPlaneMeta.heap.getOffset(A)}#li(A,t){const e=A.geometry,i=A.material;if(!e||!i)return;e.switchStore(this.#ni),e.boundingBox||e.computeBoundingBox();const s=this.renderObjects,n=s.getMemberAtPoolIndex(A.poolIndex);n&&this.#gi(n),this.#ri.ensure(e),A.vertexStreams&&this.#ri.ensure(A.vertexStreams),e.morphAttributes.size>0&&A.updateMorphTargets(!1);const r="indirect"===wn(A,e)?this.#ai.ensure(i):null;r||i.ensureLegacyUploaded(this.#ii,this.#ai);const a=s.getOrCreateForMesh(A,i,e,t,r?.table??null),o=s.addMember(a,A,i,e),l=a.hasMorph?4294967295:r?.row??4294967295,c=cn.ALIVE|(A.visible?cn.VISIBLE:0);this.#ni.instanceMeta.write4(A.poolIndex,e.boundIndex,l,hn(c,o.batch.batchId),gn(s.getSkinSid(o),this.#ui(A.clipSetId))),a.variant??=this.#si.requestVariant(a)}#gi(A){const t=this.renderObjects,e=A.batch.bucket,i=A.poolIndex;this.#ni.instanceMeta.clear(i);const s=t.releaseDrawMember(A);if(this.#si.clearInstancedGroup3BG(A.mesh),s&&("indirect"===e.drawKind&&this.#ai.release(s.material),this.#ri.release(s.geometry),s.vertexStreams&&this.#ri.release(s.vertexStreams),0===e.memberCount)){this.#si.releaseVariant(e.variant),this.#si.releaseVariant(e.altVariant);const A=e.passVariants;if(A){for(const t of A.values())this.#si.releaseVariant(t);e.passVariants=null}e.variant=null,e.altVariant=null,t.release(e)}}}class cr{constructor(A){this.renderObjects=A}#ni;#ri;#yi=[];#Bi=-1;#Ii=[];#Qi=new Map;#Ei=new Map;#xi=new Map;#Di=new Set;#Mi=new Set;#bi=-1;bind(A){this.#ni=A.worldStore,this.#ri=A.geometryTables}syncMorph(A){const t=this.renderObjects,e=t.morphMembers,i=e.length,s=t.morphMembershipEpoch,n=this.#ni;if(0===i)return this.#Bi=s,void(n.releaseMorphActive()&&this.#ri.invalidateMorphBindGroups());const r=s!==this.#Bi;if(!r&&0===A.length)return;const a=this.#yi,o=n.instanceMeta,l=o.cpuView;let c=0;if(r){c=i,a.length=i;for(let A=0;A<i;A++){const t=a[A]??={morphSlot:0,poolIndex:0,influences:void 0,currentPayload:4294967295,vertexCount:0,span:0,targetCount:0};this.#Si(t,e[A],l)}}else{const e=A.length;for(let i=0;i<e;i++){const e=t.getMemberForMesh(A[i]);if(!e||e.morphMemberIndex<0)continue;const s=a[c]??={morphSlot:0,poolIndex:0,influences:void 0,currentPayload:4294967295,vertexCount:0,span:0,targetCount:0};this.#Si(s,e,l),c++}if(0===c)return}const h=n.syncMorphActive(a,c,r);this.#Bi=s;const u=h.payloadUpdates;for(let g=0,d=u.length;g<d;g++){const A=u[g];o.writePayload(A.poolIndex,A.heapOffset)}h.rebuilt&&this.#ri.invalidateMorphBindGroups()}syncSkin(){const A=this.#ni,t=this.renderObjects,e=t.skinMembers,i=e.length,s=t.skinMembershipEpoch;if(0===i)return this.#bi=s,this.#Ei.clear(),this.#xi.clear(),this.#Di.clear(),this.#Mi.clear(),this.#Qi.clear(),A.bonePalette?.retainOnly(this.#Qi,this.#Mi),void(A.releaseSkinActive()&&this.#ri.invalidateMorphSkinBindGroups());const n=A.ensureBonePalette();n.tick();const r=s!==this.#bi;if(!r&&!this.#vi(e,i))return void(this.#bi=s);let a=!1;const o=n.generation,l=this.#Qi;l.clear();const c=this.#Ei;c.clear();const h=this.#xi;h.clear();const u=this.#Di;u.clear();const g=this.#Mi;g.clear();for(let f=0;f<i;f++)g.add(hr(e[f].member.mesh));const d=this.#Ii;d.length=i;for(let f=0;f<i;f++){const A=e[f],t=hr(A.member.mesh),i=A.skeleton,s=gr(n,i,t,g);l.has(i)||l.set(i,s);let r=h.get(s)===i?c.get(s):void 0;if(void 0===r){const A=n.getBase(i,s);let t=!1;if(void 0===A?(t=!0,r=n.ensureAllocated(i,s)):r=A,t||i.needsPaletteSync(s)){const A=i.updatePalette(s);(t||A)&&n.upload(i,r),u.add(i)}c.set(s,r),h.set(s,i)}const o=d[f]??={skinSid:0,paletteBase:0,boneCount:0};o.paletteBase===r&&o.boneCount===i.boneCount||(a=!0),o.skinSid=f,o.paletteBase=r,o.boneCount=i.boneCount}for(const f of u)f.consumePose();const p=~f.UPLOAD_DIRTY;for(let f=0;f<i;f++){const A=e[f].skeleton;u.has(A)&&(hr(e[f].member.mesh).dirtyTypes[0]&=p)}if(this.#bi=s,r||a){if(a){g.clear();for(const A of c.keys())g.add(A)}return n.retainOnly(l,g),void((A.syncSkinActive(d,i).rebuilt||n.generation!==o)&&(this.#ri.invalidateMorphSkinBindGroups(),n.invalidateBindGroup()))}n.generation!==o&&(this.#ri.invalidateMorphSkinBindGroups(),n.invalidateBindGroup())}#Si(A,t,e){const i=t.geometry,s=i.getAttribute("position")?.count??0;A.morphSlot=t.morphSlot,A.poolIndex=t.poolIndex,A.influences=t.mesh.morphTargetInfluences,A.currentPayload=e[4*t.poolIndex+an.MaterialSlot],A.vertexCount=s,A.span=s*(i.morphNormals.size>0&&i.hasAttribute("normal")?2:1),A.targetCount=i.morphAttributes.size}#vi(A,t){const e=this.#Qi;e.clear();const i=f.UPLOAD_DIRTY;for(let s=0;s<t;s++){const t=A[s],n=t.skeleton,r=hr(t.member.mesh);if(e.has(n)){if(null==r.worldStore||0!==(r.dirtyTypes[0]&i))return!0}else if(e.set(n,r),n.needsPaletteSync(r))return!0}return!1}}function hr(A){return A.skinPaletteRoot??A}function ur(A,t){const e=A.elements,i=t.elements;for(let s=0;s<16;s++)if(e[s]!==i[s])return!1;return!0}function gr(A,t,e,i){const s=A.primaryRoot(t);let n;if(null==s||s!==e&&!ur(s.readMatrixWorld(),e.readMatrixWorld())){const i=A.extraCount(t);for(let s=0;s<i;s++){const i=A.extraRoot(t,s);if(i===e||ur(i.readMatrixWorld(),e.readMatrixWorld())){n=i;break}}}else n=s;return null==n?e:n===e||i.has(n)?n:(A.rebindRoot(t,n,e),e)}class dr extends si{type="RenderWorldScene";id=0;device;worldMatrixMeta;clipPlaneMeta;instanceIndicesMeta;instanceMeta;geometryMeta;updateTimings={worldMatrix:0,instanceIndices:0,clipPlane:0,geometryMeta:0};geometryMetaReset=!1;constructor(A,t){super(),this.device=A,this.worldMatrixMeta=t.worldMatrixMeta,this.clipPlaneMeta=t.clipPlaneMeta,this.instanceIndicesMeta=t.instanceIndices,this.instanceMeta=t.instanceMeta,this.geometryMeta=t.geometryMeta,this.addBinding(this.worldMatrixMeta.binding,!1),this.addBinding(this.instanceIndicesMeta.binding,!1),this.addBinding(this.instanceMeta.binding,!1),this.addBinding(this.clipPlaneMeta.binding,!1)}update(){const A=this.device,t=this.updateTimings;let e=performance.now(),i=this.worldMatrixMeta.update(A),s=performance.now();return t.worldMatrix=s-e,e=s,i=this.instanceIndicesMeta.update(A)||i,s=performance.now(),t.instanceIndices=s-e,e=s,i=this.clipPlaneMeta.update(A)||i,s=performance.now(),t.clipPlane=s-e,e=s,this.geometryMetaReset=this.geometryMeta.update(A),s=performance.now(),t.geometryMeta=s-e,i&&this.version++,i}dispose(){}}class pr extends si{type="CullComputeWorldScene";id=0;device;worldMatrixMeta;boundingMeta;instanceMeta;updateTimings={bounding:0,instanceMeta:0};constructor(A,t){super(),this.device=A,this.worldMatrixMeta=t.worldMatrixMeta,this.boundingMeta=t.boundingMeta,this.instanceMeta=t.instanceMeta,this.addBinding(this.worldMatrixMeta.binding,!1),this.addBinding(this.instanceMeta.binding,!1),this.addBinding(this.boundingMeta.binding,!1)}update(){const A=this.device,t=this.updateTimings;let e=performance.now(),i=this.boundingMeta.update(A),s=performance.now();return t.bounding=s-e,e=s,i=this.instanceMeta.update(A)||i,s=performance.now(),t.instanceMeta=s-e,i&&this.version++,i}dispose(){}}const fr=20,mr=z.COMPUTE,Cr=j.INDIRECT|j.STORAGE|j.COPY_DST|j.COPY_SRC;new wt("IndirectArgs",[{name:"indexCount",format:"u32"},{name:"instanceCount",format:"u32"},{name:"firstIndex",format:"u32"},{name:"baseVertex",format:"u32"},{name:"firstInstance",format:"u32"}],{useStandardLayout:!0}).computeLayout();class wr{device;binding;cpuView;count=0;drawCount=0;isDirty=!0;dirtyMin=2147483647;dirtyMax=-1;isTransferDirty=!1;get gpuBuffer(){return this.binding.dataView.buffer}constructor(A,t=1024){this.device=A,this.cpuView=new Uint32Array(5*t),this.binding=new zt("indirectArgs",this.cpuView,"u32",{visibility:mr,access:"ReadWrite",isArray:!0,isDynamicArray:!0,count:5*t,usage:Cr,isAtomic:!0}),this.binding.setCount(5*t,!0),this.count=t}ensureCapacity(A){if(A<=this.count)return A>this.drawCount&&(this.drawCount=A),!1;const t=256*Math.ceil(A/256+1);return this.resizeTo(t),this.drawCount=A,!0}shrinkToFit(A=0){const t=this.count,e=Math.max(256*Math.ceil(this.drawCount/256+1),A);return!(e>=t||e/t>.3||(this.resizeTo(e),this.isTransferDirty=!0,this.isDirty=!0,0))}read(A){return this.cpuView.subarray(5*A,5*(A+1))}writeIndexedAt(A,t,e,i,s){this.ensureCapacity(A+1);const n=5*A,r=this.cpuView;r[n]=t>>>0,r[n+1]=0,r[n+2]=e>>>0,r[n+3]=i>>>0,r[n+4]=s>>>0,this.#Ti(A)}writeNonIndexedAt(A,t,e,i){this.ensureCapacity(A+1);const s=5*A,n=this.cpuView;n[s]=t>>>0,n[s+1]=0,n[s+2]=e>>>0,n[s+3]=i>>>0,n[s+4]=0,this.#Ti(A)}clearSlot(A){A<0||A>=this.count||(this.cpuView.fill(0,5*A,5*(A+1)),this.#Ti(A))}resizeTo(A){const t=this.binding,e=new Uint32Array(this.cpuView.buffer.transfer?.(5*A*4));this.cpuView=e,this.count=A,this.isDirty=!0,this.isTransferDirty=!0,this.dirtyMin=0,this.dirtyMax=Math.max(A-1,0),t.dataView.view=e}update(A){A??=this.device,this.device=A;const t=this.binding,e=this.count,i=this.drawCount;let s=t.dataView.buffer,n=!1;if((!s||5*e>t.count||this.isTransferDirty)&&(n=!0,t.setCount(5*e,!0),s=t.createGPUBuffer(A),this.isTransferDirty=!1),n&&i>0)A.queue.writeBuffer(s,0,this.cpuView,0,5*i);else if(this.isDirty&&i>0&&this.dirtyMax>=this.dirtyMin){const t=this.dirtyMin,e=this.dirtyMax-t+1;A.queue.writeBuffer(s,t*fr,this.cpuView,5*t,5*e)}return this.isDirty=!1,this.dirtyMin=2147483647,this.dirtyMax=-1,n}dispose(){this.gpuBuffer?.destroy?.(),this.binding.dispose?.()}#Ti(A){this.isDirty=!0,A<this.dirtyMin&&(this.dirtyMin=A),A>this.dirtyMax&&(this.dirtyMax=A)}}const yr=z.COMPUTE,Br=j.STORAGE|j.COPY_DST|j.COPY_SRC;class Ir{device;binding;cpuView;count;drawCount=0;isTransferDirty=!1;isDirty=!0;get gpuBuffer(){return this.binding.dataView.buffer}constructor(A,t=256){const e=Math.max(t,1);this.device=A,this.count=e,this.cpuView=new Uint32Array(1*e),this.cpuView.fill(4294967295),this.binding=new zt("cullBatches",this.cpuView,"u32",{visibility:yr,access:"ReadOnly",isArray:!0,isDynamicArray:!0,count:e,usage:Br}),this.binding.setCount(e,!0)}ensureCapacity(A){if(A=Math.max(A,1),this.drawCount=A,A<=this.count)return!1;const t=this.cpuView.length/1,e=this.binding,i=256*Math.ceil(A/256+1),s=new Uint32Array(this.cpuView.buffer.transfer?.(1*i*4));return s.fill(4294967295,t),e.dataView.view=s,this.cpuView=s,this.count=i,this.isDirty=!0,this.isTransferDirty=!0,!0}shrinkToFit(A=0){const t=this.count,e=Math.max(256*Math.ceil(this.drawCount/256+1),0|A);if(e>=t||e/t>.35)return!1;const i=new Uint32Array(this.cpuView.buffer.transfer(1*e*4));return this.binding.dataView.view=i,this.cpuView=i,this.count=e,this.isTransferDirty=!0,this.isDirty=!0,!0}write(A,t){if(A<0||A>=this.count)return;const e=1*A;this.cpuView[e]=t>>>0,this.isDirty=!0}clear(A){if(A<0||A>=this.count)return;const t=1*A;this.cpuView[t]=4294967295,this.isDirty=!0}read(A){if(A<0||A>=this.count)return;const t=1*A;return this.cpuView.subarray(t,t+1)}update(A){A??=this.device,this.device=A;const t=this.binding,e=this.count;let i=t.dataView.buffer,s=!1;return(!i||e>t.count||this.isTransferDirty)&&(s=!0,t.setCount(e,!0),i=t.createGPUBuffer(A),this.isTransferDirty=!1),(this.isDirty||s)&&this.drawCount>0&&A.queue.writeBuffer(i,0,this.cpuView,0,1*this.drawCount),this.isDirty=!1,s}markDirty(){this.isDirty=!0}fill(A,t=0,e=this.drawCount){this.cpuView.fill(A,t,e)}dispose(){this.gpuBuffer?.destroy?.(),this.binding.dispose?.(),this.binding=null,this.cpuView=null,this.device=null}}class Qr{device;binding;cpuView;count;drawCount=0;isDirty=!0;dirtyMin=2147483647;dirtyMax=-1;isTransferDirty=!1;get gpuBuffer(){return this.binding.dataView.buffer}constructor(A,t=1024){const e=Math.max(t,1);this.device=A,this.count=e,this.cpuView=new Uint32Array(e),this.binding=new zt("sourceIndices",this.cpuView,"u32",{visibility:yr,access:"ReadOnly",isArray:!0,isDynamicArray:!0,count:e,usage:Br}),this.binding.setCount(e,!0)}ensureCapacity(A){if((A=Math.max(A,1))<=this.count)return!1;const t=this.binding,e=256*Math.ceil(A/256+1),i=new Uint32Array(this.cpuView.buffer.transfer(4*e));return t.dataView.view=i,this.cpuView=i,this.count=e,this.isDirty=!0,this.isTransferDirty=!0,!0}shrinkToFit(A=0){const t=this.count,e=Math.max(256*Math.ceil(this.drawCount/256+1),A);if(e>=t||e/t>.35)return!1;const i=new Uint32Array(this.cpuView.buffer.transfer(4*e));return this.binding.dataView.view=i,this.cpuView=i,this.count=e,this.isTransferDirty=!0,this.isDirty=!0,this.dirtyMax>=e&&(this.dirtyMax=e-1),this.dirtyMin>=e&&(this.dirtyMin=2147483647,this.dirtyMax=-1),!0}setDrawCount(A){this.ensureCapacity(A),this.drawCount=A}write(A,t){A<0||A>=this.count||(this.cpuView[A]=t>>>0,this.isDirty=!0,A<this.dirtyMin&&(this.dirtyMin=A),A>this.dirtyMax&&(this.dirtyMax=A))}read(A){if(!(A<0||A>=this.count))return this.cpuView[A]}update(A){A??=this.device,this.device=A;const t=this.binding,e=this.count,i=this.isDirty?this.drawCount:0;let s=t.dataView.buffer,n=!1;if((!s||e>t.count||this.isTransferDirty)&&(n=!0,t.setCount(e,!0),s=t.createGPUBuffer(A),this.isTransferDirty=!1),i>0){const t=this.dirtyMax-this.dirtyMin+1;n||t<=0||this.dirtyMin>=i?A.queue.writeBuffer(s,0,this.cpuView,0,i):A.queue.writeBuffer(s,4*this.dirtyMin,this.cpuView,this.dirtyMin,t)}return this.isDirty=!1,this.dirtyMin=2147483647,this.dirtyMax=-1,n}markDirty(){this.isDirty=!0,this.dirtyMin=0,this.dirtyMax=Math.max(this.drawCount-1,0)}dispose(){this.gpuBuffer?.destroy?.(),this.binding.dispose?.(),this.binding=null,this.cpuView=null,this.isTransferDirty=!1,this.device=null}}class Er{freeByClass=[];highWater=0;allocate(A,t={base:0,capacity:0}){const e=this.#Ui(A),i=31-Math.clz32(e),s=this.freeByClass[i];if(s?.length)return t.base=s.pop(),t.capacity=e,t;const n=this.highWater;return this.highWater+=e,t.base=n,t.capacity=e,t}release(A,t){if(A<0||t<=0)return;const e=31-Math.clz32(t);(this.freeByClass[e]??=[]).push(A)}reset(){const A=this.freeByClass;for(let t=0,e=A.length;t<e;t++)A[t]?.splice(0);this.highWater=0}#Ui(A){return A<=1?1:2**Math.ceil(Math.log2(A))}}function xr(A,t){A.encodeVersion=t.encodeVersion,A.layoutBindingVersion=t.layoutBindingVersion,A.contextKey=t.contextKey,A.pipeline=t.pipeline,A.cameraBindGroup=t.cameraBindGroup,A.worldBindGroup=t.worldBindGroup,A.materialBindGroup=t.materialBindGroup,A.indirectBuffer=t.indirectBuffer,A.vertexBuffer=t.vertexBuffer,A.indexBuffer=t.indexBuffer}class Dr{bundle=null;executeList=[];committedCount=0;signature={encodeVersion:0,layoutBindingVersion:0,contextKey:"",pipeline:null,cameraBindGroup:null,worldBindGroup:null,materialBindGroup:null,indirectBuffer:null,vertexBuffer:null,indexBuffer:null};hasSignature=!1;stableFrames=0;failedForSignature=!1;hits=0;builds=0;fallbacks=0;observe(A){return this.hasSignature&&(e=A,(t=this.signature).encodeVersion===e.encodeVersion&&t.layoutBindingVersion===e.layoutBindingVersion&&t.contextKey===e.contextKey&&t.pipeline===e.pipeline&&t.cameraBindGroup===e.cameraBindGroup&&t.worldBindGroup===e.worldBindGroup&&t.materialBindGroup===e.materialBindGroup&&t.indirectBuffer===e.indirectBuffer&&t.vertexBuffer===e.vertexBuffer&&t.indexBuffer===e.indexBuffer)?!this.failedForSignature&&(this.stableFrames++,this.stableFrames>=1):(xr(this.signature,A),this.hasSignature=!0,this.bundle=null,this.executeList.length=0,this.committedCount=0,this.stableFrames=0,this.failedForSignature=!1,this.fallbacks++,!1);var t,e}commit(A,t,e){xr(this.signature,t),this.hasSignature=!0,this.bundle=A,this.executeList[0]=A,this.executeList.length=1,this.committedCount=e,this.builds++}markFailure(A){xr(this.signature,A),this.hasSignature=!0,this.bundle=null,this.executeList.length=0,this.committedCount=0,this.failedForSignature=!0,this.fallbacks++}markHit(){this.hits++}}class Mr{batchVersion=-1;geometryDrawVersion=-1;sourceMembers=[];segmentAllocator=new Er;activeSegmentCapacity=0;layoutEpoch=0;bundleCaches=new WeakMap;bundleSigScratch={encodeVersion:0,layoutBindingVersion:0,contextKey:"",pipeline:null,cameraBindGroup:null,worldBindGroup:null,materialBindGroup:null,indirectBuffer:null,vertexBuffer:null,indexBuffer:null};static BUNDLE_BATCH_THRESHOLD=64;bundleHits=0;bundleFallbacks=0;encodeBundleExecMs=0;encodeSuffixMs=0;encodeFullRecordMs=0;profileEncode=!1;#Ni={hits:0,fallbacks:0,exec:0,suffix:0,full:0};segmentScratch={base:0,capacity:0};streamBindScratch=[];slotBatchScratch=[];group3ResScratch={};clear(){this.sourceMembers.length=0,this.segmentAllocator.reset(),this.activeSegmentCapacity=0,this.batchVersion=-1,this.geometryDrawVersion=-1,this.bundleCaches=new WeakMap,this.bundleHits=0,this.bundleFallbacks=0,this.encodeBundleExecMs=0,this.encodeSuffixMs=0,this.encodeFullRecordMs=0}dispose(){this.clear()}buildArgs(A,t){const{renderObjects:e,geometryTables:i,sourceIndices:s,instanceIndices:n,cullBatches:r,indirectArgs:a}=A,o=e.batchVersion,l=i.drawVersion,c=e.removedMembers,h=e.addedMembers,u=this.sourceMembers;s.ensureCapacity(s.drawCount+h.length);for(let w=0,y=c.length;w<y;w++){const A=c[w],t=A.sourceSlot;if(t<0)continue;const e=u.length-1;if(t<e){const A=u[e];u[t]=A,A.sourceSlot=t,s.write(t,A.poolIndex)}u.length=e,A.sourceSlot=-1}for(let w=0,y=h.length;w<y;w++){const A=h[w];if(e.getMemberForMesh(A.mesh)!==A)continue;if(A.batch.skipCull)continue;const t=u.length;A.sourceSlot=t,u.push(A),s.write(t,A.poolIndex)}s.setDrawCount(u.length),r.ensureCapacity(e.batchIdCapacity),a.ensureCapacity(e.batchIdCapacity);const g=++this.layoutEpoch;for(let w=0,y=c.length;w<y;w++){const t=c[w].batch;t.layoutEpoch!==g&&(t.layoutEpoch=g,this.#Pi(t,A))}for(let w=0,y=h.length;w<y;w++){const t=h[w].batch;t.layoutEpoch!==g&&(t.layoutEpoch=g,this.#Pi(t,A))}const d=e.megaSyncBatches;for(let w=0,y=d.length;w<y;w++){const t=d[w];t.layoutEpoch!==g&&(t.layoutEpoch=g,this.#Pi(t,A))}const p=i.consumeDrawDirtySlots();o!==this.batchVersion?this.#Oi(A,t):l!==this.geometryDrawVersion&&p.length>0&&this.#Fi(A,t,p);const f=this.segmentAllocator,m=f.highWater,C=this.activeSegmentCapacity;return m>16384&&C>0&&m>1.5*C&&this.#ki(A,t),n.ensureCapacity(Math.max(f.highWater,1)),e.flushMemberDeltas(),this.batchVersion=o,this.geometryDrawVersion=l,e.getEncodeBatchCount()}#Pi(A,t){const e=A.members.length;if(0===e)return A.segmentCapacity>0&&(this.segmentAllocator.release(A.base,A.segmentCapacity),this.activeSegmentCapacity-=A.segmentCapacity),t.cullBatches.clear(A.batchId),t.indirectArgs.clearSlot(A.batchId),A.base=-1,A.segmentCapacity=0,A.count=0,void(A.mega&&(A.maxIndexCount=0));if(A.skipCull)return A.count=e,void this.#Ri(A,t);if(A.segmentCapacity<e){const t=this.segmentAllocator,i=A.segmentCapacity;i>0&&t.release(A.base,i);const s=t.allocate(e,this.segmentScratch);A.base=s.base,A.segmentCapacity=s.capacity,this.activeSegmentCapacity+=s.capacity-i}A.count=e,this.#Ri(A,t)}#Li(A,t){if(A.mega&&A.bucket.isMegaPull)return A.members.length>0&&A.maxIndexCount>0;const e=A.geometrySlot,i=t.geometryMeta.u32;if(e<0||e>=t.geometryMeta.count||!(i[e*zs+Ls.Flags]&Gs.ALIVE)||!t.geometryTables.hasGeometry(A.geometry.id))return!1;const s=e*zs,n=i[s+Ls.IndexCount],r=i[s+Ls.VertexCount];return n>0||r>0}#ji(A,t){const{indirectArgs:e,cullBatches:i}=t;if(!this.#Li(A,t))return i.clear(A.batchId),e.clearSlot(A.batchId),!1;if(A.skipCull){const e=A.geometrySlot,i=t.geometryMeta.u32,s=e*zs;return A.indexed=i[s+Ls.IndexCount]>0,!0}if(A.bucket.wireframe&&"instanced"!==A.bucket.drawKind&&(!A.mega||!A.bucket.isMegaPull)){const s=A.geometrySlot,n=t.geometryMeta.u32,r=s*zs,a=n[r+Ls.IndexCount],o=a>0?a:n[r+Ls.VertexCount],l=function(A,t){const e=ji(t);return e<=0?null:{indexCount:e,firstIndex:6*(A/3|0)}}(n[r+Ls.FirstIndex],o);return l?(e.writeIndexedAt(A.batchId,l.indexCount,l.firstIndex,n[r+Ls.BaseVertex],A.base),A.indexed=!0,i.write(A.batchId,A.base),!0):(i.clear(A.batchId),e.clearSlot(A.batchId),!1)}if(A.mega&&A.bucket.isMegaPull)return e.writeNonIndexedAt(A.batchId,A.maxIndexCount,0,A.base),A.indexed=!1,i.write(A.batchId,A.base),!0;const s=A.geometrySlot,n=t.geometryMeta.u32,r=s*zs,a=n[r+Ls.IndexCount],o=n[r+Ls.VertexCount];return a>0?(e.writeIndexedAt(A.batchId,a,n[r+Ls.FirstIndex],n[r+Ls.BaseVertex],A.base),A.indexed=!0):(e.writeNonIndexedAt(A.batchId,o,n[r+Ls.FirstIndex],A.base),A.indexed=!1),i.write(A.batchId,A.base),!0}#Oi(A,t){for(let e=0,i=t.length;e<i;e++){const i=t[e];if(!i||0===i.memberCount||!i.variant)continue;i.encodeOrderDirty=!0,i.ensureEncodeOrder();const s=i.encodeBatches;let n=0;for(let t=0,e=s.length;t<e;t++){const e=s[t];e.members.length>0&&this.#ji(e,A)?(e.encodeIndex=n,s[n++]=e):e.encodeIndex=-1}n!==s.length&&(s.length=n,i.encodeVersion++)}}#Fi(A,t,e){const i=A.geometryMeta.u32,s=A.geometryMeta.count,n=this.slotBatchScratch;for(let r=0,a=e.length;r<a;r++){const a=e[r],o=a>=0&&a<s,l=o?i[a*zs+Ls.LayoutId]:0;for(let e=0,i=t.length;e<i;e++){const i=t[e];if(i&&0!==i.memberCount&&(!i.materialTable||o&&l===i.layoutId)){n.length=0,i.collectGeometrySlotBatches(a,n);for(let t=0,e=n.length;t<e;t++)this.#Ri(n[t],A)}}}n.length=0}#Ri(A,t){this.#ji(A,t)&&A.encodeIndex<0&&A.bucket.appendEncodeBatch(A)}#ki(A,t){let e=0;const i=this.segmentScratch,s=this.segmentAllocator;s.reset();for(let n=0,r=t.length;n<r;n++){const r=t[n];r&&0!==r.memberCount&&r.forEachBatch(t=>{const n=t.members.length;if(0===n)return;if(t.skipCull)return t.base=-1,t.segmentCapacity=0,t.count=n,void this.#ji(t,A);const r=s.allocate(n,i);t.base=r.base,t.segmentCapacity=r.capacity,t.count=n,e+=r.capacity,this.#ji(t,A)})}this.activeSegmentCapacity=e}encodeDraws(A,t){const{pass:e,pipelineCache:i,geometryTables:s,camera:n,indirectArgs:r,renderContext:a}=A;if(!e)throw new Error("BucketEncoder.encodeDraws: pass required");const o=i.getCameraBG(n),l=i.getCommonSenceBG(),c=a.getCacheKey(),h=a.getBundleCompatibleKey(),u=a.isCanvasRender?null:a.textures[0],g=this.bundleCaches,d=this.bundleSigScratch,p=!0===A.transparentPass;A.sawTransparent=!1;const f=this.#Ni;f.hits=0,f.fallbacks=0,f.exec=0,f.suffix=0,f.full=0;const m=this.profileEncode;for(let C=0,w=t.length;C<w;C++){const n=t[C];if(!n||!n.variant||0===n.encodeBatches.length)continue;const r=n.sourceMaterial??n.encodeBatches[0].material,w=!!r.transparent;if(w&&(A.sawTransparent=!0),w!==p)continue;if(u&&r.map===u)continue;const y=n.encodeBatches,B=s.getLayoutPools(n.layoutId);if(!B)continue;const I=n.variant,Q=i.ensurePassVariant(n,a,c);if(Q){n.variant=Q;try{this.#zi(e,A,n,y,o,l,B,h,d,g,m,f)}finally{n.variant=I}}}return this.bundleHits=f.hits,this.bundleFallbacks=f.fallbacks,this.encodeBundleExecMs=f.exec,this.encodeSuffixMs=f.suffix,this.encodeFullRecordMs=f.full,r.drawCount}#zi(A,t,e,i,s,n,r,a,o,l,c,h){const u=i.length;if(e.wireframe&&!e.isMegaPull&&"instanced"!==e.drawKind){const e=c?performance.now():0;return this.#Gi(A,t,i,0,u,s,n,!0),c&&(h.full+=performance.now()-e),void h.fallbacks++}if(e.isMegaPull){const r=c?performance.now():0;return this.#Yi(A,t,e,i,s,n),c&&(h.full+=performance.now()-r),void h.fallbacks++}if("instanced"===e.drawKind){const r=c?performance.now():0;return this.#Hi(A,t,e,i,s,n),c&&(h.full+=performance.now()-r),void h.fallbacks++}if(t.indirectSliceActive||"rich"===e.drawKind||u<Mr.BUNDLE_BATCH_THRESHOLD){const e=c?performance.now():0;return this.#Gi(A,t,i,0,u,s,n,!0),c&&(h.full+=performance.now()-e),void h.fallbacks++}this.#Ki(A,t,e,i,u,s,n,r,a,o,l,c,h)}#Ki(A,t,e,i,s,n,r,a,o,l,c,h,u){const{indirectArgs:g}=t;let d=c.get(e);d||(d=new Dr,c.set(e,d)),this.#Vi(l,e,o,n,r,a.vb.activeBuffer,a.ib.active,e.materialTable?this.#Ji(t,e):null,g.gpuBuffer,a.bindingVersion);const p=d.observe(l);if(p&&d.bundle){let e=h?performance.now():0;A.executeBundles(d.executeList),h&&(u.exec+=performance.now()-e);const a=d.committedCount;return s>a&&(e=h?performance.now():0,this.#Gi(A,t,i,a,s,n,r,!0),h&&(u.suffix+=performance.now()-e)),d.markHit(),void u.hits++}if(p){const e=h?performance.now():0;return void(this.#Wi(d,l,t,i,0,s,n,r,o,a)?(A.executeBundles(d.executeList),h&&(u.exec+=performance.now()-e),u.hits++):(this.#Gi(A,t,i,0,s,n,r,!0),h&&(u.full+=performance.now()-e),u.fallbacks++))}const f=h?performance.now():0;this.#Gi(A,t,i,0,s,n,r,!0),h&&(u.full+=performance.now()-f),u.fallbacks++}#Wi(A,t,e,i,s,n,r,a,o,l){const{renderContext:c}=e,h=i[s].bucket,u=l.vb.activeBuffer,g=l.ib.active;try{const d=c.device.createRenderBundleEncoder(c.getRenderBundleEncoderDescriptor());this.#Gi(d,e,i,s,n,r,a,!1);const p=d.finish();return this.#Vi(t,h,o,r,a,u,g,h.materialTable?this.#Ji(e,h):null,e.indirectArgs.gpuBuffer,l.bindingVersion),A.commit(p,t,n),!0}catch{return A.markFailure(t),!1}}#qi(A,t,e){const i=t.materialBGL;let s=A.renderObjects.getMaterialBindGroup(e,i)??null;return s||(s=A.pipelineCache.createMaterialBindGroup(t,e),A.renderObjects.setMaterialBindGroup(e,i,s)),s}#Ji(A,t){const e=t.materialBindingProvider,i=t.variant;return e&&i?this.#qi(A,i,e):null}#Xi(A,t,e,i){const s=t.geometryMeta.u32,n=e.geometrySlot*zs,r=this.streamBindScratch,a=t.geometryTables.getVertexBinds(e.geometry,r);if(a<=0)return 0;for(let o=0;o<a;o++){const A=r[o];if(A.offset+A.size>A.buffer.size)return 0}for(let o=0;o<a;o++){const t=r[o];A.setVertexBuffer(o,t.buffer,t.offset,t.size)}if(e.bucket.wireframe&&"instanced"!==e.bucket.drawKind&&!e.bucket.isMegaPull){const i=function(A,t){const e=t.index,i=t.getAttribute("position");if(!i||i.count<3)return null;const s=null!=e&&e.count>=3,n=s?e.count:i.count,r=s?e.serial:0,a=s?e:null,o=Li.get(t);if(o&&o.attr===a&&o.serial===r&&o.count===n)return o;const l=function(A,t,e,i){const s=i/3|0;if(s<=0)return null;const n=e>=65535||null!=t&&!(t.view instanceof Uint16Array),r=6*s,a=n?new Uint32Array(r):new Uint16Array(r);let o=0;if(t)for(let h=0;h<s;h++){const A=3*h,e=Gi(t,A),i=Gi(t,A+1),s=Gi(t,A+2);a[o++]=e,a[o++]=i,a[o++]=i,a[o++]=s,a[o++]=s,a[o++]=e}else for(let h=0;h<s;h++){const A=3*h;a[o++]=A,a[o++]=A+1,a[o++]=A+1,a[o++]=A+2,a[o++]=A+2,a[o++]=A}const l=a.byteLength+3&-4,c=A.createBuffer({label:"wireframe-index",size:l,usage:GPUBufferUsage.INDEX|GPUBufferUsage.COPY_DST});return A.queue.writeBuffer(c,0,a),{buffer:c,indexCount:r,format:n?"uint32":"uint16",byteLength:l}}(A,s?e:null,i.count,n);if(!l)return o&&zi(t),null;o&&o.buffer.destroy();const c={attr:a,serial:r,count:n,...l};return Li.set(t,c),c}(t.pipelineCache.device,e.geometry);return i?(A.setIndexBuffer(i.buffer,i.format,0,i.byteLength),a):0}if(e.indexed&&i){const t=s[n+Ls.IbOffset],e=s[n+Ls.IbSize];if(t+e>i.size)return 0;const r=s[n+Ls.IndexFormat]===Ys.Uint16?"uint16":"uint32";A.setIndexBuffer(i,r,t,e)}return a}#Vi(A,t,e,i,s,n,r,a,o,l){A.encodeVersion=t.encodeVersion,A.layoutBindingVersion=l,A.contextKey=e,A.pipeline=t.variant.pipeline,A.cameraBindGroup=i,A.worldBindGroup=s,A.materialBindGroup=a,A.indirectBuffer=o,A.vertexBuffer=n,A.indexBuffer=r}#Yi(A,t,e,i,s,n){const{pipelineCache:r,geometryTables:a,indirectArgs:o}=t,l=e.variant,c=a.getLayoutPools(e.layoutId);if(!c)return;const h=e.materialTable;if(!h)return;const u=this.#qi(t,l,h),g=r.getMegaPoolsBG(c);A.setPipeline(l.pipeline),A.setBindGroup(0,s),A.setBindGroup(1,u),A.setBindGroup(2,n),A.setBindGroup(3,g);const d=o.gpuBuffer;for(let p=0,f=i.length;p<f;p++){const e=i[p];e.count<=0||this.#Zi(A,t,e,d)}}#Zi(A,t,e,i){const s=t.indirectSliceSize??0,n=t.sliceIndirectBuffer,r=t.indirectSliceMax??0;if(!t.indirectSliceActive||s<=0||!n||r<=0){const t=e.batchId*fr;return void(e.indexed?A.drawIndexedIndirect(i,t):A.drawIndirect(i,t))}const a=Math.ceil(e.count/s),o=e.batchId*r;for(let l=0;l<a;l++){const t=(o+l)*fr;e.indexed?A.drawIndexedIndirect(n,t):A.drawIndirect(n,t)}}#Gi(A,t,e,i,s,n,r,a){const{pipelineCache:o,geometryTables:l,indirectArgs:c}=t,h=e[i].bucket,u=h.variant,g=l.getLayoutPools(h.layoutId);if(!g)return;const d=c.gpuBuffer,p=g.ib.active,f=u.group3BGL,m=u.group3Mask,C=0!==(m&_t.Morph),w=0!==(m&_t.Skin),y=C?t.morphActive?.gpuBuffer??null:null;let B=-1;if(A.setPipeline(u.pipeline),A.setBindGroup(0,n),A.setBindGroup(2,r),w&&!C&&f){const e=t.skinActive?.gpuBuffer??null,i=e?t.bonePalette?.getBindGroup(f,e,o)??null:null;if(!i)throw new Error("BucketEncoder: rich|skin missing bonePalette BindGroup");A.setBindGroup(3,i)}const I=h.materialTable;let Q="",E=null;I&&(E=this.#qi(t,u,I),A.setBindGroup(1,E));for(let x=i;x<s;x++){const i=e[x];if(!(a&&i.count<=0)){if(!I){const e=i.material.uuid;e===Q&&E||(E=this.#qi(t,u,i.material),A.setBindGroup(1,E),Q=e)}if(C&&f){if(!y)continue;const e=i.geometry.id;if(e!==B){const s=w?t.bonePalette:null,n=w?t.skinActive?.gpuBuffer??null:null;if(w&&(!n||!s?.view||!s.texture))throw new Error("BucketEncoder: rich|morph|skin missing bonePalette");const r=l.getGroup3BindGroup(i.geometry,m,f,{morphHeap:y,bonePalette:s?.view??void 0,skinActive:n??void 0,paletteTex:s?.texture??void 0},o);if(!r)continue;A.setBindGroup(3,r),B=e}}this.#Xi(A,t,i,p)<=0||this.#Zi(A,t,i,d)}}}#Hi(A,t,e,i,s,n){const{pipelineCache:r,geometryTables:a,instanceMeta:o}=t,l=e.variant,c=l.group3BGL;if(!c)return;const h=a.getLayoutPools(e.layoutId);if(!h)return;const u=r.device,g=o.cpuView,d=h.ib.active;A.setPipeline(l.pipeline),A.setBindGroup(0,s),A.setBindGroup(2,n);let p="",f=null,m=null,C=-1,w=-1;for(let y=0,B=i.length;y<B;y++){const e=i[y];if(e.count<=0)continue;const s=e.material.uuid;s===p&&f||(f=this.#qi(t,l,e.material),A.setBindGroup(1,f),p=s);const n=this.#Xi(A,t,e,d);if(n<=0)continue;const o=l.group3Mask,h=this.group3ResScratch;if(h.morphAtlas=void 0,h.morphAtlasTex=void 0,h.morphHeap=void 0,h.bonePalette=void 0,h.skinActive=void 0,h.paletteTex=void 0,o&_t.Morph){const A=a.getMorphAtlas(e.geometry),i=t.morphActive?.gpuBuffer;if(!A||!i)continue;h.morphAtlas=A.view,h.morphAtlasTex=A.texture,h.morphHeap=i}if(o&_t.Skin){const A=t.skinActive?.gpuBuffer,e=t.bonePalette;if(!A||!e?.view||!e.texture)throw new Error("BucketEncoder: instanced|skin missing bonePalette BindGroup");h.bonePalette=e.view,h.skinActive=A,h.paletteTex=e.texture}const B=e.members;for(let i=0,a=B.length;i<a;i++){const s=B[i].mesh;if(!s.isInstancedDraw||!s.visible||s.count<1)continue;if(!s.vertexStreams)continue;const a=t.instancedPackedBuffer;if(!a)continue;const l=48*s.cullVisibleBase;l===w&&n===C||(A.setVertexBuffer(n,a,l,a.size-l),w=l,C=n);const d=t.instancedIndirectArgs,p=s.cullArgsSlot;if(!d||p<0)continue;const f=B[i].poolIndex;s.syncInstancedObject(f,g[4*f+an.Flags]>>>16)&&s.flushInstancedObject(u);const y=r.getInstancedGroup3BindGroup(c,o,s,h);y!==m&&(A.setBindGroup(3,y),m=y);const I=p*fr;e.indexed?A.drawIndexedIndirect(d.gpuBuffer,I):A.drawIndirect(d.gpuBuffer,I)}}}}function br(A,t,e){const i=A.viewport,s=t.matrixWorld.elements;A.cameraFar=t.far??1e3;let n=t.position.version+1000003*t.quaternion.version+t.scale.version;for(let a=t.parent;a;a=a.parent)n+=a.position.version+1000003*a.quaternion.version+a.scale.version;const r=t.projectionMatrix.elements;if(n+=(4096*r[0]|0)+31*(4096*r[5]|0)+37*(4096*r[10]|0)+41*(4096*r[14]|0),A.cameraEpoch=n,A.cameraX=s[12],A.cameraY=s[13],A.cameraZ=s[14],e.viewport){const A=e.viewportValue;i.x=A.x,i.y=A.y,i.z=A.z,i.w=A.w,i.minDepth=A.minDepth??0,i.maxDepth=A.maxDepth??1}else i.x=0,i.y=0,i.z=e.width,i.w=e.height,i.minDepth=0,i.maxDepth=1;return A}let Sr=0;class vr extends si{id=Sr++;type="ComputeNode";name="";workgroupSize=[64,1,1];entryPoint;injectWgslFragment="";#_i;#$i;#As="";#ts=0;buildShader;_cacheKey="";get defines(){return this.#_i}get features(){return this.#$i}constructor(A){super();const t=A=>{this.onChangeCallback(A)};this.#_i=new Ke(A?.defines,t),this.#$i=new Ke(A?.features,t),this.#_i.dirtyTypes=f.DIRTY_STRUCTURE,this.#$i.dirtyTypes=f.DIRTY_STRUCTURE,this.buildShader=this.createShaderFn(A?.shader);const e=A?.workgroupSize||[64,1,1];this.workgroupSize=[e[0]??64,e[1]??1,e[2]??1],this.entryPoint=A?.entryPoint||"main"}createShaderFn(A){if(!A)return this.#ts=0,()=>"";const t="function"==typeof A;return this.#ts=ze(t?A.toString():A),t?A:new Function("renderer","computeObject","pipeline","commonFunctions","isRender",`return (${A})();`)}onBeforeCompile(A,t,e,i){return A}onChangeCallback(A){if(A&f.DIRTY_STRUCTURE&&(this._cacheKey="",this.#As="",this.version++),this.dirtyTypes&A)return;this.dirtyTypes|=A;const t=this.depObjects;for(const e of t){const i=e.deref();null!=i?i.onChangeCallback(A):t.delete(e)}}getBindingLayoutKey(){if(this.#As)return this.#As;const A=[];for(const[,t]of this.getBindings()){if(t.isSkipBinding())continue;const e=t.access?.key??"u",i=t.isDynamicArray?"d":t.isArray?`a${t.count}`:"v";A.push(`${t.name}:${t.typeInfo?.format??"u"}:${i}:${e}`)}return A.sort(),this.#As=A.join("|"),this.#As}getCacheKey(){if(this._cacheKey)return this._cacheKey;const A=[],t=[];for(const[s,n]of this.defines)A.push(`${s}=${n}`);for(const[s,n]of this.features)t.push(`${s}=${n}`);A.sort(),t.sort();const e=this.workgroupSize.join(","),i=this.injectWgslFragment?ze(this.injectWgslFragment):0;return this._cacheKey=`${this.type}|${this.name}|${A.join(";")}|ft:${t.join(";")}|wg:${e}|ep:${this.entryPoint}|inj:${i}|sh:${this.#ts}|bg:${this.getBindingLayoutKey()}`,this._cacheKey}}let Tr=0;class Ur extends si{id=Tr++;type="ComputeContext";name;device;encoder=null;passEncoder=null;ownsEncoder=!1;constructor(A,t={}){super(),this.device=A,this.name=t.name||"compute"}beginComputePass(A){if(this.passEncoder)throw new Error(`ComputeContext[${this.name}]: beginComputePass while pass is open`);return A?(this.encoder=A,this.ownsEncoder=!1):(this.encoder=this.device.createCommandEncoder({label:`CE_${this.name}_${this.id}`}),this.ownsEncoder=!0),this.passEncoder=this.encoder.beginComputePass({label:`CP_${this.name}`}),this.passEncoder}endPass(){this.passEncoder?.end(),this.passEncoder=null}finish(){if(this.passEncoder&&this.endPass(),!this.ownsEncoder)return null;const A=this.encoder.finish();return this.encoder=null,A}dispatchObject(A,t,e=1,i=1,s){const n=this.passEncoder,r=A.variant;n.setPipeline(r.pipeline),n.setBindGroup(0,A.cameraBindGroup),n.setBindGroup(1,s??A.materialBindGroup),n.setBindGroup(2,A.contextBindGroup),n.dispatchWorkgroups(t,e,i)}dispose(){this.passEncoder&&this.endPass(),this.passEncoder=null,this.encoder=null}}function Nr(A,t,e,i=!0){const s=A.material;A.variant||(void 0!==e&&(s.entryPoint=e),s._cacheKey="",A.pipelineKey="",A.computePipelineKey(),A.variant=t.getComputeVariant(A));const n=t.getEmptyBG();A.cameraBindGroup=A.isNeedCamera?t.getCameraBG(void 0,!1):n,A.contextBindGroup=A.isNeedWorldStore?t.getCommonSenceBG(void 0,!1,!1):n,i&&(A.materialBindGroup??=t.createMaterialBindGroup(A.variant,s))}class Pr{material;pipelineKey="";isNeedCamera=!1;isNeedWorldStore=!1;variant=null;materialBindGroup=null;contextBindGroup=null;cameraBindGroup=null;constructor(A,t=!1,e=!1){this.material=A,this.isNeedCamera=t,this.isNeedWorldStore=e}computePipelineKey(){const A=this.material.getCacheKey(),t=this.isNeedWorldStore?"WS":"-";return this.isNeedCamera?this.pipelineKey=`c|${A}|${t}|1`:this.pipelineKey=`c|${A}|${t}`}clearBindGroups(){this.materialBindGroup=null,this.contextBindGroup=null,this.cameraBindGroup=null}}const Or=[0,1];function Fr(A){return`localInvocationIndex + (workgroupId.x + workgroupId.y * numWorkgroups.x) * ${A}u`}function kr(A,t,e){if(A<=0)return Or[0]=0,Or[1]=1,Or;const i=e>0?e:65535,s=Math.ceil(A/t),n=Math.max(1,Math.ceil(s/i));return Or[0]=Math.ceil(s/n),Or[1]=n,Or}function Rr(A){const t=A.limits.maxComputeWorkgroupsPerDimension;return t>0?t:65535}const Lr=z.COMPUTE,jr="\nfn culledByScreenPixels(worldCenter: vec3<f32>, worldRadius: f32) -> bool {\n let minPx = camera.minScreenPixels;\n if (minPx <= 0.0) { return false; }\n let screenH = camera.screenResolution.y;\n if (screenH < 1.0) { return false; }\n let projY = abs(camera.projectionMatrix[1][1]);\n let isPersp = abs(camera.projectionMatrix[2][3]) > 0.5;\n var ndcR: f32;\n if (isPersp) {\n let viewZ = -(camera.viewMatrix * vec4<f32>(worldCenter, 1.0)).z;\n let zNearPt = viewZ - worldRadius;\n let c = camera.projectionMatrix[2][2];\n let d = camera.projectionMatrix[3][2];\n let camNear = select(d, d / (1.0 + c), abs(c) > 1e-8);\n if (zNearPt <= camNear * 1.2) { return false; }\n ndcR = worldRadius * projY / zNearPt;\n } else {\n ndcR = worldRadius * projY;\n }\n return ndcR * screenH < minPx;\n}\n",zr=jr+`\nconst ALIVE_VISIBLE: u32 = 3u; // 字2 低 2 位 ALIVE|VISIBLE\nconst INDIRECT_STRIDE: u32 = 5u;\nconst INVALID: u32 = 0xffffffffu;\nconst WG: u32 = 64u;\nconst FLAG_ANY: u32 = 1u;\nconst FLAG_MIX: u32 = 2u;\n\n// 按 WG 分类,不是整帧二选一:\n// 同批连续(1M 同几何、append 成段)→ 前缀和 + 1 次 atomic,避免单计数器 64 路争用\n// 混批(swap-remove / 多批交界)→ 每线程 atomic;src 不保证紧排\nvar<workgroup> wgVis: array<u32, WG>;\nvar<workgroup> wgDst: u32;\nvar<workgroup> wgFirstBatch: atomic<u32>;\nvar<workgroup> wgFlags: atomic<u32>;\nvar<workgroup> wgF: u32;\n\nfn cullCompact() {\n let slot = ${Fr(64)};\n let lid = localInvocationIndex;\n\n var vis = 0u;\n var poolIndex = 0u;\n var batchId = 0u;\n var rangeBase = 0u;\n\n if (slot < instanceCount) {\n poolIndex = sourceIndices[slot];\n let im = instanceMeta[poolIndex];\n if ((im.drawGroupId & ALIVE_VISIBLE) == ALIVE_VISIBLE) {\n let boundIndex = im.geometrySlot;\n if (boundIndex != INVALID) {\n let localCenter = bounding[boundIndex];\n let radius = localCenter.w;\n let M = worldMatrices[poolIndex];\n let worldCenter = (M * vec4<f32>(localCenter.xyz, 1.0)).xyz;\n let ax = M[0].xyz;\n let ay = M[1].xyz;\n let az = M[2].xyz;\n // 谱范数上界(M^T M 的 Gershgorin 圆):列正交时等于最大列长,剪切时不会把球算小。\n let gxy = abs(dot(ax, ay));\n let gxz = abs(dot(ax, az));\n let gyz = abs(dot(ay, az));\n let worldRadius = radius * sqrt(max(dot(ax, ax) + gxy + gxz, max(dot(ay, ay) + gxy + gyz, dot(az, az) + gxz + gyz)));\n var culled = false;\n let maxDist = camera.maxDistance;\n if (maxDist > 0.0) {\n let viewCenter = (camera.viewMatrix * vec4<f32>(worldCenter, 1.0)).xyz;\n if (length(viewCenter) - worldRadius > maxDist) { culled = true; }\n }\n if (!culled) {\n var inFrustum = true;\n for (var i = 0u; i < 6u; i++) {\n let p = camera.frustumPlanes[i];\n if (dot(p.xyz, worldCenter) + p.w < -worldRadius) {\n inFrustum = false;\n break;\n }\n }\n if (inFrustum) {\n batchId = im.drawGroupId >> 2u;\n rangeBase = cullBatches[batchId];\n if (rangeBase != INVALID && !culledByScreenPixels(worldCenter, worldRadius)) { vis = 1u; }\n }\n }\n }\n }\n }\n\n wgVis[lid] = vis;\n if (lid == 0u) {\n atomicStore(&wgFirstBatch, INVALID);\n atomicStore(&wgFlags, 0u);\n }\n workgroupBarrier();\n\n if (vis == 1u) {\n atomicOr(&wgFlags, FLAG_ANY);\n var expected = INVALID;\n loop {\n let r = atomicCompareExchangeWeak(&wgFirstBatch, expected, batchId);\n if (r.exchanged) { break; }\n expected = r.old_value;\n if (expected != INVALID) { break; }\n }\n if (atomicLoad(&wgFirstBatch) != batchId) {\n atomicOr(&wgFlags, FLAG_MIX);\n }\n }\n workgroupBarrier();\n\n // flags 须 workgroupUniformLoad:后面还有 barrier,不能用非 uniform 的 atomicLoad 分支。\n if (lid == 0u) { wgF = atomicLoad(&wgFlags); }\n let flags = workgroupUniformLoad(&wgF);\n if ((flags & FLAG_ANY) == 0u) { return; }\n if ((flags & FLAG_MIX) != 0u) {\n if (vis == 1u) {\n let dstOff = atomicAdd(&indirectArgs[batchId * INDIRECT_STRIDE + 1u], 1u);\n instanceIndices[rangeBase + dstOff] = poolIndex;\n }\n return;\n }\n\n for (var s = 1u; s < WG; s = s * 2u) {\n var v = 0u;\n if (lid >= s) { v = wgVis[lid - s]; }\n workgroupBarrier();\n wgVis[lid] = wgVis[lid] + v;\n workgroupBarrier();\n }\n let exclusive = wgVis[lid] - vis;\n let total = wgVis[WG - 1u];\n if (lid == 0u) {\n let b = atomicLoad(&wgFirstBatch);\n wgDst = atomicAdd(&indirectArgs[b * INDIRECT_STRIDE + 1u], total);\n }\n workgroupBarrier();\n if (vis == 1u) {\n instanceIndices[rangeBase + wgDst + exclusive] = poolIndex;\n }\n}\n`,Gr="\nconst HIZ_INFLATE: f32 = 1.14;\nconst HIZ_Z_BIAS: f32 = 0.01;\n\nfn hizFar(uv: vec2<f32>, lod: u32) -> f32 {\n if (lod == 0u) {\n let dim = vec2<f32>(textureDimensions(hiz0));\n let p = vec2<i32>(clamp(uv * dim, vec2<f32>(0.0), dim - vec2<f32>(1.0)));\n return textureLoad(hiz0, p, 0).r;\n }\n if (lod == 1u) {\n let dim = vec2<f32>(textureDimensions(hiz1));\n let p = vec2<i32>(clamp(uv * dim, vec2<f32>(0.0), dim - vec2<f32>(1.0)));\n return textureLoad(hiz1, p, 0).r;\n }\n let dim = vec2<f32>(textureDimensions(hiz2));\n let p = vec2<i32>(clamp(uv * dim, vec2<f32>(0.0), dim - vec2<f32>(1.0)));\n return textureLoad(hiz2, p, 0).r;\n}\n\nfn occludedByHiZ(worldCenter: vec3<f32>, worldRadius: f32) -> bool {\n let r = worldRadius * HIZ_INFLATE;\n let clip = camera.viewProjectionMatrix * vec4<f32>(worldCenter, 1.0);\n if (clip.w <= 1e-4) { return false; }\n let invW = 1.0 / clip.w;\n let ndc = clip.xyz * invW;\n let ndcR = r * invW;\n let minN = ndc.xy - vec2<f32>(ndcR);\n let maxN = ndc.xy + vec2<f32>(ndcR);\n let zClosest = ndc.z + ndcR;\n let uv0 = vec2<f32>(minN.x * 0.5 + 0.5, 0.5 - minN.y * 0.5);\n let uv1 = vec2<f32>(maxN.x * 0.5 + 0.5, 0.5 - maxN.y * 0.5);\n let uvMin = min(uv0, uv1);\n let uvMax = max(uv0, uv1);\n if (uvMax.x < 0.0 || uvMax.y < 0.0 || uvMin.x > 1.0 || uvMin.y > 1.0) { return false; }\n let dim0 = vec2<f32>(textureDimensions(hiz0));\n let sizePx = (uvMax - uvMin) * dim0;\n let extent = max(sizePx.x, sizePx.y);\n // lod 只到 2(纹素 = 4 个 hiz0 像素)。更大的矩形四角盖不住,中间的洞会被当成墙。\n if (extent > 4.0) { return false; }\n let lod = u32(clamp(ceil(log2(max(extent, 1.0))), 0.0, 2.0));\n let zFar = min(\n min(hizFar(vec2<f32>(uvMin.x, uvMin.y), lod), hizFar(vec2<f32>(uvMax.x, uvMin.y), lod)),\n min(hizFar(vec2<f32>(uvMin.x, uvMax.y), lod), hizFar(vec2<f32>(uvMax.x, uvMax.y), lod)));\n return zClosest < zFar - HIZ_Z_BIAS;\n}\n",Yr=Gr+zr.replace("if (rangeBase != INVALID && !culledByScreenPixels(worldCenter, worldRadius)) { vis = 1u; }","if (rangeBase != INVALID && !culledByScreenPixels(worldCenter, worldRadius) && !occludedByHiZ(worldCenter, worldRadius)) { vis = 1u; }");class Hr extends vr{type="CullComputeMaterialNode";instanceCountBinding;indirectArgsBinding;cullSourceIndicesBinding=null;instanceIndicesBinding=null;batchesBinding=null;device;cullBatches;cullSourceIndices;indirectArgs;instanceIndices;constructor(A,t,e){super({workgroupSize:[64,1,1],entryPoint:e?.entryPoint||"cullCompact",shader:e?.shader||(()=>zr)}),this.name=e?.name||"CullCompact",this.device=A,this.cullBatches=t.cullBatches,this.cullSourceIndices=t.cullSourceIndices,this.indirectArgs=t.indirectArgs,this.instanceIndices=t.instanceIndices;const i=e?.mode??"cull";"cull-hiz"===i&&e?.hiz&&(this.addBinding(e.hiz.hiz0,!1),this.addBinding(e.hiz.hiz1,!1),this.addBinding(e.hiz.hiz2,!1)),"clear"!==i&&(this.batchesBinding=t.cullBatches.binding,this.addBinding(this.batchesBinding,!1),this.cullSourceIndicesBinding=t.cullSourceIndices.binding,this.addBinding(this.cullSourceIndicesBinding,!1),this.instanceIndicesBinding=t.instanceIndices.csBinding,this.addBinding(this.instanceIndicesBinding,!1)),this.indirectArgsBinding=t.indirectArgs.binding,this.addBinding(this.indirectArgsBinding,!1),this.instanceCountBinding=new zt("instanceCount",0,"u32",{visibility:Lr,access:"Uniform",usage:j.UNIFORM|j.COPY_DST}),this.addBinding(this.instanceCountBinding,!1)}update(){const A=this.device;let t=this.cullSourceIndices.update(A);return t=this.cullBatches.update(A)||t,t=this.indirectArgs.update(A)||t,t=this.instanceIndices.update(A)||t,t}setInstanceCount(A,t){const e=this.instanceCountBinding,i=t>>>0;(e.getValue()!==i||e.isDirty)&&(e.setValue(i),e.updateCPUBuffer(),e.updateGPUBuffer(A))}}class Kr{material;clearMaterial;hiZMaterial=null;passCtx=null;compactObject;hiZCompactObject=null;clearObject;ctorOpts;device;constructor(A,t){this.device=A,this.ctorOpts=t,this.material=new Hr(A,t),this.clearMaterial=new Hr(A,t,{name:"ClearIndirectCounts",entryPoint:"clearIndirectCounts",shader:()=>"\nconst INDIRECT_STRIDE: u32 = 5u;\n\nfn clearIndirectCounts() {\n let i = globalInvocationId.x;\n if (i >= instanceCount) { return; }\n // i ≡ batchId;扫 0..drawCount(含空洞,无害)。不读 cullBatches,避免多余 storage 读/绑定。\n atomicStore(&indirectArgs[i * INDIRECT_STRIDE + 1u], 0u);\n}\n",mode:"clear"}),this.compactObject=new Pr(this.material,!0,!0),this.clearObject=new Pr(this.clearMaterial,!1,!1)}attachHiZ(A){this.hiZMaterial||(this.hiZMaterial=new Hr(this.device,this.ctorOpts,{name:"CullCompactHiZ",entryPoint:"cullCompact",shader:()=>Yr,mode:"cull-hiz",hiz:{hiz0:A.sample0,hiz1:A.sample1,hiz2:A.sample2}}),this.hiZCompactObject=new Pr(this.hiZMaterial,!0,!0))}clearHiZBindGroups(){this.hiZCompactObject?.clearBindGroups(),this.hiZCompactObject&&(this.hiZCompactObject.variant=null)}clearBindGroups(){this.compactObject.clearBindGroups(),this.clearObject.clearBindGroups(),this.hiZCompactObject?.clearBindGroups()}update(){const A=this.material.update();return A&&this.clearBindGroups(),A}compute(A){const{encoder:t,pipelineCache:e}=A,i=this.material,s=i.cullSourceIndices.drawCount,n=i.indirectArgs.drawCount;if(n<=0)return;const r=e.device,a=this.clearObject,o=this.compactObject,l=this.clearMaterial;l.setInstanceCount(r,n),s>0&&i.setInstanceCount(r,s),Nr(a,e,"clearIndirectCounts");const c=!0===A.occlusionHiZ&&null!=this.hiZMaterial&&null!=this.hiZCompactObject,h=c?this.hiZMaterial:i,u=c?this.hiZCompactObject:o;s>0&&c&&h.setInstanceCount(r,s),s>0&&Nr(u,e,"cullCompact");const g=this.passCtx??=new Ur(r,{name:"cullCompactPass"});g.beginComputePass(t);const d=l.workgroupSize[0]||64;if(g.dispatchObject(a,Math.ceil(n/d),1,1),s>0){const A=h.workgroupSize[0]||64,[t,e]=kr(s,A,Rr(r));g.dispatchObject(u,t,e,1)}g.endPass()}dispose(){this.clearBindGroups(),this.passCtx?.dispose(),this.passCtx=null}}const Vr=z.COMPUTE,Jr=96,Wr=new wt("ShadowCullParams",[{name:"viewCount",format:"u32"},{name:"srcCount",format:"u32"},{name:"batchCap",format:"u32"},{name:"dstStride",format:"u32"}]);Wr.computeLayout();const qr=`\nfn clearShadowCounts() {\n let i = ${Fr(64)};\n if (i >= cullParams.viewCount * cullParams.batchCap) { return; }\n atomicStore(&indirectArgs[i * 5u + 1u], 0u);\n}\n`,Xr=`\nconst ALIVE_VISIBLE: u32 = 3u;\nconst INVALID: u32 = 0xffffffffu;\n\nfn cullShadow() {\n let slot = ${Fr(64)};\n if (slot >= cullParams.srcCount) { return; }\n let poolIndex = sourceIndices[slot];\n let im = instanceMeta[poolIndex];\n if ((im.drawGroupId & ALIVE_VISIBLE) != ALIVE_VISIBLE) { return; }\n let boundIndex = im.geometrySlot;\n if (boundIndex == INVALID) { return; }\n let localCenter = bounding[boundIndex];\n let radius = localCenter.w;\n let M = worldMatrices[poolIndex];\n let worldCenter = (M * vec4<f32>(localCenter.xyz, 1.0)).xyz;\n let ax = M[0].xyz;\n let ay = M[1].xyz;\n let az = M[2].xyz;\n // 谱范数上界(M^T M 的 Gershgorin 圆):列正交时等于最大列长,剪切时不会把球算小。\n let gxy = abs(dot(ax, ay));\n let gxz = abs(dot(ax, az));\n let gyz = abs(dot(ay, az));\n let worldRadius = radius * sqrt(max(dot(ax, ax) + gxy + gxz, max(dot(ay, ay) + gxy + gyz, dot(az, az) + gxz + gyz)));\n let batchId = im.drawGroupId >> 2u;\n let rangeBase = cullBatches[batchId];\n if (rangeBase == INVALID) { return; }\n let viewCount = cullParams.viewCount;\n let batchCap = cullParams.batchCap;\n let dstStride = cullParams.dstStride;\n for (var v = 0u; v < viewCount; v++) {\n var inFrustum = true;\n let po = v * 6u;\n for (var i = 0u; i < 6u; i++) {\n let p = shadowViews[po + i];\n if (dot(p.xyz, worldCenter) + p.w < -worldRadius) {\n inFrustum = false;\n break;\n }\n }\n if (inFrustum) {\n let dstOff = atomicAdd(&indirectArgs[(v * batchCap + batchId) * 5u + 1u], 1u);\n instanceIndices[v * dstStride + rangeBase + dstOff] = poolIndex;\n }\n }\n}\n`;class Zr extends vr{constructor(A,t){super({workgroupSize:[64,1,1],entryPoint:"clearShadowCounts",shader:()=>qr}),this.name="ShadowCullClear",this.addBinding(A,!1),this.addBinding(t,!1)}}class _r extends vr{constructor(A,t,e,i,s,n){super({workgroupSize:[64,1,1],entryPoint:"cullShadow",shader:()=>Xr}),this.name="ShadowCullCompact",this.addBinding(A,!1),this.addBinding(t,!1),this.addBinding(e,!1),this.addBinding(i,!1),this.addBinding(s,!1),this.addBinding(n,!1)}}class $r{clearObject;compactObject;csParams;csViews;csBatches;source;dest;args;passCtx=null;constructor(A,t,e){this.source=A,this.dest=t,this.args=e,this.csParams=new Zt("cullParams",Wr,{access:"Uniform",visibility:Vr}),this.csViews=new Ht("shadowViews",new Float32Array(2304),"f32",{access:"Uniform",visibility:Vr,isArray:!0,count:576,usage:j.UNIFORM|j.COPY_DST}),this.csBatches=new zt("cullBatches",new Uint32Array(1),"u32",{access:"ReadOnly",visibility:Vr,isArray:!0,isDynamicArray:!0});const i=new Zr(this.csParams,e.binding),s=new _r(this.csViews,A.binding,this.csBatches,t.csBinding,e.binding,this.csParams);this.clearObject=new Pr(i,!1,!1),this.compactObject=new Pr(s,!1,!0)}batchesGpu=null;syncShared(A){this.csBatches.setCount(Math.max(1,A.count)),function(A,t){const e=A.dataView,i=t.dataView,s=i.buffer;e.buffer=s,e.offset=i.offset,e.view=i.view,e.ownsBuffer=!1,e.size=i.size??(s?s.size-(0|i.offset):e.size)}(this.csBatches,A.binding);const t=A.binding.dataView.buffer;t!==this.batchesGpu&&(this.batchesGpu=t,this.clearBindGroups())}clearBindGroups(){this.clearObject.clearBindGroups(),this.compactObject.clearBindGroups()}writeParams(A,t,e,i,s){const n=this.csParams;n.dataView.buffer||n.createGPUBuffer(A);const r=n.dataView.view.u32;r[0]=t>>>0,r[1]=e>>>0,r[2]=i>>>0,r[3]=s>>>0,n.isDirty=!0,n.updateGPUBuffer(A)}writeViews(A,t){const e=this.csViews;e.dataView.buffer||e.createGPUBuffer(A);const i=e.dataView.buffer,s=0|e.dataView.offset;A.queue.writeBuffer(i,s,t.buffer,t.byteOffset,t.byteLength)}compute(A,t,e,i){if(i<=0)return;const s=t.device,n=this.clearObject,r=this.compactObject;Nr(n,t),e>0&&Nr(r,t);const a=this.passCtx??=new Ur(s,{name:"shadowCullPass"}),o=Rr(s);a.beginComputePass(A);const[l,c]=kr(i,64,o);if(a.dispatchObject(n,l,c,1),e>0){const[A,t]=kr(e,64,o);a.dispatchObject(r,A,t,1)}a.endPass()}dispose(){this.clearBindGroups(),this.passCtx?.dispose(),this.passCtx=null,this.csParams.releaseOwnedGpuBuffer(),this.csViews.releaseOwnedGpuBuffer()}}function Aa(A,t,e){for(let i=t;i<e;i++){const t=16*i;A[t]=1,A[t+1]=0,A[t+2]=0,A[t+3]=0,A[t+4]=0,A[t+5]=1,A[t+6]=0,A[t+7]=0,A[t+8]=0,A[t+9]=0,A[t+10]=1,A[t+11]=0,A[t+12]=0,A[t+13]=0,A[t+14]=0,A[t+15]=1}}function ta(A,t){const e=A.onChangeCallback.bind(A);A.onChangeCallback=()=>{t(),e()}}const ea=new v,ia=new v,sa=new v,na=new v,ra=new y,aa=new y,oa=new y,la=new y,ca=new y,ha=new y,ua=new y,ga=new y,da=new y,pa=1e-10;function fa(A,t){return 1===A[t]&&0===A[t+1]&&0===A[t+2]&&0===A[t+3]&&0===A[t+4]&&1===A[t+5]&&0===A[t+6]&&0===A[t+7]&&0===A[t+8]&&0===A[t+9]&&1===A[t+10]&&0===A[t+11]&&1===A[t+15]}function ma(A,t){const e=A[t],i=A[t+1],s=A[t+2],n=A[t+4],r=A[t+5],a=A[t+6],o=A[t+8],l=A[t+9],c=A[t+10],h=Math.abs(e*n+i*r+s*a),u=Math.abs(e*o+i*l+s*c),g=Math.abs(n*o+r*l+a*c),d=e*e+i*i+s*s+h+u,p=n*n+r*r+a*a+h+g,f=o*o+l*l+c*c+u+g;return Math.sqrt(d>p?d>f?d:f:p>f?p:f)}function Ca(A,t,e,i,s,n){const r=A[t+3]*e+A[t+7]*i+A[t+11]*s+A[t+15],a=0!==r?1/r:0;n.set((A[t]*e+A[t+4]*i+A[t+8]*s+A[t+12])*a,(A[t+1]*e+A[t+5]*i+A[t+9]*s+A[t+13])*a,(A[t+2]*e+A[t+6]*i+A[t+10]*s+A[t+14])*a)}const wa={cx:0,cy:0,cz:0,cr:0};function ya(A,t,e,i,s,n,r,a,o=wa){let l=0,c=0,h=0,u=0;for(let g=0;g<i;g++){const i=e+g*t;let o,d,p,f;if(fa(A,i))o=s+A[i+12],d=n+A[i+13],p=r+A[i+14],f=a;else{const t=A[i+3]*s+A[i+7]*n+A[i+11]*r+A[i+15],e=0!==t?1/t:0;o=(A[i]*s+A[i+4]*n+A[i+8]*r+A[i+12])*e,d=(A[i+1]*s+A[i+5]*n+A[i+9]*r+A[i+13])*e,p=(A[i+2]*s+A[i+6]*n+A[i+10]*r+A[i+14])*e,f=a*ma(A,i)}if(0===g){l=o,c=d,h=p,u=f;continue}const m=o-l,C=d-c,w=p-h,y=Math.sqrt(m*m+C*C+w*w);if(y+f<=u)continue;if(y+u<=f){l=o,c=d,h=p,u=f;continue}const B=.5*(u+f+y);if(y>0){const A=(B-u)/y;l+=m*A,c+=C*A,h+=w*A}u=B}return o.cx=l,o.cy=c,o.cz=h,o.cr=u,o}function Ba(A,t,e,i,s){s.copy(A);const n=A.data,r=s.data;r[12]=n[0]*t+n[4]*e+n[8]*i+n[12],r[13]=n[1]*t+n[5]*e+n[9]*i+n[13],r[14]=n[2]*t+n[6]*e+n[10]*i+n[14],r[15]=n[3]*t+n[7]*e+n[11]*i+n[15]}function Ia(A,t,e,i,s){const n=e.x-A.x,r=e.y-A.y,a=e.z-A.z,o=n*t.x+r*t.y+a*t.z,l=n*n+r*r+a*a-o*o,c=i*i;if(l>c)return null;const h=Math.sqrt(c-l),u=o-h,g=o+h;if(g<0)return null;const d=u<0?g:u;return s.set(A.x+t.x*d,A.y+t.y*d,A.z+t.z*d),s}function Qa(A,t,e){const i=1/(t.x||pa),s=1/(t.y||pa),n=1/(t.z||pa);let r=i>=0?(e.min.x-A.x)*i:(e.max.x-A.x)*i,a=i>=0?(e.max.x-A.x)*i:(e.min.x-A.x)*i;const o=s>=0?(e.min.y-A.y)*s:(e.max.y-A.y)*s,l=s>=0?(e.max.y-A.y)*s:(e.min.y-A.y)*s;if(r>l||o>a)return!1;(o>r||Number.isNaN(r))&&(r=o),(l<a||Number.isNaN(a))&&(a=l);const c=n>=0?(e.min.z-A.z)*n:(e.max.z-A.z)*n,h=n>=0?(e.max.z-A.z)*n:(e.min.z-A.z)*n;return!(r>h||c>a)&&((c>r||Number.isNaN(r))&&(r=c),(h<a||Number.isNaN(a))&&(a=h),a>=0)}const Ea=z.VERTEX,xa=j.STORAGE|j.COPY_DST;function Da(){return{visible:new zt("instancedVisible",new Uint32Array(4),"u32",{access:"ReadOnly",isArray:!0,isDynamicArray:!0,count:4,visibility:Ea,usage:xa,fixedSlot:1}),mats:new zt("instancedMats",new Float32Array(16),"vec4f",{access:"ReadOnly",isArray:!0,isDynamicArray:!0,count:4,visibility:Ea,usage:xa,fixedSlot:2}),f32:new zt("instancedF32",new Float32Array(4),"f32",{access:"ReadOnly",isArray:!0,isDynamicArray:!0,count:4,visibility:Ea,usage:xa,fixedSlot:3})}}function Ma(A,t,e,i,s,n,r,a,o){const l=A.visible.dataView;l.buffer=e,l.offset=0,l.size=e.size,t.visible=e,t.visSize=e.size;const c=A.mats.dataView;c.buffer=i,c.offset=s,c.size=n,t.mats=i,t.matsOff=s,t.matsSize=n;const h=A.f32.dataView;h.buffer=r,h.offset=a,h.size=o,t.f32=r,t.f32Off=a,t.f32Size=o}class ba extends Os{type="InstancedMesh";isInstancedMesh=!0;isInstancedDraw=!0;bindingStartIndex=0;#es;get instanceMatrix(){return this.#es}#is;#ss;#ns={object:null,visible:null,visSize:0,mats:null,matsOff:0,matsSize:0,f32:null,f32Off:0,f32Size:0};cullArgsSlot=-1;cullVisibleBase=0;matrixEpoch=0;#rs=-1;#as=-1;#os=0;#ls=0;#cs=0;#hs=0;#us=0;#gs=0;#ds=0;#ps=-1;#fs=Number.NaN;#ms=Number.NaN;#Cs=Number.NaN;#ws=Number.NaN;constructor(A,t,e){super(A,t),this.count=Math.max(1,0|e);const i=new Fi(new Float32Array(16*this.count),"mat4");i.stepMode="instance",i.skipGpu=!0,Aa(i.view,0,this.count),this.#es=i,ta(i,()=>{this.matrixEpoch=this.matrixEpoch+1|0});const s=new Wi;s.setAttribute("instanceMatrix",i),this.vertexStreams=s;const n=new zt("poolIndex",0,"u32",{access:"Uniform",visibility:Ea}),r=new zt("clipPacked",65535,"u32",{access:"Uniform",visibility:Ea}),a=new zt("visibleBase",0,"u32",{access:"Uniform",visibility:Ea}),o=new zt("matVec4Base",0,"u32",{access:"Uniform",visibility:Ea}),l=new zt("colorF32Base",0,"u32",{access:"Uniform",visibility:Ea}),c=new zt("colorStride",0,"u32",{access:"Uniform",visibility:Ea}),h=new zt("_cullPad0",0,"u32",{access:"Uniform",visibility:Ea}),u=new zt("_cullPad1",0,"u32",{access:"Uniform",visibility:Ea});this.#is=new Xt("instancedObject",[n,r,a,o,l,c,h,u],{access:"Uniform",mode:"struct",visibility:Ea}),this.addBinding(this.#is,!1),this.#ss=Da(),this.addBinding(this.#ss.visible,!1),this.addBinding(this.#ss.mats,!1),this.addBinding(this.#ss.f32,!1)}getCullHandle(){return this}attachInstancedStorage(A,t,e,i,s,n,r){Ma(this.#ss,this.#ns,A,t,e,i,s,n,r)}setInstancedCullLookups(A,t,e,i){this.cullVisibleBase=A>>>0,this.#os=t>>>0,this.#ls=e>>>0,this.#cs=i>>>0,this.#rs=-1}setMatrixAt(A,t){if(A<0||A>=this.count)return this;const e=this.#es;return e.view.set(t.elements,16*A),e.isDirty||e.onChangeCallback(),this.matrixEpoch=this.matrixEpoch+1|0,this}getMatrixAt(A,t){return A<0||A>=this.count?t.identity():t.fromArray(this.#es.view,16*A)}syncInstancedObject(A,t){return this.#rs===A&&this.#as===t?this.#is.isDirty:(this.#rs=A,this.#as=t,this.#is.setValue({poolIndex:A,clipPacked:t,visibleBase:this.cullVisibleBase,matVec4Base:this.#os,colorF32Base:this.#ls,colorStride:this.#cs}),!0)}flushInstancedObject(A){const t=this.#is;t.updateCPUBuffer(),t.updateGPUBuffer(A)}getBindGroupCacheToken(){const A=this.#ns,t=this.#is.dataView.buffer??null;return A.object!==t&&(A.object=t),A}get instanceColor(){return this._vertexStreams?.getAttribute("instanceColor")??null}set instanceColor(A){const t=this._vertexStreams;t&&A!==t.getAttribute("instanceColor")&&(A?(A.stepMode="instance",t.setAttribute("instanceColor",A)):t.deleteAttribute("instanceColor"),this.onChangeCallback(f.DIRTY_STRUCTURE))}setCount(A){const t=Math.max(1,0|A),e=this.count;if(t===e)return;const i=this.#es;i.resize(t),t>e&&Aa(i.view,e,t),this._vertexStreams?.getAttribute("instanceColor")?.resize(t),this.count=t,this.matrixEpoch=this.matrixEpoch+1|0,this.onChangeCallback(f.DIRTY_STRUCTURE)}copy(A,t=!0){super.copy(A,t);const e=this._vertexStreams?.getAttribute("instanceMatrix");return e&&(ta(e,()=>{this.matrixEpoch=this.matrixEpoch+1|0}),this.#es=e,this.count=e.count),this.matrixEpoch=this.matrixEpoch+1|0,this.#ps=-1,this}clone(A=!0){return new ba(this.geometry,this.material,this.count).copy(this,A)}raycast(A,t){if(null==this.material)return;const e=this.geometry,i=e.boundingBox??e.computeBoundingBox();if(!i)return;const s=this.matrixWorld,n=this.count,r=this.instanceMatrix,a=r.view,o=r.stride,l=r.typeInfo?.offset??0,c=i.center.x,h=i.center.y,u=i.center.z,g=i.center.w;this.#ys(a,o,l,n,c,h,u,g);const d=A.ray.origin,p=A.ray.direction,f=A.near,m=A.far-f,C=m*m;oa.set(this.#hs,this.#us,this.#gs),oa.applyMatrix4(s);const w=this.#ds*ma(s.elements,0);if(ra.copy(d),ra.x+=p.x*f,ra.y+=p.y*f,ra.z+=p.z*f,oa.distanceToSquared(ra)>w*w){if(null===Ia(ra,p,oa,w,aa))return;if(ra.distanceToSquared(aa)>C)return}ea.copy(s).invert(),la.copy(d).applyMatrix4(ea),ca.copy(p).transformDirection(ea),ha.copy(ca).normalize();const y=!1!==A.firstHitOnly&&!0!==A.closestOnly,B=e.boundingBox;$i();try{for(let e=0;e<n;e++){const i=l+e*o;if(fa(a,i)){const n=a[i+12],r=a[i+13],o=a[i+14];if(da.set(c+n,h+r,u+o),!Sa(la,ha,da,g))continue;if(0===n&&0===r&&0===o){if(null!=B&&!Qa(la,ca,B))continue;const i=t.length;if(this._computeIntersections(A,t,la,ca,s,e),y&&t.length>i)return;continue}if(ua.set(la.x-n,la.y-r,la.z-o),null!=B&&!Qa(ua,ca,B))continue;Ba(s,n,r,o,na);const l=t.length;if(this._computeIntersections(A,t,ua,ca,na,e),y&&t.length>l)return;continue}const n=ma(a,i);if(0===n)continue;if(Ca(a,i,c,h,u,da),!Sa(la,ha,da,g*n))continue;if(sa.fromArray(a,i).invert(),ua.copy(la).applyMatrix4(sa),ga.copy(ca).transformDirection(sa),null!=B&&!Qa(ua,ga,B))continue;ia.fromArray(a,i),na.multiplyMatrices(s,ia);const r=t.length;if(this._computeIntersections(A,t,ua,ga,na,e),y&&t.length>r)return}}finally{As()}}expandWorldAABB(A,t){const e=this.geometry,i=e.boundingBox??e.computeBoundingBox();if(!i)return!1;const s=i.center,n=this.instanceMatrix,r=n.view;this.#ys(r,n.stride,n.typeInfo?.offset??0,this.count,s.x,s.y,s.z,s.w);const a=this.matrixWorld;oa.set(this.#hs,this.#us,this.#gs).applyMatrix4(a);const o=this.#ds*ma(a.elements,0),l=oa.x-o,c=oa.y-o,h=oa.z-o,u=oa.x+o,g=oa.y+o,d=oa.z+o;return l<A.x&&(A.x=l),c<A.y&&(A.y=c),h<A.z&&(A.z=h),u>t.x&&(t.x=u),g>t.y&&(t.y=g),d>t.z&&(t.z=d),!0}#ys(A,t,e,i,s,n,r,a){this.#ps===this.matrixEpoch&&s===this.#ms&&n===this.#Cs&&r===this.#ws&&a===this.#fs||(this.#Bs(A,t,e,i,s,n,r,a),this.#ms=s,this.#Cs=n,this.#ws=r,this.#fs=a,this.#ps=this.matrixEpoch)}#Bs(A,t,e,i,s,n,r,a){const o=ya(A,t,e,i,s,n,r,a);this.#hs=o.cx,this.#us=o.cy,this.#gs=o.cz,this.#ds=o.cr}}function Sa(A,t,e,i){const s=i*i;return e.distanceToSquared(A)<=s||null!==Ia(A,t,e,i,aa)}const va=z.COMPUTE,Ta=j.STORAGE|j.COPY_DST|j.COPY_SRC,Ua=12,Na=64,Pa=Fr(Na),Oa=new wt("InstancedCullJob",[{name:"visibleBase",format:"u32"},{name:"count",format:"u32"},{name:"worldPool",format:"u32"},{name:"argsSlot",format:"u32"},{name:"matVec4Base",format:"u32"},{name:"partCount",format:"u32"},{name:"_pad0",format:"u32"},{name:"_pad1",format:"u32"},{name:"sphere",format:"vec4f"}],{useStandardLayout:!0});Oa.computeLayout();const Fa=new v,ka=new v,Ra=new y,La=jr+`\nconst WG: u32 = 64u;\nconst INVALID: u32 = 0xffffffffu;\nconst FLAG_ANY: u32 = 1u;\nconst FLAG_MIX: u32 = 2u;\nvar<workgroup> wgVis: array<u32, WG>;\nvar<workgroup> wgDst: u32;\nvar<workgroup> wgFirstJob: atomic<u32>;\nvar<workgroup> wgFlags: atomic<u32>;\nvar<workgroup> wgF: u32;\n\nfn emitInstanced(visibleBase: u32, dst: u32, localI: u32, c0: vec4<f32>, c1: vec4<f32>, c2: vec4<f32>) {\n visible[visibleBase + dst] = localI;\n let pb = (visibleBase + dst) * 3u;\n packedWorld[pb] = c0;\n packedWorld[pb + 1u] = c1;\n packedWorld[pb + 2u] = c2;\n}\n\nfn cullInstancedCompact() {\n let i = ${Pa};\n let lid = localInvocationIndex;\n\n var vis = 0u;\n var localI = 0u;\n var visibleBase = 0u;\n var argsSlot = 0u;\n var ji = 0u;\n var c0 = vec4<f32>(0.0);\n var c1 = vec4<f32>(0.0);\n var c2 = vec4<f32>(0.0);\n\n if (i < instanceCount) {\n ji = srcJob[i];\n let job = jobs[ji];\n localI = i - job.visibleBase;\n visibleBase = job.visibleBase;\n argsSlot = job.argsSlot;\n let base = job.matVec4Base + localI * 4u;\n let Mi = mat4x4<f32>(\n instancedMats[base],\n instancedMats[base + 1u],\n instancedMats[base + 2u],\n instancedMats[base + 3u],\n );\n let M = worldMatrices[job.worldPool] * Mi;\n let localCenter = job.sphere.xyz;\n let radius = job.sphere.w;\n let worldCenter = (M * vec4<f32>(localCenter, 1.0)).xyz;\n let ax = M[0].xyz;\n let ay = M[1].xyz;\n let az = M[2].xyz;\n // 谱范数上界(M^T M 的 Gershgorin 圆):列正交时等于最大列长,剪切时不会把球算小。\n let gxy = abs(dot(ax, ay));\n let gxz = abs(dot(ax, az));\n let gyz = abs(dot(ay, az));\n let worldRadius = radius * sqrt(max(dot(ax, ax) + gxy + gxz, max(dot(ay, ay) + gxy + gyz, dot(az, az) + gxz + gyz)));\n var culled = false;\n let maxDist = camera.maxDistance;\n if (maxDist > 0.0) {\n let viewCenter = (camera.viewMatrix * vec4<f32>(worldCenter, 1.0)).xyz;\n if (length(viewCenter) - worldRadius > maxDist) { culled = true; }\n }\n var kept = false;\n if (!culled) {\n var inFrustum = true;\n for (var p = 0u; p < 6u; p++) {\n let plane = camera.frustumPlanes[p];\n if (dot(plane.xyz, worldCenter) + plane.w < -worldRadius) {\n inFrustum = false;\n break;\n }\n }\n if (inFrustum && !culledByScreenPixels(worldCenter, worldRadius)) {\n kept = true;\n /*HIZ*/\n }\n }\n if (kept) {\n vis = 1u;\n c0 = vec4<f32>(Mi[0].xyz, Mi[3].x);\n c1 = vec4<f32>(Mi[1].xyz, Mi[3].y);\n c2 = vec4<f32>(Mi[2].xyz, Mi[3].z);\n }\n }\n\n wgVis[lid] = vis;\n if (lid == 0u) {\n atomicStore(&wgFirstJob, INVALID);\n atomicStore(&wgFlags, 0u);\n }\n workgroupBarrier();\n\n if (vis == 1u) {\n atomicOr(&wgFlags, FLAG_ANY);\n var expected = INVALID;\n loop {\n let r = atomicCompareExchangeWeak(&wgFirstJob, expected, ji);\n if (r.exchanged) { break; }\n expected = r.old_value;\n if (expected != INVALID) { break; }\n }\n if (atomicLoad(&wgFirstJob) != ji) {\n atomicOr(&wgFlags, FLAG_MIX);\n }\n }\n workgroupBarrier();\n\n if (lid == 0u) { wgF = atomicLoad(&wgFlags); }\n let flags = workgroupUniformLoad(&wgF);\n if ((flags & FLAG_ANY) == 0u) { return; }\n if ((flags & FLAG_MIX) != 0u) {\n if (vis == 1u) {\n let dst = atomicAdd(&indirectArgs[argsSlot * 5u + 1u], 1u);\n emitInstanced(visibleBase, dst, localI, c0, c1, c2);\n }\n return;\n }\n\n for (var s = 1u; s < WG; s = s * 2u) {\n var v = 0u;\n if (lid >= s) { v = wgVis[lid - s]; }\n workgroupBarrier();\n wgVis[lid] = wgVis[lid] + v;\n workgroupBarrier();\n }\n let exclusive = wgVis[lid] - vis;\n let total = wgVis[WG - 1u];\n if (lid == 0u) {\n let slot = jobs[atomicLoad(&wgFirstJob)].argsSlot;\n wgDst = atomicAdd(&indirectArgs[slot * 5u + 1u], total);\n }\n workgroupBarrier();\n if (vis == 1u) {\n emitInstanced(visibleBase, wgDst + exclusive, localI, c0, c1, c2);\n }\n}\n`,ja=Gr+La.replace("/*HIZ*/","if (occludedByHiZ(worldCenter, worldRadius)) { kept = false; }"),za="\nfn clearInstancedCounts() {\n let i = globalInvocationId.x;\n if (i >= instanceCount) { return; }\n atomicStore(&indirectArgs[i * 5u + 1u], 0u);\n}\n",Ga=new wt("InstancedShadowParams",[{name:"viewCount",format:"u32"},{name:"srcCount",format:"u32"},{name:"argsCap",format:"u32"},{name:"visStride",format:"u32"}]);Ga.computeLayout();const Ya=`\nfn cullInstancedShadow() {\n let i = ${Pa};\n if (i >= instanceCount) { return; }\n let ji = srcJob[i];\n let job = jobs[ji];\n let localI = i - job.visibleBase;\n let base = job.matVec4Base + localI * 4u;\n let Mi = mat4x4<f32>(\n instancedMats[base],\n instancedMats[base + 1u],\n instancedMats[base + 2u],\n instancedMats[base + 3u],\n );\n let M = worldMatrices[job.worldPool] * Mi;\n let localCenter = job.sphere.xyz;\n let radius = job.sphere.w;\n let worldCenter = (M * vec4<f32>(localCenter, 1.0)).xyz;\n let ax = M[0].xyz;\n let ay = M[1].xyz;\n let az = M[2].xyz;\n // 谱范数上界(M^T M 的 Gershgorin 圆):列正交时等于最大列长,剪切时不会把球算小。\n let gxy = abs(dot(ax, ay));\n let gxz = abs(dot(ax, az));\n let gyz = abs(dot(ay, az));\n let worldRadius = radius * sqrt(max(dot(ax, ax) + gxy + gxz, max(dot(ay, ay) + gxy + gyz, dot(az, az) + gxz + gyz)));\n let viewCount = shadowParams.viewCount;\n let argsCap = shadowParams.argsCap;\n let visStride = shadowParams.visStride;\n for (var v = 0u; v < viewCount; v++) {\n var inFrustum = true;\n let po = v * 6u;\n for (var p = 0u; p < 6u; p++) {\n let plane = shadowViews[po + p];\n if (dot(plane.xyz, worldCenter) + plane.w < -worldRadius) {\n inFrustum = false;\n break;\n }\n }\n if (inFrustum) {\n let dst = atomicAdd(&indirectArgs[(v * argsCap + job.argsSlot) * 5u + 1u], 1u);\n shadowVisible[v * visStride + job.visibleBase + dst] = localI;\n }\n }\n}\n`;function Ha(A,t){const e=A.geometry,i=e.boundingBox??e.computeBoundingBox();if(!i)return t.x=t.y=t.z=0,void(t.r=0);const s=i.center;t.x=s.x,t.y=s.y,t.z=s.z,t.r=s.w}function Ka(A,t,e){const i=e>>>0;(A.getValue()!==i||A.isDirty)&&(A.setValue(i),A.updateCPUBuffer(),A.updateGPUBuffer(t))}class Va extends vr{type="InstancedCullMaterialNode";instanceCountBinding;jobsBinding;visibleBinding;matsBinding;indirectArgsBinding;constructor(A,t,e){super({workgroupSize:[Na,1,1],entryPoint:e.entryPoint,shader:e.shader}),this.name=e.name,this.injectWgslFragment="";const i=e.mode;this.jobsBinding=null,this.visibleBinding=null,this.matsBinding=null,"cull-hiz"===i&&e.hiz&&(this.addBinding(e.hiz.hiz0,!1),this.addBinding(e.hiz.hiz1,!1),this.addBinding(e.hiz.hiz2,!1)),"compact"!==i&&"cull-hiz"!==i||!t?"scatter"===i&&t&&(this.jobsBinding=t.jobs,this.addBinding(t.jobs,!1)):(this.jobsBinding=t.jobs,this.addBinding(t.jobs,!1),this.visibleBinding=t.visible,this.addBinding(t.visible,!1),this.matsBinding=t.mats,this.addBinding(t.mats,!1),t.packed&&this.addBinding(t.packed,!1),t.srcJob&&this.addBinding(t.srcJob,!1)),this.indirectArgsBinding=A.binding,this.addBinding(this.indirectArgsBinding,!1),this.instanceCountBinding=new zt("instanceCount",0,"u32",{visibility:va,access:"Uniform",usage:j.UNIFORM|j.COPY_DST}),this.addBinding(this.instanceCountBinding,!1)}setInstanceCount(A,t){Ka(this.instanceCountBinding,A,t)}}class Ja extends vr{type="InstancedShadowCompactNode";instanceCountBinding;constructor(A,t,e,i,s,n,r,a){super({workgroupSize:[Na,1,1],entryPoint:a.entryPoint,shader:a.shader}),this.name=a.name,this.injectWgslFragment="";const o=a.mode;"compact"===o?(this.addBinding(t,!1),this.addBinding(i,!1),this.addBinding(e,!1),this.addBinding(s,!1),this.addBinding(n,!1),this.addBinding(r,!1)):"scatter"===o?(this.addBinding(t,!1),this.addBinding(n,!1)):this.addBinding(n,!1),this.addBinding(A.binding,!1),this.instanceCountBinding=new zt("instanceCount",0,"u32",{visibility:va,access:"Uniform",usage:j.UNIFORM|j.COPY_DST}),this.addBinding(this.instanceCountBinding,!1)}setInstanceCount(A,t){Ka(this.instanceCountBinding,A,t)}}class Wa{indirectArgs;canonicalArgsSlots=[];device;align;jobsArray;jobs;visible;mats;packed;srcJob;compactMaterial;clearMaterial;scatterMaterial=null;hiZMaterial=null;compactObject;clearObject;scatterObject=null;hiZCompactObject=null;shadowArgs;shadowVisible;shadowParams;shadowViews;shadowClearMaterial=null;shadowCompactMaterial=null;shadowScatterMaterial=null;shadowClearObject=null;shadowCompactObject=null;shadowScatterObject=null;passCtx=null;jobCpu=new Uint32Array(Ua);jobF32=new Float32Array(this.jobCpu.buffer);jobCount=0;argsCount=0;needScatter=!1;jobMats=[];handleJobs=[];layoutWatch=[];streamBinds=[];lastMatsBuf=null;sphereScratch={x:0,y:0,z:0,r:0};visibleTotal=0;groups=new Map;groupOrder=[];groupIndex=new Map;meshStream=new Map;partsBySlot=new Map;partsBySlotStale=!0;touchedJobs=[];jobTouchGen=[];touchGen=1;firstDirty=2147483647;bindDirty=!1;jobsReady=!1;shadowViewCount=0;shadowArgsCap=0;shadowVisStride=0;shadowReady=!1;constructor(A){this.device=A,this.align=Math.max(A.limits.minStorageBufferOffsetAlignment||256,4),this.indirectArgs=new wr(A,64),this.jobsArray=new yt(1,Oa,{isStandardLayout:!0,count:1,isAutoGrow:!0,isAutoShrink:!1}),this.jobs=new Zt("jobs",this.jobsArray,{visibility:va,access:"ReadOnly",isArray:!0,isDynamicArray:!0,isStandardLayout:!0,count:1,usage:Ta}),this.jobs.setCount(1,!0),this.jobCpu=this.jobsArray.u32,this.jobF32=this.jobsArray.f32,this.visible=new zt("visible",new Uint32Array(4),"u32",{visibility:va,access:"ReadWrite",isArray:!0,isDynamicArray:!0,count:4,usage:Ta}),this.visible.setCount(4,!0);const t=new Float32Array(16);this.mats=new zt("instancedMats",t,"vec4f",{visibility:va,access:"ReadOnly",isArray:!0,isDynamicArray:!0,count:4,usage:Ta}),this.mats.setCount(4,!0),this.packed=new zt("packedWorld",new Float32Array(4),"vec4f",{visibility:va,access:"ReadWrite",isArray:!0,isDynamicArray:!0,count:4,usage:j.VERTEX|j.STORAGE|j.COPY_DST}),this.packed.setCount(4,!0);const e=new Uint32Array(4);this.srcJob=new zt("srcJob",e,"u32",{visibility:va,access:"ReadOnly",isArray:!0,isDynamicArray:!0,count:4,usage:Ta}),this.srcJob.setCount(4,!0),this.shadowArgs=new wr(A,64),this.shadowVisible=new zt("shadowVisible",new Uint32Array(4),"u32",{visibility:va,access:"ReadWrite",isArray:!0,isDynamicArray:!0,count:4,usage:Ta}),this.shadowVisible.setCount(4,!0),this.shadowParams=new Zt("shadowParams",Ga,{access:"Uniform",visibility:va}),this.shadowViews=new Ht("shadowViews",new Float32Array(2304),"f32",{access:"Uniform",visibility:va,isArray:!0,count:576,usage:j.UNIFORM|j.COPY_DST});const i={jobs:this.jobs,visible:this.visible,mats:this.mats,packed:this.packed,srcJob:this.srcJob};this.compactMaterial=new Va(this.indirectArgs,i,{name:"InstancedCullCompact",entryPoint:"cullInstancedCompact",shader:()=>La,mode:"compact"}),this.clearMaterial=new Va(this.indirectArgs,null,{name:"ClearInstancedCounts",entryPoint:"clearInstancedCounts",shader:()=>za,mode:"clear"}),this.compactObject=new Pr(this.compactMaterial,!0,!0),this.clearObject=new Pr(this.clearMaterial,!1,!1)}get packedGpuBuffer(){return this.packed.dataView.buffer??null}get shadowVisibleBinding(){return this.shadowVisible}get instancedArgsCap(){return this.shadowArgsCap}attachHiZ(A){this.hiZMaterial||(this.hiZMaterial=new Va(this.indirectArgs,{jobs:this.jobs,visible:this.visible,mats:this.mats,packed:this.packed,srcJob:this.srcJob},{name:"InstancedCullCompactHiZ",entryPoint:"cullInstancedCompact",shader:()=>ja,mode:"cull-hiz",hiz:{hiz0:A.sample0,hiz1:A.sample1,hiz2:A.sample2}}),this.hiZCompactObject=new Pr(this.hiZMaterial,!0,!0))}clearHiZBindGroups(){this.hiZCompactObject?.clearBindGroups(),this.hiZCompactObject&&(this.hiZCompactObject.variant=null)}refreshDrawTemplates(A,t){if(0===A.length||this.jobCount<=0)return;this.partsBySlotStale&&this.#Is();const e=this.partsBySlot,i=t.u32;for(let s=0,n=A.length;s<n;s++){const n=A[s],r=e.get(n);if(r)for(let A=0,e=r.length;A<e;A++){const e=r[A];e.geometry.boundIndex===n&&this.#Qs(e.cullArgsSlot,e,i,t)}}}#Is(){const A=this.partsBySlot;A.clear();const t=this.jobMats;for(let e=0,i=t.length;e<i;e++){const i=t[e].parts;for(let t=0,e=i.length;t<e;t++){const e=i[t],s=e.geometry.boundIndex;if(s<0)continue;let n=A.get(s);n||(n=[],A.set(s,n)),n.push(e)}}this.partsBySlotStale=!1}sync(A){this.#Es(A),this.jobsReady=!0,this.#xs()}compute(A){const{encoder:t,pipelineCache:e,skipCommit:i}=A;if(i?this.argsCount>0&&this.#Ds():(this.jobsReady||this.#Es(A),this.jobsReady=!1),this.argsCount<=0)return;this.#xs();const s=this.argsCount,n=e.device;this.indirectArgs.update(n)&&this.#Ms(),this.clearMaterial.setInstanceCount(n,s),Nr(this.clearObject,e,"clearInstancedCounts");const r=!0===A.occlusionHiZ&&null!=this.hiZMaterial&&null!=this.hiZCompactObject,a=r?this.hiZMaterial:this.compactMaterial,o=r?this.hiZCompactObject:this.compactObject;a.setInstanceCount(n,this.visibleTotal),Nr(o,e,"cullInstancedCompact");const l=this.passCtx??=new Ur(n,{name:"instancedCullPass"}),c=this.clearMaterial.workgroupSize[0]||Na,h=a.workgroupSize[0]||Na,[u,g]=kr(this.visibleTotal,h,Rr(n));let d=null,p=1;if(this.needScatter&&this.jobCount>0){const A=this.#bs();d=this.scatterObject,A.setInstanceCount(n,this.jobCount),Nr(d,e,"scatterInstancedCounts"),p=Math.ceil(this.jobCount/(A.workgroupSize[0]||Na))}l.beginComputePass(t),l.dispatchObject(this.clearObject,Math.ceil(s/c),1,1),l.dispatchObject(o,u,g,1),d&&l.dispatchObject(d,p,1,1),l.endPass()}prepareShadow(A,t,e){if(this.argsCount<=0||this.visibleTotal<=0||t<=0)return this.shadowReady=!1,!1;const i=this.argsCount,s=this.visibleTotal;this.shadowViewCount=t,this.shadowArgsCap=i,this.shadowVisStride=s,this.shadowArgs.ensureCapacity(t*i),this.shadowArgs.drawCount=t*i,this.shadowArgs.update(A),this.#Ss(A,t,i,s),this.#vs(this.shadowVisible,Math.max(t*s,4));const n=this.shadowVisible.dataView.buffer;return this.shadowVisible.createGPUBuffer(A),n!==this.shadowVisible.dataView.buffer&&this.#Ts(),this.#Us(A,t,this.visibleTotal,i,s),this.#Ns(A,e),this.shadowReady=!0,!0}computeShadow(A,t){if(!this.shadowReady||this.argsCount<=0)return;this.#Ps();const e=t.device;this.shadowArgs.update(e)&&this.#Ts();const i=this.shadowViewCount*this.shadowArgsCap,s=this.shadowClearMaterial,n=this.shadowCompactMaterial,r=this.shadowClearObject,a=this.shadowCompactObject;s.setInstanceCount(e,i),Nr(r,t,"clearInstancedCounts"),n.setInstanceCount(e,this.visibleTotal),Nr(a,t,"cullInstancedShadow");const o=this.passCtx??=new Ur(e,{name:"instancedCullPass"}),l=n.workgroupSize[0]||Na,[c,h]=kr(this.visibleTotal,l,Rr(e));let u=null,g=1;if(this.needScatter&&this.jobCount>0){const A=this.shadowScatterMaterial;u=this.shadowScatterObject,A.setInstanceCount(e,this.jobCount),Nr(u,t,"scatterInstancedShadowCounts"),g=Math.ceil(this.jobCount/Na)}o.beginComputePass(A),o.dispatchObject(r,Math.ceil(i/l),1,1),o.dispatchObject(a,c,h,1),u&&o.dispatchObject(u,g,1,1),o.endPass()}dispose(){this.#Ms(),this.#Ts(),this.passCtx?.dispose(),this.passCtx=null,this.indirectArgs.binding.releaseOwnedGpuBuffer(),this.shadowArgs.binding.releaseOwnedGpuBuffer(),this.jobs.releaseOwnedGpuBuffer(),this.visible.releaseOwnedGpuBuffer(),this.mats.releaseOwnedGpuBuffer(),this.packed.releaseOwnedGpuBuffer(),this.srcJob.releaseOwnedGpuBuffer(),this.shadowVisible.releaseOwnedGpuBuffer(),this.shadowParams.releaseOwnedGpuBuffer(),this.shadowViews.releaseOwnedGpuBuffer(),this.compactMaterial.instanceCountBinding.releaseOwnedGpuBuffer(),this.clearMaterial.instanceCountBinding.releaseOwnedGpuBuffer(),this.scatterMaterial?.instanceCountBinding.releaseOwnedGpuBuffer(),this.hiZMaterial?.instanceCountBinding.releaseOwnedGpuBuffer(),this.shadowClearMaterial?.instanceCountBinding.releaseOwnedGpuBuffer(),this.shadowCompactMaterial?.instanceCountBinding.releaseOwnedGpuBuffer(),this.shadowScatterMaterial?.instanceCountBinding.releaseOwnedGpuBuffer()}#Ms(){this.compactObject.clearBindGroups(),this.clearObject.clearBindGroups(),this.scatterObject?.clearBindGroups(),this.hiZCompactObject?.clearBindGroups(),this.lastMatsBuf=null}#Ts(){this.shadowClearObject?.clearBindGroups(),this.shadowCompactObject?.clearBindGroups(),this.shadowScatterObject?.clearBindGroups()}#bs(){if(this.scatterMaterial&&this.scatterObject)return this.scatterMaterial;const A=new Va(this.indirectArgs,{jobs:this.jobs,visible:this.visible,mats:this.mats},{name:"ScatterInstancedCounts",entryPoint:"scatterInstancedCounts",shader:()=>"\nfn scatterInstancedCounts() {\n let j = globalInvocationId.x;\n if (j >= instanceCount) { return; }\n let job = jobs[j];\n let n = job.partCount;\n if (n <= 1u) { return; }\n let c = atomicLoad(&indirectArgs[job.argsSlot * 5u + 1u]);\n for (var k = 1u; k < n; k++) {\n atomicStore(&indirectArgs[(job.argsSlot + k) * 5u + 1u], c);\n }\n}\n",mode:"scatter"});return this.scatterMaterial=A,this.scatterObject=new Pr(A,!1,!1),A}#Ps(){if(this.shadowClearMaterial&&this.shadowCompactMaterial)return;const A=this.shadowArgs,t=this.jobs,e=this.mats,i=this.srcJob,s=this.shadowViews,n=this.shadowParams,r=this.shadowVisible;this.shadowClearMaterial=new Ja(A,t,e,i,s,n,r,{name:"ClearInstancedShadowCounts",entryPoint:"clearInstancedCounts",shader:()=>za,mode:"clear"}),this.shadowCompactMaterial=new Ja(A,t,e,i,s,n,r,{name:"InstancedShadowCompact",entryPoint:"cullInstancedShadow",shader:()=>Ya,mode:"compact"}),this.shadowScatterMaterial=new Ja(A,t,e,i,s,n,r,{name:"ScatterInstancedShadowCounts",entryPoint:"scatterInstancedShadowCounts",shader:()=>"\nfn scatterInstancedShadowCounts() {\n let j = globalInvocationId.x;\n if (j >= instanceCount) { return; }\n let job = jobs[j];\n let n = job.partCount;\n if (n <= 1u) { return; }\n let viewCount = shadowParams.viewCount;\n let argsCap = shadowParams.argsCap;\n for (var v = 0u; v < viewCount; v++) {\n let c = atomicLoad(&indirectArgs[(v * argsCap + job.argsSlot) * 5u + 1u]);\n for (var k = 1u; k < n; k++) {\n atomicStore(&indirectArgs[(v * argsCap + job.argsSlot + k) * 5u + 1u], c);\n }\n }\n}\n",mode:"scatter"}),this.shadowClearObject=new Pr(this.shadowClearMaterial,!1,!1),this.shadowCompactObject=new Pr(this.shadowCompactMaterial,!1,!0),this.shadowScatterObject=new Pr(this.shadowScatterMaterial,!1,!1)}#Us(A,t,e,i,s){const n=this.shadowParams;n.dataView.buffer||n.createGPUBuffer(A);const r=n.dataView.view.u32;r[0]=t>>>0,r[1]=e>>>0,r[2]=i>>>0,r[3]=s>>>0,n.isDirty=!0,n.updateGPUBuffer(A)}#Ns(A,t){const e=this.shadowViews;e.dataView.buffer||e.createGPUBuffer(A);const i=e.dataView.buffer,s=0|e.dataView.offset;A.queue.writeBuffer(i,s,t.buffer,t.byteOffset,t.byteLength)}#Ss(A,t,e,i){const s=this.indirectArgs.cpuView,n=this.shadowArgs,r=n.cpuView,a=n.gpuBuffer,o=this.jobMats;for(let l=0,c=o.length;l<c;l++){const A=o[l],n=A.argsSlot,a=A.partCount,c=A.indexed,h=A.visibleBase>>>0;for(let o=0;o<a;o++){const A=n+o,a=5*A;for(let n=0;n<t;n++){const t=5*(n*e+A),o=n*i+h>>>0;r[t]=s[a],r[t+1]=0,r[t+2]=s[a+2],c?(r[t+3]=s[a+3],r[t+4]=o):(r[t+3]=o,r[t+4]=0)}}}A.queue.writeBuffer(a,0,r,0,t*e*5)}#Es(A){const t=this.#Os(A);if(this.jobCount<=0){if(!t)return;return void this.#Fs(A)}if(t){if(!this.#ks(A))return void this.#Fs(A);this.#Rs(A)}const e=A.geometryTables;this.#Ls(e)?this.#js(e)?this.#Fs(A):(this.#zs(A),t||this.#Ds()):t||this.#Ds()}#Os(A){const{addedList:t,removedList:e,structureList:i}=A;for(let s=0,n=t.length;s<n;s++)if(t[s].isInstancedDraw)return!0;for(let s=0,n=e.length;s<n;s++)if(e[s].isInstancedDraw)return!0;for(let s=0,n=i.length;s<n;s++)if(i[s].isInstancedDraw)return!0;return!1}#Ls(A){const t=this.layoutWatch;for(let e=0,i=t.length;e<i;e++){const i=t[e],s=A.getLayoutPools(i.layoutId);if(!s||s.bindingVersion!==i.bindingVersion)return!0}return!1}#Gs(A,t){const e=tn(t),i=this.layoutWatch;for(let n=0,r=i.length;n<r;n++)if(i[n].layoutId===e)return;const s=A.getLayoutPools(e);i.push({layoutId:e,bindingVersion:s?.bindingVersion??-1})}#Fs(A){this.groups.clear(),this.groupOrder.length=0,this.groupIndex.clear(),this.meshStream.clear(),this.touchedJobs.length=0,this.firstDirty=2147483647;const t=A.renderObjects.slots;for(let e=0,i=t.length;e<i;e++){const A=t[e];if(!A||"instanced"!==A.drawKind)continue;const i=A.encodeBatches;for(let t=0,e=i.length;t<e;t++){const A=i[t].members;for(let t=0,e=A.length;t<e;t++){const e=A[t].mesh;this.#Ys(e)&&this.#Hs(e,!1)}}}this.#Ks(),this.#Vs(A,0),this.touchedJobs.length=0,this.firstDirty=2147483647}#ks(A){this.touchGen=this.touchGen+1|0,0===this.touchGen&&(this.jobTouchGen.fill(0),this.touchGen=1),this.touchedJobs.length=0,this.firstDirty=2147483647;const t=A.removedList;for(let s=0,n=t.length;s<n;s++){const A=t[s];A.isInstancedDraw&&this.#Js(A)}const e=A.structureList;for(let s=0,n=e.length;s<n;s++){const A=e[s];if(!A.isInstancedDraw)continue;if(!this.#Ys(A)){this.#Js(A);continue}if(!this.meshStream.has(A))return!1;const t=this.meshStream.get(A),i=A.vertexStreams;t!==i?(this.#Js(A),this.#Hs(A,!0)):this.#Ws(i)}const i=A.addedList;for(let s=0,n=i.length;s<n;s++){const A=i[s];this.#Ys(A)&&this.#Hs(A,!0)}return!0}#Rs(A){const t=this.firstDirty;if(2147483647===t)return this.#Ds(),void(this.touchedJobs.length=0);const e=this.#Ks(),i=t<e?t:e;this.#qs(i)?this.#Vs(A,Math.min(i,this.groupOrder.length)):this.#Xs(A),this.touchedJobs.length=0,this.firstDirty=2147483647}#qs(A){const t=this.groupOrder,e=this.jobMats;if(t.length!==e.length)return!0;for(let i=A;i<t.length;i++){const A=t[i];if(!A)return!0;const s=this.groups.get(A),n=e[i];if(!s||!n||n.owner!==s[0]||n.partCount!==s.length||n.count!==(0|s[0].count))return!0;const r=n.parts;if(r.length!==s.length)return!0;for(let t=0;t<s.length;t++)if(r[t]!==s[t])return!0}return!1}#Xs(A){const t=this.touchedJobs;if(0===t.length)return void this.#Ds();let e=t[0],i=t[0];for(let s=0,n=t.length;s<n;s++){const n=t[s];n<e&&(e=n),n>i&&(i=n),this.#Zs(n,A)}this.#Ds(),this.#_s(e,i+1)}#Zs(A,t){const e=this.groupOrder[A];if(!e)return;const i=this.groups.get(e),s=this.jobMats[A];if(!i||!s)return;const n=i[0],r=n.hasNodeBind?n.getCullHandle():null,a=r?r.poolIndex:n.poolIndex,o=A*Ua;this.partsBySlotStale=!0,this.jobCpu[o+2]=a,this.#$s(o,i,r);const l=t.geometryMeta.u32;for(let u=0,g=i.length;u<g;u++)this.#Qs(s.argsSlot+u,i[u],l,t.geometryMeta);const c=this.#An(t.geometryTables,e,s.count);if(s.colorF32Base!==c.colorF32Base||s.colorStride!==c.colorStride||s.f32Off!==c.f32Off||s.f32Size!==c.f32Size||s.f32Buf!==c.f32Buf){s.colorF32Base=c.colorF32Base,s.colorStride=c.colorStride,s.f32Off=c.f32Off,s.f32Size=c.f32Size,s.f32Buf=c.f32Buf;const A=this.visible.dataView.buffer,t=this.mats.dataView.buffer,e=Math.max(64*this.visibleTotal,16),n=c.f32Buf??A;for(let r=0,a=i.length;r<a;r++)i[r].attachInstancedStorage(A,t,0,e,n,c.f32Off,c.f32Size),i[r].setInstancedCullLookups(s.visibleBase,s.matVec4Base,c.colorF32Base,c.colorStride)}s.indexed=!!n.geometry.index;const h=e.getAttribute("instanceMatrix")?.view;h&&(s.view=h)}#Vs(A,t){this.bindDirty=!1,this.partsBySlotStale=!0;const e=this.groupOrder,i=e.length;if(t>i&&(t=i),0===i)return this.jobCount=0,this.argsCount=0,this.visibleTotal=0,this.needScatter=!1,this.jobMats.length=0,this.handleJobs.length=0,this.canonicalArgsSlots.length=0,this.layoutWatch.length=0,void(this.indirectArgs.drawCount=0);if(t===i)return this.#tn(i,A.geometryTables),void this.#Ds();const{geometryTables:s,geometryMeta:n}=A,r=n.u32;let a=0,o=0;if(t>0){const A=this.jobMats[t-1];a=A.visibleBase+A.count,o=A.argsSlot+A.partCount}const l=a;if(this.jobMats.length=t,this.canonicalArgsSlots.length=t,0===t)this.handleJobs.length=0,this.layoutWatch.length=0;else{const A=this.handleJobs;let e=0;for(let i=0,s=A.length;i<s;i++)A[i].jobIndex<t&&(A[e++]=A[i]);A.length=e}let c=a,h=o;for(let N=t;N<i;N++){const A=this.groups.get(e[N]);c+=0|A[0].count,h+=A.length}const u=this.jobs.count,g=this.visible.count,d=this.mats.count,p=this.srcJob.count,f=this.packed.count,m=this.mats.dataView.buffer,C=this.visible.dataView.buffer,w=this.packed.dataView.buffer,y=this.srcJob.dataView.buffer,B=this.jobs.dataView.buffer;this.jobCount=i,this.argsCount=h,this.visibleTotal=c,this.indirectArgs.ensureCapacity(h),this.indirectArgs.drawCount=h,this.#en(i);const I=this.jobCpu;this.#vs(this.visible,Math.max(c,4)),this.#in(c),this.#sn(c);const Q=this.#vs(this.srcJob,Math.max(c,4)),E=this.mats.dataView.view;(this.jobs.count>u||this.visible.count>g||this.mats.count>d||this.srcJob.count>p||this.packed.count>f)&&(this.bindDirty=!0);const x=this.canonicalArgsSlots;for(let N=t;N<i;N++){const A=e[N],t=this.groups.get(A),i=0|t[0].count,l=t[0],c=l.hasNodeBind?l.getCullHandle():null,h=c?c.poolIndex:l.poolIndex,u=t.length,g=this.#An(s,A,i),d=0|(c?.matrixEpoch??l.matrixEpoch??0),p=A.getAttribute("instanceMatrix").view,f=t.slice(),m=N*Ua;I[m]=a,I[m+1]=i,I[m+2]=h,I[m+3]=o,I[m+4]=4*a,I[m+5]=u,I[m+6]=0,I[m+7]=0,this.#$s(m,t,c),this.#Gs(s,A),E.set(p.subarray(0,16*i),16*a),Q.fill(N,a,a+i),this.jobMats.push({jobIndex:N,visibleBase:a,count:i,view:p,epoch:d,owner:l,argsSlot:o,partCount:u,indexed:!!l.geometry.index,matVec4Base:4*a,parts:f,colorF32Base:g.colorF32Base,colorStride:g.colorStride,f32Off:g.f32Off,f32Size:g.f32Size,f32Buf:g.f32Buf}),x[N]=o;for(let e=0;e<u;e++){const A=t[e];A.cullArgsSlot=o+e,this.#Qs(A.cullArgsSlot,A,r,n)}c&&this.handleJobs.push({handle:c,jobIndex:N,parts:f}),a+=i,o+=u}let D=!1;const M=this.jobMats;for(let N=0,P=M.length;N<P;N++)if(M[N].partCount>1){D=!0;break}this.needScatter=D,this.#nn(c,m!==this.mats.dataView.buffer?0:l),this.#rn(this.srcJob,Q,Math.max(c,4),l);const b=this.visible.createGPUBuffer(this.device);0===t&&this.#rn(this.visible,this.visible.dataView.view,Math.max(c,4)),m===this.mats.dataView.buffer&&C===b&&w===this.packed.dataView.buffer&&y===this.srcJob.dataView.buffer&&B===this.jobs.dataView.buffer||(this.bindDirty=!0);const S=this.mats.dataView.buffer,v=this.visible.dataView.buffer,T=0===t||m!==S||C!==v?0:t,U=Math.max(64*c,16);for(let N=T;N<i;N++){const A=this.jobMats[N],e=A.parts,i=A.f32Buf??v,s=N>=t;for(let t=0,n=e.length;t<n;t++)e[t].attachInstancedStorage(v,S,0,U,i,A.f32Off,A.f32Size),s&&e[t].setInstancedCullLookups(A.visibleBase,A.matVec4Base,A.colorF32Base,A.colorStride)}this.#Ds(),this.#_s(t),(0===t||this.bindDirty||B!==this.jobs.dataView.buffer)&&this.#Ms(),this.bindDirty=!1}#tn(A,t){this.jobMats.length=A,this.jobCount=A,this.canonicalArgsSlots.length=A;const e=this.handleJobs;let i=0;for(let o=0,l=e.length;o<l;o++)e[o].jobIndex<A&&(e[i++]=e[o]);e.length=i;const s=this.jobMats;let n=0,r=0,a=!1;for(let o=0;o<A;o++){const A=s[o];n=A.argsSlot+A.partCount,r=A.visibleBase+A.count,A.partCount>1&&(a=!0)}this.argsCount=n,this.visibleTotal=r,this.needScatter=a,this.indirectArgs.drawCount=n,this.layoutWatch.length=0;for(let o=0;o<A;o++){const A=s[o].owner.vertexStreams;A&&this.#Gs(t,A)}}#zs(A){const t=A.geometryTables,e=this.groupOrder,i=this.visible.dataView.buffer,s=this.mats.dataView.buffer,n=Math.max(64*this.visibleTotal,16);for(let a=0,o=e.length;a<o;a++){const A=e[a];if(!A)continue;const r=this.groups.get(A),o=this.jobMats[a];if(!r||!o)continue;const l=this.#An(t,A,o.count);if(o.colorF32Base===l.colorF32Base&&o.colorStride===l.colorStride&&o.f32Off===l.f32Off&&o.f32Size===l.f32Size&&o.f32Buf===l.f32Buf)continue;o.colorF32Base=l.colorF32Base,o.colorStride=l.colorStride,o.f32Off=l.f32Off,o.f32Size=l.f32Size,o.f32Buf=l.f32Buf;const c=l.f32Buf??i;for(let t=0,e=r.length;t<e;t++)r[t].attachInstancedStorage(i,s,0,n,c,l.f32Off,l.f32Size),r[t].setInstancedCullLookups(o.visibleBase,o.matVec4Base,l.colorF32Base,l.colorStride)}const r=this.layoutWatch;for(let a=0,o=r.length;a<o;a++){const A=t.getLayoutPools(r[a].layoutId);r[a].bindingVersion=A?.bindingVersion??-1}}#An(A,t,e){const i=this.streamBinds,s=A.getVertexBinds(t,i);let n=0,r=0,a=0,o=16,l=null;const c=function(A,t){const e=A.getVertexSlots();for(let i=0,s=e.length;i<s;i++){const A=e[i].attributes;for(let e=0,s=A.length;e<s;e++){const s=A[e].attrName;if(s===t||s===`${t}0`)return i}}return-1}(t,"instanceColor"),h=t.getAttribute("instanceColor");if(c>=0&&h&&s>c){const A=i[c];n=(0|h.typeInfo.elements)>=4?4:3,u=A.offset,a=(g=this.align)>0?u-u%g:u;const t=A.offset+Math.max(e*n*4,16);o=Math.max(function(A){return A+15&-16}(t-a),16),r=(A.offset-a)/4|0,l=A.buffer}var u,g;return{colorStride:n,colorF32Base:r,f32Off:a,f32Size:o,f32Buf:l}}#js(A){const t=this.layoutWatch;for(let e=0,i=t.length;e<i;e++)if(!A.getLayoutPools(t[e].layoutId))return!0;return!1}#Ys(A){if(!A?.isInstancedDraw)return!1;const t=A.vertexStreams;return!(!t||(0|A.count)<1||!t.getAttribute("instanceMatrix"))}#Hs(A,t){if(t&&this.meshStream.has(A))return;const e=A.vertexStreams;let i=this.groups.get(e);if(i)t&&this.#Ws(e);else{i=[],this.groups.set(e,i);const A=this.groupOrder.length;this.groupOrder.push(e),this.groupIndex.set(e,A),this.#an(A)}i.push(A),this.meshStream.set(A,e)}#Js(A){const t=this.meshStream.get(A);if(!t)return;this.meshStream.delete(A);const e=this.groups.get(t);if(!e)return;const i=e.indexOf(A);if(i<0)return;e.splice(i,1);const s=this.#on(t);0===e.length&&(this.groups.delete(t),this.groupIndex.delete(t),s>=0&&(this.groupOrder[s]=null)),s>=0&&this.#an(s)}#Ws(A){const t=this.#on(A);t>=0&&this.#an(t)}#on(A){return this.groupIndex.get(A)??-1}#an(A){if(A<0)return;let t=this.jobTouchGen;if(t.length<=A){const e=new Array(Math.max(A+1,t.length<<1));for(let A=0;A<t.length;A++)e[A]=t[A];t=this.jobTouchGen=e}t[A]!==this.touchGen&&(t[A]=this.touchGen,this.touchedJobs.push(A)),A<this.firstDirty&&(this.firstDirty=A)}#Ks(){const A=this.groupOrder;let t=0,e=A.length;for(let i=0;i<A.length;i++){const s=A[i];s?(t!==i&&(t<e&&(e=t),A[t]=s,this.groupIndex.set(s,t)),t++):i<e&&(e=i)}return A.length=t,e}#Qs(A,t,e,i){const s=t.geometry,n=s.boundIndex*zs;s.index?this.indirectArgs.writeIndexedAt(A,e[n+Ls.IndexCount],e[n+Ls.FirstIndex],e[n+Ls.BaseVertex],0):this.indirectArgs.writeNonIndexedAt(A,e[n+Ls.VertexCount],e[n+Ls.FirstIndex],0)}#$s(A,t,e){const i=this.jobF32,s=this.sphereScratch;if(!e)return Ha(t[0],s),i[A+8]=s.x,i[A+9]=s.y,i[A+10]=s.z,void(i[A+11]=s.r);this.#ln(e,t,i,A)}#ln(A,t,e,i){Fa.copy(A.matrixWorld).invert();let s=0,n=0,r=0,a=-1;const o=this.sphereScratch;for(let l=0,c=t.length;l<c;l++){Ha(t[l],o),ka.multiplyMatrices(Fa,t[l].matrixWorld),Ra.set(o.x,o.y,o.z).applyMatrix4(ka);const A=o.r*ma(ka.elements,0);if(a<0)s=Ra.x,n=Ra.y,r=Ra.z,a=A;else{const t=Ra.x-s,e=Ra.y-n,i=Ra.z-r,o=Math.sqrt(t*t+e*e+i*i);if(o+A<=a)continue;if(o+a<=A){s=Ra.x,n=Ra.y,r=Ra.z,a=A;continue}const l=.5*(o+A-a),c=o>0?1/o:0;s+=t*l*c,n+=e*l*c,r+=i*l*c,a=.5*(o+a+A)}}e[i+8]=s,e[i+9]=n,e[i+10]=r,e[i+11]=Math.max(a,0)}#Ds(){const A=this.handleJobs;let t=!1;for(let e=0,i=A.length;e<i;e++){const i=A[e];i.handle.commitDrawState()&&(this.#ln(i.handle,i.parts,this.jobF32,i.jobIndex*Ua),t=!0)}t&&this.#_s()}#en(A){const t=Math.max(A,1);if(t>this.jobsArray.count){const A=256*Math.ceil(t/256+1);this.jobsArray.resizeTo(A),this.jobs.setCount(A,!0),this.jobs.dataView.view=this.jobsArray}this.jobCpu=this.jobsArray.u32,this.jobF32=this.jobsArray.f32}#_s(A=0,t=this.jobCount){const e=t<this.jobCount?t:this.jobCount,i=this.jobs,s=this.jobsArray.count,n=i.dataView.buffer,r=i.count;i.dataView.view=this.jobsArray,r!==s&&i.setCount(s,!0);const a=i.createGPUBuffer(this.device);let o=A*Ua,l=e*Ua;n===a&&r===i.count||(this.bindDirty=!0,o=0,l=this.jobCount*Ua),l<=o||this.device.queue.writeBuffer(a,4*o,this.jobsArray.u32,o,l-o)}#rn(A,t,e,i=0){const s=A.dataView.buffer,n=A.count;A.dataView.view=t,n!==t.length&&A.setCount(t.length,!0);const r=A.createGPUBuffer(this.device);let a=i;s===r&&n===A.count||(this.bindDirty=!0,a=0),e<=a||(this.device.queue.writeBuffer(r,4*a,t,a,e-a),A.isDirty=!1)}#vs(A,t){t=Math.max(t,4);let e=A.dataView.view;if(!e||e.length<t){const i=256*Math.ceil(t/256+1),s=new Uint32Array(i);e&&s.set(e),e=s,A.dataView.view=e,A.setCount(i,!0)}return e}#in(A){const t=Math.max(3*A,4),e=this.packed,i=e.dataView.buffer;e.setCount(t,!0),e.createGPUBuffer(this.device),i!==e.dataView.buffer&&this.compactObject.clearBindGroups()}#sn(A){const t=Math.max(4*A,4),e=this.mats;let i=e.dataView.view;if(!i||i.length<4*t){const A=256*Math.ceil(t/256+1),s=new Float32Array(4*A);i&&s.set(i),i=s,e.dataView.view=i,e.setCount(A,!0)}else e.count<t&&e.setCount(t,!0);const s=e.dataView.buffer;e.createGPUBuffer(this.device),s!==e.dataView.buffer&&this.#Ms()}#nn(A,t=0){const e=this.mats,i=e.dataView.view,s=e.dataView.buffer,n=e.count,r=e.createGPUBuffer(this.device);let a=16*t;const o=Math.max(16*A,16);s===r&&n===e.count||(this.bindDirty=!0,a=0),o<=a||(this.device.queue.writeBuffer(r,4*a,i,a,o-a),e.isDirty=!1)}#xs(){const A=this.jobMats;if(A.length<=0)return;const t=this.mats.dataView.view,e=this.mats.dataView.buffer;if(!e||!t)return;const i=this.device.queue;for(let s=0,n=A.length;s<n;s++){const n=A[s],r=n.owner,a=0|(r.getCullHandle().matrixEpoch??r.matrixEpoch??0);if(a===n.epoch)continue;n.epoch=a;const o=r.instanceMatrix?.view;o&&(n.view=o);const l=16*n.count,c=16*n.visibleBase;t.set(n.view.subarray(0,l),c),i.writeBuffer(e,4*c,t,c,l)}}}const qa=z.COMPUTE,Xa=j.INDIRECT|j.STORAGE|j.COPY_DST;class Za extends vr{type="IndirectSliceMaterialNode";instanceCountBinding;sliceSizeBinding;maxSlicesBinding;sliceArgsBinding;sliceIndexedBinding;device;indirectArgs;flagsView;sliceSlotCapacity=0;constructor(A,t){super({workgroupSize:[64,1,1],entryPoint:"sliceIndirect",shader:()=>"\nconst INDIRECT_STRIDE: u32 = 5u;\n\nfn sliceIndirect() {\n let batchId = globalInvocationId.x;\n if (batchId >= instanceCount) { return; }\n let packed = sliceIndexed[batchId];\n let kMax = packed >> 1u;\n if (kMax == 0u) { return; }\n let indexed = packed & 1u;\n let src = batchId * INDIRECT_STRIDE;\n let V = atomicLoad(&indirectArgs[src + 1u]);\n if (V == 0u) {\n for (var k = 0u; k < kMax; k++) {\n atomicStore(&sliceArgs[(batchId * maxSlices + k) * INDIRECT_STRIDE + 1u], 0u);\n }\n return;\n }\n let w0 = atomicLoad(&indirectArgs[src]);\n let w2 = atomicLoad(&indirectArgs[src + 2u]);\n let w3 = atomicLoad(&indirectArgs[src + 3u]);\n let w4 = atomicLoad(&indirectArgs[src + 4u]);\n for (var k = 0u; k < kMax; k++) {\n let start = k * sliceSize;\n let dst = (batchId * maxSlices + k) * INDIRECT_STRIDE;\n if (V <= start) {\n atomicStore(&sliceArgs[dst + 1u], 0u);\n continue;\n }\n let cnt = min(sliceSize, V - start);\n atomicStore(&sliceArgs[dst], w0);\n atomicStore(&sliceArgs[dst + 1u], cnt);\n atomicStore(&sliceArgs[dst + 2u], w2);\n if (indexed != 0u) {\n atomicStore(&sliceArgs[dst + 3u], w3);\n atomicStore(&sliceArgs[dst + 4u], w4 + start);\n } else {\n atomicStore(&sliceArgs[dst + 3u], w3 + start);\n atomicStore(&sliceArgs[dst + 4u], w4);\n }\n }\n}\n"}),this.name="IndirectSlice",this.device=A,this.indirectArgs=t,this.addBinding(t.binding,!1),this.flagsView=new Uint32Array(256),this.sliceIndexedBinding=new zt("sliceIndexed",this.flagsView,"u32",{visibility:qa,access:"ReadOnly",isArray:!0,isDynamicArray:!0,count:256,usage:j.STORAGE|j.COPY_DST}),this.sliceIndexedBinding.createGPUBuffer(A),this.addBinding(this.sliceIndexedBinding,!1);const e=new Uint32Array(5);this.sliceArgsBinding=new zt("sliceArgs",e,"u32",{visibility:qa,access:"ReadWrite",isArray:!0,isDynamicArray:!0,count:5,usage:Xa,isAtomic:!0}),this.addBinding(this.sliceArgsBinding,!1),this.instanceCountBinding=new zt("instanceCount",0,"u32",{visibility:qa,access:"Uniform",usage:j.UNIFORM|j.COPY_DST}),this.sliceSizeBinding=new zt("sliceSize",0,"u32",{visibility:qa,access:"Uniform",usage:j.UNIFORM|j.COPY_DST}),this.maxSlicesBinding=new zt("maxSlices",1,"u32",{visibility:qa,access:"Uniform",usage:j.UNIFORM|j.COPY_DST}),this.addBinding(this.instanceCountBinding,!1),this.addBinding(this.sliceSizeBinding,!1),this.addBinding(this.maxSlicesBinding,!1)}ensureSliceCapacity(A){if(A<=this.sliceSlotCapacity)return!1;const t=256*Math.ceil(A/256+1);return this.sliceArgsBinding.setCount(5*t,!0),this.sliceArgsBinding.createGPUBuffer(this.device),this.sliceSlotCapacity=t,!0}ensureFlagsCapacity(A){if(A<=this.flagsView.length)return!1;const t=256*Math.ceil(A/256+1),e=new Uint32Array(t);return this.flagsView=e,this.sliceIndexedBinding.setValue(e),this.sliceIndexedBinding.createGPUBuffer(this.device),!0}setU32(A,t){const e=t>>>0;(A.getValue()!==e||A.isDirty)&&(A.setValue(e),A.updateCPUBuffer(),A.updateGPUBuffer(this.device))}uploadFlags(A){const t=this.sliceIndexedBinding.dataView.buffer;!t||A<=0||this.device.queue.writeBuffer(t,0,this.flagsView,0,A)}}class _a{material;active=!1;maxSlices=1;#cn=0;passCtx=null;object;constructor(A,t){this.material=new Za(A,t),this.object=new Pr(this.material,!1,!1)}get gpuBuffer(){return this.material.sliceArgsBinding.dataView.buffer}prepare(A,t,e){if(this.active=!1,this.maxSlices=1,this.#cn=e,e<=0||t<=0)return;let i=1;const s=this.material.flagsView,n=this.material.ensureFlagsCapacity(t),r=n?this.material.flagsView:s;r.fill(0,0,t);for(let a=0,o=A.length;a<o;a++){const t=A[a];if(!t)continue;const s=t.encodeBatches;for(let A=0,n=s.length;A<n;A++){const t=s[A];if(t.skipCull||t.count<=0||t.batchId<0)continue;const n=Math.ceil(t.count/e);n>i&&(i=n),r[t.batchId]=(t.indexed?1:0)|n<<1}}this.#hn(t,i,n)}#hn(A,t,e){if(this.maxSlices=t,t<=1)return;const i=this.material.ensureSliceCapacity(A*t);(e||i)&&(this.object.clearBindGroups(),this.object.variant=null),this.material.uploadFlags(A),this.active=!0}compute(A){if(!this.active)return;const{encoder:t,pipelineCache:e}=A,i=this.material,s=i.indirectArgs.drawCount;if(s<=0)return;const n=e.device;i.setU32(i.instanceCountBinding,s),i.setU32(i.sliceSizeBinding,this.#cn),i.setU32(i.maxSlicesBinding,this.maxSlices),Nr(this.object,e,"sliceIndirect");const r=this.passCtx??=new Ur(n,{name:"indirectSlicePass"});r.beginComputePass(t);const a=i.workgroupSize[0]||64;r.dispatchObject(this.object,Math.ceil(s/a),1,1),r.endPass()}dispose(){this.object.clearBindGroups(),this.passCtx?.dispose(),this.passCtx=null;const A=this.material;A.sliceIndexedBinding.releaseOwnedGpuBuffer(),A.sliceArgsBinding.releaseOwnedGpuBuffer(),A.instanceCountBinding.releaseOwnedGpuBuffer(),A.sliceSizeBinding.releaseOwnedGpuBuffer(),A.maxSlicesBinding.releaseOwnedGpuBuffer()}}const $a=z.COMPUTE,Ao=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.STORAGE_BINDING,to=new wt("HizParams",[{name:"viewProj",format:"mat4x4f"},{name:"invViewProj",format:"mat4x4f"},{name:"viewProjPrev",format:"mat4x4f"},{name:"invViewProjPrev",format:"mat4x4f"},{name:"srcSize",format:"vec2f"},{name:"dstSize",format:"vec2f"},{name:"hasPrev",format:"u32"},{name:"_pad0",format:"u32"},{name:"pixelEps",format:"f32"},{name:"depthEps",format:"f32"}]);class eo extends Lt{isSampledTexture=!0;isStorageTexture=!1;#un="unfilterable-float";#gn=!1;constructor(A,t){super(A,null,"store"===t?"texture_storage_2d<r32float, write>":"depth"===t?"texture_depth_2d":"depth-ms"===t?"texture_depth_multisampled_2d":"texture_2d<f32>",{visibility:$a}),this.isStorageTexture="store"===t,this.isSampledTexture="store"!==t,this.#gn="depth-ms"===t,this.#un="depth"===t||"depth-ms"===t?"depth":"unfilterable-float"}initTypeInfo(A){this.typeInfo={name:this.name,format:A??"texture_2d<f32>",align:0,size:0,elements:0,itemElements:0,offset:0,byteOffset:0,byteStride:0,stride:0,bytes:0,needPadding:!1,dataView:null,isChunkLayout:!1,totalElements:0,gpuTotalElements:0}}attachView(A){this.dataView.texture=A}getType(){return this.typeInfo.format}isSkipBinding(){return!1}generateShader(A,t){return`${this.WGSL_FRAGMENT}@group(${A}) @binding(${t}) var ${this.name}: ${this.getType()};\n`}generateLayout(A,t){return this.isStorageTexture?[{binding:t,visibility:this.visibility,storageTexture:{access:"write-only",format:"r32float",viewDimension:"2d"}}]:[{binding:t,visibility:this.visibility,texture:{sampleType:this.#un,viewDimension:"2d",multisampled:this.#gn}}]}generateBinding(A,t){return[{binding:t,resource:this.dataView.texture}]}}const io="\nfn ndcToUv(ndc: vec2<f32>) -> vec2<f32> {\n return vec2<f32>(ndc.x * 0.5 + 0.5, 0.5 - ndc.y * 0.5);\n}\n\nfn unproject(invVp: mat4x4<f32>, uv: vec2<f32>, depth: f32) -> vec3<f32> {\n let ndc = vec4<f32>(uv.x * 2.0 - 1.0, 1.0 - uv.y * 2.0, depth, 1.0);\n let w = invVp * ndc;\n return w.xyz / w.w;\n}\n\nfn loadPrevDepth(coord: vec2<i32>, srcSize: vec2<i32>) -> f32 {\n let p = clamp(coord, vec2<i32>(0), srcSize - vec2<i32>(1));\n return textureLoad(prevDepth, p, 0);\n}\n\nstruct HizHit {\n dst: vec2<i32>,\n z: f32,\n ok: u32,\n}\n\nfn scatterHit(coord: vec2<i32>, srcSize: vec2<i32>, dstSize: vec2<f32>, dstSizeI: vec2<i32>) -> HizHit {\n if (coord.x < 0 || coord.y < 0 || coord.x >= srcSize.x || coord.y >= srcSize.y) {\n return HizHit(vec2<i32>(0), 1.0, 0u);\n }\n let dPrev = loadPrevDepth(coord, srcSize);\n if (dPrev <= 0.001) { return HizHit(vec2<i32>(0), 0.0, 0u); }\n let uvP = (vec2<f32>(coord) + vec2<f32>(0.5)) / hizParams.srcSize;\n let world = unproject(hizParams.invViewProjPrev, uvP, dPrev);\n let curr = hizParams.viewProj * vec4<f32>(world, 1.0);\n if (curr.w <= 1e-5) { return HizHit(vec2<i32>(0), 1.0, 0u); }\n let ndc = curr.xyz / curr.w;\n if (ndc.z <= 0.0 || ndc.z >= 1.0) { return HizHit(vec2<i32>(0), 1.0, 0u); }\n if (abs(ndc.x) > 1.0 || abs(ndc.y) > 1.0) { return HizHit(vec2<i32>(0), 1.0, 0u); }\n let dst = vec2<i32>(ndcToUv(ndc.xy) * dstSize);\n if (dst.x < 0 || dst.y < 0 || dst.x >= dstSizeI.x || dst.y >= dstSizeI.y) {\n return HizHit(vec2<i32>(0), 1.0, 0u);\n }\n return HizHit(dst, ndc.z, 1u);\n}\n\nfn reprojectHiZ() {\n let id = vec2<i32>(globalInvocationId.xy);\n let dstSizeI = vec2<i32>(hizParams.dstSize);\n // _pad0==0:清成远平面(反向深度的 0)。相机一动对不上的像素保持没墙。\n if (hizParams._pad0 == 0u) {\n if (id.x < dstSizeI.x && id.y < dstSizeI.y) {\n textureStore(hizOut, id, vec4<f32>(0.0, 0.0, 0.0, 0.0));\n }\n return;\n }\n let srcSize = vec2<i32>(hizParams.srcSize);\n let dstSize = hizParams.dstSize;\n let base = id * 2;\n var hit: array<HizHit, 4>;\n hit[0] = scatterHit(base, srcSize, dstSize, dstSizeI);\n hit[1] = scatterHit(base + vec2<i32>(1, 0), srcSize, dstSize, dstSizeI);\n hit[2] = scatterHit(base + vec2<i32>(0, 1), srcSize, dstSize, dstSizeI);\n hit[3] = scatterHit(base + vec2<i32>(1, 1), srcSize, dstSize, dstSizeI);\n // 同一线程打到同一半屏纹素时取 min。反向深度里更小是更远,后写不能盖住更远的洞。\n for (var i = 0; i < 4; i++) {\n if (hit[i].ok == 0u) { continue; }\n var seen = false;\n for (var k = 0; k < i; k++) {\n if (hit[k].ok != 0u && all(hit[k].dst == hit[i].dst)) { seen = true; break; }\n }\n if (seen) { continue; }\n var z = hit[i].z;\n for (var n = i + 1; n < 4; n++) {\n if (hit[n].ok != 0u && all(hit[n].dst == hit[i].dst)) { z = min(z, hit[n].z); }\n }\n textureStore(hizOut, hit[i].dst, vec4<f32>(z, 0.0, 0.0, 0.0));\n }\n}\n",so=io.replace("fn loadPrevDepth(coord: vec2<i32>, srcSize: vec2<i32>) -> f32 {\n let p = clamp(coord, vec2<i32>(0), srcSize - vec2<i32>(1));\n return textureLoad(prevDepth, p, 0);\n}","\nfn loadPrevDepth(coord: vec2<i32>, srcSize: vec2<i32>) -> f32 {\n let p = clamp(coord, vec2<i32>(0), srcSize - vec2<i32>(1));\n let s0 = textureLoad(prevDepth, p, 0);\n let s1 = textureLoad(prevDepth, p, 1);\n let s2 = textureLoad(prevDepth, p, 2);\n let s3 = textureLoad(prevDepth, p, 3);\n return min(min(s0, s1), min(s2, s3));\n}\n");class no extends vr{type="HiZReprojectNode";params;prevDepth;hizOut;constructor(A){super({workgroupSize:[8,8,1],entryPoint:"reprojectHiZ",shader:()=>A?so:io}),this.name=A?"HiZReprojectMs":"HiZReproject",this.params=new Zt("hizParams",to,{access:"Uniform",visibility:$a}),this.prevDepth=new eo("prevDepth",A?"depth-ms":"depth"),this.hizOut=new eo("hizOut","store"),this.addBinding(this.params,!1),this.addBinding(this.prevDepth,!1),this.addBinding(this.hizOut,!1)}}class ro extends vr{type="HiZDownNode";hizSrc;hizDst;constructor(A){super({workgroupSize:[8,8,1],entryPoint:"hizDown",shader:()=>"\nfn hizDown() {\n let dst = vec2<i32>(globalInvocationId.xy);\n let dstSize = vec2<i32>(textureDimensions(hizDst));\n if (dst.x >= dstSize.x || dst.y >= dstSize.y) { return; }\n let src = dst * 2;\n let srcSize = vec2<i32>(textureDimensions(hizSrc));\n let maxC = srcSize - vec2<i32>(1);\n let d0 = textureLoad(hizSrc, clamp(src, vec2<i32>(0), maxC), 0).r;\n let d1 = textureLoad(hizSrc, clamp(src + vec2<i32>(1, 0), vec2<i32>(0), maxC), 0).r;\n let d2 = textureLoad(hizSrc, clamp(src + vec2<i32>(0, 1), vec2<i32>(0), maxC), 0).r;\n let d3 = textureLoad(hizSrc, clamp(src + vec2<i32>(1, 1), vec2<i32>(0), maxC), 0).r;\n textureStore(hizDst, dst, vec4<f32>(min(min(d0, d1), min(d2, d3)), 0.0, 0.0, 0.0));\n}\n"}),this.name=A,this.hizSrc=new eo("hizSrc","sample"),this.hizDst=new eo("hizDst","store"),this.addBinding(this.hizSrc,!1),this.addBinding(this.hizDst,!1)}}function ao(A,t){const e=new pt({width:A,height:t},{format:W.R32Float,useMipmaps:!1,generateMipmaps:!1,magFilter:X.Nearest,minFilter:X.Nearest,usage:Ao});return e.isDirty=!1,e}class oo{active=!1;sample0;sample1;sample2;#ii;#dn=null;#pn=null;#fn=null;#mn=0;#Cn=0;#wn=!1;#yn=!1;#Bn=new Float32Array(16);#In=new v;#Qn=new v;#tA=new v;#En=new Float32Array(72);#xn;#Dn;#Mn;#bn;#Sn;#vn;#Tn;#Un;#Nn=null;constructor(A){this.#ii=A,this.#xn=new no(!1),this.#Dn=new no(!0),this.#Mn=new ro("HiZDown01"),this.#bn=new ro("HiZDown12"),this.#Sn=new Pr(this.#xn,!1,!1),this.#vn=new Pr(this.#Dn,!1,!1),this.#Tn=new Pr(this.#Mn,!1,!1),this.#Un=new Pr(this.#bn,!1,!1),this.sample0=new eo("hiz0","sample"),this.sample1=new eo("hiz1","sample"),this.sample2=new eo("hiz2","sample")}prepare(A){if(this.active=!1,!A.depth||A.multiview||0!==A.activeLayer||A.textureDepth>1)return!1;const t=A.getDepthTexture();if(!t)return!1;const e=0|A.width,i=0|A.height;if(e<2||i<2)return!1;const s=Math.max(1,e>>1),n=Math.max(1,i>>1),r=Math.max(1,s>>1),a=Math.max(1,n>>1),o=Math.max(1,r>>1),l=Math.max(1,a>>1),c=t.sampleCount>1;let h=!1;this.#mn===s&&this.#Cn===n&&this.#dn||(this.#dn?.destroyTexture(),this.#pn?.destroyTexture(),this.#fn?.destroyTexture(),this.#dn=ao(s,n),this.#pn=ao(r,a),this.#fn=ao(o,l),this.#mn=s,this.#Cn=n,this.#wn=!1,h=!0),this.#yn!==c&&(this.#yn=c,h=!0);const u=this.#ii,g=this.#dn,d=this.#pn,p=this.#fn;g.ensureUploaded(u),d.ensureUploaded(u),p.ensureUploaded(u),t.ensureUploaded(u);const f=t.createView(u,{aspect:"depth-only",dimension:"2d"}),m=g.createView(u),C=d.createView(u),w=p.createView(u),y=c?this.#Dn:this.#xn;return y.prevDepth.attachView(f),y.hizOut.attachView(m),this.#Mn.hizSrc.attachView(m),this.#Mn.hizDst.attachView(C),this.#bn.hizSrc.attachView(C),this.#bn.hizDst.attachView(w),this.sample0.attachView(m),this.sample1.attachView(C),this.sample2.attachView(w),h&&(this.#Sn.clearBindGroups(),this.#vn.clearBindGroups(),this.#Tn.clearBindGroups(),this.#Un.clearBindGroups(),this.#Sn.variant=null,this.#vn.variant=null,this.#Tn.variant=null,this.#Un.variant=null),this.active=!0,h}uploadParams(A,t){const e=(this.#yn?this.#Dn:this.#xn).params,i=this.#ii;e.dataView.buffer||e.createGPUBuffer(i);const s=A.viewProjectionMatrix.data;this.#tA.copy(A.viewProjectionMatrix),this.#In.copy(this.#tA).invert(),this.#Qn.elements.set(this.#Bn),this.#Qn.invert();const n=this.#En;n.set(s,0),n.set(this.#In.data,16),n.set(this.#Bn,32),n.set(this.#Qn.data,48),n[64]=this.#mn<<1,n[65]=this.#Cn<<1,n[66]=this.#mn,n[67]=this.#Cn;const r=new Uint32Array(n.buffer,272,2);r[0]=this.#wn?1:0,r[1]=t,n[70]=1.75,n[71]=.012;const a=e.dataView.buffer;i.queue.writeBuffer(a,0|e.dataView.offset,n)}compute(A){if(!this.active||!this.#dn)return;const{encoder:t,pipelineCache:e,camera:i}=A,s=this.#yn?this.#vn:this.#Sn;Nr(s,e,"reprojectHiZ"),Nr(this.#Tn,e,"hizDown"),Nr(this.#Un,e,"hizDown");const n=this.#Nn??=new Ur(this.#ii,{name:"hiZReproject"}),r=Math.ceil(this.#mn/8),a=Math.ceil(this.#Cn/8);this.uploadParams(i,0),n.beginComputePass(t),n.dispatchObject(s,r,a,1),n.endPass(),this.#wn&&(this.uploadParams(i,1),n.beginComputePass(t),n.dispatchObject(s,r,a,1),n.endPass());const o=this.#pn.width,l=this.#pn.height;n.beginComputePass(t),n.dispatchObject(this.#Tn,Math.ceil(o/8),Math.ceil(l/8),1),n.endPass();const c=this.#fn.width,h=this.#fn.height;n.beginComputePass(t),n.dispatchObject(this.#Un,Math.ceil(c/8),Math.ceil(h/8),1),n.endPass()}capture(A){this.#Bn.set(A.viewProjectionMatrix.data),this.#wn=!0}invalidate(){this.#wn=!1}dispose(){this.#Sn.clearBindGroups(),this.#vn.clearBindGroups(),this.#Tn.clearBindGroups(),this.#Un.clearBindGroups(),this.#dn?.destroyTexture(),this.#pn?.destroyTexture(),this.#fn?.destroyTexture(),this.#dn=this.#pn=this.#fn=null,this.#Nn?.dispose(),this.#Nn=null}}const lo=2147483648,co=2147483647;class ho{device;rowStride;initialRows;maxRows;usage;growFactor;releaseDelayFrames;label;active=null;capacity=0;liveCount=0;rowGenerations=new Uint32Array(0);freeRows=new Int32Array(0);freeCount=0;pendingFrees=[];pendingDestroys=[];destroyed=!1;constructor(A,t){const e=0|t.rowStride;if(e<=0||3&e)throw new Error("GrowableStrideLayoutBuffer: rowStride must be positive multiple of 4");const i=0|Math.max(1,t.initialRows??256),s=0|t.maxRows;if(s<i)throw new Error("GrowableStrideLayoutBuffer: invalid maxRows");this.device=A,this.rowStride=e,this.initialRows=i,this.maxRows=s,this.usage=t.usage??j.STORAGE|j.COPY_DST|j.COPY_SRC,this.growFactor=t.growFactor??2,this.releaseDelayFrames=Math.max(0,t.releaseDelayFrames??2),this.label=t.label??"MaterialLayout"}get activeBuffer(){if(!this.active)throw new Error("GrowableStrideLayoutBuffer: no active buffer");return this.active}alloc(A){if(this.destroyed)return!1;if(this.active||this.growTo(this.initialRows),0===this.freeCount&&!this.grow())return!1;const t=this.freeRows[--this.freeCount];let e=1+(this.rowGenerations[t]&co);0===e&&(e=1);const i=(e|lo)>>>0;return this.rowGenerations[t]=i,this.liveCount++,A.id=t,A.generation=i,!0}free(A,t){!this.destroyed&&this.isLive(A,t)&&(this.releaseDelayFrames<=0?this.retire(A,t):this.pendingFrees.push({id:A,generation:t,framesLeft:this.releaseDelayFrames}))}beginFrame(){this.destroyed||(this.tickPendingFrees(),this.tickPendingDestroys(),this.maybeShrink())}update(A,t,e,i=0,s=0,n=-1){this.assertLive(A,t);const r=n<0?e.byteLength-s:n;if(s<0||r<0||s+r>e.byteLength)throw new Error("GrowableStrideLayoutBuffer.update: source out of range");if(i<0||i+r>this.rowStride)throw new Error("GrowableStrideLayoutBuffer.update: out of range");if(0===r)return;const a=A*this.rowStride+i;if(3&a||3&r)throw new Error("GrowableStrideLayoutBuffer.update: offset/size must be multiple of 4");this.device.queue.writeBuffer(this.active,a,e.buffer,e.byteOffset+s,r)}destroy(){if(!this.destroyed){this.destroyed=!0,this.pendingFrees.length=0;for(const A of this.pendingDestroys)A.buffer.destroy();this.pendingDestroys.length=0,this.active?.destroy(),this.active=null,this.rowGenerations.fill(0),this.freeCount=0,this.liveCount=0,this.capacity=0}}grow(){const A=this.capacity,t=0|Math.min(Math.max(A*this.growFactor,A+1,this.initialRows),this.maxRows);return!(t<=A)&&(this.growTo(t),this.freeCount>0)}maybeShrink(){const A=this.capacity,t=this.initialRows;if(!this.active||A<=t)return;if((this.liveCount+256)/A>=.3)return;let e=-1;if(this.liveCount>0){const t=this.rowGenerations;for(let i=A-1;i>=0;i--)if(0!==(t[i]&lo)){e=i;break}}const i=e+1,s=this.growFactor,n=this.maxRows;let r=t;for(;r<i;){const A=0|Math.min(Math.max(r*s,r+1,t),n);if(A<=r)return;r=A}r>=A||this.shrinkTo(r)}growTo(A){const t=this.device,e=this.capacity,i=A*this.rowStride+3&-4,s=t.createBuffer({label:this.label,size:i,usage:this.usage}),n=this.active;if(n&&e>0){const A=t.createCommandEncoder({label:`${this.label}-grow`});A.copyBufferToBuffer(n,0,s,0,e*this.rowStride),t.queue.submit([A.finish()]),this.pendingDestroys.push({buffer:n,framesLeft:Math.max(1,this.releaseDelayFrames)})}this.rowGenerations=new Uint32Array(this.rowGenerations.buffer.transfer(4*A));const r=new Int32Array(this.freeRows.buffer.transfer(4*A));let a=this.freeCount;for(let o=A-1;o>=e;o--)r[a++]=o;this.freeCount=a,this.freeRows=r,this.active=s,this.capacity=A}shrinkTo(A){const t=this.device,e=A*this.rowStride+3&-4;let i;try{i=t.createBuffer({label:this.label,size:e,usage:this.usage})}catch{return}const s=this.active;try{const e=t.createCommandEncoder({label:`${this.label}-shrink`});e.copyBufferToBuffer(s,0,i,0,A*this.rowStride),t.queue.submit([e.finish()])}catch{return void i.destroy()}this.pendingDestroys.push({buffer:s,framesLeft:Math.max(1,this.releaseDelayFrames)});const n=this.freeRows;let r=0;for(let a=0,o=this.freeCount;a<o;a++){const t=n[a];t<A&&(n[r++]=t)}this.freeCount=r,this.rowGenerations=new Uint32Array(this.rowGenerations.buffer.transfer(4*A)),this.freeRows=new Int32Array(this.freeRows.buffer.transfer(4*A)),this.active=i,this.capacity=A}retire(A,t){this.isLive(A,t)&&(this.rowGenerations[A]=t&co,this.freeRows[this.freeCount++]=A,this.liveCount--)}tickPendingFrees(){const A=this.pendingFrees;let t=0;for(let e=0;e<A.length;e++){const i=A[e];--i.framesLeft>0?A[t++]=i:this.retire(i.id,i.generation)}A.length=t}tickPendingDestroys(){const A=this.pendingDestroys;let t=0;for(let e=0;e<A.length;e++){const i=A[e];--i.framesLeft>0?A[t++]=i:i.buffer.destroy()}A.length=t}isLive(A,t){return!this.destroyed&&0!==(t&lo)&&A>=0&&A<this.capacity&&this.rowGenerations[A]===t}assertLive(A,t){if(!this.isLive(A,t))throw new Error("GrowableStrideLayoutBuffer: invalid handle")}}class uo extends Lt{isSampledTexture=!0;view;sampleType;wgslType;constructor(A,t,e="float"){const i=function(A){switch(A){case"sint":return"texture_2d_array<i32>";case"uint":return"texture_2d_array<u32>";case"depth":return"texture_depth_2d_array";default:return"texture_2d_array<f32>"}}(e);super(A,null,i),this.view=t,this.sampleType=e,this.wgslType=i,this.typeInfo.format=i,this.visibility=z.VERTEX|z.FRAGMENT}initTypeInfo(A){this.typeInfo={name:this.name,format:A??"texture_2d_array<f32>",align:0,size:0,elements:0,itemElements:0,offset:0,byteOffset:0,byteStride:0,stride:0,bytes:0,needPadding:!1,dataView:null,isChunkLayout:!1,totalElements:0,gpuTotalElements:0}}isSkipBinding(){return!1}generateLayout(A,t){return[{binding:t,visibility:this.visibility,texture:{sampleType:this.sampleType,viewDimension:"2d-array",multisampled:!1}}]}generateBinding(A,t){return[{binding:t,resource:this.view}]}setView(A){this.view=A}generateShader(A,t){return`@group(${A}) @binding(${t}) var ${this.name}: ${this.wgslType};\n`}}class go{type="MaterialTable";id;bindingLayoutKey;heapSetKey;rowDef;rowStride;fields;buffer;materialsBinding;heaps;samplerHandles;heapCount;heapIndexByKey;#H;#Pn=0;#On=null;constructor(A,t,e,i,s,n,r,a,o=new Map){this.id=A,this.bindingLayoutKey=t,this.heapSetKey=e,this.rowDef=i,this.rowStride=0|i.typeInfo.size,this.fields=s,this.buffer=n,this.heaps=r,this.heapCount=r.length,this.heapIndexByKey=o,this.materialsBinding=new Zt("materials",i,{access:"ReadOnly",isDynamicArray:!0,isStandardLayout:!0,visibility:z.VERTEX|z.FRAGMENT,mode:"struct"});const l=new Map([["materials",this.materialsBinding]]);this.#H=l;for(let h=0,u=r.length;h<u;h++){const A=r[h],t=new uo(`texHeap${h}`,A.view,A.sampleType);l.set(t.name,t)}const c=new Array(a.length);for(let h=0,u=a.length;h<u;h++){const A=a[h],t=A.sampler??new rt({magFilter:"linear",minFilter:"linear",mipmapFilter:"linear"}),e=new Wt(`sampHeap${h}`,t);t.gpuSampler=A.gpu,l.set(e.name,e),c[h]=A.handle}this.samplerHandles=c}getBindings(){return this.#H}getBindGroupCacheToken(){const A=this.buffer.active;if(0===this.#Pn)return A;let t=this.#On;return t&&t.b===A&&t.g===this.#Pn||(t=this.#On={b:A,g:this.#Pn}),t}replaceHeapView(A,t){const e=this.heapIndexByKey.get(A);if(void 0===e)return;const i=this.#H.get(`texHeap${e}`);if(!(i instanceof uo))return;i.setView(t);const s=this.heaps[e];s&&(s.view=t),this.#Pn++}syncActiveBuffer(){const A=this.buffer.active;if(!A)return;const t=this.materialsBinding.dataView;t.buffer=A,t.offset=0,t.size=A.size}}function po(A,t,e,i,s,n){if(e.isStruct){const e=i;if(!e?.isStructDefinition)throw new Error(`MaterialTableManager: nested field missing StructDef (${n.name})`);if(!(n instanceof Xt))throw new Error(`MaterialTableManager: expected StructUniformStorageBinding (${n.name})`);const r=n.getFields();for(const[i,a]of e.fields){const e=a.meta;if(!e)throw new Error(`MaterialTableManager: nested meta missing (${n.name}.${i})`);const o=r.get(i);if(!o)throw new Error(`MaterialTableManager: missing source field (${n.name}.${i})`);po(A,t,e,a.format,s+e.byteOffset,o)}return}const r=n.value?.elements;if(null==r)throw new Error(`MaterialTableManager: leaf binding has no value (${n.name})`);let a;"number"==typeof r||"boolean"==typeof r?(A.scalarScratch[0]=Number(r),a=A.scalarScratch):a=r;const o=t.getView(e.type),l=s/o.BYTES_PER_ELEMENT;e.setData(o,l,a,0,e.totalElements,e.isStandardLayout||!e.isArray)}function fo(A,t,e,i,s){A.u32Scratch[0]=s>>>0;const n=t.getView(e.type),r=i/n.BYTES_PER_ELEMENT;e.setData(n,r,A.u32Scratch,0,1,!0)}function mo(A,t,e,i,s,n){A.vec2Scratch[0]=s,A.vec2Scratch[1]=n;const r=t.getView(e.type),a=i/r.BYTES_PER_ELEMENT;e.setData(r,a,A.vec2Scratch,0,2,!0)}function Co(A,t){if(A.row<0)return;const e=A.table,i=function(A,t){const e=`${t.bindingLayoutKey}#${t.heapSetKey}`,i=A.rowScratchByKey.get(e);if(i)return i.buffer;const s=new Bt(t.rowDef,{isStandardLayout:!0});return A.rowScratchByKey.set(e,{buffer:s}),s}(t,e);i.u8.fill(0);const s=e.fields,n=A.sourceBindings;for(let r=0,a=s.length;r<a;r++){const A=s[r],e=A.meta,a=n[r];"buffer"===a.kind?po(t,i,e,A.format,e.byteOffset,a.binding):"texScale"===a.kind?mo(t,i,e,e.byteOffset,a.x,a.y):fo(t,i,e,e.byteOffset,a.handle)}e.buffer.update(A.row,A.generation,i.u8,0,0,e.rowStride)}function wo(A,t,e=1){return(255&e)<<24|(255&A)<<16|65535&t}function yo(A){return{name:A.name,access:A.access?.key,format:A.typeInfo.format,count:A.count,isArray:A.isArray,isDynamicArray:A.isDynamicArray}}function Bo(A){const t=A.structDef;return{name:A.name,access:A.access?.key,format:t.clone(!0),count:A.count,isArray:A.isArray,isDynamicArray:!1}}function Io(A){const t=[],e=[],i=new Set;for(const n of A.values()){if(n.isSkipBinding()&&!n.isSampledTexture&&!n.isSampler)continue;const A=n.name;if(n.isSampledTexture){if(n.isStorageTexture)return null;const s=`${A}Index`;if(i.has(s))return null;i.add(s),t.push({name:s,format:"u32"}),e.push({kind:"texHandle",name:s,sourceName:A});const r=`${A}UvScale`;if(i.has(r))return null;i.add(r),t.push({name:r,format:"vec2f"}),e.push({kind:"texScale",name:r,sourceName:A});continue}if(n.isSampler){const s=`${A}Index`;if(i.has(s))return null;i.add(s),t.push({name:s,format:"u32"}),e.push({kind:"sampHandle",name:s,sourceName:A});continue}if(n.isDynamicArray||!n.isUniformBuffer&&!n.isStorageBuffer)return null;if(i.has(A))return null;if(i.add(A),n.isStructBinding){if(!(n instanceof Xt))return null;t.push(Bo(n)),e.push({kind:"buffer",name:A})}else t.push(yo(n)),e.push({kind:"buffer",name:A})}if(0===t.length)return null;const s=t.length;for(let n=1;n<s;n++){const A=t[n],i=e[n],s=A.name;let r=n-1;for(;r>=0&&t[r].name>s;)t[r+1]=t[r],e[r+1]=e[r],r--;t[r+1]=A,e[r+1]=i}return{rowFields:t,fieldKinds:e}}class Qo{device;textureTables;samplerTables;poolByKey=new Map;rowLayoutByKey=new Map;byId=new Map;scratch={id:0,generation:0};rowScratchByKey=new Map;scalarScratch=new Float64Array(1);u32Scratch=new Uint32Array(1);vec2Scratch=new Float32Array(2);#Fn={rowScratchByKey:this.rowScratchByKey,scalarScratch:this.scalarScratch,u32Scratch:this.u32Scratch,vec2Scratch:this.vec2Scratch};#uA={x:1,y:1};dirtyRecords=[];#kn=new Map;#Rn=new Map;#Ln=0;constructor(A,t,e){this.device=A,this.textureTables=t,this.samplerTables=e,t.onShardGrown=(A,t)=>{for(const e of this.poolByKey.values())e.replaceHeapView(A,t)}}beginFrame(){this.#Ln++;for(const A of this.poolByKey.values())A.buffer.beginFrame(),A.syncActiveBuffer()}writeActiveRow(A,t=!1){if(!t&&!A.isSupportFamily)return;const e=this.byId.get(A.id);!e?.active||e.refCount<=0||((t||e.rowDirty||this.#jn(e)||0!==(A.dirtyTypes&m))&&(Co(e,this.#Fn),e.rowDirty=!1),e.typeClearFrame=this.#Ln)}ensure(A){const t=this.byId,e=A.id;let i=t.get(e);const s=A.version;if(i?.active&&i.structureVersion===s)return i.refCount++,i;if(!A.isSupportFamily)return this.#zn(A,i,s);const n=A.getBindingLayoutKey();let r,a=null;if(i?.active&&n===i.table.bindingLayoutKey)r=i.table.fields;else{const t=this.rowLayoutByKey.get(n);if(t)r=t.fields;else{if(a=Io(A.getBindings()),!a)return this.#zn(A,i,s);r=a.fieldKinds}}const o=i?.active?i.heldTextures:null,l=this.#Gn(A,r,o);if(!l)return this.#zn(A,i,s);this.abandonPrepared(A.id);const c=`${n}#${l.heapSetKey}`;let h=this.poolByKey.get(c);if(!h)try{h=this.#Yn(n,l,a)}catch{return this.#zn(A,i,s,l)}if(!this.#Hn(l.sources,h))return this.#zn(A,i,s,l);if(i?.active&&i.table===h){this.#Kn(i.heldTextures,l.heldTextures);const t=!function(A,t){const e=A.length;if(e!==t.length)return!1;for(let i=0;i<e;i++){const e=A[i],s=t[i];if(e.kind!==s.kind)return!1;if("buffer"!==e.kind)if("texHandle"!==e.kind||"texHandle"!==s.kind){if("sampHandle"!==e.kind||"sampHandle"!==s.kind){if("texScale"!==e.kind||"texScale"!==s.kind)return!1;if(e.x!==s.x||e.y!==s.y)return!1}else if(e.handle!==s.handle)return!1}else if(e.handle!==s.handle)return!1}return!0}(i.sourceBindings,l.sources);return i.heldTextures=l.heldTextures,i.sourceBindings=l.sources,i.structureVersion=s,(t||this.#jn(i))&&(i.rowDirty=!0,this.#Vn(i)),A.dirtyTypes&=-424961,i.refCount++,i}const u=i?.refCount??0;let g;try{g=this.#YA(A,h,l,s)}catch{return this.#zn(A,i,s,l)}return i?.active&&(this.#Kn(i.heldTextures,l.heldTextures),this.#GA(i,!1)),g.refCount=u+1,t.set(e,g),A.dirtyTypes&=-424961,g}preparePool(A){if(!A.isSupportFamily)return null;const t=this.byId.get(A.id),e=A.getBindingLayoutKey();let i,s=null;const n=t?.active&&e===t.table.bindingLayoutKey?t.table:this.rowLayoutByKey.get(e);if(n)i=n.fields;else{if(s=Io(A.getBindings()),!s)return null;i=s.fieldKinds}const r=t?.active?t.heldTextures:null,a=this.#Gn(A,i,r);if(!a)return null;if(t?.active&&t.table.bindingLayoutKey===e&&t.table.heapSetKey===a.heapSetKey)return this.#Jn(a.newlyEnsured),t.table;const o=this.#Rn.get(A.id);if(o&&o.bindingLayoutKey===e&&o.heapSetKey===a.heapSetKey)return this.#Jn(a.newlyEnsured),o;this.#Wn(A.id),this.#Rn.delete(A.id);const l=`${e}#${a.heapSetKey}`;let c=this.poolByKey.get(l);if(!c)try{c=this.#Yn(e,a,s)}catch{return this.#Jn(a.newlyEnsured),null}return a.newlyEnsured.length>0&&this.#kn.set(A.id,a.newlyEnsured),this.#Rn.set(A.id,c),c}abandonPrepared(A){this.#Wn(A),this.#Rn.delete(A)}#Wn(A){const t=this.#kn.get(A);t&&(this.#kn.delete(A),this.#Jn(t))}#Jn(A){const t=this.textureTables;for(let e=0,i=A.length;e<i;e++)t.release(A[e])}release(A){const t=this.byId.get(A.id);return!(!t||--t.refCount>0||(this.abandonPrepared(A.id),t.active&&(A.needsLegacyBootstrap=!0,this.#GA(t,!0)),this.byId.delete(A.id),0))}noteDirtyTextures(A){const t=this.byId,e=this.textureTables;for(let i=0,s=A.length;i<s;i++){const s=t.get(A[i].id);if(!s?.active||s.refCount<=0)continue;const n=s.sourceBindings;let r=!1;for(let A=0,t=n.length;A<t;A++){const t=n[A];if("texHandle"===t.kind){t.texture&&e.noteContent(t.texture);continue}if("texScale"!==t.kind||!t.texture)continue;const i=e.contentScale(t.texture,this.#uA);t.x===i.x&&t.y===i.y||(t.x=i.x,t.y=i.y,r=!0)}r&&(s.rowDirty=!0,this.#Vn(s))}}uploadDirtyMaterials(A){this.textureTables.uploadDirty(),this.#qn();const t=this.byId;for(let e=0,i=A.length;e<i;e++){const i=A[e],s=t.get(i.id);if(s&&!(s.refCount<=0)){if(!s.active){if(!i.isSupportFamily)continue;const A=s.refCount,e=this.ensure(i),n=t.get(i.id);n&&(n.refCount=A),e&&i.onChangeCallback(f.DIRTY_STRUCTURE);continue}i.dirtyTypes&m&&this.#Xn(s)}}this.#qn()}#qn(){const A=this.dirtyRecords,t=this.byId;for(let e=0,i=A.length;e<i;e++){const i=A[e];i.rowQueued=!1,t.get(i.material.id)!==i||i.refCount<=0||this.#Xn(i)}A.length=0}dispose(){for(const A of this.byId.values())A.active&&this.#GA(A,!0);this.byId.clear();for(const A of this.poolByKey.values())A.buffer.destroy();this.poolByKey.clear(),this.rowLayoutByKey.clear(),this.rowScratchByKey.clear(),this.dirtyRecords.length=0}#Yn(A,t,e){const i=`${A}#${t.heapSetKey}`,s=this.rowLayoutByKey.get(A);if(s)return this.#Zn(i,A,t,s.rowDef,s.fields);if(!e)throw new Error(`MaterialTableManager: missing CollectedLayout for ${A}`);const n=new wt("MaterialRow",e.rowFields,{useStandardLayout:!0,optimizeMemory:!1});n.computeLayout();const r=[],a=e.fieldKinds,o=n.fields;for(let l=0,c=a.length;l<c;l++){const A=a[l],t=o.get(A.name);if(!t)throw new Error(`MaterialTableManager: missing row field ${A.name}`);r.push({name:A.name,meta:t.meta,format:t.format,kind:A.kind,sourceName:A.sourceName})}return this.#Zn(i,A,t,n,r)}#Zn(A,t,e,i,s){const n=[],r=new Map,a=this.textureTables,o=e.heapKeyList;for(let y=0,B=o.length;y<B;y++){const A=o[y],t=a.getHeapResource(A);if(!t)throw new Error(`MaterialTableManager: missing heap ${A}`);r.set(A,y),n.push(t)}const l=this.samplerTables,c=e.sampHandles,h=new Array(c.length);for(let y=0,B=c.length;y<B;y++){const A=c[y];h[y]={name:`sampHeap${y}`,sampler:l.getSampler(A),gpu:l.getGpuSampler(A,a.defaultSampler),handle:A}}const u=0|i.typeInfo.size,g=this.device,d=g.limits.maxStorageBufferBindingSize,p=g.limits.maxBufferSize,f=Math.floor(Math.min(d,p)/u);if(f<1)throw new Error("MaterialTableManager: row exceeds device storage buffer limit");const m=ze(A)||1,C=new ho(this.device,{rowStride:u,initialRows:Math.min(256,f),maxRows:f,label:`MaterialTable(${A.slice(0,48)})`}),w=new go(m,t,e.heapSetKey,i,s,C,n,h,r);return this.poolByKey.set(A,w),this.rowLayoutByKey.has(t)||this.rowLayoutByKey.set(t,w),w}#Gn(A,t,e){const i=A.getBindings(),s=e?new Set(e):null,n=[],r=[],a=[],o=new Map,l=new Set,c=new Set,h=this.textureTables,u=this.samplerTables,g=()=>{for(let A=0,t=n.length;A<t;A++)h.release(n[A]);return null};for(let f=0,m=t.length;f<m;f++){const A=t[f],e=A.kind??"buffer";if("buffer"===e){const t=i.get(A.name);if(!t||!t.isUniformBuffer&&!t.isStorageBuffer)return g();r.push({kind:"buffer",binding:t});continue}if("texHandle"===e){const t=i.get(A.sourceName);if(!(t instanceof qt))return g();const e=t.getValue();if(!e){r.push({kind:"texHandle",binding:t,texture:null,handle:0});continue}let c=o.get(e);if(!c){let A;if(s?.has(e)){if(h.noteContent(e),A=h.getResidency(e),!A)return g()}else{if(A=h.ensure(e),!A)return g();n.push(e)}c={heapKey:A.heapKey,layer:A.layer},o.set(e,c),l.add(A.heapKey),a.push(e)}r.push({kind:"texHandle",binding:t,texture:e,handle:0,heapKey:c.heapKey,layer:c.layer});continue}if("texScale"===e){const t=i.get(A.sourceName);if(!(t instanceof qt))return g();const e=t.getValue();if(!e){r.push({kind:"texScale",binding:t,texture:null,x:1,y:1});continue}const s=h.contentScale(e,this.#uA);r.push({kind:"texScale",binding:t,texture:e,x:s.x,y:s.y});continue}if("sampHandle"===e){const t=i.get(A.sourceName);if(!(t instanceof Wt))return g();const e=u.ensure(t.getValue());c.add(e),r.push({kind:"sampHandle",binding:t,handle:e});continue}return g()}const d=[...l].sort(),p=[...c].sort((A,t)=>A-t);return 0===p.length&&d.length>0&&p.push(0),{heapSetKey:`t:${d.join(",")}|s:${p.join(",")}`,heapKeyList:d,sampHandles:p,sources:r,heldTextures:a,newlyEnsured:n}}#Hn(A,t){const e=t.heapIndexByKey;for(let i=0;i<A.length;i++){const t=A[i];if("texHandle"!==t.kind||!t.texture)continue;const s=e.get(t.heapKey);if(void 0===s)return!1;t.handle=wo(s,0|t.layer,1)}return!0}#Kn(A,t){if(0===A.length)return;const e=new Set(t),i=this.textureTables;for(let s=0,n=A.length;s<n;s++){const t=A[s];e.has(t)||i.release(t)}}#zn(A,t,e,i=null){if(i){const A=this.textureTables;for(let t=0,e=i.newlyEnsured.length;t<e;t++)A.release(i.newlyEnsured[t])}return t?.active&&(A.needsLegacyBootstrap=!0),A.dirtyTypes&=-424961,this.#_n(A,t,e),null}#jn(A){const t=A.sourceBindings;for(let e=0,i=t.length;e<i;e++){const A=t[e];if("buffer"===A.kind&&A.binding.isDirty)return!0}return!1}#$n(A){const t=A.sourceBindings;for(let e=0,i=t.length;e<i;e++){const A=t[e];"buffer"===A.kind&&(A.binding.isDirty=!1)}}#Vn(A){A.rowQueued||(A.rowQueued=!0,this.dirtyRecords.push(A))}#Xn(A){const t=A.material;if(0!==A.typeClearFrame&&A.typeClearFrame===this.#Ln)return void((A.rowDirty||this.#jn(A))&&(Co(A,this.#Fn),A.rowDirty=!1));const e=-1!==t._dirtySlot;(A.rowDirty||this.#jn(A))&&(Co(A,this.#Fn),this.#$n(A),A.rowDirty=!1),(e||-1===t._dirtySlot)&&(t.dirtyTypes&=-424961)}#_n(A,t,e){if(!t)return void this.byId.set(A.id,{active:!1,refCount:1,material:A,structureVersion:e});if(!t.active)return t.structureVersion=e,void t.refCount++;const i=t.refCount;this.#GA(t,!0),this.byId.set(A.id,{active:!1,refCount:i+1,material:A,structureVersion:e})}#YA(A,t,e,i){const s=this.scratch;if(!t.buffer.alloc(s))throw new Error(`MaterialTableManager: alloc failed (${t.bindingLayoutKey})`);t.syncActiveBuffer();const n={active:!0,refCount:1,material:A,table:t,row:s.id,generation:s.generation,rowDirty:!0,rowQueued:!1,typeClearFrame:0,structureVersion:i,sourceBindings:e.sources,heldTextures:e.heldTextures};return this.#Vn(n),n}#GA(A,t){if(t){const t=A.heldTextures,e=this.textureTables;for(let A=0,i=t.length;A<i;A++)e.release(t[A])}A.heldTextures=[],A.row>=0&&(A.table.buffer.free(A.row,A.generation),A.row=-1,A.generation=0),A.refCount=0,A.rowQueued=!1,A.rowDirty=!1}}const Eo=16<<20;class xo{constructor(A){this.device=A}mipScratchPools=new Map;mipScratchInUse=new Map;copyEncoder=null;rowPadScratch=null;scaleCanvas=null;scaleCtx=null;srcCanvas=null;srcCtx=null;fitScratch=null;#Ar=null;#tr=null;#er=null;#ir=null;dispose(){this.flush();for(const A of this.mipScratchPools.values())for(let t=0;t<A.length;t++)A[t].destroy();this.mipScratchPools.clear(),this.mipScratchInUse.clear(),this.scaleCanvas=null,this.scaleCtx=null,this.srcCanvas=null,this.srcCtx=null,this.#tr?.destroy(),this.#er?.destroy(),this.#ir?.destroy(),this.#tr=this.#er=this.#ir=null,this.#Ar=null}uploadLayer(t,e){const i=e.gpuTexture,s=e.layer,n=e.ladderSize,r=i.mipLevelCount,a=t.image,o=this.device,l=e.format,c=e.contentWidth,h=e.contentHeight,u=c===n&&h===n;let g=null;r>1&&(g=this.#sr(function(A,t,e){return`${A}|${t}|m${e}`}(l,n,r),l,n,r));const d=g??i,p=g?0:s;if(ArrayBuffer.isView(a?.data)){const A=a.data;u?this.#nr(t,d,p,n,A):this.#rr(t,d,p,n,c,h,A)}else if(ct(a))if(u){const A=t.width===n&&t.height===n,e=A?a:this.#ar(a,n,t.flipY,!1);this.#or(o,d,p,0,n,e,t.premultiplyAlpha,t.colorSpace,A&&t.flipY)}else{const A=this.#lr(a,t.width,t.height,n,c,h,t.flipY);this.#or(o,d,p,0,n,A,t.premultiplyAlpha,t.colorSpace)}else{const A=new Uint8Array(n*n*4);A.fill(255),o.queue.writeTexture({texture:d,origin:{x:0,y:0,z:p}},A,{bytesPerRow:4*n,rowsPerImage:n},{width:n,height:n,depthOrArrayLayers:1})}g&&(A.generateMipmap(o,g),this.#cr(g,i,s,n,r))}#sr(A,t,e,i){let s=this.mipScratchPools.get(A);s||(s=[],this.mipScratchPools.set(A,s));const n=this.mipScratchInUse.get(A)??0;if(n<s.length)return this.mipScratchInUse.set(A,n+1),s[n];const r=this.#hr(t,e,i);return s.push(r),this.mipScratchInUse.set(A,n+1),r}#hr(A,t,e){return this.device.createTexture({label:`TexTable/mipScratch(${A}|${t}|m${e})`,format:A,size:{width:t,height:t},mipLevelCount:e,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT})}#cr(A,t,e,i,s){const n=this.copyEncoder??=this.device.createCommandEncoder({label:"TexTable/copyMipsBatch"});for(let r=0;r<s;r++){const s=Math.max(1,i>>r);n.copyTextureToTexture({texture:A,mipLevel:r},{texture:t,mipLevel:r,origin:{x:0,y:0,z:e}},{width:s,height:s,depthOrArrayLayers:1})}}flush(){const A=this.copyEncoder;this.mipScratchInUse.clear(),A&&(this.copyEncoder=null,this.device.queue.submit([A.finish()]))}#or(A,t,e,i,s,n,r,a,o=!1){const l={texture:t,mipLevel:i,origin:{x:0,y:0,z:e},premultipliedAlpha:r};a===bA.SRGBColorSpace&&(l.colorSpace="srgb"),A.queue.copyExternalImageToTexture({source:n,flipY:o},l,{width:s,height:s,depthOrArrayLayers:1})}#nr(A,t,e,i,s){const n=A.width,r=A.height,a=0|(A.sampleConfig?.byte??4);if(n===i&&r===i)return void this.#ur(t,e,s,n,r,a);if(4===a&&("rgba8unorm"===(o=t.format)||"rgba8unorm-srgb"===o||"bgra8unorm"===o||"bgra8unorm-srgb"===o)&&this.#gr(A,t,e,i,s,n,r))return;var o;if(this.#dr(t,e,i,s,n,r,a))return;const l=new Uint8Array(s.buffer,s.byteOffset,s.byteLength),c=new Uint8Array(i*i*a),h=n/i,u=r/i;for(let g=0;g<i;g++){const A=g*i*a,t=Math.min(r-1,g*u|0)*n*a;for(let e=0;e<i;e++){const i=A+e*a,s=t+Math.min(n-1,e*h|0)*a;for(let A=0;A<a;A++)c[i+A]=l[s+A]}}this.#ur(t,e,c,i,i,a)}#dr(A,t,e,i,s,n,r){const a=this.device,o=s*n*r,l=o+3&-4,c=e*r+255&-256,h=c*e,u=a.limits.maxStorageBufferBindingSize;if(i.byteLength<o||l>u||h>u)return!1;const g=this.#tr=this.#pr(this.#tr,l,GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST),d=this.#er=this.#pr(this.#er,h,GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC),p=this.#ir??=a.createBuffer({label:"TexTable/resampleParams",size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),f=a.queue,m=-4&o;if(m>0&&f.writeBuffer(g,0,i.buffer,i.byteOffset,m),m!==o){const A=new Uint8Array(4);A.set(new Uint8Array(i.buffer,i.byteOffset+m,o-m)),f.writeBuffer(g,m,A)}f.writeBuffer(p,0,new Uint32Array([s,n,e,r,s*r,c,0,0]));const C=this.#Ar??=a.createComputePipeline({label:"TexTable/resampleNearest",layout:"auto",compute:{module:a.createShaderModule({label:"TexTable/resampleNearest",code:"\nstruct Params { srcW: u32, srcH: u32, dst: u32, bpp: u32, srcRowBytes: u32, dstRowBytes: u32, _p0: u32, _p1: u32 }\n@group(0) @binding(0) var<storage, read> src: array<u32>;\n@group(0) @binding(1) var<storage, read_write> dst: array<u32>;\n@group(0) @binding(2) var<uniform> p: Params;\n\nfn srcByte(i: u32) -> u32 {\n return (src[i >> 2u] >> ((i & 3u) * 8u)) & 0xffu;\n}\n\n@compute @workgroup_size(64)\nfn main(@builtin(global_invocation_id) gid: vec3u) {\n let wordsPerRow = p.dstRowBytes >> 2u;\n let word = gid.x;\n let y = gid.y;\n if (word >= wordsPerRow || y >= p.dst) { return; }\n let srcRow = min(p.srcH - 1u, (y * p.srcH) / p.dst) * p.srcRowBytes;\n let tight = p.dst * p.bpp;\n var v = 0u;\n for (var k = 0u; k < 4u; k++) {\n let b = word * 4u + k;\n if (b >= tight) { break; }\n let x = b / p.bpp;\n let sx = min(p.srcW - 1u, (x * p.srcW) / p.dst);\n v |= srcByte(srcRow + sx * p.bpp + (b - x * p.bpp)) << (k * 8u);\n }\n dst[y * wordsPerRow + word] = v;\n}\n"}),entryPoint:"main"}}),w=a.createBindGroup({layout:C.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:g,size:l}},{binding:1,resource:{buffer:d,size:h}},{binding:2,resource:{buffer:p}}]}),y=a.createCommandEncoder({label:"TexTable/resampleNearest"}),B=y.beginComputePass();return B.setPipeline(C),B.setBindGroup(0,w),B.dispatchWorkgroups(Math.ceil(c/4/64),e),B.end(),y.copyBufferToTexture({buffer:d,bytesPerRow:c,rowsPerImage:e},{texture:A,origin:{x:0,y:0,z:t}},{width:e,height:e,depthOrArrayLayers:1}),f.submit([y.finish()]),g.size>Eo&&(this.#tr=null,this.#fr(g)),d.size>Eo&&(this.#er=null,this.#fr(d)),!0}#pr(A,t,e){return A&&A.size>=t?A:(A&&this.#fr(A),this.device.createBuffer({label:"TexTable/resample",size:t,usage:e}))}#fr(A){this.device.queue.onSubmittedWorkDone().then(()=>A.destroy())}#gr(A,t,e,i,s,n,r){const a=n*r*4;if(s.byteLength<a)return!1;let o;try{o=s instanceof Uint8ClampedArray&&s.byteLength===a?s:new Uint8ClampedArray(s.buffer,s.byteOffset,a);const l=this.#mr(n,r,!0);this.srcCtx.putImageData(new ImageData(o,n,r),0,0);const c=this.#ar(l,i,!1,!0);return this.#or(this.device,t,e,0,i,c,A.premultiplyAlpha,A.colorSpace),!0}catch{return!1}}#rr(A,t,e,i,s,n,r){const a=0|A.width,o=0|A.height,l=0|(A.sampleConfig?.byte??4);if(a<1||o<1||l<1)return;const c=i*i*l;let h=this.fitScratch;(!h||h.byteLength<c)&&(h=new Uint8Array(c),this.fitScratch=h);const u=Math.min(r.byteLength,a*o*l),g=new Uint8Array(r.buffer,r.byteOffset,u);this.#Cr(g,h,a,o,i,s,n,l),this.#ur(t,e,h.subarray(0,c),i,i,l)}#Cr(A,t,e,i,s,n,r,a){const o=e*a,l=s*a,c=n*a,h=A.byteLength;if(n===e&&r===i)for(let u=0;u<r;u++){const e=u*o;if(e+c>h)break;t.set(A.subarray(e,e+c),u*l)}else for(let u=0;u<r;u++){const s=Math.min(i-1,u*i/r|0)*o,c=u*l;for(let i=0;i<n;i++){const r=s+Math.min(e-1,i*e/n|0)*a;if(r+a>h)continue;const o=c+i*a;for(let e=0;e<a;e++)t[o+e]=A[r+e]}}if(n<s)for(let u=0;u<r;u++){const A=u*l,e=A+(n-1)*a;for(let i=n;i<s;i++){const s=A+i*a;for(let A=0;A<a;A++)t[s+A]=t[e+A]}}if(r<s){const A=(r-1)*l,e=t.subarray(A,A+l);for(let i=r;i<s;i++)t.set(e,i*l)}}#lr(A,t,e,i,s,n,r){const a=this.#mr(i,i,!1),o=this.scaleCtx;o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,i,i),o.imageSmoothingEnabled=!0;const l=Math.max(0|t,1),c=Math.max(0|e,1);if(r?(o.save(),o.translate(0,n),o.scale(1,-1),o.drawImage(A,0,0,l,c,0,0,s,n),o.restore()):o.drawImage(A,0,0,l,c,0,0,s,n),o.imageSmoothingEnabled=!1,s<i&&(r?(o.save(),o.translate(0,n),o.scale(1,-1),o.drawImage(A,l-1,0,1,c,s,0,i-s,n),o.restore()):o.drawImage(A,l-1,0,1,c,s,0,i-s,n)),n<i){const t=r?0:c-1;o.drawImage(A,0,t,l,1,0,n,s,i-n)}if(s<i&&n<i){const t=r?0:c-1;o.drawImage(A,l-1,t,1,1,s,n,i-s,i-n)}return a}#ur(A,t,e,i,s,n){const r=i*n,a=r+255&-256;let o=e;if(a!==r){const A=a*s;let t=this.rowPadScratch;(!t||t.byteLength<A)&&(t=new Uint8Array(A),this.rowPadScratch=t);const i=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(let e=0;e<s;e++)t.set(i.subarray(e*r,e*r+r),e*a);o=t}this.device.queue.writeTexture({texture:A,origin:{x:0,y:0,z:t}},o,{bytesPerRow:a,rowsPerImage:s},{width:i,height:s,depthOrArrayLayers:1})}#mr(A,t,e){let i=e?this.srcCanvas:this.scaleCanvas;if(!i||i.width!==A||i.height!==t){i="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(A,t):Object.assign(document.createElement("canvas"),{width:A,height:t});const s=i.getContext("2d");e?(this.srcCanvas=i,this.srcCtx=s):(this.scaleCanvas=i,this.scaleCtx=s)}return i}#ar(A,t,e,i=!1){const s=this.#mr(t,t,!1),n=this.scaleCtx;return n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t,t),n.imageSmoothingEnabled=!i,e&&(n.translate(0,t),n.scale(1,-1)),n.drawImage(A,0,0,t,t),s}}const Do=[128,256,512,1024,2048];function Mo(A){const t=EA[A.format]?.block;if(!t)return 0;let e=0,i=A.size,s=A.size;for(let n=0;n<A.mipLevelCount;n++)e+=Math.ceil(i/t.width)*Math.ceil(s/t.height)*t.byteLength,i=Math.max(1,i>>1),s=Math.max(1,s>>1);return e*A.capacity}function bo(A,t){const e=A.ladderSize;let i=e,s=e;const n=t.sampler;if(n.wrapS===q.ClampToEdge&&n.wrapT===q.ClampToEdge){const A=Math.max(0|t.width,1),n=Math.max(0|t.height,1);A<=e&&n<=e?(i=A,s=n):A>=n?s=Math.max(1,Math.min(e,Math.round(n*e/A))):i=Math.max(1,Math.min(e,Math.round(A*e/n)))}return(A.contentWidth!==i||A.contentHeight!==s)&&(A.contentWidth=i,A.contentHeight=s,!0)}function So(A,t){return`${A}#${t}`}class vo{device;#wr;shards=new Map;byTexId=new Map;pendingFrees=[];dirtyTexIds=[];dirtySet=new Set;#yr=[];onShardGrown=null;defaultSampler;constructor(A){this.device=A,this.#wr=new xo(A),this.defaultSampler=A.createSampler({addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",magFilter:"linear",minFilter:"linear",mipmapFilter:"linear",maxAnisotropy:4})}beginFrame(){const A=this.pendingFrees;let t=0;for(let e=0,i=A.length;e<i;e++){const i=A[e];--i.framesLeft>0?A[t++]=i:this.#Br(i.shardKey,i.layer,i.generation)}A.length=t}writeStats(A){A.shardCount=0,A.capacityLayers=0,A.liveLayers=0,A.pendingFreeLayers=this.pendingFrees.length,A.accountedGpuBytes=0;for(const t of this.shards.values())for(let e=0,i=t.length;e<i;e++){const i=t[e];A.shardCount++,A.capacityLayers+=i.capacity,A.liveLayers+=i.liveCount,A.accountedGpuBytes+=Mo(i)}}ensure(A,t="ladder"){if(!this.#Ir(A))return null;A.prepareConfiguration();const e=A.id,i=this.byTexId;let s=i.get(e);const n=A.source?.version??0;if(s)return s.refCount++,(bo(s.residency,A)||n!==s.sourceVersion||A.isDirty)&&(s.sourceVersion=n,s.rowDirty=!0,this.#Ti(e)),s.residency;const r="exact"===t?Math.max(A.width,A.height):function(A,t){const e=Math.max(0|A,0|t,1),i=Do.length;for(let s=0;s<i;s++)if(e<=Do[s])return Do[s];return Do[i-1]}(A.width,A.height),a=A.format,o=A.useMipmaps&&A.generateMipmaps?Math.floor(Math.log2(Math.max(r,1)))+1:1,l=`${a}|${r}|m${o}`,c=A.getEffectiveSampleType({device:this.device})??"float",h=this.#Qr(l,a,r,o,c);if(!h)return null;const u={shardKey:l,shardIndex:h.shard.shardIndex,heapKey:So(l,h.shard.shardIndex),layer:h.layer,generation:h.generation,format:a,ladderSize:r,contentWidth:0,contentHeight:0,gpuTexture:h.shard.gpu,view:h.shard.view,sampleType:h.shard.sampleType};return bo(u,A),s={refCount:1,residency:u,sourceVersion:n,rowDirty:!0,texture:A},i.set(e,s),this.#Ti(e),u}packHandle(A,t){return wo(t,A.layer,1)}release(A){const t=A.id,e=this.byTexId,i=e.get(t);if(!i)return;if(--i.refCount>0)return;const{shardKey:s,layer:n,generation:r}=i.residency;this.pendingFrees.push({shardKey:s,layer:n,generation:r,framesLeft:3}),this.dirtySet.delete(t),e.delete(t)}uploadDirty(){const A=this.dirtyTexIds,t=this.dirtySet,e=this.byTexId;for(let i=0,s=A.length;i<s;i++){const s=A[i],n=e.get(s);t.delete(s),n&&(n.rowDirty||n.texture.isDirty)&&(this.#wr.uploadLayer(n.texture,n.residency),n.rowDirty=!1,n.texture.isDirty=!1)}A.length=0,this.#wr.flush()}uploadTexture(A){const t=this.byTexId.get(A.id);t&&(t.rowDirty||A.isDirty)&&(this.#wr.uploadLayer(A,t.residency),t.rowDirty=!1,A.isDirty=!1,this.#wr.flush())}getResidency(A){return this.byTexId.get(A.id)?.residency??null}noteContent(A){const t=this.byTexId.get(A.id);if(!t)return;const e=bo(t.residency,A),i=A.source?.version??0;(e||i!==t.sourceVersion||A.isDirty)&&(t.sourceVersion=i,t.rowDirty=!0,this.#Ti(A.id))}contentScale(A,t){const e=this.byTexId.get(A.id);if(!e)return t.x=1,t.y=1,t;const i=e.residency,s=i.ladderSize;return t.x=i.contentWidth/s,t.y=i.contentHeight/s,t}getHeapResource(A){const t=A.lastIndexOf("#");if(t<0)return null;const e=A.slice(0,t),i=Number(A.slice(t+1)),s=this.shards.get(e);if(!s||i<0||i>=s.length)return null;const n=s[i];return{heapKey:A,view:n.view,format:n.format,sampleType:n.sampleType,mipLevelCount:n.mipLevelCount}}dispose(){this.#wr.dispose();for(const t of this.shards.values())for(const A of t)A.gpu.destroy();this.shards.clear(),this.byTexId.clear(),this.pendingFrees.length=0,this.dirtyTexIds.length=0,this.dirtySet.clear();const A=this.#yr;for(let t=0;t<A.length;t++)A[t].destroy();A.length=0}#Ir(A){if(A.isExternalTexture||A.isStorageTexture||A.isDepthTexture)return!1;if(A.isCube||A.isArray)return!1;if(A.sampleCount>1)return!1;const t=A.image;return!(null==t||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||!ArrayBuffer.isView(t?.data)&&!ct(t)&&0!==(A.usage&GPUTextureUsage.RENDER_ATTACHMENT))}#Ti(A){this.dirtySet.has(A)||(this.dirtySet.add(A),this.dirtyTexIds.push(A))}#Er(){return Math.min(256,0|this.device.limits.maxTextureArrayLayers)}#Qr(A,t,e,i,s){const n=this.shards;let r=n.get(A);r||(r=[],n.set(A,r));for(let p=0,f=r.length;p<f;p++){const A=r[p];if(0!==A.freeList.length)return this.#xr(A)}const a=r.length>0?r[r.length-1]:null;if(a&&this.#Dr(a))return this.#xr(a);const o=this.#Er();if(o<1)return null;const l=Math.min(4,o),c=this.device.createTexture({label:`TexShard(${A})#${r.length}@${l}`,format:t,size:{width:e,height:e,depthOrArrayLayers:l},mipLevelCount:i,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT}),h=c.createView({dimension:"2d-array"}),u=new Uint32Array(l),g=[];for(let p=l-1;p>=0;p--)g.push(p);const d={key:A,format:t,size:e,mipLevelCount:i,capacity:l,shardIndex:r.length,gpu:c,view:h,sampleType:s,generations:u,freeList:g,liveCount:0};return r.push(d),this.#xr(d)}#xr(A){const t=A.freeList.pop();let e=1+(2147483647&A.generations[t]);0===e&&(e=1);const i=(2147483648|e)>>>0;return A.generations[t]=i,A.liveCount++,{shard:A,layer:t,generation:i}}#Dr(A){const t=this.#Er(),e=Math.min(t,A.capacity<<1);if(e<=A.capacity)return!1;this.#wr.flush();const i=this.device,s=i.createTexture({label:`TexShard(${A.key})#${A.shardIndex}@${e}`,format:A.format,size:{width:A.size,height:A.size,depthOrArrayLayers:e},mipLevelCount:A.mipLevelCount,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT}),n=A.gpu,r=i.createCommandEncoder();let a=!1;const o=A.capacity;for(let u=0;u<o;u++){if(!(2147483648&A.generations[u]))continue;let t=A.size,e=A.size;for(let i=0;i<A.mipLevelCount;i++)r.copyTextureToTexture({texture:n,mipLevel:i,origin:{x:0,y:0,z:u}},{texture:s,mipLevel:i,origin:{x:0,y:0,z:u}},{width:t,height:e,depthOrArrayLayers:1}),a=!0,t=Math.max(1,t>>1),e=Math.max(1,e>>1)}if(!a)return s.destroy(),!1;i.queue.submit([r.finish()]);const l=s.createView({dimension:"2d-array"}),c=new Uint32Array(e);c.set(A.generations),A.generations=c;for(let u=e-1;u>=o;u--)A.freeList.push(u);A.capacity=e,A.gpu=s,A.view=l;const h=So(A.key,A.shardIndex);return this.#Mr(h,s,l),this.#br(n),this.onShardGrown?.(h,l),!0}#Mr(A,t,e){for(const i of this.byTexId.values()){const s=i.residency;s.heapKey===A&&(s.gpuTexture=t,s.view=e)}}#br(A){const t=this.#yr;t.push(A),this.device.queue.onSubmittedWorkDone().then(()=>{const e=t.indexOf(A);e<0||(t.splice(e,1),A.destroy())})}#Br(A,t,e){const i=this.shards.get(A);if(i)for(let s=0,n=i.length;s<n;s++){const A=i[s];if(A.generations[t]===e)return A.generations[t]=2147483647&e,A.freeList.push(t),void A.liveCount--}}}class To{device;bySampler=new Map;keyBySampler=new Map;byKey=new Map;list=[];constructor(A){this.device=A,this.list.push(null)}ensure(A){if(null==A)return 0;const t=this.bySampler.get(A);if(null!=t){const e=this.keyBySampler.get(A);if(null!=e&&e===A.getDescriptorKey())return t;this.bySampler.delete(A),this.keyBySampler.delete(A),this.list[t]===A&&(this.list[t]=this.#Sr(t)),null!=e&&this.#vr(e,t)}const e=A.getDescriptorKey(),i=this.byKey.get(e);if(null!=i)return this.bySampler.set(A,i),this.keyBySampler.set(A,e),A.createSampler(this.device),i;const s=this.list.length;return this.list.push(A),this.bySampler.set(A,s),this.byKey.set(e,s),this.keyBySampler.set(A,e),A.createSampler(this.device),s}getSampler(A){return A<=0||A>=this.list.length?null:this.list[A]??null}getGpuSampler(A,t){const e=this.getSampler(A);return e?e.createSampler(this.device):t}remove(A){const t=this.bySampler.get(A);if(null==t)return;const e=this.keyBySampler.get(A);this.bySampler.delete(A),this.keyBySampler.delete(A),this.list[t]===A&&(this.list[t]=this.#Sr(t)),null!=e&&this.#vr(e,t)}clear(){this.bySampler.clear(),this.keyBySampler.clear(),this.byKey.clear(),this.list.length=1}#Sr(A){for(const[t,e]of this.bySampler)if(e===A)return t;return null}#vr(A,t){for(const e of this.bySampler.values())if(e===t)return;this.byKey.get(A)===t&&this.byKey.delete(A)}dispose(){this.clear()}}const Uo=j.STORAGE|j.COPY_DST|j.COPY_SRC;class No extends yt{device;binding;dirtyIds;dirtyCount=0;isTransferDirty=!1;get gpuBuffer(){return this.binding.dataView.buffer}get cpuView(){return this.f32}constructor(A,t=16384){const e=t;super(e,"vec4f",{isStandardLayout:!0,count:e,enableFreeList:!0,isAutoGrow:!0,isAutoShrink:!1}),this.maxCount=1e6,this.device=A,this.binding=new Ht("bounding",this.f32,"f32",{visibility:z.COMPUTE,access:"ReadOnly",isArray:!0,isDynamicArray:!0,usage:Uo,count:e}),this.binding.setCount(t,!0),this.dirtyIds=new Uint32Array(e)}syncCapacityState(A,t){const e=super.syncCapacityState(A,t);return e&&(this.isTransferDirty=!0,this.binding.dataView.view=this.f32,this.dirtyCount<t&&(this.dirtyIds=new Uint32Array(this.dirtyIds.buffer.transfer(4*t)))),e}writeDirty(A){if(A<0||A>=this.maxCount)return;let t=this.dirtyIds;if(this.dirtyCount>=t.length){const A=Math.max(t.length<<1,this.dirtyCount+1);this.dirtyIds=t=new Uint32Array(t.buffer.transfer(4*A))}t[this.dirtyCount++]=A}write(A,t){A<0||A>=this.maxCount||(this.f32.set(t,4*A),this.writeDirty(A))}read(A){if(A<0||A>=this.maxCount)return;const t=4*A;return this.f32.subarray(t,t+4)}releaseGPU(A){if(null!=A&&null!=this.device&&this.device!==A)return;const t=this.binding.dataView,e=t.buffer;e&&(It.release(this.device,e),t.buffer=null,t.ownsBuffer=!1),this.device=void 0}update(A){const t=this.device;null!=t&&t!==A&&this.releaseGPU(t),this.device=A;const e=this.binding;let i=e.dataView.buffer,s=e.count,n=!1;return(!i||this.isTransferDirty||this.maxIndex>=s)&&(n=!0,s=Math.min(this.count,Math.max(this.calcCapacity(),this.maxIndex+1,1)),e.setCount(s,!0),i=e.createGPUBuffer(A),this.isTransferDirty=!1),this.flushDirty(n,A,i,s),n}flushDirty(A,t,e,i){const s=this.f32;A?t.queue.writeBuffer(e,0,s,0,4*i):ne(t.queue,e,s,this.dirtyIds,this.dirtyCount,4),this.dirtyCount=0}dispose(){this.releaseGPU(),this.binding.dispose?.()}}const Po=new WebAssembly.Module(function(A){const t=globalThis;if("function"==typeof t.atob){const e=t.atob(A),i=e.length,s=new Uint8Array(i);for(let A=0;A<i;A++)s[A]=e.charCodeAt(A);return s}return new Uint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KAIAQQJ2QfwAcWoiDCAMKAIAQQFqNgIAIAMgDSACQQRqKAIAQTBsakEcaigCAEECdkH8AHFqIgwgDCgCAEEBajYCACACQQhqIQIgBCABQQJqIgFHDQALRQ0BCyADIA0gCCABQQJ0aigCAEEwbGpBHGooAgBBAnZB/ABxaiIAIAAoAgBBAWo2AgALQQAhASADQQA2AoABIAMgAygCACIANgKEASADIAAgAygCBGoiADYCiAEgAyADKAIIIABqIgA2AowBIAMgAygCDCAAaiIANgKQASADIAMoAhAgAGoiADYClAEgAyADKAIUIABqIgA2ApgBIAMgAygCGCAAaiIANgKcASADIAMoAhwgAGoiADYCoAEgAyADKAIgIABqIgA2AqQBIAMgAygCJCAAaiIANgKoASADIAMoAiggAGoiADYCrAEgAyADKAIsIABqIgA2ArABIAMgAygCMCAAaiIANgK0ASADIAMoAjQgAGoiADYCuAEgAyADKAI4IABqIgA2ArwBIAMgAygCPCAAaiIANgLAASADIAMoAkAgAGoiADYCxAEgAyADKAJEIABqIgA2AsgBIAMgAygCSCAAaiIANgLMASADIAMoAkwgAGoiADYC0AEgAyADKAJQIABqIgA2AtQBIAMgAygCVCAAaiIANgLYASADIAMoAlggAGoiADYC3AEgAyADKAJcIABqIgA2AuABIAMgAygCYCAAaiIANgLkASADIAMoAmQgAGoiADYC6AEgAyADKAJoIABqIgA2AuwBIAMgAygCbCAAaiIANgLwASADIAMoAnAgAGoiADYC9AEgAyADKAJ0IABqIgA2AvgBIAMgAygCeCAAajYC/AFBgIDAACgCACEAAkAgCgRAIAdBAXEgB0F+cSEMIAghAgNAIA8gA0GAAWoiCyAAIAIoAgAiCkEwbGpBHGooAgBBAnZB/ABxaiINKAIAIg5BAnRqIAo2AgAgDSAOQQFqNgIAIAsgACACQQRqKAIAIg1BMGxqQRxqKAIAQQJ2QfwAcWoiCygCACEKIAsgCkEBajYCACAPIApBAnRqIA02AgAgAkEIaiECIAwgAUECaiIBRw0AC0UNAQsgA0GAAWogACAIIAFBAnRqKAIAIgFBMGxq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AAIAIgD2oiATYCAEGUgMAAIAIgCmo2AgBBmIDAACACIAtqNgIAQZyAwAAgAiAMajYCAEGggMAAIAIgBGoiDzYCAEGogMAAIAIgCGoiEDYCAEGkgMAAIAIgBmoiETYCAEG8gMAAIAIgBWoiEjYCAEG0gMAAIAIgCWoiEzYCAEG4gMAAIAIgDWoiDTYCAEGQgMAAIAIgDmoiDjYCACAAIANrIglBMGwiBARAIAIgFGpBACAE/AsACyAJQQZ0IgQEQCABIAdqQQAgBPwLAAsgAyEBAkACQCAJQQhJDQAgAEEESQ0AIAlBfHEiCCABaiEBIAIgA0ECdCIEIApqaiEGIAIgBCALamohByACIAQgDGpqIQUgCCEEA0AgBv0M//////////////////////0LAgAgB/0M//////////////////////0LAgAgBf0M//////////////////////0LAgAgBkEQaiEGIAdBEGohByAFQRBqIQUgBEEEayIEDQALIAggCUYNAQsgASEIIAAgAWtBA3EiBARAIAEgBGohCCACIAFBAnQiBSAKamohBiACIAUgC2pqIQcgAiAFIAxqaiEFA0AgBkF/NgIAIAdBfzYCACAFQX82AgAgBkEEaiEGIAdBBGohByAFQQRqIQUgBEEBayIEDQALCyABIABrQXxLDQAgACAIayEEIAIgCEECdCIBIAxqaiEGIAIgASALamohByACIAEgCmpqIQUDQCAFQX82AgAgB0F/NgIAIAZBfzYCACAFQQRqQX82AgAgB0EEakF/NgIAIAZBBGpBfzYCACAFQQhqQX82AgAgB0EIakF/NgIAIAZBCGpBfzYCACAFQQxqQX82AgAgB0EMakF/NgIAIAZBDGpBfzYCACAGQRBqIQYgB0EQaiEHIAVBEGohBSAEQQRrIgQNAAsLIANBAnQhASAJQQJ0IgNFIgRFBEAgASAPakEAIAP8CwALIARFBEAgASAQakEAIAP8CwALIARFBEAgASARakEAIAP8CwALIARFBEAgASASakEAIAP8CwALIARFBEAgASATakEAIAP8CwALIARFBEAgASANakEAIAP8CwALAkAgHkEFdiIDIB1BBXYiAU0NACADIAFrQQJ0IgNFDQAgDiABQQJ0akEAIAP8CwALQayAwAAgADYCAAtBASEHCyAHC9gGAg9/AX4CQCAARQ0AQayAwAAoAgANACAArUIwfiIQQiCIpw0AIABB////H0sNACAQpyIDIABBBnRqIgggA0kNACAAQQJ0IgEgCGoiCSAISQ0AIAEgCWoiCiAJSQ0AIAEgCmoiByAKSQ0AIAEgB2oiBiAHSQ0AIAYgASAGaiILSw0AIAEgC2oiDCALSQ0AIAEgDGoiDSAMSQ0AIAEgDWoiDiANSQ0AIAEgDmoiDyAOSQ0AIA8gAEEfakEDdkH8//8HcWoiASAPSQ0AIAFB//8DakEQdkAAIgFBf0YNACABQRB0IgJFDQBBACEBQYCAwAAgAjYCAEGwgMAAIAI2AgBBwIDAACACIANqNgIAQZSAwAAgAiAIaiIDNgIAQZiAwAAgAiAJaiIFNgIAQZyAwAAgAiAKaiIENgIAQaCAwAAgAiAHajYCAEGogMAAIAIgBmo2AgBBpIDAACACIAtqNgIAQbyAwAAgAiAMajYCAEG0gMAAIAIgDWo2AgBBuIDAACACIA5qNgIAQZCAwAAgAiAPajYCAAJAIABBCE8EQCAAQfz//x9xIgEhBgNAIAP9DP/////////////////////9CwQAIAX9DP/////////////////////9CwIAIAT9DP/////////////////////9CwIAIANBEGohAyAFQRBqIQUgBEEQaiEEIAZBBGsiBg0ACyAAIAFGDQELIAEhByAAQQNxIgYEQCABIAZqIQcgAiABQQJ0IgQgCGpqIQMgAiAEIAlqaiEFIAIgBCAKamohBANAIANBfzYCACAFQX82AgAgBEF/NgIAIANBBGohAyAFQQRqIQUgBEEEaiEEIAZBAWsiBg0ACwsgASAAa0F8Sw0AIAAgB2shBiACIAdBAnQiASAKamohAyACIAEgCWpqIQUgAiABIAhqaiEEA0AgBEF/NgIAIAVBfzYCACADQX82AgAgBEEEakF/NgIAIAVBBGpBfzYCACADQQRqQX82AgAgBEEIakF/NgIAIAVBCGpBfzYCACADQQhqQX82AgAgBEEMakF/NgIAIAVBDGpBfzYCACADQQxqQX82AgAgA0EQaiEDIAVBEGohBSAEQRBqIQQgB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AIQIDQCAAIAEQEyACIABBAnRqKAIAIgBBf0cNAAsLCwcAQYSAwAALCgBBkIDAACgCAAsKAEHAgMAAKAIACw=="));function Oo(A,t){const e=t>0?0|t:2e4,i=A>0?A:e;return Math.ceil(i/e)*e}function Fo(A,t){const e=t.capacity(),i=t.memory.buffer;A.capacity=e,A.transformByteOffset=t.transform_ptr(),A.worldByteOffset=t.world_ptr(),A.rootsByteOffset=t.roots_ptr(),A.visibilityByteOffset=t.visibility_ptr(),A.uploadRangeByteOffset=t.upload_range_ptr(),A.orderByteOffset=t.order_ptr(),A.rootsView=new Uint32Array(i,A.rootsByteOffset,e),A.visibilityView=new Uint32Array(i,A.visibilityByteOffset,Math.ceil(e/32)),A.uploadRangeView=new Uint32Array(i,A.uploadRangeByteOffset,3),A.orderView=new Uint32Array(i,A.orderByteOffset,e)}const ko=j.STORAGE|j.COPY_DST|j.COPY_SRC;class Ro{device;binding;csBinding;cpuView;count;drawCount;isTransferDirty=!0;get gpuBuffer(){return this.binding.dataView.buffer}constructor(A,t=1024){const e=Math.max(t,1024),i=new Uint32Array(1);this.cpuView=i,this.device=A,this.binding=new zt("instanceIndices",i,"u32",{visibility:z.VERTEX,access:"ReadOnly",isArray:!0,isDynamicArray:!0,usage:ko,count:e}),this.binding.setCount(e,!0),this.csBinding=new zt("instanceIndices",i,"u32",{visibility:z.COMPUTE,access:"ReadWrite",isArray:!0,isDynamicArray:!0,usage:ko,count:e}),this.csBinding.setCount(e,!0),this.count=e,this.drawCount=e}ensureCapacity(A){return this.drawCount=A,!(A<=this.count||(this.count=256*Math.ceil(A/256+1),this.isTransferDirty=!0,0))}shrinkToFit(A=0){const t=this.count,e=Math.max(256*Math.ceil(this.drawCount/256+1),A);return!(e>=t||e/t>.3||(this.count=e,this.isTransferDirty=!0,0))}update(A){const t=this.isTransferDirty;if(t){this.binding.setCount(this.count,!0);const t=this.binding.createGPUBuffer(A||this.device);this.csBinding.setCount(this.count,!0),this.csBinding.dataView.buffer=t,this.isTransferDirty=!1}return t}dispose(){this.gpuBuffer?.destroy?.(),this.csBinding.dataView.buffer?.destroy?.(),this.csBinding.dispose?.(),this.binding.dispose?.()}}const Lo=j.STORAGE|j.COPY_DST,jo=new Float32Array(1),zo=new Uint32Array(jo.buffer);function Go(A){return jo[0]=A,zo[0]}class Yo{device;gpuBuffer;heap;states=new Map;dirty=[];dirtyN=0;payloadPool=[];payloadUpdates=[];epoch=0;constructor(A){this.device=A;const t=function(A){const t=A.limits,e=Number(t.maxStorageBufferBindingSize),i=Number(t.maxBufferSize);let s=Number.isFinite(e)&&e>0?e:1024;Number.isFinite(i)&&i>0&&(s=Math.min(s,i)),s=Math.min(s,2147483640);const n=Math.floor(s/8);return!Number.isSafeInteger(n)||n<1?1:n}(A);this.heap=new se({unitBytes:8,count:Math.min(128,t),maxCount:t,growFactor:1.5,fitFactor:0,isAutoGrow:!0}),this.gpuBuffer=this.#Tr(this.heap.byteLength)}sync(A,t=A.length,e=!0){const i=++this.epoch,s=this.states,n=this.heap;let r=0,a=0;this.dirtyN=0;for(let l=0;l<t;l++){const t=A[l],e=t.morphSlot;if(e<0||4294967295===e)continue;let n=s.get(e);n||(n={poolIndex:t.poolIndex,blockId:-1,pairCapacity:0,pairCount:0,vertexCount:0,span:0,targetCount:-1,influences:[],seen:0},s.set(e,n));const o=n.poolIndex!==t.poolIndex;n.poolIndex=t.poolIndex,n.seen!==i&&r++,n.seen=i,a=this.#Ur(t,n,o,a)}if(e&&r!==s.size)for(const[l,c]of s)c.seen!==i&&(c.blockId>=0&&n.free(c.blockId),s.delete(l));let o=!1;if(n.isTransferDirty||this.gpuBuffer.size<Math.max(n.byteLength,16)){const A=this.gpuBuffer;this.gpuBuffer=this.#Tr(n.byteLength),It.release(this.device,A),n.isTransferDirty=!1,o=!0}return this.flushDirty(o),this.payloadUpdates.length=a,{rebuilt:o,payloadUpdates:this.payloadUpdates}}dispose(){It.release(this.device,this.gpuBuffer),this.gpuBuffer=null,this.heap.dispose(),this.states.clear()}#Ur(A,t,e,i){const s=Math.max(0,0|A.targetCount),n=A.vertexCount,r=A.span,a=A.influences,o=t.influences;let l=e||t.targetCount!==s;if(a){if(!l)for(let d=0;d<s;d++)if(o[d]!==(a[d]??0)){l=!0;break}}else if(!l)for(let d=0;d<s;d++)if(0!==o[d]){l=!0;break}let c=t.pairCount;if(l)if(c=0,o.length=s,t.targetCount=s,a)for(let d=0;d<s;d++){const A=a[d]??0;o[d]=A,0!==A&&c++}else o.fill(0);const h=this.#Nr(t,c),u=this.heap.getOffset(t.blockId);if(e||h||l||t.vertexCount!==n||t.span!==r){const A=this.heap.u32,t=2*u;if(A[t]=c>>>0,A[t+1]=n>>>0,A[t+2]=r>>>0,A[t+3]=0,c>0&&(l||h)){let e=t+4;for(let t=0;t<s;t++){const i=o[t];0!==i&&(A[e++]=t>>>0,A[e++]=Go(i))}}this.writeDirty(u,u+2+c)}const g=u>>>0;if(A.currentPayload!==g){const t=this.payloadPool,e=t[i]??(t[i]={poolIndex:0,heapOffset:0});e.poolIndex=A.poolIndex,e.heapOffset=g,this.payloadUpdates[i]=e,i++}return t.pairCount=c,t.vertexCount=n,t.span=r,i}writeDirty(A,t){const e=this.dirtyN;this.dirty[e]=A,this.dirty[e+1]=t,this.dirtyN=e+2}#Nr(A,t){const e=A.pairCapacity;if(A.blockId>=0&&t<=e&&(0===t||4*t>e))return!1;const i=e>0&&t>e?Math.max(t,Math.ceil(1.5*e)):t,s=this.heap.allocate(2+i);if(s<0)throw new Error(`MorphActiveMeta: cannot allocate ${i} pairs`);const n=A.blockId;return A.blockId=s,A.pairCapacity=i,n>=0&&this.heap.free(n),!0}flushDirty(A){const t=this.gpuBuffer,e=this.device,i=this.heap.u32,s=this.dirtyN;if(A)return e.queue.writeBuffer(t,0,i,0,i.length),void(this.dirtyN=0);!function(A,t,e,i,s){if(s<=0)return;for(let c=2;c<s;c+=2){const A=i[c],t=i[c+1];let e=c;for(;e>0&&i[e-2]>A;)i[e]=i[e-2],i[e+1]=i[e-1],e-=2;i[e]=A,i[e+1]=t}const n=2*e.BYTES_PER_ELEMENT,r=i[0];let a=i[1];for(let c=3;c<s;c+=2)i[c]>a&&(a=i[c]);if(s>2){let o=0,l=r,c=i[1];for(let A=2;A<s;A+=2)i[A]<=c?i[A+1]>c&&(c=i[A+1]):(o+=Pt((c-l)*n),l=i[A],c=i[A+1]);if(o+=Pt((c-l)*n),o>=Pt((a-r)*n))return void A.writeBuffer(t,r*n,e,2*r,2*(a-r))}let o=r,l=i[1];for(let c=2;c<s;c+=2)i[c]<=l?i[c+1]>l&&(l=i[c+1]):(A.writeBuffer(t,o*n,e,2*o,2*(l-o)),o=i[c],l=i[c+1]);A.writeBuffer(t,o*n,e,2*o,2*(l-o))}(e.queue,t,i,this.dirty,s),this.dirtyN=0}#Tr(A){return this.device.createBuffer({label:"morphHeap",size:Math.max(A,16),usage:Lo})}}class Ho{device;texture=null;view=null;width=0;height=0;generation=0;cpuView=new Float32Array(0);nextBase=0;freeSpans=[];pending=[];owned=new Map;slotRoot=new Map;extras=new Map;bindGroup=null;bindGroupLayout=null;bindGroupTex=null;bindGroupBuf=null;constructor(A){this.device=A}tick(){const A=this.pending,t=A.length;if(0===t)return;let e=0;for(let i=0;i<t;i++){const t=A[i];--t.framesLeft>0?A[e++]=t:t.texture.destroy()}A.length=e}primaryRoot(A){return this.slotRoot.get(A)}extraCount(A){return this.extras.get(A)?.length??0}extraRoot(A,t){return this.extras.get(A)[t].root}rebindRoot(A,t,e){if(t===e)return;if(this.slotRoot.get(A)===t)return void this.slotRoot.set(A,e);const i=this.extras.get(A);if(i)for(let s=0,n=i.length;s<n;s++)if(i[s].root===t)return void(i[s].root=e)}ensureAllocated(A,t){const e=this.getBase(A,t);if(void 0!==e)return e;const i=A.boneCount;if(i<=0)throw new Error("BonePaletteStore: empty skeleton");const s=this.#Pr(i);if(!this.owned.has(A))return this.owned.set(A,s),this.slotRoot.set(A,t),s;let n=this.extras.get(A);return n||(n=[],this.extras.set(A,n)),n.push({root:t,base:s}),s}getBase(A,t){if(this.slotRoot.get(A)===t)return this.owned.get(A);const e=this.extras.get(A);if(e)for(let i=0,s=e.length;i<s;i++)if(e[i].root===t)return e[i].base}free(A){const t=this.owned.get(A);if(null==t)return;const e=A.boneCount;this.owned.delete(A),this.slotRoot.delete(A),this.#Or(t,e);const i=this.extras.get(A);if(i){for(let A=0,t=i.length;A<t;A++)this.#Or(i[A].base,e);this.extras.delete(A)}}retainOnly(A,t){for(const e of this.owned.keys()){if(!A.has(e)){this.free(e);continue}const i=e.boneCount,s=this.extras.get(e);if(s){let A=0;for(let e=0,n=s.length;e<n;e++){const n=s[e];t.has(n.root)?s[A++]=n:this.#Or(n.base,i)}s.length=A,0===A&&this.extras.delete(e)}const n=this.slotRoot.get(e);if(n&&t.has(n))continue;this.#Or(this.owned.get(e),i);const r=this.extras.get(e);if(r&&r.length>0){const A=r.pop();this.owned.set(e,A.base),this.slotRoot.set(e,A.root),0===r.length&&this.extras.delete(e)}else this.owned.delete(e),this.slotRoot.delete(e)}}upload(A,t){const e=A.boneCount,i=4*(t+e);this.#Fr(i);const s=this.cpuView,n=A.boneMatrices;for(let r=0;r<e;r++){const A=16*r,e=4*(t+r)*4;s[e]=n[A],s[e+1]=n[A+1],s[e+2]=n[A+2],s[e+3]=n[A+3],s[e+4]=n[A+4],s[e+5]=n[A+5],s[e+6]=n[A+6],s[e+7]=n[A+7],s[e+8]=n[A+8],s[e+9]=n[A+9],s[e+10]=n[A+10],s[e+11]=n[A+11],s[e+12]=n[A+12],s[e+13]=n[A+13],s[e+14]=n[A+14],s[e+15]=n[A+15]}this.#kr(4*t,4*e)}getBindGroup(A,t,e){if(!this.texture||!this.view)return null;if(this.bindGroup&&this.bindGroupLayout===A&&this.bindGroupTex===this.texture&&this.bindGroupBuf===t)return this.bindGroup;const i=e.createGroup3BindGroup(_t.Skin,A,{bonePalette:this.view,skinActive:t});return this.bindGroup=i,this.bindGroupLayout=A,this.bindGroupTex=this.texture,this.bindGroupBuf=t,i}invalidateBindGroup(){this.bindGroup=null,this.bindGroupLayout=null,this.bindGroupTex=null,this.bindGroupBuf=null}dispose(){this.flush(),this.texture?.destroy(),this.texture=null,this.view=null,this.cpuView=new Float32Array(0),this.owned.clear(),this.slotRoot.clear(),this.extras.clear(),this.freeSpans.length=0,this.nextBase=0,this.invalidateBindGroup()}flush(){const A=this.pending;for(let t=0,e=A.length;t<e;t++)A[t].texture.destroy();A.length=0}#Pr(A){const t=this.freeSpans;for(let i=0,s=t.length;i<s;i++){const e=t[i];if(e.count<A)continue;const s=e.start;return e.count===A?t.splice(i,1):(e.start+=A,e.count-=A),s}const e=this.nextBase;return this.nextBase=e+A,e}#Or(A,t){const e=this.freeSpans,i=e.length;let s=0;for(;s<i&&e[s].start<A;)s++;const n=s>0?e[s-1]:null,r=s<i?e[s]:null;return n&&n.start+n.count===A?(n.count+=t,r&&n.start+n.count===r.start&&(n.count+=r.count,e.splice(s,1)),void this.#Rr()):r&&A+t===r.start?(r.start=A,r.count+=t,void this.#Rr()):(e.splice(s,0,{start:A,count:t}),void this.#Rr())}#Rr(){const A=this.freeSpans,t=A.length;if(0===t)return;const e=A[t-1];e.start+e.count===this.nextBase&&(this.nextBase=e.start,A.length=t-1)}shrinkToFit(A=0){if(!this.texture||this.width<=0||this.height<=0||this.nextBase<=0)return!1;const t=this.width,e=Math.max(1,4*this.nextBase),i=Math.max(1,Math.ceil(e/t),0|A),s=this.device.limits.maxTextureDimension2D;let n=1;for(;n<i;)n*=2;return n=Math.min(s,n),n<this.height&&n/this.height<=.5&&(this.#Fs(t,n),!0)}#Fr(A){const t=this.device.limits.maxTextureDimension2D,e=4*Math.floor(t/4),i=Math.ceil(A/t),s=Math.max(4,4*Math.ceil(Math.max(i,256)/4));if(s>e)throw new Error(`BonePaletteStore: ${A} texels exceed ${t} atlas`);const n=Math.max(1,Math.ceil(A/s));if(n>t)throw new Error(`BonePaletteStore: height ${n} > maxTextureDimension2D`);if(this.texture&&this.width===s&&this.height>=n)return;let r=n;if(this.texture&&this.width===s)r=Math.min(t,Math.max(n,2*this.height));else{let A=1;for(;A<n;)A*=2;r=Math.min(t,A)}this.#Fs(s,r)}#Fs(A,t){const e=this.texture,i=this.cpuView,s=this.width,n=new Float32Array(A*t*4);i.length>0&&s>0&&n.set(i.subarray(0,Math.min(i.length,n.length))),this.cpuView=n,this.width=A,this.height=t;const r=this.device.createTexture({label:"bonePalette",format:"rgba32float",size:{width:A,height:t},usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST});this.texture=r,this.view=r.createView({label:"bonePaletteView"}),this.generation++,this.invalidateBindGroup(),e&&this.pending.push({texture:e,framesLeft:3}),this.device.queue.writeTexture({texture:r},n,{bytesPerRow:16*A},{width:A,height:t})}#kr(A,t){const e=this.texture;if(!e||t<=0)return;const i=this.width,s=this.cpuView,n=this.device;let r=A,a=t;for(;a>0;){const A=r%i,t=r/i|0,o=Math.min(a,i-A),l=4*r;n.queue.writeTexture({texture:e,origin:{x:A,y:t}},s.subarray(l,l+4*o),{bytesPerRow:16*o},{width:o,height:1}),r+=o,a-=o}}}const Ko=j.STORAGE|j.COPY_DST;class Vo{device;gpuBuffer;cpuView;capacity;livePools=[];sparePools=[];seenEpoch;epoch=0;dirtyPools=new Uint32Array(32);dirtyCount=0;constructor(A){this.device=A,this.capacity=32,this.cpuView=new Uint32Array(64),this.seenEpoch=new Uint32Array(32),this.gpuBuffer=this.#Tr(256)}sync(A,t=A.length){let e=this.epoch+1>>>0;0===e&&(this.seenEpoch.fill(0),e=1),this.epoch=e;const i=t+this.livePools.length;this.dirtyPools.length<i&&(this.dirtyPools=new Uint32Array(Math.max(i,this.dirtyPools.length<<1)));let s=0,n=-1;for(let g=0;g<t;g++){const t=0|A[g].skinSid;t>n&&(n=t)}let r=!1;n>=this.capacity&&(r=this.#X(Math.max(this.capacity+256,n+1)));const a=this.cpuView,o=this.seenEpoch,l=this.sparePools;l.length=0;const c=!r,h=this.dirtyPools;for(let g=0;g<t;g++){const t=A[g],i=0|t.skinSid;if(i<0)continue;const n=2*i,r=t.paletteBase>>>0,u=t.boneCount>>>0;a[n]===r&&a[n+1]===u||(a[n]=r,a[n+1]=u,c&&(h[s++]=i)),o[i]=e,l.push(i)}const u=this.livePools;for(let g=0,d=u.length;g<d;g++){const A=u[g];if(o[A]===e)continue;const t=2*A;0===a[t]&&0===a[t+1]||(a[t]=0,a[t+1]=0,c&&(h[s++]=A))}return u.length=0,this.livePools=l,this.sparePools=u,this.dirtyCount=s,this.flushDirty(r),{rebuilt:r}}dispose(){It.release(this.device,this.gpuBuffer),this.gpuBuffer=null,this.livePools.length=0,this.sparePools.length=0,this.dirtyCount=0}#X(A){const t=this.gpuBuffer;return this.cpuView=new Uint32Array(this.cpuView.buffer.transfer(8*A)),this.seenEpoch=new Uint32Array(this.seenEpoch.buffer.transfer(4*A)),this.capacity=A,this.gpuBuffer=this.#Tr(8*A),It.release(this.device,t),!0}flushDirty(A){const t=this.device.queue;A?t.writeBuffer(this.gpuBuffer,0,this.cpuView):ne(t,this.gpuBuffer,this.cpuView,this.dirtyPools,this.dirtyCount,2),this.dirtyCount=0}#Tr(A){return this.device.createBuffer({label:"skinActive",size:Math.max(A,16),usage:Ko})}}class Jo{wasm;capacityUnit;graph;worldMatrixMeta;transformMeta;boundingMeta;clipPlaneMeta;geometryMeta;instanceMeta;cullSourceIndices;instanceIndices;cullBatches;indirectArgs;morphActive=null;bonePalette=null;skinActive=null;device;#Lr=!1;constructor(A,t){this.device=A;const e=t?.capacityUnit&&t.capacityUnit>0?0|t.capacityUnit:2e4;this.capacityUnit=e;const i=Oo(t?.initCapacity??e,e);this.wasm=function(A=2e4,t=2e4){const e=new WebAssembly.Instance(Po,{}).exports,i=Oo(A,t);if(e.init(i),e.capacity()!==i)throw new Error(`transform-wasm init(${i}) 失败,capacity=${e.capacity()}`);const s={memory:e.memory,capacityUnit:t,capacity:i,transformByteOffset:0,worldByteOffset:0,rootsByteOffset:0,visibilityByteOffset:0,uploadRangeByteOffset:0,orderByteOffset:0,rootsView:new Uint32Array,visibilityView:new Uint32Array,uploadRangeView:new Uint32Array,orderView:new Uint32Array,getLevel:e.get_level,setLevel:e.set_level,updateSubtreeLevel:e.update_subtree_level,finalizeSubtreeLevelAndVisibility:e.finalize_subtree_level_and_visibility,markReparentPending:e.mark_reparent_pending,linkChild:e.link_child,unlinkChild:e.unlink_child,computeWorld:e.compute_world,resolveWorld:e.resolve_world,resolveSubtree:e.resolve_subtree,batchUpdate:e.batch_update,flushReparentPending:e.flush_reparent_pending,propagateEffectiveVisible:e.propagate_effective_visible,grow:A=>A<=s.capacity||0!==e.grow(A>>>0)&&(Fo(s,e),!0)};return Fo(s,e),s}(i,e),this.graph=function(A){return{getLevel:A.getLevel,setLevel:A.setLevel,linkChild:A.linkChild,unlinkChild:A.unlinkChild,updateSubtreeLevel:A.updateSubtreeLevel,finalizeSubtreeLevelAndVisibility:A.finalizeSubtreeLevelAndVisibility,markReparentPending:A.markReparentPending,computeWorld:A.computeWorld,resolveWorld:A.resolveWorld,resolveSubtree:A.resolveSubtree,batchUpdate:function(t,e){if(0===e)return;const i=A.rootsView;if(t!==i)for(let A=0;A<e;A++)i[A]=t[A];A.batchUpdate(e)},flushReparentPending:function(t,e){if(0===e)return;const i=A.rootsView;if(t!==i)for(let A=0;A<e;A++)i[A]=t[A];A.flushReparentPending(e)},propagateEffectiveVisible:A.propagateEffectiveVisible}}(this.wasm),this.transformMeta=new Ai(A,this.wasm),this.transformMeta.onSlotGrow=A=>this.growSlots(A),this.worldMatrixMeta=new Xe(A,void 0,this.transformMeta,this.wasm),this.boundingMeta=new No(A),this.clipPlaneMeta=new oe(A),this.geometryMeta=new Vs,this.instanceMeta=new dn(A,void 0,this.transformMeta),this.cullSourceIndices=new Qr(A),this.instanceIndices=new Ro(A),this.cullBatches=new Ir(A),this.indirectArgs=new wr(A)}get capacity(){return this.wasm.capacity}growSlots(A){if(this.#Lr)return!1;const t=Oo(A,this.capacityUnit);if(t<=this.wasm.capacity)return!1;this.#Lr=!0;try{return!!this.wasm.grow(t)&&(this.transformMeta.adoptGrown(),this.worldMatrixMeta.adoptGrown(),this.instanceMeta.growTo(this.wasm.capacity),this.transformMeta.rebindOwners(),!0)}finally{this.#Lr=!1}}syncMorphActive(A,t=A.length,e=!0){return(this.morphActive??=new Yo(this.device)).sync(A,t,e)}releaseMorphActive(){return!!this.morphActive&&(this.morphActive.dispose(),this.morphActive=null,!0)}ensureBonePalette(){return this.bonePalette??=new Ho(this.device)}syncSkinActive(A,t=A.length){return(this.skinActive??=new Vo(this.device)).sync(A,t)}releaseSkinActive(){let A=!1;return this.skinActive&&(this.skinActive.dispose(),this.skinActive=null,A=!0),this.bonePalette&&(this.bonePalette.dispose(),this.bonePalette=null,A=!0),A}beginFrame(){}shrinkToFit(A=0){let t=!1;return this.boundingMeta.shrinkToFit(A)&&(this.boundingMeta.binding.rebuildGpu=!0,t=!0),this.clipPlaneMeta.shrinkToFit(A)&&(this.clipPlaneMeta.binding.rebuildGpu=!0,t=!0),this.cullSourceIndices.shrinkToFit(A)&&(this.cullSourceIndices.binding.rebuildGpu=!0,t=!0),this.cullBatches.shrinkToFit(A)&&(this.cullBatches.binding.rebuildGpu=!0,t=!0),this.instanceIndices.shrinkToFit(A)&&(this.instanceIndices.binding.rebuildGpu=!0,t=!0),this.indirectArgs.shrinkToFit(A)&&(this.indirectArgs.binding.rebuildGpu=!0,t=!0),this.bonePalette?.shrinkToFit(A)&&(t=!0),t}dispose(){this.worldMatrixMeta.dispose(),this.transformMeta.dispose?.(),this.boundingMeta.dispose(),this.clipPlaneMeta.dispose(),this.geometryMeta.dispose(),this.instanceMeta.dispose(),this.cullSourceIndices.dispose(),this.instanceIndices.dispose(),this.cullBatches.dispose(),this.indirectArgs.dispose(),this.releaseMorphActive(),this.releaseSkinActive()}}const Wo=new wt("LightHeader",[{name:"ambient",format:"vec3f"},{name:"hemiSlot",format:"u32"},{name:"dirCount",format:"u32"},{name:"unboundedCount",format:"u32"},{name:"localCount",format:"u32"},{name:"dirSlots",format:"vec4u"},{name:"unbSlots",format:"vec4u"},{name:"localSlots0",format:"vec4u"},{name:"localSlots1",format:"vec4u"},{name:"localSlots2",format:"vec4u"},{name:"localSlots3",format:"vec4u"},{name:"localSlots4",format:"vec4u"},{name:"localSlots5",format:"vec4u"},{name:"localSlots6",format:"vec4u"},{name:"localSlots7",format:"vec4u"}]),qo=new wt("ClusterParams",[{name:"cellSize",format:"f32"},{name:"hashMask",format:"u32"},{name:"maxPerCell",format:"u32"},{name:"stride",format:"u32"}]);Wo.computeLayout(),qo.computeLayout();const Xo=j.STORAGE|j.COPY_DST|j.COPY_SRC,Zo=z.FRAGMENT;function _o(A,t){return A.fields.get(t).meta.byteOffset>>2}class $o{heap;binding;device;dirtyIds;dirtyCount=0;constructor(A,t=256){this.device=A,this.heap=new se({unitBytes:16,count:t,maxCount:131072,growFactor:1.5,fitFactor:.35,isAutoGrow:!0}),this.binding=new Ht("lights",this.heap.f32,"f32",{access:"ReadOnly",visibility:Zo,isArray:!0,isDynamicArray:!0,count:t,usage:Xo,fixedSlot:5}),this.binding.setCount(t,!0),this.dirtyIds=new Uint32Array(2*t)}getOffset(A){return this.heap.getOffset(A)}getSize(A){return this.heap.getSize(A)}allocate(A){const t=Math.min(Math.max(0|A,2),8);return this.heap.allocate(t)}free(A){if(A<=0)return;const t=this.heap,e=t.getOffset(A);e>=0&&(t.f32[4*e+1]=-1,this.writeDirty(e)),t.free(A)}writeDirty(A){if(A<0)return;let t=this.dirtyIds;this.dirtyCount>=t.length&&(this.dirtyIds=new Uint32Array(t.buffer.transfer(4*Math.max(t.length<<1,this.heap.capacity))),t=this.dirtyIds),t[this.dirtyCount++]=A}write(A,t){if(A<=0)return;const e=this.heap.getOffset(A);if(e<0)return;t.writeMeta(this,e);const i=this.heap.getSize(A);for(let s=0;s<i;s++)this.writeDirty(e+s)}setLocalRadius(A,t){const e=this.heap,i=e.getOffset(A);i<0||e.getSize(A)<3||(e.f32[4*i+8]=t,this.writeDirty(i+2))}releaseGPU(A){if(null!=A&&null!=this.device&&this.device!==A)return;const t=this.binding.dataView,e=t.buffer;e&&this.device&&(It.release(this.device,e),t.buffer=null,t.ownsBuffer=!1),this.device=void 0}update(A){const t=this.device;null!=t&&t!==A&&this.releaseGPU(t),this.device=A;const e=this.heap,i=this.binding;let s=i.dataView.buffer;const n=e.capacity,r=!s||n>i.count||e.isTransferDirty;if(!r&&0===this.dirtyCount)return!1;i.dataView.view=e.f32;let a=!1;return r&&(a=!0,i.setCount(n,!0),s=i.createGPUBuffer(A),e.isTransferDirty=!1),this.flushDirty(a,A,s,n),a}flushDirty(A,t,e,i){const s=this.heap.f32;A?t.queue.writeBuffer(e,0,s,0,4*i):ne(t.queue,e,s,this.dirtyIds,this.dirtyCount,4),this.dirtyCount=0}dispose(){this.releaseGPU(),this.heap.dispose(),this.binding.dispose?.()}}var Al=(A=>(A[A.Ambient=0]="Ambient",A[A.Hemi=1]="Hemi",A[A.Dir=2]="Dir",A[A.Punctual=3]="Punctual",A))(Al||{});function tl(A,t){null!=t&&(t instanceof P?A.copy(t):"number"!=typeof t&&"string"!=typeof t?A.setRGB(t[0],t[1],t[2]):A.set(t))}const el=new Set(["poolIndex","kind","flags","span","cullRadius"]),il=["x","y","z","w"],sl=new Set(["poolIndex","kind","flags","span"]),nl=new Set(["kind"]);class rl extends Mi{isLight=!0;type="Light";lightSlot=-1;isLocal=!1;lightDirty=0;_clusterWeight=NaN;_clusterRadius=NaN;heapOff=-1;#kA=!1;#jr=!1;kind;lightUniforms;_poolIndexBinding;_spanBinding;_colorBinding;_intensityBinding;_flagsBinding;static ensureClass(A){if(Object.prototype.hasOwnProperty.call(A,"kind"))return A.kind;if(YA)throw new Error("Light class is locked");const t=At("");return A.kind=t,t}get color(){return this._colorBinding.getValue()}set color(A){tl(this.color,A)}get intensity(){return this._intensityBinding.getValue()}set intensity(A){this._intensityBinding.setValue(A)}get castShadow(){return this.#kA}set castShadow(A){const t=!!A;this.#kA!==t&&(this.#kA=t,this.onChangeCallback(f.DIRTY_DATA))}get shadowPcf(){return this.#jr?9:5}set shadowPcf(A){const t=A>=9;if(this.#jr===t)return;this.#jr=t;const e=0|this._flagsBinding.getValue();this._flagsBinding.setValue(t?4|e:-5&e),this.onChangeCallback(f.DIRTY_DATA)}writeShadowFlags(A){1&(A|=0)?this._flagsBinding.setValue(this.#jr?4|A:-5&A):this._flagsBinding.setValue(0)}constructor(A,t=1){super(),this.kind=rl.ensureClass(this.constructor);const e=new P;tl(e,A),this._poolIndexBinding=new zt("poolIndex",0),this._spanBinding=new zt("span",0),this._flagsBinding=new zt("flags",0),this._intensityBinding=new zt("intensity",t),this._colorBinding=new Kt("color",e),this.lightUniforms=new Xt("lightUniforms",[this._poolIndexBinding,new zt("kind",this.kind),this._flagsBinding,this._spanBinding,this._colorBinding,this._intensityBinding],{isStandardLayout:!0}),this.lightUniforms.depObjects.add(this.weakSelf),new.target===rl&&this.finishLightLayout()}copy(A,t=!0){if(super.copy(A,t),!(A instanceof rl))return this;this.castShadow=A.castShadow,this.shadowPcf=A.shadowPcf;const e=this.lightUniforms.getFields();for(const[i,s]of A.lightUniforms.getFields()){if(el.has(i))continue;const A=e.get(i);if(!A)continue;const t=s.getValue();if("number"==typeof t||"boolean"==typeof t)A.getValue()!==t&&A.setValue(t);else if(null!=t){const e=A.getValue();e?.copy?.(t)}}return this}registerShareWgsl(){const A=this.kind;if(null==A)return;this.lightUniforms.computeLayout();const t=this.buildShader();t.trim()&&At(function(A){const t=A.structDef;let e="";for(const i of A.getFields().values()){const A=i.name;if(nl.has(A))continue;const s=t.fields.get(A)?.meta;if(!s)continue;const n=s.byteOffset,r=(15&n)>>2,a=`lights[off + ${n>>4}u]`,o=s.elements??1;let l;4===o?l=a:3===o?l=`${a}.${il[r]}${il[r+1]}${il[r+2]}`:2===o?l=`${a}.${il[r]}${il[r+1]}`:(l=`${a}.${il[r]}`,sl.has(A)&&(l=`u32(${l})`)),e+=` let ${A} = ${l};\n`}return e}(this.lightUniforms)+t,A)}finishLightLayout(){this.lightUniforms.computeLayout()}registerStructField(A,t){this.lightUniforms.addField(t),this.setProperty(A,t,!1)}headerRole(){return 3}localRadius(){return 0}energyWeight(){return this.intensity}buildShader(){return""}heapSpan(){this.lightUniforms.computeLayout();const A=Math.ceil(this.lightUniforms.typeInfo.bytes/16);if(A>8)throw new Error(`Light heap span ${A} exceeds max 8 vec4s`);return Math.max(A,2)}writeMeta(A,t){const e=this.heapSpan();if(0===e)return void(this.heapOff=-1);this._poolIndexBinding.setValue(this.poolIndex),this._spanBinding.setValue(e);const i=this.lightUniforms;i.updateCPUBuffer(),i.resetDirty();const s=i.dataView.view;A.heap.f32.set(s.f32,4*t),this.heapOff=t}}class al extends rl{type="AmbientLight";headerRole(){return Al.Ambient}heapSpan(){return 0}constructor(A,t=1){super(A,t),new.target===al&&this.finishLightLayout()}}class ol extends rl{type="HemisphereLight";headerRole(){return Al.Hemi}buildShader(){return" let w = dot(N, lightWorldUp(poolIndex)) * 0.5 + 0.5;\n // 与 ambient / punctual 一样乘 albedo,否则红砖白墙被同一层天空色洗掉。\n return albedo * mix(groundColor, color, w) * intensity;"}constructor(A,t,e=1){super(A,e);const i=new P(.2,.2,.2);tl(i,t),this.registerStructField("groundColor",new Kt("groundColor",i)),new.target===ol&&this.finishLightLayout()}}class ll extends rl{type="DirectionalLight";headerRole(){return Al.Dir}buildShader(){return" let L = -lightWorldDirNegZ(poolIndex);\n return shadePunctual(N, V, L, color * intensity, albedo, roughness, metal, F0);"}constructor(A,t=1){super(A,t),new.target===ll&&this.finishLightLayout()}}const cl=4*Math.PI;class hl extends rl{type="PointLight";get power(){return this.intensity*cl}set power(A){const t=A/cl;t!==this.intensity&&(this.intensity=t)}constructor(A,t=1,e=0,i=2){super(A,t),this.registerStructField("distance",new zt("distance",e)),this.registerStructField("decay",new zt("decay",i)),new.target===hl&&this.finishLightLayout()}localRadius(){return this.distance}buildShader(){return" let Lp = lightWorldPos(poolIndex);\n let toL = Lp - P;\n let distSq = dot(toL, toL);\n if (distance > 0.0 && distSq > distance * distance) { return vec3f(0.0); }\n let dist = sqrt(max(distSq, 1e-8));\n let L = toL / dist;\n var att: f32;\n if (distance > 0.0) {\n att = punctualAtten(dist, distance, decay);\n } else {\n att = distanceFalloff(dist, decay);\n }\n if (att <= 0.0) { return vec3f(0.0); }\n return shadePunctual(N, V, L, color * (intensity * att), albedo, roughness, metal, F0);"}}const ul=Math.PI;class gl extends hl{type="SpotLight";_cosInnerBinding;_cosOuterBinding;#zr;#Gr;get angle(){return this.#zr}set angle(A){this.#zr!==A&&(this.#zr=A,this.onChangeCallback(f.DIRTY_DATA))}get penumbra(){return this.#Gr}set penumbra(A){this.#Gr!==A&&(this.#Gr=A,this.onChangeCallback(f.DIRTY_DATA))}get power(){return this.intensity*ul}set power(A){const t=A/ul;t!==this.intensity&&(this.intensity=t)}constructor(A,t=1,e=0,i=Math.PI/3,s=0,n=2){super(A,t,e,n),this._cosInnerBinding=new zt("cosInner",0),this._cosOuterBinding=new zt("cosOuter",0),this.lightUniforms.addField(this._cosInnerBinding),this.lightUniforms.addField(this._cosOuterBinding),this.#zr=i,this.#Gr=s,new.target===gl&&this.finishLightLayout()}buildShader(){return" let Lp = lightWorldPos(poolIndex);\n let toL = Lp - P;\n let distSq = dot(toL, toL);\n if (distance > 0.0 && distSq > distance * distance) { return vec3f(0.0); }\n let dist = sqrt(max(distSq, 1e-8));\n let L = toL / dist;\n let cd = dot(-L, lightWorldDirNegZ(poolIndex));\n // smoothstep 在 cosOuter 处为 0;先丢锥外,再算衰减。\n if (cd <= cosOuter) { return vec3f(0.0); }\n var att: f32;\n if (distance > 0.0) {\n att = punctualAtten(dist, distance, decay);\n } else {\n att = distanceFalloff(dist, decay);\n }\n att *= smoothstep(cosOuter, cosInner, cd);\n if (att <= 0.0) { return vec3f(0.0); }\n return shadePunctual(N, V, L, color * (intensity * att), albedo, roughness, metal, F0);"}copy(A,t=!0){return super.copy(A,t),A instanceof gl&&(this.angle=A.angle,this.penumbra=A.penumbra),this}writeMeta(A,t){const e=this.#zr;this._cosInnerBinding.setValue(Math.cos(e*(1-this.#Gr))),this._cosOuterBinding.setValue(Math.cos(e)),super.writeMeta(A,t)}}class dl extends rl{type="RectAreaLight";_cullRadiusBinding;get power(){return this.intensity*this.width*this.height*Math.PI}set power(A){const t=this.width*this.height*Math.PI,e=t>0?A/t:0;e!==this.intensity&&(this.intensity=e)}constructor(A,t=1,e=10,i=10,s=0){super(A,t),this._cullRadiusBinding=new zt("cullRadius",0),this.lightUniforms.addField(this._cullRadiusBinding),this.registerStructField("distance",new zt("distance",s)),this.registerStructField("width",new zt("width",e)),this.registerStructField("height",new zt("height",i)),new.target===dl&&this.finishLightLayout()}localRadius(){const A=this.width,t=this.height,e=.5*Math.hypot(A,t),i=this.distance;if(i<0)return 0;if(i>0)return i>e?i:e;const s=A*t,n=s>1e-6?s:1e-6,r=Math.sqrt(this.intensity*n/.05);return r>e?r:e}energyWeight(){const A=this.width*this.height;return this.intensity*(A>1e-6?A:1e-6)}writeMeta(A,t){this._cullRadiusBinding.setValue(this.localRadius()),super.writeMeta(A,t)}buildShader(){return" let C = lightWorldPos(poolIndex);\n let distC = length(C - P);\n // 窗只看 cullRadius。distance<0 的四槽无限光写 0;溢出写成 fallback 后按该半径收。\n var win = 1.0;\n if (cullRadius > 0.0) {\n let x = saturate(distC / cullRadius);\n let x2 = x * x;\n win = saturate(1.0 - x2 * x2);\n if (win <= 0.0) { return vec3f(0.0); }\n }\n let ax = lightWorldRight(poolIndex);\n let ay = lightWorldUp(poolIndex);\n let rgt = ax * (width * 0.5);\n let up = ay * (height * 0.5);\n // 与 Three 同绕序(CCW,沿 -Z 出光),供 LTC 背面判定。\n let p0 = C + rgt - up;\n let p1 = C - rgt - up;\n let p2 = C - rgt + up;\n let p3 = C + rgt + up;\n // 背向不采 LUT。ltcEvaluateDual 不再重复判背面。\n if (ltcIsBackface(P, p0, p1, p3)) { return vec3f(0.0); }\n let uv = ltcUv(N, V, roughness);\n let t1 = textureSampleLevel(ltcMat, ltcSampler, uv, 0.0);\n let t2 = textureSampleLevel(ltcAmp, ltcSampler, uv, 0.0);\n let mInv = mat3x3f(vec3f(t1.x, 0.0, t1.y), vec3f(0.0, 1.0, 0.0), vec3f(t1.z, 0.0, t1.w));\n let ff = ltcEvaluateDual(N, V, P, mInv, p0, p1, p2, p3);\n let rad = color * (intensity * win);\n let fresnel = F0 * t2.x + (vec3f(1.0) - F0) * t2.y;\n return albedo * (1.0 - metal) * rad * ff.y + fresnel * rad * ff.x;"}}class pl extends rl{type="CustomLight";constructor(A,t=1){if(super(A,t),new.target===pl)throw new Error("CustomLight is abstract; extend it and LightManager.register(YourLight)")}localRadius(){throw new Error("CustomLight.localRadius() must be overridden (return 0 for unbounded)")}registerShareWgsl(){if(!this.buildShader().trim())throw new Error("CustomLight.buildShader() is required");this.localRadius(),super.registerShareWgsl()}}function fl(A,t,e,i,s,n,r){r>1&&Cl(A,t,e,i,s,n,0,r-1)}function ml(A,t,e,i,s,n,r,a){let o=A[r];A[r]=A[a],A[a]=o,o=t[r],t[r]=t[a],t[a]=o,o=e[r],e[r]=e[a],e[a]=o,o=i[r],i[r]=i[a],i[a]=o,o=s[r],s[r]=s[a],s[a]=o;const l=n[r];n[r]=n[a],n[a]=l}function Cl(A,t,e,i,s,n,r,a){for(;r<a;){if(a-r<24){for(let o=r+1;o<=a;o++){const a=A[o],l=t[o],c=e[o],h=i[o],u=s[o],g=n[o];let d=o-1;for(;d>=r&&s[d]<u;)A[d+1]=A[d],t[d+1]=t[d],e[d+1]=e[d],i[d+1]=i[d],s[d+1]=s[d],n[d+1]=n[d],d--;A[d+1]=a,t[d+1]=l,e[d+1]=c,i[d+1]=h,s[d+1]=u,n[d+1]=g}return}const o=s[r+a>>1];let l=r,c=a;for(;l<=c;){for(;s[l]>o;)l++;for(;s[c]<o;)c--;l<=c&&(ml(A,t,e,i,s,n,l,c),l++,c--)}c-r<a-l?(r<c&&Cl(A,t,e,i,s,n,r,c),r=l):(l<a&&Cl(A,t,e,i,s,n,l,a),a=c)}}function wl(A,t,e,i,s,n,r,a,o,l,c,h){const u=(e+1)*t;A.fill(0,0,u);const g=1/s,d=0|n;let p=0;for(let f=0;f<h;f++){const s=l[f];if(!(s>0))continue;const n=r[f],h=a[f],u=o[f],m=c[f],C=Math.floor(n*g),w=Math.floor(h*g),y=Math.floor(u*g);let B=Math.floor((n-s)*g),I=Math.floor((n+s)*g),Q=Math.floor((h-s)*g),E=Math.floor((h+s)*g),x=Math.floor((u-s)*g),D=Math.floor((u+s)*g);B<C-d&&(B=C-d),I>C+d&&(I=C+d),Q<w-d&&(Q=w-d),E>w+d&&(E=w+d),x<y-d&&(x=y-d),D>y+d&&(D=y+d);for(let r=x;r<=D;r++)for(let s=Q;s<=E;s++)for(let n=B;n<=I;n++){const a=yl(A,t,e,i,n,s,r,m);if(a<0)return-1;p+=a}}return p}function yl(A,t,e,i,s,n,r,a){let o=function(A,t,e,i){const s=(0|A)>>>0,n=(0|t)>>>0,r=(0|e)>>>0;return(Math.imul(s,73856093)^Math.imul(n,19349663)^Math.imul(r,83492791))>>>0&i}(s,n,r,e);const l=0|s,c=0|n,h=0|r;for(let u=0;u<64;u++){const s=o*t,n=A[s+3];if(0===n)return A[s]=l,A[s+1]=c,A[s+2]=h,A[s+3]=1,A[s+4]=a,1;if((0|A[s])===l&&(0|A[s+1])===c&&(0|A[s+2])===h)return n<i&&(A[s+3]=n+1,A[s+4+n]=a),0;o=o+1&e}return-1}let Bl=null,Il=null,Ql=null,El=null,xl=null,Dl=null,Ml=null,bl=null,Sl=0,vl=0,Tl=0;try{const A=function(A){const t=globalThis;if("function"==typeof t.atob){const e=t.atob(A),i=e.length,s=new Uint8Array(i);for(let A=0;A<i;A++)s[A]=e.charCodeAt(A);return s}return new Uint8Array(t.Buffer.from(A,"base64"))}("AGFzbQEAAAABQgtgA39/fwF/YAJ/fwF/YAJ/fwBgBn99f39/fwF/YAABf2AAAGADf39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yFACAAQfgBcUH0iIyFAGoiACEDDAELIABB+AFxIgBB9IiMhQBqIQMgAEH8iIyFAGooAgAhAAsgAyABNgIIIAAgATYCDCABIAM2AgwgASAANgIIDwsgAEEmIABBCHZnIgNrdkEBcSADQQF0ckE+cyEDDAELAkACQEEAKALsiIyFACIADQBB/x8hAQwBC0EAIQEDQCABQQFqIQEgACgCCCIADQALIAFB/x8gAUH/H0sbIQELQQAgATYCpIuMhQAgBCACTQ0BQQBBfzYCnIuMhQAMAQsgAUIANwIQIAEgAzYCHCADQQJ0QeSHjIUAaiECAkACQEEAKAKAi4yFAEEBIAN0IgRxDQAgAiABNgIAIAEgAjYCGCABIAE2AgwgASABNgIIQQBBACgCgIuMhQAgBHI2AoCLjIUADAELAkACQAJAIAIoAgAiBCgCBEF4cSAARw0AIAQhAwwBCyAAQQBBGSADQQF2ayADQR9GG3QhAgNAIAQgAkEddkEEcWoiBSgCECIDRQ0CIAJBAXQhAiADIQQgAygCBEF4cSAARw0ACwsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIDAELIAVBEGogATYCACABIAQ2AhggASABNgIMIAEgATYCCAtBAEEAKAKki4yFAEF/aiIBNgKki4yFACABDQACQAJAQQAoAuyIjIUAIgANAEH/HyEBDAELQQAhAQNAIAFBAWohASAAKAIIIgANAAsgAUH/HyABQf8fSxshAQtBACABNgKki4yFAA8LC1gAAkAgACgCAEGAgICAeEYNACABKAIAIAAoAgQgACgCCCABKAIEKAIMEYCAgIAAgICAgAAPCyABKAIAIAEoAgQgACgCDCgCACIAKAIAIAAoAgQQk4CAgAALgQICAn8BfiOAgICAAEEwayICJICAgIAAAkAgASgCAEGAgICAeEcNACABKAIMIQMgAkEANgIsIAJCgICAgBA3AiQgAkEkakHghMCAACADKAIAIgMoAgAgAygCBBCTgICAABogAiACKAIsIgM2AiAgAiACKQIkIgQ3AxggASADNgIIIAEgBDcCAAsgASgCCCEDIAFBADYCCCABKQIAIQQgAUKAgICAED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k1MDUxNTI1MzU0NTU1NjU3NTg1OTYwNjE2MjYzNjQ2NTY2Njc2ODY5NzA3MTcyNzM3NDc1NzY3Nzc4Nzk4MDgxODI4Mzg0ODU4Njg3ODg4OTkwOTE5MjkzOTQ5NTk2OTc5ODk5AwAAAAwAAAAEAAAABAAAAAUAAAAGAAAAAAAAAAgAAAAEAAAABwAAAAgAAAAJAAAACgAAAAsAAAAQAAAABAAAAAwAAAANAAAADgAAAA8AAABtXcvWLFDrY3hBpldxG4u5K4FbAb2GUewMtMKc5MnHBGFzc2VydGlvbiBmYWlsZWQ6IHBzaXplID49IHNpemUgKyBtaW5fb3ZlcmhlYWQAAOYAEAAqAAAAsQQAAAkAAABhc3NlcnRpb24gZmFpbGVkOiBwc2l6ZSA8PSBzaXplICsgbWF4X292ZXJoZWFkAADmABAAKgAAALcEAAANAAAAcndsb2NrIG92ZXJmbG93ZWQgcmVhZCBsb2NrczcAEABdAAAAFQAAACwAAAAAAAAACAAAAAQAAAAQAAAAAwAAAAwAAAAEAAAAEQAAAHJ3bG9jayBoYXMgbm90IGJlZW4gbG9ja2VkIGZvciByZWFkaW5nAAA3ABAAXQAAAD4AAAAJAAAA"),t=new WebAssembly.Instance(new WebAssembly.Module(A.buffer),{});Bl=t.exports;const e=Bl.memory.buffer;Sl=0|Bl.max_lights(),vl=0|Bl.max_buckets(),Tl=0|Bl.stride_max(),Il=new Float32Array(e,Bl.px_ptr(),Sl),Ql=new Float32Array(e,Bl.py_ptr(),Sl),El=new Float32Array(e,Bl.pz_ptr(),Sl),xl=new Float32Array(e,Bl.pr_ptr(),Sl),Dl=new Uint32Array(e,Bl.off_ptr(),Sl),Ml=new Float32Array(e,Bl.pw_ptr(),Sl),bl=new Uint32Array(e,Bl.hash_ptr(),vl*Tl)}catch{Bl=null}function Ul(A,t,e,i,s,n,r,a,o,l,c,h,u){const g=Bl;if(!(g&&Il&&Ql&&El&&xl&&Ml&&Dl&&bl))return!1;const d=e+1;if(u>Sl||d>vl||t>Tl||d&d-1)return!1;if(Il.set(r.subarray(0,u)),Ql.set(a.subarray(0,u)),El.set(o.subarray(0,u)),xl.set(l.subarray(0,u)),Ml.set(c.subarray(0,u)),Dl.set(h.subarray(0,u)),4294967295==g.fill_world_hash(u,s,i,e,t,n)>>>0)return!1;const p=d*t;return A.set(bl.subarray(0,p)),!0}const Nl=z.FRAGMENT,Pl=4294967295,Ol=[Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl,Pl],Fl=_o(Wo,"ambient"),kl=_o(Wo,"hemiSlot"),Rl=_o(Wo,"dirCount"),Ll=_o(Wo,"unboundedCount"),jl=_o(Wo,"localCount"),zl=_o(Wo,"dirSlots"),Gl=_o(Wo,"unbSlots"),Yl=_o(Wo,"localSlots0"),Hl=_o(Wo,"localSlots1"),Kl=_o(Wo,"localSlots2"),Vl=_o(Wo,"localSlots3"),Jl=_o(Wo,"localSlots4"),Wl=_o(Wo,"localSlots5"),ql=_o(Wo,"localSlots6"),Xl=_o(Wo,"localSlots7"),Zl=_o(qo,"cellSize"),_l=_o(qo,"hashMask"),$l=_o(qo,"maxPerCell"),Ac=_o(qo,"stride"),tc=f.DIRTY_DATA|f.DIRTY_STRUCTURE,ec=f.LOCAL_DIRTY|f.WORLD_DIRTY;class ic{lights=[];localCount=0;needsCluster=!1;shareDirty=!1;meta;lightHeader;clusterCells;clusterParams;maxLightsPerCell;worldCellSize;#Yr=null;#Hr=new Uint32Array(64);#Kr=[];#Vr;#Jr=64;#Wr=0;#qr=new Uint32Array(64);#Xr=new Float32Array(64);#Zr=new Float32Array(64);#_r=new Float32Array(64);#$r=new Float32Array(64);#Aa=new Float32Array(64);#ta=new Uint32Array(64);#ea=1e3;#ia=!1;#sa=0;#na=0;#ra=0;static register(A){if(null!=Object.getOwnPropertyDescriptor(A,"kind"))return;let t=null;try{HA(!1),t=new A,t.registerShareWgsl()}catch(e){throw console.error(e),e}finally{HA(!0),t?.dispose?.()}}constructor(A){this.maxLightsPerCell=function(A){if(null==A)return 32;const t=0|A;return t<1?1:t>64?64:t}(A?.maxLightsPerCell);let t=A?.worldCellSize;null!=t&&t>0||(t=8),t<.5&&(t=.5),t>256&&(t=256),this.worldCellSize=t,this.#Vr=4+this.maxLightsPerCell,this.meta=new $o,this.lightHeader=new Zt("lightHeader",Wo,{access:"Uniform",visibility:Nl,fixedSlot:4}),this.clusterCells=new zt("clusterCells",new Uint32Array(64),"u32",{access:"ReadOnly",visibility:Nl,isArray:!0,isDynamicArray:!0,fixedSlot:6}),this.clusterParams=new Zt("clusterParams",qo,{access:"Uniform",visibility:Nl,fixedSlot:7})}install(A){this.#Yr=A,A.attachBinding(this.lightHeader),A.attachBinding(this.meta.binding),A.attachBinding(this.clusterCells),A.attachBinding(this.clusterParams)}add(A){if(A.lightSlot>=0)return;if(A.headerRole()===Al.Ambient)return A.lightSlot=0,void this.lights.push(A);const t=this.meta.allocate(A.heapSpan());if(t<0)throw new Error("LightMeta overflow");A.lightSlot=t,A.isLocal=!1,this.lights.push(A),this.meta.write(t,A)}remove(A){const t=A.lightSlot;if(t<0)return;t>0&&this.meta.free(t);const e=this.lights;for(let i=0,s=e.length;i<s;i++){if(e[i]!==A)continue;const t=s-1;e[i]=e[t],e.pop();break}A.lightSlot=-1,A.heapOff=-1,A.isLocal=!1,A.lightDirty=0}syncLight(A,t,e,i=!1){this.#aa(A);const s=e.cameraFar!==this.#ea;if(this.#ea=e.cameraFar,!t)return void(this.needsCluster=!1);const n=t.removedLightList,r=t.addedLightList;for(let u=0,g=n.length;u<g;u++)this.remove(n[u]);for(let u=0,g=r.length;u<g;u++)this.add(r[u]);let a=n.length>0||r.length>0||s,o=!1,l=!1;const c=t.lightList,h=e.cameraFar;for(let u=0,g=c.length;u<g;u++){const A=c[u],t=A.lightDirty;A.lightDirty=0,t&f.DIRTY_VISIBLE&&(a=!0);const e=A.headerRole();if(e!==Al.Ambient){if(!(A.lightSlot<=0)&&(t&tc&&(this.meta.write(A.lightSlot,A),e!==Al.Dir&&e!==Al.Hemi||(a=!0),this.#oa(A,h)!==A.isLocal&&(a=!0)),A.isLocal&&t&ec&&(l=!0),A.isLocal&&t&tc)){const t=A.energyWeight(),e=A.localRadius();t===A._clusterWeight&&e===A._clusterRadius||(l=!0,A._clusterWeight=t,A._clusterRadius=e)}}else t&tc&&(o=!0)}if(a?this.#la(A,h):o&&this.#ca(A),this.meta.update(A)){const A=this.#Yr;A&&A.lightBindEpoch++,this.shareDirty=!0}this.needsCluster=this.localCount>32&&(a||l),this.#ha(A),this.shareDirty=!1}#ha(A){this.needsCluster&&(this.#ua(A),this.needsCluster=!1)}#aa(A){this.#ia||(this.lightHeader.createGPUBuffer(A),this.clusterCells.createGPUBuffer(A),this.clusterParams.createGPUBuffer(A),this.meta.update(A),this.#ga(A,0,0,0,Pl,0,0,0,[Pl,Pl,Pl,Pl],[Pl,Pl,Pl,Pl],Ol),this.#da(A,0,this.#Vr),this.#ia=!0)}#oa(A,t){const e=A.localRadius();return e>0&&e<t}#la(A,t){const e=this.lights,i=this.meta;let s=0,n=0,r=0,a=0,o=0,l=0,c=Pl,h=0,u=0,g=0;const d=[Pl,Pl,Pl,Pl],p=[Pl,Pl,Pl,Pl],m=f.EFFECTIVE_VISIBLE;for(let f=0,w=e.length;f<w;f++){const A=e[f];if(A.isLocal=!1,0===(A.dirtyTypes[0]&m))continue;const C=A.headerRole();if(C===Al.Ambient){const t=A.intensity,e=A.color;s+=e.r*t,n+=e.g*t,r+=e.b*t;continue}if(A.lightSlot<=0)continue;const w=i.getOffset(A.lightSlot);if(!(w<0))if(A.heapOff=w,C!==Al.Hemi)if(C!==Al.Dir)this.#oa(A,t)?g=this.#pa(A,w,g):u<4?(p[u++]=w,i.setLocalRadius(A.lightSlot,A.localRadius())):(i.setLocalRadius(A.lightSlot,8),g=this.#pa(A,w,g),A._clusterRadius=8);else if(h<4)d[h++]=w;else{const t=A.intensity,e=A.color,i=e.r*t,c=e.g*t,h=e.b*t;s+=i,n+=c,r+=h,a+=i,o+=c,l+=h}else if(c===Pl)c=w>>>0;else{const t=A.intensity,e=A.color,i=e.r*t,c=e.g*t,h=e.b*t;s+=i,n+=c,r+=h,a+=i,o+=c,l+=h}}this.localCount=g,this.#Kr.length=g,this.#sa=a,this.#na=o,this.#ra=l;const C=Ol.slice();if(g>0&&g<=32){const A=this.#Hr;for(let t=0;t<g;t++)C[t]=A[t]}this.#ga(A,s,n,r,c,h,u,g,d,p,C)}#ca(A){let t=this.#sa,e=this.#na,i=this.#ra;const s=this.lights,n=f.EFFECTIVE_VISIBLE;for(let o=0,l=s.length;o<l;o++){const A=s[o];if(0===(A.dirtyTypes[0]&n))continue;if(A.headerRole()!==Al.Ambient)continue;const r=A.intensity,a=A.color;t+=a.r*r,e+=a.g*r,i+=a.b*r}const r=this.lightHeader,a=r.dataView.view.f32;a[Fl]=t,a[Fl+1]=e,a[Fl+2]=i,r.isDirty=!0,r.updateGPUBuffer(A)}#ga(A,t,e,i,s,n,r,a,o,l,c){const h=this.lightHeader,u=h.dataView.view,{f32:g,u32:d}=u;g[Fl]=t,g[Fl+1]=e,g[Fl+2]=i,d[kl]=s>>>0,d[Rl]=n,d[Ll]=r,d[jl]=a,d[zl]=o[0],d[zl+1]=o[1],d[zl+2]=o[2],d[zl+3]=o[3],d[Gl]=l[0],d[Gl+1]=l[1],d[Gl+2]=l[2],d[Gl+3]=l[3],d[Yl]=c[0],d[Yl+1]=c[1],d[Yl+2]=c[2],d[Yl+3]=c[3],d[Hl]=c[4],d[Hl+1]=c[5],d[Hl+2]=c[6],d[Hl+3]=c[7],d[Kl]=c[8],d[Kl+1]=c[9],d[Kl+2]=c[10],d[Kl+3]=c[11],d[Vl]=c[12],d[Vl+1]=c[13],d[Vl+2]=c[14],d[Vl+3]=c[15],d[Jl]=c[16],d[Jl+1]=c[17],d[Jl+2]=c[18],d[Jl+3]=c[19],d[Wl]=c[20],d[Wl+1]=c[21],d[Wl+2]=c[22],d[Wl+3]=c[23],d[ql]=c[24],d[ql+1]=c[25],d[ql+2]=c[26],d[ql+3]=c[27],d[Xl]=c[28],d[Xl+1]=c[29],d[Xl+2]=c[30],d[Xl+3]=c[31],h.isDirty=!0,h.updateGPUBuffer(A)}#fa(A){let t=this.#Xr;for(;A>t.length;){const A=t.length<<1;t=this.#Xr=new Float32Array(A),this.#Zr=new Float32Array(A),this.#_r=new Float32Array(A),this.#$r=new Float32Array(A),this.#Aa=new Float32Array(A),this.#ta=new Uint32Array(A)}}#ua(A){const t=0|this.localCount;if(t<=0)return;const e=this.#Vr,i=this.maxLightsPerCell,s=this.worldCellSize;this.#fa(t);const n=this.#Xr,r=this.#Zr,a=this.#_r,o=this.#$r,l=this.#Aa,c=this.#ta,h=this.#Kr,u=this.#Hr;for(let d=0;d<t;d++){const A=h[d].matrixWorld.elements;n[d]=A[12],r[d]=A[13],a[d]=A[14],o[d]=h[d]._clusterRadius,l[d]=h[d].energyWeight(),c[d]=u[d]}fl(n,r,a,o,l,c,t);let g=this.#Wr?this.#Wr+1:1024;for(;;){const h=g*e;if(h>262144*e)break;if(h>this.#Jr){this.clusterCells.setCount(h,!1),this.clusterCells.createGPUBuffer(A),this.#Jr=h,this.shareDirty=!0;const t=this.#Yr;t&&t.lightBindEpoch++}let u=this.#qr;u.length<h&&(u=this.#qr=new Uint32Array(h));const d=g-1;let p=-1;if(p=Ul(u,e,d,i,s,8,n,r,a,o,l,c,t)?0:wl(u,e,d,i,s,8,n,r,a,o,c,t),p>=0)return this.#Wr=d,this.#ma(A,u,h),void this.#da(A,d,e);g<<=1}this.#Wr=0,this.#da(A,0,e,0)}#ma(A,t,e){const i=this.clusterCells,s=i.dataView,n=s.buffer;s.view=t,s.dataOffset=0,i.isDirty=!0,i.setUpdateRange(0,e),i.updateGPUBuffer(A),s.buffer!==n&&(this.shareDirty=!0)}#da(A,t,e,i=this.worldCellSize){const s=this.clusterParams,n=s.dataView.view,r=n.u32;n.f32[Zl]=i,r[_l]=t>>>0,r[$l]=this.maxLightsPerCell,r[Ac]=e>>>0,s.isDirty=!0,s.updateGPUBuffer(A)}#Ca(A){let t=this.#Hr;for(;A>t.length;){const A=new Uint32Array(t.length<<1);A.set(t),t=this.#Hr=A}return t}#pa(A,t,e){A.isLocal=!0,A._clusterWeight=A.energyWeight(),A._clusterRadius=A.localRadius(),this.#Ca(e+1)[e]=t>>>0;const i=this.#Kr;return e===i.length?i.push(A):i[e]=A,e+1}dispose(){const A=this.lights;for(let t=0,e=A.length;t<e;t++){const e=A[t];e.lightSlot=-1,e.heapOff=-1,e.isLocal=!1,e.lightDirty=0}A.length=0,this.#Kr.length=0,this.clusterCells.dispose(),this.clusterParams.dispose(),this.lightHeader.dispose(),this.meta.dispose()}}class sc extends Rn{type="FXAA";colorBinding;samplerBinding;constructor(A){super(),this.colorBinding=new qt("color",null),this.samplerBinding=new Wt("colorSampler",A),this.addBinding(this.colorBinding),this.addBinding(this.samplerBinding)}attach(A){this.colorBinding.setValue(A)}sync(A){this.colorBinding.updateGPUBuffer(A)}}const nc={r:0,g:0,b:0,a:1},rc="\n@fragment fn fragmentMain(@builtin(position) pos: vec4f) -> @location(0) vec4f {\n let dim = vec2f(textureDimensions(color));\n let px = 1.0 / max(dim, vec2f(1.0));\n let uv = pos.xy * px;\n let center = textureSampleLevel(weights, samp, uv, 0.0);\n var a: vec4f;\n a.x = textureSampleLevel(weights, samp, uv + vec2f(px.x, 0.0), 0.0).a;\n a.y = textureSampleLevel(weights, samp, uv + vec2f(0.0, px.y), 0.0).g;\n a.z = center.r;\n a.w = center.b;\n let base = textureSampleLevel(color, samp, uv, 0.0);\n if (dot(a, vec4f(1.0)) < 1e-5) { return vec4f(base.rgb, 1.0); }\n\n let horizontal = max(a.x, a.z) > max(a.y, a.w);\n var blendingOffset = vec4f(0.0, a.y, 0.0, a.w);\n var blendingWeight = a.yw;\n if (horizontal) {\n blendingOffset = vec4f(a.x, 0.0, a.z, 0.0);\n blendingWeight = a.xz;\n }\n blendingWeight /= dot(blendingWeight, vec2f(1.0));\n let coord = blendingOffset * vec4f(px.x, px.y, -px.x, -px.y) + uv.xyxy;\n let mixed = blendingWeight.x * textureSampleLevel(color, samp, coord.xy, 0.0)\n + blendingWeight.y * textureSampleLevel(color, samp, coord.zw, 0.0);\n return vec4f(mixed.rgb, 1.0);\n}\n";class ac extends Rn{type="SMAAEdge";colorBinding;pointBinding;constructor(A){super(),this.colorBinding=new qt("color",null),this.pointBinding=new Wt("point",A),this.addBinding(this.colorBinding),this.addBinding(this.pointBinding)}}class oc extends Rn{type="SMAAWeight";edgesBinding;areaBinding;searchBinding;sampBinding;constructor(A){super(),this.edgesBinding=new qt("edges",null),this.areaBinding=new qt("area",null),this.searchBinding=new qt("search",null),this.sampBinding=new Wt("samp",A),this.addBinding(this.edgesBinding),this.addBinding(this.areaBinding),this.addBinding(this.searchBinding),this.addBinding(this.sampBinding)}}class lc extends Rn{type="SMAABlend";colorBinding;weightsBinding;sampBinding;constructor(A){super(),this.colorBinding=new qt("color",null),this.weightsBinding=new qt("weights",null),this.sampBinding=new Wt("samp",A),this.addBinding(this.colorBinding),this.addBinding(this.weightsBinding),this.addBinding(this.sampBinding)}}const cc={r:0,g:0,b:0,a:0},hc={r:0,g:0,b:0,a:1};let uc=null;function gc(A,t,e,i){const s=new pt({width:t,height:e,depth:1},{format:i,sampleCount:1,generateMipmaps:!1,useMipmaps:!1,flipY:!1});return s.applyUsageRender(),s.isDirty=!1,s.prepareConfiguration(),s.createTexture(A),s}function dc(A,t,e,i,s){const n=new Yn(t,e,i,{magFilter:X.Linear,minFilter:X.Linear,mipmapFilter:X.Nearest,wrapS:q.ClampToEdge,wrapT:q.ClampToEdge,formatType:s,dataType:yA.UnNormByteType,generateMipmaps:!1,useMipmaps:!1,flipY:!1});n.prepareConfiguration();const r=n.createTexture(A),a=e*(s===wA.RGFormat?2:s===wA.RGBAFormat?4:1),o=a+255&-256;let l=t;if(o!==a){l=new Uint8Array(o*i);for(let A=0;A<i;A++)l.set(t.subarray(A*a,A*a+a),A*o)}return A.queue.writeTexture({texture:r},l,{bytesPerRow:o,rowsPerImage:i},{width:e,height:i}),n.isDirty=!1,n}class pc extends Lt{isSampledTexture=!0;#yn=!1;constructor(){super("depth",null,"texture_depth_2d",{visibility:z.FRAGMENT})}initTypeInfo(A){this.typeInfo={name:this.name,format:A??"texture_depth_2d",align:0,size:0,elements:0,itemElements:0,offset:0,byteOffset:0,byteStride:0,stride:0,bytes:0,needPadding:!1,dataView:null,isChunkLayout:!1,totalElements:0,gpuTotalElements:0}}isSkipBinding(){return null==this.dataView.texture}attach(A,t){A.isDirty=!1;const e=A.sampleCount>1;return!(this.dataView.texture&&this.#yn===e||(this.dataView.texture=A.createView(t,{aspect:"depth-only",dimension:"2d"}),this.#yn=e,this.setBaseType(e?"texture_depth_multisampled_2d":"texture_depth_2d"),0))}clearView(){this.dataView.texture=null,this.#yn=!1}get msaa(){return this.#yn}generateShader(A,t){return`${this.WGSL_FRAGMENT}@group(${A}) @binding(${t}) var ${this.name}: ${this.getType()};\n`}generateLayout(A,t){return[{binding:t,visibility:this.visibility,texture:{sampleType:"depth",viewDimension:"2d",multisampled:this.#yn}}]}generateBinding(A,t){return[{binding:t,resource:this.dataView.texture}]}}class fc extends Rn{type="SSAO";depthBinding=new pc;radiusBinding;intensityBinding;biasBinding;invProjBinding;projBinding;vpBinding;paramsBinding;invProj=new v;proj=new v;vp=new B(0,0,1,1);constructor(){super(),this.radiusBinding=new zt("radius",.55,"f32",{access:"Uniform"}),this.intensityBinding=new zt("intensity",1.8,"f32",{access:"Uniform"}),this.biasBinding=new zt("bias",.025,"f32",{access:"Uniform"}),this.invProjBinding=new Jt("invProj",this.invProj,"f32",{access:"Uniform"}),this.projBinding=new Jt("proj",this.proj,"f32",{access:"Uniform"}),this.vpBinding=new Ht("vp",this.vp,"f32",{access:"Uniform"}),this.paramsBinding=new Xt("ssao",[this.invProjBinding,this.projBinding,this.vpBinding,this.radiusBinding,this.intensityBinding,this.biasBinding],{access:"Uniform",mode:"struct"}),this.addBinding(this.depthBinding),this.addBinding(this.paramsBinding)}sync(A,t,e,i,s,n,r,a,o){this.writeCPU(t,e,i,s,n,r,a,o),this.paramsBinding.updateGPUBuffer(A)}writeCPU(A,t,e,i,s,n,r,a){this.proj.copy(i),this.invProj.copy(i).invert();const o=this.vp;o.x===s&&o.y===n&&o.z===r&&o.w===a||o.set(s,n,r,a),this.radiusBinding.setValue(A),this.intensityBinding.setValue(t),this.biasBinding.setValue(e);const l=this.paramsBinding;l.isDirty=!0,l.updateCPUBuffer()}}const mc={color:{operation:"add",srcFactor:"zero",dstFactor:"src"},alpha:{operation:"add",srcFactor:"zero",dstFactor:"one"}},Cc={canvas:null,powerPreference:"high-performance",pixelRatio:globalThis.devicePixelRatio||1,antialias:!0,indirectSliceSize:0,occlusionHiZ:!1,profileEncode:!1},wc=["camera","commit","matrixUpload","syncRemoved","geometryBeginFrame","syncAdded","syncStructure","syncPipeline","prepare","buildArgs","cull","encode","prepareSyncDirty","syncMorphActive","syncSkinActive","prepareGeometry","prepareMaterials","prepareWorldMatrix","prepareGeometryMeta","prepareBounding","prepareInstanceMeta","drawRecord","flush","encodeBundleExec","encodeSuffix","encodeFullRecord","bundleHits","bundleFallbacks"];function yc(){const A={};for(let t=0;t<wc.length;t++)A[wc[t]]=0;return A}const Bc=2048;function Ic(A,t,e){return A>0&&t>0&&A/t>(e?1.5:2)}function Qc(A,t,e=0){let i=4;const s=A/Math.max(t,A/32);if(e>0)i=Math.round(A/e),i=Math.min(32,Math.max(4,i)),s>1.2*i&&i<32?i*=2:s<.55*i&&i>4&&(i*=.5);else for(;i<s&&i<32;)i*=2;return A/i}function Ec(A,t){return Math.round(A/t)*t}const xc=2048,Dc=new Float32Array(2304),Mc=new Float32Array(24),bc=z.FRAGMENT,Sc=z.VERTEX,vc=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],Tc=[0,-1,0,0,-1,0,0,0,1,0,0,-1,0,-1,0,0,-1,0];function Uc(A){let t=1;for(;t*t<A;)t++;return t}function Nc(A){if(!A.visible||!A.castShadow||A.lightSlot<=0)return!1;const t=A.headerRole();return t!==Al.Ambient&&t!==Al.Hemi&&!(A instanceof dl)}function Pc(A){return A.headerRole()===Al.Dir||A instanceof gl?1:6}const Oc=new wt("ShadowTable",[{name:"biasPad",format:"vec4f"},{name:"cubeVP",format:"mat4x4f",isArray:!0,count:96},{name:"tileBias",format:"vec4f",isArray:!0,count:16}]);Oc.computeLayout();class Fc extends si{type="ShadowEncode";id=0;constructor(A,t,e){super(),this.addBinding(A,!1),this.addBinding(t,!1),this.addBinding(e,!1)}}class kc extends si{type="InstancedShadowEncode";id=0;constructor(A,t,e){super(),this.addBinding(A,!1),this.addBinding(t,!1),this.addBinding(e,!1)}}function Rc(A,t){const e=A.dataView,i=t.dataView,s=i.buffer;e.buffer=s,e.offset=i.offset,e.view=i.view,e.ownsBuffer=!1,e.size=i.size??(s?s.size-(0|i.offset):e.size)}class Lc extends Lt{constructor(A,t){super(A,null,"u32",{visibility:bc,fixedSlot:t}),this.typeInfo.format="texture_depth_2d"}isSkipBinding(){return!1}attachView(A){this.dataView.texture=A}generateShader(A,t){return`@group(${A}) @binding(${this.fixedSlot}) var ${this.name}: texture_depth_2d;\n`}generateLayout(){return[{binding:this.fixedSlot,visibility:bc,texture:{sampleType:"depth",viewDimension:"2d",multisampled:!1}}]}generateBinding(){return[{binding:this.fixedSlot,resource:this.dataView.texture}]}}const jc=new y,zc=new y,Gc=new y(0,1,0),Yc=new y,Hc=new y,Kc=new y,Vc=new y,Jc=new v,Wc=new v,qc=new v,Xc=new Float32Array(1604),Zc=new y,_c=new y,$c=new y,Ah=new y,th=new y,eh=new Set,ih=[],sh={},nh=new Set,rh=new Float32Array(1),ah=new Uint32Array(rh.buffer),oh=new Uint32Array(2);function lh(A,t){return Math.imul(A^(0|t),16777619)>>>0}function ch(A){return rh[0]=A,ah[0]}function hh(A,t,e){let i=lh(2166136261,t),s=2166136261,n=0;for(let r=0;r<t;r++){const t=A[r];i=lh(i,t.poolIndex);const e=t.readMatrixWorld().elements;for(let A=0;A<16;A++)i=lh(i,ch(e[A]));if(t.headerRole()===Al.Dir){n++,s=lh(s,t.poolIndex);for(let A=0;A<16;A++)s=lh(s,ch(e[A]))}}s=lh(s,n),i=lh(i,e.length),s=lh(s,e.length);for(let r=0,a=e.length;r<a;r++){const A=e[r];i=lh(i,A.poolIndex),s=lh(s,A.poolIndex);const t=A.readMatrixWorld().elements;for(let e=0;e<16;e++){const A=ch(t[e]);i=lh(i,A),s=lh(s,A)}}return oh[0]=i,oh[1]=s,oh}function uh(A,t,e,i){gh(A,t,e[i+3]+e[i],e[i+7]+e[i+4],e[i+11]+e[i+8],e[i+15]+e[i+12]),gh(A,t+4,e[i+3]-e[i],e[i+7]-e[i+4],e[i+11]-e[i+8],e[i+15]-e[i+12]),gh(A,t+8,e[i+3]+e[i+1],e[i+7]+e[i+5],e[i+11]+e[i+9],e[i+15]+e[i+13]),gh(A,t+12,e[i+3]-e[i+1],e[i+7]-e[i+5],e[i+11]-e[i+9],e[i+15]-e[i+13]),gh(A,t+16,e[i+2],e[i+6],e[i+10],e[i+14]),gh(A,t+20,e[i+3]-e[i+2],e[i+7]-e[i+6],e[i+11]-e[i+10],e[i+15]-e[i+14])}function gh(A,t,e,i,s,n){let r=Math.sqrt(e*e+i*i+s*s);r>0&&(r=1/r,e*=r,i*=r,s*=r,n*=r),A[t]=e,A[t+1]=i,A[t+2]=s,A[t+3]=n}function dh(A,t,e,i){Vc.copy(t).sub(e),Vc.lengthSq()<1e-12&&Vc.set(0,0,1),Vc.normalize(),Hc.crossVectors(i,Vc),Hc.lengthSq()<1e-12&&(Vc.x+=1e-4,Vc.normalize(),Hc.crossVectors(i,Vc)),Hc.normalize(),Kc.crossVectors(Vc,Hc);const s=Hc.elements,n=Kc.elements,r=Vc.elements,a=t.elements,o=A.elements;o[0]=s[0],o[4]=s[1],o[8]=s[2],o[12]=-(s[0]*a[0]+s[1]*a[1]+s[2]*a[2]),o[1]=n[0],o[5]=n[1],o[9]=n[2],o[13]=-(n[0]*a[0]+n[1]*a[1]+n[2]*a[2]),o[2]=r[0],o[6]=r[1],o[10]=r[2],o[14]=-(r[0]*a[0]+r[1]*a[1]+r[2]*a[2]),o[3]=0,o[7]=0,o[11]=0,o[15]=1}class ph{atlasBinding;nearBinding;samplerBinding;shadowTable;encodeTable;casters;tileIndex;encodeNode;instVisible;instEncodeNode;scene=null;needsEncode=!1;needsNear=!1;nearLive=!1;nearSlot=1;nearViewIndex=-1;nearTex=null;nearTexView=null;nearDummy=null;nearSize=0;baseValid=!1;baseTexel=0;baseNear=.1;baseFar=1;baseTile=0;baseView=new Float32Array(16);baseMinX=0;baseMinY=0;baseMinZ=0;baseMaxX=0;baseMaxY=0;baseMaxZ=0;nearTexel=0;nearCamX=Number.NaN;nearCamY=Number.NaN;nearCamZ=Number.NaN;nearCamFx=Number.NaN;nearCamFy=Number.NaN;nearCamFz=Number.NaN;nearProjectionY=Number.NaN;nearViewportH=Number.NaN;snapX=Number.POSITIVE_INFINITY;snapY=Number.POSITIVE_INFINITY;dstStride=1;casterMeshes=[];casterSet=new Set;casterIndex=new Map;jobs=[];jobSeen=new Set;instancedCasters=[];instPassBGs=[];flagged=[];tiles=[];tileCount=0;atlasGrid=1;atlas=null;atlasView=null;atlasSize=0;dummyAtlas=null;lastTileSig=-1;casterPools=new Set;casterPoolOf=new Map;poolRefs=new Map;epochCasters=[];epochSnap=[];countSnap=[];matrixStamp=0;nearMatrixStamp=0;matrixStampReady=!1;stampCoversFrame=!1;tileIdBufs=[];passBGs=[];cubeMask=0;fittedMask=0;viewCount=0;viewSlots=new Uint8Array(Jr);viewX=new Float32Array(Jr);viewY=new Float32Array(Jr);viewW=new Float32Array(Jr);viewH=new Float32Array(Jr);src=null;dst=null;args=null;pullUsed=0;pullDraws=[];pullFlat=new Uint32Array(0);cull=null;batchCap=0;regShadow=!1;regInstMesh=!1;regInstModel=!1;pipeGen=-1;pipes=new Map;instMeshPipes=new Map;instModelPipes=new Map;lastStride=-1;lastFormat="";lastOffset=-1;lastPipe=null;instLastKind=-1;instLastStride=-1;instLastFormat="";instLastOffset=-1;instLastPipe=null;lastBoundPipe=null;constructor(){this.atlasBinding=new Lc("shadowAtlas",8),this.nearBinding=new Lc("shadowNear",17);const A=new rt({magFilter:X.Linear,minFilter:X.Linear,mipmapFilter:X.Nearest,compareFunction:"greater",wrapS:q.ClampToEdge,wrapT:q.ClampToEdge});this.samplerBinding=new Wt("shadowSampler",A,{visibility:bc,fixedSlot:9}),this.samplerBinding.setBaseType("sampler_comparison"),this.shadowTable=new Zt("shadowTable",Oc,{access:"Uniform",visibility:bc,fixedSlot:10}),this.encodeTable=new Zt("shadowTable",Oc,{access:"Uniform",visibility:Sc}),this.casters=new zt("shadowCasters",new Uint32Array(64),"u32",{access:"ReadOnly",visibility:Sc,isArray:!0,isDynamicArray:!0}),this.tileIndex=new zt("shadowTile",0,"u32",{access:"Uniform",visibility:Sc}),this.encodeNode=new Fc(this.encodeTable,this.casters,this.tileIndex),this.instVisible=new zt("shadowVisible",new Uint32Array(4),"u32",{access:"ReadOnly",visibility:Sc,isArray:!0,isDynamicArray:!0}),this.instEncodeNode=new kc(this.encodeTable,this.instVisible,this.tileIndex)}}function fh(A,t){0===A.nearSize&&mh(A,t,1),A.cull||(A.shadowTable.createGPUBuffer(t),Rc(A.encodeTable,A.shadowTable),A.src=new Qr(t),A.dst=new Ro(t),A.args=new wr(t),A.cull=new $r(A.src,A.dst,A.args),function(A,t){if(96===A.tileIdBufs.length)return;const e=new Uint32Array(4);for(let i=0;i<96;i++){const s=t.createBuffer({label:`shadow-tile-id-${i}`,size:16,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});e[0]=i,t.queue.writeBuffer(s,0,e),A.tileIdBufs[i]=s}}(A,t),Ch(A,t,1))}function mh(A,t,e){if(A.nearTex&&A.nearSize===e)return;const i=A.nearTex,s=A.nearSize;A.nearTex=t.createTexture({label:1===e?"shadow-near-dummy":"shadow-near",format:"depth32float",size:{width:e,height:e},usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}),A.nearTexView=A.nearTex.createView({aspect:"depth-only"}),A.nearBinding.attachView(A.nearTexView),A.nearSize=e,i&&1===s&&e===Bc?A.nearDummy=i:i?.destroy();const n=A.scene;n&&1!==e&&n.lightBindEpoch++}function Ch(A,t,e){if(A.atlas&&A.atlasSize===e)return;const i=A.atlas,s=A.atlasSize;A.atlas=t.createTexture({label:1===e?"shadow-dummy":"shadow-atlas",format:"depth32float",size:{width:e,height:e},usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}),A.atlasView=A.atlas.createView({aspect:"depth-only"}),A.atlasBinding.attachView(A.atlasView),A.atlasSize=e,i&&1===s&&e===xc?A.dummyAtlas=i:i?.destroy();const n=A.scene;n&&1!==e&&n.lightBindEpoch++}function wh(A,t,e,i){return t.headerRole()===Al.Dir?function(A,t,e,i){const s=t.matrixWorld.elements;if(Yc.set(-s[8],-s[9],-s[10]),Yc.lengthSq()<1e-12)return!1;if(Yc.normalize(),!function(A,t){_c.set(1e30,1e30,1e30),$c.set(-1e30,-1e30,-1e30);let e=!1;eh.clear();for(let i=0,s=t.length;i<s;i++){const A=t[i];if(!A.visible||!yh(0,A))continue;if(A.isInstancedDraw){const t=A,i=t.getCullHandle();if(eh.has(i))continue;eh.add(i),t.expandWorldAABB?.(_c,$c)&&(e=!0);continue}const s=A.geometry,n=s.boundingBox??s.computeBoundingBox();if(!n)continue;const r=A.matrixWorld,a=n.min.elements,o=n.max.elements;for(let t=0;t<2;t++){const A=t?o[0]:a[0];for(let t=0;t<2;t++){const i=t?o[1]:a[1];for(let t=0;t<2;t++){Zc.set(A,i,t?o[2]:a[2]).applyMatrix4(r);const s=Zc.elements;s[0]<_c.x&&(_c.x=s[0]),s[1]<_c.y&&(_c.y=s[1]),s[2]<_c.z&&(_c.z=s[2]),s[0]>$c.x&&($c.x=s[0]),s[1]>$c.y&&($c.y=s[1]),s[2]>$c.z&&($c.z=s[2]),e=!0}}}}return e}(0,e))return!1;zc.set(.5*(_c.x+$c.x),.5*(_c.y+$c.y),.5*(_c.z+$c.z));const n=$c.x-_c.x,r=$c.y-_c.y,a=$c.z-_c.z,o=.5*Math.sqrt(n*n+r*r+a*a)+1.5;jc.copy(Yc).multiplyScalar(-o).add(zc),Gc.set(0,1,0),Math.abs(Yc.y)>.99&&Gc.set(1,0,0),dh(Jc,jc,zc,Gc);let l=1e30,c=1e30,h=1e30,u=-1e30,g=-1e30,d=-1e30;const p=Jc.elements;eh.clear();for(let D=0,M=e.length;D<M;D++){const A=e[D];if(!A.visible||!yh(0,A))continue;if(A.isInstancedDraw){const t=A,e=t.getCullHandle();if(eh.has(e))continue;if(eh.add(e),Ah.set(1e30,1e30,1e30),th.set(-1e30,-1e30,-1e30),!t.expandWorldAABB?.(Ah,th))continue;for(let A=0;A<2;A++){const t=A?th.x:Ah.x;for(let A=0;A<2;A++){const e=A?th.y:Ah.y;for(let A=0;A<2;A++){const i=A?th.z:Ah.z,s=p[0]*t+p[4]*e+p[8]*i+p[12],n=p[1]*t+p[5]*e+p[9]*i+p[13],r=p[2]*t+p[6]*e+p[10]*i+p[14];s<l&&(l=s),s>u&&(u=s),n<c&&(c=n),n>g&&(g=n),r<h&&(h=r),r>d&&(d=r)}}}continue}const t=A.geometry,i=t.boundingBox??t.computeBoundingBox();if(!i)continue;const s=A.matrixWorld,n=i.min.elements,r=i.max.elements;for(let e=0;e<2;e++){const A=e?r[0]:n[0];for(let t=0;t<2;t++){const e=t?r[1]:n[1];for(let t=0;t<2;t++){Zc.set(A,e,t?r[2]:n[2]).applyMatrix4(s);const i=Zc.elements,a=p[0]*i[0]+p[4]*i[1]+p[8]*i[2]+p[12],o=p[1]*i[0]+p[5]*i[1]+p[9]*i[2]+p[13],f=p[2]*i[0]+p[6]*i[1]+p[10]*i[2]+p[14];a<l&&(l=a),a>u&&(u=a),o<c&&(c=o),o>g&&(g=o),f<h&&(h=f),f>d&&(d=f)}}}}const f=.35;l-=f,u+=f,c-=f,g+=f;const m=1/.88,C=.5*(l+u),w=.5*(c+g),y=.5*(u-l)*m,B=.5*(g-c)*m;l=C-y,u=C+y,c=w-B,g=w+B;const I=d-h;I>0&&(h-=I);const Q=Math.max(.001,-d-f),E=Math.max(Q+.001,-h+f);Wc.makeOrthographic(l,u,g,c,Q,E),qc.multiplyMatrices(Wc,Jc),xh(0,i);const x=function(A,t,e,i,s,n){const r=function(A,t,e){const i=A>t?A:t;return i>0&&e>0?i/e:0}(e,i,xc/Uc(A.tileCount));if(A.baseValid&&r<=A.baseTexel)return r;A.baseValid=!0,A.baseTexel=r,A.baseNear=s,A.baseFar=n,A.baseTile=t,A.baseMinX=_c.x,A.baseMinY=_c.y,A.baseMinZ=_c.z,A.baseMaxX=$c.x,A.baseMaxY=$c.y,A.baseMaxZ=$c.z;const a=Jc.elements,o=A.baseView;for(let l=0;l<16;l++)o[l]=a[l];return r}(A,i,u-l,g-c,Q,E);return Mh(0,i,0,x,Q,E),!0}(A,t,e,i):t instanceof gl?function(A,t,e){const i=t.matrixWorld.elements;if(jc.set(i[12],i[13],i[14]),Yc.set(-i[8],-i[9],-i[10]),Yc.lengthSq()<1e-12)return!1;Yc.normalize();const s=Math.max(t.localRadius()||8,1);zc.copy(Yc).multiplyScalar(s).add(jc),Gc.set(0,1,0),Math.abs(Yc.y)>.99&&Gc.set(1,0,0),dh(Jc,jc,zc,Gc);const n=Math.min(Math.max(2*t.angle,.08),.95*Math.PI);return Wc.makePerspective(n,1,.12,s),qc.multiplyMatrices(Wc,Jc),xh(0,e),!0}(0,t,i):function(A,t,e){const i=t.matrixWorld.elements;jc.set(i[12],i[13],i[14]);const s=t.localRadius(),n=Math.max(s>0?s:8,1);Wc.makePerspective(.5*Math.PI,1,.12,n),A.cubeMask|=1<<e;for(let r=0;r<6;r++){const A=3*r;zc.set(jc.x+vc[A],jc.y+vc[A+1],jc.z+vc[A+2]),Gc.set(Tc[A],Tc[A+1],Tc[A+2]),dh(Jc,jc,zc,Gc),qc.multiplyMatrices(Wc,Jc),Dh(0,e,r)}return!0}(A,t,i)}function yh(A,t){if(t.skeleton)return!1;if(t.topology!==G.TriangleList)return!1;if(t.material.transparent)return!1;const e=t.geometry;return"stream"!==e.role&&!(e.morphAttributes.size>0||e.morphNormals.size>0)}function Bh(A,t){const e=t.matrixWorld.elements,i=e[12],s=e[13],n=e[14],r=e[8],a=e[9],o=e[10],l=t.projectionMatrix.elements[5],c=t.viewport.y,h=i!==A.nearCamX||s!==A.nearCamY||n!==A.nearCamZ||r!==A.nearCamFx||a!==A.nearCamFy||o!==A.nearCamFz||l!==A.nearProjectionY||c!==A.nearViewportH;return A.nearCamX=i,A.nearCamY=s,A.nearCamZ=n,A.nearCamFx=r,A.nearCamFy=a,A.nearCamFz=o,A.nearProjectionY=l,A.nearViewportH=c,h}function Ih(A){let t=0;const e=A.cubeMask,i=A.fittedMask;for(let s=0;s<A.tileCount;s++)i>>s&1&&(t+=e&1<<s?6:1);return t}function Qh(A,t){if(!A.baseValid)return 0;const e=t.matrixWorld.elements,i=e[12],s=e[13],n=e[14];let r=-e[8],a=-e[9],o=-e[10];const l=Math.sqrt(r*r+a*a+o*o);l>1e-8&&(r/=l,a/=l,o/=l);const c=A.baseMinX,h=A.baseMinY,u=A.baseMinZ,g=A.baseMaxX,d=A.baseMaxY,p=A.baseMaxZ;let f=function(A,t,e,i,s,n,r,a,o,l,c,h){let u=0,g=1e30;if(Math.abs(i)<1e-8){if(A<r||A>l)return-1}else{let t=(r-A)/i,e=(l-A)/i;if(t>e){const A=t;t=e,e=A}if(t>u&&(u=t),e<g&&(g=e),u>g)return-1}if(Math.abs(s)<1e-8){if(t<a||t>c)return-1}else{let A=(a-t)/s,e=(c-t)/s;if(A>e){const t=A;A=e,e=t}if(A>u&&(u=A),e<g&&(g=e),u>g)return-1}if(Math.abs(n)<1e-8){if(e<o||e>h)return-1}else{let A=(o-e)/n,t=(h-e)/n;if(A>t){const e=A;A=t,t=e}if(A>u&&(u=A),t<g&&(g=t),u>g)return-1}return g>=0?u:-1}(i,s,n,r,a,o,c,h,u,g,d,p);const m=f>=0;let C,w,y;if(m)C=i+r*f,w=s+a*f,y=n+o*f;else{C=Math.max(c,Math.min(g,i)),w=Math.max(h,Math.min(d,s)),y=Math.max(u,Math.min(p,n));const A=C-i,t=w-s,e=y-n;f=Math.sqrt(A*A+t*t+e*e)}const B=t.projectionMatrix.elements,I=Math.max(t.viewport.y,1);let Q;Q=Math.abs(B[15])<.5?function(A,t,e){return t>0&&e>0?2*Math.max(A,0)/(t*e):0}(f,Math.abs(B[5]),I):2/(Math.max(Math.abs(B[5]),1e-8)*I),Q=Math.max(Q,A.baseTexel/32);const E=A.nearLive?A.nearTexel:0,x=Qc(A.baseTexel,Q,E),D=Bc*x*.25;return m&&(C=Math.max(c,Math.min(g,C+r*D)),w=Math.max(h,Math.min(d,w+a*D)),y=Math.max(u,Math.min(p,y+o*D))),zc.set(C,w,y),Q}function Eh(A,t,e,i,s){const n=A.nearTexel,r=A.baseView,a=r[0]*t+r[4]*e+r[8]*i+r[12],o=r[1]*t+r[5]*e+r[9]*i+r[13],l=Ec(a,n),c=Ec(o,n),h=s||function(A,t,e,i,s){const n=Bc*s*.125;return Math.abs(e-A)>n||Math.abs(i-t)>n}(A.snapX,A.snapY,l,c,n);if(!h)return!1;A.snapX=l,A.snapY=c;const u=Bc*n*.5,g=Jc.elements,d=A.baseView;for(let f=0;f<16;f++)g[f]=d[f];Wc.makeOrthographic(l-u,l+u,c+u,c-u,A.baseNear,A.baseFar),qc.multiplyMatrices(Wc,Jc);const p=4+16*A.nearSlot;return Xc.set(qc.elements,p),Mh(0,A.baseTile,1,n,A.baseNear,A.baseFar),uh(Mc,0,Xc,p),h}function xh(A,t){Xc.set(qc.elements,4+6*t*16)}function Dh(A,t,e){Xc.set(qc.elements,4+16*(6*t+e))}function Mh(A,t,e,i,s,n){const r=.25*i;Xc[1540+4*t+e]=Math.min(.002,r/Math.max(n-s,1e-8))}function bh(A,t){return!A.casterSet.has(t)&&(A.casterSet.add(t),A.casterIndex.set(t,A.casterMeshes.length),A.casterMeshes.push(t),vh(A,t),Uh(A,t),!0)}function Sh(A,t){if(!A.casterSet.delete(t))return!1;!function(A,t){const e=A.casterPoolOf.get(t);void 0!==e&&(A.casterPoolOf.delete(t),Th(A,e))}(A,t),function(A,t){const e=A.epochCasters,i=e.length;for(let s=0;s<i;s++){if(e[s]!==t)continue;const n=i-1;return e[s]=e[n],A.epochSnap[s]=A.epochSnap[n],A.countSnap[s]=A.countSnap[n],e.pop(),A.epochSnap.pop(),void A.countSnap.pop()}}(A,t);const e=A.casterMeshes,i=A.casterIndex,s=i.get(t);if(i.delete(t),void 0===s)return!0;const n=e.length-1,r=e[n];return e[s]=r,e.pop(),s!==n&&i.set(r,s),!0}function vh(A,t){const e=t.poolIndex,i=A.casterPoolOf.get(t);i!==e&&(void 0!==i&&(A.casterPoolOf.delete(t),Th(A,i)),e>=0&&(function(A,t){const e=A.poolRefs.get(t)??0;A.poolRefs.set(t,e+1),0===e&&A.casterPools.add(t)}(A,e),A.casterPoolOf.set(t,e)))}function Th(A,t){const e=A.poolRefs.get(t);if(null==e||e<=1)return A.poolRefs.delete(t),void A.casterPools.delete(t);A.poolRefs.set(t,e-1)}function Uh(A,t){if(!t.isInstancedDraw)return;const e=A.epochCasters;for(let s=0,n=e.length;s<n;s++)if(e[s]===t)return;const i=t;e.push(t),A.epochSnap.push(i.matrixEpoch??0),A.countSnap.push(0|i.count)}function Nh(A,t,e){const i=A.flagged,s=A.tiles,n=A.fittedMask,r=A.tileCount;for(let a=0,o=i.length;a<o;a++){const A=i[a];let t=!1;for(let e=0;e<r;e++)if(n>>e&1&&s[e]===A){t=!0;break}!t&&A.lightSlot>0&&(A.writeShadowFlags(0),e.write(A.lightSlot,A))}i.length=0;for(let a=0;a<r;a++){if(!(n>>a&1))continue;const t=s[a];t.writeShadowFlags(1|a<<8|(A.cubeMask&1<<a?2:0)|(A.nearLive&&a===A.baseTile?8:0)),e.write(t.lightSlot,t),i.push(t)}e.update(t)}function Ph(A,t,e,i,s){const n=i.getVertexSlots();let r=-1,a=null;for(let f=0,m=n.length;f<m;f++){if("instance"===n[f].stepMode)continue;const A=n[f].attributes;for(let t=0,e=A.length;t<e;t++)if("position"===A[t].attrName){r=f,a=A[t];break}if(a)break}if(!a||r<0)return!1;if(e.geometryTables.getVertexBinds(i,ih)<=r)return!1;const o=ih[r],l=i.boundIndex;if(l<0)return!1;const c=e.worldStore.geometryMeta.cpuView,h=l*zs;if(0===(c[h+Ls.Flags]&Gs.ALIVE))return!1;const u=n[r].arrayStride,g=a.format,d=a.offset;let p;if(u===A.lastStride&&g===A.lastFormat&&d===A.lastOffset&&A.lastPipe)p=A.lastPipe;else{const t=vn(u,g,d),i=e.pipelineCache;p=A.pipes.get(t),p||(p=i.createDepthEncode(0,u,g,d),A.pipes.set(t,p)),A.lastPipe=p,A.lastStride=u,A.lastFormat=g,A.lastOffset=d}if(p!==A.lastBoundPipe&&(t.setPipeline(p),A.lastBoundPipe=p),t.setVertexBuffer(0,o.buffer,o.offset,o.size),s){const A=e.geometryTables.getLayoutPools(c[h+Ls.LayoutId]);if(!A)return!1;const i=c[h+Ls.IndexFormat]===Ys.Uint32?V.Uint32:V.Uint16;t.setIndexBuffer(A.ib.activeBuffer,i,c[h+Ls.IbOffset],c[h+Ls.IbSize])}return!0}function Oh(A,t,e,i,s){const n=i.geometry,r=n.getVertexSlots();let a=-1,o=null;for(let m=0,C=r.length;m<C;m++){if("instance"===r[m].stepMode)continue;const A=r[m].attributes;for(let t=0,e=A.length;t<e;t++)if("position"===A[t].attrName){a=m,o=A[t];break}if(o)break}if(!o||a<0)return!1;if(e.geometryTables.getVertexBinds(n,ih)<=a)return!1;const l=ih[a],c=i.hasNodeBind?2:1,h=r[a].arrayStride,u=o.format,g=o.offset;let d;if(c===A.instLastKind&&h===A.instLastStride&&u===A.instLastFormat&&g===A.instLastOffset&&A.instLastPipe)d=A.instLastPipe;else{const t=vn(h,u,g),i=2===c?A.instModelPipes:A.instMeshPipes,s=e.pipelineCache;d=i.get(t),d||(d=s.createDepthEncode(c,h,u,g),i.set(t,d)),A.instLastPipe=d,A.instLastKind=c,A.instLastStride=h,A.instLastFormat=u,A.instLastOffset=g}const p=e.pipelineCache.getSystemGroup3BGL(c);if(!p)return!1;const f=e.pipelineCache.getInstancedGroup3BindGroup(p,0,i,sh);if(d!==A.lastBoundPipe&&(t.setPipeline(d),A.lastBoundPipe=d),t.setBindGroup(3,f),t.setVertexBuffer(0,l.buffer,l.offset,l.size),s){const A=n.boundIndex;if(A<0)return!1;const i=e.worldStore.geometryMeta.cpuView,s=A*zs,r=e.geometryTables.getLayoutPools(i[s+Ls.LayoutId]);if(!r)return!1;const a=i[s+Ls.IndexFormat]===Ys.Uint32?V.Uint32:V.Uint16;t.setIndexBuffer(r.ib.activeBuffer,a,i[s+Ls.IbOffset],i[s+Ls.IbSize])}return!0}function Fh(A,t,e){if(e.hasNodeBind){if(A.regInstModel)return;return t.registerDepthKind({material:A.instEncodeNode,entryWgsl:"\n@vertex fn vs_main(@location(0) position: vec3<f32>, @builtin(instance_index) instanceIndex: u32) -> @builtin(position) vec4<f32> {\n let instId = shadowVisible[instanceIndex];\n let _mat = instancedObject.matVec4Base + instId * 4u;\n let Mi = mat4x4<f32>(instancedMats[_mat], instancedMats[_mat + 1u], instancedMats[_mat + 2u], instancedMats[_mat + 3u]);\n let world = worldMatrices[instancedObject.handlePool] * Mi * instancedObject.nodeBind;\n return shadowTable.cubeVP[u32(shadowTile)] * (world * vec4<f32>(position, 1.0));\n}\n",group3:e,reservedId:2}),void(A.regInstModel=!0)}A.regInstMesh||(t.registerDepthKind({material:A.instEncodeNode,entryWgsl:"\n@vertex fn vs_main(@location(0) position: vec3<f32>, @builtin(instance_index) instanceIndex: u32) -> @builtin(position) vec4<f32> {\n let instId = shadowVisible[instanceIndex];\n let _mat = instancedObject.matVec4Base + instId * 4u;\n let Mi = mat4x4<f32>(instancedMats[_mat], instancedMats[_mat + 1u], instancedMats[_mat + 2u], instancedMats[_mat + 3u]);\n let world = worldMatrices[instancedObject.poolIndex] * Mi;\n return shadowTable.cubeVP[u32(shadowTile)] * (world * vec4<f32>(position, 1.0));\n}\n",group3:e,reservedId:1}),A.regInstMesh=!0)}const kh=[],Rh=new Map,Lh=new Map;function jh(A,t,e,i){let s=Rh.get(A);if(null==s){s=Rh.size,Rh.set(A,s);let n=kh[s];n||(n={geometry:t,batchBase:e,capacity:i,pools:[],n:0},kh[s]=n),n.geometry=t,n.batchBase=e,n.capacity=i,n.n=0}return kh[s]}function zh(A,t,e,i){const s=A.pullUsed;if(0===s)return;const n=A.pullDraws,r=i*A.dstStride,a=A.dstStride;for(let o=0;o<s;o++){const i=n[o];if(i.origin+i.instances>a)continue;if(!Ph(A,t,e,i.geometry,i.indexed))continue;const s=r+i.origin;i.indexed?t.drawIndexed(i.indexCount,i.instances,i.firstIndex,i.baseVertex,s):t.draw(i.indexCount,i.instances,i.firstIndex,s)}}function Gh(A,t,e){if(!t.visible||t.poolIndex<0)return!1;if(t.isInstancedDraw)return!1;if(!yh(0,t))return!1;if(!e.geometryTables.hasGeometry(t.geometry.id))return!1;const i=e.buckets.getMemberForMesh(t);return!(!i||i.batch.skipCull||i.batch.bucket.isMegaPull)}function Yh(A,t,e){const i=t;if(!i.isInstancedDraw||!t.visible)return!1;if(i.cullArgsSlot<0)return!1;if(!yh(0,t))return!1;if(!e.geometryTables.hasGeometry(t.geometry.id))return!1;const s=e.buckets.getMemberForMesh(t);return!(!s||s.batch.bucket.isMegaPull)}class Hh{#wa=new ph;get atlasBinding(){return this.#wa.atlasBinding}get nearBinding(){return this.#wa.nearBinding}get samplerBinding(){return this.#wa.samplerBinding}get shadowTable(){return this.#wa.shadowTable}install(A){!function(A,t){A.scene=t,t.attachBinding(A.atlasBinding),t.attachBinding(A.nearBinding),t.attachBinding(A.samplerBinding),t.attachBinding(A.shadowTable)}(this.#wa,A)}sync(A,t,e,i,s){!function(A,t,e,i,s,n){A.stampCoversFrame=!1,A.needsNear=!1,fh(A,t);let r=!1,a=!1;const o=e.addedList;for(let C=0,w=o.length;C<w;C++){const t=o[C];if(t.isMesh&&t.castShadow){const e=bh(A,t);r=e||r,a=e||a}}const l=e.removedList;for(let C=0,w=l.length;C<w;C++){const t=l[C];if(t.isMesh){const e=Sh(A,t);r=e||r,a=e||a}}const c=e.casterFlagList;for(let C=0,w=c.length;C<w;C++){const t=c[C],e=t.castShadow?bh(A,t):Sh(A,t);r=e||r,a=e||a}const h=e.structureList,u=A.casterSet;for(let C=0,w=h.length;C<w;C++){const t=h[C];t.isMesh&&u.has(t)&&(r=!0,a=!0,vh(A,t),Uh(A,t))}const g=A.casterMeshes;if(!r){const A=e.visibleList;for(let t=0,e=A.length;t<e;t++){const e=A[t];if(e.isMesh&&u.has(e)){r=!0,a=!0;break}}}if(!r){const A=e.pipelineList;for(let t=0,e=A.length;t<e;t++){const e=A[t];if(e.isMesh&&u.has(e)){r=!0,a=!0;break}}}if(!r){const A=e.geometryList,t=g.length,i=A.length;if(1===i&&t>0){const e=A[0];for(let A=0;A<t;A++)if(g[A].geometry===e){r=!0,a=!0;break}}else if(i>1&&t>0){const e=nh;e.clear();for(let t=0;t<i;t++)e.add(A[t]);for(let A=0;A<t;A++)if(e.has(g[A].geometry)){r=!0,a=!0;break}}}!function(A,t){const e=A.tiles;e.length=0;let i=0;const s=t.length;for(let n=0;n<s&&e.length<16;n++){const A=t[n];if(!Nc(A))continue;const s=Pc(A);i+s>Jr||(e.push(A),i+=s)}A.tileCount=e.length}(A,i);const d=A.tiles,p=A.tileCount;if(0===p||0===g.length)return A.fittedMask=0,A.viewCount=0,A.lastTileSig=-1,A.nearLive=!1,A.baseValid=!1,A.flagged.length>0&&Nh(A,t,s),void(A.needsEncode=!1);const f=function(A,t){let e=lh(2166136261,t);for(let i=0;i<t;i++)e=lh(e,A[i].poolIndex);return e}(d,p);if(f!==A.lastTileSig&&(r=!0,a=!0,A.lastTileSig=f),function(A){const t=A.epochCasters,e=A.epochSnap,i=A.countSnap;let s=!1;for(let n=0,r=t.length;n<r;n++){const A=t[n],r=A.matrixEpoch??0,a=0|A.count;r===e[n]&&a===i[n]||(e[n]=r,i[n]=a,s=!0)}return s}(A)&&(r=!0,a=!0),!r){const t=function(A,t,e,i){const s=0|t.worldUpdateCount;if(s<=0)return 0;const n=A.scene?.renderer;if(!n)return 0;const r=n.worldStore.wasm.orderView,a=s<r.length?s:r.length;if(a<=0)return 0;const o=A.casterPools;if(a>o.size+i){const t=hh(e,i,A.casterMeshes),s=!A.matrixStampReady||t[0]!==A.matrixStamp,n=!A.matrixStampReady||t[1]!==A.nearMatrixStamp;return A.matrixStamp=t[0],A.nearMatrixStamp=t[1],A.matrixStampReady=!0,A.stampCoversFrame=!0,s?1|(n?6:0):0}let l=0;for(let c=0;c<a;c++){const A=r[c];o.has(A)&&(l|=3);for(let t=0;t<i;t++){const i=e[t];if(i.poolIndex===A){l|=1,i.headerRole()===Al.Dir&&(l|=4);break}}if(!(6&~l))break}return l}(A,e,d,p);1&t&&(r=!0),6&t&&(a=!0)}if(!r){A.needsEncode=!1;const e=A.nearLive;return A.needsNear=function(A,t,e){if(!A.baseValid)return!1;if(!Bh(A,t))return!1;const i=A.nearLive,s=Qh(A,t),n=Ic(A.baseTexel,s,i)&&Ih(A)+1<=Jr;if(A.nearLive=n,!n)return A.nearTexel=0,A.snapX=Number.POSITIVE_INFINITY,A.snapY=Number.POSITIVE_INFINITY,!1;const r=Qc(A.baseTexel,s,i?A.nearTexel:0),a=!i||r!==A.nearTexel;return A.nearTexel=r,A.nearSlot=6*A.baseTile+1,mh(A,e,Bc),!!Eh(A,zc.x,zc.y,zc.z,a)&&(function(A,t,e){const i=A.shadowTable.dataView.buffer;if(!i)return;const s=4*(4+16*A.nearSlot);if(t.queue.writeBuffer(i,s,Xc.buffer,Xc.byteOffset+s,64),e){const e=1540+4*A.baseTile+1;t.queue.writeBuffer(i,4*e,Xc.buffer,4*e,4)}}(A,e,a),!0)}(A,n,t),void(e!==A.nearLive&&Nh(A,t,s))}if(!A.stampCoversFrame){const t=hh(d,p,g);A.matrixStamp=t[0],A.nearMatrixStamp=t[1],A.matrixStampReady=!0}Ch(A,t,xc),A.cubeMask=0,A.fittedMask=0,A.baseValid=!1;let m=0;for(let C=0;C<p;C++)wh(A,d[C],g,C)&&(m|=1<<C);if(A.fittedMask=m,0===m)return A.viewCount=0,A.nearLive=!1,A.flagged.length>0&&Nh(A,t,s),void(A.needsEncode=!1);!function(A,t,e,i){A.nearViewIndex=-1,Bh(A,e);const s=A.nearLive,n=Qh(A,e),r=A.baseValid&&Ic(A.baseTexel,n,s)&&Ih(A)+1<=Jr;if(A.nearLive=r,!r)return A.nearTexel=0,A.snapX=Number.POSITIVE_INFINITY,void(A.snapY=Number.POSITIVE_INFINITY);const a=Qc(A.baseTexel,n,s?A.nearTexel:0),o=!s||a!==A.nearTexel;A.nearTexel=a,A.nearSlot=6*A.baseTile+1,A.needsNear=Eh(A,zc.x,zc.y,zc.z,i||o),mh(A,t,Bc)}(A,t,n,a),A.atlasGrid=Uc(p),function(A,t){Xc[0]=.002,Xc[1]=1/xc,Xc[2]=.025,Xc[3]=A.atlasGrid;const e=A.shadowTable.dataView.buffer;A.shadowTable.createGPUBuffer(t);const i=A.shadowTable.dataView.buffer;i!==e&&(Rc(A.encodeTable,A.shadowTable),A.passBGs=[],A.instPassBGs=[],A.scene&&A.scene.lightBindEpoch++),t.queue.writeBuffer(i,0,Xc.buffer,0,6416)}(A,t),Nh(A,t,s),function(A){const t=A.atlasGrid,e=A.atlasSize/t,i=A.cubeMask,s=A.fittedMask,n=A.viewSlots,r=A.viewX,a=A.viewY,o=A.viewW,l=A.viewH;let c=0;for(let h=0;h<A.tileCount;h++){if(!(s>>h&1))continue;const A=h%t*e,u=Math.floor(h/t)*e;if(i&1<<h){const t=e/3,i=e/2;for(let e=0;e<6;e++){const s=6*h+e;uh(Dc,24*c,Xc,4+16*s),n[c]=s,r[c]=A+e%3*t,a[c]=u+Math.floor(e/3)*i,o[c]=t,l[c]=i,c++}}else{const t=6*h;uh(Dc,24*c,Xc,4+16*t),n[c]=t,r[c]=A,a[c]=u,o[c]=e,l[c]=e,c++}}if(A.nearViewIndex=-1,A.nearLive&&A.needsNear&&c>0&&c<Jr){const t=A.nearSlot;uh(Dc,24*c,Xc,4+16*t),Mc.set(Dc.subarray(24*c,24*c+24)),n[c]=t,r[c]=0,a[c]=0,o[c]=Bc,l[c]=Bc,A.nearViewIndex=c,c++}A.viewCount=c}(A),A.needsEncode=A.viewCount>0}(this.#wa,A,t,e,i,s)}prepare(A){!function(A,t){if(!A.needsEncode)return void(A.needsNear&&function(A,t){fh(A,t.device);const e=A.src,i=!!e&&e.drawCount>0&&A.batchCap>0&&!!A.cull,s=A.instancedCasters.length>0;i||s?(i&&(A.cull.writeParams(t.device,1,e.drawCount,A.batchCap,A.dstStride),A.cull.writeViews(t.device,Mc)),s&&t.instancedCull.prepareShadow(t.device,1,Mc)):A.needsNear=!1}(A,t));fh(A,t.device);const e=A.src,i=A.dst,s=A.args,n=A.cull;!function(A,t){const e=A.src,i=A.casterMeshes,s=A.jobs,n=A.jobSeen;e.ensureCapacity(Math.max(i.length,1)),s.length=0,n.clear();let r=0;for(let a=0,o=i.length;a<o;a++){const A=i[a];if(!Gh(0,A,t))continue;const o=t.buckets.getMemberForMesh(A).batch;e.write(r,A.poolIndex),r++;const l=o.batchId;l<0||n.has(l)||(n.add(l),s.push(o))}e.setDrawCount(r)}(A,t),function(A,t){const e=A.casterMeshes,i=A.instancedCasters;i.length=0;for(let s=0,n=e.length;s<n;s++){const A=e[s];Yh(0,A,t)&&i.push(A)}}(A,t);const r=t.worldStore,a=Math.max(r.indirectArgs.drawCount,1),o=Math.max(r.instanceIndices.drawCount,1);A.dstStride=o;const l=A.viewCount;!function(A,t){Rh.clear(),Lh.clear();const e=t.worldStore.geometryMeta.cpuView,i=zs,s=A.casterMeshes;for(let c=0,h=s.length;c<h;c++){const A=s[c];if(!A.visible||A.poolIndex<0)continue;if(A.isInstancedDraw)continue;if(!yh(0,A))continue;if(!t.geometryTables.hasGeometry(A.geometry.id))continue;const n=t.buckets.getMemberForMesh(A),r=n?.batch;if(!r||!r.bucket.isMegaPull||r.bucket.wireframe)continue;if(r.base<0||r.segmentCapacity<=0)continue;const a=A.geometry,o=a.boundIndex;if(o<0||(o+1)*i>e.length)continue;const l=jh(16777216*r.batchId+o,a,r.base,r.segmentCapacity);l.n>=l.capacity||(l.pools[l.n]=A.poolIndex,l.n++)}const n=A.pullDraws,r=A.dstStride;let a=0,o=0,l=A.pullFlat;for(const c of Rh.values()){const A=kh[c];if(A.n<=0)continue;let t=Lh.get(A.batchBase)??0;if(t+A.n>A.capacity)continue;if(A.batchBase+t+A.n>r)continue;const s=A.geometry.boundIndex*i,h=e[s+Ls.IndexCount]??0,u=e[s+Ls.VertexCount]??0,g=h>0,d=g?h:u;if(d<=0)continue;Lh.set(A.batchBase,t+A.n);const p=a+A.n;if(l.length<p){const A=new Uint32Array(Math.max(p,2*l.length,256));A.set(l),l=A}for(let e=0;e<A.n;e++)l[a+e]=A.pools[e];let f=n[o];f||(f={geometry:A.geometry,indexed:g,indexCount:d,firstIndex:0,baseVertex:0,origin:0,instances:0,flat:0},n[o]=f),f.geometry=A.geometry,f.indexed=g,f.indexCount=d,f.firstIndex=e[s+Ls.FirstIndex]??0,f.baseVertex=e[s+Ls.BaseVertex]??0,f.origin=A.batchBase+t,f.instances=A.n,f.flat=a,a+=A.n,o++}A.pullFlat=l,A.pullUsed=o}(A,t);const c=e.drawCount>0,h=A.instancedCasters.length>0;if(!c&&0===A.pullUsed&&!h||0===l)return A.needsEncode=!1,void(A.pullUsed=0);if(c){i.ensureCapacity(l*o),s.ensureCapacity(l*a),A.batchCap=a;const c=e.update(t.device),h=i.update(t.device),u=s.update(t.device);!function(A,t,e,i,s){const n=t.worldStore.indirectArgs.cpuView,r=A.args,a=r.cpuView,o=r.gpuBuffer,l=A.jobs,c=t.device;for(let h=0,u=l.length;h<u;h++){const A=l[h];if(A.batchId<0||A.base<0||0===A.count)continue;const t=A.batchId,r=5*t,u=A.indexed;for(let l=0;l<e;l++){const e=l*i+t,h=5*e,g=l*s+A.base>>>0;a[h]=n[r],a[h+1]=0,a[h+2]=n[r+2],u?(a[h+3]=n[r+3],a[h+4]=g):(a[h+3]=g,a[h+4]=0),c.queue.writeBuffer(o,e*fr,a,h,5)}}}(A,t,l,a,o),n.syncShared(r.cullBatches),(c||h||u)&&n.clearBindGroups(),n.writeParams(t.device,l,e.drawCount,a,o),n.writeViews(t.device,Dc),Rc(A.casters,i.binding),A.casters.setCount(i.count,!0),(c||h||u||!A.passBGs[0])&&(A.passBGs=[])}else A.batchCap=a,n.writeViews(t.device,Dc);if(A.pullUsed>0){if(!c){i.ensureCapacity(l*o);const e=i.update(t.device);Rc(A.casters,i.binding),A.casters.setCount(i.count,!0),e&&n.clearBindGroups(),!e&&A.passBGs[0]||(A.passBGs=[])}!function(A,t){const e=A.pullUsed,i=A.dst?.gpuBuffer;if(0===e||!i)return;const s=A.dstStride,n=A.viewCount,r=A.pullDraws,a=A.pullFlat;for(let o=0;o<e;o++){const A=r[o];if(A.origin+A.instances>s)continue;const e=a.subarray(A.flat,A.flat+A.instances);for(let r=0;r<n;r++)t.queue.writeBuffer(i,4*(r*s+A.origin),e)}}(A,t.device)}h&&(t.instancedCull.prepareShadow(t.device,l,Dc),Rc(A.instVisible,t.instancedCull.shadowVisibleBinding),A.instVisible.setCount(t.instancedCull.shadowVisibleBinding.count,!0),A.instPassBGs=[])}(this.#wa,A)}cull(A,t){!function(A,t,e){const i=A.needsEncode;if((i||A.needsNear)&&A.cull&&A.src&&A.src.drawCount>0){const s=i?A.viewCount:1;A.cull.compute(t,e,A.src.drawCount,s*A.batchCap)}}(this.#wa,A,t)}cullInstanced(A,t,e){!function(A,t,e,i){!A.needsEncode&&!A.needsNear||A.instancedCasters.length<=0||i.computeShadow(t,e)}(this.#wa,A,t,e)}encode(A,t){!function(A,t,e){if(A.needsEncode&&!A.atlasView)return;const i=A.needsEncode,s=A.needsNear&&!i;if(!i&&!s)return;const n=A.pullUsed>0,r=A.jobs.length>0&&!!A.args,a=A.instancedCasters.length>0,o=A.nearViewIndex,l=A.nearSize===Bc&&(s||i&&o>=0);if(!r&&!a&&!n)return A.needsEncode=!1,void(A.needsNear=!1);A.needsEncode=!1,A.needsNear=!1;const c=e.pipelineCache;if(A.pipeGen!==c.worldLayoutGen&&(A.pipes.clear(),A.instMeshPipes.clear(),A.instModelPipes.clear(),A.pipeGen=c.worldLayoutGen,A.lastPipe=null,A.lastStride=-1,A.instLastPipe=null,A.instLastStride=-1,A.instLastKind=-1),(r||n)&&function(A,t){A.regShadow||(t.registerDepthKind({material:A.encodeNode,entryWgsl:"\n@vertex fn vs_main(@location(0) position: vec3<f32>, @builtin(instance_index) instanceIndex: u32) -> @builtin(position) vec4<f32> {\n let pool = shadowCasters[instanceIndex];\n let slot = u32(shadowTile);\n return shadowTable.cubeVP[slot] * (worldMatrices[pool] * vec4<f32>(position, 1.0));\n}\n",reservedId:0}),A.regShadow=!0)}(A,c),a&&(!A.regInstMesh||!A.regInstModel)){const t=A.instancedCasters;for(let e=0,i=t.length;e<i&&(Fh(A,c,t[e]),!A.regInstMesh||!A.regInstModel);e++);}if(!r&&!n||A.passBGs[0]||function(A,t){const e=A.passBGs,i=A.tileIdBufs,s=A.encodeNode,n=A.tileIndex.dataView;n.ownsBuffer=!1,n.offset=0,n.size=16;for(let r=0;r<96;r++)n.buffer=i[r],e[r]=t.pipelineCache.createSystemBindGroup(0,s)}(A,e),a&&!A.instPassBGs[0]&&function(A,t){const e=A.instPassBGs,i=A.tileIdBufs,s=A.instEncodeNode,n=A.tileIndex.dataView;n.ownsBuffer=!1,n.offset=0,n.size=16;for(let r=0;r<96;r++)n.buffer=i[r],e[r]=t.pipelineCache.createSystemBindGroup(A.regInstMesh?1:2,s)}(A,e),i){const i=t.beginRenderPass({colorAttachments:[],depthStencilAttachment:{view:A.atlasView,depthClearValue:0,depthLoadOp:"clear",depthStoreOp:"store"}}),s=c.getEmptyBG(),l=c.getCommonSenceBG(void 0,!1,!0);i.setBindGroup(0,s),i.setBindGroup(2,l),A.lastBoundPipe=null;const h=A.args?.gpuBuffer??null,u=A.batchCap,g=o>=0?o:A.viewCount,d=A.jobs,p=A.passBGs,f=A.viewSlots,m=A.viewX,C=A.viewY,w=A.viewW,y=A.viewH;if(1===g&&r&&(i.setViewport(m[0],C[0],w[0],y[0],0,1),i.setBindGroup(1,p[f[0]])),r&&h)for(let t=0,n=d.length;t<n;t++){const s=d[t];if(s.batchId<0||0===s.count)continue;if(!Ph(A,i,e,s.geometry,s.indexed))continue;const n=s.batchId;if(1===g){const A=n*fr;s.indexed?i.drawIndexedIndirect(h,A):i.drawIndirect(h,A);continue}for(let A=0;A<g;A++){i.setViewport(m[A],C[A],w[A],y[A],0,1),i.setBindGroup(1,p[f[A]]);const t=(A*u+n)*fr;s.indexed?i.drawIndexedIndirect(h,t):i.drawIndirect(h,t)}}if(a&&function(A,t,e,i){const s=A.instancedCasters,n=i,r=A.viewSlots,a=A.viewX,o=A.viewY,l=A.viewW,c=A.viewH,h=A.instPassBGs,u=e.instancedCull.shadowArgs.gpuBuffer,g=e.instancedCull.instancedArgsCap,d=e.worldStore.instanceMeta.cpuView,p=e.device;1===n&&(t.setViewport(a[0],o[0],l[0],c[0],0,1),t.setBindGroup(1,h[r[0]]));for(let f=0,m=s.length;f<m;f++){const i=s[f],m=e.buckets.getMemberForMesh(i);if(!m)continue;const C=!!i.geometry.index;if(!Oh(A,t,e,i,C))continue;const w=m.poolIndex;i.syncInstancedObject(w,d[4*w+an.Flags]>>>16)&&i.flushInstancedObject(p);const y=i.cullArgsSlot;if(1===n){const A=y*fr;C?t.drawIndexedIndirect(u,A):t.drawIndirect(u,A);continue}for(let A=0;A<n;A++){t.setViewport(a[A],o[A],l[A],c[A],0,1),t.setBindGroup(1,h[r[A]]);const e=(A*g+y)*fr;C?t.drawIndexedIndirect(u,e):t.drawIndirect(u,e)}}}(A,i,e,g),n){const t=A.viewX,s=A.viewY,n=A.viewW,r=A.viewH,a=A.passBGs,o=A.viewSlots;for(let l=0;l<g;l++){const c=a[o[l]];c&&(i.setViewport(t[l],s[l],n[l],r[l],0,1),i.setBindGroup(1,c),zh(A,i,e,l))}}i.end()}l&&function(A,t,e,i,s,n){const r=A.nearTexView;if(!r||i<0)return;const a=e.pipelineCache,o=t.beginRenderPass({colorAttachments:[],depthStencilAttachment:{view:r,depthClearValue:0,depthLoadOp:"clear",depthStoreOp:"store"}});o.setBindGroup(0,a.getEmptyBG()),o.setBindGroup(2,a.getCommonSenceBG(void 0,!1,!0)),o.setViewport(0,0,Bc,Bc,0,1),A.lastBoundPipe=null;const l=A.nearSlot;if(s){const t=A.args?.gpuBuffer,s=A.passBGs[l];if(t&&s){o.setBindGroup(1,s);const n=A.jobs,r=A.batchCap;for(let s=0,a=n.length;s<a;s++){const a=n[s];if(a.batchId<0||0===a.count)continue;if(!Ph(A,o,e,a.geometry,a.indexed))continue;const l=(i*r+a.batchId)*fr;a.indexed?o.drawIndexedIndirect(t,l):o.drawIndirect(t,l)}}}if(n){const t=A.instPassBGs[l],s=e.instancedCull.shadowArgs.gpuBuffer;if(t&&s){o.setBindGroup(1,t);const n=e.instancedCull.instancedArgsCap,r=A.instancedCasters,a=e.worldStore.instanceMeta.cpuView,l=e.device;for(let t=0,c=r.length;t<c;t++){const c=r[t],h=e.buckets.getMemberForMesh(c);if(!h)continue;const u=!!c.geometry.index;if(!Oh(A,o,e,c,u))continue;const g=h.poolIndex;c.syncInstancedObject(g,a[4*g+an.Flags]>>>16)&&c.flushInstancedObject(l);const d=(i*n+c.cullArgsSlot)*fr;u?o.drawIndexedIndirect(s,d):o.drawIndirect(s,d)}}}if(A.pullUsed>0){const t=A.passBGs[l];t&&(o.setBindGroup(1,t),zh(A,o,e,i))}o.end()}(A,t,e,s?0:o,r,a)}(this.#wa,A,t)}dispose(){!function(A){A.atlas?.destroy(),A.atlas=null,A.atlasView=null,A.dummyAtlas?.destroy(),A.dummyAtlas=null,A.nearTex?.destroy(),A.nearTex=null,A.nearTexView=null,A.nearDummy?.destroy(),A.nearDummy=null,A.shadowTable.dataView.buffer?.destroy();const t=A.tileIdBufs;for(let e=0,i=t.length;e<i;e++)t[e]?.destroy();A.tileIdBufs=[],A.passBGs=[],A.instPassBGs=[],A.src?.dispose(),A.dst?.dispose(),A.args?.dispose(),A.src=A.dst=A.args=null,A.cull?.dispose(),A.cull=null,A.pipes.clear(),A.instMeshPipes.clear(),A.instModelPipes.clear(),A.lastPipe=null,A.instLastPipe=null,A.lastBoundPipe=null}(this.#wa)}}let Kh=null,Vh=null;function Jh(A){return 2.3283064365386963e-10*(((16711935&(A=((252645135&(A=((858993459&(A=((1431655765&(A=(A<<16|A>>>16)>>>0))<<1|(2863311530&A)>>>1)>>>0))<<2|(3435973836&A)>>>2)>>>0))<<4|(4042322160&A)>>>4)>>>0))<<8|(4278255360&A)>>>8)>>>0)}const Wh=new Float32Array(1),qh=new Uint32Array(Wh.buffer);function Xh(A){Wh[0]=A;const t=qh[0],e=t>>>16&32768,i=(t>>>23&255)-127+15;return i<=0?e:i>=31?31744|e:e|i<<10|t>>>13&1023}function Zh(A,t){const e=t*t*.5;return A/Math.max(A*(1-e)+e,1e-7)}function _h(){if(Vh)return Vh;const A={width:1,height:1,mipmaps:[{data:new Uint8Array([0,0,0,255]),width:1,height:1}]};return Vh=new jn([A,A,A,A,A,A],{magFilter:X.Linear,minFilter:X.Linear,mapping:gt.CubeReflectionMapping,formatType:wA.RGBAFormat,dataType:yA.UnNormByteType,generateMipmaps:!1,useMipmaps:!1}),Vh.generateMipmaps=!1,Vh.useMipmaps=!1,Vh}const $h=[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],Au=new WeakMap;function tu(A){const t=A?.mipmaps?.[0]?.data??A?.data;if(!t||1!==t.BYTES_PER_ELEMENT)return null;const e=t,i=e.length/4|0;if(i<=0)return null;let s=0,n=0,r=0;for(let o=0;o<i;o++){const A=4*o;s+=e[A],n+=e[A+1],r+=e[A+2]}const a=1/(255*i);return[s*a,n*a,r*a]}function eu(A,t,e,i){const s=Math.abs(t),n=Math.abs(e),r=Math.abs(i);return s>=n&&s>=r?t>=0?A[0]:A[1]:n>=r?e>=0?A[2]:A[3]:i>=0?A[4]:A[5]}const iu=z.FRAGMENT,su=new wt("SceneParams",[{name:"fogColor",format:"vec3f"},{name:"fogEnabled",format:"f32"},{name:"fogNear",format:"f32"},{name:"fogFar",format:"f32"},{name:"fogDensity",format:"f32"},{name:"fogMode",format:"f32"},{name:"iblIntensity",format:"f32"},{name:"iblMaxLod",format:"f32"}]);su.computeLayout();class nu{sceneParams;samplerBinding;irradiance;radiance;brdfLut;#Yr=null;#ya;#Ba=null;#Ia=null;constructor(){this.sceneParams=new Zt("sceneParams",su,{access:"Uniform",visibility:iu,fixedSlot:2});const A=new rt({magFilter:X.Linear,minFilter:X.Linear,mipmapFilter:X.Linear,wrapS:q.ClampToEdge,wrapT:q.ClampToEdge,wrapR:q.ClampToEdge});this.samplerBinding=new Wt("envSampler",A,{visibility:iu,fixedSlot:3}),this.#ya=_h(),this.irradiance=new qt("envIrradiance",this.#ya,{visibility:iu,fixedSlot:11}),this.radiance=new qt("envRadiance",this.#ya,{visibility:iu,fixedSlot:12}),this.brdfLut=new qt("envBrdfLut",function(){if(Kh)return Kh;const A=new Uint16Array(16384);for(let t=0;t<64;t++){const e=Math.max(t/63,.045);for(let i=0;i<64;i++){const s=Math.max(i/63,.001);let n=0,r=0;const a=Math.sqrt(Math.max(1-s*s,0));for(let A=0;A<32;A++){const t=A/32,i=Jh(A),o=e*e,l=2*Math.PI*t,c=Math.sqrt((1-i)/(1+(o*o-1)*i)),h=Math.sqrt(Math.max(1-c*c,0)),u=Math.cos(l)*h,g=c,d=Math.max(a*u+s*g,0),p=Math.max(2*d*g-s,0),f=Math.max(g,0);if(p<=0)continue;const m=Zh(s,e)*Zh(p,e)*d/Math.max(f*s,1e-5),C=(1-d)**5;n+=(1-C)*m,r+=C*m}const o=1/32,l=4*(64*t+i);A[l]=Xh(n*o),A[l+1]=Xh(r*o),A[l+2]=0,A[l+3]=Xh(1)}}return Kh=new Yn(A,64,64,{magFilter:X.Linear,minFilter:X.Linear,dataType:yA.HalfFloatType,formatType:wA.RGBAFormat}),Kh.flipY=!1,Kh.generateMipmaps=!1,Kh.useMipmaps=!1,Kh}(),{visibility:iu,fixedSlot:13}),this.#Ba=this.#ya,this.#Ia=this.#ya}install(A){this.#Yr=A,A.attachBinding(this.sceneParams),A.attachBinding(this.samplerBinding),A.attachBinding(this.irradiance),A.attachBinding(this.radiance),A.attachBinding(this.brdfLut)}sync(A){const t=this.#Yr;if(!t)return;const e=t.environment,i=e?.isCube?e:this.#ya,s=i===this.#ya?this.#ya:function(A){if(A===_h())return A;const t=Au.get(A);if(t)return t;const e=A.images;if(!Array.isArray(e)||e.length<6)return Au.set(A,A),A;const i=[];for(let r=0;r<6;r++){const t=tu(e[r]);if(!t)return Au.set(A,A),A;i.push(t)}const s=$h.map(A=>function(A,t,e,i){let s=0,n=1;Math.abs(e)>.999&&(s=1,n=0);let r=n*i-0*e,a=0*t-s*i,o=s*e-n*t;const l=Math.hypot(r,a,o)||1;r/=l,a/=l,o/=l;const c=e*o-i*a,h=i*r-t*o,u=t*a-e*r;let g=0,d=0,p=0;for(let m=0;m<48;m++){const s=m/48,n=Jh(m),l=Math.sqrt(1-n),f=Math.sqrt(n),C=2*Math.PI*s,w=Math.cos(C)*f,y=Math.sin(C)*f,B=eu(A,r*w+c*y+t*l,a*w+h*y+e*l,o*w+u*y+i*l);g+=B[0],d+=B[1],p+=B[2]}const f=1/48;return[g*f,d*f,p*f]}(i,A[0],A[1],A[2])),n=function(A){const t=A.map(A=>{const t=Math.min(255,255*A[0]+.5|0),e=Math.min(255,255*A[1]+.5|0),i=Math.min(255,255*A[2]+.5|0);return{width:1,height:1,mipmaps:[{data:new Uint8Array([t,e,i,255]),width:1,height:1}]}}),e=new jn(t,{magFilter:X.Linear,minFilter:X.Linear,mapping:gt.CubeReflectionMapping,formatType:wA.RGBAFormat,dataType:yA.UnNormByteType,generateMipmaps:!1,useMipmaps:!1});return e.generateMipmaps=!1,e.useMipmaps=!1,e}(s);return Au.set(A,n),n}(i);i===this.#Ba&&s===this.#Ia||(this.irradiance.setValue(s),this.radiance.setValue(i),this.#Ba=i,this.#Ia=s,t.lightBindEpoch++),this.irradiance.updateGPUBuffer(A),this.radiance.updateGPUBuffer(A),this.brdfLut.updateGPUBuffer(A);const n=t.fog;let r=0,a=0;i!==this.#ya&&(r=t.environmentIntensity,a=Math.max((0|i.mipLevelCount)-1,0)),this.#da(n,r,a),this.sceneParams.updateCPUBuffer(),this.sceneParams.updateGPUBuffer(A)}dispose(){this.#Ba=null,this.#Ia=null,this.#Yr=null,this.sceneParams.dispose()}#da(A,t,e){const i=this.sceneParams.getFields(),s=i.get("fogColor"),n=s.elements,r=A.color;n[0]===r[0]&&n[1]===r[1]&&n[2]===r[2]||s.fromArray(r);const a=(A,t)=>{const e=i.get(A);e.getValue()!==t&&e.setValue(t)};a("fogEnabled",A.enabled?1:0),a("fogNear",A.near),a("fogFar",A.far),a("fogDensity",A.density),a("fogMode","exp2"===A.mode?1:0),a("iblIntensity",t),a("iblMaxLod",e)}}function ru(A){const t=atob(A),e=t.length,i=new Uint16Array(e>>1);for(let s=0,n=0;s<e;s+=2,n++)i[n]=t.charCodeAt(s)|t.charCodeAt(s+1)<<8;return i}const au=ru("ADwAAAAAUAEAPAAAAAAhEAA8AAAAACEYADwAAAAApRwAPAAAAAAhIAA8AAAAAHMiADwAAAAApSQAPAAAAABSJgA8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50tAADXOXY7XC0AAPg5djsgLQAAGDp2O+gsAAA5OnY7tCwAAFk6djuELAAAejp2O1YsAACaOnY7LCwAALs6djsFLAAA2zp2O8ArAAD8OnY7fCsAABw7djs8KwAAPTt2OwArAABdO3Y7yCoAAH47dTuUKgAAnjt1O2MqAAC/O3U7NSoAAN87dTsKKgAAADw="),lu=z.FRAGMENT;let cu=null,hu=null,uu=null;class gu{ray={origin:new y,direction:new y(0,0,-1)};near=0;far=1e8;firstHitOnly=!1;closestOnly=!0;needUV=!1;needNormal=!1;needBarycoord=!1;lineThreshold=1;camera=null;#Qa=[];#Ea=new v;#xa=new y;setFromCamera(A,t,e){this.camera=e,e.updateWorldMatrix(!0,!1),e.updateProjectionMatrix();const i=e.near,s=e.far;this.near=i??0,this.far=s??1e8;const n=this.#Ea;n.copy(e.projectionMatrix).invert();const r=e.matrixWorld,a=this.ray,o=this.#xa;if(!0===e.isOrthographicCamera)return a.origin.set(A,t,1).applyMatrix4(n).applyMatrix4(r),a.direction.set(0,0,-1).transformDirection(r).normalize(),this;const l=r.data;return a.origin.set(l[12],l[13],l[14]),o.set(A,t,.5).applyMatrix4(n).applyMatrix4(r),a.direction.copy(o).sub(a.origin).normalize(),this}intersectObject(A){const t=this.#Qa;t.length=0,this.closestOnly=!0,this.firstHitOnly=!1,$i();try{A.traverseVisible(A=>{A.hasNodeBind||A.raycast(this,t)})}finally{As()}return t}intersectObjects(A){const t=this.#Qa;t.length=0,this.closestOnly=!0,this.firstHitOnly=!1,$i();try{for(let e=0,i=A.length;e<i;e++)A[e].traverseVisible(A=>{A.hasNodeBind||A.raycast(this,t)})}finally{As()}return t}}let du=1;const pu=new v,fu=new Float32Array(16);function mu(A,t,e,i,s,n){const r=e[i],a=e[i+1],o=e[i+2],l=e[i+3],c=e[i+4],h=e[i+5],u=e[i+6],g=e[i+7],d=e[i+8],p=e[i+9],f=e[i+10],m=e[i+11],C=e[i+12],w=e[i+13],y=e[i+14],B=e[i+15],I=s[n],Q=s[n+1],E=s[n+2],x=s[n+3],D=s[n+4],M=s[n+5],b=s[n+6],S=s[n+7],v=s[n+8],T=s[n+9],U=s[n+10],N=s[n+11],P=s[n+12],O=s[n+13],F=s[n+14],k=s[n+15];A[t]=r*I+c*Q+d*E+C*x,A[t+1]=a*I+h*Q+p*E+w*x,A[t+2]=o*I+u*Q+f*E+y*x,A[t+3]=l*I+g*Q+m*E+B*x,A[t+4]=r*D+c*M+d*b+C*S,A[t+5]=a*D+h*M+p*b+w*S,A[t+6]=o*D+u*M+f*b+y*S,A[t+7]=l*D+g*M+m*b+B*S,A[t+8]=r*v+c*T+d*U+C*N,A[t+9]=a*v+h*T+p*U+w*N,A[t+10]=o*v+u*T+f*U+y*N,A[t+11]=l*v+g*T+m*U+B*N,A[t+12]=r*P+c*O+d*F+C*k,A[t+13]=a*P+h*O+p*F+w*k,A[t+14]=o*P+u*O+f*F+y*k,A[t+15]=l*P+g*O+m*F+B*k}class Cu{id=du++;bones;inverseBindMatrices;boneMatrices;version=0;poseDirty=!0;#Da;#Ma;constructor(A,t){const e=A.length;this.bones=A;const i=t??new Float32Array(16*e);if(i.length<16*e)throw new Error(`Skeleton: inverseBindMatrices length ${i.length} < ${16*e}`);if(!t)for(let s=0;s<e;s++){const A=16*s;i[A]=1,i[A+5]=1,i[A+10]=1,i[A+15]=1}this.inverseBindMatrices=i,this.boneMatrices=new Float32Array(16*e),this.#Da=new Float32Array(16),this.#Ma=new Float32Array(16*e);for(let s=0;s<e;s++)A[s].poseSkeleton=this}needsPaletteSync(A){if(this.poseDirty)return!0;const t=f.UPLOAD_DIRTY;if(null==A.worldStore||0!==(A.dirtyTypes[0]&t))return!0;const e=this.bones;for(let i=0,s=e.length;i<s;i++){const A=e[i];if(null==A.worldStore||0!==(A.dirtyTypes[0]&t))return!0}return!1}consumePose(){this.poseDirty=!1;const A=~f.UPLOAD_DIRTY,t=this.bones;for(let e=0,i=t.length;e<i;e++)t[e].dirtyTypes[0]&=A}get boneCount(){return this.bones.length}updatePalette(A){const t=this.bones,e=t.length,i=A.readMatrixWorld(),s=i.elements,n=this.#Da,r=this.#Ma;let a=this.poseDirty;if(!a)for(let h=0;h<16;h++)if(n[h]!==s[h]){a=!0;break}if(!a)for(let h=0;h<e;h++){const A=t[h].readMatrixWorld().elements,e=16*h;for(let t=0;t<16;t++)if(r[e+t]!==A[t]){a=!0;break}if(a)break}if(!a)return!1;n.set(s),pu.copy(i).invert();const o=pu.elements,l=this.inverseBindMatrices,c=this.boneMatrices;for(let h=0;h<e;h++){const A=t[h].readMatrixWorld().elements,e=16*h;r.set(A,e),mu(fu,0,o,0,A,0),mu(c,e,fu,0,l,e)}return this.version++,!0}}const wu=new v,yu=new v,Bu=new y,Iu=new y,Qu=new v,Eu=new v,xu=new v,Du=new v,Mu=new v,bu=new v,Su=new v,vu=new y,Tu=new y,Uu=new y,Nu=new y,Pu=new y,Ou=new y,Fu=new y,ku=new y;class Ru extends Os{type="InstancedModelPart";isInstancedDraw=!0;hasNodeBind=!0;bindingStartIndex=0;instanceMatrix;#is;#ba;#ss;#ns={object:null,visible:null,visSize:0,mats:null,matsOff:0,matsSize:0,f32:null,f32Off:0,f32Size:0};#Sa;cullArgsSlot=-1;cullVisibleBase=0;get matrixEpoch(){return this.#Sa.matrixEpoch}#rs=-1;#as=-1;#va=-1;#os=0;#ls=0;#cs=0;#Ta=new Float32Array(16);constructor(A,t,e,i,s){super(A,t),this.#Sa=s,this.count=Math.max(1,0|e);const n=i.getAttribute("instanceMatrix");if(!n)throw new Error("InstancedModelPart: shared vertexStreams must contain instanceMatrix");this.instanceMatrix=n,this.vertexStreams=i;const r=z.VERTEX,a=new zt("poolIndex",0,"u32",{access:"Uniform",visibility:r}),o=new zt("clipPacked",65535,"u32",{access:"Uniform",visibility:r}),l=new zt("handlePool",0,"u32",{access:"Uniform",visibility:r}),c=new zt("visibleBase",0,"u32",{access:"Uniform",visibility:r}),h=new zt("matVec4Base",0,"u32",{access:"Uniform",visibility:r}),u=new zt("colorF32Base",0,"u32",{access:"Uniform",visibility:r}),g=new zt("colorStride",0,"u32",{access:"Uniform",visibility:r}),d=new zt("_cullPad0",0,"u32",{access:"Uniform",visibility:r}),p=new Jt("nodeBind",(new v).identity(),"f32",{access:"Uniform",visibility:r});this.#ba=p;const f=this.#Ta;f[0]=1,f[5]=1,f[10]=1,f[15]=1,this.#is=new Xt("instancedObject",[a,o,l,c,h,u,g,d,p],{access:"Uniform",mode:"struct",visibility:r}),this.addBinding(this.#is,!1),this.#ss=Da(),this.addBinding(this.#ss.visible,!1),this.addBinding(this.#ss.mats,!1),this.addBinding(this.#ss.f32,!1)}getCullHandle(){return this.#Sa}expandWorldAABB(A,t){return this.#Sa.expandWorldAABB(A,t)}get instanceColor(){return this.vertexStreams?.getAttribute("instanceColor")??null}attachInstancedStorage(A,t,e,i,s,n,r){Ma(this.#ss,this.#ns,A,t,e,i,s,n,r)}setInstancedCullLookups(A,t,e,i){this.cullVisibleBase=A>>>0,this.#os=t>>>0,this.#ls=e>>>0,this.#cs=i>>>0,this.#rs=-1}setNodeBind(A){const t=A.elements,e=this.#Ta;return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]||(e.set(t),this.#ba.setValue(A)),this}syncInstancedObject(A,t){this.#Sa.commitDrawState();const e=this.#Sa.poolIndex;return this.#rs===A&&this.#as===t&&this.#va===e?this.#is.isDirty:(this.#rs=A,this.#as=t,this.#va=e,this.#is.setValue({poolIndex:A,clipPacked:t,handlePool:e,visibleBase:this.cullVisibleBase,matVec4Base:this.#os,colorF32Base:this.#ls,colorStride:this.#cs}),!0)}flushInstancedObject(A){const t=this.#is;t.updateCPUBuffer(),t.updateGPUBuffer(A)}getBindGroupCacheToken(){const A=this.#is.dataView.buffer??null;return this.#ns.object!==A&&(this.#ns.object=A),this.#ns}#hs=0;#us=0;#gs=0;#ds=0;#ps=-1;#fs=Number.NaN;#ms=Number.NaN;#Cs=Number.NaN;#ws=Number.NaN;raycast(A,t){if(null==this.material)return;const e=this.geometry,i=e.boundingBox??e.computeBoundingBox();if(!i)return;this.#Sa.commitDrawState();const s=this.#Sa.matrixWorld,n=this.#Ta,r=i.center.x,a=i.center.y,o=i.center.z,l=i.center.w;Ca(n,0,r,a,o,ku);const c=ku.x,h=ku.y,u=ku.z,g=l*ma(n,0),d=this.count,p=this.instanceMatrix,f=p.view,m=p.stride,C=p.typeInfo?.offset??0;this.#ys(f,m,C,d,c,h,u,g);const w=A.ray.origin,y=A.ray.direction,B=A.near,I=A.far-B,Q=I*I;Bu.set(this.#hs,this.#us,this.#gs),Bu.applyMatrix4(s);const E=this.#ds*ma(s.elements,0);if(vu.copy(w),vu.x+=y.x*B,vu.y+=y.y*B,vu.z+=y.z*B,Bu.distanceToSquared(vu)>E*E){if(null===Ia(vu,y,Bu,E,Tu))return;if(vu.distanceToSquared(Tu)>Q)return}Qu.copy(s).invert(),Uu.copy(w).applyMatrix4(Qu),Nu.copy(y).transformDirection(Qu),Pu.copy(Nu).normalize(),Mu.fromArray(n);const x=!(1===(D=n)[0]&&0===D[1]&&0===D[2]&&0===D[3]&&0===D[4]&&1===D[5]&&0===D[6]&&0===D[7]&&0===D[8]&&0===D[9]&&1===D[10]&&0===D[11]&&0===D[12]&&0===D[13]&&0===D[14]&&1===D[15]);var D;x&&bu.copy(Mu).invert();const M=!1!==A.firstHitOnly&&!0!==A.closestOnly,b=e.boundingBox;$i();try{for(let e=0;e<d;e++){const i=C+e*m;let n;if(fa(f,i)){const A=f[i+12],t=f[i+13],e=f[i+14];if(ku.set(c+A,h+t,u+e),!Sa(Uu,Pu,ku,g))continue;if(Ou.set(Uu.x-A,Uu.y-t,Uu.z-e),Fu.copy(Nu),x&&(Ou.applyMatrix4(bu),Fu.transformDirection(bu)),null!=b&&!Qa(Ou,Fu,b))continue;0===A&&0===t&&0===e?n=s:(Ba(s,A,t,e,Du),n=Du)}else{const A=ma(f,i);if(0===A)continue;if(Ca(f,i,c,h,u,ku),!Sa(Uu,Pu,ku,g*A))continue;if(xu.fromArray(f,i).invert(),Ou.copy(Uu).applyMatrix4(xu),Fu.copy(Nu).transformDirection(xu),x&&(Ou.applyMatrix4(bu),Fu.transformDirection(bu)),null!=b&&!Qa(Ou,Fu,b))continue;Eu.fromArray(f,i),Du.multiplyMatrices(s,Eu),n=Du}x&&(Su.multiplyMatrices(n,Mu),n=Su);const r=t.length;if(this._computeIntersections(A,t,Ou,Fu,n,e),M&&t.length>r)return}}finally{As()}}#ys(A,t,e,i,s,n,r,a){if(this.#ps===this.matrixEpoch&&s===this.#ms&&n===this.#Cs&&r===this.#ws&&a===this.#fs)return;const o=ya(A,t,e,i,s,n,r,a);this.#hs=o.cx,this.#us=o.cy,this.#gs=o.cz,this.#ds=o.cr,this.#ms=s,this.#Cs=n,this.#ws=r,this.#fs=a,this.#ps=this.matrixEpoch}}function Lu(A,t,e,i,s,n,r){if(A.isInstancedMesh||A.isInstancedModel)throw new Error("InstancedModel: source must not contain InstancedMesh or InstancedModel");if(A.isLight||A.isCamera)throw new Error("InstancedModel: source must not contain Light or Camera");let a;if(A.isMesh){const s=A,o=new Ru(s.geometry,s.material,i,t,e);!function(A,t){A.position.copy(t.position),A.quaternion.copy(t.quaternion),A.scale.copy(t.scale)}(o,s),o.name=s.name,o.castShadow=s.castShadow,o.visible=s.visible;const l=s.morphTargetInfluences;l&&l.length>0&&o.setMorphInfluences(l),s.morphTargetDictionary&&(o.morphTargetDictionary={...s.morphTargetDictionary}),s.skeleton&&r.push({part:o,src:s}),n.push(o),a=o}else a=new Mi,a.copy(A,!1);s.set(A,a);const o=A.children;for(let l=0,c=o.length;l<c;l++){const A=o[l];A.isLight||A.isCamera||a.add(Lu(A,t,e,i,s,n,r))}return a}function ju(A,t){let e=A;for(;null!==e&&e!==t;){if(!e.visible)return!1;e=e.parent}return e===t}const zu=new v,Gu=new y,Yu=new y,Hu=new y,Ku=new y,Vu=new y,Ju=new y,Wu=new y,qu=new y,Xu=new y,Zu=new y;function _u(A,t,e){const i=A.getAttribute("lineDistance");if(i&&i.count===t&&1===i.stride&&"f32"===i.typeInfo.wgslType&&i.view.length>=t)return e(i.view),void(i.isDirty||i.onChangeCallback());const s=new Float32Array(t);e(s),A.setAttribute("lineDistance",new Fi(s,1))}class $u extends Os{type="Line";topology=G.LineStrip;isLine=!0;isLineSegments=!1;computeLineDistances(){const A=this.geometry;if(null!=A.getIndex())return console.warn("Line.computeLineDistances(): 只支持无索引几何。"),this;const t=A.getAttribute("position");if(!t)return this;const e=t.count;return _u(A,e,A=>{A[0]=0;for(let i=1;i<e;i++){const e=t.getX(i-1),s=t.getY(i-1),n=t.getZ(i-1),r=t.getX(i)-e,a=t.getY(i)-s,o=t.getZ(i)-n;A[i]=A[i-1]+Math.hypot(r,a,o)}}),this}raycast(A,t){const e=this.geometry,i=e.getAttribute("position");if(!i||i.count<2)return;const s=this.matrixWorld,n=A.lineThreshold??1,r=e.boundingBox??e.computeBoundingBox();if(!r)return;const a=r.center;Zu.set(a.x,a.y,a.z).applyMatrix4(s);const o=a.w*s.getMaxScaleOnAxis()+n;if(function(A,t,e,i){const s=e.x-A.x,n=e.y-A.y,r=e.z-A.z,a=s*t.x+n*t.y+r*t.z,o=s*s+n*n+r*r,l=i*i;return o-a*a>l||a<0&&o>l}(A.ray.origin,A.ray.direction,Zu,o))return;zu.copy(s).invert(),Gu.copy(A.ray.origin).applyMatrix4(zu),Yu.copy(A.ray.direction).transformDirection(zu);const l=function(A){const t=A.data;return(Math.hypot(t[0],t[1],t[2])+Math.hypot(t[4],t[5],t[6])+Math.hypot(t[8],t[9],t[10]))/3}(s),c=n/(l>1e-8?l:1),h=c*c,u=e.index,g=e.drawRange,d=Math.max(0,0|g.start),p=(u?u.count:i.count)-d,f=Number.isFinite(g.count)?0|g.count:p,m=d+(f<0?0:f>p?p:f),C=this.isLineSegments?2:1,w=!0===A.closestOnly,y=!1!==A.firstHitOnly&&!w;let B=w&&t.length>0?t[0].distance:A.far;for(let I=d;I<m-1;I+=C){const e=u?Ag(u,I):I,i=u?Ag(u,I+1):I+1;if(this.getVertexPosition(e,Hu),this.getVertexPosition(i,Ku),tg(Gu,Yu,Hu,Ku,qu,Xu)>h)continue;qu.applyMatrix4(s);const n=A.ray.origin.distanceTo(qu);if(!(n<A.near||n>A.far||n>B)){if(Xu.applyMatrix4(s),w){const A=t[0];A?(A.object=this,A.point.copy(Xu),A.distance=n,A.index=I,A.face=void 0,A.faceIndex=void 0,A.uv=void 0,A.normal=void 0,A.barycoord=void 0,A.instanceId=void 0):t.push({object:this,point:Xu.clone(),distance:n,index:I}),B=n;continue}if(t.push({object:this,point:Xu.clone(),distance:n,index:I}),y)return}}}}function Ag(A,t){const e=0|A.typeInfo.offset;return A.view[t*A.stride+e]}function tg(A,t,e,i,s,n){Vu.copy(e).add(i).multiplyScalar(.5),Ju.copy(i).sub(e);const r=.5*Ju.length();if(0===r)return function(A,t,e,i,s){const n=e.x-A.x,r=e.y-A.y,a=e.z-A.z,o=Math.max(0,n*t.x+r*t.y+a*t.z);i.set(A.x+t.x*o,A.y+t.y*o,A.z+t.z*o),s.copy(e);const l=e.x-i.x,c=e.y-i.y,h=e.z-i.z;return l*l+c*c+h*h}(A,t,e,s,n);Ju.normalize(),Wu.copy(A).sub(Vu);const a=-t.dot(Ju),o=Wu.dot(t),l=-Wu.dot(Ju),c=Wu.lengthSq(),h=Math.abs(1-a*a);let u,g,d;if(h>0){u=a*l-o,g=a*o-l;const A=r*h;if(u>=0)if(g>=-A)if(g<=A){const A=1/h;u*=A,g*=A,d=u*(u+a*g+2*o)+g*(a*u+g+2*l)+c}else g=r,u=Math.max(0,-(a*g+o)),d=-u*u+g*(g+2*l)+c;else g=-r,u=Math.max(0,-(a*g+o)),d=-u*u+g*(g+2*l)+c;else g<=-A?(u=Math.max(0,-(-a*r+o)),g=u>0?-r:Math.min(Math.max(-r,-l),r),d=-u*u+g*(g+2*l)+c):g<=A?(u=0,g=Math.min(Math.max(-r,-l),r),d=g*(g+2*l)+c):(u=Math.max(0,-(a*r+o)),g=u>0?r:Math.min(Math.max(-r,-l),r),d=-u*u+g*(g+2*l)+c)}else g=a>0?-r:r,u=Math.max(0,-(a*g+o)),d=-u*u+g*(g+2*l)+c;return s.copy(A),s.x+=t.x*u,s.y+=t.y*u,s.z+=t.z*u,n.copy(Vu),n.x+=Ju.x*g,n.y+=Ju.y*g,n.z+=Ju.z*g,d<0?0:d}const eg=new WeakSet,ig=new WeakMap;class sg extends Wi{onChangeCallback(A){ig.get(this)?.(),super.onChangeCallback(A)}}class ng extends $u{type="LineLoop";isLineLoop=!0;#Ua=null;#Na=null;#Pa=null;#Oa=!1;#Fa=-1;#ka=-1;#Ra=-1;#La=0;#ja=1/0;constructor(A,t){super(A,t),eg.add(this),this.#za(A)}get geometry(){return super.geometry}set geometry(A){eg.has(this)?this.#za(A):super.geometry=A}onChangeCallback(A){eg.has(this)&&!this.#Oa&&A&(f.DIRTY_STRUCTURE|f.DIRTY_DATA|f.DIRTY_INDEX)&&this.#Ga(),super.onChangeCallback(A)}dispose(){this.#Ya(),eg.delete(this),super.dispose()}#v(A){super.geometry=A}#Ya(){const A=this.#Ua,t=this.#Na;A&&A.depObjects.delete(this.weakSelf),this.#Pa&&t&&this.#Pa.depObjects.delete(t.weakSelf),t&&ig.delete(t),this.#Ua=null,this.#Pa=null}#za(A){if(!this.#Oa)if(this.#Na!==A&&this.#Ua!==A){this.#Oa=!0;try{if(this.#Ya(),og(A))return this.#Na=null,void this.#v(A);const t=this.#Na??new sg;this.#Na=t,this.#Ua=A,ig.set(t,()=>this.#Ga()),this.#Ha(A,t),this.#Ka(A,t),this.#Va(A,t),this.#v(t),A.depObjects.add(this.weakSelf)}finally{this.#Oa=!1}}else this.#Ga()}#Ga(){if(this.#Oa)return;const A=this.#Ua,t=this.#Na;if(!A||!t)return;if(og(A)){this.#Oa=!0;try{this.#Ya(),this.#Na=null,this.#v(A)}finally{this.#Oa=!1}return}const e=A.getAttribute("position");if(t.getAttribute("position")!==e||A.attributes.size!==t.attributes.size){this.#Oa=!0;try{this.#Ha(A,t)}finally{this.#Oa=!1}}const i=rg(A);if(A.index!==this.#Pa||!this.#Ja(i)){this.#Oa=!0;try{this.#Ka(A,t),this.#Va(A,t)}finally{this.#Oa=!1}}}#Ha(A,t){t.name=A.name;const e=[];for(const i of t.attributes.keys())A.attributes.has(i)||e.push(i);for(let i=0;i<e.length;i++)t.deleteAttribute(e[i]);for(const[i,s]of A.attributes)t.getAttribute(i)!==s&&t.setAttribute(i,s);if(A.morphAttributes.size!==t.morphAttributes.size){t.morphAttributes.clear();for(const[e,i]of A.morphAttributes)t.morphAttributes.set(e,i);t.morphTargetsRelative=A.morphTargetsRelative}if(A.morphNormals.size!==t.morphNormals.size){t.morphNormals.clear();for(const[e,i]of A.morphNormals)t.morphNormals.set(e,i)}}#Ka(A,t){const e=A.index,i=this.#Pa;i!==e&&(i&&i.depObjects.delete(t.weakSelf),e&&e.depObjects.add(t.weakSelf),this.#Pa=e)}#Va(A,t){const e=rg(A),i=ag(A),s=i.end-i.start,n=s+1;let r=0;const a=A.index;if(i.indexed&&a)for(let c=i.start;c<i.end;c++){const A=lg(a,c);A>r&&(r=A)}else i.end>0&&(r=i.end-1);const o=r>=65535,l=o?new Uint32Array(n):new Uint16Array(n);if(i.indexed&&a)for(let c=0;c<s;c++)l[c]=lg(a,i.start+c);else for(let c=0;c<s;c++)l[c]=i.start+c;l[s]=l[0],o?t.setIndex(new Oi(l,1)):t.setIndex(new Pi(l,1,!1,!0)),0===t.drawRange.start&&t.drawRange.count===1/0||t.setDrawRange(0,1/0),this.#Fa=e.posCount,this.#ka=e.indexCount,this.#Ra=e.indexSerial,this.#La=e.drawStart,this.#ja=e.drawCount}#Ja(A){return this.#Fa===A.posCount&&this.#ka===A.indexCount&&this.#Ra===A.indexSerial&&this.#La===A.drawStart&&this.#ja===A.drawCount}}function rg(A){const t=A.getAttribute("position"),e=A.index;return{posCount:t?.count??0,indexCount:e?e.count:-1,indexSerial:e?e.serial??0:0,drawStart:A.drawRange.start,drawCount:A.drawRange.count}}function ag(A){const t=A.drawRange,e=Math.max(0,0|t.start),i=A.index,s=A.getAttribute("position"),n=(i?i.count:s?.count??0)-e,r=Number.isFinite(t.count)?0|t.count:n;return{start:e,end:e+(r<0?0:r>n?n:r),indexed:null!=i}}function og(A){const t=ag(A);if(t.end-t.start<2)return!0;if(!t.indexed)return!1;const e=A.index;return!!e&&lg(e,t.start)===lg(e,t.end-1)}function lg(A,t){const e=0|A.typeInfo.offset;return A.view[t*A.stride+e]}class cg extends $u{type="LineSegments";topology=G.LineList;isLineSegments=!0;computeLineDistances(){const A=this.geometry;if(null!=A.getIndex())return console.warn("LineSegments.computeLineDistances(): 只支持无索引几何。"),this;const t=A.getAttribute("position");if(!t)return this;const e=t.count;return _u(A,e,A=>{const i=-2&e;let s=0;for(let e=0;e<i;e+=2){const i=t.getX(e),n=t.getY(e),r=t.getZ(e),a=t.getX(e+1)-i,o=t.getY(e+1)-n,l=t.getZ(e+1)-r;A[e]=s,s+=Math.hypot(a,o,l),A[e+1]=s}i<e&&(A[i]=s)}),this}}class hg extends Os{type="Points";topology=G.PointList}const ug=new v,gg=new y,dg=new y,pg=new y,fg=new y,mg=new y,Cg=new y,wg=new y,yg=new y,Bg=new y,Ig=new y,Qg=new y,Eg=new y,xg=new y,Dg=new y;let Mg=null;function bg(){if(Mg)return Mg;const A=new Wi;return A.name="Sprite",A.setAttribute("position",new Fi(new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),3)),A.setAttribute("uv",new Fi(new Float32Array([0,0,1,0,1,1,0,1]),2)),A.setIndex(new Pi(new Uint16Array([0,1,2,0,2,3]),1,!1,!0)),Mg=A,A}function Sg(A,t,e,i,s){const n=e*t;A[n]=i,A[n+1]=s,A[n+2]=0}function vg(A,t,e,i,s,n,r,a){let o=A.getX(t)*e,l=A.getY(t)*i;if(1!==s||0!==n){const A=n*o+s*l;o=s*o-n*l,l=A}a.set(r.x+o,r.y+l,r.z)}function Tg(A,t,e,i,s,n){Ig.copy(i).sub(e),Qg.copy(s).sub(e),Eg.crossVectors(Ig,Qg);let r,a=t.dot(Eg);if(a>0)r=1;else{if(!(a<0))return null;r=-1,a=-a}xg.copy(A).sub(e),Dg.crossVectors(xg,Qg);const o=r*t.dot(Dg);if(o<0)return null;const l=r*t.dot(Ig.cross(xg));if(l<0)return null;if(o+l>a)return null;const c=-r*xg.dot(Eg);if(c<0)return null;const h=c/a;return n.set(A.x+t.x*h,A.y+t.y*h,A.z+t.z*h),h}function Ug(A){const t=A.name,e=A.access?.key??"u";if(A.isSampledTexture)return`${t}:texHandle:u32:${e}`;if(A.isSampler)return`${t}:sampHandle:u32:${e}`;if(A.isStorageTexture)return`${t}:stex:${A.typeInfo?.format??"u"}:${e}`;if(A.isStructBinding){const i=A.getFields(),s=[];for(const A of i.values())s.push(Ug(A));s.sort();const n=A.isDynamicArray?"d":A.isArray?`a${A.count}`:"v";return`${t}:struct{${s.join(";")}}:${n}:${e}`}const i=A.isDynamicArray?"d":A.isArray?`a${A.count}`:"v";return`${t}:${A.typeInfo?.format??"u"}:${i}:${e}`}class Ng extends Rn{type="Material";_bindingLayoutKey="";isSupportFamily;needsLegacyBootstrap=!1;injectWgslFragment="";_vertexDisplaceWgsl="";_extraVaryings=[];get vertexDisplaceWgsl(){return this._vertexDisplaceWgsl}set vertexDisplaceWgsl(A){const t=(A??"").trim();t!==this._vertexDisplaceWgsl&&(this._vertexDisplaceWgsl=t,this.onChangeCallback(f.DIRTY_STRUCTURE))}get extraVaryings(){return this._extraVaryings}set extraVaryings(A){const t=A??[],e=this._extraVaryings;if(t.length===e.length){let A=!0;for(let i=0;i<t.length;i++){const s=t[i],n=e[i];if(s.name!==n.name||s.type!==n.type||s.assign!==n.assign){A=!1;break}}if(A)return}this._extraVaryings=t.length?t.slice():[],this.onChangeCallback(f.DIRTY_STRUCTURE)}dirtySystem=null;_dirtySlot=-1;gpuRetired=!1;gpuUseCount=0;_colorBinding;get color(){return this._colorBinding.getValue()}set color(A){this._colorBinding.setValue(A)}_transparent=!1;get transparent(){return this._transparent}set transparent(A){A!==this._transparent&&(this._transparent=A,this.onChangeCallback(f.DIRTY_PIPELINE))}_vertexColors=!1;get vertexColors(){return this._vertexColors}set vertexColors(A){A!==this._vertexColors&&(this._vertexColors=A,this.onChangeCallback(f.DIRTY_PIPELINE))}_mapTextureBinding;_mapSamplerBinding;get map(){return this._mapTextureBinding.getValue()}set map(A){null!=A&&A.assertCompatibleSampler(A.sampler),this._mapTextureBinding.setValue(A),this._mapSamplerBinding.setValue(A?.sampler??null)}constructor(A,t){super(t),this.isSupportFamily=!0===t?.isSupportFamily;const e=new Vt("color",void 0,void 0,{access:"Uniform"}),i=new Xt("material",[e],{access:"Uniform",mode:"struct"});this._colorBinding=e,this._mapTextureBinding=new qt("map",A?.map??null),this._mapSamplerBinding=new Wt("mapSampler",A?.map?.sampler??null),this.addBinding(this._mapTextureBinding),this.addBinding(this._mapSamplerBinding),this.addBinding(i),new.target===Ng&&this.setValues(A)}copy(A){this.isSupportFamily=A.isSupportFamily,super.copy(A),this.color.copy(A.color),this.map=A.map,this.transparent=A.transparent,this.vertexColors=A.vertexColors,this.vertexDisplaceWgsl=A.vertexDisplaceWgsl,this.extraVaryings=A.extraVaryings,this.setInjectHeadWgsl(A.injectWgslFragment);const t=A.getBinding("material"),e=this.getBinding("material");for(const[i,s]of t.getFields()){if("color"===i)continue;const A=e.getField(i);if(!A)continue;const t=s.getValue();"number"==typeof t||"boolean"==typeof t?A.setValue(t):null!=t&&"function"==typeof A.getValue()?.copy&&A.getValue().copy(t)}return this}dispose(){if(this.dirtySystem?.removeMaterial(this),this.dirtySystem=null,this.gpuRetired=!0,!(this.gpuUseCount>0))for(const A of this.getBindings().values())A.releaseOwnedGpuBuffer?.()}onDrawGpuUseDropped(){if(this.gpuUseCount>0&&this.gpuUseCount--,this.gpuRetired&&0===this.gpuUseCount)for(const A of this.getBindings().values())A.releaseOwnedGpuBuffer?.()}setInjectHeadWgsl(A){A!==this.injectWgslFragment&&(this.injectWgslFragment=A,this.onChangeCallback(f.DIRTY_STRUCTURE))}getBindingLayoutKey(){if(this._bindingLayoutKey)return this._bindingLayoutKey;const A=[];for(const t of this.getBindings().values())t.isStorageTexture||(!t.isSkipBinding()||t.isSampledTexture||t.isSampler)&&A.push(Ug(t));return A.sort(),this._bindingLayoutKey=A.join("|"),this._bindingLayoutKey}getCacheKey(){const A=this._cacheKey;if(A)return A;const t=[],e=[];for(const[C,w]of this._features)e.push(`${C}=${w}`);for(const[C,w]of this._defines)t.push(`${C}=${w}`);t.sort(),e.sort();const i=t.join(";"),s=e.join(";"),n=this._transparent?"b":"o",r=this._wireframe?"w":"f",a=this._depthTest?this._depthCompare??"greater":"always",o=this._depthOffset?`${this._depthBias},${this._depthBiasSlopeScale},${this._depthBiasClamp}`:"0",l=this._stencilFront,c=this._stencilBack,h=this._stencilWrite?`${l.compare},${l.failOp??"keep"},${l.depthFailOp??"keep"},${l.passOp??"keep"}|${c.compare},${c.failOp??"keep"},${c.depthFailOp??"keep"},${c.passOp??"keep"}|${this._stencilReadMask},${this._stencilWriteMask}`:"0",u=this.injectWgslFragment?ze(this.injectWgslFragment):0;let g="",d="";for(const C of this.getBindings().values())(C.isSampledTexture||C.isSampler)&&(g+=C.isSkipBinding()?"0":"1"),d+=C.shaderIoCacheKey();const p=this._vertexColors?1:0;let f="";this._vertexDisplaceWgsl&&(f+=`|vd:${ze(this._vertexDisplaceWgsl)}`);const m=this._extraVaryings;if(m.length>0){let A="";for(let t=0;t<m.length;t++){const e=m[t];A+=`${e.name}:${e.type}:${e.assign};`}f+=`|vy:${ze(A)}`}return this._cacheKey=`${this.type}|${i}|ft:${s}|${this.side}|${n}|${r}|${this.depthWrite?1:0}|${a}|do:${o}|st:${h}|ac:${this.alphaToCoverage?1:0}|vc:${p}|wgsl:${u}|ts:${g}|sk:${this._shaderKey}|bg:${this.getBindingLayoutKey()}${d?`|io:${d}`:""}${f}`,this._cacheKey}getCullMode(){switch(this.side){case"front":return"back";case"back":return"front";case"double":return"none"}}registerStructField(A,t){this.getBinding("material").addField(t),this.setProperty(A,t,!1)}update(A,t){const e=-1!==this._dirtySlot;for(const[,i]of this.getBindings())i.isDirty&&!i.isSkipBinding()&&(i.updateCPUBuffer(),i.updateGPUBuffer(A));t?.writeActiveRow(this),(e||-1===this._dirtySlot)&&(this.dirtyTypes&=-424961)}ensureLegacyUploaded(A,t){if(this.needsLegacyBootstrap){for(const[,t]of this.getBindings()){if(t.isSkipBinding())continue;const e=t;if(e.isSampledTexture){const t=e.getValue?.();t&&(t.isDirty=!0,t.ensureUploaded?.(A));continue}e.isSampler||e.isStorageTexture||(e.isDirty=!0,e.updateCPUBuffer()),e.updateGPUBuffer?.(A)}this.needsLegacyBootstrap=!1,t?.writeActiveRow(this,!0),this.dirtyTypes&=-424961}else this.update(A,t)}getBindGroupCacheToken(){return this.version}onChangeCallback(A){if(A&f.DIRTY_STRUCTURE?(this._cacheKey="",this._bindingLayoutKey="",this.version++):A&f.DIRTY_PIPELINE&&(this._cacheKey=""),this.dirtyTypes&A&&-1!==this._dirtySlot)return;this.dirtyTypes|=A;const t=this.depObjects,e=this.dirtyTypes&(f.DIRTY_STRUCTURE|f.DIRTY_PIPELINE);if(A&f.DIRTY_DATA&&!e){if(!this.dirtySystem)return;if(0===t.size)return void(this.dirtySystem=null);let A=!1;for(const e of t){const i=e.deref();if(null!=i){if(i.dirtySystem){A=!0;break}}else t.delete(e)}return void(A?this.dirtySystem.addMaterial(this):this.dirtySystem=null)}this.dirtySystem?.removeMaterial(this);for(const i of t){const e=i.deref();null!=e?e.onChangeCallback(A):t.delete(i)}}}const Pg=()=>"\n@vertex fn vertexMain() -> VertexOutput {\n let center = worldMatrix * vec4f(0.0, 0.0, 0.0, 1.0);\n let clip = camera.viewProjectionMatrix * center;\n let scale = 0.5 * max(camera.viewport.y, 1.0);\n var depth = max(material.sizeAttenuationRef, 1e-3);\n if (material.sizeAttenuation > 0.5) {\n depth = max(-(camera.viewMatrix * center).z, 1e-3);\n }\n var pixelSize = material.size * (scale / depth);\n if (material.maxScreenSize > 0.0) {\n pixelSize = min(pixelSize, material.maxScreenSize);\n }\n let res = max(camera.viewport, vec2f(1.0));\n // in.position 为 ±0.5;半宽 = pixelSize 像素\n let ndc = in.position.xy * (pixelSize * 2.0) / res;\n out.clipPosition = vec4f(clip.xy + ndc * clip.w, clip.z, clip.w);\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n let alpha = material.color.a * mapSample.a * alphaMapSample.g * vertexColor.a;\n return vec4f(material.color.rgb * mapSample.rgb * vertexColor.rgb, alpha);\n}\n";class Og extends Ng{type="PointsMaterial2";isPointsMaterial2=!0;alphaMapTextureBinding;alphaMapSamplerBinding;size;sizeAttenuation;sizeAttenuationRef;maxScreenSize;get alphaMap(){return this.alphaMapTextureBinding.getValue()}set alphaMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.alphaMapTextureBinding.setValue(A),this.alphaMapSamplerBinding.setValue(A?.sampler??null)}constructor(A){super(A,{shader:Pg,isSupportFamily:!1}),this.side=Fn.Double,this.registerStructField("size",new zt("size",1,void 0,{access:"Uniform"})),this.registerStructField("sizeAttenuation",new zt("sizeAttenuation",1,void 0,{access:"Uniform"})),this.registerStructField("sizeAttenuationRef",new zt("sizeAttenuationRef",1,void 0,{access:"Uniform"})),this.registerStructField("maxScreenSize",new zt("maxScreenSize",1,void 0,{access:"Uniform"})),this.alphaMapTextureBinding=new qt("alphaMap",A?.alphaMap??null),this.alphaMapSamplerBinding=new Wt("alphaMapSampler",A?.alphaMap?.sampler??null),this.addBinding(this.alphaMapTextureBinding),this.addBinding(this.alphaMapSamplerBinding);const t=A&&"boolean"==typeof A.sizeAttenuation?{...A,sizeAttenuation:A.sizeAttenuation?1:0}:{...A};this.setValues({sizeAttenuationRef:4,maxScreenSize:16,...t}),null==A?.side&&(this.side=Fn.Double)}clone(){const A=super.clone();return A.size=this.size,A.sizeAttenuation=this.sizeAttenuation,A.sizeAttenuationRef=this.sizeAttenuationRef,A.maxScreenSize=this.maxScreenSize,A.alphaMap=this.alphaMap,A}}const Fg=new v,kg=new y;function Rg(A,t,e,i){const s=t.getAttribute("position");if(!s)return;const n=t.boundingBox??t.computeBoundingBox();if(!n)return;const r=e.params?.Points?.threshold??1,a=A.matrixWorld,o=a.data,l=n.center;kg.set(l.x,l.y,l.z),kg.applyMatrix4(a);const c=a.getMaxScaleOnAxis()*l.w+r,h=c*c,u=kg.elements,g=e.ray,d=g.origin.x,p=g.origin.y,f=g.origin.z,m=g.direction.x,C=g.direction.y,w=g.direction.z,y=u[0]-d,B=u[1]-p,I=u[2]-f,Q=y*m+B*C+I*w;if(Q<-c)return;if(y*y+B*B+I*I-Q*Q>h)return;const E=A.scale,x=.3333333333333333*(E.x+E.y+E.z),D=0!==x?r/x:r,M=D*D;Fg.copy(a).invert();const b=Fg.data,S=1/(b[3]*d+b[7]*p+b[11]*f+b[15]),v=(b[0]*d+b[4]*p+b[8]*f+b[12])*S,T=(b[1]*d+b[5]*p+b[9]*f+b[13])*S,U=(b[2]*d+b[6]*p+b[10]*f+b[14])*S;let N=b[0]*m+b[4]*C+b[8]*w,P=b[1]*m+b[5]*C+b[9]*w,O=b[2]*m+b[6]*C+b[10]*w;const F=Math.sqrt(N*N+P*P+O*O);if(F>0){const A=1/F;N*=A,P*=A,O*=A}const k=t.drawRange,R=!1!==e.firstHitOnly,L=e.near*e.near,j=e.far*e.far,z=s.view,G=s.stride,Y=s.typeInfo?.offset??0,H=Math.max(0,k.start),K=t.index;if(null!==K){const t=K.view,e=K.stride,s=K.typeInfo?.offset??0,n=Math.min(K.count,k.start+k.count);for(let r=H;r<n;r++){const n=t[s+r*e],a=Y+n*G;if(Lg(A,i,n,z[a],z[a+1],z[a+2],v,T,U,N,P,O,M,o,d,p,f,L,j,R))return}return}const V=Math.min(s.count,k.start+k.count);for(let J=H;J<V;J++){const t=Y+J*G;if(Lg(A,i,J,z[t],z[t+1],z[t+2],v,T,U,N,P,O,M,o,d,p,f,L,j,R))return}}function Lg(A,t,e,i,s,n,r,a,o,l,c,h,u,g,d,p,f,m,C,w){const B=i-r,I=s-a,Q=n-o;let E,x=B*l+I*c+Q*h;if(x<=0)x=0,E=B*B+I*I+Q*Q;else{const A=r+l*x-i,t=a+c*x-s,e=o+h*x-n;E=A*A+t*t+e*e}return!(E>=u)&&function(A,t,e,i,s,n,r,a,o,l,c,h,u,g,d,p,f,m){const C=n+o*i,w=r+l*i,B=a+c*i,I=1/(h[3]*C+h[7]*w+h[11]*B+h[15]),Q=(h[0]*C+h[4]*w+h[8]*B+h[12])*I,E=(h[1]*C+h[5]*w+h[9]*B+h[13])*I,x=(h[2]*C+h[6]*w+h[10]*B+h[14])*I,D=Q-u,M=E-g,b=x-d,S=D*D+M*M+b*b;return!(S<p||S>f)&&(t.push({object:A,point:new y(Q,E,x),distance:Math.sqrt(S),distanceToRay:Math.sqrt(s),index:e}),m)}(A,t,e,x,E,r,a,o,l,c,h,g,d,p,f,m,C,w)}const jg=new wt("CameraUniforms",[{name:"projectionMatrix",format:"mat4x4f"},{name:"viewMatrix",format:"mat4x4f"},{name:"viewProjectionMatrix",format:"mat4x4f"},{name:"frustumPlanes",format:"vec4f",isArray:!0,count:6},{name:"viewport",format:"vec2f"},{name:"screenResolution",format:"vec2f"},{name:"cameraPosition",format:"vec3f"},{name:"maxDistance",format:"f32"},{name:"enabledTypes",format:"u32"},{name:"minScreenPixels",format:"f32"}]);class zg extends Zt{constructor(A="camera"){super(A,jg,{access:"Uniform",visibility:z.ALL,isTrySameBuffer:!0}),this.access.usage|=j.COPY_SRC}copy(A){const t=A.dataView.view;return this.dataView.view.copy(t),this}add(){console.warn("camera is not add child")}}class Gg extends Mi{type="Camera";isCamera=!0;projectionMatrix;viewMatrix;viewProjectionMatrix;frustumPlanes;viewport;screenResolution;cameraPosition;maxDistance;enabledTypes;minScreenPixels;#Wa=null;get projectionMatrixInverse(){return this.projectionMatrix.clone().invert()}constructor(){super();const A=new zg("camera");this.setProperty("camera",A),this.switchStore=()=>{console.warn("Camera is camera, not need world store")},d.register(this,()=>{A.dispose()})}needsDerivedUpdate(A){if(null==this.parent)return A;if(A)return!0;const t=this.matrixWorld.data,e=this.#Wa;if(null==e)return!0;for(let i=0;i<16;i++)if(e[i]!==t[i])return!0;return!1}onBeforeUpdate(){const A=0!==(this.dirtyTypes[0]&(f.DIRTY_MATRIX|f.DIRTY_DATA));return!!this.needsDerivedUpdate(A)&&(this.updateProjectionMatrix(),this.writeDerivedCameraUniforms(),!0)}writeDerivedCameraUniforms(){const A=this.matrixWorld;this.viewMatrix.copy(A).invert(),this.viewProjectionMatrix.multiplyMatrices(this.projectionMatrix,this.viewMatrix),this.extractFrustumPlanesInline();const t=A.data;this.cameraPosition.set(t[12],t[13],t[14]),null!=this.parent&&(this.#Wa??(this.#Wa=new Float32Array(16))).set(t)}getCameraUniforms(){return this.getBinding("camera")}writeScreenSize(A,t){const e=A>0?A:1,i=t>0?t:1,s=this.viewport;s.x===e&&s.y===i||s.set(e,i);const n=this.screenResolution;n.x===e&&n.y===i||n.set(e,i)}onChangeCallback(A){A&f.DIRTY_STRUCTURE&&(this.getCameraUniforms().computeLayout(),this._cacheKey="",this.version++),this.dirtyTypes[0]|=A&C}updateProjectionMatrix(){}update(A,t=!0){if(!this.onBeforeUpdate())return!1;const e=this.getCameraUniforms();return e.updateCPUBuffer(),t&&e.updateGPUBuffer(A),this.dirtyTypes[0]&=-424967,this.resetPQSDirtyFlags(),!0}#qa(){const A=this.frustumPlanes;return A?.elements?{data:A.elements,base:0,markDirty:()=>{A.onChangeCallback?.()}}:{data:this.frustumPlanes,base:0,markDirty:()=>{}}}extractFrustumPlanesInline(){const{data:A,base:t,markDirty:e}=this.#qa();if(null==A)return;const i=this.viewProjectionMatrix.data;this.#Xa(A,t+0,i[3]+i[0],i[7]+i[4],i[11]+i[8],i[15]+i[12]),this.#Xa(A,t+4,i[3]-i[0],i[7]-i[4],i[11]-i[8],i[15]-i[12]),this.#Xa(A,t+8,i[3]+i[1],i[7]+i[5],i[11]+i[9],i[15]+i[13]),this.#Xa(A,t+12,i[3]-i[1],i[7]-i[5],i[11]-i[9],i[15]-i[13]),this.#Xa(A,t+16,i[2],i[6],i[10],i[14]),this.#Xa(A,t+20,i[3]-i[2],i[7]-i[6],i[11]-i[10],i[15]-i[14]),e()}#Xa(A,t,e,i,s,n){let r=Math.sqrt(e*e+i*i+s*s);r>0&&(r=1/r,e*=r,i*=r,s*=r,n*=r),A[t]=e,A[t+1]=i,A[t+2]=s,A[t+3]=n}sphereInFrustum(A,t,e,i){const{data:s,base:n}=this.#qa();if(null==s)return!0;let r,a,o,l;"object"==typeof A?(r=A.x,a=A.y,o=A.z,l=t):(r=A,a=t,o=e,l=i);for(let c=0;c<6;c++){const A=n+4*c;if(s[A]*r+s[A+1]*a+s[A+2]*o+s[A+3]<-l)return!1}return!0}boxInFrustum(A,t,e,i,s,n){const{data:r,base:a}=this.#qa();if(null==r)return!0;for(let o=0;o<6;o++){const l=a+4*o,c=r[l],h=r[l+1],u=r[l+2];if(c*(c>0?i:A)+h*(h>0?s:t)+u*(u>0?n:e)+r[l+3]<0)return!1}return!0}copy(A,t=!0){return super.copy(A,t),this.getCameraUniforms().copy(A.getCameraUniforms()),this}dispose(){this.getCameraUniforms().dispose(),super.dispose()}}const Yg=new Float64Array(4);class Hg extends Gg{type="PerspectiveCamera";isPerspectiveCamera=!0;#Za=50;#_a=1;#$a=.1;#Ao=1e3;#to=Math.tan(50*k*.5);#eo=1;#io=!0;#so=null;focus=10;viewportRect=null;constructor(A=50,t=1,e=.1,i=1e3){super(),this.#Za=A,this.#_a=t,this.#$a=e,this.#Ao=i,this.#to=Math.tan(A*k*.5),this.updateProjectionMatrix()}get fov(){return this.#Za}set fov(A){this.#Za!==A&&(this.#Za=A,this.#to=Math.tan(A*k*.5),this.#no())}get aspect(){return this.#_a}set aspect(A){this.#_a!==A&&(this.#_a=A,this.#no())}get near(){return this.#$a}set near(A){this.#$a!==A&&(this.#$a=A,this.#no())}get far(){return this.#Ao}set far(A){this.#Ao!==A&&(this.#Ao=A,this.#no())}get tanHalfFov(){return this.#to}get zoom(){return this.#eo}set zoom(A){this.#eo!==A&&(this.#eo=A,this.#no())}get view(){return this.#so}set(A,t,e,i){return this.#Za=A,this.#_a=t,this.#$a=e,this.#Ao=i,this.#to=Math.tan(A*k*.5),this.#no(),this}setAspect(A){return this.aspect=A,this}setViewOffset(A,t,e,i,s,n){this.aspect=A/t;const r=this.#so;return null==r?this.#so={fullWidth:A,fullHeight:t,x:e,y:i,width:s,height:n}:(r.fullWidth=A,r.fullHeight=t,r.x=e,r.y=i,r.width=s,r.height=n),this.#no(),this}clearViewOffset(){return null!=this.#so&&(this.#so=null,this.#no()),this}setFocalLength(A,t=24){return this.fov=2*Math.atan(t/(2*A))*R,this}getFocalLength(A=24){return A/(2*this.tanHalfFov)}getEffectiveFOV(){return 2*Math.atan(this.tanHalfFov/this.zoom)*R}getViewBounds(A,t,e){this.#ro();const i=A/this.#$a;t.x=Yg[0]*i,t.y=Yg[3]*i,e.x=Yg[1]*i,e.y=Yg[2]*i}getViewSize(A,t){this.#ro();const e=A/this.#$a;return t.x=(Yg[1]-Yg[0])*e,t.y=(Yg[2]-Yg[3])*e,t}onBeforeUpdate(){const A=this.dirtyTypes[0],t=this.#io||0!==(A&(f.DIRTY_MATRIX|f.DIRTY_DATA));return!!this.needsDerivedUpdate(t)&&(this.#io&&this.updateProjectionMatrix(),this.writeDerivedCameraUniforms(),!0)}updateProjectionMatrix(){const A=this.projectionMatrix,t=A.elements,e=this.#$a,i=this.#Ao;let s,n;if(i===1/0)s=0,n=e;else{const A=1/(i-e);s=e*A,n=i*e*A}if(null===this.#so){const A=this.#eo/this.#to;t[0]=A/this.#_a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=A,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=n,t[15]=0}else{this.#ro();const A=Yg[0],i=Yg[1],r=Yg[2],a=Yg[3],o=2*e/(i-A),l=2*e/(r-a);t[0]=o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=(i+A)/(i-A),t[9]=(r+a)/(r-a),t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=n,t[15]=0}A.isDirty||A.onChangeCallback(),this.#io=!1}clone(){return(new Hg).copy(this)}copy(A){if(this.set(A.fov,A.aspect,A.near,A.far),this.zoom=A.zoom,this.focus=A.focus,null==A.view)this.clearViewOffset();else{const t=A.view;this.setViewOffset(t.fullWidth,t.fullHeight,t.x,t.y,t.width,t.height)}this.position.copy(A.position),this.quaternion.copy(A.quaternion),this.scale.copy(A.scale),this.up.copy(A.up);const t=A.viewportRect;return null==t?this.viewportRect=null:null==this.viewportRect?this.viewportRect=t.clone():this.viewportRect.copy(t),this}toJSON(){return{type:this.type,fov:this.fov,zoom:this.zoom,near:this.near,far:this.far,focus:this.focus,aspect:this.aspect,view:null==this.#so?null:{...this.#so}}}#ro(){let A=this.#$a*this.#to/this.#eo,t=2*A,e=this.#_a*t,i=-.5*e;const s=this.#so;null!=s&&(i+=s.x*e/s.fullWidth,A-=s.y*t/s.fullHeight,e*=s.width/s.fullWidth,t*=s.height/s.fullHeight),Yg[0]=i,Yg[1]=i+e,Yg[2]=A,Yg[3]=A-t}#no(){this.#io||(this.#io=!0,this.dirtyTypes[0]|=f.DIRTY_DATA,this.dirtySystem?.add(this,this.dirtyTypes[0]))}}class Kg extends Hg{type="ArrayCamera";isArrayCamera=!0;isMultiViewCamera=!1;cameras;constructor(A=[]){super(),this.cameras=A}clone(){return(new Kg).copy(this)}copy(A){super.copy(A);const t=A;if(!0!==t.isArrayCamera)return this;this.isMultiViewCamera=t.isMultiViewCamera;const e=t.cameras,i=[];for(let s=0,n=e.length;s<n;s++)i.push(e[s].clone());return this.cameras=i,this}}const Vg=[[-1,0,0,0,-1,0],[1,0,0,0,-1,0],[0,1,0,0,0,1],[0,-1,0,0,0,-1],[0,0,1,0,-1,0],[0,0,-1,0,-1,0]];class Jg extends Gg{type="OrthographicCamera";isOrthographicCamera=!0;#ao=-1;#oo=1;#lo=1;#co=-1;#$a=.1;#Ao=1e3;#eo=1;#io=!0;#so=null;constructor(A=-1,t=1,e=1,i=-1,s=.1,n=1e3){super(),this.#ao=A,this.#oo=t,this.#lo=e,this.#co=i,this.#$a=s,this.#Ao=n,this.updateProjectionMatrix()}static fromSize(A,t,e=.1,i=1e3){const s=.5*A,n=.5*t;return new Jg(-s,s,n,-n,e,i)}get left(){return this.#ao}set left(A){this.#ao!==A&&(this.#ao=A,this.#no())}get right(){return this.#oo}set right(A){this.#oo!==A&&(this.#oo=A,this.#no())}get top(){return this.#lo}set top(A){this.#lo!==A&&(this.#lo=A,this.#no())}get bottom(){return this.#co}set bottom(A){this.#co!==A&&(this.#co=A,this.#no())}get near(){return this.#$a}set near(A){this.#$a!==A&&(this.#$a=A,this.#no())}get far(){return this.#Ao}set far(A){this.#Ao!==A&&(this.#Ao=A,this.#no())}get zoom(){return this.#eo}set zoom(A){this.#eo!==A&&(this.#eo=A,this.#no())}get view(){return this.#so}set(A,t,e,i,s=this.#$a,n=this.#Ao){return this.#ao=A,this.#oo=t,this.#lo=e,this.#co=i,this.#$a=s,this.#Ao=n,this.#no(),this}setFromSize(A,t){const e=.5*A,i=.5*t;return this.set(-e,e,i,-i,this.#$a,this.#Ao)}setViewOffset(A,t,e,i,s,n){const r=this.#so;return null==r?this.#so={fullWidth:A,fullHeight:t,x:e,y:i,width:s,height:n}:(r.fullWidth=A,r.fullHeight=t,r.x=e,r.y=i,r.width=s,r.height=n),this.#no(),this}clearViewOffset(){return null!=this.#so&&(this.#so=null,this.#no()),this}onBeforeUpdate(){const A=this.dirtyTypes[0],t=this.#io||0!==(A&(f.DIRTY_MATRIX|f.DIRTY_DATA));return!!this.needsDerivedUpdate(t)&&(this.#io&&this.updateProjectionMatrix(),this.writeDerivedCameraUniforms(),!0)}updateProjectionMatrix(){const A=this.projectionMatrix.elements,t=this.#eo,e=.5*(this.#oo-this.#ao)/t,i=.5*(this.#lo-this.#co)/t,s=.5*(this.#oo+this.#ao),n=.5*(this.#lo+this.#co);let r=s-e,a=s+e,o=n+i,l=n-i;const c=this.#so;if(null!==c){const A=(this.#oo-this.#ao)/c.fullWidth/t,e=(this.#lo-this.#co)/c.fullHeight/t;r+=A*c.x,a=r+A*c.width,o-=e*c.y,l=o-e*c.height}const h=1/(a-r),u=1/(o-l),g=1/(this.#Ao-this.#$a);A[0]=2*h,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=2*u,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=g,A[11]=0,A[12]=-(a+r)*h,A[13]=-(o+l)*u,A[14]=this.#Ao*g,A[15]=1,this.projectionMatrix.isDirty||this.projectionMatrix.onChangeCallback(),this.#io=!1}clone(){return(new Jg).copy(this)}copy(A){this.set(A.left,A.right,A.top,A.bottom,A.near,A.far),this.zoom=A.zoom;const t=A.view;return null==t?this.clearViewOffset():this.setViewOffset(t.fullWidth,t.fullHeight,t.x,t.y,t.width,t.height),this.position.copy(A.position),this.quaternion.copy(A.quaternion),this.scale.copy(A.scale),this.up.copy(A.up),this}toJSON(){const A=this.#so;return{type:this.type,left:this.#ao,right:this.#oo,top:this.#lo,bottom:this.#co,near:this.#$a,far:this.#Ao,zoom:this.#eo,view:null===A?null:{fullWidth:A.fullWidth,fullHeight:A.fullHeight,x:A.x,y:A.y,width:A.width,height:A.height}}}#no(){this.#io||(this.#io=!0,this.dirtyTypes[0]|=f.DIRTY_DATA,this.dirtySystem?.add(this,this.dirtyTypes[0]))}}const Wg=new y,qg=new y,Xg=new y,Zg=new y,_g=new v,$g=new v,Ad=new v;{const A=Ad.elements;A[0]=-.5,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=-.5,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=1,A[11]=0,A[12]=.5,A[13]=.5,A[14]=0,A[15]=1}function td(A,t,e,i,s,n,r,a){const o=2*(i*A+s*t+n*e+r);a.set(A-o*i,t-o*s,e-o*n)}function ed(A){const t=A.elements;for(let e=0;e<16;e++)t[e]=0;A.isDirty||A.onChangeCallback()}const id=new T,sd=new y,nd=new y;function rd(A,t,e,i){A.x===t&&A.y===e&&A.z===i||A.set(t,e,i)}function ad(A,t){const e=t.x,i=t.y,s=t.z,n=t.w;A.x===e&&A.y===i&&A.z===s&&A.w===n||A.set(e,i,s,n)}class od{object;input;enabled=!0;constructor(A,t){this.object=A,this.input=t}update(A){}dispose(){this.enabled=!1}on(A,t){return ri(this,A,t),this}off(A,t){return ai(this,A,t),this}emit(A,t){if(null==t)return ld.type=A,void oi(this,A,ld);oi(this,A,t)}}const ld={type:""},cd="sail-in",hd="sail-out";function ud(A){return"ArrowLeft"===A||"KeyA"===A?1:"ArrowRight"===A||"KeyD"===A?2:"ArrowUp"===A||"KeyW"===A?4:"ArrowDown"===A||"KeyS"===A?8:0}function gd(A,t){t.type=A.type,t.pointerId=A.pointerId,t.pointerType=A.pointerType,t.button=A.button,t.buttons=A.buttons,t.x=A.x,t.y=A.y,t.nx=A.nx,t.ny=A.ny,t.modifiers=A.modifiers,t.timeStamp=A.timeStamp,t.deltaX=A.deltaX,t.deltaY=A.deltaY,t.deltaMode=A.deltaMode,t.key=A.key,t.code=A.code,t.repeat=A.repeat,t.cssWidth=A.cssWidth,t.cssHeight=A.cssHeight,t.pixelRatio=A.pixelRatio,t.visible=A.visible}const dd={type:"change"},pd={type:"start"},fd={type:"end"},md=new y,Cd=1e-4,wd=.00115;function yd(A,t,e){return A<t?t:A>e?e:A}class Bd{pointer={x:0,y:0,nx:0,ny:0,buttons:0,button:0,pointerId:0,down:!1,modifiers:0,abort:0,pointerType:""};size={cssWidth:0,cssHeight:0,pixelRatio:1};keys=0;claimed=!1;#ho=0;#uo=0;#go="";#do=null;#po=null;#Js=null;#fo=null;#mo=null;#Co=!1;bindCursor(A){this.#do=A}bindObserveResize(A){this.#po=A}bindDetach(A){this.#Js=A}setCursor(A){A!==this.#go&&(this.#go=A,this.#do?.(A))}consumeWheel(){const A=this.#ho;return this.#ho=0,A}consumePinch(){const A=this.#uo;return this.#uo=0,A}observeResize(A){this.#po?.(A)}on(A,t){let e=this.#fo;e||(this.#fo=e=new Map);let i=e.get(A);return i||e.set(A,i=[]),-1===i.indexOf(t)&&i.push(t),this}off(A,t){const e=this.#fo?.get(A);if(!e)return this;const i=e.indexOf(t);return-1!==i&&e.splice(i,1),this}push(A){const t=A.type;if("pointerdown"===t||"pointermove"===t||"pointerup"===t||"pointercancel"===t){const e=A.pointerId;if(null!==this.#mo&&null!=e&&e!==this.#mo)return;const i=this.pointer;null!=A.x&&(i.x=A.x),null!=A.y&&(i.y=A.y),null!=A.nx&&(i.nx=A.nx),null!=A.ny&&(i.ny=A.ny),null!=A.buttons&&(i.buttons=A.buttons),null!=A.button&&("pointermove"!==t||A.button>=0)&&(i.button=A.button),null!=e&&(i.pointerId=e),null!=A.modifiers&&(i.modifiers=A.modifiers),null!=A.pointerType&&(i.pointerType=A.pointerType),"pointerdown"===t?(i.down=!0,null!=e&&(this.#mo=e)):"pointerup"===t?(i.down=0!==(A.buttons??0),i.down||(this.claimed=!1,this.#mo=null)):"pointercancel"===t&&(i.down=!1,i.buttons=0,i.abort++,this.claimed=!1,this.#mo=null)}else if("wheel"===t){let t=A.deltaY??0;if("touch"===A.pointerType)this.#uo+=t;else{const e=A.deltaMode??0;1===e?t*=16:2===e&&(t*=this.size.cssHeight>0?this.size.cssHeight:800),this.#ho+=t}const e=this.pointer;null!=A.x&&(e.x=A.x),null!=A.y&&(e.y=A.y),null!=A.nx&&(e.nx=A.nx),null!=A.ny&&(e.ny=A.ny)}else"resize"===t?(null!=A.cssWidth&&(this.size.cssWidth=A.cssWidth),null!=A.cssHeight&&(this.size.cssHeight=A.cssHeight),null!=A.pixelRatio&&(this.size.pixelRatio=A.pixelRatio)):"keydown"===t?this.keys|=ud(A.code):"keyup"===t?this.keys&=~ud(A.code):("blur"===t||"visibility"===t&&!1===A.visible)&&(this.pointer.down=!1,this.pointer.buttons=0,this.pointer.abort++,this.keys=0,this.claimed=!1,this.#mo=null);const e=this.#fo?.get(t);if(e)for(let i=0,s=e.length;i<s;i++)e[i](A)}dispose(){this.#Co||(this.#Co=!0,this.keys=0,this.#ho=0,this.claimed=!1,this.#mo=null,this.pointer.down=!1,this.pointer.buttons=0,this.#Js?.(),this.#Js=null,this.#do=null,this.#po=null,this.#fo=null)}}function Id(A){const t=new Bd,e=A=>{const e=A.data;null!=e&&e.ch===cd&&t.push(e.p)};return A.addEventListener("message",e),A.start?.(),t.bindCursor(t=>{const e={ch:hd,op:"cursor",v:t};A.postMessage(e)}),t.bindDetach(()=>{A.removeEventListener("message",e)}),t}function Qd(A){return(A.altKey?1:0)|(A.ctrlKey?2:0)|(A.metaKey?4:0)|(A.shiftKey?8:0)}function Ed(A){if("undefined"==typeof HTMLElement||!(A instanceof HTMLElement))return!1;const t=A.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t||A.isContentEditable}class xd{host;#wo=null;#yo=null;#Bo=null;#Io=!1;#Qo=!1;#Eo=0;#mo=null;#xo=0;#zt=!1;#Do=!1;#Mo=null;#bo=null;#So;#vo={type:"pointermove"};#To={type:"pointermove"};#Uo={ch:cd,p:{type:"pointermove"}};#No=!1;#Po=0;#Oo=0;#Fo=0;#ko=0;#Ro=!1;#Lo=0;#jo=0;#zo=0;#Go=0;#Yo=!1;#Ho=0;#Ko=0;#Vo=0;#Jo=!1;#Wo=0;#qo=0;#Xo=0;#Zo=0;#_o=0;#$o=-1;#Al=-1;#tl=!1;constructor(A,t){this.host=A,this.#So={preventWheel:!1!==t?.preventWheel,captureOnDown:!1!==t?.captureOnDown,keys:!0===t?.keys};const e=A.style;this.#Mo=e.touchAction,e.touchAction="none",A.addEventListener("pointerdown",this.#el),A.addEventListener("pointermove",this.#il),A.addEventListener("pointerup",this.#sl),A.addEventListener("pointercancel",this.#nl),A.addEventListener("pointerenter",this.#rl),A.addEventListener("pointerleave",this.#al),A.addEventListener("lostpointercapture",this.#ol),A.addEventListener("wheel",this.#ll,{passive:!1}),A.addEventListener("contextmenu",this.#cl),A.addEventListener("blur",this.#hl),this.#So.keys&&(globalThis.addEventListener("keydown",this.#ul),globalThis.addEventListener("keyup",this.#gl)),document.addEventListener("visibilitychange",this.#dl),globalThis.addEventListener("scroll",this.#pl,!0)}connect(A){this.#wo=A,this.#yo=null,A.bindCursor(A=>{this.host.style.cursor=A}),A.bindObserveResize(A=>this.observeResize(A)),A.bindDetach(()=>this.dispose()),this.#fl()}connectPort(A){this.#yo=A,this.#wo=null;const t=A=>{const t=A.data;null!=t&&t.ch===hd&&"cursor"===t.op&&(this.host.style.cursor=t.v)};A.addEventListener("message",t),A.start?.(),this.#bo=t}observeResize(A){this.#Bo?.disconnect();const t=A??this.host;this.#Bo=new ResizeObserver(A=>{const t=A[0];if(!t)return;this.#pl();const e=t.contentRect.width,i=t.contentRect.height;if(e<1||i<1)return;const s=t.devicePixelContentBoxSize?.[0],n=globalThis.devicePixelRatio||1,r=s&&e>0?s.inlineSize/e:n;this.#g({type:"resize",cssWidth:e,cssHeight:i,pixelRatio:r,timeStamp:performance.now()})});try{this.#Bo.observe(t,{box:"device-pixel-content-box"})}catch{this.#Bo.observe(t)}}dispose(){if(this.#zt)return;this.#zt=!0;const A=null!=this.#yo&&null==this.#wo&&(0!==this.#xo||null!==this.#mo),t=this.host;if(this.#Qo&&t.releasePointerCapture)try{t.releasePointerCapture(this.#Eo)}catch{}if(t.releasePointerCapture&&this.#Al>=0&&this.#Al!==this.#Eo)try{t.releasePointerCapture(this.#Al)}catch{}this.#ml(),t.removeEventListener("pointerdown",this.#el),t.removeEventListener("pointermove",this.#il),t.removeEventListener("pointerup",this.#sl),t.removeEventListener("pointercancel",this.#nl),t.removeEventListener("pointerenter",this.#rl),t.removeEventListener("pointerleave",this.#al),t.removeEventListener("lostpointercapture",this.#ol),t.removeEventListener("wheel",this.#ll),t.removeEventListener("contextmenu",this.#cl),t.removeEventListener("blur",this.#hl),this.#So.keys&&(globalThis.removeEventListener("keydown",this.#ul),globalThis.removeEventListener("keyup",this.#gl)),document.removeEventListener("visibilitychange",this.#dl),globalThis.removeEventListener("scroll",this.#pl,!0),this.#Bo?.disconnect(),this.#Bo=null,null!=this.#Mo&&(t.style.touchAction=this.#Mo),this.#xo=0,this.#mo=null,this.#Qo=!1,this.#Io=!1,A&&this.#g({type:"blur",timeStamp:performance.now()}),this.#yo&&this.#bo&&this.#yo.removeEventListener("message",this.#bo),this.#bo=null,this.#yo=null,this.#wo=null}#fl(){const A=this.#wo;if(!A||A.size.cssHeight>1)return;const t=this.host.getBoundingClientRect();t.width<1||t.height<1||(A.size.cssWidth=t.width,A.size.cssHeight=t.height)}#pl=()=>{this.#No=!1};#cl=A=>{A.preventDefault()};#rl=()=>{this.#Do=!0};#al=()=>{this.#Do=!1};#Cl(A){return null!==this.#mo&&A!==this.#mo}#ol=A=>{if(this.#tl)return;if(this.#wl(A.pointerId))return void this.#yl(A.pointerId,A.timeStamp,Qd(A),A.clientX,A.clientY,!0);if(this.#Zo>0)return;if(!this.#Qo||A.pointerId!==this.#Eo)return;this.#Qo=!1,this.#mo=null,this.#Bl();const t=this.#vo;t.type="pointercancel",t.buttons=0,this.#Ro&&(t.x=this.#Lo,t.y=this.#jo,t.nx=this.#zo,t.ny=this.#Go),this.#g(t)};#el=A=>{"touch"!==A.pointerType?this.#Cl(A.pointerId)||(this.#Bl(),this.#Il(A,"pointerdown",this.#vo,!1)&&(A.button<=2&&(this.#So.captureOnDown&&this.host.setPointerCapture&&(this.host.setPointerCapture(A.pointerId),this.#Qo=!0,this.#Eo=A.pointerId),A.preventDefault()),this.#mo=A.pointerId,this.#g(this.#vo))):this.#Ql(A)};#il=A=>{if("touch"!==A.pointerType){if(!this.#Cl(A.pointerId)&&this.#Il(A,"pointermove",this.#vo,!1))return this.#yo?(gd(this.#vo,this.#To),void this.#El()):void this.#g(this.#vo)}else this.#xl(A)};#sl=A=>{"touch"!==A.pointerType?this.#Cl(A.pointerId)||(this.#Bl(),this.#Il(A,"pointerup",this.#vo,!0)&&(this.#Qo=!1,0===A.buttons&&(this.#mo=null),this.#g(this.#vo))):this.#Dl(A)};#nl=A=>{"touch"!==A.pointerType?this.#Cl(A.pointerId)||(this.#Bl(),this.#Il(A,"pointercancel",this.#vo,!0)&&(this.#Qo=!1,this.#mo=null,this.#g(this.#vo))):this.#yl(A.pointerId,A.timeStamp,Qd(A),A.clientX,A.clientY,!0)};#ll=A=>{this.#Bl(),this.#So.preventWheel&&A.preventDefault();const t=this.#vo;t.type="wheel",t.deltaX=A.deltaX,t.deltaY=A.deltaY,t.deltaMode=A.deltaMode,t.modifiers=Qd(A),t.timeStamp=A.timeStamp,t.pointerId=void 0,t.pointerType=void 0,t.button=void 0,t.buttons=void 0,this.#Ml(A.clientX,A.clientY,t,!0)||(t.x=void 0,t.y=void 0,t.nx=void 0,t.ny=void 0),this.#g(t)};#hl=()=>{this.#Bl(),this.#ml(),this.#Qo=!1,this.#mo=null,this.#xo=0,this.#g({type:"blur",timeStamp:performance.now()})};#dl=()=>{this.#Bl();const A="visible"===document.visibilityState;A||(this.#ml(),this.#Qo=!1,this.#mo=null,this.#xo=0),this.#g({type:"visibility",visible:A,timeStamp:performance.now()})};#ul=A=>{if(Ed(A.target))return;const t=ud(A.code),e=this.#Do||this.#Qo;(e||0!==t&&0!==(this.#xo&t))&&(0!==t&&(this.#xo|=t,A.code.startsWith("Arrow")&&A.preventDefault()),e&&this.#g({type:"keydown",key:A.key,code:A.code,repeat:A.repeat,modifiers:Qd(A),timeStamp:A.timeStamp}))};#gl=A=>{const t=ud(A.code);if(0!==t){if(0===(this.#xo&t))return;this.#xo&=~t}else if(Ed(A.target)||!this.#Do&&!this.#Qo)return;this.#g({type:"keyup",key:A.key,code:A.code,repeat:!1,modifiers:Qd(A),timeStamp:A.timeStamp})};#bl(A){if(!A&&this.#No)return this.#Fo>=1&&this.#ko>=1;const t=this.host.getBoundingClientRect();return this.#Po=t.left,this.#Oo=t.top,this.#Fo=t.width,this.#ko=t.height,this.#No=!0,this.#Fo>=1&&this.#ko>=1}#Ml(A,t,e,i){if(this.#bl(!1)){const i=A-this.#Po,s=t-this.#Oo,n=this.#Fo,r=this.#ko;e.x=i,e.y=s,e.nx=i/n*2-1,e.ny=1-s/r*2;const a=this.#wo;return a&&a.size.cssHeight<=1&&(a.size.cssWidth=n,a.size.cssHeight=r),this.#Lo=i,this.#jo=s,this.#zo=e.nx,this.#Go=e.ny,this.#Ro=!0,!0}return!(!i||!this.#Ro||(e.x=this.#Lo,e.y=this.#jo,e.nx=this.#zo,e.ny=this.#Go,0))}#Il(A,t,e,i){return"pointerdown"===t&&(this.#No=!1),e.type=t,e.pointerId=A.pointerId,e.pointerType=A.pointerType,e.button=A.button,e.buttons=A.buttons,e.modifiers=Qd(A),e.timeStamp=A.timeStamp,e.deltaX=void 0,e.deltaY=void 0,e.deltaMode=void 0,e.key=void 0,e.code=void 0,e.repeat=void 0,e.cssWidth=void 0,e.cssHeight=void 0,e.pixelRatio=void 0,e.visible=void 0,this.#Ml(A.clientX,A.clientY,e,i)}#Ql(A){if(A.cancelable&&A.preventDefault(),this.#wl(A.pointerId)||this.#Zo>=2)return;if(0===this.#Zo&&null!==this.#mo)return;this.#Bl(),this.#Sl(A.pointerId,A.clientX,A.clientY),this.#vl(A.pointerId);const t=Qd(A);if(1===this.#Zo)return this.#mo=A.pointerId,this.#Do=!0,void(this.#Tl(A.clientX,A.clientY,"pointerdown",1,0,A.timeStamp,t)||this.#yl(A.pointerId,A.timeStamp,t,A.clientX,A.clientY,!0));this.#_o=this.#Ul(),this.#Tl(this.#Nl(),this.#Pl(),"pointermove",2,-1,A.timeStamp,t)}#xl(A){if(!this.#wl(A.pointerId))return;A.cancelable&&A.preventDefault(),this.#Ol(A.pointerId,A.clientX,A.clientY);const t=Qd(A);if(1===this.#Zo)return void this.#Tl(A.clientX,A.clientY,"pointermove",1,-1,A.timeStamp,t);const e=this.#Nl(),i=this.#Pl();this.#Tl(e,i,"pointermove",2,-1,A.timeStamp,t);const s=this.#Ul(),n=this.#_o;this.#_o=s,n>1&&s>1&&n!==s&&this.#Fl(Math.log(n/s),e,i,A.timeStamp,t)}#Dl(A){A.cancelable&&A.preventDefault(),this.#yl(A.pointerId,A.timeStamp,Qd(A),A.clientX,A.clientY,!1)}#yl(A,t,e,i,s,n){if(!this.#wl(A))return;this.#Bl();const r=1===this.#Zo;if(this.#kl(A),this.#Rl(A),!r)return this.#_o=0,void this.#Tl(this.#Ko,this.#Vo,"pointermove",1,-1,t,e);this.#$o=-1,this.#Al=-1,this.#Qo=!1,this.#_o=0,this.#Tl(i,s,n?"pointercancel":"pointerup",0,0,t,e),this.#mo=null}#Tl(A,t,e,i,s,n,r){const a=this.#vo;return"pointerdown"===e&&(this.#No=!1),a.type=e,a.pointerId=this.#mo??0,a.pointerType="touch",a.button=s,a.buttons=i,a.modifiers=r,a.timeStamp=n,a.deltaX=void 0,a.deltaY=void 0,a.deltaMode=void 0,a.key=void 0,a.code=void 0,a.repeat=void 0,a.cssWidth=void 0,a.cssHeight=void 0,a.pixelRatio=void 0,a.visible=void 0,!!this.#Ml(A,t,a,"pointerdown"!==e)&&(this.#yo&&"pointermove"===e?(gd(a,this.#To),this.#El(),!0):(this.#g(a),!0))}#Fl(A,t,e,i,s){if(0===A)return;const n=this.#vo;n.type="wheel",n.deltaX=0,n.deltaY=A,n.deltaMode=0,n.modifiers=s,n.timeStamp=i,n.pointerId=void 0,n.pointerType="touch",n.button=void 0,n.buttons=void 0,n.key=void 0,n.code=void 0,n.repeat=void 0,n.cssWidth=void 0,n.cssHeight=void 0,n.pixelRatio=void 0,n.visible=void 0,this.#Ml(t,e,n,!0)||(n.x=void 0,n.y=void 0,n.nx=void 0,n.ny=void 0),this.#g(n)}#wl(A){return this.#Yo&&this.#Ho===A||this.#Jo&&this.#Wo===A}#Sl(A,t,e){this.#Yo?(this.#Jo=!0,this.#Wo=A,this.#qo=t,this.#Xo=e):(this.#Yo=!0,this.#Ho=A,this.#Ko=t,this.#Vo=e),this.#Zo++}#Ol(A,t,e){this.#Yo&&this.#Ho===A?(this.#Ko=t,this.#Vo=e):this.#Jo&&this.#Wo===A&&(this.#qo=t,this.#Xo=e)}#kl(A){if(this.#Yo&&this.#Ho===A)this.#Jo?(this.#Ho=this.#Wo,this.#Ko=this.#qo,this.#Vo=this.#Xo,this.#Jo=!1):this.#Yo=!1;else{if(!this.#Jo||this.#Wo!==A)return;this.#Jo=!1}this.#Zo--}#Nl(){return.5*(this.#Ko+this.#qo)}#Pl(){return.5*(this.#Vo+this.#Xo)}#Ul(){return Math.hypot(this.#Ko-this.#qo,this.#Vo-this.#Xo)}#vl(A){if(this.#So.captureOnDown&&this.host.setPointerCapture){this.#tl=!0;try{this.host.setPointerCapture(A)}catch{return void(this.#tl=!1)}this.#tl=!1,this.#$o<0?(this.#$o=A,this.#Eo=A):this.#Al<0&&(this.#Al=A),this.#Qo=!0}}#Rl(A){this.#$o===A&&(this.#$o=-1),this.#Al===A&&(this.#Al=-1),this.#Qo=this.#$o>=0||this.#Al>=0}#ml(){this.#Yo=!1,this.#Jo=!1,this.#Zo=0,this.#_o=0,this.#$o=-1,this.#Al=-1}#El(){if(this.#Io)return;this.#Io=!0;const A=globalThis.requestAnimationFrame;"function"==typeof A?A(()=>this.#Bl()):this.#Bl()}#Bl(){this.#Io&&(this.#Io=!1,this.#g(this.#To))}#g(A){const t=this.#wo;if(t)return void t.push(A);const e=this.#yo;e&&(this.#Uo.p=A,e.postMessage(this.#Uo))}}function Dd(A,t){if("undefined"==typeof document)throw new Error("Input.attach requires document; use Input.listen / InputSurface.push");const e=new Bd;return new xd(A,t).connect(e),e}function Md(A,t,e){if("undefined"==typeof document)throw new Error("Input.bindHost requires document");const i=new xd(A,e);return i.connectPort(t),i}const bd={attach:Dd,bindHost:Md,listen:Id},Sd=(A,t)=>{const e=function(A){const t=A?.material?.defines?.get("ALPHATEST");return"number"==typeof t&&t>0?t:0}(t);return e>0?`\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n let coverage = material.color.a * mapSample.a * vertexColor.a;\n if (coverage < ${function(A){const t=String(A);return/[eE.]/.test(t)?t:`${t}.0`}(e)}) { discard; }\n return vec4f(material.color.rgb * mapSample.rgb * vertexColor.rgb, coverage);\n}\n`:"\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n return material.color * mapSample * vertexColor;\n}\n"};class vd extends Ng{type="MeshBasicMaterial";constructor(A){super(A,{shader:Sd,isSupportFamily:!0}),this.setValues(A)}}const Td=3200,Ud=3201,Nd=3202,Pd=3203,Od="\nconst PACK_UPSCALE = 256.0 / 255.0;\nconst INV_255 = 1.0 / 255.0;\nconst SHIFT_RIGHT_8 = 1.0 / 256.0;\n",Fd=`${Od}\nfn packDepthToRGBA(v: f32) -> vec4f {\n if (v <= 0.0) { return vec4f(0.0); }\n if (v >= 1.0) { return vec4f(1.0); }\n let a = modf(v * 256.0 * 256.0 * 256.0);\n let b = modf(a.whole * SHIFT_RIGHT_8);\n let g = modf(b.whole * SHIFT_RIGHT_8);\n return vec4f(g.whole * INV_255, g.fract * PACK_UPSCALE, b.fract * PACK_UPSCALE, a.fract);\n}\n`,kd=`${Od}\nfn packDepthToRGB(v: f32) -> vec3f {\n if (v <= 0.0) { return vec3f(0.0); }\n if (v >= 1.0) { return vec3f(1.0); }\n let b = modf(v * 256.0 * 256.0);\n let g = modf(b.whole * SHIFT_RIGHT_8);\n return vec3f(g.whole * INV_255, g.fract * PACK_UPSCALE, b.fract);\n}\n`,Rd=`${Od}\nfn packDepthToRG(v: f32) -> vec2f {\n if (v <= 0.0) { return vec2f(0.0); }\n if (v >= 1.0) { return vec2f(1.0); }\n let g = modf(v * 256.0);\n return vec2f(g.whole * INV_255, g.fract);\n}\n`;function Ld(A){return A===Td||A===Ud||A===Nd||A===Pd}function jd(A){const t=String(A);return/[eE.]/.test(t)?t:`${t}.0`}const zd=(A,t)=>{const e=t?.material?.defines,i=Ld(e?.get("DEPTH_PACKING"))?e.get("DEPTH_PACKING"):Td,s=e?.get("ALPHATEST"),n="number"==typeof s&&s>0?s:0,r="material.color.a * mapSample.a * alphaMapSample.g * vertexColor.a",a="let fragZ = in.vDepthZW.x / in.vDepthZW.y;";let o;return o=i===Td?n>0?`let coverage = ${r};\n if (coverage < ${jd(n)}) { discard; }\n ${a}\n return vec4f(vec3f(fragZ), coverage);`:`${a}\n let coverage = ${r};\n return vec4f(vec3f(fragZ), coverage);`:`${n>0?`let coverage = ${r};\n if (coverage < ${jd(n)}) { discard; }\n `:"if (mapSample.a * alphaMapSample.g * vertexColor.a == 0.0) { discard; }\n "}${a}\n ${i===Ud?"return packDepthToRGBA(1.0 - fragZ);":i===Nd?"return vec4f(packDepthToRGB(1.0 - fragZ), 1.0);":"return vec4f(packDepthToRG(1.0 - fragZ), 0.0, 1.0);"}`,`${i===Ud?Fd:i===Nd?kd:i===Pd?Rd:""}\n@vertex fn vertexMain() -> VertexOutput {\n let clip = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);\n out.clipPosition = clip;\n out.vDepthZW = clip.zw;\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n ${o}\n}\n`},Gd=(A,t)=>{const e=t?.material?.defines?.get("ALPHATEST"),i="number"==typeof e&&e>0?e:0;return`\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * vec4f(out.vWorldPos, 1.0);\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n ${i>0?`let coverage = mapSample.a * alphaMapSample.g;\n if (coverage < ${function(A){const t=String(A);return/[eE.]/.test(t)?t:`${t}.0`}(i)}) { discard; }\n `:""}let dist = length(in.vWorldPos - material.referencePosition);\n return vec4f(saturate((dist - material.nearDistance) / (material.farDistance - material.nearDistance)), 0.0, 0.0, 1.0);\n}\n`},Yd=(A,t)=>{const e=t?.material?.defines,i=e?.get("ALPHATEST"),s="number"==typeof i&&i>0?i:0;return`\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n var N = ${1===e?.get("FLAT_SHADING")?"normalize(cross(dpdx(in.vWorldPos), dpdy(in.vWorldPos)))":"normalize(select(-in.vNormal, in.vNormal, frontFacing))"};\n N = normalize(mix(N, normalize(normalMapSample.xyz * 2.0 - 1.0), 0.35 * normalMapSample.a));\n let coverage = material.color.a * mapSample.a * alphaMapSample.g * vertexColor.a;\n ${s>0?`if (coverage < ${function(A){const t=String(A);return/[eE.]/.test(t)?t:`${t}.0`}(s)}) { discard; }\n `:""}let albedo = material.color.rgb * mapSample.rgb * vertexColor.rgb;\n let V = normalize(camera.cameraPosition - in.vWorldPos);\n let lit = applyLambert(in.vWorldPos, N, V, albedo, lightMapSample.rgb * material.lightMapIntensity);\n return vec4f(lit + material.emissive * material.emissiveIntensity, coverage);\n}\n`},Hd=17/255,Kd=(A,t)=>{const e=t?.material?.defines,i=e?.get("ALPHATEST"),s="number"==typeof i&&i>0?i:0;return`\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n var N = ${1===e?.get("FLAT_SHADING")?"normalize(cross(dpdx(in.vWorldPos), dpdy(in.vWorldPos)))":"normalize(select(-in.vNormal, in.vNormal, frontFacing))"};\n N = normalize(mix(N, normalize(normalMapSample.xyz * 2.0 - 1.0), 0.35 * normalMapSample.a));\n let coverage = material.color.a * mapSample.a * alphaMapSample.g * vertexColor.a;\n ${s>0?`if (coverage < ${function(A){const t=String(A);return/[eE.]/.test(t)?t:`${t}.0`}(s)}) { discard; }\n `:""}let albedo = material.color.rgb * mapSample.rgb * vertexColor.rgb;\n let V = normalize(camera.cameraPosition - in.vWorldPos);\n let lit = applyPhong(in.vWorldPos, N, V, albedo, material.specular, material.shininess, specularMapSample.r, lightMapSample.rgb * material.lightMapIntensity);\n return vec4f(lit + material.emissive * material.emissiveIntensity, coverage);\n}\n`},Vd="fn tangentNormal(viewPos: vec3f, N: vec3f, uv: vec2f, mapN: vec3f, flipTB: f32) -> vec3f {\n let q0 = dpdx(viewPos);\n let q1 = dpdy(viewPos);\n let st0 = dpdx(uv);\n let st1 = dpdy(uv);\n let q1perp = cross(q1, N);\n let q0perp = cross(N, q0);\n var T = q1perp * st0.x + q0perp * st1.x;\n var B = q1perp * st0.y + q0perp * st1.y;\n let det = max(dot(T, T), dot(B, B));\n if (det == 0.0) { return N; }\n let s = inverseSqrt(det) * flipTB;\n T = T * s;\n B = B * s;\n let n = T * mapN.x + B * mapN.y + N * mapN.z;\n return normalize(select(n, N, dot(n, n) == 0.0));\n}\n",Jd="fn perturbNormalArb(surfPos: vec3f, surfNorm: vec3f, dHdxy: vec2f, faceDirection: f32) -> vec3f {\n let vSigmaX = dpdx(surfPos);\n let vSigmaY = dpdy(surfPos);\n let R1 = cross(vSigmaY, surfNorm);\n let R2 = cross(surfNorm, vSigmaX);\n let fDet = dot(vSigmaX, R1) * faceDirection;\n let vGrad = sign(fDet) * (dHdxy.x * R1 + dHdxy.y * R2);\n let n = abs(fDet) * surfNorm - vGrad;\n return normalize(select(n, surfNorm, dot(n, n) == 0.0));\n}\n";function Wd(A,t){const e=A?.getBinding(t);return null!=e&&!e.isSkipBinding()}const qd=(A,t)=>{const e=t?.material,i=e?.defines,s=i?.get("ALPHATEST"),n="number"==typeof s&&s>0?s:0,r=1===i?.get("FLAT_SHADING"),a=0!==i?.get("FOG"),o=e?.side??Fn.Front,l=!0===t?.isSupportFamily,c=Wd(e,"normalMap"),h=!c&&Wd(e,"bumpMap"),u=Wd(e,"gradientMap"),g=Wd(e,"aoMap"),d=Wd(e,"emissiveMap"),p=Wd(e,"alphaMap"),f=Wd(e,"lightMap"),m=[];let C;const w=function(A,t){return A?"normalize(cross(dpdx(in.vWorldPos), dpdy(in.vWorldPos)))":t===Fn.Double?"normalize(select(-in.vNormal, in.vNormal, frontFacing))":t===Fn.Back?"normalize(-in.vNormal)":"normalize(in.vNormal)"}(r,o);c?(m.push(Vd),C=`let N0 = ${w};\n let rawN = normalMapSample.xyz * 2.0 - 1.0;\n let mapN = vec3f(rawN.xy * material.normalScale, rawN.z);\n let N = tangentNormal(in.vWorldPos, N0, ${l?"(in.vUv * materialRowData.normalMapUvScale)":"in.vUv"}, mapN, ${o!==Fn.Double||r?"1.0":"select(-1.0, 1.0, frontFacing)"});`):h?(m.push(Jd),C=`let N0 = ${w};\n let H = (${l?"sampleTexture(in.vUv, materialRowData.bumpMapUvScale, materialRowData.bumpMapIndex, materialRowData.bumpMapSamplerIndex, vec4f(0.0)).r":"textureSample(bumpMap, bumpMapSampler, in.vUv).r"}) * material.bumpScale;\n let N = perturbNormalArb(in.vWorldPos, N0, vec2f(dpdx(H), dpdy(H)), ${o===Fn.Double?"select(-1.0, 1.0, frontFacing)":o===Fn.Back?"-1.0":"1.0"});`):C=`let N = ${w};`;const y=u?"":"let toonDx = dpdx(N);\n let toonDy = dpdy(N);\n ",B=f?", lightMapSample.rgb * material.lightMapIntensity":"";let I;I=u&&l?`applyToonTexFamily(in.vWorldPos, N, V, albedo${B}, materialRowData.gradientMapUvScale, materialRowData.gradientMapIndex, materialRowData.gradientMapSamplerIndex)`:u?`applyToonTex(in.vWorldPos, N, V, albedo${B})`:`applyToon(in.vWorldPos, N, V, toonDx, toonDy, albedo${B})`;const Q=g?"pbrAo = mix(1.0, aoMapSample.r, material.aoMapIntensity);\n ":"",E=d?"material.emissive * material.emissiveIntensity * emissiveMapSample.rgb":"material.emissive * material.emissiveIntensity",x=p?" * alphaMapSample.g":"",D=n>0?`if (coverage < ${function(A){const t=String(A);return/[eE.]/.test(t)?t:`${t}.0`}(n)}) { discard; }\n `:"",M=a?"let lit = applySceneFog(rgb, in.vWorldPos);\n return vec4f(lit, coverage);":"return vec4f(rgb, coverage);";return`${m.join("\n")}\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n ${C}\n ${y}let coverage = material.color.a * mapSample.a * vertexColor.a${x};\n ${D}${Q}let albedo = material.color.rgb * mapSample.rgb * vertexColor.rgb;\n let V = normalize(camera.cameraPosition - in.vWorldPos);\n let rgb = ${I} + ${E};\n ${M}\n}\n`},Xd=(A,t)=>{const e=t?.material,i=0!==e?.defines?.get("FOG"),s=e?.side??Fn.Front;return`\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n let N = ${s===Fn.Double?"normalize(select(-in.vNormal, in.vNormal, frontFacing))":s===Fn.Back?"normalize(-in.vNormal)":"normalize(in.vNormal)"};\n let tint = material.color * mapSample * vertexColor;\n let shadow = applyShadow(in.vWorldPos, N);\n ${i?"let lit = applySceneFog(tint.rgb, in.vWorldPos);\n return vec4f(lit, tint.a * (1.0 - shadow));":"return vec4f(tint.rgb, tint.a * (1.0 - shadow));"}\n}\n`},Zd=[{name:"worldC0",type:"vec4f",assign:"worldMatrix[0]"},{name:"worldC1",type:"vec4f",assign:"worldMatrix[1]"},{name:"worldC2",type:"vec4f",assign:"worldMatrix[2]"},{name:"worldC3",type:"vec4f",assign:"worldMatrix[3]"}],_d=()=>"\nfn volumeInv(v: f32) -> f32 {\n let s = select(1.0, -1.0, v < 0.0);\n return select(1.0 / v, s * 1e16, abs(v) < 1e-8);\n}\n\nfn volumeRayBox(ro: vec3f, rd: vec3f, e: vec3f) -> vec2f {\n let inv = vec3f(volumeInv(rd.x), volumeInv(rd.y), volumeInv(rd.z));\n let t0 = (-e - ro) * inv;\n let t1 = (e - ro) * inv;\n let tmin = min(t0, t1);\n let tmax = max(t0, t1);\n return vec2f(max(max(tmin.x, tmin.y), tmin.z), min(min(tmax.x, tmax.y), tmax.z));\n}\n\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);\n return out;\n}\n\nfn volumeAffine(M: mat4x4f, p: vec3f) -> vec3f {\n return vec3f(M[0].xyz * p.x + M[1].xyz * p.y + M[2].xyz * p.z) + M[3].xyz;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n let M = mat4x4f(in.worldC0, in.worldC1, in.worldC2, in.worldC3);\n let a = M[0].xyz;\n let b = M[1].xyz;\n let c = M[2].xyz;\n let r0 = cross(b, c);\n let det = dot(r0, a);\n if (abs(det) < 1e-12) { return vec4f(0.0); }\n let iR = transpose(mat3x3f(r0, cross(c, a), cross(a, b))) * (1.0 / det);\n let origin = M[3].xyz;\n let localCam = iR * (camera.cameraPosition - origin);\n let localHit = iR * (in.vWorldPos - origin);\n var rd = localHit - localCam;\n let span = length(rd);\n rd = rd / max(span, 1e-4);\n let hit = volumeRayBox(localCam, rd, max(material.extent, vec3f(0.0)));\n let t0 = max(hit.x, 0.0);\n let t1 = min(hit.y, span);\n if (t1 <= t0) { return vec4f(0.0); }\n let entryW = volumeAffine(M, localCam + rd * t0);\n let exitW = volumeAffine(M, localCam + rd * t1);\n let vol = applyVolume(entryW, exitW, material.color.rgb, material.density, material.emissive, material.steps, material.dither, in.clipPosition.xy);\n return vec4f(vol.rgb, vol.a * material.color.a);\n}\n",$d=(A,t)=>{const e=t?.material,i=e?.defines,s=0!==i?.get("FOG"),n=1===i?.get("ALPHATEST"),r=e?.getBinding("alphaMap");return`\n@vertex fn vertexMain() -> VertexOutput {\n let origin = worldMatrix[3];\n var viewPos = stableView(origin.xyz);\n var scale = vec2f(length(worldMatrix[0].xyz), length(worldMatrix[1].xyz));\n if (material.sizeAttenuation < 0.5 && camera.projectionMatrix[2].w < -0.5) {\n scale *= -viewPos.z;\n }\n let aligned = in.position.xy * scale;\n var rotated = aligned;\n let rotation = material.rotation;\n if (rotation != 0.0) {\n let c = cos(rotation);\n let s = sin(rotation);\n rotated = vec2f(c * aligned.x - s * aligned.y, s * aligned.x + c * aligned.y);\n }\n viewPos = vec4f(viewPos.x + rotated.x, viewPos.y + rotated.y, viewPos.z, viewPos.w);\n out.clipPosition = camera.projectionMatrix * viewPos;${s?"\n out.vWorldPos = origin.xyz;":""}\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n let coverage = material.color.a * mapSample.a${null==r||r.isSkipBinding()?"":" * alphaMapSample.g"} * vertexColor.a;\n ${n?"if (coverage < material.alphaTest) { discard; }\n ":""}${s?"var rgb = material.color.rgb * mapSample.rgb * vertexColor.rgb;\n "+(s?"if (sceneParams.fogEnabled > 0.5) {\n let d = distance(in.vWorldPos, camera.cameraPosition);\n var fogT = 0.0;\n if (sceneParams.fogMode > 0.5) {\n let dd = sceneParams.fogDensity * d;\n fogT = 1.0 - exp(-dd * dd);\n } else {\n fogT = saturate((d - sceneParams.fogNear) / max(sceneParams.fogFar - sceneParams.fogNear, 1e-4));\n }\n rgb = mix(rgb, sceneParams.fogColor, fogT);\n }\n ":""):"let rgb = material.color.rgb * mapSample.rgb * vertexColor.rgb;\n "}return vec4f(rgb, coverage);\n}\n`},Ap=(A,t)=>{const e=t?.material,i=0!==e?.defines?.get("FOG"),s=e?.defines?.get("ALPHATEST"),n="number"==typeof s&&s>0?`let coverage = material.color.a * mapSample.a * vertexColor.a;\n if (coverage < ${function(A){const t=String(A);return/[eE.]/.test(t)?t:`${t}.0`}(s)}) { discard; }\n `:"",r=t?.geometry?.getAttribute("lineDistance"),a=!0===e?.isLineDashedMaterial&&"f32"===r?.typeInfo.wgslType;return`\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);${a?"\n out.vLineDistance = in.lineDistance * material.scale;":""}\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n ${n}${a?"let period = material.dashSize + material.gapSize;\n if (period > 0.0) {\n let along = in.vLineDistance;\n if (along - floor(along / period) * period > material.dashSize) { discard; }\n }\n ":""}${i?"var rgb = material.color.rgb * mapSample.rgb * vertexColor.rgb;\n if (sceneParams.fogEnabled > 0.5) {\n let d = distance(in.vWorldPos, camera.cameraPosition);\n var fogT = 0.0;\n if (sceneParams.fogMode > 0.5) {\n let dd = sceneParams.fogDensity * d;\n fogT = 1.0 - exp(-dd * dd);\n } else {\n fogT = saturate((d - sceneParams.fogNear) / max(sceneParams.fogFar - sceneParams.fogNear, 1e-4));\n }\n rgb = mix(rgb, sceneParams.fogColor, fogT);\n }\n return vec4f(rgb, material.color.a * mapSample.a * vertexColor.a);":"return material.color * mapSample * vertexColor;"}\n}\n`};class tp extends Ng{type="LineBasicMaterial";isLineBasicMaterial=!0;constructor(A){super(A,{shader:Ap,isSupportFamily:!0}),this.color.set(1,1,1,1),new.target===tp&&this.setValues(A)}get fog(){return 0!==this.defines.get("FOG")}set fog(A){A?this.defines.delete("FOG"):this.defines.set("FOG",0)}}const ep=(A,t)=>{const e=t?.material,i=e?.defines,s=i?.get("ALPHATEST"),n="number"==typeof s&&s>0?s:0,r=1===i?.get("FLAT_SHADING"),a=e?.side===Fn.Double,o=!0===t?.isSupportFamily,l=e?.getBinding("normalMap"),c=null!=l&&!l.isSkipBinding(),h=e?.getBinding("bumpMap"),u=!c&&null!=h&&!h.isSkipBinding(),g=r?"normalize((camera.viewMatrix * vec4f(cross(dpdx(in.vWorldPos), dpdy(in.vWorldPos)), 0.0)).xyz)":a?"normalize((camera.viewMatrix * vec4f(select(-in.vNormal, in.vNormal, frontFacing), 0.0)).xyz)":"normalize((camera.viewMatrix * vec4f(in.vNormal, 0.0)).xyz)";let d,p="";return c?(p=Vd,d=`let viewPos = (camera.viewMatrix * vec4f(in.vWorldPos, 1.0)).xyz;\n let N0 = ${g};\n let raw = normalMapSample.xyz * 2.0 - 1.0;\n let mapN = vec3f(raw.xy * material.normalScale, raw.z);\n let N = tangentNormal(viewPos, N0, ${o?"(in.vUv * materialRowData.normalMapUvScale)":"in.vUv"}, mapN, ${a&&!r?"select(-1.0, 1.0, frontFacing)":"1.0"});`):u?(p=Jd,d=`let viewPos = (camera.viewMatrix * vec4f(in.vWorldPos, 1.0)).xyz;\n let N0 = ${g};\n let H = (${o?"sampleTexture(in.vUv, materialRowData.bumpMapUvScale, materialRowData.bumpMapIndex, materialRowData.bumpMapSamplerIndex, vec4f(0.0)).x":"textureSample(bumpMap, bumpMapSampler, in.vUv).x"}) * material.bumpScale;\n let N = perturbNormalArb(viewPos, N0, vec2f(dpdx(H), dpdy(H)), ${a?"select(-1.0, 1.0, frontFacing)":e?.side===Fn.Back?"-1.0":"1.0"});`):d=`let N = ${g};`,`${p}\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n ${d}\n let coverage = material.color.a * mapSample.a * vertexColor.a;\n ${n>0?`if (coverage < ${function(A){const t=String(A);return/[eE.]/.test(t)?t:`${t}.0`}(n)}) { discard; }\n `:""}return vec4f(N * 0.5 + 0.5, coverage);\n}\n`},ip=(A,t)=>{const e=t?.material,i=e?.defines,s=i?.get("ALPHATEST"),n="number"==typeof s&&s>0?s:0,r=1===i?.get("FLAT_SHADING"),a=0!==i?.get("FOG"),o=e?.side===Fn.Double,l=!0===t?.isSupportFamily,c=e?.getBinding("normalMap"),h=null!=c&&!c.isSkipBinding(),u=e?.getBinding("bumpMap"),g=!h&&null!=u&&!u.isSkipBinding(),d=e?.getBinding("matcap"),p=null!=d&&!d.isSkipBinding(),f=r?"normalize((camera.viewMatrix * vec4f(cross(dpdx(in.vWorldPos), dpdy(in.vWorldPos)), 0.0)).xyz)":o?"normalize((camera.viewMatrix * vec4f(select(-in.vNormal, in.vNormal, frontFacing), 0.0)).xyz)":"normalize((camera.viewMatrix * vec4f(in.vNormal, 0.0)).xyz)";let m,C="";return h?(C=Vd,m=`let N0 = ${f};\n let raw = normalMapSample.xyz * 2.0 - 1.0;\n let mapN = vec3f(raw.xy * material.normalScale, raw.z);\n let N = tangentNormal(viewPos, N0, ${l?"(in.vUv * materialRowData.normalMapUvScale)":"in.vUv"}, mapN, ${o&&!r?"select(-1.0, 1.0, frontFacing)":"1.0"});`):g?(C=Jd,m=`let N0 = ${f};\n let H = (${l?"sampleTexture(in.vUv, materialRowData.bumpMapUvScale, materialRowData.bumpMapIndex, materialRowData.bumpMapSamplerIndex, vec4f(0.0)).x":"textureSample(bumpMap, bumpMapSampler, in.vUv).x"}) * material.bumpScale;\n let N = perturbNormalArb(viewPos, N0, vec2f(dpdx(H), dpdy(H)), ${o?"select(-1.0, 1.0, frontFacing)":e?.side===Fn.Back?"-1.0":"1.0"});`):m=`let N = ${f};`,`${C}\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n let viewPos = (camera.viewMatrix * vec4f(in.vWorldPos, 1.0)).xyz;\n ${m}\n let viewDir = normalize(-viewPos);\n let x = normalize(vec3f(viewDir.z, 0.0, -viewDir.x));\n let y = cross(viewDir, x);\n let matcapUv = vec2f(dot(x, N), dot(y, N)) * 0.495 + 0.5;\n let matcapRgb = ${p?l?"sampleTexture(matcapUv, materialRowData.matcapUvScale, materialRowData.matcapIndex, materialRowData.matcapSamplerIndex, vec4f(0.0)).rgb":"textureSample(matcap, matcapSampler, matcapUv).rgb":"vec3f(mix(0.2, 0.8, matcapUv.y))"};\n let coverage = material.color.a * mapSample.a * alphaMapSample.g * vertexColor.a;\n ${n>0?`if (coverage < ${function(A){const t=String(A);return/[eE.]/.test(t)?t:`${t}.0`}(n)}) { discard; }\n `:""}${a?"var rgb = material.color.rgb * mapSample.rgb * vertexColor.rgb * matcapRgb;\n "+(a?"if (sceneParams.fogEnabled > 0.5) {\n let d = distance(in.vWorldPos, camera.cameraPosition);\n var fogT = 0.0;\n if (sceneParams.fogMode > 0.5) {\n let dd = sceneParams.fogDensity * d;\n fogT = 1.0 - exp(-dd * dd);\n } else {\n fogT = saturate((d - sceneParams.fogNear) / max(sceneParams.fogFar - sceneParams.fogNear, 1e-4));\n }\n rgb = mix(rgb, sceneParams.fogColor, fogT);\n }\n ":""):"let rgb = material.color.rgb * mapSample.rgb * vertexColor.rgb * matcapRgb;\n "}return vec4f(rgb, coverage);\n}\n`};function sp(A,t){const e=A?.getBinding(t);return null!=e&&!e.isSkipBinding()}function np(A,t,e,i,s){return A.family?`sampleTexture(${e}, materialRowData.${t}UvScale, materialRowData.${t}Index, materialRowData.${t}SamplerIndex, ${i}).${s}`:`textureSample(${t}, ${t}Sampler, ${e}).${s}`}function rp(A,t){return A.family?`(in.vUv * materialRowData.${t}UvScale)`:"in.vUv"}function ap(A,t){const e=function(A){const t=A?.material,e=t?.defines,i=e?.get("ALPHATEST"),s=1===e?.get("TRANSMISSION");return{family:!0===A?.isSupportFamily,side:t?.side??"front",flat:1===e?.get("FLAT_SHADING"),fog:0!==e?.get("FOG"),env:1===e?.get("ENV_SCALE"),alphaTest:"number"==typeof i&&i>0?i:0,normalLive:sp(t,"normalMap"),bumpLive:sp(t,"bumpMap"),roughMap:sp(t,"roughnessMap"),metalMap:sp(t,"metalnessMap"),emissiveMap:sp(t,"emissiveMap"),alphaMap:sp(t,"alphaMap"),ao:sp(t,"aoMap"),clearcoat:1===e?.get("CLEARCOAT"),ccMap:sp(t,"clearcoatMap"),ccRoughMap:sp(t,"clearcoatRoughnessMap"),ccNormal:sp(t,"clearcoatNormalMap"),sheen:1===e?.get("SHEEN"),sheenColorMap:sp(t,"sheenColorMap"),sheenRoughMap:sp(t,"sheenRoughnessMap"),anisotropy:1===e?.get("ANISOTROPY"),anisoMap:sp(t,"anisotropyMap"),transmission:s,transMap:sp(t,"transmissionMap"),thickMap:sp(t,"thicknessMap"),dispersion:s&&1===e?.get("DISPERSION"),iridescence:1===e?.get("IRIDESCENCE"),iriMap:sp(t,"iridescenceMap"),iriThickMap:sp(t,"iridescenceThicknessMap"),retro:1===e?.get("RETRO"),glassRim:1===e?.get("GLASS_RIM"),specColorMap:sp(t,"specularColorMap"),specIMap:sp(t,"specularIntensityMap")}}(A);if("applyLightingBaked"===t&&"front"===(i=e).side&&!i.flat&&i.fog&&!i.env&&0===i.alphaTest&&!i.normalLive&&!i.bumpLive&&!i.roughMap&&!i.metalMap&&!i.emissiveMap&&!i.alphaMap&&!i.ao)return"\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n let albedo = material.color.rgb * mapSample.rgb * vertexColor.rgb;\n var N = normalize(in.vNormal);\n // normalMapSample.a:有图≈1,空槽 Assembler 注入 0 → 不扰动\n N = normalize(mix(N, normalize(normalMapSample.xyz * 2.0 - 1.0), 0.35 * normalMapSample.a));\n let V = normalize(camera.cameraPosition - in.vWorldPos);\n let lit = applyLightingBaked(in.vWorldPos, N, V, albedo, material.roughness, material.metalness, in.clipPosition, lightMapSample.rgb * material.lightMapIntensity);\n return vec4f(lit + material.emissive * material.emissiveIntensity, material.color.a * mapSample.a * vertexColor.a);\n}\n";var i;const s=e.roughMap?"saturate(material.roughness * roughnessMapSample.g)":"material.roughness",n=e.metalMap?"saturate(material.metalness * metalnessMapSample.b)":"material.metalness",r="lightMapSample.rgb * material.lightMapIntensity",a=e.emissiveMap?"material.emissive * material.emissiveIntensity * emissiveMapSample.rgb":"material.emissive * material.emissiveIntensity",o=e.alphaMap?" * alphaMapSample.g":"",l=e.alphaTest>0?`if (coverage < ${function(A){const t=String(A);return/[eE.]/.test(t)?t:`${t}.0`}(e.alphaTest)}) { discard; }\n `:"",c=[];let h;if((e.normalLive||e.ccNormal)&&c.push(Vd),e.bumpLive&&!e.normalLive&&c.push(Jd),"applyPhysical"===t&&(e.iridescence&&c.push("\nconst IRI_XYZ: mat3x3f = mat3x3f(\n vec3f(3.2404542, -0.9692660, 0.0556434),\n vec3f(-1.5371385, 1.8760108, -0.2040259),\n vec3f(-0.4985314, 0.0415560, 1.0572252),\n);\n\nfn iriSensitivity(opd: f32, shift: vec3f) -> vec3f {\n let phase = 6.2831853 * opd * 1e-9;\n let val = vec3f(5.4856e-13, 4.4201e-13, 5.2481e-13);\n let pos = vec3f(1.6810e+06, 1.7953e+06, 2.2084e+06);\n let vr = vec3f(4.3278e+09, 9.3046e+09, 6.6121e+09);\n var xyz = val * sqrt(6.2831853 * vr) * cos(pos * phase + shift) * exp(-phase * phase * vr);\n xyz.x += 9.7470e-14 * sqrt(6.2831853 * 4.5282e+09) * cos(2.2399e+06 * phase + shift.x) * exp(-4.5282e+09 * phase * phase);\n xyz /= 1.0685e-7;\n return IRI_XYZ * xyz;\n}\n\nfn evalIridescence(eta2: f32, cosTheta1: f32, thin: f32, baseF0: vec3f) -> vec3f {\n let outsideIOR = 1.0;\n let iridescenceIOR = mix(outsideIOR, eta2, smoothstep(0.0, 0.03, thin));\n let sinTheta2Sq = pow(outsideIOR / iridescenceIOR, 2.0) * (1.0 - cosTheta1 * cosTheta1);\n let cosTheta2Sq = 1.0 - sinTheta2Sq;\n if (cosTheta2Sq < 0.0) { return vec3f(1.0); }\n let cosTheta2 = sqrt(cosTheta2Sq);\n let R0 = pow((iridescenceIOR - outsideIOR) / (iridescenceIOR + outsideIOR), 2.0);\n let R12 = R0 + (1.0 - R0) * pow(1.0 - cosTheta1, 5.0);\n let T121 = 1.0 - R12;\n let phi12 = select(0.0, 3.14159265, iridescenceIOR < outsideIOR);\n let phi21 = 3.14159265 - phi12;\n let baseIOR = (vec3f(1.0) + sqrt(clamp(baseF0, vec3f(0.0), vec3f(0.9999)))) / (vec3f(1.0) - sqrt(clamp(baseF0, vec3f(0.0), vec3f(0.9999))));\n let R1 = pow((baseIOR - vec3f(iridescenceIOR)) / (baseIOR + vec3f(iridescenceIOR)), vec3f(2.0));\n let R23 = R1 + (vec3f(1.0) - R1) * pow(1.0 - cosTheta2, 5.0);\n var phi23 = vec3f(0.0);\n if (baseIOR.x < iridescenceIOR) { phi23.x = 3.14159265; }\n if (baseIOR.y < iridescenceIOR) { phi23.y = 3.14159265; }\n if (baseIOR.z < iridescenceIOR) { phi23.z = 3.14159265; }\n let OPD = 2.0 * iridescenceIOR * thin * cosTheta2;\n let phi = vec3f(phi21) + phi23;\n let R123 = clamp(R12 * R23, vec3f(1e-5), vec3f(0.9999));\n let r123 = sqrt(R123);\n let Rs = (T121 * T121) * R23 / (vec3f(1.0) - R123);\n var I = R12 + Rs;\n var Cm = Rs - vec3f(T121);\n for (var m = 1; m <= 2; m++) {\n Cm *= r123;\n I += Cm * (2.0 * iriSensitivity(f32(m) * OPD, f32(m) * phi));\n }\n return max(I, vec3f(0.0));\n}\n"),c.push(function(A){const t=A.transmission?" * (1.0 - saturate(physTrans))":"",e=A.ao?" * pbrAo":"",i=A.env?" * envScale":"",s=function(A){const t=[];return A.sheen&&t.push("let sheenNv = max(dot(N, V), 0.0);\n let sheenA = saturate(1.0 - physSheenRough) * (0.2 + 0.8 * (1.0 - sheenNv));\n let sheenMax = max(physSheenColor.r, max(physSheenColor.g, physSheenColor.b)) * physSheen;\n ibl *= saturate(1.0 - sheenMax * sheenA);\n ibl += textureSampleLevel(envIrradiance, envSampler, N, 0.0).rgb * physSheenColor * physSheen * sheenA * sceneParams.iblIntensity;"),A.clearcoat&&t.push("let ccNv = max(dot(physCcN, V), 0.0);\n let ccFv = 0.04 + 0.96 * pow(1.0 - ccNv, 5.0);\n ibl *= (1.0 - saturate(physCc) * ccFv);\n let ccLod = physCcRough * physCcRough * sceneParams.iblMaxLod;\n ibl += textureSampleLevel(envRadiance, envSampler, reflect(-V, physCcN), ccLod).rgb * ccFv * physCc * sceneParams.iblIntensity;"),t.join("\n ")}(A);let n;if(A.transmission||s)if(A.transmission){const e=A.dispersion?"let spread = dispersion * 0.04;\n let etaR = clamp(eta * (1.0 + spread), 0.001, 0.999);\n let etaB = clamp(eta * (1.0 - spread), 0.001, 0.999);\n let trans = vec3f(\n textureSampleLevel(envRadiance, envSampler, refract(-V, N, etaR), lod).r,\n textureSampleLevel(envRadiance, envSampler, refract(-V, N, eta), lod).g,\n textureSampleLevel(envRadiance, envSampler, refract(-V, N, etaB), lod).b\n );":"let trans = textureSampleLevel(envRadiance, envSampler, refract(-V, N, eta), lod).rgb;";n=`let intensity = sceneParams.iblIntensity;\n if (intensity > 0.0) {\n let nv = max(dot(N, V), 0.0);\n let R = reflect(-V, N);\n let irr = textureSampleLevel(envIrradiance, envSampler, N, 0.0).rgb;\n let lod = roughness * roughness * sceneParams.iblMaxLod;\n var specEnv = textureSampleLevel(envRadiance, envSampler, R, lod).rgb;\n if (sceneParams.iblMaxLod < 0.5) {\n specEnv = mix(specEnv, irr, roughness * roughness);\n }\n let brdf = textureSampleLevel(envBrdfLut, envSampler, vec2f(nv, roughness), 0.0).rg;\n let fres = F0 + (vec3f(1.0) - F0) * pow(1.0 - nv, 5.0);\n var ibl = (irr * albedo * (1.0 - metal)${t}${A.ao?" * pbrAo":""} + specEnv * (F0 * brdf.x + brdf.y)${A.ao?" * saturate(pow(nv + pbrAo, exp2(-16.0 * roughness - 1.0)) - 1.0 + pbrAo)":""}) * intensity;\n let eta = clamp(1.0 / max(ior, 1.0001), 0.001, 0.999);\n ${e}\n ibl += trans * (vec3f(1.0) - fres) * physTrans * physAtten * intensity;\n ${s}\n rgb += ibl${i};\n }`}else n=`var ibl = applyIbl(N, V, albedo, roughness, metal, F0);\n if (sceneParams.iblIntensity > 0.0) {\n ${s}\n }\n rgb += ibl${i};`;else n=`rgb += applyIbl(N, V, albedo, roughness, metal, F0)${i};`;const r=A.fog?"return applySceneFog(rgb, P);":"return rgb;";return`fn applyPhysical(\n P: vec3f, N: vec3f, V: vec3f,\n albedo: vec3f, roughness: f32, metal: f32,\n F0: vec3f,\n bakedIrradiance: vec3f${A.env?",\n envScale: f32":""}${A.transmission?",\n ior: f32"+(A.dispersion?",\n dispersion: f32":""):""}\n) -> vec3f {\n var rgb = shadeSceneLights(P, N, V, albedo, roughness, metal, F0);\n ${n}\n rgb += bakedIrradiance * albedo * (1.0 - metal)${t}${e};\n ${r}\n}\n`}(e))),"applyPhysical"===t){const A=e.specIMap?" * specularIntensityMapSample.a":"",t=e.specColorMap?" * specularColorMapSample.rgb":"",i=e.ao?"pbrAo = mix(1.0, aoMapSample.r, material.aoMapIntensity);\n ":"",a=function(A){const t=[];if(A.clearcoat){const e=A.ccMap?` * ${np(A,"clearcoatMap","in.vUv","vec4f(1.0)","r")}`:"",i=A.ccRoughMap?` * ${np(A,"clearcoatRoughnessMap","in.vUv","vec4f(1.0)","g")}`:"";if(t.push(`physCc = material.clearcoat${e};`),t.push(`physCcRough = saturate(material.clearcoatRoughness${i});`),A.ccNormal){const e=rp(A,"clearcoatNormalMap"),i="double"!==A.side||A.flat?"1.0":"select(-1.0, 1.0, frontFacing)";t.push(`let ccRaw = ${np(A,"clearcoatNormalMap","in.vUv","vec4f(0.5, 0.5, 1.0, 1.0)","xyz")} * 2.0 - 1.0;`),t.push("let ccMapN = vec3f(ccRaw.xy * material.clearcoatNormalScale, ccRaw.z);"),t.push(`physCcN = tangentNormal(in.vWorldPos, N, ${e}, ccMapN, ${i});`)}else t.push("physCcN = N;")}if(A.sheen){const e=A.sheenColorMap?` * ${np(A,"sheenColorMap","in.vUv","vec4f(1.0)","rgb")}`:"",i=A.sheenRoughMap?` * ${np(A,"sheenRoughnessMap","in.vUv","vec4f(1.0)","a")}`:"";t.push("physSheen = material.sheen;"),t.push(`physSheenColor = material.sheenColor${e};`),t.push(`physSheenRough = saturate(material.sheenRoughness${i});`)}if(A.anisotropy){const e=A.anisoMap?rp(A,"anisotropyMap"):"in.vUv";A.anisoMap&&t.push(`let anisoMap = ${np(A,"anisotropyMap","in.vUv","vec4f(1.0, 0.5, 1.0, 1.0)","rgb")};`);const i=A.anisoMap?" * anisoMap.b":"",s=A.anisoMap?"anisoMap.rg * 2.0 - 1.0":"vec2f(1.0, 0.0)";t.push(`physAniso = saturate(material.anisotropy${i});`),t.push(`let anisoUv = ${e};`),t.push(`let anisoQ0 = dpdx(in.vWorldPos);\n let anisoQ1 = dpdy(in.vWorldPos);\n let anisoS0 = dpdx(anisoUv);\n let anisoS1 = dpdy(anisoUv);\n var anisoT = cross(anisoQ1, N) * anisoS0.x + cross(N, anisoQ0) * anisoS1.x;\n var anisoB = cross(anisoQ1, N) * anisoS0.y + cross(N, anisoQ0) * anisoS1.y;\n let anisoDet = max(dot(anisoT, anisoT), dot(anisoB, anisoB));\n if (anisoDet > 0.0) {\n let anisoS = inverseSqrt(anisoDet);\n anisoT *= anisoS;\n anisoB *= anisoS;\n } else {\n anisoT = normalize(select(vec3f(1.0, 0.0, 0.0), vec3f(0.0, 1.0, 0.0), abs(N.x) > 0.5));\n anisoT = normalize(anisoT - N * dot(anisoT, N));\n anisoB = cross(N, anisoT);\n }\n let anisoDir = ${s};\n let anisoCs = cos(material.anisotropyRotation);\n let anisoSn = sin(material.anisotropyRotation);\n let anisoRot = vec2f(anisoCs * anisoDir.x - anisoSn * anisoDir.y, anisoSn * anisoDir.x + anisoCs * anisoDir.y);\n physT = normalize(anisoT * anisoRot.x + anisoB * anisoRot.y);\n physB = normalize(cross(N, physT));`)}if(A.transmission){const e=A.transMap?` * ${np(A,"transmissionMap","in.vUv","vec4f(1.0)","r")}`:"",i=A.thickMap?` * ${np(A,"thicknessMap","in.vUv","vec4f(1.0)","g")}`:"";t.push(`physTrans = saturate(material.transmission${e});`),t.push(`let thick = max(material.thickness, 0.0)${i};\n let attDist = material.attenuationDistance;\n physAtten = vec3f(1.0);\n if (attDist > 0.0 && thick > 0.0) {\n physAtten = exp(log(max(material.attenuationColor, vec3f(1e-4))) * (thick / attDist));\n }`)}return A.retro&&t.push("physRetro = saturate(material.retroreflectivity);"),t.join("\n ")}(e);h=`${i}${a?`${a}\n `:""}let ior = max(material.ior, 1.0001);\n let specI = material.specularIntensity${A};\n let specC = material.specularColor${t};\n let f0s = (ior - 1.0) / (ior + 1.0);\n let F0 = mix(min(vec3f(f0s * f0s) * specC * specI, vec3f(1.0)), albedo, ${n});\n ${e.iridescence?`let iriW = saturate(material.iridescence${e.iriMap?` * ${np(e,"iridescenceMap","in.vUv","vec4f(1.0)","r")}`:""});\n let iriThick = ${e.iriThickMap?`mix(material.iridescenceThicknessMin, material.iridescenceThicknessMax, ${np(e,"iridescenceThicknessMap","in.vUv","vec4f(0.0)","g")})`:"material.iridescenceThicknessMax"};\n let dielectricF0 = min(vec3f(f0s * f0s) * specC * specI, vec3f(1.0));\n physIriW = iriW;\n physIri = evalIridescence(material.iridescenceIOR, max(dot(N, V), 0.0), iriThick, dielectricF0);\n `:""}let lit = applyPhysical(in.vWorldPos, N, V, albedo, ${s}, ${n}, F0, ${r}${e.env?", material.envMapIntensity":""}${e.transmission?", ior"+(e.dispersion?", material.dispersion":""):""});`}else h=function(A,t,e,i){return!A.env&&A.fog?`${A.ao?"pbrAo = mix(1.0, aoMapSample.r, material.aoMapIntensity);\n ":""}let lit = applyLightingBaked(in.vWorldPos, N, V, albedo, ${t}, ${e}, in.clipPosition, ${i});`:`${A.ao?"pbrAo = mix(1.0, aoMapSample.r, material.aoMapIntensity);\n ":""}let F0 = mix(vec3f(0.04), albedo, ${e});\n var rgb = shadeSceneLights(in.vWorldPos, N, V, albedo, ${t}, ${e}, F0);\n rgb += applyIbl(N, V, albedo, ${t}, ${e}, F0)${A.env?" * material.envMapIntensity":""};\n rgb += (${i}) * albedo * (1.0 - ${e})${A.ao?" * pbrAo":""};\n ${A.fog?"let lit = applySceneFog(rgb, in.vWorldPos);":"let lit = rgb;"}`}(e,s,n,r);return`${c.join("\n")}\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n let albedo = material.color.rgb * mapSample.rgb * vertexColor.rgb;\n ${function(A){const t=function(A){return A.flat?"normalize(cross(dpdx(in.vWorldPos), dpdy(in.vWorldPos)))":"double"===A.side?"normalize(select(-in.vNormal, in.vNormal, frontFacing))":"back"===A.side?"normalize(-in.vNormal)":"normalize(in.vNormal)"}(A);if(A.normalLive)return`let N0 = ${t};\n let rawN = normalMapSample.xyz * 2.0 - 1.0;\n let mapN = vec3f(rawN.xy * material.normalScale, rawN.z);\n let N = tangentNormal(in.vWorldPos, N0, ${rp(A,"normalMap")}, mapN, ${"double"!==A.side||A.flat?"1.0":"select(-1.0, 1.0, frontFacing)"});`;let e=`var N = ${t};\n N = normalize(mix(N, normalize(normalMapSample.xyz * 2.0 - 1.0), 0.35 * normalMapSample.a));`;if(A.bumpLive){const t="double"===A.side?"select(-1.0, 1.0, frontFacing)":"back"===A.side?"-1.0":"1.0";e+=`\n let bumpH = (${np(A,"bumpMap","in.vUv","vec4f(0.0)","x")}) * material.bumpScale;\n N = perturbNormalArb(in.vWorldPos, N, vec2f(dpdx(bumpH), dpdy(bumpH)), ${t});`}return e}(e)}\n let V = normalize(camera.cameraPosition - in.vWorldPos);\n let coverage = material.color.a * mapSample.a * vertexColor.a${o};\n ${l}${h}\n ${e.glassRim?`let glassNv = clamp(abs(dot(N, V)), 0.0, 0.9995);\n let glassOne = max(0.0005, 1.0 - glassNv);\n let glassFine = pow(glassOne, 4.5) * material.glassRim;\n let glassSoft = pow(glassOne, 2.5) * 0.12;\n let glassBase = clamp(lit + ${a}, vec3f(0.0), vec3f(8.0));\n let glassInterior = (glassBase / (vec3f(1.0) + glassBase * 1.65)) * 0.25;\n let glassRgb = max(vec3f(0.0), glassInterior + material.glassRimColor * (glassFine + glassSoft));\n let glassA = clamp(coverage + glassFine + glassSoft * 0.65, coverage, max(material.glassRimAlpha, coverage));\n return vec4f(glassRgb, glassA);`:`return vec4f(lit + ${a}, coverage);`}\n}\n`}const op=(A,t)=>ap(t,"applyLightingBaked");class lp extends Ng{type="MeshStandardMaterial";isMeshStandardMaterial=!0;normalMapTextureBinding;normalMapSamplerBinding;lightMapTextureBinding;lightMapSamplerBinding;slots=new Map;_normalScale=new w(1,1);_aoMapIntensity=1;_bumpScale=1;_envMapIntensity=1;metalness;roughness;emissive;emissiveIntensity;lightMapIntensity;get alphaTest(){const A=this.defines.get("ALPHATEST");return"number"==typeof A&&A>0?A:0}set alphaTest(A){A>0?this.defines.set("ALPHATEST",A):this.defines.delete("ALPHATEST")}get flatShading(){return 1===this.defines.get("FLAT_SHADING")}set flatShading(A){A?this.defines.set("FLAT_SHADING",1):this.defines.delete("FLAT_SHADING")}get fog(){return 0!==this.defines.get("FOG")}set fog(A){A?this.defines.delete("FOG"):this.defines.set("FOG",0)}get envMapIntensity(){return this._envMapIntensity}set envMapIntensity(A){this._envMapIntensity=A,1!==A?this.ensureNum("envMapIntensity",A):this.dropNum("envMapIntensity");const t=1!==A;t!==(1===this.defines.get("ENV_SCALE"))&&(t?this.defines.set("ENV_SCALE",1):this.defines.delete("ENV_SCALE"))}get aoMapIntensity(){return this._aoMapIntensity}set aoMapIntensity(A){this._aoMapIntensity=A,this.materialStruct().getField("aoMapIntensity")?.setValue(A)}get bumpScale(){return this._bumpScale}set bumpScale(A){this._bumpScale=A,this.materialStruct().getField("bumpScale")?.setValue(A)}get normalScale(){const A=this.materialStruct().getField("normalScale");return A?.getValue()??this._normalScale}set normalScale(A){const t=Array.isArray(A)?A[0]:A.x,e=Array.isArray(A)?A[1]:A.y;this._normalScale.set(t,e),this.materialStruct().getField("normalScale")?.setValue(this._normalScale)}get normalMap(){return this.normalMapTextureBinding.getValue()}set normalMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.normalMapTextureBinding.setValue(A),this.normalMapSamplerBinding.setValue(A?.sampler??null),null!=A?this.ensureNormalScale():this.dropNormalScale()}get lightMap(){return this.lightMapTextureBinding.getValue()}set lightMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.lightMapTextureBinding.setValue(A),this.lightMapSamplerBinding.setValue(A?.sampler??null)}get roughnessMap(){return this.readSlot("roughnessMap")}set roughnessMap(A){this.writeSlot("roughnessMap",A)}get metalnessMap(){return this.readSlot("metalnessMap")}set metalnessMap(A){this.writeSlot("metalnessMap",A)}get emissiveMap(){return this.readSlot("emissiveMap")}set emissiveMap(A){this.writeSlot("emissiveMap",A)}get alphaMap(){return this.readSlot("alphaMap")}set alphaMap(A){this.writeSlot("alphaMap",A)}get aoMap(){return this.readSlot("aoMap")}set aoMap(A){this.writeSlot("aoMap",A,A=>{A.texCoord=1}),null!=A?this.ensureNum("aoMapIntensity",this._aoMapIntensity):this.dropNum("aoMapIntensity")}get bumpMap(){return this.readSlot("bumpMap")}set bumpMap(A){this.writeSlot("bumpMap",A,A=>{A.deferSample=!0}),null!=A?this.ensureNum("bumpScale",this._bumpScale):this.dropNum("bumpScale")}constructor(A){var t;super(A,{shader:op,isSupportFamily:!0}),(t=this).registerStructField("metalness",new zt("metalness",0,void 0,{access:"Uniform"})),t.registerStructField("roughness",new zt("roughness",.5,void 0,{access:"Uniform"})),t.registerStructField("emissive",new Yt("emissive",void 0,void 0,{access:"Uniform"})),t.registerStructField("emissiveIntensity",new zt("emissiveIntensity",1,void 0,{access:"Uniform"})),t.registerStructField("lightMapIntensity",new zt("lightMapIntensity",1,void 0,{access:"Uniform"})),this.normalMapTextureBinding=new qt("normalMap",A?.normalMap??null),this.normalMapTextureBinding.emptySample="vec4f(0.5, 0.5, 1.0, 0.0)",this.normalMapSamplerBinding=new Wt("normalMapSampler",A?.normalMap?.sampler??null),this.addBinding(this.normalMapTextureBinding),this.addBinding(this.normalMapSamplerBinding),this.lightMapTextureBinding=new qt("lightMap",A?.lightMap??null),this.lightMapTextureBinding.emptySample="vec4f(0.0)",this.lightMapTextureBinding.texCoord=1,this.lightMapSamplerBinding=new Wt("lightMapSampler",A?.lightMap?.sampler??null),this.addBinding(this.lightMapTextureBinding),this.addBinding(this.lightMapSamplerBinding),A?.normalMap&&this.ensureNormalScale(),this.setValues(A)}copy(A){super.copy(A);const t=A;return t.isMeshStandardMaterial?(this.normalMap=t.normalMap,this.normalScale=t.normalScale,this.lightMap=t.lightMap,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.emissiveMap=t.emissiveMap,this.alphaMap=t.alphaMap,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.envMapIntensity=t.envMapIntensity,this):this}clone(){return super.clone()}materialStruct(){return this.getBinding("material")}readSlot(A){const t=this.slots.get(A);return t?t.tex.getValue():null}writeSlot(A,t,e){const i=this.slots.get(A);if(null==t){if(!i)return;return this.removeBinding(i.tex),this.removeBinding(i.samp),this.slots.delete(A),void this.onChangeCallback(f.DIRTY_STRUCTURE)}if(!i){const t=new qt(A,null);e?.(t);const i=new Wt(`${A}Sampler`,null);this.addBinding(t),this.addBinding(i),this.slots.set(A,{tex:t,samp:i})}const s=this.slots.get(A);t.assertCompatibleSampler(t.sampler),s.tex.setValue(t),s.samp.setValue(t.sampler??null)}ensureNum(A,t){const e=this.materialStruct(),i=e.getField(A);i?i.setValue(t):e.addField(new zt(A,t,void 0,{access:"Uniform"}))}dropNum(A){const t=this.materialStruct();t.getField(A)&&t.removeField(A)}ensureNormalScale(){const A=this.materialStruct();A.getField("normalScale")||A.addField(new Gt("normalScale",this._normalScale.clone(),"f32",{access:"Uniform"}))}dropNormalScale(){const A=this.materialStruct();A.getField("normalScale")&&A.removeField("normalScale")}}const cp=(A,t)=>ap(t,"applyPhysical");function hp(A){A.deferSample=!0}class up extends lp{type="MeshPhysicalMaterial";isMeshPhysicalMaterial=!0;_anisotropy=0;_anisotropyRotation=0;_clearcoat=0;_clearcoatRoughness=0;_clearcoatNormalScale=new w(1,1);_iridescence=0;_iridescenceIOR=1.3;_iridescenceThicknessMin=100;_iridescenceThicknessMax=400;_sheen=0;_sheenColor=new y(0,0,0);_sheenRoughness=1;_transmission=0;_thickness=0;_attenuationDistance=0;_attenuationColor=new y(1,1,1);_dispersion=0;_retroreflectivity=0;_glassRim=0;_glassRimAlpha=1;_glassRimColor=new y(1,1,1);ior;specularIntensity;specularColor;constructor(A){super(),this.type="MeshPhysicalMaterial",this.buildShader=this.createShaderFn(cp),this.registerStructField("ior",new zt("ior",1.5,void 0,{access:"Uniform"})),this.registerStructField("specularIntensity",new zt("specularIntensity",1,void 0,{access:"Uniform"})),this.registerStructField("specularColor",new Yt("specularColor",new y(1,1,1),void 0,{access:"Uniform"})),this.setValues(A)}get reflectivity(){const A=this.ior;return Math.min(1,Math.max(0,2.5*(A-1)/(A+1)))}set reflectivity(A){const t=Math.min(1,Math.max(0,A));this.ior=(1+.4*t)/(1-.4*t)}get anisotropy(){return this.readNum("anisotropy",this._anisotropy)}set anisotropy(A){const t=this._anisotropy>0;this._anisotropy=A;const e=A>0;(e||this.materialStruct().getField("anisotropy"))&&(this.putNum("anisotropy",A),this.putNum("anisotropyRotation",this._anisotropyRotation)),this.flag("ANISOTROPY",e,t)}get anisotropyRotation(){return this.readNum("anisotropyRotation",this._anisotropyRotation)}set anisotropyRotation(A){this._anisotropyRotation=A,this.materialStruct().getField("anisotropyRotation")&&this.putNum("anisotropyRotation",A)}get anisotropyMap(){return this.readSlot("anisotropyMap")}set anisotropyMap(A){this.writeSlot("anisotropyMap",A,hp)}get clearcoat(){return this.readNum("clearcoat",this._clearcoat)}set clearcoat(A){const t=this._clearcoat>0;this._clearcoat=A;const e=A>0;(e||this.materialStruct().getField("clearcoat"))&&(this.putNum("clearcoat",A),this.putNum("clearcoatRoughness",this._clearcoatRoughness),this.putVec2("clearcoatNormalScale",this._clearcoatNormalScale)),this.flag("CLEARCOAT",e,t)}get clearcoatRoughness(){return this.readNum("clearcoatRoughness",this._clearcoatRoughness)}set clearcoatRoughness(A){this._clearcoatRoughness=A,this.materialStruct().getField("clearcoatRoughness")&&this.putNum("clearcoatRoughness",A)}get clearcoatMap(){return this.readSlot("clearcoatMap")}set clearcoatMap(A){this.writeSlot("clearcoatMap",A,hp)}get clearcoatRoughnessMap(){return this.readSlot("clearcoatRoughnessMap")}set clearcoatRoughnessMap(A){this.writeSlot("clearcoatRoughnessMap",A,hp)}get clearcoatNormalMap(){return this.readSlot("clearcoatNormalMap")}set clearcoatNormalMap(A){this.writeSlot("clearcoatNormalMap",A,hp)}get clearcoatNormalScale(){return this.materialStruct().getField("clearcoatNormalScale")?.getValue()??this._clearcoatNormalScale}set clearcoatNormalScale(A){this._clearcoatNormalScale.set(Array.isArray(A)?A[0]:A.x,Array.isArray(A)?A[1]:A.y),this.materialStruct().getField("clearcoatNormalScale")?.setValue(this._clearcoatNormalScale)}get iridescence(){return this.readNum("iridescence",this._iridescence)}set iridescence(A){const t=this._iridescence>0;this._iridescence=A;const e=A>0;(e||this.materialStruct().getField("iridescence"))&&(this.putNum("iridescence",A),this.putNum("iridescenceIOR",this._iridescenceIOR),this.putNum("iridescenceThicknessMin",this._iridescenceThicknessMin),this.putNum("iridescenceThicknessMax",this._iridescenceThicknessMax)),this.flag("IRIDESCENCE",e,t)}get iridescenceIOR(){return this.readNum("iridescenceIOR",this._iridescenceIOR)}set iridescenceIOR(A){this._iridescenceIOR=A,this.materialStruct().getField("iridescenceIOR")&&this.putNum("iridescenceIOR",A)}get iridescenceThicknessRange(){return[this.readNum("iridescenceThicknessMin",this._iridescenceThicknessMin),this.readNum("iridescenceThicknessMax",this._iridescenceThicknessMax)]}set iridescenceThicknessRange(A){this._iridescenceThicknessMin=A[0],this._iridescenceThicknessMax=A[1],this.materialStruct().getField("iridescenceThicknessMin")&&(this.putNum("iridescenceThicknessMin",A[0]),this.putNum("iridescenceThicknessMax",A[1]))}get iridescenceMap(){return this.readSlot("iridescenceMap")}set iridescenceMap(A){this.writeSlot("iridescenceMap",A,hp)}get iridescenceThicknessMap(){return this.readSlot("iridescenceThicknessMap")}set iridescenceThicknessMap(A){this.writeSlot("iridescenceThicknessMap",A,hp)}get sheen(){return this.readNum("sheen",this._sheen)}set sheen(A){const t=this._sheen>0;this._sheen=A;const e=A>0;(e||this.materialStruct().getField("sheen"))&&(this.putNum("sheen",A),this.putNum("sheenRoughness",this._sheenRoughness),this.putVec3("sheenColor",this._sheenColor)),this.flag("SHEEN",e,t)}get sheenRoughness(){return this.readNum("sheenRoughness",this._sheenRoughness)}set sheenRoughness(A){this._sheenRoughness=A,this.materialStruct().getField("sheenRoughness")&&this.putNum("sheenRoughness",A)}get sheenColor(){return this.materialStruct().getField("sheenColor")?.getValue()??this._sheenColor}set sheenColor(A){this.writeVec3(this._sheenColor,A),this.materialStruct().getField("sheenColor")?.setValue(this._sheenColor)}get sheenColorMap(){return this.readSlot("sheenColorMap")}set sheenColorMap(A){this.writeSlot("sheenColorMap",A,hp)}get sheenRoughnessMap(){return this.readSlot("sheenRoughnessMap")}set sheenRoughnessMap(A){this.writeSlot("sheenRoughnessMap",A,hp)}get transmission(){return this.readNum("transmission",this._transmission)}set transmission(A){const t=this._transmission>0;this._transmission=A;const e=A>0;(e||this.materialStruct().getField("transmission"))&&(this.putNum("transmission",A),this.putNum("thickness",this._thickness),this.putNum("attenuationDistance",this._attenuationDistance),this.putVec3("attenuationColor",this._attenuationColor)),this.flag("TRANSMISSION",e,t),this._dispersion>0&&(e||this.materialStruct().getField("dispersion"))&&this.putNum("dispersion",this._dispersion),this.syncDispersion()}get thickness(){return this.readNum("thickness",this._thickness)}set thickness(A){this._thickness=A,this.materialStruct().getField("thickness")&&this.putNum("thickness",A)}get attenuationDistance(){const A=this.readNum("attenuationDistance",this._attenuationDistance);return A>0?A:1/0}set attenuationDistance(A){const t=Number.isFinite(A)&&A>0?A:0;this._attenuationDistance=t,this.materialStruct().getField("attenuationDistance")&&this.putNum("attenuationDistance",t)}get attenuationColor(){return this.materialStruct().getField("attenuationColor")?.getValue()??this._attenuationColor}set attenuationColor(A){this.writeVec3(this._attenuationColor,A),this.materialStruct().getField("attenuationColor")?.setValue(this._attenuationColor)}get transmissionMap(){return this.readSlot("transmissionMap")}set transmissionMap(A){this.writeSlot("transmissionMap",A,hp)}get thicknessMap(){return this.readSlot("thicknessMap")}set thicknessMap(A){this.writeSlot("thicknessMap",A,hp)}get dispersion(){return this.readNum("dispersion",this._dispersion)}set dispersion(A){this._dispersion=A,(this.materialStruct().getField("dispersion")||A>0&&this._transmission>0)&&this.putNum("dispersion",A),this.syncDispersion()}get glassRim(){return this.readNum("glassRim",this._glassRim)}set glassRim(A){const t=this._glassRim>0;this._glassRim=A;const e=A>0;(e||this.materialStruct().getField("glassRim"))&&(this.putNum("glassRim",A),this.putNum("glassRimAlpha",this._glassRimAlpha),this.putVec3("glassRimColor",this._glassRimColor)),this.flag("GLASS_RIM",e,t)}get glassRimAlpha(){return this.readNum("glassRimAlpha",this._glassRimAlpha)}set glassRimAlpha(A){this._glassRimAlpha=A,this.materialStruct().getField("glassRimAlpha")&&this.putNum("glassRimAlpha",A)}get glassRimColor(){return this.materialStruct().getField("glassRimColor")?.getValue()??this._glassRimColor}set glassRimColor(A){this.writeVec3(this._glassRimColor,A),this.materialStruct().getField("glassRimColor")?.setValue(this._glassRimColor)}get retroreflectivity(){return this.readNum("retroreflectivity",this._retroreflectivity)}set retroreflectivity(A){const t=this._retroreflectivity>0;this._retroreflectivity=A;const e=A>0;(e||this.materialStruct().getField("retroreflectivity"))&&this.putNum("retroreflectivity",A),this.flag("RETRO",e,t)}get specularIntensityMap(){return this.readSlot("specularIntensityMap")}set specularIntensityMap(A){this.writeSlot("specularIntensityMap",A)}get specularColorMap(){return this.readSlot("specularColorMap")}set specularColorMap(A){this.writeSlot("specularColorMap",A)}copy(A){super.copy(A);const t=A;return t.isMeshPhysicalMaterial?(this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatNormalScale=t.clearcoatNormalScale,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.iridescence=t.iridescence,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=t.iridescenceThicknessRange,this.iridescenceMap=t.iridescenceMap,this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenRoughness=t.sheenRoughness,this.sheenColor=t.sheenColor,this.sheenColorMap=t.sheenColorMap,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.thickness=t.thickness,this.attenuationDistance=t.attenuationDistance,this.attenuationColor=t.attenuationColor,this.transmissionMap=t.transmissionMap,this.thicknessMap=t.thicknessMap,this.dispersion=t.dispersion,this.glassRimAlpha=t.glassRimAlpha,this.glassRimColor=t.glassRimColor,this.glassRim=t.glassRim,this.retroreflectivity=t.retroreflectivity,this.specularIntensityMap=t.specularIntensityMap,this.specularColorMap=t.specularColorMap,this):this}readNum(A,t){const e=this.materialStruct().getField(A)?.getValue();return"number"==typeof e?e:t}putNum(A,t){const e=this.materialStruct(),i=e.getField(A);i?i.setValue(t):e.addField(new zt(A,t,void 0,{access:"Uniform"}))}putVec2(A,t){const e=this.materialStruct(),i=e.getField(A);i?i.setValue(t):e.addField(new Gt(A,t.clone(),"f32",{access:"Uniform"}))}putVec3(A,t){const e=this.materialStruct(),i=e.getField(A);i?i.setValue(t):e.addField(new Yt(A,t.clone(),void 0,{access:"Uniform"}))}writeVec3(A,t){Array.isArray(t)?A.set(t[0],t[1],t[2]):A.copy(t)}flag(A,t,e){t!==e&&(t?this.defines.set(A,1):this.defines.delete(A))}syncDispersion(){const A=this._dispersion>0&&this._transmission>0;A!==(1===this.defines.get("DISPERSION"))&&(A?this.defines.set("DISPERSION",1):this.defines.delete("DISPERSION"))}}const gp=(A,t)=>{const e=function(A){const t=A?.material?.defines?.get("ALPHATEST");return"number"==typeof t&&t>0?t:0}(t);return e>0?`\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n let alpha = material.color.a * mapSample.a * alphaMapSample.g * vertexColor.a;\n if (alpha < ${function(A){const t=String(A);return/[eE.]/.test(t)?t:`${t}.0`}(e)}) { discard; }\n return vec4f(material.color.rgb * mapSample.rgb * vertexColor.rgb, alpha);\n}\n`:"\n@vertex fn vertexMain() -> VertexOutput {\n out.clipPosition = camera.viewProjectionMatrix * worldMatrix * vec4f(in.position, 1.0);\n return out;\n}\n\n@fragment fn fragmentMain(in: VertexOutput) -> @location(0) vec4f {\n let alpha = material.color.a * mapSample.a * alphaMapSample.g * vertexColor.a;\n return vec4f(material.color.rgb * mapSample.rgb * vertexColor.rgb, alpha);\n}\n"};class dp extends Ng{type="PointsMaterial";isPointsMaterial=!0;alphaMapTextureBinding;alphaMapSamplerBinding;get alphaMap(){return this.alphaMapTextureBinding.getValue()}set alphaMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.alphaMapTextureBinding.setValue(A),this.alphaMapSamplerBinding.setValue(A?.sampler??null)}constructor(A){super(A,{shader:gp,isSupportFamily:!0}),this.registerStructField("size",new zt("size",1,void 0,{access:"Uniform"})),this.registerStructField("sizeAttenuation",new zt("sizeAttenuation",1,void 0,{access:"Uniform"})),this.alphaMapTextureBinding=new qt("alphaMap",A?.alphaMap??null),this.alphaMapSamplerBinding=new Wt("alphaMapSampler",A?.alphaMap?.sampler??null),this.addBinding(this.alphaMapTextureBinding),this.addBinding(this.alphaMapSamplerBinding),this.setValues(A)}clone(){const A=super.clone();return A.alphaMap=this.alphaMap,A}}class pp extends Wi{type="BoxGeometry";parameters;#Ll=!0;constructor(A=1,t=1,e=1,i=1,s=1,n=1){super(),this.parameters={width:A,height:t,depth:e,widthSegments:Math.floor(i),heightSegments:Math.floor(s),depthSegments:Math.floor(n)},this.#jl()}#jl(){const{width:A,height:t,depth:e,widthSegments:i,heightSegments:s,depthSegments:n}=this.parameters,r=i,a=s,o=n,l=2*((o+1)*(a+1)+(r+1)*(o+1)+(r+1)*(a+1)),c=12*(o*a+r*o+r*a),h=new ArrayBuffer(8*l*4),u=new Float32Array(h,0,3*l),g=new Float32Array(h,3*l*4,3*l),d=new Float32Array(h,6*l*4,2*l),p=new Uint32Array(c);let f=0,m=0;const C=(A,t,e,i,s,n,r,a,o,l,c,h,C)=>{const w=n/o,y=r/l,B=n/2,I=r/2,Q=a/2,E=o+1,x=l+1,D=1/o,M=1/l;let b,S,v,T=f,U=m;for(let p=0;p<x;p++){const e=p*y-I;for(let n=0;n<E;n++){const r=n*w-B;b="x"===A?r*i:"x"===t?e*s:Q,S="y"===A?r*i:"y"===t?e*s:Q,v="z"===A?r*i:"z"===t?e*s:Q;const a=3*T;u[a]=b,u[a+1]=S,u[a+2]=v,g[a]=c,g[a+1]=h,g[a+2]=C;const o=2*T;d[o]=n*D,d[o+1]=1-p*M,T++}}const N=f;for(let u=0;u<l;u++)for(let A=0;A<o;A++){const t=N+A+E*u,e=N+A+E*(u+1),i=N+(A+1)+E*(u+1),s=N+(A+1)+E*u;p[U]=t,p[U+1]=e,p[U+2]=s,U+=3,p[U]=e,p[U+1]=i,p[U+2]=s,U+=3}f=T,m=U};C("z","y",0,-1,-1,e,t,A,o,a,1,0,0),C("z","y",0,1,-1,e,t,-A,o,a,-1,0,0),C("x","z",0,1,1,A,e,t,r,o,0,1,0),C("x","z",0,1,-1,A,e,-t,r,o,0,-1,0),C("x","y",0,1,-1,A,t,e,r,a,0,0,1),C("x","y",0,-1,-1,A,t,-e,r,a,0,0,-1),this.setIndex(new Oi(p,1)),this.setAttribute("position",new Fi(u,3)),this.setAttribute("normal",new Fi(g,3)),this.setAttribute("uv",new Fi(d,2)),this.computeBoundingBox(),this.freeze()}applyMatrix4(A){return this.#Ll=!1,super.applyMatrix4(A)}computeBoundingBox(){if(!this.#Ll)return super.computeBoundingBox();const{width:A,height:t,depth:e}=this.parameters,i=A/2,s=t/2,n=e/2;return this.assignBoundingBox(-i,-s,-n,i,s,n,0,0,0,.5*Math.sqrt(A*A+t*t+e*e))}copy(A){return super.copy(A),this.parameters={...A.parameters},this.#Ll=A.#Ll,this}static fromJSON(A){return new pp(A.width,A.height,A.depth,A.widthSegments,A.heightSegments,A.depthSegments)}}class fp extends Wi{type="CapsuleGeometry";parameters;#Ll=!0;constructor(A=1,t=1,e=4,i=8,s=1){super(),this.parameters={radius:A,height:Math.max(0,t),capSegments:Math.max(1,Math.floor(e)),radialSegments:Math.max(3,Math.floor(i)),heightSegments:Math.max(1,Math.floor(s))},this.#jl()}#jl(){const{radius:A,height:t,capSegments:e,radialSegments:i,heightSegments:s}=this.parameters,n=2*e+s,r=i+1,a=(n+1)*r,o=6*i*(n-1),l=new ArrayBuffer(8*a*4),c=new Float32Array(l,0,3*a),h=new Float32Array(l,3*a*4,3*a),u=new Float32Array(l,6*a*4,2*a),g=new Uint32Array(o),d=.5*t,p=.5*Math.PI*A,f=2*p+t,m=0!==f?1/f:0,C=1/e,w=1/s,y=1/i,B=0!==A?1/Math.abs(A):0,I=.5*Math.PI,Q=.5*y,E=new Float64Array(r),x=new Float64Array(r);E[0]=1,x[0]=0;const D=2*Math.PI;for(let U=1;U<i;U++){const A=U*y*D;E[U]=Math.cos(A),x[U]=Math.sin(A)}E[i]=1,x[i]=0;let M=0,b=0,S=0;const v=A=>Math.min(1,Math.max(0,A*m)),T=(A,t,e,s,a)=>{const o=t*B,l=e*B;for(let i=0;i<r;i++){const e=E[i],n=x[i],r=3*M;c[r]=-t*e,c[r+1]=A,c[r+2]=t*n,h[r]=-o*e,h[r+1]=l,h[r+2]=o*n;const g=2*M;u[g]=i*y+a,u[g+1]=s,M++}if(S>0){const A=(S-1)*r,t=S*r;if(1===S)for(let e=0;e<i;e++){const i=t+e;g[b]=A+e+1,g[b+1]=i+1,g[b+2]=i,b+=3}else if(S===n)for(let e=0;e<i;e++){const i=A+e;g[b]=i,g[b+1]=i+1,g[b+2]=t+e,b+=3}else for(let e=0;e<i;e++){const i=A+e,s=i+1,n=t+e,r=n+1;g[b]=i,g[b+1]=s,g[b+2]=n,b+=3,g[b]=s,g[b+1]=r,g[b+2]=n,b+=3}}S++};for(let U=0;U<=e;U++){const t=U*C,e=t*I,i=Math.cos(e);T(-d-A*i,A*Math.sin(e),-A*i,v(t*p),0===U?Q:0)}for(let U=1;U<=s;U++){const e=U*w;T(e*t-d,A,0,v(p+e*t),0)}for(let U=1;U<=e;U++){const i=U*C,s=i*I,n=Math.sin(s);T(d+A*n,A*Math.cos(s),A*n,v(p+t+i*p),U===e?-Q:0)}this.setIndex(new Oi(g,1)),this.setAttribute("position",new Fi(c,3)),this.setAttribute("normal",new Fi(h,3)),this.setAttribute("uv",new Fi(u,2)),this.computeBoundingBox(),this.freeze()}applyMatrix4(A){return this.#Ll=!1,super.applyMatrix4(A)}computeBoundingBox(){if(!this.#Ll)return super.computeBoundingBox();const{radius:A,height:t}=this.parameters;if(A<0)return super.computeBoundingBox();const e=.5*t+A;return this.assignBoundingBox(-A,-e,-A,A,e,A,0,0,0,e)}copy(A){return super.copy(A),this.parameters={...A.parameters},this.#Ll=A.#Ll,this}static fromJSON(A){return new fp(A.radius,A.height,A.capSegments,A.radialSegments,A.heightSegments)}}const mp=Math.PI,Cp=2*mp,wp=.5*mp;function yp(A,t,e,i,s){const n=A=>s?e*Math.cos(A):e*Math.sin(A);let r=n(A),a=r;const o=n(t);o<r&&(r=o),o>a&&(a=o);const l=mp;let c=i+Math.ceil((A-i)/l-1e-12)*l;c<A&&(c+=l);for(let h=0;h<4&&c<=t+1e-12;h++){const A=n(c);A<r&&(r=A),A>a&&(a=A),c+=l}return[r,a]}class Bp extends Wi{type="CircleGeometry";parameters;#Ll=!0;constructor(A=1,t=32,e=0,i=Cp){super(),this.parameters={radius:A,segments:Math.max(3,Math.floor(t)),thetaStart:e,thetaLength:i},this.#jl()}#jl(){const{radius:A,segments:t,thetaStart:e,thetaLength:i}=this.parameters,s=t+1,n=s+1,r=3*t,a=new ArrayBuffer(8*n*4),o=new Float32Array(a,0,3*n),l=new Float32Array(a,3*n*4,3*n),c=new Float32Array(a,6*n*4,2*n),h=new Uint32Array(r);o[0]=0,o[1]=0,o[2]=0,l[2]=1,c[0]=.5,c[1]=.5;const u=1/t;for(let p=0;p<=t;p++){const t=e+p*u*i,s=Math.cos(t),n=Math.sin(t),r=p+1,a=3*r;o[a]=A*s,o[a+1]=A*n,l[a+2]=1;const h=2*r;c[h]=.5*(s+1),c[h+1]=.5*(n+1)}const g=i/Cp;if(Number.isFinite(g)&&Math.abs(g)>.5&&Math.abs(g-Math.round(g))<1e-8){const A=3*s;o[A]=o[3],o[A+1]=o[4];const t=2*s;c[t]=c[2],c[t+1]=c[3]}let d=0;for(let p=1;p<=t;p++)h[d]=p,h[d+1]=p+1,h[d+2]=0,d+=3;this.setIndex(new Oi(h,1)),this.setAttribute("position",new Fi(o,3)),this.setAttribute("normal",new Fi(l,3)),this.setAttribute("uv",new Fi(c,2)),this.computeBoundingBox(),this.freeze()}applyMatrix4(A){return this.#Ll=!1,super.applyMatrix4(A)}computeBoundingBox(){if(!this.#Ll)return super.computeBoundingBox();const{radius:A,thetaStart:t,thetaLength:e}=this.parameters,i=Math.abs(A);if(0===i)return this.assignBoundingBox(0,0,0,0,0,0,0,0,0,0);let s=t,n=t+e;if(n<s){const A=s;s=n,n=A}const r=n-s;if(!(r<Cp))return this.assignBoundingBox(-i,-i,0,i,i,0,0,0,0,i);const[a,o]=yp(s,n,A,0,!0),[l,c]=yp(s,n,A,wp,!1),h=a<0?a:0,u=o>0?o:0,g=l<0?l:0,d=c>0?c:0,p=.5*(s+n),f=Math.cos(p),m=Math.sin(p),C=.5*r;let w,y,B;if(r>=mp)w=0,y=0,B=i;else if(r>=wp){B=i*Math.sin(C);const t=A*Math.cos(C);w=t*f,y=t*m}else{B=i/(2*Math.cos(C));const t=A>0?1:-1;w=t*B*f,y=t*B*m}return this.assignBoundingBox(h,g,0,u,d,0,w,y,0,B)}copy(A){return super.copy(A),this.parameters={...A.parameters},this.#Ll=A.#Ll,this}static fromJSON(A){return new Bp(A.radius,A.segments,A.thetaStart,A.thetaLength)}}const Ip=Math.PI,Qp=2*Ip,Ep=.5*Ip;function xp(A,t,e,i,s){const n=A=>s?e*Math.cos(A):e*Math.sin(A);let r=n(A),a=r;const o=n(t);o<r&&(r=o),o>a&&(a=o);const l=Ip;let c=i+Math.ceil((A-i)/l-1e-12)*l;c<A&&(c+=l);for(let h=0;h<4&&c<=t+1e-12;h++){const A=n(c);A<r&&(r=A),A>a&&(a=A),c+=l}return[r,a]}function Dp(A,t,e,i){if(i||0===A){const t=Math.abs(A);return[-t,t,-t,t]}const[s,n]=xp(t,e,A,Ep,!1),[r,a]=xp(t,e,A,0,!0);return[s,n,r,a]}class Mp extends Wi{type="CylinderGeometry";parameters;#Ll=!0;#zl=0;#Gl=0;#U=0;#Yl=0;#Hl=0;#Kl=!1;constructor(A=1,t=1,e=1,i=32,s=1,n=!1,r=0,a=Qp){super();const o=Math.max(1,Math.floor(i)),l=Math.max(1,Math.floor(s)),c=!!n;this.#zl=A,this.#Gl=t,this.#U=e,this.#Yl=r,this.#Hl=a,this.#Kl=c,this.parameters={radiusTop:A,radiusBottom:t,height:e,radialSegments:o,heightSegments:l,openEnded:c,thetaStart:r,thetaLength:a},this.#jl()}#jl(){const{radiusTop:A,radiusBottom:t,height:e,radialSegments:i,heightSegments:s,openEnded:n,thetaStart:r,thetaLength:a}=this.parameters,o=i+1,l=!n&&A>0,c=!n&&t>0,h=(s+1)*o+((l?i+o:0)+(c?i+o:0)),u=3*(i*((A>0?s:s-1)+(t>0?s:s-1))+((l?i:0)+(c?i:0))),g=new ArrayBuffer(8*h*4),d=new Float32Array(g,0,3*h),p=new Float32Array(g,3*h*4,3*h),f=new Float32Array(g,6*h*4,2*h),m=new Uint32Array(u),C=a/Qp,w=Number.isFinite(C)&&Math.abs(C)>.5&&Math.abs(C-Math.round(C))<1e-8,y=new Float64Array(o),B=new Float64Array(o),I=1/i;for(let U=0;U<i;U++){const A=r+U*I*a;y[U]=Math.sin(A),B[U]=Math.cos(A)}if(w)y[i]=y[0],B[i]=B[0];else{const A=r+a;y[i]=Math.sin(A),B[i]=Math.cos(A)}const Q=t-A;let E=0;0!==e?E=Q/e:0!==Q&&(E=Q>0?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY);const x=Number.isFinite(E)?1/Math.hypot(1,E):0,D=Number.isFinite(E)?E*x:E<0?-1:1,M=.5*e,b=1/s;let S=0;for(let U=0;U<=s;U++){const t=U*b,i=A+t*Q,s=-t*e+M,n=1-t;for(let A=0;A<o;A++){const t=y[A],e=B[A],r=3*S;d[r]=i*t,d[r+1]=s,d[r+2]=i*e,p[r]=t*x,p[r+1]=D,p[r+2]=e*x;const a=2*S;f[a]=A*I,f[a+1]=n,S++}}let v=0;for(let U=0;U<i;U++)for(let e=0;e<s;e++){const i=e*o+U,n=i+o,r=i+1,a=n+1;(A>0||0!==e)&&(m[v]=i,m[v+1]=n,m[v+2]=r,v+=3),(t>0||e!==s-1)&&(m[v]=n,m[v+1]=a,m[v+2]=r,v+=3)}const T=(A,t)=>{const e=M*t,s=S;for(let r=0;r<i;r++){const A=3*S;d[A+1]=e,p[A+1]=t;const i=2*S;f[i]=.5,f[i+1]=.5,S++}const n=S;for(let i=0;i<o;i++){const s=y[i],n=B[i],r=3*S;d[r]=A*s,d[r+1]=e,d[r+2]=A*n,p[r+1]=t;const a=2*S;f[a]=.5*n+.5,f[a+1]=.5*s*t+.5,S++}if(t>0)for(let r=0;r<i;r++)m[v]=n+r,m[v+1]=n+r+1,m[v+2]=s+r,v+=3;else for(let r=0;r<i;r++)m[v]=n+r+1,m[v+1]=n+r,m[v+2]=s+r,v+=3};l&&T(A,1),c&&T(t,-1),this.setIndex(new Oi(m,1)),this.setAttribute("position",new Fi(d,3)),this.setAttribute("normal",new Fi(p,3)),this.setAttribute("uv",new Fi(f,2)),this.computeBoundingBox(),this.freeze()}applyMatrix4(A){return this.#Ll=!1,super.applyMatrix4(A)}computeBoundingBox(){if(!this.#Ll)return super.computeBoundingBox();const A=this.#zl,t=this.#Gl,e=this.#U,i=this.#Yl,s=this.#Hl,n=.5*e,r=-Math.abs(n),a=Math.abs(n);let o=i,l=i+s;if(l<o){const A=o;o=l,l=A}const c=!(l-o<Qp),h=Dp(A,o,l,c),u=Dp(t,o,l,c);let g=h[0]<u[0]?h[0]:u[0],d=h[1]>u[1]?h[1]:u[1],p=h[2]<u[2]?h[2]:u[2],f=h[3]>u[3]?h[3]:u[3];(!this.#Kl&&A>0||!this.#Kl&&t>0)&&(g>0&&(g=0),d<0&&(d=0),p>0&&(p=0),f<0&&(f=0));const m=Math.abs(A),C=Math.abs(t),w=Math.abs(e),y=n,B=-n;let I;I=m>=Math.hypot(C,w)?y:C>=Math.hypot(m,w)?B:(m*m-C*C)/(2*e);const Q=Math.max(Math.hypot(m,y-I),Math.hypot(C,B-I));return this.assignBoundingBox(g,r,p,d,a,f,0,I,0,Q)}copy(A){return super.copy(A),this.parameters={...A.parameters},this.#zl=A.#zl,this.#Gl=A.#Gl,this.#U=A.#U,this.#Yl=A.#Yl,this.#Hl=A.#Hl,this.#Kl=A.#Kl,this.#Ll=A.#Ll,this}static fromJSON(A){return new Mp(A.radiusTop,A.radiusBottom,A.height,A.radialSegments,A.heightSegments,A.openEnded,A.thetaStart,A.thetaLength)}}const bp=2*Math.PI;class Sp extends Mp{type="ConeGeometry";constructor(A=1,t=1,e=32,i=1,s=!1,n=0,r=bp){super(0,A,t,e,i,s,n,r);const a=this.parameters;this.parameters={radius:A,height:t,radialSegments:a.radialSegments,heightSegments:a.heightSegments,openEnded:a.openEnded,thetaStart:n,thetaLength:r}}static fromJSON(A){return new Sp(A.radius,A.height,A.radialSegments,A.heightSegments,A.openEnded,A.thetaStart,A.thetaLength)}}class vp extends Wi{type="PolyhedronGeometry";parameters;#Ll=!0;#Vl=0;#Jl=0;#Wl=0;#ql=0;#Xl=0;#Zl=0;#_l=0;constructor(A=[],t=[],e=1,i=0){super(),this.parameters={vertices:Tp(A)?A:[],indices:Tp(t)?t:[],radius:Number.isFinite(e)?e:0,detail:Number.isFinite(i)?Math.max(0,Math.floor(i)):0},this.#jl()}#jl(){const{vertices:A,indices:t,radius:e,detail:i}=this.parameters,s=Math.floor(A.length/3),n=Math.floor(t.length/3),r=i+1,a=n*r*r;if(!Number.isSafeInteger(a))throw new RangeError("PolyhedronGeometry: detail exceeds vertex capacity");if(0===a)return this.setAttribute("position",new Fi(new Float32Array(0),3)),this.setAttribute("normal",new Fi(new Float32Array(0),3)),this.setAttribute("uv",new Fi(new Float32Array(0),2)),this.computeBoundingBox(),void this.freeze();const o=3*a,l=new Float64Array(3*o),c=r+1,h=new Float64Array(c*c*3);let u=0;for(let S=0;S<n;S++){const e=3*S,i=Up(t,e,s),n=Up(t,e+1,s),a=Up(t,e+2,s);u=Pp(Np(A,i,0),Np(A,i,1),Np(A,i,2),Np(A,n,0),Np(A,n,1),Np(A,n,2),Np(A,a,0),Np(A,a,1),Np(A,a,2),r,h,c,l,u)}const g=new ArrayBuffer(8*o*4),d=new Float32Array(g,0,3*o),p=new Float32Array(g,3*o*4,3*o),f=new Float32Array(g,6*o*4,2*o),m=0===i,C=new Float64Array(9);let w=1/0,y=1/0,B=1/0,I=-1/0,Q=-1/0,E=-1/0;for(let S=0,v=0,T=0;S<o;S+=3,v+=6,T+=9){Fp(l[T],l[T+1],l[T+2],e,C,0),Fp(l[T+3],l[T+4],l[T+5],e,C,3),Fp(l[T+6],l[T+7],l[T+8],e,C,6);const A=C[0],t=C[1],i=C[2],s=C[3],n=C[4],r=C[5],a=C[6],o=C[7],c=C[8];let h=Rp(A,i),u=Rp(s,r),g=Rp(a,c);const x=Lp(A,t,i),D=Lp(s,n,r),M=Lp(a,o,c),b=kp((A+s+a)/3,(i+r+c)/3);h=jp(h,A,i,b),u=jp(u,s,r,b),g=jp(g,a,c,b),Math.max(h,u,g)>.9&&Math.min(h,u,g)<.1&&(h<.2&&(h+=1),u<.2&&(u+=1),g<.2&&(g+=1)),f[v]=h,f[v+1]=x,f[v+2]=u,f[v+3]=D,f[v+4]=g,f[v+5]=M;const U=3*S;d[U]=A,d[U+1]=t,d[U+2]=i,d[U+3]=s,d[U+4]=n,d[U+5]=r,d[U+6]=a,d[U+7]=o,d[U+8]=c;const N=d[U],P=d[U+1],O=d[U+2],F=d[U+3],k=d[U+4],R=d[U+5],L=d[U+6],j=d[U+7],z=d[U+8];if(w=Math.min(w,N,F,L),y=Math.min(y,P,k,j),B=Math.min(B,O,R,z),I=Math.max(I,N,F,L),Q=Math.max(Q,P,k,j),E=Math.max(E,O,R,z),m){const A=N-F,t=P-k,e=O-R,i=L-F,s=j-k,n=z-R;zp(p,U,s*e-n*t,n*A-i*e,i*t-s*A)}else Gp(p,U,N,P,O),Gp(p,U+3,F,k,R),Gp(p,U+6,L,j,z)}const x=(w+I)/2,D=(y+Q)/2,M=(B+E)/2;let b=0;for(let S=0;S<d.length;S+=3){const A=d[S]-x,t=d[S+1]-D,e=d[S+2]-M,i=A*A+t*t+e*e;i>b&&(b=i)}this.#Vl=w,this.#Jl=y,this.#Wl=B,this.#ql=I,this.#Xl=Q,this.#Zl=E,this.#_l=b>0?Math.sqrt(b):0,this.setAttribute("position",new Fi(d,3)),this.setAttribute("normal",new Fi(p,3)),this.setAttribute("uv",new Fi(f,2)),this.computeBoundingBox(),this.freeze()}applyMatrix4(A){return this.#Ll=!1,super.applyMatrix4(A)}computeBoundingBox(){if(!this.#Ll)return super.computeBoundingBox();const A=(this.#Vl+this.#ql)/2,t=(this.#Jl+this.#Xl)/2,e=(this.#Wl+this.#Zl)/2;return this.assignBoundingBox(this.#Vl,this.#Jl,this.#Wl,this.#ql,this.#Xl,this.#Zl,A,t,e,this.#_l)}copy(A){return super.copy(A),this.parameters={...A.parameters},this.#Ll=A.#Ll,this.#Vl=A.#Vl,this.#Jl=A.#Jl,this.#Wl=A.#Wl,this.#ql=A.#ql,this.#Xl=A.#Xl,this.#Zl=A.#Zl,this.#_l=A.#_l,this}static fromJSON(A){return new vp(A.vertices,A.indices,A.radius,A.detail)}}function Tp(A){return null!=A&&"object"==typeof A&&"number"==typeof A.length}function Up(A,t,e){const i=A[t];return"number"!=typeof i||!Number.isInteger(i)||i<0||i>=e?-1:i}function Np(A,t,e){if(t<0)return 0;const i=A[3*t+e];return Number.isFinite(i)?i:0}function Pp(A,t,e,i,s,n,r,a,o,l,c,h,u,g){for(let p=0;p<=l;p++){const u=p/l,g=A+(r-A)*u,d=t+(a-t)*u,f=e+(o-e)*u,m=i+(r-i)*u,C=s+(a-s)*u,w=n+(o-n)*u,y=l-p;for(let A=0;A<=y;A++){const t=3*(p*h+A);if(0===A&&p===l)c[t]=g,c[t+1]=d,c[t+2]=f;else{const e=A/y;c[t]=g+(m-g)*e,c[t+1]=d+(C-d)*e,c[t+2]=f+(w-f)*e}}}let d=g;for(let p=0;p<l;p++){const A=2*(l-p)-1;for(let t=0;t<A;t++){const A=t>>1;1&t?(d=Op(c,h,p,A+1,u,d),d=Op(c,h,p+1,A+1,u,d),d=Op(c,h,p+1,A,u,d)):(d=Op(c,h,p,A+1,u,d),d=Op(c,h,p+1,A,u,d),d=Op(c,h,p,A,u,d))}}return d}function Op(A,t,e,i,s,n){const r=3*(e*t+i);return s[n]=A[r],s[n+1]=A[r+1],s[n+2]=A[r+2],n+3}function Fp(A,t,e,i,s,n){const r=1/(Math.sqrt(A*A+t*t+e*e)||1);s[n]=A*r*i,s[n+1]=t*r*i,s[n+2]=e*r*i}function kp(A,t){return Math.atan2(t,-A)}function Rp(A,t){return kp(A,t)/2/Math.PI+.5}function Lp(A,t,e){return 1-(Math.atan2(-t,Math.sqrt(A*A+e*e))/Math.PI+.5)}function jp(A,t,e,i){return i<0&&1===A&&(A-=1),0===t&&0===e&&(A=i/2/Math.PI+.5),A}function zp(A,t,e,i,s){const n=Math.fround(e),r=Math.fround(i),a=Math.fround(s),o=1/(Math.sqrt(n*n+r*r+a*a)||1),l=n*o,c=r*o,h=a*o;A[t]=l,A[t+1]=c,A[t+2]=h,A[t+3]=l,A[t+4]=c,A[t+5]=h,A[t+6]=l,A[t+7]=c,A[t+8]=h}function Gp(A,t,e,i,s){const n=1/(Math.sqrt(e*e+i*i+s*s)||1);A[t]=e*n,A[t+1]=i*n,A[t+2]=s*n}const Yp=(1+Math.sqrt(5))/2,Hp=1/Yp,Kp=new Float64Array([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-Hp,-Yp,0,-Hp,Yp,0,Hp,-Yp,0,Hp,Yp,-Hp,-Yp,0,-Hp,Yp,0,Hp,-Yp,0,Hp,Yp,0,-Yp,0,-Hp,Yp,0,-Hp,-Yp,0,Hp,Yp,0,Hp]),Vp=new Uint8Array([3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9]);class Jp extends vp{type="DodecahedronGeometry";constructor(A=1,t=0){super(Kp,Vp,A,t);const e=this.parameters;this.parameters={radius:e.radius,detail:e.detail}}static fromJSON(A){return new Jp(A.radius,A.detail)}}const Wp=1e4,qp=Math.PI/180;function Xp(A,t){return A.view[(0|A.typeInfo.offset)+t*A.stride]}function Zp(A,t,e,i){const s=(0|A.typeInfo.offset)+t*A.stride,n=A.view;e[i]=n[s],e[i+1]=n[s+1],e[i+2]=n[s+2]}function _p(A,t,e){return`${Math.round(A*Wp)},${Math.round(t*Wp)},${Math.round(e*Wp)}`}function $p(A,t,e=2){const i=t&&t.length,s=i?t[0]*e:A.length;let n=Af(A,0,s,e,!0);const r=[];if(!n||n.next===n.prev)return r;let a,o,l;if(i&&(n=function(A,t,e,i){const s=[];for(let n=0,r=t.length;n<r;n++){const e=Af(A,t[n]*i,n<r-1?t[n+1]*i:A.length,i,!1);e===e.next&&(e.steiner=!0),s.push(uf(e))}s.sort(of);for(let n=0;n<s.length;n++)e=lf(s[n],e);return e}(A,t,n,e)),A.length>80*e){a=A[0],o=A[1];let t=a,i=o;for(let n=e;n<s;n+=e){const e=A[n],s=A[n+1];e<a&&(a=e),s<o&&(o=s),e>t&&(t=e),s>i&&(i=s)}l=Math.max(t-a,i-o),l=0!==l?32767/l:0}return ef(n,r,e,a,o,l,0),r}function Af(A,t,e,i,s){let n;if(s===function(A,t,e,i){let s=0;for(let n=t,r=e-i;n<e;n+=i)s+=(A[r]-A[n])*(A[n+1]+A[r+1]),r=n;return s}(A,t,e,i)>0)for(let r=t;r<e;r+=i)n=Qf(r/i|0,A[r],A[r+1],n);else for(let r=e-i;r>=t;r-=i)n=Qf(r/i|0,A[r],A[r+1],n);return n&&mf(n,n.next)&&(Ef(n),n=n.next),n}function tf(A,t){if(!A)return A;t||(t=A);let e,i=A;do{if(e=!1,i.steiner||!mf(i,i.next)&&0!==ff(i.prev,i,i.next))i=i.next;else{if(Ef(i),i=t=i.prev,i===i.next)break;e=!0}}while(e||i!==t);return t}function ef(A,t,e,i,s,n,r){if(!A)return;!r&&n&&function(A,t,e,i){let s=A;do{0===s.z&&(s.z=hf(s.x,s.y,t,e,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==A);s.prevZ.nextZ=null,s.prevZ=null,function(A){let t,e=1;do{let i,s=A;A=null;let n=null;for(t=0;s;){t++;let r=s,a=0;for(let A=0;A<e&&(a++,r=r.nextZ,r);A++);let o=e;for(;a>0||o>0&&r;)0!==a&&(0===o||!r||s.z<=r.z)?(i=s,s=s.nextZ,a--):(i=r,r=r.nextZ,o--),n?n.nextZ=i:A=i,i.prevZ=n,n=i;s=r}n.nextZ=null,e*=2}while(t>1)}(s)}(A,i,s,n);let a=A;for(;A.prev!==A.next;){const o=A.prev,l=A.next;if(n?nf(A,i,s,n):sf(A))t.push(o.i,A.i,l.i),Ef(A),A=l.next,a=l.next;else if((A=l)===a){r?1===r?ef(A=rf(tf(A),t),t,e,i,s,n,2):2===r&&af(A,t,e,i,s,n):ef(tf(A),t,e,i,s,n,1);break}}}function sf(A){const t=A.prev,e=A,i=A.next;if(ff(t,e,i)>=0)return!1;const s=t.x,n=e.x,r=i.x,a=t.y,o=e.y,l=i.y,c=Math.min(s,n,r),h=Math.min(a,o,l),u=Math.max(s,n,r),g=Math.max(a,o,l);let d=i.next;for(;d!==t;){if(d.x>=c&&d.x<=u&&d.y>=h&&d.y<=g&&df(s,a,n,o,r,l,d.x,d.y)&&ff(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function nf(A,t,e,i){const s=A.prev,n=A,r=A.next;if(ff(s,n,r)>=0)return!1;const a=s.x,o=n.x,l=r.x,c=s.y,h=n.y,u=r.y,g=Math.min(a,o,l),d=Math.min(c,h,u),p=Math.max(a,o,l),f=Math.max(c,h,u),m=hf(g,d,t,e,i),C=hf(p,f,t,e,i);let w=A.prevZ,y=A.nextZ;for(;w&&w.z>=m&&y&&y.z<=C;){if(w.x>=g&&w.x<=p&&w.y>=d&&w.y<=f&&w!==s&&w!==r&&df(a,c,o,h,l,u,w.x,w.y)&&ff(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,y.x>=g&&y.x<=p&&y.y>=d&&y.y<=f&&y!==s&&y!==r&&df(a,c,o,h,l,u,y.x,y.y)&&ff(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;w&&w.z>=m;){if(w.x>=g&&w.x<=p&&w.y>=d&&w.y<=f&&w!==s&&w!==r&&df(a,c,o,h,l,u,w.x,w.y)&&ff(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;y&&y.z<=C;){if(y.x>=g&&y.x<=p&&y.y>=d&&y.y<=f&&y!==s&&y!==r&&df(a,c,o,h,l,u,y.x,y.y)&&ff(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function rf(A,t){let e=A;do{const i=e.prev,s=e.next.next;!mf(i,s)&&Cf(i,e,e.next,s)&&Bf(i,s)&&Bf(s,i)&&(t.push(i.i,e.i,s.i),Ef(e),Ef(e.next),e=A=s),e=e.next}while(e!==A);return tf(e)}function af(A,t,e,i,s,n){let r=A;do{let A=r.next.next;for(;A!==r.prev;){if(r.i!==A.i&&pf(r,A)){let a=If(r,A);return r=tf(r,r.next),a=tf(a,a.next),ef(r,t,e,i,s,n,0),void ef(a,t,e,i,s,n,0)}A=A.next}r=r.next}while(r!==A)}function of(A,t){let e=A.x-t.x;return 0===e&&(e=A.y-t.y,0===e)&&(e=(A.next.y-A.y)/(A.next.x-A.x)-(t.next.y-t.y)/(t.next.x-t.x)),e}function lf(A,t){const e=function(A,t){let e=t;const i=A.x,s=A.y;let n,r=-1/0;if(mf(A,e))return e;do{if(mf(A,e.next))return e.next;if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){const A=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(A<=i&&A>r&&(r=A,n=e.x<e.next.x?e:e.next,A===i))return n}e=e.next}while(e!==t);if(!n)return null;const a=n,o=n.x,l=n.y;let c=1/0;e=n;do{if(i>=e.x&&e.x>=o&&i!==e.x&&gf(s<l?i:r,s,o,l,s<l?r:i,s,e.x,e.y)){const t=Math.abs(s-e.y)/(i-e.x);Bf(e,A)&&(t<c||t===c&&(e.x>n.x||e.x===n.x&&cf(n,e)))&&(n=e,c=t)}e=e.next}while(e!==a);return n}(A,t);if(!e)return t;const i=If(e,A);return tf(i,i.next),tf(e,e.next)}function cf(A,t){return ff(A.prev,A,t.prev)<0&&ff(t.next,A,A.next)<0}function hf(A,t,e,i,s){return(A=1431655765&((A=858993459&((A=252645135&((A=16711935&((A=(A-e)*s|0)|A<<8))|A<<4))|A<<2))|A<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function uf(A){let t=A,e=A;do{(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next}while(t!==A);return e}function gf(A,t,e,i,s,n,r,a){return(s-r)*(t-a)>=(A-r)*(n-a)&&(A-r)*(i-a)>=(e-r)*(t-a)&&(e-r)*(n-a)>=(s-r)*(i-a)}function df(A,t,e,i,s,n,r,a){return!(A===r&&t===a)&&gf(A,t,e,i,s,n,r,a)}function pf(A,t){return A.next.i!==t.i&&A.prev.i!==t.i&&!function(A,t){let e=A;do{if(e.i!==A.i&&e.next.i!==A.i&&e.i!==t.i&&e.next.i!==t.i&&Cf(e,e.next,A,t))return!0;e=e.next}while(e!==A);return!1}(A,t)&&(Bf(A,t)&&Bf(t,A)&&function(A,t){let e=A,i=!1;const s=(A.x+t.x)/2,n=(A.y+t.y)/2;do{e.y>n!=e.next.y>n&&e.next.y!==e.y&&s<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next}while(e!==A);return i}(A,t)&&(ff(A.prev,A,t.prev)||ff(A,t.prev,t))||mf(A,t)&&ff(A.prev,A,A.next)>0&&ff(t.prev,t,t.next)>0)}function ff(A,t,e){return(t.y-A.y)*(e.x-t.x)-(t.x-A.x)*(e.y-t.y)}function mf(A,t){return A.x===t.x&&A.y===t.y}function Cf(A,t,e,i){const s=yf(ff(A,t,e)),n=yf(ff(A,t,i)),r=yf(ff(e,i,A)),a=yf(ff(e,i,t));return s!==n&&r!==a||!(0!==s||!wf(A,e,t))||!(0!==n||!wf(A,i,t))||!(0!==r||!wf(e,A,i))||!(0!==a||!wf(e,t,i))}function wf(A,t,e){return t.x<=Math.max(A.x,e.x)&&t.x>=Math.min(A.x,e.x)&&t.y<=Math.max(A.y,e.y)&&t.y>=Math.min(A.y,e.y)}function yf(A){return A>0?1:A<0?-1:0}function Bf(A,t){return ff(A.prev,A,A.next)<0?ff(A,t,A.next)>=0&&ff(A,A.prev,t)>=0:ff(A,t,A.prev)<0||ff(A,A.next,t)<0}function If(A,t){const e=xf(A.i,A.x,A.y),i=xf(t.i,t.x,t.y),s=A.next,n=t.prev;return A.next=t,t.prev=A,e.next=s,s.prev=e,i.next=e,e.prev=i,n.next=i,i.prev=n,i}function Qf(A,t,e,i){const s=xf(A,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function Ef(A){A.next.prev=A.prev,A.prev.next=A.next,A.prevZ&&(A.prevZ.nextZ=A.nextZ),A.nextZ&&(A.nextZ.prevZ=A.prevZ)}function xf(A,t,e){return{i:A,x:t,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}const Df=Math.PI;class Mf extends Wi{type="ExtrudeGeometry";parameters;#Ll=!0;#Vl=0;#Jl=0;#Wl=0;#ql=0;#Xl=0;#Zl=0;#_l=0;constructor(A,t={}){super(),this.parameters={shapes:void 0===A?[{x:.5,y:.5},{x:-.5,y:.5},{x:-.5,y:-.5},{x:.5,y:-.5}]:A,options:t},this.#jl()}#jl(){const{shapes:A,options:t}=this.parameters,e=(n=A,Array.isArray(n)?0===n.length||(r=n[0])&&"object"==typeof r&&"number"==typeof r.x&&"number"==typeof r.y&&"function"!=typeof r.extractPoints?[{shape:n}]:n:[n]),i={minX:1/0,minY:1/0,minZ:1/0,maxX:-1/0,maxY:-1/0,maxZ:-1/0},s=[];var n,r;for(let g=0;g<e.length;g++){const A=vf(this,e[g],t,i);A&&s.push(A)}const a=function(A){if(0===A.length)return{pos:new Float32Array(0),nrm:new Float32Array(0),uv:new Float32Array(0),count:0};if(1===A.length)return{pos:A[0].pos,nrm:A[0].nrm,uv:A[0].uv,count:A[0].pos.length/3};let t=0;for(let a=0;a<A.length;a++)t+=A[a].pos.length/3;const e=new ArrayBuffer(8*t*4),i=new Float32Array(e,0,3*t),s=new Float32Array(e,3*t*4,3*t),n=new Float32Array(e,6*t*4,2*t);let r=0;for(let a=0;a<A.length;a++){const t=A[a];i.set(t.pos,3*r),s.set(t.nrm,3*r),n.set(t.uv,2*r),r+=t.pos.length/3}return{pos:i,nrm:s,uv:n,count:t}}(s);this.#Vl=a.count>0?i.minX:0,this.#Jl=a.count>0?i.minY:0,this.#Wl=a.count>0?i.minZ:0,this.#ql=a.count>0?i.maxX:0,this.#Xl=a.count>0?i.maxY:0,this.#Zl=a.count>0?i.maxZ:0;const o=.5*(this.#Vl+this.#ql),l=.5*(this.#Jl+this.#Xl),c=.5*(this.#Wl+this.#Zl);let h=0;const u=a.pos;for(let g=0;g<u.length;g+=3){const A=u[g]-o,t=u[g+1]-l,e=u[g+2]-c,i=A*A+t*t+e*e;i>h&&(h=i)}this.#_l=h>0?Math.sqrt(h):0,this.setAttribute("position",new Fi(a.pos,3)),this.setAttribute("normal",new Fi(a.nrm,3)),this.setAttribute("uv",new Fi(a.uv,2)),this.computeBoundingBox(),this.freeze()}applyMatrix4(A){return this.#Ll=!1,super.applyMatrix4(A)}computeBoundingBox(){if(!this.#Ll)return super.computeBoundingBox();const A=.5*(this.#Vl+this.#ql),t=.5*(this.#Jl+this.#Xl),e=.5*(this.#Wl+this.#Zl);return this.assignBoundingBox(this.#Vl,this.#Jl,this.#Wl,this.#ql,this.#Xl,this.#Zl,A,t,e,this.#_l)}copy(A){return super.copy(A),this.parameters={shapes:A.parameters.shapes,options:A.parameters.options},this.#Ll=A.#Ll,this.#Vl=A.#Vl,this.#Jl=A.#Jl,this.#Wl=A.#Wl,this.#ql=A.#ql,this.#Xl=A.#Xl,this.#Zl=A.#Zl,this.#_l=A.#_l,this}static fromJSON(A){return new Mf(A.shapes,A.options)}}function bf(A,t){return void 0!==A&&Number.isFinite(A)?A:t}function Sf(A){const t=new Array(A.length);for(let e=0;e<A.length;e++)t[e]={x:A[e].x,y:A[e].y};return t}function vf(A,t,e,i){const s=Math.max(1,Math.floor(bf(e.curveSegments,12))),n=Math.max(0,Math.floor(bf(e.steps,1))),r=bf(e.depth,1);let a=void 0===e.bevelEnabled||!!e.bevelEnabled,o=bf(e.bevelThickness,.2),l=void 0!==e.bevelSize&&Number.isFinite(e.bevelSize)?e.bevelSize:o-.1,c=bf(e.bevelOffset,0),h=Math.max(0,Math.floor(bf(e.bevelSegments,3)));const u=e.extrudePath??null,g=e.UVGenerator;let d=null,p=null,f=null;const m=!!u;if(u){d=u.getSpacedPoints(n);const A=u.computeFrenetFrames(n,!!u.isCatmullRomCurve3&&!!u.closed);p=A.normals,f=A.binormals,a=!1}a||(h=0,o=0,l=0,c=0);const C=function(A,t){if("function"==typeof A.extractPoints){const e=A.extractPoints(t),i=e.holes??[],s=new Array(i.length);for(let A=0;A<i.length;A++)s[A]=Sf(i[A]);return{shape:Sf(e.shape??[]),holes:s}}const e=A.holes??[],i=new Array(e.length);for(let s=0;s<e.length;s++)i[s]=Sf(e[s]);return{shape:Sf(A.shape??[]),holes:i}}(t,s);let w=C.shape;const y=C.holes;if(w.length<3)return null;if(!Lf(w)){w.reverse();for(let A=0;A<y.length;A++)Lf(y[A])&&y[A].reverse()}jf(w);for(let J=0;J<y.length;J++)jf(y[J]);if(w.length<3)return null;const B=w.slice();for(let J=0;J<y.length;J++){const A=y[J];for(let t=0;t<A.length;t++)B.push(A[t])}const I=B.length,Q=new Float64Array(2*I);let E=0;E=kf(w,Q,E);for(let J=0;J<y.length;J++)E=kf(y[J],Q,E);const x={x:0,y:0},D=new Float32Array(I*(n+1+2*h)*3);let M=0;const b=[],S=[];if(h>0)for(let J=0;J<h;J++){const A=J/h,t=o*Math.cos(A*Df*.5),e=l*Math.sin(A*Df*.5)+c;for(let i=0;i<w.length;i++)Uf(x,w[i],Q,i,e),M=Nf(D,M,x.x,x.y,-t),0===A&&b.push({x:x.x,y:x.y});for(let i=0;i<y.length;i++){const s=y[i],n=w.length+Tf(y,i),r=[];for(let i=0;i<s.length;i++)Uf(x,s[i],Q,n+i,e),M=Nf(D,M,x.x,x.y,-t),0===A&&r.push({x:x.x,y:x.y});0===A&&S.push(r)}}let v,T=w,U=y;if(0===h){zf(w);for(let A=0;A<y.length;A++)zf(y[A]);T=w,U=y,v=Gf(w,y)}else{for(let A=0;A<S.length;A++)zf(S[A]);zf(b),v=Gf(b,S)}const N=(A,t,e,i)=>{if(!(m&&d&&p&&f))return void(M=Nf(D,M,A,t,e));const s=p[i],n=f[i],r=d[i];M=Nf(D,M,r.x+s.x*A+n.x*t,r.y+s.y*A+n.y*t,r.z+s.z*A+n.z*t)},P=l+c;for(let J=0;J<I;J++){const A=a?Uf(x,B[J],Q,J,P):B[J];N(A.x,A.y,0,0)}for(let J=1;J<=n;J++)for(let A=0;A<I;A++){const t=a?Uf(x,B[A],Q,A,P):B[A];N(t.x,t.y,r/n*J,J)}for(let J=h-1;J>=0;J--){const A=J/h,t=o*Math.cos(A*Df*.5),e=l*Math.sin(A*Df*.5)+c;for(let i=0;i<w.length;i++)Uf(x,w[i],Q,i,e),M=Nf(D,M,x.x,x.y,r+t);for(let i=0;i<y.length;i++){const A=y[i],s=w.length+Tf(y,i);for(let i=0;i<A.length;i++)Uf(x,A[i],Q,s+i,e),M=Nf(D,M,x.x,x.y,r+t)}}let O=T.length;for(let J=0;J<U.length;J++)O+=U[J].length;const F=n+2*h,k=v.length/3*6+O*F*6,R=new ArrayBuffer(8*k*4),L=new Float32Array(R,0,3*k),j=new Float32Array(R,3*k*4,3*k),z=new Float32Array(R,6*k*4,2*k);let G=0;const Y=(t,e,s)=>{const n=G;if(G=Pf(D,L,t,G,i),G=Pf(D,L,e,G,i),G=Pf(D,L,s,G,i),Ff(L,j,n),g){const t=g.generateTopUV(A,L,n,n+1,n+2);Of(z,n,t[0].x,t[0].y),Of(z,n+1,t[1].x,t[1].y),Of(z,n+2,t[2].x,t[2].y)}else Of(z,n,L[3*n],L[3*n+1]),Of(z,n+1,L[3*(n+1)],L[3*(n+1)+1]),Of(z,n+2,L[3*(n+2)],L[3*(n+2)+1])},H=(t,e,s,n)=>{const r=G;let a,o,l,c,h,u,d,p;if(G=Pf(D,L,t,G,i),G=Pf(D,L,e,G,i),G=Pf(D,L,n,G,i),G=Pf(D,L,e,G,i),G=Pf(D,L,s,G,i),G=Pf(D,L,n,G,i),Ff(L,j,r),Ff(L,j,r+3),g){const t=g.generateSideWallUV(A,L,r,r+3,r+4,r+5);a=t[0].x,o=t[0].y,l=t[1].x,c=t[1].y,h=t[2].x,u=t[2].y,d=t[3].x,p=t[3].y}else{const A=L[3*r],t=L[3*r+1],e=L[3*r+2],i=L[3*(r+3)],s=L[3*(r+3)+1],n=L[3*(r+3)+2],g=L[3*(r+4)],f=L[3*(r+4)+1],m=L[3*(r+4)+2],C=L[3*(r+5)],w=L[3*(r+5)+1],y=L[3*(r+5)+2];Math.abs(t-s)<Math.abs(A-i)?(a=A,o=1-e,l=i,c=1-n,h=g,u=1-m,d=C,p=1-y):(a=t,o=1-e,l=s,c=1-n,h=f,u=1-m,d=w,p=1-y)}Of(z,r,a,o),Of(z,r+1,l,c),Of(z,r+2,d,p),Of(z,r+3,l,c),Of(z,r+4,h,u),Of(z,r+5,d,p)};if(a){for(let t=0;t<v.length;t+=3)Y(v[t+2],v[t+1],v[t]);const A=I*(n+2*h);for(let t=0;t<v.length;t+=3)Y(v[t]+A,v[t+1]+A,v[t+2]+A)}else{for(let t=0;t<v.length;t+=3)Y(v[t+2],v[t+1],v[t]);const A=I*n;for(let t=0;t<v.length;t+=3)Y(v[t]+A,v[t+1]+A,v[t+2]+A)}const K=(A,t)=>{let e=A.length;for(;--e>=0;){const i=e;let s=e-1;s<0&&(s=A.length-1);for(let A=0;A<F;A++){const e=I*A,n=I*(A+1);H(t+i+e,t+s+e,t+s+n,t+i+n)}}};let V=0;K(T,V),V+=T.length;for(let J=0;J<U.length;J++)K(U[J],V),V+=U[J].length;return{pos:L,nrm:j,uv:z}}function Tf(A,t){let e=0;for(let i=0;i<t;i++)e+=A[i].length;return e}function Uf(A,t,e,i,s){const n=2*i;return A.x=t.x+e[n]*s,A.y=t.y+e[n+1]*s,A}function Nf(A,t,e,i,s){return A[t]=e,A[t+1]=i,A[t+2]=s,t+3}function Pf(A,t,e,i,s){const n=3*e,r=A[n],a=A[n+1],o=A[n+2];return t[3*i]=r,t[3*i+1]=a,t[3*i+2]=o,r<s.minX&&(s.minX=r),a<s.minY&&(s.minY=a),o<s.minZ&&(s.minZ=o),r>s.maxX&&(s.maxX=r),a>s.maxY&&(s.maxY=a),o>s.maxZ&&(s.maxZ=o),i+1}function Of(A,t,e,i){A[2*t]=e,A[2*t+1]=i}function Ff(A,t,e){const i=3*e,s=i+3,n=i+6,r=A[i]-A[s],a=A[i+1]-A[s+1],o=A[i+2]-A[s+2],l=A[n]-A[s],c=A[n+1]-A[s+1],h=A[n+2]-A[s+2];let u=c*o-h*a,g=h*r-l*o,d=l*a-c*r;const p=u*u+g*g+d*d;if(p>0){const A=1/Math.sqrt(p);u*=A,g*=A,d*=A}else u=0,g=0,d=0;t[i]=u,t[i+1]=g,t[i+2]=d,t[s]=u,t[s+1]=g,t[s+2]=d,t[n]=u,t[n+1]=g,t[n+2]=d}function kf(A,t,e){const i=A.length;for(let s=0,n=i-1,r=1;s<i;s++,n++,r++)n===i&&(n=0),r===i&&(r=0),e=Rf(A[s],A[n],A[r],t,e);return e}function Rf(A,t,e,i,s){const n=A.x-t.x,r=A.y-t.y,a=e.x-A.x,o=e.y-A.y,l=n*n+r*r,c=n*o-r*a;let h,u,g;if(Math.abs(c)>Number.EPSILON){const c=Math.sqrt(l),d=Math.sqrt(a*a+o*o),p=t.x-r/c,f=t.y+n/c,m=((e.x-o/d-p)*o-(e.y+a/d-f)*a)/(n*o-r*a);h=p+n*m-A.x,u=f+r*m-A.y;const C=h*h+u*u;if(C<=2)return i[s]=h,i[s+1]=u,s+2;g=Math.sqrt(C/2)}else{let A=!1;n>Number.EPSILON?a>Number.EPSILON&&(A=!0):n<-Number.EPSILON?a<-Number.EPSILON&&(A=!0):Math.sign(r)===Math.sign(o)&&(A=!0),A?(h=-r,u=n,g=Math.sqrt(l)):(h=n,u=r,g=Math.sqrt(l/2))}return i[s]=h/g,i[s+1]=u/g,s+2}function Lf(A){const t=A.length;let e=0;for(let i=t-1,s=0;s<t;i=s++)e+=A[i].x*A[s].y-A[s].x*A[i].y;return.5*e<0}function jf(A){if(0===A.length)return;let t=A[0];for(let e=1;e<=A.length;e++){if(0===A.length)return;const i=e%A.length,s=A[i];if(!s)break;const n=s.x-t.x,r=s.y-t.y,a=Math.max(Math.abs(s.x),Math.abs(s.y),Math.abs(t.x),Math.abs(t.y));n*n+r*r<=1e-20*a*a?(A.splice(i,1),e--):t=s}}function zf(A){const t=A.length;t>2&&A[t-1].x===A[0].x&&A[t-1].y===A[0].y&&A.pop()}function Gf(A,t){const e=[];for(let n=0;n<A.length;n++)e.push(A[n].x,A[n].y);const i=[];let s=A.length;for(let n=0;n<t.length;n++){const A=t[n];if(0!==A.length){i.push(s),s+=A.length;for(let t=0;t<A.length;t++)e.push(A[t].x,A[t].y)}}return $p(e,i,2)}const Yf=(1+Math.sqrt(5))/2,Hf=new Float64Array([-1,Yf,0,1,Yf,0,-1,-Yf,0,1,-Yf,0,0,-1,Yf,0,1,Yf,0,-1,-Yf,0,1,-Yf,Yf,0,-1,Yf,0,1,-Yf,0,-1,-Yf,0,1]),Kf=new Uint8Array([0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]);class Vf extends vp{type="IcosahedronGeometry";constructor(A=1,t=0){super(Hf,Kf,A,t);const e=this.parameters;this.parameters={radius:e.radius,detail:e.detail}}static fromJSON(A){return new Vf(A.radius,A.detail)}}const Jf=2*Math.PI;function Wf(A){return"number"==typeof A&&Number.isFinite(A)?A:null}class qf extends Wi{type="LatheGeometry";parameters;#Ll=!0;#Vl=0;#Jl=0;#Wl=0;#ql=0;#Xl=0;#Zl=0;#_l=0;constructor(A,t=12,e=0,i=Jf){super();const s=A??(void 0===A?[{x:0,y:-.5},{x:.5,y:0},{x:0,y:.5}]:[]),n=Number.isFinite(t)?Math.floor(t):1;let r=Number.isFinite(i)?i:0;r<0?r=0:r>Jf&&(r=Jf),this.parameters={points:s,segments:n<1?1:n,phiStart:Number.isFinite(e)?e:0,phiLength:r},this.#jl()}#jl(){const{points:A,segments:t,phiStart:e,phiLength:i}=this.parameters,s=Math.max(0,Math.floor(A.length));if(s<2)return void this.#$l();if(!Number.isSafeInteger(t)||t>4294967296)throw new RangeError("LatheGeometry: segments exceeds vertex capacity");const n=t+1;if(s>Number.MAX_SAFE_INTEGER/n)throw new RangeError("LatheGeometry: segments exceeds vertex capacity");const r=n*s,a=t*(s-1)*6;if(r>4294967296||a>4294967295||!Number.isSafeInteger(a))throw new RangeError("LatheGeometry: segments exceeds vertex capacity");const o=new Float64Array(4*s);for(let v=0;v<s;v++){const t=A[v],e=4*v;o[e]=Wf(t?.x)??0,o[e+1]=Wf(t?.y)??0}let l=0,c=0;const h=s-1;for(let v=0;v<s;v++){const A=4*v;if(v===h){const t=1/(Math.sqrt(l*l+c*c)||1);o[A+2]=l*t,o[A+3]=c*t;break}const t=o[A+4]-o[A],e=o[A+5]-o[A+1],i=-t;if(0===v){const t=1/(Math.sqrt(e*e+i*i)||1);o[A+2]=e*t,o[A+3]=i*t}else{const t=e+l,s=i+c,n=1/(Math.sqrt(t*t+s*s)||1);o[A+2]=t*n,o[A+3]=s*n}l=e,c=i}const u=new ArrayBuffer(8*r*4),g=new Float32Array(u,0,3*r),d=new Float32Array(u,3*r*4,3*r),p=new Float32Array(u,6*r*4,2*r),f=new Uint32Array(a),m=1/t;let C=1/0,w=1/0,y=1/0,B=-1/0,I=-1/0,Q=-1/0,E=0;for(let v=0;v<n;v++){const A=e+v*m*i,n=Math.sin(A),r=Math.cos(A),a=v/t;for(let t=0;t<s;t++){const A=4*t,e=o[A],i=e*n,s=o[A+1],l=e*r,c=3*E;g[c]=i,g[c+1]=s,g[c+2]=l;const u=o[A+2];d[c]=u*n,d[c+1]=o[A+3],d[c+2]=u*r;const f=2*E;p[f]=a,p[f+1]=t/h;const m=g[c],x=g[c+1],D=g[c+2];m<C&&(C=m),x<w&&(w=x),D<y&&(y=D),m>B&&(B=m),x>I&&(I=x),D>Q&&(Q=D),E++}}let x=0;for(let v=0;v<t;v++){const A=v*s;for(let t=0;t<h;t++){const e=A+t,i=e+s,n=e+1,r=i+1;f[x]=e,f[x+1]=i,f[x+2]=n,f[x+3]=r,f[x+4]=n,f[x+5]=i,x+=6}}const D=(C+B)/2,M=(w+I)/2,b=(y+Q)/2;let S=0;for(let v=0;v<g.length;v+=3){const A=g[v]-D,t=g[v+1]-M,e=g[v+2]-b,i=A*A+t*t+e*e;i>S&&(S=i)}this.#Vl=C,this.#Jl=w,this.#Wl=y,this.#ql=B,this.#Xl=I,this.#Zl=Q,this.#_l=S>0?Math.sqrt(S):0,this.setIndex(new Oi(f,1)),this.setAttribute("position",new Fi(g,3)),this.setAttribute("normal",new Fi(d,3)),this.setAttribute("uv",new Fi(p,2)),this.computeBoundingBox(),this.freeze()}#$l(){this.#Vl=0,this.#Jl=0,this.#Wl=0,this.#ql=0,this.#Xl=0,this.#Zl=0,this.#_l=0,this.setAttribute("position",new Fi(new Float32Array(0),3)),this.setAttribute("normal",new Fi(new Float32Array(0),3)),this.setAttribute("uv",new Fi(new Float32Array(0),2)),this.computeBoundingBox(),this.freeze()}applyMatrix4(A){return this.#Ll=!1,super.applyMatrix4(A)}computeBoundingBox(){if(!this.#Ll)return super.computeBoundingBox();const A=(this.#Vl+this.#ql)/2,t=(this.#Jl+this.#Xl)/2,e=(this.#Wl+this.#Zl)/2;return this.assignBoundingBox(this.#Vl,this.#Jl,this.#Wl,this.#ql,this.#Xl,this.#Zl,A,t,e,this.#_l)}copy(A){return super.copy(A),this.parameters={...A.parameters},this.#Ll=A.#Ll,this.#Vl=A.#Vl,this.#Jl=A.#Jl,this.#Wl=A.#Wl,this.#ql=A.#ql,this.#Xl=A.#Xl,this.#Zl=A.#Zl,this.#_l=A.#_l,this}static fromJSON(A){return new qf(A.points,A.segments,A.phiStart,A.phiLength)}}const Xf=new Float64Array([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1]),Zf=new Uint8Array([0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2]);class _f extends vp{type="OctahedronGeometry";constructor(A=1,t=0){super(Xf,Zf,A,t);const e=this.parameters;this.parameters={radius:e.radius,detail:e.detail}}static fromJSON(A){return new _f(A.radius,A.detail)}}class $f extends Wi{type="PlaneGeometry";parameters;#Ll=!0;constructor(A=1,t=1,e=1,i=1){super(),this.parameters={width:A,height:t,widthSegments:Math.floor(e),heightSegments:Math.floor(i)},this.#jl()}#jl(){const{width:A,height:t,widthSegments:e,heightSegments:i}=this.parameters,s=e,n=i,r=s+1,a=n+1,o=r*a,l=s*n*6,c=new ArrayBuffer(8*o*4),h=new Float32Array(c,0,3*o),u=new Float32Array(c,3*o*4,3*o),g=new Float32Array(c,6*o*4,2*o),d=new Uint32Array(l),p=A/2,f=t/2,m=A/s,C=t/n,w=1/s,y=1/n;let B=0;for(let Q=0;Q<a;Q++){const A=Q*C-f;for(let t=0;t<r;t++){const e=t*m-p,i=3*B;h[i]=e,h[i+1]=-A,h[i+2]=0,u[i]=0,u[i+1]=0,u[i+2]=1;const s=2*B;g[s]=t*w,g[s+1]=1-Q*y,B++}}let I=0;for(let Q=0;Q<n;Q++)for(let A=0;A<s;A++){const t=A+r*Q,e=A+r*(Q+1),i=A+1+r*(Q+1),s=A+1+r*Q;d[I]=t,d[I+1]=e,d[I+2]=s,I+=3,d[I]=e,d[I+1]=i,d[I+2]=s,I+=3}this.setIndex(new Oi(d,1)),this.setAttribute("position",new Fi(h,3)),this.setAttribute("normal",new Fi(u,3)),this.setAttribute("uv",new Fi(g,2)),this.computeBoundingBox(),this.freeze()}applyMatrix4(A){return this.#Ll=!1,super.applyMatrix4(A)}computeBoundingBox(){if(!this.#Ll)return super.computeBoundingBox();const{width:A,height:t}=this.parameters,e=A/2,i=t/2;return this.assignBoundingBox(-e,-i,0,e,i,0,0,0,0,.5*Math.sqrt(A*A+t*t))}copy(A){return super.copy(A),this.parameters={...A.parameters},this.#Ll=A.#Ll,this}static fromJSON(A){return new $f(A.width,A.height,A.widthSegments,A.heightSegments)}}const Am=Math.PI,tm=2*Am,em=.5*Am;function im(A,t){const e=Math.floor(A);return e>=t?e:t}function sm(A,t,e,i,s){const n=A=>s?e*Math.cos(A):e*Math.sin(A);let r=n(A),a=r;const o=n(t);o<r&&(r=o),o>a&&(a=o);const l=Am;let c=i+Math.ceil((A-i)/l-1e-12)*l;c<A&&(c+=l);for(let h=0;h<4&&c<=t+1e-12;h++){const A=n(c);A<r&&(r=A),A>a&&(a=A),c+=l}return[r,a]}function nm(A,t,e,i,s,n){const r=t=>{const e=A*Math.cos(t)-i,r=A*Math.sin(t)-s,a=e*e+r*r;a>n&&(n=a)};if(r(t),r(e),0===i&&0===s)return n;const a=e-t,o=A=>{let e=(A-t)%tm;e<0&&(e+=tm),e<=a+1e-8&&r(t+e)},l=Math.atan2(s,i);return o(l),o(l+Am),n}class rm extends Wi{type="RingGeometry";parameters;#Ll=!0;constructor(A=.5,t=1,e=32,i=1,s=0,n=tm){super(),this.parameters={innerRadius:A,outerRadius:t,thetaSegments:im(e,3),phiSegments:im(i,1),thetaStart:s,thetaLength:n},this.#jl()}#jl(){const{innerRadius:A,outerRadius:t,thetaSegments:e,phiSegments:i,thetaStart:s,thetaLength:n}=this.parameters,r=e+1,a=i+1,o=a*r,l=i*e*6,c=new ArrayBuffer(8*o*4),h=new Float32Array(c,0,3*o),u=new Float32Array(c,3*o*4,3*o),g=new Float32Array(c,6*o*4,2*o),d=o>65535,p=d?new Uint32Array(l):new Uint16Array(l),f=(t-A)/i,m=n/e,C=0!==t?.5/t:0;for(let B=0;B<a;B++){const t=A+f*B,e=B*r;for(let A=0;A<r;A++){const i=s+A*m,n=e+A,r=3*n,a=t*Math.cos(i),o=t*Math.sin(i);h[r]=a,h[r+1]=o,u[r+2]=1;const l=2*n;g[l]=a*C+.5,g[l+1]=o*C+.5}}const w=n/tm;if(Number.isFinite(w)&&Math.abs(w)>.5&&Math.abs(w-Math.round(w))<1e-8)for(let B=0;B<a;B++){const A=B*r,t=A+e,i=3*A,s=3*t;h[s]=h[i],h[s+1]=h[i+1];const n=2*A,a=2*t;g[a]=g[n],g[a+1]=g[n+1]}let y=0;for(let B=0;B<i;B++){const A=B*r;for(let t=0;t<e;t++){const e=A+t,i=e+r,s=e+1,n=i+1;p[y]=e,p[y+1]=i,p[y+2]=s,y+=3,p[y]=i,p[y+1]=n,p[y+2]=s,y+=3}}this.setIndex(d?new Oi(p,1):new Pi(p,1,!1,!0)),this.setAttribute("position",new Fi(h,3)),this.setAttribute("normal",new Fi(u,3)),this.setAttribute("uv",new Fi(g,2)),this.computeBoundingBox(),this.freeze()}applyMatrix4(A){return this.#Ll=!1,super.applyMatrix4(A)}computeBoundingBox(){if(!this.#Ll)return super.computeBoundingBox();const{innerRadius:A,outerRadius:t,thetaStart:e,thetaLength:i}=this.parameters,s=Math.abs(A),n=Math.abs(t),r=s>n?s:n;if(0===r)return this.assignBoundingBox(0,0,0,0,0,0,0,0,0,0);let a=e,o=e+i;if(o<a){const A=a;a=o,o=A}if(!(o-a<tm))return this.assignBoundingBox(-r,-r,0,r,r,0,0,0,0,r);const[l,c]=sm(a,o,t,0,!0),[h,u]=sm(a,o,t,em,!1),[g,d]=sm(a,o,A,0,!0),[p,f]=sm(a,o,A,em,!1),m=g<l?g:l,C=d>c?d:c,w=p<h?p:h,y=f>u?f:u,B=.5*(m+C),I=.5*(w+y);let Q=nm(t,a,o,B,I,0);Q=nm(A,a,o,B,I,Q);const E=Q>0?Math.sqrt(Q):0;return this.assignBoundingBox(m,w,0,C,y,0,B,I,0,E)}copy(A){return super.copy(A),this.parameters={...A.parameters},this.#Ll=A.#Ll,this.computeBoundingBox(),this}static fromJSON(A){return new rm(A.innerRadius,A.outerRadius,A.thetaSegments,A.phiSegments,A.thetaStart,A.thetaLength)}}function am(A){return Array.isArray(A)&&(0===A.length||function(A){return!!A&&"object"==typeof A&&"number"==typeof A.x&&"number"==typeof A.y&&"function"!=typeof A.extractPoints}(A[0]))}function om(A,t){const e=A.slice();return function(A){const t=A.length;let e=0;for(let i=t-1,s=0;s<t;i=s++)e+=A[i].x*A[s].y-A[s].x*A[i].y;return.5*e<0}(e)!==t&&e.reverse(),e}function lm(A){const t=A.length;t>2&&A[t-1].x===A[0].x&&A[t-1].y===A[0].y&&A.pop()}function cm(A,t){const e=function(A,t){if("function"==typeof A.extractPoints){const e=A.extractPoints(t);return{shape:e.shape??[],holes:e.holes??[]}}return{shape:A.shape??[],holes:A.holes??[]}}(A,t);if(e.shape.length<3)return null;const i=om(e.shape,!0);if(lm(i),i.length<3)return null;const s=e.holes,n=[];for(let o=0;o<s.length;o++){const A=s[o];if(!A||A.length<3)continue;const t=om(A,!1);lm(t),t.length<3||n.push(t)}const r=function(A,t){let e=A.length;for(let r=0;r<t.length;r++)e+=t[r].length;const i=new Float64Array(2*e);let s,n=0;for(let r=0;r<A.length;r++)i[n++]=A[r].x,i[n++]=A[r].y;if(t.length>0){s=new Uint32Array(t.length);let e=A.length;for(let A=0;A<t.length;A++){s[A]=e;const r=t[A];e+=r.length;for(let A=0;A<r.length;A++)i[n++]=r[A].x,i[n++]=r[A].y}}return $p(i,s,2)}(i,n);if(0===r.length)return null;let a=i.length;for(let o=0;o<n.length;o++)a+=n[o].length;return{contour:i,holes:n,faces:r,vertexCount:a}}class hm extends Wi{type="ShapeGeometry";parameters;#Ll=!0;#Vl=0;#Jl=0;#ql=0;#Xl=0;#_l=0;constructor(A,t=12){var e;super(),this.parameters={shapes:void 0===A?[{x:0,y:.5},{x:-.5,y:-.5},{x:.5,y:-.5}]:A,curveSegments:Math.max(1,Math.floor((e=t,void 0!==e&&Number.isFinite(e)?e:12)))},this.#jl()}#jl(){const{shapes:A,curveSegments:t}=this.parameters,e=function(A){if(Array.isArray(A)){if(am(A))return[{shape:A}];const t=new Array(A.length);for(let e=0;e<A.length;e++){const i=A[e];t[e]=am(i)?{shape:i}:i}return t}return[A]}(A),i=[];let s=0,n=0;for(let C=0;C<e.length;C++){const A=cm(e[C],t);A&&(i.push(A),s+=A.vertexCount,n+=A.faces.length)}const r=new ArrayBuffer(8*s*4),a=new Float32Array(r,0,3*s),o=new Float32Array(r,3*s*4,3*s),l=new Float32Array(r,6*s*4,2*s),c=s>65535,h=c?new Uint32Array(n):new Uint16Array(n);let u=1/0,g=1/0,d=-1/0,p=-1/0,f=0,m=0;for(let C=0;C<i.length;C++){const A=i[C],t=f,e=A=>{for(let t=0;t<A.length;t++){const e=A[t],i=e.x,s=e.y,n=3*f;a[n]=i,a[n+1]=s,o[n+2]=1;const r=2*f;l[r]=i,l[r+1]=s,i<u&&(u=i),s<g&&(g=s),i>d&&(d=i),s>p&&(p=s),f++}};e(A.contour);for(let i=0;i<A.holes.length;i++)e(A.holes[i]);const s=A.faces;for(let i=0;i<s.length;i++)h[m++]=s[i]+t}if(0===s)this.#Vl=0,this.#Jl=0,this.#ql=0,this.#Xl=0,this.#_l=0;else{this.#Vl=u,this.#Jl=g,this.#ql=d,this.#Xl=p;const A=.5*(u+d),t=.5*(g+p);let e=0;for(let i=0;i<s;i++){const s=a[3*i]-A,n=a[3*i+1]-t,r=s*s+n*n;r>e&&(e=r)}this.#_l=e>0?Math.sqrt(e):0}this.setIndex(c?new Oi(h,1):new Pi(h,1,!1,!0)),this.setAttribute("position",new Fi(a,3)),this.setAttribute("normal",new Fi(o,3)),this.setAttribute("uv",new Fi(l,2)),this.computeBoundingBox(),this.freeze()}applyMatrix4(A){return this.#Ll=!1,super.applyMatrix4(A)}computeBoundingBox(){if(!this.#Ll)return super.computeBoundingBox();const A=.5*(this.#Vl+this.#ql),t=.5*(this.#Jl+this.#Xl);return this.assignBoundingBox(this.#Vl,this.#Jl,0,this.#ql,this.#Xl,0,A,t,0,this.#_l)}copy(A){return super.copy(A),this.parameters={shapes:A.parameters.shapes,curveSegments:A.parameters.curveSegments},this.#Ll=A.#Ll,this.#Vl=A.#Vl,this.#Jl=A.#Jl,this.#ql=A.#ql,this.#Xl=A.#Xl,this.#_l=A.#_l,this.computeBoundingBox(),this}static fromJSON(A){return new hm(A.shapes,A.curveSegments)}}class um extends Wi{type="SphereGeometry";parameters;#Ll=!0;constructor(A=1,t=32,e=16,i=0,s=2*Math.PI,n=0,r=Math.PI){super(),this.parameters={radius:A,widthSegments:Math.max(3,Math.floor(t)),heightSegments:Math.max(2,Math.floor(e)),phiStart:i,phiLength:s,thetaStart:n,thetaLength:r},this.#jl()}#jl(){const{radius:A,widthSegments:t,heightSegments:e,phiStart:i,phiLength:s,thetaStart:n,thetaLength:r}=this.parameters,a=Math.min(n+r,Math.PI),o=t,l=e,c=o+1,h=c*(l+1);let u=6*o*l;0===n&&(u-=3*o),a>=Math.PI&&(u-=3*o);const g=new ArrayBuffer(8*h*4),d=new Float32Array(g,0,3*h),p=new Float32Array(g,3*h*4,3*h),f=new Float32Array(g,6*h*4,2*h),m=new Uint32Array(u),C=1/o,w=1/l;let y=0;for(let I=0;I<=l;I++){const t=I*w;let e=0;0===I&&0===n?e=.5*C:I===l&&a===Math.PI&&(e=-.5*C);const c=n+t*r,h=Math.sin(c),u=Math.cos(c);for(let n=0;n<=o;n++){const r=n*C,a=i+r*s,o=Math.sin(a),l=-A*Math.cos(a)*h,c=A*u,g=A*o*h,m=3*y;d[m]=l,d[m+1]=c,d[m+2]=g;const w=1/A;p[m]=l*w,p[m+1]=c*w,p[m+2]=g*w;const B=2*y;f[B]=r+e,f[B+1]=1-t,y++}}let B=0;for(let I=0;I<l;I++)for(let A=0;A<o;A++){const t=A+1+c*I,e=A+c*I,i=A+c*(I+1),s=A+1+c*(I+1);(0!==I||n>0)&&(m[B]=t,m[B+1]=e,m[B+2]=s,B+=3),(I!==l-1||a<Math.PI)&&(m[B]=e,m[B+1]=i,m[B+2]=s,B+=3)}this.setIndex(new Oi(m,1)),this.setAttribute("position",new Fi(d,3)),this.setAttribute("normal",new Fi(p,3)),this.setAttribute("uv",new Fi(f,2)),this.computeBoundingBox(),this.freeze()}applyMatrix4(A){return this.#Ll=!1,super.applyMatrix4(A)}computeBoundingBox(){if(!this.#Ll)return super.computeBoundingBox();const{radius:A}=this.parameters;return this.assignBoundingBox(-A,-A,-A,A,A,A,0,0,0,A)}copy(A){return super.copy(A),this.parameters={...A.parameters},this.#Ll=A.#Ll,this}static fromJSON(A){return new um(A.radius,A.widthSegments,A.heightSegments,A.phiStart,A.phiLength,A.thetaStart,A.thetaLength)}}const gm=new Float64Array([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1]),dm=new Uint8Array([2,1,0,0,3,2,1,3,0,2,3,1]);class pm extends vp{type="TetrahedronGeometry";constructor(A=1,t=0){super(gm,dm,A,t);const e=this.parameters;this.parameters={radius:e.radius,detail:e.detail}}static fromJSON(A){return new pm(A.radius,A.detail)}}const fm=Math.PI,mm=2*fm,Cm=.5*fm;function wm(A,t){if(!Number.isFinite(A))return t;const e=Math.floor(A);return e>=t?e:t}function ym(A){return Number.isFinite(A)?A:0}function Bm(A,t,e,i,s){const n=A=>s?e*Math.cos(A):e*Math.sin(A);let r=n(A),a=r;const o=n(t);o<r&&(r=o),o>a&&(a=o);const l=fm;let c=i+Math.ceil((A-i)/l-1e-12)*l;c<A&&(c+=l);for(let h=0;h<4&&c<=t+1e-12;h++){const A=n(c);A<r&&(r=A),A>a&&(a=A),c+=l}return[r,a]}function Im(A,t){return t<A?[t,A]:[A,t]}function Qm(A,t,e,i,s,n,r){if(e){const A=Math.abs(i),t=Math.abs(s),e=A>t?A:t;return[-e,e]}const[a,o]=Bm(A,t,i,n,r),[l,c]=Bm(A,t,s,n,r);return[a<l?a:l,o>c?o:c]}function Em(A,t,e,i,s,n,r){const a=2*t*(A-s*r),o=-2*n*t,l=A*A+t*t+s*s+n*n-2*s*r*A,c=A=>l+a*Math.cos(A)+o*Math.sin(A);let h=c(e);const u=c(i);if(u>h&&(h=u),0!==a||0!==o){let A=(Math.atan2(o,a)-e)%mm;if(A<0&&(A+=mm),A<=i-e+1e-8){const t=c(e+A);t>h&&(h=t)}}return h}class xm extends Wi{type="TorusGeometry";parameters;#Ll=!0;constructor(A=1,t=.4,e=12,i=48,s=mm,n=0,r=mm){super(),this.parameters={radius:ym(A),tube:ym(t),radialSegments:wm(e,1),tubularSegments:wm(i,1),arc:ym(s),thetaStart:ym(n),thetaLength:ym(r)},this.#jl()}#jl(){const{radius:A,tube:t,radialSegments:e,tubularSegments:i,arc:s,thetaStart:n,thetaLength:r}=this.parameters,a=i+1,o=e+1;if(a>4294967296||o>4294967296||o>Number.MAX_SAFE_INTEGER/a)throw new RangeError("TorusGeometry: segments exceeds vertex capacity");const l=o*a,c=e*i;if(!Number.isSafeInteger(c)||c>715827882.5||l>4294967295)throw new RangeError("TorusGeometry: segments exceeds vertex capacity");const h=6*c,u=new ArrayBuffer(8*l*4),g=new Float32Array(u,0,3*l),d=new Float32Array(u,3*l*4,3*l),p=new Float32Array(u,6*l*4,2*l),f=l>65536,m=f?new Uint32Array(h):new Uint16Array(h),C=new Float64Array(a),w=new Float64Array(a),y=new Float64Array(o),B=new Float64Array(o),I=new Float32Array(a),Q=s/mm,E=r/mm,x=Number.isFinite(Q)&&Math.abs(Q)>.5&&Math.abs(Q-Math.round(Q))<1e-8,D=Number.isFinite(E)&&Math.abs(E)>.5&&Math.abs(E-Math.round(E))<1e-8;for(let v=0;v<i;v++){const A=v/i,t=A*s;C[v]=Math.cos(t),w[v]=Math.sin(t),I[v]=A}I[i]=1,x?(C[i]=C[0],w[i]=w[0]):(C[i]=Math.cos(s),w[i]=Math.sin(s));for(let v=0;v<e;v++){const A=n+v/e*r;y[v]=Math.cos(A),B[v]=Math.sin(A)}if(D)y[e]=y[0],B[e]=B[0];else{const A=n+r;y[e]=Math.cos(A),B[e]=Math.sin(A)}const M=t>0?1:t<0?-1:0;for(let v=0;v<o;v++){const i=y[v],s=B[v],n=A+t*i,r=t*s,o=M*i,l=M*s,c=v*a,h=v===e?1:v/e;for(let A=0;A<a;A++){const t=C[A],e=w[A],i=c+A,s=3*i;g[s]=n*t,g[s+1]=n*e,g[s+2]=r,d[s]=o*t,d[s+1]=o*e,d[s+2]=l;const a=2*i;p[a]=I[A],p[a+1]=h}}const b=s<0!=r<0;let S=0;for(let v=0;v<e;v++){const A=v*a,t=A+a;for(let e=0;e<i;e++){const i=A+e,s=i+1,n=t+e,r=n+1,a=b?r:i,o=b?i:r,l=b?r:s,c=b?s:r;m[S]=n,m[S+1]=a,m[S+2]=o,S+=3,m[S]=i,m[S+1]=l,m[S+2]=c,S+=3}}this.setIndex(f?new Oi(m,1):new Pi(m,1,!1,!0)),this.setAttribute("position",new Fi(g,3)),this.setAttribute("normal",new Fi(d,3)),this.setAttribute("uv",new Fi(p,2)),this.computeBoundingBox(),this.freeze()}applyMatrix4(A){return this.#Ll=!1,super.applyMatrix4(A)}computeBoundingBox(){if(!this.#Ll)return super.computeBoundingBox();const{radius:A,tube:t,arc:e,thetaStart:i,thetaLength:s}=this.parameters,n=i+s;if(!Number.isFinite(n))return super.computeBoundingBox();const[r,a]=Im(0,e),[o,l]=Im(i,n),c=!(a-r<mm),h=!(l-o<mm);let u=-1,g=1;if(!h){const A=Bm(o,l,1,0,!0);u=A[0],g=A[1]}const d=t*u,p=t*g,f=A+(d<p?d:p),m=A+(d>p?d:p),[C,w]=Qm(r,a,c,f,m,0,!0),[y,B]=Qm(r,a,c,f,m,Cm,!1);let I,Q;if(h){const A=Math.abs(t);I=-A,Q=A}else{const A=Bm(o,l,t,Cm,!1);I=A[0],Q=A[1]}const E=.5*(C+w),x=.5*(y+B),D=.5*(I+Q),M=function(A,t,e,i,s,n,r,a,o,l){const c=Math.hypot(a,o);let h=0,u=0;if(0!==c)if(s)h=-1,u=1;else{const A=Math.atan2(o,a),t=Bm(e-A,i-A,1,0,!0);h=t[0],u=t[1]}const g=r-n>=mm?n+mm:r,d=[n];!function(A,t,e,i,s){if(0===i)return;const n=-e/i;if(n>1||n<-1)return;const r=Math.acos(n),a=t-A,o=t=>{let e=(t-A)%mm;e<0&&(e+=mm),e>1e-8&&e<a-1e-8&&s.push(A+e)};o(r),0!==r&&r!==fm&&o(-r)}(n,g,A,t,d),d.push(g),d.length>3&&d.sort((A,t)=>A-t);let p=0;for(let f=0;f<d.length-1;f++){const e=d[f],i=d[f+1];if(!(i>e))continue;let s=0;0!==c&&(s=A+t*Math.cos(.5*(e+i))>=0?h:u);const n=Em(A,t,e,i,c,l,s);n>p&&(p=n)}return p}(A,t,r,a,c,o,l,E,x,D),b=M>0?Math.sqrt(M):0;return this.assignBoundingBox(C,y,I,w,B,Q,E,x,D,b)}copy(A){return super.copy(A),this.parameters={...A.parameters},this.#Ll=A.#Ll,this}static fromJSON(A){return new xm(A.radius,A.tube,A.radialSegments,A.tubularSegments,A.arc,A.thetaStart,A.thetaLength)}}const Dm=2*Math.PI;function Mm(A,t){const e=Math.floor(A);return e>=t?e:t}function bm(A,t,e){return A<t?t:A>e?e:A}function Sm(A,t){if(Array.isArray(A)&&A.length>=3)return{x:Number(A[0])||0,y:Number(A[1])||0,z:Number(A[2])||0};if(A&&"object"==typeof A){const t=A;if("number"==typeof t.x&&"number"==typeof t.y)return{x:t.x,y:t.y,z:"number"==typeof t.z?t.z:0}}return t}function vm(A,t,e){return{getPoint(i,s={x:0,y:0,z:0}){const n=1-i,r=n*n,a=2*n*i,o=i*i;return s.x=r*A.x+a*t.x+o*e.x,s.y=r*A.y+a*t.y+o*e.y,s.z=r*A.z+a*t.z+o*e.z,s}}}function Tm(A){if(void 0===A)return vm({x:-1,y:-1,z:0},{x:-1,y:1,z:0},{x:1,y:1,z:0});if(null===A)return null;if(function(A){if(!A||"object"!=typeof A)return!1;const t=A;return"function"==typeof t.getPoint||"function"==typeof t.getPointAt||"function"==typeof t.computeFrenetFrames}(A)&&("function"==typeof A.getPoint||"function"==typeof A.getPointAt))return A;const t=A;return null!=t.v0&&null!=t.v1&&null!=t.v2?vm(Sm(t.v0,{x:0,y:0,z:0}),Sm(t.v1,{x:0,y:0,z:0}),Sm(t.v2,{x:0,y:0,z:0})):null}function Um(){return{x:0,y:0,z:0,set(A,t,e=0){return this.x=A,this.y=t,this.z=e,this}}}function Nm(A,t,e,i){const s=A[t];s&&function(A,t){t&&(A.x=t.x,A.y=t.y,A.z=t.z??0)}(i,s.call(A,e,i)??i)}function Pm(A,t,e,i,s,n){return[t*n-e*s,e*i-A*n,A*s-t*i]}function Om(A,t,e,i,s,n){return A*i+t*s+e*n}function Fm(A,t,e){const i=1/(Math.sqrt(A*A+t*t+e*e)||1);return[A*i,t*i,e*i]}function km(A,t,e,i,s,n,r){const a=Math.cos(r),o=Math.sin(r),l=1-a,c=i*A+s*t+n*e;return[A*a+(s*e-n*t)*o+i*c*l,t*a+(n*A-i*e)*o+s*c*l,e*a+(i*t-s*A)*o+n*c*l]}function Rm(A,t,e,i,s,n,r){const a=A+1,o=t+1,l=a*o,c=A*t*6,h=new Float64Array(o),u=new Float64Array(o),g=1/t;for(let N=0;N<o;N++){const A=N*g*Dm;h[N]=-Math.cos(A),u[N]=Math.sin(A)}const d=new ArrayBuffer(8*l*4),p=new Float32Array(d,0,3*l),f=new Float32Array(d,3*l*4,3*l),m=new Float32Array(d,6*l*4,2*l),C=l>65535,w=C?new Uint32Array(c):new Uint16Array(c),y=1/A;let B=1/0,I=1/0,Q=1/0,E=-1/0,x=-1/0,D=-1/0,M=0;for(let N=0;N<a;N++){const A=3*N,t=i[A],a=i[A+1],l=i[A+2],c=s[A],d=s[A+1],C=s[A+2],w=n[A],b=n[A+1],S=n[A+2],v=N*y;for(let i=0;i<o;i++){const A=h[i]*c+u[i]*w,s=h[i]*d+u[i]*b,n=h[i]*C+u[i]*S;let o,y,T,U,N,P;r?(o=e*A,y=e*s,T=e*n,[U,N,P]=Fm(o,y,T)):([U,N,P]=Fm(A,s,n),o=e*U,y=e*N,T=e*P);const O=t+o,F=a+y,k=l+T,R=3*M;p[R]=O,p[R+1]=F,p[R+2]=k,f[R]=U,f[R+1]=N,f[R+2]=P;const L=2*M;m[L]=v,m[L+1]=i*g,O<B&&(B=O),F<I&&(I=F),k<Q&&(Q=k),O>E&&(E=O),F>x&&(x=F),k>D&&(D=k),M++}}let b=0;for(let N=1;N<=A;N++){const A=o*(N-1),e=o*N;for(let i=1;i<=t;i++){const t=A+i-1,s=e+i-1,n=e+i,r=A+i;w[b]=t,w[b+1]=s,w[b+2]=r,b+=3,w[b]=s,w[b+1]=n,w[b+2]=r,b+=3}}const S=.5*(B+E),v=.5*(I+x),T=.5*(Q+D);let U=0;for(let N=0;N<p.length;N+=3){const A=p[N]-S,t=p[N+1]-v,e=p[N+2]-T,i=A*A+t*t+e*e;i>U&&(U=i)}return{vertices:p,normals:f,uvs:m,indices:w,index32:C,minX:B,minY:I,minZ:Q,maxX:E,maxY:x,maxZ:D,sphereRadius:U>0?Math.sqrt(U):0}}function Lm(A,t){A.setIndex(t.index32?new Oi(t.indices,1):new Pi(t.indices,1,!1,!0)),A.setAttribute("position",new Fi(t.vertices,3)),A.setAttribute("normal",new Fi(t.normals,3)),A.setAttribute("uv",new Fi(t.uvs,2))}class jm extends Wi{type="TubeGeometry";parameters;#Ll=!0;#Vl=0;#Jl=0;#Wl=0;#ql=0;#Xl=0;#Zl=0;#_l=0;constructor(A,t=64,e=1,i=8,s=!1){super(),this.parameters={path:Tm(A),tubularSegments:Mm(t,1),radius:Number.isFinite(e)?e:0,radialSegments:Mm(i,1),closed:!0===s},this.#jl()}#jl(){const{path:A,tubularSegments:t,radius:e,radialSegments:i,closed:s}=this.parameters;if(!A||"function"!=typeof A.getPoint&&"function"!=typeof A.getPointAt)return this.#Ac({minX:0,minY:0,minZ:0,maxX:0,maxY:0,maxZ:0,sphereRadius:0}),this.setAttribute("position",new Fi(new Float32Array(0),3)),this.setAttribute("normal",new Fi(new Float32Array(0),3)),this.setAttribute("uv",new Fi(new Float32Array(0),2)),this.computeBoundingBox(),void this.freeze();const n=t+1,r=new Float64Array(3*n),a=new Float64Array(3*n),o=new Float64Array(3*n),l=new Float64Array(n),c=new Float64Array(n),h=new Float64Array(n),u=new Float64Array(n),g=new Float64Array(n),d=new Float64Array(n),p="function"==typeof A.getPointAt,f=p||"function"!=typeof A.getPoint?null:function(A){const t=A.arcLengthDivisions&&A.arcLengthDivisions>0?Math.floor(A.arcLengthDivisions):200,e=new Float64Array(t+1),i=Um(),s=Um();Nm(A,"getPoint",0,i);let n=0;for(let a=1;a<=t;a++){Nm(A,"getPoint",a/t,s);const r=s.x-i.x,o=s.y-i.y,l=s.z-i.z;n+=Math.sqrt(r*r+o*o+l*l),e[a]=n,i.x=s.x,i.y=s.y,i.z=s.z}const r=e.length;return A=>{const t=A*e[r-1];let i=0,s=0,n=r-1;for(;s<=n;){i=Math.floor(s+(n-s)/2);const A=e[i]-t;if(A<0)s=i+1;else{if(!(A>0)){n=i;break}n=i-1}}if(i=n,i<0)return 0;if(i>=r-1)return 1;if(e[i]===t)return i/(r-1);const a=e[i],o=e[i+1]-a;return 0===o?i/(r-1):(i+(t-a)/o)/(r-1)}}(A);if("function"==typeof A.computeFrenetFrames){const e=A.computeFrenetFrames(t,s);for(let A=0;A<n;A++){const t=e.normals[A],i=e.binormals[A];l[A]=t.x,c[A]=t.y,h[A]=t.z,u[A]=i.x,g[A]=i.y,d[A]=i.z}}else{const e=new Float64Array(n),i=new Float64Array(n),r=new Float64Array(n),a=Um(),o=Um();!function(A,t,e,i,s,n,r,a,o,l,c,h){const u={x:0,y:0,z:0};for(let U=0;U<=A;U++)e(U/A,u),i[U]=u.x,s[U]=u.y,n[U]=u.z;let g=0,d=0,p=0,f=Number.MAX_VALUE;const m=Math.abs(i[0]),C=Math.abs(s[0]);m<=f&&(f=m,g=1,d=0,p=0),C<=f&&(f=C,g=0,d=1,p=0),Math.abs(n[0])<=f&&(g=0,d=0,p=1);let[w,y,B]=Pm(i[0],s[0],n[0],g,d,p);[w,y,B]=Fm(w,y,B);let[I,Q,E]=Pm(i[0],s[0],n[0],w,y,B);r[0]=I,a[0]=Q,o[0]=E;let[x,D,M]=Pm(i[0],s[0],n[0],I,Q,E);l[0]=x,c[0]=D,h[0]=M;for(let U=1;U<=A;U++){let A=r[U-1],t=a[U-1],e=o[U-1],[u,g,d]=Pm(i[U-1],s[U-1],n[U-1],i[U],s[U],n[U]);const p=Math.sqrt(u*u+g*g+d*d);if(p>Number.EPSILON){const r=1/p,a=Math.acos(bm(Om(i[U-1],s[U-1],n[U-1],i[U],s[U],n[U]),-1,1));[A,t,e]=km(A,t,e,u*r,g*r,d*r,a)}r[U]=A,a[U]=t,o[U]=e;const[f,m,C]=Pm(i[U],s[U],n[U],A,t,e);l[U]=f,c[U]=m,h[U]=C}if(!t)return;const[b,S,v]=Pm(r[0],a[0],o[0],r[A],a[A],o[A]);let T=Math.acos(bm(Om(r[0],a[0],o[0],r[A],a[A],o[A]),-1,1))/A;Om(i[0],s[0],n[0],b,S,v)>0&&(T=-T);for(let U=1;U<=A;U++){const[A,t,e]=km(r[U],a[U],o[U],i[U],s[U],n[U],T*U);r[U]=A,a[U]=t,o[U]=e;const[u,g,d]=Pm(i[U],s[U],n[U],A,t,e);l[U]=u,c[U]=g,h[U]=d}}(t,s,(t,e)=>{if(f){const e=f(t),i=1e-4;let s=e-i,n=e+i;s<0&&(s=0),n>1&&(n=1),Nm(A,"getPoint",s,a),Nm(A,"getPoint",n,o)}else{const e=1e-4;let i=t-e,s=t+e;i<0&&(i=0),s>1&&(s=1),Nm(A,"getPointAt",i,a),Nm(A,"getPointAt",s,o)}const[i,s,n]=Fm(o.x-a.x,o.y-a.y,o.z-a.z);e.x=i,e.y=s,e.z=n},e,i,r,l,c,h,u,g,d)}const m=Um();for(let w=0;w<n;w++){const e=s&&w===t?0:w,i=s&&w===t?0:w/t;p?Nm(A,"getPointAt",i,m):f&&Nm(A,"getPoint",f(i),m);const n=3*w;r[n]=m.x,r[n+1]=m.y,r[n+2]=m.z,a[n]=l[e],a[n+1]=c[e],a[n+2]=h[e],o[n]=u[e],o[n+1]=g[e],o[n+2]=d[e]}const C=Rm(t,i,e,r,a,o,!1);this.#Ac(C),Lm(this,C),this.computeBoundingBox(),this.freeze()}#Ac(A){this.#Vl=A.minX,this.#Jl=A.minY,this.#Wl=A.minZ,this.#ql=A.maxX,this.#Xl=A.maxY,this.#Zl=A.maxZ,this.#_l=A.sphereRadius}applyMatrix4(A){return this.#Ll=!1,super.applyMatrix4(A)}computeBoundingBox(){if(!this.#Ll)return super.computeBoundingBox();const A=.5*(this.#Vl+this.#ql),t=.5*(this.#Jl+this.#Xl),e=.5*(this.#Wl+this.#Zl);return this.assignBoundingBox(this.#Vl,this.#Jl,this.#Wl,this.#ql,this.#Xl,this.#Zl,A,t,e,this.#_l)}copy(A){return super.copy(A),this.parameters={path:A.parameters.path,tubularSegments:A.parameters.tubularSegments,radius:A.parameters.radius,radialSegments:A.parameters.radialSegments,closed:A.parameters.closed},this.#Ll=A.#Ll,this.#Vl=A.#Vl,this.#Jl=A.#Jl,this.#Wl=A.#Wl,this.#ql=A.#ql,this.#Xl=A.#Xl,this.#Zl=A.#Zl,this.#_l=A.#_l,this.computeBoundingBox(),this}static fromJSON(A){return new jm(A.path,A.tubularSegments,A.radius,A.radialSegments,A.closed)}}const zm=2*Math.PI;function Gm(A,t){const e=Math.floor(A);return e>=t?e:t}function Ym(A,t,e){const i=1/(Math.sqrt(A*A+t*t+e*e)||1);return[A*i,t*i,e*i]}function Hm(A,t,e,i,s){const n=Math.cos(A),r=Math.sin(A),a=e/t*A,o=Math.cos(a);s[0]=i*(2+o)*.5*n,s[1]=i*(2+o)*r*.5,s[2]=i*Math.sin(a)*.5}class Km extends Wi{type="TorusKnotGeometry";parameters;#Ll=!0;#Vl=0;#Jl=0;#Wl=0;#ql=0;#Xl=0;#Zl=0;#_l=0;constructor(A=1,t=.4,e=64,i=8,s=2,n=3){super(),this.parameters={radius:Number.isFinite(A)?A:1,tube:Number.isFinite(t)?t:0,tubularSegments:Gm(e,1),radialSegments:Gm(i,1),p:Number.isFinite(s)&&0!==s?s:2,q:Number.isFinite(n)?n:3},this.#jl()}#jl(){const{radius:A,tube:t,tubularSegments:e,radialSegments:i,p:s,q:n}=this.parameters,r=e+1,a=new Float64Array(3*r),o=new Float64Array(3*r),l=new Float64Array(3*r),c=new Float64Array(3),h=new Float64Array(3),u=s*zm/e;for(let d=0;d<r;d++){const t=d*u;Hm(t,s,n,A,c),Hm(t+.01,s,n,A,h);const e=h[0]-c[0],i=h[1]-c[1],r=h[2]-c[2],g=h[0]+c[0],p=h[1]+c[1],f=h[2]+c[2];let m=i*f-r*p,C=r*g-e*f,w=e*p-i*g;const y=C*r-w*i,B=w*e-m*r,I=m*i-C*e;[m,C,w]=Ym(m,C,w);const[Q,E,x]=Ym(y,B,I),D=3*d;a[D]=c[0],a[D+1]=c[1],a[D+2]=c[2],o[D]=Q,o[D+1]=E,o[D+2]=x,l[D]=m,l[D+1]=C,l[D+2]=w}const g=Rm(e,i,t,a,o,l,!0);this.#Ac(g),Lm(this,g),this.computeBoundingBox(),this.freeze()}#Ac(A){this.#Vl=A.minX,this.#Jl=A.minY,this.#Wl=A.minZ,this.#ql=A.maxX,this.#Xl=A.maxY,this.#Zl=A.maxZ,this.#_l=A.sphereRadius}applyMatrix4(A){return this.#Ll=!1,super.applyMatrix4(A)}computeBoundingBox(){if(!this.#Ll)return super.computeBoundingBox();const A=.5*(this.#Vl+this.#ql),t=.5*(this.#Jl+this.#Xl),e=.5*(this.#Wl+this.#Zl);return this.assignBoundingBox(this.#Vl,this.#Jl,this.#Wl,this.#ql,this.#Xl,this.#Zl,A,t,e,this.#_l)}copy(A){return super.copy(A),this.parameters={...A.parameters},this.#Ll=A.#Ll,this.#Vl=A.#Vl,this.#Jl=A.#Jl,this.#Wl=A.#Wl,this.#ql=A.#ql,this.#Xl=A.#Xl,this.#Zl=A.#Zl,this.#_l=A.#_l,this.computeBoundingBox(),this}static fromJSON(A){return new Km(A.radius,A.tube,A.tubularSegments,A.radialSegments,A.p,A.q)}}const Vm=new Float32Array(1),Jm=new Uint32Array(Vm.buffer);function Wm(A){if(Number.isNaN(A))return 2143289344;Vm[0]=A;const t=Jm[0];return 2147483648===t?0:t}function qm(A){let t=1;for(;t<A&&t<1073741824;)t<<=1;return t}function Xm(A,t,e){let i=Math.imul(A,2654435761)^t;return i=Math.imul(i,2246822507)^e,i>>>0}function Zm(A,t,e,i){const s=(0|A.typeInfo.offset)+t*A.stride,n=A.view;e[i]=n[s],e[i+1]=n[s+1],e[i+2]=n[s+2]}const _m=W.RGBA16Float;class $m extends Rn{type="CubeConvolution";envBinding;samplerBinding;faceBinding;modeBinding;roughnessBinding;sizeBinding;paramsBinding;constructor(){super();const A=new rt({magFilter:X.Linear,minFilter:X.Linear,mipmapFilter:X.Linear,wrapS:q.ClampToEdge,wrapT:q.ClampToEdge,wrapR:q.ClampToEdge});this.envBinding=new qt("env",_h()),this.samplerBinding=new Wt("envSampler",A),this.faceBinding=new zt("face",0,"f32",{access:"Uniform"}),this.modeBinding=new zt("mode",0,"f32",{access:"Uniform"}),this.roughnessBinding=new zt("roughness",0,"f32",{access:"Uniform"}),this.sizeBinding=new zt("size",1,"f32",{access:"Uniform"}),this.paramsBinding=new Xt("conv",[this.faceBinding,this.modeBinding,this.roughnessBinding,this.sizeBinding],{access:"Uniform",mode:"struct"}),this.addBinding(this.envBinding),this.addBinding(this.samplerBinding),this.addBinding(this.paramsBinding)}attach(A){this.envBinding.setValue(A)}writeParams(A,t,e,i,s){this.faceBinding.setValue(t),this.modeBinding.setValue(e),this.roughnessBinding.setValue(i),this.sizeBinding.setValue(s);const n=this.paramsBinding;n.isDirty=!0,n.updateCPUBuffer(),n.updateGPUBuffer(A),this.envBinding.updateGPUBuffer(A)}}function AC(A,t,e){const i=0|A;let s=t;for(;s<i&&s<e;)s<<=1;return s>e&&(s=e),Math.max(t,s)}function tC(A,t,e,i){const s=new Wn(A,{name:t,width:e,height:e,sampleCount:1,depth:!1,stencil:!1,format:_m,clearColor:!0,clearColorValue:{r:0,g:0,b:0,a:1}},{depth:6,isCube:!0,useMipmaps:i,generateMipmaps:!1,magFilter:X.Linear,minFilter:X.Linear,mipmapFilter:X.Linear});s.createTextures();const n=s.texture;return n.isCube=!0,n.ensureUploaded(A),n.isDirty=!1,s}const eC=.002,iC=["inverse","linear","exponential"];class sC{slot=-1;dead=!1;loop=!1;positional=!1;attached=!1;active=!1;hrtf=!1;placed=!1;follow=null;pin=null;instanceId=-1;buffer=null;group=null;vol=1;priority=1;playbackRate=1;detune=0;offset=0;end=0;loopStart=0;loopEnd=0;model=0;ref=1;rolloff=1;max=1e4;cull2=Number.POSITIVE_INFINITY;x=0;y=0;z=0;lx=0;ly=0;lz=0;d2=0;score=-1;pick=0;born=0;fft=0;tap=!1;source=null;gain=null;panner=null;analyser=null;freq=null;hub;constructor(A){this.hub=A}get playing(){return!this.dead}get volume(){return this.vol}set volume(A){this.vol=A>0?A:0,this.cull2=oC(this.model,this.ref,this.rolloff,this.max,this.vol);const t=this.gain;t&&(t.gain.value=this.vol)}stop(){this.dead||(this.dead=!0,this.releaseNodes(),this.dropAnalyser(),this.follow=null,this.pin=null,this.buffer=null,this.hub.unlink(this))}analyse(A=256){if(this.dead)return this;const t=A<32?32:A;return this.fft===t&&this.analyser||(this.dropAnalyser(),this.fft=t,this.gain&&this.attachAnalyser()),this}frequency(){const A=this.analyser,t=this.freq;if(!A||!t||!this.active)return 0;A.getByteFrequencyData(t);let e=0;const i=t.length;for(let s=0;s<i;s++)e+=t[s];return e/i}track(){if(!this.buffer)return!1;if(!this.loop&&this.offset+(this.hub.ctx.currentTime-this.born)*this.playbackRate>=this.end)return!1;const A=this.pin;if(A){if(null==A.position)return!1;rC(A,this.instanceId,this),this.pin=null}const t=this.follow;if(t){if(null==t.position)return!1;if(null!=t.dirtySystem)this.attached=!0;else if(this.attached)return!1;rC(t,this.instanceId,this)}return!0}realize(A,t,e){if(this.active||this.dead)return;const i=this.buffer;if(!i)return;const s=this.hub,n=s.ctx,r=n.currentTime;let a=this.offset+(r-this.born)*this.playbackRate,o=0;if(this.loop&&this.loopEnd>this.loopStart){const A=this.loopEnd-this.loopStart;a=this.loopStart+nC(a-this.loopStart,A)}else if(this.loop&&i.duration>0)a=nC(a,i.duration);else if(o=this.end-a,!(o>0))return void(this.dead=!0);const l=n.createBufferSource();if(l.buffer=i,l.loop=this.loop,this.loop&&this.loopEnd>this.loopStart&&(l.loopStart=this.loopStart,l.loopEnd=this.loopEnd),l.playbackRate.value=this.playbackRate,l.detune.value=this.detune,this.source=l,l.onended=()=>{if(!this.dead&&this.source===l)return s.inSync?(this.dead=!0,void this.releaseNodes()):void this.stop()},this.loop?l.start(r,a):l.start(r,a,o),this.dead)return;const c=function(A){return A.gainPool.pop()||A.ctx.createGain()}(s);c.gain.value=this.vol;const h=this.group??s.master;if(this.positional){const i=function(A){return A.pannerPool.pop()||A.ctx.createPanner()}(s);i.distanceModel=iC[this.model],i.refDistance=this.ref,i.rolloffFactor=this.rolloff,i.maxDistance=this.max,i.panningModel="equalpower",i.coneInnerAngle=360,i.coneOuterAngle=360,i.coneOuterGain=0,l.connect(i),i.connect(c),this.panner=i,this.hrtf=!1,this.placed=!1;const n=this.x-A,r=this.y-t,a=this.z-e;this.d2=n*n+r*r+a*a}else l.connect(c);c.connect(h),this.gain=c,this.active=!0,this.fft&&this.attachAnalyser()}releaseNodes(){const A=this.source;if(A){A.onended=null;try{A.stop()}catch{}A.disconnect(),this.source=null}const t=this.panner;if(t){t.disconnect();const A=this.hub.pannerPool;A.length<32&&A.push(t),this.panner=null}const e=this.gain;if(e){e.disconnect();const A=this.hub.gainPool;A.length<64&&A.push(e),this.gain=null}this.active=!1,this.placed=!1,this.tap=!1,this.hrtf=!1}dropAnalyser(){const A=this.analyser;A&&(A.disconnect(),this.analyser=null,this.freq=null,this.tap=!1)}attachAnalyser(){const A=this.gain;if(!A||0===this.fft||this.tap)return;let t=this.analyser;t||(t=this.hub.ctx.createAnalyser(),t.fftSize=this.fft,this.analyser=t,this.freq=new Uint8Array(t.frequencyBinCount)),A.connect(t),this.tap=!0}}function nC(A,t){let e=A%t;return e<0&&(e+=t),e}function rC(A,t,e){const i=A.readMatrixWorld().data,s=t>=0?A.instanceMatrix?.view:void 0,n=A.count??0;if(null==s||t>=n)return e.x=i[12],e.y=i[13],void(e.z=i[14]);const r=16*t,a=s[r+12],o=s[r+13],l=s[r+14];e.x=i[0]*a+i[4]*o+i[8]*l+i[12],e.y=i[1]*a+i[5]*o+i[9]*l+i[13],e.z=i[2]*a+i[6]*o+i[10]*l+i[14]}function aC(A,t,e,i,s){const n=t<e?e:t;let r;if(1===A){const A=s-e;r=A<=1e-8?t<=e?1:0:1-i*(n-e)/A}else if(2===A)r=e<=1e-8?0:Math.pow(n/e,-i);else{const A=e+i*(n-e);r=A<=1e-8?1:e/A}return r<=0?0:r>1?1:r}function oC(A,t,e,i,s){const n=i>0?i*i:0;if(!(s>eC))return 0;let r;if(1===A)r=i;else if(2===A){if(!(e>1e-8&&t>0))return n>0?n:Number.POSITIVE_INFINITY;r=t*Math.pow(s/eC,1/e)}else{if(!(e>1e-8))return n>0?n:Number.POSITIVE_INFINITY;{const A=eC/s;if(A>=1)return 0;r=t+t*(1/A-1)/e}}if(!(r>0))return 0;const a=r*r;return n<a?n:a}function lC(A,t,e,i,s,n){const r=A-i,a=t-s,o=e-n;return r*r+a*a+o*o>1e-8}class cC{path="";requestHeader;#tc=new AbortController;#ec=new Map;#ic=new Map;load(A,t){const e=this.resolve(A);return this.fetchBuffer(e,t).then(A=>this.parse(A,function(A){const t=A.lastIndexOf("/");return t>=0?A.slice(0,t+1):""}(e)))}parse(A,t){return A}abort(){this.#tc.abort(),this.#tc=new AbortController,this.#ec.clear(),this.#ic.clear()}resolve(A){return!this.path||function(A){return/^[a-z][a-z0-9+.-]*:/i.test(A)||A.startsWith("/")}(A)?A:this.path.endsWith("/")?this.path+A:`${this.path}/${A}`}fetchBuffer(A,t){let e=this.#ec.get(A);return e||(e=this.#sc(A,t,A=>A.arrayBuffer()),this.#nc(this.#ec,A,e),e)}fetchImageBitmap(A,t){let e=this.#ic.get(A);return e||(e=this.#sc(A,t,A=>A.blob().then(A=>createImageBitmap(A))),this.#nc(this.#ic,A,e),e)}#sc(A,t,e){const i=function(A,t){if(!t)return{signal:A,dispose:hC};if(A.aborted||t.aborted){const A=new AbortController;return A.abort(),{signal:A.signal,dispose:hC}}const e=new AbortController,i=()=>e.abort();return A.addEventListener("abort",i),t.addEventListener("abort",i),{signal:e.signal,dispose:()=>{A.removeEventListener("abort",i),t.removeEventListener("abort",i)}}}(this.#tc.signal,t);return fetch(A,{headers:this.requestHeader,signal:i.signal}).then(t=>{if(!t.ok)throw new Error(`Loader: ${t.status} ${A}`);return e(t)}).finally(i.dispose)}#nc(A,t,e){A.set(t,e),e.finally(()=>{A.get(t)===e&&A.delete(t)})}}function hC(){}var uC=(A=>(A[A.Translation=0]="Translation",A[A.Rotation=1]="Rotation",A[A.Scale=2]="Scale",A[A.Weights=3]="Weights",A))(uC||{}),gC=(A=>(A[A.Step=0]="Step",A[A.Linear=1]="Linear",A[A.Cubic=2]="Cubic",A))(gC||{});const dC="gltfNode";class pC{node;name;path;interpolation;times;values;stride;constructor(A,t,e,i,s,n,r=function(A){return 1===A?4:3===A?1:3}(e)){if(0===s.length)throw new Error("AnimationTrack: no keyframes");if(!(r>0))throw new Error("AnimationTrack: stride must be positive");if((0===e||2===e)&&3!==r)throw new Error("AnimationTrack: translation and scale use 3 components");if(1===e&&4!==r)throw new Error("AnimationTrack: rotation uses 4 components");const a=2===i?3:1;if(n.length!==s.length*a*r)throw new Error("AnimationTrack: value length does not match times");const o=mC(s);for(let l=1;l<o.length;l++)if(!(o[l]>o[l-1]))throw new Error("AnimationTrack: times must increase");this.node=A,this.name=t,this.path=e,this.interpolation=i,this.times=o,this.values=mC(n),this.stride=r}}class fC{name;duration;tracks;constructor(A,t){let e=0;for(let i=0,s=t.length;i<s;i++){const A=t[i].times,s=A[A.length-1];s>e&&(e=s)}this.name=A,this.duration=e,this.tracks=t}}function mC(A){if(A instanceof Float32Array&&0===A.byteOffset&&A.byteLength===A.buffer.byteLength)return A;const t=new Float32Array(A.length);return t.set(A),t}const CC=[],wC=new Set(["KHR_draco_mesh_compression","KHR_texture_basisu","KHR_texture_transform"]),yC=new Set(["ATTRIBUTES","TRIANGLES","INDICES"]),BC=new Set(["NONE","OCTAHEDRAL","QUATERNION","EXPONENTIAL"]);class IC{json;baseUrl;fetchBuffer;glb;bins=[];meshopt=null;accCache=new Map;attrCache=new Map;meshCache=new Map;texCache=new Map;bitmapCache=new Map;rawCache=new Map;variants=new Map;skeletons=new Map;skinned=[];cameras=[];nodes=[];matrix=new v;instPos=new y;instQuat=new T;instScale=new y;materials=[];defaultMaterial=null;constructor(A,t,e){const i=function(A){if(A.byteLength<12)throw new Error("GLTFLoader: file is too small");const t=new DataView(A);if(1179937895!==t.getUint32(0,!0))return{json:JSON.parse((new TextDecoder).decode(A)),bin:null};if(2!==t.getUint32(4,!0))throw new Error(`GLTFLoader: unsupported GLB version ${t.getUint32(4,!0)}`);const e=t.getUint32(8,!0);let i=12,s=null,n=null;for(;i+8<=A.byteLength&&i+8<=e;){const e=t.getUint32(i,!0),r=t.getUint32(i+4,!0),a=i+8;1313821514===r?s=JSON.parse((new TextDecoder).decode(new Uint8Array(A,a,e))):5130562===r&&null==n&&(n={buffer:A,byteOffset:a,byteLength:e}),i=a+e}if(!s)throw new Error("GLTFLoader: GLB is missing JSON");return{json:s,bin:n}}(A);this.json=i.json,this.glb=i.bin,this.baseUrl=t,this.fetchBuffer=e}async parse(){const A=this.json.asset?.version??"";if(!A.startsWith("2"))throw new Error(`GLTFLoader: unsupported glTF version ${A||"unknown"}`);const t=this.json.extensionsRequired;if(t)for(let n=0;n<t.length;n++)if(wC.has(t[n]))throw new Error(`GLTFLoader: required extension ${t[n]} is not supported`);this.bins=await this.resolveBuffers(),await this.decodeMeshopt();const e=this.loadMaterials();this.prebuildMeshes(),this.materials=await e,this.buildNodes();const i=this.buildAnimations(),s=this.buildScenes();return{scene:s.scene,scenes:s.scenes,cameras:this.cameras,animations:i,asset:{version:A,generator:this.json.asset?.generator}}}async resolveBuffers(){const A=this.json.buffers??[],t=new Array(A.length),e=[];for(let i=0;i<A.length;i++){const s=A[i];if(!this.bufferSkippable(i))if(s.uri){const A=s.uri;e.push(this.bufferFromUri(A).then(A=>{t[i]=A}))}else{if(!this.glb||0!==i)throw new Error(`GLTFLoader: buffer ${i} has no uri`);t[i]=this.glb}}return e.length&&await Promise.all(e),t}async bufferFromUri(A){if(A.startsWith("data:")){const t=GC(A).bytes;return{buffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}}const t=await this.fetchBuffer(zC(this.baseUrl,A));return{buffer:t,byteOffset:0,byteLength:t.byteLength}}bufferSkippable(A){const t=this.json.buffers?.[A];if(!t)return!1;if(!0===t.extensions?.EXT_meshopt_compression?.fallback)return!0;if(t.uri||this.glb&&0===A)return!1;const e=this.json.bufferViews;if(!e)return!1;let i=!1;for(let s=0;s<e.length;s++){const t=e[s],n=t.extensions?.EXT_meshopt_compression;if(n?.buffer===A)return!1;if(t.buffer===A&&(i=!0,!n))return!1}return i}async decodeMeshopt(){const A=this.json.bufferViews;if(!A)return;let t=-1;for(let s=0;s<A.length;s++)if(A[s].extensions?.EXT_meshopt_compression){t=s;break}if(t<0)return;const e=await(HC||(HC=import("meshoptimizer/decoder").then(async({MeshoptDecoder:A})=>{if(await A.ready,!A.supported)throw new Error("GLTFLoader: meshopt decoder is not supported");return(t,e,i,s,n,r)=>{A.decodeGltfBuffer(t,e,i,s,n,r)}}).catch(A=>{throw HC=null,A})),HC),i=new Array(A.length);for(let s=t;s<A.length;s++){const t=A[s].extensions?.EXT_meshopt_compression;t&&(i[s]=KC(this.bins,A[s],t,e))}this.meshopt=i}loadMaterials(){const A=this.json.materials??[],t=new Array(A.length);for(let e=0;e<A.length;e++)t[e]=this.loadMaterial(A[e]);return Promise.all(t)}async loadMaterial(A){const t=A.pbrMetallicRoughness??{},e=null!=A.extensions?.KHR_materials_unlit,i=!e&&function(A){const t=A.extensions;return!!t&&(null!=t.KHR_materials_clearcoat||null!=t.KHR_materials_transmission||null!=t.KHR_materials_volume||null!=t.KHR_materials_ior||null!=t.KHR_materials_specular||null!=t.KHR_materials_sheen||null!=t.KHR_materials_iridescence||null!=t.KHR_materials_anisotropy||null!=t.KHR_materials_dispersion)}(A),s=t.baseColorFactor,n=[s?.[0]??1,s?.[1]??1,s?.[2]??1,s?.[3]??1],r=A.alphaMode??"OPAQUE",[a,o,l,c,h]=await Promise.all([this.slot(t.baseColorTexture,!0),e?null:this.slot(t.metallicRoughnessTexture,!1),e?null:this.slot(A.normalTexture,!1),e?null:this.slot(A.occlusionTexture,!1),e?null:this.slot(A.emissiveTexture,!0)]),u=!0===A.doubleSided?Fn.Double:Fn.Front,g="BLEND"===r,d="BLEND"!==r,p="MASK"===r?A.alphaCutoff??.5:0;let f;if(e){const A=new vd({color:n,map:a?.texture,side:u,transparent:g,depthWrite:d});p>0&&A.defines.set("ALPHATEST",p),f=A}else{const e={color:n,metalness:t.metallicFactor??1,roughness:t.roughnessFactor??1,map:a?.texture,roughnessMap:o?.texture,metalnessMap:o?.texture,normalMap:l?.texture,aoMap:c?.texture,emissiveMap:h?.texture,side:u,transparent:g,depthWrite:d,alphaTest:p};if(l){const t=A.normalTexture?.scale??1;e.normalScale=[t,-t]}A.emissiveFactor&&(e.emissive=[A.emissiveFactor[0]??0,A.emissiveFactor[1]??0,A.emissiveFactor[2]??0]);const s=A.extensions?.KHR_materials_emissive_strength?.emissiveStrength;"number"==typeof s&&(e.emissiveIntensity=s),c&&null!=A.occlusionTexture?.strength&&(e.aoMapIntensity=A.occlusionTexture.strength);const r=i?await this.fillPhysical(e,A):[];f=i?new up(e):new lp(e);for(let A=0;A<r.length;A++)DC(f,r[A].name,r[A].texCoord)}return A.name&&(f.name=A.name),a&&DC(f,"map",a.texCoord),o&&(DC(f,"roughnessMap",o.texCoord),DC(f,"metalnessMap",o.texCoord)),l&&DC(f,"normalMap",l.texCoord),c&&DC(f,"aoMap",c.texCoord),h&&DC(f,"emissiveMap",h.texCoord),f}async fillPhysical(A,t){const e=t.extensions??{},i=e.KHR_materials_clearcoat,s=e.KHR_materials_transmission,n=e.KHR_materials_volume,r=e.KHR_materials_ior,a=e.KHR_materials_specular,o=e.KHR_materials_sheen,l=e.KHR_materials_iridescence,c=e.KHR_materials_anisotropy,h=e.KHR_materials_dispersion,[u,g,d,p,f,m,C,w,y,B,I,Q]=await Promise.all([this.slot(EC(i,"clearcoatTexture"),!1),this.slot(EC(i,"clearcoatRoughnessTexture"),!1),this.slot(EC(i,"clearcoatNormalTexture"),!1),this.slot(EC(s,"transmissionTexture"),!1),this.slot(EC(n,"thicknessTexture"),!1),this.slot(EC(a,"specularTexture"),!1),this.slot(EC(a,"specularColorTexture"),!0),this.slot(EC(o,"sheenColorTexture"),!0),this.slot(EC(o,"sheenRoughnessTexture"),!1),this.slot(EC(l,"iridescenceTexture"),!1),this.slot(EC(l,"iridescenceThicknessTexture"),!1),this.slot(EC(c,"anisotropyTexture"),!1)]);if("number"==typeof i?.clearcoatFactor&&(A.clearcoat=i.clearcoatFactor),"number"==typeof i?.clearcoatRoughnessFactor&&(A.clearcoatRoughness=i.clearcoatRoughnessFactor),u&&(A.clearcoatMap=u.texture),g&&(A.clearcoatRoughnessMap=g.texture),d){A.clearcoatNormalMap=d.texture;const t="object"==typeof i?.clearcoatNormalTexture&&i.clearcoatNormalTexture&&"number"==typeof i.clearcoatNormalTexture.scale?i.clearcoatNormalTexture.scale:1;A.clearcoatNormalScale=[t,-t]}if("number"==typeof s?.transmissionFactor&&(A.transmission=s.transmissionFactor),p&&(A.transmissionMap=p.texture),"number"==typeof n?.thicknessFactor&&(A.thickness=n.thicknessFactor),f&&(A.thicknessMap=f.texture),"number"==typeof n?.attenuationDistance&&(A.attenuationDistance=n.attenuationDistance),Array.isArray(n?.attenuationColor)){const t=n.attenuationColor;A.attenuationColor=[t[0]??1,t[1]??1,t[2]??1]}if("number"==typeof r?.ior&&(A.ior=r.ior),"number"==typeof a?.specularFactor&&(A.specularIntensity=a.specularFactor),Array.isArray(a?.specularColorFactor)){const t=a.specularColorFactor;A.specularColor=[t[0]??1,t[1]??1,t[2]??1]}if(m&&(A.specularIntensityMap=m.texture),C&&(A.specularColorMap=C.texture),o){A.sheen=1,A.sheenRoughness="number"==typeof o.sheenRoughnessFactor?o.sheenRoughnessFactor:0;const t=Array.isArray(o.sheenColorFactor)?o.sheenColorFactor:[0,0,0];A.sheenColor=[t[0]??0,t[1]??0,t[2]??0]}w&&(A.sheenColorMap=w.texture),y&&(A.sheenRoughnessMap=y.texture),"number"==typeof l?.iridescenceFactor&&(A.iridescence=l.iridescenceFactor),"number"==typeof l?.iridescenceIor&&(A.iridescenceIOR=l.iridescenceIor),"number"!=typeof l?.iridescenceThicknessMinimum&&"number"!=typeof l?.iridescenceThicknessMaximum||(A.iridescenceThicknessRange=["number"==typeof l.iridescenceThicknessMinimum?l.iridescenceThicknessMinimum:100,"number"==typeof l.iridescenceThicknessMaximum?l.iridescenceThicknessMaximum:400]),B&&(A.iridescenceMap=B.texture),I&&(A.iridescenceThicknessMap=I.texture),"number"==typeof c?.anisotropyStrength&&(A.anisotropy=c.anisotropyStrength),"number"==typeof c?.anisotropyRotation&&(A.anisotropyRotation=c.anisotropyRotation),Q&&(A.anisotropyMap=Q.texture),"number"==typeof h?.dispersion&&(A.dispersion=h.dispersion);const E=[xC("clearcoatMap",u),xC("clearcoatRoughnessMap",g),xC("clearcoatNormalMap",d),xC("transmissionMap",p),xC("thicknessMap",f),xC("specularIntensityMap",m),xC("specularColorMap",C),xC("sheenColorMap",w),xC("sheenRoughnessMap",y),xC("iridescenceMap",B),xC("iridescenceThicknessMap",I),xC("anisotropyMap",Q)],x=[];for(let D=0;D<E.length;D++){const A=E[D];A&&x.push(A)}return x}slot(A,t){return A&&null!=A.index?this.loadTexture(A.index,t).then(t=>({texture:t,texCoord:A.texCoord??0})):Promise.resolve(null)}loadTexture(A,t){const e=`${A}:${t?1:0}`,i=this.texCache.get(e);if(i)return i;const s=this.createTexture(A,t);return this.texCache.set(e,s),s}async createTexture(A,t){const e=this.json.textures?.[A];if(!e)throw new Error(`GLTFLoader: missing texture ${A}`);if(e.extensions?.KHR_texture_basisu)throw new Error("GLTFLoader: KHR_texture_basisu is not supported");const i=this.json.samplers?.[e.sampler??-1]??{},s=function(A,t){const e=9728===A?X.Nearest:X.Linear;switch(t??9987){case 9728:return{mag:e,min:X.Nearest,mip:X.Nearest,mips:!1};case 9729:return{mag:e,min:X.Linear,mip:X.Nearest,mips:!1};case 9984:return{mag:e,min:X.Nearest,mip:X.Nearest,mips:!0};case 9985:return{mag:e,min:X.Linear,mip:X.Nearest,mips:!0};case 9986:return{mag:e,min:X.Nearest,mip:X.Linear,mips:!0};default:return{mag:e,min:X.Linear,mip:X.Linear,mips:!0}}}(i.magFilter,i.minFilter),n={flipY:!1,premultiplyAlpha:!1,wrapS:LC(i.wrapS),wrapT:LC(i.wrapT),magFilter:s.mag,minFilter:s.min,mipmapFilter:s.mip,generateMipmaps:s.mips,useMipmaps:s.mips,colorSpace:t?bA.SRGBColorSpace:bA.NoColorSpace};if(t){const A=await this.loadBitmap(e.source),t=new pt(A,n);return e.name&&(t.name=e.name),t}const r=await this.loadRaw(e.source),a=new pt({width:r.width,height:r.height,data:r.data},n);return e.name&&(a.name=e.name),a}loadBitmap(A){if(null==A)return Promise.reject(new Error("GLTFLoader: texture has no image"));const t=this.bitmapCache.get(A);if(t)return t;const e=this.decodeImage(A);return this.bitmapCache.set(A,e),e}loadRaw(A){if(null==A)return Promise.reject(new Error("GLTFLoader: texture has no image"));const t=this.rawCache.get(A);if(t)return t;const e=this.loadBitmap(A).then(jC);return this.rawCache.set(A,e),e}async decodeImage(A){const t=this.json.images?.[A];if(!t)throw new Error(`GLTFLoader: missing image ${A}`);let e,i=t.mimeType??"";if(null!=t.bufferView)e=this.viewBytes(t.bufferView),i||(i=YC(e));else{if(!t.uri)throw new Error(`GLTFLoader: image ${A} has no data`);if(t.uri.startsWith("data:")){const A=GC(t.uri);e=A.bytes,i=i||A.mime||YC(e)}else{const A=await this.fetchBuffer(zC(this.baseUrl,t.uri));e=new Uint8Array(A),i=i||function(A){const t=A.split("?")[0].toLowerCase();return t.endsWith(".png")?"image/png":t.endsWith(".jpg")||t.endsWith(".jpeg")?"image/jpeg":t.endsWith(".webp")?"image/webp":""}(t.uri)||YC(e)}}const s=new Blob([e],{type:i||"application/octet-stream"});return createImageBitmap(s,{colorSpaceConversion:"none",premultiplyAlpha:"none",imageOrientation:"none"})}viewBytes(A){const t=this.meshopt?.[A];if(t){const A=t.bin;return new Uint8Array(A.buffer,A.byteOffset,A.byteLength)}const e=this.bufferView(A),i=this.bins[e.buffer];if(!i)throw new Error(`GLTFLoader: missing buffer ${e.buffer}`);return new Uint8Array(i.buffer,i.byteOffset+(e.byteOffset??0),e.byteLength)}prebuildMeshes(){const A=this.json.meshes??[];for(let t=0;t<A.length;t++)this.meshPrims(t)}meshPrims(A){const t=this.meshCache.get(A);if(t)return t;const e=this.json.meshes?.[A];if(!e)throw new Error(`GLTFLoader: missing mesh ${A}`);const i=e.primitives,s=new Array(i.length);for(let n=0;n<i.length;n++)s[n]=this.buildPrim(i[n],e,n);return this.meshCache.set(A,s),s}buildPrim(A,t,e){const i=A.extensions;if(i?.KHR_draco_mesh_compression||i?.EXT_meshopt_compression)throw new Error("GLTFLoader: compressed mesh primitives are not supported");const s=A.mode??4,n=function(A){return 0===A?"point":1===A||2===A||3===A?"line":"mesh"}(s),r=A.attributes;if(null==r.POSITION)throw new Error("GLTFLoader: primitive is missing POSITION");const a=new Wi;if(a.name=t.name?e?`${t.name}_${e}`:t.name:"",a.setAttribute("position",this.floatVec(r.POSITION,3)),null!=r.NORMAL&&a.setAttribute("normal",this.floatVec(r.NORMAL,3)),null!=r.COLOR_0){const A="VEC4"===this.accessor(r.COLOR_0).type?4:3;a.setAttribute("color",this.floatVec(r.COLOR_0,A))}for(let l=0;l<4;l++){const A=r[`TEXCOORD_${l}`];null!=A&&a.setAttribute(0===l?"uv":`uv${l+1}`,this.floatVec(A,2))}null!=r.JOINTS_0&&null!=r.WEIGHTS_0&&(a.setAttribute("skinIndex",this.jointAttr(r.JOINTS_0)),a.setAttribute("skinWeight",null!=r.JOINTS_1?this.renormalizedWeights(r.WEIGHTS_0):this.floatVec(r.WEIGHTS_0,4)));const o=A.targets;if(o&&o.length){a.morphTargetsRelative=!0;const A=new Set,e=a.getAttribute("position").count;let i=!1;for(let t=0;t<o.length;t++)null!=o[t].NORMAL&&(i=!0);for(let s=0;s<o.length;s++){const n=bC(t.extras?.targetNames,s,A),r=o[s];a.morphAttributes.set(n,null!=r.POSITION?this.floatVec(r.POSITION,3):new Fi(new Float32Array(3*e),3)),i&&null!=r.NORMAL&&a.morphNormals.set(n,this.floatVec(r.NORMAL,3))}}return this.applyMode(a,s,A.indices,a.getAttribute("position").count),{geometry:a,materialIndex:A.material,kind:n,mode:s,vertexColors:null!=r.COLOR_0,flat:"mesh"===n&&null==r.NORMAL}}applyMode(A,t,e,i){if(4===t||0===t||1===t||3===t||2===t){if(null==e)return;if(1===t){const t=this.readIndex(e);if(1&t.length){const e=-2&t.length,i=t instanceof Uint32Array?new Uint32Array(t.subarray(0,e)):new Uint16Array(t.subarray(0,e));return void A.setIndex(i instanceof Uint32Array?new Oi(i,1):new Pi(i,1,!1,!0))}}return void A.setIndex(this.indexAttr(e))}const s=null==e?null:this.readIndex(e),n=s?s.length:i,r=function(A,t,e,i){const s=e>2?e-2:0,n=i?new Uint32Array(3*s):new Uint16Array(3*s);let r=0;if(6===A){const A=t?t[0]:0;for(let i=1;i<e-1;i++)n[r++]=A,n[r++]=t?t[i]:i,n[r++]=t?t[i+1]:i+1;return n}for(let a=0;a<e-2;a++){const A=t?t[a]:a,e=t?t[a+1]:a+1,i=t?t[a+2]:a+2;1&a?(n[r++]=e,n[r++]=A,n[r++]=i):(n[r++]=A,n[r++]=e,n[r++]=i)}return n}(t,s,n,s instanceof Uint32Array||!s&&n>65536);A.setIndex(r instanceof Uint32Array?new Oi(r,1):new Pi(r,1,!1,!0))}indexAttr(A){const t=`i${A}`,e=this.attrCache.get(t);if(e)return e;const i=RC(this.readIndex(A)),s=i instanceof Uint32Array?new Oi(i,1):new Pi(i,1,!1,!0);return this.attrCache.set(t,s),s}readIndex(A){const t=this.accessor(A),e=this.readAccessor(A);if(5125===t.componentType){if(e instanceof Uint32Array)return e;const A=new Uint32Array(e.length);for(let t=0;t<e.length;t++)A[t]=e[t];return A}if(e instanceof Uint16Array&&5123===t.componentType)return e;const i=new Uint16Array(e.length);for(let s=0;s<e.length;s++)i[s]=e[s];return i}floatVec(A,t){const e=`f${A}:${t}`,i=this.attrCache.get(e);if(i)return i;const s=this.accessor(A);if(PC(s.type)!==t)throw new Error(`GLTFLoader: accessor ${A} is ${s.type}, expected ${t} components`);const n=RC(kC(this.readAccessor(A),s.componentType,!0===s.normalized)),r=new Fi(n,t);return this.attrCache.set(e,r),r}jointAttr(A){const t=`j${A}`,e=this.attrCache.get(t);if(e)return e;const i=this.accessor(A);if(4!==PC(i.type))throw new Error("GLTFLoader: JOINTS_0 must be VEC4");const s=this.readAccessor(A);let n;return n=5121===i.componentType&&s instanceof Uint8Array?new Ni(RC(s),4,!1):5123===i.componentType&&s instanceof Uint16Array?new Pi(RC(s),4,!1):new Fi(RC(kC(s,i.componentType,!1)),4),this.attrCache.set(t,n),n}renormalizedWeights(A){const t=`rn${A}`,e=this.attrCache.get(t);if(e)return e;const i=this.accessor(A),s=kC(this.readAccessor(A),i.componentType,!0===i.normalized),n=new Float32Array(s.length);for(let a=0;a+3<n.length;a+=4){const A=s[a]+s[a+1]+s[a+2]+s[a+3];if(!(A>0))continue;const t=1/A;n[a]=s[a]*t,n[a+1]=s[a+1]*t,n[a+2]=s[a+2]*t,n[a+3]=s[a+3]*t}const r=new Fi(n,4);return this.attrCache.set(t,r),r}readAccessor(A){const t=this.accCache.get(A);if(t)return t;const e=this.accessor(A),i=PC(e.type);let s;return s=null==e.bufferView?OC(e.componentType,e.count*i):this.readView(e.bufferView,e.byteOffset??0,e.componentType,e.count,i),e.sparse&&(s=this.applySparse(s,e,i)),this.accCache.set(A,s),s}readView(A,t,e,i,s){const n=this.meshopt?.[A],r=function(A){switch(A){case 5120:case 5121:return 1;case 5122:case 5123:return 2;default:return 4}}(e),a=r*s;let o,l,c,h;if(n)o=n.bin,l=n.byteStride,c=0,h=n.bin.byteLength;else{const t=this.bufferView(A),e=this.bins[t.buffer];if(!e)throw new Error(`GLTFLoader: missing buffer ${t.buffer}`);o=e,l=t.byteStride??a,c=t.byteOffset??0,h=t.byteLength}const u=o.byteOffset+c,g=u+t;if(i>0&&(g<u||g+(i-1)*l+a>u+h))throw new Error("GLTFLoader: accessor exceeds its bufferView");if(l===a&&i>0&&g%r===0)return function(A,t,e,i){switch(A){case 5120:return new Int8Array(t,e,i);case 5121:return new Uint8Array(t,e,i);case 5122:return new Int16Array(t,e,i);case 5123:return new Uint16Array(t,e,i);case 5125:return new Uint32Array(t,e,i);default:return new Float32Array(t,e,i)}}(e,o.buffer,g,i*s);const d=OC(e,i*s),p=new DataView(o.buffer);for(let f=0;f<i;f++){const A=g+f*l,t=f*s;for(let i=0;i<s;i++)d[t+i]=FC(p,A+i*r,e)}return d}applySparse(A,t,e){const i=t.sparse,s=0===A.byteOffset&&A.byteLength===A.buffer.byteLength?A:A.slice(),n=this.readView(i.indices.bufferView,i.indices.byteOffset??0,i.indices.componentType,i.count,1),r=this.readView(i.values.bufferView,i.values.byteOffset??0,t.componentType,i.count,e);for(let a=0;a<i.count;a++){const A=n[a]*e;if(A<0||A+e>s.length)throw new Error("GLTFLoader: sparse index is out of range");const t=a*e;for(let i=0;i<e;i++)s[A+i]=r[t+i]}return s}accessor(A){const t=this.json.accessors?.[A];if(!t)throw new Error(`GLTFLoader: missing accessor ${A}`);return t}bufferView(A){const t=this.json.bufferViews?.[A];if(!t)throw new Error(`GLTFLoader: missing bufferView ${A}`);return t}buildAnimations(){const A=this.json.animations;if(!A||0===A.length)return CC;const t=this.nodes;for(let i=0,s=t.length;i<s;i++){const A=t[i];if(!A)continue;const e=A.userData;e?e[dC]=i:A.userData={[dC]:i}}const e=new Array(A.length);for(let i=0;i<A.length;i++)e[i]=this.animationClip(A[i],i);return e}animationClip(A,t){const e=A.samplers??[],i=A.channels??[],s=new Array(e.length),n=[],r=new Map;for(let a=0;a<i.length;a++){const A=i[a],t=A.target;if(!t||null==t.node)continue;const o=TC(t.path),l=t.node;if(!this.nodes[l])throw new Error(`GLTFLoader: animation node ${l} is missing`);const c=A.sampler??-1,h=this.samplerData(e,s,c,UC(o)),u=h.interpolation===gC.Cubic?3:1,g=h.times.length*u;if(0===g||h.values.length%g!==0)throw new Error(`GLTFLoader: animation sampler ${c} value count does not match its times`);const d=h.values.length/g,p=this.json.nodes?.[l]?.name??"",f=new pC(l,p,o,h.interpolation,h.times,h.values,d),m=4*l+o,C=r.get(m);void 0!==C?n[C]=f:(r.set(m,n.length),n.push(f))}return new fC(A.name&&A.name.length>0?A.name:`animation${t}`,n)}samplerData(A,t,e,i){const s=t[e];if(s){if(s.type!==i)throw new Error(`GLTFLoader: animation sampler ${e} is used with two paths`);return s}const n=A[e];if(!n||null==n.input||null==n.output)throw new Error(`GLTFLoader: animation sampler ${e} is missing`);const r={type:i,interpolation:NC(n.interpolation),times:this.animationFloats(n.input,"SCALAR"),values:this.animationFloats(n.output,i)};return t[e]=r,r}animationFloats(A,t){const e=this.accessor(A);if(5126!==e.componentType)throw new Error(`GLTFLoader: animation accessor ${A} must be FLOAT`);if(e.type!==t)throw new Error(`GLTFLoader: animation accessor ${A} is ${e.type}, expected ${t}`);const i=this.readAccessor(A);if(!(i instanceof Float32Array))throw new Error(`GLTFLoader: animation accessor ${A} is not float data`);const s=new Float32Array(i.length);return s.set(i),s}buildNodes(){const A=this.json.nodes??[];for(let t=0;t<A.length;t++)this.nodes[t]=this.makeNode(A[t]);for(let t=0;t<A.length;t++){const e=A[t].children;if(!e)continue;const i=this.nodes[t];for(let A=0;A<e.length;A++){const t=this.nodes[e[A]];if(!t)throw new Error(`GLTFLoader: node ${e[A]} is missing`);i.add(t)}}for(let t=0;t<this.skinned.length;t++){const A=this.skinned[t];A.mesh.skeleton=this.skeleton(A.skin)}}makeNode(A){const t=[];if(null!=A.mesh){const e=this.json.meshes?.[A.mesh];if(!e)throw new Error(`GLTFLoader: missing mesh ${A.mesh}`);const i=this.meshPrims(A.mesh),s=A.weights??e.weights,n=this.instanceMatrices(A);for(let r=0;r<i.length;r++){const a=i[r];if(n&&("mesh"!==a.kind||null!=A.skin||a.geometry.morphAttributes.size>0))throw new Error("GLTFLoader: GPU instancing only applies to static triangle meshes");const o=this.materialFor(a.materialIndex,a.kind,a.vertexColors,a.flat),l=n?this.makeInstanced(a.geometry,o,n):"point"===a.kind?new hg(a.geometry,o):"line"===a.kind?MC(a.mode,a.geometry,o):new Os(a.geometry,o);e.name&&(l.name=i.length>1?`${e.name}_${r}`:e.name),!n&&a.geometry.morphAttributes.size>0&&(l.updateMorphTargets(),s&&SC(l,s,a.geometry.morphAttributes.size)),n||null==A.skin||"mesh"!==a.kind||this.skinned.push({mesh:l,skin:A.skin}),t.push(l)}}null!=A.camera&&t.push(this.makeCamera(A.camera));const e=this.punctualLight(A);let i;if(e&&t.push(e),1===t.length)i=t[0];else{i=new Mi;for(let A=0;A<t.length;A++)i.add(t[A])}return A.name&&(i.name=A.name),A.matrix?(this.matrix.fromArray(A.matrix),i.matrix=this.matrix):(A.translation&&i.position.set(A.translation[0],A.translation[1],A.translation[2]),A.rotation&&i.quaternion.set(A.rotation[0],A.rotation[1],A.rotation[2],A.rotation[3]),A.scale&&i.scale.set(A.scale[0],A.scale[1],A.scale[2])),i}instanceMatrices(A){const t=A.extensions?.EXT_mesh_gpu_instancing;if(!t||"object"!=typeof t)return null;const e=t.attributes;if(!e)throw new Error("GLTFLoader: GPU instancing has no attributes");const i=null==e.TRANSLATION?null:this.floatAccessor(e.TRANSLATION,3),s=null==e.ROTATION?null:this.floatAccessor(e.ROTATION,4),n=null==e.SCALE?null:this.floatAccessor(e.SCALE,3);let r=0;if(i)r=i.length/3;else if(s)r=s.length/4;else{if(!n)throw new Error("GLTFLoader: GPU instancing has no TRS");r=n.length/3}if(s&&s.length!==4*r||n&&n.length!==3*r||i&&i.length!==3*r)throw new Error("GLTFLoader: GPU instancing attributes have different counts");const a=new Float32Array(16*r),o=this.instPos,l=this.instQuat,c=this.instScale;for(let h=0;h<r;h++){const A=3*h,t=4*h;o.set(i?i[A]:0,i?i[A+1]:0,i?i[A+2]:0),l.set(s?s[t]:0,s?s[t+1]:0,s?s[t+2]:0,s?s[t+3]:1),c.set(n?n[A]:1,n?n[A+1]:1,n?n[A+2]:1),this.matrix.compose(o,l,c),a.set(this.matrix.elements,16*h)}return a}makeInstanced(A,t,e){const i=new ba(A,t,e.length/16),s=i.instanceMatrix;return s.view.set(e),s.onChangeCallback(),i}floatAccessor(A,t){const e=this.accessor(A);if(PC(e.type)!==t)throw new Error(`GLTFLoader: accessor ${A} is ${e.type}, expected ${t} components`);return kC(this.readAccessor(A),e.componentType,!0===e.normalized)}punctualLight(A){const t=A.extensions?.KHR_lights_punctual;if(!t||null==t.light)return null;const e=this.json.extensions?.KHR_lights_punctual?.lights?.[t.light];if(!e)throw new Error(`GLTFLoader: missing light ${t.light}`);const i=[e.color?.[0]??1,e.color?.[1]??1,e.color?.[2]??1],s=e.intensity??1,n=e.range??0;let r;if("directional"===e.type)QC(ll),r=new ll(i,s);else if("point"===e.type)QC(hl),r=new hl(i,s,n,2);else{if("spot"!==e.type)throw new Error(`GLTFLoader: unsupported light ${e.type??"unknown"}`);{QC(gl);const A=e.spot?.outerConeAngle??Math.PI/4,t=e.spot?.innerConeAngle??0;r=new gl(i,s,n,A,A>0?1-t/A:0,2)}}return e.name&&(r.name=e.name),r}makeCamera(A){const t=this.json.cameras?.[A];if(!t)throw new Error(`GLTFLoader: missing camera ${A}`);let e;if("orthographic"===t.type){const A=t.orthographic;if(!A)throw new Error("GLTFLoader: orthographic camera is missing parameters");e=new Jg(-A.xmag,A.xmag,A.ymag,-A.ymag,A.znear,A.zfar)}else{const A=t.perspective;if(!A)throw new Error("GLTFLoader: perspective camera is missing parameters");e=new Hg(180*A.yfov/Math.PI,A.aspectRatio??1,A.znear,A.zfar??1/0)}return t.name&&(e.name=t.name),this.cameras.push(e),e}skeleton(A){const t=this.skeletons.get(A);if(t)return t;const e=this.json.skins?.[A];if(!e)throw new Error(`GLTFLoader: missing skin ${A}`);const i=new Array(e.joints.length);for(let r=0;r<e.joints.length;r++){const A=this.nodes[e.joints[r]];if(!A)throw new Error(`GLTFLoader: skin joint ${e.joints[r]} is missing`);i[r]=A}const s=null==e.inverseBindMatrices?void 0:RC(kC(this.readAccessor(e.inverseBindMatrices),this.accessor(e.inverseBindMatrices).componentType,!1)),n=new Cu(i,s);return this.skeletons.set(A,n),n}materialFor(A,t,e,i){const s=null==A?this.ensureDefault():this.materials[A];if(!s)throw new Error(`GLTFLoader: missing material ${A}`);if("mesh"===t&&!e&&!i)return s;const n=`${s.uuid}|${t}|${e?1:0}|${i?1:0}`,r=this.variants.get(n);if(r)return r;const a="point"===t?function(A,t){const e=A.color,i={color:[e.r,e.g,e.b,e.a],transparent:A.transparent,side:A.side,depthWrite:A.depthWrite,vertexColors:t};A.map&&(i.map=A.map);const s=new dp(i),n=vC(A);return n>0&&s.defines.set("ALPHATEST",n),s.name=A.name,s}(s,e):"line"===t?function(A,t){const e=A.color,i={color:[e.r,e.g,e.b,e.a],transparent:A.transparent,side:A.side,depthWrite:A.depthWrite,vertexColors:t};A.map&&(i.map=A.map);const s=new tp(i),n=vC(A);return n>0&&s.defines.set("ALPHATEST",n),s.name=A.name,s}(s,e):function(A,t,e){const i=A.clone();t&&(i.vertexColors=!0);const s=i;return e&&s.isMeshStandardMaterial&&(s.flatShading=!0),i}(s,e,i);return this.variants.set(n,a),a}ensureDefault(){return this.defaultMaterial||(this.defaultMaterial=new lp({color:[1,1,1,1],metalness:1,roughness:1})),this.defaultMaterial}buildScenes(){const A=this.json.scenes??[],t=new Array(A.length);for(let e=0;e<A.length;e++){const i=A[e],s=new Mi;i.name&&(s.name=i.name);const n=i.nodes??[];for(let A=0;A<n.length;A++){const t=this.nodes[n[A]];if(!t)throw new Error(`GLTFLoader: scene node ${n[A]} is missing`);s.add(t.parent?t.clone(!0):t)}t[e]=s}return{scene:t[this.json.scene??0]??new Mi,scenes:t}}}function QC(A){if(null!=Object.getOwnPropertyDescriptor(A,"kind"))return;HA(!1);let t=null;try{t=new A,t.registerShareWgsl()}finally{HA(!0),t?.dispose()}}function EC(A,t){const e=A?.[t];if(!e||"object"!=typeof e)return;const i=e;return null==i.index?void 0:i}function xC(A,t){return t?{name:A,texCoord:t.texCoord}:null}function DC(A,t,e){const i=A.getBinding(t);i&&(i.texCoord=e)}function MC(A,t,e){return 3===A?new $u(t,e):2===A?new ng(t,e):new cg(t,e)}function bC(A,t,e){const i=Array.isArray(A)?A:null,s=i?i[t]:void 0;if("string"==typeof s&&s&&!e.has(s))return e.add(s),s;const n=String(t);return e.add(n),n}function SC(A,t,e){if(t.length===e)return void A.setMorphInfluences(t);const i=new Array(e);for(let s=0;s<e;s++)i[s]=t[s]??0;A.setMorphInfluences(i)}function vC(A){const t=A.defines.get("ALPHATEST");return"number"==typeof t&&t>0?t:0}function TC(A){if("translation"===A)return uC.Translation;if("rotation"===A)return uC.Rotation;if("scale"===A)return uC.Scale;if("weights"===A)return uC.Weights;throw new Error(`GLTFLoader: unsupported animation path ${A??"unknown"}`)}function UC(A){return A===uC.Rotation?"VEC4":A===uC.Weights?"SCALAR":"VEC3"}function NC(A){if("STEP"===A)return gC.Step;if("CUBICSPLINE"===A)return gC.Cubic;if(null==A||"LINEAR"===A)return gC.Linear;throw new Error(`GLTFLoader: unsupported interpolation ${A}`)}function PC(A){switch(A){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:throw new Error(`GLTFLoader: unsupported accessor type ${A}`)}}function OC(A,t){switch(A){case 5120:return new Int8Array(t);case 5121:return new Uint8Array(t);case 5122:return new Int16Array(t);case 5123:return new Uint16Array(t);case 5125:return new Uint32Array(t);default:return new Float32Array(t)}}function FC(A,t,e){switch(e){case 5120:return A.getInt8(t);case 5121:return A.getUint8(t);case 5122:return A.getInt16(t,!0);case 5123:return A.getUint16(t,!0);case 5125:return A.getUint32(t,!0);default:return A.getFloat32(t,!0)}}function kC(A,t,e){if(5126===t&&A instanceof Float32Array)return A;const i=new Float32Array(A.length);if(!e||5126===t){for(let t=0,e=A.length;t<e;t++)i[t]=A[t];return i}const s=5120===t||5122===t,n=1/(5120===t||5121===t?s?127:255:s?32767:65535);for(let r=0,a=A.length;r<a;r++){const t=A[r]*n;i[r]=s&&t<-1?-1:t}return i}function RC(A){return 0===A.byteOffset&&A.byteLength===A.buffer.byteLength?A:A instanceof Float32Array?new Float32Array(A):A instanceof Uint8Array?new Uint8Array(A):A instanceof Uint16Array?new Uint16Array(A):new Uint32Array(A)}function LC(A){return 33071===A?q.ClampToEdge:33648===A?q.MirrorRepeat:q.Repeat}function jC(A){const t=new OffscreenCanvas(A.width,A.height).getContext("2d",{willReadFrequently:!0});if(!t)throw new Error("GLTFLoader: 2d context unavailable");t.drawImage(A,0,0);const e=t.getImageData(0,0,A.width,A.height);return{width:A.width,height:A.height,data:e.data}}function zC(A,t){if(/^[a-z][a-z0-9+.-]*:/i.test(t)||t.startsWith("/"))return t;if(/^[a-z][a-z0-9+.-]*:/i.test(A))return new URL(t,A).href;const e=A?A.endsWith("/")?A:`${A}/`:"",i=new URL(t,`http://gltf.local/${e}`);return i.pathname.replace(/^\/+/,"")+i.search+i.hash}function GC(A){const t=A.indexOf(","),e=A.slice(5,t),i=e.split(";")[0]??"",s=A.slice(t+1);if(e.includes(";base64")){const A=atob(s),t=new Uint8Array(A.length);for(let e=0;e<A.length;e++)t[e]=255&A.charCodeAt(e);return{mime:i,bytes:t}}return{mime:i,bytes:(new TextEncoder).encode(decodeURIComponent(s))}}function YC(A){return 137===A[0]&&80===A[1]?"image/png":255===A[0]&&216===A[1]?"image/jpeg":82===A[0]&&73===A[1]?"image/webp":""}let HC=null;function KC(A,t,e,i){const s=e.filter??"NONE";if(!yC.has(e.mode)||!BC.has(s))throw new Error(`GLTFLoader: unsupported meshopt mode ${e.mode}/${s}`);const{count:n,byteStride:r}=e;if(!Number.isInteger(n)||n<0||!Number.isInteger(r)||r<=0)throw new Error("GLTFLoader: invalid meshopt bufferView");if(t.byteLength!==n*r)throw new Error("GLTFLoader: meshopt bufferView length does not match count * stride");if(null!=t.byteStride&&t.byteStride!==r)throw new Error("GLTFLoader: meshopt byteStride does not match bufferView");const a=A[e.buffer];if(!a)throw new Error(`GLTFLoader: missing meshopt buffer ${e.buffer}`);const o=e.byteOffset??0,l=e.byteLength;if(!Number.isInteger(o)||!Number.isInteger(l)||o<0||l<0||o>a.byteLength||l>a.byteLength-o)throw new Error("GLTFLoader: meshopt range is outside its buffer");const c=new Uint8Array(n*r);return n>0&&i(c,n,r,new Uint8Array(a.buffer,a.byteOffset+o,l),e.mode,s),{bin:{buffer:c.buffer,byteOffset:c.byteOffset,byteLength:c.byteLength},byteStride:r}}const VC=new v,JC=new v,WC=new P;class qC{data=new Float32Array(32);parent=null;ready=!1}function XC(A,t,e){for(let i=0;i<16;i++)if(A[e+i]!==t[i])return!1;return!0}function ZC(A,t,e){const i=A.parent,s=t.matrixWorld.data,n=e.data;if(null==i)return!(e.ready&&null==e.parent&&XC(n,s,0)||(e.ready=!0,e.parent=null,n.set(s),t.matrixWorld.decompose(A.position,A.quaternion,A.scale),0));const r=i.matrixWorld.data;return!(e.ready&&e.parent===i&&XC(n,s,0)&&XC(n,r,16)||(e.ready=!0,e.parent=i,n.set(s),n.set(r,16),VC.copy(i.matrixWorld).invert(),JC.multiplyMatrices(VC,t.matrixWorld),JC.decompose(A.position,A.quaternion,A.scale),0))}function _C(A,t){WC.set(t),A.r===WC.r&&A.g===WC.g&&A.b===WC.b||A.setRGB(WC.r,WC.g,WC.b)}function $C(A,t){return t.set(A)}function Aw(A,t,e,i){A.x===t&&A.y===e&&A.z===i||A.set(t,e,i)}function tw(A,t,e,i,s){A.x===t&&A.y===e&&A.z===i&&A.w===s||A.set(t,e,i,s)}function ew(A,t,e,i,s,n){const r=e*t;return(A[r]!==i||A[r+1]!==s||A[r+2]!==n)&&(A[r]=i,A[r+1]=s,A[r+2]=n,!0)}function iw(A){A.isDirty||A.onChangeCallback()}function sw(A,t){const e=new Wi;return e.setAttribute("position",new Fi(A,3)),t&&e.setAttribute("color",new Fi(t,3)),e.computeBoundingBox(),e.freeze(),e}let nw=null;function rw(){if(nw)return nw;const A=new Wi;return A.setIndex(new Pi(new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),1,!1,!0)),A.setAttribute("position",new Fi(new Float32Array([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1]),3)),A.computeBoundingBox(),A.freeze(),nw=A,A}function aw(A){if(A.poolIndex<0)return;const t=A.geometry,e=A.material;Os.prototype.dispose.call(A),t.dispose(),e.dispose()}function ow(A){if(A.poolIndex<0)return;const t=A.material;Os.prototype.dispose.call(A),t.dispose()}const lw=new y,cw=new T,hw=new y(0,0,1);let uw=null,gw=null;const dw=new P;function pw(A,t,e,i){$C(i,dw);const s=dw.r,n=dw.g,r=dw.b,a=ew(A,t,e,s,n,r),o=ew(A,t,e+1,s,n,r);return a||o}const fw=new y,mw=new y;function Cw(A,t,e){return A<t?t:A>e?e:A}const ww=new y,yw=new y,Bw=new y,Iw=new y,Qw=new y,Ew=new y,xw=new y,Dw=new y;function Mw(A,t,e,i,s,n,r,a,o){const l=r*Math.abs(A)+a*Math.abs(t)+o*Math.abs(e),c=i.x*A+i.y*t+i.z*e,h=s.x*A+s.y*t+s.z*e,u=n.x*A+n.y*t+n.z*e,g=c>h?c>u?c:u:h>u?h:u,d=c<h?c<u?c:u:h<u?h:u;return Math.max(-g,d)>l}class bw{min;max;constructor(A=new y(1/0,1/0,1/0),t=new y(-1/0,-1/0,-1/0)){this.min=A,this.max=t}set(A,t){return this.min.copy(A),this.max.copy(t),this}setFromArray(A,t=3){this.makeEmpty();const e=A.length;let i=1/0,s=1/0,n=1/0,r=-1/0,a=-1/0,o=-1/0;for(let l=0;l+2<e;l+=t){const t=A[l],e=A[l+1],c=A[l+2];t<i&&(i=t),e<s&&(s=e),c<n&&(n=c),t>r&&(r=t),e>a&&(a=e),c>o&&(o=c)}return i!==1/0&&(this.min.set(i,s,n),this.max.set(r,a,o)),this}setFromPoints(A){this.makeEmpty();for(let t=0,e=A.length;t<e;t++)this.expandByPoint(A[t]);return this}setFromCenterAndSize(A,t){const e=.5*t.x,i=.5*t.y,s=.5*t.z;return this.min.set(A.x-e,A.y-i,A.z-s),this.max.set(A.x+e,A.y+i,A.z+s),this}copy(A){return this.min.copy(A.min),this.max.copy(A.max),this}clone(){return(new bw).copy(this)}makeEmpty(){return this.min.set(1/0,1/0,1/0),this.max.set(-1/0,-1/0,-1/0),this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(A){return this.isEmpty()?A.set(0,0,0):A.set(.5*(this.min.x+this.max.x),.5*(this.min.y+this.max.y),.5*(this.min.z+this.max.z))}getSize(A){return this.isEmpty()?A.set(0,0,0):A.set(this.max.x-this.min.x,this.max.y-this.min.y,this.max.z-this.min.z)}expandByPoint(A){return A.x<this.min.x&&(this.min.x=A.x),A.y<this.min.y&&(this.min.y=A.y),A.z<this.min.z&&(this.min.z=A.z),A.x>this.max.x&&(this.max.x=A.x),A.y>this.max.y&&(this.max.y=A.y),A.z>this.max.z&&(this.max.z=A.z),this}expandByVector(A){return this.min.set(this.min.x-A.x,this.min.y-A.y,this.min.z-A.z),this.max.set(this.max.x+A.x,this.max.y+A.y,this.max.z+A.z),this}expandByScalar(A){return this.min.set(this.min.x-A,this.min.y-A,this.min.z-A),this.max.set(this.max.x+A,this.max.y+A,this.max.z+A),this}containsPoint(A){return A.x>=this.min.x&&A.x<=this.max.x&&A.y>=this.min.y&&A.y<=this.max.y&&A.z>=this.min.z&&A.z<=this.max.z}containsBox(A){return this.min.x<=A.min.x&&A.max.x<=this.max.x&&this.min.y<=A.min.y&&A.max.y<=this.max.y&&this.min.z<=A.min.z&&A.max.z<=this.max.z}getParameter(A,t){return t.set((A.x-this.min.x)/(this.max.x-this.min.x),(A.y-this.min.y)/(this.max.y-this.min.y),(A.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(A){return A.max.x>=this.min.x&&A.min.x<=this.max.x&&A.max.y>=this.min.y&&A.min.y<=this.max.y&&A.max.z>=this.min.z&&A.min.z<=this.max.z}intersectsSphere(A){const t=A.center,e=Cw(t.x,this.min.x,this.max.x),i=Cw(t.y,this.min.y,this.max.y),s=Cw(t.z,this.min.z,this.max.z),n=e-t.x,r=i-t.y,a=s-t.z;return n*n+r*r+a*a<=A.radius*A.radius}intersectsPlane(A){const t=A.normal;let e=0,i=0;t.x>0?(e=t.x*this.min.x,i=t.x*this.max.x):(e=t.x*this.max.x,i=t.x*this.min.x),t.y>0?(e+=t.y*this.min.y,i+=t.y*this.max.y):(e+=t.y*this.max.y,i+=t.y*this.min.y),t.z>0?(e+=t.z*this.min.z,i+=t.z*this.max.z):(e+=t.z*this.max.z,i+=t.z*this.min.z);const s=-A.constant;return e<=s&&i>=s}intersectsTriangle(A){if(this.isEmpty())return!1;this.getCenter(xw),Dw.set(this.max.x-xw.x,this.max.y-xw.y,this.max.z-xw.z),ww.set(A.a.x-xw.x,A.a.y-xw.y,A.a.z-xw.z),yw.set(A.b.x-xw.x,A.b.y-xw.y,A.b.z-xw.z),Bw.set(A.c.x-xw.x,A.c.y-xw.y,A.c.z-xw.z),Iw.set(yw.x-ww.x,yw.y-ww.y,yw.z-ww.z),Qw.set(Bw.x-yw.x,Bw.y-yw.y,Bw.z-yw.z),Ew.set(ww.x-Bw.x,ww.y-Bw.y,ww.z-Bw.z);const t=Dw.x,e=Dw.y,i=Dw.z;return!(Mw(0,-Iw.z,Iw.y,ww,yw,Bw,t,e,i)||Mw(Iw.z,0,-Iw.x,ww,yw,Bw,t,e,i)||Mw(-Iw.y,Iw.x,0,ww,yw,Bw,t,e,i)||Mw(0,-Qw.z,Qw.y,ww,yw,Bw,t,e,i)||Mw(Qw.z,0,-Qw.x,ww,yw,Bw,t,e,i)||Mw(-Qw.y,Qw.x,0,ww,yw,Bw,t,e,i)||Mw(0,-Ew.z,Ew.y,ww,yw,Bw,t,e,i)||Mw(Ew.z,0,-Ew.x,ww,yw,Bw,t,e,i)||Mw(-Ew.y,Ew.x,0,ww,yw,Bw,t,e,i)||Mw(1,0,0,ww,yw,Bw,t,e,i)||Mw(0,1,0,ww,yw,Bw,t,e,i)||Mw(0,0,1,ww,yw,Bw,t,e,i)||Mw(Iw.y*Qw.z-Iw.z*Qw.y,Iw.z*Qw.x-Iw.x*Qw.z,Iw.x*Qw.y-Iw.y*Qw.x,ww,yw,Bw,t,e,i))}clampPoint(A,t){return t.set(Cw(A.x,this.min.x,this.max.x),Cw(A.y,this.min.y,this.max.y),Cw(A.z,this.min.z,this.max.z))}distanceToPoint(A){const t=Cw(A.x,this.min.x,this.max.x)-A.x,e=Cw(A.y,this.min.y,this.max.y)-A.y,i=Cw(A.z,this.min.z,this.max.z)-A.z;return Math.sqrt(t*t+e*e+i*i)}getBoundingSphere(A){if(this.isEmpty())return A.makeEmpty(),A;this.getCenter(A.center);const t=this.max.x-this.min.x,e=this.max.y-this.min.y,i=this.max.z-this.min.z;return A.radius=.5*Math.sqrt(t*t+e*e+i*i),A}intersect(A){return A.min.x>this.min.x&&(this.min.x=A.min.x),A.min.y>this.min.y&&(this.min.y=A.min.y),A.min.z>this.min.z&&(this.min.z=A.min.z),A.max.x<this.max.x&&(this.max.x=A.max.x),A.max.y<this.max.y&&(this.max.y=A.max.y),A.max.z<this.max.z&&(this.max.z=A.max.z),this.isEmpty()&&this.makeEmpty(),this}union(A){return A.min.x<this.min.x&&(this.min.x=A.min.x),A.min.y<this.min.y&&(this.min.y=A.min.y),A.min.z<this.min.z&&(this.min.z=A.min.z),A.max.x>this.max.x&&(this.max.x=A.max.x),A.max.y>this.max.y&&(this.max.y=A.max.y),A.max.z>this.max.z&&(this.max.z=A.max.z),this}applyMatrix4(A){if(this.isEmpty())return this;const t=A.data,e=this.min.x,i=this.min.y,s=this.min.z,n=this.max.x,r=this.max.y,a=this.max.z;let o=1/0,l=1/0,c=1/0,h=-1/0,u=-1/0,g=-1/0;for(let d=0;d<8;d++){const A=4&d?n:e,p=2&d?r:i,f=1&d?a:s,m=1/(t[3]*A+t[7]*p+t[11]*f+t[15]),C=(t[0]*A+t[4]*p+t[8]*f+t[12])*m,w=(t[1]*A+t[5]*p+t[9]*f+t[13])*m,y=(t[2]*A+t[6]*p+t[10]*f+t[14])*m;C<o&&(o=C),w<l&&(l=w),y<c&&(c=y),C>h&&(h=C),w>u&&(u=w),y>g&&(g=y)}return this.min.set(o,l,c),this.max.set(h,u,g),this}translate(A){return this.min.set(this.min.x+A.x,this.min.y+A.y,this.min.z+A.z),this.max.set(this.max.x+A.x,this.max.y+A.y,this.max.z+A.z),this}equals(A){return A.min.equals(this.min)&&A.max.equals(this.max)}}const Sw=new bw,vw=new bw,Tw=new y,Uw=new y,Nw=new v,Pw=new v,Ow=new y,Fw=new T,kw=new y,Rw=new T;function Lw(A,t,e){if(t===e)return;const i=t.geometry;if(i){const e=i.boundingBox??i.computeBoundingBox();e&&(vw.min.set(e.min.x,e.min.y,e.min.z),vw.max.set(e.max.x,e.max.y,e.max.z),vw.applyMatrix4(t.matrixWorld),A.union(vw))}const s=t.children;for(let n=0,r=s.length;n<r;n++)Lw(A,s[n],e)}const jw=new v,zw=new y,Gw=new P,Yw=new Uint8Array([0,7,16,25]),Hw=new Uint8Array([1,2,18,27]),Kw=new Uint8Array([5,6,20,29]),Vw=new Uint8Array([3,4,22,31]),Jw=new Uint8Array([8,15,17]),Ww=new Uint8Array([9,10,19]),qw=new Uint8Array([13,14,21]),Xw=new Uint8Array([11,12,23]),Zw=new Uint8Array([32,37]),_w=new Uint8Array([33,34]),$w=new Uint8Array([35,36]),Ay=new Uint8Array([38,41]),ty=new Uint8Array([39]),ey=new Uint8Array([42]),iy=new Uint8Array([43]),sy=new Uint8Array([44]),ny=new Uint8Array([45]),ry=new Uint8Array([46]),ay=new Uint8Array([47]),oy=new Uint8Array([48]),ly=new Uint8Array([49]);function cy(A,t,e,i,s,n){zw.set(i,s,n).applyMatrix4(jw);const r=zw.x,a=zw.y,o=zw.z;let l=!1;for(let c=0,h=e.length;c<h;c++)ew(A,t,e[c],r,a,o)&&(l=!0);return l}function hy(A,t,e,i,s){$C(s,Gw);const n=Gw.r,r=Gw.g,a=Gw.b;let o=!1;for(let l=e;l<i;l++)ew(A,t,l,n,r,a)&&(o=!0);return o}function uy(A,t,e,i,s,n,r,a){const o=3*t;A[o]=e,A[o+1]=i,A[o+2]=s,A[o+3]=n,A[o+4]=r,A[o+5]=a}const gy=new P,dy=new P,py=new Float32Array([0,1,0,1,0,0,0,1,0,-1,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,-1,0,1,0,0,0,-1,0,-1,0,0,0,-1,0,0,0,1,0,-1,0,0,0,-1,1,0,0,0,0,1,0,0,1,-1,0,0,-1,0,0,0,0,-1,0,0,-1,1,0,0]),fy=new y,my=new y,Cy=new v,wy=new v,yy=new y,By=new T,Iy=new y;let Qy=null,Ey=null,xy=null;const Dy=2*Math.PI;function My(A,t,e){const i=3*t;A[i]=e.r,A[i+1]=e.g,A[i+2]=e.b}const by=new v,Sy=new P;function vy(A,t,e,i,s){const n=s[12],r=s[13],a=s[14],o=1/(i[3]*n+i[7]*r+i[11]*a+i[15]);return ew(A,t,e,(i[0]*n+i[4]*r+i[8]*a+i[12])*o,(i[1]*n+i[5]*r+i[9]*a+i[13])*o,(i[2]*n+i[6]*r+i[10]*a+i[14])*o)}const Ty=2*Math.PI;let Uy=null;const Ny=new Uint32Array(512),Py=new Uint32Array(512),Oy=new Uint32Array(2048),Fy=new Uint32Array(64),ky=new Uint32Array(64),Ry=new ArrayBuffer(4),Ly=new Float32Array(Ry),jy=new Uint32Array(Ry);function zy(A){Ly[0]=A<-65504?-65504:A>65504?65504:A;const t=jy[0],e=t>>23&511;return Ny[e]+((8388607&t)>>Py[e])}function Gy(A){const t=A>>10;return jy[0]=Oy[ky[t]+(1023&A)]+Fy[t],Ly[0]}!function(){for(let A=0;A<256;A++){const t=A-127,e=256|A;if(t<-27)Ny[A]=0,Ny[e]=32768,Py[A]=24,Py[e]=24;else if(t<-14){const i=1024>>-t-14;Ny[A]=i,Ny[e]=32768|i,Py[A]=-t-1,Py[e]=-t-1}else if(t<=15){const i=t+15<<10;Ny[A]=i,Ny[e]=32768|i,Py[A]=13,Py[e]=13}else t<128?(Ny[A]=31744,Ny[e]=64512,Py[A]=24,Py[e]=24):(Ny[A]=31744,Ny[e]=64512,Py[A]=13,Py[e]=13)}for(let A=1;A<1024;A++){let t=A<<13,e=0;for(;!(8388608&t);)t<<=1,e-=8388608;t&=-8388609,Oy[A]=t|e+947912704}for(let A=1024;A<2048;A++)Oy[A]=939524096+(A-1024<<13);for(let A=1;A<31;A++)Fy[A]=A<<23;Fy[31]=1199570944,Fy[32]=2147483648;for(let A=33;A<63;A++)Fy[A]=2147483648+(A-32<<23);Fy[63]=3347054592;for(let A=1;A<64;A++)32!==A&&(ky[A]=1024)}();const Yy={toHalfFloat:zy,fromHalfFloat:Gy};function Hy(A,t,e=2){return $p(A,t,e)}const Ky={triangulate:Hy};function Vy(A){const t=A.length;let e=0;for(let i=t-1,s=0;s<t;i=s++){const t=A[i],n=A[s];e+=t.x*n.y-n.x*t.y}return.5*e}function Jy(A){return Vy(A)<0}function Wy(A){const t=A.length;var e,i;t>2&&(e=A[t-1],i=A[0],e.x===i.x&&e.y===i.y)&&A.pop()}function qy(A,t=[]){Wy(A);let e=A.length;for(let a=0;a<t.length;a++)Wy(t[a]),e+=t[a].length;const i=new Float64Array(2*e),s=t.length>0?new Uint32Array(t.length):null;let n=0,r=A.length;for(let a=0;a<A.length;a++){const t=A[a];i[n++]=t.x,i[n++]=t.y}for(let a=0;a<t.length;a++){s[a]=r;const A=t[a];r+=A.length;for(let t=0;t<A.length;t++){const e=A[t];i[n++]=e.x,i[n++]=e.y}}return Hy(i,s,2)}const Xy={area:Vy,isClockWise:Jy,triangulateShape:qy};function Zy(A){const t=A.width,e=A.height;return t>0&&e>0?t/e:1}function _y(A,t){const e=Zy(A);return e>t?(A.repeat.x=1,A.repeat.y=e/t,A.offset.x=0,A.offset.y=(1-A.repeat.y)/2):(A.repeat.x=t/e,A.repeat.y=1,A.offset.x=(1-A.repeat.x)/2,A.offset.y=0),A}function $y(A,t){const e=Zy(A);return e>t?(A.repeat.x=t/e,A.repeat.y=1,A.offset.x=(1-A.repeat.x)/2,A.offset.y=0):(A.repeat.x=1,A.repeat.y=e/t,A.offset.x=0,A.offset.y=(1-A.repeat.y)/2),A}function AB(A){return A.repeat.x=1,A.repeat.y=1,A.offset.x=0,A.offset.y=0,A}function tB(A,t,e,i=1){const s=EA[e];if(!s)throw new Error(`TextureUtils.getByteLength: unknown format ${e}`);const n=s.block,r=n?.byteLength??s.byte,a=n?.width||1,o=n?.height||1;return Math.ceil(A/a)*Math.ceil(t/o)*r*i}const eB={contain:_y,cover:$y,fill:AB,getByteLength:tB};function iB(A,t,e){const i=A.x-t.x,s=A.y-t.y;if(2===e)return Math.sqrt(i*i+s*s);const n=A.z-t.z;return Math.sqrt(i*i+s*s+n*n)}function sB(A,t,e){2===e?A.set(t.x,t.y):A.set(t.x,t.y,t.z)}function nB(A,t,e,i,s){const n=Math.cos(s),r=Math.sin(s),a=A.x,o=A.y,l=A.z,c=e*l-i*o,h=i*a-t*l,u=t*o-e*a,g=(1-n)*(t*a+e*o+i*l);A.set(a*n+c*r+t*g,o*n+h*r+e*g,l*n+u*r+i*g)}function rB(A){return A<-1?-1:A>1?1:A}class aB{type="Curve";arcLengthDivisions=200;needsUpdate=!1;cacheArcLengths=null;#rc=null;#ac=null;pair(){return[this.#rc??=this.spawn(),this.#ac??=this.spawn()]}getPointAt(A,t){return this.getPoint(this.getUtoTmapping(A),t)}getPoints(A=5){const t=A>0?A:0,e=new Array(t+1);for(let i=0;i<=t;i++)e[i]=this.getPoint(t>0?i/t:0);return e}getSpacedPoints(A=5){const t=A>0?A:0,e=new Array(t+1);for(let i=0;i<=t;i++)e[i]=this.getPointAt(t>0?i/t:0);return e}getLength(){const A=this.getLengths();return A[A.length-1]??0}getLengths(A=this.arcLengthDivisions){const t=(A>0?A:0)+1,e=this.cacheArcLengths;if(e&&e.length===t&&!this.needsUpdate)return e;this.needsUpdate=!1;const i=e&&e.length===t?e:new Float32Array(t),[s,n]=this.pair();this.getPoint(0,s),i[0]=0;let r=0;const a=t-1;for(let o=1;o<t;o++)this.getPoint(a>0?o/a:0,n),r+=iB(s,n,this.dim),i[o]=r,sB(s,n,this.dim);return this.cacheArcLengths=i,i}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(A,t=null){const e=this.getLengths(),i=e.length;if(i<2)return 0;const s=t||A*e[i-1];let n=0,r=0,a=i-1;for(;r<=a;){n=r+a>>1;const A=e[n]-s;if(A<0)r=n+1;else{if(!(A>0)){a=n;break}a=n-1}}if(n=a,n<0)return 0;if(e[n]===s)return n/(i-1);if(n>=i-1)return 1;const o=e[n],l=e[n+1]-o;return 0===l?n/(i-1):(n+(s-o)/l)/(i-1)}getTangent(A,t){const e=1e-4;let i=A-e,s=A+e;i<0&&(i=0),s>1&&(s=1);const[n,r]=this.pair();this.getPoint(i,n),this.getPoint(s,r);const a=t??this.spawn();if(2===this.dim){const A=r.x-n.x,t=r.y-n.y,e=Math.sqrt(A*A+t*t);e>0?a.set(A/e,t/e):a.set(0,0)}else{const A=r.z-n.z,t=r.x-n.x,e=r.y-n.y,i=Math.sqrt(t*t+e*e+A*A),s=a;i>0?s.set(t/i,e/i,A/i):s.set(0,0,0)}return a}getTangentAt(A,t){return this.getTangent(this.getUtoTmapping(A),t)}computeFrenetFrames(A,t=!1){if(3!==this.dim)throw new Error("Curve.computeFrenetFrames: 3D curve required");const e=A>0?A:0,i=e+1,s=new Array(i),n=new Array(i),r=new Array(i);for(let d=0;d<i;d++)s[d]=this.getTangentAt(e>0?d/e:0,new y),n[d]=new y,r[d]=new y;const a=new y,o=new y,l=s[0];let c=1/0;const h=Math.abs(l.x),u=Math.abs(l.y),g=Math.abs(l.z);h<=c&&(c=h,o.set(1,0,0)),u<=c&&(c=u,o.set(0,1,0)),g<=c&&o.set(0,0,1),a.crossVectors(l,o).normalize(),n[0].crossVectors(l,a),r[0].crossVectors(l,n[0]);for(let d=1;d<i;d++){const A=n[d];A.copy(n[d-1]);const t=s[d-1],e=s[d];a.crossVectors(t,e),a.length()>Number.EPSILON&&(a.normalize(),nB(A,a.x,a.y,a.z,Math.acos(rB(t.dot(e))))),r[d].crossVectors(e,A)}if(t&&e>0){let A=Math.acos(rB(n[0].dot(n[e])))/e;a.crossVectors(n[0],n[e]),s[0].dot(a)>0&&(A=-A);for(let t=1;t<i;t++){const e=s[t];nB(n[t],e.x,e.y,e.z,A*t),r[t].crossVectors(e,n[t])}}return{tangents:s,normals:n,binormals:r}}clone(){return(new(0,this.constructor)).copy(this)}copy(A){return this.arcLengthDivisions=A.arcLengthDivisions,this.needsUpdate=!0,this.cacheArcLengths=null,this}toJSON(){return{type:this.type,arcLengthDivisions:this.arcLengthDivisions}}fromJSON(A){return"number"==typeof A.arcLengthDivisions&&(this.arcLengthDivisions=A.arcLengthDivisions),this.needsUpdate=!0,this.cacheArcLengths=null,this}}function oB(A,t,e,i,s){const n=.5*(i-t),r=.5*(s-e),a=A*A;return(2*e-2*i+n+r)*(A*a)+(-3*e+3*i-2*n-r)*a+n*A+e}function lB(A,t,e,i){const s=1-A;return s*s*t+2*s*A*e+A*A*i}function cB(A,t,e,i,s){const n=1-A,r=n*n,a=A*A;return r*n*t+3*r*A*e+3*n*a*i+a*A*s}class hB extends aB{dim=2;v1;v2;constructor(A=new w,t=new w){super(),this.type="LineCurve",this.v1=A,this.v2=t}spawn(){return new w}getPoint(A,t=new w){const e=this.v1,i=this.v2;return 1===A?t.set(i.x,i.y):t.set(e.x+(i.x-e.x)*A,e.y+(i.y-e.y)*A)}getPointAt(A,t){return this.getPoint(A,t)}getTangent(A,t=new w){const e=this.v2.x-this.v1.x,i=this.v2.y-this.v1.y,s=Math.sqrt(e*e+i*i);return s>0?t.set(e/s,i/s):t.set(0,0)}getTangentAt(A,t){return this.getTangent(A,t)}copy(A){return super.copy(A),this.v1.copy(A.v1),this.v2.copy(A.v2),this}toJSON(){const A=super.toJSON();return A.v1=this.v1.toArray(),A.v2=this.v2.toArray(),A}fromJSON(A){return super.fromJSON(A),this.v1.fromArray(A.v1),this.v2.fromArray(A.v2),this}}class uB extends aB{dim=3;v1;v2;constructor(A=new y,t=new y){super(),this.type="LineCurve3",this.v1=A,this.v2=t}spawn(){return new y}getPoint(A,t=new y){const e=this.v1,i=this.v2;return 1===A?t.set(i.x,i.y,i.z):t.set(e.x+(i.x-e.x)*A,e.y+(i.y-e.y)*A,e.z+(i.z-e.z)*A)}getPointAt(A,t){return this.getPoint(A,t)}getTangent(A,t=new y){const e=this.v2.x-this.v1.x,i=this.v2.y-this.v1.y,s=this.v2.z-this.v1.z,n=Math.sqrt(e*e+i*i+s*s);return n>0?t.set(e/n,i/n,s/n):t.set(0,0,0)}getTangentAt(A,t){return this.getTangent(A,t)}copy(A){return super.copy(A),this.v1.copy(A.v1),this.v2.copy(A.v2),this}toJSON(){const A=super.toJSON();return A.v1=this.v1.toArray(),A.v2=this.v2.toArray(),A}fromJSON(A){return super.fromJSON(A),this.v1.fromArray(A.v1),this.v2.fromArray(A.v2),this}}const gB=2*Math.PI;function dB(A,t,e){let i=t-A;const s=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=gB;for(;i>gB;)i-=gB;return i<Number.EPSILON&&(i=s?0:gB),e&&!s&&(i=i===gB?-gB:i-gB),i}class pB extends aB{dim=2;aX;aY;xRadius;yRadius;aStartAngle;aEndAngle;aClockwise;aRotation;constructor(A=0,t=0,e=1,i=1,s=0,n=gB,r=!1,a=0){super(),this.type="EllipseCurve",this.aX=A,this.aY=t,this.xRadius=e,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=n,this.aClockwise=r,this.aRotation=a}spawn(){return new w}getPoint(A,t=new w){const e=this.aStartAngle+A*dB(this.aStartAngle,this.aEndAngle,this.aClockwise);let i=this.aX+this.xRadius*Math.cos(e),s=this.aY+this.yRadius*Math.sin(e);if(0!==this.aRotation){const A=Math.cos(this.aRotation),t=Math.sin(this.aRotation),e=i-this.aX,n=s-this.aY;i=e*A-n*t+this.aX,s=e*t+n*A+this.aY}return t.set(i,s)}getTangent(A,t=new w){const e=dB(this.aStartAngle,this.aEndAngle,this.aClockwise),i=this.aStartAngle+A*e;let s=-this.xRadius*Math.sin(i)*e,n=this.yRadius*Math.cos(i)*e;if(0!==this.aRotation){const A=Math.cos(this.aRotation),t=Math.sin(this.aRotation),e=s*A-n*t;n=s*t+n*A,s=e}const r=Math.sqrt(s*s+n*n);return r>0?t.set(s/r,n/r):t.set(0,0)}copy(A){return super.copy(A),this.aX=A.aX,this.aY=A.aY,this.xRadius=A.xRadius,this.yRadius=A.yRadius,this.aStartAngle=A.aStartAngle,this.aEndAngle=A.aEndAngle,this.aClockwise=A.aClockwise,this.aRotation=A.aRotation,this}toJSON(){const A=super.toJSON();return A.aX=this.aX,A.aY=this.aY,A.xRadius=this.xRadius,A.yRadius=this.yRadius,A.aStartAngle=this.aStartAngle,A.aEndAngle=this.aEndAngle,A.aClockwise=this.aClockwise,A.aRotation=this.aRotation,A}fromJSON(A){return super.fromJSON(A),this.aX=A.aX,this.aY=A.aY,this.xRadius=A.xRadius,this.yRadius=A.yRadius,this.aStartAngle=A.aStartAngle,this.aEndAngle=A.aEndAngle,this.aClockwise=A.aClockwise,this.aRotation=A.aRotation,this}}class fB extends pB{constructor(A=0,t=0,e=1,i=0,s=2*Math.PI,n=!1){super(A,t,e,e,i,s,n,0),this.type="ArcCurve"}}function mB(A,t){const e=A.x-t.x,i=A.y-t.y,s=A.z-t.z;return e*e+i*i+s*s}function CB(A,t,e,i,s){return t+A*(i+A*(-3*t+3*e-2*i-s+A*(2*t-2*e+i+s)))}function wB(A,t,e,i,s,n,r,a){let o=(e-t)/n-(i-t)/(n+r)+(i-e)/r,l=(i-e)/r-(s-e)/(r+a)+(s-i)/a;return o*=r,l*=r,CB(A,e,i,o,l)}class yB extends aB{dim=3;isCatmullRomCurve3=!0;points;closed;curveType;tension;#oc=null;#lc=null;constructor(A=[],t=!1,e="centripetal",i=.5){super(),this.type="CatmullRomCurve3",this.points=A,this.closed=t,this.curveType=e,this.tension=i}spawn(){return new y}getPoint(A,t=new y){const e=this.points,i=e.length;if(0===i)return t.set(0,0,0);if(1===i)return t.copy(e[0]);const s=this.closed,n=(i-(s?0:1))*A;let r,a,o=Math.floor(n),l=n-o;if(s?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:0===l&&o===i-1&&(o=i-2,l=1),s||o>0)r=e[(o-1)%i];else{const A=e[0],t=e[1];r=(this.#oc??=new y).set(2*A.x-t.x,2*A.y-t.y,2*A.z-t.z)}const c=e[o%i],h=e[(o+1)%i];if(s||o+2<i)a=e[(o+2)%i];else{const A=e[i-1],t=e[i-2];a=(this.#lc??=new y).set(2*A.x-t.x,2*A.y-t.y,2*A.z-t.z)}if("centripetal"===this.curveType||"chordal"===this.curveType){const A="chordal"===this.curveType?.5:.25;let e=Math.pow(mB(r,c),A),i=Math.pow(mB(c,h),A),s=Math.pow(mB(h,a),A);return i<1e-4&&(i=1),e<1e-4&&(e=i),s<1e-4&&(s=i),t.set(wB(l,r.x,c.x,h.x,a.x,e,i,s),wB(l,r.y,c.y,h.y,a.y,e,i,s),wB(l,r.z,c.z,h.z,a.z,e,i,s))}const u=this.tension;return t.set(CB(l,c.x,h.x,u*(h.x-r.x),u*(a.x-c.x)),CB(l,c.y,h.y,u*(h.y-r.y),u*(a.y-c.y)),CB(l,c.z,h.z,u*(h.z-r.z),u*(a.z-c.z)))}copy(A){super.copy(A);const t=A.points,e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=t[i].clone();return this.points=e,this.closed=A.closed,this.curveType=A.curveType,this.tension=A.tension,this}toJSON(){const A=super.toJSON(),t=this.points,e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=t[i].toArray();return A.points=e,A.closed=this.closed,A.curveType=this.curveType,A.tension=this.tension,A}fromJSON(A){super.fromJSON(A);const t=A.points,e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=(new y).fromArray(t[i]);return this.points=e,this.closed=!!A.closed,this.curveType=A.curveType||"centripetal",this.tension="number"==typeof A.tension?A.tension:.5,this}}class BB extends aB{dim=2;v0;v1;v2;v3;constructor(A=new w,t=new w,e=new w,i=new w){super(),this.type="CubicBezierCurve",this.v0=A,this.v1=t,this.v2=e,this.v3=i}spawn(){return new w}getPoint(A,t=new w){const e=this.v0,i=this.v1,s=this.v2,n=this.v3;return t.set(cB(A,e.x,i.x,s.x,n.x),cB(A,e.y,i.y,s.y,n.y))}copy(A){return super.copy(A),this.v0.copy(A.v0),this.v1.copy(A.v1),this.v2.copy(A.v2),this.v3.copy(A.v3),this}toJSON(){const A=super.toJSON();return A.v0=this.v0.toArray(),A.v1=this.v1.toArray(),A.v2=this.v2.toArray(),A.v3=this.v3.toArray(),A}fromJSON(A){return super.fromJSON(A),this.v0.fromArray(A.v0),this.v1.fromArray(A.v1),this.v2.fromArray(A.v2),this.v3.fromArray(A.v3),this}}class IB extends aB{dim=3;v0;v1;v2;v3;constructor(A=new y,t=new y,e=new y,i=new y){super(),this.type="CubicBezierCurve3",this.v0=A,this.v1=t,this.v2=e,this.v3=i}spawn(){return new y}getPoint(A,t=new y){const e=this.v0,i=this.v1,s=this.v2,n=this.v3;return t.set(cB(A,e.x,i.x,s.x,n.x),cB(A,e.y,i.y,s.y,n.y),cB(A,e.z,i.z,s.z,n.z))}copy(A){return super.copy(A),this.v0.copy(A.v0),this.v1.copy(A.v1),this.v2.copy(A.v2),this.v3.copy(A.v3),this}toJSON(){const A=super.toJSON();return A.v0=this.v0.toArray(),A.v1=this.v1.toArray(),A.v2=this.v2.toArray(),A.v3=this.v3.toArray(),A}fromJSON(A){return super.fromJSON(A),this.v0.fromArray(A.v0),this.v1.fromArray(A.v1),this.v2.fromArray(A.v2),this.v3.fromArray(A.v3),this}}class QB extends aB{dim=2;v0;v1;v2;constructor(A=new w,t=new w,e=new w){super(),this.type="QuadraticBezierCurve",this.v0=A,this.v1=t,this.v2=e}spawn(){return new w}getPoint(A,t=new w){const e=this.v0,i=this.v1,s=this.v2;return t.set(lB(A,e.x,i.x,s.x),lB(A,e.y,i.y,s.y))}copy(A){return super.copy(A),this.v0.copy(A.v0),this.v1.copy(A.v1),this.v2.copy(A.v2),this}toJSON(){const A=super.toJSON();return A.v0=this.v0.toArray(),A.v1=this.v1.toArray(),A.v2=this.v2.toArray(),A}fromJSON(A){return super.fromJSON(A),this.v0.fromArray(A.v0),this.v1.fromArray(A.v1),this.v2.fromArray(A.v2),this}}class EB extends aB{dim=3;v0;v1;v2;constructor(A=new y,t=new y,e=new y){super(),this.type="QuadraticBezierCurve3",this.v0=A,this.v1=t,this.v2=e}spawn(){return new y}getPoint(A,t=new y){const e=this.v0,i=this.v1,s=this.v2;return t.set(lB(A,e.x,i.x,s.x),lB(A,e.y,i.y,s.y),lB(A,e.z,i.z,s.z))}copy(A){return super.copy(A),this.v0.copy(A.v0),this.v1.copy(A.v1),this.v2.copy(A.v2),this}toJSON(){const A=super.toJSON();return A.v0=this.v0.toArray(),A.v1=this.v1.toArray(),A.v2=this.v2.toArray(),A}fromJSON(A){return super.fromJSON(A),this.v0.fromArray(A.v0),this.v1.fromArray(A.v1),this.v2.fromArray(A.v2),this}}class xB extends aB{dim=2;points;constructor(A=[]){super(),this.type="SplineCurve",this.points=A}spawn(){return new w}getPoint(A,t=new w){const e=this.points,i=e.length;if(0===i)return t.set(0,0);if(1===i)return t.set(e[0].x,e[0].y);const s=(i-1)*A,n=Math.floor(s),r=s-n,a=e[0===n?n:n-1],o=e[n],l=e[n>i-2?i-1:n+1],c=e[n>i-3?i-1:n+2];return t.set(oB(r,a.x,o.x,l.x,c.x),oB(r,a.y,o.y,l.y,c.y))}copy(A){super.copy(A);const t=A.points,e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=t[i].clone();return this.points=e,this}toJSON(){const A=super.toJSON(),t=this.points,e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=t[i].toArray();return A.points=e,A}fromJSON(A){super.fromJSON(A);const t=A.points,e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=(new w).fromArray(t[i]);return this.points=e,this}}const DB={ArcCurve:fB,CatmullRomCurve3:yB,CubicBezierCurve:BB,CubicBezierCurve3:IB,EllipseCurve:pB,LineCurve:hB,LineCurve3:uB,QuadraticBezierCurve:QB,QuadraticBezierCurve3:EB,SplineCurve:xB};function MB(A){const t=DB[A];if(!t)throw new Error(`Unknown curve type ${A}`);return new t}function bB(A,t,e){return A.equals(t)}function SB(A,t){const e=A.type;return"EllipseCurve"===e||"ArcCurve"===e?2*t:"LineCurve"===e||"LineCurve3"===e?1:"SplineCurve"===e?t*A.points.length:t}class vB extends aB{dim;curves=[];autoClose=!1;cacheLengths=null;constructor(A=2){super(),this.dim=A,this.type="CurvePath"}spawn(){return 3===this.dim?new y:new w}add(A){return this.curves.push(A),this.cacheLengths=null,this}closePath(){const A=this.curves,t=A.length;if(0===t)return this;const e=A[0].getPoint(0),i=A[t-1].getPoint(1);if(!bB(e,i,this.dim)){const t=e instanceof y?new uB(i,e):new hB(i,e);A.push(t)}return this.cacheLengths=null,this}getPoint(A,t){const e=this.curves,i=e.length;if(0===i){const A=t??this.spawn();return 3===this.dim?A.set(0,0,0):A.set(0,0),A}const s=this.getCurveLengths(),n=A*(s[i-1]??0);let r=0,a=i;for(;r<a;){const A=r+a>>1;s[A]<n?r=A+1:a=A}r>=i&&(r=i-1);const o=r>0?s[r-1]:0,l=e[r],c=s[r]-o,h=0===c?0:Math.min(1,(n-o)/c);return l.getPointAt(h,t)}getLength(){const A=this.getCurveLengths(),t=A.length;return 0===t?0:A[t-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.cacheArcLengths=null,this.getCurveLengths()}getCurveLengths(){const A=this.curves,t=A.length,e=this.cacheLengths;let i=this.needsUpdate||!e||e.length!==t;if(!i&&e)for(let r=0;r<t;r++)if(A[r].needsUpdate){i=!0;break}if(!i&&e)return e;this.needsUpdate=!1;const s=e&&e.length===t?e:new Float32Array(t);let n=0;for(let r=0;r<t;r++)n+=A[r].getLength(),s[r]=n;return this.cacheLengths=s,s}getSpacedPoints(A=40){const t=A>0?A:0,e=new Array(t+1);for(let i=0;i<=t;i++)e[i]=this.getPoint(t>0?i/t:0);return this.autoClose&&e.length>0&&e.push(e[0]),e}getPoints(A=12){const t=[];let e=null;const i=this.curves;for(let s=0;s<i.length;s++){const n=i[s],r=n.getPoints(SB(n,A));for(let A=0;A<r.length;A++){const i=r[A];e&&bB(e,i,this.dim)||(t.push(i),e=i)}}return this.autoClose&&t.length>1&&!bB(t[t.length-1],t[0],this.dim)&&t.push(t[0]),t}copy(A){super.copy(A);const t=A.curves,e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=t[i].clone();return this.curves=e,this.autoClose=A.autoClose,this.cacheLengths=null,this}toJSON(){const A=super.toJSON();A.autoClose=this.autoClose;const t=new Array(this.curves.length);for(let e=0;e<this.curves.length;e++)t[e]=this.curves[e].toJSON();return A.curves=t,A}fromJSON(A){super.fromJSON(A),this.autoClose=!!A.autoClose;const t=A.curves??[],e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=MB(t[i].type).fromJSON(t[i]);return this.curves=e,this.cacheLengths=null,this}}class TB extends vB{currentPoint=new w;constructor(A){super(2),this.type="Path",A&&A.length>0&&this.setFromPoints(A)}setFromPoints(A){const t=A[0];if(!t)return this;this.moveTo(t.x,t.y);for(let e=1,i=A.length;e<i;e++){const t=A[e];this.lineTo(t.x,t.y)}return this}moveTo(A,t){return this.currentPoint.set(A,t),this}lineTo(A,t){return this.curves.push(new hB(this.currentPoint.clone(),new w(A,t))),this.currentPoint.set(A,t),this.cacheLengths=null,this}quadraticCurveTo(A,t,e,i){return this.curves.push(new QB(this.currentPoint.clone(),new w(A,t),new w(e,i))),this.currentPoint.set(e,i),this.cacheLengths=null,this}bezierCurveTo(A,t,e,i,s,n){return this.curves.push(new BB(this.currentPoint.clone(),new w(A,t),new w(e,i),new w(s,n))),this.currentPoint.set(s,n),this.cacheLengths=null,this}splineThru(A){const t=new Array(A.length+1);t[0]=this.currentPoint.clone();for(let i=0;i<A.length;i++)t[i+1]=A[i];this.curves.push(new xB(t));const e=A[A.length-1];return e&&this.currentPoint.copy(e),this.cacheLengths=null,this}arc(A=0,t=0,e=1,i=0,s=2*Math.PI,n=!1){return this.absarc(A+this.currentPoint.x,t+this.currentPoint.y,e,i,s,n)}absarc(A=0,t=0,e=1,i=0,s=2*Math.PI,n=!1){return this.absellipse(A,t,e,e,i,s,n,0)}ellipse(A=0,t=0,e=1,i=1,s=0,n=2*Math.PI,r=!1,a=0){return this.absellipse(A+this.currentPoint.x,t+this.currentPoint.y,e,i,s,n,r,a)}absellipse(A=0,t=0,e=1,i=1,s=0,n=2*Math.PI,r=!1,a=0){const o=new pB(A,t,e,i,s,n,r,a);if(this.curves.length>0){const A=o.getPoint(0);A.x===this.currentPoint.x&&A.y===this.currentPoint.y||this.lineTo(A.x,A.y)}return this.curves.push(o),this.currentPoint.copy(o.getPoint(1)),this.cacheLengths=null,this}copy(A){return super.copy(A),this.currentPoint.copy(A.currentPoint),this}toJSON(){const A=super.toJSON();return A.currentPoint=this.currentPoint.toArray(),A}fromJSON(A){return super.fromJSON(A),this.currentPoint.fromArray(A.currentPoint),this}}class UB extends TB{uuid;holes=[];constructor(A){super(A),this.type="Shape",this.uuid=e()}getPointsHoles(A){const t=this.holes,e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=t[i].getPoints(A);return e}extractPoints(A){return{shape:this.getPoints(A),holes:this.getPointsHoles(A)}}copy(A){super.copy(A);const t=A.holes,e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=t[i].clone();return this.holes=e,this}toJSON(){const A=super.toJSON();A.uuid=this.uuid;const t=new Array(this.holes.length);for(let e=0;e<this.holes.length;e++)t[e]=this.holes[e].toJSON();return A.holes=t,A}fromJSON(A){super.fromJSON(A),"string"==typeof A.uuid&&(this.uuid=A.uuid);const t=A.holes??[],e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=(new TB).fromJSON(t[i]);return this.holes=e,this}}function NB(A,t,e){let i=!1;const s=e.length;for(let n=0,r=s-1;n<s;r=n++){const s=e[n],a=e[r];s.y>t!=a.y>t&&A<(a.x-s.x)*(t-s.y)/(a.y-s.y)+s.x&&(i=!i)}return i}function PB(A){let t=1/0,e=1/0,i=-1/0,s=-1/0;for(let n=0;n<A.length;n++){const r=A[n];r.x<t&&(t=r.x),r.y<e&&(e=r.y),r.x>i&&(i=r.x),r.y>s&&(s=r.y)}return{minX:t,minY:e,maxX:i,maxY:s}}function OB(A,t){return t.minX>=A.minX&&t.maxX<=A.maxX&&t.minY>=A.minY&&t.maxY<=A.maxY}function FB(A,t,e){const i=.5*(t.minX+t.maxX),s=.5*(t.minY+t.maxY);if(e.set(i,s),NB(i,s,A))return e;const n=[],r=A.length;for(let a=0;a<r;a++){const t=A[a],e=A[(a+1)%r];t.y>s!=e.y>s&&n.push(t.x+(s-t.y)*(e.x-t.x)/(e.y-t.y))}return n.length>1&&(n.sort((A,t)=>A-t),e.x=.5*(n[0]+n[1])),e}const kB=-1,RB=4294967295;var LB=(A=>(A[A.Full=0]="Full",A[A.Reduced=1]="Reduced",A[A.Aggregate=2]="Aggregate",A[A.Dormant=3]="Dormant",A))(LB||{}),jB=(A=>(A[A.None=0]="None",A[A.RequireFull=1]="RequireFull",A))(jB||{});function zB(A){const t=A>>>0,e=Math.floor(A/4294967296)>>>0;return Math.imul(t^e,2654435761)>>>0}class GB{capacity;cellCapacity;entityId;cellId;simState;protoBundleId;visualPageId;generation;flags;retiring;nextInCell;prevInCell;cellHead;cellCount;freeSlots;freeCount;hashKeys;hashSlots;hashMask;tombstoneCount=0;nextEntityId=1;_count=0;constructor(A,t){if(!Number.isSafeInteger(A)||A<=0)throw new Error("EntityStore.capacity must be a positive safe integer");if(!Number.isSafeInteger(t)||t<=0||t>4294967295)throw new Error("EntityStore.cellCapacity must be in [1, 2^32-1]");this.capacity=A,this.cellCapacity=t,this.entityId=new Float64Array(A),this.cellId=new Uint32Array(A),this.simState=new Uint8Array(A),this.protoBundleId=new Uint32Array(A),this.visualPageId=new Uint32Array(A),this.protoBundleId.fill(RB),this.visualPageId.fill(RB),this.generation=new Uint32Array(A),this.flags=new Uint16Array(A),this.retiring=new Uint8Array(A),this.nextInCell=new Int32Array(A),this.prevInCell=new Int32Array(A),this.nextInCell.fill(kB),this.prevInCell.fill(kB),this.cellHead=new Int32Array(t),this.cellHead.fill(kB),this.cellCount=new Uint32Array(t),this.freeSlots=new Int32Array(A);for(let i=0;i<A;i++)this.freeSlots[i]=A-i-1;this.freeCount=A;const e=function(A){let t=1;for(;t<A;)t*=2;return t}(Math.max(4,2*A));this.hashKeys=new Float64Array(e),this.hashSlots=new Int32Array(e),this.hashSlots.fill(kB),this.hashMask=e-1}get count(){return this._count}spawn(A){if(0===this.freeCount)return 0;const t=A.cellId;if(this.#cc(t),this.nextEntityId>Number.MAX_SAFE_INTEGER)throw new Error("EntityStore entityId space exhausted");const e=this.freeSlots[--this.freeCount],i=this.nextEntityId++;this.entityId[e]=i,this.cellId[e]=t,this.simState[e]=A.simState??3,this.protoBundleId[e]=A.protoBundleId??RB,this.visualPageId[e]=A.visualPageId??RB,this.flags[e]=A.flags??0;let s=this.generation[e]+1>>>0;return 0===s&&(s=1),this.generation[e]=s,this.#hc(i,e),this.#uc(t,e),this.cellCount[t]++,this._count++,i}despawn(A){const t=this.beginDespawn(A);return t!==kB&&this.finishDespawn(t,this.generation[t])}beginDespawn(A){const t=this.getSlot(A);return t===kB?kB:(this.#gc(t),this.cellCount[this.cellId[t]]--,this.#dc(A),this.retiring[t]=1,this._count--,t)}finishDespawn(A,t){return!(A<0||A>=this.capacity||0===this.retiring[A]||this.generation[A]!==t||(this.entityId[A]=0,this.protoBundleId[A]=RB,this.visualPageId[A]=RB,this.flags[A]=0,this.simState[A]=3,this.retiring[A]=0,this.freeSlots[this.freeCount++]=A,2*this.tombstoneCount>this.hashMask&&this.#pc(),0))}moveToCell(A,t){this.#cc(t);const e=this.getSlot(A);if(e===kB)return!1;if(this.cellId[e]===t)return!0;const i=this.cellId[e];return this.#gc(e),this.cellCount[i]--,this.cellId[e]=t,this.#uc(t,e),this.cellCount[t]++,!0}setSimulationState(A,t){const e=this.getSlot(A);return e!==kB&&(this.simState[e]=t,!0)}setVisualPageId(A,t){const e=this.getSlot(A);return e!==kB&&(this.visualPageId[e]=t>>>0,!0)}setProtoBundleId(A,t){const e=this.getSlot(A);return e!==kB&&(this.protoBundleId[e]=t>>>0,!0)}getSlot(A){if(!Number.isSafeInteger(A)||A<=0)return kB;let t=zB(A)&this.hashMask;for(;;){const e=this.hashKeys[t];if(0===e)return kB;if(e===A)return this.hashSlots[t];t=t+1&this.hashMask}}#cc(A){if(!Number.isInteger(A)||A<0||A>=this.cellCapacity)throw new Error(`EntityStore cellId(${A}) out of range`)}#uc(A,t){const e=this.cellHead[A];this.prevInCell[t]=kB,this.nextInCell[t]=e,e!==kB&&(this.prevInCell[e]=t),this.cellHead[A]=t}#gc(A){const t=this.prevInCell,e=this.nextInCell,i=t[A],s=e[A];i===kB?this.cellHead[this.cellId[A]]=s:e[i]=s,s!==kB&&(t[s]=i),t[A]=kB,e[A]=kB}#hc(A,t){const e=this.hashMask,i=this.hashKeys,s=this.hashSlots;let n=zB(A)&e,r=kB;for(;;){const a=i[n];if(0===a){const e=r===kB?n:r;return e!==n&&this.tombstoneCount--,i[e]=A,void(s[e]=t)}-1===a&&r===kB&&(r=n),n=n+1&e}}#dc(A){const t=this.hashMask,e=this.hashKeys,i=this.hashSlots;let s=zB(A)&t;for(;;){const n=e[s];if(0===n)return;if(n===A)return e[s]=-1,i[s]=kB,void this.tombstoneCount++;s=s+1&t}}#pc(){const A=this.hashKeys,t=this.hashSlots;A.fill(0),t.fill(kB),this.tombstoneCount=0;const e=this.entityId,i=this.retiring;for(let s=0;s<this.capacity;s++){const A=e[s];0===A||i[s]||this.#hc(A,s)}}}var YB=(A=>(A[A.None=0]="None",A[A.CompressedBytes=1]="CompressedBytes",A[A.DecodedBytes=2]="DecodedBytes",A[A.ScratchBytes=3]="ScratchBytes",A[A.PendingUploadBytes=4]="PendingUploadBytes",A[A.UploadBytesThisFrame=5]="UploadBytesThisFrame",A[A.GpuAccountedBytes=6]="GpuAccountedBytes",A[A.GpuPreparePeakBytes=7]="GpuPreparePeakBytes",A[A.WorldSlots=8]="WorldSlots",A[A.InstanceSlots=9]="InstanceSlots",A[A.ActivationMutations=10]="ActivationMutations",A))(YB||{});function HB(A,t,e){return t>e||A>e-t}function KB(A,t,e){return HB(t.compressedBytes,e.compressedBytes,A.maxCompressedBytes)?1:HB(t.decodedBytes,e.decodedBytes,A.maxDecodedBytes)?2:HB(t.scratchBytes,e.scratchPeakBytes,A.maxScratchBytes)?3:HB(t.pendingUploadBytes,e.uploadBytes,A.maxPendingUploadBytes)?4:HB(t.gpuAccountedBytes,e.gpuAccountedBytes,A.maxGpuAccountedBytes)?6:HB(t.gpuPreparePeakBytes,e.gpuPreparePeakBytes,A.maxGpuPreparePeakBytes)?7:HB(t.worldSlots,e.worldSlots,A.maxWorldSlots)?8:HB(t.instanceSlots,e.instanceSlots,A.maxInstanceSlots)?9:HB(t.activationMutationsThisFrame,e.activationMutations,A.maxActivationMutationsPerFrame)?10:0}function VB(A,t,e){return HB(t.uploadBytesThisFrame,e,A.maxUploadBytesPerFrame)?5:0}function JB(A,t){for(const e of Object.keys(A)){const t=A[e];if(!Number.isSafeInteger(t)||t<0)throw new Error(`StreamingBudget.${e} must be a non-negative safe integer`)}if(A.maxWorldSlots>t)throw new Error("StreamingBudget.maxWorldSlots exceeds WorldStore capacity");if(A.staticL0WorldSlotReserve+A.staticL1WorldSlotReserve+A.dynamicWorldSlotReserve+A.nonStreamingWorldSlotReserve+A.auxiliaryWorldSlotReserve+A.worldSlotSafetyMargin>A.maxWorldSlots)throw new Error("StreamingBudget WorldStore reserves exceed maxWorldSlots");if(A.staticL0GpuReserve+A.staticL1GpuReserve+A.dynamicGpuReserve>A.maxGpuAccountedBytes)throw new Error("StreamingBudget GPU reserves exceed maxGpuAccountedBytes");if(A.maxUploadBytesPerFrame>A.maxPendingUploadBytes)throw new Error("StreamingBudget frame upload exceeds pending upload capacity")}function WB(A,t){for(const e of Object.keys(t)){const i=t[e];if(!Number.isSafeInteger(i)||i<0)throw new Error(`${A}.${e} must be a non-negative safe integer`)}}var qB=(A=>(A[A.StaticL0=0]="StaticL0",A[A.StaticL1=1]="StaticL1",A[A.StaticShared=2]="StaticShared",A[A.Dynamic=3]="Dynamic",A))(qB||{});function XB(A,t){A.compressedBytes+=t.compressedBytes,A.decodedBytes+=t.decodedBytes,A.scratchBytes+=t.scratchPeakBytes,A.pendingUploadBytes+=t.uploadBytes,A.gpuAccountedBytes+=t.gpuAccountedBytes,A.gpuPreparePeakBytes+=t.gpuPreparePeakBytes,A.worldSlots+=t.worldSlots,A.instanceSlots+=t.instanceSlots}function ZB(A,t){A.compressedBytes-=t.compressedBytes,A.decodedBytes-=t.decodedBytes,A.scratchBytes-=t.scratchPeakBytes,A.pendingUploadBytes-=t.uploadBytes,A.gpuAccountedBytes-=t.gpuAccountedBytes,A.gpuPreparePeakBytes-=t.gpuPreparePeakBytes,A.worldSlots-=t.worldSlots,A.instanceSlots-=t.instanceSlots}function _B(A,t,e){return 0===t?(A.l0Gpu+=e.gpuAccountedBytes,void(A.l0Slots+=e.worldSlots)):1===t?(A.l1Gpu+=e.gpuAccountedBytes,void(A.l1Slots+=e.worldSlots)):3===t?(A.dynamicGpu+=e.gpuAccountedBytes,void(A.dynamicSlots+=e.worldSlots)):(A.sharedGpu+=e.gpuAccountedBytes,void(A.sharedSlots+=e.worldSlots))}function $B(A,t,e){return 0===t?(A.l0Gpu-=e.gpuAccountedBytes,void(A.l0Slots-=e.worldSlots)):1===t?(A.l1Gpu-=e.gpuAccountedBytes,void(A.l1Slots-=e.worldSlots)):3===t?(A.dynamicGpu-=e.gpuAccountedBytes,void(A.dynamicSlots-=e.worldSlots)):(A.sharedGpu-=e.gpuAccountedBytes,void(A.sharedSlots-=e.worldSlots))}function AI(A,t,e,i){if(0===e)return HB(t.l0Gpu,i.gpuAccountedBytes,A.staticL0GpuReserve)?6:HB(t.l0Slots,i.worldSlots,A.staticL0WorldSlotReserve)?8:0;if(1===e)return HB(t.l1Gpu,i.gpuAccountedBytes,A.staticL1GpuReserve)?6:HB(t.l1Slots,i.worldSlots,A.staticL1WorldSlotReserve)?8:0;if(3===e)return HB(t.dynamicGpu,i.gpuAccountedBytes,A.dynamicGpuReserve)?6:HB(t.dynamicSlots,i.worldSlots,A.dynamicWorldSlotReserve)?8:0;const s=A.maxGpuAccountedBytes-A.staticL0GpuReserve-A.staticL1GpuReserve-A.dynamicGpuReserve,n=A.maxWorldSlots-A.staticL0WorldSlotReserve-A.staticL1WorldSlotReserve-A.dynamicWorldSlotReserve-A.nonStreamingWorldSlotReserve-A.auxiliaryWorldSlotReserve-A.worldSlotSafetyMargin;return HB(t.sharedGpu,i.gpuAccountedBytes,Math.max(0,s))?6:HB(t.sharedSlots,i.worldSlots,Math.max(0,n))?8:0}function tI(A,t){if(WB("StaticL0Cost",t),t.gpuAccountedBytes>A.staticL0GpuReserve)throw new Error("Static L0 GPU cost exceeds staticL0GpuReserve");if(t.gpuPreparePeakBytes>A.maxGpuPreparePeakBytes)throw new Error("Static L0 GPU prepare peak exceeds maxGpuPreparePeakBytes");if(t.worldSlots>A.staticL0WorldSlotReserve)throw new Error("Static L0 WorldStore cost exceeds staticL0WorldSlotReserve");if(t.instanceSlots>A.maxInstanceSlots)throw new Error("Static L0 instance cost exceeds maxInstanceSlots");if(t.compressedBytes>A.maxCompressedBytes||t.decodedBytes>A.maxDecodedBytes||t.scratchPeakBytes>A.maxScratchBytes||t.uploadBytes>A.maxPendingUploadBytes)throw new Error("Static L0 CPU or pending upload cost exceeds budget")}const eI=4294967295;var iI=(A=>(A[A.None=0]="None",A[A.MandatoryL0=1]="MandatoryL0",A))(iI||{}),sI=(A=>(A[A.None=0]="None",A[A.Replace=1]="Replace",A[A.Add=2]="Add",A))(sI||{});function nI(A,t,e){if(t.length!==e)throw new Error(`GridManifest.${A}.length(${t.length}) != ${e}`)}function rI(A,t,e,i){if(t>i||e>i-t)throw new Error(`GridManifest ${A} range out of bounds`)}class aI{version;staticL0Cost;layers;cells;pages;bundles;pageBundles;bundleDependencies;resourceIds;cellCount;pageCount;bundleCount;constructor(A){this.version=A.version,this.staticL0Cost=A.staticL0Cost,this.layers=A.layers,this.cells=A.cells,this.pages=A.pages,this.bundles=A.bundles,this.pageBundles=A.pageBundles,this.bundleDependencies=A.bundleDependencies,this.resourceIds=A.resourceIds,this.cellCount=A.cells.layer.length,this.pageCount=A.pages.cellId.length,this.bundleCount=A.bundles.dependencyStart.length,this.#fc()}#fc(){if(!Number.isSafeInteger(this.version)||this.version<1)throw new Error("GridManifest.version must be a positive safe integer");WB("GridManifest.staticL0Cost",this.staticL0Cost);const A=this.layers,t=A.length;if(0===t||t>255)throw new Error("GridManifest.layers length must be in [1, 255]");for(let h=0;h<t;h++){const t=A[h];if(!Number.isFinite(t.cellSizeX)||t.cellSizeX<=0||!Number.isFinite(t.cellSizeY)||t.cellSizeY<=0||!Number.isFinite(t.cellSizeZ)||t.cellSizeZ<=0||!Number.isFinite(t.loadingRange)||t.loadingRange<0)throw new Error(`GridManifest.layers[${h}] has invalid 3D cell size or loadingRange`)}const e=this.cells,i=this.cellCount;nI("cells.x",e.x,i),nI("cells.y",e.y,i),nI("cells.z",e.z,i),nI("cells.parentCellId",e.parentCellId,i),nI("cells.pageStart",e.pageStart,i),nI("cells.pageCount",e.pageCount,i),nI("cells.flags",e.flags,i);const s=this.pages,n=this.pageCount;nI("pages.bundleStart",s.bundleStart,n),nI("pages.bundleCount",s.bundleCount,n),nI("pages.replacementPageId",s.replacementPageId,n),nI("pages.flags",s.flags,n),nI("pages.compressedBytes",s.compressedBytes,n),nI("pages.decodedBytes",s.decodedBytes,n),nI("pages.scratchPeakBytes",s.scratchPeakBytes,n),nI("pages.uploadBytes",s.uploadBytes,n),nI("pages.gpuAccountedBytes",s.gpuAccountedBytes,n),nI("pages.gpuPreparePeakBytes",s.gpuPreparePeakBytes,n),nI("pages.worldSlots",s.worldSlots,n),nI("pages.instanceSlots",s.instanceSlots,n),nI("pages.activationMutations",s.activationMutations,n);const r=this.bundles,a=this.bundleCount;nI("bundles.dependencyCount",r.dependencyCount,a),nI("bundles.resourceStart",r.resourceStart,a),nI("bundles.resourceCount",r.resourceCount,a),nI("bundles.compressedBytes",r.compressedBytes,a),nI("bundles.decodedBytes",r.decodedBytes,a),nI("bundles.scratchPeakBytes",r.scratchPeakBytes,a),nI("bundles.uploadBytes",r.uploadBytes,a),nI("bundles.gpuAccountedBytes",r.gpuAccountedBytes,a),nI("bundles.gpuPreparePeakBytes",r.gpuPreparePeakBytes,a);for(let h=0;h<i;h++){if(e.layer[h]>=A.length)throw new Error(`GridManifest cell ${h} references an invalid layer`);const t=e.parentCellId[h];if(t!==eI&&t>=i)throw new Error(`GridManifest cell ${h} references an invalid parent`);if(0===e.layer[h]){if(t!==eI)throw new Error(`GridManifest L0 cell ${h} cannot have a parent`)}else if(t===eI||e.layer[t]+1!==e.layer[h])throw new Error(`GridManifest cell ${h} must reference an immediate coarser parent`);rI(`cell ${h} pages`,e.pageStart[h],e.pageCount[h],n)}for(let h=0;h<n;h++){if(s.cellId[h]>=i)throw new Error(`GridManifest page ${h} references an invalid cell`);const A=s.replacementPageId[h];if(A!==eI&&A>=n)throw new Error(`GridManifest page ${h} has an invalid replacement`);const t=s.flags[h];if(1&t&&2&t)throw new Error(`GridManifest page ${h} cannot be both REPLACE and ADD`);if(-4&t)throw new Error(`GridManifest page ${h} has unknown flags`);if(1&t){if(A===eI)throw new Error(`GridManifest REPLACE page ${h} has no replacement target`);const t=s.cellId[h],i=s.cellId[A];if(e.parentCellId[t]!==i)throw new Error(`GridManifest page ${h} must replace a Page in its parent cell`)}else if(A!==eI)throw new Error(`GridManifest page ${h} replacement target requires REPLACE`);if(!Number.isSafeInteger(s.gpuAccountedBytes[h])||s.gpuAccountedBytes[h]<0||!Number.isSafeInteger(s.gpuPreparePeakBytes[h])||s.gpuPreparePeakBytes[h]<0||0===s.activationMutations[h])throw new Error(`GridManifest page ${h} has an invalid GPU or activation cost`);rI(`page ${h} bundles`,s.bundleStart[h],s.bundleCount[h],this.pageBundles.length)}for(let h=0;h<this.pageBundles.length;h++)if(this.pageBundles[h]>=a)throw new Error(`GridManifest pageBundles[${h}] references an invalid bundle`);for(let h=0;h<a;h++){if(!Number.isSafeInteger(r.gpuAccountedBytes[h])||r.gpuAccountedBytes[h]<0||!Number.isSafeInteger(r.gpuPreparePeakBytes[h])||r.gpuPreparePeakBytes[h]<0)throw new Error(`GridManifest bundle ${h} has an invalid GPU cost`);rI(`bundle ${h} dependencies`,r.dependencyStart[h],r.dependencyCount[h],this.bundleDependencies.length),rI(`bundle ${h} resources`,r.resourceStart[h],r.resourceCount[h],this.resourceIds.length)}for(let h=0;h<this.bundleDependencies.length;h++)if(this.bundleDependencies[h]>=a)throw new Error(`GridManifest bundleDependencies[${h}] references an invalid bundle`);const o=new Uint8Array(a),l=new Int32Array(a),c=new Uint32Array(a);for(let h=0;h<a;h++){if(0!==o[h])continue;let A=0;for(l[0]=h,c[0]=0,o[h]=1;A>=0;){const t=l[A],e=c[A];if(e>=r.dependencyCount[t]){o[t]=2,A--;continue}c[A]=e+1;const i=this.bundleDependencies[r.dependencyStart[t]+e],s=o[i];if(1===s)throw new Error(`GridManifest bundle dependency cycle at ${i}`);2!==s&&(A++,l[A]=i,c[A]=0,o[i]=1)}}}}const oI={compressedBytes:0,decodedBytes:0,scratchBytes:0,pendingUploadBytes:0,gpuAccountedBytes:0,gpuPreparePeakBytes:0,worldSlots:0,instanceSlots:0,activationMutationsThisFrame:0};function lI(){return{compressedBytes:0,decodedBytes:0,scratchPeakBytes:0,uploadBytes:0,gpuAccountedBytes:0,gpuPreparePeakBytes:0,worldSlots:0,instanceSlots:0,activationMutations:0}}function cI(A,t,e){for(const i of Object.keys(A)){const s=A[i]+t[i];if(!Number.isSafeInteger(s))throw new Error(`${e}.${i} exceeds safe integer range`);A[i]=s}}function hI(A,t,e){for(const i of Object.keys(t))if(t[i]>e[i])throw new Error(`${A}.${i} exceeds build limit`)}function uI(A,t){if(!Number.isInteger(t)||t<0||t>4294967295)throw new Error(`${A} must be uint32`)}function gI(A,t){if(!Number.isInteger(t)||t<0||t>65535)throw new Error(`${A} must be uint16`)}function dI(A,t){uI(`${A}.compressedBytes`,t.compressedBytes),uI(`${A}.decodedBytes`,t.decodedBytes),uI(`${A}.scratchPeakBytes`,t.scratchPeakBytes),uI(`${A}.uploadBytes`,t.uploadBytes),uI(`${A}.worldSlots`,t.worldSlots),uI(`${A}.instanceSlots`,t.instanceSlots),uI(`${A}.activationMutations`,t.activationMutations)}function pI(A,t,e,i){return`${A}:${t}:${e}:${i}`}function fI(A,t){const e=A.layer;if(!Number.isInteger(e)||e<0||e>=t.length)throw new Error(`ImportedPage(${A.id}) references invalid layer`);const i=A.bounds;if(!Number.isFinite(i.minX)||!Number.isFinite(i.minY)||!Number.isFinite(i.minZ)||!Number.isFinite(i.maxX)||!Number.isFinite(i.maxY)||!Number.isFinite(i.maxZ)||i.minX>i.maxX||i.minY>i.maxY||i.minZ>i.maxZ)throw new Error(`ImportedPage(${A.id}) has invalid bounds`);const s=t[e],n=Math.floor((.5*(i.minX+i.maxX)-s.originX)/s.cellSizeX),r=Math.floor((.5*(i.minY+i.maxY)-s.originY)/s.cellSizeY),a=Math.floor((.5*(i.minZ+i.maxZ)-s.originZ)/s.cellSizeZ);if(!Number.isSafeInteger(n)||n<-2147483648||n>2147483647||!Number.isSafeInteger(r)||r<-2147483648||r>2147483647||!Number.isSafeInteger(a)||a<-2147483648||a>2147483647)throw new Error(`ImportedPage(${A.id}) cell coordinate exceeds int32`);const o=s.originX+n*s.cellSizeX,l=s.originY+r*s.cellSizeY,c=s.originZ+a*s.cellSizeZ,h=1e-9*Math.max(s.cellSizeX,s.cellSizeY,s.cellSizeZ);if(i.minX<o-h||i.maxX>o+s.cellSizeX+h||i.minY<l-h||i.maxY>l+s.cellSizeY+h||i.minZ<c-h||i.maxZ>c+s.cellSizeZ+h)throw new Error(`ImportedPage(${A.id}) crosses its L${e} cell; assign it to a coarser layer or split it`);return{layer:e,x:n,y:r,z:a,key:pI(e,n,r,a),pageIndices:[]}}function mI(A,t){const e=t[A.layer],i=t[A.layer-1],s=e.originX+(A.x+.5)*e.cellSizeX,n=e.originY+(A.y+.5)*e.cellSizeY,r=e.originZ+(A.z+.5)*e.cellSizeZ,a=Math.floor((s-i.originX)/i.cellSizeX),o=Math.floor((n-i.originY)/i.cellSizeY),l=Math.floor((r-i.originZ)/i.cellSizeZ);return pI(A.layer-1,a,o,l)}function CI(A,t,e,i){JB(t,i),WB("GridManifestBuildLimits.maxPageCost",e.maxPageCost),tI(t,A.staticL0Cost);const s={compressedBytes:0,decodedBytes:0,scratchPeakBytes:0,uploadBytes:0,gpuAccountedBytes:0,gpuPreparePeakBytes:0,worldSlots:0,instanceSlots:0,activationMutations:0},n=A.pages;for(let a=0;a<A.pageCount;a++){if(n.bundleCount[a]>e.maxBundlesPerPage)throw new Error(`GridManifest page ${a} exceeds maxBundlesPerPage`);s.compressedBytes=n.compressedBytes[a],s.decodedBytes=n.decodedBytes[a],s.scratchPeakBytes=n.scratchPeakBytes[a],s.uploadBytes=n.uploadBytes[a],s.gpuAccountedBytes=n.gpuAccountedBytes[a],s.gpuPreparePeakBytes=n.gpuPreparePeakBytes[a],s.worldSlots=n.worldSlots[a],s.instanceSlots=n.instanceSlots[a],s.activationMutations=n.activationMutations[a],hI(`GridManifest page ${a}`,s,e.maxPageCost);const A=KB(t,oI,s);if(A!==YB.None)throw new Error(`GridManifest page ${a} cannot be admitted: ${A}`)}const r=A.bundles;for(let a=0;a<A.bundleCount;a++){if(r.dependencyCount[a]>e.maxDependenciesPerBundle)throw new Error(`GridManifest bundle ${a} exceeds maxDependenciesPerBundle`);if(r.resourceCount[a]>e.maxResourcesPerBundle)throw new Error(`GridManifest bundle ${a} exceeds maxResourcesPerBundle`)}}var wI=(A=>(A[A.Absent=0]="Absent",A[A.Preparing=1]="Preparing",A[A.Ready=2]="Ready",A[A.Active=3]="Active",A[A.Retiring=4]="Retiring",A))(wI||{}),yI=(A=>(A[A.Coverage=0]="Coverage",A[A.Incoming=1]="Incoming",A[A.Fallback=2]="Fallback",A[A.Refinement=3]="Refinement",A))(yI||{});function BI(A){return 0===A?qB.StaticL0:1===A?qB.StaticL1:qB.StaticShared}class II{pageCount;staticPageCount;state;generation;account;staticWanted;dynamicWanted;preloadWanted;remainingUpload;lane;roots;residentPages;usage;columns;budget;manifest;content;runtimeDefined;runtimeFree;runtimeFreeCount;runtimeCompressedBytes;runtimeDecodedBytes;runtimeScratchPeakBytes;runtimeUploadBytes;runtimeGpuAccountedBytes;runtimeGpuPreparePeakBytes;runtimeWorldSlots;runtimeInstanceSlots;runtimeActivationMutations;bundleRefCount;bundleMandatoryL0;bundleVisitEpoch;bundleStack;bundleScratch;bundleEpoch=0;deltaCost={compressedBytes:0,decodedBytes:0,scratchPeakBytes:0,uploadBytes:0,gpuAccountedBytes:0,gpuPreparePeakBytes:0,worldSlots:0,instanceSlots:0,activationMutations:0};columnCosts=[{compressedBytes:0,decodedBytes:0,scratchPeakBytes:0,uploadBytes:0,gpuAccountedBytes:0,gpuPreparePeakBytes:0,worldSlots:0,instanceSlots:0,activationMutations:0},{compressedBytes:0,decodedBytes:0,scratchPeakBytes:0,uploadBytes:0,gpuAccountedBytes:0,gpuPreparePeakBytes:0,worldSlots:0,instanceSlots:0,activationMutations:0},{compressedBytes:0,decodedBytes:0,scratchPeakBytes:0,uploadBytes:0,gpuAccountedBytes:0,gpuPreparePeakBytes:0,worldSlots:0,instanceSlots:0,activationMutations:0},{compressedBytes:0,decodedBytes:0,scratchPeakBytes:0,uploadBytes:0,gpuAccountedBytes:0,gpuPreparePeakBytes:0,worldSlots:0,instanceSlots:0,activationMutations:0}];source;decoder;maxInflightJobs;costScratch={compressedBytes:0,decodedBytes:0,scratchPeakBytes:0,uploadBytes:0,gpuAccountedBytes:0,gpuPreparePeakBytes:0,worldSlots:0,instanceSlots:0,activationMutations:0};jobPageId;jobGeneration;jobAbort;inflight=0;completePageId;completeGeneration;completeKind;completePayload;completeHead=0;completeTail=0;laneHead;laneCount;lanePages;queued;residentPosition;_residentCount=0;syncPrepare;syncCompleted=0;blockedLane=4;constructor(A){const t=A.manifest?.pageCount??0,e=Math.max(0,A.runtimePageCapacity??0);if(!Number.isSafeInteger(e))throw new Error("PagePipeline.runtimePageCapacity must be a non-negative safe integer");const i=t+e;if(!Number.isSafeInteger(i)||i>4294967295)throw new Error("PagePipeline total page capacity is invalid");this.pageCount=i,this.staticPageCount=t,this.manifest=A.manifest,this.budget=A.budget,this.source=A.source,this.decoder=A.decoder,this.maxInflightJobs=Math.max(1,0|A.maxInflightJobs),this.state=new Uint8Array(i),this.generation=new Uint32Array(i),this.account=new Uint8Array(i),this.staticWanted=new Uint8Array(i),this.dynamicWanted=new Uint32Array(i),this.preloadWanted=new Uint32Array(i),this.remainingUpload=new Uint32Array(i),this.lane=new Uint8Array(i),this.roots=new Array(i),this.content=new Array(i),this.runtimeDefined=new Uint8Array(e),this.runtimeFree=new Int32Array(e),this.runtimeFreeCount=e,this.runtimeCompressedBytes=new Uint32Array(e),this.runtimeDecodedBytes=new Uint32Array(e),this.runtimeScratchPeakBytes=new Uint32Array(e),this.runtimeUploadBytes=new Uint32Array(e),this.runtimeGpuAccountedBytes=new Float64Array(e),this.runtimeGpuPreparePeakBytes=new Float64Array(e),this.runtimeWorldSlots=new Uint32Array(e),this.runtimeInstanceSlots=new Uint32Array(e),this.runtimeActivationMutations=new Uint32Array(e);for(let r=0;r<e;r++)this.runtimeFree[r]=e-r-1;const s=A.manifest?.bundleCount??0;this.bundleRefCount=new Uint32Array(s),this.bundleMandatoryL0=new Uint8Array(s),this.bundleVisitEpoch=new Uint32Array(s),this.bundleStack=new Int32Array(s),this.bundleScratch=new Uint32Array(s),this.residentPages=new Uint32Array(i),this.residentPosition=new Int32Array(i),this.residentPosition.fill(-1),this.usage={compressedBytes:0,decodedBytes:0,scratchBytes:0,pendingUploadBytes:0,uploadBytesThisFrame:0,gpuAccountedBytes:0,gpuPreparePeakBytes:0,worldSlots:0,instanceSlots:0,activationMutationsThisFrame:0},this.columns={l0Gpu:0,l1Gpu:0,sharedGpu:0,dynamicGpu:0,l0Slots:0,l1Slots:0,sharedSlots:0,dynamicSlots:0},this.jobPageId=new Int32Array(this.maxInflightJobs),this.jobGeneration=new Uint32Array(this.maxInflightJobs),this.jobAbort=new Array(this.maxInflightJobs),this.jobPageId.fill(-1);const n=Math.max(4,4*this.maxInflightJobs);if(this.completePageId=new Int32Array(n),this.completeGeneration=new Uint32Array(n),this.completeKind=new Uint8Array(n),this.completePayload=new Array(n),this.laneHead=new Uint32Array(4),this.laneCount=new Uint32Array(4),this.lanePages=new Uint32Array(Math.max(4,4*i)),this.queued=new Uint8Array(i),this.syncPrepare=new Array(i),this.syncPrepare.fill(null),A.manifest){const e=A.manifest.cells,i=A.manifest.pages;for(let A=0;A<t;A++)this.account[A]=BI(e.layer[i.cellId[A]]),this.roots[A]=null,this.content[A]=null;for(let A=0;A<t;A++){if(0!==e.layer[i.cellId[A]])continue;const t=this.#mc(A);for(let A=0;A<t;A++)this.bundleMandatoryL0[this.bundleScratch[A]]=1}}}registerRuntimePage(A){if(WB("RuntimePageCost",A),A.compressedBytes>4294967295||A.decodedBytes>4294967295||A.scratchPeakBytes>4294967295||A.uploadBytes>4294967295||A.worldSlots>4294967295||A.instanceSlots>4294967295||A.activationMutations>4294967295)throw new Error("RuntimePageCost exceeds Uint32 storage");if(0===A.activationMutations)throw new Error("RuntimePageCost.activationMutations must be positive");if(0===this.runtimeFreeCount)return-1;const t=this.runtimeFree[--this.runtimeFreeCount],e=this.staticPageCount+t;return this.runtimeDefined[t]=1,this.runtimeCompressedBytes[t]=A.compressedBytes,this.runtimeDecodedBytes[t]=A.decodedBytes,this.runtimeScratchPeakBytes[t]=A.scratchPeakBytes,this.runtimeUploadBytes[t]=A.uploadBytes,this.runtimeGpuAccountedBytes[t]=A.gpuAccountedBytes,this.runtimeGpuPreparePeakBytes[t]=A.gpuPreparePeakBytes,this.runtimeWorldSlots[t]=A.worldSlots,this.runtimeInstanceSlots[t]=A.instanceSlots,this.runtimeActivationMutations[t]=A.activationMutations,this.account[e]=qB.Dynamic,e}unregisterRuntimePage(A){const t=A-this.staticPageCount;return!(t<0||t>=this.runtimeDefined.length||0===this.runtimeDefined[t]||0!==this.state[A]||this.wanted(A)||(this.runtimeDefined[t]=0,this.syncPrepare[A]=null,this.runtimeFree[this.runtimeFreeCount++]=t,0))}setSyncPrepare(A,t){if(A<this.staticPageCount||A>=this.pageCount)throw new Error(`PagePipeline.setSyncPrepare page ${A} is not a runtime page`);this.syncPrepare[A]=t}wanted(A){return 0!==this.staticWanted[A]||0!==this.dynamicWanted[A]||0!==this.preloadWanted[A]}get residentCount(){return this._residentCount}preparedContent(A){return A<0||A>=this.pageCount?null:this.content[A]}setStaticWanted(A,t,e){if(A<0||A>=this.staticPageCount)return;const i=this.wanted(A);if(this.staticWanted[A]=t?1:0,t&&(!i||e<this.lane[A])&&(this.lane[A]=e),t&&0===this.state[A]){const t=this.manifest;this.account[A]=BI(t.cells.layer[t.pages.cellId[A]]),this.#oA(A,e)}}addDynamicWanted(A,t){if(A<0||A>=this.pageCount)return;const e=this.wanted(A),i=A-this.staticPageCount;if(i>=0&&0===this.runtimeDefined[i])throw new Error(`PagePipeline runtime page ${A} is not registered`);if(4294967295===this.dynamicWanted[A])throw new Error(`PagePipeline dynamic refCount overflow for page ${A}`);this.dynamicWanted[A]++,(!e||t<this.lane[A])&&(this.lane[A]=t),0===this.state[A]&&(1===this.dynamicWanted[A]&&0===this.staticWanted[A]&&(this.account[A]=qB.Dynamic),this.#oA(A,t))}removeDynamicWanted(A){if(!(A<0||A>=this.pageCount)&&(this.dynamicWanted[A]>0&&this.dynamicWanted[A]--,0===this.dynamicWanted[A]&&this.staticWanted[A]&&0===this.state[A])){const t=this.manifest;t&&(this.account[A]=BI(t.cells.layer[t.pages.cellId[A]]))}}addPreloadWanted(A,t=3){if(A<0||A>=this.pageCount)return;const e=this.wanted(A),i=A-this.staticPageCount;if(!(i>=0&&0===this.runtimeDefined[i])){if(4294967295===this.preloadWanted[A])throw new Error(`PagePipeline preload refCount overflow for page ${A}`);this.preloadWanted[A]++,(!e||t<this.lane[A])&&(this.lane[A]=t),0===this.state[A]&&(1===this.preloadWanted[A]&&0===this.dynamicWanted[A]&&0===this.staticWanted[A]&&(this.account[A]=qB.Dynamic),this.#oA(A,t))}}removePreloadWanted(A){A<0||A>=this.pageCount||this.preloadWanted[A]>0&&this.preloadWanted[A]--}requestL0Coverage(A=0){const t=this.manifest;if(!t)return;const e=t.pages,i=t.cells;for(let s=0;s<this.staticPageCount;s++)0===i.layer[e.cellId[s]]&&this.setStaticWanted(s,!0,A)}pump(){this.usage.uploadBytesThisFrame=0,this.blockedLane=4,this.syncCompleted=0,this.#Cc(),this.#wc(),this.#yc(),0!==this.syncCompleted&&(this.#Cc(),this.#wc()),this.#Bc()}cancelLane(A){let t=0;for(;t<this._residentCount;){const e=this.residentPages[t],i=this.state[e];this.lane[e]!==A||1!==i&&2!==i?t++:(1===i&&this.#Ic(e),this.#Wn(e))}}beginRetire(A){3===this.state[A]&&(this.state[A]=4)}finishRetire(A,t=!1){4===this.state[A]&&(t&&this.wanted(A)?this.state[A]=2:this.#Wn(A))}markActive(A){2===this.state[A]&&(this.state[A]=3)}hasEntityWriter(A){const t=this.content[A];return!(!t?.addEntity&&!t?.removeEntity)}addEntity(A,t,e){this.content[A]?.addEntity?.(t,e)}removeEntity(A,t,e){this.content[A]?.removeEntity?.(t,e)}dropGpuKeepWanted(){for(;this._residentCount>0;){const A=this.residentPages[this._residentCount-1];this.#Ic(A),this.#Wn(A)}for(this.inflight=0,this.jobPageId.fill(-1);this.completeHead!==this.completeTail;)this.completePayload[this.completeHead]?.dispose(),this.completePayload[this.completeHead]=null,this.completeHead=(this.completeHead+1)%this.completePageId.length;this.completeHead=this.completeTail,this.usage.uploadBytesThisFrame=0,this.usage.activationMutationsThisFrame=0}dispose(){for(let A=0;A<this.jobAbort.length;A++)this.jobAbort[A]?.abort(),this.jobAbort[A]=null;this.staticWanted.fill(0),this.dynamicWanted.fill(0),this.preloadWanted.fill(0),this.dropGpuKeepWanted()}pageCost(A,t=this.costScratch){const e=this.manifest;if(A<0||A>=this.pageCount)throw new Error(`PagePipeline unknown page ${A}`);if(A<this.staticPageCount)return function(A,t,e){const i=A.pages;e.compressedBytes=i.compressedBytes[t],e.decodedBytes=i.decodedBytes[t],e.scratchPeakBytes=i.scratchPeakBytes[t],e.uploadBytes=i.uploadBytes[t],e.gpuAccountedBytes=i.gpuAccountedBytes[t],e.gpuPreparePeakBytes=i.gpuPreparePeakBytes[t],e.worldSlots=i.worldSlots[t],e.instanceSlots=i.instanceSlots[t],e.activationMutations=i.activationMutations[t]}(e,A,t),t;const i=A-this.staticPageCount;if(0===this.runtimeDefined[i])throw new Error(`PagePipeline runtime page ${A} is not registered`);return t.compressedBytes=this.runtimeCompressedBytes[i],t.decodedBytes=this.runtimeDecodedBytes[i],t.scratchPeakBytes=this.runtimeScratchPeakBytes[i],t.uploadBytes=this.runtimeUploadBytes[i],t.gpuAccountedBytes=this.runtimeGpuAccountedBytes[i],t.gpuPreparePeakBytes=this.runtimeGpuPreparePeakBytes[i],t.worldSlots=this.runtimeWorldSlots[i],t.instanceSlots=this.runtimeInstanceSlots[i],t.activationMutations=this.runtimeActivationMutations[i],t}#oA(A,t){if(this.queued[A])return;const e=Math.max(1,this.pageCount);if(this.laneCount[t]>=e)return;const i=t*e+(this.laneHead[t]+this.laneCount[t])%e;this.lanePages[i]=A,this.laneCount[t]++,this.queued[A]=1}#Qc(A){const t=Math.max(1,this.pageCount);if(0===this.laneCount[A])return-1;const e=A*t+this.laneHead[A]%t,i=this.lanePages[e];return this.laneHead[A]++,this.laneCount[A]--,this.queued[i]=0,i}#Ec(A){const t=Math.max(1,this.pageCount);return 0===this.laneCount[A]?-1:this.lanePages[A*t+this.laneHead[A]%t]}#yc(){for(let A=0;A<4;A++)for(;this.laneCount[A]>0;){const t=this.#Ec(A);if(this.lane[t]<A){this.#Qc(A),this.#oA(t,this.lane[t]);continue}if(t<0||!this.wanted(t)||0!==this.state[t]){this.#Qc(A);continue}const e=null!==this.syncPrepare[t];if(!e&&this.inflight>=this.maxInflightJobs)return;if(!this.#K(t)){if(this.#xc(A))continue;return void(A<this.blockedLane&&(this.blockedLane=A))}this.#Qc(A),e?this.#Dc(t):this.#Mc(t)}}#Dc(A){let t=null;try{t=this.syncPrepare[A]()}catch{t=null}t?(this.content[A]=t,this.roots[A]=t.roots,this.syncCompleted++):this.#Wn(A,!1)}#xc(A){for(let t=0;t<this._residentCount;t++){const e=this.residentPages[t],i=this.state[e];if(!(this.lane[e]<=A||1!==i&&2!==i))return 1===i&&this.#Ic(e),this.#Wn(e),!0}return!1}#K(A){const t=this.account[A],e=this.pageCost(A),i=this.#mc(A),s=this.deltaCost;this.#bc(e,s),s.activationMutations=0;const n=this.columnCosts;for(let c=0;c<4;c++)this.#Sc(n[c]);const r=n[t];r.worldSlots=e.worldSlots,r.instanceSlots=e.instanceSlots;let a=e.gpuAccountedBytes;const o=this.manifest?.bundles;if(o)for(let c=0;c<i;c++){const A=this.bundleScratch[c];a-=o.gpuAccountedBytes[A],0===this.bundleRefCount[A]?n[this.bundleMandatoryL0[A]?qB.StaticL0:qB.StaticShared].gpuAccountedBytes+=o.gpuAccountedBytes[A]:(s.gpuAccountedBytes-=o.gpuAccountedBytes[A],s.gpuPreparePeakBytes-=o.gpuPreparePeakBytes[A])}if(a<0)throw new Error(`PagePipeline page ${A} has inconsistent bundle GPU cost`);if(r.gpuAccountedBytes+=a,KB(this.budget,this.usage,s)!==YB.None)return!1;for(let c=0;c<4;c++)if(AI(this.budget,this.columns,c,n[c])!==YB.None)return!1;XB(this.usage,s);for(let c=0;c<4;c++)_B(this.columns,c,n[c]);for(let c=0;c<i;c++){const A=this.bundleScratch[c];if(4294967295===this.bundleRefCount[A])throw new Error(`PagePipeline bundle refCount overflow for bundle ${A}`);this.bundleRefCount[A]++}this.residentPosition[A]=this._residentCount,this.residentPages[this._residentCount++]=A,this.remainingUpload[A]=e.uploadBytes,this.state[A]=1;let l=this.generation[A]+1>>>0;return 0===l&&(l=1),this.generation[A]=l,!0}#Mc(A){let t=-1;for(let n=0;n<this.maxInflightJobs;n++)if(this.jobPageId[n]<0){t=n;break}if(t<0)return;const e=new AbortController,i=this.generation[A];this.jobPageId[t]=A,this.jobGeneration[t]=i,this.jobAbort[t]=e,this.inflight++;const s=A;this.source.load(s,e.signal).then(A=>this.generation[s]!==i?null:this.decoder.decode(s,A,e.signal)).then(A=>{this.#vc(s,i,A?1:2,A)}).catch(()=>{this.#vc(s,i,2,null)}).finally(()=>{this.jobPageId[t]===s&&this.jobGeneration[t]===i&&(this.jobPageId[t]=-1,this.jobAbort[t]=null,this.inflight--)})}#vc(A,t,e,i){const s=this.completePageId.length,n=(this.completeTail+1)%s;n!==this.completeHead?(this.completePageId[this.completeTail]=A,this.completeGeneration[this.completeTail]=t,this.completeKind[this.completeTail]=e,this.completePayload[this.completeTail]=i,this.completeTail=n):i?.dispose()}#Cc(){const A=this.completePageId.length;for(;this.completeHead!==this.completeTail;){const t=this.completePageId[this.completeHead],e=this.completeGeneration[this.completeHead],i=this.completeKind[this.completeHead],s=this.completePayload[this.completeHead];this.completePayload[this.completeHead]=null,this.completeHead=(this.completeHead+1)%A,this.generation[t]===e&&1===this.state[t]?1===i&&s?(this.content[t]=s,this.roots[t]=s.roots):this.#Wn(t,!1):s?.dispose()}}#wc(){const A=this.budget,t=this.usage,e=this.residentPages,i=this._residentCount;for(let s=0;s<i;s++){const i=e[s];if(1!==this.state[i]||!this.roots[i])continue;const n=this.remainingUpload[i];if(0===n){this.state[i]=2;continue}const r=Math.min(n,A.maxUploadBytesPerFrame-t.uploadBytesThisFrame);r<=0||VB(A,t,r)===YB.None&&(t.uploadBytesThisFrame+=r,t.pendingUploadBytes-=r,this.remainingUpload[i]=n-r,0===this.remainingUpload[i]&&(this.state[i]=2))}}#Bc(){let A=0;for(;A<this._residentCount;){const t=this.residentPages[A];if(this.wanted(t)){A++;continue}const e=this.state[t];1!==e?2!==e?A++:this.#Wn(t):(this.#Ic(t),this.#Wn(t))}}#Ic(A){let t=this.generation[A]+1>>>0;0===t&&(t=1),this.generation[A]=t;for(let e=0;e<this.maxInflightJobs;e++)this.jobPageId[e]===A&&this.jobAbort[e]?.abort()}#mc(A){const t=this.manifest;if(!t||A>=this.staticPageCount||0===t.bundleCount)return 0;let e=this.bundleEpoch+1>>>0;0===e&&(this.bundleVisitEpoch.fill(0),e=1),this.bundleEpoch=e;let i=0,s=0;const n=t.pages,r=n.bundleStart[A],a=r+n.bundleCount[A];for(let l=r;l<a;l++){const A=t.pageBundles[l];this.bundleVisitEpoch[A]!==e&&(this.bundleVisitEpoch[A]=e,this.bundleStack[i++]=A)}const o=t.bundles;for(;i>0;){const A=this.bundleStack[--i];this.bundleScratch[s++]=A;const n=o.dependencyStart[A],r=n+o.dependencyCount[A];for(let s=n;s<r;s++){const A=t.bundleDependencies[s];this.bundleVisitEpoch[A]!==e&&(this.bundleVisitEpoch[A]=e,this.bundleStack[i++]=A)}}return s}#bc(A,t){t.compressedBytes=A.compressedBytes,t.decodedBytes=A.decodedBytes,t.scratchPeakBytes=A.scratchPeakBytes,t.uploadBytes=A.uploadBytes,t.gpuAccountedBytes=A.gpuAccountedBytes,t.gpuPreparePeakBytes=A.gpuPreparePeakBytes,t.worldSlots=A.worldSlots,t.instanceSlots=A.instanceSlots,t.activationMutations=A.activationMutations}#Sc(A){A.compressedBytes=0,A.decodedBytes=0,A.scratchPeakBytes=0,A.uploadBytes=0,A.gpuAccountedBytes=0,A.gpuPreparePeakBytes=0,A.worldSlots=0,A.instanceSlots=0,A.activationMutations=0}#Wn(A,t=!0){if(0===this.state[A])return;const e=this.roots[A];if(e){for(let A=0;A<e.length;A++){const t=e[A];t.parent&&t.parent.remove(t)}this.roots[A]=null}if(this.content[A]?.dispose(),this.content[A]=null,0!==this.state[A]){const t=this.account[A],e=this.pageCost(A),i=this.#mc(A),s=this.deltaCost;this.#bc(e,s),s.uploadBytes=this.remainingUpload[A];const n=this.columnCosts;for(let A=0;A<4;A++)this.#Sc(n[A]);n[t].worldSlots=e.worldSlots,n[t].instanceSlots=e.instanceSlots;let r=e.gpuAccountedBytes;const a=this.manifest?.bundles;if(a)for(let A=0;A<i;A++){const t=this.bundleScratch[A];r-=a.gpuAccountedBytes[t];const e=this.bundleRefCount[t];if(0===e)throw new Error(`PagePipeline bundle ${t} refCount underflow`);this.bundleRefCount[t]=e-1,e>1?(s.gpuAccountedBytes-=a.gpuAccountedBytes[t],s.gpuPreparePeakBytes-=a.gpuPreparePeakBytes[t]):n[this.bundleMandatoryL0[t]?qB.StaticL0:qB.StaticShared].gpuAccountedBytes+=a.gpuAccountedBytes[t]}if(r<0)throw new Error(`PagePipeline page ${A} has inconsistent bundle GPU cost`);n[t].gpuAccountedBytes+=r,ZB(this.usage,s);for(let A=0;A<4;A++)$B(this.columns,A,n[A])}const i=this.residentPosition[A];if(i>=0){const t=--this._residentCount;if(i!==t){const A=this.residentPages[t];this.residentPages[i]=A,this.residentPosition[A]=i}this.residentPosition[A]=-1}this.remainingUpload[A]=0,this.state[A]=0,t&&this.wanted(A)&&this.#oA(A,this.lane[A])}}function QI(){return new DOMException("The operation was aborted.","AbortError")}const EI=-1;function xI(A){const t=Math.max(1,0|A),e=64*t;return{compressedBytes:256,decodedBytes:e,scratchPeakBytes:e,uploadBytes:e,gpuAccountedBytes:e+2048,gpuPreparePeakBytes:e+2048,worldSlots:1,instanceSlots:t,activationMutations:1}}class DI{roots;mesh;capacity;#Tc=0;#Uc;#Nc;constructor(A,t,e,i){const s=Math.max(1,0|e),n=Math.max(1,0|i);this.capacity=s,this.mesh=new ba(A,t,s),this.mesh.visible=!1,this.roots=[this.mesh],this.#Uc=new Int32Array(n),this.#Uc.fill(EI),this.#Nc=new Int32Array(s),this.#Nc.fill(EI)}get liveCount(){return this.#Tc}addEntity(A,t){if(t<0||t>=this.#Uc.length)return;if(this.#Uc[t]!==EI)return;if(this.#Tc>=this.capacity)return;const e=this.#Tc++;this.#Uc[t]=e,this.#Nc[e]=t,this.mesh.visible=!0,this.#Pc()}removeEntity(A,t){if(t<0||t>=this.#Uc.length)return;const e=this.#Uc[t];if(e<0)return;const i=--this.#Tc;if(this.#Uc[t]=EI,e!==i){const A=this.#Nc[i];this.#Nc[e]=A,this.#Uc[A]=e,this.#Oc(i,e)}this.#Nc[i]=EI,0===this.#Tc&&(this.mesh.visible=!1),this.#Pc()}setPose(A,t,e,i,s){if(A<0||A>=this.#Uc.length)return;const n=this.#Uc[A];n<0||this.#Fc(n,t,e,i,s)}dispose(){this.mesh.dispose(),this.#Tc=0,this.#Uc.fill(EI),this.#Nc.fill(EI)}#Pc(){const A=Math.max(1,this.#Tc);this.mesh.count!==A&&(this.mesh.count=A,this.mesh.onChangeCallback(f.DIRTY_STRUCTURE))}#Oc(A,t){const e=this.mesh.instanceMatrix.view,i=16*A,s=16*t;for(let n=0;n<16;n++)e[s+n]=e[i+n];this.#kc()}#Fc(A,t,e,i,s){const n=Math.cos(s),r=Math.sin(s),a=this.mesh.instanceMatrix.view,o=16*A;a[o]=n,a[o+1]=0,a[o+2]=-r,a[o+3]=0,a[o+4]=0,a[o+5]=1,a[o+6]=0,a[o+7]=0,a[o+8]=r,a[o+9]=0,a[o+10]=n,a[o+11]=0,a[o+12]=t,a[o+13]=e,a[o+14]=i,a[o+15]=1,this.#kc()}#kc(){const A=this.mesh.instanceMatrix;A.isDirty||A.onChangeCallback(),this.mesh.matrixEpoch=this.mesh.matrixEpoch+1|0}}var MI=(A=>(A[A.None=0]="None",A[A.PreloadOnly=1]="PreloadOnly",A))(MI||{});function bI(A,t,e,i){let s=Math.imul(A^t,2654435761);return s=Math.imul(s^e,2246822507),Math.imul(s^i,3266489909)>>>0}const SI=Math.PI/3,vI=1e6,TI=Math.SQRT2;function UI(A){const t=new Uint8Array(4*A);return t.fill(255),t}function NI(A,t,e){A.addUpdateRange(t,e),A.isDirty||A.onChangeCallback()}function PI(A,t){const e=new Wi;return e.setAttribute("position",new Fi(A,3)),e.setAttribute("color",new Ni(t,4,!0)),e.computeBoundingBox(),e}function OI(A,t=SI,e=1080){return A>0?A*e/(2*Math.tan(.5*t)):0}function FI(A){const t=.5*A.cellSizeX,e=.5*A.cellSizeY,i=.5*A.cellSizeZ;return Math.sqrt(t*t+e*e+i*i)}function kI(A,t,e,i){const s=Math.floor((t-A.originX)/A.cellSizeX),n=Math.floor((e-A.originY)/A.cellSizeY),r=Math.floor((i-A.originZ)/A.cellSizeZ);return s<0||n<0||r<0||s>=A.countX||n>=A.countY||r>=A.countZ?-1:s+A.countX*(n+A.countY*r)}function RI(A,t){const e=A.countX,i=e*A.countY;return{ix:t%e,iy:(t/e|0)%A.countY,iz:t/i|0}}function LI(A,t){if(A.length%3!=0)throw new Error("PointChunks positions length must be a multiple of 3");const e=A.length/3|0;if(e<1)throw new Error("PointChunks needs at least one point");const i=Math.max(4,Math.min(24,Math.round(Math.sqrt(e/65536))||4));let s=1/0,n=1/0,r=1/0,a=-1/0,o=-1/0,l=-1/0;for(let C=0;C<e;C++){const t=3*C,e=A[t],i=A[t+1],c=A[t+2];e<s&&(s=e),i<n&&(n=i),c<r&&(r=c),e>a&&(a=e),i>o&&(o=i),c>l&&(l=c)}!function(A){if(!Number.isFinite(A))throw new Error("PointChunks.aabb must be finite")}(s);const c=1e-4;s-=c,n-=c,r-=c,a+=c,o+=c,l+=c;const h=Math.max(.001,a-s),u=Math.max(.001,o-n),g=Math.max(.001,l-r),d=Math.max(h,g),p=Math.max(1,Math.round(i*h/d)),f=Math.max(1,Math.round(i*g/d)),m=u>.35*d?Math.max(1,Math.round(i*u/d)):1;return{originX:s,originY:n,originZ:r,cellSizeX:h/p,cellSizeY:u/m,cellSizeZ:g/f,countX:p,countY:m,countZ:f}}function jI(A,t,e){if(A.length%3!=0)throw new Error("PointChunks.binPoints positions length must be a multiple of 3");const i=A.length/3|0,s=t??UI(i);if(s.length!==4*i)throw new Error("PointChunks.binPoints colors length must be pointCount * 4");const n=e.countX*e.countY*e.countZ,r=new Uint32Array(n);for(let h=0;h<i;h++){const t=kI(e,A[3*h],A[3*h+1],A[3*h+2]);t>=0&&r[t]++}const a=new Array(n),o=new Array(n),l=new Uint32Array(n);for(let h=0;h<n;h++){const A=r[h];0!==A&&(a[h]=new Float32Array(3*A),o[h]=new Uint8Array(4*A))}for(let h=0;h<i;h++){const t=3*h,i=kI(e,A[t],A[t+1],A[t+2]);if(i<0)continue;const n=l[i]++,r=a[i],c=o[i],u=3*n;r[u]=A[t],r[u+1]=A[t+1],r[u+2]=A[t+2];const g=4*h,d=4*n;c[d]=s[g],c[d+1]=s[g+1],c[d+2]=s[g+2],c[d+3]=s[g+3]}const c=[];for(let h=0;h<n;h++){const A=a[h],t=o[h];if(!A||!t)continue;const i=RI(e,h);c.push({id:h,ix:i.ix,iy:i.iy,iz:i.iz,positions:A,colors:t})}return c}function zI(A,t){const e=function(A){return Math.max(8,1<<32-Math.clz32(Math.max(8,2*A)-1))}(A);return!t||e>t.cap?t={cap:e,occupied:new Uint8Array(e),vx:new Int32Array(e),vy:new Int32Array(e),vz:new Int32Array(e),keep:new Int32Array(Math.max(A,t?.keep.length??0,8))}:(t.occupied.fill(0,0,e),A>t.keep.length&&(t.keep=new Int32Array(A))),{scratch:t,cap:e}}function GI(A,t){const e=Math.max(t.cellSizeX,t.cellSizeY,t.cellSizeZ),i=[];let s=Math.max(1e-4,A);for(let n=0;n<12;n++){i.push(s);const A=s*TI;if(A>e)break;s=A}return i}function YI(A,t){let e=0;for(let i=0;i<t.length&&t[i]<=A;i++)e=i+1;return e}function HI(A,t,e,i,s,n,r,a,o){const l=A<i?i-A:A>r?A-r:0,c=t<s?s-t:t>a?t-a:0,h=e<n?n-e:e>o?e-o:0;return l*l+c*c+h*h}function KI(A){const t=atob(A),e=new Uint8Array(t.length);for(let i=0;i<t.length;i++)e[i]=t.charCodeAt(i);return e}let VI=null,JI=null;const WI=Object.freeze(Object.defineProperty({__proto__:null,smaaAreaBytes:function(){return VI??=KI("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAHwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEA9QT1CPUE9Qj1CPUI9QT1CPUI9\nQj1CPUI9Qj1CPUE9Qj1CPUI9Qj1Ee0FdQlRBT0JLQklCSEFHQkZCRUJFQkRCREJEQkNBQ0JDQkNCQ0JDBH8iPSs9MD0zPTU9Nz04PTk9OT06PTo9Oz07PTs9\nPD08PTw9PD08PUB/QT1CPUE9Qj1CPUI9QT1CPUI9Qj1CPUI9Qj1CPUE9Qj1CPUI9Qj0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/AAoAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/AAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQT1BPUI9QT1CPUI9Qj1BPUI9Qj1CPUI9Qj1CPUI9QT1CPUI9Qj1CPWIgTSpIMEQzRDVENkM3QjhDOUI5\nQjpCOkI7QjtCO0E7QjxCPEI8QjwAXQxJF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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==")}},Symbol.toStringTag,{value:"Module"}));exports.AdmissionFailure=YB,exports.AmbientLight=al,exports.ArcCurve=fB,exports.ArrayCamera=Kg,exports.ArrowHelper=class extends Mi{type="ArrowHelper";line;cone;constructor(A,t,e=1,i=16776960,s,n){super();const r=s??.2*e,a=n??.2*r,o=new tp({fog:!1}),l=new vd;this.line=new cg(uw||(uw=sw(new Float32Array([0,0,0,0,1,0])),uw),o),this.cone=new Os(function(){if(gw)return gw;const A=new Sp(.5,1,5,1);return A.translate(0,-.5,0),A.computeBoundingBox(),gw=A,A}(),l),this.add(this.line),this.add(this.cone),t&&this.position.copy(t),this.setDirection(A??hw),this.setLength(e,r,a),this.setColor(i)}setDirection(A){const t=A.y;if(t>.99999)return void tw(this.quaternion,0,0,0,1);if(t<-.99999)return void tw(this.quaternion,1,0,0,0);lw.set(A.z,0,-A.x).normalize();const e=t<-1?-1:t>1?1:t;cw.setFromAxisAngle(lw,Math.acos(e)),tw(this.quaternion,cw.x,cw.y,cw.z,cw.w)}setLength(A,t=.2*A,e=.2*t){Aw(this.line.scale,1,Math.max(1e-4,A-t),1),Aw(this.cone.scale,e,t,e),Aw(this.cone.position,0,A,0)}setColor(A){_C(this.line.material.color,A),_C(this.cone.material.color,A)}dispose(){this.poolIndex<0||(ow(this.line),ow(this.cone),super.dispose())}},exports.AudioEngine=class{#Le;#Rc;#Lc;#jc;#zc=new Map;#Gc=[];#Yc=new Map;#lo=new Int32Array(32);#Hc=null;#Kc=0;#Vc=0;#Jc=0;#Wc=0;#qc=0;#Xc=-1;#Zc=0;#_c=1;#$c=0;#Ah=!1;#th=0;#eh=!1;#ih=null;#sh=null;constructor(A){this.#Rc=null==A;const t=A??new AudioContext;this.#Le=t;const e=t.createGain();e.connect(t.destination),this.#Lc=e;const i=this.#Gc;this.#jc={ctx:t,master:e,inSync:!1,gainPool:[],pannerPool:[],unlink(A){const t=A.slot;if(t<0)return;const e=i.pop();e&&e!==A&&(i[t]=e,e.slot=t),A.slot=-1}}}get volume(){return this.#Lc.gain.value}set volume(A){this.#Lc.gain.value=A>0?A:0}bind(A){if(this.#eh||this.#sh===A)return;this.#nh();const t=()=>{"suspended"===this.#Le.state&&this.#Le.resume()};A.addEventListener("pointerdown",t),A.addEventListener("keydown",t),this.#ih=t,this.#sh=A}resume(){return this.#eh?Promise.resolve():this.#Le.resume()}listen(A){this.#Hc=A,this.#Ah=!1}add(A,t){this.#zc.set(A,t)}decode(A){return this.#eh?Promise.reject(new Error("AudioEngine 已 dispose")):this.#Le.decodeAudioData(A.slice(0))}setGroupVolume(A,t){this.#rh(A).gain.value=t>0?t:0}play(A,t){if(this.#eh)throw new Error("AudioEngine 已 dispose");const e="string"==typeof A?this.#zc.get(A):A;if(!e)throw new Error(`音频不存在: ${A}`);const i=t?.playbackRate??1;if(!(i>0&&Number.isFinite(i)))throw new Error("playbackRate 必须为正数");const s=t?.offset??0;if(!(s>=0)||s>e.duration)throw new Error("offset 超出缓冲");const n=t?.follow??null,r=n?null:t?.at??null,a=null!=n||null!=r,o=new sC(this.#jc);o.buffer=e,o.loop=!0===t?.loop,o.vol=null!=t?.volume&&t.volume>0?t.volume:0===t?.volume?0:1,o.priority=null!=t?.priority&&t.priority>0?t.priority:1,o.playbackRate=i,o.detune=t?.detune??0,o.offset=s,o.loopStart=t?.loopStart??0,o.loopEnd=t?.loopEnd??0,o.positional=a,o.follow=n,o.pin=r,o.instanceId=t?.instanceId??-1,o.model="linear"===t?.distanceModel?1:"exponential"===t?.distanceModel?2:0,o.ref=null!=t?.refDistance&&t.refDistance>0?t.refDistance:1,o.rolloff=null!=t?.rolloffFactor&&t.rolloffFactor>=0?t.rolloffFactor:1,o.max=null!=t?.maxDistance&&t.maxDistance>0?t.maxDistance:1e4,o.cull2=oC(o.model,o.ref,o.rolloff,o.max,o.volume);const l=t?.duration;return o.end=null==l?e.duration:Math.min(e.duration,s+(l>0?l:0)),o.born=this.#Le.currentTime,o.group=null!=t?.group?this.#rh(t.group):null,null==n?.dirtySystem&&null==r?.dirtySystem||(o.attached=!0),o.slot=this.#Gc.length,this.#Gc.push(o),a||(o.track()?o.realize(this.#Kc,this.#Vc,this.#Jc):o.dead=!0,o.dead&&(o.releaseNodes(),o.dropAnalyser(),o.buffer=null,o.follow=null,o.pin=null,this.#jc.unlink(o))),o}sync(){if(this.#eh)return;const A=this.#Gc;let t=A.length;if(0===t)return;const e=this.#jc;e.inSync=!0;let i=0;for(let g=0;g<t;g++){const t=A[g];t.dead||!t.track()?(t.dead=!0,t.releaseNodes(),t.dropAnalyser(),t.follow=null,t.pin=null,t.buffer=null,t.slot=-1):(t.slot=i,A[i++]=t)}if(A.length=i,t=i,0===t)return void(e.inSync=!1);let s=!1;for(let g=0;g<t;g++)if(A[g].positional){s=!0;break}s&&this.#ah();const n=this.#Kc,r=this.#Vc,a=this.#Jc;let o=0;for(let g=0;g<t;g++){const t=A[g];if(!t.positional)continue;if(!(t.vol>0)){t.score=-1;continue}const e=t.x-n,i=t.y-r,s=t.z-a,l=e*e+i*i+s*s;if(t.d2=l,l>t.cull2){t.score=-1;continue}const c=l>0?Math.sqrt(l):0,h=aC(t.model,c,t.ref,t.rolloff,t.max);h<=0?t.score=-1:(t.score=t.priority*t.vol*h,o++)}const l=++this.#th,c=this.#lo;let h=0;if(o<=32)for(let g=0;g<t;g++){const t=A[g];t.positional&&t.score>=0&&(t.pick=l,c[h++]=g)}else{for(let e=0;e<t;e++){const t=A[e];if(!t.positional||t.score<0)continue;const i=t.score;if(h<32){let t=h;for(;t>0&&A[c[t-1]].score<i;)c[t]=c[t-1],t--;c[t]=e,h++}else if(i>A[c[31]].score){let t=31;for(;t>0&&A[c[t-1]].score<i;)c[t]=c[t-1],t--;c[t]=e}}for(let t=0;t<h;t++)A[c[t]].pick=l}const u=e.ctx.currentTime;for(let g=0;g<t;g++){const t=A[g];if(!t.positional){t.active||t.realize(n,r,a);continue}if(t.pick!==l){t.active&&t.releaseNodes();continue}t.active||t.realize(n,r,a);const e=t.panner;if(!e||t.dead)continue;t.placed&&!lC(t.x,t.y,t.z,t.lx,t.ly,t.lz)||(e.positionX.setValueAtTime(t.x,u),e.positionY.setValueAtTime(t.y,u),e.positionZ.setValueAtTime(t.z,u),t.lx=t.x,t.ly=t.y,t.lz=t.z,t.placed=!0);let i=0;if(h>8)for(let n=0;n<h&&!(A[c[n]].d2<t.d2&&++i>=8);n++);const s=i<8;t.hrtf!==s&&(e.panningModel=s?"HRTF":"equalpower",t.hrtf=s)}i=0;for(let g=0;g<A.length;g++){const t=A[g];t.dead?(t.releaseNodes(),t.dropAnalyser(),t.follow=null,t.pin=null,t.buffer=null,t.slot=-1):(t.slot=i,A[i++]=t)}A.length=i,e.inSync=!1}dispose(){if(this.#eh)return;this.#eh=!0,this.#nh();const A=this.#Gc;for(let t=A.length-1;t>=0;t--)A[t].stop();this.#Lc.disconnect();for(const t of this.#Yc.values())t.disconnect();this.#Yc.clear(),this.#zc.clear(),this.#jc.gainPool.length=0,this.#jc.pannerPool.length=0,this.#Hc=null,this.#Rc&&this.#Le.close()}#ah(){const A=this.#Hc;if(!A)return;if(null==A.position)return void(this.#Hc=null);const t=A.readMatrixWorld().data,e=t[12],i=t[13],s=t[14],n=t[4],r=t[5],a=t[6],o=-t[8],l=-t[9],c=-t[10];if(this.#Ah&&!lC(e,i,s,this.#Kc,this.#Vc,this.#Jc)&&!lC(o,l,c,this.#Wc,this.#qc,this.#Xc)&&!lC(n,r,a,this.#Zc,this.#_c,this.#$c))return;this.#Kc=e,this.#Vc=i,this.#Jc=s,this.#Wc=o,this.#qc=l,this.#Xc=c,this.#Zc=n,this.#_c=r,this.#$c=a,this.#Ah=!0;const h=this.#Le.listener,u=this.#Le.currentTime;h.positionX.setValueAtTime(e,u),h.positionY.setValueAtTime(i,u),h.positionZ.setValueAtTime(s,u),h.forwardX.setValueAtTime(o,u),h.forwardY.setValueAtTime(l,u),h.forwardZ.setValueAtTime(c,u),h.upX.setValueAtTime(n,u),h.upY.setValueAtTime(r,u),h.upZ.setValueAtTime(a,u)}#rh(A){let t=this.#Yc.get(A);return t||(t=this.#Le.createGain(),t.connect(this.#Lc),this.#Yc.set(A,t),t)}#nh(){const A=this.#ih,t=this.#sh;A&&t&&(t.removeEventListener("pointerdown",A),t.removeEventListener("keydown",A)),this.#ih=null,this.#sh=null}},exports.AxesHelper=class extends cg{type="AxesHelper";constructor(A=1){super(sw(new Float32Array([0,0,0,A,0,0,0,0,0,0,A,0,0,0,0,0,0,A]),new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1])),new tp({vertexColors:!0,fog:!1}))}setColors(A,t,e){const i=this.geometry.getAttribute("color"),s=i.view,n=i.stride;let r=!1;return r=pw(s,n,0,A)||r,r=pw(s,n,2,t)||r,r=pw(s,n,4,e)||r,r&&iw(i),this}dispose(){aw(this)}},exports.BGRABufferAttribute=ki,exports.BasicDepthPacking=Td,exports.Box3Helper=class extends cg{type="Box3Helper";box;constructor(A,t=16776960){super(rw(),new tp({fog:!1})),this.box=A,_C(this.material.color,t),this.update()}update(){const A=this.box;A.isEmpty()?this.visible&&(this.visible=!1):(this.visible||(this.visible=!0),A.getCenter(fw),A.getSize(mw),Aw(this.position,fw.x,fw.y,fw.z),Aw(this.scale,.5*mw.x,.5*mw.y,.5*mw.z))}dispose(){ow(this)}},exports.BoxGeometry=pp,exports.BoxHelper=class extends cg{type="BoxHelper";object;#oh=NaN;#lh=NaN;#ch=NaN;#hh=NaN;#uh=NaN;#gh=NaN;#dh=new Float32Array(16);#ph=!1;constructor(A,t=16776960){super(rw(),new tp({fog:!1})),this.object=A,_C(this.material.color,t),this.update()}update(){Sw.makeEmpty();const A=this.object;if(A&&Lw(Sw,A,this),Sw.isEmpty())return this.#oh=NaN,void(this.visible&&(this.visible=!1));this.visible||(this.visible=!0),Sw.getCenter(Tw),Sw.getSize(Uw),Uw.set(.5*Uw.x,.5*Uw.y,.5*Uw.z);const t=this.parent;let e=!0;if(t){const A=t.matrixWorld.data,i=this.#dh;if(this.#ph){for(let t=0;t<16;t++)if(i[t]!==A[t]){e=!1;break}}else e=!1;e||(this.#ph=!0,i.set(A))}else this.#ph&&(e=!1,this.#ph=!1);e&&this.#oh===Tw.x&&this.#lh===Tw.y&&this.#ch===Tw.z&&this.#hh===Uw.x&&this.#uh===Uw.y&&this.#gh===Uw.z||(this.#oh=Tw.x,this.#lh=Tw.y,this.#ch=Tw.z,this.#hh=Uw.x,this.#uh=Uw.y,this.#gh=Uw.z,Nw.compose(Tw,Rw,Uw),t&&(Pw.copy(t.matrixWorld).invert(),Nw.premultiply(Pw)),Nw.decompose(Ow,Fw,kw),Aw(this.position,Ow.x,Ow.y,Ow.z),tw(this.quaternion,Fw.x,Fw.y,Fw.z,Fw.w),Aw(this.scale,kw.x,kw.y,kw.z))}setFromObject(A){return this.object=A,this.update(),this}dispose(){ow(this)}},exports.BudgetAccount=qB,exports.BufferAttribute=vi,exports.BufferGeometry=Wi,exports.CLIP_PLANE_INACTIVE_W=1e30,exports.CachedChunkSource=class{maxBytes;maxEntries;inner;pageId;byteLength;prev;next;payloads;slotByPage;freeHead=0;lruHead=-1;lruTail=-1;usedBytes=0;usedEntries=0;hits=0;misses=0;constructor(A){const t=0|A.maxEntries,e=0|A.maxBytes;if(!Number.isSafeInteger(t)||t<=0)throw new Error("CachedChunkSource.maxEntries must be a positive safe integer");if(!Number.isSafeInteger(e)||e<=0)throw new Error("CachedChunkSource.maxBytes must be a positive safe integer");this.inner=A.inner,this.maxEntries=t,this.maxBytes=e,this.pageId=new Int32Array(t),this.byteLength=new Uint32Array(t),this.prev=new Int32Array(t),this.next=new Int32Array(t),this.payloads=new Array(t),this.slotByPage=new Map,this.pageId.fill(-1),this.prev.fill(-1),this.next.fill(-1);for(let i=0;i<t-1;i++)this.next[i]=i+1;this.next[t-1]=-1,this.freeHead=0}get byteCount(){return this.usedBytes}get entryCount(){return this.usedEntries}get hitCount(){return this.hits}get missCount(){return this.misses}async load(A,t){if(t.aborted)throw QI();const e=this.slotByPage.get(A);if(void 0!==e)return this.hits++,this.#fh(e),this.payloads[e];this.misses++;const i=await this.inner.load(A,t);if(t.aborted)throw QI();return this.#mh(A,i),i}clear(){for(;-1!==this.lruTail;)this.#Ch();this.hits=0,this.misses=0}#mh(A,t){const e=t.byteLength>>>0;if(0===e||e>this.maxBytes)return;if(this.slotByPage.has(A)){const i=this.slotByPage.get(A);return this.usedBytes-=this.byteLength[i],this.payloads[i]=t,this.byteLength[i]=e,this.usedBytes+=e,this.#fh(i),void this.#wh()}for(;(this.usedEntries>=this.maxEntries||this.usedBytes+e>this.maxBytes)&&-1!==this.lruTail;)this.#Ch();if(this.usedEntries>=this.maxEntries||this.usedBytes+e>this.maxBytes)return;if(this.freeHead<0)return;const i=this.freeHead;this.freeHead=this.next[i],this.pageId[i]=A,this.byteLength[i]=e,this.payloads[i]=t,this.slotByPage.set(A,i),this.usedBytes+=e,this.usedEntries++,this.#yh(i)}#fh(A){this.lruHead!==A&&(this.#Bh(A),this.#yh(A))}#wh(){for(;(this.usedEntries>this.maxEntries||this.usedBytes>this.maxBytes)&&-1!==this.lruTail;)this.#Ch()}#Ch(){const A=this.lruTail;if(A<0)return;const t=this.pageId[A];this.#Bh(A),this.slotByPage.delete(t),this.usedBytes-=this.byteLength[A],this.usedEntries--,this.pageId[A]=-1,this.byteLength[A]=0,this.payloads[A]=null,this.next[A]=this.freeHead,this.prev[A]=-1,this.freeHead=A}#yh(A){this.prev[A]=-1,this.next[A]=this.lruHead,this.lruHead>=0&&(this.prev[this.lruHead]=A),this.lruHead=A,this.lruTail<0&&(this.lruTail=A)}#Bh(A){const t=this.prev[A],e=this.next[A];t>=0?this.next[t]=e:this.lruHead=e,e>=0?this.prev[e]=t:this.lruTail=t,this.prev[A]=-1,this.next[A]=-1}},exports.Camera=Gg,exports.CameraHelper=class extends cg{type="CameraHelper";camera;#Ih=new qC;#Qh=new Float32Array(16);constructor(A){super(sw(new Float32Array(150),new Float32Array(150)),new tp({vertexColors:!0,fog:!1})),this.camera=A,this.setColors(16755200,16711680,43775,16777215,3355443),this.update()}setColors(A,t,e,i,s){const n=this.geometry.getAttribute("color"),r=n.view,a=n.stride;let o=!1;return o=hy(r,a,0,24,A)||o,o=hy(r,a,24,32,t)||o,o=hy(r,a,32,38,e)||o,o=hy(r,a,38,40,i)||o,o=hy(r,a,40,50,s)||o,o&&iw(n),this}update(){this.camera.onBeforeUpdate(),ZC(this,this.camera,this.#Ih);const A=this.camera.projectionMatrix.data,t=this.#Qh;let e=!0;for(let a=0;a<16;a++)if(t[a]!==A[a]){e=!1;break}if(e)return;t.set(A),jw.copy(this.camera.projectionMatrix).invert();const i=this.geometry.getAttribute("position"),s=i.view,n=i.stride;let r=!1;r=cy(s,n,Yw,-1,-1,0)||r,r=cy(s,n,Hw,1,-1,0)||r,r=cy(s,n,Kw,-1,1,0)||r,r=cy(s,n,Vw,1,1,0)||r,r=cy(s,n,Jw,-1,-1,1)||r,r=cy(s,n,Ww,1,-1,1)||r,r=cy(s,n,qw,-1,1,1)||r,r=cy(s,n,Xw,1,1,1)||r,r=cy(s,n,Zw,.7,1.1,0)||r,r=cy(s,n,_w,-.7,1.1,0)||r,r=cy(s,n,$w,0,2,0)||r,r=cy(s,n,Ay,0,0,0)||r,r=cy(s,n,ty,0,0,1)||r,r=cy(s,n,ey,-1,0,0)||r,r=cy(s,n,iy,1,0,0)||r,r=cy(s,n,sy,0,-1,0)||r,r=cy(s,n,ny,0,1,0)||r,r=cy(s,n,ry,-1,0,1)||r,r=cy(s,n,ay,1,0,1)||r,r=cy(s,n,oy,0,-1,1)||r,r=cy(s,n,ly,0,1,1)||r,r&&(iw(i),this.geometry.computeBoundingBox())}dispose(){aw(this)}},exports.CanvasTexture=class extends pt{isCanvasTexture=!0;constructor(A,t){super(A,t),!0!==t?.useMipmaps&&(this.useMipmaps=!1),!0!==t?.generateMipmaps&&(this.generateMipmaps=!1),this.usage|=GPUTextureUsage.RENDER_ATTACHMENT}},exports.CapsuleGeometry=fp,exports.CatmullRomCurve3=yB,exports.CircleGeometry=Bp,exports.ClippingMesh=class extends Mi{type="ClippingMesh";isClippingMesh=!0;pClipSetId=-1;#Eh;#BA=null;#xh=!0;#Dh=!1;switchStore(A){const t=this.worldStore;if(super.switchStore(A),t!=A){if(!t&&A){const t=A.clipPlaneMeta,e=this.#Eh,i=t.allocate(e.count);if(i<0)throw new Error("ClipPlaneMeta: slots exhausted");return this.clipSetId=i,t.write(i,e),e.isDirty=!1,t.writeState(i,{enabled:this.#xh,clipIntersection:this.#Dh}),this.#BA=()=>{t.free(i)},void d.register(this,this.#BA)}if(t&&!A){const A=this.#BA;return this.clipSetId=-1,void(A&&(A(),this.#BA=null,d.unregister(this,A)))}throw new Error("Cannot switch worldStore when worldStore is not null")}}constructor(A){super(),this.#Eh=A,this.clipSetId=-1,A.depObject={onChangeCallback:()=>{const A=this.clipSetId;if(A<0)return;const t=this.#Eh;t.isDirty=!1,this.worldStore?.clipPlaneMeta.write(A,t)}}}get planes(){return this.#Eh}set planes(A){const t=this.#Eh;t!==A&&t.setValue(A)}get enabled(){return this.#xh}set enabled(A){this.#xh=A;const t=this.clipSetId;t<0||this.worldStore?.clipPlaneMeta.writeState(t,{enabled:A})}get clipIntersection(){return this.#Dh}set clipIntersection(A){this.#Dh=A;const t=this.clipSetId;t<0||this.worldStore?.clipPlaneMeta.writeState(t,{clipIntersection:A})}resetState(){super.resetState(),this.#Eh.isDirty=!1}dispose(){const A=this.#Eh,t=this.#BA;t?(t(),this.#BA=null,d.unregister(this,t)):this.clipSetId>=0&&this.worldStore?.clipPlaneMeta.free(this.clipSetId),this.clipSetId=-1,this.pClipSetId=-1,A.depObject=null,super.dispose()}},exports.Color=P,exports.Color4=O,exports.ColorSpace=bA,exports.CompressedArrayTexture=class extends zn{isCompressedArrayTexture=!0;isArray=!0;constructor(A=[],t,e,i,s){super(A,t,e,s),this.sampler.wrapR=q.ClampToEdge,this.image.depth=i}},exports.CompressedCubeTexture=class extends zn{isCompressedCubeTexture=!0;isCube=!0;isArray=!1;isCubeTexture=!0;constructor(A,t){super(void 0,A[0].width,A[0].height,t),this.generateMipmaps=!1,this.image=A}get mipLevelCount(){return this.images?.[0]?.mipLevelCount??1}get images(){return this.image}},exports.CompressedTexture=zn,exports.ConeGeometry=Sp,exports.Controls=od,exports.CoverageCellFlags=iI,exports.CubeCamera=class extends Mi{type="CubeCamera";isCubeCamera=!0;renderTarget;activeMipmapLevel=0;cameras;constructor(A,t,e){super(),this.renderTarget=e;const i=new Array(6);for(let s=0;s<6;s++){const e=new Hg(-90,1,A,t),n=Vg[s];e.up.set(n[3],n[4],n[5]),e.lookAt(n[0],n[1],n[2]),this.add(e),i[s]=e}this.cameras=i}update(A,t){null==this.parent&&this.updateWorldMatrix(!1,!0);const e=this.renderTarget,i=this.activeMipmapLevel,s=this.cameras,n=A.currentRenderContext,r=A.device.createCommandEncoder({label:"CubeCamera"});try{A.beginCameraCopyPass(r);for(let n=0;n<6;n++)e.setActiveAttachment(n,i),A.render(t,s[n],e,{skipCommit:n>0,encoder:r});A.device.queue.submit([r.finish()])}catch(a){console.error("[CubeCamera] 捕获失败:",a);try{e.passEncoder&&e.finish()}catch{}try{r.finish()}catch{}}finally{A.endCameraCopyPass(),A.currentRenderContext=n}}},exports.CubeConvolution=class{type="CubeConvolution";#Mh;#bh=new $m;#Sh=-1;#Me=null;#vh=null;#ns="";#Th=null;#Uh=null;#Nh=0;#Ph=0;constructor(A){this.#Mh=A}process(A,t){if(!A?.isCube)throw new Error("CubeConvolution.process: source must be a cube texture");const e=this.#Mh,i=e.pipelineCache,s=e.device;A.ensureUploaded(s);const n=Math.max(0|A.width,1),r=AC(t?.size??Math.min(n,128),16,256),a=AC(t?.irradianceSize??32,8,64);this.#Oh(s,r,a),this.#bh.attach(A),this.#ve(i);const o=this.#Me??=i.createFullscreen(this.#Sh,_m,1),l=`${A.id}|${A.width}`;let c=this.#vh;c&&this.#ns===l||(c=i.createSystemBindGroup(this.#Sh,this.#bh),this.#vh=c,this.#ns=l);const h=i.getEmptyBG();this.#Fh(o,h,c,this.#Uh,0,0,0);const u=this.#Th,g=u.texture,d=Math.max(0|g.mipLevelCount,1),p=Math.max(d-1,1);for(let m=0;m<d;m++)this.#Fh(o,h,c,u,1,m,m/p);const f=this.#Uh.texture;return g.isDirty=!1,f.isDirty=!1,function(A,t){Au.set(A,t)}(g,f),g}dispose(){this.#Th?.dispose(),this.#Uh?.dispose(),this.#Th=null,this.#Uh=null,this.#Me=null,this.#vh=null,this.#ns="",this.#Sh=-1}#ve(A){this.#Sh>=0||(this.#Sh=A.registerFullscreenKind({material:this.#bh,entryWgsl:"\nstruct VsOut {\n @builtin(position) pos: vec4f,\n @location(0) uv: vec2f,\n}\n\n@vertex fn vertexMain(@builtin(vertex_index) vi: u32) -> VsOut {\n var out: VsOut;\n let x = f32(i32(vi & 1u) * 4 - 1);\n let y = f32(i32(vi >> 1u) * 4 - 1);\n out.pos = vec4f(x, y, 0.0, 1.0);\n // clip y-up / 附件 v 向下。0–1 UV 不依赖 conv.size(避免和 queue 上传绑死)。\n out.uv = vec2f(x * 0.5 + 0.5, 0.5 - y * 0.5);\n return out;\n}\n\nconst SAMPLE_N: u32 = 128u;\nconst PI: f32 = 3.14159265;\n\nfn radicalInverseVdC(bitsIn: u32) -> f32 {\n var bits = bitsIn;\n bits = (bits << 16u) | (bits >> 16u);\n bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\n bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\n bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\n bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\n return f32(bits) * 2.3283064365386963e-10;\n}\n\nfn hammersley(i: u32, n: u32) -> vec2f {\n return vec2f(f32(i) / f32(n), radicalInverseVdC(i));\n}\n\nfn faceDir(face: u32, uv: vec2f) -> vec3f {\n let st = uv * 2.0 - 1.0;\n switch face {\n case 0u: { return vec3f(1.0, -st.y, -st.x); }\n case 1u: { return vec3f(-1.0, -st.y, st.x); }\n case 2u: { return vec3f(st.x, 1.0, st.y); }\n case 3u: { return vec3f(st.x, -1.0, -st.y); }\n case 4u: { return vec3f(st.x, -st.y, 1.0); }\n default: { return vec3f(-st.x, -st.y, -1.0); }\n }\n}\n\nfn tangentFrame(n: vec3f) -> mat3x3f {\n var up = vec3f(0.0, 1.0, 0.0);\n if (abs(n.y) > 0.999) { up = vec3f(1.0, 0.0, 0.0); }\n let t = normalize(cross(up, n));\n let b = cross(n, t);\n return mat3x3f(t, b, n);\n}\n\nfn importanceGgx(xi: vec2f, roughness: f32) -> vec3f {\n let a = roughness * roughness;\n let phi = 2.0 * PI * xi.x;\n let cosT = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));\n let sinT = sqrt(max(1.0 - cosT * cosT, 0.0));\n return vec3f(cos(phi) * sinT, sin(phi) * sinT, cosT);\n}\n\nfn convolveIrradiance(n: vec3f) -> vec3f {\n let tbn = tangentFrame(n);\n var acc = vec3f(0.0);\n for (var i = 0u; i < SAMPLE_N; i++) {\n let xi = hammersley(i, SAMPLE_N);\n let cosT = sqrt(1.0 - xi.y);\n let sinT = sqrt(xi.y);\n let phi = 2.0 * PI * xi.x;\n let l = tbn * vec3f(cos(phi) * sinT, sin(phi) * sinT, cosT);\n acc += textureSampleLevel(env, envSampler, l, 0.0).rgb;\n }\n return acc / f32(SAMPLE_N);\n}\n\nfn convolveRadiance(r: vec3f, roughness: f32) -> vec3f {\n if (roughness < 0.045) {\n return textureSampleLevel(env, envSampler, r, 0.0).rgb;\n }\n let tbn = tangentFrame(normalize(r));\n var acc = vec3f(0.0);\n var wsum = 0.0;\n for (var i = 0u; i < SAMPLE_N; i++) {\n let h = tbn * importanceGgx(hammersley(i, SAMPLE_N), roughness);\n let l = normalize(2.0 * dot(r, h) * h - r);\n let ndl = max(dot(r, l), 0.0);\n if (ndl > 0.0) {\n acc += textureSampleLevel(env, envSampler, l, 0.0).rgb * ndl;\n wsum += ndl;\n }\n }\n if (wsum <= 0.0) {\n return textureSampleLevel(env, envSampler, r, 0.0).rgb;\n }\n return acc / wsum;\n}\n\n@fragment fn fragmentMain(in: VsOut) -> @location(0) vec4f {\n let dir = normalize(faceDir(u32(conv.face), in.uv));\n var rgb = vec3f(0.0);\n if (conv.mode < 0.5) {\n rgb = convolveIrradiance(dir);\n } else {\n rgb = convolveRadiance(dir, conv.roughness);\n }\n return vec4f(rgb, 1.0);\n}\n",sampleCountFixed:1}))}#Oh(A,t,e){this.#Th&&this.#Nh===t&&this.#Uh&&this.#Ph===e||(this.#Th?.dispose(),this.#Uh?.dispose(),this.#Th=tC(A,"ibl-radiance",t,!0),this.#Uh=tC(A,"ibl-irradiance",e,!1),this.#Nh=t,this.#Ph=e,this.#vh=null,this.#ns="")}#Fh(A,t,e,i,s,n,r){const a=this.#Mh.device,o=Math.max(1,i.width>>n);for(let l=0;l<6;l++){this.#bh.writeParams(a,l,s,r,o),i.setActiveAttachment(l,n);const c=a.createCommandEncoder({label:`CubeConvolution-f${l}-m${n}`}),h=i.beginRenderPass(c);h.setPipeline(A),h.setBindGroup(0,t),h.setBindGroup(1,e),h.draw(3),i.finish(),a.queue.submit([c.finish()])}}},exports.CubeTexture=jn,exports.CubicBezierCurve=BB,exports.CubicBezierCurve3=IB,exports.Curve=aB,exports.CurvePath=vB,exports.CustomLight=pl,exports.CylinderGeometry=Mp,exports.DEG2RAD=k,exports.DIRTY_FLAG_MASK=C,exports.DIRTY_TYPE_MASK=m,exports.Data3DTexture=class extends pt{isData3DTexture=!0;dimension=xA.ThreeD;constructor(A=null,t=1,e=1,i=1,s){super(null,s),this.image=Gn(this,A,t,e,i),this.sampler.magFilter=X.Nearest,this.sampler.minFilter=X.Nearest,this.sampler.wrapR=q.ClampToEdge,this.useMipmaps=!1,this.flipY=!1}},exports.DataArrayTexture=class extends pt{isDataArrayTexture=!0;isArray=!0;constructor(A=null,t=1,e=1,i=1,s){super(null,s),this.image=Gn(this,A,t,e,i),this.sampler.magFilter=X.Nearest,this.sampler.minFilter=X.Nearest,this.sampler.wrapR=q.ClampToEdge,this.useMipmaps=!1,this.flipY=!1}},exports.DataTexture=Yn,exports.DataUtils=Yy,exports.DepthTexture=Ln,exports.DirectionalLight=ll,exports.DirectionalLightHelper=class extends cg{type="DirectionalLightHelper";light;color;#Ih=new qC;constructor(A,t=1,e){super(sw(new Float32Array([-t,t,0,t,t,0,t,t,0,t,-t,0,t,-t,0,-t,-t,0,-t,-t,0,-t,t,0,0,0,0,0,0,-t])),new tp({fog:!1})),this.light=A,this.color=e,this.update()}update(){ZC(this,this.light,this.#Ih);const A=this.color;_C(this.material.color,void 0!==A?A:this.light.color)}dispose(){aw(this)}},exports.DodecahedronGeometry=Jp,exports.EMPTY_ENTITY_ID=0,exports.Earcut=Ky,exports.EdgesGeometry=class extends Wi{type="EdgesGeometry";parameters;constructor(A=null,t=1){super(),this.parameters={geometry:A,thresholdAngle:t},null!==A&&this.#jl(A,t),this.freeze()}#jl(A,t){const e=A.getAttribute("position");if(!e||0===e.count)return this.setAttribute("position",new Fi(new Float32Array(0),3)),void this.computeBoundingBox();const i=A.index,s=i?i.count:e.count,n=s-s%3,r=Math.cos(qp*t),a=new Map,o=new Float64Array(9),l=["","",""];let c=new Uint32Array(Math.min(2*n,4096)),h=0;const u=(A,t)=>{if(h+2>c.length){const A=new Uint32Array(2*c.length);A.set(c),c=A}c[h++]=A,c[h++]=t};for(let d=0;d<n;d+=3){const A=i?Xp(i,d):d,t=i?Xp(i,d+1):d+1,s=i?Xp(i,d+2):d+2;if(A<0||t<0||s<0||A>=e.count||t>=e.count||s>=e.count)continue;Zp(e,A,o,0),Zp(e,t,o,3),Zp(e,s,o,6);const n=o[0],c=o[1],h=o[2],g=o[3],p=o[4],f=o[5],m=o[6],C=o[7],w=o[8];if(l[0]=_p(n,c,h),l[1]=_p(g,p,f),l[2]=_p(m,C,w),l[0]===l[1]||l[1]===l[2]||l[2]===l[0])continue;let y=0,B=0,I=0;const Q=n-g,E=c-p,x=h-f,D=m-g,M=C-p,b=w-f;y=M*x-b*E,B=b*Q-D*x,I=D*E-M*Q;const S=y*y+B*B+I*I;if(S>0){const A=1/Math.sqrt(S);y*=A,B*=A,I*=A}const v=[A,t,s];for(let e=0;e<3;e++){const A=(e+1)%3,t=`${l[e]}_${l[A]}`,i=`${l[A]}_${l[e]}`,s=a.get(i);s?(y*s.nx+B*s.ny+I*s.nz<=r&&u(v[e],v[A]),a.set(i,null)):a.has(t)||a.set(t,{i0:v[e],i1:v[A],nx:y,ny:B,nz:I})}}for(const d of a.values())d&&u(d.i0,d.i1);const g=new Float32Array(3*h);for(let d=0;d<h;d++){Zp(e,c[d],o,0);const A=3*d;g[A]=o[0],g[A+1]=o[1],g[A+2]=o[2]}this.setAttribute("position",new Fi(g,3)),this.computeBoundingBox()}copy(A){return super.copy(A),this.parameters={...A.parameters},this}},exports.EllipseCurve=pB,exports.EntityFlags=jB,exports.EntityStore=GB,exports.Euler=U,exports.EventBridge=xd,exports.ExtrudeGeometry=Mf,exports.FXAA=class{isFXAA=!0;slot=Un.Present;needsTonemap=!0;active=!0;#kh=new rt({magFilter:X.Linear,minFilter:X.Linear,mipmapFilter:X.Nearest,wrapS:q.ClampToEdge,wrapT:q.ClampToEdge});#bh=new sc(this.#kh);#Rh=null;#Sh=-1;#Me=null;#Lh="";#jh=0;#vh=null;#zh=null;#Gh=0;#Yh=0;#Hh=null;#Kh={view:void 0,loadOp:"clear",storeOp:"store",clearValue:nc};#Vh={label:"FXAA",colorAttachments:[this.#Kh]};onDetach(){this.#Rh&&this.#Sh>=0&&this.#Rh.releaseFullscreenKind(this.#Sh),this.#Rh=null,this.#Sh=-1,this.#Me=null,this.#Lh="",this.#jh=0,this.#vh=null,this.#zh=null,this.#Gh=0,this.#Yh=0,this.#Hh=null}execute(A){const t=A.colorOut,e=A.colorIn;if(!t||!e)return;const i=A.cache,s=this.#bh;this.#zh===e&&this.#Gh===e.width&&this.#Yh===e.height||(s.attach(e),s.sync(A.device),this.#zh=e,this.#Gh=e.width,this.#Yh=e.height,this.#vh=null),this.#Rh!==i&&(this.#Rh&&this.#Sh>=0&&this.#Rh.releaseFullscreenKind(this.#Sh),this.#Rh=i,this.#Sh=-1,this.#Me=null,this.#Lh="",this.#jh=0,this.#vh=null),this.#Sh<0&&(this.#Sh=i.registerFullscreenKind({material:s,entryWgsl:"\nconst EDGE_MIN: f32 = 0.0312;\nconst EDGE_MAX: f32 = 0.125;\nconst SUBPIX: f32 = 0.75;\n\nfn luma(c: vec3f) -> f32 {\n return sqrt(dot(max(c, vec3f(0.0)), vec3f(0.299, 0.587, 0.114)));\n}\n\nfn quality(i: i32) -> f32 {\n if (i < 5) { return 1.0; }\n if (i == 5) { return 1.5; }\n if (i < 10) { return 2.0; }\n if (i == 10) { return 4.0; }\n return 8.0;\n}\n\n@fragment fn fragmentMain(@builtin(position) pos: vec4f) -> @location(0) vec4f {\n let dim = vec2f(textureDimensions(color));\n let rcp = 1.0 / max(dim, vec2f(1.0));\n let uv = pos.xy * rcp;\n\n let rgbC = textureSampleLevel(color, colorSampler, uv, 0.0);\n let lumaC = luma(rgbC.rgb);\n let lumaN = luma(textureSampleLevel(color, colorSampler, uv + vec2f(0.0, -rcp.y), 0.0).rgb);\n let lumaS = luma(textureSampleLevel(color, colorSampler, uv + vec2f(0.0, rcp.y), 0.0).rgb);\n let lumaE = luma(textureSampleLevel(color, colorSampler, uv + vec2f(rcp.x, 0.0), 0.0).rgb);\n let lumaW = luma(textureSampleLevel(color, colorSampler, uv + vec2f(-rcp.x, 0.0), 0.0).rgb);\n\n let lumaMin = min(lumaC, min(min(lumaN, lumaS), min(lumaE, lumaW)));\n let lumaMax = max(lumaC, max(max(lumaN, lumaS), max(lumaE, lumaW)));\n let lumaRange = lumaMax - lumaMin;\n if (lumaRange < max(EDGE_MIN, lumaMax * EDGE_MAX)) {\n return vec4f(rgbC.rgb, 1.0);\n }\n\n let lumaNW = luma(textureSampleLevel(color, colorSampler, uv + vec2f(-rcp.x, -rcp.y), 0.0).rgb);\n let lumaNE = luma(textureSampleLevel(color, colorSampler, uv + vec2f(rcp.x, -rcp.y), 0.0).rgb);\n let lumaSW = luma(textureSampleLevel(color, colorSampler, uv + vec2f(-rcp.x, rcp.y), 0.0).rgb);\n let lumaSE = luma(textureSampleLevel(color, colorSampler, uv + vec2f(rcp.x, rcp.y), 0.0).rgb);\n\n let edgeHorz = abs(-2.0 * lumaW + lumaSW + lumaNW)\n + abs(-2.0 * lumaC + lumaS + lumaN) * 2.0\n + abs(-2.0 * lumaE + lumaSE + lumaNE);\n let edgeVert = abs(-2.0 * lumaN + lumaNW + lumaNE)\n + abs(-2.0 * lumaC + lumaW + lumaE) * 2.0\n + abs(-2.0 * lumaS + lumaSW + lumaSE);\n let isHorz = edgeHorz >= edgeVert;\n\n let luma1 = select(lumaW, lumaS, isHorz);\n let luma2 = select(lumaE, lumaN, isHorz);\n let grad1 = luma1 - lumaC;\n let grad2 = luma2 - lumaC;\n let is1Steep = abs(grad1) >= abs(grad2);\n let gradScaled = 0.25 * max(abs(grad1), abs(grad2));\n var stepLen = select(rcp.x, rcp.y, isHorz);\n let lumaAvg = select(0.5 * (luma2 + lumaC), 0.5 * (luma1 + lumaC), is1Steep);\n if (is1Steep) { stepLen = -stepLen; }\n\n var curr = uv;\n if (isHorz) { curr.y += stepLen * 0.5; } else { curr.x += stepLen * 0.5; }\n let offset = select(vec2f(0.0, rcp.y), vec2f(rcp.x, 0.0), isHorz);\n var uv1 = curr - offset;\n var uv2 = curr + offset;\n var lumaEnd1 = luma(textureSampleLevel(color, colorSampler, uv1, 0.0).rgb) - lumaAvg;\n var lumaEnd2 = luma(textureSampleLevel(color, colorSampler, uv2, 0.0).rgb) - lumaAvg;\n var reached1 = abs(lumaEnd1) >= gradScaled;\n var reached2 = abs(lumaEnd2) >= gradScaled;\n if (!reached1) { uv1 -= offset; }\n if (!reached2) { uv2 += offset; }\n\n if (!(reached1 && reached2)) {\n for (var i = 2; i < 12; i++) {\n if (!reached1) {\n lumaEnd1 = luma(textureSampleLevel(color, colorSampler, uv1, 0.0).rgb) - lumaAvg;\n reached1 = abs(lumaEnd1) >= gradScaled;\n }\n if (!reached2) {\n lumaEnd2 = luma(textureSampleLevel(color, colorSampler, uv2, 0.0).rgb) - lumaAvg;\n reached2 = abs(lumaEnd2) >= gradScaled;\n }\n if (reached1 && reached2) { break; }\n let q = quality(i);\n if (!reached1) { uv1 -= offset * q; }\n if (!reached2) { uv2 += offset * q; }\n }\n }\n\n let dist1 = select(uv.y - uv1.y, uv.x - uv1.x, isHorz);\n let dist2 = select(uv2.y - uv.y, uv2.x - uv.x, isHorz);\n let distFinal = min(dist1, dist2);\n let thickness = dist1 + dist2;\n var pixelOff = select(0.0, -distFinal / thickness + 0.5, thickness > 0.0);\n let lumaEnd = select(lumaEnd2, lumaEnd1, dist1 < dist2);\n if ((lumaEnd < 0.0) == (lumaC < lumaAvg)) { pixelOff = 0.0; }\n\n let luma12 = (2.0 * (lumaS + lumaN + lumaW + lumaE) + lumaSW + lumaNE + lumaNW + lumaSE) * (1.0 / 12.0);\n let sub1 = clamp(abs(luma12 - lumaC) / lumaRange, 0.0, 1.0);\n let sub2 = (-2.0 * sub1 + 3.0) * sub1 * sub1;\n pixelOff = max(pixelOff, sub2 * sub2 * SUBPIX);\n\n var outUv = uv;\n if (isHorz) { outUv.y += pixelOff * stepLen; } else { outUv.x += pixelOff * stepLen; }\n let rgb = textureSampleLevel(color, colorSampler, outUv, 0.0);\n return vec4f(rgb.rgb, 1.0);\n}\n"}));let n=this.#Me;n&&this.#Lh===t.format&&this.#jh===t.sampleCount||(n=i.createFullscreen(this.#Sh,t.format,t.sampleCount),this.#Me=n,this.#Lh=t.format,this.#jh=t.sampleCount);let r=this.#vh;r||(r=i.createSystemBindGroup(this.#Sh,s),this.#vh=r);const a=this.#Kh;a.view=t.view,t.resolveTarget?a.resolveTarget=t.resolveTarget:delete a.resolveTarget;const o=A.encoder.beginRenderPass(this.#Vh);o.setPipeline(n),o.setBindGroup(0,this.#Hh??=i.getEmptyBG()),o.setBindGroup(1,r),o.draw(3),o.end()}},exports.Float16BufferAttribute=class extends vi{constructor(A,t=1,e=!1){A&&A instanceof Float16Array||(A=new Float16Array(A??0)),super(A,t,e)}},exports.Float32BufferAttribute=Fi,exports.FramebufferTexture=class extends pt{isFramebufferTexture=!0;constructor(A,t,e){super({width:A,height:t},e),this.sampler.magFilter=X.Nearest,this.sampler.minFilter=X.Nearest,this.useMipmaps=!1,this.generateMipmaps=!1,this.usage|=GPUTextureUsage.RENDER_ATTACHMENT}},exports.GLTFLoader=class extends cC{parse(A,t=""){return new IC(A,t,A=>this.fetchBuffer(A)).parse()}},exports.GPU={"unfilterable-float":"f32",depth:"",float:"f32",sint:"i32",int:"i32",uint:"u32",bool:"bool",color:"vec3<f32>",vec2:"vec2<f32>",ivec2:"vec2<i32>",uvec2:"vec2<u32>",bvec2:"vec2<bool>",vec3:"vec3<f32>",ivec3:"vec3<i32>",uvec3:"vec3<u32>",bvec3:"vec3<bool>",vec4:"vec4<f32>",ivec4:"vec4<i32>",uvec4:"vec4<u32>",bvec4:"vec4<bool>",mat2:"mat2x2<f32>",mat3:"mat3x3<f32>",mat4:"mat4x4<f32>"},exports.GPUAddressMode=q,exports.GPUBindingAccessMap=Z,exports.GPUBlendFactor={Zero:"zero",One:"one",Src:"src",OneMinusSrc:"one-minus-src",SrcAlpha:"src-alpha",OneMinusSrcAlpha:"one-minus-src-alpha",Dst:"dst",OneMinusDstColor:"one-minus-dst",DstAlpha:"dst-alpha",OneMinusDstAlpha:"one-minus-dst-alpha",SrcAlphaSaturated:"src-alpha-saturated",Constant:"constant",OneMinusConstant:"one-minus-constant",Src1:"src1",OneMinusSrc1:"one-minus-src1",Src1Alpha:"src1-alpha",OneMinusSrc1Alpha:"one-minus-src1-alpha"},exports.GPUBlendOperation={Add:"add",Subtract:"subtract",ReverseSubtract:"reverse-subtract",Min:"min",Max:"max"},exports.GPUBufferUsage=j,exports.GPUColorWriteFlags={None:0,Red:1,Green:2,Blue:4,Alpha:8,All:15},exports.GPUCompareFunction=Y,exports.GPUCompressSampleFormatMap=QA,exports.GPUCompressTextureFormatType=IA,exports.GPUCullMode={None:"none",Front:"front",Back:"back"},exports.GPUFeatureName=MA,exports.GPUFilterMode=X,exports.GPUFrontFace={CCW:"ccw",CW:"cw"},exports.GPUIndexFormat=V,exports.GPULoadOp=K,exports.GPUPrimitiveTopology=G,exports.GPUSamplerBindingType=mA,exports.GPUShaderStage=z,exports.GPUStoreOp=H,exports.GPUTextureAspect={All:"all",StencilOnly:"stencil-only",DepthOnly:"depth-only"},exports.GPUTextureDataType=yA,exports.GPUTextureDimension=xA,exports.GPUTextureFormatMap=EA,exports.GPUTextureFormatObject=W,exports.GPUTextureFormatType=wA,exports.GPUTextureSampleFormatMap=BA,exports.GPUTextureSampleType=CA,exports.GPUTextureViewDimension=DA,exports.GPUVertexFormatLib=J,exports.GPUWgslTypeLib=fA,exports.GridHelper=class extends cg{type="GridHelper";constructor(A=10,t=10,e=4473924,i=8947848){const s=Math.max(1,0|t),n=$C(e,new P),r=$C(i,new P),a=s+1,o=4*a,l=new Float32Array(3*o),c=new Float32Array(3*o),h=A/s,u=.5*A,g=.5*s;let d=0;for(let p=0;p<a;p++){const A=p*h-u;uy(l,d,-u,0,A,u,0,A),uy(l,d+2,A,0,-u,A,0,u);const t=p===g?n:r,e=t.r,i=t.g,s=t.b;for(let n=0;n<4;n++){const A=3*(d+n);c[A]=e,c[A+1]=i,c[A+2]=s}d+=4}super(sw(l,c),new tp({vertexColors:!0,fog:!1}))}dispose(){aw(this)}},exports.GridManifest=aI,exports.Group=class extends Mi{isGroup=!0;type="Group";constructor(){super()}},exports.HemisphereLight=ol,exports.HemisphereLightHelper=class extends cg{type="HemisphereLightHelper";light;color;#Jh;#Ih=new qC;#Wh=NaN;#qh=NaN;#ac=NaN;#Xh=NaN;#Zh=NaN;#_h=NaN;constructor(A,t=1,e){const i=new Float32Array(py.length);i.set(py),super(sw(i,new Float32Array(py.length)),new tp({vertexColors:!0,fog:!1})),this.light=A,this.color=e,this.#Jh=t,this.update()}update(){if(ZC(this,this.light,this.#Ih)){const A=this.scale,t=this.#Jh;Aw(A,A.x*t,A.y*t,A.z*t)}const A=this.color;if(void 0!==A?($C(A,gy),dy.copy(gy)):(gy.copy(this.light.color),dy.copy(this.light.groundColor)),this.#Wh===gy.r&&this.#qh===gy.g&&this.#ac===gy.b&&this.#Xh===dy.r&&this.#Zh===dy.g&&this.#_h===dy.b)return;this.#Wh=gy.r,this.#qh=gy.g,this.#ac=gy.b,this.#Xh=dy.r,this.#Zh=dy.g,this.#_h=dy.b;const t=this.geometry.getAttribute("color"),e=this.geometry.getAttribute("position"),i=t.view,s=e.view,n=e.stride,r=t.stride,a=e.count;let o=!1;for(let l=0;l<a;l++){const A=s[l*n+1]>=0?gy:dy;ew(i,r,l,A.r,A.g,A.b)&&(o=!0)}o&&iw(t)}dispose(){aw(this)}},exports.INPUT_IN=cd,exports.INPUT_OUT=hd,exports.INVALID_ENTITY_REF=RB,exports.INVALID_ENTITY_SLOT=kB,exports.INVALID_MANIFEST_ID=eI,exports.IcosahedronGeometry=Vf,exports.ImageUtils=a,exports.Input=bd,exports.InputSurface=Bd,exports.InstancedMesh=ba,exports.InstancedModel=class extends Mi{type="InstancedModel";isInstancedModel=!0;source;meshes;instanceMatrix;#$h;#Au;#tu;#eu;#iu;#su;#nu;#ru=-1;#au=-1;matrixEpoch=0;#hs=0;#us=0;#gs=0;#ds=0;#ps=-1;#fs=Number.NaN;#ms=Number.NaN;#Cs=Number.NaN;#ws=Number.NaN;#ou=0;#lu=0;#cu=0;#hu=0;#uu=!1;#gu=!1;#du;#pu;constructor(A,t){if(super(),A.isInstancedMesh||A.isInstancedModel)throw new Error("InstancedModel: source must not be InstancedMesh or InstancedModel");this.source=A,this.#nu=Math.max(1,0|t);const e=this.#nu,i=new Fi(new Float32Array(16*e),"mat4");i.stepMode="instance",i.skipGpu=!0,Aa(i.view,0,e),this.instanceMatrix=i,ta(i,()=>{this.matrixEpoch=this.matrixEpoch+1|0});const s=new Wi;s.setAttribute("instanceMatrix",i),this.#$h=s;const{root:n,parts:r}=function(A,t,e,i){const s=new Map,n=[],r=[],a=Lu(A,t,e,i,s,n,r);return function(A,t){const e=new Map;for(let i=0,s=t.length;i<s;i++){const{part:s,src:n}=t[i],r=n.skeleton;if(!r)continue;let a=e.get(r);if(!a){const t=r.bones,i=new Array(t.length);for(let e=0,s=t.length;e<s;e++){const s=A.get(t[e]);if(!s)throw new Error("InstancedModel: skeleton bone is outside source graph");i[e]=s}a=new Cu(i,r.inverseBindMatrices),e.set(r,a)}s.skeleton=a}}(s,r),{root:a,parts:n}}(A,s,this,e);if(0===r.length)throw new Error("InstancedModel: source has no drawable Mesh");this.#Au=r,this.meshes=r,this.#du=new Float32Array(4*r.length),this.#pu=new Uint8Array(r.length),this.add(n);const a=function(A,t){const e=new Set,i=[];for(let s=0,n=t.length;s<n;s++){let n=t[s];for(;n&&(e.has(n)||(e.add(n),i.push(n)),n!==A);)n=n.parent}return e.has(A)||i.push(A),i}(this,r),o=a.length,l=new Array(o),c=new Array(o),h=new Array(o);for(let u=0;u<o;u++)l[u]=-1,c[u]=-1,h[u]=-1;this.#tu=l,this.#eu=c,this.#iu=h,this.#su=a}get count(){return this.#nu}set count(A){this.setCount(A)}setCount(A){A=Math.max(1,0|A);const t=this.#nu;if(A===t)return;const e=this.instanceMatrix;e.resize(A),A>t&&Aa(e.view,t,A),this.#$h.getAttribute("instanceColor")?.resize(A),this.#nu=A,this.matrixEpoch=this.matrixEpoch+1|0,this.#ps=-1;const i=this.#Au;for(let s=0,n=i.length;s<n;s++)i[s].count=A,i[s].onChangeCallback(f.DIRTY_STRUCTURE)}setMatrixAt(A,t){if(A<0||A>=this.#nu)return this;const e=this.instanceMatrix;return e.view.set(t.elements,16*A),e.isDirty||e.onChangeCallback(),this.matrixEpoch=this.matrixEpoch+1|0,this}getMatrixAt(A,t){return A<0||A>=this.#nu?t.identity():t.fromArray(this.instanceMatrix.view,16*A)}expandWorldAABB(A,t){if(this.#fu(),!this.#gu)return!1;this.#mu(),Bu.set(this.#hs,this.#us,this.#gs).applyMatrix4(this.matrixWorld);const e=this.#ds*ma(this.matrixWorld.elements,0),i=Bu.x-e,s=Bu.y-e,n=Bu.z-e,r=Bu.x+e,a=Bu.y+e,o=Bu.z+e;return i<A.x&&(A.x=i),s<A.y&&(A.y=s),n<A.z&&(A.z=n),r>t.x&&(t.x=r),a>t.y&&(t.y=a),o>t.z&&(t.z=o),!0}#Cu(){const A=this.#Au,t=this.#pu,e=this.#du;for(let i=0,s=A.length;i<s;i++){const s=A[i].geometry.boundingBox;if(!s){if(0!==t[i])return!1;continue}if(1!==t[i])return!1;const n=s.center,r=4*i;if(e[r]!==n.x||e[r+1]!==n.y||e[r+2]!==n.z||e[r+3]!==n.w)return!1}return!0}#fu(){if(this.#uu&&this.#Cu())return;const A=this.#Au,t=this.#pu,e=this.#du;wu.copy(this.matrixWorld).invert();let i=0,s=0,n=0,r=-1;for(let a=0,o=A.length;a<o;a++){const o=A[a].geometry,l=o.boundingBox??o.computeBoundingBox(),c=4*a;if(!l){t[a]=0;continue}t[a]=1;const h=l.center;e[c]=h.x,e[c+1]=h.y,e[c+2]=h.z,e[c+3]=h.w,yu.multiplyMatrices(wu,A[a].matrixWorld),Iu.set(h.x,h.y,h.z).applyMatrix4(yu);const u=h.w*ma(yu.elements,0);if(r<0){i=Iu.x,s=Iu.y,n=Iu.z,r=u;continue}const g=Iu.x-i,d=Iu.y-s,p=Iu.z-n,f=Math.sqrt(g*g+d*d+p*p);if(f+u<=r)continue;if(f+r<=u){i=Iu.x,s=Iu.y,n=Iu.z,r=u;continue}const m=.5*(r+u+f);if(f>0){const A=(m-r)/f;i+=g*A,s+=d*A,n+=p*A}r=m}this.#ou=i,this.#lu=s,this.#cu=n,this.#hu=Math.max(r,0),this.#gu=r>=0,this.#uu=!0}#mu(){const A=this.#hu,t=this.#ou,e=this.#lu,i=this.#cu;if(this.#ps===this.matrixEpoch&&A===this.#fs&&t===this.#ms&&e===this.#Cs&&i===this.#ws)return;const s=this.instanceMatrix,n=ya(s.view,s.stride,s.typeInfo?.offset??0,this.#nu,t,e,i,A);this.#hs=n.cx,this.#us=n.cy,this.#gs=n.cz,this.#ds=n.cr,this.#ms=t,this.#Cs=e,this.#ws=i,this.#fs=A,this.#ps=this.matrixEpoch}get instanceColor(){return this.#$h.getAttribute("instanceColor")??null}set instanceColor(A){const t=this.#$h;if(A===t.getAttribute("instanceColor"))return;A?(A.stepMode="instance",t.setAttribute("instanceColor",A)):t.deleteAttribute("instanceColor");const e=this.#Au;for(let i=0,s=e.length;i<s;i++)e[i].onChangeCallback(f.DIRTY_STRUCTURE)}getAssetObjectByName(A){return this.getObjectByName(A)}getInternalMesh(A=0){return this.#Au[A]}raycast(A,t){this.commitDrawState();const e=this.#Au,i=!1!==A.firstHitOnly&&!0!==A.closestOnly,s=t.length;$i();try{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(ju(r,this)&&(r.raycast(A,t),i&&t.length>s))return}}finally{As()}}get visible(){return super.visible}set visible(A){super.visible=A;const t=this.#Au;if(t)for(let e=0,i=t.length;e<i;e++)t[e].visible=A}get castShadow(){const A=this.#Au,t=A.length;for(let e=0;e<t;e++)if(!A[e].castShadow)return!1;return t>0}set castShadow(A){const t=!!A,e=this.#Au;for(let i=0,s=e.length;i<s;i++)e[i].castShadow=t}commitDrawState(){const A=this.clipSetId;if(A!==this.#au){this.#au=A;const t=this.#Au;for(let e=0,i=t.length;e<i;e++){const i=t[e];i.clipSetId!==A&&(i.clipSetId=A,i.onChangeCallback(f.DIRTY_PIPELINE))}}const t=this.dirtySystem,e=t?.dirtyEpoch??-1,i=null!=t&&this.#ru<0;if(null!=t&&e===this.#ru)return!1;null!=t&&(this.#ru=e);const s=this.#su,n=s.length,r=this.#tu,a=this.#eu,o=this.#iu;let l=i;if(!l)for(let h=0;h<n;h++){const A=s[h];if(A.position.version!==r[h]||A.quaternion.version!==a[h]||A.scale.version!==o[h]){l=!0;break}}if(!l)return!1;this.#uu=!1,wu.copy(this.matrixWorld).invert();const c=this.#Au;for(let h=0,u=c.length;h<u;h++)yu.multiplyMatrices(wu,c[h].matrixWorld),c[h].setNodeBind(yu);for(let h=0;h<n;h++){const A=s[h];r[h]=A.position.version,a[h]=A.quaternion.version,o[h]=A.scale.version}return!0}},exports.Int16BufferAttribute=class extends vi{constructor(A,t=1,e=!1){A&&A instanceof Int16Array||(A=new Int16Array(A??0)),super(A,t,e)}},exports.Int32BufferAttribute=class extends vi{constructor(A,t=1,e=!1){A&&A instanceof Int32Array||(A=new Int32Array(A??0)),super(A,t,e)}},exports.Int8BufferAttribute=class extends vi{constructor(A,t=1,e=!1){A&&A instanceof Int8Array||(A=new Int8Array(A??0)),super(A,t,e)}},exports.KEY_DOWN=8,exports.KEY_LEFT=1,exports.KEY_RIGHT=2,exports.KEY_UP=4,exports.LatheGeometry=qf,exports.Light=rl,exports.LightHeaderRole=Al,exports.LightManager=ic,exports.Line=$u,exports.LineBasicMaterial=tp,exports.LineCurve=hB,exports.LineCurve3=uB,exports.LineDashedMaterial=class extends tp{type="LineDashedMaterial";isLineDashedMaterial=!0;scale;dashSize;gapSize;constructor(A){super(A),this.registerStructField("scale",new zt("scale",1,void 0,{access:"Uniform"})),this.registerStructField("dashSize",new zt("dashSize",3,void 0,{access:"Uniform"})),this.registerStructField("gapSize",new zt("gapSize",1,void 0,{access:"Uniform"})),this.setValues(A)}},exports.LineLoop=ng,exports.LineSegments=cg,exports.Loader=cC,exports.MOD_ALT=1,exports.MOD_CTRL=2,exports.MOD_META=4,exports.MOD_SHIFT=8,exports.MappedChunkSource=class{loaders;constructor(A){if(!Number.isSafeInteger(A)||A<0)throw new Error("MappedChunkSource.pageCapacity must be a non-negative safe integer");this.loaders=new Array(A),this.loaders.fill(null)}get capacity(){return this.loaders.length}setLoader(A,t){if(A<0||A>=this.loaders.length)throw new Error(`MappedChunkSource pageId ${A} out of range`);this.loaders[A]=t}load(A,t){if(A<0||A>=this.loaders.length)return Promise.reject(new Error(`MappedChunkSource unknown page ${A}`));const e=this.loaders[A];return e?t.aborted?Promise.reject(new DOMException("The operation was aborted.","AbortError")):e(A,t):Promise.reject(new Error(`MappedChunkSource page ${A} has no loader`))}},exports.Mapping=gt,exports.MaterialNode=Ng,exports.MaterialSide=Fn,exports.Matrix2=I,exports.Matrix3=Q,exports.Matrix4=v,exports.Mesh=Os,exports.MeshBasicMaterial=vd,exports.MeshDepthMaterial=class extends Ng{type="MeshDepthMaterial";isMeshDepthMaterial=!0;alphaMapTextureBinding;alphaMapSamplerBinding;get depthPacking(){const A=this.defines.get("DEPTH_PACKING");return Ld(A)?A:Td}set depthPacking(A){Ld(A)?this.defines.set("DEPTH_PACKING",A):console.warn(`MeshDepthMaterial: depthPacking ${String(A)} 无效`)}get alphaTest(){const A=this.defines.get("ALPHATEST");return"number"==typeof A&&A>0?A:0}set alphaTest(A){A>0?this.defines.set("ALPHATEST",A):this.defines.delete("ALPHATEST")}get alphaMap(){return this.alphaMapTextureBinding.getValue()}set alphaMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.alphaMapTextureBinding.setValue(A),this.alphaMapSamplerBinding.setValue(A?.sampler??null)}constructor(A){super(A,{shader:zd,isSupportFamily:!0}),this.alphaMapTextureBinding=new qt("alphaMap",A?.alphaMap??null),this.alphaMapSamplerBinding=new Wt("alphaMapSampler",A?.alphaMap?.sampler??null),this.addBinding(this.alphaMapTextureBinding),this.addBinding(this.alphaMapSamplerBinding),this.depthPacking=Td,this.setValues(A)}clone(){const A=super.clone();return A.alphaMap=this.alphaMap,A}},exports.MeshDistanceMaterial=class extends Ng{type="MeshDistanceMaterial";isMeshDistanceMaterial=!0;alphaMapTextureBinding;alphaMapSamplerBinding;referencePosition;nearDistance;farDistance;get alphaTest(){const A=this.defines.get("ALPHATEST");return"number"==typeof A&&A>0?A:0}set alphaTest(A){A>0?this.defines.set("ALPHATEST",A):this.defines.delete("ALPHATEST")}get alphaMap(){return this.alphaMapTextureBinding.getValue()}set alphaMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.alphaMapTextureBinding.setValue(A),this.alphaMapSamplerBinding.setValue(A?.sampler??null)}constructor(A){super(A,{shader:Gd,isSupportFamily:!0}),this.alphaMapTextureBinding=new qt("alphaMap",A?.alphaMap??null),this.alphaMapSamplerBinding=new Wt("alphaMapSampler",A?.alphaMap?.sampler??null),this.addBinding(this.alphaMapTextureBinding),this.addBinding(this.alphaMapSamplerBinding),this.registerStructField("referencePosition",new Yt("referencePosition",new y,void 0,{access:"Uniform"})),this.registerStructField("nearDistance",new zt("nearDistance",1,void 0,{access:"Uniform"})),this.registerStructField("farDistance",new zt("farDistance",1e3,void 0,{access:"Uniform"})),this.setValues(A)}clone(){const A=super.clone();return A.alphaMap=this.alphaMap,A}},exports.MeshLambertMaterial=class extends Ng{type="MeshLambertMaterial";isMeshLambertMaterial=!0;normalMapTextureBinding;normalMapSamplerBinding;lightMapTextureBinding;lightMapSamplerBinding;alphaMapTextureBinding;alphaMapSamplerBinding;emissive;emissiveIntensity;lightMapIntensity;get alphaTest(){const A=this.defines.get("ALPHATEST");return"number"==typeof A&&A>0?A:0}set alphaTest(A){A>0?this.defines.set("ALPHATEST",A):this.defines.delete("ALPHATEST")}get flatShading(){return 1===this.defines.get("FLAT_SHADING")}set flatShading(A){A?this.defines.set("FLAT_SHADING",1):this.defines.delete("FLAT_SHADING")}get normalMap(){return this.normalMapTextureBinding.getValue()}set normalMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.normalMapTextureBinding.setValue(A),this.normalMapSamplerBinding.setValue(A?.sampler??null)}get lightMap(){return this.lightMapTextureBinding.getValue()}set lightMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.lightMapTextureBinding.setValue(A),this.lightMapSamplerBinding.setValue(A?.sampler??null)}get alphaMap(){return this.alphaMapTextureBinding.getValue()}set alphaMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.alphaMapTextureBinding.setValue(A),this.alphaMapSamplerBinding.setValue(A?.sampler??null)}constructor(A){super(A,{shader:Yd,isSupportFamily:!0}),this.registerStructField("emissive",new Yt("emissive",void 0,void 0,{access:"Uniform"})),this.registerStructField("emissiveIntensity",new zt("emissiveIntensity",1,void 0,{access:"Uniform"})),this.registerStructField("lightMapIntensity",new zt("lightMapIntensity",1,void 0,{access:"Uniform"})),this.normalMapTextureBinding=new qt("normalMap",A?.normalMap??null),this.normalMapTextureBinding.emptySample="vec4f(0.5, 0.5, 1.0, 0.0)",this.normalMapSamplerBinding=new Wt("normalMapSampler",A?.normalMap?.sampler??null),this.addBinding(this.normalMapTextureBinding),this.addBinding(this.normalMapSamplerBinding),this.lightMapTextureBinding=new qt("lightMap",A?.lightMap??null),this.lightMapTextureBinding.emptySample="vec4f(0.0)",this.lightMapTextureBinding.texCoord=1,this.lightMapSamplerBinding=new Wt("lightMapSampler",A?.lightMap?.sampler??null),this.addBinding(this.lightMapTextureBinding),this.addBinding(this.lightMapSamplerBinding),this.alphaMapTextureBinding=new qt("alphaMap",A?.alphaMap??null),this.alphaMapSamplerBinding=new Wt("alphaMapSampler",A?.alphaMap?.sampler??null),this.addBinding(this.alphaMapTextureBinding),this.addBinding(this.alphaMapSamplerBinding),this.setValues(A)}clone(){const A=super.clone();return A.emissive=this.emissive.clone(),A.emissiveIntensity=this.emissiveIntensity,A.lightMapIntensity=this.lightMapIntensity,A.normalMap=this.normalMap,A.lightMap=this.lightMap,A.alphaMap=this.alphaMap,A}},exports.MeshMatcapMaterial=class extends Ng{type="MeshMatcapMaterial";isMeshMatcapMaterial=!0;matcapTextureBinding;matcapSamplerBinding;normalMapTextureBinding;normalMapSamplerBinding;bumpMapTextureBinding;bumpMapSamplerBinding;alphaMapTextureBinding;alphaMapSamplerBinding;normalScale;bumpScale;get alphaTest(){const A=this.defines.get("ALPHATEST");return"number"==typeof A&&A>0?A:0}set alphaTest(A){A>0?this.defines.set("ALPHATEST",A):this.defines.delete("ALPHATEST")}get flatShading(){return 1===this.defines.get("FLAT_SHADING")}set flatShading(A){A?this.defines.set("FLAT_SHADING",1):this.defines.delete("FLAT_SHADING")}get fog(){return 0!==this.defines.get("FOG")}set fog(A){A?this.defines.delete("FOG"):this.defines.set("FOG",0)}get matcap(){return this.matcapTextureBinding.getValue()}set matcap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.matcapTextureBinding.setValue(A),this.matcapSamplerBinding.setValue(A?.sampler??null)}get normalMap(){return this.normalMapTextureBinding.getValue()}set normalMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.normalMapTextureBinding.setValue(A),this.normalMapSamplerBinding.setValue(A?.sampler??null)}get bumpMap(){return this.bumpMapTextureBinding.getValue()}set bumpMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.bumpMapTextureBinding.setValue(A),this.bumpMapSamplerBinding.setValue(A?.sampler??null)}get alphaMap(){return this.alphaMapTextureBinding.getValue()}set alphaMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.alphaMapTextureBinding.setValue(A),this.alphaMapSamplerBinding.setValue(A?.sampler??null)}constructor(A){super(A,{shader:ip,isSupportFamily:!0}),this.registerStructField("normalScale",new Gt("normalScale",new w(1,1),"f32",{access:"Uniform"})),this.registerStructField("bumpScale",new zt("bumpScale",1,"f32",{access:"Uniform"})),this.matcapTextureBinding=new qt("matcap",A?.matcap??null),this.matcapTextureBinding.deferSample=!0,this.matcapSamplerBinding=new Wt("matcapSampler",A?.matcap?.sampler??null),this.addBinding(this.matcapTextureBinding),this.addBinding(this.matcapSamplerBinding),this.normalMapTextureBinding=new qt("normalMap",A?.normalMap??null),this.normalMapSamplerBinding=new Wt("normalMapSampler",A?.normalMap?.sampler??null),this.addBinding(this.normalMapTextureBinding),this.addBinding(this.normalMapSamplerBinding),this.bumpMapTextureBinding=new qt("bumpMap",A?.bumpMap??null),this.bumpMapTextureBinding.deferSample=!0,this.bumpMapSamplerBinding=new Wt("bumpMapSampler",A?.bumpMap?.sampler??null),this.addBinding(this.bumpMapTextureBinding),this.addBinding(this.bumpMapSamplerBinding),this.alphaMapTextureBinding=new qt("alphaMap",A?.alphaMap??null),this.alphaMapSamplerBinding=new Wt("alphaMapSampler",A?.alphaMap?.sampler??null),this.addBinding(this.alphaMapTextureBinding),this.addBinding(this.alphaMapSamplerBinding),this.setValues(A)}clone(){const A=super.clone();return A.normalScale=this.normalScale.clone(),A.bumpScale=this.bumpScale,A.matcap=this.matcap,A.normalMap=this.normalMap,A.bumpMap=this.bumpMap,A.alphaMap=this.alphaMap,A}},exports.MeshNormalMaterial=class extends Ng{type="MeshNormalMaterial";isMeshNormalMaterial=!0;normalMapTextureBinding;normalMapSamplerBinding;bumpMapTextureBinding;bumpMapSamplerBinding;normalScale;bumpScale;get alphaTest(){const A=this.defines.get("ALPHATEST");return"number"==typeof A&&A>0?A:0}set alphaTest(A){A>0?this.defines.set("ALPHATEST",A):this.defines.delete("ALPHATEST")}get flatShading(){return 1===this.defines.get("FLAT_SHADING")}set flatShading(A){A?this.defines.set("FLAT_SHADING",1):this.defines.delete("FLAT_SHADING")}get normalMap(){return this.normalMapTextureBinding.getValue()}set normalMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.normalMapTextureBinding.setValue(A),this.normalMapSamplerBinding.setValue(A?.sampler??null)}get bumpMap(){return this.bumpMapTextureBinding.getValue()}set bumpMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.bumpMapTextureBinding.setValue(A),this.bumpMapSamplerBinding.setValue(A?.sampler??null)}constructor(A){super(A,{shader:ep,isSupportFamily:!0}),this.registerStructField("normalScale",new Gt("normalScale",new w(1,1),"f32",{access:"Uniform"})),this.registerStructField("bumpScale",new zt("bumpScale",1,"f32",{access:"Uniform"})),this.normalMapTextureBinding=new qt("normalMap",A?.normalMap??null),this.normalMapSamplerBinding=new Wt("normalMapSampler",A?.normalMap?.sampler??null),this.addBinding(this.normalMapTextureBinding),this.addBinding(this.normalMapSamplerBinding),this.bumpMapTextureBinding=new qt("bumpMap",A?.bumpMap??null),this.bumpMapTextureBinding.deferSample=!0,this.bumpMapSamplerBinding=new Wt("bumpMapSampler",A?.bumpMap?.sampler??null),this.addBinding(this.bumpMapTextureBinding),this.addBinding(this.bumpMapSamplerBinding),this.setValues(A)}clone(){const A=super.clone();return A.normalScale=this.normalScale.clone(),A.bumpScale=this.bumpScale,A.normalMap=this.normalMap,A.bumpMap=this.bumpMap,A}},exports.MeshPhongMaterial=class extends Ng{type="MeshPhongMaterial";isMeshPhongMaterial=!0;normalMapTextureBinding;normalMapSamplerBinding;specularMapTextureBinding;specularMapSamplerBinding;lightMapTextureBinding;lightMapSamplerBinding;alphaMapTextureBinding;alphaMapSamplerBinding;specular;shininess;emissive;emissiveIntensity;lightMapIntensity;get alphaTest(){const A=this.defines.get("ALPHATEST");return"number"==typeof A&&A>0?A:0}set alphaTest(A){A>0?this.defines.set("ALPHATEST",A):this.defines.delete("ALPHATEST")}get flatShading(){return 1===this.defines.get("FLAT_SHADING")}set flatShading(A){A?this.defines.set("FLAT_SHADING",1):this.defines.delete("FLAT_SHADING")}get normalMap(){return this.normalMapTextureBinding.getValue()}set normalMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.normalMapTextureBinding.setValue(A),this.normalMapSamplerBinding.setValue(A?.sampler??null)}get specularMap(){return this.specularMapTextureBinding.getValue()}set specularMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.specularMapTextureBinding.setValue(A),this.specularMapSamplerBinding.setValue(A?.sampler??null)}get lightMap(){return this.lightMapTextureBinding.getValue()}set lightMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.lightMapTextureBinding.setValue(A),this.lightMapSamplerBinding.setValue(A?.sampler??null)}get alphaMap(){return this.alphaMapTextureBinding.getValue()}set alphaMap(A){null!=A&&A.assertCompatibleSampler(A.sampler),this.alphaMapTextureBinding.setValue(A),this.alphaMapSamplerBinding.setValue(A?.sampler??null)}constructor(A){super(A,{shader:Kd,isSupportFamily:!0}),this.registerStructField("emissive",new Yt("emissive",void 0,void 0,{access:"Uniform"})),this.registerStructField("emissiveIntensity",new zt("emissiveIntensity",1,void 0,{access:"Uniform"})),this.registerStructField("specular",new Yt("specular",new y(Hd,Hd,Hd),void 0,{access:"Uniform"})),this.registerStructField("shininess",new zt("shininess",30,void 0,{access:"Uniform"})),this.registerStructField("lightMapIntensity",new zt("lightMapIntensity",1,void 0,{access:"Uniform"})),this.normalMapTextureBinding=new qt("normalMap",A?.normalMap??null),this.normalMapTextureBinding.emptySample="vec4f(0.5, 0.5, 1.0, 0.0)",this.normalMapSamplerBinding=new Wt("normalMapSampler",A?.normalMap?.sampler??null),this.addBinding(this.normalMapTextureBinding),this.addBinding(this.normalMapSamplerBinding),this.specularMapTextureBinding=new qt("specularMap",A?.specularMap??null),this.specularMapSamplerBinding=new Wt("specularMapSampler",A?.specularMap?.sampler??null),this.addBinding(this.specularMapTextureBinding),this.addBinding(this.specularMapSamplerBinding),this.lightMapTextureBinding=new qt("lightMap",A?.lightMap??null),this.lightMapTextureBinding.emptySample="vec4f(0.0)",this.lightMapTextureBinding.texCoord=1,this.lightMapSamplerBinding=new Wt("lightMapSampler",A?.lightMap?.sampler??null),this.addBinding(this.lightMapTextureBinding),this.addBinding(this.lightMapSamplerBinding),this.alphaMapTextureBinding=new qt("alphaMap",A?.alphaMap??null),this.alphaMapSamplerBinding=new Wt("alphaMapSampler",A?.alphaMap?.sampler??null),this.addBinding(this.alphaMapTextureBinding),this.addBinding(this.alphaMapSamplerBinding),this.setValues(A)}clone(){const A=super.clone();return A.specular=this.specular.clone(),A.shininess=this.shininess,A.emissive=this.emissive.clone(),A.emissiveIntensity=this.emissiveIntensity,A.lightMapIntensity=this.lightMapIntensity,A.normalMap=this.normalMap,A.specularMap=this.specularMap,A.lightMap=this.lightMap,A.alphaMap=this.alphaMap,A}},exports.MeshPhysicalMaterial=up,exports.MeshStandardMaterial=lp,exports.MeshToonMaterial=class extends Ng{type="MeshToonMaterial";isMeshToonMaterial=!0;slots=new Map;_normalScale=new w(1,1);_aoMapIntensity=1;_bumpScale=1;_lightMapIntensity=1;emissive;emissiveIntensity;constructor(A){super(A,{shader:qd,isSupportFamily:!0}),this.registerStructField("emissive",new Yt("emissive",void 0,void 0,{access:"Uniform"})),this.registerStructField("emissiveIntensity",new zt("emissiveIntensity",1,void 0,{access:"Uniform"})),this.setValues(A)}get alphaTest(){const A=this.defines.get("ALPHATEST");return"number"==typeof A&&A>0?A:0}set alphaTest(A){A>0?this.defines.set("ALPHATEST",A):this.defines.delete("ALPHATEST")}get flatShading(){return 1===this.defines.get("FLAT_SHADING")}set flatShading(A){A?this.defines.set("FLAT_SHADING",1):this.defines.delete("FLAT_SHADING")}get fog(){return 0!==this.defines.get("FOG")}set fog(A){A?this.defines.delete("FOG"):this.defines.set("FOG",0)}get gradientMap(){return this.readSlot("gradientMap")}set gradientMap(A){this.writeSlot("gradientMap",A,A=>{A.deferSample=!0})}get emissiveMap(){return this.readSlot("emissiveMap")}set emissiveMap(A){this.writeSlot("emissiveMap",A)}get alphaMap(){return this.readSlot("alphaMap")}set alphaMap(A){this.writeSlot("alphaMap",A)}get aoMap(){return this.readSlot("aoMap")}set aoMap(A){this.writeSlot("aoMap",A,A=>{A.texCoord=1}),null!=A?this.putNum("aoMapIntensity",this._aoMapIntensity):this.dropNum("aoMapIntensity")}get aoMapIntensity(){return this.readNum("aoMapIntensity",this._aoMapIntensity)}set aoMapIntensity(A){this._aoMapIntensity=A,this.materialStruct().getField("aoMapIntensity")&&this.putNum("aoMapIntensity",A)}get bumpMap(){return this.readSlot("bumpMap")}set bumpMap(A){this.writeSlot("bumpMap",A,A=>{A.deferSample=!0}),null!=A?this.putNum("bumpScale",this._bumpScale):this.dropNum("bumpScale")}get bumpScale(){return this.readNum("bumpScale",this._bumpScale)}set bumpScale(A){this._bumpScale=A,this.materialStruct().getField("bumpScale")&&this.putNum("bumpScale",A)}get lightMap(){return this.readSlot("lightMap")}set lightMap(A){this.writeSlot("lightMap",A,A=>{A.texCoord=1}),null!=A?this.putNum("lightMapIntensity",this._lightMapIntensity):this.dropNum("lightMapIntensity")}get lightMapIntensity(){return this.readNum("lightMapIntensity",this._lightMapIntensity)}set lightMapIntensity(A){this._lightMapIntensity=A,this.materialStruct().getField("lightMapIntensity")&&this.putNum("lightMapIntensity",A)}get normalMap(){return this.readSlot("normalMap")}set normalMap(A){this.writeSlot("normalMap",A),null!=A?this.ensureNormalScale():this.dropNormalScale()}get normalScale(){return this.materialStruct().getField("normalScale")?.getValue()??this._normalScale}set normalScale(A){this._normalScale.set(Array.isArray(A)?A[0]:A.x,Array.isArray(A)?A[1]:A.y),this.materialStruct().getField("normalScale")?.setValue(this._normalScale)}copy(A){super.copy(A);const t=A;return t.isMeshToonMaterial?(this.gradientMap=t.gradientMap,this.emissiveMap=t.emissiveMap,this.normalMap=t.normalMap,this.normalScale=t.normalScale,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.alphaMap=t.alphaMap,this):this}materialStruct(){return this.getBinding("material")}readNum(A,t){const e=this.materialStruct().getField(A);return e?e.getValue():t}putNum(A,t){const e=this.materialStruct(),i=e.getField(A);i?i.setValue(t):e.addField(new zt(A,t,void 0,{access:"Uniform"}))}dropNum(A){const t=this.materialStruct();t.getField(A)&&t.removeField(A)}ensureNormalScale(){const A=this.materialStruct();A.getField("normalScale")||A.addField(new Gt("normalScale",this._normalScale.clone(),"f32",{access:"Uniform"}))}dropNormalScale(){const A=this.materialStruct();A.getField("normalScale")&&A.removeField("normalScale")}readSlot(A){const t=this.slots.get(A);return t?t.tex.getValue():null}writeSlot(A,t,e){const i=this.slots.get(A);if(null==t){if(!i)return;return this.removeBinding(i.tex),this.removeBinding(i.samp),this.slots.delete(A),void this.onChangeCallback(f.DIRTY_STRUCTURE)}if(!i){const t=new qt(A,null);e?.(t);const i=new Wt(`${A}Sampler`,null);this.addBinding(t),this.addBinding(i),this.slots.set(A,{tex:t,samp:i})}const s=this.slots.get(A);t.assertCompatibleSampler(t.sampler),s.tex.setValue(t),s.samp.setValue(t.sampler??null)}},exports.Object3D=Mi,exports.OctahedronGeometry=_f,exports.OrbitControls=class extends od{target=new y;minRadius=.35;maxRadius=8e3;minPhi=.08;maxPhi=Math.PI-.08;minTheta=-1/0;maxTheta=1/0;rotateSpeed=.008;zoomScale=wd;pinchGain=1;panSpeed=1;keyPanSpeed=6;enableRotate=!0;enableZoom=!0;enablePan=!0;enableDamping=!1;dampingFactor=.12;autoRotate=!1;autoRotateSpeed=.35;screenSpacePanning=!0;manual=!1;theta=Math.PI/4;phi=Math.PI/3;radius=4;dTheta=0;dPhi=0;dRadius=0;panX=0;panY=0;dZoom=0;heldButtons=0;heldMods=0;lastX=0;lastY=0;downX=0;downY=0;dragging=!1;wasDown=!1;inited=!1;state=0;lastObject=null;#wu=Math.PI/4;#yu=Math.PI/3;#Bu=4;#Iu=new y;constructor(A,t){super(A,t)}get camera(){return this.object}update(A=1/60){const t=this.input;if(!this.enabled)return t.consumeWheel(),t.consumePinch(),void this.resetDrag();if(this.object!==this.lastObject?(this.lastObject=this.camera,this.syncFromCamera(),this.inited=!0):this.inited||(this.syncFromCamera(),this.inited=!0),t.claimed)return t.consumeWheel(),t.consumePinch(),this.dTheta=0,this.dPhi=0,this.dRadius=0,this.dZoom=0,this.panX=0,this.panY=0,this.resetDrag(),void(this.wasDown=t.pointer.down&&0!==t.pointer.buttons);const e=t.pointer,i=e.down&&0!==e.buttons,s=this.wasDown;if(i&&!s)this.lastX=e.x,this.lastY=e.y,this.downX=e.x,this.downY=e.y,this.dragging=!1,this.heldButtons=e.buttons,this.heldMods=e.modifiers,this.state=this.pickState(e.button,e.buttons,e.modifiers),this.autoRotate||this.syncFromCamera();else if(!i&&s)this.endDrag(),this.state=0;else if(i&&(e.buttons!==this.heldButtons||e.modifiers!==this.heldMods)){this.heldButtons=e.buttons,this.heldMods=e.modifiers;const A=this.pickHeld(e.buttons,e.modifiers);A!==this.state&&(this.state=A,"touch"===e.pointerType&&(this.lastX=e.x,this.lastY=e.y),this.dragging&&this.input.setCursor(3===A?"move":2===A?"ns-resize":1===A?"grabbing":"grab"))}if(i&&(this.dragging||(e.x-this.downX)**2+(e.y-this.downY)**2>36&&this.beginDrag(),this.dragging)){const A=e.x-this.lastX,t=e.y-this.lastY;0===A&&0===t||(this.applyPointerDelta(A,t),this.lastX=e.x,this.lastY=e.y)}const n=t.consumeWheel();0!==n&&this.enableZoom&&(this.autoRotate||this.dragging||this.syncFromCamera(),this.markManual(),!0===this.camera.isOrthographicCamera?this.dZoom+=n*this.zoomScale:this.dRadius+=this.radius*(Math.exp(n*this.zoomScale)-1));const r=t.consumePinch();let a=!1;if(0!==r&&this.enableZoom){this.autoRotate||this.dragging||this.syncFromCamera();const A=Math.exp(r*this.pinchGain*(this.zoomScale/wd));if(!0===this.camera.isOrthographicCamera){const t=this.camera,e=t.zoom??1,i=yd(e/A,Cd,1e4);i!==e&&(t.zoom=i)}else 1!==A&&(this.radius=yd(this.radius*A,this.minRadius,this.maxRadius));this.markManual(),a=!0}a||this.autoRotate||this.dragging||0===this.input.keys||0!==this.dTheta||0!==this.dPhi||0!==this.dRadius||0!==this.dZoom||0!==this.panX||0!==this.panY||this.syncFromCamera();const o=this.applyKeys(A);let l=!1;if(this.autoRotate&&!this.dragging){const t=this.autoRotateSpeed*A;0!==t&&this.enableDamping&&this.dampingFactor>0&&this.dampingFactor<1?(this.theta=this.clampTheta(this.theta+t),l=!0):this.dTheta+=t}const c=this.integrate()||o||l||a;this.wasDown=i,c&&(this.apply(),this.emit("change",dd))}syncFromCamera(){const A=this.camera;let t=A.position.x,e=A.position.y,i=A.position.z;if(A.parent){A.updateWorldMatrix(!0,!1);const s=A.matrixWorld.data;t=s[12],e=s[13],i=s[14]}this.setOrbitFromOffset(t-this.target.x,e-this.target.y,i-this.target.z),this.dTheta=0,this.dPhi=0,this.dRadius=0,this.dZoom=0,this.panX=0,this.panY=0}hydrate(A,t,e,i,s,n){this.target.set(i,s,n),this.setOrbitFromOffset(A-i,t-s,e-n),this.inited=!0,this.lastObject=this.camera,this.apply()}saveState(){this.#wu=this.theta,this.#yu=this.phi,this.#Bu=this.radius,this.#Iu.copy(this.target)}reset(){this.theta=this.#wu,this.phi=this.#yu,this.radius=this.#Bu,this.target.copy(this.#Iu),this.dTheta=0,this.dPhi=0,this.dRadius=0,this.dZoom=0,this.panX=0,this.panY=0,this.apply(),this.emit("change",dd)}setManual(A){this.manual=A}dispose(){this.resetDrag(),super.dispose()}pickState(A,t,e){const i=!!(14&e);return 1===A||4&t?this.enableZoom?2:0:2===A||2&t||0===A&&i?this.enablePan?3:0:(0===A||1&t)&&this.enableRotate?1:0}pickHeld(A,t){const e=!!(14&t);return 4&A?this.enableZoom?2:0:2&A||1&A&&e?this.enablePan?3:0:1&A&&this.enableRotate?1:0}applyPointerDelta(A,t){const e=this.state;1===e&&this.enableRotate?(this.dTheta-=A*this.rotateSpeed,this.dPhi-=t*this.rotateSpeed):2===e&&this.enableZoom?!0===this.camera.isOrthographicCamera?this.dZoom+=t*this.rotateSpeed:this.dRadius+=t*this.rotateSpeed*this.radius:3===e&&this.enablePan&&(this.panX+=A,this.panY+=t)}applyKeys(A){if(!this.enablePan)return!1;const t=this.input.keys;if(0===t)return!1;const e=this.keyPanSpeed*A*60;let i=0,s=0;return 1&t&&(i+=e),2&t&&(i-=e),4&t&&(s+=e),8&t&&(s-=e),this.markManual(),!(0===i&&0===s||(this.enableDamping&&this.dampingFactor>0&&this.dampingFactor<1?(this.applyPan(i,s),0):(this.panX+=i,this.panY+=s,1)))}integrate(){const A=this.dragging&&"touch"===this.input.pointer.pointerType,t=this.enableDamping&&!A,e=t?this.dampingFactor:1,i=t?1-this.dampingFactor:0;let s=!1;if(0===this.dTheta&&0===this.dPhi&&0===this.dRadius||(this.theta=this.clampTheta(this.theta+this.dTheta*e),this.phi=this.clampPhi(this.phi+this.dPhi*e),this.radius=yd(this.radius+this.dRadius*e,this.minRadius,this.maxRadius),this.dTheta*=i,this.dPhi*=i,this.dRadius*=i,(!t||Math.abs(this.dTheta)<1e-6&&Math.abs(this.dPhi)<1e-6&&Math.abs(this.dRadius)<1e-6)&&(this.dTheta=0,this.dPhi=0,this.dRadius=0),s=!0),0!==this.panX||0!==this.panY){const A=this.panX*e,n=this.panY*e;this.applyPan(A,n),this.panX*=i,this.panY*=i,(!t||Math.abs(this.panX)<1e-4&&Math.abs(this.panY)<1e-4)&&(this.panX=0,this.panY=0),s=!0}if(0!==this.dZoom){const A=this.camera,n=A.zoom??1,r=yd(n*Math.exp(-this.dZoom*e),Cd,1e4);r!==n&&(A.zoom=r),this.dZoom*=i,(!t||Math.abs(this.dZoom)<1e-6)&&(this.dZoom=0),s=!0}return s}applyPan(A,t){const e=this.camera,i=this.input.size.cssHeight>1?this.input.size.cssHeight:480;let s,n;if(!0===e.isOrthographicCamera&&null!=e.left&&null!=e.right&&null!=e.top&&null!=e.bottom){const A=e.zoom||1,t=this.input.size.cssWidth;s=(e.right-e.left)/A/(t>1?t:i),n=(e.top-e.bottom)/A/i}else{const A=(e.fov??50)*k;s=this.radius*Math.tan(.5*A)*2/i;const t=e.zoom;null!=t&&1!==t&&(s/=t),n=s}s*=this.panSpeed,n*=this.panSpeed;const r=e.matrixWorld.data;if(this.screenSpacePanning&&s===n)return this.target.x+=(-r[0]*A+r[4]*t)*s,this.target.y+=(-r[1]*A+r[5]*t)*n,void(this.target.z+=(-r[2]*A+r[6]*t)*s);const a=A*s,o=t*n,l=r[0],c=r[1],h=r[2];let u,g,d;if(this.screenSpacePanning)u=r[4],g=r[5],d=r[6];else{const A=e.up;u=A.y*h-A.z*c,g=A.z*l-A.x*h,d=A.x*c-A.y*l}this.target.x+=-l*a+u*o,this.target.y+=-c*a+g*o,this.target.z+=-h*a+d*o}apply(){const A=Math.sin(this.phi),t=this.target,e=this.radius,i=this.camera;let s=t.x+e*A*Math.cos(this.theta),n=t.y+e*Math.cos(this.phi),r=t.z+e*A*Math.sin(this.theta);const a=i.parent;null==a||function(A){if(null!=A.parent)return!1;const t=A.position;if(0!==t.x||0!==t.y||0!==t.z)return!1;const e=A.quaternion;if(0!==e.x||0!==e.y||0!==e.z||1!==e.w)return!1;const i=A.scale;return 1===i.x&&1===i.y&&1===i.z}(a)||(md.set(s,n,r),a.worldToLocal(md),s=md.x,n=md.y,r=md.z),i.position.set(s,n,r),i.lookAt(t)}setOrbitFromOffset(A,t,e){const i=Math.hypot(A,t,e);if(!(i>=.2)){if(!(i>1e-8))return;this.radius=yd(i,this.minRadius,this.maxRadius),this.theta=this.clampTheta(Math.atan2(e,A));const s=t/i;return void(this.phi=this.clampPhi(Math.acos(s<-1?-1:s>1?1:s)))}this.radius=yd(i,this.minRadius,this.maxRadius),this.theta=this.clampTheta(Math.atan2(e,A)),this.phi=this.clampPhi(Math.acos(Math.max(-1,Math.min(1,t/Math.max(this.radius,1e-6)))))}clampPhi(A){const t=this.minPhi,e=this.maxPhi;return A<t?t:A>e?e:A}clampTheta(A){const t=this.minTheta,e=this.maxTheta;return A<t?t:A>e?e:A}beginDrag(){this.dragging=!0,this.markManual();const A=this.state;this.input.setCursor(3===A?"move":2===A?"ns-resize":"grabbing"),this.emit("start",pd)}endDrag(){this.dragging&&(this.input.setCursor("grab"),this.dragging=!1,this.emit("end",fd))}resetDrag(){this.endDrag(),this.wasDown=!1,this.state=0}markManual(){this.manual||(this.manual=!0)}},exports.OrthographicCamera=Jg,exports.POINTER_CLICK_PX2=36,exports.PageLane=yI,exports.PagePipeline=II,exports.PageState=wI,exports.Path=TB,exports.PerspectiveCamera=Hg,exports.PlanarReflection=class extends Mi{type="PlanarReflection";isPlanarReflection=!0;renderTarget;cameraP;cameraO;mesh=null;localNormal=new y(0,0,1);#Qu=0;#Eu=!1;#xu=null;constructor(A){super(),this.renderTarget=A,this.cameraP=new Hg(50,1,.1,1e3),this.cameraO=new Jg(-1,1,1,-1,.1,1e3)}setPlane(A,t,e,i){return Wg.set(A,t,e).normalize(),this.localNormal.copy(Wg),this.#Qu=i,this.#Eu=!0,this}update(A,t,e,i){if(!0===e.isArrayCamera)return;null==this.parent&&this.updateWorldMatrix(!1,!0),this.mesh?.updateWorldMatrix(!0,!1),this.#Du();const s=this.renderTarget,n=this.#xu;if(!this.#Mu())return void(n&&ed(n));const r=Wg.x,a=Wg.y,o=Wg.z,l=this.#Qu;e.updateWorldMatrix(!0,!1);const c=e.matrixWorld.elements,h=c[12],u=c[13],g=c[14],d=r*h+a*u+o*g+l;if(d<=0)return void(n&&ed(n));if(d<=.02)return;td(h,u,g,r,a,o,l,qg),td(h-c[8],u-c[9],g-c[10],r,a,o,l,Zg),function(A,t,e,i,s,n){const r=2*(A*i+t*s+e*n);Xg.set(A-r*i,t-r*s,e-r*n)}(c[4],c[5],c[6],r,a,o);const p=this.#bu(e);p.up.copy(Xg),p.position.copy(qg),p.lookAt(Zg),p.scale.set(1,1,1),p.updateWorldMatrix(!1,!1),p.dirtyTypes[0]|=f.DIRTY_MATRIX|f.DIRTY_DATA,p.updateProjectionMatrix(),n&&(_g.copy(e.matrixWorld).invert(),$g.multiplyMatrices(e.projectionMatrix,_g),n.multiplyMatrices(Ad,$g),n.isDirty||n.onChangeCallback());const m=A.currentRenderContext,C=null==i?.encoder,w=i?.encoder??A.device.createCommandEncoder({label:"PlanarReflection"});try{A.beginCameraCopyPass(w),A.render(t,p,s,{skipCommit:!0===i?.skipCommit,encoder:w}),C&&A.device.queue.submit([w.finish()])}catch(y){console.error("[PlanarReflection] 捕获失败:",y);try{s.passEncoder&&s.finish()}catch{}if(!C)throw y;try{w.finish()}catch{}}finally{A.endCameraCopyPass(),A.currentRenderContext=m}}#bu(A){const t=A;if(!0===t.isPerspectiveCamera){const A=this.cameraP;return A.fov=t.fov,A.near=t.near,A.far=t.far,A.zoom=t.zoom,A.aspect=t.aspect,A}const e=A;if(!0===e.isOrthographicCamera){const A=this.cameraO;return A.set(e.left,e.right,e.top,e.bottom,e.near,e.far),A.zoom=e.zoom,A}return this.cameraP}#Du(){const A=this.mesh?.material;if(!A)return;const t=A.getBinding("material").getField("planarProjector");if(t)return void(this.#xu=t.getValue());const e=new Jt("planarProjector",new v,"f32",{access:"Uniform"});A.registerStructField("planarProjector",e),this.#xu=e.getValue()}#Mu(){if(this.#Eu)return Wg.copy(this.localNormal),Wg.lengthSq()>0;const A=this.mesh;if(!A)return!1;const t=A.matrixWorld.elements,e=this.localNormal.x,i=this.localNormal.y,s=this.localNormal.z;return Wg.set(t[0]*e+t[4]*i+t[8]*s,t[1]*e+t[5]*i+t[9]*s,t[2]*e+t[6]*i+t[10]*s),!(Wg.lengthSq()<1e-12||(Wg.normalize(),this.#Qu=-(Wg.x*t[12]+Wg.y*t[13]+Wg.z*t[14]),0))}},exports.PlaneGeometry=$f,exports.PlaneHelper=class extends cg{type="PlaneHelper";plane;size;#We;#Su=NaN;#vu=NaN;#Tu=NaN;#Uu=NaN;#Nu=NaN;#dh=new Float32Array(16);#ph=!1;constructor(A,t=1,e=16776960){const i=new tp({fog:!1});super(Qy||(Qy=sw(new Float32Array([1,-1,0,-1,-1,0,-1,-1,0,-1,1,0,-1,1,0,1,1,0,1,1,0,1,-1,0,1,-1,0,-1,1,0,-1,-1,0,1,1,0])),Qy),i),this.plane=A,this.size=t;const s=new vd({transparent:!0,depthWrite:!1,side:Fn.Double});this.#We=new Os(Ey||(Ey=sw(new Float32Array([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0])),Ey),s),this.add(this.#We),this.#Pu(e),this.update()}setColor(A){this.#Pu(A)}update(){const A=this.plane.normal,t=this.plane.constant,e=.5*this.size,i=this.parent;let s=!0;if(i){const A=i.matrixWorld.data,t=this.#dh;if(this.#ph){for(let e=0;e<16;e++)if(t[e]!==A[e]){s=!1;break}}else s=!1;s||(this.#ph=!0,t.set(A))}else this.#ph&&(s=!1,this.#ph=!1);if(s&&this.#Su===A.x&&this.#vu===A.y&&this.#Tu===A.z&&this.#Uu===t&&this.#Nu===e)return;this.#Su=A.x,this.#vu=A.y,this.#Tu=A.z,this.#Uu=t,this.#Nu=e,fy.set(A.x,A.y,A.z),Cy.lookAt(fy,my,this.up);const n=Cy.elements;n[0]*=e,n[1]*=e,n[2]*=e,n[4]*=e,n[5]*=e,n[6]*=e,n[12]=-t*A.x,n[13]=-t*A.y,n[14]=-t*A.z,i&&(wy.copy(i.matrixWorld).invert(),Cy.premultiply(wy)),Cy.decompose(yy,By,Iy),Aw(this.position,yy.x,yy.y,yy.z),tw(this.quaternion,By.x,By.y,By.z,By.w),Aw(this.scale,Iy.x,Iy.y,Iy.z)}dispose(){if(this.poolIndex<0)return;ow(this.#We);const A=this.material;super.dispose(),A.dispose()}#Pu(A){_C(this.material.color,A);const t=this.#We.material.color;_C(t,A),.2!==t.a&&(t.a=.2)}},exports.Planes=F,exports.PointChunkSet=class{_grid=null;_voxelSize=0;_nearRange=0;_farRange=1/0;_voxelSizes=[];_pointCount=0;targetL0Points;fovY;viewportY;maxErrorPx;explicitVoxel;explicitNear;cells=[];occupied=[];sampleOut=[];voxelScratch=null;constructor(A={}){this.fovY=A.fovY??SI,this.viewportY=A.viewportY??1080,this.maxErrorPx=A.maxErrorPx??1.25,this.targetL0Points=A.targetL0Points??vI,this.explicitVoxel=A.voxelSize,this.explicitNear=A.nearRange,this._farRange=A.farRange??1/0,A.grid&&this.bindGrid(A.grid)}get grid(){if(!this._grid)throw new Error("PointChunkSet.grid not ready; ingest first");return this._grid}get voxelSize(){return this._voxelSizes[0]??this._voxelSize}get nearRange(){return this._nearRange}get farRange(){return this._farRange}get occupiedCellCount(){return this.occupied.length}get pointCount(){return this._pointCount}cellIdAt(A,t,e){return kI(this.grid,A,t,e)}cellPointCount(A){const t=this.cells[A];return t?t.counts[0]:0}geometry(A,t){const e=this.cells[A];return e?"full"===t?e.fine:this.ensureLod(e,1):null}ingest(A,t){this._grid||this.bindGrid(LI(A)),this.clearCells();const e=jI(A,t,this.grid);if(0===e.length)throw new Error("PointChunkSet.ingest produced no in-grid points");let i=0;for(let s=0;s<e.length;s++){const A=e[s],t=this.makeCell(A);this.cells[A.id]=t,this.occupied.push(t),i+=A.positions.length/3}this._pointCount=i,this.buildPyramid()}ingestSweep(A,t){this._grid||this.bindGrid(LI(A));const e=jI(A,t,this.grid);for(let i=0;i<e.length;i++){const A=e[i],t=this.cells[A.id];if(t)this._pointCount-=t.counts[0],this.replaceCellGeometry(t,A.positions,A.colors);else{const t=this.makeCell(A);this.cells[A.id]=t,this.occupied.push(t)}this._pointCount+=A.positions.length/3}0===this._voxelSizes.length&&this.buildPyramid()}writeRange(A,t,e,i){const s=this.cells[A];if(!s||e<=0)return!1;const n=s.fine.getAttribute("position"),r=s.fine.getAttribute("color"),a=n.count;if(t<0||t+e>a)return!1;if(i.positions){const A=i.positions;if(A.length<3*e)throw new Error("PointChunkSet.writeRange positions short");n.view.set(A.length===3*e?A:new Float32Array(A),3*t),NI(n,t,e),s.fine.computeBoundingBox()}if(i.colors&&r){const A=i.colors;if(A.length<4*e)throw new Error("PointChunkSet.writeRange colors short");r.view.set(A.length===4*e?A:new Uint8Array(A),4*t),NI(r,t,e)}return this.invalidateLods(s),!0}recolorCell(A,t,e,i,s=255){const n=this.cells[A];if(!n)return!1;const r=n.fine.getAttribute("color");if(!r)return!1;const a=r.view,o=r.count;for(let l=0;l<o;l++){const A=4*l;a[A]=t,a[A+1]=e,a[A+2]=i,a[A+3]=s}return NI(r,0,o),this.invalidateLods(n),!0}replaceCell(A,t,e){const i=this.cells[A];if(!i)return!1;if(t.length%3!=0)throw new Error("PointChunkSet.replaceCell positions length must be a multiple of 3");const s=t.length/3|0,n=e??UI(s);if(n.length!==4*s)throw new Error("PointChunkSet.replaceCell colors length must be pointCount * 4");return this._pointCount-=i.counts[0],this.replaceCellGeometry(i,t,n),this._pointCount+=s,!0}removePoints(A,t){const e=this.cells[A];if(!e)return!1;const i=e.fine.getAttribute("position"),s=e.fine.getAttribute("color"),n=i.count;if(0===n||0===t.length)return!1;const r=new Uint8Array(n);let a=0;for(let h=0;h<t.length;h++){const A=0|t[h];A<0||A>=n||0!==r[A]||(r[A]=1,a++)}if(0===a)return!1;const o=i.view,l=s?.view;let c=0;for(let h=0;h<n;h++)0===r[h]&&(c!==h&&(o.copyWithin(3*c,3*h,3*h+3),l&&l.copyWithin(4*c,4*h,4*h+4)),c++);return i.resize(c),s?.resize(c),NI(i,0,c),s&&NI(s,0,c),e.fine.computeBoundingBox(),this._pointCount-=a,e.counts[0]=c,this.invalidateLods(e),!0}setColor(A,t,e,i,s,n=255){const r=this.cells[A];if(!r)return!1;const a=r.fine.getAttribute("color");if(!a||t<0||t>=a.count)return!1;const o=a.view,l=4*t;return o[l]=e,o[l+1]=i,o[l+2]=s,o[l+3]=n,NI(a,t,1),this.invalidateLods(r),!0}bakeCoarse(A){const t=this.cells[A];return t?(this.ensureLod(t,1),t.counts[1]||t.counts[0]):0}sample(A,t){const e=this.occupied,i=this._voxelSizes,s=this.sampleOut;if(0===i.length||0===e.length)return s.length=0,s;const[n,r,a]="x"in(o=A)?[o.x,o.y,o.z]:[o[0],o[1],o[2]];var o;const l=t?.fovY??this.fovY,c=t?.viewportY??this.viewportY,h=t?.maxErrorPx??this.maxErrorPx,u=2*Math.tan(.5*l)/Math.max(1,c),g=this._farRange*this._farRange;let d=0;for(let p=0;p<e.length;p++){const A=e[p],t=A.fine.boundingBox;if(!t)continue;const o=HI(n,r,a,t.min.x,t.min.y,t.min.z,t.max.x,t.max.y,t.max.z);if(o>g)continue;const l=Math.max(Math.sqrt(o),1e-4)*u*h;let c=YI(l,i);const f=A.shown;if(c>f){const A=i[f];null!=A&&l<1.2*A&&(c=f)}A.shown=c,this.ensureLod(A,c);const m=0===c?A.fine:A.lods[c-1],C=0===c?"full":"coarse",w=s[d];w?(w.cellId=A.id,w.lod=C,w.lodIndex=c,w.geometry=m):s[d]={cellId:A.id,lod:C,lodIndex:c,geometry:m},d++}return s.length=d,s}dispose(){this.clearCells()}bindGrid(A){!function(A){if(!Number.isInteger(A.countX)||A.countX<1||!Number.isInteger(A.countY)||A.countY<1||!Number.isInteger(A.countZ)||A.countZ<1)throw new Error("PointChunkSet.grid counts must be positive integers")}(A),this._grid=A,this.cells=new Array(A.countX*A.countY*A.countZ),this.cells.fill(null);const t=function(A,t){const e=t.fovY??SI,i=t.viewportY??1080,s=t.targetL0Points??vI,n=FI(A);let r=t.voxelSize,a=t.nearRange;if(null==r&&null!=a)r=function(A,t=SI,e=1080){return 2*A*Math.tan(.5*t)/e}(Math.max(.001,a-n),e,i);else if(null!=r&&null==a)a=OI(r,e,i)+n;else if(null==r&&null==a){const t=Math.max(A.cellSizeX*A.countX,A.cellSizeZ*A.countZ),o=Math.max(.001,A.cellSizeY*A.countY),l=t/Math.sqrt(Math.max(1,s)),c=Math.cbrt(t*t*o/Math.max(1,s));r=Math.max(1e-4,Math.min(l,c)),a=OI(r,e,i)+n}const o=t.farRange??1/0;return{voxelSize:Math.max(1e-4,r),nearRange:Math.max(a,2*n),farRange:o<0?0:o,fovY:e,viewportY:i,targetL0Points:Math.max(1,0|s)}}(A,{voxelSize:this.explicitVoxel,nearRange:this.explicitNear,fovY:this.fovY,viewportY:this.viewportY,targetL0Points:this.targetL0Points,farRange:this._farRange===1/0?void 0:this._farRange});this._voxelSize=t.voxelSize,this._nearRange=t.nearRange,this._farRange=t.farRange,null==this.explicitVoxel&&null==this.explicitNear||(this._voxelSizes=GI(t.voxelSize,A))}buildPyramid(){const A=this.grid,t=this.explicitVoxel??2*function(A,t){const e=Math.max(1,t),i=Math.max(1e-6,A.cellSizeX*A.countX),s=Math.max(1e-6,A.cellSizeY*A.countY),n=Math.max(1e-6,A.cellSizeZ*A.countZ),r=Math.sqrt(i*n/e),a=Math.cbrt(i*s*n/e);return Math.max(1e-4,Math.min(r,a))}(A,this._pointCount);this._voxelSize=t,this._voxelSizes=GI(t,A),null==this.explicitNear&&(this._nearRange=OI(t,this.fovY,this.viewportY)+FI(A))}makeCell(A){const t=A.positions.length/3|0,e=new Uint32Array(13);return e[0]=t,{id:A.id,ix:A.ix,iy:A.iy,iz:A.iz,generation:1,fine:PI(A.positions,A.colors),lods:new Array(12).fill(null),lodGen:new Uint32Array(12),counts:e,shown:0}}ensureLod(A,t){if(t<=0)return A.fine;const e=t-1,i=A.lods[e];if(i&&A.lodGen[e]===A.generation)return i;t>1&&this.ensureLod(A,t-1);const s=1===t?A.fine:A.lods[e-1],n=this._voxelSizes[e],r=s.getAttribute("position"),a=s.getAttribute("color"),o=r.view,l=a.view,c=r.count,h=this.grid,u=function(A,t,e,i,s,n,r){if(t<=0)return{count:0,scratch:r??zI(1).scratch};const{scratch:a,cap:o}=zI(t,r),l=a.occupied,c=a.vx,h=a.vy,u=a.vz,g=a.keep,d=o-1;let p=0;for(let f=0;f<t;f++){const t=3*f,r=Math.floor((A[t]-i)/e),a=Math.floor((A[t+1]-s)/e),o=Math.floor((A[t+2]-n)/e);let m=(Math.imul(r,2654435761)^Math.imul(a,2246822507)^Math.imul(o,3266489909))>>>0&d;for(;;){if(0===l[m]){l[m]=1,c[m]=r,h[m]=a,u[m]=o,g[p++]=f;break}if(c[m]===r&&h[m]===a&&u[m]===o)break;m=m+1&d}}return 0===p&&(g[0]=0,p=1),{count:p,scratch:a}}(o,c,n,h.originX,h.originY,h.originZ,this.voxelScratch??void 0);this.voxelScratch=u.scratch;const g=u.count,d=u.scratch.keep;let p=i;p||(p=PI(new Float32Array(3*Math.max(1,g)),new Uint8Array(4*Math.max(1,g))),A.lods[e]=p);const f=p.getAttribute("position"),m=p.getAttribute("color");g>f.capacity&&(f.resize(g),m.resize(g));const C=f.view,w=m.view;for(let y=0;y<g;y++){const A=d[y],t=3*y,e=3*A;C[t]=o[e],C[t+1]=o[e+1],C[t+2]=o[e+2];const i=4*y,s=4*A;w[i]=l[s],w[i+1]=l[s+1],w[i+2]=l[s+2],w[i+3]=l[s+3]}return f.count!==g&&f.resize(g),m.count!==g&&m.resize(g),NI(f,0,g),NI(m,0,g),p.computeBoundingBox(),A.lodGen[e]=A.generation,A.counts[t]=g,p}invalidateLods(A){A.generation++,A.lodGen.fill(0),A.shown=0,A.counts[0]=A.fine.getAttribute("position").count}replaceCellGeometry(A,t,e){const i=A.fine.getAttribute("position"),s=A.fine.getAttribute("color"),n=t.length/3|0;n>i.capacity&&i.resize(n),i.view.set(t),i.count!==n&&i.resize(n),NI(i,0,n),s&&(n>s.capacity&&s.resize(n),s.view.set(e),s.count!==n&&s.resize(n),NI(s,0,n)),A.fine.computeBoundingBox(),A.counts[0]=n,this.invalidateLods(A)}clearCells(){for(let A=0;A<this.occupied.length;A++){const t=this.occupied[A];t.fine.dispose();for(let A=0;A<t.lods.length;A++)t.lods[A]?.dispose();this.cells[t.id]=null}this.occupied.length=0,this._pointCount=0,this.sampleOut.length=0}},exports.PointLight=hl,exports.PointLightHelper=class extends Os{type="PointLightHelper";light;color;#Ou;#Ih=new qC;constructor(A,t=1,e){super(xy||(xy=new um(1,4,2),xy),new vd({wireframe:!0,side:Fn.Double})),this.light=A,this.color=e,this.#Ou=t,this.update()}update(){if(ZC(this,this.light,this.#Ih)){const A=this.scale,t=this.#Ou;Aw(A,A.x*t,A.y*t,A.z*t)}const A=this.color;_C(this.material.color,void 0!==A?A:this.light.color)}dispose(){ow(this)}},exports.PointerInteraction=class{#xh=!0;#Fu=!1;#ku=!1;objects=null;get enabled(){return this.#xh}set enabled(A){A!==this.#xh&&(this.#xh=A,A&&this.#Fu&&(this.hoverNx=Number.NaN,this.hoverNy=Number.NaN))}get hover(){return this.#Fu}set hover(A){A!==this.#Fu&&(this.#Fu=A,A?(this.#ku=!1,this.hoverNx=Number.NaN,this.hoverNy=Number.NaN):this.#ku=!0)}input;root;camera;ray=new gu;wasDown=!1;downX=0;downY=0;downObj=null;downInst;downHit=null;downLeft=!1;dragging=!1;hoverObj=null;hoverInst;hoverNx=Number.NaN;hoverNy=Number.NaN;stopped=!1;lastClickAt=0;lastClickObj=null;lastClickInst;downCancel=0;planeY=0;grabOffX=0;grabOffY=0;grabOffZ=0;#Ru=new y;#Lu=new y;#ju=new y;#zu=0;#Gu={type:"",object:null,point:null,distance:0,nx:0,ny:0,button:0,buttons:0,modifiers:0,stopPropagation:()=>{this.stopped=!0}};constructor(A,t,e){this.input=A,this.root=t,this.camera=e}update(){if(this.#Yu(),!this.enabled)return this.input.claimed=!1,this.wasDown=!1,this.downObj=null,this.downInst=void 0,this.downHit=null,this.downLeft=!1,this.dragging=!1,void this.#Hu();const A=this.input.pointer,t=A.down&&0!==A.buttons,e=this.wasDown;if(t&&!e){this.downX=A.x,this.downY=A.y,this.dragging=!1,this.downLeft=!!(1&A.buttons),this.downCancel=A.abort??0;const t=this.pick();this.downObj=t?.object??null,this.downInst=t?.instanceId,this.downHit=t??null,this.hoverNx=A.nx,this.hoverNy=A.ny,t&&(this.bindDragPlane(t),this.dispatch("pointerdown",t)),this.hover&&this.syncHover(t,!1)}else if(!t&&e)this.#Ku(!0);else if(!t||!this.downLeft||1&A.buttons||"touch"!==A.pointerType)if(t&&this.downObj&&this.downLeft){const t=(A.x-this.downX)**2+(A.y-this.downY)**2;if(!this.dragging&&t>36&&(this.dragging=!0,this.claimsDrag(this.downObj)&&(this.input.claimed=!0),this.downHit&&(this.projectDrag(this.downHit),this.dispatch("dragstart",this.downHit))),A.nx!==this.hoverNx||A.ny!==this.hoverNy)if(this.hoverNx=A.nx,this.hoverNy=A.ny,this.dragging&&this.downHit&&(this.projectDrag(this.downHit),this.dispatch("drag",this.downHit)),this.hover)this.syncHover(this.pick(),!this.dragging);else if(!this.dragging){const A=this.pick();A&&this.dispatch("pointermove",A)}}else!this.hover||A.nx===this.hoverNx&&A.ny===this.hoverNy||(this.hoverNx=A.nx,this.hoverNy=A.ny,this.syncHover(this.pick(),!0));else this.#Ku(!1);this.wasDown=t,this.#Yu()}#Ku(A){const t=this.input.pointer,e=A?this.pick():void 0;this.hoverNx=t.nx,this.hoverNy=t.ny;const i=this.downHit;this.dragging&&i&&(A&&this.projectDrag(i),this.dispatch("dragend",i)),A&&e?this.dispatch("pointerup",e):i&&this.dispatch("pointerup",i);const s=this.downObj,n=(t.x-this.downX)**2+(t.y-this.downY)**2,r=(t.abort??0)!==this.downCancel;if(A&&!this.dragging&&!r&&s&&e&&e.object===s&&e.instanceId===this.downInst&&n<=36&&this.downLeft){this.dispatch("click",e);const A=performance.now();s===this.lastClickObj&&e.instanceId===this.lastClickInst&&A-this.lastClickAt<=400?(this.dispatch("dblclick",e),this.lastClickObj=null,this.lastClickInst=void 0,this.lastClickAt=0):(this.lastClickObj=s,this.lastClickInst=e.instanceId,this.lastClickAt=A)}this.downObj=null,this.downInst=void 0,this.downHit=null,this.downLeft=!1,this.dragging=!1,this.input.claimed=!1,A?this.syncHover(e,!1):this.#Hu()}pick(){const A=this.input.pointer;this.ray.setFromCamera(A.nx,A.ny,this.camera);const t=this.objects;return(null==t?this.ray.intersectObject(this.root):Array.isArray(t)?this.ray.intersectObjects(t):this.ray.intersectObject(t))[0]}claimsDrag(A){let t=A;for(;t;){if(li(t,"drag")||li(t,"dragstart"))return!0;t=t.parent}return!1}bindDragPlane(A){const t=A.point,e=A.object.getWorldPosition(this.#Lu);this.planeY=t.y,this.grabOffX=e.x-t.x,this.grabOffY=e.y-t.y,this.grabOffZ=e.z-t.z}projectDrag(A){this.ray.setFromCamera(this.input.pointer.nx,this.input.pointer.ny,this.camera);const t=this.ray.ray.origin,e=this.ray.ray.direction;if(Math.abs(e.y)<1e-8)return;const i=(this.planeY-t.y)/e.y;if(i<0||i>this.ray.far)return;const s=this.#Ru;s.set(t.x+e.x*i+this.grabOffX,this.planeY+this.grabOffY,t.z+e.z*i+this.grabOffZ);const n=A.object.parent;n&&n.worldToLocal(s),A.point=s,A.distance=i}syncHover(A,t){if(!this.hover)return;const e=A?.object??null,i=A?.instanceId,s=this.hoverObj;if(s!==e||this.hoverInst!==i){const t=this.hoverInst;s&&(this.hoverObj=null,this.hoverInst=void 0,this.#Vu(s,t)),A&&this.#Fu&&(this.#Ju(A),this.hoverObj=A.object,this.hoverInst=i,this.dispatch("pointerenter",A))}else A&&(this.#Ju(A),t&&this.dispatch("pointermove",A))}#Yu(){this.#ku&&(this.#ku=!1,this.#Fu||this.#Hu())}#Hu(){const A=this.hoverObj;if(!A)return;const t=this.hoverInst;this.hoverObj=null,this.hoverInst=void 0,this.#Vu(A,t)}#Vu(A,t){this.dispatch("pointerleave",{object:A,point:this.#ju,distance:this.#zu,instanceId:t})}#Ju(A){this.#ju.copy(A.point),this.#zu=A.distance}dispatch(A,t){const e=this.#Gu,i=this.input.pointer;e.type=A,e.object=t.object,e.point=t.point,e.distance=t.distance,e.instanceId=t.instanceId,e.nx=i.nx,e.ny=i.ny,e.button=i.button,e.buttons=i.buttons,e.modifiers=i.modifiers,this.stopped=!1;let s=t.object;for(;s;){if(oi(s,A,e),this.stopped)return;s=s.parent}}},exports.Points=hg,exports.Points2=class extends ba{type="Points2";isPoints2=!0;#Wu;#qu;#Xu;#Zu=!1;#_u=null;#$u=null;#Ag=!1;constructor(A=new Wi,t,e){const i=A.getAttribute("position"),s=e??(i?i.count:0);super(function(){const A=new Wi;return A.setAttribute("position",new Fi(new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),3)),A.setAttribute("uv",new Fi(new Float32Array([0,0,1,0,1,1,0,1]),2)),A.setIndex(new Oi(new Uint32Array([0,1,2,0,2,3]),1)),A.computeBoundingBox(),A.freeze(),A}(),t??new Og,Math.max(1,0|s)),this.#Wu=A,this.#qu={onChangeCallback:()=>{this.#tg()}},this.#Xu=new WeakRef(this.#qu),this.#eg(),this.#tg()}get sourceGeometry(){return this.#Wu}setSourceGeometry(A,t){this.#ig(),this.#Wu=A;const e=A.getAttribute("position"),i=t??(e?e.count:0);i>0&&i!==this.count&&this.setCount(i),this.#eg(),this.#tg()}syncFromSource(){this.#tg()}expandWorldAABB(A,t){const e=this.#Wu.boundingBox??this.#Wu.computeBoundingBox();if(!e)return!1;const i=e.center,s=this.matrixWorld;kg.set(i.x,i.y,i.z).applyMatrix4(s);const n=i.w*s.getMaxScaleOnAxis(),r=kg.elements,a=r[0]-n,o=r[1]-n,l=r[2]-n,c=r[0]+n,h=r[1]+n,u=r[2]+n;return a<A.x&&(A.x=a),o<A.y&&(A.y=o),l<A.z&&(A.z=l),c>t.x&&(t.x=c),h>t.y&&(t.y=h),u>t.z&&(t.z=u),!0}raycast(A,t){null!=this.material&&Rg(this,this.#Wu,A,t)}_computeIntersections(A,t,e,i){Rg(this,this.#Wu,A,t)}#eg(){this.#Zu||(this.#Wu.depObjects.add(this.#Xu),this.#Zu=!0,this.#sg())}#ig(){if(!this.#Zu)return;this.#Wu.depObjects.delete(this.#Xu);const A=this.#Xu;this.#_u?.depObjects?.delete?.(A),this.#$u?.depObjects?.delete?.(A),this.#_u=null,this.#$u=null,this.#Zu=!1}#sg(){const A=this.#Xu,t=this.#Wu.getAttribute("position")??null,e=this.#Wu.getAttribute("color")??null;t!==this.#_u&&(this.#_u?.depObjects?.delete?.(A),t?.depObjects?.add?.(A),this.#_u=t),e!==this.#$u&&(this.#$u?.depObjects?.delete?.(A),e?.depObjects?.add?.(A),this.#$u=e)}#tg(){if(!this.#Ag){this.#Ag=!0;try{const A=this.#Wu.getAttribute("position");if(!A||A.count<=0)return this.#sg(),void this.#ng();const t=A.count;t!==this.count&&this.setCount(t);const e=this.instanceMatrix.view,i=A.view,s=A.stride,n=A.typeInfo?.offset??0;for(let r=0;r<t;r++){const A=16*r,t=n+r*s;e[A+12]=i[t],e[A+13]=i[t+1],e[A+14]=i[t+2]}this.instanceMatrix.isDirty||this.instanceMatrix.onChangeCallback(),this.#ng(),this.#sg()}finally{this.#Ag=!1}}}#ng(){const A=this.#Wu,t=A.getAttribute("color"),e=A.getAttribute("position")?.count??0;if(!t||e<=0)return void(this.instanceColor&&(this.instanceColor=null));let i=this.instanceColor;(!i||i.count<e)&&(i=new Fi(new Float32Array(3*e),3),this.instanceColor=i);const s=i.view,n=t.view,r=t.stride,a=t.typeInfo?.offset??0,o=t.typeInfo.elements,l=3*e;if(o>=3&&3===r&&0===a)if(n.length===l)s.set(n);else for(let c=0;c<l;c++)s[c]=n[c];else for(let c=0;c<e;c++){const A=a+c*r,t=3*c;if(o>=3)s[t]=n[A],s[t+1]=n[A+1],s[t+2]=n[A+2];else{const e=n[A];s[t]=e,s[t+1]=e,s[t+2]=e}}i.isDirty||i.onChangeCallback()}dispose(){this.#ig();const A=this.geometry;super.dispose(),A.dispose()}},exports.PointsMaterial=dp,exports.PointsMaterial2=Og,exports.PolarGridHelper=class extends cg{type="PolarGridHelper";constructor(A=10,t=16,e=8,i=64,s=4473924,n=8947848){const r=Math.max(0,0|t),a=Math.max(0,0|e),o=Math.max(0,0|i),l=$C(s,new P),c=$C(n,new P),h=r>1?2*r:0,u=o>0?a*o*2:0,g=new Float32Array(3*(h+u)),d=new Float32Array(3*(h+u));let p=0;if(r>1)for(let f=0;f<r;f++){const t=f/r*Dy,e=Math.sin(t)*A,i=Math.cos(t)*A,s=3*p;g[s]=0,g[s+1]=0,g[s+2]=0,g[s+3]=e,g[s+4]=0,g[s+5]=i,My(d,p,1&f?l:c),My(d,p+1,1&f?l:c),p+=2}if(o>0)for(let f=0;f<a;f++){const t=1&f?l:c,e=A-A/a*f;for(let A=0;A<o;A++){const i=A/o*Dy,s=(A+1)/o*Dy,n=3*p;g[n]=Math.sin(i)*e,g[n+1]=0,g[n+2]=Math.cos(i)*e,g[n+3]=Math.sin(s)*e,g[n+4]=0,g[n+5]=Math.cos(s)*e,My(d,p,t),My(d,p+1,t),p+=2}}super(sw(g,d),new tp({vertexColors:!0,fog:!1}))}dispose(){aw(this)}},exports.PolyhedronGeometry=vp,exports.PostProcessing=Pn,exports.ProtoInstanceContent=DI,exports.QuadraticBezierCurve=QB,exports.QuadraticBezierCurve3=EB,exports.Quaternion=T,exports.RAD2DEG=R,exports.RGBADepthPacking=Ud,exports.RGBDepthPacking=Nd,exports.RGDepthPacking=Pd,exports.Raycaster=gu,exports.RectAreaLight=dl,exports.RenderContext=Wn,exports.RingGeometry=rm,exports.SMAA=class{isSMAA=!0;slot=Un.Present;needsTonemap=!0;active=!0;#rg=new rt({magFilter:X.Nearest,minFilter:X.Nearest,mipmapFilter:X.Nearest});#ag=new rt({magFilter:X.Linear,minFilter:X.Linear,mipmapFilter:X.Nearest});#og=new ac(this.#rg);#lg=new oc(this.#ag);#cg=new lc(this.#ag);#hg={kind:-1,pipe:null,format:"",samples:0,bg:null};#ug={kind:-1,pipe:null,format:"",samples:0,bg:null};#gg={kind:-1,pipe:null,format:"",samples:0,bg:null};#Rh=null;#Hh=null;#dg=null;#pg=null;#fg=null;#mg=null;#Cg=null;#wg=null;#ii=null;#mn=0;#Cn=0;#yg=null;#Bg=0;#Ig=0;#Qg=null;#Eg=null;#xg={view:void 0,format:"rg8unorm",sampleCount:1};#Dg={view:void 0,format:"rgba8unorm",sampleCount:1};#Kh={view:void 0,loadOp:"clear",storeOp:"store",clearValue:hc};#Vh={label:"SMAA",colorAttachments:[this.#Kh]};constructor(){(uc||(uc=Promise.resolve().then(()=>WI).then(A=>({area:A.smaaAreaBytes(),search:A.smaaSearchBytes()})).catch(A=>{throw uc=null,A})),uc).then(A=>{this.#wg=A},()=>{})}onDetach(){this.#Mg(),this.#bg(),this.#Hh=null}execute(A){const t=A.colorOut,e=A.colorIn;if(!t||!e)return;this.#Sg(A.cache);const i=A.device;if(this.#wg&&this.#ii!==i&&this.#vg(i),this.#Tg(i,e),!this.#wg)return this.#Ug(this.#Ng(i)),void this.#Nn(A,this.#gg,this.#cg,rc,t,hc);this.#Jh(i,e.width,e.height);const s=this.#dg,n=this.#pg;this.#Nn(A,this.#hg,this.#og,"\nconst THRESHOLD: f32 = 0.05;\n\nfn chroma(c: vec3f, n: vec3f) -> f32 {\n let d = abs(c - n);\n return max(d.r, max(d.g, d.b));\n}\n\n@fragment fn fragmentMain(@builtin(position) pos: vec4f) -> @location(0) vec4f {\n let dim = vec2f(textureDimensions(color));\n let px = 1.0 / max(dim, vec2f(1.0));\n let uv = pos.xy * px;\n let c = textureSampleLevel(color, point, uv, 0.0).rgb;\n let left = chroma(c, textureSampleLevel(color, point, uv + vec2f(-px.x, 0.0), 0.0).rgb);\n let top = chroma(c, textureSampleLevel(color, point, uv + vec2f(0.0, -px.y), 0.0).rgb);\n var edges = step(vec2f(THRESHOLD), vec2f(left, top));\n if (dot(edges, vec2f(1.0)) == 0.0) { discard; }\n\n let right = chroma(c, textureSampleLevel(color, point, uv + vec2f(px.x, 0.0), 0.0).rgb);\n let bottom = chroma(c, textureSampleLevel(color, point, uv + vec2f(0.0, px.y), 0.0).rgb);\n var maxDelta = max(vec2f(left, top), vec2f(right, bottom));\n let left2 = chroma(c, textureSampleLevel(color, point, uv + vec2f(-2.0 * px.x, 0.0), 0.0).rgb);\n let top2 = chroma(c, textureSampleLevel(color, point, uv + vec2f(0.0, -2.0 * px.y), 0.0).rgb);\n maxDelta = max(maxDelta, vec2f(left2, top2));\n let finalDelta = max(maxDelta.x, maxDelta.y);\n edges *= step(vec2f(finalDelta), 2.0 * vec2f(left, top));\n return vec4f(edges, 0.0, 0.0);\n}\n",this.#xg,cc),this.#Pg(s),this.#Nn(A,this.#ug,this.#lg,"\nconst STEPS: i32 = 32;\nconst CORNER: f32 = 0.25;\n\nfn hlslRound(x: f32) -> f32 {\n return sign(x) * floor(abs(x) + 0.5);\n}\n\nfn searchLength(e: vec2f, offset: f32) -> f32 {\n var scale = vec2f(66.0, 33.0) * vec2f(0.5, -1.0);\n var bias = vec2f(66.0, 33.0) * vec2f(offset, 1.0);\n scale += vec2f(-1.0, 1.0);\n bias += vec2f(0.5, -0.5);\n let packed = vec2f(64.0, 16.0);\n return textureSampleLevel(search, samp, (scale * e + bias) / packed, 0.0).r;\n}\n\nfn searchXLeft(uv: vec2f, end: f32, px: vec2f) -> f32 {\n var coord = uv;\n var e = vec2f(0.0, 1.0);\n for (var i = 0; i < STEPS; i++) {\n if (!(coord.x > end && e.g > 0.8281 && e.r == 0.0)) { break; }\n e = textureSampleLevel(edges, samp, coord, 0.0).rg;\n coord.x -= 2.0 * px.x;\n }\n let offset = -(255.0 / 127.0) * searchLength(e, 0.0) + 3.25;\n return px.x * offset + coord.x;\n}\n\nfn searchXRight(uv: vec2f, end: f32, px: vec2f) -> f32 {\n var coord = uv;\n var e = vec2f(0.0, 1.0);\n for (var i = 0; i < STEPS; i++) {\n if (!(coord.x < end && e.g > 0.8281 && e.r == 0.0)) { break; }\n e = textureSampleLevel(edges, samp, coord, 0.0).rg;\n coord.x += 2.0 * px.x;\n }\n let offset = -(255.0 / 127.0) * searchLength(e, 0.5) + 3.25;\n return -px.x * offset + coord.x;\n}\n\nfn searchYUp(uv: vec2f, end: f32, px: vec2f) -> f32 {\n var coord = uv;\n var e = vec2f(1.0, 0.0);\n for (var i = 0; i < STEPS; i++) {\n if (!(coord.y > end && e.r > 0.8281 && e.g == 0.0)) { break; }\n e = textureSampleLevel(edges, samp, coord, 0.0).rg;\n coord.y -= 2.0 * px.y;\n }\n let offset = -(255.0 / 127.0) * searchLength(e.gr, 0.0) + 3.25;\n return px.y * offset + coord.y;\n}\n\nfn searchYDown(uv: vec2f, end: f32, px: vec2f) -> f32 {\n var coord = uv;\n var e = vec2f(1.0, 0.0);\n for (var i = 0; i < STEPS; i++) {\n if (!(coord.y < end && e.r > 0.8281 && e.g == 0.0)) { break; }\n e = textureSampleLevel(edges, samp, coord, 0.0).rg;\n coord.y += 2.0 * px.y;\n }\n let offset = -(255.0 / 127.0) * searchLength(e.gr, 0.5) + 3.25;\n return -px.y * offset + coord.y;\n}\n\nfn areaOf(dist: vec2f, e1: f32, e2: f32) -> vec2f {\n var uv = vec2f(16.0) * vec2f(hlslRound(4.0 * e1), hlslRound(4.0 * e2)) + dist;\n let texel = 1.0 / vec2f(160.0, 560.0);\n uv = texel * uv + 0.5 * texel;\n return textureSampleLevel(area, samp, uv, 0.0).rg;\n}\n\nfn cornerH(weights: vec2f, ends: vec4f, d: vec2f, px: vec2f) -> vec2f {\n let side = step(d.xy, d.yx);\n let rounding = (1.0 - CORNER) * side / (side.x + side.y);\n var factor = vec2f(1.0);\n factor.x -= rounding.x * textureSampleLevel(edges, samp, ends.xy + vec2f(0.0, px.y), 0.0).r;\n factor.x -= rounding.y * textureSampleLevel(edges, samp, ends.zw + vec2f(px.x, px.y), 0.0).r;\n factor.y -= rounding.x * textureSampleLevel(edges, samp, ends.xy + vec2f(0.0, -2.0 * px.y), 0.0).r;\n factor.y -= rounding.y * textureSampleLevel(edges, samp, ends.zw + vec2f(px.x, -2.0 * px.y), 0.0).r;\n return weights * clamp(factor, vec2f(0.0), vec2f(1.0));\n}\n\nfn cornerV(weights: vec2f, ends: vec4f, d: vec2f, px: vec2f) -> vec2f {\n let side = step(d.xy, d.yx);\n let rounding = (1.0 - CORNER) * side / (side.x + side.y);\n var factor = vec2f(1.0);\n factor.x -= rounding.x * textureSampleLevel(edges, samp, ends.xy + vec2f(px.x, 0.0), 0.0).g;\n factor.x -= rounding.y * textureSampleLevel(edges, samp, ends.zw + vec2f(px.x, px.y), 0.0).g;\n factor.y -= rounding.x * textureSampleLevel(edges, samp, ends.xy + vec2f(-2.0 * px.x, 0.0), 0.0).g;\n factor.y -= rounding.y * textureSampleLevel(edges, samp, ends.zw + vec2f(-2.0 * px.x, px.y), 0.0).g;\n return weights * clamp(factor, vec2f(0.0), vec2f(1.0));\n}\n\n@fragment fn fragmentMain(@builtin(position) pos: vec4f) -> @location(0) vec4f {\n let dim = vec2f(textureDimensions(edges));\n let px = 1.0 / max(dim, vec2f(1.0));\n let uv = pos.xy * px;\n let e = textureSampleLevel(edges, samp, uv, 0.0).rg;\n if (e.r == 0.0 && e.g == 0.0) { discard; }\n\n let pix = uv * dim;\n let o0 = uv.xyxy + vec4f(-0.25, -0.125, 1.25, -0.125) * px.xyxy;\n let o1 = uv.xyxy + vec4f(-0.125, -0.25, -0.125, 1.25) * px.xyxy;\n let span = vec4f(-2.0, 2.0, -2.0, 2.0) * f32(STEPS);\n let o2 = vec4f(o0.xz, o1.yw) + span * px.xxyy;\n var weights = vec4f(0.0);\n\n if (e.g > 0.0) {\n var coords = vec3f(0.0);\n coords.x = searchXLeft(o0.xy, o2.x, px);\n coords.y = o1.y;\n let e1 = textureSampleLevel(edges, samp, coords.xy, 0.0).r;\n coords.z = searchXRight(o0.zw, o2.y, px);\n var d = abs(vec2f(hlslRound(coords.x * dim.x - pix.x), hlslRound(coords.z * dim.x - pix.x)));\n let e2 = textureSampleLevel(edges, samp, coords.zy + vec2f(px.x, 0.0), 0.0).r;\n weights.rg = cornerH(areaOf(sqrt(d), e1, e2), vec4f(coords.x, uv.y, coords.z, uv.y), d, px);\n }\n\n if (e.r > 0.0) {\n var coords = vec3f(0.0);\n coords.y = searchYUp(o1.xy, o2.z, px);\n coords.x = o0.x;\n let e1 = textureSampleLevel(edges, samp, coords.xy, 0.0).g;\n coords.z = searchYDown(o1.zw, o2.w, px);\n var d = abs(vec2f(hlslRound(coords.y * dim.y - pix.y), hlslRound(coords.z * dim.y - pix.y)));\n let e2 = textureSampleLevel(edges, samp, coords.xz + vec2f(0.0, px.y), 0.0).g;\n weights.ba = cornerV(areaOf(sqrt(d), e1, e2), vec4f(uv.x, coords.y, uv.x, coords.z), d, px);\n }\n return weights;\n}\n",this.#Dg,cc),this.#Ug(n),this.#Nn(A,this.#gg,this.#cg,rc,t,hc)}#Sg(A){this.#Rh!==A&&(this.#Mg(),this.#Rh=A,this.#Hh=null)}#Mg(){const A=this.#Rh;if(A){for(const t of[this.#hg,this.#ug,this.#gg])t.kind>=0&&A.releaseFullscreenKind(t.kind),t.kind=-1,t.pipe=null,t.format="",t.samples=0,t.bg=null;this.#Rh=null}}#Tg(A,t){this.#yg===t&&this.#Bg===t.width&&this.#Ig===t.height||(this.#og.colorBinding.setValue(t),this.#cg.colorBinding.setValue(t),this.#og.colorBinding.updateGPUBuffer(A),this.#cg.colorBinding.updateGPUBuffer(A),this.#yg=t,this.#Bg=t.width,this.#Ig=t.height,this.#hg.bg=null,this.#gg.bg=null)}#Pg(A){this.#Qg!==A&&(this.#lg.edgesBinding.setValue(A),this.#Qg=A,this.#ug.bg=null)}#Ug(A){this.#Eg!==A&&(this.#cg.weightsBinding.setValue(A),this.#Eg=A,this.#gg.bg=null)}#bg(){this.#dg?.destroy(),this.#pg?.destroy(),this.#fg?.destroy(),this.#mg?.destroy(),this.#Cg?.destroy(),this.#dg=null,this.#pg=null,this.#fg=null,this.#mg=null,this.#Cg=null,this.#mn=0,this.#Cn=0,this.#yg=null,this.#Bg=0,this.#Ig=0,this.#Qg=null,this.#Eg=null,this.#ii=null}#vg(A){const t=this.#wg;if(t){if(this.#ii&&this.#ii!==A){this.#bg();const A=this.#Rh;if(A)for(const t of[this.#hg,this.#ug,this.#gg])t.kind>=0&&A.releaseFullscreenKind(t.kind),t.kind=-1,t.pipe=null,t.format="",t.samples=0,t.bg=null}else this.#fg?.destroy(),this.#mg?.destroy(),this.#Cg?.destroy(),this.#Cg=null,this.#Eg=null;this.#fg=dc(A,t.area,160,560,wA.RGFormat),this.#mg=dc(A,t.search,64,16,wA.RedFormat),this.#lg.areaBinding.setValue(this.#fg),this.#lg.searchBinding.setValue(this.#mg),this.#ii=A,this.#ug.bg=null}}#Ng(A){return this.#Cg||(this.#Cg=dc(A,new Uint8Array(4),1,1,wA.RGBAFormat)),this.#Cg}#Jh(A,t,e){this.#dg&&this.#mn===t&&this.#Cn===e||(this.#dg?.destroy(),this.#pg?.destroy(),this.#dg=gc(A,t,e,"rg8unorm"),this.#pg=gc(A,t,e,"rgba8unorm"),this.#xg.view=this.#dg.createView(A),this.#Dg.view=this.#pg.createView(A),this.#mn=t,this.#Cn=e,this.#Qg=null,this.#Eg=null,this.#hg.bg=null,this.#ug.bg=null,this.#gg.bg=null)}#Nn(A,t,e,i,s,n){const r=A.cache;t.kind<0&&(t.kind=r.registerFullscreenKind({material:e,entryWgsl:i})),t.pipe&&t.format===s.format&&t.samples===s.sampleCount||(t.pipe=r.createFullscreen(t.kind,s.format,s.sampleCount),t.format=s.format,t.samples=s.sampleCount),t.bg||(t.bg=r.createSystemBindGroup(t.kind,e));const a=this.#Kh;a.view=s.view,a.clearValue=n,s.resolveTarget?a.resolveTarget=s.resolveTarget:delete a.resolveTarget;const o=A.encoder.beginRenderPass(this.#Vh);o.setPipeline(t.pipe),o.setBindGroup(0,this.#Hh??=r.getEmptyBG()),o.setBindGroup(1,t.bg),o.draw(3),o.end()}},exports.SSAO=class{isSSAO=!0;slot=Un.AfterOpaque;needsHdr=!0;active=!0;radius=.55;intensity=1.8;bias=.025;#bh=new fc;#Rh=null;#Og=-1;#Fg=-1;#kg=-1;#Me=null;#Lh="";#jh=0;#vh=null;#N=null;#Rg=0;#Lg=0;#Hh=null;#jg=[];#zg=[];#Gg=null;#Yg=null;#Hg={x:0,y:0,w:0,h:0,u0:0,v0:0,du:0,dv:0};#Kh={view:void 0,loadOp:"load",storeOp:"store"};#Vh={label:"SSAO",colorAttachments:[this.#Kh]};onDetach(){this.#Kg(),this.#Mg(),this.#kg=-1,this.#Me=null,this.#Lh="",this.#jh=0,this.#vh=null,this.#N=null,this.#Rg=0,this.#Lg=0,this.#Hh=null,this.#bh.depthBinding.clearView()}execute(A){const t=A.depth,e=this.#Vg(A);if(!e||!t)return;this.#Jg(A,e,t);const i=this.#Me,s=this.#vh,n=A.camera;!0===n.isArrayCamera&&!0!==n.isMultiViewCamera&&n.cameras.length>0?this.#Wg(A,e,i,n):this.#qg(A,i,s,A.camera.projectionMatrix,0,0,1,1,0,0,0,0,!1)}#Vg(A){if(A.coverMsaa){const t=A.sceneRC.textures[0];if(null!=t&&t.sampleCount>1)return t}return A.color}#Mg(){const A=this.#Rh;A&&(this.#Og>=0&&A.releaseFullscreenKind(this.#Og),this.#Fg>=0&&A.releaseFullscreenKind(this.#Fg)),this.#Og=-1,this.#Fg=-1,this.#Rh=null}#Jg(A,t,e){const i=A.cache,s=this.#bh;this.#Rh!==i&&(this.#Kg(),this.#Mg(),this.#kg=-1,this.#Me=null,this.#Lh="",this.#jh=0,this.#vh=null),this.#Rh=i,this.#N===e&&this.#Rg===e.width&&this.#Lg===e.height||(s.depthBinding.clearView(),this.#N=e,this.#Rg=e.width,this.#Lg=e.height,this.#vh=null),s.depthBinding.attach(e,A.device)&&(this.#vh=null);const n=s.depthBinding.msaa;let r=n?this.#Fg:this.#Og;r<0&&(r=i.registerFullscreenKind({material:s,entryWgsl:"\nconst KERNEL_SIZE: i32 = 24;\n\nfn loadDepth(p: vec2i) -> f32 {\n let dim = vec2i(textureDimensions(depth));\n let c = clamp(p, vec2i(0), dim - vec2i(1));\n return textureLoad(depth, c, 0);\n}\n\nfn viewFromDepth(texUv: vec2f, z: f32) -> vec3f {\n // vp = (u0, v0, du, dv)。全屏是 (0,0,1,1),这条分支整屏同向,不走除法。\n var uv = texUv;\n let vp = ssao.vp;\n if (vp.x != 0.0 || vp.y != 0.0 || vp.z != 1.0 || vp.w != 1.0) {\n uv = (texUv - vp.xy) / max(vp.zw, vec2f(1e-8));\n }\n let ndc = vec4f(uv.x * 2.0 - 1.0, 1.0 - uv.y * 2.0, z, 1.0);\n let vh = ssao.invProj * ndc;\n return vh.xyz / max(vh.w, 1e-8);\n}\n\n@fragment fn fragmentMain(@builtin(position) pos: vec4f) -> @location(0) vec4f {\n let dimU = textureDimensions(depth);\n let dim = vec2f(dimU);\n let ip = vec2i(pos.xy);\n let uv = pos.xy / max(dim, vec2f(1.0));\n let z = loadDepth(ip);\n if (z <= 0.0001) { return vec4f(1.0); }\n\n let zRight = loadDepth(ip + vec2i(1, 0));\n let zUp = loadDepth(ip + vec2i(0, 1));\n if (zRight <= 0.0001 || zUp <= 0.0001) { return vec4f(1.0); }\n\n let origin = viewFromDepth(uv, z);\n let px = 1.0 / dim;\n let ddx = viewFromDepth(uv + vec2f(px.x, 0.0), zRight) - origin;\n let ddy = viewFromDepth(uv + vec2f(0.0, px.y), zUp) - origin;\n var normal = normalize(cross(ddx, ddy));\n normal *= sign(dot(normal, -origin));\n\n var tangent = cross(normal, vec3f(0.0, 1.0, 0.0));\n if (dot(tangent, tangent) < 1e-4) {\n tangent = cross(normal, vec3f(1.0, 0.0, 0.0));\n }\n tangent = normalize(tangent);\n let bitangent = cross(normal, tangent);\n let radius = max(ssao.radius, 1e-4);\n var occ = 0.0;\n for (var i = 0; i < KERNEL_SIZE; i++) {\n let fi = f32(i) + 0.5;\n let u = fi / f32(KERNEL_SIZE);\n let phi = fi * 2.399963229728653;\n let r = sqrt(u);\n let k = vec3f(cos(phi) * r, sin(phi) * r, sqrt(max(0.0, 1.0 - u)));\n let sampleView = origin + (tangent * k.x + bitangent * k.y + normal * k.z) * radius;\n let clip = ssao.proj * vec4f(sampleView, 1.0);\n let ndc = clip.xy / max(clip.w, 1e-8);\n let nxy = vec2f(ndc.x * 0.5 + 0.5, 0.5 - ndc.y * 0.5);\n if (nxy.x < 0.0 || nxy.x > 1.0 || nxy.y < 0.0 || nxy.y > 1.0) { continue; }\n var suv = nxy;\n let vp = ssao.vp;\n if (vp.x != 0.0 || vp.y != 0.0 || vp.z != 1.0 || vp.w != 1.0) {\n suv = vp.xy + nxy * vp.zw;\n }\n let occluder = viewFromDepth(suv, loadDepth(vec2i(suv * dim)));\n let range = 1.0 - smoothstep(radius * 0.25, radius, abs(occluder.z - origin.z));\n occ += select(0.0, range, occluder.z - sampleView.z > ssao.bias);\n }\n let ao = pow(clamp(1.0 - occ / f32(KERNEL_SIZE), 0.0, 1.0), max(ssao.intensity, 0.0));\n return vec4f(ao, ao, ao, 1.0);\n}\n",blend:mc}),n?this.#Fg=r:this.#Og=r),this.#kg!==r&&(this.#kg=r,this.#Me=null,this.#Lh="",this.#jh=0,this.#vh=null);const a=t.sampleCount>1?4:1;let o=this.#Me;o&&this.#Lh===t.format&&this.#jh===a||(o=i.createFullscreen(r,t.format,a),this.#Me=o,this.#Lh=t.format,this.#jh=a);let l=this.#vh;l||(l=i.createSystemBindGroup(r,s),this.#vh=l),this.#Kh.view=t.createView(A.device)}#Wg(A,t,e,i){const s=t.width,n=t.height,r=i.cameras,a=this.#bh,o=A.device,l=a.depthBinding.dataView.texture;this.#Gg===e&&this.#Yg===l||(this.#zg.length=0,this.#Gg=e,this.#Yg=l);let c=0;for(let u=0,g=r.length;u<g;u++){const A=r[u];if(!this.#Xg(A.viewportRect,s,n))continue;const t=this.#Hg;a.writeCPU(this.radius,this.intensity,this.bias,A.projectionMatrix,t.u0,t.v0,t.du,t.dv),this.#Zg(o,e,c),c++}const h=c;c=0;for(let u=0,g=r.length;u<g&&c<h;u++){const t=r[u];if(!this.#Xg(t.viewportRect,s,n))continue;const i=this.#Hg;this.#_g(A,e,this.#zg[c],i.x,i.y,i.w,i.h,!0),c++}}#Xg(A,t,e){let i=0,s=0,n=t,r=e;if(null!=A&&(i=0|A.x,s=0|A.y,n=0|A.z,r=0|A.w,i<0&&(n+=i,i=0),s<0&&(r+=s,s=0),i+n>t&&(n=t-i),s+r>e&&(r=e-s)),n<1||r<1||t<1||e<1)return!1;const a=this.#Hg;return a.x=i,a.y=s,a.w=n,a.h=r,a.u0=i/t,a.v0=s/e,a.du=n/t,a.dv=r/e,!0}#Zg(A,t,e){const i=this.#bh.paramsBinding,s=i.dataView,n=s.view;if(!n)return;const r=n instanceof c?n.u8:n,a=r.BYTES_PER_ELEMENT||1,o=s.size||i.typeInfo.bytes,l=o/a|0;if(l<=0)return;const h=Math.max(16,o+15&-16);let u=this.#jg[e];if((!u||u.size<h)&&(u?.destroy(),u=A.createBuffer({label:"ssao-view",size:h,usage:j.UNIFORM|j.COPY_DST}),this.#jg[e]=u,this.#zg[e]=void 0),A.queue.writeBuffer(u,0,r,s.dataOffset,l),this.#zg[e])return;const g=this.#bh.depthBinding.dataView.texture;g&&(this.#zg[e]=A.createBindGroup({label:"ssao-view",layout:t.getBindGroupLayout(1),entries:[{binding:0,resource:g},{binding:1,resource:{buffer:u}}]}))}#Kg(){const A=this.#jg;for(let t=0,e=A.length;t<e;t++)A[t].destroy();A.length=0,this.#zg.length=0,this.#Gg=null,this.#Yg=null}#qg(A,t,e,i,s,n,r,a,o,l,c,h,u){this.#bh.sync(A.device,this.radius,this.intensity,this.bias,i,s,n,r,a),this.#_g(A,t,e,o,l,c,h,u)}#_g(A,t,e,i,s,n,r,a){const o=A.encoder.beginRenderPass(this.#Vh);o.setPipeline(t),o.setBindGroup(0,this.#Hh??=A.cache.getEmptyBG()),o.setBindGroup(1,e),a&&(o.setViewport(i,s,n,r,0,1),o.setScissorRect(i,s,n,r)),o.draw(3),o.end()}},exports.Sampler=rt,exports.Scene=class extends Mi{type="Scene";isScene=!0;environment=null;environmentIntensity=1;fog={enabled:!1,mode:"linear",color:new Float32Array([1,1,1]),near:1,far:1e3,density:25e-5};get bindingStartIndex(){return 2}attachBinding(A){this.addBinding(A,!1)}lightBindEpoch=0;lightManager;shadowManager;iblManager;renderer=null;audio=null;constructor(A,t){super(A),this.dirtySystem=new ii,this.renderer=A,this.lightManager=new ic(t),this.lightManager.install(this),this.shadowManager=new Hh,this.shadowManager.install(this),this.iblManager=new nu,this.iblManager.install(this),function(A){const t=(function(){if(cu)return;const A={magFilter:X.Linear,minFilter:X.Linear,dataType:yA.HalfFloatType,formatType:wA.RGBAFormat};cu=new Yn(au,64,64,A),hu=new Yn(ou,64,64,A),uu=new rt({magFilter:X.Linear,minFilter:X.Linear})}(),{ltcMat:new qt("ltcMat",cu,{visibility:lu,fixedSlot:14}),ltcAmp:new qt("ltcAmp",hu,{visibility:lu,fixedSlot:15}),ltcSampler:new Wt("ltcSampler",uu,{visibility:lu,fixedSlot:16}),matTex:cu,ampTex:hu});A.attachBinding(t.ltcMat),A.attachBinding(t.ltcAmp),A.attachBinding(t.ltcSampler)}(this)}getCacheKey(){return`${super.getCacheKey()}|L${this.lightBindEpoch}`}updateMatrixWorld(A=this.renderer){if(!A)throw new Error("Scene must be attached to a renderer");this.dirtySystem?.commit(A),this.audio?.sync()}dispose(){const A=this.audio;A?.sync(),this.lightManager?.dispose(),this.shadowManager?.dispose(),this.iblManager?.dispose(),super.dispose(),A?.sync(),this.audio=null}},exports.ShaderNode=Rn,exports.ShadowMaterial=class extends Ng{type="ShadowMaterial";isShadowMaterial=!0;constructor(A){super(A,{shader:Xd,isSupportFamily:!0}),this.transparent=!0,this.color.set(0,0,0,1),this.setValues(A)}get fog(){return 0!==this.defines.get("FOG")}set fog(A){A?this.defines.delete("FOG"):this.defines.set("FOG",0)}},exports.Shape=UB,exports.ShapeGeometry=hm,exports.ShapePath=class{type="ShapePath";color=new P;subPaths=[];currentPath=null;userData={};#$g(){const A=this.currentPath;if(!A)throw new Error("ShapePath: call moveTo before drawing");return A}moveTo(A,t){const e=new TB;return this.currentPath=e,this.subPaths.push(e),e.moveTo(A,t),this}lineTo(A,t){return this.#$g().lineTo(A,t),this}quadraticCurveTo(A,t,e,i){return this.#$g().quadraticCurveTo(A,t,e,i),this}bezierCurveTo(A,t,e,i,s,n){return this.#$g().bezierCurveTo(A,t,e,i,s,n),this}splineThru(A){return this.#$g().splineThru(A),this}toShapes(){const A=this.userData.style;let t=A?.fillRule||"nonzero";"nonzero"!==t&&"evenodd"!==t&&(t="nonzero");const e="evenodd"===t,i=A=>e?!!(1&A):0!==A,s=[],n=this.subPaths;for(let o=0;o<n.length;o++){const A=n[o],t=A.getPoints();if(t.length<3)continue;const e=Vy(t);if(0===e)continue;const i=PB(t);s.push({subPath:A,points:t,box:i,interior:FB(t,i,new w),absArea:Math.abs(e),winding:e<0?-1:1,container:null,exclude:!1,role:null})}s.sort((A,t)=>t.absArea-A.absArea);for(let o=0;o<s.length;o++){const A=s[o];let t=0;for(let e=o-1;e>=0;e--){const i=s[e];if(OB(i.box,A.box)&&NB(A.interior.x,A.interior.y,i.points)){A.container=i.exclude?i.container:i,t=i.winding,A.winding+=t;break}}i(A.winding)===i(t)&&(A.exclude=!0)}for(let o=0;o<s.length;o++){const A=s[o];A.exclude||(A.role=null===A.container||"hole"===A.container.role?"outer":"hole")}const r=[],a=new Map;for(let o=0;o<s.length;o++){const A=s[o];if(A.exclude||"outer"!==A.role)continue;const t=new UB;t.curves=A.subPath.curves,t.cacheLengths=null,r.push(t),a.set(A,t)}for(let o=0;o<s.length;o++){const A=s[o];if(A.exclude||"hole"!==A.role||!A.container)continue;const t=a.get(A.container);if(!t)continue;const e=new TB;e.curves=A.subPath.curves,e.cacheLengths=null,t.holes.push(e)}return r}},exports.ShapeUtils=Xy,exports.SimulationState=LB,exports.Skeleton=Cu,exports.SkeletonHelper=class extends cg{type="SkeletonHelper";root;bones;#Ad;#Ih=new qC;constructor(A){const t=function(A){const t=A.skeleton;if(t)return t.bones.slice();const e=[],i=[A];for(;i.length;){const A=i.pop();null==A.geometry&&!0!==A.isCamera&&!0!==A.isLight&&e.push(A);const t=A.children;for(let e=0,s=t.length;e<s;e++)i.push(t[e])}return e}(A),e=function(A){const t=A.length,e=new Map;for(let s=0;s<t;s++)e.set(A[s],s);const i=[];for(let s=0;s<t;s++){const t=A[s].parent;if(null==t)continue;const n=e.get(t);void 0!==n&&i.push(n,s)}return Int32Array.from(i)}(t),i=e.length>>1;super(sw(new Float32Array(2*i*3),new Float32Array(2*i*3)),new tp({vertexColors:!0,fog:!1,depthTest:!1,depthWrite:!1,transparent:!0})),this.root=A,this.bones=t,this.#Ad=e,this.visible=i>0,this.setColors(255,65280),this.update()}setColors(A,t){const e=this.geometry.getAttribute("color"),i=e.view,s=e.stride,n=e.count;let r=!1;$C(A,Sy);const a=Sy.r,o=Sy.g,l=Sy.b;$C(t,Sy);const c=Sy.r,h=Sy.g,u=Sy.b;for(let g=0;g<n;g+=2)ew(i,s,g,a,o,l)&&(r=!0),ew(i,s,g+1,c,h,u)&&(r=!0);return r&&iw(e),this}update(){ZC(this,this.root,this.#Ih);const A=this.#Ad,t=A.length>>1;if(0===t)return;by.copy(this.root.matrixWorld).invert();const e=by.data,i=this.bones,s=this.geometry.getAttribute("position"),n=s.view,r=s.stride;let a=!1;for(let o=0;o<t;o++){const t=i[A[2*o]];vy(n,r,2*o,e,i[A[2*o+1]].matrixWorld.data)&&(a=!0),vy(n,r,2*o+1,e,t.matrixWorld.data)&&(a=!0)}a&&(iw(s),this.geometry.computeBoundingBox())}dispose(){aw(this)}},exports.Slot=Un,exports.SphereGeometry=um,exports.SplineCurve=xB,exports.SpotLight=gl,exports.SpotLightHelper=class extends Mi{type="SpotLightHelper";light;color;cone;#Ih=new qC;#T=NaN;#td=NaN;constructor(A,t){super(),this.light=A,this.color=t,this.cone=new cg(function(){if(Uy)return Uy;const A=new Float32Array(222),t=[0,0,-1,1,0,-1,-1,0,-1,0,1,-1,0,-1,-1];let e=0;for(let i=0;i<5;i++){const s=3*e;A[s]=0,A[s+1]=0,A[s+2]=0,A[s+3]=t[3*i],A[s+4]=t[3*i+1],A[s+5]=t[3*i+2],e+=2}for(let i=0;i<32;i++){const t=i/32*Ty,s=(i+1)/32*Ty,n=3*e;A[n]=Math.cos(t),A[n+1]=Math.sin(t),A[n+2]=-1,A[n+3]=Math.cos(s),A[n+4]=Math.sin(s),A[n+5]=-1,e+=2}return Uy=sw(A),Uy}(),new tp({fog:!1})),this.add(this.cone),this.update()}update(){ZC(this,this.light,this.#Ih);const A=this.light.distance,t=A>0?A:1e3,e=t*Math.tan(this.light.angle);e===this.#T&&t===this.#td||(this.#T=e,this.#td=t,Aw(this.cone.scale,e,e,t));const i=this.color;_C(this.cone.material.color,void 0!==i?i:this.light.color)}dispose(){this.poolIndex<0||(ow(this.cone),super.dispose())}},exports.Sprite=class extends Os{type="Sprite";isSprite=!0;center=new w(.5,.5);#oh=.5;#lh=.5;#ed=null;#id=null;constructor(A){super(bg(),A),this.center.depObject={onChangeCallback:()=>this.#sd()},this.center.resetDirty()}get castShadow(){return!1}set castShadow(A){}copy(A,t=!0){super.copy(A,t);const e=A;return e.isSprite?(this.#oh=Number.NaN,this.center.copy(e.center),this.#sd(),this):this}raycast(A,t){const e=A.camera;if(!e)return void console.warn("Sprite.raycast: 需要 Raycaster.camera,请先 setFromCamera。");const i=this.geometry.getAttribute("position");if(!i||i.count<4)return;const s=this.matrixWorld.data;gg.set(s[12],s[13],s[14]),ug.copy(e.matrixWorld).invert(),gg.applyMatrix4(ug);let n=Math.hypot(s[0],s[1],s[2]),r=Math.hypot(s[4],s[5],s[6]);const a=this.material,o=a.isSpriteMaterial?a.rotation??0:0;if(a.isSpriteMaterial&&!1===a.sizeAttenuation&&e.projectionMatrix.data[11]<-.5){const A=-gg.z;n*=A,r*=A}const l=0!==o?Math.cos(o):1,c=0!==o?Math.sin(o):0;vg(i,0,n,r,l,c,gg,fg),vg(i,1,n,r,l,c,gg,mg),vg(i,2,n,r,l,c,gg,Cg),vg(i,3,n,r,l,c,gg,wg),dg.copy(A.ray.origin).applyMatrix4(ug),pg.copy(A.ray.direction).transformDirection(ug);let h=null,u=1,g=2;const d=Tg(dg,pg,fg,mg,Cg,yg);null!==d&&(h=d,Bg.copy(yg));const p=Tg(dg,pg,fg,Cg,wg,yg);if(null!==p&&(null===h||p<h)&&(h=p,Bg.copy(yg),u=2,g=3),null===h)return;let f;if(A.needUV){const A=function(A,t,e,i,s){if(!A)return null;const n=[fg,mg,Cg,wg],r=n[0],a=n[i],o=n[s];Ig.copy(o).sub(r),Qg.copy(a).sub(r),xg.copy(t).sub(r);const l=Ig.dot(Ig),c=Ig.dot(Qg),h=Ig.dot(xg),u=Qg.dot(Qg),g=Qg.dot(xg),d=l*u-c*c;if(0===d)return null;const p=1/d,f=(u*h-c*g)*p,m=(l*g-c*h)*p,C=1-f-m;return[A.getX(0)*C+A.getX(i)*m+A.getX(s)*f,A.getY(0)*C+A.getY(i)*m+A.getY(s)*f]}(this.geometry.getAttribute("uv"),Bg,0,u,g);A&&(f=new w(A[0],A[1]))}Bg.applyMatrix4(e.matrixWorld);const m=A.ray.origin.distanceTo(Bg);if(m<A.near||m>A.far)return;const C=!0===A.closestOnly;if(C&&t.length>0&&m>=t[0].distance)return;const y=C?t[0]:void 0;if(y)return y.object=this,y.point.copy(Bg),y.distance=m,y.face=void 0,y.faceIndex=void 0,y.uv=f,y.normal=void 0,y.barycoord=void 0,y.instanceId=void 0,void(y.index=void 0);const B={object:this,point:Bg.clone(),distance:m};f&&(B.uv=f),t.push(B)}#sd(){const A=this.center.x,t=this.center.y;if(this.center.resetDirty(),A===this.#oh&&t===this.#lh)return;this.#oh=A,this.#lh=t;const e=bg();if(.5===A&&.5===t)return void(this.geometry!==e&&(this.geometry=e));let i=this.#ed,s=this.#id;if(!i||!s){i=new Wi,i.name="Sprite",s=new Fi(new Float32Array(12),3),i.setAttribute("position",s);const A=e.getAttribute("uv");A&&i.setAttribute("uv",A),i.setIndex(e.getIndex()),this.#ed=i,this.#id=s}const n=.5-A,r=.5-t,a=s.view,o=s.stride;Sg(a,o,0,-.5+n,-.5+r),Sg(a,o,1,.5+n,-.5+r),Sg(a,o,2,.5+n,.5+r),Sg(a,o,3,-.5+n,.5+r),s.isDirty||s.onChangeCallback(),this.geometry!==i&&(this.geometry=i)}},exports.SpriteMaterial=class extends Ng{type="SpriteMaterial";isSpriteMaterial=!0;alphaTex=null;alphaSamp=null;_alphaTest=0;constructor(A){super(A,{shader:$d,isSupportFamily:!0}),this.registerStructField("rotation",new zt("rotation",0,void 0,{access:"Uniform"})),this.registerStructField("sizeAttenuation",new zt("sizeAttenuation",1,void 0,{access:"Uniform"})),this.transparent=!0,this.color.set(1,1,1,1),this.setValues(A)}get rotation(){return this.readNum("rotation",0)}set rotation(A){this.putNum("rotation",A)}get sizeAttenuation(){return this.readNum("sizeAttenuation",1)>=.5}set sizeAttenuation(A){this.putNum("sizeAttenuation",A?1:0)}get alphaTest(){return this._alphaTest}set alphaTest(A){if(!(A>0))return this._alphaTest=0,this.defines.delete("ALPHATEST"),void this.dropNum("alphaTest");this._alphaTest=A,1!==this.defines.get("ALPHATEST")&&this.defines.set("ALPHATEST",1),this.putNum("alphaTest",A)}get fog(){return 0!==this.defines.get("FOG")}set fog(A){A?this.defines.delete("FOG"):this.defines.set("FOG",0)}get alphaMap(){return this.alphaTex?this.alphaTex.getValue():null}set alphaMap(A){if(null==A){if(!this.alphaTex||!this.alphaSamp)return;return this.removeBinding(this.alphaTex),this.removeBinding(this.alphaSamp),this.alphaTex=null,this.alphaSamp=null,void this.onChangeCallback(f.DIRTY_STRUCTURE)}if(A.assertCompatibleSampler(A.sampler),!this.alphaTex||!this.alphaSamp){const A=new qt("alphaMap",null),t=new Wt("alphaMapSampler",null);this.addBinding(A),this.addBinding(t),this.alphaTex=A,this.alphaSamp=t,this.onChangeCallback(f.DIRTY_STRUCTURE)}this.alphaTex.setValue(A),this.alphaSamp.setValue(A.sampler??null)}copy(A){super.copy(A);const t=A;return t.isSpriteMaterial?(this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.alphaTest=t.alphaTest,this):this}materialStruct(){return this.getBinding("material")}readNum(A,t){const e=this.materialStruct().getField(A);return e?e.getValue():t}putNum(A,t){const e=this.materialStruct(),i=e.getField(A);i?i.setValue(t):e.addField(new zt(A,t,void 0,{access:"Uniform"}))}dropNum(A){const t=this.materialStruct();t.getField(A)&&t.removeField(A)}},exports.StereoCamera=class{type="StereoCamera";isStereoCamera=!0;aspect=1;eyeSep=.064;cameraL;cameraR;#Qh={focus:NaN,fov:NaN,aspect:NaN,near:NaN,far:NaN,zoom:NaN,eyeSep:NaN};#nd=new Float32Array(16);#rd=NaN;#ad=!1;constructor(){this.cameraL=new Hg,this.cameraR=new Hg}update(A){this.#od(A),this.#ld(A)}#od(A){const t=this.#Qh,e=A.focus,i=A.fov,s=A.aspect*this.aspect,n=A.near,r=A.far,a=A.zoom,o=this.eyeSep;if(t.focus===e&&t.fov===i&&t.aspect===s&&t.near===n&&t.far===r&&t.zoom===a&&t.eyeSep===o)return;t.focus=e,t.fov=i,t.aspect=s,t.near=n,t.far=r,t.zoom=a,t.eyeSep=o;const l=this.cameraL,c=this.cameraR;l.set(i,s,n,r),c.set(i,s,n,r),l.zoom=a,c.zoom=a,l.focus=e,c.focus=e;const h=.5*o*n/(e>0?e:1),u=n*A.tanHalfFov/a*2,g=u*s;if(!(g>0&&u>0))return l.clearViewOffset(),void c.clearViewOffset();l.setViewOffset(g,u,h,0,g,u),c.setViewOffset(g,u,-h,0,g,u)}#ld(A){const t=this.cameraL,e=this.cameraR,i=.5*this.eyeSep,s=t.parent===A,n=e.parent===A;if(s&&this.#cd(t,-i),n&&this.#cd(e,i),s&&n)return;const r=A.matrixWorld.data;var a,o;this.#ad&&this.#rd===i&&(a=r,o=this.#nd,a[0]===o[0]&&a[1]===o[1]&&a[2]===o[2]&&a[4]===o[4]&&a[5]===o[5]&&a[6]===o[6]&&a[8]===o[8]&&a[9]===o[9]&&a[10]===o[10]&&a[12]===o[12]&&a[13]===o[13]&&a[14]===o[14])||(this.#nd.set(r),this.#rd=i,this.#ad=!0,A.matrixWorld.decompose(nd,id,sd),s||(rd(t.position,r[12]-r[0]*i,r[13]-r[1]*i,r[14]-r[2]*i),ad(t.quaternion,id),rd(t.scale,sd.x,sd.y,sd.z)),n||(rd(e.position,r[12]+r[0]*i,r[13]+r[1]*i,r[14]+r[2]*i),ad(e.quaternion,id),rd(e.scale,sd.x,sd.y,sd.z)))}#cd(A,t){var e;this.#ad=!1,rd(A.position,t,0,0),0===(e=A.quaternion).x&&0===e.y&&0===e.z&&1===e.w||e.identity(),rd(A.scale,1,1,1)}},exports.Storage3DTexture=class extends pt{is3DTexture=!0;isStorageTexture=!0;dimension=xA.ThreeD;constructor(A=1,t=1,e=1){super(),this.image={width:A,height:t,depth:e},this.useMipmaps=!1,this.generateMipmaps=!1,this.usage|=GPUTextureUsage.STORAGE_BINDING}get mipLevelCount(){return 1}},exports.StorageArrayTexture=class extends pt{isStorageTexture=!0;isArrayTexture=!0;isArray=!0;dimension=xA.TwoD;constructor(A=1,t=1,e=1){super(),this.image={width:A,height:t,depth:e},this.useMipmaps=!1,this.generateMipmaps=!1,this.sampler.magFilter=X.Linear,this.sampler.minFilter=X.Linear,this.sampler.wrapR=q.ClampToEdge,this.usage|=GPUTextureUsage.STORAGE_BINDING}},exports.StorageTexture=class extends pt{isStorageTexture=!0;viewDimension=DA.TwoD;constructor(A,t){super(A,t),this.useMipmaps=!1,this.generateMipmaps=!1,this.usage|=GPUTextureUsage.STORAGE_BINDING}},exports.StreamingPageFlags=sI,exports.StructBufferAttribute=Ti,exports.StructUnorm10Attribute=Ui,exports.TetrahedronGeometry=pm,exports.Texture=pt,exports.TextureUtils=eB,exports.ToneMapping=SA,exports.TorusGeometry=xm,exports.TorusKnotGeometry=Km,exports.TransformFlags=f,exports.TubeGeometry=jm,exports.Uint16BufferAttribute=Pi,exports.Uint32BufferAttribute=Oi,exports.Uint8BufferAttribute=Ni,exports.Uint8ClampedBufferAttribute=class extends vi{constructor(A,t=1,e=!1){A&&A instanceof Uint8ClampedArray||(A=new Uint8ClampedArray(A??0)),super(A,t,e)}},exports.Unorm10BufferAttribute=Ri,exports.Vector2=w,exports.Vector3=y,exports.Vector4=B,exports.VertexStructBuffer=UA,exports.VideoFrameTexture=class extends Hn{isVideoFrameTexture=!0;constructor(A,t){super(A,t),this.useMipmaps=!1}setFrame(A){const t=this.image;t!==A&&(this.image=A,"function"==typeof t?.close&&t.close())}},exports.VideoTexture=Hn,exports.VolumeMaterial=class extends Ng{type="VolumeMaterial";isVolumeMaterial=!0;emissive;density;steps;dither;extent;constructor(A){super(A,{shader:_d}),this.registerStructField("emissive",new Yt("emissive",void 0,void 0,{access:"Uniform"})),this.registerStructField("density",new zt("density",1,void 0,{access:"Uniform"})),this.registerStructField("steps",new zt("steps",8,void 0,{access:"Uniform"})),this.registerStructField("dither",new zt("dither",1,void 0,{access:"Uniform"})),this.registerStructField("extent",new Yt("extent",new y(.5,.5,.5),void 0,{access:"Uniform"})),this.transparent=!0,this.side=Fn.Back,this.depthTest=!1,this.depthWrite=!1,this.extraVaryings=Zd,this.setValues(A)}},exports.WebGPURenderer=class{config;canvas;device;adapter;format;defaultRenderContext;currentRenderContext=null;#hd=null;clipPipelineMode="hybrid";pixelRatio;width=0;height=0;pipelineCache;renderObjects=new xn;renderWorldScene;cullComputeWorldScene;geometryTables;textureTables;samplerTables;materialTables;bucketEncoder=new Mr;cullCompute;instancedCull;indirectSliceSize=0;indirectSlice;occlusionHiZ=!1;hiZ;#Ln=new or;#ud=new lr(this.renderObjects);#gd=new cr(this.renderObjects);#dd=0;#pd=null;#fd={};#md=yc();#Cd={commitDone:!1,frameBuildMs:0,deviceEpoch:0,submissionSequence:0,prepareStart:0,cursor:0,lightView:{cameraFar:1e3,cameraEpoch:0,cameraX:0,cameraY:0,cameraZ:0,viewport:{x:0,y:0,z:1,w:1,minDepth:0,maxDepth:1}},encodeStats:{hits:0,fallbacks:0,exec:0,suffix:0,full:0}};#wd;worldStore;get postProcessing(){return this.#Ln.post}set postProcessing(A){this.#Ln.setPost(A)}get transparentPass(){return this.#Ln.transparentPass}set transparentPass(A){this.#Ln.setTransparentPass(A)}use(A){const t=2===this.#dd;return this.#Ln.use(A,this,t?this.pipelineCache:void 0,t),this}remove(A){return this.#Ln.remove(A),this}#yd=new Set;constructor(A={}){A={...Cc,...A},this.config=A,this.canvas=A.canvas||function(){if("undefined"!=typeof document){const A=document.createElement("canvas");return A.width=16,A.height=16,A}return new OffscreenCanvas(16,16)}(),this.pixelRatio=A.pixelRatio||globalThis.devicePixelRatio||1,this.indirectSliceSize=A.indirectSliceSize??0,this.occlusionHiZ=!0===A.occlusionHiZ,this.bucketEncoder.profileEncode=!0===A.profileEncode,A.canvas=null,this.init()}get sampleCount(){return this.defaultRenderContext?.sampleCount??1}async init(){if(2===this.#dd)return;if(this.#pd)return this.#pd;if(!navigator.gpu)throw new Error("WebGPU is not supported in this browser");const A=(async()=>{this.device&&this.#Bd(),await this.#Id(),this.#dd=2,this.#Ln.rebind(this.pipelineCache,this)})();this.#pd=A;try{await A}catch(t){throw this.#dd=0,console.error("[WebGPURenderer] init 失败",t),t}finally{this.#pd=null}}async#Id(){await this.#Qd();const A=this.config,t=this.canvas,e=this.device;this.defaultRenderContext=new Wn(e,{canvas:this.canvas,name:"default",format:this.format,sampleCount:A.antialias?4:1,width:t.width||16,height:t.height||16,depth:A.depth??!0,stencil:A.stencil??!1,clearColor:A.clearColor??!0,clearColorValue:A.clearColorValue??{r:.1,g:.1,b:.1,a:1},clearDepth:A.clearDepth??!0,clearStencil:A.clearStencil??!0,colorSpace:A.colorSpace||"srgb",toneMapping:A.toneMapping||"standard",alpha:A.alpha??!1}),this.renderObjects.deviceClipMode=this.clipPipelineMode,this.pipelineCache=new Tn(this);const i=new Jo(e,{capacityUnit:A.capacityUnit,initCapacity:A.initCapacity});this.worldStore=i,this.renderObjects.instanceMeta=i.instanceMeta,this.geometryTables=new en(e,i.geometryMeta),this.textureTables=new vo(e),this.samplerTables=new To(e),this.materialTables=new Qo(e,this.textureTables,this.samplerTables),this.#ud.bind({device:e,pipelineCache:this.pipelineCache,worldStore:i,geometryTables:this.geometryTables,materialTables:this.materialTables,textureTables:this.textureTables}),this.#gd.bind({worldStore:i,geometryTables:this.geometryTables}),this.renderWorldScene=new dr(e,i),this.cullComputeWorldScene=new pr(e,i),this.cullCompute=new Kr(e,i),this.instancedCull=new Wa(e),this.indirectSlice=new _a(e,i.indirectArgs),this.hiZ=new oo(e),this.cullCompute.attachHiZ(this.hiZ);const s=this.#yd;s.add(this.bucketEncoder),s.add(this.cullCompute),s.add(this.instancedCull),s.add(this.indirectSlice),s.add(this.hiZ),s.add(this.renderWorldScene),s.add(this.cullComputeWorldScene),s.add(this.geometryTables),s.add(this.textureTables),s.add(this.samplerTables),s.add(this.materialTables),s.add(this.defaultRenderContext),s.add(this.renderObjects),s.add(i),s.add(this.pipelineCache);const n=new WeakRef(s);return d.register(this,()=>{const A=n.deref();try{A?.forEach(A=>{A.dispose?.()}),A?.clear(),It.flush(e)}catch(t){console.error("WebGPURenderer GC dispose error",t)}try{e.destroy?.()}catch(t){console.error("WebGPURenderer GC dispose error",t)}}),this.#Ed(),!0}async#Qd(){const A=await navigator.gpu.requestAdapter({powerPreference:this.config.powerPreference})||await navigator.gpu.requestAdapter();if(!A)throw new Error("Failed to get WebGPU adapter");this.adapter=A;const t=A.limits,e={maxStorageBuffersPerShaderStage:t.maxStorageBuffersPerShaderStage,maxComputeWorkgroupStorageSize:t.maxComputeWorkgroupStorageSize,maxComputeInvocationsPerWorkgroup:t.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupsPerDimension:t.maxComputeWorkgroupsPerDimension,maxBufferSize:t.maxBufferSize,maxStorageBufferBindingSize:t.maxStorageBufferBindingSize,maxUniformBufferBindingSize:t.maxUniformBufferBindingSize};try{this.device=await A.requestDevice({requiredFeatures:Array.from(A.features),requiredLimits:e})}catch{try{this.device=await A.requestDevice({requiredLimits:e})}catch{this.device=await A.requestDevice()}}this.device.lost.then(A=>{this.#dd=0,this.#pd=null,"destroyed"!==A.reason&&this.onDeviceLost?.(A)}),this.format=this.getPreferredCanvasFormat(),this.clipPipelineMode=this.device.features.has(MA.ClipDistances)?"hybrid":"soft",await async function(A){await Promise.all([Cn(A),Ot(A)])}(this.adapter)}#Ed(){this.#wd={device:this.device,pipelineCache:this.pipelineCache,renderWorldScene:this.renderWorldScene,cullComputeWorldScene:this.cullComputeWorldScene,renderObjects:this.renderObjects,geometryTables:this.geometryTables,materialTables:this.materialTables,worldStore:this.worldStore,residency:this.#ud,deformers:this.#gd,instancedCull:this.instancedCull,cullCompute:this.cullCompute,indirectSlice:this.indirectSlice,hiZ:this.hiZ,bucketEncoder:this.bucketEncoder,frame:this.#Ln,run:this.#Cd}}getDomElement(){return this.canvas}getPreferredCanvasFormat(){const A=this.config.outputType;if(A===yA.UnByteType)return W.BGRA8Unorm;if(A===yA.HalfFloatType)return W.RGBA16Float;const t=navigator.gpu.getPreferredCanvasFormat();return"bgra8unorm"===t?W.BGRA8UnormSRGB:"rgba8unorm"===t?W.RGBA8UnormSRGB:t}_timings={camera:0,commit:0,matrixUpload:0,syncRemoved:0,geometryBeginFrame:0,syncAdded:0,syncStructure:0,syncPipeline:0,prepare:0,buildArgs:0,cull:0,encode:0,prepareSyncDirty:0,syncMorphActive:0,syncSkinActive:0,prepareGeometry:0,prepareMaterials:0,prepareWorldMatrix:0,prepareGeometryMeta:0,prepareBounding:0,prepareInstanceMeta:0,drawRecord:0,drawExecute:0,submit:0,flush:0,frames:0,dirtyCount:0,geometryDirtyCount:0,addedCount:0,removedCount:0,activeMeshCount:0,batchCount:0,bundleHits:0,bundleFallbacks:0,encodeBundleExec:0,encodeSuffix:0,encodeFullRecord:0,frameCull:0,frameEncode:0};onQueueSubmit=null;onDeviceLost=null;shrinkToFit(A=0){return!this.currentRenderContext&&!!this.worldStore.shrinkToFit(A)&&(this.pipelineCache.clearCommonSenceBG(this.renderWorldScene,!0),this.pipelineCache.clearCommonSenceBG(this.cullComputeWorldScene,!1),this.cullCompute.clearBindGroups(),this.geometryTables.invalidateMegaBindGroups(),!0)}_lastFrame=yc();resetTimings(){const A=this._timings;A.camera=A.commit=A.matrixUpload=A.syncRemoved=0,A.geometryBeginFrame=A.syncAdded=A.syncStructure=A.syncPipeline=0,A.prepare=A.buildArgs=A.cull=A.encode=0,A.encodeBundleExec=A.encodeSuffix=A.encodeFullRecord=0,A.prepareSyncDirty=A.syncMorphActive=A.syncSkinActive=A.prepareGeometry=A.prepareMaterials=0,A.prepareWorldMatrix=A.prepareGeometryMeta=0,A.prepareBounding=A.prepareInstanceMeta=0,A.drawRecord=A.drawExecute=A.submit=A.flush=0,A.frames=0,A.dirtyCount=A.geometryDirtyCount=A.addedCount=A.removedCount=A.activeMeshCount=0,A.batchCount=0,A.bundleHits=A.bundleFallbacks=0,A.encodeBundleExec=A.encodeSuffix=A.encodeFullRecord=0,A.frameCull=A.frameEncode=0;const t=this._lastFrame;for(let e=0;e<wc.length;e++)t[wc[e]]=0}compileAsync(A,t,e){return this.pipelineCache.compileVariantsAsync(()=>this.render(A,t,e))}render(A,t,e,i){if(2!==this.#dd)return;if(this.#xd(A,t,e,i))return;const s=!0===i?.skipCull,n=s||!0===i?.skipCommit;n||null!=this.currentRenderContext||null===this.#hd||this.#Dd();const r=i?.encoder,a=e||this.defaultRenderContext,o=this.#Ln,l=o.post;o.hasRegistered&&(o.refresh(),o.releaseHdrIfIdle(l),o.capture(A,t,a));const c=(null!=l||o.needsHdr)&&a.isCanvasRender,h=a.isCanvasRender&&(c||o.hasPresentUser||o.hasAfterPresent)?a:null,u=c?o.prepare(this.device,a):a;this.currentRenderContext=u,o.hasRegistered&&(o.frameDrawRC=u);const g=A.dirtySystem,d=this.device,p=this.renderWorldScene,f=this.cullComputeWorldScene,m=this.pipelineCache,C=this.renderObjects,w=this.geometryTables,y=this.worldStore,{geometryMeta:B,instanceMeta:I,indirectArgs:Q,cullSourceIndices:E,instanceIndices:x,cullBatches:D}=y,{visibleList:M,geometryList:b,addedList:S,removedList:v}=g,T=this._timings,U=this.#md;for(let R=0;R<wc.length;R++){const A=wc[R];U[A]=T[A]}T.frameCull=T.frameEncode=0,n||T.frames++;let N,P=performance.now(),O=0;const F=this.#Cd;F.commitDone=!1,F.frameBuildMs=0;try{const e=u.viewportValue;t.writeScreenSize(e.z>0?e.z:u.width,e.w>0?e.w:u.height),t.update(d,!1),m.setCamera(t),m.setScene(A),m.setCommonSence(p),m.setCullComputeSence(f),N=performance.now(),T.camera+=N-P;const i=this.#fd;i.renderContext=u,i.pipelineCache=m,i.renderObjects=C,i.geometryTables=w,i.geometryMeta=B,i.camera=t,i.indirectArgs=Q,i.sourceIndices=E,i.instanceIndices=x,i.cullBatches=D,i.instanceMeta=I,i.instancedIndirectArgs=this.instancedCull.indirectArgs,i.instancedPackedBuffer=void 0,i.morphActive=y.morphActive,i.bonePalette=y.bonePalette,i.skinActive=y.skinActive;const a=this.#wd;n?(A.lightManager.syncLight(d,null,br(F.lightView,t,u),!0),A.iblManager.sync(d)):function(A,t,e,i,s,n){const r=n._timings,a=A.device,o=t.dirtySystem,{visibleList:l,geometryList:c,materialList:h,addedList:u,removedList:g,structureList:d,pipelineList:p,morphList:f}=o,m=A.renderWorldScene,C=A.cullComputeWorldScene,w=A.pipelineCache,y=A.renderObjects,B=A.geometryTables,I=A.materialTables,Q=A.worldStore,{geometryMeta:E,instanceMeta:x,instanceIndices:D}=Q,M=A.residency,b=A.deformers,S=A.run;let v=performance.now();t.updateMatrixWorld(n);let T=performance.now();r.commit+=T-v,M.sync(g,u,d,p,l,h,i,o,r,S),v=S.cursor,b.syncMorph(f),T=performance.now(),r.syncMorphActive+=T-v,v=T,b.syncSkin(),T=performance.now(),r.syncSkinActive+=T-v,s.morphActive=Q.morphActive,s.bonePalette=Q.bonePalette,s.skinActive=Q.skinActive,v=T,B.uploadDirtyGeometries(c),y.rebinMegaDirtyGeometries(B.peekDrawDirtySlots(),E,x),A.instancedCull.refreshDrawTemplates(B.peekDrawDirtySlots(),E),y.evaluateFamilySupply(E,x,w),T=performance.now(),r.prepareGeometry+=T-v,v=T,y.uploadDirtyMaterials(a,h,I),I.uploadDirtyMaterials(h),T=performance.now(),r.prepareMaterials+=T-v,v=T;const U=m.update();m.geometryMetaReset&&B.invalidateMegaBindGroups();const N=m.updateTimings;r.prepareWorldMatrix+=N.worldMatrix,r.prepareGeometryMeta+=N.geometryMeta;const P=C.update(),O=C.updateTimings;r.prepareBounding+=O.bounding,r.prepareInstanceMeta+=O.instanceMeta,t.lightManager.syncLight(a,o,br(S.lightView,e,i)),t.shadowManager.sync(a,o,t.lightManager.lights,t.lightManager.meta,e),t.iblManager.sync(a),T=performance.now(),r.prepare+=T-S.prepareStart,v=T,r.batchCount=A.bucketEncoder.buildArgs(s,y.slots);const F=D.isTransferDirty;A.cullCompute.update(),(U||F)&&(w.clearCommonSenceBG(m,!0),A.cullCompute.clearBindGroups()),(U||P)&&w.clearCommonSenceBG(C,!1),A.instancedCull.sync({renderObjects:y,geometryTables:B,geometryMeta:Q.geometryMeta,addedList:u,removedList:g,structureList:d}),t.shadowManager.prepare({device:a,pipelineCache:w,geometryTables:B,buckets:y,worldStore:Q,instancedCull:A.instancedCull}),T=performance.now(),S.frameBuildMs=T-v,r.buildArgs+=S.frameBuildMs,S.commitDone=!0}(a,A,t,u,i,this),P=performance.now();const o=r??d.createCommandEncoder({label:n?"Pass":"Frame"});!function(A,t,e,i,s,n,r,a,o,l){const c=A.pipelineCache,h=A.renderObjects,u=A.geometryTables,g=A.worldStore,d=A.device,p=t.dirtySystem,{addedList:f,removedList:m,structureList:C}=p;if(!n){t.shadowManager.cull(s,c),t.shadowManager.cullInstanced(s,c,A.instancedCull),t.shadowManager.encode(s,{device:d,pipelineCache:c,geometryTables:u,buckets:h,worldStore:g,instancedCull:A.instancedCull});const e=A.frame;e.hasAfterShadow&&e.runAfterShadow(s,i,d,c)}let w=!1;!r&&o&&(A.instancedCull.attachHiZ(A.hiZ),A.hiZ.prepare(i)&&(A.cullCompute.clearHiZBindGroups(),A.instancedCull.clearHiZBindGroups()),A.hiZ.active&&(A.hiZ.compute({encoder:s,pipelineCache:c,camera:e}),w=!0)),r||(A.cullCompute.compute({encoder:s,pipelineCache:c,occlusionHiZ:w}),A.instancedCull.compute({encoder:s,pipelineCache:c,renderObjects:h,geometryTables:u,geometryMeta:g.geometryMeta,skipCommit:n,occlusionHiZ:w,addedList:f,removedList:m,structureList:C})),a.instancedPackedBuffer=A.instancedCull.packedGpuBuffer??void 0;const y=0|l;if(a.indirectSliceSize=y,a.indirectSliceActive=!1,a.indirectSliceMax=0,a.sliceIndirectBuffer=void 0,y>0){const t=A.indirectSlice;t.prepare(h.slots,g.indirectArgs.drawCount,y),t.active&&(t.compute({encoder:s,pipelineCache:c}),a.indirectSliceActive=!0,a.indirectSliceMax=t.maxSlices,a.sliceIndirectBuffer=t.gpuBuffer)}c.prefetchRenderCamera(e)}(a,A,t,u,o,n,s,i,this.occlusionHiZ,this.indirectSliceSize),N=performance.now();const c=N-P;T.cull+=c,T.frameCull=c,P=N;const g=function(A,t,e,i,s,n,r,a,o,l,c){const h=A.bucketEncoder,u=A.pipelineCache,g=A.renderObjects.slots,d=A.run.encodeStats,p=A.frame;i.transparentPass=!1,i.sawTransparent=!1,i.pass=e.beginRenderPass(t),h.encodeDraws(i,g),i.pass=void 0,e.finish(),d.hits=h.bundleHits,d.fallbacks=h.bundleFallbacks,d.exec=h.encodeBundleExecMs,d.suffix=h.encodeSuffixMs,d.full=h.encodeFullRecordMs,o&&0===e.activeLayer&&A.hiZ.capture(i.camera);const f=null==s;if(f&&p.hasAfterOpaque&&p.runAfterOpaque(t,e,A.device,u,!!i.sawTransparent&&e.sampleCount>1),i.sawTransparent){p.frameSawTransparent=!0;const s=p.prepareTransparent(A.device,e);i.renderContext=s,i.transparentPass=!0,i.pass=s.beginRenderPass(t),h.encodeDraws(i,g),i.pass=void 0,s.finish(),i.renderContext=e,i.transparentPass=!1,p.compositeTransparent(t,e,u),d.hits+=h.bundleHits,d.fallbacks+=h.bundleFallbacks,d.exec+=h.encodeBundleExecMs,d.suffix+=h.encodeSuffixMs,d.full+=h.encodeFullRecordMs,f&&p.hasAfterTransparent&&p.runAfterTransparent(t,e,A.device,u)}else!n&&p.ownedWboit&&p.dropIdleTransparent();return r&&!s&&p.present(t,r,a,e,l,A.device,u),s||(A.device.queue.submit([t.finish()]),c&&c(A.run.deviceEpoch,++A.run.submissionSequence)),d}(a,o,u,i,r,n,h,l,this.occlusionHiZ,this.currentRenderContext,this.onQueueSubmit);N=performance.now();const M=N-P;if(T.encode+=M,T.frameEncode=M,T.bundleHits+=g.hits,T.bundleFallbacks+=g.fallbacks,T.encodeBundleExec+=g.exec,T.encodeSuffix+=g.suffix,T.encodeFullRecord+=g.full,T.drawRecord+=F.frameBuildMs+c+M,T.submit+=0,T.drawExecute=0,!n)for(const A of C.slots)A&&(O+=A.memberCount)}catch(k){console.error("[render] 帧内异常:",k);try{u.passEncoder&&u.finish()}catch{}try{this.#Ln.finishTransparentIfOpen()}catch{}try{this.#Ln.finishPostIfOpen()}catch{}if(r)throw k}finally{this.pipelineCache.unlockCameraUpload(),P=performance.now(),F.commitDone&&(T.dirtyCount=M.length,T.geometryDirtyCount=b.length,T.addedCount=S.length,T.removedCount=v.length,T.activeMeshCount=O,g.flushFrameQueues()),this.currentRenderContext=null,N=performance.now(),T.flush+=N-P,F.commitDone&&It.tick();const A=this._lastFrame;for(let t=0;t<wc.length;t++){const e=wc[t];A[e]=T[e]-U[e]}T.frameCull=A.cull,T.frameEncode=A.encode}}beginCameraCopyPass(A){this.pipelineCache.beginCameraCopyPass(A)}endCameraCopyPass(){this.pipelineCache.endCameraCopyPass()}#xd(A,t,e,i){const s=t;if(!0!==s.isArrayCamera)return!1;if(s.isMultiViewCamera)return!1;const n=s.cameras,r=n.length;if(0===r)return!1;const a=e||this.defaultRenderContext,o=this.currentRenderContext,l=a.viewport,c=a.scissor,h=a.viewportValue,u=h.x,g=h.y,d=h.z,p=h.w,f=h.minDepth??0,m=h.maxDepth??1,C=a.scissorValue,w=C.x,y=C.y,B=C.z,I=C.w,Q=a.clearColor,E=a.clearDepth,x=a.clearStencil,D=null==i?.encoder,M=i?.encoder??this.device.createCommandEncoder({label:"ArrayCamera"}),b=!0===i?.skipCommit;a.viewport=!0,a.scissor=!0;const S=a.keepMsaaColor;a.keepMsaaColor=!0,this.beginCameraCopyPass(M),this.#Ln.hasRegistered&&(this.#Ln.frameSawTransparent=!1);try{let e=!0;const i=a.width,s=a.height;for(let t=0;t<r;t++){const r=n[t],o=r.viewportRect;let l=0,c=0,h=i,u=s;null!=o&&(l=0|o.x,c=0|o.y,h=0|o.z,u=0|o.w,l<0&&(h+=l,l=0),c<0&&(u+=c,c=0),l+h>i&&(h=i-l),c+u>s&&(u=s-c)),h<1||u<1||(a.setViewport(l,c,h,u),a.setScissor(l,c,h,u),e||(a.clearColor=!1,a.clearDepth=!1,a.clearStencil=!1,a.syncAttachmentLoadOps()),this.render(A,r,a,{skipCommit:!e||b,encoder:M}),e=!1)}const o=this.#Ln;a.isCanvasRender&&(o.hasRegistered||o.post)&&o.presentArray(M,a,A,t,this.device,this.pipelineCache,this.currentRenderContext),D&&this.device.queue.submit([M.finish()])}catch(v){console.error("[ArrayCamera] 分屏渲染失败:",v);try{a.passEncoder&&a.finish()}catch{}if(!D)throw v;try{M.finish()}catch{}}finally{this.endCameraCopyPass(),a.keepMsaaColor=S,a.clearColor=Q,a.clearDepth=E,a.clearStencil=x,a.syncAttachmentLoadOps(),a.viewport=l,a.scissor=c,a.setViewport(u,g,d,p,f,m),a.setScissor(w,y,B,I),this.currentRenderContext=o}return!0}getRenderStats(){let A=0,t=0,e=0,i=0,s=0,n=0,r=0,a=0,o=0,l=0;const c=[];for(const h of this.renderObjects.slots)if(h&&0!==h.memberCount)if(A++,t+=h.memberCount,h.materialTable){e++,s+=h.encodeBatches.length;const A="pull"===h.supply;A?(a++,l+=h.encodeBatches.length):(r++,o+=h.encodeBatches.length),c.push(`${h.bucketId}:${A?"pull":"hw"}`)}else i++,n+=h.encodeBatches.length;return{activeBuckets:A,activeMeshCount:t,batchCount:this.renderObjects.getBatchCount(),megaBuckets:e,legacyBuckets:i,megaEncodeBatches:s,legacyEncodeBatches:n,hwBuckets:r,pullBuckets:a,hwEncodeBatches:o,pullEncodeBatches:l,familySupply:c.join(" ")}}getAssembledShader(A){const t=this.renderObjects.getBucketForMesh(A);return t?.variant?this.pipelineCache.assembleRenderShader(t):null}setSize(A,t,e=!1){const i=this.pixelRatio,s=this.canvas,n=Math.max(1,Math.floor(A*i)),r=Math.max(1,Math.floor(t*i));this.width===A&&this.height===t&&s.width===n&&s.height===r&&this.defaultRenderContext?.width===n&&this.defaultRenderContext?.height===r||(this.width=A,this.height=t,s.width=n,s.height=r,e&&"style"in s&&(s.style.width=`${A}px`,s.style.height=`${t}px`),this.defaultRenderContext?.setSize(n,r))}getSize(){return{width:this.width,height:this.height}}releaseDraw(A){if(this.currentRenderContext)return;if(!(this.worldStore&&this.geometryTables&&this.materialTables&&this.pipelineCache))return;if(!A.isCanRender)return;const t=A.worldStore;t&&t!==this.worldStore||this.#ud.deactivateMesh(A)}deferReleaseDraw(A){let t=this.#hd;null===t&&(t=this.#hd=[]),t.push(A)}#Dd(){if(this.currentRenderContext)return;const A=this.#hd;if(null===A)return;this.#hd=null;const t=A.length;for(let e=0;e<t;e++)this.releaseDraw(A[e])}#Bd(){this.#Cd.deviceEpoch++,this.#Cd.submissionSequence=0,d.unregister(this),this.#Ln.detach(),this.hiZ?.dispose(),this.hiZ=void 0,this.indirectSlice?.dispose(),this.indirectSlice=void 0,this.bucketEncoder.dispose(),this.cullCompute?.dispose(),this.instancedCull?.dispose(),this.renderWorldScene?.dispose(),this.cullComputeWorldScene?.dispose(),this.geometryTables?.dispose(),this.materialTables?.dispose(),this.textureTables?.dispose(),this.samplerTables?.dispose(),this.#Ln.disposeTargets(this.device,!0),this.pipelineCache?.dispose(),this.defaultRenderContext?.dispose(),this.renderObjects.dispose(),this.worldStore?.dispose(),It.flush(this.device),this.device?.destroy?.(),this.#yd.clear(),this.cullCompute=void 0,this.instancedCull=void 0,this.renderWorldScene=void 0,this.cullComputeWorldScene=void 0,this.geometryTables=void 0,this.materialTables=void 0,this.textureTables=void 0,this.samplerTables=void 0,this.pipelineCache=void 0,this.defaultRenderContext=void 0,this.worldStore=void 0,this.device=void 0,this.adapter=void 0}dispose(){null==this.currentRenderContext&&this.#Dd(),this.#hd=null,this.#Bd(),this.#dd=0,this.#pd=null}},exports.WireframeGeometry=class extends Wi{type="WireframeGeometry";parameters;constructor(A=null){super(),this.parameters={geometry:A},null!==A&&this.#jl(A),this.freeze()}#jl(A){const t=A.getAttribute("position"),e=A.index,i=t?e?e.count:t.count:0,s=i-i%3;if(!t||0===t.count||0===s)return this.setAttribute("position",new Fi(new Float32Array(0),3)),void this.computeBoundingBox();const n=t.count,r=new Int32Array(qm(n));r.fill(-1);const a=r.length-1,o=new Uint32Array(n),l=new Uint32Array(n),c=new Uint32Array(n),h=new Int32Array(n),u=new Uint32Array(n);let g=0;const d=0|t.typeInfo.offset,p=t.stride,f=t.view,m=A=>{const t=d+A*p,e=Wm(f[t]),i=Wm(f[t+1]),s=Wm(f[t+2]),n=Xm(e,i,s)&a;for(let a=r[n];a>=0;a=h[a])if(o[a]===e&&l[a]===i&&c[a]===s)return a;const m=g++;return o[m]=e,l[m]=i,c[m]=s,u[m]=A,h[m]=r[n],r[n]=m,m},C=new Int32Array(qm(s));C.fill(-1);const w=C.length-1,y=new Uint32Array(s),B=new Uint32Array(s),I=new Int32Array(s),Q=new Uint32Array(s),E=new Uint32Array(s);let x=0;const D=(A,t)=>{let e=A,i=t;i<e&&(e=t,i=A);const s=Xm(e,i,1)&w;for(let r=C[s];r>=0;r=I[r])if(y[r]===e&&B[r]===i)return;const n=x++;y[n]=e,B[n]=i,I[n]=C[s],C[s]=n,Q[n]=u[A],E[n]=u[t]},M=A=>e?function(A,t){return A.view[(0|A.typeInfo.offset)+t*A.stride]}(e,A):A,b=t.count;for(let U=0;U<s;U+=3){const A=M(U),t=M(U+1),e=M(U+2);if(A<0||t<0||e<0||A>=b||t>=b||e>=b)continue;const i=m(A),s=m(t),n=m(e);D(i,s),D(s,n),D(n,i)}const S=new Float32Array(6*x),v=new Float32Array(3);let T=0;for(let U=0;U<x;U++)Zm(t,Q[U],v,0),S[T++]=v[0],S[T++]=v[1],S[T++]=v[2],Zm(t,E[U],v,0),S[T++]=v[0],S[T++]=v[1],S[T++]=v[2];this.setAttribute("position",new Fi(S,3)),this.computeBoundingBox()}copy(A){return super.copy(A),this.parameters={...A.parameters},this.computeBoundingBox(),this}},exports.WorldRuntime=class{entities;pages;manifest;pendingBatch=!1;retiredPagesLastSubmit=0;submitted;batchOp;batchPageId;batchCount=0;retirePageId;retireCount=0;submittedVisualPage;entityDirty;entityDirtySlots;entityDirtyCount=0;batchEntityOp;batchEntitySlot;batchEntityPageId;batchEntityCount=0;maxMutations;dynamicLayer;dynamicGrid;aggregatePageIdByCell;cellHash;cellHashMask;staticPrepareEpoch;staticDirectPrepareEpoch;staticActivateEpoch;manualStaticWanted;staticEpoch=1;staticCurrent;staticCurrentCount=0;staticNext;staticNextCount=0;replacementHead;replacementNext;cellCutState;cellDemandEpoch;cellDemandState;cellEpoch=1;dynamicCurrent;dynamicCurrentCount=0;dynamicNext;dynamicNextCount=0;cellPreloadEpoch;cellPreloaded;preloadCurrent;preloadCurrentCount=0;preloadNext;preloadNextCount=0;maxViews;viewStride;lastViewCellX;lastViewCellY;lastViewCellZ;lastPredCellX;lastPredCellY;lastPredCellZ;lastViewId;lastViewFlags;lastViewImportance;lastViewCount=-1;preloadLeadSeconds;primaryImportance=1;pressureStep=0;requireFullSlots;requireFullAt;requireFullCount=0;aggregateWanted;protoPage;spawnScratch={cellId:0};posePatch={};constructor(A){const t=A.manifest??null,e=t?null:A.dynamicGrid??null,i=t?t.cellCount:e?function(A){const t=[A.cellSizeX,A.cellSizeY,A.cellSizeZ,A.countX,A.countY,A.countZ];for(let i=0,s=t.length;i<s;i++){const A=t[i];if(!Number.isFinite(A)||A<=0)throw new Error("WorldRuntime dynamicGrid has invalid size or count")}if(!(Number.isInteger(A.countX)&&Number.isInteger(A.countY)&&Number.isInteger(A.countZ)&&Number.isInteger(A.minCellX)&&Number.isInteger(A.minCellY)&&Number.isInteger(A.minCellZ)&&Number.isFinite(A.originX)&&Number.isFinite(A.originY)&&Number.isFinite(A.originZ)&&Number.isFinite(A.interestRange))||A.interestRange<0||!Number.isFinite(A.aggregateRange)||A.aggregateRange<A.interestRange)throw new Error("WorldRuntime dynamicGrid has invalid ranges");const e=A.countX*A.countY*A.countZ;if(!Number.isSafeInteger(e)||e<=0||e>4294967295)throw new Error("WorldRuntime dynamicGrid cell count is invalid");return e}(e):1,s=t?A.dynamicLayer??Math.min(1,t.layers.length-1):0;if(t&&(!Number.isInteger(s)||s<0||s>=t.layers.length))throw new Error("WorldRuntime.dynamicLayer is out of range");this.manifest=t,this.dynamicGrid=e,this.dynamicLayer=s,this.pages=new II({manifest:t,runtimePageCapacity:A.runtimePageCapacity??0,budget:A.budget,source:A.source,decoder:A.decoder,maxInflightJobs:A.maxInflightJobs??4}),this.entities=new GB(Math.max(1,A.entityCapacity??1024),i),this.submitted=new Uint8Array(this.pages.pageCount),this.maxMutations=A.budget.maxActivationMutationsPerFrame;const n=Math.max(1,this.maxMutations);this.batchOp=new Uint8Array(n),this.batchPageId=new Int32Array(n),this.retirePageId=new Int32Array(n),this.submittedVisualPage=new Uint32Array(this.entities.capacity),this.submittedVisualPage.fill(RB),this.entityDirty=new Uint8Array(this.entities.capacity),this.entityDirtySlots=new Uint32Array(this.entities.capacity),this.batchEntityOp=new Uint8Array(n),this.batchEntitySlot=new Uint32Array(n),this.batchEntityPageId=new Uint32Array(n);const r=t?function(A){let t=1;for(;t<A;)t*=2;return t}(Math.max(4,2*t.cellCount)):1;if(this.cellHash=new Int32Array(r),this.cellHash.fill(-1),this.cellHashMask=r-1,t){const A=this.cellHash,e=this.cellHashMask,i=t.cells;for(let s=0,n=t.cellCount;s<n;s++){let t=bI(i.layer[s],i.x[s],i.y[s],i.z[s])&e;for(;-1!==A[t];)t=t+1&e;A[t]=s}}const a=this.pages.pageCount;this.staticPrepareEpoch=new Uint32Array(a),this.staticDirectPrepareEpoch=new Uint32Array(a),this.staticActivateEpoch=new Uint32Array(a),this.manualStaticWanted=new Uint8Array(a),this.staticCurrent=new Uint32Array(a),this.staticNext=new Uint32Array(a);const o=new Int32Array(a),l=new Int32Array(a);if(o.fill(-1),l.fill(-1),t){const A=t.pages;for(let e=0;e<t.pageCount;e++){const t=A.replacementPageId[e];t!==eI&&(l[e]=o[t],o[t]=e)}}this.replacementHead=o,this.replacementNext=l,this.cellCutState=new Uint8Array(i),this.cellCutState.fill(LB.Dormant),this.cellDemandEpoch=new Uint32Array(i),this.cellDemandState=new Uint8Array(i),this.dynamicCurrent=new Uint32Array(i),this.dynamicNext=new Uint32Array(i),this.cellPreloadEpoch=new Uint32Array(i),this.cellPreloaded=new Uint8Array(i),this.preloadCurrent=new Uint32Array(i),this.preloadNext=new Uint32Array(i);const c=A.aggregatePageIdByCell??null;if(c&&c.length!==i)throw new Error("WorldRuntime.aggregatePageIdByCell length mismatch");if(this.aggregatePageIdByCell=c,this.maxViews=Math.max(1,A.maxViews??8),!Number.isSafeInteger(this.maxViews))throw new Error("WorldRuntime.maxViews must be a positive safe integer");this.viewStride=t?.layers.length??1;const h=this.maxViews*this.viewStride;this.lastViewCellX=new Int32Array(h),this.lastViewCellY=new Int32Array(h),this.lastViewCellZ=new Int32Array(h),this.lastPredCellX=new Int32Array(h),this.lastPredCellY=new Int32Array(h),this.lastPredCellZ=new Int32Array(h),this.lastViewId=new Float64Array(this.maxViews),this.lastViewFlags=new Uint32Array(this.maxViews),this.lastViewImportance=new Float64Array(this.maxViews);const u=A.preloadLeadSeconds??2;if(!Number.isFinite(u)||u<0)throw new Error("WorldRuntime.preloadLeadSeconds must be a non-negative finite number");this.preloadLeadSeconds=u,this.requireFullSlots=new Uint32Array(64),this.requireFullAt=new Int32Array(this.entities.capacity),this.requireFullAt.fill(-1),this.aggregateWanted=new Uint32Array(a),this.protoPage=new Uint8Array(a),!1!==A.requestL0&&t&&this.pages.requestL0Coverage(yI.Coverage)}get hasPendingBatch(){return this.pendingBatch}update(A,t){const e=this.#Md();(this.#bd(A)||e)&&(this.#Sd(A),this.#vd(A),this.pressureStep>0&&this.pages.cancelLane(yI.Refinement)),this.pages.pump()}setStaticPageWanted(A,t,e=yI.Coverage){if(A<0||A>=this.pages.staticPageCount)return;this.manualStaticWanted[A]=t?1:0;const i=this.staticPrepareEpoch[A]===this.staticEpoch;this.pages.setStaticWanted(A,t||i,e)}registerDynamicPage(A){return this.pages.registerRuntimePage(A)}unregisterDynamicPage(A){const t=this.pages.unregisterRuntimePage(A);return t&&A>=0&&A<this.protoPage.length&&(this.protoPage[A]=0),t}createProtoPage(A,t,e){const i=this.pages.registerRuntimePage(xI(e));if(i<0)return i;const s=this.entities.capacity,n=e;return this.pages.setSyncPrepare(i,()=>new DI(A,t,n,s)),this.protoPage[i]=1,i}spawn(A){const t=A;let e=t.cellId??-1;if(Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.z)){const A=this.cellIdAt(t.x,t.y,t.z);A>=0&&(e=A)}if(e<0)return 0;let i=t.visualPageId??RB;void 0!==t.proto&&(i=t.proto);const s=this.spawnScratch;return s.cellId=e,s.visualPageId=i,s.protoBundleId=t.protoBundleId??RB,s.flags=t.flags,s.simState=t.simState,this.#Td(s)}#Td(A){const t=this.entities,e=t.spawn(A);if(0===e)return e;const i=t.getSlot(e),s=t.cellId[i],n=this.cellCutState[s];return t.simState[i]=this.#Ud(i,n),n===LB.Aggregate&&1===t.cellCount[s]&&this.#Nd(s,!0),this.cellPreloaded[s]&&this.#Pd(t.visualPageId[i],!0),this.#Od(t.visualPageId[i],t.simState[i],!0),this.#Fd(i),this.#kd(t.simState[i])&&this.#Rd(i),e}despawn(A){const t=this.entities,e=t.getSlot(A);if(e===kB)return;const i=t.cellId[e];this.cellCutState[i]===LB.Aggregate&&1===t.cellCount[i]&&this.#Nd(i,!1),this.cellPreloaded[i]&&this.#Pd(t.visualPageId[e],!1),this.#Od(t.visualPageId[e],t.simState[e],!1),this.#Ld(e),t.simState[e]=LB.Dormant;const s=t.generation[e];t.beginDespawn(A),this.submittedVisualPage[e]===RB?t.finishDespawn(e,s):this.#Rd(e)}setEntityState(A,t){const e=this.entities,i=e.getSlot(A);if(i===kB)return;const s=e.visualPageId[i],n=e.simState[i],r=e.cellId[i];if(void 0!==t.cellId&&t.cellId!==r){this.cellPreloaded[r]&&this.#Pd(s,!1),this.cellCutState[r]===LB.Aggregate&&1===e.cellCount[r]&&this.#Nd(r,!1),this.entities.moveToCell(A,t.cellId);const n=this.entities.cellId[i];this.cellCutState[n]===LB.Aggregate&&1===e.cellCount[n]&&this.#Nd(n,!0),this.cellPreloaded[n]&&this.#Pd(s,!0)}void 0!==t.visualPageId&&e.setVisualPageId(A,t.visualPageId),void 0!==t.protoBundleId&&e.setProtoBundleId(A,t.protoBundleId),void 0!==t.flags&&(e.flags[i]=t.flags,this.#Fd(i));const a=this.cellCutState[e.cellId[i]];e.setSimulationState(A,t.simState??this.#Ud(i,a));const o=e.visualPageId[i],l=e.simState[i];o!==s&&this.cellPreloaded[e.cellId[i]]&&(this.#Pd(s,!1),this.#Pd(o,!0)),l===n&&o===s||(this.#Od(s,n,!1),this.#Od(o,l,!0),this.#Rd(i))}setPose(A,t,e,i,s){const n=this.entities,r=n.getSlot(A);if(r===kB)return;const a=this.cellIdAt(t,e,i);if(a>=0&&a!==n.cellId[r]){const t=this.posePatch;t.cellId=a,this.setEntityState(A,t)}this.pages.preparedContent(n.visualPageId[r])?.setPose?.(r,t,e,i,s)}sync(A,t,e=0){this.update(t,e),this.commit(A)}noteSubmit(A,t=0,e=0){this.onFrameSubmit(A,t,e)}commit(A){if(this.pendingBatch)return;this.pages.usage.activationMutationsThisFrame=0,this.batchCount=0,this.batchEntityCount=0;const t=this.pages.state,e=this.pages.residentPages,i=this.pages.residentCount,s=this.maxMutations,n=this.submitted;for(let f=0;f<i;f++){const A=e[f];n[A]||!this.#jd(A)||t[A]!==wI.Ready||this.#zd(A)||this.#Gd(2,A,s)}for(let f=0;f<i;f++){const A=e[f];!n[A]||this.#jd(A)||t[A]!==wI.Active||this.#zd(A)||this.#Gd(1,A,s)}this.#Yd();for(let f=0;f<i;f++){const A=e[f];n[A]&&!this.#jd(A)&&t[A]===wI.Active&&this.#zd(A)&&this.#Gd(1,A,s)}for(let f=0;f<i;f++){const A=e[f];!n[A]&&this.#jd(A)&&t[A]===wI.Ready&&this.#zd(A)&&this.#Gd(2,A,s)}if(0===this.batchCount&&0===this.batchEntityCount)return void this.#Hd();const r=this.batchOp,a=this.batchPageId,o=this.retirePageId,l=this.pages,c=this.entities;let h=this.retireCount;for(let f=0;f<this.batchCount;f++){if(1!==r[f])continue;const t=a[f],e=l.roots[t];if(e)for(let i=0;i<e.length;i++)e[i].parent===A&&A.remove(e[i]);l.beginRetire(t),n[t]=0,o[h++]=t}this.retireCount=h;const u=this.batchEntityOp,g=this.batchEntitySlot,d=this.batchEntityPageId,p=this.submittedVisualPage;for(let f=0;f<this.batchEntityCount;f++){if(1!==u[f])continue;const A=g[f],t=d[f];l.removeEntity(t,c.entityId[A],A),p[A]=RB}for(let f=0;f<this.batchCount;f++){if(2!==this.batchOp[f])continue;const t=a[f],e=l.roots[t];if(e)for(let i=0;i<e.length;i++)A.add(e[i]);l.markActive(t),n[t]=1}for(let f=0;f<this.batchEntityCount;f++){if(2!==u[f])continue;const A=g[f],t=d[f];l.addEntity(t,c.entityId[A],A),p[A]=t}this.pendingBatch=!0}onFrameSubmit(A,t,e){if("device-lost"===A){this.pages.dropGpuKeepWanted(),this.submitted.fill(0),this.submittedVisualPage.fill(RB),this.entityDirty.fill(0),this.entityDirtyCount=0;for(let A=0;A<this.entities.capacity;A++)this.entities.retiring[A]?this.entities.finishDespawn(A,this.entities.generation[A]):0!==this.entities.entityId[A]&&this.#kd(this.entities.simState[A])&&this.#Rd(A);return this.retireCount=0,this.batchCount=0,this.batchEntityCount=0,this.pendingBatch=!1,void(this.retiredPagesLastSubmit=0)}if(!this.pendingBatch)return void(this.retiredPagesLastSubmit=0);this.retiredPagesLastSubmit=this.retireCount;const i=this.pages,s=this.retirePageId;for(let n=0;n<this.retireCount;n++){const A=s[n];i.finishRetire(A,i.wanted(A))}this.retireCount=0,this.batchCount=0,this.batchEntityCount=0,this.pendingBatch=!1,this.#Hd(),this.#Kd()}getStats(A){let t=0,e=0,i=0;const s=this.pages.state,n=this.pages.residentPages,r=this.pages.residentCount;for(let o=0;o<r;o++){const A=n[o];s[A]===wI.Ready?t++:s[A]===wI.Active?e++:s[A]===wI.Retiring&&i++}A.entityCount=this.entities.count,A.pendingBatch=this.pendingBatch,A.pageReady=t,A.pageActive=e,A.pageRetiring=i,A.retiredPagesLastSubmit=this.retiredPagesLastSubmit,A.pressureStep=this.pressureStep;let a=0;this.forEachVisualEntity(()=>{a++}),A.visualEntityCount=a,A.usage=this.pages.usage,A.columns=this.pages.columns}dispose(){this.pages.dispose(),this.submitted.fill(0),this.retireCount=0,this.pendingBatch=!1,this.retiredPagesLastSubmit=0}cellIdAt(A,t,e){if(this.manifest){const i=this.manifest.layers[this.dynamicLayer],s=Math.floor((A-i.originX)/i.cellSizeX),n=Math.floor((t-i.originY)/i.cellSizeY),r=Math.floor((e-i.originZ)/i.cellSizeZ);return this.#Vd(this.dynamicLayer,s,n,r)}const i=this.dynamicGrid;if(!i)return-1;const s=Math.floor((A-i.originX)/i.cellSizeX),n=Math.floor((t-i.originY)/i.cellSizeY),r=Math.floor((e-i.originZ)/i.cellSizeZ);if(s<i.minCellX||s>=i.minCellX+i.countX||n<i.minCellY||n>=i.minCellY+i.countY||r<i.minCellZ||r>=i.minCellZ+i.countZ)return-1;const a=s-i.minCellX,o=n-i.minCellY,l=r-i.minCellZ;return a+i.countX*(o+i.countY*l)}forEachVisualEntity(A){const t=this.entities,e=this.cellEpoch,i=this.dynamicCurrent;for(let r=0;r<this.dynamicCurrentCount;r++){const e=i[r];let s=t.cellHead[e];for(;s!==kB;)this.#kd(t.simState[s])&&A(s,t.entityId[s],e),s=t.nextInCell[s]}const s=this.requireFullSlots,n=this.cellDemandEpoch;for(let r=0;r<this.requireFullCount;r++){const i=s[r];if(!this.#kd(t.simState[i]))continue;const a=t.cellId[i];n[a]!==e&&A(i,t.entityId[i],a)}}forEachSimulated(A){this.forEachVisualEntity(A)}#Jd(A,t,e){this.batchOp[this.batchCount]=A,this.batchPageId[this.batchCount]=t,this.batchCount++,this.pages.usage.activationMutationsThisFrame+=e}#Gd(A,t,e){const i=this.pages.pageCost(t).activationMutations;return!(this.pages.usage.activationMutationsThisFrame+i>e||(this.#Jd(A,t,i),0))}#Rd(A){this.entityDirty[A]||(this.entityDirty[A]=1,this.entityDirtySlots[this.entityDirtyCount++]=A)}#Yd(){const A=this.pages.usage,t=this.entityDirty,e=this.entityDirtySlots,i=this.submittedVisualPage,s=this.entities,n=this.pages;for(let r=0;r<this.entityDirtyCount;r++){const a=e[r];if(!t[a])continue;const o=i[a],l=s.retiring[a]?RB:this.#Wd(a);if(o===l){this.entityDirty[a]=0;continue}let c=!1;if(o!==RB){const t=this.#qd(o);if(c=!(t&&!n.wanted(o))&&n.hasEntityWriter(o),c){if(A.activationMutationsThisFrame>=this.maxMutations){t&&this.#Xd(o);continue}this.#Zd(1,a,o)}else i[a]=RB}if(l!==RB){if(this.#_d(l))if(n.hasEntityWriter(l)){if(A.activationMutationsThisFrame>=this.maxMutations)continue;this.#Zd(2,a,l)}else c||(i[a]=l,t[a]=0)}else c||(t[a]=0,s.retiring[a]&&s.finishDespawn(a,s.generation[a]))}}#Zd(A,t,e){this.batchEntityOp[this.batchEntityCount]=A,this.batchEntitySlot[this.batchEntityCount]=t,this.batchEntityPageId[this.batchEntityCount]=e,this.batchEntityCount++,this.pages.usage.activationMutationsThisFrame++}#_d(A){if(this.submitted[A]&&this.#jd(A))return!0;const t=this.batchOp,e=this.batchPageId;for(let i=0;i<this.batchCount;i++)if(2===t[i]&&e[i]===A)return!0;return!1}#qd(A){const t=this.batchOp,e=this.batchPageId;for(let i=0;i<this.batchCount;i++)if(1===t[i]&&e[i]===A)return!0;return!1}#Xd(A){const t=this.batchOp,e=this.batchPageId,i=this.pages;for(let s=0;s<this.batchCount;s++){if(1!==t[s]||e[s]!==A)continue;const n=i.pageCost(A).activationMutations;i.usage.activationMutationsThisFrame-=n;const r=--this.batchCount;return void(s!==r&&(t[s]=t[r],e[s]=e[r]))}}#Wd(A){if(!this.#kd(this.entities.simState[A]))return RB;const t=this.entities.visualPageId[A];return t<this.pages.pageCount?t:RB}#kd(A){return A===LB.Full||A===LB.Reduced}#Hd(){let A=0;const t=this.entityDirty,e=this.entityDirtySlots,i=this.entities;this.pages;const s=this.submittedVisualPage;for(let n=0;n<this.entityDirtyCount;n++){const r=e[n];if(!this.entityDirty[r])continue;const a=i.retiring[r]?RB:this.#Wd(r);s[r]!==a?e[A++]=r:(t[r]=0,i.retiring[r]&&i.finishDespawn(r,i.generation[r]))}this.entityDirtyCount=A}#bd(A){if(A.length>this.maxViews)throw new Error(`WorldRuntime views(${A.length}) exceed maxViews(${this.maxViews})`);let t=A.length!==this.lastViewCount;const e=this.manifest,i=this.preloadLeadSeconds;let s=1;for(let n=0;n<A.length;n++){const t=A[n].importance??1;t>s&&(s=t)}(this.lastViewCount<0||s!==this.primaryImportance)&&(t=!0,this.primaryImportance=s);for(let n=0;n<A.length;n++){const s=A[n],r=s.position;if(r.length<3)continue;const a=s.viewId??n,o=s.flags??0,l=s.importance??1;this.lastViewId[n]===a&&this.lastViewFlags[n]===o||(t=!0,this.lastViewId[n]=a,this.lastViewFlags[n]=o),this.lastViewImportance[n]!==l&&(t=!0,this.lastViewImportance[n]=l);const c=s.velocity&&s.velocity.length>=3?s.velocity[0]:0,h=s.velocity&&s.velocity.length>=3?s.velocity[1]:0,u=s.velocity&&s.velocity.length>=3?s.velocity[2]:0,g=r[0]+c*i,d=r[1]+h*i,p=r[2]+u*i;for(let A=0;A<this.viewStride;A++){const i=e?e.layers[A]:this.dynamicGrid;if(!i)continue;const s=n*this.viewStride+A,a=Math.floor((r[0]-i.originX)/i.cellSizeX),o=Math.floor((r[1]-i.originY)/i.cellSizeY),l=Math.floor((r[2]-i.originZ)/i.cellSizeZ),c=Math.floor((g-i.originX)/i.cellSizeX),h=Math.floor((d-i.originY)/i.cellSizeY),u=Math.floor((p-i.originZ)/i.cellSizeZ);(this.lastViewCount<0||this.lastViewCellX[s]!==a||this.lastViewCellY[s]!==o||this.lastViewCellZ[s]!==l||this.lastPredCellX[s]!==c||this.lastPredCellY[s]!==h||this.lastPredCellZ[s]!==u)&&(t=!0,this.lastViewCellX[s]=a,this.lastViewCellY[s]=o,this.lastViewCellZ[s]=l,this.lastPredCellX[s]=c,this.lastPredCellY[s]=h,this.lastPredCellZ[s]=u)}}return this.lastViewCount=A.length,t}#Sd(A){const t=this.manifest;if(!t)return;let e=this.staticEpoch+1>>>0;0===e&&(this.staticPrepareEpoch.fill(0),this.staticDirectPrepareEpoch.fill(0),this.staticActivateEpoch.fill(0),e=1),this.staticEpoch=e,this.staticNextCount=0;for(let r=0;r<A.length;r++){const e=A[r],i=e.position;if(i.length<3)continue;const s=!!(1&(e.flags??0)),n=e.importance??1,a=e.velocity&&e.velocity.length>=3?e.velocity[0]:0,o=e.velocity&&e.velocity.length>=3?e.velocity[1]:0,l=e.velocity&&e.velocity.length>=3?e.velocity[2]:0;for(let A=1;A<t.layers.length;A++){if(this.pressureStep>0&&A>=2)continue;const e=t.layers[A],r=Math.max(e.cellSizeX,e.cellSizeY,e.cellSizeZ),c=this.#$d(e.loadingRange,r,n),h=e.originX+(Math.floor((i[0]-e.originX)/e.cellSizeX)+.5)*e.cellSizeX,u=e.originY+(Math.floor((i[1]-e.originY)/e.cellSizeY)+.5)*e.cellSizeY,g=e.originZ+(Math.floor((i[2]-e.originZ)/e.cellSizeZ)+.5)*e.cellSizeZ;if(this.#Ap(A,h,u,g,c,s),s||0===a&&0===o&&0===l)continue;const d=i[0]+a*this.preloadLeadSeconds,p=i[1]+o*this.preloadLeadSeconds,f=i[2]+l*this.preloadLeadSeconds,m=e.originX+(Math.floor((d-e.originX)/e.cellSizeX)+.5)*e.cellSizeX,C=e.originY+(Math.floor((p-e.originY)/e.cellSizeY)+.5)*e.cellSizeY,w=e.originZ+(Math.floor((f-e.originZ)/e.cellSizeZ)+.5)*e.cellSizeZ;this.#Ap(A,m,C,w,c,!0)}}const i=this.pages.residentPages,s=this.pages.residentCount;for(let r=0;r<s;r++){const A=i[r];if(A>=t.pageCount||0===this.submitted[A])continue;const e=t.pages.replacementPageId[A];e!==eI&&this.#tp(e,!1)}for(let r=0;r<this.staticNextCount;r++){const A=this.staticNext[r],e=t.pages.replacementPageId[A];e!==eI&&this.#tp(e,!1)}for(let r=0;r<this.staticCurrentCount;r++){const A=this.staticCurrent[r];this.staticPrepareEpoch[A]!==e&&0!==t.cells.layer[t.pages.cellId[A]]&&0===this.manualStaticWanted[A]&&this.pages.setStaticWanted(A,!1,yI.Refinement)}for(let r=0;r<this.staticNextCount;r++){const A=this.staticNext[r],i=t.cells.layer[t.pages.cellId[A]],s=this.staticDirectPrepareEpoch[A]!==e?yI.Fallback:1===i?yI.Incoming:yI.Refinement;this.pages.setStaticWanted(A,!0,s)}const n=this.staticCurrent;this.staticCurrent=this.staticNext,this.staticNext=n,this.staticCurrentCount=this.staticNextCount}#Ap(A,t,e,i,s,n){const r=this.manifest,a=r.layers[A],o=Math.floor((t-s-a.originX)/a.cellSizeX),l=Math.floor((t+s-a.originX)/a.cellSizeX),c=Math.floor((e-s-a.originY)/a.cellSizeY),h=Math.floor((e+s-a.originY)/a.cellSizeY),u=Math.floor((i-s-a.originZ)/a.cellSizeZ),g=Math.floor((i+s-a.originZ)/a.cellSizeZ),d=s*s,p=r.cells;for(let f=u;f<=g;f++)for(let s=c;s<=h;s++)for(let r=o;r<=l;r++){const o=this.#Vd(A,r,s,f);if(o<0||!this.#ep(t,e,i,d,a,r,s,f))continue;const l=p.pageStart[o],c=l+p.pageCount[o];for(let A=l;A<c;A++)this.#tp(A,!n,!0)}}#tp(A,t,e=!1){const i=this.staticEpoch;this.staticPrepareEpoch[A]!==i&&(this.staticPrepareEpoch[A]=i,this.staticNext[this.staticNextCount++]=A),e&&(this.staticDirectPrepareEpoch[A]=i),t&&(this.staticActivateEpoch[A]=i)}#Vd(A,t,e,i){const s=this.manifest.cells;let n=bI(A,t,e,i)&this.cellHashMask;for(;;){const r=this.cellHash[n];if(r<0)return-1;if(s.layer[r]===A&&s.x[r]===t&&s.y[r]===e&&s.z[r]===i)return r;n=n+1&this.cellHashMask}}#ep(A,t,e,i,s,n,r,a){const o=s.originX+n*s.cellSizeX,l=s.originY+r*s.cellSizeY,c=s.originZ+a*s.cellSizeZ,h=o+s.cellSizeX,u=l+s.cellSizeY,g=c+s.cellSizeZ,d=A<o?o-A:A>h?A-h:0,p=t<l?l-t:t>u?t-u:0,f=e<c?c-e:e>g?e-g:0;return d*d+p*p+f*f<=i}#vd(A){let t=this.cellEpoch+1>>>0;0===t&&(this.cellDemandEpoch.fill(0),t=1),this.cellEpoch=t,this.dynamicNextCount=0,this.preloadNextCount=0;for(let s=0;s<A.length;s++){const t=A[s],e=t.position;if(e.length<3)continue;const i=!!(1&(t.flags??0)),n=t.importance??1;if(this.manifest){const A=this.manifest.layers[this.dynamicLayer],s=Math.max(A.cellSizeX,A.cellSizeY,A.cellSizeZ),r=this.#$d(A.loadingRange,s,n),a=r+s,o=A.originX+(Math.floor((e[0]-A.originX)/A.cellSizeX)+.5)*A.cellSizeX,l=A.originY+(Math.floor((e[1]-A.originY)/A.cellSizeY)+.5)*A.cellSizeY,c=A.originZ+(Math.floor((e[2]-A.originZ)/A.cellSizeZ)+.5)*A.cellSizeZ;if(i){this.#ip(o,l,c,r,LB.Full,!0);continue}0===this.pressureStep&&this.#ip(o,l,c,a,LB.Aggregate),this.#ip(o,l,c,r,LB.Full);const h=t.velocity&&t.velocity.length>=3?t.velocity[0]:0,u=t.velocity&&t.velocity.length>=3?t.velocity[1]:0,g=t.velocity&&t.velocity.length>=3?t.velocity[2]:0;if(0===h&&0===u&&0===g)continue;const d=A.originX+(Math.floor((e[0]+h*this.preloadLeadSeconds-A.originX)/A.cellSizeX)+.5)*A.cellSizeX,p=A.originY+(Math.floor((e[1]+u*this.preloadLeadSeconds-A.originY)/A.cellSizeY)+.5)*A.cellSizeY,f=A.originZ+(Math.floor((e[2]+g*this.preloadLeadSeconds-A.originZ)/A.cellSizeZ)+.5)*A.cellSizeZ;this.#ip(d,p,f,r,LB.Full,!0)}else if(this.dynamicGrid){const A=this.dynamicGrid,s=Math.max(A.cellSizeX,A.cellSizeY,A.cellSizeZ),r=this.#$d(A.interestRange,s,n),a=0===this.pressureStep?this.#$d(A.aggregateRange,s,n):r,o=A.originX+(Math.floor((e[0]-A.originX)/A.cellSizeX)+.5)*A.cellSizeX,l=A.originY+(Math.floor((e[1]-A.originY)/A.cellSizeY)+.5)*A.cellSizeY,c=A.originZ+(Math.floor((e[2]-A.originZ)/A.cellSizeZ)+.5)*A.cellSizeZ;if(i){this.#sp(o,l,c,r,LB.Full,!0);continue}0===this.pressureStep&&this.#sp(o,l,c,a,LB.Aggregate),this.#sp(o,l,c,r,LB.Full);const h=t.velocity&&t.velocity.length>=3?t.velocity[0]:0,u=t.velocity&&t.velocity.length>=3?t.velocity[1]:0,g=t.velocity&&t.velocity.length>=3?t.velocity[2]:0;if(0===h&&0===u&&0===g)continue;const d=A.originX+(Math.floor((e[0]+h*this.preloadLeadSeconds-A.originX)/A.cellSizeX)+.5)*A.cellSizeX,p=A.originY+(Math.floor((e[1]+u*this.preloadLeadSeconds-A.originY)/A.cellSizeY)+.5)*A.cellSizeY,f=A.originZ+(Math.floor((e[2]+g*this.preloadLeadSeconds-A.originZ)/A.cellSizeZ)+.5)*A.cellSizeZ;this.#sp(d,p,f,r,LB.Full,!0)}else i?this.#np(0):this.#rp(0,LB.Full)}for(let s=0;s<this.preloadCurrentCount;s++){const A=this.preloadCurrent[s];this.cellPreloadEpoch[A]!==t&&this.#ap(A,!1)}for(let s=0;s<this.preloadNextCount;s++){const A=this.preloadNext[s];this.cellPreloaded[A]||this.#ap(A,!0)}const e=this.preloadCurrent;this.preloadCurrent=this.preloadNext,this.preloadNext=e,this.preloadCurrentCount=this.preloadNextCount;for(let s=0;s<this.dynamicCurrentCount;s++){const A=this.dynamicCurrent[s];this.cellDemandEpoch[A]!==t&&this.#op(A,LB.Dormant)}for(let s=0;s<this.dynamicNextCount;s++){const A=this.dynamicNext[s],t=this.cellDemandState[A];this.cellCutState[A]!==t&&this.#op(A,t)}const i=this.dynamicCurrent;this.dynamicCurrent=this.dynamicNext,this.dynamicNext=i,this.dynamicCurrentCount=this.dynamicNextCount}#ip(A,t,e,i,s,n=!1){const r=this.manifest.layers[this.dynamicLayer],a=Math.floor((A-i-r.originX)/r.cellSizeX),o=Math.floor((A+i-r.originX)/r.cellSizeX),l=Math.floor((t-i-r.originY)/r.cellSizeY),c=Math.floor((t+i-r.originY)/r.cellSizeY),h=Math.floor((e-i-r.originZ)/r.cellSizeZ),u=Math.floor((e+i-r.originZ)/r.cellSizeZ),g=i*i;for(let d=h;d<=u;d++)for(let i=l;i<=c;i++)for(let l=a;l<=o;l++){const a=this.#Vd(this.dynamicLayer,l,i,d);a>=0&&this.#ep(A,t,e,g,r,l,i,d)&&(n?this.#np(a):this.#rp(a,s))}}#sp(A,t,e,i,s,n=!1){const r=this.dynamicGrid,a=Math.floor((A-i-r.originX)/r.cellSizeX),o=Math.floor((A+i-r.originX)/r.cellSizeX),l=Math.floor((t-i-r.originY)/r.cellSizeY),c=Math.floor((t+i-r.originY)/r.cellSizeY),h=Math.floor((e-i-r.originZ)/r.cellSizeZ),u=Math.floor((e+i-r.originZ)/r.cellSizeZ),g=Math.max(a,r.minCellX),d=Math.min(o,r.minCellX+r.countX-1),p=Math.max(l,r.minCellY),f=Math.min(c,r.minCellY+r.countY-1),m=Math.max(h,r.minCellZ),C=Math.min(u,r.minCellZ+r.countZ-1),w=i*i;for(let y=m;y<=C;y++)for(let i=p;i<=f;i++)for(let a=g;a<=d;a++){if(!this.#ep(A,t,e,w,r,a,i,y))continue;const o=a-r.minCellX,l=i-r.minCellY,c=y-r.minCellZ,h=o+r.countX*(l+r.countY*c);n?this.#np(h):this.#rp(h,s)}}#rp(A,t){const e=this.cellEpoch;this.cellDemandEpoch[A]!==e?(this.cellDemandEpoch[A]=e,this.cellDemandState[A]=t,this.dynamicNext[this.dynamicNextCount++]=A):t<this.cellDemandState[A]&&(this.cellDemandState[A]=t)}#np(A){this.cellPreloadEpoch[A]!==this.cellEpoch&&(this.cellPreloadEpoch[A]=this.cellEpoch,this.preloadNext[this.preloadNextCount++]=A)}#ap(A,t){this.cellPreloaded[A]=t?1:0;const e=this.aggregatePageIdByCell;e&&this.#Pd(e[A],t);const i=this.entities;let s=i.cellHead[A];for(;s!==kB;)this.#Pd(i.visualPageId[s],t),s=i.nextInCell[s]}#op(A,t){this.cellCutState[A]===LB.Aggregate&&this.#Nd(A,!1),t===LB.Aggregate&&this.#Nd(A,!0),this.cellCutState[A]=t;const e=this.entities;let i=e.cellHead[A];for(;i!==kB;){const A=e.simState[i],s=this.#Ud(i,t);if(A!==s){const t=e.visualPageId[i];this.#Od(t,A,!1),e.simState[i]=s,this.#Od(t,s,!0),this.#Rd(i)}i=e.nextInCell[i]}}#Ud(A,t){if(0!==(this.entities.flags[A]&jB.RequireFull))return LB.Full;if(t===LB.Full){const t=this.entities.visualPageId[A];return this.entities.protoBundleId[A]!==RB||t<this.protoPage.length&&0!==this.protoPage[t]?LB.Reduced:LB.Full}return t===LB.Aggregate?LB.Aggregate:LB.Dormant}#Nd(A,t){const e=this.aggregatePageIdByCell;if(!e)return;if(t&&0===this.entities.cellCount[A])return;const i=e[A];i===RB||i>=this.pages.pageCount||(t?(this.aggregateWanted[i]++,this.pages.addDynamicWanted(i,yI.Refinement)):this.aggregateWanted[i]>0&&(this.aggregateWanted[i]--,this.pages.removeDynamicWanted(i)))}#Pd(A,t){A===RB||A>=this.pages.pageCount||(t?this.pages.addPreloadWanted(A,yI.Refinement):this.pages.removePreloadWanted(A))}#jd(A){if(0!==this.pages.dynamicWanted[A])return!0;const t=this.manifest;if(!t||0===this.pages.staticWanted[A])return!1;const e=t.pages,i=0===t.cells.layer[e.cellId[A]]||this.staticActivateEpoch[A]===this.staticEpoch||0!==this.manualStaticWanted[A];let s=this.replacementHead[A];if(-1!==s){let A=!1,t=!0;for(;-1!==s;){const e=this.staticActivateEpoch[s]===this.staticEpoch;(e||this.submitted[s])&&(A=!0),e&&0!==this.submitted[s]||(t=!1),s=this.replacementNext[s]}return(!A||!t)&&(i||A)}if(0!==(e.flags[A]&sI.Replace)&&!i&&this.submitted[A]){const t=e.replacementPageId[A];return 0===this.submitted[t]}return i}#Kd(){const A=this.manifest;if(!A)return;const t=this.staticEpoch,e=this.pages.residentPages;let i=0;for(;i<this.pages.residentCount;){const s=e[i];if(s>=A.pageCount||0===this.pages.staticWanted[s]||0!==this.manualStaticWanted[s]||0===A.cells.layer[A.pages.cellId[s]]||this.staticDirectPrepareEpoch[s]===t){i++;continue}let n=this.replacementHead[s],r=!1;for(;-1!==n;){if(this.staticPrepareEpoch[n]===t||0!==this.submitted[n]){r=!0;break}n=this.replacementNext[n]}r||this.pages.setStaticWanted(s,!1,yI.Fallback),i++}}#Od(A,t,e){if(A===RB||A>=this.pages.pageCount)return;if(t!==LB.Full&&t!==LB.Reduced)return;const i=t===LB.Full?yI.Coverage:yI.Incoming;e?this.pages.addDynamicWanted(A,i):this.pages.removeDynamicWanted(A)}#zd(A){if(A>=this.pages.staticPageCount){const t=this.aggregateWanted[A];return 0!==t&&this.pages.dynamicWanted[A]<=t}const t=this.manifest;return!!t&&t.cells.layer[t.pages.cellId[A]]>=2}#$d(A,t,e){let i=this.pressureStep;e>=this.primaryImportance&&(i=i>0?i-1:0);const s=i*t;return A>t+s?A-s:t}#lp(A,t,e,i){return!(t<=0)&&A*i>=t*e}#Md(){const A=this.pages.budget,t=this.pages.columns,e=Math.max(0,A.maxGpuAccountedBytes-A.staticL0GpuReserve-A.staticL1GpuReserve-A.dynamicGpuReserve),i=Math.max(0,A.maxWorldSlots-A.staticL0WorldSlotReserve-A.staticL1WorldSlotReserve-A.dynamicWorldSlotReserve-A.nonStreamingWorldSlotReserve-A.auxiliaryWorldSlotReserve-A.worldSlotSafetyMargin),s=this.pages.blockedLane<=yI.Incoming,n=s||this.#lp(t.sharedGpu,e,9,10)||this.#lp(t.sharedSlots,i,9,10)||this.#lp(t.dynamicGpu,A.dynamicGpuReserve,9,10)||this.#lp(t.dynamicSlots,A.dynamicWorldSlotReserve,9,10),r=!(s||this.#lp(t.sharedGpu,e,7,10)||this.#lp(t.sharedSlots,i,7,10)||this.#lp(t.dynamicGpu,A.dynamicGpuReserve,7,10)||this.#lp(t.dynamicSlots,A.dynamicWorldSlotReserve,7,10)),a=this.pressureStep;return n&&this.pressureStep<4?this.pressureStep++:r&&this.pressureStep>0&&this.pressureStep--,this.pressureStep!==a}#Fd(A){const t=0!==(this.entities.flags[A]&jB.RequireFull),e=this.requireFullAt[A];if(t){if(e>=0||this.requireFullCount>=64)return;return this.requireFullAt[A]=this.requireFullCount,void(this.requireFullSlots[this.requireFullCount++]=A)}this.#Ld(A)}#Ld(A){const t=this.requireFullAt[A];if(t<0)return;const e=--this.requireFullCount,i=this.requireFullSlots[e];this.requireFullSlots[t]=i,this.requireFullAt[i]=t,this.requireFullAt[A]=-1}},exports.WorldViewFlags=MI,exports.addColumnCost=_B,exports.addStreamingCost=XB,exports.area=Vy,exports.attach=Dd,exports.bindHost=Md,exports.buildAttributeRows=vA,exports.buildGridManifest=function(A,t,e,i){JB(t,i),WB("GridManifestBuildLimits.maxPageCost",e.maxPageCost),gI("maxBundlesPerPage",e.maxBundlesPerPage),gI("maxDependenciesPerBundle",e.maxDependenciesPerBundle),gI("maxResourcesPerBundle",e.maxResourcesPerBundle);for(let lA=0;lA<A.layers.length;lA++){const t=A.layers[lA];if(!Number.isFinite(t.cellSizeX)||t.cellSizeX<=0||!Number.isFinite(t.cellSizeY)||t.cellSizeY<=0||!Number.isFinite(t.cellSizeZ)||t.cellSizeZ<=0||!Number.isFinite(t.originX)||!Number.isFinite(t.originY)||!Number.isFinite(t.originZ)||!Number.isFinite(t.loadingRange)||t.loadingRange<0)throw new Error(`CoverageLayer[${lA}] is invalid`)}const s=A.bundles.length,n=new Map;for(let lA=0;lA<s;lA++){const t=A.bundles[lA];if(uI(`ImportedBundle[${lA}].id`,t.id),n.has(t.id))throw new Error(`Duplicate ImportedBundle id ${t.id}`);if(WB(`ImportedBundle(${t.id}).cost`,t.cost),dI(`ImportedBundle(${t.id}).cost`,t.cost),0!==t.cost.worldSlots||0!==t.cost.instanceSlots||0!==t.cost.activationMutations)throw new Error(`ImportedBundle(${t.id}) cannot own Scene or instance slots`);if(t.dependencies.length>e.maxDependenciesPerBundle)throw new Error(`ImportedBundle(${t.id}) has too many dependencies`);if(t.resourceIds.length>e.maxResourcesPerBundle)throw new Error(`ImportedBundle(${t.id}) has too many resources`);n.set(t.id,lA)}const r=new Array(s);for(let lA=0;lA<s;lA++){const t=A.bundles[lA].dependencies,e=new Array(t.length);for(let i=0;i<t.length;i++){const s=n.get(t[i]);if(null==s)throw new Error(`ImportedBundle(${A.bundles[lA].id}) references missing bundle ${t[i]}`);e[i]=s}r[lA]=e}const a=new Uint8Array(s),o=new Int32Array(s),l=new Uint32Array(s);for(let lA=0;lA<s;lA++){if(0!==a[lA])continue;let t=0;for(o[0]=lA,l[0]=0,a[lA]=1;t>=0;){const e=o[t],i=r[e],s=l[t];if(s>=i.length){a[e]=2,t--;continue}l[t]=s+1;const n=i[s],c=a[n];if(1===c)throw new Error(`Bundle dependency cycle at ${A.bundles[n].id}`);2!==c&&(t++,o[t]=n,l[t]=0,a[n]=1)}}const c=new Map,h=new Array(A.pages.length),u=new Set;for(let lA=0;lA<A.pages.length;lA++){const t=A.pages[lA];if(uI(`ImportedPage[${lA}].id`,t.id),u.has(t.id))throw new Error(`Duplicate ImportedPage id ${t.id}`);if(u.add(t.id),WB(`ImportedPage(${t.id}).localCost`,t.localCost),dI(`ImportedPage(${t.id}).localCost`,t.localCost),t.flags&sI.Replace&&t.flags&sI.Add)throw new Error(`ImportedPage(${t.id}) cannot be both REPLACE and ADD`);if(0!==(t.flags&~(sI.Replace|sI.Add)))throw new Error(`ImportedPage(${t.id}) has unknown flags`);if(t.flags&sI.Replace&&null==t.replacementPageId)throw new Error(`ImportedPage(${t.id}) REPLACE requires replacementPageId`);if(0===t.layer&&t.flags&sI.Replace)throw new Error(`ImportedPage(${t.id}) L0 cannot replace another Page`);if(t.bundleIds.length>e.maxBundlesPerPage)throw new Error(`ImportedPage(${t.id}) has too many bundles`);const i=fI(t,A.layers);let s=c.get(i.key);s||(s=i,c.set(s.key,s)),s.pageIndices.push(lA);const r=new Array(t.bundleIds.length);for(let A=0;A<t.bundleIds.length;A++){const e=n.get(t.bundleIds[A]);if(null==e)throw new Error(`ImportedPage(${t.id}) references missing bundle ${t.bundleIds[A]}`);r[A]=e}h[lA]={source:t,cellKey:s.key,bundleIds:r,cost:lI()}}const g=[],d=(t,e,i)=>{for(g.length=0,g.push(t);g.length>0;){const t=g.pop();if(e.has(t))continue;e.add(t),cI(i,A.bundles[t].cost,`Bundle closure ${t}`);const s=r[t];for(let A=0;A<s.length;A++)g.push(s[A])}};for(let lA=0;lA<h.length;lA++){const A=h[lA];cI(A.cost,A.source.localCost,`ImportedPage(${A.source.id})`);const i=new Set;for(let t=0;t<A.bundleIds.length;t++)d(A.bundleIds[t],i,A.cost);dI(`ImportedPage(${A.source.id}) totalCost`,A.cost),hI(`ImportedPage(${A.source.id})`,A.cost,e.maxPageCost);const s=KB(t,oI,A.cost);if(s!==YB.None)throw new Error(`ImportedPage(${A.source.id}) cannot be admitted: ${s}`)}const p=Array.from(c.values());p.sort((A,t)=>A.layer-t.layer||A.x-t.x||A.y-t.y||A.z-t.z);const f=new Map;for(let lA=0;lA<p.length;lA++)f.set(p[lA].key,lA);for(let lA=0;lA<p.length;lA++){const t=p[lA];if(gI(`Cell(${t.key}).pageCount`,t.pageIndices.length),t.layer>0&&!f.has(mI(t,A.layers)))throw new Error(`Cell ${t.key} has no immediate coarser parent coverage`)}const m=[];for(let lA=0;lA<p.length;lA++){const t=p[lA].pageIndices;t.sort((t,e)=>A.pages[t].id-A.pages[e].id);for(let A=0;A<t.length;A++)m.push(h[t[A]])}const C=new Map;for(let lA=0;lA<m.length;lA++)C.set(m[lA].source.id,lA);for(let lA=0;lA<m.length;lA++){const t=m[lA],e=t.source;if(!(e.flags&sI.Replace)){if(null!=e.replacementPageId)throw new Error(`ImportedPage(${e.id}) replacementPageId requires REPLACE`);continue}const i=C.get(e.replacementPageId);if(null==i)throw new Error(`ImportedPage(${e.id}) references missing replacement ${e.replacementPageId}`);const s=m[i],n=p[f.get(t.cellKey)];if(s.source.layer!==e.layer-1||s.cellKey!==mI(n,A.layers))throw new Error(`ImportedPage(${e.id}) must replace a Page in its immediate parent cell`)}const w=[],y=[],B=[];for(let lA=0;lA<s;lA++){const t=r[lA];for(let A=0;A<t.length;A++)y.push(t[A]);const e=A.bundles[lA].resourceIds;for(let i=0;i<e.length;i++)uI(`ImportedBundle(${A.bundles[lA].id}).resourceIds[${i}]`,e[i]),B.push(e[i])}const I=p.length,Q=m.length,E=new Uint8Array(I),x=new Int32Array(I),D=new Int32Array(I),M=new Int32Array(I),b=new Uint32Array(I),S=new Uint32Array(I),v=new Uint16Array(I),T=new Uint16Array(I);let U=0;for(let lA=0;lA<I;lA++){const t=p[lA];E[lA]=t.layer,x[lA]=t.x,D[lA]=t.y,M[lA]=t.z,b[lA]=0===t.layer?eI:f.get(mI(t,A.layers)),S[lA]=U,v[lA]=t.pageIndices.length,T[lA]=0===t.layer?iI.MandatoryL0:iI.None,U+=t.pageIndices.length}const N=new Uint32Array(Q),P=new Uint32Array(Q),O=new Uint16Array(Q),F=new Uint32Array(Q);F.fill(eI);const k=new Uint16Array(Q),R=new Uint32Array(Q),L=new Uint32Array(Q),j=new Uint32Array(Q),z=new Uint32Array(Q),G=new Float64Array(Q),Y=new Float64Array(Q),H=new Uint32Array(Q),K=new Uint32Array(Q),V=new Uint32Array(Q);for(let lA=0;lA<Q;lA++){const A=m[lA],t=A.source;N[lA]=f.get(A.cellKey),P[lA]=w.length,O[lA]=A.bundleIds.length;for(let i=0;i<A.bundleIds.length;i++)w.push(A.bundleIds[i]);if(k[lA]=t.flags,null!=t.replacementPageId){const A=C.get(t.replacementPageId);if(null==A)throw new Error(`ImportedPage(${t.id}) references missing replacement ${t.replacementPageId}`);F[lA]=A}const e=A.cost;R[lA]=e.compressedBytes,L[lA]=e.decodedBytes,j[lA]=e.scratchPeakBytes,z[lA]=e.uploadBytes,G[lA]=e.gpuAccountedBytes,Y[lA]=e.gpuPreparePeakBytes,H[lA]=e.worldSlots,K[lA]=e.instanceSlots,V[lA]=e.activationMutations}const J=new Uint32Array(s),W=new Uint16Array(s),q=new Uint32Array(s),X=new Uint16Array(s),Z=new Uint32Array(s),_=new Uint32Array(s),$=new Uint32Array(s),AA=new Uint32Array(s),tA=new Float64Array(s),eA=new Float64Array(s);let iA=0,sA=0;for(let lA=0;lA<s;lA++){const t=A.bundles[lA];J[lA]=iA,W[lA]=r[lA].length,iA+=r[lA].length,q[lA]=sA,X[lA]=t.resourceIds.length,sA+=t.resourceIds.length,Z[lA]=t.cost.compressedBytes,_[lA]=t.cost.decodedBytes,$[lA]=t.cost.scratchPeakBytes,AA[lA]=t.cost.uploadBytes,tA[lA]=t.cost.gpuAccountedBytes,eA[lA]=t.cost.gpuPreparePeakBytes}const nA={compressedBytes:0,decodedBytes:0,scratchPeakBytes:0,uploadBytes:0,gpuAccountedBytes:0,gpuPreparePeakBytes:0,worldSlots:0,instanceSlots:0,activationMutations:0},rA=new Set;for(let lA=0;lA<h.length;lA++){const A=h[lA];if(0===A.source.layer){cI(nA,A.source.localCost,"Static L0");for(let t=0;t<A.bundleIds.length;t++)d(A.bundleIds[t],rA,nA)}}tI(t,nA);const aA={version:A.version,staticL0Cost:nA,layers:A.layers,cells:{layer:E,x,y:D,z:M,parentCellId:b,pageStart:S,pageCount:v,flags:T},pages:{cellId:N,bundleStart:P,bundleCount:O,replacementPageId:F,flags:k,compressedBytes:R,decodedBytes:L,scratchPeakBytes:j,uploadBytes:z,gpuAccountedBytes:G,gpuPreparePeakBytes:Y,worldSlots:H,instanceSlots:K,activationMutations:V},bundles:{dependencyStart:J,dependencyCount:W,resourceStart:q,resourceCount:X,compressedBytes:Z,decodedBytes:_,scratchPeakBytes:$,uploadBytes:AA,gpuAccountedBytes:tA,gpuPreparePeakBytes:eA},pageBundles:Uint32Array.from(w),bundleDependencies:Uint32Array.from(y),resourceIds:Uint32Array.from(B)},oA=new aI(aA);return CI(oA,t,e,i),oA},exports.buildSweptTube=Rm,exports.catmullRom=oB,exports.checkColumnAdmission=AI,exports.checkStreamingAdmission=KB,exports.checkUploadSliceAdmission=VB,exports.clamp=function(A,t,e){return Math.max(t,Math.min(e,A))},exports.commitLineDistance=_u,exports.commitSweptTube=Lm,exports.contain=_y,exports.copyPacket=gd,exports.cover=$y,exports.createCurve=MB,exports.cubicBezier=cB,exports.curveConstructors=DB,exports.ellipseSweep=dB,exports.emptyColumnUsage=function(){return{l0Gpu:0,l1Gpu:0,sharedGpu:0,dynamicGpu:0,l0Slots:0,l1Slots:0,sharedSlots:0,dynamicSlots:0}},exports.emptyStreamingUsage=function(){return{compressedBytes:0,decodedBytes:0,scratchBytes:0,pendingUploadBytes:0,uploadBytesThisFrame:0,gpuAccountedBytes:0,gpuPreparePeakBytes:0,worldSlots:0,instanceSlots:0,activationMutationsThisFrame:0}},exports.evalCubic=function(A,t,e,i,s){return t+A*(e+A*(i+A*s))},exports.fill=AB,exports.fromHalfFloat=Gy,exports.getByteLength=tB,exports.hermite=function(A,t,e,i){return[A,e,-3*A+3*t-2*e-i,2*A-2*t+e+i]},exports.isClockWise=Jy,exports.isPowerOfTwo=function(A){return!(A&A-1)&&0!==A},exports.lerp=function(A,t,e){return A+(t-A)*e},exports.listen=Id,exports.meshMorphWeightsActive=ks,exports.nearestPowerOfTwo=function(A){return Math.pow(2,Math.round(Math.log(A)/Math.LN2))},exports.quadraticBezier=lB,exports.quadraticBezierPath=vm,exports.quoteProtoInstanceCost=xI,exports.registerMaterialShade=function(A,t){if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(A)||ZA.has(A))throw new Error(`registerMaterialShade: '${A}' 不可用`);for(let i=0;i<_A.length;i++)if(_A[i].name===A)throw new Error(`registerMaterialShade: '${A}' 已登记`);const e=t.trim();if(!e)throw new Error(`registerMaterialShade: '${A}' 缺少函数体`);_A.push({name:A,re:new RegExp(`\\b${A}\\b`),wgsl:e})},exports.smoothstep=function(A,t,e){return A<=t?0:A>=e?1:(A=(A-t)/(e-t))*A*(3-2*A)},exports.subColumnCost=$B,exports.subStreamingCost=ZB,exports.toHalfFloat=zy,exports.triangulate=Hy,exports.triangulateShape=qy,exports.validateGridManifestForBudget=CI,exports.validateStaticL0Cost=tI,exports.validateStreamingBudget=JB,exports.validateStreamingCost=WB;
|