a3js 0.0.34 → 0.0.35
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/dist/a3js.cjs.js +53 -53
- package/dist/a3js.cjs.js.map +1 -1
- package/dist/a3js.es.js +2351 -2332
- package/dist/a3js.es.js.map +1 -1
- package/package.json +1 -1
package/dist/a3js.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var ar=Object.create;var En=Object.defineProperty;var Ar=Object.getOwnPropertyDescriptor;var cr=Object.getOwnPropertyNames;var lr=Object.getPrototypeOf,ur=Object.prototype.hasOwnProperty;var hr=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of cr(e))!ur.call(i,r)&&r!==t&&En(i,r,{get:()=>e[r],enumerable:!(n=Ar(e,r))||n.enumerable});return i};var dr=(i,e,t)=>(t=i!=null?ar(lr(i)):{},hr(e||!i||!i.__esModule?En(t,"default",{value:i,enumerable:!0}):t,i));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("three"),Mn=require("fflate");function fr(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const se=fr(g);class Z{_x;_y;_z;get x(){return this._x}get y(){return this._y}get z(){return this._z}constructor(e,t,n){typeof e=="number"?(this._x=e,this._y=t,this._z=n):typeof e>"u"?this._x=this._y=this._z=0:(this._x=e.x,this._y=e.y,this._z=e.z)}clone(){return new Z(this)}write(e){e.x=this._x,e.y=this._y,e.z=this._z}normalize(){const e=this._x*this._x+this._y*this._y+this._z*this._z,t=Math.sqrt(e);return t!==0?(this._x/=t,this._y/=t,this._z/=t):console.warn("Vec3.normalize."),this}negate(){return this._x*=-1,this._y*=-1,this._z*=-1,this}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)}set(e,t,n){return typeof e=="number"?(this._x=e,this._y=t,this._z=n):(this._x=e.x,this._y=e.y,this._z=e.z),this}add(e,t,n){return typeof e=="number"?(this._x+=e,this._y+=t,this._z+=n):(this._x+=e.x,this._y+=e.y,this._z+=e.z),this}sub(e,t,n){return typeof e=="number"?(this._x-=e,this._y-=t,this._z-=n):(this._x-=e.x,this._y-=e.y,this._z-=e.z),this}scale(e){return this._x*=e,this._y*=e,this._z*=e,this}cross(e,t){return this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this}apply(e,t,n,r){const o=new Te;typeof e=="number"?o.set(e,t,n,r):o.set(e);const s=new Te(this._x,this._y,this._z,0),c=new Te(o).conjugate();return o.mul(s).mul(c),this._x=o.x,this._y=o.y,this._z=o.z,this}lerp(e,t,n){this._x=(1-n)*e.x+n*t.x,this._y=(1-n)*e.y+n*t.y,this._z=(1-n)*e.z+n*t.z}}class Te{_x;_y;_z;_w;get x(){return this._x}get y(){return this._y}get z(){return this._z}get w(){return this._w}constructor(e,t,n,r){typeof e=="number"?(this._x=e,this._y=t,this._z=n,this._w=r):typeof e>"u"?(this._x=this._y=this._z=0,this._w=1):(this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w)}clone(){return new Te(this)}write(e){e.x=this._x,e.y=this._y,e.z=this._z,e.w=this._w}normalize(){const e=this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w,t=Math.sqrt(e);return t!==0?(this._x/=t,this._y/=t,this._z/=t,this._w/=t):console.warn("Quat.normalize."),this}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this}set(e,t,n,r){return typeof e=="number"?(this._x=e,this._y=t,this._z=n,this._w=r):(this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w),this}mul(e,t,n,r){const o=new Te(this),s=new Te;return typeof e=="number"?s.set(e,t,n,r):s.set(e),this._x=o.w*s.x+o.x*s.w+o.y*s.z-o.z*s.y,this._y=o.w*s.y-o.x*s.z+o.y*s.w+o.z*s.x,this._z=o.w*s.z+o.x*s.y-o.y*s.x+o.z*s.w,this._w=o.w*s.w-o.x*s.x-o.y*s.y-o.z*s.z,this}lerp(e,t,n){this._x=(1-n)*e.x+n*t.x,this._y=(1-n)*e.y+n*t.y,this._z=(1-n)*e.z+n*t.z,this._w=(1-n)*e.w+n*t.w}slerp(e,t,n){if(n<0||n>1){console.warn("Quat.slerp(): t must be in [0,1]");return}let r=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w;if(Xe.set(t),r<0&&(r*=-1,Xe.set(-Xe.x,-Xe.y,-Xe.z,-Xe.w)),r>.9995){this._x=(1-n)*e.x+n*Xe.x,this._y=(1-n)*e.y+n*Xe.y,this._z=(1-n)*e.z+n*Xe.z,this._w=(1-n)*e.w+n*Xe.w;const o=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w);o<1e-4?(console.warn("Quat.slerp(); ???!"),this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w):(this._x*=1/o,this._y*=1/o,this._z*=1/o,this._w*=1/o)}else{const o=Math.acos(r),s=Math.sin((1-n)*o)/Math.sin(o),c=Math.sin(n*o)/Math.sin(o);this._x=s*e.x+c*Xe.x,this._y=s*e.y+c*Xe.y,this._z=s*e.z+c*Xe.z,this._w=s*e.w+c*Xe.w}}}const Xe=new Te;function At(i,e,t){t.normalize();const n=i.clone().sub(e).normalize(),r=new Z().cross(n,t).normalize(),o=new Z().cross(r,n),s=r.x,c=o.x,A=-n.x,a=r.y,h=o.y,u=-n.y,b=r.z,f=o.z,I=-n.z,E=s+h+I;if(E>0){const l=Math.sqrt(E+1)*2;return new Te((f-u)/l,(A-b)/l,(a-c)/l,.25*l)}else if(s>h&&s>I){const l=Math.sqrt(1+s-h-I)*2;return new Te(.25*l,(c+a)/l,(A+b)/l,(f-u)/l)}else if(h>I){const l=Math.sqrt(1+h-s-I)*2;return new Te((c+a)/l,.25*l,(u+f)/l,(A-b)/l)}else{const l=Math.sqrt(1+I-s-h)*2;return new Te((A+b)/l,(u+f)/l,.25*l,(a-c)/l)}}function dt(i,e="XYZ"){const t=new Te(0,0,0,1);for(let n=0;n<3;n++)switch(e.charAt(n)){case"X":t.mul(Math.sin(i.x),0,0,Math.cos(i.x));break;case"Y":t.mul(0,Math.sin(i.y),0,Math.cos(i.y));break;case"Z":t.mul(0,0,Math.sin(i.z),Math.cos(i.z));break}return t}function pr(i){const e=[[],[],[]],t=i.x+i.x,n=i.y+i.y,r=i.z+i.z,o=i.x*t,s=i.x*n,c=i.x*r,A=i.y*n,a=i.y*r,h=i.z*r,u=i.w*t,b=i.w*n,f=i.w*r;return e[0][0]=1-(A+h),e[0][1]=s-f,e[0][2]=c+b,e[1][0]=s+f,e[1][1]=1-(o+h),e[1][2]=a-u,e[2][0]=c-b,e[2][1]=a+u,e[2][2]=1-(o+A),e}const pt=i=>Math.max(-1,Math.min(1,i));function mn(i,e="XYZ"){const t=pr(i),n=new Z;let r=0,o=0,s=0;switch(e){case"XYZ":o=Math.asin(pt(t[0][2])),Math.abs(t[0][2])<.9999999?(r=Math.atan2(-t[1][2],t[2][2]),s=Math.atan2(-t[0][1],t[0][0])):(r=Math.atan2(t[2][1],t[1][1]),s=0);break;case"YXZ":r=Math.asin(-pt(t[1][2])),Math.abs(t[1][2])<.9999999?(o=Math.atan2(t[0][2],t[2][2]),s=Math.atan2(t[1][0],t[1][1])):(o=Math.atan2(-t[2][0],t[0][0]),s=0);break;case"ZXY":r=Math.asin(pt(t[2][1])),Math.abs(t[2][1])<.9999999?(o=Math.atan2(-t[2][0],t[2][2]),s=Math.atan2(-t[0][1],t[1][1])):(o=0,s=Math.atan2(t[1][0],t[0][0]));break;case"ZYX":o=Math.asin(-pt(t[2][0])),Math.abs(t[2][0])<.9999999?(r=Math.atan2(t[2][1],t[2][2]),s=Math.atan2(t[1][0],t[0][0])):(r=0,s=Math.atan2(-t[0][1],t[1][1]));break;case"YZX":s=Math.asin(pt(t[1][0])),Math.abs(t[1][0])<.9999999?(r=Math.atan2(-t[1][2],t[1][1]),o=Math.atan2(-t[2][0],t[0][0])):(r=0,o=Math.atan2(t[0][2],t[2][2]));break;case"XZY":s=Math.asin(-pt(t[0][1])),Math.abs(t[0][1])<.9999999?(r=Math.atan2(t[2][1],t[1][1]),o=Math.atan2(t[0][2],t[0][0])):(r=Math.atan2(-t[1][2],t[2][2]),o=0);break}return n.set(r,o,s),n}class qe{loc;quat;scale;constructor(){this.loc=new Z,this.quat=new Te,this.scale=new Z(1,1,1)}set(e){if(e instanceof qe)this.loc.set(e.loc),this.quat.set(e.quat),this.scale.set(e.scale);else{const t=e.trans;this.loc.set(t.loc),this.quat.set(t.quat),this.scale.set(t.scale)}return this}write(e){e instanceof Oe?(e.object.position.set(this.loc.x,this.loc.y,this.loc.z),e.object.quaternion.set(this.quat.x,this.quat.y,this.quat.z,this.quat.w),e.object.scale.set(this.scale.x,this.scale.y,this.scale.z)):(e.position.set(this.loc.x,this.loc.y,this.loc.z),e.quaternion.set(this.quat.x,this.quat.y,this.quat.z,this.quat.w),e.scale.set(this.scale.x,this.scale.y,this.scale.z))}blend(e,t){return this.loc.lerp(this.loc,e.loc,t),this.quat.slerp(this.quat,e.quat,t),this.scale.lerp(this.scale,e.scale,t),this}clone(){const e=new qe;return e.set(this),e}}class wt{trans;constructor(){this.trans=new qe}init(e,t){this.trans.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.trans.loc.y<=0}setLocation(e){this.trans.loc.set(e)}setLocationNow(e){this.trans.loc.set(e)}setQuat(e){this.trans.quat.set(e)}setQuatNow(e){this.trans.quat.set(e)}setScale(e){this.trans.scale.set(e)}setScaleNow(e){this.trans.scale.set(e)}setLinvel(e){}getLinvel(e){return e||new Z}setAngvel(e){}getAngvel(e){return e||new Z}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class Pn{trans;constructor(){this.trans=new qe}init(e,t){this.trans.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.trans.loc.y<=0}setLocation(e){}setLocationNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinvel(e){}getLinvel(e){return e||new Z}setAngvel(e){}getAngvel(e){return e||new Z}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class Gn{firstTrans;trans;lastTrans;nowTime;duration;constructor(){this.firstTrans=new qe,this.trans=new qe,this.lastTrans=new qe,this.nowTime=0,this.duration=1}init(e,t){this.firstTrans.set(e),this.trans.set(e),this.lastTrans.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.trans.loc.y<=0}setLocation(e){this.firstTrans.set(this.trans),this.lastTrans.loc.set(e),this.nowTime=0}setLocationNow(e){this.setLocation(e),this.nowTime=1}setQuat(e){this.firstTrans.set(this.trans),this.lastTrans.quat.set(e),this.nowTime=0}setQuatNow(e){this.setQuat(e),this.nowTime=1}setScale(e){this.firstTrans.set(this.trans),this.lastTrans.scale.set(e),this.nowTime=0}setScaleNow(e){this.setScale(e),this.nowTime=1}setLinvel(e){}getLinvel(e){e||(e=new Z);const t=this.lastTrans.loc.x-this.firstTrans.loc.x,n=this.lastTrans.loc.y-this.firstTrans.loc.y,r=this.lastTrans.loc.z-this.firstTrans.loc.z;e.set(t,n,r);const o=this.nowTime<this.duration?this.nowTime:this.duration;return e.scale((-6*o*o+6*o)/this.duration),e}setAngvel(e){}getAngvel(e){e||(e=new Z);const t=mn(this.firstTrans.quat,"XYZ"),n=mn(this.lastTrans.quat,"XYZ");e.set(n.x-t.x,n.y-t.y,n.z-t.z);const r=this.nowTime<this.duration?this.nowTime:this.duration;return e.scale((-6*r*r+6*r)/this.duration),e}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}smoothstep(e){return e*e*(3-2*e)}update(e){this.nowTime+=e,this.nowTime>this.duration&&(this.nowTime=this.duration);const t=this.nowTime/this.duration,n=this.smoothstep(t);this.trans.set(this.firstTrans),this.trans.blend(this.lastTrans,n)}}const ot=new Z,It=new Z;class gr extends wt{up;target;constructor(e){super(),this.up=new Z(0,1,0),this.target=e}setTarget(e){this.target=e}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=Oe.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){ot.set(this.trans.loc),It.set(this.target.trans.loc);const t=At(ot,It,this.up);this.trans.quat.set(t)}}class Er extends Gn{up;target;constructor(e){super(),this.up=new Z(0,1,0),this.target=e}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=Oe.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){super.update(e),ot.set(this.trans.loc),It.set(this.target.trans.loc);const t=At(ot,It,this.up);this.trans.quat.set(t)}}const Un={lookFrom:{x:0,y:5,z:-10},smoothness:.9};class mr extends Pn{options;target;lookFrom;up;constructor(e,t={}){super(),this.options={...Un,...t},this.target=e,this.lookFrom=new Z(this.options.lookFrom),e.upVector?this.up=e.upVector:this.up=Oe.defaultUpVector}init(e,t){super.init(e,t)}update(e){super.update(e);const t=new qe;ot.set(this.trans.loc),It.set(this.target.trans.loc);const n=At(ot,It,this.up);n.mul(new Te(0,1,0,0)),t.quat.set(n),ot.set(this.lookFrom),ot.apply(this.target.quat),ot.add(this.target.loc),t.loc.set(ot),this.trans.loc.lerp(this.trans.loc,t.loc,1-this.options.smoothness),this.trans.quat.slerp(this.trans.quat,t.quat,1-this.options.smoothness)}}const $t={rigidBody:"dynamic",collider:"solid",meshCollider:"convex_hull",mass:1,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1};function jn(i){return typeof i=="string"}function an(i){return i.isMesh===!0}function Ir(i){return i.type==="RoundedBoxGeometry"}function br(i){return i.type==="BoxGeometry"}function Cr(i){return i.type==="SphereGeometry"}function yr(i){return i.type==="IcosahedronGeometry"}function Br(i){return i.type==="CylinderGeometry"}function wr(i){return i.type==="CapsuleGeometry"}function Tr(i){return i.isBone===!0}function Rr(i){return i.isPerspectiveCamera===!0}let He;const it=new Map;class Tt{static RAPIER;isInitialized=!1;constructor(){}async init(){if(!Tt.RAPIER){const e=await import("@dimforge/rapier3d-compat");await e.init(),Tt.RAPIER=e,He=e,this.isInitialized=!0}}createWorld(e){let t=.016666666666666666;this.isRapierWorldOptions(e)&&(t=e.timestep);const n=new He.World(e.gravity);return new An(n,t)}isRapierWorldOptions(e){return"timestep"in e}}class An{world;timestep;collisionEventQueue;constructor(e,t){this.world=e,this.timestep=t,this.collisionEventQueue=new He.EventQueue(!0),this.world.integrationParameters.dt=this.timestep}add(e){e.addOneselfToPhysics(this)}remove(e){e.removeOneselfFromPhysics(this)}update(e){const t=Math.ceil(e/this.timestep);for(let n=0;n<t;n++)this.world.step(this.collisionEventQueue)}getCollisions(){const e=[];return this.collisionEventQueue.drainCollisionEvents((t,n,r)=>{const o=it.get(t),s=it.get(n);o&&s&&e.push({objectA:o,partOfA:t,objectB:s,partOfB:n,started:r})}),e}}class In{trans;objectA3;bodyDesc;body;colliderDescs;colliders;completeOptions;constructor(e={}){this.completeOptions={...$t,...e},this.trans=new qe,this.colliderDescs=[],this.colliders=[]}makeBodyDesc(){let e;switch(this.completeOptions.rigidBody){case"dynamic":e=He.RigidBodyDesc.dynamic();break;case"kinematic":e=He.RigidBodyDesc.kinematicPositionBased();break;case"fixed":e=He.RigidBodyDesc.fixed();break}return e.setTranslation(this.trans.loc.x,this.trans.loc.y,this.trans.loc.z),e.setRotation({x:this.trans.quat.x,y:this.trans.quat.y,z:this.trans.quat.z,w:this.trans.quat.w}),e}configColliderDescs(){if(!this.objectA3)return;const e=this.completeOptions,t=[];this.objectA3.object.traverse(r=>{if(an(r)){const o=kr(r.geometry),s=e.membership<<16|e.filter;if(o)o.colliderDesc.setCollisionGroups(s),e.collisionDetection&&o.colliderDesc.setActiveEvents(He.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(o.colliderDesc),o.colliderDesc.setRestitution(e.restitution).setFriction(e.friction),t.push(o.volume);else{let c,A;switch(e.meshCollider){case"tri_mesh":c=vr(r),A=bn(r.geometry);break;case"convex_hull":c=Qr(r),A=bn(r.geometry);break}c&&(c.setCollisionGroups(s),e.collisionDetection&&c.setActiveEvents(He.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(c),t.push(A))}}});let n=t.reduce((r,o)=>r+o,0);for(let r=0;r<this.colliderDescs.length;r++)this.colliderDescs[r].setRestitution(e.restitution),this.colliderDescs[r].setFriction(e.friction),this.colliderDescs[r].setMass(e.mass*(t[r]/n))}init(e,t){this.trans.set(e),this.objectA3=t,this.colliderDescs=[],this.colliders=[],this.bodyDesc=this.makeBodyDesc(),this.configColliderDescs()}addOneselfToPhysics(e){this.bodyDesc&&(this.body=e.world.createRigidBody(this.bodyDesc),this.colliderDescs.forEach(t=>{const n=e.world.createCollider(t,this.body);this.colliders.push(n),this.objectA3&&it.set(n.handle,this.objectA3)}))}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.colliders.forEach(t=>{e.world.removeCollider(t,!1),it.delete(t.handle)})}isGrounded(){return this.trans.loc.y<=0}setLocation(e){}setLocationNow(e){this.body?this.body.setTranslation(e,!0):this.bodyDesc?.setTranslation(e.x,e.y,e.z),this.trans.loc.set(e)}setQuat(e){}setQuatNow(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.trans.quat.set(e)}setScale(e){}setScaleNow(e){}setLinvel(e){this.body?this.body.setLinvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setLinvel(e.x,e.y,e.z)}getLinvel(e){return e||(e=new Z),this.body?e.set(this.body.linvel()):this.bodyDesc&&e.set(this.bodyDesc.linvel),e}setAngvel(e){this.body?this.body.setAngvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setAngvel({x:e.x,y:e.y,z:e.z})}getAngvel(e){return e||(e=new Z),this.body?e.set(this.body.angvel()):this.bodyDesc&&e.set(this.bodyDesc.angvel),e}resetForce(){this.body?.resetForces(!0)}addForce(e){this.body?.addForce({x:e.x,y:e.y,z:e.z},!0)}addForceAtPoint(e,t){this.body?.addForceAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}resetTorque(){this.body?.resetTorques(!0)}addTorque(e){this.body?.addTorque({x:e.x,y:e.y,z:e.z},!0)}applyImpulse(e){this.body?.applyImpulse({x:e.x,y:e.y,z:e.z},!0)}applyImpulseAtPoint(e,t){this.body?.applyImpulseAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}applyTorqueImpulse(e){this.body?.applyTorqueImpulse({x:e.x,y:e.y,z:e.z},!0)}update(e){if(this.body){const t=this.body.translation();this.trans.loc.set(t.x,t.y,t.z);const n=this.body.rotation();this.trans.quat.set(n.x,n.y,n.z,n.w)}}}function vr(i){let e=null;if(an(i)){const t=i;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const r=n.attributes.position.array;let o=n.index?n.index.array:null;if(o)o instanceof Uint32Array||(o=new Uint32Array(o));else{const s=n.attributes.position.count;o=new Uint32Array(s);for(let c=0;c<s;c++)o[c]=c}r instanceof Float32Array&&(e=He.ColliderDesc.trimesh(r,o))}return e}function Qr(i){let e=null;if(an(i)){const t=i;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const r=n.attributes.position.array;r instanceof Float32Array&&(e=He.ColliderDesc.convexHull(r))}return e}function bn(i){const e=i.attributes.position;if(!e)throw new Error("position attribute not found");const t=i.index,n=e.array;let r=0;const o=new se.Vector3,s=new se.Vector3,c=new se.Vector3;if(t){const A=t.array;for(let a=0;a<A.length;a+=3){const h=A[a]*3,u=A[a+1]*3,b=A[a+2]*3;o.set(n[h],n[h+1],n[h+2]),s.set(n[u],n[u+1],n[u+2]),c.set(n[b],n[b+1],n[b+2]),r+=o.dot(s.clone().cross(c))}}else for(let A=0;A<n.length;A+=9)o.set(n[A],n[A+1],n[A+2]),s.set(n[A+3],n[A+4],n[A+5]),c.set(n[A+6],n[A+7],n[A+8]),r+=o.dot(s.clone().cross(c));return Math.abs(r)/6}function kr(i){if(Ir(i)){const e=i.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,r=typeof e?.depth=="number"?e.depth/2:.5,o=.1;return{colliderDesc:He.ColliderDesc.roundCuboid(t-o,n-o,r-o,o),volume:2*t*2*n*2*r}}else if(br(i)){const e=i.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,r=typeof e?.depth=="number"?e.depth/2:.5;return{colliderDesc:He.ColliderDesc.cuboid(t,n,r),volume:2*t*2*n*2*r}}else if(Cr(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:He.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(yr(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:He.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(Br(i)){const e=i.parameters,t=typeof e?.radiusBottom=="number"?e.radiusBottom:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:He.ColliderDesc.cylinder(n/2,t),volume:Math.PI*t*t*n}}else if(wr(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:He.ColliderDesc.capsule(n/2,t),volume:4/3*Math.PI*t*t*t+Math.PI*t*t*n}}return null}const en=new Tt;async function Sr(){await en.init()}const H={v0:new Z,v1:new Z,v2:new Z,v3:new Z,v4:new Z,q0:new Te,q1:new Te,q2:new Te,q3:new Te,q4:new Te,t0:new qe,t1:new qe,t2:new qe,t3:new qe,t4:new qe};function Lr(i){return new Promise(e=>{setTimeout(()=>{e()},i)})}async function Hn(i){const t=await(await fetch(i)).arrayBuffer(),n=await new Promise((r,o)=>{Mn.unzip(new Uint8Array(t),(s,c)=>{s?o(s):r(c)})});return{zipUrl:i,unzipped:n}}function cn(i,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),i.unzipped[e])return Mn.strFromU8(i.unzipped[e]);throw new Error(`readStringFromUnzippedA3(): no file at ${e}`)}function qn(i,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),i.unzipped[e]){const t=xr(e);return new Blob([new Uint8Array(i.unzipped[e])],{type:t})}else throw new Error(`readBlobFromUnzippedA3(): no file at ${e}`)}const _r={"image/png":/\.png$/i,"image/jpeg":/\.(jpg|jpeg)$/i,"image/gif":/\.gif$/i,"model/vrml":/\.wrl$/i,"application/xml":/\.xml$/i,"application/octet-stream":/\.bvh/i,"audio/x-wav":/\.wav/i,"audio/mpeg":/\.mp3/i,"audio/ogg":/\.ogg/i,"text/plain":/\.(txt|text)$/i,"model/gltf+json":/\.gltf$/i,"model/gltf-binary":/\.glb$/i};function xr(i){for(const[e,t]of Object.entries(_r))if(t.test(i))return e;return"application/octet-stream"}function _t(i,e){if(!e)return i;const t={...i};for(const n in e)typeof i[n]=="object"&&typeof e[n]=="object"?t[n]=_t(i[n],e[n]):t[n]=e[n];return t}const Nr=new se.SphereGeometry,Dr=new se.MeshStandardMaterial({color:16711680});let Fr=new se.Mesh(Nr,Dr);class Oe{static defaultRotationOrder="XYZ";static defaultUpVector=new Z(0,1,0);rotationOrder;upVector;object;scene;balloon;transformer;parent;children=[];clickListener;constructor(e){this.transformer=this.initTransformer(e),this.object=new se.Object3D;const t=this.initObject(e);t&&this.object.add(t),this.object.traverse(n=>{n.userData.a3js={objectA3:this}})}initObject(e){return Fr.clone()}initTransformer(e){return new wt}setTransformer(e){H.t0.set(this.transformer.trans),e.init(H.t0,this),this.transformer=e}getTransformer(){return this.transformer}setTransformMode(e,t){if(e==="Default")this.setTransformer(new wt);else if(e==="Interpolation")this.setTransformer(new Gn);else if(e==="Billboard")this.setTransformer(new gr(t));else if(e==="InterpolationBillboard")this.setTransformer(new Er(t));else if(e==="SimplePhysics"){const n={...$t,...t};this.setTransformer(new In(n))}}initSimplePhysics(e){const t={...$t,...e};this.setTransformer(new In(t))}update(e){this.transformer.update(e),this.transformer.trans.write(this),this.children.forEach(t=>{t.update(e)})}add(e){if(e.scene){console.warn("ObjectA3.add(obj) is ignored.");return}if(e.parent){console.warn("ObjectA3.add(obj) is ignored.");return}this.children.push(e),e.parent=this,this.object.add(e.object)}remove(e){if(e.parent!==this){console.warn("ObjectA3.remove(obj) is ignored.");return}const t=this.children.indexOf(e);this.children.splice(t,1),e.parent=void 0,this.object.remove(e.object)}setBalloon(e){this.balloon?this.balloon.message=e:this.balloon=new Or(e)}setClickListener(e){this.clickListener=e}handleCollision(e,t,n,r){}async clicked(){this.clickListener&&await this.clickListener(this)}get trans(){return this.transformer.trans.clone()}get loc(){return this.trans.loc}setLocation(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.setLocation(H.v0)}setLocationNow(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.setLocationNow(H.v0)}get quat(){return this.trans.quat}setQuat(e,t,n,r){typeof e=="number"?H.q0.set(e,t,n,r):H.q0.set(e),this.transformer.setQuat(H.q0)}setQuatNow(e,t,n,r){typeof e=="number"?H.q0.set(e,t,n,r):H.q0.set(e),this.transformer.setQuatNow(H.q0)}get scale(){return this.trans.scale}setScale(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.setScale(H.v0)}setScaleNow(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.setScaleNow(H.v0)}setRotation(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):r.set(e),r.scale(Math.PI/360);const o=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder,s=dt(r,o);this.setQuat(s)}setRotationNow(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):r.set(e);const o=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder,s=new Te(0,0,0,1);for(let c=0;c<3;c++)switch(o.charAt(c)){case"X":s.mul(new Te(Math.sin(r.x),0,0,Math.cos(r.x)));break;case"Y":s.mul(new Te(0,Math.sin(r.y),0,Math.cos(r.y)));break;case"Z":s.mul(new Te(0,0,Math.sin(r.z),Math.cos(r.z)));break}this.setQuatNow(s)}lookAt(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):e instanceof Oe?r.set(e.loc):r.set(e);const o=this.upVector?this.upVector:Oe.defaultUpVector,s=At(this.loc,r,o);this.setQuat(s)}lookAtNow(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):e instanceof Oe?r.set(e.loc):r.set(e);const o=this.upVector?this.upVector:Oe.defaultUpVector,s=At(this.loc,r,o);this.setQuatNow(s)}getUnitVecX(){return new Z(1,0,0).apply(this.object.quaternion)}getUnitVecY(){return new Z(0,1,0).apply(this.object.quaternion)}getUnitVecZ(){return new Z(0,0,1).apply(this.object.quaternion)}addLocation(e,t,n){const r=new Z;r.set(this.loc),typeof e=="number"?r.add(e,t,n):r.add(e),this.setLocation(r)}addLocationNow(e,t,n){const r=new Z;r.set(this.loc),typeof e=="number"?r.add(e,t,n):r.add(e),this.setLocationNow(r)}mulQuat(e,t,n,r){const o=new Te;o.set(this.quat),typeof e=="number"?o.mul(e,t,n,r):o.mul(e),this.setQuat(o)}mulQuatNow(e,t,n,r){const o=new Te;o.set(this.quat),typeof e=="number"?o.mul(e,t,n,r):o.mul(e),this.setQuatNow(o)}mulRotation(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),H.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder,o=dt(H.v0,r);H.q0.set(this.quat),H.q0.mul(o),this.setQuat(H.q0)}mulRotationNow(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),H.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder,o=dt(H.v0,r);H.q0.set(this.quat),H.q0.mul(o),this.setQuatNow(H.q0)}mulScale(e,t,n){H.v0.set(this.scale),typeof e=="number"?H.v0.set(H.v0.x*e,H.v0.y*t,H.v0.z*n):H.v0.set(H.v0.x*e.x,H.v0.y*e.y,H.v0.z*e.z),this.setScale(H.v0)}mulScaleNow(e,t,n){H.v0.set(this.scale),typeof e=="number"?H.v0.set(H.v0.x*e,H.v0.y*t,H.v0.z*n):H.v0.set(H.v0.x*e.x,H.v0.y*e.y,H.v0.z*e.z),this.setScaleNow(H.v0)}moveForward(e){H.v0.set(this.getUnitVecZ()),H.v0.scale(e),this.addLocation(H.v0)}moveForwardNow(e){H.v0.set(this.getUnitVecZ()),H.v0.scale(e),this.addLocationNow(H.v0)}moveBackward(e){H.v0.set(this.getUnitVecZ()),H.v0.scale(-e),this.addLocation(H.v0)}moveBackwardNow(e){H.v0.set(this.getUnitVecZ()),H.v0.scale(-e),this.addLocationNow(H.v0)}moveRight(e){H.v0.set(this.getUnitVecX()),H.v0.scale(-e),this.addLocation(H.v0)}moveRightNow(e){H.v0.set(this.getUnitVecX()),H.v0.scale(-e),this.addLocationNow(H.v0)}moveLeft(e){H.v0.set(this.getUnitVecX()),H.v0.scale(e),this.addLocation(H.v0)}moveLeftNow(e){H.v0.set(this.getUnitVecX()),H.v0.scale(e),this.addLocationNow(H.v0)}moveUp(e){H.v0.set(this.getUnitVecY()),H.v0.scale(e),this.addLocation(H.v0)}moveUpNow(e){H.v0.set(this.getUnitVecY()),H.v0.scale(e),this.addLocationNow(H.v0)}moveDown(e){H.v0.set(this.getUnitVecY()),H.v0.scale(-e),this.addLocation(H.v0)}moveDownNow(e){H.v0.set(this.getUnitVecY()),H.v0.scale(-e),this.addLocationNow(H.v0)}turnUp(e){this.mulRotation(-e,0,0)}turnUpNow(e){this.mulRotationNow(-e,0,0)}turnDown(e){this.mulRotation(e,0,0)}turnDownNow(e){this.mulRotationNow(e,0,0)}turnRight(e){this.mulRotation(0,-e,0)}turnRightNow(e){this.mulRotationNow(0,-e,0)}turnLeft(e){this.mulRotation(0,e,0)}turnLeftNow(e){this.mulRotationNow(0,e,0)}rollRight(e){this.mulRotation(0,0,e)}rollRightNow(e){this.mulRotationNow(0,0,e)}rollLeft(e){this.mulRotation(0,0,-e)}rollLeftNow(e){this.mulRotationNow(0,0,-e)}setLinvel(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.setLinvel(H.v0)}getLinvel(e){return this.transformer.getLinvel(e)}setAngvel(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.setAngvel(H.v0)}getAngvel(e){return this.transformer.getAngvel(e)}resetForce(){this.transformer.resetForce()}addForce(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.addForce(H.v0)}addForceAtPoint(e,t,n,r,o,s){if(typeof e=="number")if(typeof t=="number")H.v0.set(e,t,n),H.v1.set(r,o,s);else{console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else if(typeof t=="number"){console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else H.v0.set(e),H.v1.set(t);this.transformer.addForceAtPoint(H.v0,H.v1)}resetTorque(){this.transformer.resetTorque()}addTorque(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.addTorque(H.v0)}applyImpulse(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.applyImpulse(H.v0)}applyImpulseAtPoint(e,t,n,r,o,s){if(typeof e=="number")if(typeof t=="number")H.v0.set(e,t,n),H.v1.set(r,o,s);else{console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else if(typeof t=="number"){console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else H.v0.set(e),H.v1.set(t);this.transformer.applyImpulseAtPoint(H.v0,H.v1)}applyTorqueImpulse(e,t,n){typeof e=="number"?H.v0.set(e,t,n):H.v0.set(e),this.transformer.applyTorqueImpulse(H.v0)}isGrounded(){return this.transformer.isGrounded()}}class Or{message;dir;offsetTop;offsetRight;offsetLeft;offsetBottom;constructor(e){this.message=e,this.dir="RIGHT",this.offsetTop={x:0,y:2},this.offsetRight={x:1,y:1},this.offsetLeft={x:-1,y:1},this.offsetBottom={x:0,y:0}}}const Mr={type:"audio",autoplay:!1,loop:!1,volume:1,positional:{refDistance:1,maxDistance:1e3,rolloffFactor:1,directional:{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}}};async function Pr(){try{at.listener.context.state!=="running"&&await at.listener.context.resume()}catch{console.warn("AudioContext resume failed. Did you call on user gesture?")}}class at extends Oe{static listener=new se.AudioListener;static audioLoader=new se.AudioLoader;ready;options;sound;constructor(e,t={}){super(),this.options=_t(Mr,t),this.ready=this.asyncInit(e)}initObject(){return new se.Object3D}async asyncInit(e){if(this.options.type==="positional"){const t=new se.PositionalAudio(at.listener);t.setRefDistance(this.options.positional.refDistance),t.setMaxDistance(this.options.positional.maxDistance),t.setRolloffFactor(this.options.positional.rolloffFactor);const n=this.options.positional.directional;t.setDirectionalCone(n.coneInnerAngle,n.coneOuterAngle,n.coneOuterGain),t.setVolume(this.options.volume),t.setLoop(this.options.loop),this.sound=t}else{const t=new se.Audio(at.listener);t.setVolume(this.options.volume),t.setLoop(this.options.loop),this.sound=t}return this.object.add(this.sound),new Promise(t=>{at.audioLoader.load(e,n=>{this.sound&&this.sound.setBuffer(n),t(this)})})}play(){this.sound?.stop(),this.sound?.play()}stop(){this.sound?.stop()}}class Rt extends Oe{ready;actions;currentAction;stateAction;emoteAction;morphs;morphsOverwrite;constructor(e){super(e),this.actions={},this.morphs={},this.morphsOverwrite=!1,this.ready=this.asyncInit(e)}syncInit(e,t,n={}){this.actions=t,this.stateAction=this.actions[e],this.currentAction=this.stateAction,this.object.clear(),this.object.add(this.currentAction.shape.root),this.morphs=n}setActions(e){this.actions=e}getAction(e){return this.actions[e]}addAction(e,t){this.actions[e]=t}removeAction(e){const t=this.actions[e];return delete this.actions[e],t}getActionNames(){return Object.keys(this.actions)}setState(e){const t=this.actions[e];t&&(this.currentAction&&(this.currentAction.sound&&(this.currentAction.soundContinue||this.currentAction.sound.stop()),this.object.remove(this.currentAction.shape.root)),this.object.add(t.shape.root),t.motion.playCount=0,t.motion.time=0,t.sound&&(t.sound.play(),t.motion.setFinishListener(()=>{t.sound?.play()})),this.currentAction=t,this.stateAction=t)}setEmote(e){const t=this.actions[e];t&&(this.currentAction&&(this.currentAction.sound&&(this.currentAction.soundContinue||this.currentAction.sound.stop()),this.object.remove(this.currentAction.shape.root)),this.object.add(t.shape.root),t.motion.playCount=0,t.motion.time=0,t.sound&&(t.sound.play(),t.motion.setFinishListener(()=>{t.sound?.play()})),this.currentAction=t,this.emoteAction=t)}setMorphsOverwrite(e){this.morphsOverwrite=e}morph(e,t){if(e in this.morphs){const{array:n,idx:r}=this.morphs[e];n[r]=t}}getMorphNames(){return Object.keys(this.morphs)}pose={};update(e){super.update(e);let t;if(this.emoteAction&&this.emoteAction.motion.playCount<=0){if(t=this.emoteAction.motion.update(e),this.emoteAction.motion.playCount>0&&(this.currentAction?.shape.root&&this.object.remove(this.currentAction.shape.root),this.currentAction?.sound&&(this.currentAction.soundContinue||this.currentAction.sound.stop()),this.emoteAction=void 0,this.stateAction&&(this.object.add(this.stateAction.shape.root),this.currentAction=this.stateAction,this.stateAction.sound))){const n=this.stateAction.sound;n.play(),this.stateAction.motion.setFinishListener(()=>{n.play()})}}else this.stateAction&&(t=this.stateAction.motion.update(e));if(t&&this.currentAction&&this.currentAction.shape.bones)for(const[n,r]of Object.entries(t)){const o=this.currentAction.shape.bones[n];if(o&&(r.loc&&o.position.set(r.loc.x,r.loc.y,r.loc.z),r.quat&&o.quaternion.set(r.quat.x,r.quat.y,r.quat.z,r.quat.w),r.scale&&o.scale.set(r.scale.x,r.scale.y,r.scale.z)),!this.morphsOverwrite&&r.morphs){for(const s of r.morphs)for(const c of Object.keys(this.morphs))if(c.startsWith(s.name)){const{array:A}=this.morphs[c];for(let a=0;a<A.length;a++)A[a]=s.vals[a];break}}}this.object.updateMatrixWorld(!0),this.currentAction&&this.currentAction.shape.skeleton?.update()}}class Cn{name;playCount;time;finishListener;constructor(){this.name="dummy",this.playCount=0,this.time=0}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){}setTime(e){}setFinishListener(e){this.finishListener=e}update(e){return{}}}class zn{scene;objects;physicsWorld=null;physicsDt=1/60;collisionListener;rapierLines;constructor(){this.scene=new se.Scene,this.objects=[],en.isInitialized&&(this.physicsWorld=en.createWorld({gravity:{x:0,y:-9.81,z:0},timestep:this.physicsDt}))}add(e){if(this.scene.add(e.object),this.objects.push(e),e.scene=this,this.physicsWorld&&(e.transformer.addOneselfToPhysics(this.physicsWorld),e instanceof Rt))for(const t of Object.values(e.actions))t.motion.addOneselfToPhysics(this.physicsWorld)}remove(e){this.scene.remove(e.object);{const t=this.objects.indexOf(e);this.objects[t]=this.objects[this.objects.length-1],this.objects.pop()}if(e.scene=void 0,this.physicsWorld&&(e.transformer.removeOneselfFromPhysics(this.physicsWorld),e instanceof Rt))for(const t of Object.values(e.actions))t.motion.removeOneselfFromPhysics(this.physicsWorld)}setCollisionListener(e){this.collisionListener=e}update(e){if(this.physicsWorld){this.physicsWorld.update(e);const t=this.physicsWorld.getCollisions();if(t.forEach(n=>{n.objectA.handleCollision(n.objectB,n.started,n.partOfA,n.partOfB),n.objectB.handleCollision(n.objectA,n.started,n.partOfB,n.partOfA)}),this.collisionListener&&t.length>0&&this.collisionListener(t),this.rapierLines&&this.physicsWorld instanceof An){const{vertices:n,colors:r}=this.physicsWorld.world.debugRender();this.rapierLines.geometry.setAttribute("position",new se.BufferAttribute(n,3)),this.rapierLines.geometry.setAttribute("color",new se.BufferAttribute(r,4))}}for(const t of this.objects)t.update(e)}rapierDebug(e){e?(this.rapierLines=new se.LineSegments(new se.BufferGeometry,new se.LineBasicMaterial({vertexColors:!0})),this.scene.add(this.rapierLines)):this.rapierLines&&(this.scene.remove(this.rapierLines),this.rapierLines=void 0)}}class Kn extends Oe{controller;setController(e){this.controller=e}setLocation(e,t,n){const r=new Z;typeof e=="number"?(super.setLocation(e,t,n),r.set(e,t,n)):(super.setLocation(e),r.set(e)),this.controller?this.controller.setCameraLocation(r):super.setLocation(r)}setLocationNow(e,t,n){const r=new Z;typeof e=="number"?(super.setLocation(e,t,n),r.set(e,t,n)):(super.setLocation(e),r.set(e)),this.controller?this.controller.setCameraLocationNow(r):super.setLocationNow(r)}setQuat(e,t,n,r){const o=new Te;typeof e=="number"?o.set(e,t,n,r):o.set(e),this.controller?this.controller.setCameraQuat(o):this.transformer.setQuat(o)}setQuatNow(e,t,n,r){const o=new Te;typeof e=="number"?o.set(e,t,n,r):o.set(e),this.controller?this.controller.setCameraQuatNow(o):this.transformer.setQuatNow(o)}lookAt(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):e instanceof Oe?r.set(e.loc):r.set(e);const o=this.upVector?this.upVector:Oe.defaultUpVector,s=At(this.loc,r,o);s.mul(new Te(o.x,o.y,o.z,0)),this.setQuat(s)}lookAtNow(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):e instanceof Oe?r.set(e.loc):r.set(e);const o=this.upVector?this.upVector:Oe.defaultUpVector,s=At(this.loc,r,o);s.mul(new Te(o.x,o.y,o.z,0)),this.setQuatNow(s)}}class xt{view;trans;constructor(){this.trans=new qe}setView(e){this.view=e}update(e){this.view&&(this.view.camera.transformer.setLocation(this.trans.loc),this.view.camera.transformer.setQuat(this.trans.quat),this.view.camera.transformer.setScale(this.trans.scale))}activate(){}deactivate(){}keyDown(e){}keyUp(e){}keyPress(e){}mouseDown(e){}mouseUp(e){}mouseMove(e){}mouseClick(e){}mouseEnter(e){}mouseLeave(e){}mouseWheel(e){}touchStart(e){}touchEnd(e){}touchMove(e){}touchCancel(e){}setCameraLocation(e){this.trans.loc.set(e)}setCameraLocationNow(e){this.trans.loc.set(e)}setCameraQuat(e){this.trans.quat.set(e)}setCameraQuatNow(e){this.trans.quat.set(e)}setCameraScale(e){this.trans.scale.set(e)}setCameraScaleNow(e){this.trans.scale.set(e)}}class Vn extends xt{preMouse;leftClick=!1;rightClick=!1;target;cameraLoc=new Z(0,0,3);cameraQuat=new Te(0,0,0,1);constructor(e,t,n){super(),this.preMouse={x:0,y:0},typeof e=="number"?this.target=new Z(e,t,n):this.target=new Z(e)}update(e){this.view&&(this.view.camera.transformer.setLocation(this.cameraLoc),this.view.camera.transformer.setQuat(this.cameraQuat))}mouseDown(e){e.button===0?(this.leftClick=!0,this.preMouse.x=e.clientX,this.preMouse.y=e.clientY):e.button===2&&(this.rightClick=!0,this.preMouse.x=e.clientX,this.preMouse.y=e.clientY)}mouseMove(e){if(this.view){if(this.leftClick&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey){const n=.01*(e.clientX-this.preMouse.x),r=.01*(e.clientY-this.preMouse.y),o=Math.sin(-n),s=Math.cos(-n),c=Math.sin(-r),A=Math.cos(-r),a=new Z(1,0,0).apply(this.cameraQuat),h=new Z(0,1,0).apply(this.cameraQuat),u=new Te(a.x*c,a.y*c,a.z*c,A),b=new Te(h.x*o,h.y*o,h.z*o,s),f=new Z(this.cameraLoc);f.sub(this.target),f.apply(u),f.apply(b),f.add(this.target),this.cameraLoc.set(f);const I=At(this.cameraLoc,this.target,new Z(0,1,0));I.mul(new Te(0,1,0,0)),this.cameraQuat.set(I),this.preMouse.x=e.clientX,this.preMouse.y=e.clientY}else if(this.leftClick){H.v0.set(this.target),H.v0.sub(this.cameraLoc);const n=.005*H.v0.length(),r=n*(e.clientX-this.preMouse.x),o=n*(e.clientY-this.preMouse.y),s=new Z(1,0,0).apply(this.cameraQuat).scale(-r),c=new Z(0,1,0).apply(this.cameraQuat).scale(o);this.cameraLoc.add(s),this.cameraLoc.add(c),this.target.add(s),this.target.add(c),this.preMouse.x=e.clientX,this.preMouse.y=e.clientY}}}mouseUp(e){e.button===0?this.leftClick=!1:e.button===2&&(this.rightClick=!1)}mouseWheel(e){const t=new Z(this.target).sub(this.cameraLoc);e.deltaY>0?t.scale(.05):e.deltaY<0&&t.scale(-.05),this.cameraLoc.add(t)}setCameraLocation(e){this.cameraLoc.set(e)}setCameraLocationNow(e){this.cameraLoc.set(e)}setCameraQuat(e){e.normalize(),this.cameraQuat.normalize();const t=new Te(this.cameraQuat);t.conjugate();const n=new Z(this.target);n.sub(this.cameraLoc),n.apply(t),n.add(this.cameraLoc),this.target.set(n),this.cameraQuat.set(e)}setCameraQuatNow(e){this.setCameraQuat(e)}}const Gr={speed:.1,angSpeed:.01};class Ur extends xt{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextLoc;_avatarNextQuat;_velY;constructor(e,t){super(),this.options={...Gr,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextLoc=new Z,this._avatarNextQuat=new Te,this._velY=0}keyDown(e){e.code==="KeyW"?this._keyW=!0:e.code==="KeyA"?this._keyA=!0:e.code==="KeyS"?this._keyS=!0:e.code==="KeyD"?this._keyD=!0:e.code==="ArrowLeft"?this._keyLeft=!0:e.code==="ArrowRight"?this._keyRight=!0:e.code==="Space"&&(this._keySpace=!0)}keyUp(e){e.code==="KeyW"?this._keyW=!1:e.code==="KeyA"?this._keyA=!1:e.code==="KeyS"?this._keyS=!1:e.code==="KeyD"?this._keyD=!1:e.code==="ArrowLeft"?this._keyLeft=!1:e.code==="ArrowRight"?this._keyRight=!1:e.code==="Space"&&(this._keySpace=!1)}update(e){const t=this._avatar,n=new qe;n.set(t);const r=t.getUnitVecZ().scale(this.options.speed),o=t.getUnitVecX().scale(this.options.speed);this._avatarNextLoc.set(n.loc),this._avatarNextQuat.set(n.quat),this._keyW&&this._avatarNextLoc.add(r),this._keyA&&this._avatarNextLoc.add(o),this._keyS&&this._avatarNextLoc.sub(r),this._keyD&&this._avatarNextLoc.sub(o),this._velY+=-9.8*e*.1,t.isGrounded()&&(this._velY=0,this._keySpace&&(this._velY=.5)),this._avatarNextLoc.add(0,this._velY,0),this._keyLeft&&this._avatarNextQuat.mul(dt(new Z(0,this.options.angSpeed,0))),this._keyRight&&this._avatarNextQuat.mul(dt(new Z(0,-this.options.angSpeed,0))),t.transformer.setLocation(this._avatarNextLoc),t.transformer.setQuat(this._avatarNextQuat)}}const jr={speed:5,angSpeed:.3,jumpSpeed:15};class Hr extends xt{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextVel;_avatarNextAngVel;_velY;constructor(e,t){super(),this.options={...jr,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextVel=new Z,this._avatarNextAngVel=new Z,this._velY=0}keyDown(e){e.code==="KeyW"?this._keyW=!0:e.code==="KeyA"?this._keyA=!0:e.code==="KeyS"?this._keyS=!0:e.code==="KeyD"?this._keyD=!0:e.code==="ArrowLeft"?this._keyLeft=!0:e.code==="ArrowRight"?this._keyRight=!0:e.code==="Space"&&(this._keySpace=!0)}keyUp(e){e.code==="KeyW"?this._keyW=!1:e.code==="KeyA"?this._keyA=!1:e.code==="KeyS"?this._keyS=!1:e.code==="KeyD"?this._keyD=!1:e.code==="ArrowLeft"?this._keyLeft=!1:e.code==="ArrowRight"?this._keyRight=!1:e.code==="Space"&&(this._keySpace=!1)}update(e){const t=this._avatar;new qe().set(t);const r=t.getUnitVecZ().scale(this.options.speed),o=t.getUnitVecX().scale(this.options.speed);this._avatarNextVel.set(0,0,0),this._avatarNextAngVel.set(0,0,0),this._keyW&&this._avatarNextVel.add(r),this._keyA&&this._avatarNextVel.add(o),this._keyS&&this._avatarNextVel.sub(r),this._keyD&&this._avatarNextVel.sub(o),this._velY+=-9.8*e,t.isGrounded()&&(this._velY=0,this._keySpace&&(this._velY=this.options.jumpSpeed)),this._avatarNextVel.add(0,this._velY,0),this._keyLeft&&this._avatarNextAngVel.add(new Z(0,this.options.angSpeed,0)),this._keyRight&&this._avatarNextAngVel.add(new Z(0,-this.options.angSpeed,0)),t.transformer.setLinvel(this._avatarNextVel),t.transformer.setAngvel(this._avatarNextAngVel)}}class Wn{scene;camera;controller;constructor(e){this.scene=new zn,this.camera=e,this.camera.setAudioListener(at.listener),this.scene.scene.add(this.camera.object),this.camera.setLocation(0,0,3),this.controller=new Vn(0,0,0),this.controller.setView(this),this.controller.activate(),this.camera.setController(this.controller)}replaceScene(e){this.scene.scene.remove(this.camera.object),e.scene.add(this.camera.object);const t=this.scene;return this.scene=e,t}updateScene(e){this.scene.update(e),this.controller?.update(e),this.camera.update(e)}setController(e){this.controller.deactivate(),this.controller=e,this.controller.setView(this),this.controller.activate(),this.camera.setController(e)}worldToScreen(e){throw new Error("ViewBaseはworldToScreen()は実装していません")}screenToWorld(e,t,n){throw new Error("ViewBaseはscreenToWorld()は実装していません")}cameraToScreen(e){throw new Error("ViewBaseはcameraToScreen()は実装していません")}screenToCamera(e,t,n){throw new Error("ViewBaseはscreenToCamera()は実装していません")}async waitForRender(){throw new Error("ViewBaseはwaitForRender()は実装していません")}}class vt extends Kn{camera;headLight;constructor(e){super(),this.camera=e,this.headLight=new se.SpotLight(16777215,1,0,Math.PI/3,0,0),this.headLight.position.set(0,0,0);const t=new se.Object3D;t.position.set(0,0,-10),this.headLight.target=t,this.object.add(this.camera),this.object.add(this.headLight),this.object.add(t)}initObject(){return new se.Object3D}setAudioListener(e){this.camera.add(e)}getHeadLight(){return this.headLight}setAspect(e){Rr(this.camera)&&(this.camera.aspect=e,this.camera.updateProjectionMatrix())}setHeadLightEnable(e){e?this.headLight.intensity=1:this.headLight.intensity=0}calcNDC(e){const t=new se.Vector3(e.x,e.y,e.z);return t.project(this.camera),{x:t.x,y:t.y}}}class Yn extends g.Object3D{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new g.Vector2(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element&&t.element instanceof t.element.ownerDocument.defaultView.Element&&t.element.parentNode!==null&&t.element.remove()})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const gt=new g.Vector3,yn=new g.Matrix4,Bn=new g.Matrix4,wn=new g.Vector3,Tn=new g.Vector3;class Jn{constructor(e={}){const t=this;let n,r,o,s;const c={objects:new WeakMap},A=e.element!==void 0?e.element:document.createElement("div");A.style.overflow="hidden",this.domElement=A,this.sortObjects=!0,this.getSize=function(){return{width:n,height:r}},this.render=function(I,E){I.matrixWorldAutoUpdate===!0&&I.updateMatrixWorld(),E.parent===null&&E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),yn.copy(E.matrixWorldInverse),Bn.multiplyMatrices(E.projectionMatrix,yn),h(I,I,E),this.sortObjects&&f(I)},this.setSize=function(I,E){n=I,r=E,o=n/2,s=r/2,A.style.width=I+"px",A.style.height=E+"px"};function a(I){I.isCSS2DObject&&(I.element.style.display="none");for(let E=0,l=I.children.length;E<l;E++)a(I.children[E])}function h(I,E,l){if(I.visible===!1){a(I);return}if(I.isCSS2DObject){gt.setFromMatrixPosition(I.matrixWorld),gt.applyMatrix4(Bn);const d=gt.z>=-1&>.z<=1&&I.layers.test(l.layers)===!0,p=I.element;p.style.display=d===!0?"":"none",d===!0&&(I.onBeforeRender(t,E,l),p.style.transform="translate("+-100*I.center.x+"%,"+-100*I.center.y+"%)translate("+(gt.x*o+o)+"px,"+(-gt.y*s+s)+"px)",p.parentNode!==A&&A.appendChild(p),I.onAfterRender(t,E,l));const C={distanceToCameraSquared:u(l,I)};c.objects.set(I,C)}for(let d=0,p=I.children.length;d<p;d++)h(I.children[d],E,l)}function u(I,E){return wn.setFromMatrixPosition(I.matrixWorld),Tn.setFromMatrixPosition(E.matrixWorld),wn.distanceToSquared(Tn)}function b(I){const E=[];return I.traverseVisible(function(l){l.isCSS2DObject&&E.push(l)}),E}function f(I){const E=b(I).sort(function(d,p){if(d.renderOrder!==p.renderOrder)return p.renderOrder-d.renderOrder;const C=c.objects.get(d).distanceToCameraSquared,m=c.objects.get(p).distanceToCameraSquared;return C-m}),l=E.length;for(let d=0,p=E.length;d<p;d++)E[d].element.style.zIndex=l-d}}}function Rn(i,e){if(e===g.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===g.TriangleFanDrawMode||e===g.TriangleStripDrawMode){let t=i.getIndex();if(t===null){const s=[],c=i.getAttribute("position");if(c!==void 0){for(let A=0;A<c.count;A++)s.push(A);i.setIndex(s),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,r=[];if(e===g.TriangleFanDrawMode)for(let s=1;s<=n;s++)r.push(t.getX(0)),r.push(t.getX(s)),r.push(t.getX(s+1));else for(let s=0;s<n;s++)s%2===0?(r.push(t.getX(s)),r.push(t.getX(s+1)),r.push(t.getX(s+2))):(r.push(t.getX(s+2)),r.push(t.getX(s+1)),r.push(t.getX(s)));r.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=i.clone();return o.setIndex(r),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}class Xn extends g.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Wr(t)}),this.register(function(t){return new Yr(t)}),this.register(function(t){return new ro(t)}),this.register(function(t){return new oo(t)}),this.register(function(t){return new so(t)}),this.register(function(t){return new Xr(t)}),this.register(function(t){return new Zr(t)}),this.register(function(t){return new $r(t)}),this.register(function(t){return new eo(t)}),this.register(function(t){return new Vr(t)}),this.register(function(t){return new to(t)}),this.register(function(t){return new Jr(t)}),this.register(function(t){return new io(t)}),this.register(function(t){return new no(t)}),this.register(function(t){return new zr(t)}),this.register(function(t){return new ao(t)}),this.register(function(t){return new Ao(t)})}load(e,t,n,r){const o=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const a=g.LoaderUtils.extractUrlBase(e);s=g.LoaderUtils.resolveURL(a,this.path)}else s=g.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const c=function(a){r?r(a):console.error(a),o.manager.itemError(e),o.manager.itemEnd(e)},A=new g.FileLoader(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(a){try{o.parse(a,s,function(h){t(h),o.manager.itemEnd(e)},c)}catch(h){c(h)}},n,c)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let o;const s={},c={},A=new TextDecoder;if(typeof e=="string")o=JSON.parse(e);else if(e instanceof ArrayBuffer)if(A.decode(new Uint8Array(e,0,4))===Zn){try{s[Se.KHR_BINARY_GLTF]=new co(e)}catch(u){r&&r(u);return}o=JSON.parse(s[Se.KHR_BINARY_GLTF].content)}else o=JSON.parse(A.decode(e));else o=e;if(o.asset===void 0||o.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const a=new Bo(o,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});a.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){const u=this.pluginCallbacks[h](a);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),c[u.name]=u,s[u.name]=!0}if(o.extensionsUsed)for(let h=0;h<o.extensionsUsed.length;++h){const u=o.extensionsUsed[h],b=o.extensionsRequired||[];switch(u){case Se.KHR_MATERIALS_UNLIT:s[u]=new Kr;break;case Se.KHR_DRACO_MESH_COMPRESSION:s[u]=new lo(o,this.dracoLoader);break;case Se.KHR_TEXTURE_TRANSFORM:s[u]=new uo;break;case Se.KHR_MESH_QUANTIZATION:s[u]=new ho;break;default:b.indexOf(u)>=0&&c[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}a.setExtensions(s),a.setPlugins(c),a.parse(n,r)}parseAsync(e,t){const n=this;return new Promise(function(r,o){n.parse(e,t,r,o)})}}function qr(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const Se={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class zr{constructor(e){this.parser=e,this.name=Se.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const o=t[n];o.extensions&&o.extensions[this.name]&&o.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,o.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const o=t.json,A=((o.extensions&&o.extensions[this.name]||{}).lights||[])[e];let a;const h=new g.Color(16777215);A.color!==void 0&&h.setRGB(A.color[0],A.color[1],A.color[2],g.LinearSRGBColorSpace);const u=A.range!==void 0?A.range:0;switch(A.type){case"directional":a=new g.DirectionalLight(h),a.target.position.set(0,0,-1),a.add(a.target);break;case"point":a=new g.PointLight(h),a.distance=u;break;case"spot":a=new g.SpotLight(h),a.distance=u,A.spot=A.spot||{},A.spot.innerConeAngle=A.spot.innerConeAngle!==void 0?A.spot.innerConeAngle:0,A.spot.outerConeAngle=A.spot.outerConeAngle!==void 0?A.spot.outerConeAngle:Math.PI/4,a.angle=A.spot.outerConeAngle,a.penumbra=1-A.spot.innerConeAngle/A.spot.outerConeAngle,a.target.position.set(0,0,-1),a.add(a.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+A.type)}return a.position.set(0,0,0),rt(a,A),A.intensity!==void 0&&(a.intensity=A.intensity),a.name=t.createUniqueName(A.name||"light_"+e),r=Promise.resolve(a),t.cache.add(n,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,o=n.json.nodes[e],c=(o.extensions&&o.extensions[this.name]||{}).light;return c===void 0?null:this._loadLight(c).then(function(A){return n._getNodeRef(t.cache,c,A)})}}class Kr{constructor(){this.name=Se.KHR_MATERIALS_UNLIT}getMaterialType(){return g.MeshBasicMaterial}extendParams(e,t,n){const r=[];e.color=new g.Color(1,1,1),e.opacity=1;const o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){const s=o.baseColorFactor;e.color.setRGB(s[0],s[1],s[2],g.LinearSRGBColorSpace),e.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(n.assignTexture(e,"map",o.baseColorTexture,g.SRGBColorSpace))}return Promise.all(r)}}class Vr{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name].emissiveStrength;return o!==void 0&&(t.emissiveIntensity=o),Promise.resolve()}}class Wr{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];if(s.clearcoatFactor!==void 0&&(t.clearcoat=s.clearcoatFactor),s.clearcoatTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),s.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),s.clearcoatRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),s.clearcoatNormalTexture!==void 0&&(o.push(n.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),s.clearcoatNormalTexture.scale!==void 0)){const c=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new g.Vector2(c,c)}return Promise.all(o)}}class Yr{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name];return t.dispersion=o.dispersion!==void 0?o.dispersion:0,Promise.resolve()}}class Jr{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.iridescenceFactor!==void 0&&(t.iridescence=s.iridescenceFactor),s.iridescenceTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceMap",s.iridescenceTexture)),s.iridescenceIor!==void 0&&(t.iridescenceIOR=s.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),s.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),s.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),s.iridescenceThicknessTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(o)}}class Xr{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[];t.sheenColor=new g.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const s=r.extensions[this.name];if(s.sheenColorFactor!==void 0){const c=s.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],g.LinearSRGBColorSpace)}return s.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&o.push(n.assignTexture(t,"sheenColorMap",s.sheenColorTexture,g.SRGBColorSpace)),s.sheenRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(o)}}class Zr{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.transmissionFactor!==void 0&&(t.transmission=s.transmissionFactor),s.transmissionTexture!==void 0&&o.push(n.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(o)}}class $r{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];t.thickness=s.thicknessFactor!==void 0?s.thicknessFactor:0,s.thicknessTexture!==void 0&&o.push(n.assignTexture(t,"thicknessMap",s.thicknessTexture)),t.attenuationDistance=s.attenuationDistance||1/0;const c=s.attenuationColor||[1,1,1];return t.attenuationColor=new g.Color().setRGB(c[0],c[1],c[2],g.LinearSRGBColorSpace),Promise.all(o)}}class eo{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name];return t.ior=o.ior!==void 0?o.ior:1.5,Promise.resolve()}}class to{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];t.specularIntensity=s.specularFactor!==void 0?s.specularFactor:1,s.specularTexture!==void 0&&o.push(n.assignTexture(t,"specularIntensityMap",s.specularTexture));const c=s.specularColorFactor||[1,1,1];return t.specularColor=new g.Color().setRGB(c[0],c[1],c[2],g.LinearSRGBColorSpace),s.specularColorTexture!==void 0&&o.push(n.assignTexture(t,"specularColorMap",s.specularColorTexture,g.SRGBColorSpace)),Promise.all(o)}}class no{constructor(e){this.parser=e,this.name=Se.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return t.bumpScale=s.bumpFactor!==void 0?s.bumpFactor:1,s.bumpTexture!==void 0&&o.push(n.assignTexture(t,"bumpMap",s.bumpTexture)),Promise.all(o)}}class io{constructor(e){this.parser=e,this.name=Se.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.anisotropyStrength!==void 0&&(t.anisotropy=s.anisotropyStrength),s.anisotropyRotation!==void 0&&(t.anisotropyRotation=s.anisotropyRotation),s.anisotropyTexture!==void 0&&o.push(n.assignTexture(t,"anisotropyMap",s.anisotropyTexture)),Promise.all(o)}}class ro{constructor(e){this.parser=e,this.name=Se.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const o=r.extensions[this.name],s=t.options.ktx2Loader;if(!s){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o.source,s)}}class oo{constructor(e){this.parser=e,this.name=Se.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,r=n.json,o=r.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],c=r.images[s.source];let A=n.textureLoader;if(c.uri){const a=n.options.manager.getHandler(c.uri);a!==null&&(A=a)}return n.loadTextureImage(e,s.source,A)}}class so{constructor(e){this.parser=e,this.name=Se.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,r=n.json,o=r.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],c=r.images[s.source];let A=n.textureLoader;if(c.uri){const a=n.options.manager.getHandler(c.uri);a!==null&&(A=a)}return n.loadTextureImage(e,s.source,A)}}class ao{constructor(e){this.name=Se.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const r=n.extensions[this.name],o=this.parser.getDependency("buffer",r.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(c){const A=r.byteOffset||0,a=r.byteLength||0,h=r.count,u=r.byteStride,b=new Uint8Array(c,A,a);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(h,u,b,r.mode,r.filter).then(function(f){return f.buffer}):s.ready.then(function(){const f=new ArrayBuffer(h*u);return s.decodeGltfBuffer(new Uint8Array(f),h,u,b,r.mode,r.filter),f})})}else return null}}class Ao{constructor(e){this.name=Se.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const r=t.meshes[n.mesh];for(const a of r.primitives)if(a.mode!==$e.TRIANGLES&&a.mode!==$e.TRIANGLE_STRIP&&a.mode!==$e.TRIANGLE_FAN&&a.mode!==void 0)return null;const s=n.extensions[this.name].attributes,c=[],A={};for(const a in s)c.push(this.parser.getDependency("accessor",s[a]).then(h=>(A[a]=h,A[a])));return c.length<1?null:(c.push(this.parser.createNodeMesh(e)),Promise.all(c).then(a=>{const h=a.pop(),u=h.isGroup?h.children:[h],b=a[0].count,f=[];for(const I of u){const E=new g.Matrix4,l=new g.Vector3,d=new g.Quaternion,p=new g.Vector3(1,1,1),C=new g.InstancedMesh(I.geometry,I.material,b);for(let m=0;m<b;m++)A.TRANSLATION&&l.fromBufferAttribute(A.TRANSLATION,m),A.ROTATION&&d.fromBufferAttribute(A.ROTATION,m),A.SCALE&&p.fromBufferAttribute(A.SCALE,m),C.setMatrixAt(m,E.compose(l,d,p));for(const m in A)if(m==="_COLOR_0"){const y=A[m];C.instanceColor=new g.InstancedBufferAttribute(y.array,y.itemSize,y.normalized)}else m!=="TRANSLATION"&&m!=="ROTATION"&&m!=="SCALE"&&I.geometry.setAttribute(m,A[m]);g.Object3D.prototype.copy.call(C,I),this.parser.assignFinalMaterial(C),f.push(C)}return h.isGroup?(h.clear(),h.add(...f),h):f[0]}))}}const Zn="glTF",bt=12,vn={JSON:1313821514,BIN:5130562};class co{constructor(e){this.name=Se.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,bt),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Zn)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const r=this.header.length-bt,o=new DataView(e,bt);let s=0;for(;s<r;){const c=o.getUint32(s,!0);s+=4;const A=o.getUint32(s,!0);if(s+=4,A===vn.JSON){const a=new Uint8Array(e,bt+s,c);this.content=n.decode(a)}else if(A===vn.BIN){const a=bt+s;this.body=e.slice(a,a+c)}s+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class lo{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Se.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,o=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,c={},A={},a={};for(const h in s){const u=tn[h]||h.toLowerCase();c[u]=s[h]}for(const h in e.attributes){const u=tn[h]||h.toLowerCase();if(s[h]!==void 0){const b=n.accessors[e.attributes[h]],f=mt[b.componentType];a[u]=f.name,A[u]=b.normalized===!0}}return t.getDependency("bufferView",o).then(function(h){return new Promise(function(u,b){r.decodeDracoFile(h,function(f){for(const I in f.attributes){const E=f.attributes[I],l=A[I];l!==void 0&&(E.normalized=l)}u(f)},c,a,g.LinearSRGBColorSpace,b)})})}}class uo{constructor(){this.name=Se.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class ho{constructor(){this.name=Se.KHR_MESH_QUANTIZATION}}class $n extends g.Interpolant{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,o=e*r*3+r;for(let s=0;s!==r;s++)t[s]=n[o+s];return t}interpolate_(e,t,n,r){const o=this.resultBuffer,s=this.sampleValues,c=this.valueSize,A=c*2,a=c*3,h=r-t,u=(n-t)/h,b=u*u,f=b*u,I=e*a,E=I-a,l=-2*f+3*b,d=f-b,p=1-l,C=d-b+u;for(let m=0;m!==c;m++){const y=s[E+m+c],Q=s[E+m+A]*h,_=s[I+m+c],j=s[I+m]*h;o[m]=p*y+C*Q+l*_+d*j}return o}}const fo=new g.Quaternion;class po extends $n{interpolate_(e,t,n,r){const o=super.interpolate_(e,t,n,r);return fo.fromArray(o).normalize().toArray(o),o}}const $e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},mt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Qn={9728:g.NearestFilter,9729:g.LinearFilter,9984:g.NearestMipmapNearestFilter,9985:g.LinearMipmapNearestFilter,9986:g.NearestMipmapLinearFilter,9987:g.LinearMipmapLinearFilter},kn={33071:g.ClampToEdgeWrapping,33648:g.MirroredRepeatWrapping,10497:g.RepeatWrapping},Gt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},tn={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ut={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},go={CUBICSPLINE:void 0,LINEAR:g.InterpolateLinear,STEP:g.InterpolateDiscrete},Ut={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Eo(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new g.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:g.FrontSide})),i.DefaultMaterial}function ht(i,e,t){for(const n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function rt(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function mo(i,e,t){let n=!1,r=!1,o=!1;for(let a=0,h=e.length;a<h;a++){const u=e[a];if(u.POSITION!==void 0&&(n=!0),u.NORMAL!==void 0&&(r=!0),u.COLOR_0!==void 0&&(o=!0),n&&r&&o)break}if(!n&&!r&&!o)return Promise.resolve(i);const s=[],c=[],A=[];for(let a=0,h=e.length;a<h;a++){const u=e[a];if(n){const b=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):i.attributes.position;s.push(b)}if(r){const b=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):i.attributes.normal;c.push(b)}if(o){const b=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):i.attributes.color;A.push(b)}}return Promise.all([Promise.all(s),Promise.all(c),Promise.all(A)]).then(function(a){const h=a[0],u=a[1],b=a[2];return n&&(i.morphAttributes.position=h),r&&(i.morphAttributes.normal=u),o&&(i.morphAttributes.color=b),i.morphTargetsRelative=!0,i})}function Io(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,r=t.length;n<r;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function bo(i){let e;const t=i.extensions&&i.extensions[Se.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+jt(t.attributes):e=i.indices+":"+jt(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,r=i.targets.length;n<r;n++)e+=":"+jt(i.targets[n]);return e}function jt(i){let e="";const t=Object.keys(i).sort();for(let n=0,r=t.length;n<r;n++)e+=t[n]+":"+i[t[n]]+";";return e}function nn(i){switch(i){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function Co(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":i.search(/\.ktx2($|\?)/i)>0||i.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const yo=new g.Matrix4;class Bo{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new qr,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=-1,o=!1,s=-1;if(typeof navigator<"u"){const c=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(c)===!0;const A=c.match(/Version\/(\d+)/);r=n&&A?parseInt(A[1],10):-1,o=c.indexOf("Firefox")>-1,s=o?c.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&r<17||o&&s<98?this.textureLoader=new g.TextureLoader(this.options.manager):this.textureLoader=new g.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new g.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,r=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(s){const c={scene:s[0][r.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:r.asset,parser:n,userData:{}};return ht(o,c,r),rt(c,r),Promise.all(n._invokeAll(function(A){return A.afterRoot&&A.afterRoot(c)})).then(function(){for(const A of c.scenes)A.updateMatrixWorld();e(c)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let r=0,o=t.length;r<o;r++){const s=t[r].joints;for(let c=0,A=s.length;c<A;c++)e[s[c]].isBone=!0}for(let r=0,o=e.length;r<o;r++){const s=e[r];s.mesh!==void 0&&(this._addNodeRef(this.meshCache,s.mesh),s.skin!==void 0&&(n[s.mesh].isSkinnedMesh=!0)),s.camera!==void 0&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const r=n.clone(),o=(s,c)=>{const A=this.associations.get(s);A!=null&&this.associations.set(c,A);for(const[a,h]of s.children.entries())o(h,c.children[a])};return o(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const o=e(t[r]);o&&n.push(o)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne(function(o){return o.loadNode&&o.loadNode(t)});break;case"mesh":r=this._invokeOne(function(o){return o.loadMesh&&o.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(o){return o.loadBufferView&&o.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(o){return o.loadMaterial&&o.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(o){return o.loadTexture&&o.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(o){return o.loadAnimation&&o.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(o){return o!=this&&o.getDependency&&o.getDependency(e,t)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(o,s){return n.getDependency(e,s)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Se.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(o,s){n.load(g.LoaderUtils.resolveURL(t.uri,r.path),o,void 0,function(){s(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const r=t.byteLength||0,o=t.byteOffset||0;return n.slice(o,o+r)})}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const s=Gt[r.type],c=mt[r.componentType],A=r.normalized===!0,a=new c(r.count*s);return Promise.resolve(new g.BufferAttribute(a,s,A))}const o=[];return r.bufferView!==void 0?o.push(this.getDependency("bufferView",r.bufferView)):o.push(null),r.sparse!==void 0&&(o.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(o).then(function(s){const c=s[0],A=Gt[r.type],a=mt[r.componentType],h=a.BYTES_PER_ELEMENT,u=h*A,b=r.byteOffset||0,f=r.bufferView!==void 0?n.bufferViews[r.bufferView].byteStride:void 0,I=r.normalized===!0;let E,l;if(f&&f!==u){const d=Math.floor(b/f),p="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+d+":"+r.count;let C=t.cache.get(p);C||(E=new a(c,d*f,r.count*f/h),C=new g.InterleavedBuffer(E,f/h),t.cache.add(p,C)),l=new g.InterleavedBufferAttribute(C,A,b%f/h,I)}else c===null?E=new a(r.count*A):E=new a(c,b,r.count*A),l=new g.BufferAttribute(E,A,I);if(r.sparse!==void 0){const d=Gt.SCALAR,p=mt[r.sparse.indices.componentType],C=r.sparse.indices.byteOffset||0,m=r.sparse.values.byteOffset||0,y=new p(s[1],C,r.sparse.count*d),Q=new a(s[2],m,r.sparse.count*A);c!==null&&(l=new g.BufferAttribute(l.array.slice(),l.itemSize,l.normalized)),l.normalized=!1;for(let _=0,j=y.length;_<j;_++){const v=y[_];if(l.setX(v,Q[_*A]),A>=2&&l.setY(v,Q[_*A+1]),A>=3&&l.setZ(v,Q[_*A+2]),A>=4&&l.setW(v,Q[_*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}l.normalized=I}return l})}loadTexture(e){const t=this.json,n=this.options,o=t.textures[e].source,s=t.images[o];let c=this.textureLoader;if(s.uri){const A=n.manager.getHandler(s.uri);A!==null&&(c=A)}return this.loadTextureImage(e,o,c)}loadTextureImage(e,t,n){const r=this,o=this.json,s=o.textures[e],c=o.images[t],A=(c.uri||c.bufferView)+":"+s.sampler;if(this.textureCache[A])return this.textureCache[A];const a=this.loadImageSource(t,n).then(function(h){h.flipY=!1,h.name=s.name||c.name||"",h.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(h.name=c.uri);const b=(o.samplers||{})[s.sampler]||{};return h.magFilter=Qn[b.magFilter]||g.LinearFilter,h.minFilter=Qn[b.minFilter]||g.LinearMipmapLinearFilter,h.wrapS=kn[b.wrapS]||g.RepeatWrapping,h.wrapT=kn[b.wrapT]||g.RepeatWrapping,h.generateMipmaps=!h.isCompressedTexture&&h.minFilter!==g.NearestFilter&&h.minFilter!==g.LinearFilter,r.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[A]=a,a}loadImageSource(e,t){const n=this,r=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const s=r.images[e],c=self.URL||self.webkitURL;let A=s.uri||"",a=!1;if(s.bufferView!==void 0)A=n.getDependency("bufferView",s.bufferView).then(function(u){a=!0;const b=new Blob([u],{type:s.mimeType});return A=c.createObjectURL(b),A});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(A).then(function(u){return new Promise(function(b,f){let I=b;t.isImageBitmapLoader===!0&&(I=function(E){const l=new g.Texture(E);l.needsUpdate=!0,b(l)}),t.load(g.LoaderUtils.resolveURL(u,o.path),I,void 0,f)})}).then(function(u){return a===!0&&c.revokeObjectURL(A),rt(u,s),u.userData.mimeType=s.mimeType||Co(s.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),u});return this.sourceCache[e]=h,h}assignTexture(e,t,n,r){const o=this;return this.getDependency("texture",n.index).then(function(s){if(!s)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(s=s.clone(),s.channel=n.texCoord),o.extensions[Se.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[Se.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const A=o.associations.get(s);s=o.extensions[Se.KHR_TEXTURE_TRANSFORM].extendTexture(s,c),o.associations.set(s,A)}}return r!==void 0&&(s.colorSpace=r),e[t]=s,s})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=t.attributes.tangent===void 0,o=t.attributes.color!==void 0,s=t.attributes.normal===void 0;if(e.isPoints){const c="PointsMaterial:"+n.uuid;let A=this.cache.get(c);A||(A=new g.PointsMaterial,g.Material.prototype.copy.call(A,n),A.color.copy(n.color),A.map=n.map,A.sizeAttenuation=!1,this.cache.add(c,A)),n=A}else if(e.isLine){const c="LineBasicMaterial:"+n.uuid;let A=this.cache.get(c);A||(A=new g.LineBasicMaterial,g.Material.prototype.copy.call(A,n),A.color.copy(n.color),A.map=n.map,this.cache.add(c,A)),n=A}if(r||o||s){let c="ClonedMaterial:"+n.uuid+":";r&&(c+="derivative-tangents:"),o&&(c+="vertex-colors:"),s&&(c+="flat-shading:");let A=this.cache.get(c);A||(A=n.clone(),o&&(A.vertexColors=!0),s&&(A.flatShading=!0),r&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(c,A),this.associations.set(A,this.associations.get(n))),n=A}e.material=n}getMaterialType(){return g.MeshStandardMaterial}loadMaterial(e){const t=this,n=this.json,r=this.extensions,o=n.materials[e];let s;const c={},A=o.extensions||{},a=[];if(A[Se.KHR_MATERIALS_UNLIT]){const u=r[Se.KHR_MATERIALS_UNLIT];s=u.getMaterialType(),a.push(u.extendParams(c,o,t))}else{const u=o.pbrMetallicRoughness||{};if(c.color=new g.Color(1,1,1),c.opacity=1,Array.isArray(u.baseColorFactor)){const b=u.baseColorFactor;c.color.setRGB(b[0],b[1],b[2],g.LinearSRGBColorSpace),c.opacity=b[3]}u.baseColorTexture!==void 0&&a.push(t.assignTexture(c,"map",u.baseColorTexture,g.SRGBColorSpace)),c.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,c.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(a.push(t.assignTexture(c,"metalnessMap",u.metallicRoughnessTexture)),a.push(t.assignTexture(c,"roughnessMap",u.metallicRoughnessTexture))),s=this._invokeOne(function(b){return b.getMaterialType&&b.getMaterialType(e)}),a.push(Promise.all(this._invokeAll(function(b){return b.extendMaterialParams&&b.extendMaterialParams(e,c)})))}o.doubleSided===!0&&(c.side=g.DoubleSide);const h=o.alphaMode||Ut.OPAQUE;if(h===Ut.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,h===Ut.MASK&&(c.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&s!==g.MeshBasicMaterial&&(a.push(t.assignTexture(c,"normalMap",o.normalTexture)),c.normalScale=new g.Vector2(1,1),o.normalTexture.scale!==void 0)){const u=o.normalTexture.scale;c.normalScale.set(u,u)}if(o.occlusionTexture!==void 0&&s!==g.MeshBasicMaterial&&(a.push(t.assignTexture(c,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&s!==g.MeshBasicMaterial){const u=o.emissiveFactor;c.emissive=new g.Color().setRGB(u[0],u[1],u[2],g.LinearSRGBColorSpace)}return o.emissiveTexture!==void 0&&s!==g.MeshBasicMaterial&&a.push(t.assignTexture(c,"emissiveMap",o.emissiveTexture,g.SRGBColorSpace)),Promise.all(a).then(function(){const u=new s(c);return o.name&&(u.name=o.name),rt(u,o),t.associations.set(u,{materials:e}),o.extensions&&ht(r,u,o),u})}createUniqueName(e){const t=g.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,r=this.primitiveCache;function o(c){return n[Se.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(A){return Sn(A,c,t)})}const s=[];for(let c=0,A=e.length;c<A;c++){const a=e[c],h=bo(a),u=r[h];if(u)s.push(u.promise);else{let b;a.extensions&&a.extensions[Se.KHR_DRACO_MESH_COMPRESSION]?b=o(a):b=Sn(new g.BufferGeometry,a,t),r[h]={primitive:a,promise:b},s.push(b)}}return Promise.all(s)}loadMesh(e){const t=this,n=this.json,r=this.extensions,o=n.meshes[e],s=o.primitives,c=[];for(let A=0,a=s.length;A<a;A++){const h=s[A].material===void 0?Eo(this.cache):this.getDependency("material",s[A].material);c.push(h)}return c.push(t.loadGeometries(s)),Promise.all(c).then(function(A){const a=A.slice(0,A.length-1),h=A[A.length-1],u=[];for(let f=0,I=h.length;f<I;f++){const E=h[f],l=s[f];let d;const p=a[f];if(l.mode===$e.TRIANGLES||l.mode===$e.TRIANGLE_STRIP||l.mode===$e.TRIANGLE_FAN||l.mode===void 0)d=o.isSkinnedMesh===!0?new g.SkinnedMesh(E,p):new g.Mesh(E,p),d.isSkinnedMesh===!0&&d.normalizeSkinWeights(),l.mode===$e.TRIANGLE_STRIP?d.geometry=Rn(d.geometry,g.TriangleStripDrawMode):l.mode===$e.TRIANGLE_FAN&&(d.geometry=Rn(d.geometry,g.TriangleFanDrawMode));else if(l.mode===$e.LINES)d=new g.LineSegments(E,p);else if(l.mode===$e.LINE_STRIP)d=new g.Line(E,p);else if(l.mode===$e.LINE_LOOP)d=new g.LineLoop(E,p);else if(l.mode===$e.POINTS)d=new g.Points(E,p);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+l.mode);Object.keys(d.geometry.morphAttributes).length>0&&Io(d,o),d.name=t.createUniqueName(o.name||"mesh_"+e),rt(d,o),l.extensions&&ht(r,d,l),t.assignFinalMaterial(d),u.push(d)}for(let f=0,I=u.length;f<I;f++)t.associations.set(u[f],{meshes:e,primitives:f});if(u.length===1)return o.extensions&&ht(r,u[0],o),u[0];const b=new g.Group;o.extensions&&ht(r,b,o),t.associations.set(b,{meshes:e});for(let f=0,I=u.length;f<I;f++)b.add(u[f]);return b})}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new g.PerspectiveCamera(g.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type==="orthographic"&&(t=new g.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),rt(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let r=0,o=t.joints.length;r<o;r++)n.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(r){const o=r.pop(),s=r,c=[],A=[];for(let a=0,h=s.length;a<h;a++){const u=s[a];if(u){c.push(u);const b=new g.Matrix4;o!==null&&b.fromArray(o.array,a*16),A.push(b)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new g.Skeleton(c,A)})}loadAnimation(e){const t=this.json,n=this,r=t.animations[e],o=r.name?r.name:"animation_"+e,s=[],c=[],A=[],a=[],h=[];for(let u=0,b=r.channels.length;u<b;u++){const f=r.channels[u],I=r.samplers[f.sampler],E=f.target,l=E.node,d=r.parameters!==void 0?r.parameters[I.input]:I.input,p=r.parameters!==void 0?r.parameters[I.output]:I.output;E.node!==void 0&&(s.push(this.getDependency("node",l)),c.push(this.getDependency("accessor",d)),A.push(this.getDependency("accessor",p)),a.push(I),h.push(E))}return Promise.all([Promise.all(s),Promise.all(c),Promise.all(A),Promise.all(a),Promise.all(h)]).then(function(u){const b=u[0],f=u[1],I=u[2],E=u[3],l=u[4],d=[];for(let C=0,m=b.length;C<m;C++){const y=b[C],Q=f[C],_=I[C],j=E[C],v=l[C];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const M=n._createAnimationTracks(y,Q,_,j,v);if(M)for(let x=0;x<M.length;x++)d.push(M[x])}const p=new g.AnimationClip(o,void 0,d);return rt(p,r),p})}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency("mesh",r.mesh).then(function(o){const s=n._getNodeRef(n.meshCache,r.mesh,o);return r.weights!==void 0&&s.traverse(function(c){if(c.isMesh)for(let A=0,a=r.weights.length;A<a;A++)c.morphTargetInfluences[A]=r.weights[A]}),s})}loadNode(e){const t=this.json,n=this,r=t.nodes[e],o=n._loadNodeShallow(e),s=[],c=r.children||[];for(let a=0,h=c.length;a<h;a++)s.push(n.getDependency("node",c[a]));const A=r.skin===void 0?Promise.resolve(null):n.getDependency("skin",r.skin);return Promise.all([o,Promise.all(s),A]).then(function(a){const h=a[0],u=a[1],b=a[2];b!==null&&h.traverse(function(f){f.isSkinnedMesh&&f.bind(b,yo)});for(let f=0,I=u.length;f<I;f++)h.add(u[f]);return h})}_loadNodeShallow(e){const t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const o=t.nodes[e],s=o.name?r.createUniqueName(o.name):"",c=[],A=r._invokeOne(function(a){return a.createNodeMesh&&a.createNodeMesh(e)});return A&&c.push(A),o.camera!==void 0&&c.push(r.getDependency("camera",o.camera).then(function(a){return r._getNodeRef(r.cameraCache,o.camera,a)})),r._invokeAll(function(a){return a.createNodeAttachment&&a.createNodeAttachment(e)}).forEach(function(a){c.push(a)}),this.nodeCache[e]=Promise.all(c).then(function(a){let h;if(o.isBone===!0?h=new g.Bone:a.length>1?h=new g.Group:a.length===1?h=a[0]:h=new g.Object3D,h!==a[0])for(let u=0,b=a.length;u<b;u++)h.add(a[u]);if(o.name&&(h.userData.name=o.name,h.name=s),rt(h,o),o.extensions&&ht(n,h,o),o.matrix!==void 0){const u=new g.Matrix4;u.fromArray(o.matrix),h.applyMatrix4(u)}else o.translation!==void 0&&h.position.fromArray(o.translation),o.rotation!==void 0&&h.quaternion.fromArray(o.rotation),o.scale!==void 0&&h.scale.fromArray(o.scale);if(!r.associations.has(h))r.associations.set(h,{});else if(o.mesh!==void 0&&r.meshCache.refs[o.mesh]>1){const u=r.associations.get(h);r.associations.set(h,{...u})}return r.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],r=this,o=new g.Group;n.name&&(o.name=r.createUniqueName(n.name)),rt(o,n),n.extensions&&ht(t,o,n);const s=n.nodes||[],c=[];for(let A=0,a=s.length;A<a;A++)c.push(r.getDependency("node",s[A]));return Promise.all(c).then(function(A){for(let h=0,u=A.length;h<u;h++)o.add(A[h]);const a=h=>{const u=new Map;for(const[b,f]of r.associations)(b instanceof g.Material||b instanceof g.Texture)&&u.set(b,f);return h.traverse(b=>{const f=r.associations.get(b);f!=null&&u.set(b,f)}),u};return r.associations=a(o),o})}_createAnimationTracks(e,t,n,r,o){const s=[],c=e.name?e.name:e.uuid,A=[];ut[o.path]===ut.weights?e.traverse(function(b){b.morphTargetInfluences&&A.push(b.name?b.name:b.uuid)}):A.push(c);let a;switch(ut[o.path]){case ut.weights:a=g.NumberKeyframeTrack;break;case ut.rotation:a=g.QuaternionKeyframeTrack;break;case ut.translation:case ut.scale:a=g.VectorKeyframeTrack;break;default:n.itemSize===1?a=g.NumberKeyframeTrack:a=g.VectorKeyframeTrack;break}const h=r.interpolation!==void 0?go[r.interpolation]:g.InterpolateLinear,u=this._getArrayFromAccessor(n);for(let b=0,f=A.length;b<f;b++){const I=new a(A[b]+"."+ut[o.path],t.array,u,h);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(I),s.push(I)}return s}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=nn(t.constructor),r=new Float32Array(t.length);for(let o=0,s=t.length;o<s;o++)r[o]=t[o]*n;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const r=this instanceof g.QuaternionKeyframeTrack?po:$n;return new r(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function wo(i,e,t){const n=e.attributes,r=new g.Box3;if(n.POSITION!==void 0){const c=t.json.accessors[n.POSITION],A=c.min,a=c.max;if(A!==void 0&&a!==void 0){if(r.set(new g.Vector3(A[0],A[1],A[2]),new g.Vector3(a[0],a[1],a[2])),c.normalized){const h=nn(mt[c.componentType]);r.min.multiplyScalar(h),r.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const o=e.targets;if(o!==void 0){const c=new g.Vector3,A=new g.Vector3;for(let a=0,h=o.length;a<h;a++){const u=o[a];if(u.POSITION!==void 0){const b=t.json.accessors[u.POSITION],f=b.min,I=b.max;if(f!==void 0&&I!==void 0){if(A.setX(Math.max(Math.abs(f[0]),Math.abs(I[0]))),A.setY(Math.max(Math.abs(f[1]),Math.abs(I[1]))),A.setZ(Math.max(Math.abs(f[2]),Math.abs(I[2]))),b.normalized){const E=nn(mt[b.componentType]);A.multiplyScalar(E)}c.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(c)}i.boundingBox=r;const s=new g.Sphere;r.getCenter(s.center),s.radius=r.min.distanceTo(r.max)/2,i.boundingSphere=s}function Sn(i,e,t){const n=e.attributes,r=[];function o(s,c){return t.getDependency("accessor",s).then(function(A){i.setAttribute(c,A)})}for(const s in n){const c=tn[s]||s.toLowerCase();c in i.attributes||r.push(o(n[s],c))}if(e.indices!==void 0&&!i.index){const s=t.getDependency("accessor",e.indices).then(function(c){i.setIndex(c)});r.push(s)}return g.ColorManagement.workingColorSpace!==g.LinearSRGBColorSpace&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${g.ColorManagement.workingColorSpace}" not supported.`),rt(i,e),wo(i,e,t),Promise.all(r).then(function(){return e.targets!==void 0?mo(i,e.targets,t):i})}const Ht=new WeakMap;class To extends g.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){const o=new g.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,s=>{this.parse(s,t,r)},n,r)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,g.SRGBColorSpace,n).catch(n)}decodeDracoFile(e,t,n,r,o=g.LinearSRGBColorSpace,s=()=>{}){const c={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:o};return this.decodeGeometry(e,c).then(t).catch(s)}decodeGeometry(e,t){const n=JSON.stringify(t);if(Ht.has(e)){const A=Ht.get(e);if(A.key===n)return A.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const o=this.workerNextTaskID++,s=e.byteLength,c=this._getWorker(o,s).then(A=>(r=A,new Promise((a,h)=>{r._callbacks[o]={resolve:a,reject:h},r.postMessage({type:"decode",id:o,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return c.catch(()=>!0).then(()=>{r&&o&&this._releaseTask(r,o)}),Ht.set(e,{key:n,promise:c}),c}_createGeometry(e){const t=new g.BufferGeometry;e.index&&t.setIndex(new g.BufferAttribute(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const{name:r,array:o,itemSize:s,stride:c,vertexColorSpace:A}=e.attributes[n];let a;if(s===c)a=new g.BufferAttribute(o,s);else{const h=new g.InterleavedBuffer(o,c);a=new g.InterleavedBufferAttribute(h,s,0)}r==="color"&&(this._assignVertexColorSpace(a,A),a.normalized=!(o instanceof Float32Array)),t.setAttribute(r,a)}return t}_assignVertexColorSpace(e,t){if(t!==g.SRGBColorSpace)return;const n=new g.Color;for(let r=0,o=e.count;r<o;r++)n.fromBufferAttribute(e,r),g.ColorManagement.colorSpaceToWorking(n,g.SRGBColorSpace),e.setXYZ(r,n.r,n.g,n.b)}_loadLibrary(e,t){const n=new g.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((r,o)=>{n.load(e,r,void 0,o)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{const r=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const o=Ro.toString(),s=["/* draco decoder */",r,"","/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(`
|
|
2
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const r=new Worker(this.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(o){const s=o.data;switch(s.type){case"decode":r._callbacks[s.id].resolve(s);break;case"error":r._callbacks[s.id].reject(s);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,o){return r._taskLoad>o._taskLoad?-1:1});const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function Ro(){let i,e;onmessage=function(s){const c=s.data;switch(c.type){case"init":i=c.decoderConfig,e=new Promise(function(h){i.onModuleLoaded=function(u){h({draco:u})},DracoDecoderModule(i)});break;case"decode":const A=c.buffer,a=c.taskConfig;e.then(h=>{const u=h.draco,b=new u.Decoder;try{const f=t(u,b,new Int8Array(A),a),I=f.attributes.map(E=>E.array.buffer);f.index&&I.push(f.index.array.buffer),self.postMessage({type:"decode",id:c.id,geometry:f},I)}catch(f){console.error(f),self.postMessage({type:"error",id:c.id,error:f.message})}finally{u.destroy(b)}});break}};function t(s,c,A,a){const h=a.attributeIDs,u=a.attributeTypes;let b,f;const I=c.GetEncodedGeometryType(A);if(I===s.TRIANGULAR_MESH)b=new s.Mesh,f=c.DecodeArrayToMesh(A,A.byteLength,b);else if(I===s.POINT_CLOUD)b=new s.PointCloud,f=c.DecodeArrayToPointCloud(A,A.byteLength,b);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||b.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());const E={index:null,attributes:[]};for(const l in h){const d=self[u[l]];let p,C;if(a.useUniqueIDs)C=h[l],p=c.GetAttributeByUniqueId(b,C);else{if(C=c.GetAttributeId(b,s[h[l]]),C===-1)continue;p=c.GetAttribute(b,C)}const m=r(s,c,b,l,d,p);l==="color"&&(m.vertexColorSpace=a.vertexColorSpace),E.attributes.push(m)}return I===s.TRIANGULAR_MESH&&(E.index=n(s,c,b)),s.destroy(b),E}function n(s,c,A){const h=A.num_faces()*3,u=h*4,b=s._malloc(u);c.GetTrianglesUInt32Array(A,u,b);const f=new Uint32Array(s.HEAPF32.buffer,b,h).slice();return s._free(b),{array:f,itemSize:1}}function r(s,c,A,a,h,u){const b=A.num_points(),f=u.num_components(),I=o(s,h),E=f*h.BYTES_PER_ELEMENT,l=Math.ceil(E/4)*4,d=l/h.BYTES_PER_ELEMENT,p=b*E,C=b*l,m=s._malloc(p);c.GetAttributeDataArrayForAllPoints(A,u,I,p,m);const y=new h(s.HEAPF32.buffer,m,p/h.BYTES_PER_ELEMENT);let Q;if(E===l)Q=y.slice();else{Q=new h(C/h.BYTES_PER_ELEMENT);let _=0;for(let j=0,v=y.length;j<v;j++){for(let M=0;M<f;M++)Q[_+M]=y[j*f+M];_+=d}}return s._free(m),{name:a,count:b,itemSize:f,array:Q,stride:d}}function o(s,c){switch(c){case Float32Array:return s.DT_FLOAT32;case Int8Array:return s.DT_INT8;case Int16Array:return s.DT_INT16;case Int32Array:return s.DT_INT32;case Uint8Array:return s.DT_UINT8;case Uint16Array:return s.DT_UINT16;case Uint32Array:return s.DT_UINT32}}}class vo{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:r,msg:o,transfer:s}=this.queue.shift();this.workersResolve[e]=r,this.workers[e].postMessage(o,s)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const r=this._getIdleWorker();r!==-1?(this._initWorker(r),this.workerStatus|=1<<r,this.workersResolve[r]=n,this.workers[r].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const Qo=0,Ln=2,ko=1,_n=2,So=0,Lo=1,_o=10,xo=0,ei=9,ti=15,ni=16,ii=22,ri=37,oi=43,si=76,ai=83,Ai=97,ci=100,li=103,ui=109,hi=122,di=123,fi=131,pi=132,gi=133,Ei=134,mi=137,Ii=138,bi=139,Ci=140,yi=141,Bi=142,wi=145,Ti=146,Ri=148,vi=152,rn=153,No=154,on=155,Do=156,Qi=157,ki=158,Si=165,Li=166,_i=1000054e3,xi=1000054001,Ni=1000054004,Di=1000054005,ln=1000066e3,Fi=1000066004;class Ct{constructor(e,t,n,r){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=r,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let r=0;for(;this._dataView.getUint8(this._offset)!==t&&r<e;)r++,this._offset++;return r<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,r)}}const Je=[171,75,84,88,32,50,48,187,13,10,26,10];function xn(i){return new TextDecoder().decode(i)}function Fo(i){const e=new Uint8Array(i.buffer,i.byteOffset,Je.length);if(e[0]!==Je[0]||e[1]!==Je[1]||e[2]!==Je[2]||e[3]!==Je[3]||e[4]!==Je[4]||e[5]!==Je[5]||e[6]!==Je[6]||e[7]!==Je[7]||e[8]!==Je[8]||e[9]!==Je[9]||e[10]!==Je[10]||e[11]!==Je[11])throw new Error("Missing KTX 2.0 identifier.");const t={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},n=17*Uint32Array.BYTES_PER_ELEMENT,r=new Ct(i,Je.length,n,!0);t.vkFormat=r._nextUint32(),t.typeSize=r._nextUint32(),t.pixelWidth=r._nextUint32(),t.pixelHeight=r._nextUint32(),t.pixelDepth=r._nextUint32(),t.layerCount=r._nextUint32(),t.faceCount=r._nextUint32(),t.levelCount=r._nextUint32(),t.supercompressionScheme=r._nextUint32();const o=r._nextUint32(),s=r._nextUint32(),c=r._nextUint32(),A=r._nextUint32(),a=r._nextUint64(),h=r._nextUint64(),u=3*Math.max(t.levelCount,1)*8,b=new Ct(i,Je.length+n,u,!0);for(let oe=0,ae=Math.max(t.levelCount,1);oe<ae;oe++)t.levels.push({levelData:new Uint8Array(i.buffer,i.byteOffset+b._nextUint64(),b._nextUint64()),uncompressedByteLength:b._nextUint64()});const f=new Ct(i,o,s,!0);f._skip(4);const I=f._nextUint16(),E=f._nextUint16(),l=f._nextUint16(),d=f._nextUint16(),p={vendorId:I,descriptorType:E,versionNumber:l,colorModel:f._nextUint8(),colorPrimaries:f._nextUint8(),transferFunction:f._nextUint8(),flags:f._nextUint8(),texelBlockDimension:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],bytesPlane:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],samples:[]},C=(d/4-6)/4;for(let oe=0;oe<C;oe++){const ae={bitOffset:f._nextUint16(),bitLength:f._nextUint8(),channelType:f._nextUint8(),samplePosition:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&ae.channelType?(ae.sampleLower=f._nextInt32(),ae.sampleUpper=f._nextInt32()):(ae.sampleLower=f._nextUint32(),ae.sampleUpper=f._nextUint32()),p.samples[oe]=ae}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(p);const m=new Ct(i,c,A,!0);for(;m._offset<A;){const oe=m._nextUint32(),ae=m._scan(oe),Ae=xn(ae);if(t.keyValue[Ae]=m._nextUint8Array(oe-ae.byteLength-1),Ae.match(/^ktx/i)){const Ie=xn(t.keyValue[Ae]);t.keyValue[Ae]=Ie.substring(0,Ie.lastIndexOf("\0"))}m._skip(oe%4?4-oe%4:0)}if(h<=0)return t;const y=new Ct(i,a,h,!0),Q=y._nextUint16(),_=y._nextUint16(),j=y._nextUint32(),v=y._nextUint32(),M=y._nextUint32(),x=y._nextUint32(),R=[];for(let oe=0,ae=Math.max(t.levelCount,1);oe<ae;oe++)R.push({imageFlags:y._nextUint32(),rgbSliceByteOffset:y._nextUint32(),rgbSliceByteLength:y._nextUint32(),alphaSliceByteOffset:y._nextUint32(),alphaSliceByteLength:y._nextUint32()});const N=a+y._offset,L=N+j,W=L+v,J=W+M,K=new Uint8Array(i.buffer,i.byteOffset+N,j),ee=new Uint8Array(i.buffer,i.byteOffset+L,v),te=new Uint8Array(i.buffer,i.byteOffset+W,M),ue=new Uint8Array(i.buffer,i.byteOffset+J,x);return t.globalData={endpointCount:Q,selectorCount:_,imageDescs:R,endpointsData:K,selectorsData:ee,tablesData:te,extendedData:ue},t}let qt,st,sn;const zt={env:{emscripten_notify_memory_growth:function(i){sn=new Uint8Array(st.exports.memory.buffer)}}};class Oo{init(){return qt||(qt=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Nn).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,zt)).then(this._init):WebAssembly.instantiate(Buffer.from(Nn,"base64"),zt).then(this._init),qt)}_init(e){st=e.instance,zt.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!st)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,r=st.exports.malloc(n);sn.set(e,r),t=t||Number(st.exports.ZSTD_findDecompressedSize(r,n));const o=st.exports.malloc(t),s=st.exports.ZSTD_decompress(o,t,r,n),c=sn.slice(o,o+s);return st.exports.free(r),st.exports.free(o),c}}const Nn="AGFzbQEAAAAB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A2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pR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UEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShq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EDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVq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IAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",Mo="display-p3",Po="display-p3-linear";({...g.ColorManagement.spaces[g.SRGBColorSpace]});const Kt=new WeakMap;let Vt=0,Wt;class et extends g.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new vo,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return console.warn('KTX2Loader: "detectSupportAsync()" has been deprecated. Use "detectSupport()" and "await renderer.init();" when creating the renderer.'),await e.init(),this.detectSupport(e)}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-s3tc"),bptcSupported:e.hasFeature("texture-compression-bc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:(this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},typeof navigator<"u"&&navigator.platform.indexOf("Linux")>=0&&navigator.userAgent.indexOf("Firefox")>=0&&this.workerConfig.astcSupported&&this.workerConfig.etc2Supported&&this.workerConfig.bptcSupported&&this.workerConfig.dxtSupported&&(this.workerConfig.astcSupported=!1,this.workerConfig.etc2Supported=!1)),this}init(){if(!this.transcoderPending){const e=new g.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new g.FileLoader(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const r=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,r]).then(([o,s])=>{const c=et.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(et.EngineFormat),"let _EngineType = "+JSON.stringify(et.EngineType),"let _TranscoderFormat = "+JSON.stringify(et.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(et.BasisFormat),"/* basis_transcoder.js */",o,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
|
|
3
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=s,this.workerPool.setWorkerCreator(()=>{const a=new Worker(this.workerSourceURL),h=this.transcoderBinary.slice(0);return a.postMessage({type:"init",config:this.workerConfig,transcoderBinary:h},[h]),a})}),Vt>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Vt++}return this.transcoderPending}load(e,t,n,r){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const o=new g.FileLoader(this.manager);o.setPath(this.path),o.setCrossOrigin(this.crossOrigin),o.setWithCredentials(this.withCredentials),o.setRequestHeader(this.requestHeader),o.setResponseType("arraybuffer"),o.load(e,s=>{this.parse(s,t,r)},n,r)}parse(e,t,n){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Kt.has(e))return Kt.get(e).promise.then(t).catch(n);this._createTexture(e).then(r=>t?t(r):null).catch(n)}_createTextureFrom(e,t){const{type:n,error:r,data:{faces:o,width:s,height:c,format:A,type:a,dfdFlags:h}}=e;if(n==="error")return Promise.reject(r);let u;if(t.faceCount===6)u=new g.CompressedCubeTexture(o,A,a);else{const b=o[0].mipmaps;u=t.layerCount>1?new g.CompressedArrayTexture(b,s,c,t.layerCount,A,a):new g.CompressedTexture(b,s,c,A,a)}return u.minFilter=o[0].mipmaps.length===1?g.LinearFilter:g.LinearMipmapLinearFilter,u.magFilter=g.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=Oi(t),u.premultiplyAlpha=!!(h&ko),u}async _createTexture(e,t={}){const n=Fo(new Uint8Array(e)),r=n.vkFormat===ln&&n.dataFormatDescriptor[0].colorModel===167;if(!(n.vkFormat===xo||r&&!this.workerConfig.astcHDRSupported))return Uo(n);const s=t,c=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:s},[e])).then(A=>this._createTextureFrom(A.data,n));return Kt.set(e,{promise:c}),c}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Vt--}}et.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2};et.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25};et.EngineFormat={RGBAFormat:g.RGBAFormat,RGBA_ASTC_4x4_Format:g.RGBA_ASTC_4x4_Format,RGB_BPTC_UNSIGNED_Format:g.RGB_BPTC_UNSIGNED_Format,RGBA_BPTC_Format:g.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:g.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:g.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:g.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:g.RGB_ETC1_Format,RGB_ETC2_Format:g.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:g.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:g.RGBA_S3TC_DXT1_Format};et.EngineType={UnsignedByteType:g.UnsignedByteType,HalfFloatType:g.HalfFloatType,FloatType:g.FloatType};et.BasisWorker=function(){let i,e,t;const n=_EngineFormat,r=_EngineType,o=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",function(I){const E=I.data;switch(E.type){case"init":i=E.config,c(E.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:l,buffers:d,width:p,height:C,hasAlpha:m,format:y,type:Q,dfdFlags:_}=A(E.buffer);self.postMessage({type:"transcode",id:E.id,data:{faces:l,width:p,height:C,hasAlpha:m,format:y,type:Q,dfdFlags:_}},d)}catch(l){console.error(l),self.postMessage({type:"error",id:E.id,error:l.message})}});break}});function c(I){e=new Promise(E=>{t={wasmBinary:I,onRuntimeInitialized:E},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(I){const E=new t.KTX2File(new Uint8Array(I));function l(){E.close(),E.delete()}if(!E.isValid())throw l(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let d;if(E.isUASTC())d=s.UASTC;else if(E.isETC1S())d=s.ETC1S;else if(E.isHDR())d=s.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const p=E.getWidth(),C=E.getHeight(),m=E.getLayers()||1,y=E.getLevels(),Q=E.getFaces(),_=E.getHasAlpha(),j=E.getDFDFlags(),{transcoderFormat:v,engineFormat:M,engineType:x}=u(d,p,C,_);if(!p||!C||!y)throw l(),new Error("THREE.KTX2Loader: Invalid texture");if(!E.startTranscoding())throw l(),new Error("THREE.KTX2Loader: .startTranscoding failed");const R=[],N=[];for(let L=0;L<Q;L++){const W=[];for(let J=0;J<y;J++){const K=[];let ee,te;for(let oe=0;oe<m;oe++){const ae=E.getImageLevelInfo(J,oe,L);L===0&&J===0&&oe===0&&(ae.origWidth%4!==0||ae.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),y>1?(ee=ae.origWidth,te=ae.origHeight):(ee=ae.width,te=ae.height);let Ae=new Uint8Array(E.getImageTranscodedSizeInBytes(J,oe,0,v));const Ie=E.transcodeImage(Ae,J,oe,L,v,0,-1,-1);if(x===r.HalfFloatType&&(Ae=new Uint16Array(Ae.buffer,Ae.byteOffset,Ae.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!Ie)throw l(),new Error("THREE.KTX2Loader: .transcodeImage failed.");K.push(Ae)}const ue=f(K);W.push({data:ue,width:ee,height:te}),N.push(ue.buffer)}R.push({mipmaps:W,width:p,height:C,format:M,type:x})}return l(),{faces:R,buffers:N,width:p,height:C,hasAlpha:_,dfdFlags:j,format:M,type:x}}const a=[{if:"astcSupported",basisFormat:[s.UASTC],transcoderFormat:[o.ASTC_4x4,o.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],engineType:[r.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.BC7_M5,o.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],engineType:[r.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.BC1,o.BC3],engineFormat:[n.RGBA_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],engineType:[r.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.ETC1,o.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],engineType:[r.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.ETC1],engineFormat:[n.RGB_ETC1_Format],engineType:[r.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.PVRTC1_4_RGB,o.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],engineType:[r.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[s.UASTC_HDR],transcoderFormat:[o.BC6H],engineFormat:[n.RGB_BPTC_UNSIGNED_Format],engineType:[r.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.RGBA32,o.RGBA32],engineFormat:[n.RGBAFormat,n.RGBAFormat],engineType:[r.UnsignedByteType,r.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[s.UASTC_HDR],transcoderFormat:[o.RGBA_HALF],engineFormat:[n.RGBAFormat],engineType:[r.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],h={[s.ETC1S]:a.filter(I=>I.basisFormat.includes(s.ETC1S)).sort((I,E)=>I.priorityETC1S-E.priorityETC1S),[s.UASTC]:a.filter(I=>I.basisFormat.includes(s.UASTC)).sort((I,E)=>I.priorityUASTC-E.priorityUASTC),[s.UASTC_HDR]:a.filter(I=>I.basisFormat.includes(s.UASTC_HDR)).sort((I,E)=>I.priorityHDR-E.priorityHDR)};function u(I,E,l,d){const p=h[I];for(let C=0;C<p.length;C++){const m=p[C];if(m.if&&!i[m.if]||!m.basisFormat.includes(I)||d&&m.transcoderFormat.length<2||m.needsPowerOfTwo&&!(b(E)&&b(l)))continue;const y=m.transcoderFormat[d?1:0],Q=m.engineFormat[d?1:0],_=m.engineType[0];return{transcoderFormat:y,engineFormat:Q,engineType:_}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function b(I){return I<=2?!0:(I&I-1)===0&&I!==0}function f(I){if(I.length===1)return I[0];let E=0;for(let p=0;p<I.length;p++){const C=I[p];E+=C.byteLength}const l=new Uint8Array(E);let d=0;for(let p=0;p<I.length;p++){const C=I[p];l.set(C,d),d+=C.byteLength}return l}};const Go=new Set([g.RGBAFormat,g.RGBFormat,g.RGFormat,g.RedFormat]),Yt={[ui]:g.RGBAFormat,[li]:g.RGFormat,[ci]:g.RedFormat,[Ai]:g.RGBAFormat,[ai]:g.RGFormat,[si]:g.RedFormat,[oi]:g.RGBAFormat,[ri]:g.RGBAFormat,[ii]:g.RGFormat,[ni]:g.RGFormat,[ti]:g.RedFormat,[ei]:g.RedFormat,[di]:g.RGBFormat,[hi]:g.RGBFormat,[vi]:g.RGBA_ETC2_EAC_Format,[Ri]:g.RGB_ETC2_Format,[rn]:g.R11_EAC_Format,[No]:g.SIGNED_R11_EAC_Format,[on]:g.RG11_EAC_Format,[Do]:g.SIGNED_RG11_EAC_Format,[ln]:g.RGBA_ASTC_4x4_Format,[ki]:g.RGBA_ASTC_4x4_Format,[Qi]:g.RGBA_ASTC_4x4_Format,[Fi]:g.RGBA_ASTC_6x6_Format,[Li]:g.RGBA_ASTC_6x6_Format,[Si]:g.RGBA_ASTC_6x6_Format,[Ei]:g.RGBA_S3TC_DXT1_Format,[gi]:g.RGBA_S3TC_DXT1_Format,[pi]:g.RGB_S3TC_DXT1_Format,[fi]:g.RGB_S3TC_DXT1_Format,[Ii]:g.RGBA_S3TC_DXT3_Format,[mi]:g.RGBA_S3TC_DXT3_Format,[Ci]:g.SIGNED_RED_RGTC1_Format,[bi]:g.RED_RGTC1_Format,[Bi]:g.SIGNED_RED_GREEN_RGTC2_Format,[yi]:g.RED_GREEN_RGTC2_Format,[Ti]:g.RGBA_BPTC_Format,[wi]:g.RGBA_BPTC_Format,[Di]:g.RGBA_PVRTC_4BPPV1_Format,[xi]:g.RGBA_PVRTC_4BPPV1_Format,[Ni]:g.RGBA_PVRTC_2BPPV1_Format,[_i]:g.RGBA_PVRTC_2BPPV1_Format},Et={[ui]:g.FloatType,[li]:g.FloatType,[ci]:g.FloatType,[Ai]:g.HalfFloatType,[ai]:g.HalfFloatType,[si]:g.HalfFloatType,[oi]:g.UnsignedByteType,[ri]:g.UnsignedByteType,[ii]:g.UnsignedByteType,[ni]:g.UnsignedByteType,[ti]:g.UnsignedByteType,[ei]:g.UnsignedByteType,[di]:g.UnsignedInt5999Type,[hi]:g.UnsignedInt101111Type,[vi]:g.UnsignedByteType,[Ri]:g.UnsignedByteType,[rn]:g.UnsignedByteType,[rn]:g.UnsignedByteType,[on]:g.UnsignedByteType,[on]:g.UnsignedByteType,[ln]:g.HalfFloatType,[ki]:g.UnsignedByteType,[Qi]:g.UnsignedByteType,[Fi]:g.HalfFloatType,[Li]:g.UnsignedByteType,[Si]:g.UnsignedByteType,[Ei]:g.UnsignedByteType,[gi]:g.UnsignedByteType,[pi]:g.UnsignedByteType,[fi]:g.UnsignedByteType,[Ii]:g.UnsignedByteType,[mi]:g.UnsignedByteType,[Ci]:g.UnsignedByteType,[bi]:g.UnsignedByteType,[Bi]:g.UnsignedByteType,[yi]:g.UnsignedByteType,[Ti]:g.UnsignedByteType,[wi]:g.UnsignedByteType,[Di]:g.UnsignedByteType,[xi]:g.UnsignedByteType,[Ni]:g.UnsignedByteType,[_i]:g.UnsignedByteType};async function Uo(i){const{vkFormat:e}=i;if(Yt[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat: "+e);Et[e]===void 0&&console.warn('THREE.KTX2Loader: Missing ".type" for vkFormat: '+e);let t;i.supercompressionScheme===Ln&&(Wt||(Wt=new Promise(async s=>{const c=new Oo;await c.init(),s(c)})),t=await Wt);const n=[];for(let s=0;s<i.levels.length;s++){const c=Math.max(1,i.pixelWidth>>s),A=Math.max(1,i.pixelHeight>>s),a=i.pixelDepth?Math.max(1,i.pixelDepth>>s):0,h=i.levels[s];let u;if(i.supercompressionScheme===Qo)u=h.levelData;else if(i.supercompressionScheme===Ln)u=t.decode(h.levelData,h.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let b;Et[e]===g.FloatType?b=new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):Et[e]===g.HalfFloatType?b=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):Et[e]===g.UnsignedInt5999Type||Et[e]===g.UnsignedInt101111Type?b=new Uint32Array(u.buffer,u.byteOffset,u.byteLength/Uint32Array.BYTES_PER_ELEMENT):b=u,n.push({data:b,width:c,height:A,depth:a})}const r=i.levelCount===0||n.length>1;let o;if(Go.has(Yt[e]))o=i.pixelDepth===0?new g.DataTexture(n[0].data,i.pixelWidth,i.pixelHeight):new g.Data3DTexture(n[0].data,i.pixelWidth,i.pixelHeight,i.pixelDepth),o.minFilter=r?g.NearestMipmapNearestFilter:g.NearestFilter,o.magFilter=g.NearestFilter,o.generateMipmaps=i.levelCount===0;else{if(i.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");o=new g.CompressedTexture(n,i.pixelWidth,i.pixelHeight),o.minFilter=r?g.LinearMipmapLinearFilter:g.LinearFilter,o.magFilter=g.LinearFilter}return o.mipmaps=n,o.type=Et[e],o.format=Yt[e],o.colorSpace=Oi(i),o.needsUpdate=!0,Promise.resolve(o)}function Oi(i){const e=i.dataFormatDescriptor[0];return e.colorPrimaries===Lo?e.transferFunction===_n?g.SRGBColorSpace:g.LinearSRGBColorSpace:e.colorPrimaries===_o?e.transferFunction===_n?Mo:Po:(e.colorPrimaries===So||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),g.NoColorSpace)}class un{name;time;finishListener;duration;isPaused;playCount;interpolants;constructor(e,t){this.name=t||e.name,this.time=0,this.duration=e.duration,this.isPaused=!1,this.playCount=0,this.interpolants={};for(const n of e.tracks){const r=n.getValueSize();let o;n.getInterpolation()===se.InterpolateDiscrete?o=new se.DiscreteInterpolant(n.times,n.values,r):n.ValueTypeName==="quaternion"?o=new se.QuaternionLinearInterpolant(n.times,n.values,r):o=new se.LinearInterpolant(n.times,n.values,r),this.interpolants[n.name]=o}}init(e){}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){this.isPaused=e}setTime(e){this.time=e}setFinishListener(e){this.finishListener=e}update(e){this.time+=e,this.time>this.duration&&(this.time-=this.duration,this.playCount++,this.finishListener&&this.finishListener());const t={};for(const[n,r]of Object.entries(this.interpolants)){const o=n.substring(0,n.lastIndexOf(".")),s=n.substring(n.lastIndexOf(".")+1,n.length);let c=t[o];c||(c={},t[o]=c);const A=r.evaluate(this.time);if(s==="position")c.loc=new Z(A[0],A[1],A[2]);else if(s==="quaternion")c.quat=new Te(A[0],A[1],A[2],A[3]);else if(s==="scale")c.scale=new Z(A[0],A[1],A[2]);else if(s==="morphTargetInfluences"){c.morphs||(c.morphs=[]);const a=Array.from(A);c.morphs.push({name:o,vals:a})}else console.warn(`ClipMotion: update. unknown property(${s})`)}return t}}var Mi=(function(){var i="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=WebAssembly.validate(t)?c(e):c(i),o,s=WebAssembly.instantiate(r,{}).then(function(d){o=d.instance,o.exports.__wasm_call_ctors()});function c(d){for(var p=new Uint8Array(d.length),C=0;C<d.length;++C){var m=d.charCodeAt(C);p[C]=m>96?m-97:m>64?m-39:m+4}for(var y=0,C=0;C<d.length;++C)p[y++]=p[C]<60?n[p[C]]:(p[C]-60)*64+p[++C];return p.buffer.slice(0,y)}function A(d,p,C,m,y,Q,_){var j=d.exports.sbrk,v=m+3&-4,M=j(v*y),x=j(Q.length),R=new Uint8Array(d.exports.memory.buffer);R.set(Q,x);var N=p(M,m,y,x,Q.length);if(N==0&&_&&_(M,v,y),C.set(R.subarray(M,M+m*y)),j(M-j(0)),N!=0)throw new Error("Malformed buffer data: "+N)}var a={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],b=0;function f(d){var p={object:new Worker(d),pending:0,requests:{}};return p.object.onmessage=function(C){var m=C.data;p.pending-=m.count,p.requests[m.id][m.action](m.value),delete p.requests[m.id]},p}function I(d){for(var p="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+l.name+";"+A.toString()+l.toString(),C=new Blob([p],{type:"text/javascript"}),m=URL.createObjectURL(C),y=u.length;y<d;++y)u[y]=f(m);for(var y=d;y<u.length;++y)u[y].object.postMessage({});u.length=d,URL.revokeObjectURL(m)}function E(d,p,C,m,y){for(var Q=u[0],_=1;_<u.length;++_)u[_].pending<Q.pending&&(Q=u[_]);return new Promise(function(j,v){var M=new Uint8Array(C),x=++b;Q.pending+=d,Q.requests[x]={resolve:j,reject:v},Q.object.postMessage({id:x,count:d,size:p,source:M,mode:m,filter:y},[M.buffer])})}function l(d){var p=d.data;if(!p.id)return self.close();self.ready.then(function(C){try{var m=new Uint8Array(p.count*p.size);A(C,C.exports[p.mode],m,p.count,p.size,p.source,C.exports[p.filter]),self.postMessage({id:p.id,count:p.count,action:"resolve",value:m},[m.buffer])}catch(y){self.postMessage({id:p.id,count:p.count,action:"reject",value:y})}})}return{ready:s,supported:!0,useWorkers:function(d){I(d)},decodeVertexBuffer:function(d,p,C,m,y){A(o,o.exports.meshopt_decodeVertexBuffer,d,p,C,m,o.exports[a[y]])},decodeIndexBuffer:function(d,p,C,m){A(o,o.exports.meshopt_decodeIndexBuffer,d,p,C,m)},decodeIndexSequence:function(d,p,C,m){A(o,o.exports.meshopt_decodeIndexSequence,d,p,C,m)},decodeGltfBuffer:function(d,p,C,m,y,Q){A(o,o.exports[h[y]],d,p,C,m,o.exports[a[Q]])},decodeGltfBufferAsync:function(d,p,C,m,y){return u.length>0?E(d,p,C,h[m],a[y]):s.then(function(){var Q=new Uint8Array(d*p);return A(o,o.exports[h[m]],Q,d,p,C,o.exports[a[y]]),Q})}}})();function jo(i){return"morphTargetDictionary"in i&&i.morphTargetDictionary!==void 0&&"morphTargetInfluences"in i&&Array.isArray(i.morphTargetInfluences)}const Ho={draco:"https://unpkg.com/three@0.182/examples/jsm/libs/draco/",ktx2:"https://unpkg.com/three@0.182.0/examples/jsm/libs/basis/",meshopt:!0};function Pi(i={}){const e={...Ho,...i};let t=new Xn;const n=new To;if(n.setDecoderPath(e.draco),t.setDRACOLoader(n),e.renderer){const r=new et;r.setTranscoderPath(e.ktx2),r.detectSupport(e.renderer),t.setKTX2Loader(r)}e.meshopt&&t.setMeshoptDecoder(Mi),hn=t}let hn=new Xn;hn.setMeshoptDecoder(Mi);class qo extends Rt{gltf;constructor(e){super(e)}async asyncInit(e){if(jn(e)){let t=null;this.gltf=await hn.loadAsync(e);const n={},r={root:this.gltf.scene,bones:{},skeleton:void 0},o={};this.gltf.scene.traverse(s=>{if(s.userData.a3js={objectA3:this},jo(s)){const{morphTargetDictionary:c,morphTargetInfluences:A}=s;Object.keys(c).forEach(a=>{const h=s.name+"."+a,u=c[a];o[h]={array:A,idx:u}})}s instanceof se.Bone&&r.bones&&(r.bones[s.name]=s),s instanceof se.SkinnedMesh&&(r.skeleton=s.skeleton)}),this.gltf.animations.forEach(s=>{t||(t=s.name),n[s.name]={name:s.name,shape:r,motion:new un(s),sound:void 0,soundContinue:!0}}),t?this.syncInit(t,n,o):(t="dummy",n.dummy={name:"dummy",shape:r,motion:new Cn,sound:void 0,soundContinue:!0},this.syncInit(t,n,o))}else{const t=new se.BoxGeometry,n=new se.MeshStandardMaterial({color:16711680}),r=new se.Mesh(t,n),o="dummy",s={};s.dummy={name:"dummy",shape:{root:r},motion:new Cn,sound:void 0,soundContinue:!0},this.syncInit(o,s)}return this}}const Gi={camera:void 0,antialias:!1,transparent:!1};class Ui extends HTMLElement{options;ro;base;renderer;css2DRenderer;scene;camera;controller;camera3js;timer;_canvas;_css2DCanvas;constructor(e){if(super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
1
|
+
"use strict";var cr=Object.create;var In=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var ur=Object.getOwnPropertyNames;var hr=Object.getPrototypeOf,dr=Object.prototype.hasOwnProperty;var fr=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ur(e))!dr.call(i,r)&&r!==t&&In(i,r,{get:()=>e[r],enumerable:!(n=lr(e,r))||n.enumerable});return i};var pr=(i,e,t)=>(t=i!=null?cr(hr(i)):{},fr(e||!i||!i.__esModule?In(t,"default",{value:i,enumerable:!0}):t,i));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("three"),Gn=require("fflate");function gr(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const re=gr(g);class Z{_x;_y;_z;get x(){return this._x}get y(){return this._y}get z(){return this._z}constructor(e,t,n){typeof e=="number"?(this._x=e,this._y=t,this._z=n):typeof e>"u"?this._x=this._y=this._z=0:(this._x=e.x,this._y=e.y,this._z=e.z)}clone(){return new Z(this)}write(e){e.x=this._x,e.y=this._y,e.z=this._z}normalize(){const e=this._x*this._x+this._y*this._y+this._z*this._z,t=Math.sqrt(e);return t!==0?(this._x/=t,this._y/=t,this._z/=t):console.warn("Vec3.normalize."),this}negate(){return this._x*=-1,this._y*=-1,this._z*=-1,this}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)}set(e,t,n){return typeof e=="number"?(this._x=e,this._y=t,this._z=n):(this._x=e.x,this._y=e.y,this._z=e.z),this}add(e,t,n){return typeof e=="number"?(this._x+=e,this._y+=t,this._z+=n):(this._x+=e.x,this._y+=e.y,this._z+=e.z),this}sub(e,t,n){return typeof e=="number"?(this._x-=e,this._y-=t,this._z-=n):(this._x-=e.x,this._y-=e.y,this._z-=e.z),this}scale(e){return this._x*=e,this._y*=e,this._z*=e,this}cross(e,t){return this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this}apply(e,t,n,r){const o=new Te;typeof e=="number"?o.set(e,t,n,r):o.set(e);const s=new Te(this._x,this._y,this._z,0),c=new Te(o).conjugate();return o.mul(s).mul(c),this._x=o.x,this._y=o.y,this._z=o.z,this}lerp(e,t,n){this._x=(1-n)*e.x+n*t.x,this._y=(1-n)*e.y+n*t.y,this._z=(1-n)*e.z+n*t.z}}class Te{_x;_y;_z;_w;get x(){return this._x}get y(){return this._y}get z(){return this._z}get w(){return this._w}constructor(e,t,n,r){typeof e=="number"?(this._x=e,this._y=t,this._z=n,this._w=r):typeof e>"u"?(this._x=this._y=this._z=0,this._w=1):(this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w)}clone(){return new Te(this)}write(e){e.x=this._x,e.y=this._y,e.z=this._z,e.w=this._w}normalize(){const e=this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w,t=Math.sqrt(e);return t!==0?(this._x/=t,this._y/=t,this._z/=t,this._w/=t):console.warn("Quat.normalize."),this}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this}set(e,t,n,r){return typeof e=="number"?(this._x=e,this._y=t,this._z=n,this._w=r):(this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w),this}mul(e,t,n,r){const o=new Te(this),s=new Te;return typeof e=="number"?s.set(e,t,n,r):s.set(e),this._x=o.w*s.x+o.x*s.w+o.y*s.z-o.z*s.y,this._y=o.w*s.y-o.x*s.z+o.y*s.w+o.z*s.x,this._z=o.w*s.z+o.x*s.y-o.y*s.x+o.z*s.w,this._w=o.w*s.w-o.x*s.x-o.y*s.y-o.z*s.z,this}lerp(e,t,n){this._x=(1-n)*e.x+n*t.x,this._y=(1-n)*e.y+n*t.y,this._z=(1-n)*e.z+n*t.z,this._w=(1-n)*e.w+n*t.w}slerp(e,t,n){if(n<0||n>1){console.warn("Quat.slerp(): t must be in [0,1]");return}let r=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w;if(Xe.set(t),r<0&&(r*=-1,Xe.set(-Xe.x,-Xe.y,-Xe.z,-Xe.w)),r>.9995){this._x=(1-n)*e.x+n*Xe.x,this._y=(1-n)*e.y+n*Xe.y,this._z=(1-n)*e.z+n*Xe.z,this._w=(1-n)*e.w+n*Xe.w;const o=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w);o<1e-4?(console.warn("Quat.slerp(); ???!"),this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w):(this._x*=1/o,this._y*=1/o,this._z*=1/o,this._w*=1/o)}else{const o=Math.acos(r),s=Math.sin((1-n)*o)/Math.sin(o),c=Math.sin(n*o)/Math.sin(o);this._x=s*e.x+c*Xe.x,this._y=s*e.y+c*Xe.y,this._z=s*e.z+c*Xe.z,this._w=s*e.w+c*Xe.w}}}const Xe=new Te;function At(i,e,t){t.normalize();const n=i.clone().sub(e).normalize(),r=new Z().cross(n,t).normalize(),o=new Z().cross(r,n),s=r.x,c=o.x,A=-n.x,a=r.y,h=o.y,u=-n.y,b=r.z,f=o.z,I=-n.z,m=s+h+I;if(m>0){const l=Math.sqrt(m+1)*2;return new Te((f-u)/l,(A-b)/l,(a-c)/l,.25*l)}else if(s>h&&s>I){const l=Math.sqrt(1+s-h-I)*2;return new Te(.25*l,(c+a)/l,(A+b)/l,(f-u)/l)}else if(h>I){const l=Math.sqrt(1+h-s-I)*2;return new Te((c+a)/l,.25*l,(u+f)/l,(A-b)/l)}else{const l=Math.sqrt(1+I-s-h)*2;return new Te((A+b)/l,(u+f)/l,.25*l,(a-c)/l)}}function dt(i,e="XYZ"){const t=new Te(0,0,0,1);for(let n=0;n<3;n++)switch(e.charAt(n)){case"X":t.mul(Math.sin(i.x),0,0,Math.cos(i.x));break;case"Y":t.mul(0,Math.sin(i.y),0,Math.cos(i.y));break;case"Z":t.mul(0,0,Math.sin(i.z),Math.cos(i.z));break}return t}function mr(i){const e=[[],[],[]],t=i.x+i.x,n=i.y+i.y,r=i.z+i.z,o=i.x*t,s=i.x*n,c=i.x*r,A=i.y*n,a=i.y*r,h=i.z*r,u=i.w*t,b=i.w*n,f=i.w*r;return e[0][0]=1-(A+h),e[0][1]=s-f,e[0][2]=c+b,e[1][0]=s+f,e[1][1]=1-(o+h),e[1][2]=a-u,e[2][0]=c-b,e[2][1]=a+u,e[2][2]=1-(o+A),e}const pt=i=>Math.max(-1,Math.min(1,i));function bn(i,e="XYZ"){const t=mr(i),n=new Z;let r=0,o=0,s=0;switch(e){case"XYZ":o=Math.asin(pt(t[0][2])),Math.abs(t[0][2])<.9999999?(r=Math.atan2(-t[1][2],t[2][2]),s=Math.atan2(-t[0][1],t[0][0])):(r=Math.atan2(t[2][1],t[1][1]),s=0);break;case"YXZ":r=Math.asin(-pt(t[1][2])),Math.abs(t[1][2])<.9999999?(o=Math.atan2(t[0][2],t[2][2]),s=Math.atan2(t[1][0],t[1][1])):(o=Math.atan2(-t[2][0],t[0][0]),s=0);break;case"ZXY":r=Math.asin(pt(t[2][1])),Math.abs(t[2][1])<.9999999?(o=Math.atan2(-t[2][0],t[2][2]),s=Math.atan2(-t[0][1],t[1][1])):(o=0,s=Math.atan2(t[1][0],t[0][0]));break;case"ZYX":o=Math.asin(-pt(t[2][0])),Math.abs(t[2][0])<.9999999?(r=Math.atan2(t[2][1],t[2][2]),s=Math.atan2(t[1][0],t[0][0])):(r=0,s=Math.atan2(-t[0][1],t[1][1]));break;case"YZX":s=Math.asin(pt(t[1][0])),Math.abs(t[1][0])<.9999999?(r=Math.atan2(-t[1][2],t[1][1]),o=Math.atan2(-t[2][0],t[0][0])):(r=0,o=Math.atan2(t[0][2],t[2][2]));break;case"XZY":s=Math.asin(-pt(t[0][1])),Math.abs(t[0][1])<.9999999?(r=Math.atan2(t[2][1],t[1][1]),o=Math.atan2(t[0][2],t[0][0])):(r=Math.atan2(-t[1][2],t[2][2]),o=0);break}return n.set(r,o,s),n}class qe{loc;quat;scale;constructor(){this.loc=new Z,this.quat=new Te,this.scale=new Z(1,1,1)}set(e){if(e instanceof qe)this.loc.set(e.loc),this.quat.set(e.quat),this.scale.set(e.scale);else{const t=e.trans;this.loc.set(t.loc),this.quat.set(t.quat),this.scale.set(t.scale)}return this}write(e){e instanceof Pe?(e.object.position.set(this.loc.x,this.loc.y,this.loc.z),e.object.quaternion.set(this.quat.x,this.quat.y,this.quat.z,this.quat.w),e.object.scale.set(this.scale.x,this.scale.y,this.scale.z)):(e.position.set(this.loc.x,this.loc.y,this.loc.z),e.quaternion.set(this.quat.x,this.quat.y,this.quat.z,this.quat.w),e.scale.set(this.scale.x,this.scale.y,this.scale.z))}blend(e,t){return this.loc.lerp(this.loc,e.loc,t),this.quat.slerp(this.quat,e.quat,t),this.scale.lerp(this.scale,e.scale,t),this}clone(){const e=new qe;return e.set(this),e}}class Tt{trans;constructor(){this.trans=new qe}init(e,t){this.trans.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.trans.loc.y<=0}setLocation(e){this.trans.loc.set(e)}setLocationNow(e){this.trans.loc.set(e)}setQuat(e){this.trans.quat.set(e)}setQuatNow(e){this.trans.quat.set(e)}setScale(e){this.trans.scale.set(e)}setScaleNow(e){this.trans.scale.set(e)}setLinvel(e){}getLinvel(e){return e||new Z}setAngvel(e){}getAngvel(e){return e||new Z}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class Un{trans;constructor(){this.trans=new qe}init(e,t){this.trans.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.trans.loc.y<=0}setLocation(e){}setLocationNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinvel(e){}getLinvel(e){return e||new Z}setAngvel(e){}getAngvel(e){return e||new Z}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class jn{firstTrans;trans;lastTrans;nowTime;duration;constructor(){this.firstTrans=new qe,this.trans=new qe,this.lastTrans=new qe,this.nowTime=0,this.duration=1}init(e,t){this.firstTrans.set(e),this.trans.set(e),this.lastTrans.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.trans.loc.y<=0}setLocation(e){this.firstTrans.set(this.trans),this.lastTrans.loc.set(e),this.nowTime=0}setLocationNow(e){this.setLocation(e),this.nowTime=1}setQuat(e){this.firstTrans.set(this.trans),this.lastTrans.quat.set(e),this.nowTime=0}setQuatNow(e){this.setQuat(e),this.nowTime=1}setScale(e){this.firstTrans.set(this.trans),this.lastTrans.scale.set(e),this.nowTime=0}setScaleNow(e){this.setScale(e),this.nowTime=1}setLinvel(e){}getLinvel(e){e||(e=new Z);const t=this.lastTrans.loc.x-this.firstTrans.loc.x,n=this.lastTrans.loc.y-this.firstTrans.loc.y,r=this.lastTrans.loc.z-this.firstTrans.loc.z;e.set(t,n,r);const o=this.nowTime<this.duration?this.nowTime:this.duration;return e.scale((-6*o*o+6*o)/this.duration),e}setAngvel(e){}getAngvel(e){e||(e=new Z);const t=bn(this.firstTrans.quat,"XYZ"),n=bn(this.lastTrans.quat,"XYZ");e.set(n.x-t.x,n.y-t.y,n.z-t.z);const r=this.nowTime<this.duration?this.nowTime:this.duration;return e.scale((-6*r*r+6*r)/this.duration),e}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}smoothstep(e){return e*e*(3-2*e)}update(e){this.nowTime+=e,this.nowTime>this.duration&&(this.nowTime=this.duration);const t=this.nowTime/this.duration,n=this.smoothstep(t);this.trans.set(this.firstTrans),this.trans.blend(this.lastTrans,n)}}const ot=new Z,bt=new Z;class Er extends Tt{up;target;constructor(e){super(),this.up=new Z(0,1,0),this.target=e}setTarget(e){this.target=e}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=Pe.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){ot.set(this.trans.loc),bt.set(this.target.trans.loc);const t=At(ot,bt,this.up);this.trans.quat.set(t)}}class Ir extends jn{up;target;constructor(e){super(),this.up=new Z(0,1,0),this.target=e}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=Pe.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){super.update(e),ot.set(this.trans.loc),bt.set(this.target.trans.loc);const t=At(ot,bt,this.up);this.trans.quat.set(t)}}const Hn={lookFrom:{x:0,y:5,z:-10},smoothness:.9};class br extends Un{options;target;lookFrom;up;constructor(e,t={}){super(),this.options={...Hn,...t},this.target=e,this.lookFrom=new Z(this.options.lookFrom),e.upVector?this.up=e.upVector:this.up=Pe.defaultUpVector}init(e,t){super.init(e,t)}update(e){super.update(e);const t=new qe;ot.set(this.trans.loc),bt.set(this.target.trans.loc);const n=At(ot,bt,this.up);n.mul(new Te(0,1,0,0)),t.quat.set(n),ot.set(this.lookFrom),ot.apply(this.target.quat),ot.add(this.target.loc),t.loc.set(ot),this.trans.loc.lerp(this.trans.loc,t.loc,1-this.options.smoothness),this.trans.quat.slerp(this.trans.quat,t.quat,1-this.options.smoothness)}}const en={rigidBody:"dynamic",collider:"solid",meshCollider:"convex_hull",mass:1,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1};function qn(i){return typeof i=="string"}function cn(i){return i.isMesh===!0}function Cr(i){return i.type==="RoundedBoxGeometry"}function yr(i){return i.type==="BoxGeometry"}function Br(i){return i.type==="SphereGeometry"}function wr(i){return i.type==="IcosahedronGeometry"}function Tr(i){return i.type==="CylinderGeometry"}function Rr(i){return i.type==="CapsuleGeometry"}function vr(i){return i.isBone===!0}function Qr(i){return i.isPerspectiveCamera===!0}let He;const it=new Map;class Rt{static RAPIER;isInitialized=!1;constructor(){}async init(){if(!Rt.RAPIER){const e=await import("@dimforge/rapier3d-compat");await e.init(),Rt.RAPIER=e,He=e,this.isInitialized=!0}}createWorld(e){let t=.016666666666666666;this.isRapierWorldOptions(e)&&(t=e.timestep);const n=new He.World(e.gravity);return new ln(n,t)}isRapierWorldOptions(e){return"timestep"in e}}class ln{world;timestep;collisionEventQueue;constructor(e,t){this.world=e,this.timestep=t,this.collisionEventQueue=new He.EventQueue(!0),this.world.integrationParameters.dt=this.timestep}add(e){e.addOneselfToPhysics(this)}remove(e){e.removeOneselfFromPhysics(this)}update(e){const t=Math.ceil(e/this.timestep);for(let n=0;n<t;n++)this.world.step(this.collisionEventQueue)}getCollisions(){const e=[];return this.collisionEventQueue.drainCollisionEvents((t,n,r)=>{const o=it.get(t),s=it.get(n);o&&s&&e.push({objectA:o,partOfA:t,objectB:s,partOfB:n,started:r})}),e}}class Cn{trans;objectA3;bodyDesc;body;colliderDescs;colliders;completeOptions;constructor(e={}){this.completeOptions={...en,...e},this.trans=new qe,this.colliderDescs=[],this.colliders=[]}makeBodyDesc(){let e;switch(this.completeOptions.rigidBody){case"dynamic":e=He.RigidBodyDesc.dynamic();break;case"kinematic":e=He.RigidBodyDesc.kinematicPositionBased();break;case"fixed":e=He.RigidBodyDesc.fixed();break}return e.setTranslation(this.trans.loc.x,this.trans.loc.y,this.trans.loc.z),e.setRotation({x:this.trans.quat.x,y:this.trans.quat.y,z:this.trans.quat.z,w:this.trans.quat.w}),e}configColliderDescs(){if(!this.objectA3)return;const e=this.completeOptions,t=[];this.objectA3.object.traverse(r=>{if(cn(r)){const o=Lr(r.geometry),s=e.membership<<16|e.filter;if(o)o.colliderDesc.setCollisionGroups(s),e.collisionDetection&&o.colliderDesc.setActiveEvents(He.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(o.colliderDesc),o.colliderDesc.setRestitution(e.restitution).setFriction(e.friction),t.push(o.volume);else{let c,A;switch(e.meshCollider){case"tri_mesh":c=kr(r),A=yn(r.geometry);break;case"convex_hull":c=Sr(r),A=yn(r.geometry);break}c&&(c.setCollisionGroups(s),e.collisionDetection&&c.setActiveEvents(He.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(c),t.push(A))}}});let n=t.reduce((r,o)=>r+o,0);for(let r=0;r<this.colliderDescs.length;r++)this.colliderDescs[r].setRestitution(e.restitution),this.colliderDescs[r].setFriction(e.friction),this.colliderDescs[r].setMass(e.mass*(t[r]/n))}init(e,t){this.trans.set(e),this.objectA3=t,this.colliderDescs=[],this.colliders=[],this.bodyDesc=this.makeBodyDesc(),this.configColliderDescs()}addOneselfToPhysics(e){this.bodyDesc&&(this.body=e.world.createRigidBody(this.bodyDesc),this.colliderDescs.forEach(t=>{const n=e.world.createCollider(t,this.body);this.colliders.push(n),this.objectA3&&it.set(n.handle,this.objectA3)}))}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.colliders.forEach(t=>{e.world.removeCollider(t,!1),it.delete(t.handle)})}isGrounded(){return this.trans.loc.y<=0}setLocation(e){}setLocationNow(e){this.body?this.body.setTranslation(e,!0):this.bodyDesc?.setTranslation(e.x,e.y,e.z),this.trans.loc.set(e)}setQuat(e){}setQuatNow(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.trans.quat.set(e)}setScale(e){}setScaleNow(e){}setLinvel(e){this.body?this.body.setLinvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setLinvel(e.x,e.y,e.z)}getLinvel(e){return e||(e=new Z),this.body?e.set(this.body.linvel()):this.bodyDesc&&e.set(this.bodyDesc.linvel),e}setAngvel(e){this.body?this.body.setAngvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setAngvel({x:e.x,y:e.y,z:e.z})}getAngvel(e){return e||(e=new Z),this.body?e.set(this.body.angvel()):this.bodyDesc&&e.set(this.bodyDesc.angvel),e}resetForce(){this.body?.resetForces(!0)}addForce(e){this.body?.addForce({x:e.x,y:e.y,z:e.z},!0)}addForceAtPoint(e,t){this.body?.addForceAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}resetTorque(){this.body?.resetTorques(!0)}addTorque(e){this.body?.addTorque({x:e.x,y:e.y,z:e.z},!0)}applyImpulse(e){this.body?.applyImpulse({x:e.x,y:e.y,z:e.z},!0)}applyImpulseAtPoint(e,t){this.body?.applyImpulseAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}applyTorqueImpulse(e){this.body?.applyTorqueImpulse({x:e.x,y:e.y,z:e.z},!0)}update(e){if(this.body){const t=this.body.translation();this.trans.loc.set(t.x,t.y,t.z);const n=this.body.rotation();this.trans.quat.set(n.x,n.y,n.z,n.w)}}}function kr(i){let e=null;if(cn(i)){const t=i;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const r=n.attributes.position.array;let o=n.index?n.index.array:null;if(o)o instanceof Uint32Array||(o=new Uint32Array(o));else{const s=n.attributes.position.count;o=new Uint32Array(s);for(let c=0;c<s;c++)o[c]=c}r instanceof Float32Array&&(e=He.ColliderDesc.trimesh(r,o))}return e}function Sr(i){let e=null;if(cn(i)){const t=i;t.updateWorldMatrix(!0,!0);const n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);const r=n.attributes.position.array;r instanceof Float32Array&&(e=He.ColliderDesc.convexHull(r))}return e}function yn(i){const e=i.attributes.position;if(!e)throw new Error("position attribute not found");const t=i.index,n=e.array;let r=0;const o=new re.Vector3,s=new re.Vector3,c=new re.Vector3;if(t){const A=t.array;for(let a=0;a<A.length;a+=3){const h=A[a]*3,u=A[a+1]*3,b=A[a+2]*3;o.set(n[h],n[h+1],n[h+2]),s.set(n[u],n[u+1],n[u+2]),c.set(n[b],n[b+1],n[b+2]),r+=o.dot(s.clone().cross(c))}}else for(let A=0;A<n.length;A+=9)o.set(n[A],n[A+1],n[A+2]),s.set(n[A+3],n[A+4],n[A+5]),c.set(n[A+6],n[A+7],n[A+8]),r+=o.dot(s.clone().cross(c));return Math.abs(r)/6}function Lr(i){if(Cr(i)){const e=i.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,r=typeof e?.depth=="number"?e.depth/2:.5,o=.1;return{colliderDesc:He.ColliderDesc.roundCuboid(t-o,n-o,r-o,o),volume:2*t*2*n*2*r}}else if(yr(i)){const e=i.parameters,t=typeof e?.width=="number"?e.width/2:.5,n=typeof e?.height=="number"?e.height/2:.5,r=typeof e?.depth=="number"?e.depth/2:.5;return{colliderDesc:He.ColliderDesc.cuboid(t,n,r),volume:2*t*2*n*2*r}}else if(Br(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:He.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(wr(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:He.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(Tr(i)){const e=i.parameters,t=typeof e?.radiusBottom=="number"?e.radiusBottom:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:He.ColliderDesc.cylinder(n/2,t),volume:Math.PI*t*t*n}}else if(Rr(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:He.ColliderDesc.capsule(n/2,t),volume:4/3*Math.PI*t*t*t+Math.PI*t*t*n}}return null}const tn=new Rt;async function _r(){await tn.init()}const j={v0:new Z,v1:new Z,v2:new Z,v3:new Z,v4:new Z,q0:new Te,q1:new Te,q2:new Te,q3:new Te,q4:new Te,t0:new qe,t1:new qe,t2:new qe,t3:new qe,t4:new qe};function xr(i){return new Promise(e=>{setTimeout(()=>{e()},i)})}async function zn(i){const t=await(await fetch(i)).arrayBuffer(),n=await new Promise((r,o)=>{Gn.unzip(new Uint8Array(t),(s,c)=>{s?o(s):r(c)})});return{zipUrl:i,unzipped:n}}function un(i,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),i.unzipped[e])return Gn.strFromU8(i.unzipped[e]);throw new Error(`readStringFromUnzippedA3(): no file at ${e}`)}function Kn(i,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),i.unzipped[e]){const t=Dr(e);return new Blob([new Uint8Array(i.unzipped[e])],{type:t})}else throw new Error(`readBlobFromUnzippedA3(): no file at ${e}`)}const Nr={"image/png":/\.png$/i,"image/jpeg":/\.(jpg|jpeg)$/i,"image/gif":/\.gif$/i,"model/vrml":/\.wrl$/i,"application/xml":/\.xml$/i,"application/octet-stream":/\.bvh/i,"audio/x-wav":/\.wav/i,"audio/mpeg":/\.mp3/i,"audio/ogg":/\.ogg/i,"text/plain":/\.(txt|text)$/i,"model/gltf+json":/\.gltf$/i,"model/gltf-binary":/\.glb$/i};function Dr(i){for(const[e,t]of Object.entries(Nr))if(t.test(i))return e;return"application/octet-stream"}function xt(i,e){if(!e)return i;const t={...i};for(const n in e)typeof i[n]=="object"&&typeof e[n]=="object"?t[n]=xt(i[n],e[n]):t[n]=e[n];return t}const Fr=new re.SphereGeometry,Or=new re.MeshStandardMaterial({color:16711680});let Mr=new re.Mesh(Fr,Or);class Pe{static defaultRotationOrder="XYZ";static defaultUpVector=new Z(0,1,0);rotationOrder;upVector;object;scene;balloon;transformer;parent;children=[];clickListener;constructor(e){this.transformer=this.initTransformer(e),this.object=new re.Object3D;const t=this.initObject(e);t&&this.object.add(t),this.object.traverse(n=>{n.userData.a3js={objectA3:this}})}initObject(e){return Mr.clone()}initTransformer(e){return new Tt}setTransformer(e){j.t0.set(this.transformer.trans),e.init(j.t0,this),this.transformer=e}getTransformer(){return this.transformer}setTransformMode(e,t){if(e==="Default")this.setTransformer(new Tt);else if(e==="Interpolation")this.setTransformer(new jn);else if(e==="Billboard")this.setTransformer(new Er(t));else if(e==="InterpolationBillboard")this.setTransformer(new Ir(t));else if(e==="SimplePhysics"){const n={...en,...t};this.setTransformer(new Cn(n))}}initSimplePhysics(e){const t={...en,...e};this.setTransformer(new Cn(t))}update(e){this.transformer.update(e),this.transformer.trans.write(this),this.children.forEach(t=>{t.update(e)})}add(e){if(e.scene){console.warn("ObjectA3.add(obj) is ignored.");return}if(e.parent){console.warn("ObjectA3.add(obj) is ignored.");return}this.children.push(e),e.parent=this,this.object.add(e.object)}remove(e){if(e.parent!==this){console.warn("ObjectA3.remove(obj) is ignored.");return}const t=this.children.indexOf(e);this.children.splice(t,1),e.parent=void 0,this.object.remove(e.object)}setBalloon(e){this.balloon?this.balloon.message=e:this.balloon=new Pr(e)}setClickListener(e){this.clickListener=e}handleCollision(e,t,n,r){}async clicked(){this.clickListener&&await this.clickListener(this)}get trans(){return this.transformer.trans.clone()}get loc(){return this.trans.loc}setLocation(e,t,n){typeof e=="number"?j.v0.set(e,t,n):j.v0.set(e),this.transformer.setLocation(j.v0)}setLocationNow(e,t,n){typeof e=="number"?j.v0.set(e,t,n):j.v0.set(e),this.transformer.setLocationNow(j.v0)}get quat(){return this.trans.quat}setQuat(e,t,n,r){typeof e=="number"?j.q0.set(e,t,n,r):j.q0.set(e),this.transformer.setQuat(j.q0)}setQuatNow(e,t,n,r){typeof e=="number"?j.q0.set(e,t,n,r):j.q0.set(e),this.transformer.setQuatNow(j.q0)}get scale(){return this.trans.scale}setScale(e,t,n){typeof e=="number"?j.v0.set(e,t,n):j.v0.set(e),this.transformer.setScale(j.v0)}setScaleNow(e,t,n){typeof e=="number"?j.v0.set(e,t,n):j.v0.set(e),this.transformer.setScaleNow(j.v0)}setRotation(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):r.set(e),r.scale(Math.PI/360);const o=this.rotationOrder?this.rotationOrder:Pe.defaultRotationOrder,s=dt(r,o);this.setQuat(s)}setRotationNow(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):r.set(e);const o=this.rotationOrder?this.rotationOrder:Pe.defaultRotationOrder,s=new Te(0,0,0,1);for(let c=0;c<3;c++)switch(o.charAt(c)){case"X":s.mul(new Te(Math.sin(r.x),0,0,Math.cos(r.x)));break;case"Y":s.mul(new Te(0,Math.sin(r.y),0,Math.cos(r.y)));break;case"Z":s.mul(new Te(0,0,Math.sin(r.z),Math.cos(r.z)));break}this.setQuatNow(s)}lookAt(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):e instanceof Pe?r.set(e.loc):r.set(e);const o=this.upVector?this.upVector:Pe.defaultUpVector,s=At(this.loc,r,o);this.setQuat(s)}lookAtNow(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):e instanceof Pe?r.set(e.loc):r.set(e);const o=this.upVector?this.upVector:Pe.defaultUpVector,s=At(this.loc,r,o);this.setQuatNow(s)}getUnitVecX(){return new Z(1,0,0).apply(this.object.quaternion)}getUnitVecY(){return new Z(0,1,0).apply(this.object.quaternion)}getUnitVecZ(){return new Z(0,0,1).apply(this.object.quaternion)}addLocation(e,t,n){const r=new Z;r.set(this.loc),typeof e=="number"?r.add(e,t,n):r.add(e),this.setLocation(r)}addLocationNow(e,t,n){const r=new Z;r.set(this.loc),typeof e=="number"?r.add(e,t,n):r.add(e),this.setLocationNow(r)}mulQuat(e,t,n,r){const o=new Te;o.set(this.quat),typeof e=="number"?o.mul(e,t,n,r):o.mul(e),this.setQuat(o)}mulQuatNow(e,t,n,r){const o=new Te;o.set(this.quat),typeof e=="number"?o.mul(e,t,n,r):o.mul(e),this.setQuatNow(o)}mulRotation(e,t,n){typeof e=="number"?j.v0.set(e,t,n):j.v0.set(e),j.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Pe.defaultRotationOrder,o=dt(j.v0,r);j.q0.set(this.quat),j.q0.mul(o),this.setQuat(j.q0)}mulRotationNow(e,t,n){typeof e=="number"?j.v0.set(e,t,n):j.v0.set(e),j.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Pe.defaultRotationOrder,o=dt(j.v0,r);j.q0.set(this.quat),j.q0.mul(o),this.setQuatNow(j.q0)}mulScale(e,t,n){j.v0.set(this.scale),typeof e=="number"?j.v0.set(j.v0.x*e,j.v0.y*t,j.v0.z*n):j.v0.set(j.v0.x*e.x,j.v0.y*e.y,j.v0.z*e.z),this.setScale(j.v0)}mulScaleNow(e,t,n){j.v0.set(this.scale),typeof e=="number"?j.v0.set(j.v0.x*e,j.v0.y*t,j.v0.z*n):j.v0.set(j.v0.x*e.x,j.v0.y*e.y,j.v0.z*e.z),this.setScaleNow(j.v0)}moveForward(e){j.v0.set(this.getUnitVecZ()),j.v0.scale(e),this.addLocation(j.v0)}moveForwardNow(e){j.v0.set(this.getUnitVecZ()),j.v0.scale(e),this.addLocationNow(j.v0)}moveBackward(e){j.v0.set(this.getUnitVecZ()),j.v0.scale(-e),this.addLocation(j.v0)}moveBackwardNow(e){j.v0.set(this.getUnitVecZ()),j.v0.scale(-e),this.addLocationNow(j.v0)}moveRight(e){j.v0.set(this.getUnitVecX()),j.v0.scale(-e),this.addLocation(j.v0)}moveRightNow(e){j.v0.set(this.getUnitVecX()),j.v0.scale(-e),this.addLocationNow(j.v0)}moveLeft(e){j.v0.set(this.getUnitVecX()),j.v0.scale(e),this.addLocation(j.v0)}moveLeftNow(e){j.v0.set(this.getUnitVecX()),j.v0.scale(e),this.addLocationNow(j.v0)}moveUp(e){j.v0.set(this.getUnitVecY()),j.v0.scale(e),this.addLocation(j.v0)}moveUpNow(e){j.v0.set(this.getUnitVecY()),j.v0.scale(e),this.addLocationNow(j.v0)}moveDown(e){j.v0.set(this.getUnitVecY()),j.v0.scale(-e),this.addLocation(j.v0)}moveDownNow(e){j.v0.set(this.getUnitVecY()),j.v0.scale(-e),this.addLocationNow(j.v0)}turnUp(e){this.mulRotation(-e,0,0)}turnUpNow(e){this.mulRotationNow(-e,0,0)}turnDown(e){this.mulRotation(e,0,0)}turnDownNow(e){this.mulRotationNow(e,0,0)}turnRight(e){this.mulRotation(0,-e,0)}turnRightNow(e){this.mulRotationNow(0,-e,0)}turnLeft(e){this.mulRotation(0,e,0)}turnLeftNow(e){this.mulRotationNow(0,e,0)}rollRight(e){this.mulRotation(0,0,e)}rollRightNow(e){this.mulRotationNow(0,0,e)}rollLeft(e){this.mulRotation(0,0,-e)}rollLeftNow(e){this.mulRotationNow(0,0,-e)}setLinvel(e,t,n){typeof e=="number"?j.v0.set(e,t,n):j.v0.set(e),this.transformer.setLinvel(j.v0)}getLinvel(e){return this.transformer.getLinvel(e)}setAngvel(e,t,n){typeof e=="number"?j.v0.set(e,t,n):j.v0.set(e),this.transformer.setAngvel(j.v0)}getAngvel(e){return this.transformer.getAngvel(e)}resetForce(){this.transformer.resetForce()}addForce(e,t,n){typeof e=="number"?j.v0.set(e,t,n):j.v0.set(e),this.transformer.addForce(j.v0)}addForceAtPoint(e,t,n,r,o,s){if(typeof e=="number")if(typeof t=="number")j.v0.set(e,t,n),j.v1.set(r,o,s);else{console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else if(typeof t=="number"){console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else j.v0.set(e),j.v1.set(t);this.transformer.addForceAtPoint(j.v0,j.v1)}resetTorque(){this.transformer.resetTorque()}addTorque(e,t,n){typeof e=="number"?j.v0.set(e,t,n):j.v0.set(e),this.transformer.addTorque(j.v0)}applyImpulse(e,t,n){typeof e=="number"?j.v0.set(e,t,n):j.v0.set(e),this.transformer.applyImpulse(j.v0)}applyImpulseAtPoint(e,t,n,r,o,s){if(typeof e=="number")if(typeof t=="number")j.v0.set(e,t,n),j.v1.set(r,o,s);else{console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else if(typeof t=="number"){console.warn("ObjectA3.addForceAtPoint(): type of arguments mismatch.");return}else j.v0.set(e),j.v1.set(t);this.transformer.applyImpulseAtPoint(j.v0,j.v1)}applyTorqueImpulse(e,t,n){typeof e=="number"?j.v0.set(e,t,n):j.v0.set(e),this.transformer.applyTorqueImpulse(j.v0)}isGrounded(){return this.transformer.isGrounded()}}class Pr{message;dir;offsetTop;offsetRight;offsetLeft;offsetBottom;constructor(e){this.message=e,this.dir="RIGHT",this.offsetTop={x:0,y:2},this.offsetRight={x:1,y:1},this.offsetLeft={x:-1,y:1},this.offsetBottom={x:0,y:0}}}const Gr={type:"audio",autoplay:!1,loop:!1,volume:1,positional:{refDistance:1,maxDistance:1e3,rolloffFactor:1,directional:{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}}};async function Ur(){try{at.listener.context.state!=="running"&&await at.listener.context.resume()}catch{console.warn("AudioContext resume failed. Did you call on user gesture?")}}class at extends Pe{static listener=new re.AudioListener;static audioLoader=new re.AudioLoader;ready;options;sound;constructor(e,t={}){super(),this.options=xt(Gr,t),this.ready=this.asyncInit(e)}initObject(){return new re.Object3D}async asyncInit(e){if(this.options.type==="positional"){const t=new re.PositionalAudio(at.listener);t.setRefDistance(this.options.positional.refDistance),t.setMaxDistance(this.options.positional.maxDistance),t.setRolloffFactor(this.options.positional.rolloffFactor);const n=this.options.positional.directional;t.setDirectionalCone(n.coneInnerAngle,n.coneOuterAngle,n.coneOuterGain),t.setVolume(this.options.volume),t.setLoop(this.options.loop),this.sound=t}else{const t=new re.Audio(at.listener);t.setVolume(this.options.volume),t.setLoop(this.options.loop),this.sound=t}return this.object.add(this.sound),new Promise(t=>{at.audioLoader.load(e,n=>{this.sound&&this.sound.setBuffer(n),t(this)})})}play(){this.sound?.stop(),this.sound?.play()}stop(){this.sound?.stop()}}class Et extends Pe{ready;actions;currentAction;stateAction;emoteAction;morphs;morphsOverwrite;constructor(e){super(e),this.actions={},this.morphs={},this.morphsOverwrite=!1,this.ready=this.asyncInit(e)}syncInit(e,t,n={}){this.actions=t,this.stateAction=this.actions[e],this.currentAction=this.stateAction,this.object.clear(),this.object.add(this.currentAction.shape.root),this.morphs=n}setActions(e){this.actions=e}getAction(e){return this.actions[e]}addAction(e,t){this.actions[e]=t}removeAction(e){const t=this.actions[e];return delete this.actions[e],t}getActionNames(){return Object.keys(this.actions)}setState(e){const t=this.actions[e];t&&(this.currentAction&&(this.currentAction.sound&&(this.currentAction.soundContinue||this.currentAction.sound.stop()),this.scene&&(this.scene.scene.background=null,this.scene.scene.environment=null),this.object.remove(this.currentAction.shape.root)),this.object.add(t.shape.root),t.motion.playCount=0,t.motion.time=0,t.sound&&(t.sound.play(),t.motion.setFinishListener(()=>{t.sound?.play()})),this.scene&&t.backgroundTexture&&(this.scene.scene.background=t.backgroundTexture,this.scene.scene.environment=t.backgroundTexture),this.currentAction=t,this.stateAction=t)}setEmote(e){const t=this.actions[e];t&&(this.currentAction&&(this.currentAction.sound&&(this.currentAction.soundContinue||this.currentAction.sound.stop()),this.scene&&(this.scene.scene.background=null,this.scene.scene.environment=null),this.object.remove(this.currentAction.shape.root)),this.object.add(t.shape.root),t.motion.playCount=0,t.motion.time=0,t.sound&&(t.sound.play(),t.motion.setFinishListener(()=>{t.sound?.play()})),this.scene&&t.backgroundTexture&&(this.scene.scene.background=t.backgroundTexture,this.scene.scene.environment=t.backgroundTexture),this.currentAction=t,this.emoteAction=t)}setMorphsOverwrite(e){this.morphsOverwrite=e}morph(e,t){if(e in this.morphs){const{array:n,idx:r}=this.morphs[e];n[r]=t}}getMorphNames(){return Object.keys(this.morphs)}pose={};update(e){super.update(e);let t;if(this.emoteAction&&this.emoteAction.motion.playCount<=0){if(t=this.emoteAction.motion.update(e),this.emoteAction.motion.playCount>0&&(this.currentAction?.shape.root&&this.object.remove(this.currentAction.shape.root),this.currentAction?.sound&&(this.currentAction.soundContinue||this.currentAction.sound.stop()),this.emoteAction=void 0,this.stateAction&&(this.object.add(this.stateAction.shape.root),this.currentAction=this.stateAction,this.stateAction.sound))){const n=this.stateAction.sound;n.play(),this.stateAction.motion.setFinishListener(()=>{n.play()})}}else this.stateAction&&(t=this.stateAction.motion.update(e));if(t&&this.currentAction&&this.currentAction.shape.bones)for(const[n,r]of Object.entries(t)){const o=this.currentAction.shape.bones[n];if(o&&(r.loc&&o.position.set(r.loc.x,r.loc.y,r.loc.z),r.quat&&o.quaternion.set(r.quat.x,r.quat.y,r.quat.z,r.quat.w),r.scale&&o.scale.set(r.scale.x,r.scale.y,r.scale.z)),!this.morphsOverwrite&&r.morphs){for(const s of r.morphs)for(const c of Object.keys(this.morphs))if(c.startsWith(s.name)){const{array:A}=this.morphs[c];for(let a=0;a<A.length;a++)A[a]=s.vals[a];break}}}this.object.updateMatrixWorld(!0),this.currentAction&&this.currentAction.shape.skeleton?.update()}}class Bn{name;playCount;time;finishListener;constructor(){this.name="dummy",this.playCount=0,this.time=0}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){}setTime(e){}setFinishListener(e){this.finishListener=e}update(e){return{}}}class Vn{scene;objects;physicsWorld=null;physicsDt=1/60;collisionListener;rapierLines;constructor(){this.scene=new re.Scene,this.objects=[],tn.isInitialized&&(this.physicsWorld=tn.createWorld({gravity:{x:0,y:-9.81,z:0},timestep:this.physicsDt}))}add(e){if(this.scene.add(e.object),this.objects.push(e),e.scene=this,this.physicsWorld&&(e.transformer.addOneselfToPhysics(this.physicsWorld),e instanceof Et))for(const t of Object.values(e.actions))t.motion.addOneselfToPhysics(this.physicsWorld);e instanceof Et&&e.currentAction&&e.currentAction.backgroundTexture&&(this.scene.background=e.currentAction.backgroundTexture,this.scene.environment=e.currentAction.backgroundTexture)}remove(e){this.scene.remove(e.object);{const t=this.objects.indexOf(e);this.objects[t]=this.objects[this.objects.length-1],this.objects.pop()}if(e.scene=void 0,this.physicsWorld&&(e.transformer.removeOneselfFromPhysics(this.physicsWorld),e instanceof Et))for(const t of Object.values(e.actions))t.motion.removeOneselfFromPhysics(this.physicsWorld)}setCollisionListener(e){this.collisionListener=e}update(e){if(this.physicsWorld){this.physicsWorld.update(e);const t=this.physicsWorld.getCollisions();if(t.forEach(n=>{n.objectA.handleCollision(n.objectB,n.started,n.partOfA,n.partOfB),n.objectB.handleCollision(n.objectA,n.started,n.partOfB,n.partOfA)}),this.collisionListener&&t.length>0&&this.collisionListener(t),this.rapierLines&&this.physicsWorld instanceof ln){const{vertices:n,colors:r}=this.physicsWorld.world.debugRender();this.rapierLines.geometry.setAttribute("position",new re.BufferAttribute(n,3)),this.rapierLines.geometry.setAttribute("color",new re.BufferAttribute(r,4))}}for(const t of this.objects)t.update(e)}rapierDebug(e){e?(this.rapierLines=new re.LineSegments(new re.BufferGeometry,new re.LineBasicMaterial({vertexColors:!0})),this.scene.add(this.rapierLines)):this.rapierLines&&(this.scene.remove(this.rapierLines),this.rapierLines=void 0)}}class Wn extends Pe{controller;setController(e){this.controller=e}setLocation(e,t,n){const r=new Z;typeof e=="number"?(super.setLocation(e,t,n),r.set(e,t,n)):(super.setLocation(e),r.set(e)),this.controller?this.controller.setCameraLocation(r):super.setLocation(r)}setLocationNow(e,t,n){const r=new Z;typeof e=="number"?(super.setLocation(e,t,n),r.set(e,t,n)):(super.setLocation(e),r.set(e)),this.controller?this.controller.setCameraLocationNow(r):super.setLocationNow(r)}setQuat(e,t,n,r){const o=new Te;typeof e=="number"?o.set(e,t,n,r):o.set(e),this.controller?this.controller.setCameraQuat(o):this.transformer.setQuat(o)}setQuatNow(e,t,n,r){const o=new Te;typeof e=="number"?o.set(e,t,n,r):o.set(e),this.controller?this.controller.setCameraQuatNow(o):this.transformer.setQuatNow(o)}lookAt(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):e instanceof Pe?r.set(e.loc):r.set(e);const o=this.upVector?this.upVector:Pe.defaultUpVector,s=At(this.loc,r,o);s.mul(new Te(o.x,o.y,o.z,0)),this.setQuat(s)}lookAtNow(e,t,n){const r=new Z;typeof e=="number"?r.set(e,t,n):e instanceof Pe?r.set(e.loc):r.set(e);const o=this.upVector?this.upVector:Pe.defaultUpVector,s=At(this.loc,r,o);s.mul(new Te(o.x,o.y,o.z,0)),this.setQuatNow(s)}}class Nt{view;trans;constructor(){this.trans=new qe}setView(e){this.view=e}update(e){this.view&&(this.view.camera.transformer.setLocation(this.trans.loc),this.view.camera.transformer.setQuat(this.trans.quat),this.view.camera.transformer.setScale(this.trans.scale))}activate(){}deactivate(){}keyDown(e){}keyUp(e){}keyPress(e){}mouseDown(e){}mouseUp(e){}mouseMove(e){}mouseClick(e){}mouseEnter(e){}mouseLeave(e){}mouseWheel(e){}touchStart(e){}touchEnd(e){}touchMove(e){}touchCancel(e){}setCameraLocation(e){this.trans.loc.set(e)}setCameraLocationNow(e){this.trans.loc.set(e)}setCameraQuat(e){this.trans.quat.set(e)}setCameraQuatNow(e){this.trans.quat.set(e)}setCameraScale(e){this.trans.scale.set(e)}setCameraScaleNow(e){this.trans.scale.set(e)}}class Yn extends Nt{preMouse;leftClick=!1;rightClick=!1;target;cameraLoc=new Z(0,0,3);cameraQuat=new Te(0,0,0,1);constructor(e,t,n){super(),this.preMouse={x:0,y:0},typeof e=="number"?this.target=new Z(e,t,n):this.target=new Z(e)}update(e){this.view&&(this.view.camera.transformer.setLocation(this.cameraLoc),this.view.camera.transformer.setQuat(this.cameraQuat))}mouseDown(e){e.button===0?(this.leftClick=!0,this.preMouse.x=e.clientX,this.preMouse.y=e.clientY):e.button===2&&(this.rightClick=!0,this.preMouse.x=e.clientX,this.preMouse.y=e.clientY)}mouseMove(e){if(this.view){if(this.leftClick&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey){const n=.01*(e.clientX-this.preMouse.x),r=.01*(e.clientY-this.preMouse.y),o=Math.sin(-n),s=Math.cos(-n),c=Math.sin(-r),A=Math.cos(-r),a=new Z(1,0,0).apply(this.cameraQuat),h=new Z(0,1,0).apply(this.cameraQuat),u=new Te(a.x*c,a.y*c,a.z*c,A),b=new Te(h.x*o,h.y*o,h.z*o,s),f=new Z(this.cameraLoc);f.sub(this.target),f.apply(u),f.apply(b),f.add(this.target),this.cameraLoc.set(f);const I=At(this.cameraLoc,this.target,new Z(0,1,0));I.mul(new Te(0,1,0,0)),this.cameraQuat.set(I),this.preMouse.x=e.clientX,this.preMouse.y=e.clientY}else if(this.leftClick){j.v0.set(this.target),j.v0.sub(this.cameraLoc);const n=.005*j.v0.length(),r=n*(e.clientX-this.preMouse.x),o=n*(e.clientY-this.preMouse.y),s=new Z(1,0,0).apply(this.cameraQuat).scale(-r),c=new Z(0,1,0).apply(this.cameraQuat).scale(o);this.cameraLoc.add(s),this.cameraLoc.add(c),this.target.add(s),this.target.add(c),this.preMouse.x=e.clientX,this.preMouse.y=e.clientY}}}mouseUp(e){e.button===0?this.leftClick=!1:e.button===2&&(this.rightClick=!1)}mouseWheel(e){const t=new Z(this.target).sub(this.cameraLoc);e.deltaY>0?t.scale(.05):e.deltaY<0&&t.scale(-.05),this.cameraLoc.add(t)}setCameraLocation(e){this.cameraLoc.set(e)}setCameraLocationNow(e){this.cameraLoc.set(e)}setCameraQuat(e){e.normalize(),this.cameraQuat.normalize();const t=new Te(this.cameraQuat);t.conjugate();const n=new Z(this.target);n.sub(this.cameraLoc),n.apply(t),n.add(this.cameraLoc),this.target.set(n),this.cameraQuat.set(e)}setCameraQuatNow(e){this.setCameraQuat(e)}}const jr={speed:.1,angSpeed:.01};class Hr extends Nt{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextLoc;_avatarNextQuat;_velY;constructor(e,t){super(),this.options={...jr,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextLoc=new Z,this._avatarNextQuat=new Te,this._velY=0}keyDown(e){e.code==="KeyW"?this._keyW=!0:e.code==="KeyA"?this._keyA=!0:e.code==="KeyS"?this._keyS=!0:e.code==="KeyD"?this._keyD=!0:e.code==="ArrowLeft"?this._keyLeft=!0:e.code==="ArrowRight"?this._keyRight=!0:e.code==="Space"&&(this._keySpace=!0)}keyUp(e){e.code==="KeyW"?this._keyW=!1:e.code==="KeyA"?this._keyA=!1:e.code==="KeyS"?this._keyS=!1:e.code==="KeyD"?this._keyD=!1:e.code==="ArrowLeft"?this._keyLeft=!1:e.code==="ArrowRight"?this._keyRight=!1:e.code==="Space"&&(this._keySpace=!1)}update(e){const t=this._avatar,n=new qe;n.set(t);const r=t.getUnitVecZ().scale(this.options.speed),o=t.getUnitVecX().scale(this.options.speed);this._avatarNextLoc.set(n.loc),this._avatarNextQuat.set(n.quat),this._keyW&&this._avatarNextLoc.add(r),this._keyA&&this._avatarNextLoc.add(o),this._keyS&&this._avatarNextLoc.sub(r),this._keyD&&this._avatarNextLoc.sub(o),this._velY+=-9.8*e*.1,t.isGrounded()&&(this._velY=0,this._keySpace&&(this._velY=.5)),this._avatarNextLoc.add(0,this._velY,0),this._keyLeft&&this._avatarNextQuat.mul(dt(new Z(0,this.options.angSpeed,0))),this._keyRight&&this._avatarNextQuat.mul(dt(new Z(0,-this.options.angSpeed,0))),t.transformer.setLocation(this._avatarNextLoc),t.transformer.setQuat(this._avatarNextQuat)}}const qr={speed:5,angSpeed:.3,jumpSpeed:15};class zr extends Nt{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextVel;_avatarNextAngVel;_velY;constructor(e,t){super(),this.options={...qr,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextVel=new Z,this._avatarNextAngVel=new Z,this._velY=0}keyDown(e){e.code==="KeyW"?this._keyW=!0:e.code==="KeyA"?this._keyA=!0:e.code==="KeyS"?this._keyS=!0:e.code==="KeyD"?this._keyD=!0:e.code==="ArrowLeft"?this._keyLeft=!0:e.code==="ArrowRight"?this._keyRight=!0:e.code==="Space"&&(this._keySpace=!0)}keyUp(e){e.code==="KeyW"?this._keyW=!1:e.code==="KeyA"?this._keyA=!1:e.code==="KeyS"?this._keyS=!1:e.code==="KeyD"?this._keyD=!1:e.code==="ArrowLeft"?this._keyLeft=!1:e.code==="ArrowRight"?this._keyRight=!1:e.code==="Space"&&(this._keySpace=!1)}update(e){const t=this._avatar;new qe().set(t);const r=t.getUnitVecZ().scale(this.options.speed),o=t.getUnitVecX().scale(this.options.speed);this._avatarNextVel.set(0,0,0),this._avatarNextAngVel.set(0,0,0),this._keyW&&this._avatarNextVel.add(r),this._keyA&&this._avatarNextVel.add(o),this._keyS&&this._avatarNextVel.sub(r),this._keyD&&this._avatarNextVel.sub(o),this._velY+=-9.8*e,t.isGrounded()&&(this._velY=0,this._keySpace&&(this._velY=this.options.jumpSpeed)),this._avatarNextVel.add(0,this._velY,0),this._keyLeft&&this._avatarNextAngVel.add(new Z(0,this.options.angSpeed,0)),this._keyRight&&this._avatarNextAngVel.add(new Z(0,-this.options.angSpeed,0)),t.transformer.setLinvel(this._avatarNextVel),t.transformer.setAngvel(this._avatarNextAngVel)}}class Jn{scene;camera;controller;constructor(e){this.scene=new Vn,this.camera=e,this.camera.setAudioListener(at.listener),this.scene.scene.add(this.camera.object),this.camera.setLocation(0,0,3),this.controller=new Yn(0,0,0),this.controller.setView(this),this.controller.activate(),this.camera.setController(this.controller)}replaceScene(e){this.scene.scene.remove(this.camera.object),e.scene.add(this.camera.object);const t=this.scene;return this.scene=e,t}updateScene(e){this.scene.update(e),this.controller?.update(e),this.camera.update(e)}setController(e){this.controller.deactivate(),this.controller=e,this.controller.setView(this),this.controller.activate(),this.camera.setController(e)}worldToScreen(e){throw new Error("ViewBaseはworldToScreen()は実装していません")}screenToWorld(e,t,n){throw new Error("ViewBaseはscreenToWorld()は実装していません")}cameraToScreen(e){throw new Error("ViewBaseはcameraToScreen()は実装していません")}screenToCamera(e,t,n){throw new Error("ViewBaseはscreenToCamera()は実装していません")}async waitForRender(){throw new Error("ViewBaseはwaitForRender()は実装していません")}}class vt extends Wn{camera;headLight;constructor(e){super(),this.camera=e,this.headLight=new re.SpotLight(16777215,1,0,Math.PI/3,0,0),this.headLight.position.set(0,0,0);const t=new re.Object3D;t.position.set(0,0,-10),this.headLight.target=t,this.object.add(this.camera),this.object.add(this.headLight),this.object.add(t)}initObject(){return new re.Object3D}setAudioListener(e){this.camera.add(e)}getHeadLight(){return this.headLight}setAspect(e){Qr(this.camera)&&(this.camera.aspect=e,this.camera.updateProjectionMatrix())}setHeadLightEnable(e){e?this.headLight.intensity=1:this.headLight.intensity=0}calcNDC(e){const t=new re.Vector3(e.x,e.y,e.z);return t.project(this.camera),{x:t.x,y:t.y}}}class Xn extends g.Object3D{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new g.Vector2(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element&&t.element instanceof t.element.ownerDocument.defaultView.Element&&t.element.parentNode!==null&&t.element.remove()})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const gt=new g.Vector3,wn=new g.Matrix4,Tn=new g.Matrix4,Rn=new g.Vector3,vn=new g.Vector3;class Zn{constructor(e={}){const t=this;let n,r,o,s;const c={objects:new WeakMap},A=e.element!==void 0?e.element:document.createElement("div");A.style.overflow="hidden",this.domElement=A,this.sortObjects=!0,this.getSize=function(){return{width:n,height:r}},this.render=function(I,m){I.matrixWorldAutoUpdate===!0&&I.updateMatrixWorld(),m.parent===null&&m.matrixWorldAutoUpdate===!0&&m.updateMatrixWorld(),wn.copy(m.matrixWorldInverse),Tn.multiplyMatrices(m.projectionMatrix,wn),h(I,I,m),this.sortObjects&&f(I)},this.setSize=function(I,m){n=I,r=m,o=n/2,s=r/2,A.style.width=I+"px",A.style.height=m+"px"};function a(I){I.isCSS2DObject&&(I.element.style.display="none");for(let m=0,l=I.children.length;m<l;m++)a(I.children[m])}function h(I,m,l){if(I.visible===!1){a(I);return}if(I.isCSS2DObject){gt.setFromMatrixPosition(I.matrixWorld),gt.applyMatrix4(Tn);const d=gt.z>=-1&>.z<=1&&I.layers.test(l.layers)===!0,p=I.element;p.style.display=d===!0?"":"none",d===!0&&(I.onBeforeRender(t,m,l),p.style.transform="translate("+-100*I.center.x+"%,"+-100*I.center.y+"%)translate("+(gt.x*o+o)+"px,"+(-gt.y*s+s)+"px)",p.parentNode!==A&&A.appendChild(p),I.onAfterRender(t,m,l));const C={distanceToCameraSquared:u(l,I)};c.objects.set(I,C)}for(let d=0,p=I.children.length;d<p;d++)h(I.children[d],m,l)}function u(I,m){return Rn.setFromMatrixPosition(I.matrixWorld),vn.setFromMatrixPosition(m.matrixWorld),Rn.distanceToSquared(vn)}function b(I){const m=[];return I.traverseVisible(function(l){l.isCSS2DObject&&m.push(l)}),m}function f(I){const m=b(I).sort(function(d,p){if(d.renderOrder!==p.renderOrder)return p.renderOrder-d.renderOrder;const C=c.objects.get(d).distanceToCameraSquared,E=c.objects.get(p).distanceToCameraSquared;return C-E}),l=m.length;for(let d=0,p=m.length;d<p;d++)m[d].element.style.zIndex=l-d}}}function Qn(i,e){if(e===g.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===g.TriangleFanDrawMode||e===g.TriangleStripDrawMode){let t=i.getIndex();if(t===null){const s=[],c=i.getAttribute("position");if(c!==void 0){for(let A=0;A<c.count;A++)s.push(A);i.setIndex(s),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,r=[];if(e===g.TriangleFanDrawMode)for(let s=1;s<=n;s++)r.push(t.getX(0)),r.push(t.getX(s)),r.push(t.getX(s+1));else for(let s=0;s<n;s++)s%2===0?(r.push(t.getX(s)),r.push(t.getX(s+1)),r.push(t.getX(s+2))):(r.push(t.getX(s+2)),r.push(t.getX(s+1)),r.push(t.getX(s)));r.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=i.clone();return o.setIndex(r),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}class $n extends g.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Jr(t)}),this.register(function(t){return new Xr(t)}),this.register(function(t){return new so(t)}),this.register(function(t){return new ao(t)}),this.register(function(t){return new Ao(t)}),this.register(function(t){return new $r(t)}),this.register(function(t){return new eo(t)}),this.register(function(t){return new to(t)}),this.register(function(t){return new no(t)}),this.register(function(t){return new Yr(t)}),this.register(function(t){return new io(t)}),this.register(function(t){return new Zr(t)}),this.register(function(t){return new oo(t)}),this.register(function(t){return new ro(t)}),this.register(function(t){return new Vr(t)}),this.register(function(t){return new co(t)}),this.register(function(t){return new lo(t)})}load(e,t,n,r){const o=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const a=g.LoaderUtils.extractUrlBase(e);s=g.LoaderUtils.resolveURL(a,this.path)}else s=g.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const c=function(a){r?r(a):console.error(a),o.manager.itemError(e),o.manager.itemEnd(e)},A=new g.FileLoader(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(a){try{o.parse(a,s,function(h){t(h),o.manager.itemEnd(e)},c)}catch(h){c(h)}},n,c)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let o;const s={},c={},A=new TextDecoder;if(typeof e=="string")o=JSON.parse(e);else if(e instanceof ArrayBuffer)if(A.decode(new Uint8Array(e,0,4))===ei){try{s[Le.KHR_BINARY_GLTF]=new uo(e)}catch(u){r&&r(u);return}o=JSON.parse(s[Le.KHR_BINARY_GLTF].content)}else o=JSON.parse(A.decode(e));else o=e;if(o.asset===void 0||o.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const a=new To(o,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});a.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){const u=this.pluginCallbacks[h](a);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),c[u.name]=u,s[u.name]=!0}if(o.extensionsUsed)for(let h=0;h<o.extensionsUsed.length;++h){const u=o.extensionsUsed[h],b=o.extensionsRequired||[];switch(u){case Le.KHR_MATERIALS_UNLIT:s[u]=new Wr;break;case Le.KHR_DRACO_MESH_COMPRESSION:s[u]=new ho(o,this.dracoLoader);break;case Le.KHR_TEXTURE_TRANSFORM:s[u]=new fo;break;case Le.KHR_MESH_QUANTIZATION:s[u]=new po;break;default:b.indexOf(u)>=0&&c[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}a.setExtensions(s),a.setPlugins(c),a.parse(n,r)}parseAsync(e,t){const n=this;return new Promise(function(r,o){n.parse(e,t,r,o)})}}function Kr(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const Le={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Vr{constructor(e){this.parser=e,this.name=Le.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const o=t[n];o.extensions&&o.extensions[this.name]&&o.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,o.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const o=t.json,A=((o.extensions&&o.extensions[this.name]||{}).lights||[])[e];let a;const h=new g.Color(16777215);A.color!==void 0&&h.setRGB(A.color[0],A.color[1],A.color[2],g.LinearSRGBColorSpace);const u=A.range!==void 0?A.range:0;switch(A.type){case"directional":a=new g.DirectionalLight(h),a.target.position.set(0,0,-1),a.add(a.target);break;case"point":a=new g.PointLight(h),a.distance=u;break;case"spot":a=new g.SpotLight(h),a.distance=u,A.spot=A.spot||{},A.spot.innerConeAngle=A.spot.innerConeAngle!==void 0?A.spot.innerConeAngle:0,A.spot.outerConeAngle=A.spot.outerConeAngle!==void 0?A.spot.outerConeAngle:Math.PI/4,a.angle=A.spot.outerConeAngle,a.penumbra=1-A.spot.innerConeAngle/A.spot.outerConeAngle,a.target.position.set(0,0,-1),a.add(a.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+A.type)}return a.position.set(0,0,0),rt(a,A),A.intensity!==void 0&&(a.intensity=A.intensity),a.name=t.createUniqueName(A.name||"light_"+e),r=Promise.resolve(a),t.cache.add(n,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,o=n.json.nodes[e],c=(o.extensions&&o.extensions[this.name]||{}).light;return c===void 0?null:this._loadLight(c).then(function(A){return n._getNodeRef(t.cache,c,A)})}}class Wr{constructor(){this.name=Le.KHR_MATERIALS_UNLIT}getMaterialType(){return g.MeshBasicMaterial}extendParams(e,t,n){const r=[];e.color=new g.Color(1,1,1),e.opacity=1;const o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){const s=o.baseColorFactor;e.color.setRGB(s[0],s[1],s[2],g.LinearSRGBColorSpace),e.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(n.assignTexture(e,"map",o.baseColorTexture,g.SRGBColorSpace))}return Promise.all(r)}}class Yr{constructor(e){this.parser=e,this.name=Le.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name].emissiveStrength;return o!==void 0&&(t.emissiveIntensity=o),Promise.resolve()}}class Jr{constructor(e){this.parser=e,this.name=Le.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];if(s.clearcoatFactor!==void 0&&(t.clearcoat=s.clearcoatFactor),s.clearcoatTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),s.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),s.clearcoatRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),s.clearcoatNormalTexture!==void 0&&(o.push(n.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),s.clearcoatNormalTexture.scale!==void 0)){const c=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new g.Vector2(c,c)}return Promise.all(o)}}class Xr{constructor(e){this.parser=e,this.name=Le.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name];return t.dispersion=o.dispersion!==void 0?o.dispersion:0,Promise.resolve()}}class Zr{constructor(e){this.parser=e,this.name=Le.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.iridescenceFactor!==void 0&&(t.iridescence=s.iridescenceFactor),s.iridescenceTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceMap",s.iridescenceTexture)),s.iridescenceIor!==void 0&&(t.iridescenceIOR=s.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),s.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),s.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),s.iridescenceThicknessTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(o)}}class $r{constructor(e){this.parser=e,this.name=Le.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[];t.sheenColor=new g.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const s=r.extensions[this.name];if(s.sheenColorFactor!==void 0){const c=s.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],g.LinearSRGBColorSpace)}return s.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&o.push(n.assignTexture(t,"sheenColorMap",s.sheenColorTexture,g.SRGBColorSpace)),s.sheenRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(o)}}class eo{constructor(e){this.parser=e,this.name=Le.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.transmissionFactor!==void 0&&(t.transmission=s.transmissionFactor),s.transmissionTexture!==void 0&&o.push(n.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(o)}}class to{constructor(e){this.parser=e,this.name=Le.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];t.thickness=s.thicknessFactor!==void 0?s.thicknessFactor:0,s.thicknessTexture!==void 0&&o.push(n.assignTexture(t,"thicknessMap",s.thicknessTexture)),t.attenuationDistance=s.attenuationDistance||1/0;const c=s.attenuationColor||[1,1,1];return t.attenuationColor=new g.Color().setRGB(c[0],c[1],c[2],g.LinearSRGBColorSpace),Promise.all(o)}}class no{constructor(e){this.parser=e,this.name=Le.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name];return t.ior=o.ior!==void 0?o.ior:1.5,Promise.resolve()}}class io{constructor(e){this.parser=e,this.name=Le.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];t.specularIntensity=s.specularFactor!==void 0?s.specularFactor:1,s.specularTexture!==void 0&&o.push(n.assignTexture(t,"specularIntensityMap",s.specularTexture));const c=s.specularColorFactor||[1,1,1];return t.specularColor=new g.Color().setRGB(c[0],c[1],c[2],g.LinearSRGBColorSpace),s.specularColorTexture!==void 0&&o.push(n.assignTexture(t,"specularColorMap",s.specularColorTexture,g.SRGBColorSpace)),Promise.all(o)}}class ro{constructor(e){this.parser=e,this.name=Le.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return t.bumpScale=s.bumpFactor!==void 0?s.bumpFactor:1,s.bumpTexture!==void 0&&o.push(n.assignTexture(t,"bumpMap",s.bumpTexture)),Promise.all(o)}}class oo{constructor(e){this.parser=e,this.name=Le.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:g.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];return s.anisotropyStrength!==void 0&&(t.anisotropy=s.anisotropyStrength),s.anisotropyRotation!==void 0&&(t.anisotropyRotation=s.anisotropyRotation),s.anisotropyTexture!==void 0&&o.push(n.assignTexture(t,"anisotropyMap",s.anisotropyTexture)),Promise.all(o)}}class so{constructor(e){this.parser=e,this.name=Le.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const o=r.extensions[this.name],s=t.options.ktx2Loader;if(!s){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o.source,s)}}class ao{constructor(e){this.parser=e,this.name=Le.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,r=n.json,o=r.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],c=r.images[s.source];let A=n.textureLoader;if(c.uri){const a=n.options.manager.getHandler(c.uri);a!==null&&(A=a)}return n.loadTextureImage(e,s.source,A)}}class Ao{constructor(e){this.parser=e,this.name=Le.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,r=n.json,o=r.textures[e];if(!o.extensions||!o.extensions[t])return null;const s=o.extensions[t],c=r.images[s.source];let A=n.textureLoader;if(c.uri){const a=n.options.manager.getHandler(c.uri);a!==null&&(A=a)}return n.loadTextureImage(e,s.source,A)}}class co{constructor(e){this.name=Le.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const r=n.extensions[this.name],o=this.parser.getDependency("buffer",r.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(c){const A=r.byteOffset||0,a=r.byteLength||0,h=r.count,u=r.byteStride,b=new Uint8Array(c,A,a);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(h,u,b,r.mode,r.filter).then(function(f){return f.buffer}):s.ready.then(function(){const f=new ArrayBuffer(h*u);return s.decodeGltfBuffer(new Uint8Array(f),h,u,b,r.mode,r.filter),f})})}else return null}}class lo{constructor(e){this.name=Le.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const r=t.meshes[n.mesh];for(const a of r.primitives)if(a.mode!==$e.TRIANGLES&&a.mode!==$e.TRIANGLE_STRIP&&a.mode!==$e.TRIANGLE_FAN&&a.mode!==void 0)return null;const s=n.extensions[this.name].attributes,c=[],A={};for(const a in s)c.push(this.parser.getDependency("accessor",s[a]).then(h=>(A[a]=h,A[a])));return c.length<1?null:(c.push(this.parser.createNodeMesh(e)),Promise.all(c).then(a=>{const h=a.pop(),u=h.isGroup?h.children:[h],b=a[0].count,f=[];for(const I of u){const m=new g.Matrix4,l=new g.Vector3,d=new g.Quaternion,p=new g.Vector3(1,1,1),C=new g.InstancedMesh(I.geometry,I.material,b);for(let E=0;E<b;E++)A.TRANSLATION&&l.fromBufferAttribute(A.TRANSLATION,E),A.ROTATION&&d.fromBufferAttribute(A.ROTATION,E),A.SCALE&&p.fromBufferAttribute(A.SCALE,E),C.setMatrixAt(E,m.compose(l,d,p));for(const E in A)if(E==="_COLOR_0"){const y=A[E];C.instanceColor=new g.InstancedBufferAttribute(y.array,y.itemSize,y.normalized)}else E!=="TRANSLATION"&&E!=="ROTATION"&&E!=="SCALE"&&I.geometry.setAttribute(E,A[E]);g.Object3D.prototype.copy.call(C,I),this.parser.assignFinalMaterial(C),f.push(C)}return h.isGroup?(h.clear(),h.add(...f),h):f[0]}))}}const ei="glTF",Ct=12,kn={JSON:1313821514,BIN:5130562};class uo{constructor(e){this.name=Le.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Ct),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==ei)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const r=this.header.length-Ct,o=new DataView(e,Ct);let s=0;for(;s<r;){const c=o.getUint32(s,!0);s+=4;const A=o.getUint32(s,!0);if(s+=4,A===kn.JSON){const a=new Uint8Array(e,Ct+s,c);this.content=n.decode(a)}else if(A===kn.BIN){const a=Ct+s;this.body=e.slice(a,a+c)}s+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class ho{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Le.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,o=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,c={},A={},a={};for(const h in s){const u=nn[h]||h.toLowerCase();c[u]=s[h]}for(const h in e.attributes){const u=nn[h]||h.toLowerCase();if(s[h]!==void 0){const b=n.accessors[e.attributes[h]],f=It[b.componentType];a[u]=f.name,A[u]=b.normalized===!0}}return t.getDependency("bufferView",o).then(function(h){return new Promise(function(u,b){r.decodeDracoFile(h,function(f){for(const I in f.attributes){const m=f.attributes[I],l=A[I];l!==void 0&&(m.normalized=l)}u(f)},c,a,g.LinearSRGBColorSpace,b)})})}}class fo{constructor(){this.name=Le.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class po{constructor(){this.name=Le.KHR_MESH_QUANTIZATION}}class ti extends g.Interpolant{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,o=e*r*3+r;for(let s=0;s!==r;s++)t[s]=n[o+s];return t}interpolate_(e,t,n,r){const o=this.resultBuffer,s=this.sampleValues,c=this.valueSize,A=c*2,a=c*3,h=r-t,u=(n-t)/h,b=u*u,f=b*u,I=e*a,m=I-a,l=-2*f+3*b,d=f-b,p=1-l,C=d-b+u;for(let E=0;E!==c;E++){const y=s[m+E+c],Q=s[m+E+A]*h,x=s[I+E+c],H=s[I+E]*h;o[E]=p*y+C*Q+l*x+d*H}return o}}const go=new g.Quaternion;class mo extends ti{interpolate_(e,t,n,r){const o=super.interpolate_(e,t,n,r);return go.fromArray(o).normalize().toArray(o),o}}const $e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},It={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Sn={9728:g.NearestFilter,9729:g.LinearFilter,9984:g.NearestMipmapNearestFilter,9985:g.LinearMipmapNearestFilter,9986:g.NearestMipmapLinearFilter,9987:g.LinearMipmapLinearFilter},Ln={33071:g.ClampToEdgeWrapping,33648:g.MirroredRepeatWrapping,10497:g.RepeatWrapping},Ut={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nn={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ut={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Eo={CUBICSPLINE:void 0,LINEAR:g.InterpolateLinear,STEP:g.InterpolateDiscrete},jt={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Io(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new g.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:g.FrontSide})),i.DefaultMaterial}function ht(i,e,t){for(const n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function rt(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function bo(i,e,t){let n=!1,r=!1,o=!1;for(let a=0,h=e.length;a<h;a++){const u=e[a];if(u.POSITION!==void 0&&(n=!0),u.NORMAL!==void 0&&(r=!0),u.COLOR_0!==void 0&&(o=!0),n&&r&&o)break}if(!n&&!r&&!o)return Promise.resolve(i);const s=[],c=[],A=[];for(let a=0,h=e.length;a<h;a++){const u=e[a];if(n){const b=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):i.attributes.position;s.push(b)}if(r){const b=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):i.attributes.normal;c.push(b)}if(o){const b=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):i.attributes.color;A.push(b)}}return Promise.all([Promise.all(s),Promise.all(c),Promise.all(A)]).then(function(a){const h=a[0],u=a[1],b=a[2];return n&&(i.morphAttributes.position=h),r&&(i.morphAttributes.normal=u),o&&(i.morphAttributes.color=b),i.morphTargetsRelative=!0,i})}function Co(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,r=t.length;n<r;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function yo(i){let e;const t=i.extensions&&i.extensions[Le.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Ht(t.attributes):e=i.indices+":"+Ht(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,r=i.targets.length;n<r;n++)e+=":"+Ht(i.targets[n]);return e}function Ht(i){let e="";const t=Object.keys(i).sort();for(let n=0,r=t.length;n<r;n++)e+=t[n]+":"+i[t[n]]+";";return e}function rn(i){switch(i){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function Bo(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":i.search(/\.ktx2($|\?)/i)>0||i.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const wo=new g.Matrix4;class To{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Kr,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=-1,o=!1,s=-1;if(typeof navigator<"u"){const c=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(c)===!0;const A=c.match(/Version\/(\d+)/);r=n&&A?parseInt(A[1],10):-1,o=c.indexOf("Firefox")>-1,s=o?c.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&r<17||o&&s<98?this.textureLoader=new g.TextureLoader(this.options.manager):this.textureLoader=new g.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new g.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,r=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(s){const c={scene:s[0][r.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:r.asset,parser:n,userData:{}};return ht(o,c,r),rt(c,r),Promise.all(n._invokeAll(function(A){return A.afterRoot&&A.afterRoot(c)})).then(function(){for(const A of c.scenes)A.updateMatrixWorld();e(c)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let r=0,o=t.length;r<o;r++){const s=t[r].joints;for(let c=0,A=s.length;c<A;c++)e[s[c]].isBone=!0}for(let r=0,o=e.length;r<o;r++){const s=e[r];s.mesh!==void 0&&(this._addNodeRef(this.meshCache,s.mesh),s.skin!==void 0&&(n[s.mesh].isSkinnedMesh=!0)),s.camera!==void 0&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const r=n.clone(),o=(s,c)=>{const A=this.associations.get(s);A!=null&&this.associations.set(c,A);for(const[a,h]of s.children.entries())o(h,c.children[a])};return o(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const o=e(t[r]);o&&n.push(o)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne(function(o){return o.loadNode&&o.loadNode(t)});break;case"mesh":r=this._invokeOne(function(o){return o.loadMesh&&o.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(o){return o.loadBufferView&&o.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(o){return o.loadMaterial&&o.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(o){return o.loadTexture&&o.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(o){return o.loadAnimation&&o.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(o){return o!=this&&o.getDependency&&o.getDependency(e,t)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(o,s){return n.getDependency(e,s)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Le.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(o,s){n.load(g.LoaderUtils.resolveURL(t.uri,r.path),o,void 0,function(){s(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const r=t.byteLength||0,o=t.byteOffset||0;return n.slice(o,o+r)})}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const s=Ut[r.type],c=It[r.componentType],A=r.normalized===!0,a=new c(r.count*s);return Promise.resolve(new g.BufferAttribute(a,s,A))}const o=[];return r.bufferView!==void 0?o.push(this.getDependency("bufferView",r.bufferView)):o.push(null),r.sparse!==void 0&&(o.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(o).then(function(s){const c=s[0],A=Ut[r.type],a=It[r.componentType],h=a.BYTES_PER_ELEMENT,u=h*A,b=r.byteOffset||0,f=r.bufferView!==void 0?n.bufferViews[r.bufferView].byteStride:void 0,I=r.normalized===!0;let m,l;if(f&&f!==u){const d=Math.floor(b/f),p="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+d+":"+r.count;let C=t.cache.get(p);C||(m=new a(c,d*f,r.count*f/h),C=new g.InterleavedBuffer(m,f/h),t.cache.add(p,C)),l=new g.InterleavedBufferAttribute(C,A,b%f/h,I)}else c===null?m=new a(r.count*A):m=new a(c,b,r.count*A),l=new g.BufferAttribute(m,A,I);if(r.sparse!==void 0){const d=Ut.SCALAR,p=It[r.sparse.indices.componentType],C=r.sparse.indices.byteOffset||0,E=r.sparse.values.byteOffset||0,y=new p(s[1],C,r.sparse.count*d),Q=new a(s[2],E,r.sparse.count*A);c!==null&&(l=new g.BufferAttribute(l.array.slice(),l.itemSize,l.normalized)),l.normalized=!1;for(let x=0,H=y.length;x<H;x++){const R=y[x];if(l.setX(R,Q[x*A]),A>=2&&l.setY(R,Q[x*A+1]),A>=3&&l.setZ(R,Q[x*A+2]),A>=4&&l.setW(R,Q[x*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}l.normalized=I}return l})}loadTexture(e){const t=this.json,n=this.options,o=t.textures[e].source,s=t.images[o];let c=this.textureLoader;if(s.uri){const A=n.manager.getHandler(s.uri);A!==null&&(c=A)}return this.loadTextureImage(e,o,c)}loadTextureImage(e,t,n){const r=this,o=this.json,s=o.textures[e],c=o.images[t],A=(c.uri||c.bufferView)+":"+s.sampler;if(this.textureCache[A])return this.textureCache[A];const a=this.loadImageSource(t,n).then(function(h){h.flipY=!1,h.name=s.name||c.name||"",h.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(h.name=c.uri);const b=(o.samplers||{})[s.sampler]||{};return h.magFilter=Sn[b.magFilter]||g.LinearFilter,h.minFilter=Sn[b.minFilter]||g.LinearMipmapLinearFilter,h.wrapS=Ln[b.wrapS]||g.RepeatWrapping,h.wrapT=Ln[b.wrapT]||g.RepeatWrapping,h.generateMipmaps=!h.isCompressedTexture&&h.minFilter!==g.NearestFilter&&h.minFilter!==g.LinearFilter,r.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[A]=a,a}loadImageSource(e,t){const n=this,r=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const s=r.images[e],c=self.URL||self.webkitURL;let A=s.uri||"",a=!1;if(s.bufferView!==void 0)A=n.getDependency("bufferView",s.bufferView).then(function(u){a=!0;const b=new Blob([u],{type:s.mimeType});return A=c.createObjectURL(b),A});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(A).then(function(u){return new Promise(function(b,f){let I=b;t.isImageBitmapLoader===!0&&(I=function(m){const l=new g.Texture(m);l.needsUpdate=!0,b(l)}),t.load(g.LoaderUtils.resolveURL(u,o.path),I,void 0,f)})}).then(function(u){return a===!0&&c.revokeObjectURL(A),rt(u,s),u.userData.mimeType=s.mimeType||Bo(s.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),u});return this.sourceCache[e]=h,h}assignTexture(e,t,n,r){const o=this;return this.getDependency("texture",n.index).then(function(s){if(!s)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(s=s.clone(),s.channel=n.texCoord),o.extensions[Le.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[Le.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const A=o.associations.get(s);s=o.extensions[Le.KHR_TEXTURE_TRANSFORM].extendTexture(s,c),o.associations.set(s,A)}}return r!==void 0&&(s.colorSpace=r),e[t]=s,s})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=t.attributes.tangent===void 0,o=t.attributes.color!==void 0,s=t.attributes.normal===void 0;if(e.isPoints){const c="PointsMaterial:"+n.uuid;let A=this.cache.get(c);A||(A=new g.PointsMaterial,g.Material.prototype.copy.call(A,n),A.color.copy(n.color),A.map=n.map,A.sizeAttenuation=!1,this.cache.add(c,A)),n=A}else if(e.isLine){const c="LineBasicMaterial:"+n.uuid;let A=this.cache.get(c);A||(A=new g.LineBasicMaterial,g.Material.prototype.copy.call(A,n),A.color.copy(n.color),A.map=n.map,this.cache.add(c,A)),n=A}if(r||o||s){let c="ClonedMaterial:"+n.uuid+":";r&&(c+="derivative-tangents:"),o&&(c+="vertex-colors:"),s&&(c+="flat-shading:");let A=this.cache.get(c);A||(A=n.clone(),o&&(A.vertexColors=!0),s&&(A.flatShading=!0),r&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(c,A),this.associations.set(A,this.associations.get(n))),n=A}e.material=n}getMaterialType(){return g.MeshStandardMaterial}loadMaterial(e){const t=this,n=this.json,r=this.extensions,o=n.materials[e];let s;const c={},A=o.extensions||{},a=[];if(A[Le.KHR_MATERIALS_UNLIT]){const u=r[Le.KHR_MATERIALS_UNLIT];s=u.getMaterialType(),a.push(u.extendParams(c,o,t))}else{const u=o.pbrMetallicRoughness||{};if(c.color=new g.Color(1,1,1),c.opacity=1,Array.isArray(u.baseColorFactor)){const b=u.baseColorFactor;c.color.setRGB(b[0],b[1],b[2],g.LinearSRGBColorSpace),c.opacity=b[3]}u.baseColorTexture!==void 0&&a.push(t.assignTexture(c,"map",u.baseColorTexture,g.SRGBColorSpace)),c.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,c.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(a.push(t.assignTexture(c,"metalnessMap",u.metallicRoughnessTexture)),a.push(t.assignTexture(c,"roughnessMap",u.metallicRoughnessTexture))),s=this._invokeOne(function(b){return b.getMaterialType&&b.getMaterialType(e)}),a.push(Promise.all(this._invokeAll(function(b){return b.extendMaterialParams&&b.extendMaterialParams(e,c)})))}o.doubleSided===!0&&(c.side=g.DoubleSide);const h=o.alphaMode||jt.OPAQUE;if(h===jt.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,h===jt.MASK&&(c.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&s!==g.MeshBasicMaterial&&(a.push(t.assignTexture(c,"normalMap",o.normalTexture)),c.normalScale=new g.Vector2(1,1),o.normalTexture.scale!==void 0)){const u=o.normalTexture.scale;c.normalScale.set(u,u)}if(o.occlusionTexture!==void 0&&s!==g.MeshBasicMaterial&&(a.push(t.assignTexture(c,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&s!==g.MeshBasicMaterial){const u=o.emissiveFactor;c.emissive=new g.Color().setRGB(u[0],u[1],u[2],g.LinearSRGBColorSpace)}return o.emissiveTexture!==void 0&&s!==g.MeshBasicMaterial&&a.push(t.assignTexture(c,"emissiveMap",o.emissiveTexture,g.SRGBColorSpace)),Promise.all(a).then(function(){const u=new s(c);return o.name&&(u.name=o.name),rt(u,o),t.associations.set(u,{materials:e}),o.extensions&&ht(r,u,o),u})}createUniqueName(e){const t=g.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,r=this.primitiveCache;function o(c){return n[Le.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(A){return _n(A,c,t)})}const s=[];for(let c=0,A=e.length;c<A;c++){const a=e[c],h=yo(a),u=r[h];if(u)s.push(u.promise);else{let b;a.extensions&&a.extensions[Le.KHR_DRACO_MESH_COMPRESSION]?b=o(a):b=_n(new g.BufferGeometry,a,t),r[h]={primitive:a,promise:b},s.push(b)}}return Promise.all(s)}loadMesh(e){const t=this,n=this.json,r=this.extensions,o=n.meshes[e],s=o.primitives,c=[];for(let A=0,a=s.length;A<a;A++){const h=s[A].material===void 0?Io(this.cache):this.getDependency("material",s[A].material);c.push(h)}return c.push(t.loadGeometries(s)),Promise.all(c).then(function(A){const a=A.slice(0,A.length-1),h=A[A.length-1],u=[];for(let f=0,I=h.length;f<I;f++){const m=h[f],l=s[f];let d;const p=a[f];if(l.mode===$e.TRIANGLES||l.mode===$e.TRIANGLE_STRIP||l.mode===$e.TRIANGLE_FAN||l.mode===void 0)d=o.isSkinnedMesh===!0?new g.SkinnedMesh(m,p):new g.Mesh(m,p),d.isSkinnedMesh===!0&&d.normalizeSkinWeights(),l.mode===$e.TRIANGLE_STRIP?d.geometry=Qn(d.geometry,g.TriangleStripDrawMode):l.mode===$e.TRIANGLE_FAN&&(d.geometry=Qn(d.geometry,g.TriangleFanDrawMode));else if(l.mode===$e.LINES)d=new g.LineSegments(m,p);else if(l.mode===$e.LINE_STRIP)d=new g.Line(m,p);else if(l.mode===$e.LINE_LOOP)d=new g.LineLoop(m,p);else if(l.mode===$e.POINTS)d=new g.Points(m,p);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+l.mode);Object.keys(d.geometry.morphAttributes).length>0&&Co(d,o),d.name=t.createUniqueName(o.name||"mesh_"+e),rt(d,o),l.extensions&&ht(r,d,l),t.assignFinalMaterial(d),u.push(d)}for(let f=0,I=u.length;f<I;f++)t.associations.set(u[f],{meshes:e,primitives:f});if(u.length===1)return o.extensions&&ht(r,u[0],o),u[0];const b=new g.Group;o.extensions&&ht(r,b,o),t.associations.set(b,{meshes:e});for(let f=0,I=u.length;f<I;f++)b.add(u[f]);return b})}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new g.PerspectiveCamera(g.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type==="orthographic"&&(t=new g.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),rt(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let r=0,o=t.joints.length;r<o;r++)n.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(r){const o=r.pop(),s=r,c=[],A=[];for(let a=0,h=s.length;a<h;a++){const u=s[a];if(u){c.push(u);const b=new g.Matrix4;o!==null&&b.fromArray(o.array,a*16),A.push(b)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new g.Skeleton(c,A)})}loadAnimation(e){const t=this.json,n=this,r=t.animations[e],o=r.name?r.name:"animation_"+e,s=[],c=[],A=[],a=[],h=[];for(let u=0,b=r.channels.length;u<b;u++){const f=r.channels[u],I=r.samplers[f.sampler],m=f.target,l=m.node,d=r.parameters!==void 0?r.parameters[I.input]:I.input,p=r.parameters!==void 0?r.parameters[I.output]:I.output;m.node!==void 0&&(s.push(this.getDependency("node",l)),c.push(this.getDependency("accessor",d)),A.push(this.getDependency("accessor",p)),a.push(I),h.push(m))}return Promise.all([Promise.all(s),Promise.all(c),Promise.all(A),Promise.all(a),Promise.all(h)]).then(function(u){const b=u[0],f=u[1],I=u[2],m=u[3],l=u[4],d=[];for(let C=0,E=b.length;C<E;C++){const y=b[C],Q=f[C],x=I[C],H=m[C],R=l[C];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const M=n._createAnimationTracks(y,Q,x,H,R);if(M)for(let N=0;N<M.length;N++)d.push(M[N])}const p=new g.AnimationClip(o,void 0,d);return rt(p,r),p})}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency("mesh",r.mesh).then(function(o){const s=n._getNodeRef(n.meshCache,r.mesh,o);return r.weights!==void 0&&s.traverse(function(c){if(c.isMesh)for(let A=0,a=r.weights.length;A<a;A++)c.morphTargetInfluences[A]=r.weights[A]}),s})}loadNode(e){const t=this.json,n=this,r=t.nodes[e],o=n._loadNodeShallow(e),s=[],c=r.children||[];for(let a=0,h=c.length;a<h;a++)s.push(n.getDependency("node",c[a]));const A=r.skin===void 0?Promise.resolve(null):n.getDependency("skin",r.skin);return Promise.all([o,Promise.all(s),A]).then(function(a){const h=a[0],u=a[1],b=a[2];b!==null&&h.traverse(function(f){f.isSkinnedMesh&&f.bind(b,wo)});for(let f=0,I=u.length;f<I;f++)h.add(u[f]);return h})}_loadNodeShallow(e){const t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const o=t.nodes[e],s=o.name?r.createUniqueName(o.name):"",c=[],A=r._invokeOne(function(a){return a.createNodeMesh&&a.createNodeMesh(e)});return A&&c.push(A),o.camera!==void 0&&c.push(r.getDependency("camera",o.camera).then(function(a){return r._getNodeRef(r.cameraCache,o.camera,a)})),r._invokeAll(function(a){return a.createNodeAttachment&&a.createNodeAttachment(e)}).forEach(function(a){c.push(a)}),this.nodeCache[e]=Promise.all(c).then(function(a){let h;if(o.isBone===!0?h=new g.Bone:a.length>1?h=new g.Group:a.length===1?h=a[0]:h=new g.Object3D,h!==a[0])for(let u=0,b=a.length;u<b;u++)h.add(a[u]);if(o.name&&(h.userData.name=o.name,h.name=s),rt(h,o),o.extensions&&ht(n,h,o),o.matrix!==void 0){const u=new g.Matrix4;u.fromArray(o.matrix),h.applyMatrix4(u)}else o.translation!==void 0&&h.position.fromArray(o.translation),o.rotation!==void 0&&h.quaternion.fromArray(o.rotation),o.scale!==void 0&&h.scale.fromArray(o.scale);if(!r.associations.has(h))r.associations.set(h,{});else if(o.mesh!==void 0&&r.meshCache.refs[o.mesh]>1){const u=r.associations.get(h);r.associations.set(h,{...u})}return r.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],r=this,o=new g.Group;n.name&&(o.name=r.createUniqueName(n.name)),rt(o,n),n.extensions&&ht(t,o,n);const s=n.nodes||[],c=[];for(let A=0,a=s.length;A<a;A++)c.push(r.getDependency("node",s[A]));return Promise.all(c).then(function(A){for(let h=0,u=A.length;h<u;h++)o.add(A[h]);const a=h=>{const u=new Map;for(const[b,f]of r.associations)(b instanceof g.Material||b instanceof g.Texture)&&u.set(b,f);return h.traverse(b=>{const f=r.associations.get(b);f!=null&&u.set(b,f)}),u};return r.associations=a(o),o})}_createAnimationTracks(e,t,n,r,o){const s=[],c=e.name?e.name:e.uuid,A=[];ut[o.path]===ut.weights?e.traverse(function(b){b.morphTargetInfluences&&A.push(b.name?b.name:b.uuid)}):A.push(c);let a;switch(ut[o.path]){case ut.weights:a=g.NumberKeyframeTrack;break;case ut.rotation:a=g.QuaternionKeyframeTrack;break;case ut.translation:case ut.scale:a=g.VectorKeyframeTrack;break;default:n.itemSize===1?a=g.NumberKeyframeTrack:a=g.VectorKeyframeTrack;break}const h=r.interpolation!==void 0?Eo[r.interpolation]:g.InterpolateLinear,u=this._getArrayFromAccessor(n);for(let b=0,f=A.length;b<f;b++){const I=new a(A[b]+"."+ut[o.path],t.array,u,h);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(I),s.push(I)}return s}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=rn(t.constructor),r=new Float32Array(t.length);for(let o=0,s=t.length;o<s;o++)r[o]=t[o]*n;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const r=this instanceof g.QuaternionKeyframeTrack?mo:ti;return new r(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Ro(i,e,t){const n=e.attributes,r=new g.Box3;if(n.POSITION!==void 0){const c=t.json.accessors[n.POSITION],A=c.min,a=c.max;if(A!==void 0&&a!==void 0){if(r.set(new g.Vector3(A[0],A[1],A[2]),new g.Vector3(a[0],a[1],a[2])),c.normalized){const h=rn(It[c.componentType]);r.min.multiplyScalar(h),r.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const o=e.targets;if(o!==void 0){const c=new g.Vector3,A=new g.Vector3;for(let a=0,h=o.length;a<h;a++){const u=o[a];if(u.POSITION!==void 0){const b=t.json.accessors[u.POSITION],f=b.min,I=b.max;if(f!==void 0&&I!==void 0){if(A.setX(Math.max(Math.abs(f[0]),Math.abs(I[0]))),A.setY(Math.max(Math.abs(f[1]),Math.abs(I[1]))),A.setZ(Math.max(Math.abs(f[2]),Math.abs(I[2]))),b.normalized){const m=rn(It[b.componentType]);A.multiplyScalar(m)}c.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(c)}i.boundingBox=r;const s=new g.Sphere;r.getCenter(s.center),s.radius=r.min.distanceTo(r.max)/2,i.boundingSphere=s}function _n(i,e,t){const n=e.attributes,r=[];function o(s,c){return t.getDependency("accessor",s).then(function(A){i.setAttribute(c,A)})}for(const s in n){const c=nn[s]||s.toLowerCase();c in i.attributes||r.push(o(n[s],c))}if(e.indices!==void 0&&!i.index){const s=t.getDependency("accessor",e.indices).then(function(c){i.setIndex(c)});r.push(s)}return g.ColorManagement.workingColorSpace!==g.LinearSRGBColorSpace&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${g.ColorManagement.workingColorSpace}" not supported.`),rt(i,e),Ro(i,e,t),Promise.all(r).then(function(){return e.targets!==void 0?bo(i,e.targets,t):i})}const qt=new WeakMap;class vo extends g.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){const o=new g.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,s=>{this.parse(s,t,r)},n,r)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,g.SRGBColorSpace,n).catch(n)}decodeDracoFile(e,t,n,r,o=g.LinearSRGBColorSpace,s=()=>{}){const c={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:o};return this.decodeGeometry(e,c).then(t).catch(s)}decodeGeometry(e,t){const n=JSON.stringify(t);if(qt.has(e)){const A=qt.get(e);if(A.key===n)return A.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const o=this.workerNextTaskID++,s=e.byteLength,c=this._getWorker(o,s).then(A=>(r=A,new Promise((a,h)=>{r._callbacks[o]={resolve:a,reject:h},r.postMessage({type:"decode",id:o,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return c.catch(()=>!0).then(()=>{r&&o&&this._releaseTask(r,o)}),qt.set(e,{key:n,promise:c}),c}_createGeometry(e){const t=new g.BufferGeometry;e.index&&t.setIndex(new g.BufferAttribute(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const{name:r,array:o,itemSize:s,stride:c,vertexColorSpace:A}=e.attributes[n];let a;if(s===c)a=new g.BufferAttribute(o,s);else{const h=new g.InterleavedBuffer(o,c);a=new g.InterleavedBufferAttribute(h,s,0)}r==="color"&&(this._assignVertexColorSpace(a,A),a.normalized=!(o instanceof Float32Array)),t.setAttribute(r,a)}return t}_assignVertexColorSpace(e,t){if(t!==g.SRGBColorSpace)return;const n=new g.Color;for(let r=0,o=e.count;r<o;r++)n.fromBufferAttribute(e,r),g.ColorManagement.colorSpaceToWorking(n,g.SRGBColorSpace),e.setXYZ(r,n.r,n.g,n.b)}_loadLibrary(e,t){const n=new g.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((r,o)=>{n.load(e,r,void 0,o)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{const r=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const o=Qo.toString(),s=["/* draco decoder */",r,"","/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(`
|
|
2
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const r=new Worker(this.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(o){const s=o.data;switch(s.type){case"decode":r._callbacks[s.id].resolve(s);break;case"error":r._callbacks[s.id].reject(s);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,o){return r._taskLoad>o._taskLoad?-1:1});const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function Qo(){let i,e;onmessage=function(s){const c=s.data;switch(c.type){case"init":i=c.decoderConfig,e=new Promise(function(h){i.onModuleLoaded=function(u){h({draco:u})},DracoDecoderModule(i)});break;case"decode":const A=c.buffer,a=c.taskConfig;e.then(h=>{const u=h.draco,b=new u.Decoder;try{const f=t(u,b,new Int8Array(A),a),I=f.attributes.map(m=>m.array.buffer);f.index&&I.push(f.index.array.buffer),self.postMessage({type:"decode",id:c.id,geometry:f},I)}catch(f){console.error(f),self.postMessage({type:"error",id:c.id,error:f.message})}finally{u.destroy(b)}});break}};function t(s,c,A,a){const h=a.attributeIDs,u=a.attributeTypes;let b,f;const I=c.GetEncodedGeometryType(A);if(I===s.TRIANGULAR_MESH)b=new s.Mesh,f=c.DecodeArrayToMesh(A,A.byteLength,b);else if(I===s.POINT_CLOUD)b=new s.PointCloud,f=c.DecodeArrayToPointCloud(A,A.byteLength,b);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||b.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());const m={index:null,attributes:[]};for(const l in h){const d=self[u[l]];let p,C;if(a.useUniqueIDs)C=h[l],p=c.GetAttributeByUniqueId(b,C);else{if(C=c.GetAttributeId(b,s[h[l]]),C===-1)continue;p=c.GetAttribute(b,C)}const E=r(s,c,b,l,d,p);l==="color"&&(E.vertexColorSpace=a.vertexColorSpace),m.attributes.push(E)}return I===s.TRIANGULAR_MESH&&(m.index=n(s,c,b)),s.destroy(b),m}function n(s,c,A){const h=A.num_faces()*3,u=h*4,b=s._malloc(u);c.GetTrianglesUInt32Array(A,u,b);const f=new Uint32Array(s.HEAPF32.buffer,b,h).slice();return s._free(b),{array:f,itemSize:1}}function r(s,c,A,a,h,u){const b=A.num_points(),f=u.num_components(),I=o(s,h),m=f*h.BYTES_PER_ELEMENT,l=Math.ceil(m/4)*4,d=l/h.BYTES_PER_ELEMENT,p=b*m,C=b*l,E=s._malloc(p);c.GetAttributeDataArrayForAllPoints(A,u,I,p,E);const y=new h(s.HEAPF32.buffer,E,p/h.BYTES_PER_ELEMENT);let Q;if(m===l)Q=y.slice();else{Q=new h(C/h.BYTES_PER_ELEMENT);let x=0;for(let H=0,R=y.length;H<R;H++){for(let M=0;M<f;M++)Q[x+M]=y[H*f+M];x+=d}}return s._free(E),{name:a,count:b,itemSize:f,array:Q,stride:d}}function o(s,c){switch(c){case Float32Array:return s.DT_FLOAT32;case Int8Array:return s.DT_INT8;case Int16Array:return s.DT_INT16;case Int32Array:return s.DT_INT32;case Uint8Array:return s.DT_UINT8;case Uint16Array:return s.DT_UINT16;case Uint32Array:return s.DT_UINT32}}}class ko{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:r,msg:o,transfer:s}=this.queue.shift();this.workersResolve[e]=r,this.workers[e].postMessage(o,s)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const r=this._getIdleWorker();r!==-1?(this._initWorker(r),this.workerStatus|=1<<r,this.workersResolve[r]=n,this.workers[r].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const So=0,xn=2,Lo=1,Nn=2,_o=0,xo=1,No=10,Do=0,ni=9,ii=15,ri=16,oi=22,si=37,ai=43,Ai=76,ci=83,li=97,ui=100,hi=103,di=109,fi=122,pi=123,gi=131,mi=132,Ei=133,Ii=134,bi=137,Ci=138,yi=139,Bi=140,wi=141,Ti=142,Ri=145,vi=146,Qi=148,ki=152,on=153,Fo=154,sn=155,Oo=156,Si=157,Li=158,_i=165,xi=166,Ni=1000054e3,Di=1000054001,Fi=1000054004,Oi=1000054005,hn=1000066e3,Mi=1000066004;class yt{constructor(e,t,n,r){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=r,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let r=0;for(;this._dataView.getUint8(this._offset)!==t&&r<e;)r++,this._offset++;return r<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,r)}}const Je=[171,75,84,88,32,50,48,187,13,10,26,10];function Dn(i){return new TextDecoder().decode(i)}function Mo(i){const e=new Uint8Array(i.buffer,i.byteOffset,Je.length);if(e[0]!==Je[0]||e[1]!==Je[1]||e[2]!==Je[2]||e[3]!==Je[3]||e[4]!==Je[4]||e[5]!==Je[5]||e[6]!==Je[6]||e[7]!==Je[7]||e[8]!==Je[8]||e[9]!==Je[9]||e[10]!==Je[10]||e[11]!==Je[11])throw new Error("Missing KTX 2.0 identifier.");const t={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},n=17*Uint32Array.BYTES_PER_ELEMENT,r=new yt(i,Je.length,n,!0);t.vkFormat=r._nextUint32(),t.typeSize=r._nextUint32(),t.pixelWidth=r._nextUint32(),t.pixelHeight=r._nextUint32(),t.pixelDepth=r._nextUint32(),t.layerCount=r._nextUint32(),t.faceCount=r._nextUint32(),t.levelCount=r._nextUint32(),t.supercompressionScheme=r._nextUint32();const o=r._nextUint32(),s=r._nextUint32(),c=r._nextUint32(),A=r._nextUint32(),a=r._nextUint64(),h=r._nextUint64(),u=3*Math.max(t.levelCount,1)*8,b=new yt(i,Je.length+n,u,!0);for(let oe=0,ae=Math.max(t.levelCount,1);oe<ae;oe++)t.levels.push({levelData:new Uint8Array(i.buffer,i.byteOffset+b._nextUint64(),b._nextUint64()),uncompressedByteLength:b._nextUint64()});const f=new yt(i,o,s,!0);f._skip(4);const I=f._nextUint16(),m=f._nextUint16(),l=f._nextUint16(),d=f._nextUint16(),p={vendorId:I,descriptorType:m,versionNumber:l,colorModel:f._nextUint8(),colorPrimaries:f._nextUint8(),transferFunction:f._nextUint8(),flags:f._nextUint8(),texelBlockDimension:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],bytesPlane:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],samples:[]},C=(d/4-6)/4;for(let oe=0;oe<C;oe++){const ae={bitOffset:f._nextUint16(),bitLength:f._nextUint8(),channelType:f._nextUint8(),samplePosition:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&ae.channelType?(ae.sampleLower=f._nextInt32(),ae.sampleUpper=f._nextInt32()):(ae.sampleLower=f._nextUint32(),ae.sampleUpper=f._nextUint32()),p.samples[oe]=ae}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(p);const E=new yt(i,c,A,!0);for(;E._offset<A;){const oe=E._nextUint32(),ae=E._scan(oe),Ae=Dn(ae);if(t.keyValue[Ae]=E._nextUint8Array(oe-ae.byteLength-1),Ae.match(/^ktx/i)){const Ce=Dn(t.keyValue[Ae]);t.keyValue[Ae]=Ce.substring(0,Ce.lastIndexOf("\0"))}E._skip(oe%4?4-oe%4:0)}if(h<=0)return t;const y=new yt(i,a,h,!0),Q=y._nextUint16(),x=y._nextUint16(),H=y._nextUint32(),R=y._nextUint32(),M=y._nextUint32(),N=y._nextUint32(),v=[];for(let oe=0,ae=Math.max(t.levelCount,1);oe<ae;oe++)v.push({imageFlags:y._nextUint32(),rgbSliceByteOffset:y._nextUint32(),rgbSliceByteLength:y._nextUint32(),alphaSliceByteOffset:y._nextUint32(),alphaSliceByteLength:y._nextUint32()});const S=a+y._offset,_=S+H,V=_+R,J=V+M,q=new Uint8Array(i.buffer,i.byteOffset+S,H),$=new Uint8Array(i.buffer,i.byteOffset+_,R),ne=new Uint8Array(i.buffer,i.byteOffset+V,M),ue=new Uint8Array(i.buffer,i.byteOffset+J,N);return t.globalData={endpointCount:Q,selectorCount:x,imageDescs:v,endpointsData:q,selectorsData:$,tablesData:ne,extendedData:ue},t}let zt,st,an;const Kt={env:{emscripten_notify_memory_growth:function(i){an=new Uint8Array(st.exports.memory.buffer)}}};class Po{init(){return zt||(zt=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Fn).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Kt)).then(this._init):WebAssembly.instantiate(Buffer.from(Fn,"base64"),Kt).then(this._init),zt)}_init(e){st=e.instance,Kt.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!st)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,r=st.exports.malloc(n);an.set(e,r),t=t||Number(st.exports.ZSTD_findDecompressedSize(r,n));const o=st.exports.malloc(t),s=st.exports.ZSTD_decompress(o,t,r,n),c=an.slice(o,o+s);return st.exports.free(r),st.exports.free(o),c}}const Fn="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZW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ACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiA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DQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgAC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AKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCA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QQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYC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AEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3Ay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AAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",Go="display-p3",Uo="display-p3-linear";({...g.ColorManagement.spaces[g.SRGBColorSpace]});const Vt=new WeakMap;let Wt=0,Yt;class et extends g.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new ko,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return console.warn('KTX2Loader: "detectSupportAsync()" has been deprecated. Use "detectSupport()" and "await renderer.init();" when creating the renderer.'),await e.init(),this.detectSupport(e)}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-s3tc"),bptcSupported:e.hasFeature("texture-compression-bc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:(this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},typeof navigator<"u"&&navigator.platform.indexOf("Linux")>=0&&navigator.userAgent.indexOf("Firefox")>=0&&this.workerConfig.astcSupported&&this.workerConfig.etc2Supported&&this.workerConfig.bptcSupported&&this.workerConfig.dxtSupported&&(this.workerConfig.astcSupported=!1,this.workerConfig.etc2Supported=!1)),this}init(){if(!this.transcoderPending){const e=new g.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new g.FileLoader(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const r=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,r]).then(([o,s])=>{const c=et.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(et.EngineFormat),"let _EngineType = "+JSON.stringify(et.EngineType),"let _TranscoderFormat = "+JSON.stringify(et.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(et.BasisFormat),"/* basis_transcoder.js */",o,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
|
|
3
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=s,this.workerPool.setWorkerCreator(()=>{const a=new Worker(this.workerSourceURL),h=this.transcoderBinary.slice(0);return a.postMessage({type:"init",config:this.workerConfig,transcoderBinary:h},[h]),a})}),Wt>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Wt++}return this.transcoderPending}load(e,t,n,r){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const o=new g.FileLoader(this.manager);o.setPath(this.path),o.setCrossOrigin(this.crossOrigin),o.setWithCredentials(this.withCredentials),o.setRequestHeader(this.requestHeader),o.setResponseType("arraybuffer"),o.load(e,s=>{this.parse(s,t,r)},n,r)}parse(e,t,n){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Vt.has(e))return Vt.get(e).promise.then(t).catch(n);this._createTexture(e).then(r=>t?t(r):null).catch(n)}_createTextureFrom(e,t){const{type:n,error:r,data:{faces:o,width:s,height:c,format:A,type:a,dfdFlags:h}}=e;if(n==="error")return Promise.reject(r);let u;if(t.faceCount===6)u=new g.CompressedCubeTexture(o,A,a);else{const b=o[0].mipmaps;u=t.layerCount>1?new g.CompressedArrayTexture(b,s,c,t.layerCount,A,a):new g.CompressedTexture(b,s,c,A,a)}return u.minFilter=o[0].mipmaps.length===1?g.LinearFilter:g.LinearMipmapLinearFilter,u.magFilter=g.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=Pi(t),u.premultiplyAlpha=!!(h&Lo),u}async _createTexture(e,t={}){const n=Mo(new Uint8Array(e)),r=n.vkFormat===hn&&n.dataFormatDescriptor[0].colorModel===167;if(!(n.vkFormat===Do||r&&!this.workerConfig.astcHDRSupported))return Ho(n);const s=t,c=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:s},[e])).then(A=>this._createTextureFrom(A.data,n));return Vt.set(e,{promise:c}),c}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Wt--}}et.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2};et.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25};et.EngineFormat={RGBAFormat:g.RGBAFormat,RGBA_ASTC_4x4_Format:g.RGBA_ASTC_4x4_Format,RGB_BPTC_UNSIGNED_Format:g.RGB_BPTC_UNSIGNED_Format,RGBA_BPTC_Format:g.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:g.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:g.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:g.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:g.RGB_ETC1_Format,RGB_ETC2_Format:g.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:g.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:g.RGBA_S3TC_DXT1_Format};et.EngineType={UnsignedByteType:g.UnsignedByteType,HalfFloatType:g.HalfFloatType,FloatType:g.FloatType};et.BasisWorker=function(){let i,e,t;const n=_EngineFormat,r=_EngineType,o=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",function(I){const m=I.data;switch(m.type){case"init":i=m.config,c(m.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:l,buffers:d,width:p,height:C,hasAlpha:E,format:y,type:Q,dfdFlags:x}=A(m.buffer);self.postMessage({type:"transcode",id:m.id,data:{faces:l,width:p,height:C,hasAlpha:E,format:y,type:Q,dfdFlags:x}},d)}catch(l){console.error(l),self.postMessage({type:"error",id:m.id,error:l.message})}});break}});function c(I){e=new Promise(m=>{t={wasmBinary:I,onRuntimeInitialized:m},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(I){const m=new t.KTX2File(new Uint8Array(I));function l(){m.close(),m.delete()}if(!m.isValid())throw l(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let d;if(m.isUASTC())d=s.UASTC;else if(m.isETC1S())d=s.ETC1S;else if(m.isHDR())d=s.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const p=m.getWidth(),C=m.getHeight(),E=m.getLayers()||1,y=m.getLevels(),Q=m.getFaces(),x=m.getHasAlpha(),H=m.getDFDFlags(),{transcoderFormat:R,engineFormat:M,engineType:N}=u(d,p,C,x);if(!p||!C||!y)throw l(),new Error("THREE.KTX2Loader: Invalid texture");if(!m.startTranscoding())throw l(),new Error("THREE.KTX2Loader: .startTranscoding failed");const v=[],S=[];for(let _=0;_<Q;_++){const V=[];for(let J=0;J<y;J++){const q=[];let $,ne;for(let oe=0;oe<E;oe++){const ae=m.getImageLevelInfo(J,oe,_);_===0&&J===0&&oe===0&&(ae.origWidth%4!==0||ae.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),y>1?($=ae.origWidth,ne=ae.origHeight):($=ae.width,ne=ae.height);let Ae=new Uint8Array(m.getImageTranscodedSizeInBytes(J,oe,0,R));const Ce=m.transcodeImage(Ae,J,oe,_,R,0,-1,-1);if(N===r.HalfFloatType&&(Ae=new Uint16Array(Ae.buffer,Ae.byteOffset,Ae.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!Ce)throw l(),new Error("THREE.KTX2Loader: .transcodeImage failed.");q.push(Ae)}const ue=f(q);V.push({data:ue,width:$,height:ne}),S.push(ue.buffer)}v.push({mipmaps:V,width:p,height:C,format:M,type:N})}return l(),{faces:v,buffers:S,width:p,height:C,hasAlpha:x,dfdFlags:H,format:M,type:N}}const a=[{if:"astcSupported",basisFormat:[s.UASTC],transcoderFormat:[o.ASTC_4x4,o.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],engineType:[r.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.BC7_M5,o.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],engineType:[r.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.BC1,o.BC3],engineFormat:[n.RGBA_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],engineType:[r.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.ETC1,o.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],engineType:[r.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.ETC1],engineFormat:[n.RGB_ETC1_Format],engineType:[r.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.PVRTC1_4_RGB,o.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],engineType:[r.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[s.UASTC_HDR],transcoderFormat:[o.BC6H],engineFormat:[n.RGB_BPTC_UNSIGNED_Format],engineType:[r.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[s.ETC1S,s.UASTC],transcoderFormat:[o.RGBA32,o.RGBA32],engineFormat:[n.RGBAFormat,n.RGBAFormat],engineType:[r.UnsignedByteType,r.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[s.UASTC_HDR],transcoderFormat:[o.RGBA_HALF],engineFormat:[n.RGBAFormat],engineType:[r.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],h={[s.ETC1S]:a.filter(I=>I.basisFormat.includes(s.ETC1S)).sort((I,m)=>I.priorityETC1S-m.priorityETC1S),[s.UASTC]:a.filter(I=>I.basisFormat.includes(s.UASTC)).sort((I,m)=>I.priorityUASTC-m.priorityUASTC),[s.UASTC_HDR]:a.filter(I=>I.basisFormat.includes(s.UASTC_HDR)).sort((I,m)=>I.priorityHDR-m.priorityHDR)};function u(I,m,l,d){const p=h[I];for(let C=0;C<p.length;C++){const E=p[C];if(E.if&&!i[E.if]||!E.basisFormat.includes(I)||d&&E.transcoderFormat.length<2||E.needsPowerOfTwo&&!(b(m)&&b(l)))continue;const y=E.transcoderFormat[d?1:0],Q=E.engineFormat[d?1:0],x=E.engineType[0];return{transcoderFormat:y,engineFormat:Q,engineType:x}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function b(I){return I<=2?!0:(I&I-1)===0&&I!==0}function f(I){if(I.length===1)return I[0];let m=0;for(let p=0;p<I.length;p++){const C=I[p];m+=C.byteLength}const l=new Uint8Array(m);let d=0;for(let p=0;p<I.length;p++){const C=I[p];l.set(C,d),d+=C.byteLength}return l}};const jo=new Set([g.RGBAFormat,g.RGBFormat,g.RGFormat,g.RedFormat]),Jt={[di]:g.RGBAFormat,[hi]:g.RGFormat,[ui]:g.RedFormat,[li]:g.RGBAFormat,[ci]:g.RGFormat,[Ai]:g.RedFormat,[ai]:g.RGBAFormat,[si]:g.RGBAFormat,[oi]:g.RGFormat,[ri]:g.RGFormat,[ii]:g.RedFormat,[ni]:g.RedFormat,[pi]:g.RGBFormat,[fi]:g.RGBFormat,[ki]:g.RGBA_ETC2_EAC_Format,[Qi]:g.RGB_ETC2_Format,[on]:g.R11_EAC_Format,[Fo]:g.SIGNED_R11_EAC_Format,[sn]:g.RG11_EAC_Format,[Oo]:g.SIGNED_RG11_EAC_Format,[hn]:g.RGBA_ASTC_4x4_Format,[Li]:g.RGBA_ASTC_4x4_Format,[Si]:g.RGBA_ASTC_4x4_Format,[Mi]:g.RGBA_ASTC_6x6_Format,[xi]:g.RGBA_ASTC_6x6_Format,[_i]:g.RGBA_ASTC_6x6_Format,[Ii]:g.RGBA_S3TC_DXT1_Format,[Ei]:g.RGBA_S3TC_DXT1_Format,[mi]:g.RGB_S3TC_DXT1_Format,[gi]:g.RGB_S3TC_DXT1_Format,[Ci]:g.RGBA_S3TC_DXT3_Format,[bi]:g.RGBA_S3TC_DXT3_Format,[Bi]:g.SIGNED_RED_RGTC1_Format,[yi]:g.RED_RGTC1_Format,[Ti]:g.SIGNED_RED_GREEN_RGTC2_Format,[wi]:g.RED_GREEN_RGTC2_Format,[vi]:g.RGBA_BPTC_Format,[Ri]:g.RGBA_BPTC_Format,[Oi]:g.RGBA_PVRTC_4BPPV1_Format,[Di]:g.RGBA_PVRTC_4BPPV1_Format,[Fi]:g.RGBA_PVRTC_2BPPV1_Format,[Ni]:g.RGBA_PVRTC_2BPPV1_Format},mt={[di]:g.FloatType,[hi]:g.FloatType,[ui]:g.FloatType,[li]:g.HalfFloatType,[ci]:g.HalfFloatType,[Ai]:g.HalfFloatType,[ai]:g.UnsignedByteType,[si]:g.UnsignedByteType,[oi]:g.UnsignedByteType,[ri]:g.UnsignedByteType,[ii]:g.UnsignedByteType,[ni]:g.UnsignedByteType,[pi]:g.UnsignedInt5999Type,[fi]:g.UnsignedInt101111Type,[ki]:g.UnsignedByteType,[Qi]:g.UnsignedByteType,[on]:g.UnsignedByteType,[on]:g.UnsignedByteType,[sn]:g.UnsignedByteType,[sn]:g.UnsignedByteType,[hn]:g.HalfFloatType,[Li]:g.UnsignedByteType,[Si]:g.UnsignedByteType,[Mi]:g.HalfFloatType,[xi]:g.UnsignedByteType,[_i]:g.UnsignedByteType,[Ii]:g.UnsignedByteType,[Ei]:g.UnsignedByteType,[mi]:g.UnsignedByteType,[gi]:g.UnsignedByteType,[Ci]:g.UnsignedByteType,[bi]:g.UnsignedByteType,[Bi]:g.UnsignedByteType,[yi]:g.UnsignedByteType,[Ti]:g.UnsignedByteType,[wi]:g.UnsignedByteType,[vi]:g.UnsignedByteType,[Ri]:g.UnsignedByteType,[Oi]:g.UnsignedByteType,[Di]:g.UnsignedByteType,[Fi]:g.UnsignedByteType,[Ni]:g.UnsignedByteType};async function Ho(i){const{vkFormat:e}=i;if(Jt[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat: "+e);mt[e]===void 0&&console.warn('THREE.KTX2Loader: Missing ".type" for vkFormat: '+e);let t;i.supercompressionScheme===xn&&(Yt||(Yt=new Promise(async s=>{const c=new Po;await c.init(),s(c)})),t=await Yt);const n=[];for(let s=0;s<i.levels.length;s++){const c=Math.max(1,i.pixelWidth>>s),A=Math.max(1,i.pixelHeight>>s),a=i.pixelDepth?Math.max(1,i.pixelDepth>>s):0,h=i.levels[s];let u;if(i.supercompressionScheme===So)u=h.levelData;else if(i.supercompressionScheme===xn)u=t.decode(h.levelData,h.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let b;mt[e]===g.FloatType?b=new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):mt[e]===g.HalfFloatType?b=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):mt[e]===g.UnsignedInt5999Type||mt[e]===g.UnsignedInt101111Type?b=new Uint32Array(u.buffer,u.byteOffset,u.byteLength/Uint32Array.BYTES_PER_ELEMENT):b=u,n.push({data:b,width:c,height:A,depth:a})}const r=i.levelCount===0||n.length>1;let o;if(jo.has(Jt[e]))o=i.pixelDepth===0?new g.DataTexture(n[0].data,i.pixelWidth,i.pixelHeight):new g.Data3DTexture(n[0].data,i.pixelWidth,i.pixelHeight,i.pixelDepth),o.minFilter=r?g.NearestMipmapNearestFilter:g.NearestFilter,o.magFilter=g.NearestFilter,o.generateMipmaps=i.levelCount===0;else{if(i.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");o=new g.CompressedTexture(n,i.pixelWidth,i.pixelHeight),o.minFilter=r?g.LinearMipmapLinearFilter:g.LinearFilter,o.magFilter=g.LinearFilter}return o.mipmaps=n,o.type=mt[e],o.format=Jt[e],o.colorSpace=Pi(i),o.needsUpdate=!0,Promise.resolve(o)}function Pi(i){const e=i.dataFormatDescriptor[0];return e.colorPrimaries===xo?e.transferFunction===Nn?g.SRGBColorSpace:g.LinearSRGBColorSpace:e.colorPrimaries===No?e.transferFunction===Nn?Go:Uo:(e.colorPrimaries===_o||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),g.NoColorSpace)}class dn{name;time;finishListener;duration;isPaused;playCount;interpolants;constructor(e,t){this.name=t||e.name,this.time=0,this.duration=e.duration,this.isPaused=!1,this.playCount=0,this.interpolants={};for(const n of e.tracks){const r=n.getValueSize();let o;n.getInterpolation()===re.InterpolateDiscrete?o=new re.DiscreteInterpolant(n.times,n.values,r):n.ValueTypeName==="quaternion"?o=new re.QuaternionLinearInterpolant(n.times,n.values,r):o=new re.LinearInterpolant(n.times,n.values,r),this.interpolants[n.name]=o}}init(e){}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){this.isPaused=e}setTime(e){this.time=e}setFinishListener(e){this.finishListener=e}update(e){this.time+=e,this.time>this.duration&&(this.time-=this.duration,this.playCount++,this.finishListener&&this.finishListener());const t={};for(const[n,r]of Object.entries(this.interpolants)){const o=n.substring(0,n.lastIndexOf(".")),s=n.substring(n.lastIndexOf(".")+1,n.length);let c=t[o];c||(c={},t[o]=c);const A=r.evaluate(this.time);if(s==="position")c.loc=new Z(A[0],A[1],A[2]);else if(s==="quaternion")c.quat=new Te(A[0],A[1],A[2],A[3]);else if(s==="scale")c.scale=new Z(A[0],A[1],A[2]);else if(s==="morphTargetInfluences"){c.morphs||(c.morphs=[]);const a=Array.from(A);c.morphs.push({name:o,vals:a})}else console.warn(`ClipMotion: update. unknown property(${s})`)}return t}}var Gi=(function(){var i="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp: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W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=WebAssembly.validate(t)?c(e):c(i),o,s=WebAssembly.instantiate(r,{}).then(function(d){o=d.instance,o.exports.__wasm_call_ctors()});function c(d){for(var p=new Uint8Array(d.length),C=0;C<d.length;++C){var E=d.charCodeAt(C);p[C]=E>96?E-97:E>64?E-39:E+4}for(var y=0,C=0;C<d.length;++C)p[y++]=p[C]<60?n[p[C]]:(p[C]-60)*64+p[++C];return p.buffer.slice(0,y)}function A(d,p,C,E,y,Q,x){var H=d.exports.sbrk,R=E+3&-4,M=H(R*y),N=H(Q.length),v=new Uint8Array(d.exports.memory.buffer);v.set(Q,N);var S=p(M,E,y,N,Q.length);if(S==0&&x&&x(M,R,y),C.set(v.subarray(M,M+E*y)),H(M-H(0)),S!=0)throw new Error("Malformed buffer data: "+S)}var a={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],b=0;function f(d){var p={object:new Worker(d),pending:0,requests:{}};return p.object.onmessage=function(C){var E=C.data;p.pending-=E.count,p.requests[E.id][E.action](E.value),delete p.requests[E.id]},p}function I(d){for(var p="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+l.name+";"+A.toString()+l.toString(),C=new Blob([p],{type:"text/javascript"}),E=URL.createObjectURL(C),y=u.length;y<d;++y)u[y]=f(E);for(var y=d;y<u.length;++y)u[y].object.postMessage({});u.length=d,URL.revokeObjectURL(E)}function m(d,p,C,E,y){for(var Q=u[0],x=1;x<u.length;++x)u[x].pending<Q.pending&&(Q=u[x]);return new Promise(function(H,R){var M=new Uint8Array(C),N=++b;Q.pending+=d,Q.requests[N]={resolve:H,reject:R},Q.object.postMessage({id:N,count:d,size:p,source:M,mode:E,filter:y},[M.buffer])})}function l(d){var p=d.data;if(!p.id)return self.close();self.ready.then(function(C){try{var E=new Uint8Array(p.count*p.size);A(C,C.exports[p.mode],E,p.count,p.size,p.source,C.exports[p.filter]),self.postMessage({id:p.id,count:p.count,action:"resolve",value:E},[E.buffer])}catch(y){self.postMessage({id:p.id,count:p.count,action:"reject",value:y})}})}return{ready:s,supported:!0,useWorkers:function(d){I(d)},decodeVertexBuffer:function(d,p,C,E,y){A(o,o.exports.meshopt_decodeVertexBuffer,d,p,C,E,o.exports[a[y]])},decodeIndexBuffer:function(d,p,C,E){A(o,o.exports.meshopt_decodeIndexBuffer,d,p,C,E)},decodeIndexSequence:function(d,p,C,E){A(o,o.exports.meshopt_decodeIndexSequence,d,p,C,E)},decodeGltfBuffer:function(d,p,C,E,y,Q){A(o,o.exports[h[y]],d,p,C,E,o.exports[a[Q]])},decodeGltfBufferAsync:function(d,p,C,E,y){return u.length>0?m(d,p,C,h[E],a[y]):s.then(function(){var Q=new Uint8Array(d*p);return A(o,o.exports[h[E]],Q,d,p,C,o.exports[a[y]]),Q})}}})();function qo(i){return"morphTargetDictionary"in i&&i.morphTargetDictionary!==void 0&&"morphTargetInfluences"in i&&Array.isArray(i.morphTargetInfluences)}const zo={draco:"https://unpkg.com/three@0.182/examples/jsm/libs/draco/",ktx2:"https://unpkg.com/three@0.182.0/examples/jsm/libs/basis/",meshopt:!0};function Ui(i={}){const e={...zo,...i};let t=new $n;const n=new vo;if(n.setDecoderPath(e.draco),t.setDRACOLoader(n),e.renderer){const r=new et;r.setTranscoderPath(e.ktx2),r.detectSupport(e.renderer),t.setKTX2Loader(r)}e.meshopt&&t.setMeshoptDecoder(Gi),fn=t}let fn=new $n;fn.setMeshoptDecoder(Gi);class Ko extends Et{gltf;constructor(e){super(e)}async asyncInit(e){if(qn(e)){let t=null;this.gltf=await fn.loadAsync(e);const n={},r={root:this.gltf.scene,bones:{},skeleton:void 0},o={};this.gltf.scene.traverse(s=>{if(s.userData.a3js={objectA3:this},qo(s)){const{morphTargetDictionary:c,morphTargetInfluences:A}=s;Object.keys(c).forEach(a=>{const h=s.name+"."+a,u=c[a];o[h]={array:A,idx:u}})}s instanceof re.Bone&&r.bones&&(r.bones[s.name]=s),s instanceof re.SkinnedMesh&&(r.skeleton=s.skeleton)}),this.gltf.animations.forEach(s=>{t||(t=s.name),n[s.name]={name:s.name,shape:r,motion:new dn(s),sound:void 0,soundContinue:!0}}),t?this.syncInit(t,n,o):(t="dummy",n.dummy={name:"dummy",shape:r,motion:new Bn,sound:void 0,soundContinue:!0},this.syncInit(t,n,o))}else{const t=new re.BoxGeometry,n=new re.MeshStandardMaterial({color:16711680}),r=new re.Mesh(t,n),o="dummy",s={};s.dummy={name:"dummy",shape:{root:r},motion:new Bn,sound:void 0,soundContinue:!0},this.syncInit(o,s)}return this}}const ji={camera:void 0,antialias:!1,transparent:!1};class Hi extends HTMLElement{options;ro;base;renderer;css2DRenderer;scene;camera;controller;camera3js;timer;_canvas;_css2DCanvas;constructor(e){if(super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
4
4
|
<style>
|
|
5
5
|
:host {
|
|
6
6
|
display: block;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
</style>
|
|
15
15
|
<slot></slot>
|
|
16
|
-
`,this.options={...
|
|
16
|
+
`,this.options={...ji,...e},this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{const n=new re.PerspectiveCamera(75,2,.1,1e3);n.aspect=300/150,this.camera3js=n,this.camera=new vt(this.camera3js)}this.base=new Jn(this.camera),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.timer=new re.Timer;const t={antialias:this.options.antialias,alpha:this.options.transparent};this.renderer=new re.WebGLRenderer(t),Ui({renderer:this.renderer}),this.renderer.setSize(600,300),this.shadowRoot.appendChild(this.renderer.domElement),this._canvas=this.shadowRoot.querySelector("canvas"),this._canvas.width=600,this._canvas.height=300,this.css2DRenderer=new Zn,this.css2DRenderer.domElement.classList.add("css2d-layer"),this.shadowRoot.appendChild(this.css2DRenderer.domElement),this._css2DCanvas=this.shadowRoot.querySelector(".css2d-layer"),this.animationFrameId=requestAnimationFrame(this.renderingLoop),this._css2DCanvas.addEventListener("click",this.myMouseClickedListener),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),window.addEventListener("keypress",this.keyPressListener),this._css2DCanvas.addEventListener("mousedown",n=>{this.controller?.mouseDown(n)}),this._css2DCanvas.addEventListener("mouseup",n=>{this.controller?.mouseUp(n)}),this._css2DCanvas.addEventListener("mousemove",n=>{this.controller?.mouseMove(n)}),this._css2DCanvas.addEventListener("click",n=>{this.controller?.mouseClick(n)}),this._css2DCanvas.addEventListener("mouseenter",n=>{this.controller?.mouseEnter(n)}),this._css2DCanvas.addEventListener("mouseleave",n=>{this.controller?.mouseLeave(n)}),this._css2DCanvas.addEventListener("wheel",n=>{this.controller?.mouseWheel(n)}),this._css2DCanvas.addEventListener("touchstart",n=>{this.controller?.touchStart(n)}),this._css2DCanvas.addEventListener("touchmove",n=>{this.controller?.touchMove(n)}),this._css2DCanvas.addEventListener("touchend",n=>{this.controller?.touchEnd(n)}),this._css2DCanvas.addEventListener("touchcancel",n=>{this.controller?.touchCancel(n)})}keyDownListener=e=>{this.controller?.keyDown(e)};keyUpListener=e=>{this.controller?.keyUp(e)};keyPressListener=e=>{this.controller?.keyPress(e)};connectedCallback(){this.ro=new ResizeObserver(e=>{const t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0||r===0||(this.renderer.setSize(n,r,!0),this.css2DRenderer.setSize(n,r),Vo(this.camera3js)?(this.camera3js.aspect=n/r,this.camera3js.updateProjectionMatrix()):Wo(this.camera3js)&&this.camera3js.updateProjectionMatrix())}),this.ro.observe(this)}disconnectedCallback(){this.ro?.disconnect(),window.removeEventListener("keydown",this.keyDownListener),window.removeEventListener("keyup",this.keyUpListener),window.removeEventListener("keypress",this.keyPressListener)}replaceScene(e){return this.scene=e,this.base.replaceScene(e)}setController(e){this.controller=e,this.base.setController(e)}animationFrameId=-1;renderingLoop=()=>{this.animationFrameId=requestAnimationFrame(this.renderingLoop),this.timer.update();const e=this.timer.getDelta();this.base.updateScene(e),this.renderer.render(this.scene.scene,this.camera3js),this.css2DRenderer.render(this.scene.scene,this.camera3js),this.waitingRenderResolves.forEach(t=>{t(e)}),this.waitingRenderResolves=[]};waitingRenderResolves=[];waitForRender(){return new Promise(e=>{this.waitingRenderResolves.push(e)})}worldToScreen(e){const t=new re.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new re.Vector2;this.renderer.getSize(n);const r=(t.x+1)/2*n.x,o=(1-t.y)/2*n.y;return{x:r,y:o}}screenToWorld(e,t,n){const r=new re.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);r.unproject(this.camera3js);const o=r.sub(this.camera3js.position).normalize();return new Z(this.camera3js.position.clone().add(o.multiplyScalar(n)))}cameraToScreen(e){const n=new re.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return j.v0.set(n),this.worldToScreen(j.v0)}screenToCamera(e,t,n){const r=this.screenToWorld(e,t,n),o=new re.Vector3(r.x,r.y,r.z);return r.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),r}myMouseClickedListener=async e=>{if(this.camera instanceof vt){const t=new re.Raycaster,n=new re.Vector2,r=e.target.getBoundingClientRect(),o=e.clientX-r.left,s=e.clientY-r.top;n.x=2*(o/r.width)-1,n.y=-2*(s/r.height)+1,t.setFromCamera(n,this.camera.camera);const c=t.intersectObjects(this.scene.scene.children),A=[];c.forEach(a=>{const h=a.object.userData.a3js?.objectA3;A.push({three:a.object,a3js:h})}),A.length>0&&await A[0].a3js.clicked(),this.dispatchEvent(new CustomEvent("click3d",{detail:{value:A}}))}};alert(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 0px; width: 100%; height: 100%; display: flex; flex-direction: column; z-index: 3;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("button");s.textContent="OK!",r.appendChild(s),this.shadowRoot.appendChild(r),s.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n()})})}prompt(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 0px; width: 100%; height: 100%; display: flex; flex-direction: column; z-index: 3;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("input");s.setAttribute("type","text"),r.appendChild(s);const c=document.createElement("button");c.textContent="OK!",r.appendChild(c),this.shadowRoot.appendChild(r),c.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n(s.value)})})}}customElements.define("canvas-a3",Hi);function Vo(i){return i.isPerspectiveCamera===!0}function Wo(i){return i.isOrthographicCamera===!0}const qi={width:600,height:300,camera:void 0};class zi extends HTMLElement{_resizeObserver;_dragging=!1;_resizing=!1;_resizeDir="";_startMouseX=0;_startMouseY=0;_startLeft=0;_startTop=0;_startWidth=0;_startHeight=0;_borderSize=5;_canvas;_css2DCanvas;_titleEl=null;_titleBar=null;_closeBtn=null;options;base;renderer;css2DRenderer;scene;camera;controller;camera3js;timer;constructor(e=600,t=300,n={}){if(super(),this.options={...qi,...n,width:e,height:t},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
17
17
|
<style>
|
|
18
18
|
:host {
|
|
19
19
|
position: absolute;
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
</div>
|
|
58
58
|
<div class="content">
|
|
59
59
|
</div>
|
|
60
|
-
`,this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{const o=new
|
|
60
|
+
`,this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{const o=new re.PerspectiveCamera(75,e/t,.01,1e3);o.aspect=e/t,this.camera3js=o,this.camera=new vt(this.camera3js)}this.base=new Jn(this.camera),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.timer=new re.Timer,this.renderer=new re.WebGLRenderer,Ui({renderer:this.renderer}),this.renderer.setSize(e,t),this.renderer.domElement.width=e,this.renderer.domElement.height=t;const r=this.shadowRoot.querySelector(".content");r.appendChild(this.renderer.domElement),this._canvas=this.shadowRoot.querySelector("canvas"),this.css2DRenderer=new Zn,this.css2DRenderer.setSize(e,t),this.css2DRenderer.domElement.classList.add("css2d-layer"),this.css2DRenderer.domElement.style.position="absolute",this.css2DRenderer.domElement.style.top="28px",r.appendChild(this.css2DRenderer.domElement),this._css2DCanvas=this.shadowRoot.querySelector(".css2d-layer"),this._css2DCanvas.addEventListener("click",this.myMouseClickedListener),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),window.addEventListener("keypress",this.keyPressListener),this._css2DCanvas.addEventListener("mousedown",o=>{this.controller?.mouseDown(o)}),this._css2DCanvas.addEventListener("mouseup",o=>{this.controller?.mouseUp(o)}),this._css2DCanvas.addEventListener("mousemove",o=>{this.controller?.mouseMove(o)}),this._css2DCanvas.addEventListener("click",o=>{this.controller?.mouseClick(o)}),this._css2DCanvas.addEventListener("mouseenter",o=>{this.controller?.mouseEnter(o)}),this._css2DCanvas.addEventListener("mouseleave",o=>{this.controller?.mouseLeave(o)}),this._css2DCanvas.addEventListener("wheel",o=>{this.controller?.mouseWheel(o)}),this._css2DCanvas.addEventListener("touchstart",o=>{this.controller?.touchStart(o)}),this._css2DCanvas.addEventListener("touchmove",o=>{this.controller?.touchMove(o)}),this._css2DCanvas.addEventListener("touchend",o=>{this.controller?.touchEnd(o)}),this._css2DCanvas.addEventListener("touchcancel",o=>{this.controller?.touchCancel(o)}),document.body?document.body.appendChild(this):document.addEventListener("DOMContentLoaded",()=>{document.body.append(this)},{once:!0}),this.animationFrameId=requestAnimationFrame(this.renderingLoop)}keyDownListener=e=>{this.controller?.keyDown(e)};keyUpListener=e=>{this.controller?.keyUp(e)};keyPressListener=e=>{this.controller?.keyPress(e)};_resizeCanvasToContent(){const e=this.shadowRoot.querySelector(".content");let t=e.clientWidth,n=e.clientHeight;const r=Math.floor(t),o=Math.floor(n);(this._canvas.width!==r||this._canvas.height!==o)&&(this._canvas.width=r,this._canvas.height=o,Yo(this.camera3js)?(this.camera3js.aspect=r/o,this.camera3js.updateProjectionMatrix()):Jo(this.camera3js)&&this.camera3js.updateProjectionMatrix(),this.renderer.setSize(r,o),this.css2DRenderer.setSize(r,o))}connectedCallback(){this._titleEl=this.shadowRoot.querySelector(".title"),this._titleEl.textContent=this.getAttribute("title")??"Window",this._titleBar=this.shadowRoot.querySelector(".titlebar"),this._closeBtn=this.shadowRoot.querySelector(".close"),this._titleBar.addEventListener("mousedown",this._onDragStart),this._closeBtn.addEventListener("click",()=>this.remove()),this.addEventListener("mousemove",this._onHover),this.addEventListener("mousedown",this._onResizeStart),document.addEventListener("mousemove",this._onMouseMove),document.addEventListener("mouseup",this._onMouseUp),this._resizeObserver=new ResizeObserver(()=>{this._canvas&&this._resizeCanvasToContent()});const e=this.shadowRoot.querySelector(".content");this._resizeObserver.observe(e),this._resizeCanvasToContent()}disconnectedCallback(){document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp),this._resizeObserver?.disconnect(),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),window.addEventListener("keypress",this.keyPressListener)}_onDragStart=e=>{this._resizeDir||(this._dragging=!0,this._startMouseX=e.clientX,this._startMouseY=e.clientY,this._startLeft=this.offsetLeft,this._startTop=this.offsetTop)};_onHover=e=>{if(this._dragging||this._resizing)return;const t=this.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,o=this._borderSize;let s="";r<o?s+="n":r>t.height-o&&(s+="s"),n<o?s+="w":n>t.width-o&&(s+="e"),this._resizeDir=s,this.style.cursor=this._cursorFromDir(s)};_cursorFromDir(e){switch(e){case"n":return"ns-resize";case"s":return"ns-resize";case"e":return"ew-resize";case"w":return"ew-resize";case"ne":return"nesw-resize";case"sw":return"nesw-resize";case"nw":return"nwse-resize";case"se":return"nwse-resize";default:return"default"}}_onResizeStart=e=>{this._resizeDir&&(this._resizing=!0,this._startMouseX=e.clientX,this._startMouseY=e.clientY,this._startLeft=this.offsetLeft,this._startTop=this.offsetTop,this._startWidth=this.offsetWidth,this._startHeight=this.offsetHeight)};_onMouseMove=e=>{if(this._dragging&&(this.style.left=`${this._startLeft+(e.clientX-this._startMouseX)}px`,this.style.top=`${this._startTop+(e.clientY-this._startMouseY)}px`),this._resizing){const t=e.clientX-this._startMouseX,n=e.clientY-this._startMouseY;this._resizeDir.includes("e")&&(this.style.width=`${this._startWidth+t}px`),this._resizeDir.includes("s")&&(this.style.height=`${this._startHeight+n}px`),this._resizeDir.includes("w")&&(this.style.width=`${this._startWidth-t}px`,this.style.left=`${this._startLeft+t}px`),this._resizeDir.includes("n")&&(this.style.height=`${this._startHeight-n}px`,this.style.top=`${this._startTop+n}px`)}};_onMouseUp=()=>{this._dragging=!1,this._resizing=!1};replaceScene(e){return this.scene=e,this.base.replaceScene(e)}setController(e){this.controller=e,this.base.setController(e)}animationFrameId=-1;renderingLoop=()=>{this.animationFrameId=requestAnimationFrame(this.renderingLoop),this.timer.update();const e=this.timer.getDelta();this.base.updateScene(e),this.renderer.render(this.scene.scene,this.camera3js),this.css2DRenderer.render(this.scene.scene,this.camera3js),this.waitingRenderResolves.forEach(t=>{t(e)}),this.waitingRenderResolves=[]};waitingRenderResolves=[];waitForRender(){return new Promise(e=>{this.waitingRenderResolves.push(e)})}worldToScreen(e){const t=new re.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new re.Vector2;this.renderer.getSize(n);const r=(t.x+1)/2*n.x,o=(1-t.y)/2*n.y;return{x:r,y:o}}screenToWorld(e,t,n){const r=new re.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);r.unproject(this.camera3js);const o=r.sub(this.camera3js.position).normalize();return new Z(this.camera3js.position.clone().add(o.multiplyScalar(n)))}cameraToScreen(e){const n=new re.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return j.v0.set(n),this.worldToScreen(j.v0)}screenToCamera(e,t,n){const r=this.screenToWorld(e,t,n),o=new re.Vector3(r.x,r.y,r.z);return r.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),r}myMouseClickedListener=async e=>{if(this.camera instanceof vt){const t=new re.Raycaster,n=new re.Vector2,r=e.target.getBoundingClientRect(),o=e.clientX-r.left,s=e.clientY-r.top;n.x=2*(o/r.width)-1,n.y=-2*(s/r.height)+1,t.setFromCamera(n,this.camera.camera);const c=t.intersectObjects(this.scene.scene.children),A=[];c.forEach(a=>{const h=a.object.userData.a3js?.objectA3;A.push({three:a.object,a3js:h})}),A.length>0&&await A[0].a3js.clicked(),this.dispatchEvent(new CustomEvent("click3d",{detail:{value:A}}))}};alert(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 28px; width: 100%; height: 100%; display: flex; flex-direction: column;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("button");s.textContent="OK!",r.appendChild(s),this.shadowRoot.appendChild(r),s.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n()})})}prompt(e,t){return new Promise(n=>{const r=document.createElement("div");r.style.cssText="position: absolute; top: 28px; width: 100%; height: 100%; display: flex; flex-direction: column;";const o=document.createElement("p");o.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",o.textContent=e,r.appendChild(o);const s=document.createElement("input");s.setAttribute("type","text"),r.appendChild(s);const c=document.createElement("button");c.textContent="OK!",r.appendChild(c),this.shadowRoot.appendChild(r),c.addEventListener("click",async()=>{t&&await t(),this.shadowRoot.removeChild(r),n(s.value)})})}}customElements.define("window-a3",zi);function Yo(i){return i.isPerspectiveCamera===!0}function Jo(i){return i.isOrthographicCamera===!0}const Xo=`
|
|
61
61
|
color: white;
|
|
62
62
|
padding: 5px 10px;
|
|
63
63
|
background: rgba(0, 0, 0, 0.6);
|
|
@@ -66,70 +66,70 @@
|
|
|
66
66
|
font-family: sans-serif;
|
|
67
67
|
font-size: 14px;
|
|
68
68
|
pointer-events: none; /* マウスイベントを透過させて背後の操作を邪魔しない */
|
|
69
|
-
`,
|
|
70
|
-
`)A=0,a-=s;else{const b=$o(u,o,A,a,t);n=="tb"?(A=0,a+=t.ascender*o):A+=b.offsetX,c.push(b.path)}}return c}function $o(i,e,t,n,r){const o=r.glyphs[i]||r.glyphs["?"];if(!o){console.error('THREE.Font: character "'+i+'" does not exists in font family '+r.familyName+".");return}const s=new g.ShapePath;let c,A,a,h,u,b,f,I;if(o.o){const E=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let l=0,d=E.length;l<d;)switch(E[l++]){case"m":c=E[l++]*e+t,A=E[l++]*e+n,s.moveTo(c,A);break;case"l":c=E[l++]*e+t,A=E[l++]*e+n,s.lineTo(c,A);break;case"q":a=E[l++]*e+t,h=E[l++]*e+n,u=E[l++]*e+t,b=E[l++]*e+n,s.quadraticCurveTo(u,b,a,h);break;case"b":a=E[l++]*e+t,h=E[l++]*e+n,u=E[l++]*e+t,b=E[l++]*e+n,f=E[l++]*e+t,I=E[l++]*e+n,s.bezierCurveTo(u,b,f,I,a,h);break}}return{offsetX:o.ha*e,path:s}}class es extends g.ExtrudeGeometry{constructor(e,t={}){const n=t.font;if(n===void 0)super();else{const r=n.generateShapes(e,t.size,t.direction);t.depth===void 0&&(t.depth=50),t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t)}this.type="TextGeometry"}}let Lt=null;async function ts(i){if(i.match(/.zip$/i)){let e=i.substring(i.lastIndexOf("/"));e=e.substring(0,e.length-4);const t=await Hn(i),n=cn(t,e);Lt=new qi(JSON.parse(n))}else Lt=await new Xo().loadAsync(i)}class ns extends Oe{initObject(e){let t;if(jn(e)?t=e:t="ERROR",Lt==null){const n=new se.BoxGeometry,r=new se.MeshStandardMaterial({color:16711680});return new se.Mesh(n,r)}else{const n={font:Lt,size:1,depth:.5,curveSegments:12},r=new es(t,n);r.center();const o=new se.MeshStandardMaterial({color:65280});return new se.Mesh(r,o)}}}var Qe=(i,e)=>()=>(e||(e={exports:{}},i(e.exports,e)),e.exports),zi=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.VERSION=void 0,i.VERSION="9.0.1"}),De=Qe((i,e)=>{var t=i&&i.__spreadArray||function(O,Y){for(var V=0,ie=Y.length,de=O.length;V<ie;V++,de++)O[de]=Y[V];return O};Object.defineProperty(i,"__esModule",{value:!0}),i.toFastProperties=i.timer=i.peek=i.isES2015MapSupported=i.PRINT_WARNING=i.PRINT_ERROR=i.packArray=i.IDENTITY=i.NOOP=i.merge=i.groupBy=i.defaults=i.assignNoOverwrite=i.assign=i.zipObject=i.sortBy=i.indexOf=i.some=i.difference=i.every=i.isObject=i.isRegExp=i.isArray=i.partial=i.uniq=i.compact=i.reduce=i.findAll=i.find=i.cloneObj=i.cloneArr=i.contains=i.has=i.pick=i.reject=i.filter=i.dropRight=i.drop=i.isFunction=i.isUndefined=i.isString=i.forEach=i.last=i.first=i.flatten=i.map=i.mapValues=i.values=i.keys=i.isEmpty=void 0;function n(O){return O&&O.length===0}i.isEmpty=n;function r(O){return O==null?[]:Object.keys(O)}i.keys=r;function o(O){for(var Y=[],V=Object.keys(O),ie=0;ie<V.length;ie++)Y.push(O[V[ie]]);return Y}i.values=o;function s(O,Y){for(var V=[],ie=r(O),de=0;de<ie.length;de++){var Le=ie[de];V.push(Y.call(null,O[Le],Le))}return V}i.mapValues=s;function c(O,Y){for(var V=[],ie=0;ie<O.length;ie++)V.push(Y.call(null,O[ie],ie));return V}i.map=c;function A(O){for(var Y=[],V=0;V<O.length;V++){var ie=O[V];Array.isArray(ie)?Y=Y.concat(A(ie)):Y.push(ie)}return Y}i.flatten=A;function a(O){return n(O)?void 0:O[0]}i.first=a;function h(O){var Y=O&&O.length;return Y?O[Y-1]:void 0}i.last=h;function u(O,Y){if(Array.isArray(O))for(var V=0;V<O.length;V++)Y.call(null,O[V],V);else if(J(O))for(var ie=r(O),V=0;V<ie.length;V++){var de=ie[V],Le=O[de];Y.call(null,Le,de)}else throw Error("non exhaustive match")}i.forEach=u;function b(O){return typeof O=="string"}i.isString=b;function f(O){return O===void 0}i.isUndefined=f;function I(O){return O instanceof Function}i.isFunction=I;function E(O,Y){return Y===void 0&&(Y=1),O.slice(Y,O.length)}i.drop=E;function l(O,Y){return Y===void 0&&(Y=1),O.slice(0,O.length-Y)}i.dropRight=l;function d(O,Y){var V=[];if(Array.isArray(O))for(var ie=0;ie<O.length;ie++){var de=O[ie];Y.call(null,de)&&V.push(de)}return V}i.filter=d;function p(O,Y){return d(O,function(V){return!Y(V)})}i.reject=p;function C(O,Y){for(var V=Object.keys(O),ie={},de=0;de<V.length;de++){var Le=V[de],Ce=O[Le];Y(Ce)&&(ie[Le]=Ce)}return ie}i.pick=C;function m(O,Y){return J(O)?O.hasOwnProperty(Y):!1}i.has=m;function y(O,Y){return j(O,function(V){return V===Y})!==void 0}i.contains=y;function Q(O){for(var Y=[],V=0;V<O.length;V++)Y.push(O[V]);return Y}i.cloneArr=Q;function _(O){var Y={};for(var V in O)Object.prototype.hasOwnProperty.call(O,V)&&(Y[V]=O[V]);return Y}i.cloneObj=_;function j(O,Y){for(var V=0;V<O.length;V++){var ie=O[V];if(Y.call(null,ie))return ie}}i.find=j;function v(O,Y){for(var V=[],ie=0;ie<O.length;ie++){var de=O[ie];Y.call(null,de)&&V.push(de)}return V}i.findAll=v;function M(O,Y,V){for(var ie=Array.isArray(O),de=ie?O:o(O),Le=ie?[]:r(O),Ce=V,ce=0;ce<de.length;ce++)Ce=Y.call(null,Ce,de[ce],ie?ce:Le[ce]);return Ce}i.reduce=M;function x(O){return p(O,function(Y){return Y==null})}i.compact=x;function R(O,Y){Y===void 0&&(Y=function(ie){return ie});var V=[];return M(O,function(ie,de){var Le=Y(de);return y(V,Le)?ie:(V.push(Le),ie.concat(de))},[])}i.uniq=R;function N(O){for(var Y=[],V=1;V<arguments.length;V++)Y[V-1]=arguments[V];var ie=[null],de=ie.concat(Y);return Function.bind.apply(O,de)}i.partial=N;function L(O){return Array.isArray(O)}i.isArray=L;function W(O){return O instanceof RegExp}i.isRegExp=W;function J(O){return O instanceof Object}i.isObject=J;function K(O,Y){for(var V=0;V<O.length;V++)if(!Y(O[V],V))return!1;return!0}i.every=K;function ee(O,Y){return p(O,function(V){return y(Y,V)})}i.difference=ee;function te(O,Y){for(var V=0;V<O.length;V++)if(Y(O[V]))return!0;return!1}i.some=te;function ue(O,Y){for(var V=0;V<O.length;V++)if(O[V]===Y)return V;return-1}i.indexOf=ue;function oe(O,Y){var V=Q(O);return V.sort(function(ie,de){return Y(ie)-Y(de)}),V}i.sortBy=oe;function ae(O,Y){if(O.length!==Y.length)throw Error("can't zipObject with different number of keys and values!");for(var V={},ie=0;ie<O.length;ie++)V[O[ie]]=Y[ie];return V}i.zipObject=ae;function Ae(O){for(var Y=[],V=1;V<arguments.length;V++)Y[V-1]=arguments[V];for(var ie=0;ie<Y.length;ie++)for(var de=Y[ie],Le=r(de),Ce=0;Ce<Le.length;Ce++){var ce=Le[Ce];O[ce]=de[ce]}return O}i.assign=Ae;function Ie(O){for(var Y=[],V=1;V<arguments.length;V++)Y[V-1]=arguments[V];for(var ie=0;ie<Y.length;ie++)for(var de=Y[ie],Le=r(de),Ce=0;Ce<Le.length;Ce++){var ce=Le[Ce];m(O,ce)||(O[ce]=de[ce])}return O}i.assignNoOverwrite=Ie;function U(){for(var O=[],Y=0;Y<arguments.length;Y++)O[Y]=arguments[Y];return Ie.apply(void 0,t([{}],O))}i.defaults=U;function P(O,Y){var V={};return u(O,function(ie){var de=Y(ie),Le=V[de];Le?Le.push(ie):V[de]=[ie]}),V}i.groupBy=P;function q(O,Y){for(var V=_(O),ie=r(Y),de=0;de<ie.length;de++){var Le=ie[de],Ce=Y[Le];V[Le]=Ce}return V}i.merge=q;function X(){}i.NOOP=X;function ne(O){return O}i.IDENTITY=ne;function le(O){for(var Y=[],V=0;V<O.length;V++){var ie=O[V];Y.push(ie!==void 0?ie:void 0)}return Y}i.packArray=le;function we(O){console&&console.error&&console.error("Error: "+O)}i.PRINT_ERROR=we;function Re(O){console&&console.warn&&console.warn("Warning: "+O)}i.PRINT_WARNING=Re;function Fe(){return typeof Map=="function"}i.isES2015MapSupported=Fe;function We(O){return O[O.length-1]}i.peek=We;function ze(O){var Y=new Date().getTime(),V=O(),ie=new Date().getTime(),de=ie-Y;return{time:de,value:V}}i.timer=ze;function Ke(O){function Y(){}Y.prototype=O;var V=new Y;function ie(){return typeof V.bar}return ie(),ie(),O}i.toFastProperties=Ke}),dn=Qe((i,e)=>{(function(t,n){typeof define=="function"&&define.amd?define([],n):typeof e=="object"&&e.exports?e.exports=n():t.regexpToAst=n()})(typeof self<"u"?self:i,function(){function t(){}t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(l){this.idx=l.idx,this.input=l.input,this.groupIdx=l.groupIdx},t.prototype.pattern=function(l){this.idx=0,this.input=l,this.groupIdx=0,this.consumeChar("/");var d=this.disjunction();this.consumeChar("/");for(var p={type:"Flags",loc:{begin:this.idx,end:l.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":A(p,"global");break;case"i":A(p,"ignoreCase");break;case"m":A(p,"multiLine");break;case"u":A(p,"unicode");break;case"y":A(p,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:p,value:d,loc:this.loc(0)}},t.prototype.disjunction=function(){var l=[],d=this.idx;for(l.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),l.push(this.alternative());return{type:"Disjunction",value:l,loc:this.loc(d)}},t.prototype.alternative=function(){for(var l=[],d=this.idx;this.isTerm();)l.push(this.term());return{type:"Alternative",value:l,loc:this.loc(d)}},t.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},t.prototype.assertion=function(){var l=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(l)};case"$":return{type:"EndAnchor",loc:this.loc(l)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(l)};case"B":return{type:"NonWordBoundary",loc:this.loc(l)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var d;switch(this.popChar()){case"=":d="Lookahead";break;case"!":d="NegativeLookahead";break}a(d);var p=this.disjunction();return this.consumeChar(")"),{type:d,value:p,loc:this.loc(l)}}h()},t.prototype.quantifier=function(l){var d,p=this.idx;switch(this.popChar()){case"*":d={atLeast:0,atMost:1/0};break;case"+":d={atLeast:1,atMost:1/0};break;case"?":d={atLeast:0,atMost:1};break;case"{":var C=this.integerIncludingZero();switch(this.popChar()){case"}":d={atLeast:C,atMost:C};break;case",":var m;this.isDigit()?(m=this.integerIncludingZero(),d={atLeast:C,atMost:m}):d={atLeast:C,atMost:1/0},this.consumeChar("}");break}if(l===!0&&d===void 0)return;a(d);break}if(!(l===!0&&d===void 0))return a(d),this.peekChar(0)==="?"?(this.consumeChar("?"),d.greedy=!1):d.greedy=!0,d.type="Quantifier",d.loc=this.loc(p),d},t.prototype.atom=function(){var l,d=this.idx;switch(this.peekChar()){case".":l=this.dotAll();break;case"\\":l=this.atomEscape();break;case"[":l=this.characterClass();break;case"(":l=this.group();break}return l===void 0&&this.isPatternCharacter()&&(l=this.patternCharacter()),a(l),l.loc=this.loc(d),this.isQuantifier()&&(l.quantifier=this.quantifier()),l},t.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[s(`
|
|
69
|
+
`,On={testMode:!0};class Zo extends Pe{constructor(e={}){super(e);const t={...On,...e};this.setTransformer(new Mn(t))}initObject(){const e=new re.BoxGeometry,t=new re.MeshStandardMaterial({color:65280}),n=new re.Mesh(e,t),r=document.createElement("div");r.textContent="Hello Box!",r.style.cssText=Xo;const o=new Xn(r);return o.position.set(0,.8,0),n.add(o),n}initTransformer(e){const t=xt(On,e);return new Mn(t)}}class Mn extends Tt{testMode=!0;rot=new Z;constructor(e){super(),this.testMode=e.testMode}update(e){if(super.update(e),this.testMode){this.rot.add(e,e,e);const t=dt(this.rot);this.trans.quat.set(t)}}}class $o extends g.Loader{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new g.FileLoader(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(c){const A=o.parse(JSON.parse(c));t&&t(A)},n,r)}parse(e){return new Ki(e)}}class Ki{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100,n="ltr"){const r=[],o=es(e,t,this.data,n);for(let s=0,c=o.length;s<c;s++)r.push(...o[s].toShapes());return r}}function es(i,e,t,n){const r=Array.from(i),o=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*o,c=[];let A=0,a=0;(n=="rtl"||n=="tb")&&r.reverse();for(let h=0;h<r.length;h++){const u=r[h];if(u===`
|
|
70
|
+
`)A=0,a-=s;else{const b=ts(u,o,A,a,t);n=="tb"?(A=0,a+=t.ascender*o):A+=b.offsetX,c.push(b.path)}}return c}function ts(i,e,t,n,r){const o=r.glyphs[i]||r.glyphs["?"];if(!o){console.error('THREE.Font: character "'+i+'" does not exists in font family '+r.familyName+".");return}const s=new g.ShapePath;let c,A,a,h,u,b,f,I;if(o.o){const m=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let l=0,d=m.length;l<d;)switch(m[l++]){case"m":c=m[l++]*e+t,A=m[l++]*e+n,s.moveTo(c,A);break;case"l":c=m[l++]*e+t,A=m[l++]*e+n,s.lineTo(c,A);break;case"q":a=m[l++]*e+t,h=m[l++]*e+n,u=m[l++]*e+t,b=m[l++]*e+n,s.quadraticCurveTo(u,b,a,h);break;case"b":a=m[l++]*e+t,h=m[l++]*e+n,u=m[l++]*e+t,b=m[l++]*e+n,f=m[l++]*e+t,I=m[l++]*e+n,s.bezierCurveTo(u,b,f,I,a,h);break}}return{offsetX:o.ha*e,path:s}}class ns extends g.ExtrudeGeometry{constructor(e,t={}){const n=t.font;if(n===void 0)super();else{const r=n.generateShapes(e,t.size,t.direction);t.depth===void 0&&(t.depth=50),t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t)}this.type="TextGeometry"}}let Lt=null;async function is(i){if(i.match(/.zip$/i)){let e=i.substring(i.lastIndexOf("/"));e=e.substring(0,e.length-4);const t=await zn(i),n=un(t,e);Lt=new Ki(JSON.parse(n))}else Lt=await new $o().loadAsync(i)}class rs extends Pe{initObject(e){let t;if(qn(e)?t=e:t="ERROR",Lt==null){const n=new re.BoxGeometry,r=new re.MeshStandardMaterial({color:16711680});return new re.Mesh(n,r)}else{const n={font:Lt,size:1,depth:.5,curveSegments:12},r=new ns(t,n);r.center();const o=new re.MeshStandardMaterial({color:65280});return new re.Mesh(r,o)}}}var ve=(i,e)=>()=>(e||(e={exports:{}},i(e.exports,e)),e.exports),Vi=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.VERSION=void 0,i.VERSION="9.0.1"}),Oe=ve((i,e)=>{var t=i&&i.__spreadArray||function(O,Y){for(var K=0,ie=Y.length,fe=O.length;K<ie;K++,fe++)O[fe]=Y[K];return O};Object.defineProperty(i,"__esModule",{value:!0}),i.toFastProperties=i.timer=i.peek=i.isES2015MapSupported=i.PRINT_WARNING=i.PRINT_ERROR=i.packArray=i.IDENTITY=i.NOOP=i.merge=i.groupBy=i.defaults=i.assignNoOverwrite=i.assign=i.zipObject=i.sortBy=i.indexOf=i.some=i.difference=i.every=i.isObject=i.isRegExp=i.isArray=i.partial=i.uniq=i.compact=i.reduce=i.findAll=i.find=i.cloneObj=i.cloneArr=i.contains=i.has=i.pick=i.reject=i.filter=i.dropRight=i.drop=i.isFunction=i.isUndefined=i.isString=i.forEach=i.last=i.first=i.flatten=i.map=i.mapValues=i.values=i.keys=i.isEmpty=void 0;function n(O){return O&&O.length===0}i.isEmpty=n;function r(O){return O==null?[]:Object.keys(O)}i.keys=r;function o(O){for(var Y=[],K=Object.keys(O),ie=0;ie<K.length;ie++)Y.push(O[K[ie]]);return Y}i.values=o;function s(O,Y){for(var K=[],ie=r(O),fe=0;fe<ie.length;fe++){var _e=ie[fe];K.push(Y.call(null,O[_e],_e))}return K}i.mapValues=s;function c(O,Y){for(var K=[],ie=0;ie<O.length;ie++)K.push(Y.call(null,O[ie],ie));return K}i.map=c;function A(O){for(var Y=[],K=0;K<O.length;K++){var ie=O[K];Array.isArray(ie)?Y=Y.concat(A(ie)):Y.push(ie)}return Y}i.flatten=A;function a(O){return n(O)?void 0:O[0]}i.first=a;function h(O){var Y=O&&O.length;return Y?O[Y-1]:void 0}i.last=h;function u(O,Y){if(Array.isArray(O))for(var K=0;K<O.length;K++)Y.call(null,O[K],K);else if(J(O))for(var ie=r(O),K=0;K<ie.length;K++){var fe=ie[K],_e=O[fe];Y.call(null,_e,fe)}else throw Error("non exhaustive match")}i.forEach=u;function b(O){return typeof O=="string"}i.isString=b;function f(O){return O===void 0}i.isUndefined=f;function I(O){return O instanceof Function}i.isFunction=I;function m(O,Y){return Y===void 0&&(Y=1),O.slice(Y,O.length)}i.drop=m;function l(O,Y){return Y===void 0&&(Y=1),O.slice(0,O.length-Y)}i.dropRight=l;function d(O,Y){var K=[];if(Array.isArray(O))for(var ie=0;ie<O.length;ie++){var fe=O[ie];Y.call(null,fe)&&K.push(fe)}return K}i.filter=d;function p(O,Y){return d(O,function(K){return!Y(K)})}i.reject=p;function C(O,Y){for(var K=Object.keys(O),ie={},fe=0;fe<K.length;fe++){var _e=K[fe],Be=O[_e];Y(Be)&&(ie[_e]=Be)}return ie}i.pick=C;function E(O,Y){return J(O)?O.hasOwnProperty(Y):!1}i.has=E;function y(O,Y){return H(O,function(K){return K===Y})!==void 0}i.contains=y;function Q(O){for(var Y=[],K=0;K<O.length;K++)Y.push(O[K]);return Y}i.cloneArr=Q;function x(O){var Y={};for(var K in O)Object.prototype.hasOwnProperty.call(O,K)&&(Y[K]=O[K]);return Y}i.cloneObj=x;function H(O,Y){for(var K=0;K<O.length;K++){var ie=O[K];if(Y.call(null,ie))return ie}}i.find=H;function R(O,Y){for(var K=[],ie=0;ie<O.length;ie++){var fe=O[ie];Y.call(null,fe)&&K.push(fe)}return K}i.findAll=R;function M(O,Y,K){for(var ie=Array.isArray(O),fe=ie?O:o(O),_e=ie?[]:r(O),Be=K,ce=0;ce<fe.length;ce++)Be=Y.call(null,Be,fe[ce],ie?ce:_e[ce]);return Be}i.reduce=M;function N(O){return p(O,function(Y){return Y==null})}i.compact=N;function v(O,Y){Y===void 0&&(Y=function(ie){return ie});var K=[];return M(O,function(ie,fe){var _e=Y(fe);return y(K,_e)?ie:(K.push(_e),ie.concat(fe))},[])}i.uniq=v;function S(O){for(var Y=[],K=1;K<arguments.length;K++)Y[K-1]=arguments[K];var ie=[null],fe=ie.concat(Y);return Function.bind.apply(O,fe)}i.partial=S;function _(O){return Array.isArray(O)}i.isArray=_;function V(O){return O instanceof RegExp}i.isRegExp=V;function J(O){return O instanceof Object}i.isObject=J;function q(O,Y){for(var K=0;K<O.length;K++)if(!Y(O[K],K))return!1;return!0}i.every=q;function $(O,Y){return p(O,function(K){return y(Y,K)})}i.difference=$;function ne(O,Y){for(var K=0;K<O.length;K++)if(Y(O[K]))return!0;return!1}i.some=ne;function ue(O,Y){for(var K=0;K<O.length;K++)if(O[K]===Y)return K;return-1}i.indexOf=ue;function oe(O,Y){var K=Q(O);return K.sort(function(ie,fe){return Y(ie)-Y(fe)}),K}i.sortBy=oe;function ae(O,Y){if(O.length!==Y.length)throw Error("can't zipObject with different number of keys and values!");for(var K={},ie=0;ie<O.length;ie++)K[O[ie]]=Y[ie];return K}i.zipObject=ae;function Ae(O){for(var Y=[],K=1;K<arguments.length;K++)Y[K-1]=arguments[K];for(var ie=0;ie<Y.length;ie++)for(var fe=Y[ie],_e=r(fe),Be=0;Be<_e.length;Be++){var ce=_e[Be];O[ce]=fe[ce]}return O}i.assign=Ae;function Ce(O){for(var Y=[],K=1;K<arguments.length;K++)Y[K-1]=arguments[K];for(var ie=0;ie<Y.length;ie++)for(var fe=Y[ie],_e=r(fe),Be=0;Be<_e.length;Be++){var ce=_e[Be];E(O,ce)||(O[ce]=fe[ce])}return O}i.assignNoOverwrite=Ce;function U(){for(var O=[],Y=0;Y<arguments.length;Y++)O[Y]=arguments[Y];return Ce.apply(void 0,t([{}],O))}i.defaults=U;function P(O,Y){var K={};return u(O,function(ie){var fe=Y(ie),_e=K[fe];_e?_e.push(ie):K[fe]=[ie]}),K}i.groupBy=P;function z(O,Y){for(var K=x(O),ie=r(Y),fe=0;fe<ie.length;fe++){var _e=ie[fe],Be=Y[_e];K[_e]=Be}return K}i.merge=z;function X(){}i.NOOP=X;function ee(O){return O}i.IDENTITY=ee;function le(O){for(var Y=[],K=0;K<O.length;K++){var ie=O[K];Y.push(ie!==void 0?ie:void 0)}return Y}i.packArray=le;function we(O){console&&console.error&&console.error("Error: "+O)}i.PRINT_ERROR=we;function Re(O){console&&console.warn&&console.warn("Warning: "+O)}i.PRINT_WARNING=Re;function Me(){return typeof Map=="function"}i.isES2015MapSupported=Me;function We(O){return O[O.length-1]}i.peek=We;function ze(O){var Y=new Date().getTime(),K=O(),ie=new Date().getTime(),fe=ie-Y;return{time:fe,value:K}}i.timer=ze;function Ke(O){function Y(){}Y.prototype=O;var K=new Y;function ie(){return typeof K.bar}return ie(),ie(),O}i.toFastProperties=Ke}),pn=ve((i,e)=>{(function(t,n){typeof define=="function"&&define.amd?define([],n):typeof e=="object"&&e.exports?e.exports=n():t.regexpToAst=n()})(typeof self<"u"?self:i,function(){function t(){}t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(l){this.idx=l.idx,this.input=l.input,this.groupIdx=l.groupIdx},t.prototype.pattern=function(l){this.idx=0,this.input=l,this.groupIdx=0,this.consumeChar("/");var d=this.disjunction();this.consumeChar("/");for(var p={type:"Flags",loc:{begin:this.idx,end:l.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":A(p,"global");break;case"i":A(p,"ignoreCase");break;case"m":A(p,"multiLine");break;case"u":A(p,"unicode");break;case"y":A(p,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:p,value:d,loc:this.loc(0)}},t.prototype.disjunction=function(){var l=[],d=this.idx;for(l.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),l.push(this.alternative());return{type:"Disjunction",value:l,loc:this.loc(d)}},t.prototype.alternative=function(){for(var l=[],d=this.idx;this.isTerm();)l.push(this.term());return{type:"Alternative",value:l,loc:this.loc(d)}},t.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},t.prototype.assertion=function(){var l=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(l)};case"$":return{type:"EndAnchor",loc:this.loc(l)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(l)};case"B":return{type:"NonWordBoundary",loc:this.loc(l)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var d;switch(this.popChar()){case"=":d="Lookahead";break;case"!":d="NegativeLookahead";break}a(d);var p=this.disjunction();return this.consumeChar(")"),{type:d,value:p,loc:this.loc(l)}}h()},t.prototype.quantifier=function(l){var d,p=this.idx;switch(this.popChar()){case"*":d={atLeast:0,atMost:1/0};break;case"+":d={atLeast:1,atMost:1/0};break;case"?":d={atLeast:0,atMost:1};break;case"{":var C=this.integerIncludingZero();switch(this.popChar()){case"}":d={atLeast:C,atMost:C};break;case",":var E;this.isDigit()?(E=this.integerIncludingZero(),d={atLeast:C,atMost:E}):d={atLeast:C,atMost:1/0},this.consumeChar("}");break}if(l===!0&&d===void 0)return;a(d);break}if(!(l===!0&&d===void 0))return a(d),this.peekChar(0)==="?"?(this.consumeChar("?"),d.greedy=!1):d.greedy=!0,d.type="Quantifier",d.loc=this.loc(p),d},t.prototype.atom=function(){var l,d=this.idx;switch(this.peekChar()){case".":l=this.dotAll();break;case"\\":l=this.atomEscape();break;case"[":l=this.characterClass();break;case"(":l=this.group();break}return l===void 0&&this.isPatternCharacter()&&(l=this.patternCharacter()),a(l),l.loc=this.loc(d),this.isQuantifier()&&(l.quantifier=this.quantifier()),l},t.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[s(`
|
|
71
71
|
`),s("\r"),s("\u2028"),s("\u2029")]}},t.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},t.prototype.decimalEscapeAtom=function(){var l=this.positiveInteger();return{type:"GroupBackReference",value:l}},t.prototype.characterClassEscape=function(){var l,d=!1;switch(this.popChar()){case"d":l=b;break;case"D":l=b,d=!0;break;case"s":l=I;break;case"S":l=I,d=!0;break;case"w":l=f;break;case"W":l=f,d=!0;break}return a(l),{type:"Set",value:l,complement:d}},t.prototype.controlEscapeAtom=function(){var l;switch(this.popChar()){case"f":l=s("\f");break;case"n":l=s(`
|
|
72
72
|
`);break;case"r":l=s("\r");break;case"t":l=s(" ");break;case"v":l=s("\v");break}return a(l),{type:"Character",value:l}},t.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var l=this.popChar();if(/[a-zA-Z]/.test(l)===!1)throw Error("Invalid ");var d=l.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:d}},t.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:s("\0")}},t.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},t.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},t.prototype.identityEscapeAtom=function(){var l=this.popChar();return{type:"Character",value:s(l)}},t.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
|
|
73
|
-
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var l=this.popChar();return{type:"Character",value:s(l)}}},t.prototype.characterClass=function(){var l=[],d=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),d=!0);this.isClassAtom();){var p=this.classAtom(),C=p.type==="Character";if(C&&this.isRangeDash()){this.consumeChar("-");var
|
|
73
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var l=this.popChar();return{type:"Character",value:s(l)}}},t.prototype.characterClass=function(){var l=[],d=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),d=!0);this.isClassAtom();){var p=this.classAtom(),C=p.type==="Character";if(C&&this.isRangeDash()){this.consumeChar("-");var E=this.classAtom(),y=E.type==="Character";if(y){if(E.value<p.value)throw Error("Range out of order in character class");l.push({from:p.value,to:E.value})}else c(p.value,l),l.push(s("-")),c(E.value,l)}else c(p.value,l)}return this.consumeChar("]"),{type:"Set",complement:d,value:l}},t.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
|
|
74
74
|
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},t.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:s("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},t.prototype.group=function(){var l=!0;(this.consumeChar("("),this.peekChar(0))==="?"?(this.consumeChar("?"),this.consumeChar(":"),l=!1):this.groupIdx++;var d=this.disjunction();this.consumeChar(")");var p={type:"Group",capturing:l,value:d};return l&&(p.idx=this.groupIdx),p},t.prototype.positiveInteger=function(){var l=this.popChar();if(o.test(l)===!1)throw Error("Expecting a positive integer");for(;r.test(this.peekChar(0));)l+=this.popChar();return parseInt(l,10)},t.prototype.integerIncludingZero=function(){var l=this.popChar();if(r.test(l)===!1)throw Error("Expecting an integer");for(;r.test(this.peekChar(0));)l+=this.popChar();return parseInt(l,10)},t.prototype.patternCharacter=function(){var l=this.popChar();switch(l){case`
|
|
75
75
|
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:s(l)}}},t.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},t.prototype.isRangeDash=function(){return this.peekChar()==="-"&&this.isClassAtom(1)},t.prototype.isDigit=function(){return r.test(this.peekChar(0))},t.prototype.isClassAtom=function(l){switch(l===void 0&&(l=0),this.peekChar(l)){case"]":case`
|
|
76
76
|
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},t.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},t.prototype.isAssertion=function(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}},t.prototype.isQuantifier=function(){var l=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(l)}},t.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
77
|
-
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.parseHexDigits=function(l){for(var d="",p=0;p<l;p++){var C=this.popChar();if(n.test(C)===!1)throw Error("Expecting a HexDecimal digits");d+=C}var
|
|
78
|
-
`),s("\r"),s(" "),s("\v"),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s("\u2028"),s("\u2029"),s(" "),s(" "),s(" "),s("\uFEFF")];function
|
|
79
|
-
`;function c(
|
|
77
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.parseHexDigits=function(l){for(var d="",p=0;p<l;p++){var C=this.popChar();if(n.test(C)===!1)throw Error("Expecting a HexDecimal digits");d+=C}var E=parseInt(d,16);return{type:"Character",value:E}},t.prototype.peekChar=function(l){return l===void 0&&(l=0),this.input[this.idx+l]},t.prototype.popChar=function(){var l=this.peekChar(0);return this.consumeChar(),l},t.prototype.consumeChar=function(l){if(l!==void 0&&this.input[this.idx]!==l)throw Error("Expected: '"+l+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++},t.prototype.loc=function(l){return{begin:l,end:this.idx}};var n=/[0-9a-fA-F]/,r=/[0-9]/,o=/[1-9]/;function s(l){return l.charCodeAt(0)}function c(l,d){l.length!==void 0?l.forEach(function(p){d.push(p)}):d.push(l)}function A(l,d){if(l[d]===!0)throw"duplicate flag "+d;l[d]=!0}function a(l){if(l===void 0)throw Error("Internal Error - Should never get here!")}function h(){throw Error("Internal Error - Should never get here!")}var u,b=[];for(u=s("0");u<=s("9");u++)b.push(u);var f=[s("_")].concat(b);for(u=s("a");u<=s("z");u++)f.push(u);for(u=s("A");u<=s("Z");u++)f.push(u);var I=[s(" "),s("\f"),s(`
|
|
78
|
+
`),s("\r"),s(" "),s("\v"),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s("\u2028"),s("\u2029"),s(" "),s(" "),s(" "),s("\uFEFF")];function m(){}return m.prototype.visitChildren=function(l){for(var d in l){var p=l[d];l.hasOwnProperty(d)&&(p.type!==void 0?this.visit(p):Array.isArray(p)&&p.forEach(function(C){this.visit(C)},this))}},m.prototype.visit=function(l){switch(l.type){case"Pattern":this.visitPattern(l);break;case"Flags":this.visitFlags(l);break;case"Disjunction":this.visitDisjunction(l);break;case"Alternative":this.visitAlternative(l);break;case"StartAnchor":this.visitStartAnchor(l);break;case"EndAnchor":this.visitEndAnchor(l);break;case"WordBoundary":this.visitWordBoundary(l);break;case"NonWordBoundary":this.visitNonWordBoundary(l);break;case"Lookahead":this.visitLookahead(l);break;case"NegativeLookahead":this.visitNegativeLookahead(l);break;case"Character":this.visitCharacter(l);break;case"Set":this.visitSet(l);break;case"Group":this.visitGroup(l);break;case"GroupBackReference":this.visitGroupBackReference(l);break;case"Quantifier":this.visitQuantifier(l);break}this.visitChildren(l)},m.prototype.visitPattern=function(l){},m.prototype.visitFlags=function(l){},m.prototype.visitDisjunction=function(l){},m.prototype.visitAlternative=function(l){},m.prototype.visitStartAnchor=function(l){},m.prototype.visitEndAnchor=function(l){},m.prototype.visitWordBoundary=function(l){},m.prototype.visitNonWordBoundary=function(l){},m.prototype.visitLookahead=function(l){},m.prototype.visitNegativeLookahead=function(l){},m.prototype.visitCharacter=function(l){},m.prototype.visitSet=function(l){},m.prototype.visitGroup=function(l){},m.prototype.visitGroupBackReference=function(l){},m.prototype.visitQuantifier=function(l){},{RegExpParser:t,BaseRegExpVisitor:m,VERSION:"0.5.0"}})}),gn=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clearRegExpParserCache=i.getRegExpAst=void 0;var e=pn(),t={},n=new e.RegExpParser;function r(s){var c=s.toString();if(t.hasOwnProperty(c))return t[c];var A=n.pattern(c);return t[c]=A,A}i.getRegExpAst=r;function o(){t={}}i.clearRegExpParserCache=o}),os=ve(i=>{var e=i&&i.__extends||(function(){var m=function(l,d){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,C){p.__proto__=C}||function(p,C){for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(p[E]=C[E])},m(l,d)};return function(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");m(l,d);function p(){this.constructor=l}l.prototype=d===null?Object.create(d):(p.prototype=d.prototype,new p)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.canMatchCharCode=i.firstCharOptimizedIndices=i.getOptimizedStartCodesIndices=i.failedOptimizationPrefixMsg=void 0;var t=pn(),n=Oe(),r=gn(),o=Wi(),s="Complement Sets are not supported for first char optimization";i.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
|
|
79
|
+
`;function c(m,l){l===void 0&&(l=!1);try{var d=r.getRegExpAst(m),p=A(d.value,{},d.flags.ignoreCase);return p}catch(E){if(E.message===s)l&&n.PRINT_WARNING(""+i.failedOptimizationPrefixMsg+(" Unable to optimize: < "+m.toString()+` >
|
|
80
80
|
`)+` Complement Sets cannot be automatically optimized.
|
|
81
81
|
This will disable the lexer's first char optimizations.
|
|
82
82
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var C="";l&&(C=`
|
|
83
83
|
This will disable the lexer's first char optimizations.
|
|
84
84
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),n.PRINT_ERROR(i.failedOptimizationPrefixMsg+`
|
|
85
|
-
`+(" Failed parsing: < "+
|
|
85
|
+
`+(" Failed parsing: < "+m.toString()+` >
|
|
86
86
|
`)+(" Using the regexp-to-ast library version: "+t.VERSION+`
|
|
87
|
-
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+C)}}return[]}i.getOptimizedStartCodesIndices=c;function A(
|
|
88
|
-
`],tracer:function(
|
|
87
|
+
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+C)}}return[]}i.getOptimizedStartCodesIndices=c;function A(m,l,d){switch(m.type){case"Disjunction":for(var p=0;p<m.value.length;p++)A(m.value[p],l,d);break;case"Alternative":for(var C=m.value,p=0;p<C.length;p++){var E=C[p];switch(E.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var y=E;switch(y.type){case"Character":a(y.value,l,d);break;case"Set":if(y.complement===!0)throw Error(s);n.forEach(y.value,function(H){if(typeof H=="number")a(H,l,d);else{var R=H;if(d===!0)for(var M=R.from;M<=R.to;M++)a(M,l,d);else{for(var M=R.from;M<=R.to&&M<o.minOptimizationVal;M++)a(M,l,d);if(R.to>=o.minOptimizationVal)for(var N=R.from>=o.minOptimizationVal?R.from:o.minOptimizationVal,v=R.to,S=o.charCodeToOptimizedIndex(N),_=o.charCodeToOptimizedIndex(v),V=S;V<=_;V++)l[V]=V}}});break;case"Group":A(y.value,l,d);break;default:throw Error("Non Exhaustive Match")}var Q=y.quantifier!==void 0&&y.quantifier.atLeast===0;if(y.type==="Group"&&b(y)===!1||y.type!=="Group"&&Q===!1)break}break;default:throw Error("non exhaustive match!")}return n.values(l)}i.firstCharOptimizedIndices=A;function a(m,l,d){var p=o.charCodeToOptimizedIndex(m);l[p]=p,d===!0&&h(m,l)}function h(m,l){var d=String.fromCharCode(m),p=d.toUpperCase();if(p!==d){var C=o.charCodeToOptimizedIndex(p.charCodeAt(0));l[C]=C}else{var E=d.toLowerCase();if(E!==d){var C=o.charCodeToOptimizedIndex(E.charCodeAt(0));l[C]=C}}}function u(m,l){return n.find(m.value,function(d){if(typeof d=="number")return n.contains(l,d);var p=d;return n.find(l,function(C){return p.from<=C&&C<=p.to})!==void 0})}function b(m){return m.quantifier&&m.quantifier.atLeast===0?!0:m.value?n.isArray(m.value)?n.every(m.value,b):b(m.value):!1}var f=(function(m){e(l,m);function l(d){var p=m.call(this)||this;return p.targetCharCodes=d,p.found=!1,p}return l.prototype.visitChildren=function(d){if(this.found!==!0){switch(d.type){case"Lookahead":this.visitLookahead(d);return;case"NegativeLookahead":this.visitNegativeLookahead(d);return}m.prototype.visitChildren.call(this,d)}},l.prototype.visitCharacter=function(d){n.contains(this.targetCharCodes,d.value)&&(this.found=!0)},l.prototype.visitSet=function(d){d.complement?u(d,this.targetCharCodes)===void 0&&(this.found=!0):u(d,this.targetCharCodes)!==void 0&&(this.found=!0)},l})(t.BaseRegExpVisitor);function I(m,l){if(l instanceof RegExp){var d=r.getRegExpAst(l),p=new f(m);return p.visit(d),p.found}else return n.find(l,function(C){return n.contains(m,C.charCodeAt(0))})!==void 0}i.canMatchCharCode=I}),Wi=ve(i=>{var e=i&&i.__extends||(function(){var U=function(P,z){return U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,ee){X.__proto__=ee}||function(X,ee){for(var le in ee)Object.prototype.hasOwnProperty.call(ee,le)&&(X[le]=ee[le])},U(P,z)};return function(P,z){if(typeof z!="function"&&z!==null)throw new TypeError("Class extends value "+String(z)+" is not a constructor or null");U(P,z);function X(){this.constructor=P}P.prototype=z===null?Object.create(z):(X.prototype=z.prototype,new X)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.charCodeToOptimizedIndex=i.minOptimizationVal=i.buildLineBreakIssueMessage=i.LineTerminatorOptimizedTester=i.isShortPattern=i.isCustomPattern=i.cloneEmptyGroups=i.performWarningRuntimeChecks=i.performRuntimeChecks=i.addStickyFlag=i.addStartOfInput=i.findUnreachablePatterns=i.findModesThatDoNotExist=i.findInvalidGroupType=i.findDuplicatePatterns=i.findUnsupportedFlags=i.findStartOfInputAnchor=i.findEmptyMatchRegExps=i.findEndOfInputAnchor=i.findInvalidPatterns=i.findMissingPatterns=i.validatePatterns=i.analyzeTokenTypes=i.enableSticky=i.disableSticky=i.SUPPORT_STICKY=i.MODES=i.DEFAULT_MODE=void 0;var t=pn(),n=Dt(),r=Oe(),o=os(),s=gn(),c="PATTERN";i.DEFAULT_MODE="defaultMode",i.MODES="modes",i.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function A(){i.SUPPORT_STICKY=!1}i.disableSticky=A;function a(){i.SUPPORT_STICKY=!0}i.enableSticky=a;function h(U,P){P=r.defaults(P,{useSticky:i.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
88
|
+
`],tracer:function(Be,ce){return ce()}});var z=P.tracer;z("initCharCodeToOptimizedIndexMap",function(){Ce()});var X;z("Reject Lexer.NA",function(){X=r.reject(U,function(Be){return Be[c]===n.Lexer.NA})});var ee=!1,le;z("Transform Patterns",function(){ee=!1,le=r.map(X,function(Be){var ce=Be[c];if(r.isRegExp(ce)){var Ue=ce.source;return Ue.length===1&&Ue!=="^"&&Ue!=="$"&&Ue!=="."&&!ce.ignoreCase?Ue:Ue.length===2&&Ue[0]==="\\"&&!r.contains(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],Ue[1])?Ue[1]:P.useSticky?v(ce):N(ce)}else{if(r.isFunction(ce))return ee=!0,{exec:ce};if(r.has(ce,"exec"))return ee=!0,ce;if(typeof ce=="string"){if(ce.length===1)return ce;var k=ce.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),T=new RegExp(k);return P.useSticky?v(T):N(T)}else throw Error("non exhaustive match")}})});var we,Re,Me,We,ze;z("misc mapping",function(){we=r.map(X,function(Be){return Be.tokenTypeIdx}),Re=r.map(X,function(Be){var ce=Be.GROUP;if(ce!==n.Lexer.SKIPPED){if(r.isString(ce))return ce;if(r.isUndefined(ce))return!1;throw Error("non exhaustive match")}}),Me=r.map(X,function(Be){var ce=Be.LONGER_ALT;if(ce){var Ue=r.indexOf(X,ce);return Ue}}),We=r.map(X,function(Be){return Be.PUSH_MODE}),ze=r.map(X,function(Be){return r.has(Be,"POP_MODE")})});var Ke;z("Line Terminator Handling",function(){var Be=ue(P.lineTerminatorCharacters);Ke=r.map(X,function(ce){return!1}),P.positionTracking!=="onlyOffset"&&(Ke=r.map(X,function(ce){if(r.has(ce,"LINE_BREAKS"))return ce.LINE_BREAKS;if($(ce,Be)===!1)return o.canMatchCharCode(Be,ce.PATTERN)}))});var O,Y,K,ie;z("Misc Mapping #2",function(){O=r.map(X,J),Y=r.map(le,q),K=r.reduce(X,function(Be,ce){var Ue=ce.GROUP;return r.isString(Ue)&&Ue!==n.Lexer.SKIPPED&&(Be[Ue]=[]),Be},{}),ie=r.map(le,function(Be,ce){return{pattern:le[ce],longerAlt:Me[ce],canLineTerminator:Ke[ce],isCustom:O[ce],short:Y[ce],group:Re[ce],push:We[ce],pop:ze[ce],tokenTypeIdx:we[ce],tokenType:X[ce]}})});var fe=!0,_e=[];return P.safeMode||z("First Char Optimization",function(){_e=r.reduce(X,function(Be,ce,Ue){if(typeof ce.PATTERN=="string"){var k=ce.PATTERN.charCodeAt(0),T=Ae(k);oe(Be,T,ie[Ue])}else if(r.isArray(ce.START_CHARS_HINT)){var B;r.forEach(ce.START_CHARS_HINT,function(w){var D=typeof w=="string"?w.charCodeAt(0):w,F=Ae(D);B!==F&&(B=F,oe(Be,F,ie[Ue]))})}else if(r.isRegExp(ce.PATTERN))if(ce.PATTERN.unicode)fe=!1,P.ensureOptimizations&&r.PRINT_ERROR(""+o.failedOptimizationPrefixMsg+(" Unable to analyze < "+ce.PATTERN.toString()+` > pattern.
|
|
89
89
|
`)+` The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
90
90
|
This will disable the lexer's first char optimizations.
|
|
91
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var
|
|
91
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var L=o.getOptimizedStartCodesIndices(ce.PATTERN,P.ensureOptimizations);r.isEmpty(L)&&(fe=!1),r.forEach(L,function(w){oe(Be,w,ie[Ue])})}else P.ensureOptimizations&&r.PRINT_ERROR(""+o.failedOptimizationPrefixMsg+(" TokenType: <"+ce.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
92
92
|
`)+` This will disable the lexer's first char optimizations.
|
|
93
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),
|
|
94
|
-
Token Type: ->`+
|
|
95
|
-
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[
|
|
96
|
-
Token Type: ->`+
|
|
97
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[
|
|
93
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),fe=!1;return Be},[])}),z("ArrayPacking",function(){_e=r.packArray(_e)}),{emptyGroups:K,patternIdxToConfig:ie,charCodeToPatternIdxToConfig:_e,hasCustom:ee,canBeOptimized:fe}}i.analyzeTokenTypes=h;function u(U,P){var z=[],X=f(U);z=z.concat(X.errors);var ee=I(X.valid),le=ee.valid;return z=z.concat(ee.errors),z=z.concat(b(le)),z=z.concat(Q(le)),z=z.concat(x(le,P)),z=z.concat(H(le)),z}i.validatePatterns=u;function b(U){var P=[],z=r.filter(U,function(X){return r.isRegExp(X[c])});return P=P.concat(l(z)),P=P.concat(C(z)),P=P.concat(E(z)),P=P.concat(y(z)),P=P.concat(d(z)),P}function f(U){var P=r.filter(U,function(ee){return!r.has(ee,c)}),z=r.map(P,function(ee){return{message:"Token Type: ->"+ee.name+"<- missing static 'PATTERN' property",type:n.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[ee]}}),X=r.difference(U,P);return{errors:z,valid:X}}i.findMissingPatterns=f;function I(U){var P=r.filter(U,function(ee){var le=ee[c];return!r.isRegExp(le)&&!r.isFunction(le)&&!r.has(le,"exec")&&!r.isString(le)}),z=r.map(P,function(ee){return{message:"Token Type: ->"+ee.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:n.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[ee]}}),X=r.difference(U,P);return{errors:z,valid:X}}i.findInvalidPatterns=I;var m=/[^\\][\$]/;function l(U){var P=(function(ee){e(le,ee);function le(){var we=ee!==null&&ee.apply(this,arguments)||this;return we.found=!1,we}return le.prototype.visitEndAnchor=function(we){this.found=!0},le})(t.BaseRegExpVisitor),z=r.filter(U,function(ee){var le=ee[c];try{var we=s.getRegExpAst(le),Re=new P;return Re.visit(we),Re.found}catch{return m.test(le.source)}}),X=r.map(z,function(ee){return{message:`Unexpected RegExp Anchor Error:
|
|
94
|
+
Token Type: ->`+ee.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
95
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[ee]}});return X}i.findEndOfInputAnchor=l;function d(U){var P=r.filter(U,function(X){var ee=X[c];return ee.test("")}),z=r.map(P,function(X){return{message:"Token Type: ->"+X.name+"<- static 'PATTERN' must not match an empty string",type:n.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[X]}});return z}i.findEmptyMatchRegExps=d;var p=/[^\\[][\^]|^\^/;function C(U){var P=(function(ee){e(le,ee);function le(){var we=ee!==null&&ee.apply(this,arguments)||this;return we.found=!1,we}return le.prototype.visitStartAnchor=function(we){this.found=!0},le})(t.BaseRegExpVisitor),z=r.filter(U,function(ee){var le=ee[c];try{var we=s.getRegExpAst(le),Re=new P;return Re.visit(we),Re.found}catch{return p.test(le.source)}}),X=r.map(z,function(ee){return{message:`Unexpected RegExp Anchor Error:
|
|
96
|
+
Token Type: ->`+ee.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
97
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[ee]}});return X}i.findStartOfInputAnchor=C;function E(U){var P=r.filter(U,function(X){var ee=X[c];return ee instanceof RegExp&&(ee.multiline||ee.global)}),z=r.map(P,function(X){return{message:"Token Type: ->"+X.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:n.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[X]}});return z}i.findUnsupportedFlags=E;function y(U){var P=[],z=r.map(U,function(le){return r.reduce(U,function(we,Re){return le.PATTERN.source===Re.PATTERN.source&&!r.contains(P,Re)&&Re.PATTERN!==n.Lexer.NA&&(P.push(Re),we.push(Re)),we},[])});z=r.compact(z);var X=r.filter(z,function(le){return le.length>1}),ee=r.map(X,function(le){var we=r.map(le,function(Me){return Me.name}),Re=r.first(le).PATTERN;return{message:"The same RegExp pattern ->"+Re+"<-"+("has been used in all of the following Token Types: "+we.join(", ")+" <-"),type:n.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:le}});return ee}i.findDuplicatePatterns=y;function Q(U){var P=r.filter(U,function(X){if(!r.has(X,"GROUP"))return!1;var ee=X.GROUP;return ee!==n.Lexer.SKIPPED&&ee!==n.Lexer.NA&&!r.isString(ee)}),z=r.map(P,function(X){return{message:"Token Type: ->"+X.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:n.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[X]}});return z}i.findInvalidGroupType=Q;function x(U,P){var z=r.filter(U,function(ee){return ee.PUSH_MODE!==void 0&&!r.contains(P,ee.PUSH_MODE)}),X=r.map(z,function(ee){var le="Token Type: ->"+ee.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+ee.PUSH_MODE+"<-which does not exist";return{message:le,type:n.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[ee]}});return X}i.findModesThatDoNotExist=x;function H(U){var P=[],z=r.reduce(U,function(X,ee,le){var we=ee.PATTERN;return we===n.Lexer.NA||(r.isString(we)?X.push({str:we,idx:le,tokenType:ee}):r.isRegExp(we)&&M(we)&&X.push({str:we.source,idx:le,tokenType:ee})),X},[]);return r.forEach(U,function(X,ee){r.forEach(z,function(le){var we=le.str,Re=le.idx,Me=le.tokenType;if(ee<Re&&R(we,X.PATTERN)){var We="Token: ->"+Me.name+`<- can never be matched.
|
|
98
98
|
`+("Because it appears AFTER the Token Type ->"+X.name+"<-")+`in the lexer's definition.
|
|
99
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;P.push({message:We,type:n.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[X,
|
|
99
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;P.push({message:We,type:n.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[X,Me]})}})}),P}i.findUnreachablePatterns=H;function R(U,P){if(r.isRegExp(P)){var z=P.exec(U);return z!==null&&z.index===0}else{if(r.isFunction(P))return P(U,0,[],{});if(r.has(P,"exec"))return P.exec(U,0,[],{});if(typeof P=="string")return P===U;throw Error("non exhaustive match")}}function M(U){var P=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return r.find(P,function(z){return U.source.indexOf(z)!==-1})===void 0}function N(U){var P=U.ignoreCase?"i":"";return new RegExp("^(?:"+U.source+")",P)}i.addStartOfInput=N;function v(U){var P=U.ignoreCase?"iy":"y";return new RegExp(""+U.source,P)}i.addStickyFlag=v;function S(U,P,z){var X=[];return r.has(U,i.DEFAULT_MODE)||X.push({message:"A MultiMode Lexer cannot be initialized without a <"+i.DEFAULT_MODE+`> property in its definition
|
|
100
100
|
`,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),r.has(U,i.MODES)||X.push({message:"A MultiMode Lexer cannot be initialized without a <"+i.MODES+`> property in its definition
|
|
101
101
|
`,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),r.has(U,i.MODES)&&r.has(U,i.DEFAULT_MODE)&&!r.has(U.modes,U.defaultMode)&&X.push({message:"A MultiMode Lexer cannot be initialized with a "+i.DEFAULT_MODE+": <"+U.defaultMode+`>which does not exist
|
|
102
|
-
`,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),r.has(U,i.MODES)&&r.forEach(U.modes,function(
|
|
103
|
-
`),type:n.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),X}i.performRuntimeChecks=
|
|
102
|
+
`,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),r.has(U,i.MODES)&&r.forEach(U.modes,function(ee,le){r.forEach(ee,function(we,Re){r.isUndefined(we)&&X.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+le+"> at index: <"+Re+`>
|
|
103
|
+
`),type:n.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),X}i.performRuntimeChecks=S;function _(U,P,z){var X=[],ee=!1,le=r.compact(r.flatten(r.mapValues(U.modes,function(Me){return Me}))),we=r.reject(le,function(Me){return Me[c]===n.Lexer.NA}),Re=ue(z);return P&&r.forEach(we,function(Me){var We=$(Me,Re);if(We!==!1){var ze=ne(Me,We),Ke={message:ze,type:We.issue,tokenType:Me};X.push(Ke)}else r.has(Me,"LINE_BREAKS")?Me.LINE_BREAKS===!0&&(ee=!0):o.canMatchCharCode(Re,Me.PATTERN)&&(ee=!0)}),P&&!ee&&X.push({message:`Warning: No LINE_BREAKS Found.
|
|
104
104
|
This Lexer has been defined to track line and column information,
|
|
105
105
|
But none of the Token Types can be identified as matching a line terminator.
|
|
106
106
|
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
107
|
-
for details.`,type:n.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),X}i.performWarningRuntimeChecks=
|
|
107
|
+
for details.`,type:n.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),X}i.performWarningRuntimeChecks=_;function V(U){var P={},z=r.keys(U);return r.forEach(z,function(X){var ee=U[X];if(r.isArray(ee))P[X]=[];else throw Error("non exhaustive match")}),P}i.cloneEmptyGroups=V;function J(U){var P=U.PATTERN;if(r.isRegExp(P))return!1;if(r.isFunction(P)||r.has(P,"exec"))return!0;if(r.isString(P))return!1;throw Error("non exhaustive match")}i.isCustomPattern=J;function q(U){return r.isString(U)&&U.length===1?U.charCodeAt(0):!1}i.isShortPattern=q,i.LineTerminatorOptimizedTester={test:function(U){for(var P=U.length,z=this.lastIndex;z<P;z++){var X=U.charCodeAt(z);if(X===10)return this.lastIndex=z+1,!0;if(X===13)return U.charCodeAt(z+1)===10?this.lastIndex=z+2:this.lastIndex=z+1,!0}return!1},lastIndex:0};function $(U,P){if(r.has(U,"LINE_BREAKS"))return!1;if(r.isRegExp(U.PATTERN)){try{o.canMatchCharCode(P,U.PATTERN)}catch(z){return{issue:n.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:z.message}}return!1}else{if(r.isString(U.PATTERN))return!1;if(J(U))return{issue:n.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function ne(U,P){if(P.issue===n.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
108
108
|
`+(" The problem is in the <"+U.name+`> Token Type
|
|
109
109
|
`)+(" Root cause: "+P.errMsg+`.
|
|
110
110
|
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(P.issue===n.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
111
111
|
`+(" The problem is in the <"+U.name+`> Token Type
|
|
112
|
-
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}i.buildLineBreakIssueMessage=
|
|
112
|
+
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}i.buildLineBreakIssueMessage=ne;function ue(U){var P=r.map(U,function(z){return r.isString(z)&&z.length>0?z.charCodeAt(0):z});return P}function oe(U,P,z){U[P]===void 0?U[P]=[z]:U[P].push(z)}i.minOptimizationVal=256;var ae=[];function Ae(U){return U<i.minOptimizationVal?U:ae[U]}i.charCodeToOptimizedIndex=Ae;function Ce(){if(r.isEmpty(ae)){ae=new Array(65536);for(var U=0;U<65536;U++)ae[U]=U>255?255+~~(U/255):U}}}),Qt=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isTokenType=i.hasExtendingTokensTypesMapProperty=i.hasExtendingTokensTypesProperty=i.hasCategoriesProperty=i.hasShortKeyProperty=i.singleAssignCategoriesToksMap=i.assignCategoriesMapProp=i.assignCategoriesTokensProp=i.assignTokenDefaultProps=i.expandCategories=i.augmentTokenTypes=i.tokenIdxToClass=i.tokenShortNameIdx=i.tokenStructuredMatcherNoCategories=i.tokenStructuredMatcher=void 0;var e=Oe();function t(m,l){var d=m.tokenTypeIdx;return d===l.tokenTypeIdx?!0:l.isParent===!0&&l.categoryMatchesMap[d]===!0}i.tokenStructuredMatcher=t;function n(m,l){return m.tokenTypeIdx===l.tokenTypeIdx}i.tokenStructuredMatcherNoCategories=n,i.tokenShortNameIdx=1,i.tokenIdxToClass={};function r(m){var l=o(m);s(l),A(l),c(l),e.forEach(l,function(d){d.isParent=d.categoryMatches.length>0})}i.augmentTokenTypes=r;function o(m){for(var l=e.cloneArr(m),d=m,p=!0;p;){d=e.compact(e.flatten(e.map(d,function(E){return E.CATEGORIES})));var C=e.difference(d,l);l=l.concat(C),e.isEmpty(C)?p=!1:d=C}return l}i.expandCategories=o;function s(m){e.forEach(m,function(l){h(l)||(i.tokenIdxToClass[i.tokenShortNameIdx]=l,l.tokenTypeIdx=i.tokenShortNameIdx++),u(l)&&!e.isArray(l.CATEGORIES)&&(l.CATEGORIES=[l.CATEGORIES]),u(l)||(l.CATEGORIES=[]),b(l)||(l.categoryMatches=[]),f(l)||(l.categoryMatchesMap={})})}i.assignTokenDefaultProps=s;function c(m){e.forEach(m,function(l){l.categoryMatches=[],e.forEach(l.categoryMatchesMap,function(d,p){l.categoryMatches.push(i.tokenIdxToClass[p].tokenTypeIdx)})})}i.assignCategoriesTokensProp=c;function A(m){e.forEach(m,function(l){a([],l)})}i.assignCategoriesMapProp=A;function a(m,l){e.forEach(m,function(d){l.categoryMatchesMap[d.tokenTypeIdx]=!0}),e.forEach(l.CATEGORIES,function(d){var p=m.concat(l);e.contains(p,d)||a(p,d)})}i.singleAssignCategoriesToksMap=a;function h(m){return e.has(m,"tokenTypeIdx")}i.hasShortKeyProperty=h;function u(m){return e.has(m,"CATEGORIES")}i.hasCategoriesProperty=u;function b(m){return e.has(m,"categoryMatches")}i.hasExtendingTokensTypesProperty=b;function f(m){return e.has(m,"categoryMatchesMap")}i.hasExtendingTokensTypesMapProperty=f;function I(m){return e.has(m,"tokenTypeIdx")}i.isTokenType=I}),Yi=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defaultLexerErrorProvider=void 0,i.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,n,r,o){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+","+(" skipped "+n+" characters.")}}}),Dt=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Lexer=i.LexerDefinitionErrorType=void 0;var e=Wi(),t=Oe(),n=Qt(),r=Yi(),o=gn();(function(A){A[A.MISSING_PATTERN=0]="MISSING_PATTERN",A[A.INVALID_PATTERN=1]="INVALID_PATTERN",A[A.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",A[A.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",A[A.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",A[A.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",A[A.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",A[A.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",A[A.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",A[A.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",A[A.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",A[A.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",A[A.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",A[A.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",A[A.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",A[A.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",A[A.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"})(i.LexerDefinitionErrorType||(i.LexerDefinitionErrorType={}));var s={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
113
113
|
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:r.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(s);var c=(function(){function A(a,h){var u=this;if(h===void 0&&(h=s),this.lexerDefinition=a,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},typeof h=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
114
114
|
a boolean 2nd argument is no longer supported`);this.config=t.merge(s,h);var b=this.config.traceInitPerf;b===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof b=="number"&&(this.traceInitMaxIdent=b,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var f,I=!0;u.TRACE_INIT("Lexer Config handling",function(){if(u.config.lineTerminatorsPattern===s.lineTerminatorsPattern)u.config.lineTerminatorsPattern=e.LineTerminatorOptimizedTester;else if(u.config.lineTerminatorCharacters===s.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
115
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(h.safeMode&&h.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');u.trackStartLines=/full|onlyStart/i.test(u.config.positionTracking),u.trackEndLines=/full/i.test(u.config.positionTracking),t.isArray(a)?(f={modes:{}},f.modes[e.DEFAULT_MODE]=t.cloneArr(a),f[e.DEFAULT_MODE]=e.DEFAULT_MODE):(I=!1,f=t.cloneObj(a))}),u.config.skipValidations===!1&&(u.TRACE_INIT("performRuntimeChecks",function(){u.lexerDefinitionErrors=u.lexerDefinitionErrors.concat(e.performRuntimeChecks(f,u.trackStartLines,u.config.lineTerminatorCharacters))}),u.TRACE_INIT("performWarningRuntimeChecks",function(){u.lexerDefinitionWarning=u.lexerDefinitionWarning.concat(e.performWarningRuntimeChecks(f,u.trackStartLines,u.config.lineTerminatorCharacters))})),f.modes=f.modes?f.modes:{},t.forEach(f.modes,function(p,C){f.modes[C]=t.reject(p,function(
|
|
115
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(h.safeMode&&h.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');u.trackStartLines=/full|onlyStart/i.test(u.config.positionTracking),u.trackEndLines=/full/i.test(u.config.positionTracking),t.isArray(a)?(f={modes:{}},f.modes[e.DEFAULT_MODE]=t.cloneArr(a),f[e.DEFAULT_MODE]=e.DEFAULT_MODE):(I=!1,f=t.cloneObj(a))}),u.config.skipValidations===!1&&(u.TRACE_INIT("performRuntimeChecks",function(){u.lexerDefinitionErrors=u.lexerDefinitionErrors.concat(e.performRuntimeChecks(f,u.trackStartLines,u.config.lineTerminatorCharacters))}),u.TRACE_INIT("performWarningRuntimeChecks",function(){u.lexerDefinitionWarning=u.lexerDefinitionWarning.concat(e.performWarningRuntimeChecks(f,u.trackStartLines,u.config.lineTerminatorCharacters))})),f.modes=f.modes?f.modes:{},t.forEach(f.modes,function(p,C){f.modes[C]=t.reject(p,function(E){return t.isUndefined(E)})});var m=t.keys(f.modes);if(t.forEach(f.modes,function(p,C){u.TRACE_INIT("Mode: <"+C+"> processing",function(){if(u.modes.push(C),u.config.skipValidations===!1&&u.TRACE_INIT("validatePatterns",function(){u.lexerDefinitionErrors=u.lexerDefinitionErrors.concat(e.validatePatterns(p,m))}),t.isEmpty(u.lexerDefinitionErrors)){n.augmentTokenTypes(p);var E;u.TRACE_INIT("analyzeTokenTypes",function(){E=e.analyzeTokenTypes(p,{lineTerminatorCharacters:u.config.lineTerminatorCharacters,positionTracking:h.positionTracking,ensureOptimizations:h.ensureOptimizations,safeMode:h.safeMode,tracer:u.TRACE_INIT.bind(u)})}),u.patternIdxToConfig[C]=E.patternIdxToConfig,u.charCodeToPatternIdxToConfig[C]=E.charCodeToPatternIdxToConfig,u.emptyGroups=t.merge(u.emptyGroups,E.emptyGroups),u.hasCustom=E.hasCustom||u.hasCustom,u.canModeBeOptimized[C]=E.canBeOptimized}})}),u.defaultMode=f.defaultMode,!t.isEmpty(u.lexerDefinitionErrors)&&!u.config.deferDefinitionErrorsHandling){var l=t.map(u.lexerDefinitionErrors,function(p){return p.message}),d=l.join(`-----------------------
|
|
116
116
|
`);throw new Error(`Errors detected in definition of Lexer:
|
|
117
|
-
`+d)}t.forEach(u.lexerDefinitionWarning,function(p){t.PRINT_WARNING(p.message)}),u.TRACE_INIT("Choosing sub-methods implementations",function(){if(e.SUPPORT_STICKY?(u.chopInput=t.IDENTITY,u.match=u.matchWithTest):(u.updateLastIndex=t.NOOP,u.match=u.matchWithExec),I&&(u.handleModes=t.NOOP),u.trackStartLines===!1&&(u.computeNewColumn=t.IDENTITY),u.trackEndLines===!1&&(u.updateTokenEndLineColumnLocation=t.NOOP),/full/i.test(u.config.positionTracking))u.createTokenInstance=u.createFullToken;else if(/onlyStart/i.test(u.config.positionTracking))u.createTokenInstance=u.createStartOnlyToken;else if(/onlyOffset/i.test(u.config.positionTracking))u.createTokenInstance=u.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'+u.config.positionTracking+'"');u.hasCustom?(u.addToken=u.addTokenUsingPush,u.handlePayload=u.handlePayloadWithCustom):(u.addToken=u.addTokenUsingMemberAccess,u.handlePayload=u.handlePayloadNoCustom)}),u.TRACE_INIT("Failed Optimization Warnings",function(){var p=t.reduce(u.canModeBeOptimized,function(C,
|
|
117
|
+
`+d)}t.forEach(u.lexerDefinitionWarning,function(p){t.PRINT_WARNING(p.message)}),u.TRACE_INIT("Choosing sub-methods implementations",function(){if(e.SUPPORT_STICKY?(u.chopInput=t.IDENTITY,u.match=u.matchWithTest):(u.updateLastIndex=t.NOOP,u.match=u.matchWithExec),I&&(u.handleModes=t.NOOP),u.trackStartLines===!1&&(u.computeNewColumn=t.IDENTITY),u.trackEndLines===!1&&(u.updateTokenEndLineColumnLocation=t.NOOP),/full/i.test(u.config.positionTracking))u.createTokenInstance=u.createFullToken;else if(/onlyStart/i.test(u.config.positionTracking))u.createTokenInstance=u.createStartOnlyToken;else if(/onlyOffset/i.test(u.config.positionTracking))u.createTokenInstance=u.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'+u.config.positionTracking+'"');u.hasCustom?(u.addToken=u.addTokenUsingPush,u.handlePayload=u.handlePayloadWithCustom):(u.addToken=u.addTokenUsingMemberAccess,u.handlePayload=u.handlePayloadNoCustom)}),u.TRACE_INIT("Failed Optimization Warnings",function(){var p=t.reduce(u.canModeBeOptimized,function(C,E,y){return E===!1&&C.push(y),C},[]);if(h.ensureOptimizations&&!t.isEmpty(p))throw Error("Lexer Modes: < "+p.join(", ")+` > cannot be optimized.
|
|
118
118
|
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
119
119
|
Or inspect the console log for details on how to resolve these issues.`)}),u.TRACE_INIT("clearRegExpParserCache",function(){o.clearRegExpParserCache()}),u.TRACE_INIT("toFastProperties",function(){t.toFastProperties(u)})})}return A.prototype.tokenize=function(a,h){if(h===void 0&&(h=this.defaultMode),!t.isEmpty(this.lexerDefinitionErrors)){var u=t.map(this.lexerDefinitionErrors,function(I){return I.message}),b=u.join(`-----------------------
|
|
120
120
|
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
121
|
-
`+b)}var f=this.tokenizeInternal(a,h);return f},A.prototype.tokenizeInternal=function(a,h){var u=this,b,f,I,
|
|
122
|
-
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return e.has(m,A)&&(Q.CATEGORIES=m[A]),n.augmentTokenTypes([Q]),e.has(m,a)&&(Q.LABEL=m[a]),e.has(m,h)&&(Q.GROUP=m[h]),e.has(m,b)&&(Q.POP_MODE=m[b]),e.has(m,u)&&(Q.PUSH_MODE=m[u]),e.has(m,f)&&(Q.LONGER_ALT=m[f]),e.has(m,I)&&(Q.LINE_BREAKS=m[I]),e.has(m,E)&&(Q.START_CHARS_HINT=m[E]),Q}i.EOF=l({name:"EOF",pattern:t.Lexer.NA}),n.augmentTokenTypes([i.EOF]);function p(m,y,Q,_,j,v,M,x){return{image:y,startOffset:Q,endOffset:_,startLine:j,endLine:v,startColumn:M,endColumn:x,tokenTypeIdx:m.tokenTypeIdx,tokenType:m}}i.createTokenInstance=p;function C(m,y){return n.tokenStructuredMatcher(m,y)}i.tokenMatcher=C}),Ze=Qe(i=>{var e=i&&i.__extends||(function(){var d=function(p,C){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,y){m.__proto__=y}||function(m,y){for(var Q in y)Object.prototype.hasOwnProperty.call(y,Q)&&(m[Q]=y[Q])},d(p,C)};return function(p,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");d(p,C);function m(){this.constructor=p}p.prototype=C===null?Object.create(C):(m.prototype=C.prototype,new m)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.serializeProduction=i.serializeGrammar=i.Terminal=i.Alternation=i.RepetitionWithSeparator=i.Repetition=i.RepetitionMandatoryWithSeparator=i.RepetitionMandatory=i.Option=i.Alternative=i.Rule=i.NonTerminal=i.AbstractProduction=void 0;var t=De(),n=ft(),r=(function(){function d(p){this._definition=p}return Object.defineProperty(d.prototype,"definition",{get:function(){return this._definition},set:function(p){this._definition=p},enumerable:!1,configurable:!0}),d.prototype.accept=function(p){p.visit(this),t.forEach(this.definition,function(C){C.accept(p)})},d})();i.AbstractProduction=r;var o=(function(d){e(p,d);function p(C){var m=d.call(this,[])||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return Object.defineProperty(p.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(C){},enumerable:!1,configurable:!0}),p.prototype.accept=function(C){C.visit(this)},p})(r);i.NonTerminal=o;var s=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.orgText="",t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(r);i.Rule=s;var c=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.ignoreAmbiguities=!1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(r);i.Alternative=c;var A=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(r);i.Option=A;var a=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(r);i.RepetitionMandatory=a;var h=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(r);i.RepetitionMandatoryWithSeparator=h;var u=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(r);i.Repetition=u;var b=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(r);i.RepetitionWithSeparator=b;var f=(function(d){e(p,d);function p(C){var m=d.call(this,C.definition)||this;return m.idx=1,m.ignoreAmbiguities=!1,m.hasPredicates=!1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return Object.defineProperty(p.prototype,"definition",{get:function(){return this._definition},set:function(C){this._definition=C},enumerable:!1,configurable:!0}),p})(r);i.Alternation=f;var I=(function(){function d(p){this.idx=1,t.assign(this,t.pick(p,function(C){return C!==void 0}))}return d.prototype.accept=function(p){p.visit(this)},d})();i.Terminal=I;function E(d){return t.map(d,l)}i.serializeGrammar=E;function l(d){function p(y){return t.map(y,l)}if(d instanceof o)return{type:"NonTerminal",name:d.nonTerminalName,idx:d.idx};if(d instanceof c)return{type:"Alternative",definition:p(d.definition)};if(d instanceof A)return{type:"Option",idx:d.idx,definition:p(d.definition)};if(d instanceof a)return{type:"RepetitionMandatory",idx:d.idx,definition:p(d.definition)};if(d instanceof h)return{type:"RepetitionMandatoryWithSeparator",idx:d.idx,separator:l(new I({terminalType:d.separator})),definition:p(d.definition)};if(d instanceof b)return{type:"RepetitionWithSeparator",idx:d.idx,separator:l(new I({terminalType:d.separator})),definition:p(d.definition)};if(d instanceof u)return{type:"Repetition",idx:d.idx,definition:p(d.definition)};if(d instanceof f)return{type:"Alternation",idx:d.idx,definition:p(d.definition)};if(d instanceof I){var C={type:"Terminal",name:d.terminalType.name,label:n.tokenLabel(d.terminalType),idx:d.idx},m=d.terminalType.PATTERN;return d.terminalType.PATTERN&&(C.pattern=t.isRegExp(m)?m.source:m),C}else{if(d instanceof s)return{type:"Rule",name:d.name,orgText:d.orgText,definition:p(d.definition)};throw Error("non exhaustive match")}}i.serializeProduction=l}),pn=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RestWalker=void 0;var e=De(),t=Ze(),n=(function(){function o(){}return o.prototype.walk=function(s,c){var A=this;c===void 0&&(c=[]),e.forEach(s.definition,function(a,h){var u=e.drop(s.definition,h+1);if(a instanceof t.NonTerminal)A.walkProdRef(a,u,c);else if(a instanceof t.Terminal)A.walkTerminal(a,u,c);else if(a instanceof t.Alternative)A.walkFlat(a,u,c);else if(a instanceof t.Option)A.walkOption(a,u,c);else if(a instanceof t.RepetitionMandatory)A.walkAtLeastOne(a,u,c);else if(a instanceof t.RepetitionMandatoryWithSeparator)A.walkAtLeastOneSep(a,u,c);else if(a instanceof t.RepetitionWithSeparator)A.walkManySep(a,u,c);else if(a instanceof t.Repetition)A.walkMany(a,u,c);else if(a instanceof t.Alternation)A.walkOr(a,u,c);else throw Error("non exhaustive match")})},o.prototype.walkTerminal=function(s,c,A){},o.prototype.walkProdRef=function(s,c,A){},o.prototype.walkFlat=function(s,c,A){var a=c.concat(A);this.walk(s,a)},o.prototype.walkOption=function(s,c,A){var a=c.concat(A);this.walk(s,a)},o.prototype.walkAtLeastOne=function(s,c,A){var a=[new t.Option({definition:s.definition})].concat(c,A);this.walk(s,a)},o.prototype.walkAtLeastOneSep=function(s,c,A){var a=r(s,c,A);this.walk(s,a)},o.prototype.walkMany=function(s,c,A){var a=[new t.Option({definition:s.definition})].concat(c,A);this.walk(s,a)},o.prototype.walkManySep=function(s,c,A){var a=r(s,c,A);this.walk(s,a)},o.prototype.walkOr=function(s,c,A){var a=this,h=c.concat(A);e.forEach(s.definition,function(u){var b=new t.Alternative({definition:[u]});a.walk(b,h)})},o})();i.RestWalker=n;function r(o,s,c){var A=[new t.Option({definition:[new t.Terminal({terminalType:o.separator})].concat(o.definition)})],a=A.concat(s,c);return a}}),kt=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GAstVisitor=void 0;var e=Ze(),t=(function(){function n(){}return n.prototype.visit=function(r){var o=r;switch(o.constructor){case e.NonTerminal:return this.visitNonTerminal(o);case e.Alternative:return this.visitAlternative(o);case e.Option:return this.visitOption(o);case e.RepetitionMandatory:return this.visitRepetitionMandatory(o);case e.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(o);case e.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(o);case e.Repetition:return this.visitRepetition(o);case e.Alternation:return this.visitAlternation(o);case e.Terminal:return this.visitTerminal(o);case e.Rule:return this.visitRule(o);default:throw Error("non exhaustive match")}},n.prototype.visitNonTerminal=function(r){},n.prototype.visitAlternative=function(r){},n.prototype.visitOption=function(r){},n.prototype.visitRepetition=function(r){},n.prototype.visitRepetitionMandatory=function(r){},n.prototype.visitRepetitionMandatoryWithSeparator=function(r){},n.prototype.visitRepetitionWithSeparator=function(r){},n.prototype.visitAlternation=function(r){},n.prototype.visitTerminal=function(r){},n.prototype.visitRule=function(r){},n})();i.GAstVisitor=t}),Dt=Qe(i=>{var e=i&&i.__extends||(function(){var b=function(f,I){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,l){E.__proto__=l}||function(E,l){for(var d in l)Object.prototype.hasOwnProperty.call(l,d)&&(E[d]=l[d])},b(f,I)};return function(f,I){if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");b(f,I);function E(){this.constructor=f}f.prototype=I===null?Object.create(I):(E.prototype=I.prototype,new E)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.collectMethods=i.DslMethodsCollectorVisitor=i.getProductionDslName=i.isBranchingProd=i.isOptionalProd=i.isSequenceProd=void 0;var t=De(),n=Ze(),r=kt();function o(b){return b instanceof n.Alternative||b instanceof n.Option||b instanceof n.Repetition||b instanceof n.RepetitionMandatory||b instanceof n.RepetitionMandatoryWithSeparator||b instanceof n.RepetitionWithSeparator||b instanceof n.Terminal||b instanceof n.Rule}i.isSequenceProd=o;function s(b,f){f===void 0&&(f=[]);var I=b instanceof n.Option||b instanceof n.Repetition||b instanceof n.RepetitionWithSeparator;return I?!0:b instanceof n.Alternation?t.some(b.definition,function(E){return s(E,f)}):b instanceof n.NonTerminal&&t.contains(f,b)?!1:b instanceof n.AbstractProduction?(b instanceof n.NonTerminal&&f.push(b),t.every(b.definition,function(E){return s(E,f)})):!1}i.isOptionalProd=s;function c(b){return b instanceof n.Alternation}i.isBranchingProd=c;function A(b){if(b instanceof n.NonTerminal)return"SUBRULE";if(b instanceof n.Option)return"OPTION";if(b instanceof n.Alternation)return"OR";if(b instanceof n.RepetitionMandatory)return"AT_LEAST_ONE";if(b instanceof n.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(b instanceof n.RepetitionWithSeparator)return"MANY_SEP";if(b instanceof n.Repetition)return"MANY";if(b instanceof n.Terminal)return"CONSUME";throw Error("non exhaustive match")}i.getProductionDslName=A;var a=(function(b){e(f,b);function f(){var I=b!==null&&b.apply(this,arguments)||this;return I.separator="-",I.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},I}return f.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},f.prototype.visitTerminal=function(I){var E=I.terminalType.name+this.separator+"Terminal";t.has(this.dslMethods,E)||(this.dslMethods[E]=[]),this.dslMethods[E].push(I)},f.prototype.visitNonTerminal=function(I){var E=I.nonTerminalName+this.separator+"Terminal";t.has(this.dslMethods,E)||(this.dslMethods[E]=[]),this.dslMethods[E].push(I)},f.prototype.visitOption=function(I){this.dslMethods.option.push(I)},f.prototype.visitRepetitionWithSeparator=function(I){this.dslMethods.repetitionWithSeparator.push(I)},f.prototype.visitRepetitionMandatory=function(I){this.dslMethods.repetitionMandatory.push(I)},f.prototype.visitRepetitionMandatoryWithSeparator=function(I){this.dslMethods.repetitionMandatoryWithSeparator.push(I)},f.prototype.visitRepetition=function(I){this.dslMethods.repetition.push(I)},f.prototype.visitAlternation=function(I){this.dslMethods.alternation.push(I)},f})(r.GAstVisitor);i.DslMethodsCollectorVisitor=a;var h=new a;function u(b){h.reset(),b.accept(h);var f=h.dslMethods;return h.reset(),f}i.collectMethods=u}),Wi=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.firstForTerminal=i.firstForBranching=i.firstForSequence=i.first=void 0;var e=De(),t=Ze(),n=Dt();function r(A){if(A instanceof t.NonTerminal)return r(A.referencedRule);if(A instanceof t.Terminal)return c(A);if(n.isSequenceProd(A))return o(A);if(n.isBranchingProd(A))return s(A);throw Error("non exhaustive match")}i.first=r;function o(A){for(var a=[],h=A.definition,u=0,b=h.length>u,f,I=!0;b&&I;)f=h[u],I=n.isOptionalProd(f),a=a.concat(r(f)),u=u+1,b=h.length>u;return e.uniq(a)}i.firstForSequence=o;function s(A){var a=e.map(A.definition,function(h){return r(h)});return e.uniq(e.flatten(a))}i.firstForBranching=s;function c(A){return[A.terminalType]}i.firstForTerminal=c}),Yi=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IN=void 0,i.IN="_~IN~_"}),rs=Qe(i=>{var e=i&&i.__extends||(function(){var u=function(b,f){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,E){I.__proto__=E}||function(I,E){for(var l in E)Object.prototype.hasOwnProperty.call(E,l)&&(I[l]=E[l])},u(b,f)};return function(b,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");u(b,f);function I(){this.constructor=b}b.prototype=f===null?Object.create(f):(I.prototype=f.prototype,new I)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.buildInProdFollowPrefix=i.buildBetweenProdsFollowPrefix=i.computeAllProdsFollows=i.ResyncFollowsWalker=void 0;var t=pn(),n=Wi(),r=De(),o=Yi(),s=Ze(),c=(function(u){e(b,u);function b(f){var I=u.call(this)||this;return I.topProd=f,I.follows={},I}return b.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},b.prototype.walkTerminal=function(f,I,E){},b.prototype.walkProdRef=function(f,I,E){var l=a(f.referencedRule,f.idx)+this.topProd.name,d=I.concat(E),p=new s.Alternative({definition:d}),C=n.first(p);this.follows[l]=C},b})(t.RestWalker);i.ResyncFollowsWalker=c;function A(u){var b={};return r.forEach(u,function(f){var I=new c(f).startWalking();r.assign(b,I)}),b}i.computeAllProdsFollows=A;function a(u,b){return u.name+b+o.IN}i.buildBetweenProdsFollowPrefix=a;function h(u){var b=u.terminalType.name;return b+u.idx+o.IN}i.buildInProdFollowPrefix=h}),Ft=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defaultGrammarValidatorErrorProvider=i.defaultGrammarResolverErrorProvider=i.defaultParserErrorProvider=void 0;var e=ft(),t=De(),n=De(),r=Ze(),o=Dt();i.defaultParserErrorProvider={buildMismatchTokenMessage:function(s){var c=s.expected,A=s.actual;s.previous,s.ruleName;var a=e.hasTokenLabel(c),h=a?"--> "+e.tokenLabel(c)+" <--":"token of type --> "+c.name+" <--",u="Expecting "+h+" but found --> '"+A.image+"' <--";return u},buildNotAllInputParsedMessage:function(s){var c=s.firstRedundant;return s.ruleName,"Redundant input, expecting EOF but found: "+c.image},buildNoViableAltMessage:function(s){var c=s.expectedPathsPerAlt,A=s.actual;s.previous;var a=s.customUserDescription;s.ruleName;var h="Expecting: ",u=n.first(A).image,b=`
|
|
123
|
-
but found: '`+u+"'";if(a)return h+a+b;var f=n.reduce(c,function(d,p){return d.concat(p)},[]),I=n.map(f,function(d){return"["+n.map(d,function(p){return e.tokenLabel(p)}).join(", ")+"]"}),
|
|
124
|
-
`+
|
|
121
|
+
`+b)}var f=this.tokenizeInternal(a,h);return f},A.prototype.tokenizeInternal=function(a,h){var u=this,b,f,I,m,l,d,p,C,E,y,Q,x,H,R,M=a,N=M.length,v=0,S=0,_=this.hasCustom?0:Math.floor(a.length/10),V=new Array(_),J=[],q=this.trackStartLines?1:void 0,$=this.trackStartLines?1:void 0,ne=e.cloneEmptyGroups(this.emptyGroups),ue=this.trackStartLines,oe=this.config.lineTerminatorsPattern,ae=0,Ae=[],Ce=[],U=[],P=[];Object.freeze(P);var z=void 0;function X(){return Ae}function ee(B){var L=e.charCodeToOptimizedIndex(B),w=Ce[L];return w===void 0?P:w}var le=function(B){if(U.length===1&&B.tokenType.PUSH_MODE===void 0){var L=u.config.errorMessageProvider.buildUnableToPopLexerModeMessage(B);J.push({offset:B.startOffset,line:B.startLine!==void 0?B.startLine:void 0,column:B.startColumn!==void 0?B.startColumn:void 0,length:B.image.length,message:L})}else{U.pop();var w=t.last(U);Ae=u.patternIdxToConfig[w],Ce=u.charCodeToPatternIdxToConfig[w],ae=Ae.length;var D=u.canModeBeOptimized[w]&&u.config.safeMode===!1;Ce&&D?z=ee:z=X}};function we(B){U.push(B),Ce=this.charCodeToPatternIdxToConfig[B],Ae=this.patternIdxToConfig[B],ae=Ae.length,ae=Ae.length;var L=this.canModeBeOptimized[B]&&this.config.safeMode===!1;Ce&&L?z=ee:z=X}we.call(this,h);for(var Re;v<N;){l=null;var Me=M.charCodeAt(v),We=z(Me),ze=We.length;for(b=0;b<ze;b++){Re=We[b];var Ke=Re.pattern;d=null;var O=Re.short;if(O!==!1?Me===O&&(l=Ke):Re.isCustom===!0?(R=Ke.exec(M,v,V,ne),R!==null?(l=R[0],R.payload!==void 0&&(d=R.payload)):l=null):(this.updateLastIndex(Ke,v),l=this.match(Ke,a,v)),l!==null){if(m=Re.longerAlt,m!==void 0){var Y=Ae[m],K=Y.pattern;p=null,Y.isCustom===!0?(R=K.exec(M,v,V,ne),R!==null?(I=R[0],R.payload!==void 0&&(p=R.payload)):I=null):(this.updateLastIndex(K,v),I=this.match(K,a,v)),I&&I.length>l.length&&(l=I,d=p,Re=Y)}break}}if(l!==null){if(C=l.length,E=Re.group,E!==void 0&&(y=Re.tokenTypeIdx,Q=this.createTokenInstance(l,v,y,Re.tokenType,q,$,C),this.handlePayload(Q,d),E===!1?S=this.addToken(V,S,Q):ne[E].push(Q)),a=this.chopInput(a,C),v=v+C,$=this.computeNewColumn($,C),ue===!0&&Re.canLineTerminator===!0){var ie=0,fe=void 0,_e=void 0;oe.lastIndex=0;do fe=oe.test(l),fe===!0&&(_e=oe.lastIndex-1,ie++);while(fe===!0);ie!==0&&(q=q+ie,$=C-_e,this.updateTokenEndLineColumnLocation(Q,E,_e,ie,q,$,C))}this.handleModes(Re,le,we,Q)}else{for(var Be=v,ce=q,Ue=$,k=!1;!k&&v<N;)for(M.charCodeAt(v),a=this.chopInput(a,1),v++,f=0;f<ae;f++){var T=Ae[f],Ke=T.pattern,O=T.short;if(O!==!1?M.charCodeAt(v)===O&&(k=!0):T.isCustom===!0?k=Ke.exec(M,v,V,ne)!==null:(this.updateLastIndex(Ke,v),k=Ke.exec(a)!==null),k===!0)break}x=v-Be,H=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(M,Be,x,ce,Ue),J.push({offset:Be,line:ce,column:Ue,length:x,message:H})}}return this.hasCustom||(V.length=S),{tokens:V,groups:ne,errors:J}},A.prototype.handleModes=function(a,h,u,b){if(a.pop===!0){var f=a.push;h(b),f!==void 0&&u.call(this,f)}else a.push!==void 0&&u.call(this,a.push)},A.prototype.chopInput=function(a,h){return a.substring(h)},A.prototype.updateLastIndex=function(a,h){a.lastIndex=h},A.prototype.updateTokenEndLineColumnLocation=function(a,h,u,b,f,I,m){var l,d;h!==void 0&&(l=u===m-1,d=l?-1:0,b===1&&l===!0||(a.endLine=f+d,a.endColumn=I-1+-d))},A.prototype.computeNewColumn=function(a,h){return a+h},A.prototype.createTokenInstance=function(){for(var a=[],h=0;h<arguments.length;h++)a[h]=arguments[h];return null},A.prototype.createOffsetOnlyToken=function(a,h,u,b){return{image:a,startOffset:h,tokenTypeIdx:u,tokenType:b}},A.prototype.createStartOnlyToken=function(a,h,u,b,f,I){return{image:a,startOffset:h,startLine:f,startColumn:I,tokenTypeIdx:u,tokenType:b}},A.prototype.createFullToken=function(a,h,u,b,f,I,m){return{image:a,startOffset:h,endOffset:h+m-1,startLine:f,endLine:f,startColumn:I,endColumn:I+m-1,tokenTypeIdx:u,tokenType:b}},A.prototype.addToken=function(a,h,u){return 666},A.prototype.addTokenUsingPush=function(a,h,u){return a.push(u),h},A.prototype.addTokenUsingMemberAccess=function(a,h,u){return a[h]=u,h++,h},A.prototype.handlePayload=function(a,h){},A.prototype.handlePayloadNoCustom=function(a,h){},A.prototype.handlePayloadWithCustom=function(a,h){h!==null&&(a.payload=h)},A.prototype.match=function(a,h,u){return null},A.prototype.matchWithTest=function(a,h,u){var b=a.test(h);return b===!0?h.substring(u,a.lastIndex):null},A.prototype.matchWithExec=function(a,h){var u=a.exec(h);return u!==null?u[0]:u},A.prototype.TRACE_INIT=function(a,h){if(this.traceInitPerf===!0){this.traceInitIndent++;var u=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(u+"--> <"+a+">");var b=t.timer(h),f=b.time,I=b.value,m=f>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&m(u+"<-- <"+a+"> time: "+f+"ms"),this.traceInitIndent--,I}else return h()},A.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",A.NA=/NOT_APPLICABLE/,A})();i.Lexer=c}),ft=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tokenMatcher=i.createTokenInstance=i.EOF=i.createToken=i.hasTokenLabel=i.tokenName=i.tokenLabel=void 0;var e=Oe(),t=Dt(),n=Qt();function r(E){return s(E)?E.LABEL:E.name}i.tokenLabel=r;function o(E){return E.name}i.tokenName=o;function s(E){return e.isString(E.LABEL)&&E.LABEL!==""}i.hasTokenLabel=s;var c="parent",A="categories",a="label",h="group",u="push_mode",b="pop_mode",f="longer_alt",I="line_breaks",m="start_chars_hint";function l(E){return d(E)}i.createToken=l;function d(E){var y=E.pattern,Q={};if(Q.name=E.name,e.isUndefined(y)||(Q.PATTERN=y),e.has(E,c))throw`The parent property is no longer supported.
|
|
122
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return e.has(E,A)&&(Q.CATEGORIES=E[A]),n.augmentTokenTypes([Q]),e.has(E,a)&&(Q.LABEL=E[a]),e.has(E,h)&&(Q.GROUP=E[h]),e.has(E,b)&&(Q.POP_MODE=E[b]),e.has(E,u)&&(Q.PUSH_MODE=E[u]),e.has(E,f)&&(Q.LONGER_ALT=E[f]),e.has(E,I)&&(Q.LINE_BREAKS=E[I]),e.has(E,m)&&(Q.START_CHARS_HINT=E[m]),Q}i.EOF=l({name:"EOF",pattern:t.Lexer.NA}),n.augmentTokenTypes([i.EOF]);function p(E,y,Q,x,H,R,M,N){return{image:y,startOffset:Q,endOffset:x,startLine:H,endLine:R,startColumn:M,endColumn:N,tokenTypeIdx:E.tokenTypeIdx,tokenType:E}}i.createTokenInstance=p;function C(E,y){return n.tokenStructuredMatcher(E,y)}i.tokenMatcher=C}),Ze=ve(i=>{var e=i&&i.__extends||(function(){var d=function(p,C){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,y){E.__proto__=y}||function(E,y){for(var Q in y)Object.prototype.hasOwnProperty.call(y,Q)&&(E[Q]=y[Q])},d(p,C)};return function(p,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");d(p,C);function E(){this.constructor=p}p.prototype=C===null?Object.create(C):(E.prototype=C.prototype,new E)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.serializeProduction=i.serializeGrammar=i.Terminal=i.Alternation=i.RepetitionWithSeparator=i.Repetition=i.RepetitionMandatoryWithSeparator=i.RepetitionMandatory=i.Option=i.Alternative=i.Rule=i.NonTerminal=i.AbstractProduction=void 0;var t=Oe(),n=ft(),r=(function(){function d(p){this._definition=p}return Object.defineProperty(d.prototype,"definition",{get:function(){return this._definition},set:function(p){this._definition=p},enumerable:!1,configurable:!0}),d.prototype.accept=function(p){p.visit(this),t.forEach(this.definition,function(C){C.accept(p)})},d})();i.AbstractProduction=r;var o=(function(d){e(p,d);function p(C){var E=d.call(this,[])||this;return E.idx=1,t.assign(E,t.pick(C,function(y){return y!==void 0})),E}return Object.defineProperty(p.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(C){},enumerable:!1,configurable:!0}),p.prototype.accept=function(C){C.visit(this)},p})(r);i.NonTerminal=o;var s=(function(d){e(p,d);function p(C){var E=d.call(this,C.definition)||this;return E.orgText="",t.assign(E,t.pick(C,function(y){return y!==void 0})),E}return p})(r);i.Rule=s;var c=(function(d){e(p,d);function p(C){var E=d.call(this,C.definition)||this;return E.ignoreAmbiguities=!1,t.assign(E,t.pick(C,function(y){return y!==void 0})),E}return p})(r);i.Alternative=c;var A=(function(d){e(p,d);function p(C){var E=d.call(this,C.definition)||this;return E.idx=1,t.assign(E,t.pick(C,function(y){return y!==void 0})),E}return p})(r);i.Option=A;var a=(function(d){e(p,d);function p(C){var E=d.call(this,C.definition)||this;return E.idx=1,t.assign(E,t.pick(C,function(y){return y!==void 0})),E}return p})(r);i.RepetitionMandatory=a;var h=(function(d){e(p,d);function p(C){var E=d.call(this,C.definition)||this;return E.idx=1,t.assign(E,t.pick(C,function(y){return y!==void 0})),E}return p})(r);i.RepetitionMandatoryWithSeparator=h;var u=(function(d){e(p,d);function p(C){var E=d.call(this,C.definition)||this;return E.idx=1,t.assign(E,t.pick(C,function(y){return y!==void 0})),E}return p})(r);i.Repetition=u;var b=(function(d){e(p,d);function p(C){var E=d.call(this,C.definition)||this;return E.idx=1,t.assign(E,t.pick(C,function(y){return y!==void 0})),E}return p})(r);i.RepetitionWithSeparator=b;var f=(function(d){e(p,d);function p(C){var E=d.call(this,C.definition)||this;return E.idx=1,E.ignoreAmbiguities=!1,E.hasPredicates=!1,t.assign(E,t.pick(C,function(y){return y!==void 0})),E}return Object.defineProperty(p.prototype,"definition",{get:function(){return this._definition},set:function(C){this._definition=C},enumerable:!1,configurable:!0}),p})(r);i.Alternation=f;var I=(function(){function d(p){this.idx=1,t.assign(this,t.pick(p,function(C){return C!==void 0}))}return d.prototype.accept=function(p){p.visit(this)},d})();i.Terminal=I;function m(d){return t.map(d,l)}i.serializeGrammar=m;function l(d){function p(y){return t.map(y,l)}if(d instanceof o)return{type:"NonTerminal",name:d.nonTerminalName,idx:d.idx};if(d instanceof c)return{type:"Alternative",definition:p(d.definition)};if(d instanceof A)return{type:"Option",idx:d.idx,definition:p(d.definition)};if(d instanceof a)return{type:"RepetitionMandatory",idx:d.idx,definition:p(d.definition)};if(d instanceof h)return{type:"RepetitionMandatoryWithSeparator",idx:d.idx,separator:l(new I({terminalType:d.separator})),definition:p(d.definition)};if(d instanceof b)return{type:"RepetitionWithSeparator",idx:d.idx,separator:l(new I({terminalType:d.separator})),definition:p(d.definition)};if(d instanceof u)return{type:"Repetition",idx:d.idx,definition:p(d.definition)};if(d instanceof f)return{type:"Alternation",idx:d.idx,definition:p(d.definition)};if(d instanceof I){var C={type:"Terminal",name:d.terminalType.name,label:n.tokenLabel(d.terminalType),idx:d.idx},E=d.terminalType.PATTERN;return d.terminalType.PATTERN&&(C.pattern=t.isRegExp(E)?E.source:E),C}else{if(d instanceof s)return{type:"Rule",name:d.name,orgText:d.orgText,definition:p(d.definition)};throw Error("non exhaustive match")}}i.serializeProduction=l}),mn=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RestWalker=void 0;var e=Oe(),t=Ze(),n=(function(){function o(){}return o.prototype.walk=function(s,c){var A=this;c===void 0&&(c=[]),e.forEach(s.definition,function(a,h){var u=e.drop(s.definition,h+1);if(a instanceof t.NonTerminal)A.walkProdRef(a,u,c);else if(a instanceof t.Terminal)A.walkTerminal(a,u,c);else if(a instanceof t.Alternative)A.walkFlat(a,u,c);else if(a instanceof t.Option)A.walkOption(a,u,c);else if(a instanceof t.RepetitionMandatory)A.walkAtLeastOne(a,u,c);else if(a instanceof t.RepetitionMandatoryWithSeparator)A.walkAtLeastOneSep(a,u,c);else if(a instanceof t.RepetitionWithSeparator)A.walkManySep(a,u,c);else if(a instanceof t.Repetition)A.walkMany(a,u,c);else if(a instanceof t.Alternation)A.walkOr(a,u,c);else throw Error("non exhaustive match")})},o.prototype.walkTerminal=function(s,c,A){},o.prototype.walkProdRef=function(s,c,A){},o.prototype.walkFlat=function(s,c,A){var a=c.concat(A);this.walk(s,a)},o.prototype.walkOption=function(s,c,A){var a=c.concat(A);this.walk(s,a)},o.prototype.walkAtLeastOne=function(s,c,A){var a=[new t.Option({definition:s.definition})].concat(c,A);this.walk(s,a)},o.prototype.walkAtLeastOneSep=function(s,c,A){var a=r(s,c,A);this.walk(s,a)},o.prototype.walkMany=function(s,c,A){var a=[new t.Option({definition:s.definition})].concat(c,A);this.walk(s,a)},o.prototype.walkManySep=function(s,c,A){var a=r(s,c,A);this.walk(s,a)},o.prototype.walkOr=function(s,c,A){var a=this,h=c.concat(A);e.forEach(s.definition,function(u){var b=new t.Alternative({definition:[u]});a.walk(b,h)})},o})();i.RestWalker=n;function r(o,s,c){var A=[new t.Option({definition:[new t.Terminal({terminalType:o.separator})].concat(o.definition)})],a=A.concat(s,c);return a}}),kt=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GAstVisitor=void 0;var e=Ze(),t=(function(){function n(){}return n.prototype.visit=function(r){var o=r;switch(o.constructor){case e.NonTerminal:return this.visitNonTerminal(o);case e.Alternative:return this.visitAlternative(o);case e.Option:return this.visitOption(o);case e.RepetitionMandatory:return this.visitRepetitionMandatory(o);case e.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(o);case e.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(o);case e.Repetition:return this.visitRepetition(o);case e.Alternation:return this.visitAlternation(o);case e.Terminal:return this.visitTerminal(o);case e.Rule:return this.visitRule(o);default:throw Error("non exhaustive match")}},n.prototype.visitNonTerminal=function(r){},n.prototype.visitAlternative=function(r){},n.prototype.visitOption=function(r){},n.prototype.visitRepetition=function(r){},n.prototype.visitRepetitionMandatory=function(r){},n.prototype.visitRepetitionMandatoryWithSeparator=function(r){},n.prototype.visitRepetitionWithSeparator=function(r){},n.prototype.visitAlternation=function(r){},n.prototype.visitTerminal=function(r){},n.prototype.visitRule=function(r){},n})();i.GAstVisitor=t}),Ft=ve(i=>{var e=i&&i.__extends||(function(){var b=function(f,I){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,l){m.__proto__=l}||function(m,l){for(var d in l)Object.prototype.hasOwnProperty.call(l,d)&&(m[d]=l[d])},b(f,I)};return function(f,I){if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");b(f,I);function m(){this.constructor=f}f.prototype=I===null?Object.create(I):(m.prototype=I.prototype,new m)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.collectMethods=i.DslMethodsCollectorVisitor=i.getProductionDslName=i.isBranchingProd=i.isOptionalProd=i.isSequenceProd=void 0;var t=Oe(),n=Ze(),r=kt();function o(b){return b instanceof n.Alternative||b instanceof n.Option||b instanceof n.Repetition||b instanceof n.RepetitionMandatory||b instanceof n.RepetitionMandatoryWithSeparator||b instanceof n.RepetitionWithSeparator||b instanceof n.Terminal||b instanceof n.Rule}i.isSequenceProd=o;function s(b,f){f===void 0&&(f=[]);var I=b instanceof n.Option||b instanceof n.Repetition||b instanceof n.RepetitionWithSeparator;return I?!0:b instanceof n.Alternation?t.some(b.definition,function(m){return s(m,f)}):b instanceof n.NonTerminal&&t.contains(f,b)?!1:b instanceof n.AbstractProduction?(b instanceof n.NonTerminal&&f.push(b),t.every(b.definition,function(m){return s(m,f)})):!1}i.isOptionalProd=s;function c(b){return b instanceof n.Alternation}i.isBranchingProd=c;function A(b){if(b instanceof n.NonTerminal)return"SUBRULE";if(b instanceof n.Option)return"OPTION";if(b instanceof n.Alternation)return"OR";if(b instanceof n.RepetitionMandatory)return"AT_LEAST_ONE";if(b instanceof n.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(b instanceof n.RepetitionWithSeparator)return"MANY_SEP";if(b instanceof n.Repetition)return"MANY";if(b instanceof n.Terminal)return"CONSUME";throw Error("non exhaustive match")}i.getProductionDslName=A;var a=(function(b){e(f,b);function f(){var I=b!==null&&b.apply(this,arguments)||this;return I.separator="-",I.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},I}return f.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},f.prototype.visitTerminal=function(I){var m=I.terminalType.name+this.separator+"Terminal";t.has(this.dslMethods,m)||(this.dslMethods[m]=[]),this.dslMethods[m].push(I)},f.prototype.visitNonTerminal=function(I){var m=I.nonTerminalName+this.separator+"Terminal";t.has(this.dslMethods,m)||(this.dslMethods[m]=[]),this.dslMethods[m].push(I)},f.prototype.visitOption=function(I){this.dslMethods.option.push(I)},f.prototype.visitRepetitionWithSeparator=function(I){this.dslMethods.repetitionWithSeparator.push(I)},f.prototype.visitRepetitionMandatory=function(I){this.dslMethods.repetitionMandatory.push(I)},f.prototype.visitRepetitionMandatoryWithSeparator=function(I){this.dslMethods.repetitionMandatoryWithSeparator.push(I)},f.prototype.visitRepetition=function(I){this.dslMethods.repetition.push(I)},f.prototype.visitAlternation=function(I){this.dslMethods.alternation.push(I)},f})(r.GAstVisitor);i.DslMethodsCollectorVisitor=a;var h=new a;function u(b){h.reset(),b.accept(h);var f=h.dslMethods;return h.reset(),f}i.collectMethods=u}),Ji=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.firstForTerminal=i.firstForBranching=i.firstForSequence=i.first=void 0;var e=Oe(),t=Ze(),n=Ft();function r(A){if(A instanceof t.NonTerminal)return r(A.referencedRule);if(A instanceof t.Terminal)return c(A);if(n.isSequenceProd(A))return o(A);if(n.isBranchingProd(A))return s(A);throw Error("non exhaustive match")}i.first=r;function o(A){for(var a=[],h=A.definition,u=0,b=h.length>u,f,I=!0;b&&I;)f=h[u],I=n.isOptionalProd(f),a=a.concat(r(f)),u=u+1,b=h.length>u;return e.uniq(a)}i.firstForSequence=o;function s(A){var a=e.map(A.definition,function(h){return r(h)});return e.uniq(e.flatten(a))}i.firstForBranching=s;function c(A){return[A.terminalType]}i.firstForTerminal=c}),Xi=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IN=void 0,i.IN="_~IN~_"}),ss=ve(i=>{var e=i&&i.__extends||(function(){var u=function(b,f){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,m){I.__proto__=m}||function(I,m){for(var l in m)Object.prototype.hasOwnProperty.call(m,l)&&(I[l]=m[l])},u(b,f)};return function(b,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");u(b,f);function I(){this.constructor=b}b.prototype=f===null?Object.create(f):(I.prototype=f.prototype,new I)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.buildInProdFollowPrefix=i.buildBetweenProdsFollowPrefix=i.computeAllProdsFollows=i.ResyncFollowsWalker=void 0;var t=mn(),n=Ji(),r=Oe(),o=Xi(),s=Ze(),c=(function(u){e(b,u);function b(f){var I=u.call(this)||this;return I.topProd=f,I.follows={},I}return b.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},b.prototype.walkTerminal=function(f,I,m){},b.prototype.walkProdRef=function(f,I,m){var l=a(f.referencedRule,f.idx)+this.topProd.name,d=I.concat(m),p=new s.Alternative({definition:d}),C=n.first(p);this.follows[l]=C},b})(t.RestWalker);i.ResyncFollowsWalker=c;function A(u){var b={};return r.forEach(u,function(f){var I=new c(f).startWalking();r.assign(b,I)}),b}i.computeAllProdsFollows=A;function a(u,b){return u.name+b+o.IN}i.buildBetweenProdsFollowPrefix=a;function h(u){var b=u.terminalType.name;return b+u.idx+o.IN}i.buildInProdFollowPrefix=h}),Ot=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defaultGrammarValidatorErrorProvider=i.defaultGrammarResolverErrorProvider=i.defaultParserErrorProvider=void 0;var e=ft(),t=Oe(),n=Oe(),r=Ze(),o=Ft();i.defaultParserErrorProvider={buildMismatchTokenMessage:function(s){var c=s.expected,A=s.actual;s.previous,s.ruleName;var a=e.hasTokenLabel(c),h=a?"--> "+e.tokenLabel(c)+" <--":"token of type --> "+c.name+" <--",u="Expecting "+h+" but found --> '"+A.image+"' <--";return u},buildNotAllInputParsedMessage:function(s){var c=s.firstRedundant;return s.ruleName,"Redundant input, expecting EOF but found: "+c.image},buildNoViableAltMessage:function(s){var c=s.expectedPathsPerAlt,A=s.actual;s.previous;var a=s.customUserDescription;s.ruleName;var h="Expecting: ",u=n.first(A).image,b=`
|
|
123
|
+
but found: '`+u+"'";if(a)return h+a+b;var f=n.reduce(c,function(d,p){return d.concat(p)},[]),I=n.map(f,function(d){return"["+n.map(d,function(p){return e.tokenLabel(p)}).join(", ")+"]"}),m=n.map(I,function(d,p){return" "+(p+1)+". "+d}),l=`one of these possible Token sequences:
|
|
124
|
+
`+m.join(`
|
|
125
125
|
`);return h+l+b},buildEarlyExitMessage:function(s){var c=s.expectedIterationPaths,A=s.actual,a=s.customUserDescription;s.ruleName;var h="Expecting: ",u=n.first(A).image,b=`
|
|
126
|
-
but found: '`+u+"'";if(a)return h+a+b;var f=n.map(c,function(
|
|
126
|
+
but found: '`+u+"'";if(a)return h+a+b;var f=n.map(c,function(m){return"["+n.map(m,function(l){return e.tokenLabel(l)}).join(",")+"]"}),I=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
127
127
|
`+("<"+f.join(" ,")+">");return h+I+b}},Object.freeze(i.defaultParserErrorProvider),i.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(s,c){var A="Invalid grammar, reference to a rule which is not defined: ->"+c.nonTerminalName+`<-
|
|
128
|
-
inside top level rule: ->`+s.name+"<-";return A}},i.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(s,c){function A(l){return l instanceof r.Terminal?l.terminalType.name:l instanceof r.NonTerminal?l.nonTerminalName:""}var a=s.name,h=n.first(c),u=h.idx,b=o.getProductionDslName(h),f=A(h),I=u>0,
|
|
128
|
+
inside top level rule: ->`+s.name+"<-";return A}},i.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(s,c){function A(l){return l instanceof r.Terminal?l.terminalType.name:l instanceof r.NonTerminal?l.nonTerminalName:""}var a=s.name,h=n.first(c),u=h.idx,b=o.getProductionDslName(h),f=A(h),I=u>0,m="->"+b+(I?u:"")+"<- "+(f?"with argument: ->"+f+"<-":"")+`
|
|
129
129
|
appears more than once (`+c.length+" times) in the top level rule: ->"+a+`<-.
|
|
130
130
|
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
131
|
-
`;return
|
|
132
|
-
`),
|
|
131
|
+
`;return m=m.replace(/[ \t]+/g," "),m=m.replace(/\s\s+/g,`
|
|
132
|
+
`),m},buildNamespaceConflictError:function(s){var c=`Namespace conflict found in grammar.
|
|
133
133
|
`+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+s.name+`>.
|
|
134
134
|
`)+`To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
135
135
|
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
@@ -149,33 +149,33 @@ This could lead to an infinite loop.`;return A},buildTokenNameError:function(s){
|
|
|
149
149
|
`)+(`without consuming any Tokens. The grammar path that causes this is:
|
|
150
150
|
`+a+`
|
|
151
151
|
`)+` To fix this refactor your grammar to remove the left recursion.
|
|
152
|
-
see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return h},buildInvalidRuleNameError:function(s){return"deprecated"},buildDuplicateRuleNameError:function(s){var c;s.topLevelRule instanceof r.Rule?c=s.topLevelRule.name:c=s.topLevelRule;var A="Duplicate definition, rule: ->"+c+"<- is already defined in the grammar: ->"+s.grammarName+"<-";return A}}}),os=Qe(i=>{var e=i&&i.__extends||(function(){var c=function(A,a){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,u){h.__proto__=u}||function(h,u){for(var b in u)Object.prototype.hasOwnProperty.call(u,b)&&(h[b]=u[b])},c(A,a)};return function(A,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");c(A,a);function h(){this.constructor=A}A.prototype=a===null?Object.create(a):(h.prototype=a.prototype,new h)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.GastRefResolverVisitor=i.resolveGrammar=void 0;var t=tt(),n=De(),r=kt();function o(c,A){var a=new s(c,A);return a.resolveRefs(),a.errors}i.resolveGrammar=o;var s=(function(c){e(A,c);function A(a,h){var u=c.call(this)||this;return u.nameToTopRule=a,u.errMsgProvider=h,u.errors=[],u}return A.prototype.resolveRefs=function(){var a=this;n.forEach(n.values(this.nameToTopRule),function(h){a.currTopLevel=h,h.accept(a)})},A.prototype.visitNonTerminal=function(a){var h=this.nameToTopRule[a.nonTerminalName];if(h)a.referencedRule=h;else{var u=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,a);this.errors.push({message:u,type:t.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:a.nonTerminalName})}},A})(r.GAstVisitor);i.GastRefResolverVisitor=s}),Ot=Qe(i=>{var e=i&&i.__extends||(function(){var l=function(d,p){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,m){C.__proto__=m}||function(C,m){for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(C[y]=m[y])},l(d,p)};return function(d,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");l(d,p);function C(){this.constructor=d}d.prototype=p===null?Object.create(p):(C.prototype=p.prototype,new C)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.nextPossibleTokensAfter=i.possiblePathsFrom=i.NextTerminalAfterAtLeastOneSepWalker=i.NextTerminalAfterAtLeastOneWalker=i.NextTerminalAfterManySepWalker=i.NextTerminalAfterManyWalker=i.AbstractNextTerminalAfterProductionWalker=i.NextAfterTokenWalker=i.AbstractNextPossibleTokensWalker=void 0;var t=pn(),n=De(),r=Wi(),o=Ze(),s=(function(l){e(d,l);function d(p,C){var m=l.call(this)||this;return m.topProd=p,m.path=C,m.possibleTokTypes=[],m.nextProductionName="",m.nextProductionOccurrence=0,m.found=!1,m.isAtEndOfPath=!1,m}return d.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=n.cloneArr(this.path.ruleStack).reverse(),this.occurrenceStack=n.cloneArr(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},d.prototype.walk=function(p,C){C===void 0&&(C=[]),this.found||l.prototype.walk.call(this,p,C)},d.prototype.walkProdRef=function(p,C,m){if(p.referencedRule.name===this.nextProductionName&&p.idx===this.nextProductionOccurrence){var y=C.concat(m);this.updateExpectedNext(),this.walk(p.referencedRule,y)}},d.prototype.updateExpectedNext=function(){n.isEmpty(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},d})(t.RestWalker);i.AbstractNextPossibleTokensWalker=s;var c=(function(l){e(d,l);function d(p,C){var m=l.call(this,p,C)||this;return m.path=C,m.nextTerminalName="",m.nextTerminalOccurrence=0,m.nextTerminalName=m.path.lastTok.name,m.nextTerminalOccurrence=m.path.lastTokOccurrence,m}return d.prototype.walkTerminal=function(p,C,m){if(this.isAtEndOfPath&&p.terminalType.name===this.nextTerminalName&&p.idx===this.nextTerminalOccurrence&&!this.found){var y=C.concat(m),Q=new o.Alternative({definition:y});this.possibleTokTypes=r.first(Q),this.found=!0}},d})(s);i.NextAfterTokenWalker=c;var A=(function(l){e(d,l);function d(p,C){var m=l.call(this)||this;return m.topRule=p,m.occurrence=C,m.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},m}return d.prototype.startWalking=function(){return this.walk(this.topRule),this.result},d})(t.RestWalker);i.AbstractNextTerminalAfterProductionWalker=A;var a=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.prototype.walkMany=function(p,C,m){if(p.idx===this.occurrence){var y=n.first(C.concat(m));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkMany.call(this,p,C,m)},d})(A);i.NextTerminalAfterManyWalker=a;var h=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.prototype.walkManySep=function(p,C,m){if(p.idx===this.occurrence){var y=n.first(C.concat(m));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkManySep.call(this,p,C,m)},d})(A);i.NextTerminalAfterManySepWalker=h;var u=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.prototype.walkAtLeastOne=function(p,C,m){if(p.idx===this.occurrence){var y=n.first(C.concat(m));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkAtLeastOne.call(this,p,C,m)},d})(A);i.NextTerminalAfterAtLeastOneWalker=u;var b=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.prototype.walkAtLeastOneSep=function(p,C,m){if(p.idx===this.occurrence){var y=n.first(C.concat(m));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkAtLeastOneSep.call(this,p,C,m)},d})(A);i.NextTerminalAfterAtLeastOneSepWalker=b;function f(l,d,p){p===void 0&&(p=[]),p=n.cloneArr(p);var C=[],m=0;function y(v){return v.concat(n.drop(l,m+1))}function Q(v){var M=f(y(v),d,p);return C.concat(M)}for(;p.length<d&&m<l.length;){var _=l[m];if(_ instanceof o.Alternative||_ instanceof o.NonTerminal)return Q(_.definition);if(_ instanceof o.Option)C=Q(_.definition);else if(_ instanceof o.RepetitionMandatory){var j=_.definition.concat([new o.Repetition({definition:_.definition})]);return Q(j)}else if(_ instanceof o.RepetitionMandatoryWithSeparator){var j=[new o.Alternative({definition:_.definition}),new o.Repetition({definition:[new o.Terminal({terminalType:_.separator})].concat(_.definition)})];return Q(j)}else if(_ instanceof o.RepetitionWithSeparator){var j=_.definition.concat([new o.Repetition({definition:[new o.Terminal({terminalType:_.separator})].concat(_.definition)})]);C=Q(j)}else if(_ instanceof o.Repetition){var j=_.definition.concat([new o.Repetition({definition:_.definition})]);C=Q(j)}else{if(_ instanceof o.Alternation)return n.forEach(_.definition,function(v){n.isEmpty(v.definition)===!1&&(C=Q(v.definition))}),C;if(_ instanceof o.Terminal)p.push(_.terminalType);else throw Error("non exhaustive match")}m++}return C.push({partialPath:p,suffixDef:n.drop(l,m)}),C}i.possiblePathsFrom=f;function I(l,d,p,C){var m="EXIT_NONE_TERMINAL",y=[m],Q="EXIT_ALTERNATIVE",_=!1,j=d.length,v=j-C-1,M=[],x=[];for(x.push({idx:-1,def:l,ruleStack:[],occurrenceStack:[]});!n.isEmpty(x);){var R=x.pop();if(R===Q){_&&n.last(x).idx<=v&&x.pop();continue}var N=R.def,L=R.idx,W=R.ruleStack,J=R.occurrenceStack;if(!n.isEmpty(N)){var K=N[0];if(K===m){var ee={idx:L,def:n.drop(N),ruleStack:n.dropRight(W),occurrenceStack:n.dropRight(J)};x.push(ee)}else if(K instanceof o.Terminal)if(L<j-1){var te=L+1,ue=d[te];if(p(ue,K.terminalType)){var ee={idx:te,def:n.drop(N),ruleStack:W,occurrenceStack:J};x.push(ee)}}else if(L===j-1)M.push({nextTokenType:K.terminalType,nextTokenOccurrence:K.idx,ruleStack:W,occurrenceStack:J}),_=!0;else throw Error("non exhaustive match");else if(K instanceof o.NonTerminal){var oe=n.cloneArr(W);oe.push(K.nonTerminalName);var ae=n.cloneArr(J);ae.push(K.idx);var ee={idx:L,def:K.definition.concat(y,n.drop(N)),ruleStack:oe,occurrenceStack:ae};x.push(ee)}else if(K instanceof o.Option){var Ae={idx:L,def:n.drop(N),ruleStack:W,occurrenceStack:J};x.push(Ae),x.push(Q);var Ie={idx:L,def:K.definition.concat(n.drop(N)),ruleStack:W,occurrenceStack:J};x.push(Ie)}else if(K instanceof o.RepetitionMandatory){var U=new o.Repetition({definition:K.definition,idx:K.idx}),P=K.definition.concat([U],n.drop(N)),ee={idx:L,def:P,ruleStack:W,occurrenceStack:J};x.push(ee)}else if(K instanceof o.RepetitionMandatoryWithSeparator){var q=new o.Terminal({terminalType:K.separator}),U=new o.Repetition({definition:[q].concat(K.definition),idx:K.idx}),P=K.definition.concat([U],n.drop(N)),ee={idx:L,def:P,ruleStack:W,occurrenceStack:J};x.push(ee)}else if(K instanceof o.RepetitionWithSeparator){var Ae={idx:L,def:n.drop(N),ruleStack:W,occurrenceStack:J};x.push(Ae),x.push(Q);var q=new o.Terminal({terminalType:K.separator}),X=new o.Repetition({definition:[q].concat(K.definition),idx:K.idx}),P=K.definition.concat([X],n.drop(N)),Ie={idx:L,def:P,ruleStack:W,occurrenceStack:J};x.push(Ie)}else if(K instanceof o.Repetition){var Ae={idx:L,def:n.drop(N),ruleStack:W,occurrenceStack:J};x.push(Ae),x.push(Q);var X=new o.Repetition({definition:K.definition,idx:K.idx}),P=K.definition.concat([X],n.drop(N)),Ie={idx:L,def:P,ruleStack:W,occurrenceStack:J};x.push(Ie)}else if(K instanceof o.Alternation)for(var ne=K.definition.length-1;ne>=0;ne--){var le=K.definition[ne],we={idx:L,def:le.definition.concat(n.drop(N)),ruleStack:W,occurrenceStack:J};x.push(we),x.push(Q)}else if(K instanceof o.Alternative)x.push({idx:L,def:K.definition.concat(n.drop(N)),ruleStack:W,occurrenceStack:J});else if(K instanceof o.Rule)x.push(E(K,L,W,J));else throw Error("non exhaustive match")}}return M}i.nextPossibleTokensAfter=I;function E(l,d,p,C){var m=n.cloneArr(p);m.push(l.name);var y=n.cloneArr(C);return y.push(1),{idx:d,def:l.definition,ruleStack:m,occurrenceStack:y}}}),Mt=Qe(i=>{var e=i&&i.__extends||(function(){var v=function(M,x){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,N){R.__proto__=N}||function(R,N){for(var L in N)Object.prototype.hasOwnProperty.call(N,L)&&(R[L]=N[L])},v(M,x)};return function(M,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");v(M,x);function R(){this.constructor=M}M.prototype=x===null?Object.create(x):(R.prototype=x.prototype,new R)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.areTokenCategoriesNotUsed=i.isStrictPrefixOfPath=i.containsPath=i.getLookaheadPathsForOptionalProd=i.getLookaheadPathsForOr=i.lookAheadSequenceFromAlternatives=i.buildSingleAlternativeLookaheadFunction=i.buildAlternativesLookAheadFunc=i.buildLookaheadFuncForOptionalProd=i.buildLookaheadFuncForOr=i.getProdType=i.PROD_TYPE=void 0;var t=De(),n=Ot(),r=pn(),o=Qt(),s=Ze(),c=kt(),A;(function(v){v[v.OPTION=0]="OPTION",v[v.REPETITION=1]="REPETITION",v[v.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",v[v.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",v[v.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",v[v.ALTERNATION=5]="ALTERNATION"})(A=i.PROD_TYPE||(i.PROD_TYPE={}));function a(v){if(v instanceof s.Option)return A.OPTION;if(v instanceof s.Repetition)return A.REPETITION;if(v instanceof s.RepetitionMandatory)return A.REPETITION_MANDATORY;if(v instanceof s.RepetitionMandatoryWithSeparator)return A.REPETITION_MANDATORY_WITH_SEPARATOR;if(v instanceof s.RepetitionWithSeparator)return A.REPETITION_WITH_SEPARATOR;if(v instanceof s.Alternation)return A.ALTERNATION;throw Error("non exhaustive match")}i.getProdType=a;function h(v,M,x,R,N,L){var W=m(v,M,x),J=j(W)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return L(W,R,J,N)}i.buildLookaheadFuncForOr=h;function u(v,M,x,R,N,L){var W=y(v,M,N,x),J=j(W)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return L(W[0],J,R)}i.buildLookaheadFuncForOptionalProd=u;function b(v,M,x,R){var N=v.length,L=t.every(v,function(K){return t.every(K,function(ee){return ee.length===1})});if(M)return function(K){for(var ee=t.map(K,function(X){return X.GATE}),te=0;te<N;te++){var ue=v[te],oe=ue.length,ae=ee[te];if(!(ae!==void 0&&ae.call(this)===!1))e:for(var Ae=0;Ae<oe;Ae++){for(var Ie=ue[Ae],U=Ie.length,P=0;P<U;P++){var q=this.LA(P+1);if(x(q,Ie[P])===!1)continue e}return te}}};if(L&&!R){var W=t.map(v,function(K){return t.flatten(K)}),J=t.reduce(W,function(K,ee,te){return t.forEach(ee,function(ue){t.has(K,ue.tokenTypeIdx)||(K[ue.tokenTypeIdx]=te),t.forEach(ue.categoryMatches,function(oe){t.has(K,oe)||(K[oe]=te)})}),K},[]);return function(){var K=this.LA(1);return J[K.tokenTypeIdx]}}else return function(){for(var K=0;K<N;K++){var ee=v[K],te=ee.length;e:for(var ue=0;ue<te;ue++){for(var oe=ee[ue],ae=oe.length,Ae=0;Ae<ae;Ae++){var Ie=this.LA(Ae+1);if(x(Ie,oe[Ae])===!1)continue e}return K}}}}i.buildAlternativesLookAheadFunc=b;function f(v,M,x){var R=t.every(v,function(ee){return ee.length===1}),N=v.length;if(R&&!x){var L=t.flatten(v);if(L.length===1&&t.isEmpty(L[0].categoryMatches)){var W=L[0],J=W.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===J}}else{var K=t.reduce(L,function(ee,te,ue){return ee[te.tokenTypeIdx]=!0,t.forEach(te.categoryMatches,function(oe){ee[oe]=!0}),ee},[]);return function(){var ee=this.LA(1);return K[ee.tokenTypeIdx]===!0}}}else return function(){e:for(var ee=0;ee<N;ee++){for(var te=v[ee],ue=te.length,oe=0;oe<ue;oe++){var ae=this.LA(oe+1);if(M(ae,te[oe])===!1)continue e}return!0}return!1}}i.buildSingleAlternativeLookaheadFunction=f;var I=(function(v){e(M,v);function M(x,R,N){var L=v.call(this)||this;return L.topProd=x,L.targetOccurrence=R,L.targetProdType=N,L}return M.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},M.prototype.checkIsTarget=function(x,R,N,L){return x.idx===this.targetOccurrence&&this.targetProdType===R?(this.restDef=N.concat(L),!0):!1},M.prototype.walkOption=function(x,R,N){this.checkIsTarget(x,A.OPTION,R,N)||v.prototype.walkOption.call(this,x,R,N)},M.prototype.walkAtLeastOne=function(x,R,N){this.checkIsTarget(x,A.REPETITION_MANDATORY,R,N)||v.prototype.walkOption.call(this,x,R,N)},M.prototype.walkAtLeastOneSep=function(x,R,N){this.checkIsTarget(x,A.REPETITION_MANDATORY_WITH_SEPARATOR,R,N)||v.prototype.walkOption.call(this,x,R,N)},M.prototype.walkMany=function(x,R,N){this.checkIsTarget(x,A.REPETITION,R,N)||v.prototype.walkOption.call(this,x,R,N)},M.prototype.walkManySep=function(x,R,N){this.checkIsTarget(x,A.REPETITION_WITH_SEPARATOR,R,N)||v.prototype.walkOption.call(this,x,R,N)},M})(r.RestWalker),E=(function(v){e(M,v);function M(x,R,N){var L=v.call(this)||this;return L.targetOccurrence=x,L.targetProdType=R,L.targetRef=N,L.result=[],L}return M.prototype.checkIsTarget=function(x,R){x.idx===this.targetOccurrence&&this.targetProdType===R&&(this.targetRef===void 0||x===this.targetRef)&&(this.result=x.definition)},M.prototype.visitOption=function(x){this.checkIsTarget(x,A.OPTION)},M.prototype.visitRepetition=function(x){this.checkIsTarget(x,A.REPETITION)},M.prototype.visitRepetitionMandatory=function(x){this.checkIsTarget(x,A.REPETITION_MANDATORY)},M.prototype.visitRepetitionMandatoryWithSeparator=function(x){this.checkIsTarget(x,A.REPETITION_MANDATORY_WITH_SEPARATOR)},M.prototype.visitRepetitionWithSeparator=function(x){this.checkIsTarget(x,A.REPETITION_WITH_SEPARATOR)},M.prototype.visitAlternation=function(x){this.checkIsTarget(x,A.ALTERNATION)},M})(c.GAstVisitor);function l(v){for(var M=new Array(v),x=0;x<v;x++)M[x]=[];return M}function d(v){for(var M=[""],x=0;x<v.length;x++){for(var R=v[x],N=[],L=0;L<M.length;L++){var W=M[L];N.push(W+"_"+R.tokenTypeIdx);for(var J=0;J<R.categoryMatches.length;J++){var K="_"+R.categoryMatches[J];N.push(W+K)}}M=N}return M}function p(v,M,x){for(var R=0;R<v.length;R++)if(R!==x)for(var N=v[R],L=0;L<M.length;L++){var W=M[L];if(N[W]===!0)return!1}return!0}function C(v,M){for(var x=t.map(v,function(te){return n.possiblePathsFrom([te],1)}),R=l(x.length),N=t.map(x,function(te){var ue={};return t.forEach(te,function(oe){var ae=d(oe.partialPath);t.forEach(ae,function(Ae){ue[Ae]=!0})}),ue}),L=x,W=1;W<=M;W++){var J=L;L=l(J.length);for(var K=function(te){for(var ue=J[te],oe=0;oe<ue.length;oe++){var ae=ue[oe].partialPath,Ae=ue[oe].suffixDef,Ie=d(ae),U=p(N,Ie,te);if(U||t.isEmpty(Ae)||ae.length===M){var P=R[te];if(Q(P,ae)===!1){P.push(ae);for(var q=0;q<Ie.length;q++){var X=Ie[q];N[te][X]=!0}}}else{var ne=n.possiblePathsFrom(Ae,W+1,ae);L[te]=L[te].concat(ne),t.forEach(ne,function(le){var we=d(le.partialPath);t.forEach(we,function(Re){N[te][Re]=!0})})}}},ee=0;ee<J.length;ee++)K(ee)}return R}i.lookAheadSequenceFromAlternatives=C;function m(v,M,x,R){var N=new E(v,A.ALTERNATION,R);return M.accept(N),C(N.result,x)}i.getLookaheadPathsForOr=m;function y(v,M,x,R){var N=new E(v,x);M.accept(N);var L=N.result,W=new I(M,v,x),J=W.startWalking(),K=new s.Alternative({definition:L}),ee=new s.Alternative({definition:J});return C([K,ee],R)}i.getLookaheadPathsForOptionalProd=y;function Q(v,M){e:for(var x=0;x<v.length;x++){var R=v[x];if(R.length===M.length){for(var N=0;N<R.length;N++){var L=M[N],W=R[N],J=L===W||W.categoryMatchesMap[L.tokenTypeIdx]!==void 0;if(J===!1)continue e}return!0}}return!1}i.containsPath=Q;function _(v,M){return v.length<M.length&&t.every(v,function(x,R){var N=M[R];return x===N||N.categoryMatchesMap[x.tokenTypeIdx]})}i.isStrictPrefixOfPath=_;function j(v){return t.every(v,function(M){return t.every(M,function(x){return t.every(x,function(R){return t.isEmpty(R.categoryMatches)})})})}i.areTokenCategoriesNotUsed=j}),Ji=Qe(i=>{var e=i&&i.__extends||(function(){var R=function(N,L){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(W,J){W.__proto__=J}||function(W,J){for(var K in J)Object.prototype.hasOwnProperty.call(J,K)&&(W[K]=J[K])},R(N,L)};return function(N,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");R(N,L);function W(){this.constructor=N}N.prototype=L===null?Object.create(L):(W.prototype=L.prototype,new W)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.checkPrefixAlternativesAmbiguities=i.validateSomeNonEmptyLookaheadPath=i.validateTooManyAlts=i.RepetionCollector=i.validateAmbiguousAlternationAlternatives=i.validateEmptyOrAlternative=i.getFirstNoneTerminal=i.validateNoLeftRecursion=i.validateRuleIsOverridden=i.validateRuleDoesNotAlreadyExist=i.OccurrenceValidationCollector=i.identifyProductionForDuplicates=i.validateGrammar=void 0;var t=De(),n=De(),r=tt(),o=Dt(),s=Mt(),c=Ot(),A=Ze(),a=kt();function h(R,N,L,W,J){var K=t.map(R,function(U){return u(U,W)}),ee=t.map(R,function(U){return d(U,U,W)}),te=[],ue=[],oe=[];n.every(ee,n.isEmpty)&&(te=n.map(R,function(U){return m(U,W)}),ue=n.map(R,function(U){return y(U,N,W)}),oe=j(R,N,W));var ae=x(R,L,W),Ae=n.map(R,function(U){return _(U,W)}),Ie=n.map(R,function(U){return E(U,R,J,W)});return t.flatten(K.concat(oe,ee,te,ue,ae,Ae,Ie))}i.validateGrammar=h;function u(R,N){var L=new I;R.accept(L);var W=L.allProductions,J=t.groupBy(W,b),K=t.pick(J,function(te){return te.length>1}),ee=t.map(t.values(K),function(te){var ue=t.first(te),oe=N.buildDuplicateFoundError(R,te),ae=o.getProductionDslName(ue),Ae={message:oe,type:r.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:R.name,dslName:ae,occurrence:ue.idx},Ie=f(ue);return Ie&&(Ae.parameter=Ie),Ae});return ee}function b(R){return o.getProductionDslName(R)+"_#_"+R.idx+"_#_"+f(R)}i.identifyProductionForDuplicates=b;function f(R){return R instanceof A.Terminal?R.terminalType.name:R instanceof A.NonTerminal?R.nonTerminalName:""}var I=(function(R){e(N,R);function N(){var L=R!==null&&R.apply(this,arguments)||this;return L.allProductions=[],L}return N.prototype.visitNonTerminal=function(L){this.allProductions.push(L)},N.prototype.visitOption=function(L){this.allProductions.push(L)},N.prototype.visitRepetitionWithSeparator=function(L){this.allProductions.push(L)},N.prototype.visitRepetitionMandatory=function(L){this.allProductions.push(L)},N.prototype.visitRepetitionMandatoryWithSeparator=function(L){this.allProductions.push(L)},N.prototype.visitRepetition=function(L){this.allProductions.push(L)},N.prototype.visitAlternation=function(L){this.allProductions.push(L)},N.prototype.visitTerminal=function(L){this.allProductions.push(L)},N})(a.GAstVisitor);i.OccurrenceValidationCollector=I;function E(R,N,L,W){var J=[],K=n.reduce(N,function(te,ue){return ue.name===R.name?te+1:te},0);if(K>1){var ee=W.buildDuplicateRuleNameError({topLevelRule:R,grammarName:L});J.push({message:ee,type:r.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:R.name})}return J}i.validateRuleDoesNotAlreadyExist=E;function l(R,N,L){var W=[],J;return t.contains(N,R)||(J="Invalid rule override, rule: ->"+R+"<- cannot be overridden in the grammar: ->"+L+"<-as it is not defined in any of the super grammars ",W.push({message:J,type:r.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:R})),W}i.validateRuleIsOverridden=l;function d(R,N,L,W){W===void 0&&(W=[]);var J=[],K=p(N.definition);if(t.isEmpty(K))return[];var ee=R.name,te=t.contains(K,R);te&&J.push({message:L.buildLeftRecursionError({topLevelRule:R,leftRecursionPath:W}),type:r.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:ee});var ue=t.difference(K,W.concat([R])),oe=t.map(ue,function(ae){var Ae=t.cloneArr(W);return Ae.push(ae),d(R,ae,L,Ae)});return J.concat(t.flatten(oe))}i.validateNoLeftRecursion=d;function p(R){var N=[];if(t.isEmpty(R))return N;var L=t.first(R);if(L instanceof A.NonTerminal)N.push(L.referencedRule);else if(L instanceof A.Alternative||L instanceof A.Option||L instanceof A.RepetitionMandatory||L instanceof A.RepetitionMandatoryWithSeparator||L instanceof A.RepetitionWithSeparator||L instanceof A.Repetition)N=N.concat(p(L.definition));else if(L instanceof A.Alternation)N=t.flatten(t.map(L.definition,function(ee){return p(ee.definition)}));else if(!(L instanceof A.Terminal))throw Error("non exhaustive match");var W=o.isOptionalProd(L),J=R.length>1;if(W&&J){var K=t.drop(R);return N.concat(p(K))}else return N}i.getFirstNoneTerminal=p;var C=(function(R){e(N,R);function N(){var L=R!==null&&R.apply(this,arguments)||this;return L.alternations=[],L}return N.prototype.visitAlternation=function(L){this.alternations.push(L)},N})(a.GAstVisitor);function m(R,N){var L=new C;R.accept(L);var W=L.alternations,J=t.reduce(W,function(K,ee){var te=t.dropRight(ee.definition),ue=t.map(te,function(oe,ae){var Ae=c.nextPossibleTokensAfter([oe],[],null,1);return t.isEmpty(Ae)?{message:N.buildEmptyAlternationError({topLevelRule:R,alternation:ee,emptyChoiceIdx:ae}),type:r.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:R.name,occurrence:ee.idx,alternative:ae+1}:null});return K.concat(t.compact(ue))},[]);return J}i.validateEmptyOrAlternative=m;function y(R,N,L){var W=new C;R.accept(W);var J=W.alternations;J=n.reject(J,function(ee){return ee.ignoreAmbiguities===!0});var K=t.reduce(J,function(ee,te){var ue=te.idx,oe=te.maxLookahead||N,ae=s.getLookaheadPathsForOr(ue,R,oe,te),Ae=v(ae,te,R,L),Ie=M(ae,te,R,L);return ee.concat(Ae,Ie)},[]);return K}i.validateAmbiguousAlternationAlternatives=y;var Q=(function(R){e(N,R);function N(){var L=R!==null&&R.apply(this,arguments)||this;return L.allProductions=[],L}return N.prototype.visitRepetitionWithSeparator=function(L){this.allProductions.push(L)},N.prototype.visitRepetitionMandatory=function(L){this.allProductions.push(L)},N.prototype.visitRepetitionMandatoryWithSeparator=function(L){this.allProductions.push(L)},N.prototype.visitRepetition=function(L){this.allProductions.push(L)},N})(a.GAstVisitor);i.RepetionCollector=Q;function _(R,N){var L=new C;R.accept(L);var W=L.alternations,J=t.reduce(W,function(K,ee){return ee.definition.length>255&&K.push({message:N.buildTooManyAlternativesError({topLevelRule:R,alternation:ee}),type:r.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:R.name,occurrence:ee.idx}),K},[]);return J}i.validateTooManyAlts=_;function j(R,N,L){var W=[];return n.forEach(R,function(J){var K=new Q;J.accept(K);var ee=K.allProductions;n.forEach(ee,function(te){var ue=s.getProdType(te),oe=te.maxLookahead||N,ae=te.idx,Ae=s.getLookaheadPathsForOptionalProd(ae,J,ue,oe),Ie=Ae[0];if(n.isEmpty(n.flatten(Ie))){var U=L.buildEmptyRepetitionError({topLevelRule:J,repetition:te});W.push({message:U,type:r.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:J.name})}})}),W}i.validateSomeNonEmptyLookaheadPath=j;function v(R,N,L,W){var J=[],K=n.reduce(R,function(te,ue,oe){return N.definition[oe].ignoreAmbiguities===!0||n.forEach(ue,function(ae){var Ae=[oe];n.forEach(R,function(Ie,U){oe!==U&&s.containsPath(Ie,ae)&&N.definition[U].ignoreAmbiguities!==!0&&Ae.push(U)}),Ae.length>1&&!s.containsPath(J,ae)&&(J.push(ae),te.push({alts:Ae,path:ae}))}),te},[]),ee=t.map(K,function(te){var ue=n.map(te.alts,function(ae){return ae+1}),oe=W.buildAlternationAmbiguityError({topLevelRule:L,alternation:N,ambiguityIndices:ue,prefixPath:te.path});return{message:oe,type:r.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:L.name,occurrence:N.idx,alternatives:[te.alts]}});return ee}function M(R,N,L,W){var J=[],K=n.reduce(R,function(ee,te,ue){var oe=n.map(te,function(ae){return{idx:ue,path:ae}});return ee.concat(oe)},[]);return n.forEach(K,function(ee){var te=N.definition[ee.idx];if(te.ignoreAmbiguities!==!0){var ue=ee.idx,oe=ee.path,ae=n.findAll(K,function(Ie){return N.definition[Ie.idx].ignoreAmbiguities!==!0&&Ie.idx<ue&&s.isStrictPrefixOfPath(Ie.path,oe)}),Ae=n.map(ae,function(Ie){var U=[Ie.idx+1,ue+1],P=N.idx===0?"":N.idx,q=W.buildAlternationPrefixAmbiguityError({topLevelRule:L,alternation:N,ambiguityIndices:U,prefixPath:Ie.path});return{message:q,type:r.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:L.name,occurrence:P,alternatives:U}});J=J.concat(Ae)}}),J}i.checkPrefixAlternativesAmbiguities=M;function x(R,N,L){var W=[],J=n.map(N,function(K){return K.name});return n.forEach(R,function(K){var ee=K.name;if(n.contains(J,ee)){var te=L.buildNamespaceConflictError(K);W.push({message:te,type:r.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:ee})}}),W}}),ss=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.validateGrammar=i.resolveGrammar=void 0;var e=De(),t=os(),n=Ji(),r=Ft();function o(c){c=e.defaults(c,{errMsgProvider:r.defaultGrammarResolverErrorProvider});var A={};return e.forEach(c.rules,function(a){A[a.name]=a}),t.resolveGrammar(A,c.errMsgProvider)}i.resolveGrammar=o;function s(c){return c=e.defaults(c,{errMsgProvider:r.defaultGrammarValidatorErrorProvider}),n.validateGrammar(c.rules,c.maxLookahead,c.tokenTypes,c.errMsgProvider,c.grammarName)}i.validateGrammar=s}),St=Qe(i=>{var e=i&&i.__extends||(function(){var I=function(E,l){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var C in p)Object.prototype.hasOwnProperty.call(p,C)&&(d[C]=p[C])},I(E,l)};return function(E,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");I(E,l);function d(){this.constructor=E}E.prototype=l===null?Object.create(l):(d.prototype=l.prototype,new d)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.EarlyExitException=i.NotAllInputParsedException=i.NoViableAltException=i.MismatchedTokenException=i.isRecognitionException=void 0;var t=De(),n="MismatchedTokenException",r="NoViableAltException",o="EarlyExitException",s="NotAllInputParsedException",c=[n,r,o,s];Object.freeze(c);function A(I){return t.contains(c,I.name)}i.isRecognitionException=A;var a=(function(I){e(E,I);function E(l,d){var p=this.constructor,C=I.call(this,l)||this;return C.token=d,C.resyncedTokens=[],Object.setPrototypeOf(C,p.prototype),Error.captureStackTrace&&Error.captureStackTrace(C,C.constructor),C}return E})(Error),h=(function(I){e(E,I);function E(l,d,p){var C=I.call(this,l,d)||this;return C.previousToken=p,C.name=n,C}return E})(a);i.MismatchedTokenException=h;var u=(function(I){e(E,I);function E(l,d,p){var C=I.call(this,l,d)||this;return C.previousToken=p,C.name=r,C}return E})(a);i.NoViableAltException=u;var b=(function(I){e(E,I);function E(l,d){var p=I.call(this,l,d)||this;return p.name=s,p}return E})(a);i.NotAllInputParsedException=b;var f=(function(I){e(E,I);function E(l,d,p){var C=I.call(this,l,d)||this;return C.previousToken=p,C.name=o,C}return E})(a);i.EarlyExitException=f}),Xi=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.attemptInRepetitionRecovery=i.Recoverable=i.InRuleRecoveryException=i.IN_RULE_RECOVERY_EXCEPTION=i.EOF_FOLLOW_KEY=void 0;var e=ft(),t=De(),n=St(),r=Yi(),o=tt();i.EOF_FOLLOW_KEY={},i.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function s(a){this.name=i.IN_RULE_RECOVERY_EXCEPTION,this.message=a}i.InRuleRecoveryException=s,s.prototype=Error.prototype;var c=(function(){function a(){}return a.prototype.initRecoverable=function(h){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=t.has(h,"recoveryEnabled")?h.recoveryEnabled:o.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=A)},a.prototype.getTokenToInsert=function(h){var u=e.createTokenInstance(h,"",NaN,NaN,NaN,NaN,NaN,NaN);return u.isInsertedInRecovery=!0,u},a.prototype.canTokenTypeBeInsertedInRecovery=function(h){return!0},a.prototype.tryInRepetitionRecovery=function(h,u,b,f){for(var I=this,E=this.findReSyncTokenType(),l=this.exportLexerState(),d=[],p=!1,C=this.LA(1),m=this.LA(1),y=function(){var Q=I.LA(0),_=I.errorMessageProvider.buildMismatchTokenMessage({expected:f,actual:C,previous:Q,ruleName:I.getCurrRuleFullName()}),j=new n.MismatchedTokenException(_,C,I.LA(0));j.resyncedTokens=t.dropRight(d),I.SAVE_ERROR(j)};!p;)if(this.tokenMatcher(m,f)){y();return}else if(b.call(this)){y(),h.apply(this,u);return}else this.tokenMatcher(m,E)?p=!0:(m=this.SKIP_TOKEN(),this.addToResyncTokens(m,d));this.importLexerState(l)},a.prototype.shouldInRepetitionRecoveryBeTried=function(h,u,b){return!(b===!1||h===void 0||u===void 0||this.tokenMatcher(this.LA(1),h)||this.isBackTracking()||this.canPerformInRuleRecovery(h,this.getFollowsForInRuleRecovery(h,u)))},a.prototype.getFollowsForInRuleRecovery=function(h,u){var b=this.getCurrentGrammarPath(h,u),f=this.getNextPossibleTokenTypes(b);return f},a.prototype.tryInRuleRecovery=function(h,u){if(this.canRecoverWithSingleTokenInsertion(h,u)){var b=this.getTokenToInsert(h);return b}if(this.canRecoverWithSingleTokenDeletion(h)){var f=this.SKIP_TOKEN();return this.consumeToken(),f}throw new s("sad sad panda")},a.prototype.canPerformInRuleRecovery=function(h,u){return this.canRecoverWithSingleTokenInsertion(h,u)||this.canRecoverWithSingleTokenDeletion(h)},a.prototype.canRecoverWithSingleTokenInsertion=function(h,u){var b=this;if(!this.canTokenTypeBeInsertedInRecovery(h)||t.isEmpty(u))return!1;var f=this.LA(1),I=t.find(u,function(E){return b.tokenMatcher(f,E)})!==void 0;return I},a.prototype.canRecoverWithSingleTokenDeletion=function(h){var u=this.tokenMatcher(this.LA(2),h);return u},a.prototype.isInCurrentRuleReSyncSet=function(h){var u=this.getCurrFollowKey(),b=this.getFollowSetFromFollowKey(u);return t.contains(b,h)},a.prototype.findReSyncTokenType=function(){for(var h=this.flattenFollowSet(),u=this.LA(1),b=2;;){var f=u.tokenType;if(t.contains(h,f))return f;u=this.LA(b),b++}},a.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return i.EOF_FOLLOW_KEY;var h=this.getLastExplicitRuleShortName(),u=this.getLastExplicitRuleOccurrenceIndex(),b=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(h),idxInCallingRule:u,inRule:this.shortRuleNameToFullName(b)}},a.prototype.buildFullFollowKeyStack=function(){var h=this,u=this.RULE_STACK,b=this.RULE_OCCURRENCE_STACK;return t.map(u,function(f,I){return I===0?i.EOF_FOLLOW_KEY:{ruleName:h.shortRuleNameToFullName(f),idxInCallingRule:b[I],inRule:h.shortRuleNameToFullName(u[I-1])}})},a.prototype.flattenFollowSet=function(){var h=this,u=t.map(this.buildFullFollowKeyStack(),function(b){return h.getFollowSetFromFollowKey(b)});return t.flatten(u)},a.prototype.getFollowSetFromFollowKey=function(h){if(h===i.EOF_FOLLOW_KEY)return[e.EOF];var u=h.ruleName+h.idxInCallingRule+r.IN+h.inRule;return this.resyncFollows[u]},a.prototype.addToResyncTokens=function(h,u){return this.tokenMatcher(h,e.EOF)||u.push(h),u},a.prototype.reSyncTo=function(h){for(var u=[],b=this.LA(1);this.tokenMatcher(b,h)===!1;)b=this.SKIP_TOKEN(),this.addToResyncTokens(b,u);return t.dropRight(u)},a.prototype.attemptInRepetitionRecovery=function(h,u,b,f,I,E,l){},a.prototype.getCurrentGrammarPath=function(h,u){var b=this.getHumanReadableRuleStack(),f=t.cloneArr(this.RULE_OCCURRENCE_STACK),I={ruleStack:b,occurrenceStack:f,lastTok:h,lastTokOccurrence:u};return I},a.prototype.getHumanReadableRuleStack=function(){var h=this;return t.map(this.RULE_STACK,function(u){return h.shortRuleNameToFullName(u)})},a})();i.Recoverable=c;function A(a,h,u,b,f,I,E){var l=this.getKeyForAutomaticLookahead(b,f),d=this.firstAfterRepMap[l];if(d===void 0){var p=this.getCurrRuleFullName(),C=this.getGAstProductions()[p],m=new I(C,f);d=m.startWalking(),this.firstAfterRepMap[l]=d}var y=d.token,Q=d.occurrence,_=d.isEndOfRule;this.RULE_STACK.length===1&&_&&y===void 0&&(y=e.EOF,Q=1),this.shouldInRepetitionRecoveryBeTried(y,Q,E)&&this.tryInRepetitionRecovery(a,h,u,y)}i.attemptInRepetitionRecovery=A}),gn=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getKeyForAutomaticLookahead=i.AT_LEAST_ONE_SEP_IDX=i.MANY_SEP_IDX=i.AT_LEAST_ONE_IDX=i.MANY_IDX=i.OPTION_IDX=i.OR_IDX=i.BITS_FOR_ALT_IDX=i.BITS_FOR_RULE_IDX=i.BITS_FOR_OCCURRENCE_IDX=i.BITS_FOR_METHOD_TYPE=void 0,i.BITS_FOR_METHOD_TYPE=4,i.BITS_FOR_OCCURRENCE_IDX=8,i.BITS_FOR_RULE_IDX=12,i.BITS_FOR_ALT_IDX=8,i.OR_IDX=1<<i.BITS_FOR_OCCURRENCE_IDX,i.OPTION_IDX=2<<i.BITS_FOR_OCCURRENCE_IDX,i.MANY_IDX=3<<i.BITS_FOR_OCCURRENCE_IDX,i.AT_LEAST_ONE_IDX=4<<i.BITS_FOR_OCCURRENCE_IDX,i.MANY_SEP_IDX=5<<i.BITS_FOR_OCCURRENCE_IDX,i.AT_LEAST_ONE_SEP_IDX=6<<i.BITS_FOR_OCCURRENCE_IDX;function e(t,n,r){return r|n|t}i.getKeyForAutomaticLookahead=e,32-i.BITS_FOR_ALT_IDX}),as=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LooksAhead=void 0;var e=Mt(),t=De(),n=tt(),r=gn(),o=Dt(),s=(function(){function c(){}return c.prototype.initLooksAhead=function(A){this.dynamicTokensEnabled=t.has(A,"dynamicTokensEnabled")?A.dynamicTokensEnabled:n.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=t.has(A,"maxLookahead")?A.maxLookahead:n.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=t.isES2015MapSupported()?new Map:[],t.isES2015MapSupported()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},c.prototype.preComputeLookaheadFunctions=function(A){var a=this;t.forEach(A,function(h){a.TRACE_INIT(h.name+" Rule Lookahead",function(){var u=o.collectMethods(h),b=u.alternation,f=u.repetition,I=u.option,E=u.repetitionMandatory,l=u.repetitionMandatoryWithSeparator,d=u.repetitionWithSeparator;t.forEach(b,function(p){var C=p.idx===0?"":p.idx;a.TRACE_INIT(""+o.getProductionDslName(p)+C,function(){var m=e.buildLookaheadFuncForOr(p.idx,h,p.maxLookahead||a.maxLookahead,p.hasPredicates,a.dynamicTokensEnabled,a.lookAheadBuilderForAlternatives),y=r.getKeyForAutomaticLookahead(a.fullRuleNameToShort[h.name],r.OR_IDX,p.idx);a.setLaFuncCache(y,m)})}),t.forEach(f,function(p){a.computeLookaheadFunc(h,p.idx,r.MANY_IDX,e.PROD_TYPE.REPETITION,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(I,function(p){a.computeLookaheadFunc(h,p.idx,r.OPTION_IDX,e.PROD_TYPE.OPTION,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(E,function(p){a.computeLookaheadFunc(h,p.idx,r.AT_LEAST_ONE_IDX,e.PROD_TYPE.REPETITION_MANDATORY,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(l,function(p){a.computeLookaheadFunc(h,p.idx,r.AT_LEAST_ONE_SEP_IDX,e.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(d,function(p){a.computeLookaheadFunc(h,p.idx,r.MANY_SEP_IDX,e.PROD_TYPE.REPETITION_WITH_SEPARATOR,p.maxLookahead,o.getProductionDslName(p))})})})},c.prototype.computeLookaheadFunc=function(A,a,h,u,b,f){var I=this;this.TRACE_INIT(""+f+(a===0?"":a),function(){var E=e.buildLookaheadFuncForOptionalProd(a,A,b||I.maxLookahead,I.dynamicTokensEnabled,u,I.lookAheadBuilderForOptional),l=r.getKeyForAutomaticLookahead(I.fullRuleNameToShort[A.name],h,a);I.setLaFuncCache(l,E)})},c.prototype.lookAheadBuilderForOptional=function(A,a,h){return e.buildSingleAlternativeLookaheadFunction(A,a,h)},c.prototype.lookAheadBuilderForAlternatives=function(A,a,h,u){return e.buildAlternativesLookAheadFunc(A,a,h,u)},c.prototype.getKeyForAutomaticLookahead=function(A,a){var h=this.getLastExplicitRuleShortName();return r.getKeyForAutomaticLookahead(h,A,a)},c.prototype.getLaFuncFromCache=function(A){},c.prototype.getLaFuncFromMap=function(A){return this.lookAheadFuncsCache.get(A)},c.prototype.getLaFuncFromObj=function(A){return this.lookAheadFuncsCache[A]},c.prototype.setLaFuncCache=function(A,a){},c.prototype.setLaFuncCacheUsingMap=function(A,a){this.lookAheadFuncsCache.set(A,a)},c.prototype.setLaFuncUsingObj=function(A,a){this.lookAheadFuncsCache[A]=a},c})();i.LooksAhead=s}),As=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addNoneTerminalToCst=i.addTerminalToCst=i.setNodeLocationFull=i.setNodeLocationOnlyOffset=void 0;function e(o,s){isNaN(o.startOffset)===!0?(o.startOffset=s.startOffset,o.endOffset=s.endOffset):o.endOffset<s.endOffset&&(o.endOffset=s.endOffset)}i.setNodeLocationOnlyOffset=e;function t(o,s){isNaN(o.startOffset)===!0?(o.startOffset=s.startOffset,o.startColumn=s.startColumn,o.startLine=s.startLine,o.endOffset=s.endOffset,o.endColumn=s.endColumn,o.endLine=s.endLine):o.endOffset<s.endOffset&&(o.endOffset=s.endOffset,o.endColumn=s.endColumn,o.endLine=s.endLine)}i.setNodeLocationFull=t;function n(o,s,c){o.children[c]===void 0?o.children[c]=[s]:o.children[c].push(s)}i.addTerminalToCst=n;function r(o,s,c){o.children[s]===void 0?o.children[s]=[c]:o.children[s].push(c)}i.addNoneTerminalToCst=r}),Zi=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defineNameProp=i.functionName=i.classNameFromInstance=void 0;var e=De();function t(s){return r(s.constructor)}i.classNameFromInstance=t;var n="name";function r(s){var c=s.name;return c||"anonymous"}i.functionName=r;function o(s,c){var A=Object.getOwnPropertyDescriptor(s,n);return e.isUndefined(A)||A.configurable?(Object.defineProperty(s,n,{enumerable:!1,configurable:!0,writable:!1,value:c}),!0):!1}i.defineNameProp=o}),cs=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.validateRedundantMethods=i.validateMissingCstMethods=i.validateVisitor=i.CstVisitorDefinitionError=i.createBaseVisitorConstructorWithDefaults=i.createBaseSemanticVisitorConstructor=i.defaultVisit=void 0;var e=De(),t=Zi();function n(u,b){for(var f=e.keys(u),I=f.length,E=0;E<I;E++)for(var l=f[E],d=u[l],p=d.length,C=0;C<p;C++){var m=d[C];m.tokenTypeIdx===void 0&&this[m.name](m.children,b)}}i.defaultVisit=n;function r(u,b){var f=function(){};t.defineNameProp(f,u+"BaseSemantics");var I={visit:function(E,l){if(e.isArray(E)&&(E=E[0]),!e.isUndefined(E))return this[E.name](E.children,l)},validateVisitor:function(){var E=c(this,b);if(!e.isEmpty(E)){var l=e.map(E,function(d){return d.msg});throw Error("Errors Detected in CST Visitor <"+t.functionName(this.constructor)+`>:
|
|
152
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return h},buildInvalidRuleNameError:function(s){return"deprecated"},buildDuplicateRuleNameError:function(s){var c;s.topLevelRule instanceof r.Rule?c=s.topLevelRule.name:c=s.topLevelRule;var A="Duplicate definition, rule: ->"+c+"<- is already defined in the grammar: ->"+s.grammarName+"<-";return A}}}),as=ve(i=>{var e=i&&i.__extends||(function(){var c=function(A,a){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,u){h.__proto__=u}||function(h,u){for(var b in u)Object.prototype.hasOwnProperty.call(u,b)&&(h[b]=u[b])},c(A,a)};return function(A,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");c(A,a);function h(){this.constructor=A}A.prototype=a===null?Object.create(a):(h.prototype=a.prototype,new h)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.GastRefResolverVisitor=i.resolveGrammar=void 0;var t=tt(),n=Oe(),r=kt();function o(c,A){var a=new s(c,A);return a.resolveRefs(),a.errors}i.resolveGrammar=o;var s=(function(c){e(A,c);function A(a,h){var u=c.call(this)||this;return u.nameToTopRule=a,u.errMsgProvider=h,u.errors=[],u}return A.prototype.resolveRefs=function(){var a=this;n.forEach(n.values(this.nameToTopRule),function(h){a.currTopLevel=h,h.accept(a)})},A.prototype.visitNonTerminal=function(a){var h=this.nameToTopRule[a.nonTerminalName];if(h)a.referencedRule=h;else{var u=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,a);this.errors.push({message:u,type:t.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:a.nonTerminalName})}},A})(r.GAstVisitor);i.GastRefResolverVisitor=s}),Mt=ve(i=>{var e=i&&i.__extends||(function(){var l=function(d,p){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,E){C.__proto__=E}||function(C,E){for(var y in E)Object.prototype.hasOwnProperty.call(E,y)&&(C[y]=E[y])},l(d,p)};return function(d,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");l(d,p);function C(){this.constructor=d}d.prototype=p===null?Object.create(p):(C.prototype=p.prototype,new C)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.nextPossibleTokensAfter=i.possiblePathsFrom=i.NextTerminalAfterAtLeastOneSepWalker=i.NextTerminalAfterAtLeastOneWalker=i.NextTerminalAfterManySepWalker=i.NextTerminalAfterManyWalker=i.AbstractNextTerminalAfterProductionWalker=i.NextAfterTokenWalker=i.AbstractNextPossibleTokensWalker=void 0;var t=mn(),n=Oe(),r=Ji(),o=Ze(),s=(function(l){e(d,l);function d(p,C){var E=l.call(this)||this;return E.topProd=p,E.path=C,E.possibleTokTypes=[],E.nextProductionName="",E.nextProductionOccurrence=0,E.found=!1,E.isAtEndOfPath=!1,E}return d.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=n.cloneArr(this.path.ruleStack).reverse(),this.occurrenceStack=n.cloneArr(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},d.prototype.walk=function(p,C){C===void 0&&(C=[]),this.found||l.prototype.walk.call(this,p,C)},d.prototype.walkProdRef=function(p,C,E){if(p.referencedRule.name===this.nextProductionName&&p.idx===this.nextProductionOccurrence){var y=C.concat(E);this.updateExpectedNext(),this.walk(p.referencedRule,y)}},d.prototype.updateExpectedNext=function(){n.isEmpty(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},d})(t.RestWalker);i.AbstractNextPossibleTokensWalker=s;var c=(function(l){e(d,l);function d(p,C){var E=l.call(this,p,C)||this;return E.path=C,E.nextTerminalName="",E.nextTerminalOccurrence=0,E.nextTerminalName=E.path.lastTok.name,E.nextTerminalOccurrence=E.path.lastTokOccurrence,E}return d.prototype.walkTerminal=function(p,C,E){if(this.isAtEndOfPath&&p.terminalType.name===this.nextTerminalName&&p.idx===this.nextTerminalOccurrence&&!this.found){var y=C.concat(E),Q=new o.Alternative({definition:y});this.possibleTokTypes=r.first(Q),this.found=!0}},d})(s);i.NextAfterTokenWalker=c;var A=(function(l){e(d,l);function d(p,C){var E=l.call(this)||this;return E.topRule=p,E.occurrence=C,E.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},E}return d.prototype.startWalking=function(){return this.walk(this.topRule),this.result},d})(t.RestWalker);i.AbstractNextTerminalAfterProductionWalker=A;var a=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.prototype.walkMany=function(p,C,E){if(p.idx===this.occurrence){var y=n.first(C.concat(E));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkMany.call(this,p,C,E)},d})(A);i.NextTerminalAfterManyWalker=a;var h=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.prototype.walkManySep=function(p,C,E){if(p.idx===this.occurrence){var y=n.first(C.concat(E));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkManySep.call(this,p,C,E)},d})(A);i.NextTerminalAfterManySepWalker=h;var u=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.prototype.walkAtLeastOne=function(p,C,E){if(p.idx===this.occurrence){var y=n.first(C.concat(E));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkAtLeastOne.call(this,p,C,E)},d})(A);i.NextTerminalAfterAtLeastOneWalker=u;var b=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.prototype.walkAtLeastOneSep=function(p,C,E){if(p.idx===this.occurrence){var y=n.first(C.concat(E));this.result.isEndOfRule=y===void 0,y instanceof o.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkAtLeastOneSep.call(this,p,C,E)},d})(A);i.NextTerminalAfterAtLeastOneSepWalker=b;function f(l,d,p){p===void 0&&(p=[]),p=n.cloneArr(p);var C=[],E=0;function y(R){return R.concat(n.drop(l,E+1))}function Q(R){var M=f(y(R),d,p);return C.concat(M)}for(;p.length<d&&E<l.length;){var x=l[E];if(x instanceof o.Alternative||x instanceof o.NonTerminal)return Q(x.definition);if(x instanceof o.Option)C=Q(x.definition);else if(x instanceof o.RepetitionMandatory){var H=x.definition.concat([new o.Repetition({definition:x.definition})]);return Q(H)}else if(x instanceof o.RepetitionMandatoryWithSeparator){var H=[new o.Alternative({definition:x.definition}),new o.Repetition({definition:[new o.Terminal({terminalType:x.separator})].concat(x.definition)})];return Q(H)}else if(x instanceof o.RepetitionWithSeparator){var H=x.definition.concat([new o.Repetition({definition:[new o.Terminal({terminalType:x.separator})].concat(x.definition)})]);C=Q(H)}else if(x instanceof o.Repetition){var H=x.definition.concat([new o.Repetition({definition:x.definition})]);C=Q(H)}else{if(x instanceof o.Alternation)return n.forEach(x.definition,function(R){n.isEmpty(R.definition)===!1&&(C=Q(R.definition))}),C;if(x instanceof o.Terminal)p.push(x.terminalType);else throw Error("non exhaustive match")}E++}return C.push({partialPath:p,suffixDef:n.drop(l,E)}),C}i.possiblePathsFrom=f;function I(l,d,p,C){var E="EXIT_NONE_TERMINAL",y=[E],Q="EXIT_ALTERNATIVE",x=!1,H=d.length,R=H-C-1,M=[],N=[];for(N.push({idx:-1,def:l,ruleStack:[],occurrenceStack:[]});!n.isEmpty(N);){var v=N.pop();if(v===Q){x&&n.last(N).idx<=R&&N.pop();continue}var S=v.def,_=v.idx,V=v.ruleStack,J=v.occurrenceStack;if(!n.isEmpty(S)){var q=S[0];if(q===E){var $={idx:_,def:n.drop(S),ruleStack:n.dropRight(V),occurrenceStack:n.dropRight(J)};N.push($)}else if(q instanceof o.Terminal)if(_<H-1){var ne=_+1,ue=d[ne];if(p(ue,q.terminalType)){var $={idx:ne,def:n.drop(S),ruleStack:V,occurrenceStack:J};N.push($)}}else if(_===H-1)M.push({nextTokenType:q.terminalType,nextTokenOccurrence:q.idx,ruleStack:V,occurrenceStack:J}),x=!0;else throw Error("non exhaustive match");else if(q instanceof o.NonTerminal){var oe=n.cloneArr(V);oe.push(q.nonTerminalName);var ae=n.cloneArr(J);ae.push(q.idx);var $={idx:_,def:q.definition.concat(y,n.drop(S)),ruleStack:oe,occurrenceStack:ae};N.push($)}else if(q instanceof o.Option){var Ae={idx:_,def:n.drop(S),ruleStack:V,occurrenceStack:J};N.push(Ae),N.push(Q);var Ce={idx:_,def:q.definition.concat(n.drop(S)),ruleStack:V,occurrenceStack:J};N.push(Ce)}else if(q instanceof o.RepetitionMandatory){var U=new o.Repetition({definition:q.definition,idx:q.idx}),P=q.definition.concat([U],n.drop(S)),$={idx:_,def:P,ruleStack:V,occurrenceStack:J};N.push($)}else if(q instanceof o.RepetitionMandatoryWithSeparator){var z=new o.Terminal({terminalType:q.separator}),U=new o.Repetition({definition:[z].concat(q.definition),idx:q.idx}),P=q.definition.concat([U],n.drop(S)),$={idx:_,def:P,ruleStack:V,occurrenceStack:J};N.push($)}else if(q instanceof o.RepetitionWithSeparator){var Ae={idx:_,def:n.drop(S),ruleStack:V,occurrenceStack:J};N.push(Ae),N.push(Q);var z=new o.Terminal({terminalType:q.separator}),X=new o.Repetition({definition:[z].concat(q.definition),idx:q.idx}),P=q.definition.concat([X],n.drop(S)),Ce={idx:_,def:P,ruleStack:V,occurrenceStack:J};N.push(Ce)}else if(q instanceof o.Repetition){var Ae={idx:_,def:n.drop(S),ruleStack:V,occurrenceStack:J};N.push(Ae),N.push(Q);var X=new o.Repetition({definition:q.definition,idx:q.idx}),P=q.definition.concat([X],n.drop(S)),Ce={idx:_,def:P,ruleStack:V,occurrenceStack:J};N.push(Ce)}else if(q instanceof o.Alternation)for(var ee=q.definition.length-1;ee>=0;ee--){var le=q.definition[ee],we={idx:_,def:le.definition.concat(n.drop(S)),ruleStack:V,occurrenceStack:J};N.push(we),N.push(Q)}else if(q instanceof o.Alternative)N.push({idx:_,def:q.definition.concat(n.drop(S)),ruleStack:V,occurrenceStack:J});else if(q instanceof o.Rule)N.push(m(q,_,V,J));else throw Error("non exhaustive match")}}return M}i.nextPossibleTokensAfter=I;function m(l,d,p,C){var E=n.cloneArr(p);E.push(l.name);var y=n.cloneArr(C);return y.push(1),{idx:d,def:l.definition,ruleStack:E,occurrenceStack:y}}}),Pt=ve(i=>{var e=i&&i.__extends||(function(){var R=function(M,N){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var _ in S)Object.prototype.hasOwnProperty.call(S,_)&&(v[_]=S[_])},R(M,N)};return function(M,N){if(typeof N!="function"&&N!==null)throw new TypeError("Class extends value "+String(N)+" is not a constructor or null");R(M,N);function v(){this.constructor=M}M.prototype=N===null?Object.create(N):(v.prototype=N.prototype,new v)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.areTokenCategoriesNotUsed=i.isStrictPrefixOfPath=i.containsPath=i.getLookaheadPathsForOptionalProd=i.getLookaheadPathsForOr=i.lookAheadSequenceFromAlternatives=i.buildSingleAlternativeLookaheadFunction=i.buildAlternativesLookAheadFunc=i.buildLookaheadFuncForOptionalProd=i.buildLookaheadFuncForOr=i.getProdType=i.PROD_TYPE=void 0;var t=Oe(),n=Mt(),r=mn(),o=Qt(),s=Ze(),c=kt(),A;(function(R){R[R.OPTION=0]="OPTION",R[R.REPETITION=1]="REPETITION",R[R.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",R[R.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",R[R.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",R[R.ALTERNATION=5]="ALTERNATION"})(A=i.PROD_TYPE||(i.PROD_TYPE={}));function a(R){if(R instanceof s.Option)return A.OPTION;if(R instanceof s.Repetition)return A.REPETITION;if(R instanceof s.RepetitionMandatory)return A.REPETITION_MANDATORY;if(R instanceof s.RepetitionMandatoryWithSeparator)return A.REPETITION_MANDATORY_WITH_SEPARATOR;if(R instanceof s.RepetitionWithSeparator)return A.REPETITION_WITH_SEPARATOR;if(R instanceof s.Alternation)return A.ALTERNATION;throw Error("non exhaustive match")}i.getProdType=a;function h(R,M,N,v,S,_){var V=E(R,M,N),J=H(V)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return _(V,v,J,S)}i.buildLookaheadFuncForOr=h;function u(R,M,N,v,S,_){var V=y(R,M,S,N),J=H(V)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return _(V[0],J,v)}i.buildLookaheadFuncForOptionalProd=u;function b(R,M,N,v){var S=R.length,_=t.every(R,function(q){return t.every(q,function($){return $.length===1})});if(M)return function(q){for(var $=t.map(q,function(X){return X.GATE}),ne=0;ne<S;ne++){var ue=R[ne],oe=ue.length,ae=$[ne];if(!(ae!==void 0&&ae.call(this)===!1))e:for(var Ae=0;Ae<oe;Ae++){for(var Ce=ue[Ae],U=Ce.length,P=0;P<U;P++){var z=this.LA(P+1);if(N(z,Ce[P])===!1)continue e}return ne}}};if(_&&!v){var V=t.map(R,function(q){return t.flatten(q)}),J=t.reduce(V,function(q,$,ne){return t.forEach($,function(ue){t.has(q,ue.tokenTypeIdx)||(q[ue.tokenTypeIdx]=ne),t.forEach(ue.categoryMatches,function(oe){t.has(q,oe)||(q[oe]=ne)})}),q},[]);return function(){var q=this.LA(1);return J[q.tokenTypeIdx]}}else return function(){for(var q=0;q<S;q++){var $=R[q],ne=$.length;e:for(var ue=0;ue<ne;ue++){for(var oe=$[ue],ae=oe.length,Ae=0;Ae<ae;Ae++){var Ce=this.LA(Ae+1);if(N(Ce,oe[Ae])===!1)continue e}return q}}}}i.buildAlternativesLookAheadFunc=b;function f(R,M,N){var v=t.every(R,function($){return $.length===1}),S=R.length;if(v&&!N){var _=t.flatten(R);if(_.length===1&&t.isEmpty(_[0].categoryMatches)){var V=_[0],J=V.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===J}}else{var q=t.reduce(_,function($,ne,ue){return $[ne.tokenTypeIdx]=!0,t.forEach(ne.categoryMatches,function(oe){$[oe]=!0}),$},[]);return function(){var $=this.LA(1);return q[$.tokenTypeIdx]===!0}}}else return function(){e:for(var $=0;$<S;$++){for(var ne=R[$],ue=ne.length,oe=0;oe<ue;oe++){var ae=this.LA(oe+1);if(M(ae,ne[oe])===!1)continue e}return!0}return!1}}i.buildSingleAlternativeLookaheadFunction=f;var I=(function(R){e(M,R);function M(N,v,S){var _=R.call(this)||this;return _.topProd=N,_.targetOccurrence=v,_.targetProdType=S,_}return M.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},M.prototype.checkIsTarget=function(N,v,S,_){return N.idx===this.targetOccurrence&&this.targetProdType===v?(this.restDef=S.concat(_),!0):!1},M.prototype.walkOption=function(N,v,S){this.checkIsTarget(N,A.OPTION,v,S)||R.prototype.walkOption.call(this,N,v,S)},M.prototype.walkAtLeastOne=function(N,v,S){this.checkIsTarget(N,A.REPETITION_MANDATORY,v,S)||R.prototype.walkOption.call(this,N,v,S)},M.prototype.walkAtLeastOneSep=function(N,v,S){this.checkIsTarget(N,A.REPETITION_MANDATORY_WITH_SEPARATOR,v,S)||R.prototype.walkOption.call(this,N,v,S)},M.prototype.walkMany=function(N,v,S){this.checkIsTarget(N,A.REPETITION,v,S)||R.prototype.walkOption.call(this,N,v,S)},M.prototype.walkManySep=function(N,v,S){this.checkIsTarget(N,A.REPETITION_WITH_SEPARATOR,v,S)||R.prototype.walkOption.call(this,N,v,S)},M})(r.RestWalker),m=(function(R){e(M,R);function M(N,v,S){var _=R.call(this)||this;return _.targetOccurrence=N,_.targetProdType=v,_.targetRef=S,_.result=[],_}return M.prototype.checkIsTarget=function(N,v){N.idx===this.targetOccurrence&&this.targetProdType===v&&(this.targetRef===void 0||N===this.targetRef)&&(this.result=N.definition)},M.prototype.visitOption=function(N){this.checkIsTarget(N,A.OPTION)},M.prototype.visitRepetition=function(N){this.checkIsTarget(N,A.REPETITION)},M.prototype.visitRepetitionMandatory=function(N){this.checkIsTarget(N,A.REPETITION_MANDATORY)},M.prototype.visitRepetitionMandatoryWithSeparator=function(N){this.checkIsTarget(N,A.REPETITION_MANDATORY_WITH_SEPARATOR)},M.prototype.visitRepetitionWithSeparator=function(N){this.checkIsTarget(N,A.REPETITION_WITH_SEPARATOR)},M.prototype.visitAlternation=function(N){this.checkIsTarget(N,A.ALTERNATION)},M})(c.GAstVisitor);function l(R){for(var M=new Array(R),N=0;N<R;N++)M[N]=[];return M}function d(R){for(var M=[""],N=0;N<R.length;N++){for(var v=R[N],S=[],_=0;_<M.length;_++){var V=M[_];S.push(V+"_"+v.tokenTypeIdx);for(var J=0;J<v.categoryMatches.length;J++){var q="_"+v.categoryMatches[J];S.push(V+q)}}M=S}return M}function p(R,M,N){for(var v=0;v<R.length;v++)if(v!==N)for(var S=R[v],_=0;_<M.length;_++){var V=M[_];if(S[V]===!0)return!1}return!0}function C(R,M){for(var N=t.map(R,function(ne){return n.possiblePathsFrom([ne],1)}),v=l(N.length),S=t.map(N,function(ne){var ue={};return t.forEach(ne,function(oe){var ae=d(oe.partialPath);t.forEach(ae,function(Ae){ue[Ae]=!0})}),ue}),_=N,V=1;V<=M;V++){var J=_;_=l(J.length);for(var q=function(ne){for(var ue=J[ne],oe=0;oe<ue.length;oe++){var ae=ue[oe].partialPath,Ae=ue[oe].suffixDef,Ce=d(ae),U=p(S,Ce,ne);if(U||t.isEmpty(Ae)||ae.length===M){var P=v[ne];if(Q(P,ae)===!1){P.push(ae);for(var z=0;z<Ce.length;z++){var X=Ce[z];S[ne][X]=!0}}}else{var ee=n.possiblePathsFrom(Ae,V+1,ae);_[ne]=_[ne].concat(ee),t.forEach(ee,function(le){var we=d(le.partialPath);t.forEach(we,function(Re){S[ne][Re]=!0})})}}},$=0;$<J.length;$++)q($)}return v}i.lookAheadSequenceFromAlternatives=C;function E(R,M,N,v){var S=new m(R,A.ALTERNATION,v);return M.accept(S),C(S.result,N)}i.getLookaheadPathsForOr=E;function y(R,M,N,v){var S=new m(R,N);M.accept(S);var _=S.result,V=new I(M,R,N),J=V.startWalking(),q=new s.Alternative({definition:_}),$=new s.Alternative({definition:J});return C([q,$],v)}i.getLookaheadPathsForOptionalProd=y;function Q(R,M){e:for(var N=0;N<R.length;N++){var v=R[N];if(v.length===M.length){for(var S=0;S<v.length;S++){var _=M[S],V=v[S],J=_===V||V.categoryMatchesMap[_.tokenTypeIdx]!==void 0;if(J===!1)continue e}return!0}}return!1}i.containsPath=Q;function x(R,M){return R.length<M.length&&t.every(R,function(N,v){var S=M[v];return N===S||S.categoryMatchesMap[N.tokenTypeIdx]})}i.isStrictPrefixOfPath=x;function H(R){return t.every(R,function(M){return t.every(M,function(N){return t.every(N,function(v){return t.isEmpty(v.categoryMatches)})})})}i.areTokenCategoriesNotUsed=H}),Zi=ve(i=>{var e=i&&i.__extends||(function(){var v=function(S,_){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(V,J){V.__proto__=J}||function(V,J){for(var q in J)Object.prototype.hasOwnProperty.call(J,q)&&(V[q]=J[q])},v(S,_)};return function(S,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");v(S,_);function V(){this.constructor=S}S.prototype=_===null?Object.create(_):(V.prototype=_.prototype,new V)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.checkPrefixAlternativesAmbiguities=i.validateSomeNonEmptyLookaheadPath=i.validateTooManyAlts=i.RepetionCollector=i.validateAmbiguousAlternationAlternatives=i.validateEmptyOrAlternative=i.getFirstNoneTerminal=i.validateNoLeftRecursion=i.validateRuleIsOverridden=i.validateRuleDoesNotAlreadyExist=i.OccurrenceValidationCollector=i.identifyProductionForDuplicates=i.validateGrammar=void 0;var t=Oe(),n=Oe(),r=tt(),o=Ft(),s=Pt(),c=Mt(),A=Ze(),a=kt();function h(v,S,_,V,J){var q=t.map(v,function(U){return u(U,V)}),$=t.map(v,function(U){return d(U,U,V)}),ne=[],ue=[],oe=[];n.every($,n.isEmpty)&&(ne=n.map(v,function(U){return E(U,V)}),ue=n.map(v,function(U){return y(U,S,V)}),oe=H(v,S,V));var ae=N(v,_,V),Ae=n.map(v,function(U){return x(U,V)}),Ce=n.map(v,function(U){return m(U,v,J,V)});return t.flatten(q.concat(oe,$,ne,ue,ae,Ae,Ce))}i.validateGrammar=h;function u(v,S){var _=new I;v.accept(_);var V=_.allProductions,J=t.groupBy(V,b),q=t.pick(J,function(ne){return ne.length>1}),$=t.map(t.values(q),function(ne){var ue=t.first(ne),oe=S.buildDuplicateFoundError(v,ne),ae=o.getProductionDslName(ue),Ae={message:oe,type:r.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:v.name,dslName:ae,occurrence:ue.idx},Ce=f(ue);return Ce&&(Ae.parameter=Ce),Ae});return $}function b(v){return o.getProductionDslName(v)+"_#_"+v.idx+"_#_"+f(v)}i.identifyProductionForDuplicates=b;function f(v){return v instanceof A.Terminal?v.terminalType.name:v instanceof A.NonTerminal?v.nonTerminalName:""}var I=(function(v){e(S,v);function S(){var _=v!==null&&v.apply(this,arguments)||this;return _.allProductions=[],_}return S.prototype.visitNonTerminal=function(_){this.allProductions.push(_)},S.prototype.visitOption=function(_){this.allProductions.push(_)},S.prototype.visitRepetitionWithSeparator=function(_){this.allProductions.push(_)},S.prototype.visitRepetitionMandatory=function(_){this.allProductions.push(_)},S.prototype.visitRepetitionMandatoryWithSeparator=function(_){this.allProductions.push(_)},S.prototype.visitRepetition=function(_){this.allProductions.push(_)},S.prototype.visitAlternation=function(_){this.allProductions.push(_)},S.prototype.visitTerminal=function(_){this.allProductions.push(_)},S})(a.GAstVisitor);i.OccurrenceValidationCollector=I;function m(v,S,_,V){var J=[],q=n.reduce(S,function(ne,ue){return ue.name===v.name?ne+1:ne},0);if(q>1){var $=V.buildDuplicateRuleNameError({topLevelRule:v,grammarName:_});J.push({message:$,type:r.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:v.name})}return J}i.validateRuleDoesNotAlreadyExist=m;function l(v,S,_){var V=[],J;return t.contains(S,v)||(J="Invalid rule override, rule: ->"+v+"<- cannot be overridden in the grammar: ->"+_+"<-as it is not defined in any of the super grammars ",V.push({message:J,type:r.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:v})),V}i.validateRuleIsOverridden=l;function d(v,S,_,V){V===void 0&&(V=[]);var J=[],q=p(S.definition);if(t.isEmpty(q))return[];var $=v.name,ne=t.contains(q,v);ne&&J.push({message:_.buildLeftRecursionError({topLevelRule:v,leftRecursionPath:V}),type:r.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:$});var ue=t.difference(q,V.concat([v])),oe=t.map(ue,function(ae){var Ae=t.cloneArr(V);return Ae.push(ae),d(v,ae,_,Ae)});return J.concat(t.flatten(oe))}i.validateNoLeftRecursion=d;function p(v){var S=[];if(t.isEmpty(v))return S;var _=t.first(v);if(_ instanceof A.NonTerminal)S.push(_.referencedRule);else if(_ instanceof A.Alternative||_ instanceof A.Option||_ instanceof A.RepetitionMandatory||_ instanceof A.RepetitionMandatoryWithSeparator||_ instanceof A.RepetitionWithSeparator||_ instanceof A.Repetition)S=S.concat(p(_.definition));else if(_ instanceof A.Alternation)S=t.flatten(t.map(_.definition,function($){return p($.definition)}));else if(!(_ instanceof A.Terminal))throw Error("non exhaustive match");var V=o.isOptionalProd(_),J=v.length>1;if(V&&J){var q=t.drop(v);return S.concat(p(q))}else return S}i.getFirstNoneTerminal=p;var C=(function(v){e(S,v);function S(){var _=v!==null&&v.apply(this,arguments)||this;return _.alternations=[],_}return S.prototype.visitAlternation=function(_){this.alternations.push(_)},S})(a.GAstVisitor);function E(v,S){var _=new C;v.accept(_);var V=_.alternations,J=t.reduce(V,function(q,$){var ne=t.dropRight($.definition),ue=t.map(ne,function(oe,ae){var Ae=c.nextPossibleTokensAfter([oe],[],null,1);return t.isEmpty(Ae)?{message:S.buildEmptyAlternationError({topLevelRule:v,alternation:$,emptyChoiceIdx:ae}),type:r.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:v.name,occurrence:$.idx,alternative:ae+1}:null});return q.concat(t.compact(ue))},[]);return J}i.validateEmptyOrAlternative=E;function y(v,S,_){var V=new C;v.accept(V);var J=V.alternations;J=n.reject(J,function($){return $.ignoreAmbiguities===!0});var q=t.reduce(J,function($,ne){var ue=ne.idx,oe=ne.maxLookahead||S,ae=s.getLookaheadPathsForOr(ue,v,oe,ne),Ae=R(ae,ne,v,_),Ce=M(ae,ne,v,_);return $.concat(Ae,Ce)},[]);return q}i.validateAmbiguousAlternationAlternatives=y;var Q=(function(v){e(S,v);function S(){var _=v!==null&&v.apply(this,arguments)||this;return _.allProductions=[],_}return S.prototype.visitRepetitionWithSeparator=function(_){this.allProductions.push(_)},S.prototype.visitRepetitionMandatory=function(_){this.allProductions.push(_)},S.prototype.visitRepetitionMandatoryWithSeparator=function(_){this.allProductions.push(_)},S.prototype.visitRepetition=function(_){this.allProductions.push(_)},S})(a.GAstVisitor);i.RepetionCollector=Q;function x(v,S){var _=new C;v.accept(_);var V=_.alternations,J=t.reduce(V,function(q,$){return $.definition.length>255&&q.push({message:S.buildTooManyAlternativesError({topLevelRule:v,alternation:$}),type:r.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:v.name,occurrence:$.idx}),q},[]);return J}i.validateTooManyAlts=x;function H(v,S,_){var V=[];return n.forEach(v,function(J){var q=new Q;J.accept(q);var $=q.allProductions;n.forEach($,function(ne){var ue=s.getProdType(ne),oe=ne.maxLookahead||S,ae=ne.idx,Ae=s.getLookaheadPathsForOptionalProd(ae,J,ue,oe),Ce=Ae[0];if(n.isEmpty(n.flatten(Ce))){var U=_.buildEmptyRepetitionError({topLevelRule:J,repetition:ne});V.push({message:U,type:r.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:J.name})}})}),V}i.validateSomeNonEmptyLookaheadPath=H;function R(v,S,_,V){var J=[],q=n.reduce(v,function(ne,ue,oe){return S.definition[oe].ignoreAmbiguities===!0||n.forEach(ue,function(ae){var Ae=[oe];n.forEach(v,function(Ce,U){oe!==U&&s.containsPath(Ce,ae)&&S.definition[U].ignoreAmbiguities!==!0&&Ae.push(U)}),Ae.length>1&&!s.containsPath(J,ae)&&(J.push(ae),ne.push({alts:Ae,path:ae}))}),ne},[]),$=t.map(q,function(ne){var ue=n.map(ne.alts,function(ae){return ae+1}),oe=V.buildAlternationAmbiguityError({topLevelRule:_,alternation:S,ambiguityIndices:ue,prefixPath:ne.path});return{message:oe,type:r.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:_.name,occurrence:S.idx,alternatives:[ne.alts]}});return $}function M(v,S,_,V){var J=[],q=n.reduce(v,function($,ne,ue){var oe=n.map(ne,function(ae){return{idx:ue,path:ae}});return $.concat(oe)},[]);return n.forEach(q,function($){var ne=S.definition[$.idx];if(ne.ignoreAmbiguities!==!0){var ue=$.idx,oe=$.path,ae=n.findAll(q,function(Ce){return S.definition[Ce.idx].ignoreAmbiguities!==!0&&Ce.idx<ue&&s.isStrictPrefixOfPath(Ce.path,oe)}),Ae=n.map(ae,function(Ce){var U=[Ce.idx+1,ue+1],P=S.idx===0?"":S.idx,z=V.buildAlternationPrefixAmbiguityError({topLevelRule:_,alternation:S,ambiguityIndices:U,prefixPath:Ce.path});return{message:z,type:r.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:_.name,occurrence:P,alternatives:U}});J=J.concat(Ae)}}),J}i.checkPrefixAlternativesAmbiguities=M;function N(v,S,_){var V=[],J=n.map(S,function(q){return q.name});return n.forEach(v,function(q){var $=q.name;if(n.contains(J,$)){var ne=_.buildNamespaceConflictError(q);V.push({message:ne,type:r.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:$})}}),V}}),As=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.validateGrammar=i.resolveGrammar=void 0;var e=Oe(),t=as(),n=Zi(),r=Ot();function o(c){c=e.defaults(c,{errMsgProvider:r.defaultGrammarResolverErrorProvider});var A={};return e.forEach(c.rules,function(a){A[a.name]=a}),t.resolveGrammar(A,c.errMsgProvider)}i.resolveGrammar=o;function s(c){return c=e.defaults(c,{errMsgProvider:r.defaultGrammarValidatorErrorProvider}),n.validateGrammar(c.rules,c.maxLookahead,c.tokenTypes,c.errMsgProvider,c.grammarName)}i.validateGrammar=s}),St=ve(i=>{var e=i&&i.__extends||(function(){var I=function(m,l){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var C in p)Object.prototype.hasOwnProperty.call(p,C)&&(d[C]=p[C])},I(m,l)};return function(m,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");I(m,l);function d(){this.constructor=m}m.prototype=l===null?Object.create(l):(d.prototype=l.prototype,new d)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.EarlyExitException=i.NotAllInputParsedException=i.NoViableAltException=i.MismatchedTokenException=i.isRecognitionException=void 0;var t=Oe(),n="MismatchedTokenException",r="NoViableAltException",o="EarlyExitException",s="NotAllInputParsedException",c=[n,r,o,s];Object.freeze(c);function A(I){return t.contains(c,I.name)}i.isRecognitionException=A;var a=(function(I){e(m,I);function m(l,d){var p=this.constructor,C=I.call(this,l)||this;return C.token=d,C.resyncedTokens=[],Object.setPrototypeOf(C,p.prototype),Error.captureStackTrace&&Error.captureStackTrace(C,C.constructor),C}return m})(Error),h=(function(I){e(m,I);function m(l,d,p){var C=I.call(this,l,d)||this;return C.previousToken=p,C.name=n,C}return m})(a);i.MismatchedTokenException=h;var u=(function(I){e(m,I);function m(l,d,p){var C=I.call(this,l,d)||this;return C.previousToken=p,C.name=r,C}return m})(a);i.NoViableAltException=u;var b=(function(I){e(m,I);function m(l,d){var p=I.call(this,l,d)||this;return p.name=s,p}return m})(a);i.NotAllInputParsedException=b;var f=(function(I){e(m,I);function m(l,d,p){var C=I.call(this,l,d)||this;return C.previousToken=p,C.name=o,C}return m})(a);i.EarlyExitException=f}),$i=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.attemptInRepetitionRecovery=i.Recoverable=i.InRuleRecoveryException=i.IN_RULE_RECOVERY_EXCEPTION=i.EOF_FOLLOW_KEY=void 0;var e=ft(),t=Oe(),n=St(),r=Xi(),o=tt();i.EOF_FOLLOW_KEY={},i.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function s(a){this.name=i.IN_RULE_RECOVERY_EXCEPTION,this.message=a}i.InRuleRecoveryException=s,s.prototype=Error.prototype;var c=(function(){function a(){}return a.prototype.initRecoverable=function(h){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=t.has(h,"recoveryEnabled")?h.recoveryEnabled:o.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=A)},a.prototype.getTokenToInsert=function(h){var u=e.createTokenInstance(h,"",NaN,NaN,NaN,NaN,NaN,NaN);return u.isInsertedInRecovery=!0,u},a.prototype.canTokenTypeBeInsertedInRecovery=function(h){return!0},a.prototype.tryInRepetitionRecovery=function(h,u,b,f){for(var I=this,m=this.findReSyncTokenType(),l=this.exportLexerState(),d=[],p=!1,C=this.LA(1),E=this.LA(1),y=function(){var Q=I.LA(0),x=I.errorMessageProvider.buildMismatchTokenMessage({expected:f,actual:C,previous:Q,ruleName:I.getCurrRuleFullName()}),H=new n.MismatchedTokenException(x,C,I.LA(0));H.resyncedTokens=t.dropRight(d),I.SAVE_ERROR(H)};!p;)if(this.tokenMatcher(E,f)){y();return}else if(b.call(this)){y(),h.apply(this,u);return}else this.tokenMatcher(E,m)?p=!0:(E=this.SKIP_TOKEN(),this.addToResyncTokens(E,d));this.importLexerState(l)},a.prototype.shouldInRepetitionRecoveryBeTried=function(h,u,b){return!(b===!1||h===void 0||u===void 0||this.tokenMatcher(this.LA(1),h)||this.isBackTracking()||this.canPerformInRuleRecovery(h,this.getFollowsForInRuleRecovery(h,u)))},a.prototype.getFollowsForInRuleRecovery=function(h,u){var b=this.getCurrentGrammarPath(h,u),f=this.getNextPossibleTokenTypes(b);return f},a.prototype.tryInRuleRecovery=function(h,u){if(this.canRecoverWithSingleTokenInsertion(h,u)){var b=this.getTokenToInsert(h);return b}if(this.canRecoverWithSingleTokenDeletion(h)){var f=this.SKIP_TOKEN();return this.consumeToken(),f}throw new s("sad sad panda")},a.prototype.canPerformInRuleRecovery=function(h,u){return this.canRecoverWithSingleTokenInsertion(h,u)||this.canRecoverWithSingleTokenDeletion(h)},a.prototype.canRecoverWithSingleTokenInsertion=function(h,u){var b=this;if(!this.canTokenTypeBeInsertedInRecovery(h)||t.isEmpty(u))return!1;var f=this.LA(1),I=t.find(u,function(m){return b.tokenMatcher(f,m)})!==void 0;return I},a.prototype.canRecoverWithSingleTokenDeletion=function(h){var u=this.tokenMatcher(this.LA(2),h);return u},a.prototype.isInCurrentRuleReSyncSet=function(h){var u=this.getCurrFollowKey(),b=this.getFollowSetFromFollowKey(u);return t.contains(b,h)},a.prototype.findReSyncTokenType=function(){for(var h=this.flattenFollowSet(),u=this.LA(1),b=2;;){var f=u.tokenType;if(t.contains(h,f))return f;u=this.LA(b),b++}},a.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return i.EOF_FOLLOW_KEY;var h=this.getLastExplicitRuleShortName(),u=this.getLastExplicitRuleOccurrenceIndex(),b=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(h),idxInCallingRule:u,inRule:this.shortRuleNameToFullName(b)}},a.prototype.buildFullFollowKeyStack=function(){var h=this,u=this.RULE_STACK,b=this.RULE_OCCURRENCE_STACK;return t.map(u,function(f,I){return I===0?i.EOF_FOLLOW_KEY:{ruleName:h.shortRuleNameToFullName(f),idxInCallingRule:b[I],inRule:h.shortRuleNameToFullName(u[I-1])}})},a.prototype.flattenFollowSet=function(){var h=this,u=t.map(this.buildFullFollowKeyStack(),function(b){return h.getFollowSetFromFollowKey(b)});return t.flatten(u)},a.prototype.getFollowSetFromFollowKey=function(h){if(h===i.EOF_FOLLOW_KEY)return[e.EOF];var u=h.ruleName+h.idxInCallingRule+r.IN+h.inRule;return this.resyncFollows[u]},a.prototype.addToResyncTokens=function(h,u){return this.tokenMatcher(h,e.EOF)||u.push(h),u},a.prototype.reSyncTo=function(h){for(var u=[],b=this.LA(1);this.tokenMatcher(b,h)===!1;)b=this.SKIP_TOKEN(),this.addToResyncTokens(b,u);return t.dropRight(u)},a.prototype.attemptInRepetitionRecovery=function(h,u,b,f,I,m,l){},a.prototype.getCurrentGrammarPath=function(h,u){var b=this.getHumanReadableRuleStack(),f=t.cloneArr(this.RULE_OCCURRENCE_STACK),I={ruleStack:b,occurrenceStack:f,lastTok:h,lastTokOccurrence:u};return I},a.prototype.getHumanReadableRuleStack=function(){var h=this;return t.map(this.RULE_STACK,function(u){return h.shortRuleNameToFullName(u)})},a})();i.Recoverable=c;function A(a,h,u,b,f,I,m){var l=this.getKeyForAutomaticLookahead(b,f),d=this.firstAfterRepMap[l];if(d===void 0){var p=this.getCurrRuleFullName(),C=this.getGAstProductions()[p],E=new I(C,f);d=E.startWalking(),this.firstAfterRepMap[l]=d}var y=d.token,Q=d.occurrence,x=d.isEndOfRule;this.RULE_STACK.length===1&&x&&y===void 0&&(y=e.EOF,Q=1),this.shouldInRepetitionRecoveryBeTried(y,Q,m)&&this.tryInRepetitionRecovery(a,h,u,y)}i.attemptInRepetitionRecovery=A}),En=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getKeyForAutomaticLookahead=i.AT_LEAST_ONE_SEP_IDX=i.MANY_SEP_IDX=i.AT_LEAST_ONE_IDX=i.MANY_IDX=i.OPTION_IDX=i.OR_IDX=i.BITS_FOR_ALT_IDX=i.BITS_FOR_RULE_IDX=i.BITS_FOR_OCCURRENCE_IDX=i.BITS_FOR_METHOD_TYPE=void 0,i.BITS_FOR_METHOD_TYPE=4,i.BITS_FOR_OCCURRENCE_IDX=8,i.BITS_FOR_RULE_IDX=12,i.BITS_FOR_ALT_IDX=8,i.OR_IDX=1<<i.BITS_FOR_OCCURRENCE_IDX,i.OPTION_IDX=2<<i.BITS_FOR_OCCURRENCE_IDX,i.MANY_IDX=3<<i.BITS_FOR_OCCURRENCE_IDX,i.AT_LEAST_ONE_IDX=4<<i.BITS_FOR_OCCURRENCE_IDX,i.MANY_SEP_IDX=5<<i.BITS_FOR_OCCURRENCE_IDX,i.AT_LEAST_ONE_SEP_IDX=6<<i.BITS_FOR_OCCURRENCE_IDX;function e(t,n,r){return r|n|t}i.getKeyForAutomaticLookahead=e,32-i.BITS_FOR_ALT_IDX}),cs=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LooksAhead=void 0;var e=Pt(),t=Oe(),n=tt(),r=En(),o=Ft(),s=(function(){function c(){}return c.prototype.initLooksAhead=function(A){this.dynamicTokensEnabled=t.has(A,"dynamicTokensEnabled")?A.dynamicTokensEnabled:n.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=t.has(A,"maxLookahead")?A.maxLookahead:n.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=t.isES2015MapSupported()?new Map:[],t.isES2015MapSupported()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},c.prototype.preComputeLookaheadFunctions=function(A){var a=this;t.forEach(A,function(h){a.TRACE_INIT(h.name+" Rule Lookahead",function(){var u=o.collectMethods(h),b=u.alternation,f=u.repetition,I=u.option,m=u.repetitionMandatory,l=u.repetitionMandatoryWithSeparator,d=u.repetitionWithSeparator;t.forEach(b,function(p){var C=p.idx===0?"":p.idx;a.TRACE_INIT(""+o.getProductionDslName(p)+C,function(){var E=e.buildLookaheadFuncForOr(p.idx,h,p.maxLookahead||a.maxLookahead,p.hasPredicates,a.dynamicTokensEnabled,a.lookAheadBuilderForAlternatives),y=r.getKeyForAutomaticLookahead(a.fullRuleNameToShort[h.name],r.OR_IDX,p.idx);a.setLaFuncCache(y,E)})}),t.forEach(f,function(p){a.computeLookaheadFunc(h,p.idx,r.MANY_IDX,e.PROD_TYPE.REPETITION,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(I,function(p){a.computeLookaheadFunc(h,p.idx,r.OPTION_IDX,e.PROD_TYPE.OPTION,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(m,function(p){a.computeLookaheadFunc(h,p.idx,r.AT_LEAST_ONE_IDX,e.PROD_TYPE.REPETITION_MANDATORY,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(l,function(p){a.computeLookaheadFunc(h,p.idx,r.AT_LEAST_ONE_SEP_IDX,e.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,p.maxLookahead,o.getProductionDslName(p))}),t.forEach(d,function(p){a.computeLookaheadFunc(h,p.idx,r.MANY_SEP_IDX,e.PROD_TYPE.REPETITION_WITH_SEPARATOR,p.maxLookahead,o.getProductionDslName(p))})})})},c.prototype.computeLookaheadFunc=function(A,a,h,u,b,f){var I=this;this.TRACE_INIT(""+f+(a===0?"":a),function(){var m=e.buildLookaheadFuncForOptionalProd(a,A,b||I.maxLookahead,I.dynamicTokensEnabled,u,I.lookAheadBuilderForOptional),l=r.getKeyForAutomaticLookahead(I.fullRuleNameToShort[A.name],h,a);I.setLaFuncCache(l,m)})},c.prototype.lookAheadBuilderForOptional=function(A,a,h){return e.buildSingleAlternativeLookaheadFunction(A,a,h)},c.prototype.lookAheadBuilderForAlternatives=function(A,a,h,u){return e.buildAlternativesLookAheadFunc(A,a,h,u)},c.prototype.getKeyForAutomaticLookahead=function(A,a){var h=this.getLastExplicitRuleShortName();return r.getKeyForAutomaticLookahead(h,A,a)},c.prototype.getLaFuncFromCache=function(A){},c.prototype.getLaFuncFromMap=function(A){return this.lookAheadFuncsCache.get(A)},c.prototype.getLaFuncFromObj=function(A){return this.lookAheadFuncsCache[A]},c.prototype.setLaFuncCache=function(A,a){},c.prototype.setLaFuncCacheUsingMap=function(A,a){this.lookAheadFuncsCache.set(A,a)},c.prototype.setLaFuncUsingObj=function(A,a){this.lookAheadFuncsCache[A]=a},c})();i.LooksAhead=s}),ls=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addNoneTerminalToCst=i.addTerminalToCst=i.setNodeLocationFull=i.setNodeLocationOnlyOffset=void 0;function e(o,s){isNaN(o.startOffset)===!0?(o.startOffset=s.startOffset,o.endOffset=s.endOffset):o.endOffset<s.endOffset&&(o.endOffset=s.endOffset)}i.setNodeLocationOnlyOffset=e;function t(o,s){isNaN(o.startOffset)===!0?(o.startOffset=s.startOffset,o.startColumn=s.startColumn,o.startLine=s.startLine,o.endOffset=s.endOffset,o.endColumn=s.endColumn,o.endLine=s.endLine):o.endOffset<s.endOffset&&(o.endOffset=s.endOffset,o.endColumn=s.endColumn,o.endLine=s.endLine)}i.setNodeLocationFull=t;function n(o,s,c){o.children[c]===void 0?o.children[c]=[s]:o.children[c].push(s)}i.addTerminalToCst=n;function r(o,s,c){o.children[s]===void 0?o.children[s]=[c]:o.children[s].push(c)}i.addNoneTerminalToCst=r}),er=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defineNameProp=i.functionName=i.classNameFromInstance=void 0;var e=Oe();function t(s){return r(s.constructor)}i.classNameFromInstance=t;var n="name";function r(s){var c=s.name;return c||"anonymous"}i.functionName=r;function o(s,c){var A=Object.getOwnPropertyDescriptor(s,n);return e.isUndefined(A)||A.configurable?(Object.defineProperty(s,n,{enumerable:!1,configurable:!0,writable:!1,value:c}),!0):!1}i.defineNameProp=o}),us=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.validateRedundantMethods=i.validateMissingCstMethods=i.validateVisitor=i.CstVisitorDefinitionError=i.createBaseVisitorConstructorWithDefaults=i.createBaseSemanticVisitorConstructor=i.defaultVisit=void 0;var e=Oe(),t=er();function n(u,b){for(var f=e.keys(u),I=f.length,m=0;m<I;m++)for(var l=f[m],d=u[l],p=d.length,C=0;C<p;C++){var E=d[C];E.tokenTypeIdx===void 0&&this[E.name](E.children,b)}}i.defaultVisit=n;function r(u,b){var f=function(){};t.defineNameProp(f,u+"BaseSemantics");var I={visit:function(m,l){if(e.isArray(m)&&(m=m[0]),!e.isUndefined(m))return this[m.name](m.children,l)},validateVisitor:function(){var m=c(this,b);if(!e.isEmpty(m)){var l=e.map(m,function(d){return d.msg});throw Error("Errors Detected in CST Visitor <"+t.functionName(this.constructor)+`>:
|
|
153
153
|
`+(""+l.join(`
|
|
154
154
|
|
|
155
155
|
`).replace(/\n/g,`
|
|
156
|
-
`)))}}};return f.prototype=I,f.prototype.constructor=f,f._RULE_NAMES=b,f}i.createBaseSemanticVisitorConstructor=r;function o(u,b,f){var I=function(){};t.defineNameProp(I,u+"BaseSemanticsWithDefaults");var
|
|
156
|
+
`)))}}};return f.prototype=I,f.prototype.constructor=f,f._RULE_NAMES=b,f}i.createBaseSemanticVisitorConstructor=r;function o(u,b,f){var I=function(){};t.defineNameProp(I,u+"BaseSemanticsWithDefaults");var m=Object.create(f.prototype);return e.forEach(b,function(l){m[l]=n}),I.prototype=m,I.prototype.constructor=I,I}i.createBaseVisitorConstructorWithDefaults=o;var s;(function(u){u[u.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",u[u.MISSING_METHOD=1]="MISSING_METHOD"})(s=i.CstVisitorDefinitionError||(i.CstVisitorDefinitionError={}));function c(u,b){var f=A(u,b),I=h(u,b);return f.concat(I)}i.validateVisitor=c;function A(u,b){var f=e.map(b,function(I){if(!e.isFunction(u[I]))return{msg:"Missing visitor method: <"+I+"> on "+t.functionName(u.constructor)+" CST Visitor.",type:s.MISSING_METHOD,methodName:I}});return e.compact(f)}i.validateMissingCstMethods=A;var a=["constructor","visit","validateVisitor"];function h(u,b){var f=[];for(var I in u)e.isFunction(u[I])&&!e.contains(a,I)&&!e.contains(b,I)&&f.push({msg:"Redundant visitor method: <"+I+"> on "+t.functionName(u.constructor)+` CST Visitor
|
|
157
157
|
There is no Grammar Rule corresponding to this method's name.
|
|
158
|
-
`,type:s.REDUNDANT_METHOD,methodName:I});return f}i.validateRedundantMethods=h}),ls=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TreeBuilder=void 0;var e=As(),t=De(),n=cs(),r=tt(),o=(function(){function s(){}return s.prototype.initTreeBuilder=function(c){if(this.CST_STACK=[],this.outputCst=c.outputCst,this.nodeLocationTracking=t.has(c,"nodeLocationTracking")?c.nodeLocationTracking:r.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=t.NOOP,this.cstFinallyStateUpdate=t.NOOP,this.cstPostTerminal=t.NOOP,this.cstPostNonTerminal=t.NOOP,this.cstPostRule=t.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=e.setNodeLocationFull,this.setNodeLocationFromNode=e.setNodeLocationFull,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=e.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=e.setNodeLocationOnlyOffset,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=t.NOOP;else throw Error('Invalid <nodeLocationTracking> config option: "'+c.nodeLocationTracking+'"')},s.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(c){c.location={startOffset:NaN,endOffset:NaN}},s.prototype.setInitialNodeLocationOnlyOffsetRegular=function(c){c.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},s.prototype.setInitialNodeLocationFullRecovery=function(c){c.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},s.prototype.setInitialNodeLocationFullRegular=function(c){var A=this.LA(1);c.location={startOffset:A.startOffset,startLine:A.startLine,startColumn:A.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},s.prototype.cstInvocationStateUpdate=function(c,A){var a={name:c,children:{}};this.setInitialNodeLocation(a),this.CST_STACK.push(a)},s.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},s.prototype.cstPostRuleFull=function(c){var A=this.LA(0),a=c.location;a.startOffset<=A.startOffset?(a.endOffset=A.endOffset,a.endLine=A.endLine,a.endColumn=A.endColumn):(a.startOffset=NaN,a.startLine=NaN,a.startColumn=NaN)},s.prototype.cstPostRuleOnlyOffset=function(c){var A=this.LA(0),a=c.location;a.startOffset<=A.startOffset?a.endOffset=A.endOffset:a.startOffset=NaN},s.prototype.cstPostTerminal=function(c,A){var a=this.CST_STACK[this.CST_STACK.length-1];e.addTerminalToCst(a,A,c),this.setNodeLocationFromToken(a.location,A)},s.prototype.cstPostNonTerminal=function(c,A){var a=this.CST_STACK[this.CST_STACK.length-1];e.addNoneTerminalToCst(a,A,c),this.setNodeLocationFromNode(a.location,c.location)},s.prototype.getBaseCstVisitorConstructor=function(){if(t.isUndefined(this.baseCstVisitorConstructor)){var c=n.createBaseSemanticVisitorConstructor(this.className,t.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=c,c}return this.baseCstVisitorConstructor},s.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(t.isUndefined(this.baseCstVisitorWithDefaultsConstructor)){var c=n.createBaseVisitorConstructorWithDefaults(this.className,t.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=c,c}return this.baseCstVisitorWithDefaultsConstructor},s.prototype.getLastExplicitRuleShortName=function(){var c=this.RULE_STACK;return c[c.length-1]},s.prototype.getPreviousExplicitRuleShortName=function(){var c=this.RULE_STACK;return c[c.length-2]},s.prototype.getLastExplicitRuleOccurrenceIndex=function(){var c=this.RULE_OCCURRENCE_STACK;return c[c.length-1]},s})();i.TreeBuilder=o}),us=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LexerAdapter=void 0;var e=tt(),t=(function(){function n(){}return n.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(n.prototype,"input",{get:function(){return this.tokVector},set:function(r){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=r,this.tokVectorLength=r.length},enumerable:!1,configurable:!0}),n.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):e.END_OF_FILE},n.prototype.LA=function(r){var o=this.currIdx+r;return o<0||this.tokVectorLength<=o?e.END_OF_FILE:this.tokVector[o]},n.prototype.consumeToken=function(){this.currIdx++},n.prototype.exportLexerState=function(){return this.currIdx},n.prototype.importLexerState=function(r){this.currIdx=r},n.prototype.resetLexerState=function(){this.currIdx=-1},n.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},n.prototype.getLexerPosition=function(){return this.exportLexerState()},n})();i.LexerAdapter=t}),hs=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RecognizerApi=void 0;var e=De(),t=St(),n=tt(),r=Ft(),o=Ji(),s=Ze(),c=(function(){function A(){}return A.prototype.ACTION=function(a){return a.call(this)},A.prototype.consume=function(a,h,u){return this.consumeInternal(h,a,u)},A.prototype.subrule=function(a,h,u){return this.subruleInternal(h,a,u)},A.prototype.option=function(a,h){return this.optionInternal(h,a)},A.prototype.or=function(a,h){return this.orInternal(h,a)},A.prototype.many=function(a,h){return this.manyInternal(a,h)},A.prototype.atLeastOne=function(a,h){return this.atLeastOneInternal(a,h)},A.prototype.CONSUME=function(a,h){return this.consumeInternal(a,0,h)},A.prototype.CONSUME1=function(a,h){return this.consumeInternal(a,1,h)},A.prototype.CONSUME2=function(a,h){return this.consumeInternal(a,2,h)},A.prototype.CONSUME3=function(a,h){return this.consumeInternal(a,3,h)},A.prototype.CONSUME4=function(a,h){return this.consumeInternal(a,4,h)},A.prototype.CONSUME5=function(a,h){return this.consumeInternal(a,5,h)},A.prototype.CONSUME6=function(a,h){return this.consumeInternal(a,6,h)},A.prototype.CONSUME7=function(a,h){return this.consumeInternal(a,7,h)},A.prototype.CONSUME8=function(a,h){return this.consumeInternal(a,8,h)},A.prototype.CONSUME9=function(a,h){return this.consumeInternal(a,9,h)},A.prototype.SUBRULE=function(a,h){return this.subruleInternal(a,0,h)},A.prototype.SUBRULE1=function(a,h){return this.subruleInternal(a,1,h)},A.prototype.SUBRULE2=function(a,h){return this.subruleInternal(a,2,h)},A.prototype.SUBRULE3=function(a,h){return this.subruleInternal(a,3,h)},A.prototype.SUBRULE4=function(a,h){return this.subruleInternal(a,4,h)},A.prototype.SUBRULE5=function(a,h){return this.subruleInternal(a,5,h)},A.prototype.SUBRULE6=function(a,h){return this.subruleInternal(a,6,h)},A.prototype.SUBRULE7=function(a,h){return this.subruleInternal(a,7,h)},A.prototype.SUBRULE8=function(a,h){return this.subruleInternal(a,8,h)},A.prototype.SUBRULE9=function(a,h){return this.subruleInternal(a,9,h)},A.prototype.OPTION=function(a){return this.optionInternal(a,0)},A.prototype.OPTION1=function(a){return this.optionInternal(a,1)},A.prototype.OPTION2=function(a){return this.optionInternal(a,2)},A.prototype.OPTION3=function(a){return this.optionInternal(a,3)},A.prototype.OPTION4=function(a){return this.optionInternal(a,4)},A.prototype.OPTION5=function(a){return this.optionInternal(a,5)},A.prototype.OPTION6=function(a){return this.optionInternal(a,6)},A.prototype.OPTION7=function(a){return this.optionInternal(a,7)},A.prototype.OPTION8=function(a){return this.optionInternal(a,8)},A.prototype.OPTION9=function(a){return this.optionInternal(a,9)},A.prototype.OR=function(a){return this.orInternal(a,0)},A.prototype.OR1=function(a){return this.orInternal(a,1)},A.prototype.OR2=function(a){return this.orInternal(a,2)},A.prototype.OR3=function(a){return this.orInternal(a,3)},A.prototype.OR4=function(a){return this.orInternal(a,4)},A.prototype.OR5=function(a){return this.orInternal(a,5)},A.prototype.OR6=function(a){return this.orInternal(a,6)},A.prototype.OR7=function(a){return this.orInternal(a,7)},A.prototype.OR8=function(a){return this.orInternal(a,8)},A.prototype.OR9=function(a){return this.orInternal(a,9)},A.prototype.MANY=function(a){this.manyInternal(0,a)},A.prototype.MANY1=function(a){this.manyInternal(1,a)},A.prototype.MANY2=function(a){this.manyInternal(2,a)},A.prototype.MANY3=function(a){this.manyInternal(3,a)},A.prototype.MANY4=function(a){this.manyInternal(4,a)},A.prototype.MANY5=function(a){this.manyInternal(5,a)},A.prototype.MANY6=function(a){this.manyInternal(6,a)},A.prototype.MANY7=function(a){this.manyInternal(7,a)},A.prototype.MANY8=function(a){this.manyInternal(8,a)},A.prototype.MANY9=function(a){this.manyInternal(9,a)},A.prototype.MANY_SEP=function(a){this.manySepFirstInternal(0,a)},A.prototype.MANY_SEP1=function(a){this.manySepFirstInternal(1,a)},A.prototype.MANY_SEP2=function(a){this.manySepFirstInternal(2,a)},A.prototype.MANY_SEP3=function(a){this.manySepFirstInternal(3,a)},A.prototype.MANY_SEP4=function(a){this.manySepFirstInternal(4,a)},A.prototype.MANY_SEP5=function(a){this.manySepFirstInternal(5,a)},A.prototype.MANY_SEP6=function(a){this.manySepFirstInternal(6,a)},A.prototype.MANY_SEP7=function(a){this.manySepFirstInternal(7,a)},A.prototype.MANY_SEP8=function(a){this.manySepFirstInternal(8,a)},A.prototype.MANY_SEP9=function(a){this.manySepFirstInternal(9,a)},A.prototype.AT_LEAST_ONE=function(a){this.atLeastOneInternal(0,a)},A.prototype.AT_LEAST_ONE1=function(a){return this.atLeastOneInternal(1,a)},A.prototype.AT_LEAST_ONE2=function(a){this.atLeastOneInternal(2,a)},A.prototype.AT_LEAST_ONE3=function(a){this.atLeastOneInternal(3,a)},A.prototype.AT_LEAST_ONE4=function(a){this.atLeastOneInternal(4,a)},A.prototype.AT_LEAST_ONE5=function(a){this.atLeastOneInternal(5,a)},A.prototype.AT_LEAST_ONE6=function(a){this.atLeastOneInternal(6,a)},A.prototype.AT_LEAST_ONE7=function(a){this.atLeastOneInternal(7,a)},A.prototype.AT_LEAST_ONE8=function(a){this.atLeastOneInternal(8,a)},A.prototype.AT_LEAST_ONE9=function(a){this.atLeastOneInternal(9,a)},A.prototype.AT_LEAST_ONE_SEP=function(a){this.atLeastOneSepFirstInternal(0,a)},A.prototype.AT_LEAST_ONE_SEP1=function(a){this.atLeastOneSepFirstInternal(1,a)},A.prototype.AT_LEAST_ONE_SEP2=function(a){this.atLeastOneSepFirstInternal(2,a)},A.prototype.AT_LEAST_ONE_SEP3=function(a){this.atLeastOneSepFirstInternal(3,a)},A.prototype.AT_LEAST_ONE_SEP4=function(a){this.atLeastOneSepFirstInternal(4,a)},A.prototype.AT_LEAST_ONE_SEP5=function(a){this.atLeastOneSepFirstInternal(5,a)},A.prototype.AT_LEAST_ONE_SEP6=function(a){this.atLeastOneSepFirstInternal(6,a)},A.prototype.AT_LEAST_ONE_SEP7=function(a){this.atLeastOneSepFirstInternal(7,a)},A.prototype.AT_LEAST_ONE_SEP8=function(a){this.atLeastOneSepFirstInternal(8,a)},A.prototype.AT_LEAST_ONE_SEP9=function(a){this.atLeastOneSepFirstInternal(9,a)},A.prototype.RULE=function(a,h,u){if(u===void 0&&(u=n.DEFAULT_RULE_CONFIG),e.contains(this.definedRulesNames,a)){var b=r.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:a,grammarName:this.className}),f={message:b,type:n.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:a};this.definitionErrors.push(f)}this.definedRulesNames.push(a);var I=this.defineRule(a,h,u);return this[a]=I,I},A.prototype.OVERRIDE_RULE=function(a,h,u){u===void 0&&(u=n.DEFAULT_RULE_CONFIG);var b=[];b=b.concat(o.validateRuleIsOverridden(a,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(b);var f=this.defineRule(a,h,u);return this[a]=f,f},A.prototype.BACKTRACK=function(a,h){return function(){this.isBackTrackingStack.push(1);var u=this.saveRecogState();try{return a.apply(this,h),!0}catch(b){if(t.isRecognitionException(b))return!1;throw b}finally{this.reloadRecogState(u),this.isBackTrackingStack.pop()}}},A.prototype.getGAstProductions=function(){return this.gastProductionsCache},A.prototype.getSerializedGastProductions=function(){return s.serializeGrammar(e.values(this.gastProductionsCache))},A})();i.RecognizerApi=c}),ds=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RecognizerEngine=void 0;var e=De(),t=gn(),n=St(),r=Mt(),o=Ot(),s=tt(),c=Xi(),A=ft(),a=Qt(),h=Zi(),u=(function(){function b(){}return b.prototype.initRecognizerEngine=function(f,I){if(this.className=h.classNameFromInstance(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=a.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},e.has(I,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
158
|
+
`,type:s.REDUNDANT_METHOD,methodName:I});return f}i.validateRedundantMethods=h}),hs=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TreeBuilder=void 0;var e=ls(),t=Oe(),n=us(),r=tt(),o=(function(){function s(){}return s.prototype.initTreeBuilder=function(c){if(this.CST_STACK=[],this.outputCst=c.outputCst,this.nodeLocationTracking=t.has(c,"nodeLocationTracking")?c.nodeLocationTracking:r.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=t.NOOP,this.cstFinallyStateUpdate=t.NOOP,this.cstPostTerminal=t.NOOP,this.cstPostNonTerminal=t.NOOP,this.cstPostRule=t.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=e.setNodeLocationFull,this.setNodeLocationFromNode=e.setNodeLocationFull,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=e.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=e.setNodeLocationOnlyOffset,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=t.NOOP,this.setNodeLocationFromNode=t.NOOP,this.cstPostRule=t.NOOP,this.setInitialNodeLocation=t.NOOP;else throw Error('Invalid <nodeLocationTracking> config option: "'+c.nodeLocationTracking+'"')},s.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(c){c.location={startOffset:NaN,endOffset:NaN}},s.prototype.setInitialNodeLocationOnlyOffsetRegular=function(c){c.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},s.prototype.setInitialNodeLocationFullRecovery=function(c){c.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},s.prototype.setInitialNodeLocationFullRegular=function(c){var A=this.LA(1);c.location={startOffset:A.startOffset,startLine:A.startLine,startColumn:A.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},s.prototype.cstInvocationStateUpdate=function(c,A){var a={name:c,children:{}};this.setInitialNodeLocation(a),this.CST_STACK.push(a)},s.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},s.prototype.cstPostRuleFull=function(c){var A=this.LA(0),a=c.location;a.startOffset<=A.startOffset?(a.endOffset=A.endOffset,a.endLine=A.endLine,a.endColumn=A.endColumn):(a.startOffset=NaN,a.startLine=NaN,a.startColumn=NaN)},s.prototype.cstPostRuleOnlyOffset=function(c){var A=this.LA(0),a=c.location;a.startOffset<=A.startOffset?a.endOffset=A.endOffset:a.startOffset=NaN},s.prototype.cstPostTerminal=function(c,A){var a=this.CST_STACK[this.CST_STACK.length-1];e.addTerminalToCst(a,A,c),this.setNodeLocationFromToken(a.location,A)},s.prototype.cstPostNonTerminal=function(c,A){var a=this.CST_STACK[this.CST_STACK.length-1];e.addNoneTerminalToCst(a,A,c),this.setNodeLocationFromNode(a.location,c.location)},s.prototype.getBaseCstVisitorConstructor=function(){if(t.isUndefined(this.baseCstVisitorConstructor)){var c=n.createBaseSemanticVisitorConstructor(this.className,t.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=c,c}return this.baseCstVisitorConstructor},s.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(t.isUndefined(this.baseCstVisitorWithDefaultsConstructor)){var c=n.createBaseVisitorConstructorWithDefaults(this.className,t.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=c,c}return this.baseCstVisitorWithDefaultsConstructor},s.prototype.getLastExplicitRuleShortName=function(){var c=this.RULE_STACK;return c[c.length-1]},s.prototype.getPreviousExplicitRuleShortName=function(){var c=this.RULE_STACK;return c[c.length-2]},s.prototype.getLastExplicitRuleOccurrenceIndex=function(){var c=this.RULE_OCCURRENCE_STACK;return c[c.length-1]},s})();i.TreeBuilder=o}),ds=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LexerAdapter=void 0;var e=tt(),t=(function(){function n(){}return n.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(n.prototype,"input",{get:function(){return this.tokVector},set:function(r){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=r,this.tokVectorLength=r.length},enumerable:!1,configurable:!0}),n.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):e.END_OF_FILE},n.prototype.LA=function(r){var o=this.currIdx+r;return o<0||this.tokVectorLength<=o?e.END_OF_FILE:this.tokVector[o]},n.prototype.consumeToken=function(){this.currIdx++},n.prototype.exportLexerState=function(){return this.currIdx},n.prototype.importLexerState=function(r){this.currIdx=r},n.prototype.resetLexerState=function(){this.currIdx=-1},n.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},n.prototype.getLexerPosition=function(){return this.exportLexerState()},n})();i.LexerAdapter=t}),fs=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RecognizerApi=void 0;var e=Oe(),t=St(),n=tt(),r=Ot(),o=Zi(),s=Ze(),c=(function(){function A(){}return A.prototype.ACTION=function(a){return a.call(this)},A.prototype.consume=function(a,h,u){return this.consumeInternal(h,a,u)},A.prototype.subrule=function(a,h,u){return this.subruleInternal(h,a,u)},A.prototype.option=function(a,h){return this.optionInternal(h,a)},A.prototype.or=function(a,h){return this.orInternal(h,a)},A.prototype.many=function(a,h){return this.manyInternal(a,h)},A.prototype.atLeastOne=function(a,h){return this.atLeastOneInternal(a,h)},A.prototype.CONSUME=function(a,h){return this.consumeInternal(a,0,h)},A.prototype.CONSUME1=function(a,h){return this.consumeInternal(a,1,h)},A.prototype.CONSUME2=function(a,h){return this.consumeInternal(a,2,h)},A.prototype.CONSUME3=function(a,h){return this.consumeInternal(a,3,h)},A.prototype.CONSUME4=function(a,h){return this.consumeInternal(a,4,h)},A.prototype.CONSUME5=function(a,h){return this.consumeInternal(a,5,h)},A.prototype.CONSUME6=function(a,h){return this.consumeInternal(a,6,h)},A.prototype.CONSUME7=function(a,h){return this.consumeInternal(a,7,h)},A.prototype.CONSUME8=function(a,h){return this.consumeInternal(a,8,h)},A.prototype.CONSUME9=function(a,h){return this.consumeInternal(a,9,h)},A.prototype.SUBRULE=function(a,h){return this.subruleInternal(a,0,h)},A.prototype.SUBRULE1=function(a,h){return this.subruleInternal(a,1,h)},A.prototype.SUBRULE2=function(a,h){return this.subruleInternal(a,2,h)},A.prototype.SUBRULE3=function(a,h){return this.subruleInternal(a,3,h)},A.prototype.SUBRULE4=function(a,h){return this.subruleInternal(a,4,h)},A.prototype.SUBRULE5=function(a,h){return this.subruleInternal(a,5,h)},A.prototype.SUBRULE6=function(a,h){return this.subruleInternal(a,6,h)},A.prototype.SUBRULE7=function(a,h){return this.subruleInternal(a,7,h)},A.prototype.SUBRULE8=function(a,h){return this.subruleInternal(a,8,h)},A.prototype.SUBRULE9=function(a,h){return this.subruleInternal(a,9,h)},A.prototype.OPTION=function(a){return this.optionInternal(a,0)},A.prototype.OPTION1=function(a){return this.optionInternal(a,1)},A.prototype.OPTION2=function(a){return this.optionInternal(a,2)},A.prototype.OPTION3=function(a){return this.optionInternal(a,3)},A.prototype.OPTION4=function(a){return this.optionInternal(a,4)},A.prototype.OPTION5=function(a){return this.optionInternal(a,5)},A.prototype.OPTION6=function(a){return this.optionInternal(a,6)},A.prototype.OPTION7=function(a){return this.optionInternal(a,7)},A.prototype.OPTION8=function(a){return this.optionInternal(a,8)},A.prototype.OPTION9=function(a){return this.optionInternal(a,9)},A.prototype.OR=function(a){return this.orInternal(a,0)},A.prototype.OR1=function(a){return this.orInternal(a,1)},A.prototype.OR2=function(a){return this.orInternal(a,2)},A.prototype.OR3=function(a){return this.orInternal(a,3)},A.prototype.OR4=function(a){return this.orInternal(a,4)},A.prototype.OR5=function(a){return this.orInternal(a,5)},A.prototype.OR6=function(a){return this.orInternal(a,6)},A.prototype.OR7=function(a){return this.orInternal(a,7)},A.prototype.OR8=function(a){return this.orInternal(a,8)},A.prototype.OR9=function(a){return this.orInternal(a,9)},A.prototype.MANY=function(a){this.manyInternal(0,a)},A.prototype.MANY1=function(a){this.manyInternal(1,a)},A.prototype.MANY2=function(a){this.manyInternal(2,a)},A.prototype.MANY3=function(a){this.manyInternal(3,a)},A.prototype.MANY4=function(a){this.manyInternal(4,a)},A.prototype.MANY5=function(a){this.manyInternal(5,a)},A.prototype.MANY6=function(a){this.manyInternal(6,a)},A.prototype.MANY7=function(a){this.manyInternal(7,a)},A.prototype.MANY8=function(a){this.manyInternal(8,a)},A.prototype.MANY9=function(a){this.manyInternal(9,a)},A.prototype.MANY_SEP=function(a){this.manySepFirstInternal(0,a)},A.prototype.MANY_SEP1=function(a){this.manySepFirstInternal(1,a)},A.prototype.MANY_SEP2=function(a){this.manySepFirstInternal(2,a)},A.prototype.MANY_SEP3=function(a){this.manySepFirstInternal(3,a)},A.prototype.MANY_SEP4=function(a){this.manySepFirstInternal(4,a)},A.prototype.MANY_SEP5=function(a){this.manySepFirstInternal(5,a)},A.prototype.MANY_SEP6=function(a){this.manySepFirstInternal(6,a)},A.prototype.MANY_SEP7=function(a){this.manySepFirstInternal(7,a)},A.prototype.MANY_SEP8=function(a){this.manySepFirstInternal(8,a)},A.prototype.MANY_SEP9=function(a){this.manySepFirstInternal(9,a)},A.prototype.AT_LEAST_ONE=function(a){this.atLeastOneInternal(0,a)},A.prototype.AT_LEAST_ONE1=function(a){return this.atLeastOneInternal(1,a)},A.prototype.AT_LEAST_ONE2=function(a){this.atLeastOneInternal(2,a)},A.prototype.AT_LEAST_ONE3=function(a){this.atLeastOneInternal(3,a)},A.prototype.AT_LEAST_ONE4=function(a){this.atLeastOneInternal(4,a)},A.prototype.AT_LEAST_ONE5=function(a){this.atLeastOneInternal(5,a)},A.prototype.AT_LEAST_ONE6=function(a){this.atLeastOneInternal(6,a)},A.prototype.AT_LEAST_ONE7=function(a){this.atLeastOneInternal(7,a)},A.prototype.AT_LEAST_ONE8=function(a){this.atLeastOneInternal(8,a)},A.prototype.AT_LEAST_ONE9=function(a){this.atLeastOneInternal(9,a)},A.prototype.AT_LEAST_ONE_SEP=function(a){this.atLeastOneSepFirstInternal(0,a)},A.prototype.AT_LEAST_ONE_SEP1=function(a){this.atLeastOneSepFirstInternal(1,a)},A.prototype.AT_LEAST_ONE_SEP2=function(a){this.atLeastOneSepFirstInternal(2,a)},A.prototype.AT_LEAST_ONE_SEP3=function(a){this.atLeastOneSepFirstInternal(3,a)},A.prototype.AT_LEAST_ONE_SEP4=function(a){this.atLeastOneSepFirstInternal(4,a)},A.prototype.AT_LEAST_ONE_SEP5=function(a){this.atLeastOneSepFirstInternal(5,a)},A.prototype.AT_LEAST_ONE_SEP6=function(a){this.atLeastOneSepFirstInternal(6,a)},A.prototype.AT_LEAST_ONE_SEP7=function(a){this.atLeastOneSepFirstInternal(7,a)},A.prototype.AT_LEAST_ONE_SEP8=function(a){this.atLeastOneSepFirstInternal(8,a)},A.prototype.AT_LEAST_ONE_SEP9=function(a){this.atLeastOneSepFirstInternal(9,a)},A.prototype.RULE=function(a,h,u){if(u===void 0&&(u=n.DEFAULT_RULE_CONFIG),e.contains(this.definedRulesNames,a)){var b=r.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:a,grammarName:this.className}),f={message:b,type:n.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:a};this.definitionErrors.push(f)}this.definedRulesNames.push(a);var I=this.defineRule(a,h,u);return this[a]=I,I},A.prototype.OVERRIDE_RULE=function(a,h,u){u===void 0&&(u=n.DEFAULT_RULE_CONFIG);var b=[];b=b.concat(o.validateRuleIsOverridden(a,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(b);var f=this.defineRule(a,h,u);return this[a]=f,f},A.prototype.BACKTRACK=function(a,h){return function(){this.isBackTrackingStack.push(1);var u=this.saveRecogState();try{return a.apply(this,h),!0}catch(b){if(t.isRecognitionException(b))return!1;throw b}finally{this.reloadRecogState(u),this.isBackTrackingStack.pop()}}},A.prototype.getGAstProductions=function(){return this.gastProductionsCache},A.prototype.getSerializedGastProductions=function(){return s.serializeGrammar(e.values(this.gastProductionsCache))},A})();i.RecognizerApi=c}),ps=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RecognizerEngine=void 0;var e=Oe(),t=En(),n=St(),r=Pt(),o=Mt(),s=tt(),c=$i(),A=ft(),a=Qt(),h=er(),u=(function(){function b(){}return b.prototype.initRecognizerEngine=function(f,I){if(this.className=h.classNameFromInstance(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=a.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},e.has(I,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
159
159
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
160
160
|
For Further details.`);if(e.isArray(f)){if(e.isEmpty(f))throw Error(`A Token Vocabulary cannot be empty.
|
|
161
161
|
Note that the first argument for the parser constructor
|
|
162
162
|
is no longer a Token vector (since v4.0).`);if(typeof f[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
163
163
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
164
|
-
For Further details.`)}if(e.isArray(f))this.tokensMap=e.reduce(f,function(p,C){return p[C.name]=C,p},{});else if(e.has(f,"modes")&&e.every(e.flatten(e.values(f.modes)),a.isTokenType)){var
|
|
165
|
-
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var l=e.has(E,"resyncEnabled")?E.resyncEnabled:s.DEFAULT_RULE_CONFIG.resyncEnabled,d=e.has(E,"recoveryValueFunc")?E.recoveryValueFunc:s.DEFAULT_RULE_CONFIG.recoveryValueFunc,p=this.ruleShortNameIdx<<t.BITS_FOR_METHOD_TYPE+t.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[p]=f,this.fullRuleNameToShort[f]=p;function C(Q){try{if(this.outputCst===!0){I.apply(this,Q);var _=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(_),_}else return I.apply(this,Q)}catch(j){return this.invokeRuleCatch(j,l,d)}finally{this.ruleFinallyStateUpdate()}}var m=function(Q,_){return Q===void 0&&(Q=0),this.ruleInvocationStateUpdate(p,f,Q),C.call(this,_)},y="ruleName";return m[y]=f,m.originalGrammarAction=I,m},b.prototype.invokeRuleCatch=function(f,I,E){var l=this.RULE_STACK.length===1,d=I&&!this.isBackTracking()&&this.recoveryEnabled;if(n.isRecognitionException(f)){var p=f;if(d){var C=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(C))if(p.resyncedTokens=this.reSyncTo(C),this.outputCst){var m=this.CST_STACK[this.CST_STACK.length-1];return m.recoveredNode=!0,m}else return E();else{if(this.outputCst){var m=this.CST_STACK[this.CST_STACK.length-1];m.recoveredNode=!0,p.partialCstResult=m}throw p}}else{if(l)return this.moveToTerminatedState(),E();throw p}}else throw f},b.prototype.optionInternal=function(f,I){var E=this.getKeyForAutomaticLookahead(t.OPTION_IDX,I);return this.optionInternalLogic(f,I,E)},b.prototype.optionInternalLogic=function(f,I,E){var l=this,d=this.getLaFuncFromCache(E),p,C;if(f.DEF!==void 0){if(p=f.DEF,C=f.GATE,C!==void 0){var m=d;d=function(){return C.call(l)&&m.call(l)}}}else p=f;if(d.call(this)===!0)return p.call(this)},b.prototype.atLeastOneInternal=function(f,I){var E=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_IDX,f);return this.atLeastOneInternalLogic(f,I,E)},b.prototype.atLeastOneInternalLogic=function(f,I,E){var l=this,d=this.getLaFuncFromCache(E),p,C;if(I.DEF!==void 0){if(p=I.DEF,C=I.GATE,C!==void 0){var m=d;d=function(){return C.call(l)&&m.call(l)}}}else p=I;if(d.call(this)===!0)for(var y=this.doSingleRepetition(p);d.call(this)===!0&&y===!0;)y=this.doSingleRepetition(p);else throw this.raiseEarlyExitException(f,r.PROD_TYPE.REPETITION_MANDATORY,I.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[f,I],d,t.AT_LEAST_ONE_IDX,f,o.NextTerminalAfterAtLeastOneWalker)},b.prototype.atLeastOneSepFirstInternal=function(f,I){var E=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_SEP_IDX,f);this.atLeastOneSepFirstInternalLogic(f,I,E)},b.prototype.atLeastOneSepFirstInternalLogic=function(f,I,E){var l=this,d=I.DEF,p=I.SEP,C=this.getLaFuncFromCache(E);if(C.call(this)===!0){d.call(this);for(var m=function(){return l.tokenMatcher(l.LA(1),p)};this.tokenMatcher(this.LA(1),p)===!0;)this.CONSUME(p),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,p,m,d,o.NextTerminalAfterAtLeastOneSepWalker],m,t.AT_LEAST_ONE_SEP_IDX,f,o.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(f,r.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,I.ERR_MSG)},b.prototype.manyInternal=function(f,I){var E=this.getKeyForAutomaticLookahead(t.MANY_IDX,f);return this.manyInternalLogic(f,I,E)},b.prototype.manyInternalLogic=function(f,I,E){var l=this,d=this.getLaFuncFromCache(E),p,C;if(I.DEF!==void 0){if(p=I.DEF,C=I.GATE,C!==void 0){var m=d;d=function(){return C.call(l)&&m.call(l)}}}else p=I;for(var y=!0;d.call(this)===!0&&y===!0;)y=this.doSingleRepetition(p);this.attemptInRepetitionRecovery(this.manyInternal,[f,I],d,t.MANY_IDX,f,o.NextTerminalAfterManyWalker,y)},b.prototype.manySepFirstInternal=function(f,I){var E=this.getKeyForAutomaticLookahead(t.MANY_SEP_IDX,f);this.manySepFirstInternalLogic(f,I,E)},b.prototype.manySepFirstInternalLogic=function(f,I,E){var l=this,d=I.DEF,p=I.SEP,C=this.getLaFuncFromCache(E);if(C.call(this)===!0){d.call(this);for(var m=function(){return l.tokenMatcher(l.LA(1),p)};this.tokenMatcher(this.LA(1),p)===!0;)this.CONSUME(p),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,p,m,d,o.NextTerminalAfterManySepWalker],m,t.MANY_SEP_IDX,f,o.NextTerminalAfterManySepWalker)}},b.prototype.repetitionSepSecondInternal=function(f,I,E,l,d){for(;E();)this.CONSUME(I),l.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,I,E,l,d],E,t.AT_LEAST_ONE_SEP_IDX,f,d)},b.prototype.doSingleRepetition=function(f){var I=this.getLexerPosition();f.call(this);var E=this.getLexerPosition();return E>I},b.prototype.orInternal=function(f,I){var E=this.getKeyForAutomaticLookahead(t.OR_IDX,I),l=e.isArray(f)?f:f.DEF,d=this.getLaFuncFromCache(E),p=d.call(this,l);if(p!==void 0){var C=l[p];return C.ALT.call(this)}this.raiseNoAltException(I,f.ERR_MSG)},b.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var f=this.LA(1),I=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:f,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new n.NotAllInputParsedException(I,f))}},b.prototype.subruleInternal=function(f,I,E){var l;try{var d=E!==void 0?E.ARGS:void 0;return l=f.call(this,I,d),this.cstPostNonTerminal(l,E!==void 0&&E.LABEL!==void 0?E.LABEL:f.ruleName),l}catch(p){this.subruleInternalError(p,E,f.ruleName)}},b.prototype.subruleInternalError=function(f,I,E){throw n.isRecognitionException(f)&&f.partialCstResult!==void 0&&(this.cstPostNonTerminal(f.partialCstResult,I!==void 0&&I.LABEL!==void 0?I.LABEL:E),delete f.partialCstResult),f},b.prototype.consumeInternal=function(f,I,E){var l;try{var d=this.LA(1);this.tokenMatcher(d,f)===!0?(this.consumeToken(),l=d):this.consumeInternalError(f,d,E)}catch(p){l=this.consumeInternalRecovery(f,I,p)}return this.cstPostTerminal(E!==void 0&&E.LABEL!==void 0?E.LABEL:f.name,l),l},b.prototype.consumeInternalError=function(f,I,E){var l,d=this.LA(0);throw E!==void 0&&E.ERR_MSG?l=E.ERR_MSG:l=this.errorMessageProvider.buildMismatchTokenMessage({expected:f,actual:I,previous:d,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new n.MismatchedTokenException(l,I,d))},b.prototype.consumeInternalRecovery=function(f,I,E){if(this.recoveryEnabled&&E.name==="MismatchedTokenException"&&!this.isBackTracking()){var l=this.getFollowsForInRuleRecovery(f,I);try{return this.tryInRuleRecovery(f,l)}catch(d){throw d.name===c.IN_RULE_RECOVERY_EXCEPTION?E:d}}else throw E},b.prototype.saveRecogState=function(){var f=this.errors,I=e.cloneArr(this.RULE_STACK);return{errors:f,lexerState:this.exportLexerState(),RULE_STACK:I,CST_STACK:this.CST_STACK}},b.prototype.reloadRecogState=function(f){this.errors=f.errors,this.importLexerState(f.lexerState),this.RULE_STACK=f.RULE_STACK},b.prototype.ruleInvocationStateUpdate=function(f,I,E){this.RULE_OCCURRENCE_STACK.push(E),this.RULE_STACK.push(f),this.cstInvocationStateUpdate(I,f)},b.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},b.prototype.getCurrRuleFullName=function(){var f=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[f]},b.prototype.shortRuleNameToFullName=function(f){return this.shortRuleNameToFull[f]},b.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),A.EOF)},b.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},b})();i.RecognizerEngine=u}),fs=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ErrorHandler=void 0;var e=St(),t=De(),n=Mt(),r=tt(),o=(function(){function s(){}return s.prototype.initErrorHandler=function(c){this._errors=[],this.errorMessageProvider=t.has(c,"errorMessageProvider")?c.errorMessageProvider:r.DEFAULT_PARSER_CONFIG.errorMessageProvider},s.prototype.SAVE_ERROR=function(c){if(e.isRecognitionException(c))return c.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:t.cloneArr(this.RULE_OCCURRENCE_STACK)},this._errors.push(c),c;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(s.prototype,"errors",{get:function(){return t.cloneArr(this._errors)},set:function(c){this._errors=c},enumerable:!1,configurable:!0}),s.prototype.raiseEarlyExitException=function(c,A,a){for(var h=this.getCurrRuleFullName(),u=this.getGAstProductions()[h],b=n.getLookaheadPathsForOptionalProd(c,u,A,this.maxLookahead),f=b[0],I=[],E=1;E<=this.maxLookahead;E++)I.push(this.LA(E));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:f,actual:I,previous:this.LA(0),customUserDescription:a,ruleName:h});throw this.SAVE_ERROR(new e.EarlyExitException(l,this.LA(1),this.LA(0)))},s.prototype.raiseNoAltException=function(c,A){for(var a=this.getCurrRuleFullName(),h=this.getGAstProductions()[a],u=n.getLookaheadPathsForOr(c,h,this.maxLookahead),b=[],f=1;f<=this.maxLookahead;f++)b.push(this.LA(f));var I=this.LA(0),E=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:u,actual:b,previous:I,customUserDescription:A,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new e.NoViableAltException(E,this.LA(1),I))},s})();i.ErrorHandler=o}),ps=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ContentAssist=void 0;var e=Ot(),t=De(),n=(function(){function r(){}return r.prototype.initContentAssist=function(){},r.prototype.computeContentAssist=function(o,s){var c=this.gastProductionsCache[o];if(t.isUndefined(c))throw Error("Rule ->"+o+"<- does not exist in this grammar.");return e.nextPossibleTokensAfter([c],s,this.tokenMatcher,this.maxLookahead)},r.prototype.getNextPossibleTokenTypes=function(o){var s=t.first(o.ruleStack),c=this.getGAstProductions(),A=c[s],a=new e.NextAfterTokenWalker(A,o).startWalking();return a},r})();i.ContentAssist=n}),gs=Qe(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GastRecorder=void 0;var e=De(),t=Ze(),n=Nt(),r=Qt(),o=ft(),s=tt(),c=gn(),A={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(A);var a=!0,h=Math.pow(2,c.BITS_FOR_OCCURRENCE_IDX)-1,u=o.createToken({name:"RECORDING_PHASE_TOKEN",pattern:n.Lexer.NA});r.augmentTokenTypes([u]);var b=o.createTokenInstance(u,`This IToken indicates the Parser is in Recording Phase
|
|
164
|
+
For Further details.`)}if(e.isArray(f))this.tokensMap=e.reduce(f,function(p,C){return p[C.name]=C,p},{});else if(e.has(f,"modes")&&e.every(e.flatten(e.values(f.modes)),a.isTokenType)){var m=e.flatten(e.values(f.modes)),l=e.uniq(m);this.tokensMap=e.reduce(l,function(p,C){return p[C.name]=C,p},{})}else if(e.isObject(f))this.tokensMap=e.cloneObj(f);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=A.EOF;var d=e.every(e.values(f),function(p){return e.isEmpty(p.categoryMatches)});this.tokenMatcher=d?a.tokenStructuredMatcherNoCategories:a.tokenStructuredMatcher,a.augmentTokenTypes(e.values(this.tokensMap))},b.prototype.defineRule=function(f,I,m){if(this.selfAnalysisDone)throw Error("Grammar rule <"+f+`> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
165
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var l=e.has(m,"resyncEnabled")?m.resyncEnabled:s.DEFAULT_RULE_CONFIG.resyncEnabled,d=e.has(m,"recoveryValueFunc")?m.recoveryValueFunc:s.DEFAULT_RULE_CONFIG.recoveryValueFunc,p=this.ruleShortNameIdx<<t.BITS_FOR_METHOD_TYPE+t.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[p]=f,this.fullRuleNameToShort[f]=p;function C(Q){try{if(this.outputCst===!0){I.apply(this,Q);var x=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(x),x}else return I.apply(this,Q)}catch(H){return this.invokeRuleCatch(H,l,d)}finally{this.ruleFinallyStateUpdate()}}var E=function(Q,x){return Q===void 0&&(Q=0),this.ruleInvocationStateUpdate(p,f,Q),C.call(this,x)},y="ruleName";return E[y]=f,E.originalGrammarAction=I,E},b.prototype.invokeRuleCatch=function(f,I,m){var l=this.RULE_STACK.length===1,d=I&&!this.isBackTracking()&&this.recoveryEnabled;if(n.isRecognitionException(f)){var p=f;if(d){var C=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(C))if(p.resyncedTokens=this.reSyncTo(C),this.outputCst){var E=this.CST_STACK[this.CST_STACK.length-1];return E.recoveredNode=!0,E}else return m();else{if(this.outputCst){var E=this.CST_STACK[this.CST_STACK.length-1];E.recoveredNode=!0,p.partialCstResult=E}throw p}}else{if(l)return this.moveToTerminatedState(),m();throw p}}else throw f},b.prototype.optionInternal=function(f,I){var m=this.getKeyForAutomaticLookahead(t.OPTION_IDX,I);return this.optionInternalLogic(f,I,m)},b.prototype.optionInternalLogic=function(f,I,m){var l=this,d=this.getLaFuncFromCache(m),p,C;if(f.DEF!==void 0){if(p=f.DEF,C=f.GATE,C!==void 0){var E=d;d=function(){return C.call(l)&&E.call(l)}}}else p=f;if(d.call(this)===!0)return p.call(this)},b.prototype.atLeastOneInternal=function(f,I){var m=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_IDX,f);return this.atLeastOneInternalLogic(f,I,m)},b.prototype.atLeastOneInternalLogic=function(f,I,m){var l=this,d=this.getLaFuncFromCache(m),p,C;if(I.DEF!==void 0){if(p=I.DEF,C=I.GATE,C!==void 0){var E=d;d=function(){return C.call(l)&&E.call(l)}}}else p=I;if(d.call(this)===!0)for(var y=this.doSingleRepetition(p);d.call(this)===!0&&y===!0;)y=this.doSingleRepetition(p);else throw this.raiseEarlyExitException(f,r.PROD_TYPE.REPETITION_MANDATORY,I.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[f,I],d,t.AT_LEAST_ONE_IDX,f,o.NextTerminalAfterAtLeastOneWalker)},b.prototype.atLeastOneSepFirstInternal=function(f,I){var m=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_SEP_IDX,f);this.atLeastOneSepFirstInternalLogic(f,I,m)},b.prototype.atLeastOneSepFirstInternalLogic=function(f,I,m){var l=this,d=I.DEF,p=I.SEP,C=this.getLaFuncFromCache(m);if(C.call(this)===!0){d.call(this);for(var E=function(){return l.tokenMatcher(l.LA(1),p)};this.tokenMatcher(this.LA(1),p)===!0;)this.CONSUME(p),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,p,E,d,o.NextTerminalAfterAtLeastOneSepWalker],E,t.AT_LEAST_ONE_SEP_IDX,f,o.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(f,r.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,I.ERR_MSG)},b.prototype.manyInternal=function(f,I){var m=this.getKeyForAutomaticLookahead(t.MANY_IDX,f);return this.manyInternalLogic(f,I,m)},b.prototype.manyInternalLogic=function(f,I,m){var l=this,d=this.getLaFuncFromCache(m),p,C;if(I.DEF!==void 0){if(p=I.DEF,C=I.GATE,C!==void 0){var E=d;d=function(){return C.call(l)&&E.call(l)}}}else p=I;for(var y=!0;d.call(this)===!0&&y===!0;)y=this.doSingleRepetition(p);this.attemptInRepetitionRecovery(this.manyInternal,[f,I],d,t.MANY_IDX,f,o.NextTerminalAfterManyWalker,y)},b.prototype.manySepFirstInternal=function(f,I){var m=this.getKeyForAutomaticLookahead(t.MANY_SEP_IDX,f);this.manySepFirstInternalLogic(f,I,m)},b.prototype.manySepFirstInternalLogic=function(f,I,m){var l=this,d=I.DEF,p=I.SEP,C=this.getLaFuncFromCache(m);if(C.call(this)===!0){d.call(this);for(var E=function(){return l.tokenMatcher(l.LA(1),p)};this.tokenMatcher(this.LA(1),p)===!0;)this.CONSUME(p),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,p,E,d,o.NextTerminalAfterManySepWalker],E,t.MANY_SEP_IDX,f,o.NextTerminalAfterManySepWalker)}},b.prototype.repetitionSepSecondInternal=function(f,I,m,l,d){for(;m();)this.CONSUME(I),l.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[f,I,m,l,d],m,t.AT_LEAST_ONE_SEP_IDX,f,d)},b.prototype.doSingleRepetition=function(f){var I=this.getLexerPosition();f.call(this);var m=this.getLexerPosition();return m>I},b.prototype.orInternal=function(f,I){var m=this.getKeyForAutomaticLookahead(t.OR_IDX,I),l=e.isArray(f)?f:f.DEF,d=this.getLaFuncFromCache(m),p=d.call(this,l);if(p!==void 0){var C=l[p];return C.ALT.call(this)}this.raiseNoAltException(I,f.ERR_MSG)},b.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var f=this.LA(1),I=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:f,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new n.NotAllInputParsedException(I,f))}},b.prototype.subruleInternal=function(f,I,m){var l;try{var d=m!==void 0?m.ARGS:void 0;return l=f.call(this,I,d),this.cstPostNonTerminal(l,m!==void 0&&m.LABEL!==void 0?m.LABEL:f.ruleName),l}catch(p){this.subruleInternalError(p,m,f.ruleName)}},b.prototype.subruleInternalError=function(f,I,m){throw n.isRecognitionException(f)&&f.partialCstResult!==void 0&&(this.cstPostNonTerminal(f.partialCstResult,I!==void 0&&I.LABEL!==void 0?I.LABEL:m),delete f.partialCstResult),f},b.prototype.consumeInternal=function(f,I,m){var l;try{var d=this.LA(1);this.tokenMatcher(d,f)===!0?(this.consumeToken(),l=d):this.consumeInternalError(f,d,m)}catch(p){l=this.consumeInternalRecovery(f,I,p)}return this.cstPostTerminal(m!==void 0&&m.LABEL!==void 0?m.LABEL:f.name,l),l},b.prototype.consumeInternalError=function(f,I,m){var l,d=this.LA(0);throw m!==void 0&&m.ERR_MSG?l=m.ERR_MSG:l=this.errorMessageProvider.buildMismatchTokenMessage({expected:f,actual:I,previous:d,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new n.MismatchedTokenException(l,I,d))},b.prototype.consumeInternalRecovery=function(f,I,m){if(this.recoveryEnabled&&m.name==="MismatchedTokenException"&&!this.isBackTracking()){var l=this.getFollowsForInRuleRecovery(f,I);try{return this.tryInRuleRecovery(f,l)}catch(d){throw d.name===c.IN_RULE_RECOVERY_EXCEPTION?m:d}}else throw m},b.prototype.saveRecogState=function(){var f=this.errors,I=e.cloneArr(this.RULE_STACK);return{errors:f,lexerState:this.exportLexerState(),RULE_STACK:I,CST_STACK:this.CST_STACK}},b.prototype.reloadRecogState=function(f){this.errors=f.errors,this.importLexerState(f.lexerState),this.RULE_STACK=f.RULE_STACK},b.prototype.ruleInvocationStateUpdate=function(f,I,m){this.RULE_OCCURRENCE_STACK.push(m),this.RULE_STACK.push(f),this.cstInvocationStateUpdate(I,f)},b.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},b.prototype.getCurrRuleFullName=function(){var f=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[f]},b.prototype.shortRuleNameToFullName=function(f){return this.shortRuleNameToFull[f]},b.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),A.EOF)},b.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},b})();i.RecognizerEngine=u}),gs=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ErrorHandler=void 0;var e=St(),t=Oe(),n=Pt(),r=tt(),o=(function(){function s(){}return s.prototype.initErrorHandler=function(c){this._errors=[],this.errorMessageProvider=t.has(c,"errorMessageProvider")?c.errorMessageProvider:r.DEFAULT_PARSER_CONFIG.errorMessageProvider},s.prototype.SAVE_ERROR=function(c){if(e.isRecognitionException(c))return c.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:t.cloneArr(this.RULE_OCCURRENCE_STACK)},this._errors.push(c),c;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(s.prototype,"errors",{get:function(){return t.cloneArr(this._errors)},set:function(c){this._errors=c},enumerable:!1,configurable:!0}),s.prototype.raiseEarlyExitException=function(c,A,a){for(var h=this.getCurrRuleFullName(),u=this.getGAstProductions()[h],b=n.getLookaheadPathsForOptionalProd(c,u,A,this.maxLookahead),f=b[0],I=[],m=1;m<=this.maxLookahead;m++)I.push(this.LA(m));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:f,actual:I,previous:this.LA(0),customUserDescription:a,ruleName:h});throw this.SAVE_ERROR(new e.EarlyExitException(l,this.LA(1),this.LA(0)))},s.prototype.raiseNoAltException=function(c,A){for(var a=this.getCurrRuleFullName(),h=this.getGAstProductions()[a],u=n.getLookaheadPathsForOr(c,h,this.maxLookahead),b=[],f=1;f<=this.maxLookahead;f++)b.push(this.LA(f));var I=this.LA(0),m=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:u,actual:b,previous:I,customUserDescription:A,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new e.NoViableAltException(m,this.LA(1),I))},s})();i.ErrorHandler=o}),ms=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ContentAssist=void 0;var e=Mt(),t=Oe(),n=(function(){function r(){}return r.prototype.initContentAssist=function(){},r.prototype.computeContentAssist=function(o,s){var c=this.gastProductionsCache[o];if(t.isUndefined(c))throw Error("Rule ->"+o+"<- does not exist in this grammar.");return e.nextPossibleTokensAfter([c],s,this.tokenMatcher,this.maxLookahead)},r.prototype.getNextPossibleTokenTypes=function(o){var s=t.first(o.ruleStack),c=this.getGAstProductions(),A=c[s],a=new e.NextAfterTokenWalker(A,o).startWalking();return a},r})();i.ContentAssist=n}),Es=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GastRecorder=void 0;var e=Oe(),t=Ze(),n=Dt(),r=Qt(),o=ft(),s=tt(),c=En(),A={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(A);var a=!0,h=Math.pow(2,c.BITS_FOR_OCCURRENCE_IDX)-1,u=o.createToken({name:"RECORDING_PHASE_TOKEN",pattern:n.Lexer.NA});r.augmentTokenTypes([u]);var b=o.createTokenInstance(u,`This IToken indicates the Parser is in Recording Phase
|
|
166
166
|
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(b);var f={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
167
|
-
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},I=(function(){function C(){}return C.prototype.initGastRecorder=function(
|
|
167
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},I=(function(){function C(){}return C.prototype.initGastRecorder=function(E){this.recordingProdStack=[],this.RECORDING_PHASE=!1},C.prototype.enableRecording=function(){var E=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var y=function(x){var H=x>0?x:"";E["CONSUME"+H]=function(R,M){return this.consumeInternalRecord(R,x,M)},E["SUBRULE"+H]=function(R,M){return this.subruleInternalRecord(R,x,M)},E["OPTION"+H]=function(R){return this.optionInternalRecord(R,x)},E["OR"+H]=function(R){return this.orInternalRecord(R,x)},E["MANY"+H]=function(R){this.manyInternalRecord(x,R)},E["MANY_SEP"+H]=function(R){this.manySepFirstInternalRecord(x,R)},E["AT_LEAST_ONE"+H]=function(R){this.atLeastOneInternalRecord(x,R)},E["AT_LEAST_ONE_SEP"+H]=function(R){this.atLeastOneSepFirstInternalRecord(x,R)}},Q=0;Q<10;Q++)y(Q);E.consume=function(x,H,R){return this.consumeInternalRecord(H,x,R)},E.subrule=function(x,H,R){return this.subruleInternalRecord(H,x,R)},E.option=function(x,H){return this.optionInternalRecord(H,x)},E.or=function(x,H){return this.orInternalRecord(H,x)},E.many=function(x,H){this.manyInternalRecord(x,H)},E.atLeastOne=function(x,H){this.atLeastOneInternalRecord(x,H)},E.ACTION=E.ACTION_RECORD,E.BACKTRACK=E.BACKTRACK_RECORD,E.LA=E.LA_RECORD})},C.prototype.disableRecording=function(){var E=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var y=0;y<10;y++){var Q=y>0?y:"";delete E["CONSUME"+Q],delete E["SUBRULE"+Q],delete E["OPTION"+Q],delete E["OR"+Q],delete E["MANY"+Q],delete E["MANY_SEP"+Q],delete E["AT_LEAST_ONE"+Q],delete E["AT_LEAST_ONE_SEP"+Q]}delete E.consume,delete E.subrule,delete E.option,delete E.or,delete E.many,delete E.atLeastOne,delete E.ACTION,delete E.BACKTRACK,delete E.LA})},C.prototype.ACTION_RECORD=function(E){},C.prototype.BACKTRACK_RECORD=function(E,y){return function(){return!0}},C.prototype.LA_RECORD=function(E){return s.END_OF_FILE},C.prototype.topLevelRuleRecord=function(E,y){try{var Q=new t.Rule({definition:[],name:E});return Q.name=E,this.recordingProdStack.push(Q),y.call(this),this.recordingProdStack.pop(),Q}catch(x){if(x.KNOWN_RECORDER_ERROR!==!0)try{x.message=x.message+`
|
|
168
168
|
This error was thrown during the "grammar recording phase" For more info see:
|
|
169
|
-
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw
|
|
170
|
-
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw
|
|
171
|
-
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw
|
|
172
|
-
`+("Idx value must be a none negative value smaller than "+(h+1)));throw
|
|
169
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw x}throw x}},C.prototype.optionInternalRecord=function(E,y){return m.call(this,t.Option,E,y)},C.prototype.atLeastOneInternalRecord=function(E,y){m.call(this,t.RepetitionMandatory,y,E)},C.prototype.atLeastOneSepFirstInternalRecord=function(E,y){m.call(this,t.RepetitionMandatoryWithSeparator,y,E,a)},C.prototype.manyInternalRecord=function(E,y){m.call(this,t.Repetition,y,E)},C.prototype.manySepFirstInternalRecord=function(E,y){m.call(this,t.RepetitionWithSeparator,y,E,a)},C.prototype.orInternalRecord=function(E,y){return l.call(this,E,y)},C.prototype.subruleInternalRecord=function(E,y,Q){if(p(y),!E||e.has(E,"ruleName")===!1){var x=new Error("<SUBRULE"+d(y)+"> argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(E)+">")+(`
|
|
170
|
+
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw x.KNOWN_RECORDER_ERROR=!0,x}var H=e.peek(this.recordingProdStack),R=E.ruleName,M=new t.NonTerminal({idx:y,nonTerminalName:R,referencedRule:void 0});return H.definition.push(M),this.outputCst?f:A},C.prototype.consumeInternalRecord=function(E,y,Q){if(p(y),!r.hasShortKeyProperty(E)){var x=new Error("<CONSUME"+d(y)+"> argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(E)+">")+(`
|
|
171
|
+
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw x.KNOWN_RECORDER_ERROR=!0,x}var H=e.peek(this.recordingProdStack),R=new t.Terminal({idx:y,terminalType:E});return H.definition.push(R),b},C})();i.GastRecorder=I;function m(C,E,y,Q){Q===void 0&&(Q=!1),p(y);var x=e.peek(this.recordingProdStack),H=e.isFunction(E)?E:E.DEF,R=new C({definition:[],idx:y});return Q&&(R.separator=E.SEP),e.has(E,"MAX_LOOKAHEAD")&&(R.maxLookahead=E.MAX_LOOKAHEAD),this.recordingProdStack.push(R),H.call(this),x.definition.push(R),this.recordingProdStack.pop(),A}function l(C,E){var y=this;p(E);var Q=e.peek(this.recordingProdStack),x=e.isArray(C)===!1,H=x===!1?C:C.DEF,R=new t.Alternation({definition:[],idx:E,ignoreAmbiguities:x&&C.IGNORE_AMBIGUITIES===!0});e.has(C,"MAX_LOOKAHEAD")&&(R.maxLookahead=C.MAX_LOOKAHEAD);var M=e.some(H,function(N){return e.isFunction(N.GATE)});return R.hasPredicates=M,Q.definition.push(R),e.forEach(H,function(N){var v=new t.Alternative({definition:[]});R.definition.push(v),e.has(N,"IGNORE_AMBIGUITIES")?v.ignoreAmbiguities=N.IGNORE_AMBIGUITIES:e.has(N,"GATE")&&(v.ignoreAmbiguities=!0),y.recordingProdStack.push(v),N.ALT.call(y),y.recordingProdStack.pop()}),A}function d(C){return C===0?"":""+C}function p(C){if(C<0||C>h){var E=new Error("Invalid DSL Method idx value: <"+C+`>
|
|
172
|
+
`+("Idx value must be a none negative value smaller than "+(h+1)));throw E.KNOWN_RECORDER_ERROR=!0,E}}}),Is=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PerformanceTracer=void 0;var e=Oe(),t=tt(),n=(function(){function r(){}return r.prototype.initPerformanceTracer=function(o){if(e.has(o,"traceInitPerf")){var s=o.traceInitPerf,c=typeof s=="number";this.traceInitMaxIdent=c?s:1/0,this.traceInitPerf=c?s>0:s}else this.traceInitMaxIdent=0,this.traceInitPerf=t.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},r.prototype.TRACE_INIT=function(o,s){if(this.traceInitPerf===!0){this.traceInitIndent++;var c=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(c+"--> <"+o+">");var A=e.timer(s),a=A.time,h=A.value,u=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(c+"<-- <"+o+"> time: "+a+"ms"),this.traceInitIndent--,h}else return s()},r})();i.PerformanceTracer=n}),bs=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.applyMixins=void 0;function e(t,n){n.forEach(function(r){var o=r.prototype;Object.getOwnPropertyNames(o).forEach(function(s){if(s!=="constructor"){var c=Object.getOwnPropertyDescriptor(o,s);c&&(c.get||c.set)?Object.defineProperty(t.prototype,s,c):t.prototype[s]=r.prototype[s]}})})}i.applyMixins=e}),tt=ve(i=>{var e=i&&i.__extends||(function(){var Q=function(x,H){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,M){R.__proto__=M}||function(R,M){for(var N in M)Object.prototype.hasOwnProperty.call(M,N)&&(R[N]=M[N])},Q(x,H)};return function(x,H){if(typeof H!="function"&&H!==null)throw new TypeError("Class extends value "+String(H)+" is not a constructor or null");Q(x,H);function R(){this.constructor=x}x.prototype=H===null?Object.create(H):(R.prototype=H.prototype,new R)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.EmbeddedActionsParser=i.CstParser=i.Parser=i.EMPTY_ALT=i.ParserDefinitionErrorType=i.DEFAULT_RULE_CONFIG=i.DEFAULT_PARSER_CONFIG=i.END_OF_FILE=void 0;var t=Oe(),n=ss(),r=ft(),o=Ot(),s=As(),c=$i(),A=cs(),a=hs(),h=ds(),u=fs(),b=ps(),f=gs(),I=ms(),m=Es(),l=Is(),d=bs();i.END_OF_FILE=r.createTokenInstance(r.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN),Object.freeze(i.END_OF_FILE),i.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:o.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),i.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0}),(function(Q){Q[Q.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",Q[Q.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",Q[Q.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",Q[Q.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",Q[Q.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",Q[Q.LEFT_RECURSION=5]="LEFT_RECURSION",Q[Q.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",Q[Q.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",Q[Q.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",Q[Q.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",Q[Q.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",Q[Q.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",Q[Q.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(i.ParserDefinitionErrorType||(i.ParserDefinitionErrorType={}));function p(Q){return Q===void 0&&(Q=void 0),function(){return Q}}i.EMPTY_ALT=p;var C=(function(){function Q(x,H){this.definitionErrors=[],this.selfAnalysisDone=!1;var R=this;if(R.initErrorHandler(H),R.initLexerAdapter(),R.initLooksAhead(H),R.initRecognizerEngine(x,H),R.initRecoverable(H),R.initTreeBuilder(H),R.initContentAssist(),R.initGastRecorder(H),R.initPerformanceTracer(H),t.has(H,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
173
173
|
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
174
174
|
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
175
|
-
For further details.`);this.skipValidations=t.has(
|
|
176
|
-
`+
|
|
175
|
+
For further details.`);this.skipValidations=t.has(H,"skipValidations")?H.skipValidations:i.DEFAULT_PARSER_CONFIG.skipValidations}return Q.performSelfAnalysis=function(x){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},Q.prototype.performSelfAnalysis=function(){var x=this;this.TRACE_INIT("performSelfAnalysis",function(){var H;x.selfAnalysisDone=!0;var R=x.className;x.TRACE_INIT("toFastProps",function(){t.toFastProperties(x)}),x.TRACE_INIT("Grammar Recording",function(){try{x.enableRecording(),t.forEach(x.definedRulesNames,function(N){var v=x[N],S=v.originalGrammarAction,_=void 0;x.TRACE_INIT(N+" Rule",function(){_=x.topLevelRuleRecord(N,S)}),x.gastProductionsCache[N]=_})}finally{x.disableRecording()}});var M=[];if(x.TRACE_INIT("Grammar Resolving",function(){M=s.resolveGrammar({rules:t.values(x.gastProductionsCache)}),x.definitionErrors=x.definitionErrors.concat(M)}),x.TRACE_INIT("Grammar Validations",function(){if(t.isEmpty(M)&&x.skipValidations===!1){var N=s.validateGrammar({rules:t.values(x.gastProductionsCache),maxLookahead:x.maxLookahead,tokenTypes:t.values(x.tokensMap),errMsgProvider:o.defaultGrammarValidatorErrorProvider,grammarName:R});x.definitionErrors=x.definitionErrors.concat(N)}}),t.isEmpty(x.definitionErrors)&&(x.recoveryEnabled&&x.TRACE_INIT("computeAllProdsFollows",function(){var N=n.computeAllProdsFollows(t.values(x.gastProductionsCache));x.resyncFollows=N}),x.TRACE_INIT("ComputeLookaheadFunctions",function(){x.preComputeLookaheadFunctions(t.values(x.gastProductionsCache))})),!Q.DEFER_DEFINITION_ERRORS_HANDLING&&!t.isEmpty(x.definitionErrors))throw H=t.map(x.definitionErrors,function(N){return N.message}),new Error(`Parser Definition Errors detected:
|
|
176
|
+
`+H.join(`
|
|
177
177
|
-------------------------------
|
|
178
|
-
`))})},Q.DEFER_DEFINITION_ERRORS_HANDLING=!1,Q})();i.Parser=C,d.applyMixins(C,[c.Recoverable,A.LooksAhead,a.TreeBuilder,h.LexerAdapter,b.RecognizerEngine,u.RecognizerApi,f.ErrorHandler,I.ContentAssist,
|
|
178
|
+
`))})},Q.DEFER_DEFINITION_ERRORS_HANDLING=!1,Q})();i.Parser=C,d.applyMixins(C,[c.Recoverable,A.LooksAhead,a.TreeBuilder,h.LexerAdapter,b.RecognizerEngine,u.RecognizerApi,f.ErrorHandler,I.ContentAssist,m.GastRecorder,l.PerformanceTracer]);var E=(function(Q){e(x,Q);function x(H,R){R===void 0&&(R=i.DEFAULT_PARSER_CONFIG);var M=this,N=t.cloneObj(R);return N.outputCst=!0,M=Q.call(this,H,N)||this,M}return x})(C);i.CstParser=E;var y=(function(Q){e(x,Q);function x(H,R){R===void 0&&(R=i.DEFAULT_PARSER_CONFIG);var M=this,N=t.cloneObj(R);return N.outputCst=!1,M=Q.call(this,H,N)||this,M}return x})(C);i.EmbeddedActionsParser=y}),Cs=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSyntaxDiagramsCode=void 0;var e=Vi();function t(n,r){var o=r===void 0?{}:r,s=o.resourceBase,c=s===void 0?"https://unpkg.com/chevrotain@"+e.VERSION+"/diagrams/":s,A=o.css,a=A===void 0?"https://unpkg.com/chevrotain@"+e.VERSION+"/diagrams/diagrams.css":A,h=`
|
|
179
179
|
<!-- This is a generated file -->
|
|
180
180
|
<!DOCTYPE html>
|
|
181
181
|
<meta charset="utf-8">
|
|
@@ -198,15 +198,15 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
|
|
|
198
198
|
<script>
|
|
199
199
|
window.serializedGrammar = `+JSON.stringify(n,null," ")+`;
|
|
200
200
|
<\/script>
|
|
201
|
-
`,
|
|
201
|
+
`,m=`
|
|
202
202
|
<script>
|
|
203
203
|
var diagramsDiv = document.getElementById("diagrams");
|
|
204
204
|
main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);
|
|
205
205
|
<\/script>
|
|
206
|
-
`;return h+u+b+f+I+
|
|
206
|
+
`;return h+u+b+f+I+m}i.createSyntaxDiagramsCode=t}),ys=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Parser=i.createSyntaxDiagramsCode=i.clearCache=i.GAstVisitor=i.serializeProduction=i.serializeGrammar=i.Terminal=i.Rule=i.RepetitionWithSeparator=i.RepetitionMandatoryWithSeparator=i.RepetitionMandatory=i.Repetition=i.Option=i.NonTerminal=i.Alternative=i.Alternation=i.defaultLexerErrorProvider=i.NoViableAltException=i.NotAllInputParsedException=i.MismatchedTokenException=i.isRecognitionException=i.EarlyExitException=i.defaultParserErrorProvider=i.tokenName=i.tokenMatcher=i.tokenLabel=i.EOF=i.createTokenInstance=i.createToken=i.LexerDefinitionErrorType=i.Lexer=i.EMPTY_ALT=i.ParserDefinitionErrorType=i.EmbeddedActionsParser=i.CstParser=i.VERSION=void 0;var e=Vi();Object.defineProperty(i,"VERSION",{enumerable:!0,get:function(){return e.VERSION}});var t=tt();Object.defineProperty(i,"CstParser",{enumerable:!0,get:function(){return t.CstParser}}),Object.defineProperty(i,"EmbeddedActionsParser",{enumerable:!0,get:function(){return t.EmbeddedActionsParser}}),Object.defineProperty(i,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return t.ParserDefinitionErrorType}}),Object.defineProperty(i,"EMPTY_ALT",{enumerable:!0,get:function(){return t.EMPTY_ALT}});var n=Dt();Object.defineProperty(i,"Lexer",{enumerable:!0,get:function(){return n.Lexer}}),Object.defineProperty(i,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return n.LexerDefinitionErrorType}});var r=ft();Object.defineProperty(i,"createToken",{enumerable:!0,get:function(){return r.createToken}}),Object.defineProperty(i,"createTokenInstance",{enumerable:!0,get:function(){return r.createTokenInstance}}),Object.defineProperty(i,"EOF",{enumerable:!0,get:function(){return r.EOF}}),Object.defineProperty(i,"tokenLabel",{enumerable:!0,get:function(){return r.tokenLabel}}),Object.defineProperty(i,"tokenMatcher",{enumerable:!0,get:function(){return r.tokenMatcher}}),Object.defineProperty(i,"tokenName",{enumerable:!0,get:function(){return r.tokenName}});var o=Ot();Object.defineProperty(i,"defaultParserErrorProvider",{enumerable:!0,get:function(){return o.defaultParserErrorProvider}});var s=St();Object.defineProperty(i,"EarlyExitException",{enumerable:!0,get:function(){return s.EarlyExitException}}),Object.defineProperty(i,"isRecognitionException",{enumerable:!0,get:function(){return s.isRecognitionException}}),Object.defineProperty(i,"MismatchedTokenException",{enumerable:!0,get:function(){return s.MismatchedTokenException}}),Object.defineProperty(i,"NotAllInputParsedException",{enumerable:!0,get:function(){return s.NotAllInputParsedException}}),Object.defineProperty(i,"NoViableAltException",{enumerable:!0,get:function(){return s.NoViableAltException}});var c=Yi();Object.defineProperty(i,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return c.defaultLexerErrorProvider}});var A=Ze();Object.defineProperty(i,"Alternation",{enumerable:!0,get:function(){return A.Alternation}}),Object.defineProperty(i,"Alternative",{enumerable:!0,get:function(){return A.Alternative}}),Object.defineProperty(i,"NonTerminal",{enumerable:!0,get:function(){return A.NonTerminal}}),Object.defineProperty(i,"Option",{enumerable:!0,get:function(){return A.Option}}),Object.defineProperty(i,"Repetition",{enumerable:!0,get:function(){return A.Repetition}}),Object.defineProperty(i,"RepetitionMandatory",{enumerable:!0,get:function(){return A.RepetitionMandatory}}),Object.defineProperty(i,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return A.RepetitionMandatoryWithSeparator}}),Object.defineProperty(i,"RepetitionWithSeparator",{enumerable:!0,get:function(){return A.RepetitionWithSeparator}}),Object.defineProperty(i,"Rule",{enumerable:!0,get:function(){return A.Rule}}),Object.defineProperty(i,"Terminal",{enumerable:!0,get:function(){return A.Terminal}});var a=Ze();Object.defineProperty(i,"serializeGrammar",{enumerable:!0,get:function(){return a.serializeGrammar}}),Object.defineProperty(i,"serializeProduction",{enumerable:!0,get:function(){return a.serializeProduction}});var h=kt();Object.defineProperty(i,"GAstVisitor",{enumerable:!0,get:function(){return h.GAstVisitor}});function u(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API.
|
|
207
207
|
It performs no action other than printing this message.
|
|
208
|
-
Please avoid using it as it will be completely removed in the future`)}i.clearCache=u;var b=
|
|
209
|
-
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return I})();i.Parser=f});const Bt=bs();class Cs extends g.Loader{constructor(e){super(e)}load(e,t,n,r){const o=this,s=o.path===""?g.LoaderUtils.extractUrlBase(e):o.path,c=new g.FileLoader(o.manager);c.setPath(o.path),c.setRequestHeader(o.requestHeader),c.setWithCredentials(o.withCredentials),c.load(e,function(A){try{t(o.parse(A,s))}catch(a){r?r(a):console.error(a),o.manager.itemError(e)}},n,r)}parse(e,t){const n={};function r(k){const T=o(),B=new ys(T.tokens),S=new ws(T.tokenVocabulary),w=s(S.getBaseCstVisitorConstructor()),D=B.lex(k);S.input=D.tokens;const F=S.vrml();if(S.errors.length>0)throw console.error(S.errors),Error("THREE.VRMLLoader2: Parsing errors detected.");return w.visit(F)}function o(){const k=Bt.createToken,T=k({name:"RouteIdentifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*[\.][^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/}),B=k({name:"Identifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]([^\0-\x20\x22\x27\x23\x2b\x2c\x2e\x5b\x5d\x5c\x7b\x7d])*/,longer_alt:T}),S=["Anchor","Billboard","Collision","Group","Transform","Inline","LOD","Switch","AudioClip","DirectionalLight","PointLight","Script","Shape","Sound","SpotLight","WorldInfo","CylinderSensor","PlaneSensor","ProximitySensor","SphereSensor","TimeSensor","TouchSensor","VisibilitySensor","Box","Cone","Cylinder","ElevationGrid","Extrusion","IndexedFaceSet","IndexedLineSet","PointSet","Sphere","Color","Coordinate","Normal","TextureCoordinate","Appearance","FontStyle","ImageTexture","Material","MovieTexture","PixelTexture","TextureTransform","ColorInterpolator","CoordinateInterpolator","NormalInterpolator","OrientationInterpolator","PositionInterpolator","ScalarInterpolator","Background","Fog","NavigationInfo","Viewpoint","Text"],w=k({name:"Version",pattern:/#VRML.*/,longer_alt:B}),D=k({name:"NodeName",pattern:new RegExp(S.join("|")),longer_alt:B}),F=k({name:"DEF",pattern:/DEF/,longer_alt:B}),G=k({name:"USE",pattern:/USE/,longer_alt:B}),z=k({name:"ROUTE",pattern:/ROUTE/,longer_alt:B}),$=k({name:"TO",pattern:/TO/,longer_alt:B}),re=k({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),pe=k({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),ve=k({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),Me=k({name:"TrueLiteral",pattern:/TRUE/}),ye=k({name:"FalseLiteral",pattern:/FALSE/}),Be=k({name:"NullLiteral",pattern:/NULL/}),fe=k({name:"LSquare",pattern:/\[/}),Ne=k({name:"RSquare",pattern:/]/}),Pe=k({name:"LCurly",pattern:/{/}),_e=k({name:"RCurly",pattern:/}/}),ke=k({name:"Comment",pattern:/#.*/,group:Bt.Lexer.SKIPPED}),Ve=[k({name:"WhiteSpace",pattern:/[ ,\s]/,group:Bt.Lexer.SKIPPED}),D,F,G,z,$,Me,ye,Be,w,B,T,re,pe,ve,fe,Ne,Pe,_e,ke],Ye={};for(let xe=0,ge=Ve.length;xe<ge;xe++){const Ee=Ve[xe];Ye[Ee.name]=Ee}return{tokens:Ve,tokenVocabulary:Ye}}function s(k){class T extends k{constructor(){super(),this.validateVisitor()}vrml(w){const D={version:this.visit(w.version),nodes:[],routes:[]};for(let F=0,G=w.node.length;F<G;F++){const z=w.node[F];D.nodes.push(this.visit(z))}if(w.route)for(let F=0,G=w.route.length;F<G;F++){const z=w.route[F];D.routes.push(this.visit(z))}return D}version(w){return w.Version[0].image}node(w){const D={name:w.NodeName[0].image,fields:[]};if(w.field)for(let F=0,G=w.field.length;F<G;F++){const z=w.field[F];D.fields.push(this.visit(z))}return w.def&&(D.DEF=this.visit(w.def[0])),D}field(w){const D={name:w.Identifier[0].image,type:null,values:null};let F;return w.singleFieldValue&&(F=this.visit(w.singleFieldValue[0])),w.multiFieldValue&&(F=this.visit(w.multiFieldValue[0])),D.type=F.type,D.values=F.values,D}def(w){return(w.Identifier||w.NodeName)[0].image}use(w){return{USE:(w.Identifier||w.NodeName)[0].image}}singleFieldValue(w){return B(this,w)}multiFieldValue(w){return B(this,w)}route(w){return{FROM:w.RouteIdentifier[0].image,TO:w.RouteIdentifier[1].image}}}function B(S,w){const D={type:null,values:[]};if(w.node){D.type="node";for(let F=0,G=w.node.length;F<G;F++){const z=w.node[F];D.values.push(S.visit(z))}}if(w.use){D.type="use";for(let F=0,G=w.use.length;F<G;F++){const z=w.use[F];D.values.push(S.visit(z))}}if(w.StringLiteral){D.type="string";for(let F=0,G=w.StringLiteral.length;F<G;F++){const z=w.StringLiteral[F];D.values.push(z.image.replace(/'|"/g,""))}}if(w.NumberLiteral){D.type="number";for(let F=0,G=w.NumberLiteral.length;F<G;F++){const z=w.NumberLiteral[F];D.values.push(parseFloat(z.image))}}if(w.HexLiteral){D.type="hex";for(let F=0,G=w.HexLiteral.length;F<G;F++){const z=w.HexLiteral[F];D.values.push(z.image)}}if(w.TrueLiteral){D.type="boolean";for(let F=0,G=w.TrueLiteral.length;F<G;F++)w.TrueLiteral[F].image==="TRUE"&&D.values.push(!0)}if(w.FalseLiteral){D.type="boolean";for(let F=0,G=w.FalseLiteral.length;F<G;F++)w.FalseLiteral[F].image==="FALSE"&&D.values.push(!1)}return w.NullLiteral&&(D.type="null",w.NullLiteral.forEach(function(){D.values.push(null)})),D}return new T}function c(k){const T=k.nodes,B=new g.Scene;for(let S=0,w=T.length;S<w;S++){const D=T[S];A(D)}for(let S=0,w=T.length;S<w;S++){const D=T[S],F=a(D);F instanceof g.Object3D&&B.add(F),D.name==="WorldInfo"&&(B.userData.worldInfo=F)}return B}function A(k){k.DEF&&(n[k.DEF]=k);const T=k.fields;for(let B=0,S=T.length;B<S;B++){const w=T[B];if(w.type==="node"){const D=w.values;for(let F=0,G=D.length;F<G;F++)A(D[F])}}}function a(k){return k.USE?te(k.USE):(k.build!==void 0||(k.build=h(k)),k.build)}function h(k){const T=k.name;let B;switch(T){case"Anchor":case"Group":case"Transform":case"Collision":B=u(k);break;case"Background":B=b(k);break;case"Shape":B=f(k);break;case"Appearance":B=I(k);break;case"Material":B=E(k);break;case"ImageTexture":B=C(k);break;case"PixelTexture":B=p(k);break;case"TextureTransform":B=m(k);break;case"IndexedFaceSet":B=M(k);break;case"IndexedLineSet":B=x(k);break;case"PointSet":B=R(k);break;case"Box":B=N(k);break;case"Cone":B=L(k);break;case"Cylinder":B=W(k);break;case"Sphere":B=J(k);break;case"ElevationGrid":B=K(k);break;case"Extrusion":B=ee(k);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":B=y(k);break;case"WorldInfo":B=Q(k);break;case"DirectionalLight":B=_(k);break;case"PointLight":B=j(k);break;case"SpotLight":B=v(k);break;case"Billboard":case"Inline":case"LOD":case"Switch":case"AudioClip":case"Script":case"Sound":case"CylinderSensor":case"PlaneSensor":case"ProximitySensor":case"SphereSensor":case"TimeSensor":case"TouchSensor":case"VisibilitySensor":case"Text":case"FontStyle":case"MovieTexture":case"ColorInterpolator":case"CoordinateInterpolator":case"NormalInterpolator":case"OrientationInterpolator":case"PositionInterpolator":case"ScalarInterpolator":case"Fog":case"NavigationInfo":case"Viewpoint":break;default:console.warn("THREE.VRMLLoader2: Unknown node:",T);break}return B!==void 0&&k.DEF!==void 0&&B.hasOwnProperty("name")===!0&&(B.name=k.DEF),B}function u(k){const T=new g.Group,B=k.fields;for(let S=0,w=B.length;S<w;S++){const D=B[S],F=D.name,G=D.values;switch(F){case"bboxCenter":break;case"bboxSize":break;case"center":break;case"children":ue(G,T);break;case"description":break;case"collide":break;case"parameter":break;case"rotation":const z=new g.Vector3(G[0],G[1],G[2]).normalize(),$=G[3];T.quaternion.setFromAxisAngle(z,$);break;case"scale":T.scale.set(G[0],G[1],G[2]);break;case"scaleOrientation":break;case"translation":T.position.set(G[0],G[1],G[2]);break;case"proxy":break;case"url":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return T}function b(k){const T=new g.Group;let B,S,w,D;const F=k.fields;for(let z=0,$=F.length;z<$;z++){const re=F[z],pe=re.name,ve=re.values;switch(pe){case"groundAngle":B=ve;break;case"groundColor":S=ve;break;case"backUrl":break;case"bottomUrl":break;case"frontUrl":break;case"leftUrl":break;case"rightUrl":break;case"topUrl":break;case"skyAngle":w=ve;break;case"skyColor":D=ve;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",pe);break}}const G=1e4;if(D){const z=new g.SphereGeometry(G,32,16),$=new g.MeshBasicMaterial({fog:!1,side:g.BackSide,depthWrite:!1,depthTest:!1});D.length>3?(Le(z,G,w,ie(D),!0),$.vertexColors=!0):$.color.setRGB(D[0],D[1],D[2],g.SRGBColorSpace);const re=new g.Mesh(z,$);T.add(re)}if(S&&S.length>0){const z=new g.SphereGeometry(G,32,16,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),$=new g.MeshBasicMaterial({fog:!1,side:g.BackSide,vertexColors:!0,depthWrite:!1,depthTest:!1});Le(z,G,B,ie(S),!1);const re=new g.Mesh(z,$);T.add(re)}return T.renderOrder=-1/0,T}function f(k){const T=k.fields;let B=new g.MeshBasicMaterial({name:g.Loader.DEFAULT_MATERIAL_NAME,color:0}),S;for(let D=0,F=T.length;D<F;D++){const G=T[D],z=G.name,$=G.values;switch(z){case"appearance":$[0]!==null&&(B=a($[0]));break;case"geometry":$[0]!==null&&(S=a($[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}let w;if(S&&S.attributes.position){const D=S._type;if(D==="points"){const F=new g.PointsMaterial({name:g.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:B.opacity,transparent:B.transparent});S.attributes.color!==void 0?F.vertexColors=!0:B.isMeshPhongMaterial&&F.color.copy(B.emissive),w=new g.Points(S,F)}else if(D==="line"){const F=new g.LineBasicMaterial({name:g.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:B.opacity,transparent:B.transparent});S.attributes.color!==void 0?F.vertexColors=!0:B.isMeshPhongMaterial&&F.color.copy(B.emissive),w=new g.LineSegments(S,F)}else S._solid!==void 0&&(B.side=S._solid?g.FrontSide:g.DoubleSide),S.attributes.color!==void 0&&(B.vertexColors=!0),w=new g.Mesh(S,B)}else w=new g.Object3D,w.visible=!1;return w}function I(k){let T=new g.MeshPhongMaterial,B;const S=k.fields;for(let w=0,D=S.length;w<D;w++){const F=S[w],G=F.name,z=F.values;switch(G){case"material":if(z[0]!==null){const re=a(z[0]);re.diffuseColor&&T.color.copy(re.diffuseColor),re.emissiveColor&&T.emissive.copy(re.emissiveColor),re.shininess&&(T.shininess=re.shininess),re.specularColor&&T.specular.copy(re.specularColor),re.transparency&&(T.opacity=1-re.transparency),re.transparency>0&&(T.transparent=!0)}else T=new g.MeshBasicMaterial({name:g.Loader.DEFAULT_MATERIAL_NAME,color:0});break;case"texture":const $=z[0];$!==null&&($.name==="ImageTexture"||$.name==="PixelTexture"||$.USE)&&(T.map=a($));break;case"textureTransform":z[0]!==null&&(B=a(z[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",G);break}}if(T.map){if(T.map.__type){switch(T.map.__type){case nt.INTENSITY_ALPHA:T.opacity=1;break;case nt.RGB:T.color.set(16777215);break;case nt.RGBA:T.color.set(16777215),T.opacity=1;break}delete T.map.__type}B&&(T.map.center.copy(B.center),T.map.rotation=B.rotation,T.map.repeat.copy(B.scale),T.map.offset.copy(B.translation))}return T}function E(k){const T={},B=k.fields;for(let S=0,w=B.length;S<w;S++){const D=B[S],F=D.name,G=D.values;switch(F){case"ambientIntensity":break;case"diffuseColor":T.diffuseColor=new g.Color().setRGB(G[0],G[1],G[2],g.SRGBColorSpace);break;case"emissiveColor":T.emissiveColor=new g.Color().setRGB(G[0],G[1],G[2],g.SRGBColorSpace);break;case"shininess":T.shininess=G[0];break;case"specularColor":T.specularColor=new g.Color().setRGB(G[0],G[1],G[2],g.SRGBColorSpace);break;case"transparency":T.transparency=G[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return T}function l(k,T,B){let S;switch(T){case nt.INTENSITY:S=parseInt(k),B.r=S,B.g=S,B.b=S,B.a=1;break;case nt.INTENSITY_ALPHA:S=parseInt("0x"+k.substring(2,4)),B.r=S,B.g=S,B.b=S,B.a=parseInt("0x"+k.substring(4,6));break;case nt.RGB:B.r=parseInt("0x"+k.substring(2,4)),B.g=parseInt("0x"+k.substring(4,6)),B.b=parseInt("0x"+k.substring(6,8)),B.a=1;break;case nt.RGBA:B.r=parseInt("0x"+k.substring(2,4)),B.g=parseInt("0x"+k.substring(4,6)),B.b=parseInt("0x"+k.substring(6,8)),B.a=parseInt("0x"+k.substring(8,10));break}}function d(k){let T;switch(k){case 1:T=nt.INTENSITY;break;case 2:T=nt.INTENSITY_ALPHA;break;case 3:T=nt.RGB;break;case 4:T=nt.RGBA;break}return T}function p(k){let T,B=g.RepeatWrapping,S=g.RepeatWrapping;const w=k.fields;for(let D=0,F=w.length;D<F;D++){const G=w[D],z=G.name,$=G.values;switch(z){case"image":const re=$[0],pe=$[1],ve=$[2],Me=d(ve),ye=new Uint8Array(4*re*pe),Be={r:0,g:0,b:0,a:0};for(let fe=3,Ne=0,Pe=$.length;fe<Pe;fe++,Ne++){l($[fe],Me,Be);const _e=Ne*4;ye[_e+0]=Be.r,ye[_e+1]=Be.g,ye[_e+2]=Be.b,ye[_e+3]=Be.a}T=new g.DataTexture(ye,re,pe),T.colorSpace=g.SRGBColorSpace,T.needsUpdate=!0,T.__type=Me;break;case"repeatS":$[0]===!1&&(B=g.ClampToEdgeWrapping);break;case"repeatT":$[0]===!1&&(S=g.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}return T&&(T.wrapS=B,T.wrapT=S),T}function C(k){let T,B=g.RepeatWrapping,S=g.RepeatWrapping;const w=k.fields;for(let D=0,F=w.length;D<F;D++){const G=w[D],z=G.name,$=G.values;switch(z){case"url":const re=$[0];re&&(T=Ce.load(re));break;case"repeatS":$[0]===!1&&(B=g.ClampToEdgeWrapping);break;case"repeatT":$[0]===!1&&(S=g.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}return T&&(T.wrapS=B,T.wrapT=S,T.colorSpace=g.SRGBColorSpace),T}function m(k){const T={center:new g.Vector2,rotation:new g.Vector2,scale:new g.Vector2,translation:new g.Vector2},B=k.fields;for(let S=0,w=B.length;S<w;S++){const D=B[S],F=D.name,G=D.values;switch(F){case"center":T.center.set(G[0],G[1]);break;case"rotation":T.rotation=G[0];break;case"scale":T.scale.set(G[0],G[1]);break;case"translation":T.translation.set(G[0],G[1]);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return T}function y(k){return k.fields[0].values}function Q(k){const T={},B=k.fields;for(let S=0,w=B.length;S<w;S++){const D=B[S],F=D.name,G=D.values;switch(F){case"title":T.title=G[0];break;case"info":T.info=G;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return T}function _(k){let T=0;const B=new g.Color(1,1,1),S=new g.Vector3(0,0,-1);let w=1,D=!0;const F=k.fields;for(let re=0,pe=F.length;re<pe;re++){const ve=F[re],Me=ve.name,ye=ve.values;switch(Me){case"ambientIntensity":T=ye[0];break;case"color":B.set(ye[0],ye[1],ye[2]);break;case"direction":S.set(ye[0],ye[1],ye[2]);break;case"intensity":w=ye[0];break;case"on":D=ye[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",Me);break}}w=D?w:0;const G=new g.Object3D,z=new g.DirectionalLight(B,w);S.normalize(),S.multiplyScalar(-10),z.position.copy(S),G.add(z);const $=new g.AmbientLight(B,w*T);return G.add($),G}function j(k){let T=0;const B=new g.Vector3(1,0,0),S=new g.Color(1,1,1);let w=1;const D=new g.Vector3(0,0,0);let F=!0,G=100;const z=k.fields;for(let ve=0,Me=z.length;ve<Me;ve++){const ye=z[ve],Be=ye.name,fe=ye.values;switch(Be){case"ambientIntensity":T=fe[0];break;case"attenuation":B.set(fe[0],fe[1],fe[2]);break;case"color":S.set(fe[0],fe[1],fe[2]);break;case"intensity":w=fe[0];break;case"location":D.set(fe[0],fe[1],fe[2]);break;case"on":F=fe[0];break;case"radius":G=fe[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",Be);break}}w=F?w:0;const $=new g.Object3D,re=new g.PointLight(S,w,G);re.position.copy(D),re.decay=2,$.add(re);const pe=new g.AmbientLight(S,w*T);return $.add(pe),$}function v(k){let T=0;const B=new g.Vector3(1,0,0);let S=1.570796;const w=new g.Color(1,1,1);let D=.785398;const F=new g.Vector3(0,0,-1);let G=1;const z=new g.Vector3(0,0,-1);let $=!0,re=100;const pe=k.fields;for(let fe=0,Ne=pe.length;fe<Ne;fe++){const Pe=pe[fe],_e=Pe.name,ke=Pe.values;switch(_e){case"ambientIntensity":T=ke[0];break;case"attenuation":B.set(ke[0],ke[1],ke[2]);break;case"beamWidth":S=ke[0];break;case"color":w.set(ke[0],ke[1],ke[2]);break;case"cutOffAngle":D=ke[0];break;case"direction":F.set(ke[0],ke[1],ke[2]);break;case"intensity":G=ke[0];break;case"location":z.set(ke[0],ke[1],ke[2]);break;case"on":$=ke[0];break;case"radius":re=ke[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",_e);break}}G=$?G:0;const ve=new g.Object3D;S=S>D?D:S;const Me=1-S/D,ye=new g.SpotLight(w,G,re,D,Me);F.normalize(),F.multiplyScalar(-.1),ye.position.copy(F),ye.decay=2,ve.add(ye);const Be=new g.AmbientLight(w,G*T);return ve.add(Be),ve.position.copy(z),ve}function M(k){let T,B,S,w,D=!0,F=!0,G=0,z,$,re,pe,ve=!0,Me=!0;const ye=k.fields;for(let Ge=0,Ve=ye.length;Ge<Ve;Ge++){const Ye=ye[Ge],xe=Ye.name,ge=Ye.values;switch(xe){case"color":const Ee=ge[0];Ee!==null&&(T=a(Ee));break;case"coord":const he=ge[0];he!==null&&(B=a(he));break;case"normal":const me=ge[0];me!==null&&(S=a(me));break;case"texCoord":const be=ge[0];be!==null&&(w=a(be));break;case"ccw":D=ge[0];break;case"colorIndex":z=ge;break;case"colorPerVertex":ve=ge[0];break;case"convex":break;case"coordIndex":$=ge;break;case"creaseAngle":G=ge[0];break;case"normalIndex":re=ge;break;case"normalPerVertex":Me=ge[0];break;case"solid":F=ge[0];break;case"texCoordIndex":pe=ge;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",xe);break}}if($===void 0)return console.warn("THREE.VRMLLoader2: Missing coordIndex."),new g.BufferGeometry;const Be=oe($,D);let fe,Ne,Pe;if(T){if(ve===!0)if(z&&z.length>0){const Ge=oe(z,D);fe=Re(Be,Ge,T,3)}else fe=ze(Be,new g.Float32BufferAttribute(T,3));else if(z&&z.length>0){const Ge=Ae(T,z),Ve=ae(Ge,$);fe=Fe(Be,Ve)}else{const Ge=ae(T,$);fe=Fe(Be,Ge)}de(fe)}if(S)if(Me===!0)if(re&&re.length>0){const Ge=oe(re,D);Ne=Re(Be,Ge,S,3)}else Ne=ze(Be,new g.Float32BufferAttribute(S,3));else if(re&&re.length>0){const Ge=Ae(S,re),Ve=ae(Ge,$);Ne=Fe(Be,Ve)}else{const Ge=ae(S,$);Ne=Fe(Be,Ge)}else Ne=Y(Be,B,G);if(w)if(pe&&pe.length>0){const Ge=oe(pe,D);Pe=Re(Be,Ge,w,2)}else Pe=ze(Be,new g.Float32BufferAttribute(w,2));const _e=new g.BufferGeometry,ke=ze(Be,new g.Float32BufferAttribute(B,3));return _e.setAttribute("position",ke),_e.setAttribute("normal",Ne),fe&&_e.setAttribute("color",fe),Pe&&_e.setAttribute("uv",Pe),_e._solid=F,_e._type="mesh",_e}function x(k){let T,B,S,w,D=!0;const F=k.fields;for(let pe=0,ve=F.length;pe<ve;pe++){const Me=F[pe],ye=Me.name,Be=Me.values;switch(ye){case"color":const fe=Be[0];fe!==null&&(T=a(fe));break;case"coord":const Ne=Be[0];Ne!==null&&(B=a(Ne));break;case"colorIndex":S=Be;break;case"colorPerVertex":D=Be[0];break;case"coordIndex":w=Be;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",ye);break}}let G;const z=Ie(w);if(T){if(D===!0)if(S.length>0){const pe=Ie(S);G=Re(z,pe,T,3)}else G=ze(z,new g.Float32BufferAttribute(T,3));else if(S.length>0){const pe=Ae(T,S),ve=U(pe,w);G=We(z,ve)}else{const pe=U(T,w);G=We(z,pe)}de(G)}const $=new g.BufferGeometry,re=ze(z,new g.Float32BufferAttribute(B,3));return $.setAttribute("position",re),G&&$.setAttribute("color",G),$._type="line",$}function R(k){let T,B;const S=k.fields;for(let D=0,F=S.length;D<F;D++){const G=S[D],z=G.name,$=G.values;switch(z){case"color":const re=$[0];re!==null&&(T=a(re));break;case"coord":const pe=$[0];pe!==null&&(B=a(pe));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}const w=new g.BufferGeometry;if(w.setAttribute("position",new g.Float32BufferAttribute(B,3)),T){const D=new g.Float32BufferAttribute(T,3);de(D),w.setAttribute("color",D)}return w._type="points",w}function N(k){const T=new g.Vector3(2,2,2),B=k.fields;for(let w=0,D=B.length;w<D;w++){const F=B[w],G=F.name,z=F.values;G==="size"?(T.x=z[0],T.y=z[1],T.z=z[2]):console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new g.BoxGeometry(T.x,T.y,T.z)}function L(k){let T=1,B=2,S=!1;const w=k.fields;for(let F=0,G=w.length;F<G;F++){const z=w[F],$=z.name,re=z.values;switch($){case"bottom":S=!re[0];break;case"bottomRadius":T=re[0];break;case"height":B=re[0];break;case"side":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",$);break}}return new g.ConeGeometry(T,B,16,1,S)}function W(k){let T=1,B=2;const S=k.fields;for(let D=0,F=S.length;D<F;D++){const G=S[D],z=G.name,$=G.values;switch(z){case"bottom":break;case"radius":T=$[0];break;case"height":B=$[0];break;case"side":break;case"top":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",z);break}}return new g.CylinderGeometry(T,T,B,16,1)}function J(k){let T=1;const B=k.fields;for(let w=0,D=B.length;w<D;w++){const F=B[w],G=F.name,z=F.values;G==="radius"?T=z[0]:console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new g.SphereGeometry(T,16,16)}function K(k){let T,B,S,w,D=!0,F=!0,G=!0,z=!0,$=0,re=2,pe=2,ve=1,Me=1;const ye=k.fields;for(let ge=0,Ee=ye.length;ge<Ee;ge++){const he=ye[ge],me=he.name,be=he.values;switch(me){case"color":const je=be[0];je!==null&&(T=a(je));break;case"normal":const ct=be[0];ct!==null&&(B=a(ct));break;case"texCoord":const lt=be[0];lt!==null&&(S=a(lt));break;case"height":w=be;break;case"ccw":z=be[0];break;case"colorPerVertex":D=be[0];break;case"creaseAngle":$=be[0];break;case"normalPerVertex":F=be[0];break;case"solid":G=be[0];break;case"xDimension":re=be[0];break;case"xSpacing":ve=be[0];break;case"zDimension":pe=be[0];break;case"zSpacing":Me=be[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",me);break}}const Be=[],fe=[],Ne=[],Pe=[];for(let ge=0;ge<pe;ge++)for(let Ee=0;Ee<re;Ee++){const he=ge*re+Ee,me=ve*ge,be=w[he],je=Me*Ee;if(Be.push(me,be,je),T&&D===!0){const ct=T[he*3+0],lt=T[he*3+1],Pt=T[he*3+2];Ne.push(ct,lt,Pt)}if(B&&F===!0){const ct=B[he*3+0],lt=B[he*3+1],Pt=B[he*3+2];fe.push(ct,lt,Pt)}if(S){const ct=S[he*2+0],lt=S[he*2+1];Pe.push(ct,lt)}else Pe.push(ge/(re-1),Ee/(pe-1))}const _e=[];for(let ge=0;ge<re-1;ge++)for(let Ee=0;Ee<pe-1;Ee++){const he=ge+Ee*re,me=ge+(Ee+1)*re,be=ge+1+(Ee+1)*re,je=ge+1+Ee*re;z===!0?(_e.push(he,be,me),_e.push(be,he,je)):(_e.push(he,me,be),_e.push(be,je,he))}const ke=ze(_e,new g.Float32BufferAttribute(Be,3)),Ge=ze(_e,new g.Float32BufferAttribute(Pe,2));let Ve,Ye;if(T){if(D===!1){for(let ge=0;ge<re-1;ge++)for(let Ee=0;Ee<pe-1;Ee++){const he=ge+Ee*(re-1),me=T[he*3+0],be=T[he*3+1],je=T[he*3+2];Ne.push(me,be,je),Ne.push(me,be,je),Ne.push(me,be,je),Ne.push(me,be,je),Ne.push(me,be,je),Ne.push(me,be,je)}Ve=new g.Float32BufferAttribute(Ne,3)}else Ve=ze(_e,new g.Float32BufferAttribute(Ne,3));de(Ve)}if(B)if(F===!1){for(let ge=0;ge<re-1;ge++)for(let Ee=0;Ee<pe-1;Ee++){const he=ge+Ee*(re-1),me=B[he*3+0],be=B[he*3+1],je=B[he*3+2];fe.push(me,be,je),fe.push(me,be,je),fe.push(me,be,je),fe.push(me,be,je),fe.push(me,be,je),fe.push(me,be,je)}Ye=new g.Float32BufferAttribute(fe,3)}else Ye=ze(_e,new g.Float32BufferAttribute(fe,3));else Ye=Y(_e,Be,$);const xe=new g.BufferGeometry;return xe.setAttribute("position",ke),xe.setAttribute("normal",Ye),xe.setAttribute("uv",Ge),Ve&&xe.setAttribute("color",Ve),xe._solid=G,xe._type="mesh",xe}function ee(k){let T=[1,1,1,-1,-1,-1,-1,1,1,1],B=[0,0,0,0,1,0],S,w,D=!0,F=!0,G=0,z=!0,$=!0;const re=k.fields;for(let xe=0,ge=re.length;xe<ge;xe++){const Ee=re[xe],he=Ee.name,me=Ee.values;switch(he){case"beginCap":D=me[0];break;case"ccw":F=me[0];break;case"convex":break;case"creaseAngle":G=me[0];break;case"crossSection":T=me;break;case"endCap":z=me[0];break;case"orientation":w=me;break;case"scale":S=me;break;case"solid":$=me[0];break;case"spine":B=me;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",he);break}}const pe=T[0]===T[T.length-2]&&T[1]===T[T.length-1],ve=[],Me=new g.Vector3,ye=new g.Vector3,Be=new g.Vector3,fe=new g.Vector3,Ne=new g.Quaternion;for(let xe=0,ge=0,Ee=0,he=B.length;xe<he;xe+=3,ge+=2,Ee+=4){Me.fromArray(B,xe),ye.x=S?S[ge+0]:1,ye.y=1,ye.z=S?S[ge+1]:1,Be.x=w?w[Ee+0]:0,Be.y=w?w[Ee+1]:0,Be.z=w?w[Ee+2]:1;const me=w?w[Ee+3]:0;for(let be=0,je=T.length;be<je;be+=2)fe.x=T[be+0],fe.y=0,fe.z=T[be+1],fe.multiply(ye),Ne.setFromAxisAngle(Be,me),fe.applyQuaternion(Ne),fe.add(Me),ve.push(fe.x,fe.y,fe.z)}const Pe=[],_e=B.length/3,ke=T.length/2;for(let xe=0;xe<_e-1;xe++)for(let ge=0;ge<ke-1;ge++){const Ee=ge+xe*ke;let he=ge+1+xe*ke;const me=ge+(xe+1)*ke;let be=ge+1+(xe+1)*ke;ge===ke-2&&pe===!0&&(he=xe*ke,be=(xe+1)*ke),F===!0?(Pe.push(Ee,he,me),Pe.push(me,he,be)):(Pe.push(Ee,me,he),Pe.push(me,be,he))}if(D===!0||z===!0){const xe=[];for(let he=0,me=T.length;he<me;he+=2)xe.push(new g.Vector2(T[he],T[he+1]));const ge=g.ShapeUtils.triangulateShape(xe,[]),Ee=[];for(let he=0,me=ge.length;he<me;he++){const be=ge[he];Ee.push(be[0],be[1],be[2])}if(D===!0)for(let he=0,me=Ee.length;he<me;he+=3)F===!0?Pe.push(Ee[he+0],Ee[he+1],Ee[he+2]):Pe.push(Ee[he+0],Ee[he+2],Ee[he+1]);if(z===!0){const he=ke*(_e-1);for(let me=0,be=Ee.length;me<be;me+=3)F===!0?Pe.push(he+Ee[me+0],he+Ee[me+2],he+Ee[me+1]):Pe.push(he+Ee[me+0],he+Ee[me+1],he+Ee[me+2])}}const Ge=ze(Pe,new g.Float32BufferAttribute(ve,3)),Ve=Y(Pe,ve,G),Ye=new g.BufferGeometry;return Ye.setAttribute("position",Ge),Ye.setAttribute("normal",Ve),Ye._solid=$,Ye._type="mesh",Ye}function te(k){const T=n[k],B=a(T);return B.isObject3D||B.isMaterial?B.clone():B}function ue(k,T){for(let B=0,S=k.length;B<S;B++){const w=a(k[B]);w instanceof g.Object3D&&T.add(w)}}function oe(k,T){const B=[];let S=0;for(let w=0,D=k.length;w<D;w++){const F=k[S],G=k[w+(T?1:2)],z=k[w+(T?2:1)];B.push(F,G,z),(k[w+3]===-1||w+3>=D)&&(w+=3,S=w+1)}return B}function ae(k,T){const B=[];let S=0;for(let w=0,D=T.length;w<D;w++){const F=S*3,G=k[F],z=k[F+1],$=k[F+2];B.push(G,z,$),(T[w+3]===-1||w+3>=D)&&(w+=3,S++)}return B}function Ae(k,T){const B=[];for(let S=0,w=T.length;S<w;S++){const F=T[S]*3,G=k[F],z=k[F+1],$=k[F+2];B.push(G,z,$)}return B}function Ie(k){const T=[];for(let B=0,S=k.length;B<S;B++){const w=k[B],D=k[B+1];T.push(w,D),(k[B+2]===-1||B+2>=S)&&(B+=2)}return T}function U(k,T){const B=[];let S=0;for(let w=0,D=T.length;w<D;w++){const F=S*3,G=k[F],z=k[F+1],$=k[F+2];B.push(G,z,$),(T[w+2]===-1||w+2>=D)&&(w+=2,S++)}return B}const P=new g.Vector3,q=new g.Vector3,X=new g.Vector3,ne=new g.Vector2,le=new g.Vector2,we=new g.Vector2;function Re(k,T,B,S){const w=[];for(let D=0,F=k.length;D<F;D+=3){const G=T[D],z=T[D+1],$=T[D+2];S===2?(ne.fromArray(B,G*S),le.fromArray(B,z*S),we.fromArray(B,$*S),w.push(ne.x,ne.y),w.push(le.x,le.y),w.push(we.x,we.y)):(P.fromArray(B,G*S),q.fromArray(B,z*S),X.fromArray(B,$*S),w.push(P.x,P.y,P.z),w.push(q.x,q.y,q.z),w.push(X.x,X.y,X.z))}return new g.Float32BufferAttribute(w,S)}function Fe(k,T){const B=[];for(let S=0,w=0,D=k.length;S<D;S+=3,w++)P.fromArray(T,w*3),B.push(P.x,P.y,P.z),B.push(P.x,P.y,P.z),B.push(P.x,P.y,P.z);return new g.Float32BufferAttribute(B,3)}function We(k,T){const B=[];for(let S=0,w=0,D=k.length;S<D;S+=2,w++)P.fromArray(T,w*3),B.push(P.x,P.y,P.z),B.push(P.x,P.y,P.z);return new g.Float32BufferAttribute(B,3)}function ze(k,T){const B=T.array,S=T.itemSize,w=new B.constructor(k.length*S);let D=0,F=0;for(let G=0,z=k.length;G<z;G++){D=k[G]*S;for(let $=0;$<S;$++)w[F++]=B[D++]}return new g.Float32BufferAttribute(w,S)}const Ke=new g.Vector3,O=new g.Vector3;function Y(k,T,B){const S=[],w={};for(let F=0,G=k.length;F<G;F+=3){const z=k[F],$=k[F+1],re=k[F+2],pe=new Ts(z,$,re);P.fromArray(T,z*3),q.fromArray(T,$*3),X.fromArray(T,re*3),O.subVectors(X,q),Ke.subVectors(P,q),O.cross(Ke),O.normalize(),pe.normal.copy(O),w[z]===void 0&&(w[z]=[]),w[$]===void 0&&(w[$]=[]),w[re]===void 0&&(w[re]=[]),w[z].push(pe.normal),w[$].push(pe.normal),w[re].push(pe.normal),S.push(pe)}const D=[];for(let F=0,G=S.length;F<G;F++){const z=S[F],$=V(w[z.a],z.normal,B),re=V(w[z.b],z.normal,B),pe=V(w[z.c],z.normal,B);P.fromArray(T,z.a*3),q.fromArray(T,z.b*3),X.fromArray(T,z.c*3),D.push($.x,$.y,$.z),D.push(re.x,re.y,re.z),D.push(pe.x,pe.y,pe.z)}return new g.Float32BufferAttribute(D,3)}function V(k,T,B){const S=new g.Vector3;if(B===0)S.copy(T);else for(let w=0,D=k.length;w<D;w++)k[w].angleTo(T)<B&&S.add(k[w]);return S.normalize()}function ie(k){const T=[];for(let B=0,S=k.length;B<S;B+=3)T.push(new g.Color(k[B],k[B+1],k[B+2]));return T}function de(k){const T=new g.Color;for(let B=0;B<k.count;B++)T.fromBufferAttribute(k,B),g.ColorManagement.colorSpaceToWorking(T,g.SRGBColorSpace),k.setXYZ(B,T.r,T.g,T.b)}function Le(k,T,B,S,w){const D=[],F=w===!0?0:Math.PI;for(let ve=0,Me=S.length;ve<Me;ve++){let ye=ve===0?0:B[ve-1];ye=w===!0?ye:F-ye;const Be=new g.Vector3;Be.setFromSphericalCoords(T,ye,0),D.push(Be)}const G=k.index,z=k.attributes.position,$=new g.BufferAttribute(new Float32Array(k.attributes.position.count*3),3),re=new g.Vector3,pe=new g.Color;for(let ve=0;ve<G.count;ve++){const Me=G.getX(ve);re.fromBufferAttribute(z,Me);let ye,Be,fe=1;for(let _e=1;_e<D.length;_e++){ye=_e-1,Be=_e;const ke=D[ye],Ge=D[Be];if(w===!0){if(re.y<=ke.y&&re.y>Ge.y){fe=Math.abs(ke.y-re.y)/Math.abs(ke.y-Ge.y);break}}else if(re.y>=ke.y&&re.y<Ge.y){fe=Math.abs(ke.y-re.y)/Math.abs(ke.y-Ge.y);break}}const Ne=S[ye],Pe=S[Be];pe.copy(Ne).lerp(Pe,fe),g.ColorManagement.colorSpaceToWorking(pe,g.SRGBColorSpace),$.setXYZ(Me,pe.r,pe.g,pe.b)}k.setAttribute("color",$)}const Ce=new g.TextureLoader(this.manager);if(Ce.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),e.indexOf("#VRML V2.0")===-1)throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");const ce=r(e);return c(ce)}}class ys{constructor(e){this.lexer=new Bt.Lexer(e)}lex(e){const t=this.lexer.tokenize(e);if(t.errors.length>0)throw console.error(t.errors),Error("THREE.VRMLLexer: Lexing errors detected.");return t}}const Bs=Bt.CstParser;class ws extends Bs{constructor(e){super(e);const t=this,n=e.Version,r=e.LCurly,o=e.RCurly,s=e.LSquare,c=e.RSquare,A=e.Identifier,a=e.RouteIdentifier,h=e.StringLiteral,u=e.HexLiteral,b=e.NumberLiteral,f=e.TrueLiteral,I=e.FalseLiteral,E=e.NullLiteral,l=e.DEF,d=e.USE,p=e.ROUTE,C=e.TO,m=e.NodeName;t.RULE("vrml",function(){t.SUBRULE(t.version),t.AT_LEAST_ONE(function(){t.SUBRULE(t.node)}),t.MANY(function(){t.SUBRULE(t.route)})}),t.RULE("version",function(){t.CONSUME(n)}),t.RULE("node",function(){t.OPTION(function(){t.SUBRULE(t.def)}),t.CONSUME(m),t.CONSUME(r),t.MANY(function(){t.SUBRULE(t.field)}),t.CONSUME(o)}),t.RULE("field",function(){t.CONSUME(A),t.OR2([{ALT:function(){t.SUBRULE(t.singleFieldValue)}},{ALT:function(){t.SUBRULE(t.multiFieldValue)}}])}),t.RULE("def",function(){t.CONSUME(l),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(m)}}])}),t.RULE("use",function(){t.CONSUME(d),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(m)}}])}),t.RULE("singleFieldValue",function(){t.AT_LEAST_ONE(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(h)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(b)}},{ALT:function(){t.CONSUME(f)}},{ALT:function(){t.CONSUME(I)}},{ALT:function(){t.CONSUME(E)}}])})}),t.RULE("multiFieldValue",function(){t.CONSUME(s),t.MANY(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(h)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(b)}},{ALT:function(){t.CONSUME(E)}}])}),t.CONSUME(c)}),t.RULE("route",function(){t.CONSUME(p),t.CONSUME(a),t.CONSUME(C),t.CONSUME2(a)}),this.performSelfAnalysis()}}class Ts{constructor(e,t,n){this.a=e,this.b=t,this.c=n,this.normal=new g.Vector3}}const nt={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};class Rs extends g.Loader{constructor(e){super(e),this.animateBonePositions=!0,this.animateBoneRotations=!0,this.animateBoneScales=!0}load(e,t,n,r){const o=this,s=new g.FileLoader(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(c){try{t(o.parse(c))}catch(A){r?r(A):console.error(A),o.manager.itemError(e)}},n,r)}parse(e){function t(f){c(f)!=="HIERARCHY"&&console.error("THREE.BVHLoader2: HIERARCHY expected.");const I=[],E=r(f,c(f),I);c(f)!=="MOTION"&&console.error("THREE.BVHLoader2: MOTION expected.");let l=c(f).split(/[\s]+/);const d=parseInt(l[1]);isNaN(d)&&console.error("THREE.BVHLoader2: Failed to read number of frames."),l=c(f).split(/[\s]+/);const p=parseFloat(l[2]);isNaN(p)&&console.error("THREE.BVHLoader2: Failed to read frame time.");for(let C=0;C<d;C++)l=c(f).split(/[\s]+/),n(l,C*p,E);return I}function n(f,I,E){if(E.type==="ENDSITE")return;const l={time:I,position:new g.Vector3,rotation:new g.Quaternion,scale:new g.Vector3(1,1,1)};E.frames.push(l);const d=new g.Quaternion,p=new g.Vector3(1,0,0),C=new g.Vector3(0,1,0),m=new g.Vector3(0,0,1);for(let y=0;y<E.channels.length;y++)switch(E.channels[y]){case"Xposition":l.position.x=parseFloat(f.shift().trim());break;case"Yposition":l.position.y=parseFloat(f.shift().trim());break;case"Zposition":l.position.z=parseFloat(f.shift().trim());break;case"Xrotation":d.setFromAxisAngle(p,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(d);break;case"Yrotation":d.setFromAxisAngle(C,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(d);break;case"Zrotation":d.setFromAxisAngle(m,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(d);break;case"Xscale":l.scale.x=parseFloat(f.shift().trim());break;case"Yscale":l.scale.y=parseFloat(f.shift().trim());break;case"Zscale":l.scale.z=parseFloat(f.shift().trim());break;default:console.warn("THREE.BVHLoader2: Invalid channel type.")}for(let y=0;y<E.children.length;y++)n(f,I,E.children[y])}function r(f,I,E){const l={name:"",type:"",frames:[]};E.push(l);let d=I.split(/[\s]+/);d[0].toUpperCase()==="END"&&d[1].toUpperCase()==="SITE"?(l.type="ENDSITE",l.name="ENDSITE"):(l.name=d[1],l.type=d[0].toUpperCase()),c(f)!=="{"&&console.error("THREE.BVHLoader2: Expected opening { after type & name"),d=c(f).split(/[\s]+/),d[0]!=="OFFSET"&&console.error("THREE.BVHLoader2: Expected OFFSET but got: "+d[0]),d.length!==4&&console.error("THREE.BVHLoader2: Invalid number of values for OFFSET.");const p=new g.Vector3(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));if((isNaN(p.x)||isNaN(p.y)||isNaN(p.z))&&console.error("THREE.BVHLoader2: Invalid values of OFFSET."),l.offset=p,l.type!=="ENDSITE"){d=c(f).split(/[\s]+/),d[0]!=="CHANNELS"&&console.error("THREE.BVHLoader2: Expected CHANNELS definition.");const C=parseInt(d[1]);l.channels=d.splice(2,C),l.children=[]}for(;;){const C=c(f);if(C==="}")return l;l.children.push(r(f,C,E))}}function o(f,I){const E=new g.Bone;if(I.push(E),E.position.add(f.offset),E.name=f.name,f.type!=="ENDSITE")for(let l=0;l<f.children.length;l++)E.add(o(f.children[l],I));return E}function s(f){const I=[];for(let E=0;E<f.length;E++){const l=f[E];if(l.type==="ENDSITE")continue;const d=[],p=[],C=[],m=[];for(let y=0;y<l.frames.length;y++){const Q=l.frames[y];d.push(Q.time),p.push(Q.position.x+l.offset.x),p.push(Q.position.y+l.offset.y),p.push(Q.position.z+l.offset.z),C.push(Q.rotation.x),C.push(Q.rotation.y),C.push(Q.rotation.z),C.push(Q.rotation.w),m.push(Q.scale.x),m.push(Q.scale.y),m.push(Q.scale.z)}A.animateBonePositions&&I.push(new g.VectorKeyframeTrack(l.name+".position",d,p)),A.animateBoneRotations&&I.push(new g.QuaternionKeyframeTrack(l.name+".quaternion",d,C)),A.animateBoneScales&&I.push(new g.VectorKeyframeTrack(l.name+".scale",d,m))}return new g.AnimationClip("animation",-1,I)}function c(f){let I;for(;(I=f.shift().trim()).length===0;);return I}const A=this,a=e.split(/[\r\n]+/g),h=t(a),u=[];o(h[0],u);const b=s(h);return{skeleton:new g.Skeleton(u),clip:b}}}let yt;async function vs(i,e){yt||(yt=new Cs),yt.manager.setURLModifier(n=>(n.startsWith("./")&&(n=n.substring(2)),URL.createObjectURL(qn(i,n))));const t=await yt.loadAsync(e);return yt.manager.setURLModifier(n=>n),t}let Jt;async function Qs(i,e){Jt||(Jt=new Rs);const t=cn(i,e);return await Jt.parse(t)}function ks(i){const e=i.clip.clone(),t=i.skeleton.bones[0].clone(!0),n=[];t.traverse(o=>{o instanceof se.Bone&&n.push(o)});const r=new se.Skeleton(n);return r.calculateInverses(),{clip:e,skeleton:r}}class On{isDummy=!0;skeleton=new se.Skeleton([new se.Bone]);clip=new se.AnimationClip("dummy")}const Xt={},Zt={};class Ss extends Rt{comment=null;constructor(e){super(e)}async asyncInit(e){const t=await Hn(e),n=new DOMParser,r=cn(t,"CATALOG.XML"),o=n.parseFromString(r,"application/xml");if(o.querySelector("parsererror"))return console.error("Acerola3D.asyncInit(): CATALOG.XML parse error."),this;const s="http://acerola3d.sourceforge.jp/a3/catalog",c=o.getElementsByTagNameNS(s,"c");c[0]&&(this.comment=c[0].textContent);const A=o.getElementsByTagNameNS(s,"a"),a={};let h;for(const u of Array.from(A)){const b=u.getAttribute("an");if(b){h||(h=b);let f;const I=u.getAttribute("bvh");if(I){const R=t.zipUrl+"!"+I;Xt[R]||(Xt[R]=await Qs(t,I)),f=ks(Xt[R]),f&&f.clip.tracks.forEach(N=>{N.setInterpolation(se.InterpolateDiscrete)})}else f=new On;const E={};f.skeleton.bones.forEach(R=>{E[R.name]=R});const l=u.getAttribute("scale"),d=l?Number(l):1,p=u.getAttribute("offset"),C=new Z;if(p){const R=p.split(" ");C.set(Number(R[0]),Number(R[1]),Number(R[2]))}const m=u.getAttribute("rot"),y=new Z;if(m){const R=m.split(" ");y.set(Number(R[0]),Number(R[1]),Number(R[2]))}const Q={},_=u.getElementsByTagNameNS(s,"p");for(const R of Array.from(_)){const N=R.getAttribute("name"),L=R.getAttribute("wrl");if(N&&L){const W=t.zipUrl+"!"+L;Zt[W]||(Zt[W]=await vs(t,L)),Q[N]=Zt[W].clone(!0)}}const j=new se.Object3D;j.add(f.skeleton.bones[0]),f instanceof On?Object.values(Q).forEach(R=>{j.add(R)}):$i(j,Q),j.scale.set(d,d,d),y.scale(Math.PI/180),j.setRotationFromEuler(new se.Euler(y.x,y.y,y.z,"YXZ")),j.position.add(C),j.traverse(R=>{R.userData.a3js={objectA3:this}});let v,M=!0;const x=u.getElementsByTagNameNS(s,"s");if(x[0]){const R=x[0].getAttribute("file"),N=x[0].getAttribute("type")||"PointSound",L=x[0].getAttribute("loop")||"false",W=x[0].getAttribute("gain")||"1.0",J=x[0].getAttribute("offset")||"0.0 0.0 0.0",K=x[0].getAttribute("direction")||"0.0 0.0 1.0";M=(x[0].getAttribute("continue")||"true")==="true";const te=J.split(" ").map(q=>Number(q)),ue=new Z(te[0],te[1],te[2]),oe=K.split(" ").map(q=>Number(q)),ae=new Z(oe[0],oe[1],oe[2]),Ae=N==="PointSound"||N==="ConeSound"?"positional":"audio",P=N==="PointSound"?{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}:{coneInnerAngle:30,coneOuterAngle:90,coneOuterGain:.1};if(R){const q=qn(t,R),X=URL.createObjectURL(q),ne={type:Ae,loop:L==="true",volume:Number(W),positional:{directional:P}};v=await new at(X,ne).ready,v.setLocation(ue),v.lookAt(ae),URL.revokeObjectURL(X),j.add(v.object)}}a[b]={name:b,shape:{root:j,bones:E,skeleton:f.skeleton},motion:new un(f.clip,b),sound:v,soundContinue:M}}}return h&&this.syncInit(h,a),this}}function $i(i,e){if(Tr(i)){const t=e[i.name];t&&i.add(t)}i.children&&i.children.forEach(t=>{$i(t,e)})}class Ls extends Oe{constructor(e){super(e)}initObject(e){return e}}class _s extends Oe{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),r=new se.BoxGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new se.MeshStandardMaterial({color:o});return new se.Mesh(r,s)}}class xs extends Oe{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),r=new se.SphereGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new se.MeshStandardMaterial({color:o});return new se.Mesh(r,s)}}class Ns extends Oe{constructor(){super()}initObject(){const e=new se.Object3D,t=new se.DirectionalLight(16777215);t.position.set(1,1,1),e.add(t);const n=new se.AmbientLight(4210752);return e.add(n),e}}class Ds extends Oe{constructor(e){super(e)}initObject(e){const t=new se.PlaneGeometry(1,1),n=new se.TextureLoader().load(e),r=new se.MeshBasicMaterial({map:n});return new se.Mesh(t,r)}}class Fs extends Oe{constructor(e){super(e)}initObject(e){return new Yn(e)}}const er={touchDevice:navigator.maxTouchPoints>0};class tr extends HTMLElement{options;canvas;scene;camera;controller;_maxDistance;_leftActive;_leftCenter;leftJoystick;_rightActive;_rightCenter;rightJoystick;leftButton;rightButton;keys;_ro;constructor(e={}){super(),this.options={...er,...e},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
208
|
+
Please avoid using it as it will be completely removed in the future`)}i.clearCache=u;var b=Cs();Object.defineProperty(i,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return b.createSyntaxDiagramsCode}});var f=(function(){function I(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
|
|
209
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return I})();i.Parser=f});const wt=ys();let An;class Bs extends g.Loader{constructor(e){super(e)}load(e,t,n,r){An=void 0;const o=this,s=o.path===""?g.LoaderUtils.extractUrlBase(e):o.path,c=new g.FileLoader(o.manager);c.setPath(o.path),c.setRequestHeader(o.requestHeader),c.setWithCredentials(o.withCredentials),c.load(e,function(A){try{t(o.parse(A,s))}catch(a){r?r(a):console.error(a),o.manager.itemError(e)}},n,r)}parse(e,t){const n={};function r(k){const T=o(),B=new ws(T.tokens),L=new Rs(T.tokenVocabulary),w=s(L.getBaseCstVisitorConstructor()),D=B.lex(k);L.input=D.tokens;const F=L.vrml();if(L.errors.length>0)throw console.error(L.errors),Error("THREE.VRMLLoader2: Parsing errors detected.");return w.visit(F)}function o(){const k=wt.createToken,T=k({name:"RouteIdentifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*[\.][^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/}),B=k({name:"Identifier",pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]([^\0-\x20\x22\x27\x23\x2b\x2c\x2e\x5b\x5d\x5c\x7b\x7d])*/,longer_alt:T}),L=["Anchor","Billboard","Collision","Group","Transform","Inline","LOD","Switch","AudioClip","DirectionalLight","PointLight","Script","Shape","Sound","SpotLight","WorldInfo","CylinderSensor","PlaneSensor","ProximitySensor","SphereSensor","TimeSensor","TouchSensor","VisibilitySensor","Box","Cone","Cylinder","ElevationGrid","Extrusion","IndexedFaceSet","IndexedLineSet","PointSet","Sphere","Color","Coordinate","Normal","TextureCoordinate","Appearance","FontStyle","ImageTexture","Material","MovieTexture","PixelTexture","TextureTransform","ColorInterpolator","CoordinateInterpolator","NormalInterpolator","OrientationInterpolator","PositionInterpolator","ScalarInterpolator","Background","Fog","NavigationInfo","Viewpoint","Text"],w=k({name:"Version",pattern:/#VRML.*/,longer_alt:B}),D=k({name:"NodeName",pattern:new RegExp(L.join("|")),longer_alt:B}),F=k({name:"DEF",pattern:/DEF/,longer_alt:B}),G=k({name:"USE",pattern:/USE/,longer_alt:B}),W=k({name:"ROUTE",pattern:/ROUTE/,longer_alt:B}),te=k({name:"TO",pattern:/TO/,longer_alt:B}),se=k({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),pe=k({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),Qe=k({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),Fe=k({name:"TrueLiteral",pattern:/TRUE/}),ge=k({name:"FalseLiteral",pattern:/FALSE/}),be=k({name:"NullLiteral",pattern:/NULL/}),he=k({name:"LSquare",pattern:/\[/}),Ne=k({name:"RSquare",pattern:/]/}),Se=k({name:"LCurly",pattern:/{/}),xe=k({name:"RCurly",pattern:/}/}),ke=k({name:"Comment",pattern:/#.*/,group:wt.Lexer.SKIPPED}),Ve=[k({name:"WhiteSpace",pattern:/[ ,\s]/,group:wt.Lexer.SKIPPED}),D,F,G,W,te,Fe,ge,be,w,B,T,se,pe,Qe,he,Ne,Se,xe,ke],Ye={};for(let De=0,me=Ve.length;De<me;De++){const Ee=Ve[De];Ye[Ee.name]=Ee}return{tokens:Ve,tokenVocabulary:Ye}}function s(k){class T extends k{constructor(){super(),this.validateVisitor()}vrml(w){const D={version:this.visit(w.version),nodes:[],routes:[]};for(let F=0,G=w.node.length;F<G;F++){const W=w.node[F];D.nodes.push(this.visit(W))}if(w.route)for(let F=0,G=w.route.length;F<G;F++){const W=w.route[F];D.routes.push(this.visit(W))}return D}version(w){return w.Version[0].image}node(w){const D={name:w.NodeName[0].image,fields:[]};if(w.field)for(let F=0,G=w.field.length;F<G;F++){const W=w.field[F];D.fields.push(this.visit(W))}return w.def&&(D.DEF=this.visit(w.def[0])),D}field(w){const D={name:w.Identifier[0].image,type:null,values:null};let F;return w.singleFieldValue&&(F=this.visit(w.singleFieldValue[0])),w.multiFieldValue&&(F=this.visit(w.multiFieldValue[0])),D.type=F.type,D.values=F.values,D}def(w){return(w.Identifier||w.NodeName)[0].image}use(w){return{USE:(w.Identifier||w.NodeName)[0].image}}singleFieldValue(w){return B(this,w)}multiFieldValue(w){return B(this,w)}route(w){return{FROM:w.RouteIdentifier[0].image,TO:w.RouteIdentifier[1].image}}}function B(L,w){const D={type:null,values:[]};if(w.node){D.type="node";for(let F=0,G=w.node.length;F<G;F++){const W=w.node[F];D.values.push(L.visit(W))}}if(w.use){D.type="use";for(let F=0,G=w.use.length;F<G;F++){const W=w.use[F];D.values.push(L.visit(W))}}if(w.StringLiteral){D.type="string";for(let F=0,G=w.StringLiteral.length;F<G;F++){const W=w.StringLiteral[F];D.values.push(W.image.replace(/'|"/g,""))}}if(w.NumberLiteral){D.type="number";for(let F=0,G=w.NumberLiteral.length;F<G;F++){const W=w.NumberLiteral[F];D.values.push(parseFloat(W.image))}}if(w.HexLiteral){D.type="hex";for(let F=0,G=w.HexLiteral.length;F<G;F++){const W=w.HexLiteral[F];D.values.push(W.image)}}if(w.TrueLiteral){D.type="boolean";for(let F=0,G=w.TrueLiteral.length;F<G;F++)w.TrueLiteral[F].image==="TRUE"&&D.values.push(!0)}if(w.FalseLiteral){D.type="boolean";for(let F=0,G=w.FalseLiteral.length;F<G;F++)w.FalseLiteral[F].image==="FALSE"&&D.values.push(!1)}return w.NullLiteral&&(D.type="null",w.NullLiteral.forEach(function(){D.values.push(null)})),D}return new T}function c(k){const T=k.nodes,B=new g.Scene;for(let L=0,w=T.length;L<w;L++){const D=T[L];A(D)}for(let L=0,w=T.length;L<w;L++){const D=T[L],F=a(D);F instanceof g.Object3D&&B.add(F),D.name==="WorldInfo"&&(B.userData.worldInfo=F)}return B}function A(k){k.DEF&&(n[k.DEF]=k);const T=k.fields;for(let B=0,L=T.length;B<L;B++){const w=T[B];if(w.type==="node"){const D=w.values;for(let F=0,G=D.length;F<G;F++)A(D[F])}}}function a(k){return k.USE?ne(k.USE):(k.build!==void 0||(k.build=h(k)),k.build)}function h(k){const T=k.name;let B;switch(T){case"Anchor":case"Group":case"Transform":case"Collision":B=u(k);break;case"Background":B=b(k);break;case"Shape":B=f(k);break;case"Appearance":B=I(k);break;case"Material":B=m(k);break;case"ImageTexture":B=C(k);break;case"PixelTexture":B=p(k);break;case"TextureTransform":B=E(k);break;case"IndexedFaceSet":B=M(k);break;case"IndexedLineSet":B=N(k);break;case"PointSet":B=v(k);break;case"Box":B=S(k);break;case"Cone":B=_(k);break;case"Cylinder":B=V(k);break;case"Sphere":B=J(k);break;case"ElevationGrid":B=q(k);break;case"Extrusion":B=$(k);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":B=y(k);break;case"WorldInfo":B=Q(k);break;case"DirectionalLight":B=x(k);break;case"PointLight":B=H(k);break;case"SpotLight":B=R(k);break;case"Billboard":case"Inline":case"LOD":case"Switch":case"AudioClip":case"Script":case"Sound":case"CylinderSensor":case"PlaneSensor":case"ProximitySensor":case"SphereSensor":case"TimeSensor":case"TouchSensor":case"VisibilitySensor":case"Text":case"FontStyle":case"MovieTexture":case"ColorInterpolator":case"CoordinateInterpolator":case"NormalInterpolator":case"OrientationInterpolator":case"PositionInterpolator":case"ScalarInterpolator":case"Fog":case"NavigationInfo":case"Viewpoint":break;default:console.warn("THREE.VRMLLoader2: Unknown node:",T);break}return B!==void 0&&k.DEF!==void 0&&B.hasOwnProperty("name")===!0&&(B.name=k.DEF),B}function u(k){const T=new g.Group,B=k.fields;for(let L=0,w=B.length;L<w;L++){const D=B[L],F=D.name,G=D.values;switch(F){case"bboxCenter":break;case"bboxSize":break;case"center":break;case"children":ue(G,T);break;case"description":break;case"collide":break;case"parameter":break;case"rotation":const W=new g.Vector3(G[0],G[1],G[2]).normalize(),te=G[3];T.quaternion.setFromAxisAngle(W,te);break;case"scale":T.scale.set(G[0],G[1],G[2]);break;case"scaleOrientation":break;case"translation":T.position.set(G[0],G[1],G[2]);break;case"proxy":break;case"url":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return T}function b(k){const T=new g.Group;let B,L,w,D,F,G,W,te,se,pe;const Qe=k.fields;for(let ge=0,be=Qe.length;ge<be;ge++){const he=Qe[ge],Ne=he.name,Se=he.values;switch(Ne){case"groundAngle":B=Se;break;case"groundColor":L=Se;break;case"backUrl":F=Se;break;case"bottomUrl":G=Se;break;case"frontUrl":W=Se;break;case"leftUrl":te=Se;break;case"rightUrl":se=Se;break;case"topUrl":pe=Se;break;case"skyAngle":w=Se;break;case"skyColor":D=Se;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Ne);break}}F&&G&&W&&te&&se&&pe&&(An=new g.CubeTextureLoader().load([se[0],te[0],pe[0],G[0],W[0],F[0]]));const Fe=1e4;if(D){const ge=new g.SphereGeometry(Fe,32,16),be=new g.MeshBasicMaterial({fog:!1,side:g.BackSide,depthWrite:!1,depthTest:!1});D.length>3?(_e(ge,Fe,w,ie(D),!0),be.vertexColors=!0):be.color.setRGB(D[0],D[1],D[2],g.SRGBColorSpace);const he=new g.Mesh(ge,be);T.add(he)}if(L&&L.length>0){const ge=new g.SphereGeometry(Fe,32,16,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),be=new g.MeshBasicMaterial({fog:!1,side:g.BackSide,vertexColors:!0,depthWrite:!1,depthTest:!1});_e(ge,Fe,B,ie(L),!1);const he=new g.Mesh(ge,be);T.add(he)}return T.renderOrder=-1/0,T}function f(k){const T=k.fields;let B=new g.MeshBasicMaterial({name:g.Loader.DEFAULT_MATERIAL_NAME,color:0}),L;for(let D=0,F=T.length;D<F;D++){const G=T[D],W=G.name,te=G.values;switch(W){case"appearance":te[0]!==null&&(B=a(te[0]));break;case"geometry":te[0]!==null&&(L=a(te[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}let w;if(L&&L.attributes.position){const D=L._type;if(D==="points"){const F=new g.PointsMaterial({name:g.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:B.opacity,transparent:B.transparent});L.attributes.color!==void 0?F.vertexColors=!0:B.isMeshPhongMaterial&&F.color.copy(B.emissive),w=new g.Points(L,F)}else if(D==="line"){const F=new g.LineBasicMaterial({name:g.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:B.opacity,transparent:B.transparent});L.attributes.color!==void 0?F.vertexColors=!0:B.isMeshPhongMaterial&&F.color.copy(B.emissive),w=new g.LineSegments(L,F)}else L._solid!==void 0&&(B.side=L._solid?g.FrontSide:g.DoubleSide),L.attributes.color!==void 0&&(B.vertexColors=!0),w=new g.Mesh(L,B)}else w=new g.Object3D,w.visible=!1;return w}function I(k){let T=new g.MeshPhongMaterial,B;const L=k.fields;for(let w=0,D=L.length;w<D;w++){const F=L[w],G=F.name,W=F.values;switch(G){case"material":if(W[0]!==null){const se=a(W[0]);se.diffuseColor&&T.color.copy(se.diffuseColor),se.emissiveColor&&T.emissive.copy(se.emissiveColor),se.shininess&&(T.shininess=se.shininess),se.specularColor&&T.specular.copy(se.specularColor),se.transparency&&(T.opacity=1-se.transparency),se.transparency>0&&(T.transparent=!0)}else T=new g.MeshBasicMaterial({name:g.Loader.DEFAULT_MATERIAL_NAME,color:0});break;case"texture":const te=W[0];te!==null&&(te.name==="ImageTexture"||te.name==="PixelTexture"||te.USE)&&(T.map=a(te));break;case"textureTransform":W[0]!==null&&(B=a(W[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",G);break}}if(T.map){if(T.map.__type){switch(T.map.__type){case nt.INTENSITY_ALPHA:T.opacity=1;break;case nt.RGB:T.color.set(16777215);break;case nt.RGBA:T.color.set(16777215),T.opacity=1;break}delete T.map.__type}B&&(T.map.center.copy(B.center),T.map.rotation=B.rotation,T.map.repeat.copy(B.scale),T.map.offset.copy(B.translation))}return T}function m(k){const T={},B=k.fields;for(let L=0,w=B.length;L<w;L++){const D=B[L],F=D.name,G=D.values;switch(F){case"ambientIntensity":break;case"diffuseColor":T.diffuseColor=new g.Color().setRGB(G[0],G[1],G[2],g.SRGBColorSpace);break;case"emissiveColor":T.emissiveColor=new g.Color().setRGB(G[0],G[1],G[2],g.SRGBColorSpace);break;case"shininess":T.shininess=G[0];break;case"specularColor":T.specularColor=new g.Color().setRGB(G[0],G[1],G[2],g.SRGBColorSpace);break;case"transparency":T.transparency=G[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return T}function l(k,T,B){let L;switch(T){case nt.INTENSITY:L=parseInt(k),B.r=L,B.g=L,B.b=L,B.a=1;break;case nt.INTENSITY_ALPHA:L=parseInt("0x"+k.substring(2,4)),B.r=L,B.g=L,B.b=L,B.a=parseInt("0x"+k.substring(4,6));break;case nt.RGB:B.r=parseInt("0x"+k.substring(2,4)),B.g=parseInt("0x"+k.substring(4,6)),B.b=parseInt("0x"+k.substring(6,8)),B.a=1;break;case nt.RGBA:B.r=parseInt("0x"+k.substring(2,4)),B.g=parseInt("0x"+k.substring(4,6)),B.b=parseInt("0x"+k.substring(6,8)),B.a=parseInt("0x"+k.substring(8,10));break}}function d(k){let T;switch(k){case 1:T=nt.INTENSITY;break;case 2:T=nt.INTENSITY_ALPHA;break;case 3:T=nt.RGB;break;case 4:T=nt.RGBA;break}return T}function p(k){let T,B=g.RepeatWrapping,L=g.RepeatWrapping;const w=k.fields;for(let D=0,F=w.length;D<F;D++){const G=w[D],W=G.name,te=G.values;switch(W){case"image":const se=te[0],pe=te[1],Qe=te[2],Fe=d(Qe),ge=new Uint8Array(4*se*pe),be={r:0,g:0,b:0,a:0};for(let he=3,Ne=0,Se=te.length;he<Se;he++,Ne++){l(te[he],Fe,be);const xe=Ne*4;ge[xe+0]=be.r,ge[xe+1]=be.g,ge[xe+2]=be.b,ge[xe+3]=be.a}T=new g.DataTexture(ge,se,pe),T.colorSpace=g.SRGBColorSpace,T.needsUpdate=!0,T.__type=Fe;break;case"repeatS":te[0]===!1&&(B=g.ClampToEdgeWrapping);break;case"repeatT":te[0]===!1&&(L=g.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}return T&&(T.wrapS=B,T.wrapT=L),T}function C(k){let T,B=g.RepeatWrapping,L=g.RepeatWrapping;const w=k.fields;for(let D=0,F=w.length;D<F;D++){const G=w[D],W=G.name,te=G.values;switch(W){case"url":const se=te[0];se&&(T=Be.load(se));break;case"repeatS":te[0]===!1&&(B=g.ClampToEdgeWrapping);break;case"repeatT":te[0]===!1&&(L=g.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}return T&&(T.wrapS=B,T.wrapT=L,T.colorSpace=g.SRGBColorSpace),T}function E(k){const T={center:new g.Vector2,rotation:new g.Vector2,scale:new g.Vector2,translation:new g.Vector2},B=k.fields;for(let L=0,w=B.length;L<w;L++){const D=B[L],F=D.name,G=D.values;switch(F){case"center":T.center.set(G[0],G[1]);break;case"rotation":T.rotation=G[0];break;case"scale":T.scale.set(G[0],G[1]);break;case"translation":T.translation.set(G[0],G[1]);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return T}function y(k){return k.fields[0].values}function Q(k){const T={},B=k.fields;for(let L=0,w=B.length;L<w;L++){const D=B[L],F=D.name,G=D.values;switch(F){case"title":T.title=G[0];break;case"info":T.info=G;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",F);break}}return T}function x(k){let T=0;const B=new g.Color(1,1,1),L=new g.Vector3(0,0,-1);let w=1,D=!0;const F=k.fields;for(let se=0,pe=F.length;se<pe;se++){const Qe=F[se],Fe=Qe.name,ge=Qe.values;switch(Fe){case"ambientIntensity":T=ge[0];break;case"color":B.set(ge[0],ge[1],ge[2]);break;case"direction":L.set(ge[0],ge[1],ge[2]);break;case"intensity":w=ge[0];break;case"on":D=ge[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",Fe);break}}w=D?w:0;const G=new g.Object3D,W=new g.DirectionalLight(B,w);L.normalize(),L.multiplyScalar(-10),W.position.copy(L),G.add(W);const te=new g.AmbientLight(B,w*T);return G.add(te),G}function H(k){let T=0;const B=new g.Vector3(1,0,0),L=new g.Color(1,1,1);let w=1;const D=new g.Vector3(0,0,0);let F=!0,G=100;const W=k.fields;for(let Qe=0,Fe=W.length;Qe<Fe;Qe++){const ge=W[Qe],be=ge.name,he=ge.values;switch(be){case"ambientIntensity":T=he[0];break;case"attenuation":B.set(he[0],he[1],he[2]);break;case"color":L.set(he[0],he[1],he[2]);break;case"intensity":w=he[0];break;case"location":D.set(he[0],he[1],he[2]);break;case"on":F=he[0];break;case"radius":G=he[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",be);break}}w=F?w:0;const te=new g.Object3D,se=new g.PointLight(L,w,G);se.position.copy(D),se.decay=2,te.add(se);const pe=new g.AmbientLight(L,w*T);return te.add(pe),te}function R(k){let T=0;const B=new g.Vector3(1,0,0);let L=1.570796;const w=new g.Color(1,1,1);let D=.785398;const F=new g.Vector3(0,0,-1);let G=1;const W=new g.Vector3(0,0,-1);let te=!0,se=100;const pe=k.fields;for(let he=0,Ne=pe.length;he<Ne;he++){const Se=pe[he],xe=Se.name,ke=Se.values;switch(xe){case"ambientIntensity":T=ke[0];break;case"attenuation":B.set(ke[0],ke[1],ke[2]);break;case"beamWidth":L=ke[0];break;case"color":w.set(ke[0],ke[1],ke[2]);break;case"cutOffAngle":D=ke[0];break;case"direction":F.set(ke[0],ke[1],ke[2]);break;case"intensity":G=ke[0];break;case"location":W.set(ke[0],ke[1],ke[2]);break;case"on":te=ke[0];break;case"radius":se=ke[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",xe);break}}G=te?G:0;const Qe=new g.Object3D;L=L>D?D:L;const Fe=1-L/D,ge=new g.SpotLight(w,G,se,D,Fe);F.normalize(),F.multiplyScalar(-.1),ge.position.copy(F),ge.decay=2,Qe.add(ge);const be=new g.AmbientLight(w,G*T);return Qe.add(be),Qe.position.copy(W),Qe}function M(k){let T,B,L,w,D=!0,F=!0,G=0,W,te,se,pe,Qe=!0,Fe=!0;const ge=k.fields;for(let Ge=0,Ve=ge.length;Ge<Ve;Ge++){const Ye=ge[Ge],De=Ye.name,me=Ye.values;switch(De){case"color":const Ee=me[0];Ee!==null&&(T=a(Ee));break;case"coord":const de=me[0];de!==null&&(B=a(de));break;case"normal":const Ie=me[0];Ie!==null&&(L=a(Ie));break;case"texCoord":const ye=me[0];ye!==null&&(w=a(ye));break;case"ccw":D=me[0];break;case"colorIndex":W=me;break;case"colorPerVertex":Qe=me[0];break;case"convex":break;case"coordIndex":te=me;break;case"creaseAngle":G=me[0];break;case"normalIndex":se=me;break;case"normalPerVertex":Fe=me[0];break;case"solid":F=me[0];break;case"texCoordIndex":pe=me;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",De);break}}if(te===void 0)return console.warn("THREE.VRMLLoader2: Missing coordIndex."),new g.BufferGeometry;const be=oe(te,D);let he,Ne,Se;if(T){if(Qe===!0)if(W&&W.length>0){const Ge=oe(W,D);he=Re(be,Ge,T,3)}else he=ze(be,new g.Float32BufferAttribute(T,3));else if(W&&W.length>0){const Ge=Ae(T,W),Ve=ae(Ge,te);he=Me(be,Ve)}else{const Ge=ae(T,te);he=Me(be,Ge)}fe(he)}if(L)if(Fe===!0)if(se&&se.length>0){const Ge=oe(se,D);Ne=Re(be,Ge,L,3)}else Ne=ze(be,new g.Float32BufferAttribute(L,3));else if(se&&se.length>0){const Ge=Ae(L,se),Ve=ae(Ge,te);Ne=Me(be,Ve)}else{const Ge=ae(L,te);Ne=Me(be,Ge)}else Ne=Y(be,B,G);if(w)if(pe&&pe.length>0){const Ge=oe(pe,D);Se=Re(be,Ge,w,2)}else Se=ze(be,new g.Float32BufferAttribute(w,2));const xe=new g.BufferGeometry,ke=ze(be,new g.Float32BufferAttribute(B,3));return xe.setAttribute("position",ke),xe.setAttribute("normal",Ne),he&&xe.setAttribute("color",he),Se&&xe.setAttribute("uv",Se),xe._solid=F,xe._type="mesh",xe}function N(k){let T,B,L,w,D=!0;const F=k.fields;for(let pe=0,Qe=F.length;pe<Qe;pe++){const Fe=F[pe],ge=Fe.name,be=Fe.values;switch(ge){case"color":const he=be[0];he!==null&&(T=a(he));break;case"coord":const Ne=be[0];Ne!==null&&(B=a(Ne));break;case"colorIndex":L=be;break;case"colorPerVertex":D=be[0];break;case"coordIndex":w=be;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",ge);break}}let G;const W=Ce(w);if(T){if(D===!0)if(L.length>0){const pe=Ce(L);G=Re(W,pe,T,3)}else G=ze(W,new g.Float32BufferAttribute(T,3));else if(L.length>0){const pe=Ae(T,L),Qe=U(pe,w);G=We(W,Qe)}else{const pe=U(T,w);G=We(W,pe)}fe(G)}const te=new g.BufferGeometry,se=ze(W,new g.Float32BufferAttribute(B,3));return te.setAttribute("position",se),G&&te.setAttribute("color",G),te._type="line",te}function v(k){let T,B;const L=k.fields;for(let D=0,F=L.length;D<F;D++){const G=L[D],W=G.name,te=G.values;switch(W){case"color":const se=te[0];se!==null&&(T=a(se));break;case"coord":const pe=te[0];pe!==null&&(B=a(pe));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}const w=new g.BufferGeometry;if(w.setAttribute("position",new g.Float32BufferAttribute(B,3)),T){const D=new g.Float32BufferAttribute(T,3);fe(D),w.setAttribute("color",D)}return w._type="points",w}function S(k){const T=new g.Vector3(2,2,2),B=k.fields;for(let w=0,D=B.length;w<D;w++){const F=B[w],G=F.name,W=F.values;G==="size"?(T.x=W[0],T.y=W[1],T.z=W[2]):console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new g.BoxGeometry(T.x,T.y,T.z)}function _(k){let T=1,B=2,L=!1;const w=k.fields;for(let F=0,G=w.length;F<G;F++){const W=w[F],te=W.name,se=W.values;switch(te){case"bottom":L=!se[0];break;case"bottomRadius":T=se[0];break;case"height":B=se[0];break;case"side":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",te);break}}return new g.ConeGeometry(T,B,16,1,L)}function V(k){let T=1,B=2;const L=k.fields;for(let D=0,F=L.length;D<F;D++){const G=L[D],W=G.name,te=G.values;switch(W){case"bottom":break;case"radius":T=te[0];break;case"height":B=te[0];break;case"side":break;case"top":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}return new g.CylinderGeometry(T,T,B,16,1)}function J(k){let T=1;const B=k.fields;for(let w=0,D=B.length;w<D;w++){const F=B[w],G=F.name,W=F.values;G==="radius"?T=W[0]:console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new g.SphereGeometry(T,16,16)}function q(k){let T,B,L,w,D=!0,F=!0,G=!0,W=!0,te=0,se=2,pe=2,Qe=1,Fe=1;const ge=k.fields;for(let me=0,Ee=ge.length;me<Ee;me++){const de=ge[me],Ie=de.name,ye=de.values;switch(Ie){case"color":const je=ye[0];je!==null&&(T=a(je));break;case"normal":const ct=ye[0];ct!==null&&(B=a(ct));break;case"texCoord":const lt=ye[0];lt!==null&&(L=a(lt));break;case"height":w=ye;break;case"ccw":W=ye[0];break;case"colorPerVertex":D=ye[0];break;case"creaseAngle":te=ye[0];break;case"normalPerVertex":F=ye[0];break;case"solid":G=ye[0];break;case"xDimension":se=ye[0];break;case"xSpacing":Qe=ye[0];break;case"zDimension":pe=ye[0];break;case"zSpacing":Fe=ye[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Ie);break}}const be=[],he=[],Ne=[],Se=[];for(let me=0;me<pe;me++)for(let Ee=0;Ee<se;Ee++){const de=me*se+Ee,Ie=Qe*me,ye=w[de],je=Fe*Ee;if(be.push(Ie,ye,je),T&&D===!0){const ct=T[de*3+0],lt=T[de*3+1],Gt=T[de*3+2];Ne.push(ct,lt,Gt)}if(B&&F===!0){const ct=B[de*3+0],lt=B[de*3+1],Gt=B[de*3+2];he.push(ct,lt,Gt)}if(L){const ct=L[de*2+0],lt=L[de*2+1];Se.push(ct,lt)}else Se.push(me/(se-1),Ee/(pe-1))}const xe=[];for(let me=0;me<se-1;me++)for(let Ee=0;Ee<pe-1;Ee++){const de=me+Ee*se,Ie=me+(Ee+1)*se,ye=me+1+(Ee+1)*se,je=me+1+Ee*se;W===!0?(xe.push(de,ye,Ie),xe.push(ye,de,je)):(xe.push(de,Ie,ye),xe.push(ye,je,de))}const ke=ze(xe,new g.Float32BufferAttribute(be,3)),Ge=ze(xe,new g.Float32BufferAttribute(Se,2));let Ve,Ye;if(T){if(D===!1){for(let me=0;me<se-1;me++)for(let Ee=0;Ee<pe-1;Ee++){const de=me+Ee*(se-1),Ie=T[de*3+0],ye=T[de*3+1],je=T[de*3+2];Ne.push(Ie,ye,je),Ne.push(Ie,ye,je),Ne.push(Ie,ye,je),Ne.push(Ie,ye,je),Ne.push(Ie,ye,je),Ne.push(Ie,ye,je)}Ve=new g.Float32BufferAttribute(Ne,3)}else Ve=ze(xe,new g.Float32BufferAttribute(Ne,3));fe(Ve)}if(B)if(F===!1){for(let me=0;me<se-1;me++)for(let Ee=0;Ee<pe-1;Ee++){const de=me+Ee*(se-1),Ie=B[de*3+0],ye=B[de*3+1],je=B[de*3+2];he.push(Ie,ye,je),he.push(Ie,ye,je),he.push(Ie,ye,je),he.push(Ie,ye,je),he.push(Ie,ye,je),he.push(Ie,ye,je)}Ye=new g.Float32BufferAttribute(he,3)}else Ye=ze(xe,new g.Float32BufferAttribute(he,3));else Ye=Y(xe,be,te);const De=new g.BufferGeometry;return De.setAttribute("position",ke),De.setAttribute("normal",Ye),De.setAttribute("uv",Ge),Ve&&De.setAttribute("color",Ve),De._solid=G,De._type="mesh",De}function $(k){let T=[1,1,1,-1,-1,-1,-1,1,1,1],B=[0,0,0,0,1,0],L,w,D=!0,F=!0,G=0,W=!0,te=!0;const se=k.fields;for(let De=0,me=se.length;De<me;De++){const Ee=se[De],de=Ee.name,Ie=Ee.values;switch(de){case"beginCap":D=Ie[0];break;case"ccw":F=Ie[0];break;case"convex":break;case"creaseAngle":G=Ie[0];break;case"crossSection":T=Ie;break;case"endCap":W=Ie[0];break;case"orientation":w=Ie;break;case"scale":L=Ie;break;case"solid":te=Ie[0];break;case"spine":B=Ie;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",de);break}}const pe=T[0]===T[T.length-2]&&T[1]===T[T.length-1],Qe=[],Fe=new g.Vector3,ge=new g.Vector3,be=new g.Vector3,he=new g.Vector3,Ne=new g.Quaternion;for(let De=0,me=0,Ee=0,de=B.length;De<de;De+=3,me+=2,Ee+=4){Fe.fromArray(B,De),ge.x=L?L[me+0]:1,ge.y=1,ge.z=L?L[me+1]:1,be.x=w?w[Ee+0]:0,be.y=w?w[Ee+1]:0,be.z=w?w[Ee+2]:1;const Ie=w?w[Ee+3]:0;for(let ye=0,je=T.length;ye<je;ye+=2)he.x=T[ye+0],he.y=0,he.z=T[ye+1],he.multiply(ge),Ne.setFromAxisAngle(be,Ie),he.applyQuaternion(Ne),he.add(Fe),Qe.push(he.x,he.y,he.z)}const Se=[],xe=B.length/3,ke=T.length/2;for(let De=0;De<xe-1;De++)for(let me=0;me<ke-1;me++){const Ee=me+De*ke;let de=me+1+De*ke;const Ie=me+(De+1)*ke;let ye=me+1+(De+1)*ke;me===ke-2&&pe===!0&&(de=De*ke,ye=(De+1)*ke),F===!0?(Se.push(Ee,de,Ie),Se.push(Ie,de,ye)):(Se.push(Ee,Ie,de),Se.push(Ie,ye,de))}if(D===!0||W===!0){const De=[];for(let de=0,Ie=T.length;de<Ie;de+=2)De.push(new g.Vector2(T[de],T[de+1]));const me=g.ShapeUtils.triangulateShape(De,[]),Ee=[];for(let de=0,Ie=me.length;de<Ie;de++){const ye=me[de];Ee.push(ye[0],ye[1],ye[2])}if(D===!0)for(let de=0,Ie=Ee.length;de<Ie;de+=3)F===!0?Se.push(Ee[de+0],Ee[de+1],Ee[de+2]):Se.push(Ee[de+0],Ee[de+2],Ee[de+1]);if(W===!0){const de=ke*(xe-1);for(let Ie=0,ye=Ee.length;Ie<ye;Ie+=3)F===!0?Se.push(de+Ee[Ie+0],de+Ee[Ie+2],de+Ee[Ie+1]):Se.push(de+Ee[Ie+0],de+Ee[Ie+1],de+Ee[Ie+2])}}const Ge=ze(Se,new g.Float32BufferAttribute(Qe,3)),Ve=Y(Se,Qe,G),Ye=new g.BufferGeometry;return Ye.setAttribute("position",Ge),Ye.setAttribute("normal",Ve),Ye._solid=te,Ye._type="mesh",Ye}function ne(k){const T=n[k],B=a(T);return B.isObject3D||B.isMaterial?B.clone():B}function ue(k,T){for(let B=0,L=k.length;B<L;B++){const w=a(k[B]);w instanceof g.Object3D&&T.add(w)}}function oe(k,T){const B=[];let L=0;for(let w=0,D=k.length;w<D;w++){const F=k[L],G=k[w+(T?1:2)],W=k[w+(T?2:1)];B.push(F,G,W),(k[w+3]===-1||w+3>=D)&&(w+=3,L=w+1)}return B}function ae(k,T){const B=[];let L=0;for(let w=0,D=T.length;w<D;w++){const F=L*3,G=k[F],W=k[F+1],te=k[F+2];B.push(G,W,te),(T[w+3]===-1||w+3>=D)&&(w+=3,L++)}return B}function Ae(k,T){const B=[];for(let L=0,w=T.length;L<w;L++){const F=T[L]*3,G=k[F],W=k[F+1],te=k[F+2];B.push(G,W,te)}return B}function Ce(k){const T=[];for(let B=0,L=k.length;B<L;B++){const w=k[B],D=k[B+1];T.push(w,D),(k[B+2]===-1||B+2>=L)&&(B+=2)}return T}function U(k,T){const B=[];let L=0;for(let w=0,D=T.length;w<D;w++){const F=L*3,G=k[F],W=k[F+1],te=k[F+2];B.push(G,W,te),(T[w+2]===-1||w+2>=D)&&(w+=2,L++)}return B}const P=new g.Vector3,z=new g.Vector3,X=new g.Vector3,ee=new g.Vector2,le=new g.Vector2,we=new g.Vector2;function Re(k,T,B,L){const w=[];for(let D=0,F=k.length;D<F;D+=3){const G=T[D],W=T[D+1],te=T[D+2];L===2?(ee.fromArray(B,G*L),le.fromArray(B,W*L),we.fromArray(B,te*L),w.push(ee.x,ee.y),w.push(le.x,le.y),w.push(we.x,we.y)):(P.fromArray(B,G*L),z.fromArray(B,W*L),X.fromArray(B,te*L),w.push(P.x,P.y,P.z),w.push(z.x,z.y,z.z),w.push(X.x,X.y,X.z))}return new g.Float32BufferAttribute(w,L)}function Me(k,T){const B=[];for(let L=0,w=0,D=k.length;L<D;L+=3,w++)P.fromArray(T,w*3),B.push(P.x,P.y,P.z),B.push(P.x,P.y,P.z),B.push(P.x,P.y,P.z);return new g.Float32BufferAttribute(B,3)}function We(k,T){const B=[];for(let L=0,w=0,D=k.length;L<D;L+=2,w++)P.fromArray(T,w*3),B.push(P.x,P.y,P.z),B.push(P.x,P.y,P.z);return new g.Float32BufferAttribute(B,3)}function ze(k,T){const B=T.array,L=T.itemSize,w=new B.constructor(k.length*L);let D=0,F=0;for(let G=0,W=k.length;G<W;G++){D=k[G]*L;for(let te=0;te<L;te++)w[F++]=B[D++]}return new g.Float32BufferAttribute(w,L)}const Ke=new g.Vector3,O=new g.Vector3;function Y(k,T,B){const L=[],w={};for(let F=0,G=k.length;F<G;F+=3){const W=k[F],te=k[F+1],se=k[F+2],pe=new vs(W,te,se);P.fromArray(T,W*3),z.fromArray(T,te*3),X.fromArray(T,se*3),O.subVectors(X,z),Ke.subVectors(P,z),O.cross(Ke),O.normalize(),pe.normal.copy(O),w[W]===void 0&&(w[W]=[]),w[te]===void 0&&(w[te]=[]),w[se]===void 0&&(w[se]=[]),w[W].push(pe.normal),w[te].push(pe.normal),w[se].push(pe.normal),L.push(pe)}const D=[];for(let F=0,G=L.length;F<G;F++){const W=L[F],te=K(w[W.a],W.normal,B),se=K(w[W.b],W.normal,B),pe=K(w[W.c],W.normal,B);P.fromArray(T,W.a*3),z.fromArray(T,W.b*3),X.fromArray(T,W.c*3),D.push(te.x,te.y,te.z),D.push(se.x,se.y,se.z),D.push(pe.x,pe.y,pe.z)}return new g.Float32BufferAttribute(D,3)}function K(k,T,B){const L=new g.Vector3;if(B===0)L.copy(T);else for(let w=0,D=k.length;w<D;w++)k[w].angleTo(T)<B&&L.add(k[w]);return L.normalize()}function ie(k){const T=[];for(let B=0,L=k.length;B<L;B+=3)T.push(new g.Color(k[B],k[B+1],k[B+2]));return T}function fe(k){const T=new g.Color;for(let B=0;B<k.count;B++)T.fromBufferAttribute(k,B),g.ColorManagement.colorSpaceToWorking(T,g.SRGBColorSpace),k.setXYZ(B,T.r,T.g,T.b)}function _e(k,T,B,L,w){const D=[],F=w===!0?0:Math.PI;for(let Qe=0,Fe=L.length;Qe<Fe;Qe++){let ge=Qe===0?0:B[Qe-1];ge=w===!0?ge:F-ge;const be=new g.Vector3;be.setFromSphericalCoords(T,ge,0),D.push(be)}const G=k.index,W=k.attributes.position,te=new g.BufferAttribute(new Float32Array(k.attributes.position.count*3),3),se=new g.Vector3,pe=new g.Color;for(let Qe=0;Qe<G.count;Qe++){const Fe=G.getX(Qe);se.fromBufferAttribute(W,Fe);let ge,be,he=1;for(let xe=1;xe<D.length;xe++){ge=xe-1,be=xe;const ke=D[ge],Ge=D[be];if(w===!0){if(se.y<=ke.y&&se.y>Ge.y){he=Math.abs(ke.y-se.y)/Math.abs(ke.y-Ge.y);break}}else if(se.y>=ke.y&&se.y<Ge.y){he=Math.abs(ke.y-se.y)/Math.abs(ke.y-Ge.y);break}}const Ne=L[ge],Se=L[be];pe.copy(Ne).lerp(Se,he),g.ColorManagement.colorSpaceToWorking(pe,g.SRGBColorSpace),te.setXYZ(Fe,pe.r,pe.g,pe.b)}k.setAttribute("color",te)}const Be=new g.TextureLoader(this.manager);if(Be.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),e.indexOf("#VRML V2.0")===-1)throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");const ce=r(e);return c(ce)}}class ws{constructor(e){this.lexer=new wt.Lexer(e)}lex(e){const t=this.lexer.tokenize(e);if(t.errors.length>0)throw console.error(t.errors),Error("THREE.VRMLLexer: Lexing errors detected.");return t}}const Ts=wt.CstParser;class Rs extends Ts{constructor(e){super(e);const t=this,n=e.Version,r=e.LCurly,o=e.RCurly,s=e.LSquare,c=e.RSquare,A=e.Identifier,a=e.RouteIdentifier,h=e.StringLiteral,u=e.HexLiteral,b=e.NumberLiteral,f=e.TrueLiteral,I=e.FalseLiteral,m=e.NullLiteral,l=e.DEF,d=e.USE,p=e.ROUTE,C=e.TO,E=e.NodeName;t.RULE("vrml",function(){t.SUBRULE(t.version),t.AT_LEAST_ONE(function(){t.SUBRULE(t.node)}),t.MANY(function(){t.SUBRULE(t.route)})}),t.RULE("version",function(){t.CONSUME(n)}),t.RULE("node",function(){t.OPTION(function(){t.SUBRULE(t.def)}),t.CONSUME(E),t.CONSUME(r),t.MANY(function(){t.SUBRULE(t.field)}),t.CONSUME(o)}),t.RULE("field",function(){t.CONSUME(A),t.OR2([{ALT:function(){t.SUBRULE(t.singleFieldValue)}},{ALT:function(){t.SUBRULE(t.multiFieldValue)}}])}),t.RULE("def",function(){t.CONSUME(l),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(E)}}])}),t.RULE("use",function(){t.CONSUME(d),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(E)}}])}),t.RULE("singleFieldValue",function(){t.AT_LEAST_ONE(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(h)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(b)}},{ALT:function(){t.CONSUME(f)}},{ALT:function(){t.CONSUME(I)}},{ALT:function(){t.CONSUME(m)}}])})}),t.RULE("multiFieldValue",function(){t.CONSUME(s),t.MANY(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(h)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(b)}},{ALT:function(){t.CONSUME(m)}}])}),t.CONSUME(c)}),t.RULE("route",function(){t.CONSUME(p),t.CONSUME(a),t.CONSUME(C),t.CONSUME2(a)}),this.performSelfAnalysis()}}class vs{constructor(e,t,n){this.a=e,this.b=t,this.c=n,this.normal=new g.Vector3}}const nt={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};class Qs extends g.Loader{constructor(e){super(e),this.animateBonePositions=!0,this.animateBoneRotations=!0,this.animateBoneScales=!0}load(e,t,n,r){const o=this,s=new g.FileLoader(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(c){try{t(o.parse(c))}catch(A){r?r(A):console.error(A),o.manager.itemError(e)}},n,r)}parse(e){function t(f){c(f)!=="HIERARCHY"&&console.error("THREE.BVHLoader2: HIERARCHY expected.");const I=[],m=r(f,c(f),I);c(f)!=="MOTION"&&console.error("THREE.BVHLoader2: MOTION expected.");let l=c(f).split(/[\s]+/);const d=parseInt(l[1]);isNaN(d)&&console.error("THREE.BVHLoader2: Failed to read number of frames."),l=c(f).split(/[\s]+/);const p=parseFloat(l[2]);isNaN(p)&&console.error("THREE.BVHLoader2: Failed to read frame time.");for(let C=0;C<d;C++)l=c(f).split(/[\s]+/),n(l,C*p,m);return I}function n(f,I,m){if(m.type==="ENDSITE")return;const l={time:I,position:new g.Vector3,rotation:new g.Quaternion,scale:new g.Vector3(1,1,1)};m.frames.push(l);const d=new g.Quaternion,p=new g.Vector3(1,0,0),C=new g.Vector3(0,1,0),E=new g.Vector3(0,0,1);for(let y=0;y<m.channels.length;y++)switch(m.channels[y]){case"Xposition":l.position.x=parseFloat(f.shift().trim());break;case"Yposition":l.position.y=parseFloat(f.shift().trim());break;case"Zposition":l.position.z=parseFloat(f.shift().trim());break;case"Xrotation":d.setFromAxisAngle(p,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(d);break;case"Yrotation":d.setFromAxisAngle(C,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(d);break;case"Zrotation":d.setFromAxisAngle(E,parseFloat(f.shift().trim())*Math.PI/180),l.rotation.multiply(d);break;case"Xscale":l.scale.x=parseFloat(f.shift().trim());break;case"Yscale":l.scale.y=parseFloat(f.shift().trim());break;case"Zscale":l.scale.z=parseFloat(f.shift().trim());break;default:console.warn("THREE.BVHLoader2: Invalid channel type.")}for(let y=0;y<m.children.length;y++)n(f,I,m.children[y])}function r(f,I,m){const l={name:"",type:"",frames:[]};m.push(l);let d=I.split(/[\s]+/);d[0].toUpperCase()==="END"&&d[1].toUpperCase()==="SITE"?(l.type="ENDSITE",l.name="ENDSITE"):(l.name=d[1],l.type=d[0].toUpperCase()),c(f)!=="{"&&console.error("THREE.BVHLoader2: Expected opening { after type & name"),d=c(f).split(/[\s]+/),d[0]!=="OFFSET"&&console.error("THREE.BVHLoader2: Expected OFFSET but got: "+d[0]),d.length!==4&&console.error("THREE.BVHLoader2: Invalid number of values for OFFSET.");const p=new g.Vector3(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));if((isNaN(p.x)||isNaN(p.y)||isNaN(p.z))&&console.error("THREE.BVHLoader2: Invalid values of OFFSET."),l.offset=p,l.type!=="ENDSITE"){d=c(f).split(/[\s]+/),d[0]!=="CHANNELS"&&console.error("THREE.BVHLoader2: Expected CHANNELS definition.");const C=parseInt(d[1]);l.channels=d.splice(2,C),l.children=[]}for(;;){const C=c(f);if(C==="}")return l;l.children.push(r(f,C,m))}}function o(f,I){const m=new g.Bone;if(I.push(m),m.position.add(f.offset),m.name=f.name,f.type!=="ENDSITE")for(let l=0;l<f.children.length;l++)m.add(o(f.children[l],I));return m}function s(f){const I=[];for(let m=0;m<f.length;m++){const l=f[m];if(l.type==="ENDSITE")continue;const d=[],p=[],C=[],E=[];for(let y=0;y<l.frames.length;y++){const Q=l.frames[y];d.push(Q.time),p.push(Q.position.x+l.offset.x),p.push(Q.position.y+l.offset.y),p.push(Q.position.z+l.offset.z),C.push(Q.rotation.x),C.push(Q.rotation.y),C.push(Q.rotation.z),C.push(Q.rotation.w),E.push(Q.scale.x),E.push(Q.scale.y),E.push(Q.scale.z)}A.animateBonePositions&&I.push(new g.VectorKeyframeTrack(l.name+".position",d,p)),A.animateBoneRotations&&I.push(new g.QuaternionKeyframeTrack(l.name+".quaternion",d,C)),A.animateBoneScales&&I.push(new g.VectorKeyframeTrack(l.name+".scale",d,E))}return new g.AnimationClip("animation",-1,I)}function c(f){let I;for(;(I=f.shift().trim()).length===0;);return I}const A=this,a=e.split(/[\r\n]+/g),h=t(a),u=[];o(h[0],u);const b=s(h);return{skeleton:new g.Skeleton(u),clip:b}}}let _t,Bt;async function ks(i,e){Bt||(Bt=new Bs),Bt.manager.setURLModifier(n=>(n.startsWith("./")&&(n=n.substring(2)),URL.createObjectURL(Kn(i,n)))),_t=void 0;const t=await Bt.loadAsync(e);return _t=An,Bt.manager.setURLModifier(n=>n),t}let Xt;async function Ss(i,e){Xt||(Xt=new Qs);const t=un(i,e);return await Xt.parse(t)}function Ls(i){const e=i.clip.clone(),t=i.skeleton.bones[0].clone(!0),n=[];t.traverse(o=>{o instanceof re.Bone&&n.push(o)});const r=new re.Skeleton(n);return r.calculateInverses(),{clip:e,skeleton:r}}class Pn{isDummy=!0;skeleton=new re.Skeleton([new re.Bone]);clip=new re.AnimationClip("dummy")}const Zt={},$t={};class _s extends Et{comment=null;constructor(e){super(e)}async asyncInit(e){const t=await zn(e),n=new DOMParser,r=un(t,"CATALOG.XML"),o=n.parseFromString(r,"application/xml");if(o.querySelector("parsererror"))return console.error("Acerola3D.asyncInit(): CATALOG.XML parse error."),this;const s="http://acerola3d.sourceforge.jp/a3/catalog",c=o.getElementsByTagNameNS(s,"c");c[0]&&(this.comment=c[0].textContent);const A=o.getElementsByTagNameNS(s,"a"),a={};let h;for(const u of Array.from(A)){const b=u.getAttribute("an");if(b){h||(h=b);let f;const I=u.getAttribute("bvh");if(I){const S=t.zipUrl+"!"+I;Zt[S]||(Zt[S]=await Ss(t,I)),f=Ls(Zt[S]),f&&f.clip.tracks.forEach(_=>{_.setInterpolation(re.InterpolateDiscrete)})}else f=new Pn;const m={};f.skeleton.bones.forEach(S=>{m[S.name]=S});const l=u.getAttribute("scale"),d=l?Number(l):1,p=u.getAttribute("offset"),C=new Z;if(p){const S=p.split(" ");C.set(Number(S[0]),Number(S[1]),Number(S[2]))}const E=u.getAttribute("rot"),y=new Z;if(E){const S=E.split(" ");y.set(Number(S[0]),Number(S[1]),Number(S[2]))}let Q;const x={},H=u.getElementsByTagNameNS(s,"p");for(const S of Array.from(H)){const _=S.getAttribute("name"),V=S.getAttribute("wrl");if(_&&V){const J=t.zipUrl+"!"+V;$t[J]||($t[J]=await ks(t,V),_t&&(Q=_t)),x[_]=$t[J].clone(!0)}}const R=new re.Object3D;R.add(f.skeleton.bones[0]),f instanceof Pn?Object.values(x).forEach(S=>{R.add(S)}):tr(R,x),R.scale.set(d,d,d),y.scale(Math.PI/180),R.setRotationFromEuler(new re.Euler(y.x,y.y,y.z,"YXZ")),R.position.add(C),R.traverse(S=>{S.userData.a3js={objectA3:this}});let M,N=!0;const v=u.getElementsByTagNameNS(s,"s");if(v[0]){const S=v[0].getAttribute("file"),_=v[0].getAttribute("type")||"PointSound",V=v[0].getAttribute("loop")||"false",J=v[0].getAttribute("gain")||"1.0",q=v[0].getAttribute("offset")||"0.0 0.0 0.0",$=v[0].getAttribute("direction")||"0.0 0.0 1.0";N=(v[0].getAttribute("continue")||"true")==="true";const ue=q.split(" ").map(X=>Number(X)),oe=new Z(ue[0],ue[1],ue[2]),ae=$.split(" ").map(X=>Number(X)),Ae=new Z(ae[0],ae[1],ae[2]),Ce=_==="PointSound"||_==="ConeSound"?"positional":"audio",z=_==="PointSound"?{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}:{coneInnerAngle:30,coneOuterAngle:90,coneOuterGain:.1};if(S){const X=Kn(t,S),ee=URL.createObjectURL(X),le={type:Ce,loop:V==="true",volume:Number(J),positional:{directional:z}};M=await new at(ee,le).ready,M.setLocation(oe),M.lookAt(Ae),URL.revokeObjectURL(ee),R.add(M.object)}}a[b]={name:b,shape:{root:R,bones:m,skeleton:f.skeleton},motion:new dn(f.clip,b),sound:M,soundContinue:N,backgroundTexture:Q}}}return h&&this.syncInit(h,a),this}}function tr(i,e){if(vr(i)){const t=e[i.name];t&&i.add(t)}i.children&&i.children.forEach(t=>{tr(t,e)})}class xs extends Pe{constructor(e){super(e)}initObject(e){return e}}class Ns extends Pe{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),r=new re.BoxGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new re.MeshStandardMaterial({color:o});return new re.Mesh(r,s)}}class Ds extends Pe{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),n=e.filter(A=>typeof A=="string"),r=new re.SphereGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new re.MeshStandardMaterial({color:o});return new re.Mesh(r,s)}}class Fs extends Pe{constructor(){super()}initObject(){const e=new re.Object3D,t=new re.DirectionalLight(16777215);t.position.set(1,1,1),e.add(t);const n=new re.AmbientLight(4210752);return e.add(n),e}}class Os extends Pe{constructor(e){super(e)}initObject(e){const t=new re.PlaneGeometry(1,1),n=new re.TextureLoader().load(e),r=new re.MeshBasicMaterial({map:n});return new re.Mesh(t,r)}}class Ms extends Pe{constructor(e){super(e)}initObject(e){return new Xn(e)}}const nr={touchDevice:navigator.maxTouchPoints>0};class ir extends HTMLElement{options;canvas;scene;camera;controller;_maxDistance;_leftActive;_leftCenter;leftJoystick;_rightActive;_rightCenter;rightJoystick;leftButton;rightButton;keys;_ro;constructor(e={}){super(),this.options={...nr,...e},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
210
210
|
<style>
|
|
211
211
|
:host {
|
|
212
212
|
display: block;
|
|
@@ -289,5 +289,5 @@ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return I}
|
|
|
289
289
|
<button class="btn left">L</button>
|
|
290
290
|
<button class="btn right">R</button>
|
|
291
291
|
</div>
|
|
292
|
-
`,this.canvas=this.shadowRoot.querySelector("canvas-a3"),this.scene=this.canvas.scene,this.camera=this.canvas.camera,this.controller=this.canvas.controller,this._maxDistance=40,this._leftActive=!1,this._leftCenter={x:0,y:0},this.leftJoystick={x:0,y:0},this._rightActive=!1,this._rightCenter={x:0,y:0},this.rightJoystick={x:0,y:0},this.leftButton=!1,this.rightButton=!1,this.keys=new Set;const t=this.shadowRoot.querySelector(".joystick.left .stick");if(!t)return;t.addEventListener("pointerdown",s=>{this._leftActive=!0;const c=t.getBoundingClientRect();this._leftCenter.x=c.left+c.width/2,this._leftCenter.y=c.top+c.height/2,t.setPointerCapture(s.pointerId)}),t.addEventListener("pointermove",s=>{if(!this._leftActive)return;const c=s.clientX-this._leftCenter.x,A=s.clientY-this._leftCenter.y,a=Math.sqrt(c*c+A*A);let h=c,u=A;if(a>40){const b=Math.atan2(A,c);h=Math.cos(b)*this._maxDistance,u=Math.sin(b)*this._maxDistance}t.style.transform=`translate(calc(-50% + ${h}px), calc(-50% + ${u}px))`,this.leftJoystick.x=h/this._maxDistance,this.leftJoystick.y=-(u/this._maxDistance)}),t.addEventListener("pointerup",()=>{this._leftActive=!1,t.style.transform="translate(-50%, -50%)",this.leftJoystick.x=0,this.leftJoystick.y=0});const n=this.shadowRoot.querySelector(".joystick.right .stick");if(!n)return;n.addEventListener("pointerdown",s=>{this._rightActive=!0;const c=n.getBoundingClientRect();this._rightCenter.x=c.left+c.width/2,this._rightCenter.y=c.top+c.height/2,n.setPointerCapture(s.pointerId)}),n.addEventListener("pointermove",s=>{if(!this._rightActive)return;const c=s.clientX-this._rightCenter.x,A=s.clientY-this._rightCenter.y,a=Math.sqrt(c*c+A*A);let h=c,u=A;if(a>40){const b=Math.atan2(A,c);h=Math.cos(b)*this._maxDistance,u=Math.sin(b)*this._maxDistance}n.style.transform=`translate(calc(-50% + ${h}px), calc(-50% + ${u}px))`,this.rightJoystick.x=h/this._maxDistance,this.rightJoystick.y=-(u/this._maxDistance)}),n.addEventListener("pointerup",()=>{this._rightActive=!1,n.style.transform="translate(-50%, -50%)",this.rightJoystick.x=0,this.rightJoystick.y=0});const r=this.shadowRoot.querySelector(".btn.left");if(!r)return;r.addEventListener("pointerdown",()=>{this.leftButton=!0}),r.addEventListener("pointerup",()=>{this.leftButton=!1});const o=this.shadowRoot.querySelector(".btn.right");o&&(o.addEventListener("pointerdown",()=>{this.rightButton=!0}),o.addEventListener("pointerup",()=>{this.rightButton=!1}),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),this.options.touchDevice||(this.shadowRoot.querySelectorAll(".joystick").forEach(s=>{s.style.display="none"}),this.shadowRoot.querySelectorAll(".btn").forEach(s=>{s.style.display="none"})))}keyDownListener=e=>{this.keys.add(e.code),this.updateUIFromKeyInfo()};keyUpListener=e=>{this.keys.delete(e.code),this.updateUIFromKeyInfo()};connectedCallback(){this._ro=new ResizeObserver(e=>{const t=e[0],n=t.contentRect.width,r=t.contentRect.height;if(!(n===0||r===0))if(n>r){const o=this.shadowRoot.querySelector(".btn.left");o.style.bottom="50px",o.style.left="200px";const s=this.shadowRoot.querySelector(".btn.right");s.style.bottom="50px",s.style.right="200px"}else{const o=this.shadowRoot.querySelector(".btn.left");o.style.bottom="200px",o.style.left="50px";const s=this.shadowRoot.querySelector(".btn.right");s.style.bottom="200px",s.style.right="50px"}}),this._ro.observe(this)}disconnectedCallback(){this._ro?.disconnect(),window.removeEventListener("keydown",this.keyDownListener),window.removeEventListener("keyup",this.keyUpListener)}updateUIFromKeyInfo(){const e={x:0,y:0},t={x:0,y:0};this.keys.has("KeyW")&&(e.y+=1),this.keys.has("KeyA")&&(e.x-=1),this.keys.has("KeyS")&&(e.y-=1),this.keys.has("KeyD")&&(e.x+=1),this.keys.has("ArrowUp")&&(t.y+=1),this.keys.has("ArrowLeft")&&(t.x-=1),this.keys.has("ArrowDown")&&(t.y-=1),this.keys.has("ArrowRight")&&(t.x+=1);const n=Math.sqrt(e.x*e.x+e.y*e.y);n>0&&(e.x/=n,e.y/=n),this.leftJoystick=e;const r=Math.sqrt(t.x*t.x+t.y*t.y);r>0&&(t.x/=r,t.y/=r),this.rightJoystick=t,this.keys.has("Space")?this.leftButton=!0:this.leftButton=!1,this.keys.has("Enter")?this.rightButton=!0:this.rightButton=!1}replaceScene(e){return this.canvas.replaceScene(e)}setController(e){this.canvas.setController(e)}worldToScreen(e){return this.canvas.worldToScreen(e)}screenToWorld(e,t,n){return this.canvas.screenToWorld(e,t,n)}cameraToScreen(e){return this.canvas.cameraToScreen(e)}screenToCamera(e,t,n){return this.canvas.screenToCamera(e,t,n)}waitForRender(){return this.canvas.waitForRender()}alert(e,t){return this.canvas.alert(e,t)}prompt(e,t){return this.canvas.prompt(e,t)}}customElements.define("game-canvas-a3",tr);const nr={offset:.01,auto:!0,height:1.5,radius:.3};class Os{trans;objectA3;completeOptions;controller;colliderDesc;collider;capsuleCenter;nextLocation;tmpV1;tmpV2;constructor(e={}){this.completeOptions={...nr,...e},this.trans=new qe,this.capsuleCenter=new Z,this.nextLocation=new Z,this.tmpV1=new Z,this.tmpV2=new Z}init(e,t){if(this.trans.set(e),this.completeOptions.auto){const n=new se.Vector3,r=new se.Quaternion,o=new se.Object3D;o.add(t.object),t.transformer.trans.loc.write(n),o.position.set(n.x,n.y,n.z),t.transformer.trans.quat.write(r),o.quaternion.set(r.x,r.y,r.z,r.w),t.transformer.trans.scale.write(n),o.scale.set(n.x,n.y,n.z);const s=new se.Box3().setFromObject(o);o.remove(t.object),s.getSize(n),this.completeOptions.radius=Math.max(n.x,n.z)/2,this.completeOptions.height=n.y-this.completeOptions.radius*2,s.getCenter(n),this.capsuleCenter.set(n)}this.colliderDesc=He.ColliderDesc.capsule(this.completeOptions.height,this.completeOptions.radius),this.colliderDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.colliderDesc.setRotation({x:e.quat.x,y:e.quat.y,z:e.quat.z,w:e.quat.w})}addOneselfToPhysics(e){this.controller=e.world.createCharacterController(this.completeOptions.offset),this.colliderDesc&&(this.collider=e.world.createCollider(this.colliderDesc)),this.collider&&this.objectA3&&it.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.collider&&(e.world.removeCollider(this.collider,!1),it.delete(this.collider.handle))}setLocation(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.nextLocation.set(this.tmpV1)}setLocationNow(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),e=this.tmpV1,this.collider&&this.collider.setTranslation(e),this.trans.loc.set(e),this.nextLocation.set(e)}setQuat(e){this.collider&&this.collider.setRotation(e),this.trans.quat.set(e)}setQuatNow(e){this.collider&&this.collider.setRotation(e),this.trans.quat.set(e)}setScale(e){}setScaleNow(e){}setLinvel(e){}getLinvel(e){return e||(e=new Z),e.set(0,0,0),e}setAngvel(e){}getAngvel(e){return e||(e=new Z),e.set(0,0,0),e}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}isGrounded(){return this.controller?this.controller.computedGrounded():!1}update(e){if(!this.controller||!this.collider)return;this.trans.quat.set(this.collider.rotation()),this.tmpV1.set(this.collider.translation()),this.tmpV2.set(this.nextLocation),this.tmpV2.sub(this.tmpV1),this.controller.computeColliderMovement(this.collider,this.tmpV2);const t=this.controller.computedMovement();this.tmpV1.add(t),this.collider.setTranslation(this.tmpV1),this.tmpV1.sub(this.capsuleCenter),this.trans.loc.set(this.tmpV1),this.nextLocation.set(this.tmpV1)}}const ir={auto:!0,height:1.5,radius:.3};class Ms{trans;objectA3;completeOptions;colliderDesc;collider;bodyDesc;body;capsuleCenter;nextLocation;tmpV1;tmpV2;physicsWorld;constructor(e={}){this.completeOptions={...ir,...e},this.trans=new qe,this.capsuleCenter=new Z,this.nextLocation=new Z,this.tmpV1=new Z,this.tmpV2=new Z}init(e,t){if(this.trans.set(e),this.completeOptions.auto){const n=new se.Vector3,r=new se.Quaternion,o=new se.Object3D;o.add(t.object),t.transformer.trans.loc.write(n),o.position.set(n.x,n.y,n.z),t.transformer.trans.quat.write(r),o.quaternion.set(r.x,r.y,r.z,r.w),t.transformer.trans.scale.write(n),o.scale.set(n.x,n.y,n.z);const s=new se.Box3().setFromObject(o);s.getSize(n),this.completeOptions.radius=Math.max(n.x,n.z)/2,this.completeOptions.height=n.y-this.completeOptions.radius*2,s.getCenter(n),this.capsuleCenter.set(n)}this.bodyDesc=He.RigidBodyDesc.dynamic(),this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.bodyDesc.setRotation({x:e.quat.x,y:e.quat.y,z:e.quat.z,w:e.quat.w}),this.colliderDesc=He.ColliderDesc.capsule(this.completeOptions.height,this.completeOptions.radius)}addOneselfToPhysics(e){this.physicsWorld=e,this.bodyDesc&&(this.body=e.world.createRigidBody(this.bodyDesc),this.body.setEnabledRotations(!1,!1,!1,!0)),this.colliderDesc&&(this.collider=e.world.createCollider(this.colliderDesc,this.body)),this.collider&&this.objectA3&&it.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.collider&&(e.world.removeCollider(this.collider,!1),it.delete(this.collider.handle)),this.physicsWorld=void 0}setLocation(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.nextLocation.set(this.tmpV1)}setLocationNow(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),e=this.tmpV1,this.collider&&this.collider.setTranslation(e),this.trans.loc.set(e),this.nextLocation.set(e)}setQuat(e){this.collider&&this.collider.setRotation(e),this.trans.quat.set(e)}setQuatNow(e){this.collider&&this.collider.setRotation(e),this.trans.quat.set(e)}setScale(e){}setScaleNow(e){}setLinvel(e){this.body?this.body.setLinvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setLinvel(e.x,e.y,e.z)}getLinvel(e){return e||(e=new Z),this.body?e.set(this.body.linvel()):this.bodyDesc&&e.set(this.bodyDesc.linvel),e}setAngvel(e){this.body?this.body.setAngvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setAngvel({x:e.x,y:e.y,z:e.z})}getAngvel(e){return e||(e=new Z),this.body?e.set(this.body.angvel()):this.bodyDesc&&e.set(this.bodyDesc.angvel),e}resetForce(){this.body?.resetForces(!0)}addForce(e){this.body?.addForce({x:e.x,y:e.y,z:e.z},!0)}addForceAtPoint(e,t){this.body?.addForceAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}resetTorque(){this.body?.resetTorques(!0)}addTorque(e){this.body?.addTorque({x:e.x,y:e.y,z:e.z},!0)}applyImpulse(e){this.body?.applyImpulse({x:e.x,y:e.y,z:e.z},!0)}applyImpulseAtPoint(e,t){this.body?.applyImpulseAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}applyTorqueImpulse(e){this.body?.applyTorqueImpulse({x:e.x,y:e.y,z:e.z},!0)}isGrounded(){if(this.body&&this.physicsWorld){const e=this.body.translation(),t=new He.Ray(e,{x:0,y:-1,z:0}),n=1.1*(this.completeOptions.height+this.completeOptions.radius);return this.physicsWorld.world.castRay(t,n,!0,void 0,void 0,this.collider)!==null}else return this.trans.loc.y<=0}update(e){if(!this.body)return;const t=new Z(this.body.translation());t.sub(this.capsuleCenter),this.trans.loc.set(t),this.trans.quat.set(this.body.rotation())}}const rr={mass:10,defaultLocation:{x:0,y:1,z:0},defaultQuat:{x:0,y:0,z:0,w:1},chassisWidth:2,chassisHeight:1,chassisLength:4,chassisOffset:{x:0,y:-.5,z:0},chassisFriction:.1,wheelFrontYPosition:0,wheelFrontZPosition:1.5,wheelFrontAxleLength:2,wheelRearYPosition:0,wheelRearZPosition:-1.5,wheelRearAxleLength:2,wheelFrontRadius:.3,wheelRearRadius:.3,wheelFrontWidth:.4,wheelRearWidth:.4,wheelFrontSuspensionRestLength:.8,wheelRearSuspensionRestLength:.8,wheelFrontDirection:{x:0,y:-1,z:0},wheelRearDirection:{x:0,y:-1,z:0},wheelFrontAxle:{x:-1,y:0,z:0},wheelRearAxle:{x:-1,y:0,z:0},wheelFrontSuspensionStiffness:24,wheelRearSuspensionStiffness:24,wheelFrontSuspensionCompression:4,wheelRearSuspensionCompression:4,wheelFrontSuspensionRelaxation:3,wheelRearSuspensionRelaxation:3,wheelFrontWheelFrictionSlip:100,wheelRearWheelFrictionSlip:100,wheelFrontMaxSuspensionTravel:.25,wheelRearMaxSuspensionTravel:.25,aerodynamicDrag:0};class Ps{opt;trans;motion;constructor(e){this.opt={...rr,...e},this.trans=new or(this),this.motion=new sr(this)}handle(e){this.trans.controller&&(this.trans.controller.setWheelSteering(0,e),this.trans.controller.setWheelSteering(1,e))}accelerator(e){this.trans.controller&&(this.trans.controller.setWheelEngineForce(0,e),this.trans.controller.setWheelEngineForce(1,e),this.trans.controller.setWheelEngineForce(2,e),this.trans.controller.setWheelEngineForce(3,e))}brake(e){this.trans.controller&&(this.trans.controller.setWheelBrake(0,e),this.trans.controller.setWheelBrake(1,e),this.trans.controller.setWheelBrake(2,e),this.trans.controller.setWheelBrake(3,e))}reset(e,t){this.trans.chassisBody&&(e?this.trans.chassisBody.setTranslation({x:e.x,y:e.y,z:e.z},!0):this.trans.chassisBody.setTranslation(this.opt.defaultLocation,!0),t?this.trans.chassisBody.setRotation({x:t.x,y:t.y,z:t.z,w:t.w},!0):this.trans.chassisBody.setRotation(this.opt.defaultQuat,!0),this.trans.chassisBody.setLinvel({x:0,y:0,z:0},!0),this.trans.chassisBody.setAngvel({x:0,y:0,z:0},!0))}}class or{cc;trans;objectA3;controller;chassisBodyDesc;chassisBody;chassisColliderDesc;chassisCollider;constructor(e){this.cc=e,this.trans=new qe}init(e,t){this.trans.set(e),this.objectA3=t,this.chassisBodyDesc=new He.RigidBodyDesc(He.RigidBodyType.Dynamic),this.chassisColliderDesc=He.ColliderDesc.cuboid(this.cc.opt.chassisWidth/2,this.cc.opt.chassisHeight/2,this.cc.opt.chassisLength/2),this.chassisColliderDesc.setMass(this.cc.opt.mass),this.chassisColliderDesc.setFriction(this.cc.opt.chassisFriction)}addOneselfToPhysics(e){if(this.chassisBodyDesc&&(this.chassisBody=e.world.createRigidBody(this.chassisBodyDesc),this.chassisBody.setTranslation(this.cc.opt.defaultLocation,!0),this.chassisBody.setRotation(this.cc.opt.defaultQuat,!0)),this.chassisColliderDesc&&(this.chassisCollider=e.world.createCollider(this.chassisColliderDesc,this.chassisBody)),this.chassisCollider&&this.objectA3&&it.set(this.chassisCollider.handle,this.objectA3),this.chassisBody&&(this.controller=e.world.createVehicleController(this.chassisBody)),this.controller){const t={x:0,y:0,z:0};t.x=-this.cc.opt.wheelFrontAxleLength/2,t.y=this.cc.opt.wheelFrontYPosition,t.z=this.cc.opt.wheelFrontZPosition,this.controller.addWheel(t,this.cc.opt.wheelFrontDirection,this.cc.opt.wheelFrontAxle,this.cc.opt.wheelFrontSuspensionRestLength,this.cc.opt.wheelFrontRadius),this.controller.setWheelSuspensionStiffness(0,this.cc.opt.wheelFrontSuspensionStiffness),this.controller.setWheelSuspensionCompression(0,this.cc.opt.wheelFrontSuspensionCompression),this.controller.setWheelSuspensionRelaxation(0,this.cc.opt.wheelFrontSuspensionRelaxation),this.controller.setWheelFrictionSlip(0,this.cc.opt.wheelFrontWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(0,this.cc.opt.wheelFrontMaxSuspensionTravel),t.x=this.cc.opt.wheelFrontAxleLength/2,t.y=this.cc.opt.wheelFrontYPosition,t.z=this.cc.opt.wheelFrontZPosition,this.controller.addWheel(t,this.cc.opt.wheelFrontDirection,this.cc.opt.wheelFrontAxle,this.cc.opt.wheelFrontSuspensionRestLength,this.cc.opt.wheelFrontRadius),this.controller.setWheelSuspensionStiffness(1,this.cc.opt.wheelFrontSuspensionStiffness),this.controller.setWheelSuspensionCompression(1,this.cc.opt.wheelFrontSuspensionCompression),this.controller.setWheelSuspensionRelaxation(1,this.cc.opt.wheelFrontSuspensionRelaxation),this.controller.setWheelFrictionSlip(1,this.cc.opt.wheelFrontWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(1,this.cc.opt.wheelFrontMaxSuspensionTravel),t.x=-this.cc.opt.wheelRearAxleLength/2,t.y=this.cc.opt.wheelRearYPosition,t.z=this.cc.opt.wheelRearZPosition,this.controller.addWheel(t,this.cc.opt.wheelRearDirection,this.cc.opt.wheelRearAxle,this.cc.opt.wheelRearSuspensionRestLength,this.cc.opt.wheelRearRadius),this.controller.setWheelSuspensionStiffness(2,this.cc.opt.wheelRearSuspensionStiffness),this.controller.setWheelSuspensionCompression(2,this.cc.opt.wheelRearSuspensionCompression),this.controller.setWheelSuspensionRelaxation(2,this.cc.opt.wheelRearSuspensionRelaxation),this.controller.setWheelFrictionSlip(2,this.cc.opt.wheelRearWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(2,this.cc.opt.wheelRearMaxSuspensionTravel),t.x=this.cc.opt.wheelRearAxleLength/2,t.y=this.cc.opt.wheelRearYPosition,t.z=this.cc.opt.wheelRearZPosition,this.controller.addWheel(t,this.cc.opt.wheelRearDirection,this.cc.opt.wheelRearAxle,this.cc.opt.wheelRearSuspensionRestLength,this.cc.opt.wheelRearRadius),this.controller.setWheelSuspensionStiffness(3,this.cc.opt.wheelRearSuspensionStiffness),this.controller.setWheelSuspensionCompression(3,this.cc.opt.wheelRearSuspensionCompression),this.controller.setWheelSuspensionRelaxation(3,this.cc.opt.wheelRearSuspensionRelaxation),this.controller.setWheelFrictionSlip(3,this.cc.opt.wheelRearWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(3,this.cc.opt.wheelRearMaxSuspensionTravel)}}removeOneselfFromPhysics(e){this.chassisBody&&e.world.removeRigidBody(this.chassisBody),this.chassisCollider&&(e.world.removeCollider(this.chassisCollider,!1),it.delete(this.chassisCollider.handle))}setLocation(e){}setLocationNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinvel(e){}getLinvel(e){return e||(e=new Z),this.chassisBody?e.set(this.chassisBody.linvel()):this.chassisBodyDesc&&e.set(this.chassisBodyDesc.linvel),e}setAngvel(e){}getAngvel(e){return e||(e=new Z),this.chassisBody?e.set(this.chassisBody.angvel()):this.chassisBodyDesc&&e.set(this.chassisBodyDesc.angvel),e}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}isGrounded(){if(!this.controller)return!0;let e=!1;return e||=this.controller.wheelIsInContact(0),e||=this.controller.wheelIsInContact(1),e||=this.controller.wheelIsInContact(2),e||=this.controller.wheelIsInContact(3),e}vv=new Z;update(e){if(this.cc.opt.aerodynamicDrag>0&&this.chassisBody){const t=new Z(this.chassisBody.linvel());Math.abs(t.y)>3&&t.set(t.x,3*t.y/Math.abs(t.y),t.z),this.vv.lerp(this.vv,t,.9);const n=this.vv.length();n!==0&&(t.set(this.vv),t.normalize(),t.scale(-n*n*this.cc.opt.aerodynamicDrag),this.chassisBody.resetForces(!0),this.chassisBody.addForce({x:t.x,y:t.y,z:t.z},!0))}this.controller?.updateVehicle(e),this.chassisBody&&this.trans.loc.set(this.chassisBody.translation()),this.chassisBody&&this.trans.quat.set(this.chassisBody.rotation())}}class sr{cm;name;playCount;time;finishListener;constructor(e){this.cm=e,this.name="default",this.playCount=0,this.time=0}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){}setTime(e){}setFinishListener(e){this.finishListener=e}update(e){if(!this.cm.trans.chassisBody)return{};if(!this.cm.trans.controller)return{};const t=new Z(this.cm.trans.chassisBody.translation()),r=new Te(this.cm.trans.chassisBody.rotation()).clone().conjugate(),o=new Z(this.cm.trans.chassisBody.translation());o.add(this.cm.opt.chassisOffset),o.sub(t);const s=new Te(this.cm.trans.chassisBody.rotation());s.mul(r);const c=new Te,A=new Z,a=new Te;{const l=new Z(this.cm.opt.wheelFrontAxle),d=new Z(-this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),p=this.cm.trans.controller.wheelSuspensionLength(0)||0,C=this.cm.trans.controller.wheelSteering(0)||0,m=this.cm.trans.controller.wheelRotation(0)||0;A.set(d),A.sub(0,p,0),a.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(m/2),l.y*Math.sin(m/2),l.z*Math.sin(m/2),Math.cos(m/2)),a.mul(c)}const h=new Z,u=new Te;{const l=new Z(this.cm.opt.wheelFrontAxle),d=new Z(this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),p=this.cm.trans.controller.wheelSuspensionLength(1)||0,C=this.cm.trans.controller.wheelSteering(1)||0,m=this.cm.trans.controller.wheelRotation(1)||0;h.set(d),h.sub(0,p,0),u.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(m/2),l.y*Math.sin(m/2),l.z*Math.sin(m/2),Math.cos(m/2)),u.mul(c)}const b=new Z,f=new Te;{const l=new Z(this.cm.opt.wheelRearAxle),d=new Z(-this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),p=this.cm.trans.controller.wheelSuspensionLength(2)||0,C=this.cm.trans.controller.wheelSteering(2)||0,m=this.cm.trans.controller.wheelRotation(2)||0;b.set(d),b.sub(0,p,0),f.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(m/2),l.y*Math.sin(m/2),l.z*Math.sin(m/2),Math.cos(m/2)),f.mul(c)}const I=new Z,E=new Te;{const l=new Z(this.cm.opt.wheelRearAxle),d=new Z(this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),p=this.cm.trans.controller.wheelSuspensionLength(3)||0,C=this.cm.trans.controller.wheelSteering(3)||0,m=this.cm.trans.controller.wheelRotation(3)||0;I.set(d),I.sub(0,p,0),E.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(m/2),l.y*Math.sin(m/2),l.z*Math.sin(m/2),Math.cos(m/2)),E.mul(c)}return{chassis:{loc:o,quat:s},frontRight:{loc:h,quat:u},frontLeft:{loc:A,quat:a},rearRight:{loc:I,quat:E},rearLeft:{loc:b,quat:f}}}}exports.Acerola3D=Ss;exports.ActionObject=Rt;exports.AvatarController=Ur;exports.AvatarController2=Hr;exports.Box=_s;exports.Camera=Kn;exports.Canvas=Ui;exports.CarControl=Ps;exports.CarMotion=sr;exports.CarTransformer=or;exports.CharacterTransformer=Os;exports.CharacterTransformer2=Ms;exports.ClipMotion=un;exports.ControllerBase=xt;exports.DefaultTransformer=wt;exports.FixedTransformer=Pn;exports.FollowTransformer=mr;exports.GLTF=qo;exports.GameCanvas=tr;exports.GeneralCamera=vt;exports.HTML=Fs;exports.Image=Ds;exports.ObjectA3=Oe;exports.OrbitController=Vn;exports.Quat=Te;exports.RapierPhysicsEngine=Tt;exports.RapierPhysicsWorld=An;exports.Scene=zn;exports.Sound=at;exports.Sphere=xs;exports.StandardLights=Ns;exports.Test=Jo;exports.Text3D=ns;exports.ThreeJS=Ls;exports.Transform=qe;exports.Vec3=Z;exports.Window=Hi;exports.asyncSleep=Lr;exports.collisionMap=it;exports.deepMerge=_t;exports.defaultCanvasOptions=Gi;exports.defaultCarControlOptions=rr;exports.defaultCharacterTrans2Options=ir;exports.defaultCharacterTransOptions=nr;exports.defaultFollowTransformerOptions=Un;exports.defaultGameCanvasOptions=er;exports.defaultWindowOptions=ji;exports.getQuatOfLookAt=At;exports.initFont=ts;exports.initPhysics=Sr;exports.initSound=Pr;exports.vec3EulerToQuat=dt;
|
|
292
|
+
`,this.canvas=this.shadowRoot.querySelector("canvas-a3"),this.scene=this.canvas.scene,this.camera=this.canvas.camera,this.controller=this.canvas.controller,this._maxDistance=40,this._leftActive=!1,this._leftCenter={x:0,y:0},this.leftJoystick={x:0,y:0},this._rightActive=!1,this._rightCenter={x:0,y:0},this.rightJoystick={x:0,y:0},this.leftButton=!1,this.rightButton=!1,this.keys=new Set;const t=this.shadowRoot.querySelector(".joystick.left .stick");if(!t)return;t.addEventListener("pointerdown",s=>{this._leftActive=!0;const c=t.getBoundingClientRect();this._leftCenter.x=c.left+c.width/2,this._leftCenter.y=c.top+c.height/2,t.setPointerCapture(s.pointerId)}),t.addEventListener("pointermove",s=>{if(!this._leftActive)return;const c=s.clientX-this._leftCenter.x,A=s.clientY-this._leftCenter.y,a=Math.sqrt(c*c+A*A);let h=c,u=A;if(a>40){const b=Math.atan2(A,c);h=Math.cos(b)*this._maxDistance,u=Math.sin(b)*this._maxDistance}t.style.transform=`translate(calc(-50% + ${h}px), calc(-50% + ${u}px))`,this.leftJoystick.x=h/this._maxDistance,this.leftJoystick.y=-(u/this._maxDistance)}),t.addEventListener("pointerup",()=>{this._leftActive=!1,t.style.transform="translate(-50%, -50%)",this.leftJoystick.x=0,this.leftJoystick.y=0});const n=this.shadowRoot.querySelector(".joystick.right .stick");if(!n)return;n.addEventListener("pointerdown",s=>{this._rightActive=!0;const c=n.getBoundingClientRect();this._rightCenter.x=c.left+c.width/2,this._rightCenter.y=c.top+c.height/2,n.setPointerCapture(s.pointerId)}),n.addEventListener("pointermove",s=>{if(!this._rightActive)return;const c=s.clientX-this._rightCenter.x,A=s.clientY-this._rightCenter.y,a=Math.sqrt(c*c+A*A);let h=c,u=A;if(a>40){const b=Math.atan2(A,c);h=Math.cos(b)*this._maxDistance,u=Math.sin(b)*this._maxDistance}n.style.transform=`translate(calc(-50% + ${h}px), calc(-50% + ${u}px))`,this.rightJoystick.x=h/this._maxDistance,this.rightJoystick.y=-(u/this._maxDistance)}),n.addEventListener("pointerup",()=>{this._rightActive=!1,n.style.transform="translate(-50%, -50%)",this.rightJoystick.x=0,this.rightJoystick.y=0});const r=this.shadowRoot.querySelector(".btn.left");if(!r)return;r.addEventListener("pointerdown",()=>{this.leftButton=!0}),r.addEventListener("pointerup",()=>{this.leftButton=!1});const o=this.shadowRoot.querySelector(".btn.right");o&&(o.addEventListener("pointerdown",()=>{this.rightButton=!0}),o.addEventListener("pointerup",()=>{this.rightButton=!1}),window.addEventListener("keydown",this.keyDownListener),window.addEventListener("keyup",this.keyUpListener),this.options.touchDevice||(this.shadowRoot.querySelectorAll(".joystick").forEach(s=>{s.style.display="none"}),this.shadowRoot.querySelectorAll(".btn").forEach(s=>{s.style.display="none"})))}keyDownListener=e=>{this.keys.add(e.code),this.updateUIFromKeyInfo()};keyUpListener=e=>{this.keys.delete(e.code),this.updateUIFromKeyInfo()};connectedCallback(){this._ro=new ResizeObserver(e=>{const t=e[0],n=t.contentRect.width,r=t.contentRect.height;if(!(n===0||r===0))if(n>r){const o=this.shadowRoot.querySelector(".btn.left");o.style.bottom="50px",o.style.left="200px";const s=this.shadowRoot.querySelector(".btn.right");s.style.bottom="50px",s.style.right="200px"}else{const o=this.shadowRoot.querySelector(".btn.left");o.style.bottom="200px",o.style.left="50px";const s=this.shadowRoot.querySelector(".btn.right");s.style.bottom="200px",s.style.right="50px"}}),this._ro.observe(this)}disconnectedCallback(){this._ro?.disconnect(),window.removeEventListener("keydown",this.keyDownListener),window.removeEventListener("keyup",this.keyUpListener)}updateUIFromKeyInfo(){const e={x:0,y:0},t={x:0,y:0};this.keys.has("KeyW")&&(e.y+=1),this.keys.has("KeyA")&&(e.x-=1),this.keys.has("KeyS")&&(e.y-=1),this.keys.has("KeyD")&&(e.x+=1),this.keys.has("ArrowUp")&&(t.y+=1),this.keys.has("ArrowLeft")&&(t.x-=1),this.keys.has("ArrowDown")&&(t.y-=1),this.keys.has("ArrowRight")&&(t.x+=1);const n=Math.sqrt(e.x*e.x+e.y*e.y);n>0&&(e.x/=n,e.y/=n),this.leftJoystick=e;const r=Math.sqrt(t.x*t.x+t.y*t.y);r>0&&(t.x/=r,t.y/=r),this.rightJoystick=t,this.keys.has("Space")?this.leftButton=!0:this.leftButton=!1,this.keys.has("Enter")?this.rightButton=!0:this.rightButton=!1}replaceScene(e){return this.canvas.replaceScene(e)}setController(e){this.canvas.setController(e)}worldToScreen(e){return this.canvas.worldToScreen(e)}screenToWorld(e,t,n){return this.canvas.screenToWorld(e,t,n)}cameraToScreen(e){return this.canvas.cameraToScreen(e)}screenToCamera(e,t,n){return this.canvas.screenToCamera(e,t,n)}waitForRender(){return this.canvas.waitForRender()}alert(e,t){return this.canvas.alert(e,t)}prompt(e,t){return this.canvas.prompt(e,t)}}customElements.define("game-canvas-a3",ir);const rr={offset:.01,auto:!0,height:1.5,radius:.3};class Ps{trans;objectA3;completeOptions;controller;colliderDesc;collider;capsuleCenter;nextLocation;tmpV1;tmpV2;constructor(e={}){this.completeOptions={...rr,...e},this.trans=new qe,this.capsuleCenter=new Z,this.nextLocation=new Z,this.tmpV1=new Z,this.tmpV2=new Z}init(e,t){if(this.trans.set(e),this.completeOptions.auto){const n=new re.Vector3,r=new re.Quaternion,o=new re.Object3D;o.add(t.object),t.transformer.trans.loc.write(n),o.position.set(n.x,n.y,n.z),t.transformer.trans.quat.write(r),o.quaternion.set(r.x,r.y,r.z,r.w),t.transformer.trans.scale.write(n),o.scale.set(n.x,n.y,n.z);const s=new re.Box3().setFromObject(o);o.remove(t.object),s.getSize(n),this.completeOptions.radius=Math.max(n.x,n.z)/2,this.completeOptions.height=n.y-this.completeOptions.radius*2,s.getCenter(n),this.capsuleCenter.set(n)}this.colliderDesc=He.ColliderDesc.capsule(this.completeOptions.height,this.completeOptions.radius),this.colliderDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.colliderDesc.setRotation({x:e.quat.x,y:e.quat.y,z:e.quat.z,w:e.quat.w})}addOneselfToPhysics(e){this.controller=e.world.createCharacterController(this.completeOptions.offset),this.colliderDesc&&(this.collider=e.world.createCollider(this.colliderDesc)),this.collider&&this.objectA3&&it.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.collider&&(e.world.removeCollider(this.collider,!1),it.delete(this.collider.handle))}setLocation(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.nextLocation.set(this.tmpV1)}setLocationNow(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),e=this.tmpV1,this.collider&&this.collider.setTranslation(e),this.trans.loc.set(e),this.nextLocation.set(e)}setQuat(e){this.collider&&this.collider.setRotation(e),this.trans.quat.set(e)}setQuatNow(e){this.collider&&this.collider.setRotation(e),this.trans.quat.set(e)}setScale(e){}setScaleNow(e){}setLinvel(e){}getLinvel(e){return e||(e=new Z),e.set(0,0,0),e}setAngvel(e){}getAngvel(e){return e||(e=new Z),e.set(0,0,0),e}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}isGrounded(){return this.controller?this.controller.computedGrounded():!1}update(e){if(!this.controller||!this.collider)return;this.trans.quat.set(this.collider.rotation()),this.tmpV1.set(this.collider.translation()),this.tmpV2.set(this.nextLocation),this.tmpV2.sub(this.tmpV1),this.controller.computeColliderMovement(this.collider,this.tmpV2);const t=this.controller.computedMovement();this.tmpV1.add(t),this.collider.setTranslation(this.tmpV1),this.tmpV1.sub(this.capsuleCenter),this.trans.loc.set(this.tmpV1),this.nextLocation.set(this.tmpV1)}}const or={auto:!0,height:1.5,radius:.3};class Gs{trans;objectA3;completeOptions;colliderDesc;collider;bodyDesc;body;capsuleCenter;nextLocation;tmpV1;tmpV2;physicsWorld;constructor(e={}){this.completeOptions={...or,...e},this.trans=new qe,this.capsuleCenter=new Z,this.nextLocation=new Z,this.tmpV1=new Z,this.tmpV2=new Z}init(e,t){if(this.trans.set(e),this.completeOptions.auto){const n=new re.Vector3,r=new re.Quaternion,o=new re.Object3D;o.add(t.object),t.transformer.trans.loc.write(n),o.position.set(n.x,n.y,n.z),t.transformer.trans.quat.write(r),o.quaternion.set(r.x,r.y,r.z,r.w),t.transformer.trans.scale.write(n),o.scale.set(n.x,n.y,n.z);const s=new re.Box3().setFromObject(o);s.getSize(n),this.completeOptions.radius=Math.max(n.x,n.z)/2,this.completeOptions.height=n.y-this.completeOptions.radius*2,s.getCenter(n),this.capsuleCenter.set(n)}this.bodyDesc=He.RigidBodyDesc.dynamic(),this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.bodyDesc.setRotation({x:e.quat.x,y:e.quat.y,z:e.quat.z,w:e.quat.w}),this.colliderDesc=He.ColliderDesc.capsule(this.completeOptions.height,this.completeOptions.radius)}addOneselfToPhysics(e){this.physicsWorld=e,this.bodyDesc&&(this.body=e.world.createRigidBody(this.bodyDesc),this.body.setEnabledRotations(!1,!1,!1,!0)),this.colliderDesc&&(this.collider=e.world.createCollider(this.colliderDesc,this.body)),this.collider&&this.objectA3&&it.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.collider&&(e.world.removeCollider(this.collider,!1),it.delete(this.collider.handle)),this.physicsWorld=void 0}setLocation(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.nextLocation.set(this.tmpV1)}setLocationNow(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),e=this.tmpV1,this.collider&&this.collider.setTranslation(e),this.trans.loc.set(e),this.nextLocation.set(e)}setQuat(e){this.collider&&this.collider.setRotation(e),this.trans.quat.set(e)}setQuatNow(e){this.collider&&this.collider.setRotation(e),this.trans.quat.set(e)}setScale(e){}setScaleNow(e){}setLinvel(e){this.body?this.body.setLinvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setLinvel(e.x,e.y,e.z)}getLinvel(e){return e||(e=new Z),this.body?e.set(this.body.linvel()):this.bodyDesc&&e.set(this.bodyDesc.linvel),e}setAngvel(e){this.body?this.body.setAngvel({x:e.x,y:e.y,z:e.z},!0):this.bodyDesc?.setAngvel({x:e.x,y:e.y,z:e.z})}getAngvel(e){return e||(e=new Z),this.body?e.set(this.body.angvel()):this.bodyDesc&&e.set(this.bodyDesc.angvel),e}resetForce(){this.body?.resetForces(!0)}addForce(e){this.body?.addForce({x:e.x,y:e.y,z:e.z},!0)}addForceAtPoint(e,t){this.body?.addForceAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}resetTorque(){this.body?.resetTorques(!0)}addTorque(e){this.body?.addTorque({x:e.x,y:e.y,z:e.z},!0)}applyImpulse(e){this.body?.applyImpulse({x:e.x,y:e.y,z:e.z},!0)}applyImpulseAtPoint(e,t){this.body?.applyImpulseAtPoint({x:e.x,y:e.y,z:e.z},{x:t.x,y:t.y,z:t.z},!0)}applyTorqueImpulse(e){this.body?.applyTorqueImpulse({x:e.x,y:e.y,z:e.z},!0)}isGrounded(){if(this.body&&this.physicsWorld){const e=this.body.translation(),t=new He.Ray(e,{x:0,y:-1,z:0}),n=1.1*(this.completeOptions.height+this.completeOptions.radius);return this.physicsWorld.world.castRay(t,n,!0,void 0,void 0,this.collider)!==null}else return this.trans.loc.y<=0}update(e){if(!this.body)return;const t=new Z(this.body.translation());t.sub(this.capsuleCenter),this.trans.loc.set(t),this.trans.quat.set(this.body.rotation())}}const sr={mass:10,defaultLocation:{x:0,y:1,z:0},defaultQuat:{x:0,y:0,z:0,w:1},chassisWidth:2,chassisHeight:1,chassisLength:4,chassisOffset:{x:0,y:-.5,z:0},chassisFriction:.1,wheelFrontYPosition:0,wheelFrontZPosition:1.5,wheelFrontAxleLength:2,wheelRearYPosition:0,wheelRearZPosition:-1.5,wheelRearAxleLength:2,wheelFrontRadius:.3,wheelRearRadius:.3,wheelFrontWidth:.4,wheelRearWidth:.4,wheelFrontSuspensionRestLength:.8,wheelRearSuspensionRestLength:.8,wheelFrontDirection:{x:0,y:-1,z:0},wheelRearDirection:{x:0,y:-1,z:0},wheelFrontAxle:{x:-1,y:0,z:0},wheelRearAxle:{x:-1,y:0,z:0},wheelFrontSuspensionStiffness:24,wheelRearSuspensionStiffness:24,wheelFrontSuspensionCompression:4,wheelRearSuspensionCompression:4,wheelFrontSuspensionRelaxation:3,wheelRearSuspensionRelaxation:3,wheelFrontWheelFrictionSlip:100,wheelRearWheelFrictionSlip:100,wheelFrontMaxSuspensionTravel:.25,wheelRearMaxSuspensionTravel:.25,aerodynamicDrag:0};class Us{opt;trans;motion;constructor(e){this.opt={...sr,...e},this.trans=new ar(this),this.motion=new Ar(this)}handle(e){this.trans.controller&&(this.trans.controller.setWheelSteering(0,e),this.trans.controller.setWheelSteering(1,e))}accelerator(e){this.trans.controller&&(this.trans.controller.setWheelEngineForce(0,e),this.trans.controller.setWheelEngineForce(1,e),this.trans.controller.setWheelEngineForce(2,e),this.trans.controller.setWheelEngineForce(3,e))}brake(e){this.trans.controller&&(this.trans.controller.setWheelBrake(0,e),this.trans.controller.setWheelBrake(1,e),this.trans.controller.setWheelBrake(2,e),this.trans.controller.setWheelBrake(3,e))}reset(e,t){this.trans.chassisBody&&(e?this.trans.chassisBody.setTranslation({x:e.x,y:e.y,z:e.z},!0):this.trans.chassisBody.setTranslation(this.opt.defaultLocation,!0),t?this.trans.chassisBody.setRotation({x:t.x,y:t.y,z:t.z,w:t.w},!0):this.trans.chassisBody.setRotation(this.opt.defaultQuat,!0),this.trans.chassisBody.setLinvel({x:0,y:0,z:0},!0),this.trans.chassisBody.setAngvel({x:0,y:0,z:0},!0))}}class ar{cc;trans;objectA3;controller;chassisBodyDesc;chassisBody;chassisColliderDesc;chassisCollider;constructor(e){this.cc=e,this.trans=new qe}init(e,t){this.trans.set(e),this.objectA3=t,this.chassisBodyDesc=new He.RigidBodyDesc(He.RigidBodyType.Dynamic),this.chassisColliderDesc=He.ColliderDesc.cuboid(this.cc.opt.chassisWidth/2,this.cc.opt.chassisHeight/2,this.cc.opt.chassisLength/2),this.chassisColliderDesc.setMass(this.cc.opt.mass),this.chassisColliderDesc.setFriction(this.cc.opt.chassisFriction)}addOneselfToPhysics(e){if(this.chassisBodyDesc&&(this.chassisBody=e.world.createRigidBody(this.chassisBodyDesc),this.chassisBody.setTranslation(this.cc.opt.defaultLocation,!0),this.chassisBody.setRotation(this.cc.opt.defaultQuat,!0)),this.chassisColliderDesc&&(this.chassisCollider=e.world.createCollider(this.chassisColliderDesc,this.chassisBody)),this.chassisCollider&&this.objectA3&&it.set(this.chassisCollider.handle,this.objectA3),this.chassisBody&&(this.controller=e.world.createVehicleController(this.chassisBody)),this.controller){const t={x:0,y:0,z:0};t.x=-this.cc.opt.wheelFrontAxleLength/2,t.y=this.cc.opt.wheelFrontYPosition,t.z=this.cc.opt.wheelFrontZPosition,this.controller.addWheel(t,this.cc.opt.wheelFrontDirection,this.cc.opt.wheelFrontAxle,this.cc.opt.wheelFrontSuspensionRestLength,this.cc.opt.wheelFrontRadius),this.controller.setWheelSuspensionStiffness(0,this.cc.opt.wheelFrontSuspensionStiffness),this.controller.setWheelSuspensionCompression(0,this.cc.opt.wheelFrontSuspensionCompression),this.controller.setWheelSuspensionRelaxation(0,this.cc.opt.wheelFrontSuspensionRelaxation),this.controller.setWheelFrictionSlip(0,this.cc.opt.wheelFrontWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(0,this.cc.opt.wheelFrontMaxSuspensionTravel),t.x=this.cc.opt.wheelFrontAxleLength/2,t.y=this.cc.opt.wheelFrontYPosition,t.z=this.cc.opt.wheelFrontZPosition,this.controller.addWheel(t,this.cc.opt.wheelFrontDirection,this.cc.opt.wheelFrontAxle,this.cc.opt.wheelFrontSuspensionRestLength,this.cc.opt.wheelFrontRadius),this.controller.setWheelSuspensionStiffness(1,this.cc.opt.wheelFrontSuspensionStiffness),this.controller.setWheelSuspensionCompression(1,this.cc.opt.wheelFrontSuspensionCompression),this.controller.setWheelSuspensionRelaxation(1,this.cc.opt.wheelFrontSuspensionRelaxation),this.controller.setWheelFrictionSlip(1,this.cc.opt.wheelFrontWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(1,this.cc.opt.wheelFrontMaxSuspensionTravel),t.x=-this.cc.opt.wheelRearAxleLength/2,t.y=this.cc.opt.wheelRearYPosition,t.z=this.cc.opt.wheelRearZPosition,this.controller.addWheel(t,this.cc.opt.wheelRearDirection,this.cc.opt.wheelRearAxle,this.cc.opt.wheelRearSuspensionRestLength,this.cc.opt.wheelRearRadius),this.controller.setWheelSuspensionStiffness(2,this.cc.opt.wheelRearSuspensionStiffness),this.controller.setWheelSuspensionCompression(2,this.cc.opt.wheelRearSuspensionCompression),this.controller.setWheelSuspensionRelaxation(2,this.cc.opt.wheelRearSuspensionRelaxation),this.controller.setWheelFrictionSlip(2,this.cc.opt.wheelRearWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(2,this.cc.opt.wheelRearMaxSuspensionTravel),t.x=this.cc.opt.wheelRearAxleLength/2,t.y=this.cc.opt.wheelRearYPosition,t.z=this.cc.opt.wheelRearZPosition,this.controller.addWheel(t,this.cc.opt.wheelRearDirection,this.cc.opt.wheelRearAxle,this.cc.opt.wheelRearSuspensionRestLength,this.cc.opt.wheelRearRadius),this.controller.setWheelSuspensionStiffness(3,this.cc.opt.wheelRearSuspensionStiffness),this.controller.setWheelSuspensionCompression(3,this.cc.opt.wheelRearSuspensionCompression),this.controller.setWheelSuspensionRelaxation(3,this.cc.opt.wheelRearSuspensionRelaxation),this.controller.setWheelFrictionSlip(3,this.cc.opt.wheelRearWheelFrictionSlip),this.controller.setWheelMaxSuspensionTravel(3,this.cc.opt.wheelRearMaxSuspensionTravel)}}removeOneselfFromPhysics(e){this.chassisBody&&e.world.removeRigidBody(this.chassisBody),this.chassisCollider&&(e.world.removeCollider(this.chassisCollider,!1),it.delete(this.chassisCollider.handle))}setLocation(e){}setLocationNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinvel(e){}getLinvel(e){return e||(e=new Z),this.chassisBody?e.set(this.chassisBody.linvel()):this.chassisBodyDesc&&e.set(this.chassisBodyDesc.linvel),e}setAngvel(e){}getAngvel(e){return e||(e=new Z),this.chassisBody?e.set(this.chassisBody.angvel()):this.chassisBodyDesc&&e.set(this.chassisBodyDesc.angvel),e}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}isGrounded(){if(!this.controller)return!0;let e=!1;return e||=this.controller.wheelIsInContact(0),e||=this.controller.wheelIsInContact(1),e||=this.controller.wheelIsInContact(2),e||=this.controller.wheelIsInContact(3),e}vv=new Z;update(e){if(this.cc.opt.aerodynamicDrag>0&&this.chassisBody){const t=new Z(this.chassisBody.linvel());Math.abs(t.y)>3&&t.set(t.x,3*t.y/Math.abs(t.y),t.z),this.vv.lerp(this.vv,t,.9);const n=this.vv.length();n!==0&&(t.set(this.vv),t.normalize(),t.scale(-n*n*this.cc.opt.aerodynamicDrag),this.chassisBody.resetForces(!0),this.chassisBody.addForce({x:t.x,y:t.y,z:t.z},!0))}this.controller?.updateVehicle(e),this.chassisBody&&this.trans.loc.set(this.chassisBody.translation()),this.chassisBody&&this.trans.quat.set(this.chassisBody.rotation())}}class Ar{cm;name;playCount;time;finishListener;constructor(e){this.cm=e,this.name="default",this.playCount=0,this.time=0}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}setPause(e){}setTime(e){}setFinishListener(e){this.finishListener=e}update(e){if(!this.cm.trans.chassisBody)return{};if(!this.cm.trans.controller)return{};const t=new Z(this.cm.trans.chassisBody.translation()),r=new Te(this.cm.trans.chassisBody.rotation()).clone().conjugate(),o=new Z(this.cm.trans.chassisBody.translation());o.add(this.cm.opt.chassisOffset),o.sub(t);const s=new Te(this.cm.trans.chassisBody.rotation());s.mul(r);const c=new Te,A=new Z,a=new Te;{const l=new Z(this.cm.opt.wheelFrontAxle),d=new Z(-this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),p=this.cm.trans.controller.wheelSuspensionLength(0)||0,C=this.cm.trans.controller.wheelSteering(0)||0,E=this.cm.trans.controller.wheelRotation(0)||0;A.set(d),A.sub(0,p,0),a.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(E/2),l.y*Math.sin(E/2),l.z*Math.sin(E/2),Math.cos(E/2)),a.mul(c)}const h=new Z,u=new Te;{const l=new Z(this.cm.opt.wheelFrontAxle),d=new Z(this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),p=this.cm.trans.controller.wheelSuspensionLength(1)||0,C=this.cm.trans.controller.wheelSteering(1)||0,E=this.cm.trans.controller.wheelRotation(1)||0;h.set(d),h.sub(0,p,0),u.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(E/2),l.y*Math.sin(E/2),l.z*Math.sin(E/2),Math.cos(E/2)),u.mul(c)}const b=new Z,f=new Te;{const l=new Z(this.cm.opt.wheelRearAxle),d=new Z(-this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),p=this.cm.trans.controller.wheelSuspensionLength(2)||0,C=this.cm.trans.controller.wheelSteering(2)||0,E=this.cm.trans.controller.wheelRotation(2)||0;b.set(d),b.sub(0,p,0),f.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(E/2),l.y*Math.sin(E/2),l.z*Math.sin(E/2),Math.cos(E/2)),f.mul(c)}const I=new Z,m=new Te;{const l=new Z(this.cm.opt.wheelRearAxle),d=new Z(this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),p=this.cm.trans.controller.wheelSuspensionLength(3)||0,C=this.cm.trans.controller.wheelSteering(3)||0,E=this.cm.trans.controller.wheelRotation(3)||0;I.set(d),I.sub(0,p,0),m.set(0,Math.sin(C/2),0,Math.cos(C/2)),c.set(l.x*Math.sin(E/2),l.y*Math.sin(E/2),l.z*Math.sin(E/2),Math.cos(E/2)),m.mul(c)}return{chassis:{loc:o,quat:s},frontRight:{loc:h,quat:u},frontLeft:{loc:A,quat:a},rearRight:{loc:I,quat:m},rearLeft:{loc:b,quat:f}}}}exports.Acerola3D=_s;exports.ActionObject=Et;exports.AvatarController=Hr;exports.AvatarController2=zr;exports.Box=Ns;exports.Camera=Wn;exports.Canvas=Hi;exports.CarControl=Us;exports.CarMotion=Ar;exports.CarTransformer=ar;exports.CharacterTransformer=Ps;exports.CharacterTransformer2=Gs;exports.ClipMotion=dn;exports.ControllerBase=Nt;exports.DefaultTransformer=Tt;exports.FixedTransformer=Un;exports.FollowTransformer=br;exports.GLTF=Ko;exports.GameCanvas=ir;exports.GeneralCamera=vt;exports.HTML=Ms;exports.Image=Os;exports.ObjectA3=Pe;exports.OrbitController=Yn;exports.Quat=Te;exports.RapierPhysicsEngine=Rt;exports.RapierPhysicsWorld=ln;exports.Scene=Vn;exports.Sound=at;exports.Sphere=Ds;exports.StandardLights=Fs;exports.Test=Zo;exports.Text3D=rs;exports.ThreeJS=xs;exports.Transform=qe;exports.Vec3=Z;exports.Window=zi;exports.asyncSleep=xr;exports.collisionMap=it;exports.deepMerge=xt;exports.defaultCanvasOptions=ji;exports.defaultCarControlOptions=sr;exports.defaultCharacterTrans2Options=or;exports.defaultCharacterTransOptions=rr;exports.defaultFollowTransformerOptions=Hn;exports.defaultGameCanvasOptions=nr;exports.defaultWindowOptions=qi;exports.getQuatOfLookAt=At;exports.initFont=is;exports.initPhysics=_r;exports.initSound=Ur;exports.vec3EulerToQuat=dt;
|
|
293
293
|
//# sourceMappingURL=a3js.cjs.js.map
|