a3js 0.0.54 → 0.0.56

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 CHANGED
@@ -1,112 +1,112 @@
1
- "use strict";var wr=Object.create;var Sn=Object.defineProperty;var Tr=Object.getOwnPropertyDescriptor;var vr=Object.getOwnPropertyNames;var Rr=Object.getPrototypeOf,Qr=Object.prototype.hasOwnProperty;var kr=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of vr(e))!Qr.call(i,r)&&r!==t&&Sn(i,r,{get:()=>e[r],enumerable:!(n=Tr(e,r))||n.enumerable});return i};var Sr=(i,e,t)=>(t=i!=null?wr(Rr(i)):{},kr(e||!i||!i.__esModule?Sn(t,"default",{value:i,enumerable:!0}):t,i));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("three"),Yn=require("fflate");function xr(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 K=xr(b);class ce{x=0;y=0;z=0;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 ce(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}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}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){let o,s,c,A;typeof e=="number"?(o=e,s=t,c=n,A=r):(o=e.x,s=e.y,c=e.z,A=e.w);const a=2*(s*this.z-c*this.y),h=2*(c*this.x-o*this.z),u=2*(o*this.y-s*this.x);return this.x+=A*a+s*u-c*h,this.y+=A*h+c*a-o*u,this.z+=A*u+o*h-s*a,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 Me{x=0;y=0;z=0;w=1;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 Me(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=this.x,s=this.y,c=this.z,A=this.w;let a,h,u,m;return typeof e=="number"?(a=e,h=t,u=n,m=r):(a=e.x,h=e.y,u=e.z,m=e.w),this.x=A*a+o*m+s*u-c*h,this.y=A*h-o*u+s*m+c*a,this.z=A*u+o*h-s*a+c*m,this.w=A*m-o*a-s*h-c*u,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 Me;function st(i,e,t,n){t.normalize();const r=i.clone().sub(e).normalize(),o=new ce().cross(r,t).normalize(),s=new ce().cross(o,r),c=o.x,A=s.x,a=-r.x,h=o.y,u=s.y,m=-r.y,p=o.z,E=s.z,g=-r.z;let l,d,f,C;const I=c+u+g;if(I>0){const v=Math.sqrt(I+1)*2;l=(E-m)/v,d=(a-p)/v,f=(h-A)/v,C=.25*v}else if(c>u&&c>g){const v=Math.sqrt(1+c-u-g)*2;l=.25*v,d=(A+h)/v,f=(a+p)/v,C=(E-m)/v}else if(u>g){const v=Math.sqrt(1+u-c-g)*2;l=(A+h)/v,d=.25*v,f=(m+E)/v,C=(a-p)/v}else{const v=Math.sqrt(1+g-c-u)*2;l=(a+p)/v,d=(m+E)/v,f=.25*v,C=(h-A)/v}const y=n??new Me;return y.set(l,d,f,C),y}function ht(i,e="ZXY",t){const n=t!==void 0?t.set(0,0,0,1):new Me(0,0,0,1);for(let r=0;r<3;r++)switch(e.charAt(r)){case"X":n.mul(Math.sin(i.x),0,0,Math.cos(i.x));break;case"Y":n.mul(0,Math.sin(i.y),0,Math.cos(i.y));break;case"Z":n.mul(0,0,Math.sin(i.z),Math.cos(i.z));break}return n}function Lr(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,m=i.w*n,p=i.w*r;return e[0][0]=1-(A+h),e[0][1]=s-p,e[0][2]=c+m,e[1][0]=s+p,e[1][1]=1-(o+h),e[1][2]=a-u,e[2][0]=c-m,e[2][1]=a+u,e[2][2]=1-(o+A),e}const gt=i=>Math.max(-1,Math.min(1,i));function xn(i,e="ZXY",t){const n=Lr(i),r=t??new ce;let o=0,s=0,c=0;switch(e){case"XYZ":s=Math.asin(gt(n[0][2])),Math.abs(n[0][2])<.9999999?(o=Math.atan2(-n[1][2],n[2][2]),c=Math.atan2(-n[0][1],n[0][0])):(o=Math.atan2(n[2][1],n[1][1]),c=0);break;case"YXZ":o=Math.asin(-gt(n[1][2])),Math.abs(n[1][2])<.9999999?(s=Math.atan2(n[0][2],n[2][2]),c=Math.atan2(n[1][0],n[1][1])):(s=Math.atan2(-n[2][0],n[0][0]),c=0);break;case"ZXY":o=Math.asin(gt(n[2][1])),Math.abs(n[2][1])<.9999999?(s=Math.atan2(-n[2][0],n[2][2]),c=Math.atan2(-n[0][1],n[1][1])):(s=0,c=Math.atan2(n[1][0],n[0][0]));break;case"ZYX":s=Math.asin(-gt(n[2][0])),Math.abs(n[2][0])<.9999999?(o=Math.atan2(n[2][1],n[2][2]),c=Math.atan2(n[1][0],n[0][0])):(o=0,c=Math.atan2(-n[0][1],n[1][1]));break;case"YZX":c=Math.asin(gt(n[1][0])),Math.abs(n[1][0])<.9999999?(o=Math.atan2(-n[1][2],n[1][1]),s=Math.atan2(-n[2][0],n[0][0])):(o=0,s=Math.atan2(n[0][2],n[2][2]));break;case"XZY":c=Math.asin(-gt(n[0][1])),Math.abs(n[0][1])<.9999999?(o=Math.atan2(n[2][1],n[1][1]),s=Math.atan2(n[0][2],n[0][0])):(o=Math.atan2(-n[1][2],n[2][2]),s=0);break}return r.set(o,s,c),r}class qe{loc;quat;scale;constructor(){this.loc=new ce,this.quat=new Me,this.scale=new ce(1,1,1)}set(e){return e instanceof qe?(this.loc.set(e.loc),this.quat.set(e.quat),this.scale.set(e.scale)):(e.getPosition(this.loc),e.getQuat(this.quat),e.getScale(this.scale)),this}write(e){e instanceof Oe?(e.object3D.position.set(this.loc.x,this.loc.y,this.loc.z),e.object3D.quaternion.set(this.quat.x,this.quat.y,this.quat.z,this.quat.w),e.object3D.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 vt{transform;constructor(){this.transform=new qe}init(e,t){this.transform.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.transform.loc.y<=0}setPosition(e){this.transform.loc.set(e)}setPositionNow(e){this.transform.loc.set(e)}setQuat(e){this.transform.quat.set(e)}setQuatNow(e){this.transform.quat.set(e)}setScale(e){this.transform.scale.set(e)}setScaleNow(e){this.transform.scale.set(e)}setLinearVelocity(e){}getLinearVelocity(e){return e||new ce}setAngularVelocity(e){}getAngularVelocity(e){return e||new ce}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}class Jn{transform;constructor(){this.transform=new qe}init(e,t){this.transform.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.transform.loc.y<=0}setPosition(e){}setPositionNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinearVelocity(e){}getLinearVelocity(e){return e||new ce}setAngularVelocity(e){}getAngularVelocity(e){return e||new ce}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}}const Xn={duration:1};class mn{options;startTransform;transform;endTransform;currentTime;duration;constructor(e={}){this.options={...Xn,...e},this.startTransform=new qe,this.transform=new qe,this.endTransform=new qe,this.currentTime=0,this.duration=this.options.duration}init(e,t){this.startTransform.set(e),this.transform.set(e),this.endTransform.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.transform.loc.y<=0}setPosition(e){this.startTransform.set(this.transform),this.endTransform.loc.set(e),this.currentTime=0}setPositionNow(e){this.setPosition(e),this.currentTime=1}setQuat(e){this.startTransform.set(this.transform),this.endTransform.quat.set(e),this.currentTime=0}setQuatNow(e){this.setQuat(e),this.currentTime=1}setScale(e){this.startTransform.set(this.transform),this.endTransform.scale.set(e),this.currentTime=0}setScaleNow(e){this.setScale(e),this.currentTime=1}setLinearVelocity(e){}getLinearVelocity(e){e||(e=new ce);const t=this.endTransform.loc.x-this.startTransform.loc.x,n=this.endTransform.loc.y-this.startTransform.loc.y,r=this.endTransform.loc.z-this.startTransform.loc.z;e.set(t,n,r);const o=this.currentTime<this.duration?this.currentTime:this.duration;return e.scale((-6*o*o+6*o)/this.duration),e}setAngularVelocity(e){}getAngularVelocity(e){e||(e=new ce),xn(this.startTransform.quat,"ZXY",Nt),xn(this.endTransform.quat,"ZXY",Ft),e.set(Ft.x-Nt.x,Ft.y-Nt.y,Ft.z-Nt.z);const t=this.currentTime<this.duration?this.currentTime:this.duration;return e.scale((-6*t*t+6*t)/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.currentTime+=e,this.currentTime>this.duration&&(this.currentTime=this.duration);const t=this.currentTime/this.duration,n=this.smoothstep(t);this.transform.set(this.startTransform),this.transform.blend(this.endTransform,n)}}const ot=new ce,yt=new ce,ft=new Me,Dt=new qe,Nt=new ce,Ft=new ce,_r={up:new ce(0,1,0)};class Zn extends vt{up;target;constructor(e){super();const t={..._r,...e};this.target=t.target,this.up=t.up}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.transform.loc),this.target.getPosition(yt),st(ot,yt,this.up,ft),this.transform.quat.set(ft)}}const Dr={up:new ce(0,1,0),duration:1};class $n extends mn{up;target;constructor(e){super();const t={...Dr,...e};this.target=t.target,this.up=t.up,this.duration=t.duration}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.transform.loc),this.target.getPosition(yt),st(ot,yt,this.up,ft),this.transform.quat.set(ft)}}const ei={lookFrom:{x:0,y:5,z:-10},smoothness:.9};class ti extends Jn{target;lookFrom;up;smoothness;constructor(e){super();const t={...ei,...e};this.target=t.target,this.lookFrom=t.lookFrom,this.target.upVector?this.up=this.target.upVector:this.up=Oe.defaultUpVector,this.smoothness=t.smoothness}init(e,t){super.init(e,t)}update(e){super.update(e),ot.set(this.transform.loc),this.target.getPosition(yt),st(ot,yt,this.up,ft),ft.mul(0,1,0,0),Dt.quat.set(ft),ot.set(this.lookFrom),ot.apply(this.target.getQuat()),ot.add(this.target.getPosition()),Dt.loc.set(ot),this.transform.loc.lerp(this.transform.loc,Dt.loc,1-this.smoothness),this.transform.quat.slerp(this.transform.quat,Dt.quat,1-this.smoothness)}}function Nr(i){return typeof i=="string"}function En(i){return i.isMesh===!0}function Fr(i){return i.type==="RoundedBoxGeometry"}function Or(i){return i.type==="BoxGeometry"}function Mr(i){return i.type==="SphereGeometry"}function Pr(i){return i.type==="IcosahedronGeometry"}function Gr(i){return i.type==="CylinderGeometry"}function Ur(i){return i.type==="CapsuleGeometry"}function jr(i){return i.isBone===!0}function Hr(i){return i.isPerspectiveCamera===!0}const qr={rigidBody:"dynamic",collider:"solid",meshCollider:"convex_hull",mass:1,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1};let Pe;const tt=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,Pe=e,this.isInitialized=!0}}createWorld(e){let t=.016666666666666666;this.isRapierWorldOptions(e)&&(t=e.timestep);const n=new Pe.World(e.gravity);return new In(n,t)}isRapierWorldOptions(e){return"timestep"in e}}class In{world;timestep;collisionEventQueue;kinematicCharacterCollisionEventQueue;constructor(e,t){this.world=e,this.timestep=t,this.collisionEventQueue=new Pe.EventQueue(!0),this.world.integrationParameters.dt=this.timestep,this.kinematicCharacterCollisionEventQueue=[]}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=tt.get(t),s=tt.get(n);o&&s&&e.push({objectA:o,partOfA:t,objectB:s,partOfB:n,started:r})}),e.push(...this.kinematicCharacterCollisionEventQueue),this.kinematicCharacterCollisionEventQueue.length=0,e}}class zr{transform;objectA3;bodyDesc;body;colliderDescs;colliders;completeOptions;constructor(e={}){this.completeOptions={...qr,...e},this.transform=new qe,this.colliderDescs=[],this.colliders=[]}makeBodyDesc(){let e;switch(this.completeOptions.rigidBody){case"dynamic":e=Pe.RigidBodyDesc.dynamic();break;case"kinematic":e=Pe.RigidBodyDesc.kinematicPositionBased();break;case"fixed":e=Pe.RigidBodyDesc.fixed();break}return e.setTranslation(this.transform.loc.x,this.transform.loc.y,this.transform.loc.z),e.setRotation({x:this.transform.quat.x,y:this.transform.quat.y,z:this.transform.quat.z,w:this.transform.quat.w}),e}configColliderDescs(){if(!this.objectA3)return;const e=this.completeOptions,t=[];this.objectA3.object3D.traverse(r=>{if(En(r)){const o=Wr(r.geometry),s=e.membership<<16|e.filter;if(o)o.colliderDesc.setCollisionGroups(s),e.collisionDetection&&o.colliderDesc.setActiveEvents(Pe.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=Ln(r.geometry);break;case"convex_hull":c=Kr(r),A=Ln(r.geometry);break}c&&(c.setCollisionGroups(s),e.collisionDetection&&c.setActiveEvents(Pe.ActiveEvents.COLLISION_EVENTS),c.setRestitution(e.restitution).setFriction(e.friction),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.transform.set(e),this.objectA3=t,this.colliderDescs=[],this.colliders=[],this.bodyDesc=this.makeBodyDesc(),this.configColliderDescs(),this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.bodyDesc.setRotation(e.quat)}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&&tt.set(n.handle,this.objectA3)}),this.body.setTranslation(this.transform.loc,!0),this.body.setRotation(this.transform.quat,!0))}removeOneselfFromPhysics(e){this.colliders.forEach(t=>{e.world.removeCollider(t,!0),tt.delete(t.handle)}),this.colliders.length=0,this.body&&(e.world.removeRigidBody(this.body),this.body=void 0)}isGrounded(){return this.transform.loc.y<=0}setPosition(e){}setPositionNow(e){this.body?this.body.setTranslation(e,!0):this.bodyDesc?.setTranslation(e.x,e.y,e.z),this.transform.loc.set(e)}setQuat(e){}setQuatNow(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.transform.quat.set(e)}setScale(e){}setScaleNow(e){}setLinearVelocity(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)}getLinearVelocity(e){return e||(e=new ce),this.body?e.set(this.body.linvel()):this.bodyDesc&&e.set(this.bodyDesc.linvel),e}setAngularVelocity(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})}getAngularVelocity(e){return e||(e=new ce),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.transform.loc.set(t.x,t.y,t.z);const n=this.body.rotation();this.transform.quat.set(n.x,n.y,n.z,n.w)}}}function Vr(i){let e=null;if(En(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=Pe.ColliderDesc.trimesh(r,o))}return e}function Kr(i){let e=null;if(En(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=Pe.ColliderDesc.convexHull(r))}return e}function Ln(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 K.Vector3,s=new K.Vector3,c=new K.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,m=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[m],n[m+1],n[m+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 Wr(i){if(Fr(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:Pe.ColliderDesc.roundCuboid(t-o,n-o,r-o,o),volume:2*t*2*n*2*r}}else if(Or(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:Pe.ColliderDesc.cuboid(t,n,r),volume:2*t*2*n*2*r}}else if(Mr(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:Pe.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(Pr(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:Pe.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(Gr(i)){const e=i.parameters,t=typeof e?.radiusBottom=="number"?e.radiusBottom:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:Pe.ColliderDesc.cylinder(n/2,t),volume:Math.PI*t*t*n}}else if(Ur(i)){const e=i.parameters,t=typeof e?.radius=="number"?e.radius:.5,n=typeof e?.height=="number"?e.height:.5;return{colliderDesc:Pe.ColliderDesc.capsule(n/2,t),volume:4/3*Math.PI*t*t*t+Math.PI*t*t*n}}return null}const An=new Rt;async function Yr(){await An.init()}const x={v0:new ce,v1:new ce,v2:new ce,v3:new ce,v4:new ce,q0:new Me,q1:new Me,q2:new Me,q3:new Me,q4:new Me,t0:new qe,t1:new qe,t2:new qe,t3:new qe,t4:new qe};function Jr(i){return new Promise(e=>{setTimeout(()=>{e()},i)})}async function ni(i){const t=await(await fetch(i)).arrayBuffer(),n=await new Promise((r,o)=>{Yn.unzip(new Uint8Array(t),(s,c)=>{s?o(s):r(c)})});return{zipUrl:i,unzipped:n}}function Ot(i,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),i.unzipped[e])return Yn.strFromU8(i.unzipped[e]);throw new Error(`readStringFromUnzippedA3(): no file at ${e}`)}function cn(i,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),i.unzipped[e]){const t=Zr(e);return new Blob([new Uint8Array(i.unzipped[e])],{type:t})}else throw new Error(`readBlobFromUnzippedA3(): no file at ${e}`)}const Xr={"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 Zr(i){for(const[e,t]of Object.entries(Xr))if(t.test(i))return e;return"application/octet-stream"}function Pt(i,e){if(!e)return i;const t={...i};for(const n in e)typeof i[n]=="object"&&typeof e[n]=="object"?t[n]=Pt(i[n],e[n]):t[n]=e[n];return t}const ii={offset:.01,auto:!0,height:1.5,radius:.3,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1,pushDynamic:!1};class ri{transform;objectA3;completeOptions;controller;colliderDesc;collider;capsuleCenter;nextLocation;tmpV1;tmpV2;tmpQ1;world;constructor(e={}){this.completeOptions={...ii,...e},this.transform=new qe,this.capsuleCenter=new ce,this.nextLocation=new ce,this.tmpV1=new ce,this.tmpV2=new ce,this.tmpQ1=new Me}init(e,t){if(this.transform.set(e),this.objectA3=t,this.completeOptions.auto){const o=new K.Vector3,s=new K.Quaternion,c=new K.Object3D;c.add(t.object3D),t.getPosition(this.tmpV1),this.tmpV1.write(o),c.position.set(o.x,o.y,o.z),t.getQuat(this.tmpQ1),this.tmpQ1.write(s),c.quaternion.set(s.x,s.y,s.z,s.w),t.getScale(this.tmpV2),this.tmpV2.write(o),c.scale.set(o.x,o.y,o.z);const A=new K.Box3().setFromObject(c);c.remove(t.object3D),A.getSize(o),this.completeOptions.radius=Math.max(o.x,o.z)/2,this.completeOptions.height=o.y-this.completeOptions.radius*2,A.getCenter(o),this.capsuleCenter.set(o)}const n=this.completeOptions;this.colliderDesc=Pe.ColliderDesc.capsule(this.completeOptions.height,this.completeOptions.radius);const r=n.membership<<16|n.filter;this.colliderDesc.setCollisionGroups(r),n.collisionDetection&&this.colliderDesc.setActiveEvents(Pe.ActiveEvents.COLLISION_EVENTS),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.world=e,this.controller=e.world.createCharacterController(this.completeOptions.offset),this.controller.setApplyImpulsesToDynamicBodies(this.completeOptions.pushDynamic),this.colliderDesc&&(this.collider=e.world.createCollider(this.colliderDesc)),this.collider&&this.objectA3&&tt.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.collider&&(e.world.removeCollider(this.collider,!1),tt.delete(this.collider.handle),this.collider=void 0),this.controller&&e.world.removeCharacterController(this.controller)}setPosition(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.nextLocation.set(this.tmpV1)}setPositionNow(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.collider&&this.collider.setTranslation(this.tmpV1),this.transform.loc.set(e),this.nextLocation.set(this.tmpV1)}setQuat(e){this.collider&&this.collider.setRotation(e),this.transform.quat.set(e)}setQuatNow(e){this.collider&&this.collider.setRotation(e),this.transform.quat.set(e)}setScale(e){}setScaleNow(e){}setLinearVelocity(e){}getLinearVelocity(e){return e||(e=new ce),e.set(0,0,0),e}setAngularVelocity(e){}getAngularVelocity(e){return e||(e=new ce),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.transform.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();if(this.tmpV1.add(t),this.collider.setTranslation(this.tmpV1),this.tmpV1.sub(this.capsuleCenter),this.transform.loc.set(this.tmpV1),this.nextLocation.set(this.tmpV1),!this.collider||!this.world||!this.objectA3)return;const r=(this.collider.activeEvents()&Pe.ActiveEvents.COLLISION_EVENTS)!==0,o=this.collider.collisionGroups();for(let s=0;s<this.controller.numComputedCollisions();s++){let c=this.controller.computedCollision(s);if(c&&c.collider){const a=(c.collider.activeEvents()&Pe.ActiveEvents.COLLISION_EVENTS)!==0;if(!r&&!a)continue;const h=tt.get(c.collider.handle);if(!h)continue;const u=c.collider.collisionGroups();$r(o,u)&&this.world.kinematicCharacterCollisionEventQueue.push({objectA:this.objectA3,partOfA:this.collider.handle,objectB:h,partOfB:c.collider.handle,started:!0})}}}}function $r(i,e){const t=i>>>16,n=i&65535,r=e>>>16,o=e&65535;return(n&r)!==0&&(o&t)!==0}const oi={auto:!0,height:1.5,radius:.3,mass:1,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1};class si{transform;objectA3;completeOptions;colliderDesc;collider;bodyDesc;body;capsuleCenter;tmpV1;tmpV2;tmpQ1;physicsWorld;constructor(e={}){this.completeOptions={...oi,...e},this.transform=new qe,this.capsuleCenter=new ce,this.tmpV1=new ce,this.tmpV2=new ce,this.tmpQ1=new Me}init(e,t){if(this.transform.set(e),this.objectA3=t,this.completeOptions.auto){const o=new K.Vector3,s=new K.Quaternion,c=new K.Object3D;c.add(t.object3D),t.getPosition(this.tmpV1),this.tmpV1.write(o),c.position.set(o.x,o.y,o.z),t.getQuat(this.tmpQ1),this.tmpQ1.write(s),c.quaternion.set(s.x,s.y,s.z,s.w),t.getScale(this.tmpV2),this.tmpV2.write(o),c.scale.set(o.x,o.y,o.z);const A=new K.Box3().setFromObject(c);A.getSize(o),this.completeOptions.radius=Math.max(o.x,o.z)/2,this.completeOptions.height=o.y-this.completeOptions.radius*2,A.getCenter(o),this.capsuleCenter.set(o)}const n=this.completeOptions;this.bodyDesc=Pe.RigidBodyDesc.dynamic(),this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.bodyDesc.setRotation(e.quat),this.colliderDesc=Pe.ColliderDesc.capsule(this.completeOptions.height,this.completeOptions.radius),this.colliderDesc.setMass(n.mass);const r=n.membership<<16|n.filter;this.colliderDesc.setCollisionGroups(r),n.collisionDetection&&this.colliderDesc.setActiveEvents(Pe.ActiveEvents.COLLISION_EVENTS),this.colliderDesc.setRestitution(n.restitution).setFriction(n.friction)}addOneselfToPhysics(e){this.physicsWorld=e,this.bodyDesc&&(this.body=e.world.createRigidBody(this.bodyDesc),this.body.setEnabledRotations(!1,!1,!1,!0),this.body.setTranslation(this.transform.loc,!0),this.body.setRotation(this.transform.quat,!0)),this.colliderDesc&&(this.collider=e.world.createCollider(this.colliderDesc,this.body)),this.collider&&this.objectA3&&tt.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.collider&&(e.world.removeCollider(this.collider,!0),tt.delete(this.collider.handle),this.collider=void 0),this.body&&(e.world.removeRigidBody(this.body),this.body=void 0),this.physicsWorld=void 0}setPosition(e){}setPositionNow(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.body?this.body.setTranslation(this.tmpV1,!0):this.bodyDesc?.setTranslation(this.tmpV1.x,this.tmpV1.y,this.tmpV1.z),this.transform.loc.set(e)}setQuat(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.transform.quat.set(e)}setQuatNow(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.transform.quat.set(e)}setScale(e){}setScaleNow(e){}setLinearVelocity(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)}getLinearVelocity(e){return e||(e=new ce),this.body?e.set(this.body.linvel()):this.bodyDesc&&e.set(this.bodyDesc.linvel),e}setAngularVelocity(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})}getAngularVelocity(e){return e||(e=new ce),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 Pe.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.transform.loc.y<=0}update(e){if(!this.body)return;const t=new ce(this.body.translation());t.sub(this.capsuleCenter),this.transform.loc.set(t),this.transform.quat.set(this.body.rotation())}}const eo=new K.SphereGeometry,to=new K.MeshStandardMaterial({color:16711680});let no=new K.Mesh(eo,to);class Oe{static defaultRotationOrder="ZXY";static defaultUpVector=new ce(0,1,0);rotationOrder;upVector;object3D;scene;balloon;transformer;parent;children=[];clickListener;constructor(e){this.transformer=this.initTransformer(e),this.object3D=new K.Object3D;const t=this.initObject(e);t&&this.object3D.add(t),this.object3D.traverse(n=>{n.userData.a3js={objectA3:this}})}initObject(e){return no.clone()}initTransformer(e){return new vt}setTransformer(e){x.t0.set(this.transformer.transform),e.init(x.t0,this),this.transformer=e}getTransformer(){return this.transformer}setMode(e,t){e==="Default"?this.setTransformer(new vt):e==="Smooth"?this.setTransformer(new mn(t)):e==="Follow"?this.setTransformer(new ti(t)):e==="Billboard"?this.setTransformer(new Zn(t)):e==="SmoothBillboard"?this.setTransformer(new $n(t)):e==="SimplePhysics"?this.setTransformer(new zr(t)):e==="KinematicCharacter"?this.setTransformer(new ri(t)):e==="DynamicCharacter"&&this.setTransformer(new si(t))}update(e){this.transformer.update(e),this.transformer.transform.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.object3D.add(e.object3D)}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.object3D.remove(e.object3D)}setSpeechBubble(e){this.balloon?this.balloon.message=e:this.balloon=new io(e)}setClickListener(e){this.clickListener=e}handleCollision(e,t,n,r){}async clicked(){this.clickListener&&await this.clickListener(this)}setCastShadow(e){this.object3D.traverse(t=>{t instanceof K.Mesh&&(t.castShadow=e)})}setReceiveShadow(e){this.object3D.traverse(t=>{t instanceof K.Mesh&&(t.receiveShadow=e)})}setLightShadow(e){this.object3D.traverse(t=>{(t instanceof K.DirectionalLight||t instanceof K.SpotLight||t instanceof K.PointLight)&&(t.castShadow=e)})}getPosition(e){return e?(e.set(this.transformer.transform.loc),e):this.transformer.transform.loc.clone()}setPosition(e,t,n){typeof e=="number"?x.v0.set(e,t,n):x.v0.set(e),this.transformer.setPosition(x.v0)}setPositionNow(e,t,n){typeof e=="number"?x.v0.set(e,t,n):x.v0.set(e),this.transformer.setPositionNow(x.v0)}getQuat(e){return e?(e.set(this.transformer.transform.quat),e):this.transformer.transform.quat.clone()}setQuat(e,t,n,r){typeof e=="number"?x.q0.set(e,t,n,r):x.q0.set(e),this.transformer.setQuat(x.q0)}setQuatNow(e,t,n,r){typeof e=="number"?x.q0.set(e,t,n,r):x.q0.set(e),this.transformer.setQuatNow(x.q0)}getScale(e){return e?(e.set(this.transformer.transform.scale),e):this.transformer.transform.scale.clone()}setScale(e,t,n){typeof e=="number"?x.v0.set(e,t,n):x.v0.set(e),this.transformer.setScale(x.v0)}setScaleNow(e,t,n){typeof e=="number"?x.v0.set(e,t,n):x.v0.set(e),this.transformer.setScaleNow(x.v0)}setRotation(e,t,n){typeof e=="number"?x.v0.set(e,t,n):x.v0.set(e),x.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder;ht(x.v0,r,x.q1),this.setQuat(x.q1)}setRotationNow(e,t,n){typeof e=="number"?x.v0.set(e,t,n):x.v0.set(e),x.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder;ht(x.v0,r,x.q0),this.setQuatNow(x.q0)}lookAt(e,t,n){typeof e=="number"?x.v1.set(e,t,n):e instanceof Oe?x.v1.set(e.transformer.transform.loc):x.v1.set(e);const r=this.upVector?this.upVector:Oe.defaultUpVector;st(this.transformer.transform.loc,x.v1,r,x.q1),this.setQuat(x.q1)}lookAtNow(e,t,n){typeof e=="number"?x.v1.set(e,t,n):e instanceof Oe?x.v1.set(e.transformer.transform.loc):x.v1.set(e);const r=this.upVector?this.upVector:Oe.defaultUpVector;st(this.transformer.transform.loc,x.v1,r,x.q1),this.setQuatNow(x.q1)}getUnitVecX(e){return e?(e.set(1,0,0),e.apply(this.object3D.quaternion)):new ce(1,0,0).apply(this.object3D.quaternion)}getUnitVecY(e){return e?(e.set(0,1,0),e.apply(this.object3D.quaternion)):new ce(0,1,0).apply(this.object3D.quaternion)}getUnitVecZ(e){return e?(e.set(0,0,1),e.apply(this.object3D.quaternion)):new ce(0,0,1).apply(this.object3D.quaternion)}translate(e,t,n){x.v1.set(this.transformer.transform.loc),typeof e=="number"?x.v1.add(e,t,n):x.v1.add(e),this.setPosition(x.v1)}translateNow(e,t,n){x.v1.set(this.transformer.transform.loc),typeof e=="number"?x.v1.add(e,t,n):x.v1.add(e),this.setPositionNow(x.v1)}mulQuat(e,t,n,r){x.q1.set(this.transformer.transform.quat),typeof e=="number"?x.q1.mul(e,t,n,r):x.q1.mul(e),this.setQuat(x.q1)}mulQuatNow(e,t,n,r){x.q1.set(this.transformer.transform.quat),typeof e=="number"?x.q1.mul(e,t,n,r):x.q1.mul(e),this.setQuatNow(x.q1)}mulRotation(e,t,n){typeof e=="number"?x.v0.set(e,t,n):x.v0.set(e),x.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder;ht(x.v0,r,x.q1),this.getQuat(x.q0),x.q0.mul(x.q1),this.setQuat(x.q0)}mulRotationNow(e,t,n){typeof e=="number"?x.v0.set(e,t,n):x.v0.set(e),x.v0.scale(Math.PI/360);const r=this.rotationOrder?this.rotationOrder:Oe.defaultRotationOrder;ht(x.v0,r,x.q1),this.getQuat(x.q0),x.q0.mul(x.q1),this.setQuatNow(x.q0)}scaleBy(e,t,n){this.getScale(x.v0),typeof e=="number"?x.v0.set(x.v0.x*e,x.v0.y*t,x.v0.z*n):x.v0.set(x.v0.x*e.x,x.v0.y*e.y,x.v0.z*e.z),this.setScale(x.v0)}mulScaleNow(e,t,n){this.getScale(x.v0),typeof e=="number"?x.v0.set(x.v0.x*e,x.v0.y*t,x.v0.z*n):x.v0.set(x.v0.x*e.x,x.v0.y*e.y,x.v0.z*e.z),this.setScaleNow(x.v0)}moveForward(e){this.getUnitVecZ(x.v0),x.v0.scale(e),this.translate(x.v0)}moveForwardNow(e){this.getUnitVecZ(x.v0),x.v0.scale(e),this.translateNow(x.v0)}moveBackward(e){this.getUnitVecZ(x.v0),x.v0.scale(-e),this.translate(x.v0)}moveBackwardNow(e){this.getUnitVecZ(x.v0),x.v0.scale(-e),this.translateNow(x.v0)}moveRight(e){this.getUnitVecX(x.v0),x.v0.scale(-e),this.translate(x.v0)}moveRightNow(e){this.getUnitVecX(x.v0),x.v0.scale(-e),this.translateNow(x.v0)}moveLeft(e){this.getUnitVecX(x.v0),x.v0.scale(e),this.translate(x.v0)}moveLeftNow(e){this.getUnitVecX(x.v0),x.v0.scale(e),this.translateNow(x.v0)}moveUp(e){this.getUnitVecY(x.v0),x.v0.scale(e),this.translate(x.v0)}moveUpNow(e){this.getUnitVecY(x.v0),x.v0.scale(e),this.translateNow(x.v0)}moveDown(e){this.getUnitVecY(x.v0),x.v0.scale(-e),this.translate(x.v0)}moveDownNow(e){this.getUnitVecY(x.v0),x.v0.scale(-e),this.translateNow(x.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)}setLinearVelocity(e,t,n){typeof e=="number"?x.v0.set(e,t,n):x.v0.set(e),this.transformer.setLinearVelocity(x.v0)}getLinearVelocity(e){return this.transformer.getLinearVelocity(e)}setAngularVelocity(e,t,n){typeof e=="number"?x.v0.set(e,t,n):x.v0.set(e),this.transformer.setAngularVelocity(x.v0)}getAngularVelocity(e){return this.transformer.getAngularVelocity(e)}resetForce(){this.transformer.resetForce()}addForce(e,t,n){typeof e=="number"?x.v0.set(e,t,n):x.v0.set(e),this.transformer.addForce(x.v0)}addForceAtPoint(e,t,n,r,o,s){if(typeof e=="number")if(typeof t=="number")x.v0.set(e,t,n),x.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 x.v0.set(e),x.v1.set(t);this.transformer.addForceAtPoint(x.v0,x.v1)}resetTorque(){this.transformer.resetTorque()}addTorque(e,t,n){typeof e=="number"?x.v0.set(e,t,n):x.v0.set(e),this.transformer.addTorque(x.v0)}applyImpulse(e,t,n){typeof e=="number"?x.v0.set(e,t,n):x.v0.set(e),this.transformer.applyImpulse(x.v0)}applyImpulseAtPoint(e,t,n,r,o,s){if(typeof e=="number")if(typeof t=="number")x.v0.set(e,t,n),x.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 x.v0.set(e),x.v1.set(t);this.transformer.applyImpulseAtPoint(x.v0,x.v1)}applyTorqueImpulse(e,t,n){typeof e=="number"?x.v0.set(e,t,n):x.v0.set(e),this.transformer.applyTorqueImpulse(x.v0)}addOneselfToPhysics(e){this.transformer.addOneselfToPhysics(e)}removeOneselfFromPhysics(e){this.transformer.removeOneselfFromPhysics(e)}isGrounded(){return this.transformer.isGrounded()}}class io{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}}}class bn{shape;motion;constructor(e,t){this.shape=e,this.motion=t}enable(e,t){this.motion.playCount=0,this.motion.time=0,e.add(this.shape.root)}disable(e,t){e.remove(this.shape.root)}}class bt extends Oe{ready;actions;currentAction;stateAction;emoteAction;morphs;overwriteMorphs;autoAction=!1;autoDirection=!1;haltActionName="default";walkActionName="walk";runActionName="run";minWalkSpeed=.1;minRunSpeed=1;constructor(e){super(e),this.actions={},this.morphs={},this.overwriteMorphs=!1,this.ready=this.asyncInit(e),this.autoAction=!1,this.autoDirection=!1}syncInit(e,t,n={}){this.actions=t,this.stateAction=this.actions[e],this.currentAction=this.stateAction,this.object3D.clear(),this.morphs=n,this.stateAction?.enable(this.object3D,this.scene)}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.disable(this.object3D,this.scene),t.enable(this.object3D,this.scene),this.currentAction=t,this.stateAction=t)}setEmote(e){const t=this.actions[e];t&&(this.currentAction&&this.currentAction.disable(this.object3D,this.scene),t.enable(this.object3D,this.scene),this.currentAction=t,this.emoteAction=t)}setMorphsOverwrite(e){this.overwriteMorphs=e}setMorph(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?(t=this.emoteAction.motion.update(e),this.emoteAction.motion.playCount>0&&(this.emoteAction.disable(this.object3D,this.scene),this.emoteAction=void 0,this.stateAction&&(this.stateAction.enable(this.object3D,this.scene),this.currentAction=this.stateAction))):this.stateAction&&(t=this.stateAction.motion.update(e)),t&&this.currentAction&&this.currentAction.shape.bones)for(const[o,s]of Object.entries(t)){const c=this.currentAction.shape.bones[o];if(c&&(s.loc&&c.position.set(s.loc.x,s.loc.y,s.loc.z),s.quat&&c.quaternion.set(s.quat.x,s.quat.y,s.quat.z,s.quat.w),s.scale&&c.scale.set(s.scale.x,s.scale.y,s.scale.z)),!this.overwriteMorphs&&s.morphs){for(const A of s.morphs)for(const a of Object.keys(this.morphs))if(a.startsWith(A.name)){const{array:h}=this.morphs[a];for(let u=0;u<h.length;u++)h[u]=A.vals[u];break}}}this.object3D.updateMatrixWorld(!0),this.currentAction&&this.currentAction.shape.skeleton?.update();const n=this.getLinearVelocity(),r=n.length();if(this.autoAction&&(r<this.minWalkSpeed?this.actions[this.haltActionName]!==this.stateAction&&this.setState(this.haltActionName):r<this.minRunSpeed?this.actions[this.walkActionName]!==this.stateAction&&this.setState(this.walkActionName):this.actions[this.runActionName]!==this.stateAction&&this.setState(this.runActionName)),this.autoDirection&&r>1e-4){n.normalize();const o=this.upVector?this.upVector:Oe.defaultUpVector;x.v0.cross(n,o),x.v0.length()>1e-4&&(x.v0.set(0,0,0),st(x.v0,n,o,x.q0),this.setQuatNow(x.q0))}}setAutoAction(e){this.autoAction=e}setAutoDirection(e){this.autoDirection=e}}class _n{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{}}}var ve=(i,e)=>()=>(e||(e={exports:{}},i(e.exports,e)),e.exports),ai=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.VERSION=void 0,i.VERSION="9.0.1"}),Ne=ve((i,e)=>{var t=i&&i.__spreadArray||function(O,J){for(var q=0,re=J.length,fe=O.length;q<re;q++,fe++)O[fe]=J[q];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 J=[],q=Object.keys(O),re=0;re<q.length;re++)J.push(O[q[re]]);return J}i.values=o;function s(O,J){for(var q=[],re=r(O),fe=0;fe<re.length;fe++){var Qe=re[fe];q.push(J.call(null,O[Qe],Qe))}return q}i.mapValues=s;function c(O,J){for(var q=[],re=0;re<O.length;re++)q.push(J.call(null,O[re],re));return q}i.map=c;function A(O){for(var J=[],q=0;q<O.length;q++){var re=O[q];Array.isArray(re)?J=J.concat(A(re)):J.push(re)}return J}i.flatten=A;function a(O){return n(O)?void 0:O[0]}i.first=a;function h(O){var J=O&&O.length;return J?O[J-1]:void 0}i.last=h;function u(O,J){if(Array.isArray(O))for(var q=0;q<O.length;q++)J.call(null,O[q],q);else if(Z(O))for(var re=r(O),q=0;q<re.length;q++){var fe=re[q],Qe=O[fe];J.call(null,Qe,fe)}else throw Error("non exhaustive match")}i.forEach=u;function m(O){return typeof O=="string"}i.isString=m;function p(O){return O===void 0}i.isUndefined=p;function E(O){return O instanceof Function}i.isFunction=E;function g(O,J){return J===void 0&&(J=1),O.slice(J,O.length)}i.drop=g;function l(O,J){return J===void 0&&(J=1),O.slice(0,O.length-J)}i.dropRight=l;function d(O,J){var q=[];if(Array.isArray(O))for(var re=0;re<O.length;re++){var fe=O[re];J.call(null,fe)&&q.push(fe)}return q}i.filter=d;function f(O,J){return d(O,function(q){return!J(q)})}i.reject=f;function C(O,J){for(var q=Object.keys(O),re={},fe=0;fe<q.length;fe++){var Qe=q[fe],ye=O[Qe];J(ye)&&(re[Qe]=ye)}return re}i.pick=C;function I(O,J){return Z(O)?O.hasOwnProperty(J):!1}i.has=I;function y(O,J){return H(O,function(q){return q===J})!==void 0}i.contains=y;function v(O){for(var J=[],q=0;q<O.length;q++)J.push(O[q]);return J}i.cloneArr=v;function L(O){var J={};for(var q in O)Object.prototype.hasOwnProperty.call(O,q)&&(J[q]=O[q]);return J}i.cloneObj=L;function H(O,J){for(var q=0;q<O.length;q++){var re=O[q];if(J.call(null,re))return re}}i.find=H;function Q(O,J){for(var q=[],re=0;re<O.length;re++){var fe=O[re];J.call(null,fe)&&q.push(fe)}return q}i.findAll=Q;function P(O,J,q){for(var re=Array.isArray(O),fe=re?O:o(O),Qe=re?[]:r(O),ye=q,le=0;le<fe.length;le++)ye=J.call(null,ye,fe[le],re?le:Qe[le]);return ye}i.reduce=P;function D(O){return f(O,function(J){return J==null})}i.compact=D;function R(O,J){J===void 0&&(J=function(re){return re});var q=[];return P(O,function(re,fe){var Qe=J(fe);return y(q,Qe)?re:(q.push(Qe),re.concat(fe))},[])}i.uniq=R;function F(O){for(var J=[],q=1;q<arguments.length;q++)J[q-1]=arguments[q];var re=[null],fe=re.concat(J);return Function.bind.apply(O,fe)}i.partial=F;function _(O){return Array.isArray(O)}i.isArray=_;function X(O){return O instanceof RegExp}i.isRegExp=X;function Z(O){return O instanceof Object}i.isObject=Z;function V(O,J){for(var q=0;q<O.length;q++)if(!J(O[q],q))return!1;return!0}i.every=V;function $(O,J){return f(O,function(q){return y(J,q)})}i.difference=$;function ie(O,J){for(var q=0;q<O.length;q++)if(J(O[q]))return!0;return!1}i.some=ie;function ue(O,J){for(var q=0;q<O.length;q++)if(O[q]===J)return q;return-1}i.indexOf=ue;function ae(O,J){var q=v(O);return q.sort(function(re,fe){return J(re)-J(fe)}),q}i.sortBy=ae;function se(O,J){if(O.length!==J.length)throw Error("can't zipObject with different number of keys and values!");for(var q={},re=0;re<O.length;re++)q[O[re]]=J[re];return q}i.zipObject=se;function ee(O){for(var J=[],q=1;q<arguments.length;q++)J[q-1]=arguments[q];for(var re=0;re<J.length;re++)for(var fe=J[re],Qe=r(fe),ye=0;ye<Qe.length;ye++){var le=Qe[ye];O[le]=fe[le]}return O}i.assign=ee;function de(O){for(var J=[],q=1;q<arguments.length;q++)J[q-1]=arguments[q];for(var re=0;re<J.length;re++)for(var fe=J[re],Qe=r(fe),ye=0;ye<Qe.length;ye++){var le=Qe[ye];I(O,le)||(O[le]=fe[le])}return O}i.assignNoOverwrite=de;function G(){for(var O=[],J=0;J<arguments.length;J++)O[J]=arguments[J];return de.apply(void 0,t([{}],O))}i.defaults=G;function j(O,J){var q={};return u(O,function(re){var fe=J(re),Qe=q[fe];Qe?Qe.push(re):q[fe]=[re]}),q}i.groupBy=j;function Y(O,J){for(var q=L(O),re=r(J),fe=0;fe<re.length;fe++){var Qe=re[fe],ye=J[Qe];q[Qe]=ye}return q}i.merge=Y;function z(){}i.NOOP=z;function te(O){return O}i.IDENTITY=te;function oe(O){for(var J=[],q=0;q<O.length;q++){var re=O[q];J.push(re!==void 0?re:void 0)}return J}i.packArray=oe;function Be(O){console&&console.error&&console.error("Error: "+O)}i.PRINT_ERROR=Be;function we(O){console&&console.warn&&console.warn("Warning: "+O)}i.PRINT_WARNING=we;function De(){return typeof Map=="function"}i.isES2015MapSupported=De;function ze(O){return O[O.length-1]}i.peek=ze;function Je(O){var J=new Date().getTime(),q=O(),re=new Date().getTime(),fe=re-J;return{time:fe,value:q}}i.timer=Je;function Ve(O){function J(){}J.prototype=O;var q=new J;function re(){return typeof q.bar}return re(),re(),O}i.toFastProperties=Ve}),Cn=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 f={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(f,"global");break;case"i":A(f,"ignoreCase");break;case"m":A(f,"multiLine");break;case"u":A(f,"unicode");break;case"y":A(f,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:f,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 f=this.disjunction();return this.consumeChar(")"),{type:d,value:f,loc:this.loc(l)}}h()},t.prototype.quantifier=function(l){var d,f=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 I;this.isDigit()?(I=this.integerIncludingZero(),d={atLeast:C,atMost:I}):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(f),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(`
2
- `),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=m;break;case"D":l=m,d=!0;break;case"s":l=E;break;case"S":l=E,d=!0;break;case"w":l=p;break;case"W":l=p,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(`
3
- `);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`
4
- `: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 f=this.classAtom(),C=f.type==="Character";if(C&&this.isRangeDash()){this.consumeChar("-");var I=this.classAtom(),y=I.type==="Character";if(y){if(I.value<f.value)throw Error("Range out of order in character class");l.push({from:f.value,to:I.value})}else c(f.value,l),l.push(s("-")),c(I.value,l)}else c(f.value,l)}return this.consumeChar("]"),{type:"Set",complement:d,value:l}},t.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
5
- `: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 f={type:"Group",capturing:l,value:d};return l&&(f.idx=this.groupIdx),f},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`
6
- `: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`
7
- `: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`
8
- `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.parseHexDigits=function(l){for(var d="",f=0;f<l;f++){var C=this.popChar();if(n.test(C)===!1)throw Error("Expecting a HexDecimal digits");d+=C}var I=parseInt(d,16);return{type:"Character",value:I}},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(f){d.push(f)}):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,m=[];for(u=s("0");u<=s("9");u++)m.push(u);var p=[s("_")].concat(m);for(u=s("a");u<=s("z");u++)p.push(u);for(u=s("A");u<=s("Z");u++)p.push(u);var E=[s(" "),s("\f"),s(`
9
- `),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 g(){}return g.prototype.visitChildren=function(l){for(var d in l){var f=l[d];l.hasOwnProperty(d)&&(f.type!==void 0?this.visit(f):Array.isArray(f)&&f.forEach(function(C){this.visit(C)},this))}},g.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)},g.prototype.visitPattern=function(l){},g.prototype.visitFlags=function(l){},g.prototype.visitDisjunction=function(l){},g.prototype.visitAlternative=function(l){},g.prototype.visitStartAnchor=function(l){},g.prototype.visitEndAnchor=function(l){},g.prototype.visitWordBoundary=function(l){},g.prototype.visitNonWordBoundary=function(l){},g.prototype.visitLookahead=function(l){},g.prototype.visitNegativeLookahead=function(l){},g.prototype.visitCharacter=function(l){},g.prototype.visitSet=function(l){},g.prototype.visitGroup=function(l){},g.prototype.visitGroupBackReference=function(l){},g.prototype.visitQuantifier=function(l){},{RegExpParser:t,BaseRegExpVisitor:g,VERSION:"0.5.0"}})}),yn=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clearRegExpParserCache=i.getRegExpAst=void 0;var e=Cn(),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}),ro=ve(i=>{var e=i&&i.__extends||(function(){var g=function(l,d){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,C){f.__proto__=C}||function(f,C){for(var I in C)Object.prototype.hasOwnProperty.call(C,I)&&(f[I]=C[I])},g(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");g(l,d);function f(){this.constructor=l}l.prototype=d===null?Object.create(d):(f.prototype=d.prototype,new f)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.canMatchCharCode=i.firstCharOptimizedIndices=i.getOptimizedStartCodesIndices=i.failedOptimizationPrefixMsg=void 0;var t=Cn(),n=Ne(),r=yn(),o=Ai(),s="Complement Sets are not supported for first char optimization";i.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
10
- `;function c(g,l){l===void 0&&(l=!1);try{var d=r.getRegExpAst(g),f=A(d.value,{},d.flags.ignoreCase);return f}catch(I){if(I.message===s)l&&n.PRINT_WARNING(""+i.failedOptimizationPrefixMsg+(" Unable to optimize: < "+g.toString()+` >
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require("three");c=s(c,1);let l=require("fflate");var u=class e{x=0;y=0;z=0;constructor(e,t,n){typeof e==`number`?(this.x=e,this.y=t,this.z=n):e===void 0?this.x=this.y=this.z=0:(this.x=e.x,this.y=e.y,this.z=e.z)}clone(){return new e(this)}write(e){e.x=this.x,e.y=this.y,e.z=this.z}normalize(){let e=this.x*this.x+this.y*this.y+this.z*this.z,t=Math.sqrt(e);return t===0?console.warn(`Vec3.normalize.`):(this.x/=t,this.y/=t,this.z/=t),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}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}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){let i,a,o,s;typeof e==`number`?(i=e,a=t,o=n,s=r):(i=e.x,a=e.y,o=e.z,s=e.w);let c=2*(a*this.z-o*this.y),l=2*(o*this.x-i*this.z),u=2*(i*this.y-a*this.x);return this.x+=s*c+a*u-o*l,this.y+=s*l+o*c-i*u,this.z+=s*u+i*l-a*c,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}},d=class e{x=0;y=0;z=0;w=1;constructor(e,t,n,r){typeof e==`number`?(this.x=e,this.y=t,this.z=n,this.w=r):e===void 0?(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 e(this)}write(e){e.x=this.x,e.y=this.y,e.z=this.z,e.w=this.w}normalize(){let e=this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w,t=Math.sqrt(e);return t===0?console.warn(`Quat.normalize.`):(this.x/=t,this.y/=t,this.z/=t,this.w/=t),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){let i=this.x,a=this.y,o=this.z,s=this.w,c,l,u,d;return typeof e==`number`?(c=e,l=t,u=n,d=r):(c=e.x,l=e.y,u=e.z,d=e.w),this.x=s*c+i*d+a*u-o*l,this.y=s*l-i*u+a*d+o*c,this.z=s*u+i*l-a*c+o*d,this.w=s*d-i*c-a*l-o*u,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(f.set(t),r<0&&(r*=-1,f.set(-f.x,-f.y,-f.z,-f.w)),r>.9995){this.x=(1-n)*e.x+n*f.x,this.y=(1-n)*e.y+n*f.y,this.z=(1-n)*e.z+n*f.z,this.w=(1-n)*e.w+n*f.w;let t=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);t<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/t,this.y*=1/t,this.z*=1/t,this.w*=1/t)}else{let t=Math.acos(r),i=Math.sin((1-n)*t)/Math.sin(t),a=Math.sin(n*t)/Math.sin(t);this.x=i*e.x+a*f.x,this.y=i*e.y+a*f.y,this.z=i*e.z+a*f.z,this.w=i*e.w+a*f.w}}},f=new d;function p(e,t,n,r){n.normalize();let i=e.clone().sub(t).normalize(),a=new u().cross(i,n).normalize(),o=new u().cross(a,i),s=a.x,c=o.x,l=-i.x,f=a.y,p=o.y,m=-i.y,h=a.z,g=o.z,_=-i.z,v,y,b,x,S=s+p+_;if(S>0){let e=Math.sqrt(S+1)*2;v=(g-m)/e,y=(l-h)/e,b=(f-c)/e,x=.25*e}else if(s>p&&s>_){let e=Math.sqrt(1+s-p-_)*2;v=.25*e,y=(c+f)/e,b=(l+h)/e,x=(g-m)/e}else if(p>_){let e=Math.sqrt(1+p-s-_)*2;v=(c+f)/e,y=.25*e,b=(m+g)/e,x=(l-h)/e}else{let e=Math.sqrt(1+_-s-p)*2;v=(l+h)/e,y=(m+g)/e,b=.25*e,x=(f-c)/e}let C=r??new d;return C.set(v,y,b,x),C}function m(e,t=`ZXY`,n){let r=n===void 0?new d(0,0,0,1):n.set(0,0,0,1);for(let n=0;n<3;n++)switch(t.charAt(n)){case`X`:r.mul(Math.sin(e.x),0,0,Math.cos(e.x));break;case`Y`:r.mul(0,Math.sin(e.y),0,Math.cos(e.y));break;case`Z`:r.mul(0,0,Math.sin(e.z),Math.cos(e.z));break}return r}function h(e){let t=[[],[],[]],n=e.x+e.x,r=e.y+e.y,i=e.z+e.z,a=e.x*n,o=e.x*r,s=e.x*i,c=e.y*r,l=e.y*i,u=e.z*i,d=e.w*n,f=e.w*r,p=e.w*i;return t[0][0]=1-(c+u),t[0][1]=o-p,t[0][2]=s+f,t[1][0]=o+p,t[1][1]=1-(a+u),t[1][2]=l-d,t[2][0]=s-f,t[2][1]=l+d,t[2][2]=1-(a+c),t}var g=e=>Math.max(-1,Math.min(1,e));function _(e,t=`ZXY`,n){let r=h(e),i=n??new u,a=0,o=0,s=0;switch(t){case`XYZ`:o=Math.asin(g(r[0][2])),Math.abs(r[0][2])<.9999999?(a=Math.atan2(-r[1][2],r[2][2]),s=Math.atan2(-r[0][1],r[0][0])):(a=Math.atan2(r[2][1],r[1][1]),s=0);break;case`YXZ`:a=Math.asin(-g(r[1][2])),Math.abs(r[1][2])<.9999999?(o=Math.atan2(r[0][2],r[2][2]),s=Math.atan2(r[1][0],r[1][1])):(o=Math.atan2(-r[2][0],r[0][0]),s=0);break;case`ZXY`:a=Math.asin(g(r[2][1])),Math.abs(r[2][1])<.9999999?(o=Math.atan2(-r[2][0],r[2][2]),s=Math.atan2(-r[0][1],r[1][1])):(o=0,s=Math.atan2(r[1][0],r[0][0]));break;case`ZYX`:o=Math.asin(-g(r[2][0])),Math.abs(r[2][0])<.9999999?(a=Math.atan2(r[2][1],r[2][2]),s=Math.atan2(r[1][0],r[0][0])):(a=0,s=Math.atan2(-r[0][1],r[1][1]));break;case`YZX`:s=Math.asin(g(r[1][0])),Math.abs(r[1][0])<.9999999?(a=Math.atan2(-r[1][2],r[1][1]),o=Math.atan2(-r[2][0],r[0][0])):(a=0,o=Math.atan2(r[0][2],r[2][2]));break;case`XZY`:s=Math.asin(-g(r[0][1])),Math.abs(r[0][1])<.9999999?(a=Math.atan2(r[2][1],r[1][1]),o=Math.atan2(r[0][2],r[0][0])):(a=Math.atan2(-r[1][2],r[2][2]),o=0);break}return i.set(a,o,s),i}var v=class e{loc;quat;scale;constructor(){this.loc=new u,this.quat=new d,this.scale=new u(1,1,1)}set(t){return t instanceof e?(this.loc.set(t.loc),this.quat.set(t.quat),this.scale.set(t.scale)):(t.getPosition(this.loc),t.getQuat(this.quat),t.getScale(this.scale)),this}write(e){e instanceof W?(e.object3D.position.set(this.loc.x,this.loc.y,this.loc.z),e.object3D.quaternion.set(this.quat.x,this.quat.y,this.quat.z,this.quat.w),e.object3D.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(){let t=new e;return t.set(this),t}},y=class{transform;constructor(){this.transform=new v}init(e,t){this.transform.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.transform.loc.y<=0}setPosition(e){this.transform.loc.set(e)}setPositionNow(e){this.transform.loc.set(e)}setQuat(e){this.transform.quat.set(e)}setQuatNow(e){this.transform.quat.set(e)}setScale(e){this.transform.scale.set(e)}setScaleNow(e){this.transform.scale.set(e)}setLinearVelocity(e){}getLinearVelocity(e){return e||new u}setAngularVelocity(e){}getAngularVelocity(e){return e||new u}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}},b=class{transform;constructor(){this.transform=new v}init(e,t){this.transform.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.transform.loc.y<=0}setPosition(e){}setPositionNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinearVelocity(e){}getLinearVelocity(e){return e||new u}setAngularVelocity(e){}getAngularVelocity(e){return e||new u}resetForce(){}addForce(e){}addForceAtPoint(e,t){}resetTorque(){}addTorque(e){}applyImpulse(e){}applyImpulseAtPoint(e,t){}applyTorqueImpulse(e){}update(e){}},x={duration:1},S=class{options;startTransform;transform;endTransform;currentTime;duration;constructor(e={}){this.options={...x,...e},this.startTransform=new v,this.transform=new v,this.endTransform=new v,this.currentTime=0,this.duration=this.options.duration}init(e,t){this.startTransform.set(e),this.transform.set(e),this.endTransform.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}isGrounded(){return this.transform.loc.y<=0}setPosition(e){this.startTransform.set(this.transform),this.endTransform.loc.set(e),this.currentTime=0}setPositionNow(e){this.setPosition(e),this.currentTime=1}setQuat(e){this.startTransform.set(this.transform),this.endTransform.quat.set(e),this.currentTime=0}setQuatNow(e){this.setQuat(e),this.currentTime=1}setScale(e){this.startTransform.set(this.transform),this.endTransform.scale.set(e),this.currentTime=0}setScaleNow(e){this.setScale(e),this.currentTime=1}setLinearVelocity(e){}getLinearVelocity(e){e||=new u;let t=this.endTransform.loc.x-this.startTransform.loc.x,n=this.endTransform.loc.y-this.startTransform.loc.y,r=this.endTransform.loc.z-this.startTransform.loc.z;e.set(t,n,r);let i=this.currentTime<this.duration?this.currentTime:this.duration;return e.scale((-6*i*i+6*i)/this.duration),e}setAngularVelocity(e){}getAngularVelocity(e){e||=new u,_(this.startTransform.quat,`ZXY`,D),_(this.endTransform.quat,`ZXY`,O),e.set(O.x-D.x,O.y-D.y,O.z-D.z);let t=this.currentTime<this.duration?this.currentTime:this.duration;return e.scale((-6*t*t+6*t)/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.currentTime+=e,this.currentTime>this.duration&&(this.currentTime=this.duration);let t=this.currentTime/this.duration,n=this.smoothstep(t);this.transform.set(this.startTransform),this.transform.blend(this.endTransform,n)}},C=new u,w=new u,T=new d,E=new v,D=new u,O=new u,k={up:new u(0,1,0)},A=class extends y{up;target;constructor(e){super();let t={...k,...e};this.target=t.target,this.up=t.up}setTarget(e){this.target=e}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=W.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){C.set(this.transform.loc),this.target.getPosition(w),p(C,w,this.up,T),this.transform.quat.set(T)}},j={up:new u(0,1,0),duration:1},M=class extends S{up;target;constructor(e){super();let t={...j,...e};this.target=t.target,this.up=t.up,this.duration=t.duration}init(e,t){super.init(e,t),t.upVector?this.up=t.upVector:this.up=W.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e){super.update(e),C.set(this.transform.loc),this.target.getPosition(w),p(C,w,this.up,T),this.transform.quat.set(T)}},N={lookFrom:{x:0,y:5,z:-10},smoothness:.9},ee=class extends b{target;lookFrom;up;smoothness;constructor(e){super();let t={...N,...e};this.target=t.target,this.lookFrom=t.lookFrom,this.target.upVector?this.up=this.target.upVector:this.up=W.defaultUpVector,this.smoothness=t.smoothness}init(e,t){super.init(e,t)}update(e){super.update(e),C.set(this.transform.loc),this.target.getPosition(w),p(C,w,this.up,T),T.mul(0,1,0,0),E.quat.set(T),C.set(this.lookFrom),C.apply(this.target.getQuat()),C.add(this.target.getPosition()),E.loc.set(C),this.transform.loc.lerp(this.transform.loc,E.loc,1-this.smoothness),this.transform.quat.slerp(this.transform.quat,E.quat,1-this.smoothness)}};function te(e){return typeof e==`string`}function ne(e){return e.isMesh===!0}function re(e){return e.type===`RoundedBoxGeometry`}function ie(e){return e.type===`BoxGeometry`}function P(e){return e.type===`SphereGeometry`}function ae(e){return e.type===`IcosahedronGeometry`}function F(e){return e.type===`CylinderGeometry`}function oe(e){return e.type===`CapsuleGeometry`}function se(e){return e.isBone===!0}function I(e){return e.isPerspectiveCamera===!0}var L={rigidBody:`dynamic`,collider:`solid`,meshCollider:`convex_hull`,mass:1,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1},R,z=new Map,ce=class e{static RAPIER;isInitialized=!1;constructor(){}async init(){if(!e.RAPIER){let t=await import(`@dimforge/rapier3d-compat`);await t.init(),e.RAPIER=t,R=t,this.isInitialized=!0}}createWorld(e){let t=1/60;return this.isRapierWorldOptions(e)&&(t=e.timestep),new B(new R.World(e.gravity),t)}isRapierWorldOptions(e){return`timestep`in e}},B=class{world;timestep;collisionEventQueue;kinematicCharacterCollisionEventQueue;constructor(e,t){this.world=e,this.timestep=t,this.collisionEventQueue=new R.EventQueue(!0),this.world.integrationParameters.dt=this.timestep,this.kinematicCharacterCollisionEventQueue=[]}add(e){e.addOneselfToPhysics(this)}remove(e){e.removeOneselfFromPhysics(this)}update(e){let t=Math.ceil(e/this.timestep);for(let e=0;e<t;e++)this.world.step(this.collisionEventQueue)}getCollisions(){let e=[];return this.collisionEventQueue.drainCollisionEvents((t,n,r)=>{let i=z.get(t),a=z.get(n);i&&a&&e.push({objectA:i,partOfA:t,objectB:a,partOfB:n,started:r})}),e.push(...this.kinematicCharacterCollisionEventQueue),this.kinematicCharacterCollisionEventQueue.length=0,e}},le=class{transform;objectA3;bodyDesc;body;colliderDescs;colliders;completeOptions;constructor(e={}){this.completeOptions={...L,...e},this.transform=new v,this.colliderDescs=[],this.colliders=[]}makeBodyDesc(){let e;switch(this.completeOptions.rigidBody){case`dynamic`:e=R.RigidBodyDesc.dynamic();break;case`kinematic`:e=R.RigidBodyDesc.kinematicPositionBased();break;case`fixed`:e=R.RigidBodyDesc.fixed();break}return e.setTranslation(this.transform.loc.x,this.transform.loc.y,this.transform.loc.z),e.setRotation({x:this.transform.quat.x,y:this.transform.quat.y,z:this.transform.quat.z,w:this.transform.quat.w}),e}configColliderDescs(){if(!this.objectA3)return;let e=this.completeOptions,t=[];this.objectA3.object3D.traverse(n=>{if(ne(n)){let r=fe(n.geometry),i=e.membership<<16|e.filter;if(r)r.colliderDesc.setCollisionGroups(i),e.collisionDetection&&r.colliderDesc.setActiveEvents(R.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(r.colliderDesc),r.colliderDesc.setRestitution(e.restitution).setFriction(e.friction),t.push(r.volume);else{let r,a;switch(e.meshCollider){case`tri_mesh`:r=ue(n),a=V(n.geometry);break;case`convex_hull`:r=de(n),a=V(n.geometry);break}r&&(r.setCollisionGroups(i),e.collisionDetection&&r.setActiveEvents(R.ActiveEvents.COLLISION_EVENTS),r.setRestitution(e.restitution).setFriction(e.friction),this.colliderDescs.push(r),t.push(a))}}});let n=t.reduce((e,t)=>e+t,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.transform.set(e),this.objectA3=t,this.colliderDescs=[],this.colliders=[],this.bodyDesc=this.makeBodyDesc(),this.configColliderDescs(),this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.bodyDesc.setRotation(e.quat)}addOneselfToPhysics(e){this.bodyDesc&&(this.body=e.world.createRigidBody(this.bodyDesc),this.colliderDescs.forEach(t=>{let n=e.world.createCollider(t,this.body);this.colliders.push(n),this.objectA3&&z.set(n.handle,this.objectA3)}),this.body.setTranslation(this.transform.loc,!0),this.body.setRotation(this.transform.quat,!0))}removeOneselfFromPhysics(e){this.colliders.forEach(t=>{e.world.removeCollider(t,!0),z.delete(t.handle)}),this.colliders.length=0,this.body&&=(e.world.removeRigidBody(this.body),void 0)}isGrounded(){return this.transform.loc.y<=0}setPosition(e){}setPositionNow(e){this.body?this.body.setTranslation(e,!0):this.bodyDesc?.setTranslation(e.x,e.y,e.z),this.transform.loc.set(e)}setQuat(e){}setQuatNow(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.transform.quat.set(e)}setScale(e){}setScaleNow(e){}setLinearVelocity(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)}getLinearVelocity(e){return e||=new u,this.body?e.set(this.body.linvel()):this.bodyDesc&&e.set(this.bodyDesc.linvel),e}setAngularVelocity(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})}getAngularVelocity(e){return e||=new u,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){let e=this.body.translation();this.transform.loc.set(e.x,e.y,e.z);let t=this.body.rotation();this.transform.quat.set(t.x,t.y,t.z,t.w)}}};function ue(e){let t=null;if(ne(e)){let n=e;n.updateWorldMatrix(!0,!0);let r=n.geometry.clone();r.applyMatrix4(n.matrixWorld);let i=r.attributes.position.array,a=r.index?r.index.array:null;if(a)a instanceof Uint32Array||(a=new Uint32Array(a));else{let e=r.attributes.position.count;a=new Uint32Array(e);for(let t=0;t<e;t++)a[t]=t}i instanceof Float32Array&&(t=R.ColliderDesc.trimesh(i,a))}return t}function de(e){let t=null;if(ne(e)){let n=e;n.updateWorldMatrix(!0,!0);let r=n.geometry.clone();r.applyMatrix4(n.matrixWorld);let i=r.attributes.position.array;i instanceof Float32Array&&(t=R.ColliderDesc.convexHull(i))}return t}function V(e){let t=e.attributes.position;if(!t)throw Error(`position attribute not found`);let n=e.index,r=t.array,i=0,a=new c.Vector3,o=new c.Vector3,s=new c.Vector3;if(n){let e=n.array;for(let t=0;t<e.length;t+=3){let n=e[t]*3,c=e[t+1]*3,l=e[t+2]*3;a.set(r[n],r[n+1],r[n+2]),o.set(r[c],r[c+1],r[c+2]),s.set(r[l],r[l+1],r[l+2]),i+=a.dot(o.clone().cross(s))}}else for(let e=0;e<r.length;e+=9)a.set(r[e],r[e+1],r[e+2]),o.set(r[e+3],r[e+4],r[e+5]),s.set(r[e+6],r[e+7],r[e+8]),i+=a.dot(o.clone().cross(s));return Math.abs(i)/6}function fe(e){if(re(e)){let t=e.parameters,n=typeof t?.width==`number`?t.width/2:.5,r=typeof t?.height==`number`?t.height/2:.5,i=typeof t?.depth==`number`?t.depth/2:.5,a=.1;return{colliderDesc:R.ColliderDesc.roundCuboid(n-a,r-a,i-a,a),volume:2*n*2*r*2*i}}else if(ie(e)){let t=e.parameters,n=typeof t?.width==`number`?t.width/2:.5,r=typeof t?.height==`number`?t.height/2:.5,i=typeof t?.depth==`number`?t.depth/2:.5;return{colliderDesc:R.ColliderDesc.cuboid(n,r,i),volume:2*n*2*r*2*i}}else if(P(e)){let t=e.parameters,n=typeof t?.radius==`number`?t.radius:1;return{colliderDesc:R.ColliderDesc.ball(n),volume:4/3*Math.PI*n*n*n}}else if(ae(e)){let t=e.parameters,n=typeof t?.radius==`number`?t.radius:1;return{colliderDesc:R.ColliderDesc.ball(n),volume:4/3*Math.PI*n*n*n}}else if(F(e)){let t=e.parameters,n=typeof t?.radiusBottom==`number`?t.radiusBottom:.5,r=typeof t?.height==`number`?t.height:.5;return{colliderDesc:R.ColliderDesc.cylinder(r/2,n),volume:Math.PI*n*n*r}}else if(oe(e)){let t=e.parameters,n=typeof t?.radius==`number`?t.radius:.5,r=typeof t?.height==`number`?t.height:.5;return{colliderDesc:R.ColliderDesc.capsule(r/2,n),volume:4/3*Math.PI*n*n*n+Math.PI*n*n*r}}return null}var H=new ce;async function pe(){await H.init()}var U={v0:new u,v1:new u,v2:new u,v3:new u,v4:new u,q0:new d,q1:new d,q2:new d,q3:new d,q4:new d,t0:new v,t1:new v,t2:new v,t3:new v,t4:new v};function me(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}async function he(e){let t=await(await fetch(e)).arrayBuffer();return{zipUrl:e,unzipped:await new Promise((e,n)=>{(0,l.unzip)(new Uint8Array(t),(t,r)=>{t?n(t):e(r)})})}}function ge(e,t){if(t=t.replace(/^\.\//,``).replace(/^\//,``),e.unzipped[t])return(0,l.strFromU8)(e.unzipped[t]);throw Error(`readStringFromUnzippedA3(): no file at ${t}`)}function _e(e,t){if(t=t.replace(/^\.\//,``).replace(/^\//,``),e.unzipped[t]){let n=ye(t);return new Blob([new Uint8Array(e.unzipped[t])],{type:n})}else throw Error(`readBlobFromUnzippedA3(): no file at ${t}`)}var ve={"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 ye(e){for(let[t,n]of Object.entries(ve))if(n.test(e))return t;return`application/octet-stream`}function be(e,t){if(!t)return e;let n={...e};for(let r in t)typeof e[r]==`object`&&typeof t[r]==`object`?n[r]=be(e[r],t[r]):n[r]=t[r];return n}var xe={offset:.01,auto:!0,height:1.5,radius:.3,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1,pushDynamic:!1},Se=class{transform;objectA3;completeOptions;controller;colliderDesc;collider;capsuleCenter;nextLocation;tmpV1;tmpV2;tmpQ1;world;constructor(e={}){this.completeOptions={...xe,...e},this.transform=new v,this.capsuleCenter=new u,this.nextLocation=new u,this.tmpV1=new u,this.tmpV2=new u,this.tmpQ1=new d}init(e,t){if(this.transform.set(e),this.objectA3=t,this.completeOptions.auto){let e=new c.Vector3,n=new c.Quaternion,r=new c.Object3D;r.add(t.object3D),t.getPosition(this.tmpV1),this.tmpV1.write(e),r.position.set(e.x,e.y,e.z),t.getQuat(this.tmpQ1),this.tmpQ1.write(n),r.quaternion.set(n.x,n.y,n.z,n.w),t.getScale(this.tmpV2),this.tmpV2.write(e),r.scale.set(e.x,e.y,e.z);let i=new c.Box3().setFromObject(r);r.remove(t.object3D),i.getSize(e),this.completeOptions.radius=Math.max(e.x,e.z)/2,this.completeOptions.height=e.y-this.completeOptions.radius*2,i.getCenter(e),this.capsuleCenter.set(e)}let n=this.completeOptions;this.colliderDesc=R.ColliderDesc.capsule(this.completeOptions.height,this.completeOptions.radius);let r=n.membership<<16|n.filter;this.colliderDesc.setCollisionGroups(r),n.collisionDetection&&this.colliderDesc.setActiveEvents(R.ActiveEvents.COLLISION_EVENTS),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.world=e,this.controller=e.world.createCharacterController(this.completeOptions.offset),this.controller.setApplyImpulsesToDynamicBodies(this.completeOptions.pushDynamic),this.colliderDesc&&(this.collider=e.world.createCollider(this.colliderDesc)),this.collider&&this.objectA3&&z.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.collider&&=(e.world.removeCollider(this.collider,!1),z.delete(this.collider.handle),void 0),this.controller&&e.world.removeCharacterController(this.controller)}setPosition(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.nextLocation.set(this.tmpV1)}setPositionNow(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.collider&&this.collider.setTranslation(this.tmpV1),this.transform.loc.set(e),this.nextLocation.set(this.tmpV1)}setQuat(e){this.collider&&this.collider.setRotation(e),this.transform.quat.set(e)}setQuatNow(e){this.collider&&this.collider.setRotation(e),this.transform.quat.set(e)}setScale(e){}setScaleNow(e){}setLinearVelocity(e){}getLinearVelocity(e){return e||=new u,e.set(0,0,0),e}setAngularVelocity(e){}getAngularVelocity(e){return e||=new u,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.transform.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);let t=this.controller.computedMovement();if(this.tmpV1.add(t),this.collider.setTranslation(this.tmpV1),this.tmpV1.sub(this.capsuleCenter),this.transform.loc.set(this.tmpV1),this.nextLocation.set(this.tmpV1),!this.collider||!this.world||!this.objectA3)return;let n=(this.collider.activeEvents()&R.ActiveEvents.COLLISION_EVENTS)!==0,r=this.collider.collisionGroups();for(let e=0;e<this.controller.numComputedCollisions();e++){let t=this.controller.computedCollision(e);if(t&&t.collider){let e=(t.collider.activeEvents()&R.ActiveEvents.COLLISION_EVENTS)!==0;if(!n&&!e)continue;let i=z.get(t.collider.handle);if(!i)continue;Ce(r,t.collider.collisionGroups())&&this.world.kinematicCharacterCollisionEventQueue.push({objectA:this.objectA3,partOfA:this.collider.handle,objectB:i,partOfB:t.collider.handle,started:!0})}}}};function Ce(e,t){let n=e>>>16,r=e&65535,i=t>>>16,a=t&65535;return(r&i)!==0&&(a&n)!==0}var we={auto:!0,height:1.5,radius:.3,mass:1,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1},Te=class{transform;objectA3;completeOptions;colliderDesc;collider;bodyDesc;body;capsuleCenter;tmpV1;tmpV2;tmpQ1;physicsWorld;constructor(e={}){this.completeOptions={...we,...e},this.transform=new v,this.capsuleCenter=new u,this.tmpV1=new u,this.tmpV2=new u,this.tmpQ1=new d}init(e,t){if(this.transform.set(e),this.objectA3=t,this.completeOptions.auto){let e=new c.Vector3,n=new c.Quaternion,r=new c.Object3D;r.add(t.object3D),t.getPosition(this.tmpV1),this.tmpV1.write(e),r.position.set(e.x,e.y,e.z),t.getQuat(this.tmpQ1),this.tmpQ1.write(n),r.quaternion.set(n.x,n.y,n.z,n.w),t.getScale(this.tmpV2),this.tmpV2.write(e),r.scale.set(e.x,e.y,e.z);let i=new c.Box3().setFromObject(r);i.getSize(e),this.completeOptions.radius=Math.max(e.x,e.z)/2,this.completeOptions.height=e.y-this.completeOptions.radius*2,i.getCenter(e),this.capsuleCenter.set(e)}let n=this.completeOptions;this.bodyDesc=R.RigidBodyDesc.dynamic(),this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.bodyDesc.setRotation(e.quat),this.colliderDesc=R.ColliderDesc.capsule(this.completeOptions.height,this.completeOptions.radius),this.colliderDesc.setMass(n.mass);let r=n.membership<<16|n.filter;this.colliderDesc.setCollisionGroups(r),n.collisionDetection&&this.colliderDesc.setActiveEvents(R.ActiveEvents.COLLISION_EVENTS),this.colliderDesc.setRestitution(n.restitution).setFriction(n.friction)}addOneselfToPhysics(e){this.physicsWorld=e,this.bodyDesc&&(this.body=e.world.createRigidBody(this.bodyDesc),this.body.setEnabledRotations(!1,!1,!1,!0),this.body.setTranslation(this.transform.loc,!0),this.body.setRotation(this.transform.quat,!0)),this.colliderDesc&&(this.collider=e.world.createCollider(this.colliderDesc,this.body)),this.collider&&this.objectA3&&z.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.collider&&=(e.world.removeCollider(this.collider,!0),z.delete(this.collider.handle),void 0),this.body&&=(e.world.removeRigidBody(this.body),void 0),this.physicsWorld=void 0}setPosition(e){}setPositionNow(e){this.tmpV1.set(e),this.tmpV1.add(this.capsuleCenter),this.body?this.body.setTranslation(this.tmpV1,!0):this.bodyDesc?.setTranslation(this.tmpV1.x,this.tmpV1.y,this.tmpV1.z),this.transform.loc.set(e)}setQuat(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.transform.quat.set(e)}setQuatNow(e){this.body?this.body.setRotation(e,!0):this.bodyDesc?.setRotation(e),this.transform.quat.set(e)}setScale(e){}setScaleNow(e){}setLinearVelocity(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)}getLinearVelocity(e){return e||=new u,this.body?e.set(this.body.linvel()):this.bodyDesc&&e.set(this.bodyDesc.linvel),e}setAngularVelocity(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})}getAngularVelocity(e){return e||=new u,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){let e=this.body.translation(),t=new R.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.transform.loc.y<=0}update(e){if(!this.body)return;let t=new u(this.body.translation());t.sub(this.capsuleCenter),this.transform.loc.set(t),this.transform.quat.set(this.body.rotation())}},Ee=new c.SphereGeometry,De=new c.MeshStandardMaterial({color:16711680}),Oe=new c.Mesh(Ee,De),ke={left:-20,right:20,top:20,bottom:-20,angle:Math.PI/6,near:.1,far:100,shadowMapWidth:1024,shadowMapHeight:1024},W=class e{static defaultRotationOrder=`ZXY`;static defaultUpVector=new u(0,1,0);rotationOrder;upVector;object3D;scene;balloon;transformer;parent;children=[];clickListener;autoDirection=!1;constructor(e){this.autoDirection=!1,this.transformer=this.initTransformer(e),this.object3D=new c.Object3D;let t=this.initObject(e);t&&this.object3D.add(t),this.object3D.traverse(e=>{e.userData.a3js={objectA3:this}})}initObject(e){return Oe.clone()}initTransformer(e){return new y}setTransformer(e){U.t0.set(this.transformer.transform),e.init(U.t0,this),this.transformer=e}getTransformer(){return this.transformer}setMode(e,t){e===`Default`?this.setTransformer(new y):e===`Smooth`?this.setTransformer(new S(t)):e===`Follow`?this.setTransformer(new ee(t)):e===`Billboard`?this.setTransformer(new A(t)):e===`SmoothBillboard`?this.setTransformer(new M(t)):e===`SimplePhysics`?this.setTransformer(new le(t)):e===`KinematicCharacter`?this.setTransformer(new Se(t)):e===`DynamicCharacter`&&this.setTransformer(new Te(t))}update(t){let n=this.getLinearVelocity(),r=n.length();if(this.autoDirection&&r>1e-4){n.normalize();let t=this.upVector?this.upVector:e.defaultUpVector;U.v0.cross(n,t),U.v0.length()>1e-4&&(U.v0.set(0,0,0),p(U.v0,n,t,U.q0),this.setQuatNow(U.q0))}this.transformer.update(t),this.transformer.transform.write(this),this.children.forEach(e=>{e.update(t)})}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.object3D.add(e.object3D)}remove(e){if(e.parent!==this){console.warn(`ObjectA3.remove(obj) is ignored.`);return}let t=this.children.indexOf(e);this.children.splice(t,1),e.parent=void 0,this.object3D.remove(e.object3D)}setSpeechBubble(e){this.balloon?this.balloon.message=e:this.balloon=new Ae(e)}setClickListener(e){this.clickListener=e}handleCollision(e,t,n,r){}async clicked(){this.clickListener&&await this.clickListener(this)}setCastShadow(e){this.object3D.traverse(t=>{t instanceof c.Mesh&&(t.castShadow=e)})}setReceiveShadow(e){this.object3D.traverse(t=>{t instanceof c.Mesh&&(t.receiveShadow=e)})}setLightShadow(e,t){let n={...ke,...t};this.object3D.traverse(t=>{t instanceof c.DirectionalLight?(t.castShadow=e,t.shadow.camera.left=n.left,t.shadow.camera.right=n.right,t.shadow.camera.top=n.top,t.shadow.camera.bottom=n.bottom,t.shadow.camera.near=n.near,t.shadow.camera.far=n.far,t.shadow.camera.updateProjectionMatrix(),t.shadow.mapSize.width=n.shadowMapWidth,t.shadow.mapSize.height=n.shadowMapHeight):t instanceof c.SpotLight?(t.castShadow=e,t.angle=n.angle,t.shadow.camera.near=n.near,t.shadow.camera.far=n.far,t.shadow.camera.updateProjectionMatrix(),t.shadow.mapSize.width=n.shadowMapWidth,t.shadow.mapSize.height=n.shadowMapHeight):t instanceof c.PointLight&&(t.castShadow=e,t.shadow.camera.near=n.near,t.shadow.camera.far=n.far,t.shadow.camera.updateProjectionMatrix(),t.shadow.mapSize.width=n.shadowMapWidth,t.shadow.mapSize.height=n.shadowMapHeight)})}getPosition(e){return e?(e.set(this.transformer.transform.loc),e):this.transformer.transform.loc.clone()}setPosition(e,t,n){typeof e==`number`?U.v0.set(e,t,n):U.v0.set(e),this.transformer.setPosition(U.v0)}setPositionNow(e,t,n){typeof e==`number`?U.v0.set(e,t,n):U.v0.set(e),this.transformer.setPositionNow(U.v0)}getQuat(e){return e?(e.set(this.transformer.transform.quat),e):this.transformer.transform.quat.clone()}setQuat(e,t,n,r){typeof e==`number`?U.q0.set(e,t,n,r):U.q0.set(e),this.transformer.setQuat(U.q0)}setQuatNow(e,t,n,r){typeof e==`number`?U.q0.set(e,t,n,r):U.q0.set(e),this.transformer.setQuatNow(U.q0)}getScale(e){return e?(e.set(this.transformer.transform.scale),e):this.transformer.transform.scale.clone()}setScale(e,t,n){typeof e==`number`?U.v0.set(e,t,n):U.v0.set(e),this.transformer.setScale(U.v0)}setScaleNow(e,t,n){typeof e==`number`?U.v0.set(e,t,n):U.v0.set(e),this.transformer.setScaleNow(U.v0)}setRotation(t,n,r){typeof t==`number`?U.v0.set(t,n,r):U.v0.set(t),U.v0.scale(Math.PI/360);let i=this.rotationOrder?this.rotationOrder:e.defaultRotationOrder;m(U.v0,i,U.q1),this.setQuat(U.q1)}setRotationNow(t,n,r){typeof t==`number`?U.v0.set(t,n,r):U.v0.set(t),U.v0.scale(Math.PI/360);let i=this.rotationOrder?this.rotationOrder:e.defaultRotationOrder;m(U.v0,i,U.q0),this.setQuatNow(U.q0)}lookAt(t,n,r){typeof t==`number`?U.v1.set(t,n,r):t instanceof e?U.v1.set(t.transformer.transform.loc):U.v1.set(t);let i=this.upVector?this.upVector:e.defaultUpVector;p(this.transformer.transform.loc,U.v1,i,U.q1),this.setQuat(U.q1)}lookAtNow(t,n,r){typeof t==`number`?U.v1.set(t,n,r):t instanceof e?U.v1.set(t.transformer.transform.loc):U.v1.set(t);let i=this.upVector?this.upVector:e.defaultUpVector;p(this.transformer.transform.loc,U.v1,i,U.q1),this.setQuatNow(U.q1)}getUnitVecX(e){return e?(e.set(1,0,0),e.apply(this.object3D.quaternion)):new u(1,0,0).apply(this.object3D.quaternion)}getUnitVecY(e){return e?(e.set(0,1,0),e.apply(this.object3D.quaternion)):new u(0,1,0).apply(this.object3D.quaternion)}getUnitVecZ(e){return e?(e.set(0,0,1),e.apply(this.object3D.quaternion)):new u(0,0,1).apply(this.object3D.quaternion)}translate(e,t,n){U.v1.set(this.transformer.transform.loc),typeof e==`number`?U.v1.add(e,t,n):U.v1.add(e),this.setPosition(U.v1)}translateNow(e,t,n){U.v1.set(this.transformer.transform.loc),typeof e==`number`?U.v1.add(e,t,n):U.v1.add(e),this.setPositionNow(U.v1)}mulQuat(e,t,n,r){U.q1.set(this.transformer.transform.quat),typeof e==`number`?U.q1.mul(e,t,n,r):U.q1.mul(e),this.setQuat(U.q1)}mulQuatNow(e,t,n,r){U.q1.set(this.transformer.transform.quat),typeof e==`number`?U.q1.mul(e,t,n,r):U.q1.mul(e),this.setQuatNow(U.q1)}mulRotation(t,n,r){typeof t==`number`?U.v0.set(t,n,r):U.v0.set(t),U.v0.scale(Math.PI/360);let i=this.rotationOrder?this.rotationOrder:e.defaultRotationOrder;m(U.v0,i,U.q1),this.getQuat(U.q0),U.q0.mul(U.q1),this.setQuat(U.q0)}mulRotationNow(t,n,r){typeof t==`number`?U.v0.set(t,n,r):U.v0.set(t),U.v0.scale(Math.PI/360);let i=this.rotationOrder?this.rotationOrder:e.defaultRotationOrder;m(U.v0,i,U.q1),this.getQuat(U.q0),U.q0.mul(U.q1),this.setQuatNow(U.q0)}scaleBy(e,t,n){this.getScale(U.v0),typeof e==`number`?U.v0.set(U.v0.x*e,U.v0.y*t,U.v0.z*n):U.v0.set(U.v0.x*e.x,U.v0.y*e.y,U.v0.z*e.z),this.setScale(U.v0)}mulScaleNow(e,t,n){this.getScale(U.v0),typeof e==`number`?U.v0.set(U.v0.x*e,U.v0.y*t,U.v0.z*n):U.v0.set(U.v0.x*e.x,U.v0.y*e.y,U.v0.z*e.z),this.setScaleNow(U.v0)}moveForward(e){this.getUnitVecZ(U.v0),U.v0.scale(e),this.translate(U.v0)}moveForwardNow(e){this.getUnitVecZ(U.v0),U.v0.scale(e),this.translateNow(U.v0)}moveBackward(e){this.getUnitVecZ(U.v0),U.v0.scale(-e),this.translate(U.v0)}moveBackwardNow(e){this.getUnitVecZ(U.v0),U.v0.scale(-e),this.translateNow(U.v0)}moveRight(e){this.getUnitVecX(U.v0),U.v0.scale(-e),this.translate(U.v0)}moveRightNow(e){this.getUnitVecX(U.v0),U.v0.scale(-e),this.translateNow(U.v0)}moveLeft(e){this.getUnitVecX(U.v0),U.v0.scale(e),this.translate(U.v0)}moveLeftNow(e){this.getUnitVecX(U.v0),U.v0.scale(e),this.translateNow(U.v0)}moveUp(e){this.getUnitVecY(U.v0),U.v0.scale(e),this.translate(U.v0)}moveUpNow(e){this.getUnitVecY(U.v0),U.v0.scale(e),this.translateNow(U.v0)}moveDown(e){this.getUnitVecY(U.v0),U.v0.scale(-e),this.translate(U.v0)}moveDownNow(e){this.getUnitVecY(U.v0),U.v0.scale(-e),this.translateNow(U.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)}setLinearVelocity(e,t,n){typeof e==`number`?U.v0.set(e,t,n):U.v0.set(e),this.transformer.setLinearVelocity(U.v0)}getLinearVelocity(e){return this.transformer.getLinearVelocity(e)}setAngularVelocity(e,t,n){typeof e==`number`?U.v0.set(e,t,n):U.v0.set(e),this.transformer.setAngularVelocity(U.v0)}getAngularVelocity(e){return this.transformer.getAngularVelocity(e)}resetForce(){this.transformer.resetForce()}addForce(e,t,n){typeof e==`number`?U.v0.set(e,t,n):U.v0.set(e),this.transformer.addForce(U.v0)}addForceAtPoint(e,t,n,r,i,a){if(typeof e==`number`)if(typeof t==`number`)U.v0.set(e,t,n),U.v1.set(r,i,a);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 U.v0.set(e),U.v1.set(t);this.transformer.addForceAtPoint(U.v0,U.v1)}resetTorque(){this.transformer.resetTorque()}addTorque(e,t,n){typeof e==`number`?U.v0.set(e,t,n):U.v0.set(e),this.transformer.addTorque(U.v0)}applyImpulse(e,t,n){typeof e==`number`?U.v0.set(e,t,n):U.v0.set(e),this.transformer.applyImpulse(U.v0)}applyImpulseAtPoint(e,t,n,r,i,a){if(typeof e==`number`)if(typeof t==`number`)U.v0.set(e,t,n),U.v1.set(r,i,a);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 U.v0.set(e),U.v1.set(t);this.transformer.applyImpulseAtPoint(U.v0,U.v1)}applyTorqueImpulse(e,t,n){typeof e==`number`?U.v0.set(e,t,n):U.v0.set(e),this.transformer.applyTorqueImpulse(U.v0)}addOneselfToPhysics(e){this.transformer.addOneselfToPhysics(e)}removeOneselfFromPhysics(e){this.transformer.removeOneselfFromPhysics(e)}isGrounded(){return this.transformer.isGrounded()}},Ae=class{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}}},je=class{shape;motion;constructor(e,t){this.shape=e,this.motion=t}enable(e,t){this.motion.playCount=0,this.motion.time=0,e.add(this.shape.root)}disable(e,t){e.remove(this.shape.root)}},Me=class extends W{ready;actions;currentAction;stateAction;emoteAction;morphs;overwriteMorphs;autoAction=!1;haltActionName=`default`;walkActionName=`walk`;runActionName=`run`;minWalkSpeed=.1;minRunSpeed=1;constructor(e){super(e),this.actions={},this.morphs={},this.overwriteMorphs=!1,this.ready=this.asyncInit(e),this.autoAction=!1}syncInit(e,t,n={}){this.actions=t,this.stateAction=this.actions[e],this.currentAction=this.stateAction,this.object3D.clear(),this.morphs=n,this.stateAction?.enable(this.object3D,this.scene)}setActions(e){this.actions=e}getAction(e){return this.actions[e]}addAction(e,t){this.actions[e]=t}removeAction(e){let t=this.actions[e];return delete this.actions[e],t}getActionNames(){return Object.keys(this.actions)}setState(e){let t=this.actions[e];t&&(this.currentAction&&this.currentAction.disable(this.object3D,this.scene),t.enable(this.object3D,this.scene),this.currentAction=t,this.stateAction=t)}setEmote(e){let t=this.actions[e];t&&(this.currentAction&&this.currentAction.disable(this.object3D,this.scene),t.enable(this.object3D,this.scene),this.currentAction=t,this.emoteAction=t)}setMorphsOverwrite(e){this.overwriteMorphs=e}setMorph(e,t){if(e in this.morphs){let{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?(t=this.emoteAction.motion.update(e),this.emoteAction.motion.playCount>0&&(this.emoteAction.disable(this.object3D,this.scene),this.emoteAction=void 0,this.stateAction&&(this.stateAction.enable(this.object3D,this.scene),this.currentAction=this.stateAction))):this.stateAction&&(t=this.stateAction.motion.update(e)),t&&this.currentAction&&this.currentAction.shape.bones)for(let[e,n]of Object.entries(t)){let t=this.currentAction.shape.bones[e];if(t&&(n.loc&&t.position.set(n.loc.x,n.loc.y,n.loc.z),n.quat&&t.quaternion.set(n.quat.x,n.quat.y,n.quat.z,n.quat.w),n.scale&&t.scale.set(n.scale.x,n.scale.y,n.scale.z)),!this.overwriteMorphs&&n.morphs){for(let e of n.morphs)for(let t of Object.keys(this.morphs))if(t.startsWith(e.name)){let{array:n}=this.morphs[t];for(let t=0;t<n.length;t++)n[t]=e.vals[t];break}}}this.object3D.updateMatrixWorld(!0),this.currentAction&&this.currentAction.shape.skeleton?.update();let n=this.getLinearVelocity().length();this.autoAction&&(n<this.minWalkSpeed?this.actions[this.haltActionName]!==this.stateAction&&this.setState(this.haltActionName):n<this.minRunSpeed?this.actions[this.walkActionName]!==this.stateAction&&this.setState(this.walkActionName):this.actions[this.runActionName]!==this.stateAction&&this.setState(this.runActionName))}setAutoAction(e){this.autoAction=e}setAutoDirection(e){this.autoDirection=e}},Ne=class{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{}}},G=(e,t)=>()=>(t||(t={exports:{}},e(t.exports,t)),t.exports),Pe=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=void 0,e.VERSION=`9.0.1`}),K=G((e,t)=>{"use strict";var n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.toFastProperties=e.timer=e.peek=e.isES2015MapSupported=e.PRINT_WARNING=e.PRINT_ERROR=e.packArray=e.IDENTITY=e.NOOP=e.merge=e.groupBy=e.defaults=e.assignNoOverwrite=e.assign=e.zipObject=e.sortBy=e.indexOf=e.some=e.difference=e.every=e.isObject=e.isRegExp=e.isArray=e.partial=e.uniq=e.compact=e.reduce=e.findAll=e.find=e.cloneObj=e.cloneArr=e.contains=e.has=e.pick=e.reject=e.filter=e.dropRight=e.drop=e.isFunction=e.isUndefined=e.isString=e.forEach=e.last=e.first=e.flatten=e.map=e.mapValues=e.values=e.keys=e.isEmpty=void 0;function r(e){return e&&e.length===0}e.isEmpty=r;function i(e){return e==null?[]:Object.keys(e)}e.keys=i;function a(e){for(var t=[],n=Object.keys(e),r=0;r<n.length;r++)t.push(e[n[r]]);return t}e.values=a;function o(e,t){for(var n=[],r=i(e),a=0;a<r.length;a++){var o=r[a];n.push(t.call(null,e[o],o))}return n}e.mapValues=o;function s(e,t){for(var n=[],r=0;r<e.length;r++)n.push(t.call(null,e[r],r));return n}e.map=s;function c(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];Array.isArray(r)?t=t.concat(c(r)):t.push(r)}return t}e.flatten=c;function l(e){return r(e)?void 0:e[0]}e.first=l;function u(e){var t=e&&e.length;return t?e[t-1]:void 0}e.last=u;function d(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)t.call(null,e[n],n);else if(M(e))for(var r=i(e),n=0;n<r.length;n++){var a=r[n],o=e[a];t.call(null,o,a)}else throw Error(`non exhaustive match`)}e.forEach=d;function f(e){return typeof e==`string`}e.isString=f;function p(e){return e===void 0}e.isUndefined=p;function m(e){return e instanceof Function}e.isFunction=m;function h(e,t){return t===void 0&&(t=1),e.slice(t,e.length)}e.drop=h;function g(e,t){return t===void 0&&(t=1),e.slice(0,e.length-t)}e.dropRight=g;function _(e,t){var n=[];if(Array.isArray(e))for(var r=0;r<e.length;r++){var i=e[r];t.call(null,i)&&n.push(i)}return n}e.filter=_;function v(e,t){return _(e,function(e){return!t(e)})}e.reject=v;function y(e,t){for(var n=Object.keys(e),r={},i=0;i<n.length;i++){var a=n[i],o=e[a];t(o)&&(r[a]=o)}return r}e.pick=y;function b(e,t){return M(e)?e.hasOwnProperty(t):!1}e.has=b;function x(e,t){return w(e,function(e){return e===t})!==void 0}e.contains=x;function S(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t}e.cloneArr=S;function C(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}e.cloneObj=C;function w(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t.call(null,r))return r}}e.find=w;function T(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];t.call(null,i)&&n.push(i)}return n}e.findAll=T;function E(e,t,n){for(var r=Array.isArray(e),o=r?e:a(e),s=r?[]:i(e),c=n,l=0;l<o.length;l++)c=t.call(null,c,o[l],r?l:s[l]);return c}e.reduce=E;function D(e){return v(e,function(e){return e==null})}e.compact=D;function O(e,t){t===void 0&&(t=function(e){return e});var n=[];return E(e,function(e,r){var i=t(r);return x(n,i)?e:(n.push(i),e.concat(r))},[])}e.uniq=O;function k(e){var t=[...arguments].slice(1),n=[null].concat(t);return Function.bind.apply(e,n)}e.partial=k;function A(e){return Array.isArray(e)}e.isArray=A;function j(e){return e instanceof RegExp}e.isRegExp=j;function M(e){return e instanceof Object}e.isObject=M;function N(e,t){for(var n=0;n<e.length;n++)if(!t(e[n],n))return!1;return!0}e.every=N;function ee(e,t){return v(e,function(e){return x(t,e)})}e.difference=ee;function te(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return!0;return!1}e.some=te;function ne(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}e.indexOf=ne;function re(e,t){var n=S(e);return n.sort(function(e,n){return t(e)-t(n)}),n}e.sortBy=re;function ie(e,t){if(e.length!==t.length)throw Error(`can't zipObject with different number of keys and values!`);for(var n={},r=0;r<e.length;r++)n[e[r]]=t[r];return n}e.zipObject=ie;function P(e){for(var t=[...arguments].slice(1),n=0;n<t.length;n++)for(var r=t[n],a=i(r),o=0;o<a.length;o++){var s=a[o];e[s]=r[s]}return e}e.assign=P;function ae(e){for(var t=[...arguments].slice(1),n=0;n<t.length;n++)for(var r=t[n],a=i(r),o=0;o<a.length;o++){var s=a[o];b(e,s)||(e[s]=r[s])}return e}e.assignNoOverwrite=ae;function F(){var e=[...arguments];return ae.apply(void 0,n([{}],e))}e.defaults=F;function oe(e,t){var n={};return d(e,function(e){var r=t(e),i=n[r];i?i.push(e):n[r]=[e]}),n}e.groupBy=oe;function se(e,t){for(var n=C(e),r=i(t),a=0;a<r.length;a++){var o=r[a];n[o]=t[o]}return n}e.merge=se;function I(){}e.NOOP=I;function L(e){return e}e.IDENTITY=L;function R(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r===void 0?void 0:r)}return t}e.packArray=R;function z(e){console&&console.error&&console.error(`Error: `+e)}e.PRINT_ERROR=z;function ce(e){console&&console.warn&&console.warn(`Warning: `+e)}e.PRINT_WARNING=ce;function B(){return typeof Map==`function`}e.isES2015MapSupported=B;function le(e){return e[e.length-1]}e.peek=le;function ue(e){var t=new Date().getTime(),n=e();return{time:new Date().getTime()-t,value:n}}e.timer=ue;function de(e){function t(){}t.prototype=e;var n=new t;function r(){return typeof n.bar}return r(),r(),e}e.toFastProperties=de}),Fe=G((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define([],n):typeof t==`object`&&t.exports?t.exports=n():e.regexpToAst=n()})(typeof self<`u`?self:e,function(){function e(){}e.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},e.prototype.restoreState=function(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx},e.prototype.pattern=function(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar(`/`);var t=this.disjunction();this.consumeChar(`/`);for(var n={type:`Flags`,loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case`g`:o(n,`global`);break;case`i`:o(n,`ignoreCase`);break;case`m`:o(n,`multiLine`);break;case`u`:o(n,`unicode`);break;case`y`:o(n,`sticky`);break}if(this.idx!==this.input.length)throw Error(`Redundant input: `+this.input.substring(this.idx));return{type:`Pattern`,flags:n,value:t,loc:this.loc(0)}},e.prototype.disjunction=function(){var e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()===`|`;)this.consumeChar(`|`),e.push(this.alternative());return{type:`Disjunction`,value:e,loc:this.loc(t)}},e.prototype.alternative=function(){for(var e=[],t=this.idx;this.isTerm();)e.push(this.term());return{type:`Alternative`,value:e,loc:this.loc(t)}},e.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},e.prototype.assertion=function(){var e=this.idx;switch(this.popChar()){case`^`:return{type:`StartAnchor`,loc:this.loc(e)};case`$`:return{type:`EndAnchor`,loc:this.loc(e)};case`\\`:switch(this.popChar()){case`b`:return{type:`WordBoundary`,loc:this.loc(e)};case`B`:return{type:`NonWordBoundary`,loc:this.loc(e)}}throw Error(`Invalid Assertion Escape`);case`(`:this.consumeChar(`?`);var t;switch(this.popChar()){case`=`:t=`Lookahead`;break;case`!`:t=`NegativeLookahead`;break}s(t);var n=this.disjunction();return this.consumeChar(`)`),{type:t,value:n,loc:this.loc(e)}}c()},e.prototype.quantifier=function(e){var t,n=this.idx;switch(this.popChar()){case`*`:t={atLeast:0,atMost:1/0};break;case`+`:t={atLeast:1,atMost:1/0};break;case`?`:t={atLeast:0,atMost:1};break;case`{`:var r=this.integerIncludingZero();switch(this.popChar()){case`}`:t={atLeast:r,atMost:r};break;case`,`:var i;this.isDigit()?(i=this.integerIncludingZero(),t={atLeast:r,atMost:i}):t={atLeast:r,atMost:1/0},this.consumeChar(`}`);break}if(e===!0&&t===void 0)return;s(t);break}if(!(e===!0&&t===void 0))return s(t),this.peekChar(0)===`?`?(this.consumeChar(`?`),t.greedy=!1):t.greedy=!0,t.type=`Quantifier`,t.loc=this.loc(n),t},e.prototype.atom=function(){var e,t=this.idx;switch(this.peekChar()){case`.`:e=this.dotAll();break;case`\\`:e=this.atomEscape();break;case`[`:e=this.characterClass();break;case`(`:e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),s(e),e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e},e.prototype.dotAll=function(){return this.consumeChar(`.`),{type:`Set`,complement:!0,value:[i(`
2
+ `),i(`\r`),i(`\u2028`),i(`\u2029`)]}},e.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()}},e.prototype.decimalEscapeAtom=function(){return{type:`GroupBackReference`,value:this.positiveInteger()}},e.prototype.characterClassEscape=function(){var e,t=!1;switch(this.popChar()){case`d`:e=u;break;case`D`:e=u,t=!0;break;case`s`:e=f;break;case`S`:e=f,t=!0;break;case`w`:e=d;break;case`W`:e=d,t=!0;break}return s(e),{type:`Set`,value:e,complement:t}},e.prototype.controlEscapeAtom=function(){var e;switch(this.popChar()){case`f`:e=i(`\f`);break;case`n`:e=i(`
3
+ `);break;case`r`:e=i(`\r`);break;case`t`:e=i(` `);break;case`v`:e=i(`\v`);break}return s(e),{type:`Character`,value:e}},e.prototype.controlLetterEscapeAtom=function(){this.consumeChar(`c`);var e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error(`Invalid `);return{type:`Character`,value:e.toUpperCase().charCodeAt(0)-64}},e.prototype.nulCharacterAtom=function(){return this.consumeChar(`0`),{type:`Character`,value:i(`\0`)}},e.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar(`x`),this.parseHexDigits(2)},e.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar(`u`),this.parseHexDigits(4)},e.prototype.identityEscapeAtom=function(){return{type:`Character`,value:i(this.popChar())}},e.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
4
+ `:case`\r`:case`\u2028`:case`\u2029`:case`\\`:case`]`:throw Error(`TBD`);default:return{type:`Character`,value:i(this.popChar())}}},e.prototype.characterClass=function(){var e=[],t=!1;for(this.consumeChar(`[`),this.peekChar(0)===`^`&&(this.consumeChar(`^`),t=!0);this.isClassAtom();){var n=this.classAtom();if(n.type===`Character`&&this.isRangeDash()){this.consumeChar(`-`);var r=this.classAtom();if(r.type===`Character`){if(r.value<n.value)throw Error(`Range out of order in character class`);e.push({from:n.value,to:r.value})}else a(n.value,e),e.push(i(`-`)),a(r.value,e)}else a(n.value,e)}return this.consumeChar(`]`),{type:`Set`,complement:t,value:e}},e.prototype.classAtom=function(){switch(this.peekChar()){case`]`:case`
5
+ `:case`\r`:case`\u2028`:case`\u2029`:throw Error(`TBD`);case`\\`:return this.classEscape();default:return this.classPatternCharacterAtom()}},e.prototype.classEscape=function(){switch(this.consumeChar(`\\`),this.peekChar()){case`b`:return this.consumeChar(`b`),{type:`Character`,value:i(`\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()}},e.prototype.group=function(){var e=!0;switch(this.consumeChar(`(`),this.peekChar(0)){case`?`:this.consumeChar(`?`),this.consumeChar(`:`),e=!1;break;default:this.groupIdx++;break}var t=this.disjunction();this.consumeChar(`)`);var n={type:`Group`,capturing:e,value:t};return e&&(n.idx=this.groupIdx),n},e.prototype.positiveInteger=function(){var e=this.popChar();if(r.test(e)===!1)throw Error(`Expecting a positive integer`);for(;n.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)},e.prototype.integerIncludingZero=function(){var e=this.popChar();if(n.test(e)===!1)throw Error(`Expecting an integer`);for(;n.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)},e.prototype.patternCharacter=function(){var e=this.popChar();switch(e){case`
6
+ `: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:i(e)}}},e.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case`g`:case`i`:case`m`:case`u`:case`y`:return!0;default:return!1}},e.prototype.isRangeDash=function(){return this.peekChar()===`-`&&this.isClassAtom(1)},e.prototype.isDigit=function(){return n.test(this.peekChar(0))},e.prototype.isClassAtom=function(e){switch(e===void 0&&(e=0),this.peekChar(e)){case`]`:case`
7
+ `:case`\r`:case`\u2028`:case`\u2029`:return!1;default:return!0}},e.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},e.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case`.`:case`\\`:case`[`:case`(`:return!0;default:return!1}},e.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}},e.prototype.isQuantifier=function(){var e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}},e.prototype.isPatternCharacter=function(){switch(this.peekChar()){case`^`:case`$`:case`\\`:case`.`:case`*`:case`+`:case`?`:case`(`:case`)`:case`[`:case`|`:case`/`:case`
8
+ `:case`\r`:case`\u2028`:case`\u2029`:return!1;default:return!0}},e.prototype.parseHexDigits=function(e){for(var n=``,r=0;r<e;r++){var i=this.popChar();if(t.test(i)===!1)throw Error(`Expecting a HexDecimal digits`);n+=i}return{type:`Character`,value:parseInt(n,16)}},e.prototype.peekChar=function(e){return e===void 0&&(e=0),this.input[this.idx+e]},e.prototype.popChar=function(){var e=this.peekChar(0);return this.consumeChar(),e},e.prototype.consumeChar=function(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error(`Expected: '`+e+`' but found: '`+this.input[this.idx]+`' at offset: `+this.idx);if(this.idx>=this.input.length)throw Error(`Unexpected end of input`);this.idx++},e.prototype.loc=function(e){return{begin:e,end:this.idx}};var t=/[0-9a-fA-F]/,n=/[0-9]/,r=/[1-9]/;function i(e){return e.charCodeAt(0)}function a(e,t){e.length===void 0?t.push(e):e.forEach(function(e){t.push(e)})}function o(e,t){if(e[t]===!0)throw`duplicate flag `+t;e[t]=!0}function s(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`)}function c(){throw Error(`Internal Error - Should never get here!`)}var l,u=[];for(l=i(`0`);l<=i(`9`);l++)u.push(l);var d=[i(`_`)].concat(u);for(l=i(`a`);l<=i(`z`);l++)d.push(l);for(l=i(`A`);l<=i(`Z`);l++)d.push(l);var f=[i(` `),i(`\f`),i(`
9
+ `),i(`\r`),i(` `),i(`\v`),i(` `),i(`\xA0`),i(``),i(` `),i(``),i(``),i(``),i(``),i(``),i(``),i(``),i(``),i(``),i(``),i(`\u2028`),i(`\u2029`),i(``),i(``),i(` `),i(``)];function p(){}return p.prototype.visitChildren=function(e){for(var t in e){var n=e[t];e.hasOwnProperty(t)&&(n.type===void 0?Array.isArray(n)&&n.forEach(function(e){this.visit(e)},this):this.visit(n))}},p.prototype.visit=function(e){switch(e.type){case`Pattern`:this.visitPattern(e);break;case`Flags`:this.visitFlags(e);break;case`Disjunction`:this.visitDisjunction(e);break;case`Alternative`:this.visitAlternative(e);break;case`StartAnchor`:this.visitStartAnchor(e);break;case`EndAnchor`:this.visitEndAnchor(e);break;case`WordBoundary`:this.visitWordBoundary(e);break;case`NonWordBoundary`:this.visitNonWordBoundary(e);break;case`Lookahead`:this.visitLookahead(e);break;case`NegativeLookahead`:this.visitNegativeLookahead(e);break;case`Character`:this.visitCharacter(e);break;case`Set`:this.visitSet(e);break;case`Group`:this.visitGroup(e);break;case`GroupBackReference`:this.visitGroupBackReference(e);break;case`Quantifier`:this.visitQuantifier(e);break}this.visitChildren(e)},p.prototype.visitPattern=function(e){},p.prototype.visitFlags=function(e){},p.prototype.visitDisjunction=function(e){},p.prototype.visitAlternative=function(e){},p.prototype.visitStartAnchor=function(e){},p.prototype.visitEndAnchor=function(e){},p.prototype.visitWordBoundary=function(e){},p.prototype.visitNonWordBoundary=function(e){},p.prototype.visitLookahead=function(e){},p.prototype.visitNegativeLookahead=function(e){},p.prototype.visitCharacter=function(e){},p.prototype.visitSet=function(e){},p.prototype.visitGroup=function(e){},p.prototype.visitGroupBackReference=function(e){},p.prototype.visitQuantifier=function(e){},{RegExpParser:e,BaseRegExpVisitor:p,VERSION:`0.5.0`}})}),Ie=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.clearRegExpParserCache=e.getRegExpAst=void 0;var t=Fe(),n={},r=new t.RegExpParser;function i(e){var t=e.toString();if(n.hasOwnProperty(t))return n[t];var i=r.pattern(t);return n[t]=i,i}e.getRegExpAst=i;function a(){n={}}e.clearRegExpParserCache=a}),Le=G(e=>{"use strict";var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.canMatchCharCode=e.firstCharOptimizedIndices=e.getOptimizedStartCodesIndices=e.failedOptimizationPrefixMsg=void 0;var n=Fe(),r=K(),i=Ie(),a=Re(),o=`Complement Sets are not supported for first char optimization`;e.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
10
+ `;function s(t,a){a===void 0&&(a=!1);try{var s=i.getRegExpAst(t);return c(s.value,{},s.flags.ignoreCase)}catch(i){if(i.message===o)a&&r.PRINT_WARNING(``+e.failedOptimizationPrefixMsg+(` Unable to optimize: < `+t.toString()+` >
11
11
  `)+` Complement Sets cannot be automatically optimized.
12
12
  This will disable the lexer's first char optimizations.
13
- See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var C="";l&&(C=`
13
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var l=``;a&&(l=`
14
14
  This will disable the lexer's first char optimizations.
15
- See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),n.PRINT_ERROR(i.failedOptimizationPrefixMsg+`
16
- `+(" Failed parsing: < "+g.toString()+` >
17
- `)+(" Using the regexp-to-ast library version: "+t.VERSION+`
18
- `)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+C)}}return[]}i.getOptimizedStartCodesIndices=c;function A(g,l,d){switch(g.type){case"Disjunction":for(var f=0;f<g.value.length;f++)A(g.value[f],l,d);break;case"Alternative":for(var C=g.value,f=0;f<C.length;f++){var I=C[f];switch(I.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var y=I;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 Q=H;if(d===!0)for(var P=Q.from;P<=Q.to;P++)a(P,l,d);else{for(var P=Q.from;P<=Q.to&&P<o.minOptimizationVal;P++)a(P,l,d);if(Q.to>=o.minOptimizationVal)for(var D=Q.from>=o.minOptimizationVal?Q.from:o.minOptimizationVal,R=Q.to,F=o.charCodeToOptimizedIndex(D),_=o.charCodeToOptimizedIndex(R),X=F;X<=_;X++)l[X]=X}}});break;case"Group":A(y.value,l,d);break;default:throw Error("Non Exhaustive Match")}var v=y.quantifier!==void 0&&y.quantifier.atLeast===0;if(y.type==="Group"&&m(y)===!1||y.type!=="Group"&&v===!1)break}break;default:throw Error("non exhaustive match!")}return n.values(l)}i.firstCharOptimizedIndices=A;function a(g,l,d){var f=o.charCodeToOptimizedIndex(g);l[f]=f,d===!0&&h(g,l)}function h(g,l){var d=String.fromCharCode(g),f=d.toUpperCase();if(f!==d){var C=o.charCodeToOptimizedIndex(f.charCodeAt(0));l[C]=C}else{var I=d.toLowerCase();if(I!==d){var C=o.charCodeToOptimizedIndex(I.charCodeAt(0));l[C]=C}}}function u(g,l){return n.find(g.value,function(d){if(typeof d=="number")return n.contains(l,d);var f=d;return n.find(l,function(C){return f.from<=C&&C<=f.to})!==void 0})}function m(g){return g.quantifier&&g.quantifier.atLeast===0?!0:g.value?n.isArray(g.value)?n.every(g.value,m):m(g.value):!1}var p=(function(g){e(l,g);function l(d){var f=g.call(this)||this;return f.targetCharCodes=d,f.found=!1,f}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}g.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 E(g,l){if(l instanceof RegExp){var d=r.getRegExpAst(l),f=new p(g);return f.visit(d),f.found}else return n.find(l,function(C){return n.contains(g,C.charCodeAt(0))})!==void 0}i.canMatchCharCode=E}),Ai=ve(i=>{var e=i&&i.__extends||(function(){var G=function(j,Y){return G=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(z,te){z.__proto__=te}||function(z,te){for(var oe in te)Object.prototype.hasOwnProperty.call(te,oe)&&(z[oe]=te[oe])},G(j,Y)};return function(j,Y){if(typeof Y!="function"&&Y!==null)throw new TypeError("Class extends value "+String(Y)+" is not a constructor or null");G(j,Y);function z(){this.constructor=j}j.prototype=Y===null?Object.create(Y):(z.prototype=Y.prototype,new z)}})();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=Cn(),n=Gt(),r=Ne(),o=ro(),s=yn(),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(G,j){j=r.defaults(j,{useSticky:i.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
19
- `],tracer:function(ye,le){return le()}});var Y=j.tracer;Y("initCharCodeToOptimizedIndexMap",function(){de()});var z;Y("Reject Lexer.NA",function(){z=r.reject(G,function(ye){return ye[c]===n.Lexer.NA})});var te=!1,oe;Y("Transform Patterns",function(){te=!1,oe=r.map(z,function(ye){var le=ye[c];if(r.isRegExp(le)){var Ue=le.source;return Ue.length===1&&Ue!=="^"&&Ue!=="$"&&Ue!=="."&&!le.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]:j.useSticky?R(le):D(le)}else{if(r.isFunction(le))return te=!0,{exec:le};if(r.has(le,"exec"))return te=!0,le;if(typeof le=="string"){if(le.length===1)return le;var k=le.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),T=new RegExp(k);return j.useSticky?R(T):D(T)}else throw Error("non exhaustive match")}})});var Be,we,De,ze,Je;Y("misc mapping",function(){Be=r.map(z,function(ye){return ye.tokenTypeIdx}),we=r.map(z,function(ye){var le=ye.GROUP;if(le!==n.Lexer.SKIPPED){if(r.isString(le))return le;if(r.isUndefined(le))return!1;throw Error("non exhaustive match")}}),De=r.map(z,function(ye){var le=ye.LONGER_ALT;if(le){var Ue=r.indexOf(z,le);return Ue}}),ze=r.map(z,function(ye){return ye.PUSH_MODE}),Je=r.map(z,function(ye){return r.has(ye,"POP_MODE")})});var Ve;Y("Line Terminator Handling",function(){var ye=ue(j.lineTerminatorCharacters);Ve=r.map(z,function(le){return!1}),j.positionTracking!=="onlyOffset"&&(Ve=r.map(z,function(le){if(r.has(le,"LINE_BREAKS"))return le.LINE_BREAKS;if($(le,ye)===!1)return o.canMatchCharCode(ye,le.PATTERN)}))});var O,J,q,re;Y("Misc Mapping #2",function(){O=r.map(z,Z),J=r.map(oe,V),q=r.reduce(z,function(ye,le){var Ue=le.GROUP;return r.isString(Ue)&&Ue!==n.Lexer.SKIPPED&&(ye[Ue]=[]),ye},{}),re=r.map(oe,function(ye,le){return{pattern:oe[le],longerAlt:De[le],canLineTerminator:Ve[le],isCustom:O[le],short:J[le],group:we[le],push:ze[le],pop:Je[le],tokenTypeIdx:Be[le],tokenType:z[le]}})});var fe=!0,Qe=[];return j.safeMode||Y("First Char Optimization",function(){Qe=r.reduce(z,function(ye,le,Ue){if(typeof le.PATTERN=="string"){var k=le.PATTERN.charCodeAt(0),T=ee(k);ae(ye,T,re[Ue])}else if(r.isArray(le.START_CHARS_HINT)){var B;r.forEach(le.START_CHARS_HINT,function(w){var N=typeof w=="string"?w.charCodeAt(0):w,M=ee(N);B!==M&&(B=M,ae(ye,M,re[Ue]))})}else if(r.isRegExp(le.PATTERN))if(le.PATTERN.unicode)fe=!1,j.ensureOptimizations&&r.PRINT_ERROR(""+o.failedOptimizationPrefixMsg+(" Unable to analyze < "+le.PATTERN.toString()+` > pattern.
15
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),r.PRINT_ERROR(e.failedOptimizationPrefixMsg+`
16
+ `+(` Failed parsing: < `+t.toString()+` >
17
+ `)+(` Using the regexp-to-ast library version: `+n.VERSION+`
18
+ `)+` Please open an issue at: https://github.com/bd82/regexp-to-ast/issues`+l)}}return[]}e.getOptimizedStartCodesIndices=s;function c(e,t,n){switch(e.type){case`Disjunction`:for(var i=0;i<e.value.length;i++)c(e.value[i],t,n);break;case`Alternative`:for(var s=e.value,i=0;i<s.length;i++){var u=s[i];switch(u.type){case`EndAnchor`:case`GroupBackReference`:case`Lookahead`:case`NegativeLookahead`:case`StartAnchor`:case`WordBoundary`:case`NonWordBoundary`:continue}var d=u;switch(d.type){case`Character`:l(d.value,t,n);break;case`Set`:if(d.complement===!0)throw Error(o);r.forEach(d.value,function(e){if(typeof e==`number`)l(e,t,n);else{var r=e;if(n===!0)for(var i=r.from;i<=r.to;i++)l(i,t,n);else{for(var i=r.from;i<=r.to&&i<a.minOptimizationVal;i++)l(i,t,n);if(r.to>=a.minOptimizationVal)for(var o=r.from>=a.minOptimizationVal?r.from:a.minOptimizationVal,s=r.to,c=a.charCodeToOptimizedIndex(o),u=a.charCodeToOptimizedIndex(s),d=c;d<=u;d++)t[d]=d}}});break;case`Group`:c(d.value,t,n);break;default:throw Error(`Non Exhaustive Match`)}var p=d.quantifier!==void 0&&d.quantifier.atLeast===0;if(d.type===`Group`&&f(d)===!1||d.type!==`Group`&&p===!1)break}break;default:throw Error(`non exhaustive match!`)}return r.values(t)}e.firstCharOptimizedIndices=c;function l(e,t,n){var r=a.charCodeToOptimizedIndex(e);t[r]=r,n===!0&&u(e,t)}function u(e,t){var n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){var i=a.charCodeToOptimizedIndex(r.charCodeAt(0));t[i]=i}else{var o=n.toLowerCase();if(o!==n){var i=a.charCodeToOptimizedIndex(o.charCodeAt(0));t[i]=i}}}function d(e,t){return r.find(e.value,function(e){if(typeof e==`number`)return r.contains(t,e);var n=e;return r.find(t,function(e){return n.from<=e&&e<=n.to})!==void 0})}function f(e){return e.quantifier&&e.quantifier.atLeast===0?!0:e.value?r.isArray(e.value)?r.every(e.value,f):f(e.value):!1}var p=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.targetCharCodes=t,n.found=!1,n}return n.prototype.visitChildren=function(t){if(this.found!==!0){switch(t.type){case`Lookahead`:this.visitLookahead(t);return;case`NegativeLookahead`:this.visitNegativeLookahead(t);return}e.prototype.visitChildren.call(this,t)}},n.prototype.visitCharacter=function(e){r.contains(this.targetCharCodes,e.value)&&(this.found=!0)},n.prototype.visitSet=function(e){e.complement?d(e,this.targetCharCodes)===void 0&&(this.found=!0):d(e,this.targetCharCodes)!==void 0&&(this.found=!0)},n}(n.BaseRegExpVisitor);function m(e,t){if(t instanceof RegExp){var n=i.getRegExpAst(t),a=new p(e);return a.visit(n),a.found}else return r.find(t,function(t){return r.contains(e,t.charCodeAt(0))})!==void 0}e.canMatchCharCode=m}),Re=G(e=>{"use strict";var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.charCodeToOptimizedIndex=e.minOptimizationVal=e.buildLineBreakIssueMessage=e.LineTerminatorOptimizedTester=e.isShortPattern=e.isCustomPattern=e.cloneEmptyGroups=e.performWarningRuntimeChecks=e.performRuntimeChecks=e.addStickyFlag=e.addStartOfInput=e.findUnreachablePatterns=e.findModesThatDoNotExist=e.findInvalidGroupType=e.findDuplicatePatterns=e.findUnsupportedFlags=e.findStartOfInputAnchor=e.findEmptyMatchRegExps=e.findEndOfInputAnchor=e.findInvalidPatterns=e.findMissingPatterns=e.validatePatterns=e.analyzeTokenTypes=e.enableSticky=e.disableSticky=e.SUPPORT_STICKY=e.MODES=e.DEFAULT_MODE=void 0;var n=Fe(),r=Ve(),i=K(),a=Le(),o=Ie(),s=`PATTERN`;e.DEFAULT_MODE=`defaultMode`,e.MODES=`modes`,e.SUPPORT_STICKY=typeof RegExp(`(?:)`).sticky==`boolean`;function c(){e.SUPPORT_STICKY=!1}e.disableSticky=c;function l(){e.SUPPORT_STICKY=!0}e.enableSticky=l;function u(t,n){n=i.defaults(n,{useSticky:e.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:`full`,lineTerminatorCharacters:[`\r`,`
19
+ `],tracer:function(e,t){return t()}});var o=n.tracer;o(`initCharCodeToOptimizedIndexMap`,function(){ae()});var c;o(`Reject Lexer.NA`,function(){c=i.reject(t,function(e){return e[s]===r.Lexer.NA})});var l=!1,u;o(`Transform Patterns`,function(){l=!1,u=i.map(c,function(e){var t=e[s];if(i.isRegExp(t)){var r=t.source;return r.length===1&&r!==`^`&&r!==`$`&&r!==`.`&&!t.ignoreCase?r:r.length===2&&r[0]===`\\`&&!i.contains([`d`,`D`,`s`,`S`,`t`,`r`,`n`,`t`,`0`,`c`,`b`,`B`,`f`,`v`,`w`,`W`],r[1])?r[1]:n.useSticky?O(t):D(t)}else{if(i.isFunction(t))return l=!0,{exec:t};if(i.has(t,`exec`))return l=!0,t;if(typeof t==`string`){if(t.length===1)return t;var a=t.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`),o=new RegExp(a);return n.useSticky?O(o):D(o)}else throw Error(`non exhaustive match`)}})});var d,f,p,m,h;o(`misc mapping`,function(){d=i.map(c,function(e){return e.tokenTypeIdx}),f=i.map(c,function(e){var t=e.GROUP;if(t!==r.Lexer.SKIPPED){if(i.isString(t))return t;if(i.isUndefined(t))return!1;throw Error(`non exhaustive match`)}}),p=i.map(c,function(e){var t=e.LONGER_ALT;if(t)return i.indexOf(c,t)}),m=i.map(c,function(e){return e.PUSH_MODE}),h=i.map(c,function(e){return i.has(e,`POP_MODE`)})});var g;o(`Line Terminator Handling`,function(){var e=ne(n.lineTerminatorCharacters);g=i.map(c,function(e){return!1}),n.positionTracking!==`onlyOffset`&&(g=i.map(c,function(t){if(i.has(t,`LINE_BREAKS`))return t.LINE_BREAKS;if(ee(t,e)===!1)return a.canMatchCharCode(e,t.PATTERN)}))});var _,v,y,b;o(`Misc Mapping #2`,function(){_=i.map(c,M),v=i.map(u,N),y=i.reduce(c,function(e,t){var n=t.GROUP;return i.isString(n)&&n!==r.Lexer.SKIPPED&&(e[n]=[]),e},{}),b=i.map(u,function(e,t){return{pattern:u[t],longerAlt:p[t],canLineTerminator:g[t],isCustom:_[t],short:v[t],group:f[t],push:m[t],pop:h[t],tokenTypeIdx:d[t],tokenType:c[t]}})});var x=!0,S=[];return n.safeMode||o(`First Char Optimization`,function(){S=i.reduce(c,function(e,t,r){if(typeof t.PATTERN==`string`)re(e,P(t.PATTERN.charCodeAt(0)),b[r]);else if(i.isArray(t.START_CHARS_HINT)){var o;i.forEach(t.START_CHARS_HINT,function(t){var n=P(typeof t==`string`?t.charCodeAt(0):t);o!==n&&(o=n,re(e,n,b[r]))})}else if(i.isRegExp(t.PATTERN))if(t.PATTERN.unicode)x=!1,n.ensureOptimizations&&i.PRINT_ERROR(``+a.failedOptimizationPrefixMsg+(` Unable to analyze < `+t.PATTERN.toString()+` > pattern.
20
20
  `)+` The regexp unicode flag is not currently supported by the regexp-to-ast library.
21
21
  This will disable the lexer's first char optimizations.
22
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var S=o.getOptimizedStartCodesIndices(le.PATTERN,j.ensureOptimizations);r.isEmpty(S)&&(fe=!1),r.forEach(S,function(w){ae(ye,w,re[Ue])})}else j.ensureOptimizations&&r.PRINT_ERROR(""+o.failedOptimizationPrefixMsg+(" TokenType: <"+le.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
22
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var s=a.getOptimizedStartCodesIndices(t.PATTERN,n.ensureOptimizations);i.isEmpty(s)&&(x=!1),i.forEach(s,function(t){re(e,t,b[r])})}else n.ensureOptimizations&&i.PRINT_ERROR(``+a.failedOptimizationPrefixMsg+(` TokenType: <`+t.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
23
23
  `)+` This will disable the lexer's first char optimizations.
24
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),fe=!1;return ye},[])}),Y("ArrayPacking",function(){Qe=r.packArray(Qe)}),{emptyGroups:q,patternIdxToConfig:re,charCodeToPatternIdxToConfig:Qe,hasCustom:te,canBeOptimized:fe}}i.analyzeTokenTypes=h;function u(G,j){var Y=[],z=p(G);Y=Y.concat(z.errors);var te=E(z.valid),oe=te.valid;return Y=Y.concat(te.errors),Y=Y.concat(m(oe)),Y=Y.concat(v(oe)),Y=Y.concat(L(oe,j)),Y=Y.concat(H(oe)),Y}i.validatePatterns=u;function m(G){var j=[],Y=r.filter(G,function(z){return r.isRegExp(z[c])});return j=j.concat(l(Y)),j=j.concat(C(Y)),j=j.concat(I(Y)),j=j.concat(y(Y)),j=j.concat(d(Y)),j}function p(G){var j=r.filter(G,function(te){return!r.has(te,c)}),Y=r.map(j,function(te){return{message:"Token Type: ->"+te.name+"<- missing static 'PATTERN' property",type:n.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[te]}}),z=r.difference(G,j);return{errors:Y,valid:z}}i.findMissingPatterns=p;function E(G){var j=r.filter(G,function(te){var oe=te[c];return!r.isRegExp(oe)&&!r.isFunction(oe)&&!r.has(oe,"exec")&&!r.isString(oe)}),Y=r.map(j,function(te){return{message:"Token Type: ->"+te.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:[te]}}),z=r.difference(G,j);return{errors:Y,valid:z}}i.findInvalidPatterns=E;var g=/[^\\][\$]/;function l(G){var j=(function(te){e(oe,te);function oe(){var Be=te!==null&&te.apply(this,arguments)||this;return Be.found=!1,Be}return oe.prototype.visitEndAnchor=function(Be){this.found=!0},oe})(t.BaseRegExpVisitor),Y=r.filter(G,function(te){var oe=te[c];try{var Be=s.getRegExpAst(oe),we=new j;return we.visit(Be),we.found}catch{return g.test(oe.source)}}),z=r.map(Y,function(te){return{message:`Unexpected RegExp Anchor Error:
25
- Token Type: ->`+te.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
26
- See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[te]}});return z}i.findEndOfInputAnchor=l;function d(G){var j=r.filter(G,function(z){var te=z[c];return te.test("")}),Y=r.map(j,function(z){return{message:"Token Type: ->"+z.name+"<- static 'PATTERN' must not match an empty string",type:n.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[z]}});return Y}i.findEmptyMatchRegExps=d;var f=/[^\\[][\^]|^\^/;function C(G){var j=(function(te){e(oe,te);function oe(){var Be=te!==null&&te.apply(this,arguments)||this;return Be.found=!1,Be}return oe.prototype.visitStartAnchor=function(Be){this.found=!0},oe})(t.BaseRegExpVisitor),Y=r.filter(G,function(te){var oe=te[c];try{var Be=s.getRegExpAst(oe),we=new j;return we.visit(Be),we.found}catch{return f.test(oe.source)}}),z=r.map(Y,function(te){return{message:`Unexpected RegExp Anchor Error:
27
- Token Type: ->`+te.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
28
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:n.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[te]}});return z}i.findStartOfInputAnchor=C;function I(G){var j=r.filter(G,function(z){var te=z[c];return te instanceof RegExp&&(te.multiline||te.global)}),Y=r.map(j,function(z){return{message:"Token Type: ->"+z.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:n.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[z]}});return Y}i.findUnsupportedFlags=I;function y(G){var j=[],Y=r.map(G,function(oe){return r.reduce(G,function(Be,we){return oe.PATTERN.source===we.PATTERN.source&&!r.contains(j,we)&&we.PATTERN!==n.Lexer.NA&&(j.push(we),Be.push(we)),Be},[])});Y=r.compact(Y);var z=r.filter(Y,function(oe){return oe.length>1}),te=r.map(z,function(oe){var Be=r.map(oe,function(De){return De.name}),we=r.first(oe).PATTERN;return{message:"The same RegExp pattern ->"+we+"<-"+("has been used in all of the following Token Types: "+Be.join(", ")+" <-"),type:n.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:oe}});return te}i.findDuplicatePatterns=y;function v(G){var j=r.filter(G,function(z){if(!r.has(z,"GROUP"))return!1;var te=z.GROUP;return te!==n.Lexer.SKIPPED&&te!==n.Lexer.NA&&!r.isString(te)}),Y=r.map(j,function(z){return{message:"Token Type: ->"+z.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:n.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[z]}});return Y}i.findInvalidGroupType=v;function L(G,j){var Y=r.filter(G,function(te){return te.PUSH_MODE!==void 0&&!r.contains(j,te.PUSH_MODE)}),z=r.map(Y,function(te){var oe="Token Type: ->"+te.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+te.PUSH_MODE+"<-which does not exist";return{message:oe,type:n.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[te]}});return z}i.findModesThatDoNotExist=L;function H(G){var j=[],Y=r.reduce(G,function(z,te,oe){var Be=te.PATTERN;return Be===n.Lexer.NA||(r.isString(Be)?z.push({str:Be,idx:oe,tokenType:te}):r.isRegExp(Be)&&P(Be)&&z.push({str:Be.source,idx:oe,tokenType:te})),z},[]);return r.forEach(G,function(z,te){r.forEach(Y,function(oe){var Be=oe.str,we=oe.idx,De=oe.tokenType;if(te<we&&Q(Be,z.PATTERN)){var ze="Token: ->"+De.name+`<- can never be matched.
29
- `+("Because it appears AFTER the Token Type ->"+z.name+"<-")+`in the lexer's definition.
30
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;j.push({message:ze,type:n.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[z,De]})}})}),j}i.findUnreachablePatterns=H;function Q(G,j){if(r.isRegExp(j)){var Y=j.exec(G);return Y!==null&&Y.index===0}else{if(r.isFunction(j))return j(G,0,[],{});if(r.has(j,"exec"))return j.exec(G,0,[],{});if(typeof j=="string")return j===G;throw Error("non exhaustive match")}}function P(G){var j=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return r.find(j,function(Y){return G.source.indexOf(Y)!==-1})===void 0}function D(G){var j=G.ignoreCase?"i":"";return new RegExp("^(?:"+G.source+")",j)}i.addStartOfInput=D;function R(G){var j=G.ignoreCase?"iy":"y";return new RegExp(""+G.source,j)}i.addStickyFlag=R;function F(G,j,Y){var z=[];return r.has(G,i.DEFAULT_MODE)||z.push({message:"A MultiMode Lexer cannot be initialized without a <"+i.DEFAULT_MODE+`> property in its definition
31
- `,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),r.has(G,i.MODES)||z.push({message:"A MultiMode Lexer cannot be initialized without a <"+i.MODES+`> property in its definition
32
- `,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),r.has(G,i.MODES)&&r.has(G,i.DEFAULT_MODE)&&!r.has(G.modes,G.defaultMode)&&z.push({message:"A MultiMode Lexer cannot be initialized with a "+i.DEFAULT_MODE+": <"+G.defaultMode+`>which does not exist
33
- `,type:n.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),r.has(G,i.MODES)&&r.forEach(G.modes,function(te,oe){r.forEach(te,function(Be,we){r.isUndefined(Be)&&z.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+oe+"> at index: <"+we+`>
34
- `),type:n.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),z}i.performRuntimeChecks=F;function _(G,j,Y){var z=[],te=!1,oe=r.compact(r.flatten(r.mapValues(G.modes,function(De){return De}))),Be=r.reject(oe,function(De){return De[c]===n.Lexer.NA}),we=ue(Y);return j&&r.forEach(Be,function(De){var ze=$(De,we);if(ze!==!1){var Je=ie(De,ze),Ve={message:Je,type:ze.issue,tokenType:De};z.push(Ve)}else r.has(De,"LINE_BREAKS")?De.LINE_BREAKS===!0&&(te=!0):o.canMatchCharCode(we,De.PATTERN)&&(te=!0)}),j&&!te&&z.push({message:`Warning: No LINE_BREAKS Found.
24
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),x=!1;return e},[])}),o(`ArrayPacking`,function(){S=i.packArray(S)}),{emptyGroups:y,patternIdxToConfig:b,charCodeToPatternIdxToConfig:S,hasCustom:l,canBeOptimized:x}}e.analyzeTokenTypes=u;function d(e,t){var n=[],r=p(e);n=n.concat(r.errors);var i=m(r.valid),a=i.valid;return n=n.concat(i.errors),n=n.concat(f(a)),n=n.concat(S(a)),n=n.concat(C(a,t)),n=n.concat(w(a)),n}e.validatePatterns=d;function f(e){var t=[],n=i.filter(e,function(e){return i.isRegExp(e[s])});return t=t.concat(g(n)),t=t.concat(y(n)),t=t.concat(b(n)),t=t.concat(x(n)),t=t.concat(_(n)),t}function p(e){var t=i.filter(e,function(e){return!i.has(e,s)});return{errors:i.map(t,function(e){return{message:`Token Type: ->`+e.name+`<- missing static 'PATTERN' property`,type:r.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[e]}}),valid:i.difference(e,t)}}e.findMissingPatterns=p;function m(e){var t=i.filter(e,function(e){var t=e[s];return!i.isRegExp(t)&&!i.isFunction(t)&&!i.has(t,`exec`)&&!i.isString(t)});return{errors:i.map(t,function(e){return{message:`Token Type: ->`+e.name+`<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.`,type:r.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[e]}}),valid:i.difference(e,t)}}e.findInvalidPatterns=m;var h=/[^\\][\$]/;function g(e){var a=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.found=!1,t}return n.prototype.visitEndAnchor=function(e){this.found=!0},n}(n.BaseRegExpVisitor),c=i.filter(e,function(e){var t=e[s];try{var n=o.getRegExpAst(t),r=new a;return r.visit(n),r.found}catch{return h.test(t.source)}});return i.map(c,function(e){return{message:`Unexpected RegExp Anchor Error:
25
+ Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
26
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:r.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[e]}})}e.findEndOfInputAnchor=g;function _(e){var t=i.filter(e,function(e){return e[s].test(``)});return i.map(t,function(e){return{message:`Token Type: ->`+e.name+`<- static 'PATTERN' must not match an empty string`,type:r.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[e]}})}e.findEmptyMatchRegExps=_;var v=/[^\\[][\^]|^\^/;function y(e){var a=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.found=!1,t}return n.prototype.visitStartAnchor=function(e){this.found=!0},n}(n.BaseRegExpVisitor),c=i.filter(e,function(e){var t=e[s];try{var n=o.getRegExpAst(t),r=new a;return r.visit(n),r.found}catch{return v.test(t.source)}});return i.map(c,function(e){return{message:`Unexpected RegExp Anchor Error:
27
+ Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
28
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:r.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[e]}})}e.findStartOfInputAnchor=y;function b(e){var t=i.filter(e,function(e){var t=e[s];return t instanceof RegExp&&(t.multiline||t.global)});return i.map(t,function(e){return{message:`Token Type: ->`+e.name+`<- static 'PATTERN' may NOT contain global('g') or multiline('m')`,type:r.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}})}e.findUnsupportedFlags=b;function x(e){var t=[],n=i.map(e,function(n){return i.reduce(e,function(e,a){return n.PATTERN.source===a.PATTERN.source&&!i.contains(t,a)&&a.PATTERN!==r.Lexer.NA&&(t.push(a),e.push(a)),e},[])});n=i.compact(n);var a=i.filter(n,function(e){return e.length>1});return i.map(a,function(e){var t=i.map(e,function(e){return e.name});return{message:`The same RegExp pattern ->`+i.first(e).PATTERN+`<-`+(`has been used in all of the following Token Types: `+t.join(`, `)+` <-`),type:r.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}e.findDuplicatePatterns=x;function S(e){var t=i.filter(e,function(e){if(!i.has(e,`GROUP`))return!1;var t=e.GROUP;return t!==r.Lexer.SKIPPED&&t!==r.Lexer.NA&&!i.isString(t)});return i.map(t,function(e){return{message:`Token Type: ->`+e.name+`<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String`,type:r.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}})}e.findInvalidGroupType=S;function C(e,t){var n=i.filter(e,function(e){return e.PUSH_MODE!==void 0&&!i.contains(t,e.PUSH_MODE)});return i.map(n,function(e){return{message:`Token Type: ->`+e.name+`<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->`+e.PUSH_MODE+`<-which does not exist`,type:r.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}})}e.findModesThatDoNotExist=C;function w(e){var t=[],n=i.reduce(e,function(e,t,n){var a=t.PATTERN;return a===r.Lexer.NA||(i.isString(a)?e.push({str:a,idx:n,tokenType:t}):i.isRegExp(a)&&E(a)&&e.push({str:a.source,idx:n,tokenType:t})),e},[]);return i.forEach(e,function(e,a){i.forEach(n,function(n){var i=n.str,o=n.idx,s=n.tokenType;if(a<o&&T(i,e.PATTERN)){var c=`Token: ->`+s.name+`<- can never be matched.
29
+ `+(`Because it appears AFTER the Token Type ->`+e.name+`<-`)+`in the lexer's definition.
30
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:c,type:r.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}})}),t}e.findUnreachablePatterns=w;function T(e,t){if(i.isRegExp(t)){var n=t.exec(e);return n!==null&&n.index===0}else{if(i.isFunction(t))return t(e,0,[],{});if(i.has(t,`exec`))return t.exec(e,0,[],{});if(typeof t==`string`)return t===e;throw Error(`non exhaustive match`)}}function E(e){return i.find([`.`,`\\`,`[`,`]`,`|`,`^`,`$`,`(`,`)`,`?`,`*`,`+`,`{`],function(t){return e.source.indexOf(t)!==-1})===void 0}function D(e){var t=e.ignoreCase?`i`:``;return RegExp(`^(?:`+e.source+`)`,t)}e.addStartOfInput=D;function O(e){var t=e.ignoreCase?`iy`:`y`;return RegExp(``+e.source,t)}e.addStickyFlag=O;function k(t,n,a){var o=[];return i.has(t,e.DEFAULT_MODE)||o.push({message:`A MultiMode Lexer cannot be initialized without a <`+e.DEFAULT_MODE+`> property in its definition
31
+ `,type:r.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),i.has(t,e.MODES)||o.push({message:`A MultiMode Lexer cannot be initialized without a <`+e.MODES+`> property in its definition
32
+ `,type:r.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),i.has(t,e.MODES)&&i.has(t,e.DEFAULT_MODE)&&!i.has(t.modes,t.defaultMode)&&o.push({message:`A MultiMode Lexer cannot be initialized with a `+e.DEFAULT_MODE+`: <`+t.defaultMode+`>which does not exist
33
+ `,type:r.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),i.has(t,e.MODES)&&i.forEach(t.modes,function(e,t){i.forEach(e,function(e,n){i.isUndefined(e)&&o.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:`+(`<`+t+`> at index: <`+n+`>
34
+ `),type:r.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),o}e.performRuntimeChecks=k;function A(e,t,n){var o=[],c=!1,l=i.compact(i.flatten(i.mapValues(e.modes,function(e){return e}))),u=i.reject(l,function(e){return e[s]===r.Lexer.NA}),d=ne(n);return t&&i.forEach(u,function(e){var t=ee(e,d);if(t!==!1){var n={message:te(e,t),type:t.issue,tokenType:e};o.push(n)}else i.has(e,`LINE_BREAKS`)?e.LINE_BREAKS===!0&&(c=!0):a.canMatchCharCode(d,e.PATTERN)&&(c=!0)}),t&&!c&&o.push({message:`Warning: No LINE_BREAKS Found.
35
35
  This Lexer has been defined to track line and column information,
36
36
  But none of the Token Types can be identified as matching a line terminator.
37
37
  See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
38
- for details.`,type:n.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),z}i.performWarningRuntimeChecks=_;function X(G){var j={},Y=r.keys(G);return r.forEach(Y,function(z){var te=G[z];if(r.isArray(te))j[z]=[];else throw Error("non exhaustive match")}),j}i.cloneEmptyGroups=X;function Z(G){var j=G.PATTERN;if(r.isRegExp(j))return!1;if(r.isFunction(j)||r.has(j,"exec"))return!0;if(r.isString(j))return!1;throw Error("non exhaustive match")}i.isCustomPattern=Z;function V(G){return r.isString(G)&&G.length===1?G.charCodeAt(0):!1}i.isShortPattern=V,i.LineTerminatorOptimizedTester={test:function(G){for(var j=G.length,Y=this.lastIndex;Y<j;Y++){var z=G.charCodeAt(Y);if(z===10)return this.lastIndex=Y+1,!0;if(z===13)return G.charCodeAt(Y+1)===10?this.lastIndex=Y+2:this.lastIndex=Y+1,!0}return!1},lastIndex:0};function $(G,j){if(r.has(G,"LINE_BREAKS"))return!1;if(r.isRegExp(G.PATTERN)){try{o.canMatchCharCode(j,G.PATTERN)}catch(Y){return{issue:n.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:Y.message}}return!1}else{if(r.isString(G.PATTERN))return!1;if(Z(G))return{issue:n.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function ie(G,j){if(j.issue===n.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
39
- `+(" The problem is in the <"+G.name+`> Token Type
40
- `)+(" Root cause: "+j.errMsg+`.
41
- `)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(j.issue===n.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
42
- `+(" The problem is in the <"+G.name+`> Token Type
43
- `)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}i.buildLineBreakIssueMessage=ie;function ue(G){var j=r.map(G,function(Y){return r.isString(Y)&&Y.length>0?Y.charCodeAt(0):Y});return j}function ae(G,j,Y){G[j]===void 0?G[j]=[Y]:G[j].push(Y)}i.minOptimizationVal=256;var se=[];function ee(G){return G<i.minOptimizationVal?G:se[G]}i.charCodeToOptimizedIndex=ee;function de(){if(r.isEmpty(se)){se=new Array(65536);for(var G=0;G<65536;G++)se[G]=G>255?255+~~(G/255):G}}}),kt=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=Ne();function t(g,l){var d=g.tokenTypeIdx;return d===l.tokenTypeIdx?!0:l.isParent===!0&&l.categoryMatchesMap[d]===!0}i.tokenStructuredMatcher=t;function n(g,l){return g.tokenTypeIdx===l.tokenTypeIdx}i.tokenStructuredMatcherNoCategories=n,i.tokenShortNameIdx=1,i.tokenIdxToClass={};function r(g){var l=o(g);s(l),A(l),c(l),e.forEach(l,function(d){d.isParent=d.categoryMatches.length>0})}i.augmentTokenTypes=r;function o(g){for(var l=e.cloneArr(g),d=g,f=!0;f;){d=e.compact(e.flatten(e.map(d,function(I){return I.CATEGORIES})));var C=e.difference(d,l);l=l.concat(C),e.isEmpty(C)?f=!1:d=C}return l}i.expandCategories=o;function s(g){e.forEach(g,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=[]),m(l)||(l.categoryMatches=[]),p(l)||(l.categoryMatchesMap={})})}i.assignTokenDefaultProps=s;function c(g){e.forEach(g,function(l){l.categoryMatches=[],e.forEach(l.categoryMatchesMap,function(d,f){l.categoryMatches.push(i.tokenIdxToClass[f].tokenTypeIdx)})})}i.assignCategoriesTokensProp=c;function A(g){e.forEach(g,function(l){a([],l)})}i.assignCategoriesMapProp=A;function a(g,l){e.forEach(g,function(d){l.categoryMatchesMap[d.tokenTypeIdx]=!0}),e.forEach(l.CATEGORIES,function(d){var f=g.concat(l);e.contains(f,d)||a(f,d)})}i.singleAssignCategoriesToksMap=a;function h(g){return e.has(g,"tokenTypeIdx")}i.hasShortKeyProperty=h;function u(g){return e.has(g,"CATEGORIES")}i.hasCategoriesProperty=u;function m(g){return e.has(g,"categoryMatches")}i.hasExtendingTokensTypesProperty=m;function p(g){return e.has(g,"categoryMatchesMap")}i.hasExtendingTokensTypesMapProperty=p;function E(g){return e.has(g,"tokenTypeIdx")}i.isTokenType=E}),ci=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.")}}}),Gt=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Lexer=i.LexerDefinitionErrorType=void 0;var e=Ai(),t=Ne(),n=kt(),r=ci(),o=yn();(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:[`
44
- `,"\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.
45
- a boolean 2nd argument is no longer supported`);this.config=t.merge(s,h);var m=this.config.traceInitPerf;m===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof m=="number"&&(this.traceInitMaxIdent=m,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var p,E=!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.
46
- 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)?(p={modes:{}},p.modes[e.DEFAULT_MODE]=t.cloneArr(a),p[e.DEFAULT_MODE]=e.DEFAULT_MODE):(E=!1,p=t.cloneObj(a))}),u.config.skipValidations===!1&&(u.TRACE_INIT("performRuntimeChecks",function(){u.lexerDefinitionErrors=u.lexerDefinitionErrors.concat(e.performRuntimeChecks(p,u.trackStartLines,u.config.lineTerminatorCharacters))}),u.TRACE_INIT("performWarningRuntimeChecks",function(){u.lexerDefinitionWarning=u.lexerDefinitionWarning.concat(e.performWarningRuntimeChecks(p,u.trackStartLines,u.config.lineTerminatorCharacters))})),p.modes=p.modes?p.modes:{},t.forEach(p.modes,function(f,C){p.modes[C]=t.reject(f,function(I){return t.isUndefined(I)})});var g=t.keys(p.modes);if(t.forEach(p.modes,function(f,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(f,g))}),t.isEmpty(u.lexerDefinitionErrors)){n.augmentTokenTypes(f);var I;u.TRACE_INIT("analyzeTokenTypes",function(){I=e.analyzeTokenTypes(f,{lineTerminatorCharacters:u.config.lineTerminatorCharacters,positionTracking:h.positionTracking,ensureOptimizations:h.ensureOptimizations,safeMode:h.safeMode,tracer:u.TRACE_INIT.bind(u)})}),u.patternIdxToConfig[C]=I.patternIdxToConfig,u.charCodeToPatternIdxToConfig[C]=I.charCodeToPatternIdxToConfig,u.emptyGroups=t.merge(u.emptyGroups,I.emptyGroups),u.hasCustom=I.hasCustom||u.hasCustom,u.canModeBeOptimized[C]=I.canBeOptimized}})}),u.defaultMode=p.defaultMode,!t.isEmpty(u.lexerDefinitionErrors)&&!u.config.deferDefinitionErrorsHandling){var l=t.map(u.lexerDefinitionErrors,function(f){return f.message}),d=l.join(`-----------------------
47
- `);throw new Error(`Errors detected in definition of Lexer:
48
- `+d)}t.forEach(u.lexerDefinitionWarning,function(f){t.PRINT_WARNING(f.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),E&&(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 f=t.reduce(u.canModeBeOptimized,function(C,I,y){return I===!1&&C.push(y),C},[]);if(h.ensureOptimizations&&!t.isEmpty(f))throw Error("Lexer Modes: < "+f.join(", ")+` > cannot be optimized.
38
+ for details.`,type:r.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),o}e.performWarningRuntimeChecks=A;function j(e){var t={},n=i.keys(e);return i.forEach(n,function(n){var r=e[n];if(i.isArray(r))t[n]=[];else throw Error(`non exhaustive match`)}),t}e.cloneEmptyGroups=j;function M(e){var t=e.PATTERN;if(i.isRegExp(t))return!1;if(i.isFunction(t)||i.has(t,`exec`))return!0;if(i.isString(t))return!1;throw Error(`non exhaustive match`)}e.isCustomPattern=M;function N(e){return i.isString(e)&&e.length===1?e.charCodeAt(0):!1}e.isShortPattern=N,e.LineTerminatorOptimizedTester={test:function(e){for(var t=e.length,n=this.lastIndex;n<t;n++){var r=e.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return e.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function ee(e,t){if(i.has(e,`LINE_BREAKS`))return!1;if(i.isRegExp(e.PATTERN)){try{a.canMatchCharCode(t,e.PATTERN)}catch(e){return{issue:r.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}else{if(i.isString(e.PATTERN))return!1;if(M(e))return{issue:r.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error(`non exhaustive match`)}}function te(e,t){if(t.issue===r.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
39
+ `+(` The problem is in the <`+e.name+`> Token Type
40
+ `)+(` Root cause: `+t.errMsg+`.
41
+ `)+` For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===r.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
42
+ `+(` The problem is in the <`+e.name+`> Token Type
43
+ `)+` For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error(`non exhaustive match`)}e.buildLineBreakIssueMessage=te;function ne(e){return i.map(e,function(e){return i.isString(e)&&e.length>0?e.charCodeAt(0):e})}function re(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}e.minOptimizationVal=256;var ie=[];function P(t){return t<e.minOptimizationVal?t:ie[t]}e.charCodeToOptimizedIndex=P;function ae(){if(i.isEmpty(ie)){ie=Array(65536);for(var e=0;e<65536;e++)ie[e]=e>255?255+~~(e/255):e}}}),ze=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isTokenType=e.hasExtendingTokensTypesMapProperty=e.hasExtendingTokensTypesProperty=e.hasCategoriesProperty=e.hasShortKeyProperty=e.singleAssignCategoriesToksMap=e.assignCategoriesMapProp=e.assignCategoriesTokensProp=e.assignTokenDefaultProps=e.expandCategories=e.augmentTokenTypes=e.tokenIdxToClass=e.tokenShortNameIdx=e.tokenStructuredMatcherNoCategories=e.tokenStructuredMatcher=void 0;var t=K();function n(e,t){var n=e.tokenTypeIdx;return n===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[n]===!0}e.tokenStructuredMatcher=n;function r(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}e.tokenStructuredMatcherNoCategories=r,e.tokenShortNameIdx=1,e.tokenIdxToClass={};function i(e){var n=a(e);o(n),c(n),s(n),t.forEach(n,function(e){e.isParent=e.categoryMatches.length>0})}e.augmentTokenTypes=i;function a(e){for(var n=t.cloneArr(e),r=e,i=!0;i;){r=t.compact(t.flatten(t.map(r,function(e){return e.CATEGORIES})));var a=t.difference(r,n);n=n.concat(a),t.isEmpty(a)?i=!1:r=a}return n}e.expandCategories=a;function o(n){t.forEach(n,function(n){u(n)||(e.tokenIdxToClass[e.tokenShortNameIdx]=n,n.tokenTypeIdx=e.tokenShortNameIdx++),d(n)&&!t.isArray(n.CATEGORIES)&&(n.CATEGORIES=[n.CATEGORIES]),d(n)||(n.CATEGORIES=[]),f(n)||(n.categoryMatches=[]),p(n)||(n.categoryMatchesMap={})})}e.assignTokenDefaultProps=o;function s(n){t.forEach(n,function(n){n.categoryMatches=[],t.forEach(n.categoryMatchesMap,function(t,r){n.categoryMatches.push(e.tokenIdxToClass[r].tokenTypeIdx)})})}e.assignCategoriesTokensProp=s;function c(e){t.forEach(e,function(e){l([],e)})}e.assignCategoriesMapProp=c;function l(e,n){t.forEach(e,function(e){n.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.forEach(n.CATEGORIES,function(r){var i=e.concat(n);t.contains(i,r)||l(i,r)})}e.singleAssignCategoriesToksMap=l;function u(e){return t.has(e,`tokenTypeIdx`)}e.hasShortKeyProperty=u;function d(e){return t.has(e,`CATEGORIES`)}e.hasCategoriesProperty=d;function f(e){return t.has(e,`categoryMatches`)}e.hasExtendingTokensTypesProperty=f;function p(e){return t.has(e,`categoryMatchesMap`)}e.hasExtendingTokensTypesMapProperty=p;function m(e){return t.has(e,`tokenTypeIdx`)}e.isTokenType=m}),Be=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultLexerErrorProvider=void 0,e.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,i){return`unexpected character: ->`+e.charAt(t)+`<- at offset: `+t+`,`+(` skipped `+n+` characters.`)}}}),Ve=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lexer=e.LexerDefinitionErrorType=void 0;var t=Re(),n=K(),r=ze(),i=Be(),a=Ie();(function(e){e[e.MISSING_PATTERN=0]=`MISSING_PATTERN`,e[e.INVALID_PATTERN=1]=`INVALID_PATTERN`,e[e.EOI_ANCHOR_FOUND=2]=`EOI_ANCHOR_FOUND`,e[e.UNSUPPORTED_FLAGS_FOUND=3]=`UNSUPPORTED_FLAGS_FOUND`,e[e.DUPLICATE_PATTERNS_FOUND=4]=`DUPLICATE_PATTERNS_FOUND`,e[e.INVALID_GROUP_TYPE_FOUND=5]=`INVALID_GROUP_TYPE_FOUND`,e[e.PUSH_MODE_DOES_NOT_EXIST=6]=`PUSH_MODE_DOES_NOT_EXIST`,e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]=`MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE`,e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]=`MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY`,e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]=`MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST`,e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]=`LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED`,e[e.SOI_ANCHOR_FOUND=11]=`SOI_ANCHOR_FOUND`,e[e.EMPTY_MATCH_PATTERN=12]=`EMPTY_MATCH_PATTERN`,e[e.NO_LINE_BREAKS_FLAGS=13]=`NO_LINE_BREAKS_FLAGS`,e[e.UNREACHABLE_PATTERN=14]=`UNREACHABLE_PATTERN`,e[e.IDENTIFY_TERMINATOR=15]=`IDENTIFY_TERMINATOR`,e[e.CUSTOM_LINE_BREAK=16]=`CUSTOM_LINE_BREAK`})(e.LexerDefinitionErrorType||={});var o={deferDefinitionErrorsHandling:!1,positionTracking:`full`,lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
44
+ `,`\r`],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:i.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(o),e.Lexer=function(){function e(e,i){var s=this;if(i===void 0&&(i=o),this.lexerDefinition=e,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 i==`boolean`)throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
45
+ a boolean 2nd argument is no longer supported`);this.config=n.merge(o,i);var c=this.config.traceInitPerf;c===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof c==`number`&&(this.traceInitMaxIdent=c,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT(`Lexer Constructor`,function(){var c,l=!0;s.TRACE_INIT(`Lexer Config handling`,function(){if(s.config.lineTerminatorsPattern===o.lineTerminatorsPattern)s.config.lineTerminatorsPattern=t.LineTerminatorOptimizedTester;else if(s.config.lineTerminatorCharacters===o.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
46
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(i.safeMode&&i.ensureOptimizations)throw Error(`"safeMode" and "ensureOptimizations" flags are mutually exclusive.`);s.trackStartLines=/full|onlyStart/i.test(s.config.positionTracking),s.trackEndLines=/full/i.test(s.config.positionTracking),n.isArray(e)?(c={modes:{}},c.modes[t.DEFAULT_MODE]=n.cloneArr(e),c[t.DEFAULT_MODE]=t.DEFAULT_MODE):(l=!1,c=n.cloneObj(e))}),s.config.skipValidations===!1&&(s.TRACE_INIT(`performRuntimeChecks`,function(){s.lexerDefinitionErrors=s.lexerDefinitionErrors.concat(t.performRuntimeChecks(c,s.trackStartLines,s.config.lineTerminatorCharacters))}),s.TRACE_INIT(`performWarningRuntimeChecks`,function(){s.lexerDefinitionWarning=s.lexerDefinitionWarning.concat(t.performWarningRuntimeChecks(c,s.trackStartLines,s.config.lineTerminatorCharacters))})),c.modes=c.modes?c.modes:{},n.forEach(c.modes,function(e,t){c.modes[t]=n.reject(e,function(e){return n.isUndefined(e)})});var u=n.keys(c.modes);if(n.forEach(c.modes,function(e,a){s.TRACE_INIT(`Mode: <`+a+`> processing`,function(){if(s.modes.push(a),s.config.skipValidations===!1&&s.TRACE_INIT(`validatePatterns`,function(){s.lexerDefinitionErrors=s.lexerDefinitionErrors.concat(t.validatePatterns(e,u))}),n.isEmpty(s.lexerDefinitionErrors)){r.augmentTokenTypes(e);var o;s.TRACE_INIT(`analyzeTokenTypes`,function(){o=t.analyzeTokenTypes(e,{lineTerminatorCharacters:s.config.lineTerminatorCharacters,positionTracking:i.positionTracking,ensureOptimizations:i.ensureOptimizations,safeMode:i.safeMode,tracer:s.TRACE_INIT.bind(s)})}),s.patternIdxToConfig[a]=o.patternIdxToConfig,s.charCodeToPatternIdxToConfig[a]=o.charCodeToPatternIdxToConfig,s.emptyGroups=n.merge(s.emptyGroups,o.emptyGroups),s.hasCustom=o.hasCustom||s.hasCustom,s.canModeBeOptimized[a]=o.canBeOptimized}})}),s.defaultMode=c.defaultMode,!n.isEmpty(s.lexerDefinitionErrors)&&!s.config.deferDefinitionErrorsHandling){var d=n.map(s.lexerDefinitionErrors,function(e){return e.message}).join(`-----------------------
47
+ `);throw Error(`Errors detected in definition of Lexer:
48
+ `+d)}n.forEach(s.lexerDefinitionWarning,function(e){n.PRINT_WARNING(e.message)}),s.TRACE_INIT(`Choosing sub-methods implementations`,function(){if(t.SUPPORT_STICKY?(s.chopInput=n.IDENTITY,s.match=s.matchWithTest):(s.updateLastIndex=n.NOOP,s.match=s.matchWithExec),l&&(s.handleModes=n.NOOP),s.trackStartLines===!1&&(s.computeNewColumn=n.IDENTITY),s.trackEndLines===!1&&(s.updateTokenEndLineColumnLocation=n.NOOP),/full/i.test(s.config.positionTracking))s.createTokenInstance=s.createFullToken;else if(/onlyStart/i.test(s.config.positionTracking))s.createTokenInstance=s.createStartOnlyToken;else if(/onlyOffset/i.test(s.config.positionTracking))s.createTokenInstance=s.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "`+s.config.positionTracking+`"`);s.hasCustom?(s.addToken=s.addTokenUsingPush,s.handlePayload=s.handlePayloadWithCustom):(s.addToken=s.addTokenUsingMemberAccess,s.handlePayload=s.handlePayloadNoCustom)}),s.TRACE_INIT(`Failed Optimization Warnings`,function(){var e=n.reduce(s.canModeBeOptimized,function(e,t,n){return t===!1&&e.push(n),e},[]);if(i.ensureOptimizations&&!n.isEmpty(e))throw Error(`Lexer Modes: < `+e.join(`, `)+` > cannot be optimized.
49
49
  Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
50
- 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(E){return E.message}),m=u.join(`-----------------------
51
- `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
52
- `+m)}var p=this.tokenizeInternal(a,h);return p},A.prototype.tokenizeInternal=function(a,h){var u=this,m,p,E,g,l,d,f,C,I,y,v,L,H,Q,P=a,D=P.length,R=0,F=0,_=this.hasCustom?0:Math.floor(a.length/10),X=new Array(_),Z=[],V=this.trackStartLines?1:void 0,$=this.trackStartLines?1:void 0,ie=e.cloneEmptyGroups(this.emptyGroups),ue=this.trackStartLines,ae=this.config.lineTerminatorsPattern,se=0,ee=[],de=[],G=[],j=[];Object.freeze(j);var Y=void 0;function z(){return ee}function te(B){var S=e.charCodeToOptimizedIndex(B),w=de[S];return w===void 0?j:w}var oe=function(B){if(G.length===1&&B.tokenType.PUSH_MODE===void 0){var S=u.config.errorMessageProvider.buildUnableToPopLexerModeMessage(B);Z.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:S})}else{G.pop();var w=t.last(G);ee=u.patternIdxToConfig[w],de=u.charCodeToPatternIdxToConfig[w],se=ee.length;var N=u.canModeBeOptimized[w]&&u.config.safeMode===!1;de&&N?Y=te:Y=z}};function Be(B){G.push(B),de=this.charCodeToPatternIdxToConfig[B],ee=this.patternIdxToConfig[B],se=ee.length,se=ee.length;var S=this.canModeBeOptimized[B]&&this.config.safeMode===!1;de&&S?Y=te:Y=z}Be.call(this,h);for(var we;R<D;){l=null;var De=P.charCodeAt(R),ze=Y(De),Je=ze.length;for(m=0;m<Je;m++){we=ze[m];var Ve=we.pattern;d=null;var O=we.short;if(O!==!1?De===O&&(l=Ve):we.isCustom===!0?(Q=Ve.exec(P,R,X,ie),Q!==null?(l=Q[0],Q.payload!==void 0&&(d=Q.payload)):l=null):(this.updateLastIndex(Ve,R),l=this.match(Ve,a,R)),l!==null){if(g=we.longerAlt,g!==void 0){var J=ee[g],q=J.pattern;f=null,J.isCustom===!0?(Q=q.exec(P,R,X,ie),Q!==null?(E=Q[0],Q.payload!==void 0&&(f=Q.payload)):E=null):(this.updateLastIndex(q,R),E=this.match(q,a,R)),E&&E.length>l.length&&(l=E,d=f,we=J)}break}}if(l!==null){if(C=l.length,I=we.group,I!==void 0&&(y=we.tokenTypeIdx,v=this.createTokenInstance(l,R,y,we.tokenType,V,$,C),this.handlePayload(v,d),I===!1?F=this.addToken(X,F,v):ie[I].push(v)),a=this.chopInput(a,C),R=R+C,$=this.computeNewColumn($,C),ue===!0&&we.canLineTerminator===!0){var re=0,fe=void 0,Qe=void 0;ae.lastIndex=0;do fe=ae.test(l),fe===!0&&(Qe=ae.lastIndex-1,re++);while(fe===!0);re!==0&&(V=V+re,$=C-Qe,this.updateTokenEndLineColumnLocation(v,I,Qe,re,V,$,C))}this.handleModes(we,oe,Be,v)}else{for(var ye=R,le=V,Ue=$,k=!1;!k&&R<D;)for(P.charCodeAt(R),a=this.chopInput(a,1),R++,p=0;p<se;p++){var T=ee[p],Ve=T.pattern,O=T.short;if(O!==!1?P.charCodeAt(R)===O&&(k=!0):T.isCustom===!0?k=Ve.exec(P,R,X,ie)!==null:(this.updateLastIndex(Ve,R),k=Ve.exec(a)!==null),k===!0)break}L=R-ye,H=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(P,ye,L,le,Ue),Z.push({offset:ye,line:le,column:Ue,length:L,message:H})}}return this.hasCustom||(X.length=F),{tokens:X,groups:ie,errors:Z}},A.prototype.handleModes=function(a,h,u,m){if(a.pop===!0){var p=a.push;h(m),p!==void 0&&u.call(this,p)}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,m,p,E,g){var l,d;h!==void 0&&(l=u===g-1,d=l?-1:0,m===1&&l===!0||(a.endLine=p+d,a.endColumn=E-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,m){return{image:a,startOffset:h,tokenTypeIdx:u,tokenType:m}},A.prototype.createStartOnlyToken=function(a,h,u,m,p,E){return{image:a,startOffset:h,startLine:p,startColumn:E,tokenTypeIdx:u,tokenType:m}},A.prototype.createFullToken=function(a,h,u,m,p,E,g){return{image:a,startOffset:h,endOffset:h+g-1,startLine:p,endLine:p,startColumn:E,endColumn:E+g-1,tokenTypeIdx:u,tokenType:m}},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 m=a.test(h);return m===!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 m=t.timer(h),p=m.time,E=m.value,g=p>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&g(u+"<-- <"+a+"> time: "+p+"ms"),this.traceInitIndent--,E}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}),pt=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=Ne(),t=Gt(),n=kt();function r(I){return s(I)?I.LABEL:I.name}i.tokenLabel=r;function o(I){return I.name}i.tokenName=o;function s(I){return e.isString(I.LABEL)&&I.LABEL!==""}i.hasTokenLabel=s;var c="parent",A="categories",a="label",h="group",u="push_mode",m="pop_mode",p="longer_alt",E="line_breaks",g="start_chars_hint";function l(I){return d(I)}i.createToken=l;function d(I){var y=I.pattern,v={};if(v.name=I.name,e.isUndefined(y)||(v.PATTERN=y),e.has(I,c))throw`The parent property is no longer supported.
53
- See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return e.has(I,A)&&(v.CATEGORIES=I[A]),n.augmentTokenTypes([v]),e.has(I,a)&&(v.LABEL=I[a]),e.has(I,h)&&(v.GROUP=I[h]),e.has(I,m)&&(v.POP_MODE=I[m]),e.has(I,u)&&(v.PUSH_MODE=I[u]),e.has(I,p)&&(v.LONGER_ALT=I[p]),e.has(I,E)&&(v.LINE_BREAKS=I[E]),e.has(I,g)&&(v.START_CHARS_HINT=I[g]),v}i.EOF=l({name:"EOF",pattern:t.Lexer.NA}),n.augmentTokenTypes([i.EOF]);function f(I,y,v,L,H,Q,P,D){return{image:y,startOffset:v,endOffset:L,startLine:H,endLine:Q,startColumn:P,endColumn:D,tokenTypeIdx:I.tokenTypeIdx,tokenType:I}}i.createTokenInstance=f;function C(I,y){return n.tokenStructuredMatcher(I,y)}i.tokenMatcher=C}),Ze=ve(i=>{var e=i&&i.__extends||(function(){var d=function(f,C){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,y){I.__proto__=y}||function(I,y){for(var v in y)Object.prototype.hasOwnProperty.call(y,v)&&(I[v]=y[v])},d(f,C)};return function(f,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");d(f,C);function I(){this.constructor=f}f.prototype=C===null?Object.create(C):(I.prototype=C.prototype,new I)}})();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=Ne(),n=pt(),r=(function(){function d(f){this._definition=f}return Object.defineProperty(d.prototype,"definition",{get:function(){return this._definition},set:function(f){this._definition=f},enumerable:!1,configurable:!0}),d.prototype.accept=function(f){f.visit(this),t.forEach(this.definition,function(C){C.accept(f)})},d})();i.AbstractProduction=r;var o=(function(d){e(f,d);function f(C){var I=d.call(this,[])||this;return I.idx=1,t.assign(I,t.pick(C,function(y){return y!==void 0})),I}return Object.defineProperty(f.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(C){},enumerable:!1,configurable:!0}),f.prototype.accept=function(C){C.visit(this)},f})(r);i.NonTerminal=o;var s=(function(d){e(f,d);function f(C){var I=d.call(this,C.definition)||this;return I.orgText="",t.assign(I,t.pick(C,function(y){return y!==void 0})),I}return f})(r);i.Rule=s;var c=(function(d){e(f,d);function f(C){var I=d.call(this,C.definition)||this;return I.ignoreAmbiguities=!1,t.assign(I,t.pick(C,function(y){return y!==void 0})),I}return f})(r);i.Alternative=c;var A=(function(d){e(f,d);function f(C){var I=d.call(this,C.definition)||this;return I.idx=1,t.assign(I,t.pick(C,function(y){return y!==void 0})),I}return f})(r);i.Option=A;var a=(function(d){e(f,d);function f(C){var I=d.call(this,C.definition)||this;return I.idx=1,t.assign(I,t.pick(C,function(y){return y!==void 0})),I}return f})(r);i.RepetitionMandatory=a;var h=(function(d){e(f,d);function f(C){var I=d.call(this,C.definition)||this;return I.idx=1,t.assign(I,t.pick(C,function(y){return y!==void 0})),I}return f})(r);i.RepetitionMandatoryWithSeparator=h;var u=(function(d){e(f,d);function f(C){var I=d.call(this,C.definition)||this;return I.idx=1,t.assign(I,t.pick(C,function(y){return y!==void 0})),I}return f})(r);i.Repetition=u;var m=(function(d){e(f,d);function f(C){var I=d.call(this,C.definition)||this;return I.idx=1,t.assign(I,t.pick(C,function(y){return y!==void 0})),I}return f})(r);i.RepetitionWithSeparator=m;var p=(function(d){e(f,d);function f(C){var I=d.call(this,C.definition)||this;return I.idx=1,I.ignoreAmbiguities=!1,I.hasPredicates=!1,t.assign(I,t.pick(C,function(y){return y!==void 0})),I}return Object.defineProperty(f.prototype,"definition",{get:function(){return this._definition},set:function(C){this._definition=C},enumerable:!1,configurable:!0}),f})(r);i.Alternation=p;var E=(function(){function d(f){this.idx=1,t.assign(this,t.pick(f,function(C){return C!==void 0}))}return d.prototype.accept=function(f){f.visit(this)},d})();i.Terminal=E;function g(d){return t.map(d,l)}i.serializeGrammar=g;function l(d){function f(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:f(d.definition)};if(d instanceof A)return{type:"Option",idx:d.idx,definition:f(d.definition)};if(d instanceof a)return{type:"RepetitionMandatory",idx:d.idx,definition:f(d.definition)};if(d instanceof h)return{type:"RepetitionMandatoryWithSeparator",idx:d.idx,separator:l(new E({terminalType:d.separator})),definition:f(d.definition)};if(d instanceof m)return{type:"RepetitionWithSeparator",idx:d.idx,separator:l(new E({terminalType:d.separator})),definition:f(d.definition)};if(d instanceof u)return{type:"Repetition",idx:d.idx,definition:f(d.definition)};if(d instanceof p)return{type:"Alternation",idx:d.idx,definition:f(d.definition)};if(d instanceof E){var C={type:"Terminal",name:d.terminalType.name,label:n.tokenLabel(d.terminalType),idx:d.idx},I=d.terminalType.PATTERN;return d.terminalType.PATTERN&&(C.pattern=t.isRegExp(I)?I.source:I),C}else{if(d instanceof s)return{type:"Rule",name:d.name,orgText:d.orgText,definition:f(d.definition)};throw Error("non exhaustive match")}}i.serializeProduction=l}),Bn=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RestWalker=void 0;var e=Ne(),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 m=new t.Alternative({definition:[u]});a.walk(m,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}}),St=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}),Ut=ve(i=>{var e=i&&i.__extends||(function(){var m=function(p,E){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,l){g.__proto__=l}||function(g,l){for(var d in l)Object.prototype.hasOwnProperty.call(l,d)&&(g[d]=l[d])},m(p,E)};return function(p,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");m(p,E);function g(){this.constructor=p}p.prototype=E===null?Object.create(E):(g.prototype=E.prototype,new g)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.collectMethods=i.DslMethodsCollectorVisitor=i.getProductionDslName=i.isBranchingProd=i.isOptionalProd=i.isSequenceProd=void 0;var t=Ne(),n=Ze(),r=St();function o(m){return m instanceof n.Alternative||m instanceof n.Option||m instanceof n.Repetition||m instanceof n.RepetitionMandatory||m instanceof n.RepetitionMandatoryWithSeparator||m instanceof n.RepetitionWithSeparator||m instanceof n.Terminal||m instanceof n.Rule}i.isSequenceProd=o;function s(m,p){p===void 0&&(p=[]);var E=m instanceof n.Option||m instanceof n.Repetition||m instanceof n.RepetitionWithSeparator;return E?!0:m instanceof n.Alternation?t.some(m.definition,function(g){return s(g,p)}):m instanceof n.NonTerminal&&t.contains(p,m)?!1:m instanceof n.AbstractProduction?(m instanceof n.NonTerminal&&p.push(m),t.every(m.definition,function(g){return s(g,p)})):!1}i.isOptionalProd=s;function c(m){return m instanceof n.Alternation}i.isBranchingProd=c;function A(m){if(m instanceof n.NonTerminal)return"SUBRULE";if(m instanceof n.Option)return"OPTION";if(m instanceof n.Alternation)return"OR";if(m instanceof n.RepetitionMandatory)return"AT_LEAST_ONE";if(m instanceof n.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(m instanceof n.RepetitionWithSeparator)return"MANY_SEP";if(m instanceof n.Repetition)return"MANY";if(m instanceof n.Terminal)return"CONSUME";throw Error("non exhaustive match")}i.getProductionDslName=A;var a=(function(m){e(p,m);function p(){var E=m!==null&&m.apply(this,arguments)||this;return E.separator="-",E.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},E}return p.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},p.prototype.visitTerminal=function(E){var g=E.terminalType.name+this.separator+"Terminal";t.has(this.dslMethods,g)||(this.dslMethods[g]=[]),this.dslMethods[g].push(E)},p.prototype.visitNonTerminal=function(E){var g=E.nonTerminalName+this.separator+"Terminal";t.has(this.dslMethods,g)||(this.dslMethods[g]=[]),this.dslMethods[g].push(E)},p.prototype.visitOption=function(E){this.dslMethods.option.push(E)},p.prototype.visitRepetitionWithSeparator=function(E){this.dslMethods.repetitionWithSeparator.push(E)},p.prototype.visitRepetitionMandatory=function(E){this.dslMethods.repetitionMandatory.push(E)},p.prototype.visitRepetitionMandatoryWithSeparator=function(E){this.dslMethods.repetitionMandatoryWithSeparator.push(E)},p.prototype.visitRepetition=function(E){this.dslMethods.repetition.push(E)},p.prototype.visitAlternation=function(E){this.dslMethods.alternation.push(E)},p})(r.GAstVisitor);i.DslMethodsCollectorVisitor=a;var h=new a;function u(m){h.reset(),m.accept(h);var p=h.dslMethods;return h.reset(),p}i.collectMethods=u}),li=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.firstForTerminal=i.firstForBranching=i.firstForSequence=i.first=void 0;var e=Ne(),t=Ze(),n=Ut();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,m=h.length>u,p,E=!0;m&&E;)p=h[u],E=n.isOptionalProd(p),a=a.concat(r(p)),u=u+1,m=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}),ui=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IN=void 0,i.IN="_~IN~_"}),oo=ve(i=>{var e=i&&i.__extends||(function(){var u=function(m,p){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,g){E.__proto__=g}||function(E,g){for(var l in g)Object.prototype.hasOwnProperty.call(g,l)&&(E[l]=g[l])},u(m,p)};return function(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");u(m,p);function E(){this.constructor=m}m.prototype=p===null?Object.create(p):(E.prototype=p.prototype,new E)}})();Object.defineProperty(i,"__esModule",{value:!0}),i.buildInProdFollowPrefix=i.buildBetweenProdsFollowPrefix=i.computeAllProdsFollows=i.ResyncFollowsWalker=void 0;var t=Bn(),n=li(),r=Ne(),o=ui(),s=Ze(),c=(function(u){e(m,u);function m(p){var E=u.call(this)||this;return E.topProd=p,E.follows={},E}return m.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},m.prototype.walkTerminal=function(p,E,g){},m.prototype.walkProdRef=function(p,E,g){var l=a(p.referencedRule,p.idx)+this.topProd.name,d=E.concat(g),f=new s.Alternative({definition:d}),C=n.first(f);this.follows[l]=C},m})(t.RestWalker);i.ResyncFollowsWalker=c;function A(u){var m={};return r.forEach(u,function(p){var E=new c(p).startWalking();r.assign(m,E)}),m}i.computeAllProdsFollows=A;function a(u,m){return u.name+m+o.IN}i.buildBetweenProdsFollowPrefix=a;function h(u){var m=u.terminalType.name;return m+u.idx+o.IN}i.buildInProdFollowPrefix=h}),jt=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defaultGrammarValidatorErrorProvider=i.defaultGrammarResolverErrorProvider=i.defaultParserErrorProvider=void 0;var e=pt(),t=Ne(),n=Ne(),r=Ze(),o=Ut();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,m=`
54
- but found: '`+u+"'";if(a)return h+a+m;var p=n.reduce(c,function(d,f){return d.concat(f)},[]),E=n.map(p,function(d){return"["+n.map(d,function(f){return e.tokenLabel(f)}).join(", ")+"]"}),g=n.map(E,function(d,f){return" "+(f+1)+". "+d}),l=`one of these possible Token sequences:
55
- `+g.join(`
56
- `);return h+l+m},buildEarlyExitMessage:function(s){var c=s.expectedIterationPaths,A=s.actual,a=s.customUserDescription;s.ruleName;var h="Expecting: ",u=n.first(A).image,m=`
57
- but found: '`+u+"'";if(a)return h+a+m;var p=n.map(c,function(g){return"["+n.map(g,function(l){return e.tokenLabel(l)}).join(",")+"]"}),E=`expecting at least one iteration which starts with one of these possible Token sequences::
58
- `+("<"+p.join(" ,")+">");return h+E+m}},Object.freeze(i.defaultParserErrorProvider),i.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(s,c){var A="Invalid grammar, reference to a rule which is not defined: ->"+c.nonTerminalName+`<-
59
- 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,m=o.getProductionDslName(h),p=A(h),E=u>0,g="->"+m+(E?u:"")+"<- "+(p?"with argument: ->"+p+"<-":"")+`
60
- appears more than once (`+c.length+" times) in the top level rule: ->"+a+`<-.
50
+ Or inspect the console log for details on how to resolve these issues.`)}),s.TRACE_INIT(`clearRegExpParserCache`,function(){a.clearRegExpParserCache()}),s.TRACE_INIT(`toFastProperties`,function(){n.toFastProperties(s)})})}return e.prototype.tokenize=function(e,t){if(t===void 0&&(t=this.defaultMode),!n.isEmpty(this.lexerDefinitionErrors)){var r=n.map(this.lexerDefinitionErrors,function(e){return e.message}).join(`-----------------------
51
+ `);throw Error(`Unable to Tokenize because Errors detected in definition of Lexer:
52
+ `+r)}return this.tokenizeInternal(e,t)},e.prototype.tokenizeInternal=function(e,r){var i=this,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y=e,b=y.length,x=0,S=0,C=this.hasCustom?0:Math.floor(e.length/10),w=Array(C),T=[],E=this.trackStartLines?1:void 0,D=this.trackStartLines?1:void 0,O=t.cloneEmptyGroups(this.emptyGroups),k=this.trackStartLines,A=this.config.lineTerminatorsPattern,j=0,M=[],N=[],ee=[],te=[];Object.freeze(te);var ne=void 0;function re(){return M}function ie(e){var n=t.charCodeToOptimizedIndex(e),r=N[n];return r===void 0?te:r}var P=function(e){if(ee.length===1&&e.tokenType.PUSH_MODE===void 0){var t=i.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);T.push({offset:e.startOffset,line:e.startLine===void 0?void 0:e.startLine,column:e.startColumn===void 0?void 0:e.startColumn,length:e.image.length,message:t})}else{ee.pop();var r=n.last(ee);M=i.patternIdxToConfig[r],N=i.charCodeToPatternIdxToConfig[r],j=M.length;var a=i.canModeBeOptimized[r]&&i.config.safeMode===!1;ne=N&&a?ie:re}};function ae(e){ee.push(e),N=this.charCodeToPatternIdxToConfig[e],M=this.patternIdxToConfig[e],j=M.length,j=M.length;var t=this.canModeBeOptimized[e]&&this.config.safeMode===!1;ne=N&&t?ie:re}ae.call(this,r);for(var F;x<b;){l=null;var oe=y.charCodeAt(x),se=ne(oe),I=se.length;for(a=0;a<I;a++){F=se[a];var L=F.pattern;u=null;var R=F.short;if(R===!1?F.isCustom===!0?(v=L.exec(y,x,w,O),v===null?l=null:(l=v[0],v.payload!==void 0&&(u=v.payload))):(this.updateLastIndex(L,x),l=this.match(L,e,x)):oe===R&&(l=L),l!==null){if(c=F.longerAlt,c!==void 0){var z=M[c],ce=z.pattern;d=null,z.isCustom===!0?(v=ce.exec(y,x,w,O),v===null?s=null:(s=v[0],v.payload!==void 0&&(d=v.payload))):(this.updateLastIndex(ce,x),s=this.match(ce,e,x)),s&&s.length>l.length&&(l=s,u=d,F=z)}break}}if(l!==null){if(f=l.length,p=F.group,p!==void 0&&(m=F.tokenTypeIdx,h=this.createTokenInstance(l,x,m,F.tokenType,E,D,f),this.handlePayload(h,u),p===!1?S=this.addToken(w,S,h):O[p].push(h)),e=this.chopInput(e,f),x+=f,D=this.computeNewColumn(D,f),k===!0&&F.canLineTerminator===!0){var B=0,le=void 0,ue=void 0;A.lastIndex=0;do le=A.test(l),le===!0&&(ue=A.lastIndex-1,B++);while(le===!0);B!==0&&(E+=B,D=f-ue,this.updateTokenEndLineColumnLocation(h,p,ue,B,E,D,f))}this.handleModes(F,P,ae,h)}else{for(var de=x,V=E,fe=D,H=!1;!H&&x<b;)for(y.charCodeAt(x),e=this.chopInput(e,1),x++,o=0;o<j;o++){var pe=M[o],L=pe.pattern,R=pe.short;if(R===!1?pe.isCustom===!0?H=L.exec(y,x,w,O)!==null:(this.updateLastIndex(L,x),H=L.exec(e)!==null):y.charCodeAt(x)===R&&(H=!0),H===!0)break}g=x-de,_=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(y,de,g,V,fe),T.push({offset:de,line:V,column:fe,length:g,message:_})}}return this.hasCustom||(w.length=S),{tokens:w,groups:O,errors:T}},e.prototype.handleModes=function(e,t,n,r){if(e.pop===!0){var i=e.push;t(r),i!==void 0&&n.call(this,i)}else e.push!==void 0&&n.call(this,e.push)},e.prototype.chopInput=function(e,t){return e.substring(t)},e.prototype.updateLastIndex=function(e,t){e.lastIndex=t},e.prototype.updateTokenEndLineColumnLocation=function(e,t,n,r,i,a,o){var s,c;t!==void 0&&(s=n===o-1,c=s?-1:0,r===1&&s===!0||(e.endLine=i+c,e.endColumn=a-1+-c))},e.prototype.computeNewColumn=function(e,t){return e+t},e.prototype.createTokenInstance=function(){return null},e.prototype.createOffsetOnlyToken=function(e,t,n,r){return{image:e,startOffset:t,tokenTypeIdx:n,tokenType:r}},e.prototype.createStartOnlyToken=function(e,t,n,r,i,a){return{image:e,startOffset:t,startLine:i,startColumn:a,tokenTypeIdx:n,tokenType:r}},e.prototype.createFullToken=function(e,t,n,r,i,a,o){return{image:e,startOffset:t,endOffset:t+o-1,startLine:i,endLine:i,startColumn:a,endColumn:a+o-1,tokenTypeIdx:n,tokenType:r}},e.prototype.addToken=function(e,t,n){return 666},e.prototype.addTokenUsingPush=function(e,t,n){return e.push(n),t},e.prototype.addTokenUsingMemberAccess=function(e,t,n){return e[t]=n,t++,t},e.prototype.handlePayload=function(e,t){},e.prototype.handlePayloadNoCustom=function(e,t){},e.prototype.handlePayloadWithCustom=function(e,t){t!==null&&(e.payload=t)},e.prototype.match=function(e,t,n){return null},e.prototype.matchWithTest=function(e,t,n){return e.test(t)===!0?t.substring(n,e.lastIndex):null},e.prototype.matchWithExec=function(e,t){var n=e.exec(t);return n===null?n:n[0]},e.prototype.TRACE_INIT=function(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;var r=Array(this.traceInitIndent+1).join(` `);this.traceInitIndent<this.traceInitMaxIdent&&console.log(r+`--> <`+e+`>`);var i=n.timer(t),a=i.time,o=i.value,s=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(r+`<-- <`+e+`> time: `+a+`ms`),this.traceInitIndent--,o}else return t()},e.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.`,e.NA=/NOT_APPLICABLE/,e}()}),He=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tokenMatcher=e.createTokenInstance=e.EOF=e.createToken=e.hasTokenLabel=e.tokenName=e.tokenLabel=void 0;var t=K(),n=Ve(),r=ze();function i(e){return o(e)?e.LABEL:e.name}e.tokenLabel=i;function a(e){return e.name}e.tokenName=a;function o(e){return t.isString(e.LABEL)&&e.LABEL!==``}e.hasTokenLabel=o;var s=`parent`,c=`categories`,l=`label`,u=`group`,d=`push_mode`,f=`pop_mode`,p=`longer_alt`,m=`line_breaks`,h=`start_chars_hint`;function g(e){return _(e)}e.createToken=g;function _(e){var n=e.pattern,i={};if(i.name=e.name,t.isUndefined(n)||(i.PATTERN=n),t.has(e,s))throw`The parent property is no longer supported.
53
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return t.has(e,c)&&(i.CATEGORIES=e[c]),r.augmentTokenTypes([i]),t.has(e,l)&&(i.LABEL=e[l]),t.has(e,u)&&(i.GROUP=e[u]),t.has(e,f)&&(i.POP_MODE=e[f]),t.has(e,d)&&(i.PUSH_MODE=e[d]),t.has(e,p)&&(i.LONGER_ALT=e[p]),t.has(e,m)&&(i.LINE_BREAKS=e[m]),t.has(e,h)&&(i.START_CHARS_HINT=e[h]),i}e.EOF=g({name:`EOF`,pattern:n.Lexer.NA}),r.augmentTokenTypes([e.EOF]);function v(e,t,n,r,i,a,o,s){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:a,startColumn:o,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}e.createTokenInstance=v;function y(e,t){return r.tokenStructuredMatcher(e,t)}e.tokenMatcher=y}),q=G(e=>{"use strict";var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.serializeProduction=e.serializeGrammar=e.Terminal=e.Alternation=e.RepetitionWithSeparator=e.Repetition=e.RepetitionMandatoryWithSeparator=e.RepetitionMandatory=e.Option=e.Alternative=e.Rule=e.NonTerminal=e.AbstractProduction=void 0;var n=K(),r=He(),i=function(){function e(e){this._definition=e}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){e.visit(this),n.forEach(this.definition,function(t){t.accept(e)})},e}();e.AbstractProduction=i;var a=function(e){t(r,e);function r(t){var r=e.call(this,[])||this;return r.idx=1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return Object.defineProperty(r.prototype,"definition",{get:function(){return this.referencedRule===void 0?[]:this.referencedRule.definition},set:function(e){},enumerable:!1,configurable:!0}),r.prototype.accept=function(e){e.visit(this)},r}(i);e.NonTerminal=a;var o=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.orgText=``,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return r}(i);e.Rule=o;var s=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.ignoreAmbiguities=!1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return r}(i);e.Alternative=s;var c=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.idx=1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return r}(i);e.Option=c;var l=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.idx=1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return r}(i);e.RepetitionMandatory=l;var u=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.idx=1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return r}(i);e.RepetitionMandatoryWithSeparator=u;var d=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.idx=1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return r}(i);e.Repetition=d;var f=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.idx=1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return r}(i);e.RepetitionWithSeparator=f;var p=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.idx=1,r.ignoreAmbiguities=!1,r.hasPredicates=!1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return Object.defineProperty(r.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),r}(i);e.Alternation=p;var m=function(){function e(e){this.idx=1,n.assign(this,n.pick(e,function(e){return e!==void 0}))}return e.prototype.accept=function(e){e.visit(this)},e}();e.Terminal=m;function h(e){return n.map(e,g)}e.serializeGrammar=h;function g(e){function t(e){return n.map(e,g)}if(e instanceof a)return{type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};if(e instanceof s)return{type:`Alternative`,definition:t(e.definition)};if(e instanceof c)return{type:`Option`,idx:e.idx,definition:t(e.definition)};if(e instanceof l)return{type:`RepetitionMandatory`,idx:e.idx,definition:t(e.definition)};if(e instanceof u)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:g(new m({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof f)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:g(new m({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof d)return{type:`Repetition`,idx:e.idx,definition:t(e.definition)};if(e instanceof p)return{type:`Alternation`,idx:e.idx,definition:t(e.definition)};if(e instanceof m){var i={type:`Terminal`,name:e.terminalType.name,label:r.tokenLabel(e.terminalType),idx:e.idx},h=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(i.pattern=n.isRegExp(h)?h.source:h),i}else{if(e instanceof o)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error(`non exhaustive match`)}}e.serializeProduction=g}),Ue=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RestWalker=void 0;var t=K(),n=q();e.RestWalker=function(){function e(){}return e.prototype.walk=function(e,r){var i=this;r===void 0&&(r=[]),t.forEach(e.definition,function(a,o){var s=t.drop(e.definition,o+1);if(a instanceof n.NonTerminal)i.walkProdRef(a,s,r);else if(a instanceof n.Terminal)i.walkTerminal(a,s,r);else if(a instanceof n.Alternative)i.walkFlat(a,s,r);else if(a instanceof n.Option)i.walkOption(a,s,r);else if(a instanceof n.RepetitionMandatory)i.walkAtLeastOne(a,s,r);else if(a instanceof n.RepetitionMandatoryWithSeparator)i.walkAtLeastOneSep(a,s,r);else if(a instanceof n.RepetitionWithSeparator)i.walkManySep(a,s,r);else if(a instanceof n.Repetition)i.walkMany(a,s,r);else if(a instanceof n.Alternation)i.walkOr(a,s,r);else throw Error(`non exhaustive match`)})},e.prototype.walkTerminal=function(e,t,n){},e.prototype.walkProdRef=function(e,t,n){},e.prototype.walkFlat=function(e,t,n){var r=t.concat(n);this.walk(e,r)},e.prototype.walkOption=function(e,t,n){var r=t.concat(n);this.walk(e,r)},e.prototype.walkAtLeastOne=function(e,t,r){var i=[new n.Option({definition:e.definition})].concat(t,r);this.walk(e,i)},e.prototype.walkAtLeastOneSep=function(e,t,n){var i=r(e,t,n);this.walk(e,i)},e.prototype.walkMany=function(e,t,r){var i=[new n.Option({definition:e.definition})].concat(t,r);this.walk(e,i)},e.prototype.walkManySep=function(e,t,n){var i=r(e,t,n);this.walk(e,i)},e.prototype.walkOr=function(e,r,i){var a=this,o=r.concat(i);t.forEach(e.definition,function(e){var t=new n.Alternative({definition:[e]});a.walk(t,o)})},e}();function r(e,t,r){return[new n.Option({definition:[new n.Terminal({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}}),We=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GAstVisitor=void 0;var t=q();e.GAstVisitor=function(){function e(){}return e.prototype.visit=function(e){var n=e;switch(n.constructor){case t.NonTerminal:return this.visitNonTerminal(n);case t.Alternative:return this.visitAlternative(n);case t.Option:return this.visitOption(n);case t.RepetitionMandatory:return this.visitRepetitionMandatory(n);case t.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(n);case t.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(n);case t.Repetition:return this.visitRepetition(n);case t.Alternation:return this.visitAlternation(n);case t.Terminal:return this.visitTerminal(n);case t.Rule:return this.visitRule(n);default:throw Error(`non exhaustive match`)}},e.prototype.visitNonTerminal=function(e){},e.prototype.visitAlternative=function(e){},e.prototype.visitOption=function(e){},e.prototype.visitRepetition=function(e){},e.prototype.visitRepetitionMandatory=function(e){},e.prototype.visitRepetitionMandatoryWithSeparator=function(e){},e.prototype.visitRepetitionWithSeparator=function(e){},e.prototype.visitAlternation=function(e){},e.prototype.visitTerminal=function(e){},e.prototype.visitRule=function(e){},e}()}),Ge=G(e=>{"use strict";var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.collectMethods=e.DslMethodsCollectorVisitor=e.getProductionDslName=e.isBranchingProd=e.isOptionalProd=e.isSequenceProd=void 0;var n=K(),r=q(),i=We();function a(e){return e instanceof r.Alternative||e instanceof r.Option||e instanceof r.Repetition||e instanceof r.RepetitionMandatory||e instanceof r.RepetitionMandatoryWithSeparator||e instanceof r.RepetitionWithSeparator||e instanceof r.Terminal||e instanceof r.Rule}e.isSequenceProd=a;function o(e,t){return t===void 0&&(t=[]),e instanceof r.Option||e instanceof r.Repetition||e instanceof r.RepetitionWithSeparator?!0:e instanceof r.Alternation?n.some(e.definition,function(e){return o(e,t)}):e instanceof r.NonTerminal&&n.contains(t,e)?!1:e instanceof r.AbstractProduction?(e instanceof r.NonTerminal&&t.push(e),n.every(e.definition,function(e){return o(e,t)})):!1}e.isOptionalProd=o;function s(e){return e instanceof r.Alternation}e.isBranchingProd=s;function c(e){if(e instanceof r.NonTerminal)return`SUBRULE`;if(e instanceof r.Option)return`OPTION`;if(e instanceof r.Alternation)return`OR`;if(e instanceof r.RepetitionMandatory)return`AT_LEAST_ONE`;if(e instanceof r.RepetitionMandatoryWithSeparator)return`AT_LEAST_ONE_SEP`;if(e instanceof r.RepetitionWithSeparator)return`MANY_SEP`;if(e instanceof r.Repetition)return`MANY`;if(e instanceof r.Terminal)return`CONSUME`;throw Error(`non exhaustive match`)}e.getProductionDslName=c;var l=function(e){t(r,e);function r(){var t=e!==null&&e.apply(this,arguments)||this;return t.separator=`-`,t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return r.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},r.prototype.visitTerminal=function(e){var t=e.terminalType.name+this.separator+`Terminal`;n.has(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},r.prototype.visitNonTerminal=function(e){var t=e.nonTerminalName+this.separator+`Terminal`;n.has(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},r.prototype.visitOption=function(e){this.dslMethods.option.push(e)},r.prototype.visitRepetitionWithSeparator=function(e){this.dslMethods.repetitionWithSeparator.push(e)},r.prototype.visitRepetitionMandatory=function(e){this.dslMethods.repetitionMandatory.push(e)},r.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)},r.prototype.visitRepetition=function(e){this.dslMethods.repetition.push(e)},r.prototype.visitAlternation=function(e){this.dslMethods.alternation.push(e)},r}(i.GAstVisitor);e.DslMethodsCollectorVisitor=l;var u=new l;function d(e){u.reset(),e.accept(u);var t=u.dslMethods;return u.reset(),t}e.collectMethods=d}),Ke=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.firstForTerminal=e.firstForBranching=e.firstForSequence=e.first=void 0;var t=K(),n=q(),r=Ge();function i(e){if(e instanceof n.NonTerminal)return i(e.referencedRule);if(e instanceof n.Terminal)return s(e);if(r.isSequenceProd(e))return a(e);if(r.isBranchingProd(e))return o(e);throw Error(`non exhaustive match`)}e.first=i;function a(e){for(var n=[],a=e.definition,o=0,s=a.length>o,c,l=!0;s&&l;)c=a[o],l=r.isOptionalProd(c),n=n.concat(i(c)),o+=1,s=a.length>o;return t.uniq(n)}e.firstForSequence=a;function o(e){var n=t.map(e.definition,function(e){return i(e)});return t.uniq(t.flatten(n))}e.firstForBranching=o;function s(e){return[e.terminalType]}e.firstForTerminal=s}),qe=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IN=void 0,e.IN=`_~IN~_`}),Je=G(e=>{"use strict";var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.buildInProdFollowPrefix=e.buildBetweenProdsFollowPrefix=e.computeAllProdsFollows=e.ResyncFollowsWalker=void 0;var n=Ue(),r=Ke(),i=K(),a=qe(),o=q(),s=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.topProd=t,n.follows={},n}return n.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},n.prototype.walkTerminal=function(e,t,n){},n.prototype.walkProdRef=function(e,t,n){var i=l(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(n),s=new o.Alternative({definition:a}),c=r.first(s);this.follows[i]=c},n}(n.RestWalker);e.ResyncFollowsWalker=s;function c(e){var t={};return i.forEach(e,function(e){var n=new s(e).startWalking();i.assign(t,n)}),t}e.computeAllProdsFollows=c;function l(e,t){return e.name+t+a.IN}e.buildBetweenProdsFollowPrefix=l;function u(e){return e.terminalType.name+e.idx+a.IN}e.buildInProdFollowPrefix=u}),Ye=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultGrammarValidatorErrorProvider=e.defaultGrammarResolverErrorProvider=e.defaultParserErrorProvider=void 0;var t=He(),n=K(),r=K(),i=q(),a=Ge();e.defaultParserErrorProvider={buildMismatchTokenMessage:function(e){var n=e.expected,r=e.actual;return e.previous,e.ruleName,`Expecting `+(t.hasTokenLabel(n)?`--> `+t.tokenLabel(n)+` <--`:`token of type --> `+n.name+` <--`)+` but found --> '`+r.image+`' <--`},buildNotAllInputParsedMessage:function(e){var t=e.firstRedundant;return e.ruleName,`Redundant input, expecting EOF but found: `+t.image},buildNoViableAltMessage:function(e){var n=e.expectedPathsPerAlt,i=e.actual;e.previous;var a=e.customUserDescription;e.ruleName;var o=`Expecting: `,s=`
54
+ but found: '`+r.first(i).image+`'`;if(a)return o+a+s;var c=r.reduce(n,function(e,t){return e.concat(t)},[]),l=r.map(c,function(e){return`[`+r.map(e,function(e){return t.tokenLabel(e)}).join(`, `)+`]`});return o+(`one of these possible Token sequences:
55
+ `+r.map(l,function(e,t){return` `+(t+1)+`. `+e}).join(`
56
+ `))+s},buildEarlyExitMessage:function(e){var n=e.expectedIterationPaths,i=e.actual,a=e.customUserDescription;e.ruleName;var o=`Expecting: `,s=`
57
+ but found: '`+r.first(i).image+`'`;return a?o+a+s:o+(`expecting at least one iteration which starts with one of these possible Token sequences::
58
+ `+(`<`+r.map(n,function(e){return`[`+r.map(e,function(e){return t.tokenLabel(e)}).join(`,`)+`]`}).join(` ,`)+`>`))+s}},Object.freeze(e.defaultParserErrorProvider),e.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(e,t){return`Invalid grammar, reference to a rule which is not defined: ->`+t.nonTerminalName+`<-
59
+ inside top level rule: ->`+e.name+`<-`}},e.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(e,t){function n(e){return e instanceof i.Terminal?e.terminalType.name:e instanceof i.NonTerminal?e.nonTerminalName:``}var o=e.name,s=r.first(t),c=s.idx,l=a.getProductionDslName(s),u=n(s),d=c>0,f=`->`+l+(d?c:``)+`<- `+(u?`with argument: ->`+u+`<-`:``)+`
60
+ appears more than once (`+t.length+` times) in the top level rule: ->`+o+`<-.
61
61
  For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
62
- `;return g=g.replace(/[ \t]+/g," "),g=g.replace(/\s\s+/g,`
63
- `),g},buildNamespaceConflictError:function(s){var c=`Namespace conflict found in grammar.
64
- `+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+s.name+`>.
62
+ `;return f=f.replace(/[ \t]+/g,` `),f=f.replace(/\s\s+/g,`
63
+ `),f},buildNamespaceConflictError:function(e){return`Namespace conflict found in grammar.
64
+ `+(`The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <`+e.name+`>.
65
65
  `)+`To resolve this make sure each Terminal and Non-Terminal names are unique
66
66
  This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
67
- and Non-Terminal names start with a lower case letter.`;return c},buildAlternationPrefixAmbiguityError:function(s){var c=n.map(s.prefixPath,function(h){return e.tokenLabel(h)}).join(", "),A=s.alternation.idx===0?"":s.alternation.idx,a="Ambiguous alternatives: <"+s.ambiguityIndices.join(" ,")+`> due to common lookahead prefix
68
- `+("in <OR"+A+"> inside <"+s.topLevelRule.name+`> Rule,
69
- `)+("<"+c+`> may appears as a prefix path in all these alternatives.
67
+ and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError:function(e){var n=r.map(e.prefixPath,function(e){return t.tokenLabel(e)}).join(`, `),i=e.alternation.idx===0?``:e.alternation.idx;return`Ambiguous alternatives: <`+e.ambiguityIndices.join(` ,`)+`> due to common lookahead prefix
68
+ `+(`in <OR`+i+`> inside <`+e.topLevelRule.name+`> Rule,
69
+ `)+(`<`+n+`> may appears as a prefix path in all these alternatives.
70
70
  `)+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
71
- For Further details.`;return a},buildAlternationAmbiguityError:function(s){var c=n.map(s.prefixPath,function(h){return e.tokenLabel(h)}).join(", "),A=s.alternation.idx===0?"":s.alternation.idx,a="Ambiguous Alternatives Detected: <"+s.ambiguityIndices.join(" ,")+"> in <OR"+A+">"+(" inside <"+s.topLevelRule.name+`> Rule,
72
- `)+("<"+c+`> may appears as a prefix path in all these alternatives.
73
- `);return a=a+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
74
- For Further details.`,a},buildEmptyRepetitionError:function(s){var c=o.getProductionDslName(s.repetition);s.repetition.idx!==0&&(c+=s.repetition.idx);var A="The repetition <"+c+"> within Rule <"+s.topLevelRule.name+`> can never consume any tokens.
75
- This could lead to an infinite loop.`;return A},buildTokenNameError:function(s){return"deprecated"},buildEmptyAlternationError:function(s){var c="Ambiguous empty alternative: <"+(s.emptyChoiceIdx+1)+">"+(" in <OR"+s.alternation.idx+"> inside <"+s.topLevelRule.name+`> Rule.
76
- `)+"Only the last alternative may be an empty alternative.";return c},buildTooManyAlternativesError:function(s){var c=`An Alternation cannot have more than 256 alternatives:
77
- `+("<OR"+s.alternation.idx+"> inside <"+s.topLevelRule.name+`> Rule.
78
- has `+(s.alternation.definition.length+1)+" alternatives.");return c},buildLeftRecursionError:function(s){var c=s.topLevelRule.name,A=t.map(s.leftRecursionPath,function(u){return u.name}),a=c+" --> "+A.concat([c]).join(" --> "),h=`Left Recursion found in grammar.
79
- `+("rule: <"+c+`> can be invoked from itself (directly or indirectly)
71
+ For Further details.`},buildAlternationAmbiguityError:function(e){var n=r.map(e.prefixPath,function(e){return t.tokenLabel(e)}).join(`, `),i=e.alternation.idx===0?``:e.alternation.idx,a=`Ambiguous Alternatives Detected: <`+e.ambiguityIndices.join(` ,`)+`> in <OR`+i+`>`+(` inside <`+e.topLevelRule.name+`> Rule,
72
+ `)+(`<`+n+`> may appears as a prefix path in all these alternatives.
73
+ `);return a+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
74
+ For Further details.`,a},buildEmptyRepetitionError:function(e){var t=a.getProductionDslName(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <`+t+`> within Rule <`+e.topLevelRule.name+`> can never consume any tokens.
75
+ This could lead to an infinite loop.`},buildTokenNameError:function(e){return`deprecated`},buildEmptyAlternationError:function(e){return`Ambiguous empty alternative: <`+(e.emptyChoiceIdx+1)+`>`+(` in <OR`+e.alternation.idx+`> inside <`+e.topLevelRule.name+`> Rule.
76
+ `)+`Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError:function(e){return`An Alternation cannot have more than 256 alternatives:
77
+ `+(`<OR`+e.alternation.idx+`> inside <`+e.topLevelRule.name+`> Rule.
78
+ has `+(e.alternation.definition.length+1)+` alternatives.`)},buildLeftRecursionError:function(e){var t=e.topLevelRule.name,r=n.map(e.leftRecursionPath,function(e){return e.name}),i=t+` --> `+r.concat([t]).join(` --> `);return`Left Recursion found in grammar.
79
+ `+(`rule: <`+t+`> can be invoked from itself (directly or indirectly)
80
80
  `)+(`without consuming any Tokens. The grammar path that causes this is:
81
- `+a+`
81
+ `+i+`
82
82
  `)+` To fix this refactor your grammar to remove the left recursion.
83
- 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}}}),so=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 m in u)Object.prototype.hasOwnProperty.call(u,m)&&(h[m]=u[m])},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=nt(),n=Ne(),r=St();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}),Ht=ve(i=>{var e=i&&i.__extends||(function(){var l=function(d,f){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,I){C.__proto__=I}||function(C,I){for(var y in I)Object.prototype.hasOwnProperty.call(I,y)&&(C[y]=I[y])},l(d,f)};return function(d,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");l(d,f);function C(){this.constructor=d}d.prototype=f===null?Object.create(f):(C.prototype=f.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=Bn(),n=Ne(),r=li(),o=Ze(),s=(function(l){e(d,l);function d(f,C){var I=l.call(this)||this;return I.topProd=f,I.path=C,I.possibleTokTypes=[],I.nextProductionName="",I.nextProductionOccurrence=0,I.found=!1,I.isAtEndOfPath=!1,I}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(f,C){C===void 0&&(C=[]),this.found||l.prototype.walk.call(this,f,C)},d.prototype.walkProdRef=function(f,C,I){if(f.referencedRule.name===this.nextProductionName&&f.idx===this.nextProductionOccurrence){var y=C.concat(I);this.updateExpectedNext(),this.walk(f.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(f,C){var I=l.call(this,f,C)||this;return I.path=C,I.nextTerminalName="",I.nextTerminalOccurrence=0,I.nextTerminalName=I.path.lastTok.name,I.nextTerminalOccurrence=I.path.lastTokOccurrence,I}return d.prototype.walkTerminal=function(f,C,I){if(this.isAtEndOfPath&&f.terminalType.name===this.nextTerminalName&&f.idx===this.nextTerminalOccurrence&&!this.found){var y=C.concat(I),v=new o.Alternative({definition:y});this.possibleTokTypes=r.first(v),this.found=!0}},d})(s);i.NextAfterTokenWalker=c;var A=(function(l){e(d,l);function d(f,C){var I=l.call(this)||this;return I.topRule=f,I.occurrence=C,I.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},I}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(f,C,I){if(f.idx===this.occurrence){var y=n.first(C.concat(I));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,f,C,I)},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(f,C,I){if(f.idx===this.occurrence){var y=n.first(C.concat(I));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,f,C,I)},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(f,C,I){if(f.idx===this.occurrence){var y=n.first(C.concat(I));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,f,C,I)},d})(A);i.NextTerminalAfterAtLeastOneWalker=u;var m=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.prototype.walkAtLeastOneSep=function(f,C,I){if(f.idx===this.occurrence){var y=n.first(C.concat(I));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,f,C,I)},d})(A);i.NextTerminalAfterAtLeastOneSepWalker=m;function p(l,d,f){f===void 0&&(f=[]),f=n.cloneArr(f);var C=[],I=0;function y(Q){return Q.concat(n.drop(l,I+1))}function v(Q){var P=p(y(Q),d,f);return C.concat(P)}for(;f.length<d&&I<l.length;){var L=l[I];if(L instanceof o.Alternative||L instanceof o.NonTerminal)return v(L.definition);if(L instanceof o.Option)C=v(L.definition);else if(L instanceof o.RepetitionMandatory){var H=L.definition.concat([new o.Repetition({definition:L.definition})]);return v(H)}else if(L instanceof o.RepetitionMandatoryWithSeparator){var H=[new o.Alternative({definition:L.definition}),new o.Repetition({definition:[new o.Terminal({terminalType:L.separator})].concat(L.definition)})];return v(H)}else if(L instanceof o.RepetitionWithSeparator){var H=L.definition.concat([new o.Repetition({definition:[new o.Terminal({terminalType:L.separator})].concat(L.definition)})]);C=v(H)}else if(L instanceof o.Repetition){var H=L.definition.concat([new o.Repetition({definition:L.definition})]);C=v(H)}else{if(L instanceof o.Alternation)return n.forEach(L.definition,function(Q){n.isEmpty(Q.definition)===!1&&(C=v(Q.definition))}),C;if(L instanceof o.Terminal)f.push(L.terminalType);else throw Error("non exhaustive match")}I++}return C.push({partialPath:f,suffixDef:n.drop(l,I)}),C}i.possiblePathsFrom=p;function E(l,d,f,C){var I="EXIT_NONE_TERMINAL",y=[I],v="EXIT_ALTERNATIVE",L=!1,H=d.length,Q=H-C-1,P=[],D=[];for(D.push({idx:-1,def:l,ruleStack:[],occurrenceStack:[]});!n.isEmpty(D);){var R=D.pop();if(R===v){L&&n.last(D).idx<=Q&&D.pop();continue}var F=R.def,_=R.idx,X=R.ruleStack,Z=R.occurrenceStack;if(!n.isEmpty(F)){var V=F[0];if(V===I){var $={idx:_,def:n.drop(F),ruleStack:n.dropRight(X),occurrenceStack:n.dropRight(Z)};D.push($)}else if(V instanceof o.Terminal)if(_<H-1){var ie=_+1,ue=d[ie];if(f(ue,V.terminalType)){var $={idx:ie,def:n.drop(F),ruleStack:X,occurrenceStack:Z};D.push($)}}else if(_===H-1)P.push({nextTokenType:V.terminalType,nextTokenOccurrence:V.idx,ruleStack:X,occurrenceStack:Z}),L=!0;else throw Error("non exhaustive match");else if(V instanceof o.NonTerminal){var ae=n.cloneArr(X);ae.push(V.nonTerminalName);var se=n.cloneArr(Z);se.push(V.idx);var $={idx:_,def:V.definition.concat(y,n.drop(F)),ruleStack:ae,occurrenceStack:se};D.push($)}else if(V instanceof o.Option){var ee={idx:_,def:n.drop(F),ruleStack:X,occurrenceStack:Z};D.push(ee),D.push(v);var de={idx:_,def:V.definition.concat(n.drop(F)),ruleStack:X,occurrenceStack:Z};D.push(de)}else if(V instanceof o.RepetitionMandatory){var G=new o.Repetition({definition:V.definition,idx:V.idx}),j=V.definition.concat([G],n.drop(F)),$={idx:_,def:j,ruleStack:X,occurrenceStack:Z};D.push($)}else if(V instanceof o.RepetitionMandatoryWithSeparator){var Y=new o.Terminal({terminalType:V.separator}),G=new o.Repetition({definition:[Y].concat(V.definition),idx:V.idx}),j=V.definition.concat([G],n.drop(F)),$={idx:_,def:j,ruleStack:X,occurrenceStack:Z};D.push($)}else if(V instanceof o.RepetitionWithSeparator){var ee={idx:_,def:n.drop(F),ruleStack:X,occurrenceStack:Z};D.push(ee),D.push(v);var Y=new o.Terminal({terminalType:V.separator}),z=new o.Repetition({definition:[Y].concat(V.definition),idx:V.idx}),j=V.definition.concat([z],n.drop(F)),de={idx:_,def:j,ruleStack:X,occurrenceStack:Z};D.push(de)}else if(V instanceof o.Repetition){var ee={idx:_,def:n.drop(F),ruleStack:X,occurrenceStack:Z};D.push(ee),D.push(v);var z=new o.Repetition({definition:V.definition,idx:V.idx}),j=V.definition.concat([z],n.drop(F)),de={idx:_,def:j,ruleStack:X,occurrenceStack:Z};D.push(de)}else if(V instanceof o.Alternation)for(var te=V.definition.length-1;te>=0;te--){var oe=V.definition[te],Be={idx:_,def:oe.definition.concat(n.drop(F)),ruleStack:X,occurrenceStack:Z};D.push(Be),D.push(v)}else if(V instanceof o.Alternative)D.push({idx:_,def:V.definition.concat(n.drop(F)),ruleStack:X,occurrenceStack:Z});else if(V instanceof o.Rule)D.push(g(V,_,X,Z));else throw Error("non exhaustive match")}}return P}i.nextPossibleTokensAfter=E;function g(l,d,f,C){var I=n.cloneArr(f);I.push(l.name);var y=n.cloneArr(C);return y.push(1),{idx:d,def:l.definition,ruleStack:I,occurrenceStack:y}}}),qt=ve(i=>{var e=i&&i.__extends||(function(){var Q=function(P,D){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,F){R.__proto__=F}||function(R,F){for(var _ in F)Object.prototype.hasOwnProperty.call(F,_)&&(R[_]=F[_])},Q(P,D)};return function(P,D){if(typeof D!="function"&&D!==null)throw new TypeError("Class extends value "+String(D)+" is not a constructor or null");Q(P,D);function R(){this.constructor=P}P.prototype=D===null?Object.create(D):(R.prototype=D.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=Ne(),n=Ht(),r=Bn(),o=kt(),s=Ze(),c=St(),A;(function(Q){Q[Q.OPTION=0]="OPTION",Q[Q.REPETITION=1]="REPETITION",Q[Q.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",Q[Q.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",Q[Q.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",Q[Q.ALTERNATION=5]="ALTERNATION"})(A=i.PROD_TYPE||(i.PROD_TYPE={}));function a(Q){if(Q instanceof s.Option)return A.OPTION;if(Q instanceof s.Repetition)return A.REPETITION;if(Q instanceof s.RepetitionMandatory)return A.REPETITION_MANDATORY;if(Q instanceof s.RepetitionMandatoryWithSeparator)return A.REPETITION_MANDATORY_WITH_SEPARATOR;if(Q instanceof s.RepetitionWithSeparator)return A.REPETITION_WITH_SEPARATOR;if(Q instanceof s.Alternation)return A.ALTERNATION;throw Error("non exhaustive match")}i.getProdType=a;function h(Q,P,D,R,F,_){var X=I(Q,P,D),Z=H(X)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return _(X,R,Z,F)}i.buildLookaheadFuncForOr=h;function u(Q,P,D,R,F,_){var X=y(Q,P,F,D),Z=H(X)?o.tokenStructuredMatcherNoCategories:o.tokenStructuredMatcher;return _(X[0],Z,R)}i.buildLookaheadFuncForOptionalProd=u;function m(Q,P,D,R){var F=Q.length,_=t.every(Q,function(V){return t.every(V,function($){return $.length===1})});if(P)return function(V){for(var $=t.map(V,function(z){return z.GATE}),ie=0;ie<F;ie++){var ue=Q[ie],ae=ue.length,se=$[ie];if(!(se!==void 0&&se.call(this)===!1))e:for(var ee=0;ee<ae;ee++){for(var de=ue[ee],G=de.length,j=0;j<G;j++){var Y=this.LA(j+1);if(D(Y,de[j])===!1)continue e}return ie}}};if(_&&!R){var X=t.map(Q,function(V){return t.flatten(V)}),Z=t.reduce(X,function(V,$,ie){return t.forEach($,function(ue){t.has(V,ue.tokenTypeIdx)||(V[ue.tokenTypeIdx]=ie),t.forEach(ue.categoryMatches,function(ae){t.has(V,ae)||(V[ae]=ie)})}),V},[]);return function(){var V=this.LA(1);return Z[V.tokenTypeIdx]}}else return function(){for(var V=0;V<F;V++){var $=Q[V],ie=$.length;e:for(var ue=0;ue<ie;ue++){for(var ae=$[ue],se=ae.length,ee=0;ee<se;ee++){var de=this.LA(ee+1);if(D(de,ae[ee])===!1)continue e}return V}}}}i.buildAlternativesLookAheadFunc=m;function p(Q,P,D){var R=t.every(Q,function($){return $.length===1}),F=Q.length;if(R&&!D){var _=t.flatten(Q);if(_.length===1&&t.isEmpty(_[0].categoryMatches)){var X=_[0],Z=X.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===Z}}else{var V=t.reduce(_,function($,ie,ue){return $[ie.tokenTypeIdx]=!0,t.forEach(ie.categoryMatches,function(ae){$[ae]=!0}),$},[]);return function(){var $=this.LA(1);return V[$.tokenTypeIdx]===!0}}}else return function(){e:for(var $=0;$<F;$++){for(var ie=Q[$],ue=ie.length,ae=0;ae<ue;ae++){var se=this.LA(ae+1);if(P(se,ie[ae])===!1)continue e}return!0}return!1}}i.buildSingleAlternativeLookaheadFunction=p;var E=(function(Q){e(P,Q);function P(D,R,F){var _=Q.call(this)||this;return _.topProd=D,_.targetOccurrence=R,_.targetProdType=F,_}return P.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},P.prototype.checkIsTarget=function(D,R,F,_){return D.idx===this.targetOccurrence&&this.targetProdType===R?(this.restDef=F.concat(_),!0):!1},P.prototype.walkOption=function(D,R,F){this.checkIsTarget(D,A.OPTION,R,F)||Q.prototype.walkOption.call(this,D,R,F)},P.prototype.walkAtLeastOne=function(D,R,F){this.checkIsTarget(D,A.REPETITION_MANDATORY,R,F)||Q.prototype.walkOption.call(this,D,R,F)},P.prototype.walkAtLeastOneSep=function(D,R,F){this.checkIsTarget(D,A.REPETITION_MANDATORY_WITH_SEPARATOR,R,F)||Q.prototype.walkOption.call(this,D,R,F)},P.prototype.walkMany=function(D,R,F){this.checkIsTarget(D,A.REPETITION,R,F)||Q.prototype.walkOption.call(this,D,R,F)},P.prototype.walkManySep=function(D,R,F){this.checkIsTarget(D,A.REPETITION_WITH_SEPARATOR,R,F)||Q.prototype.walkOption.call(this,D,R,F)},P})(r.RestWalker),g=(function(Q){e(P,Q);function P(D,R,F){var _=Q.call(this)||this;return _.targetOccurrence=D,_.targetProdType=R,_.targetRef=F,_.result=[],_}return P.prototype.checkIsTarget=function(D,R){D.idx===this.targetOccurrence&&this.targetProdType===R&&(this.targetRef===void 0||D===this.targetRef)&&(this.result=D.definition)},P.prototype.visitOption=function(D){this.checkIsTarget(D,A.OPTION)},P.prototype.visitRepetition=function(D){this.checkIsTarget(D,A.REPETITION)},P.prototype.visitRepetitionMandatory=function(D){this.checkIsTarget(D,A.REPETITION_MANDATORY)},P.prototype.visitRepetitionMandatoryWithSeparator=function(D){this.checkIsTarget(D,A.REPETITION_MANDATORY_WITH_SEPARATOR)},P.prototype.visitRepetitionWithSeparator=function(D){this.checkIsTarget(D,A.REPETITION_WITH_SEPARATOR)},P.prototype.visitAlternation=function(D){this.checkIsTarget(D,A.ALTERNATION)},P})(c.GAstVisitor);function l(Q){for(var P=new Array(Q),D=0;D<Q;D++)P[D]=[];return P}function d(Q){for(var P=[""],D=0;D<Q.length;D++){for(var R=Q[D],F=[],_=0;_<P.length;_++){var X=P[_];F.push(X+"_"+R.tokenTypeIdx);for(var Z=0;Z<R.categoryMatches.length;Z++){var V="_"+R.categoryMatches[Z];F.push(X+V)}}P=F}return P}function f(Q,P,D){for(var R=0;R<Q.length;R++)if(R!==D)for(var F=Q[R],_=0;_<P.length;_++){var X=P[_];if(F[X]===!0)return!1}return!0}function C(Q,P){for(var D=t.map(Q,function(ie){return n.possiblePathsFrom([ie],1)}),R=l(D.length),F=t.map(D,function(ie){var ue={};return t.forEach(ie,function(ae){var se=d(ae.partialPath);t.forEach(se,function(ee){ue[ee]=!0})}),ue}),_=D,X=1;X<=P;X++){var Z=_;_=l(Z.length);for(var V=function(ie){for(var ue=Z[ie],ae=0;ae<ue.length;ae++){var se=ue[ae].partialPath,ee=ue[ae].suffixDef,de=d(se),G=f(F,de,ie);if(G||t.isEmpty(ee)||se.length===P){var j=R[ie];if(v(j,se)===!1){j.push(se);for(var Y=0;Y<de.length;Y++){var z=de[Y];F[ie][z]=!0}}}else{var te=n.possiblePathsFrom(ee,X+1,se);_[ie]=_[ie].concat(te),t.forEach(te,function(oe){var Be=d(oe.partialPath);t.forEach(Be,function(we){F[ie][we]=!0})})}}},$=0;$<Z.length;$++)V($)}return R}i.lookAheadSequenceFromAlternatives=C;function I(Q,P,D,R){var F=new g(Q,A.ALTERNATION,R);return P.accept(F),C(F.result,D)}i.getLookaheadPathsForOr=I;function y(Q,P,D,R){var F=new g(Q,D);P.accept(F);var _=F.result,X=new E(P,Q,D),Z=X.startWalking(),V=new s.Alternative({definition:_}),$=new s.Alternative({definition:Z});return C([V,$],R)}i.getLookaheadPathsForOptionalProd=y;function v(Q,P){e:for(var D=0;D<Q.length;D++){var R=Q[D];if(R.length===P.length){for(var F=0;F<R.length;F++){var _=P[F],X=R[F],Z=_===X||X.categoryMatchesMap[_.tokenTypeIdx]!==void 0;if(Z===!1)continue e}return!0}}return!1}i.containsPath=v;function L(Q,P){return Q.length<P.length&&t.every(Q,function(D,R){var F=P[R];return D===F||F.categoryMatchesMap[D.tokenTypeIdx]})}i.isStrictPrefixOfPath=L;function H(Q){return t.every(Q,function(P){return t.every(P,function(D){return t.every(D,function(R){return t.isEmpty(R.categoryMatches)})})})}i.areTokenCategoriesNotUsed=H}),hi=ve(i=>{var e=i&&i.__extends||(function(){var R=function(F,_){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,Z){X.__proto__=Z}||function(X,Z){for(var V in Z)Object.prototype.hasOwnProperty.call(Z,V)&&(X[V]=Z[V])},R(F,_)};return function(F,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");R(F,_);function X(){this.constructor=F}F.prototype=_===null?Object.create(_):(X.prototype=_.prototype,new X)}})();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=Ne(),n=Ne(),r=nt(),o=Ut(),s=qt(),c=Ht(),A=Ze(),a=St();function h(R,F,_,X,Z){var V=t.map(R,function(G){return u(G,X)}),$=t.map(R,function(G){return d(G,G,X)}),ie=[],ue=[],ae=[];n.every($,n.isEmpty)&&(ie=n.map(R,function(G){return I(G,X)}),ue=n.map(R,function(G){return y(G,F,X)}),ae=H(R,F,X));var se=D(R,_,X),ee=n.map(R,function(G){return L(G,X)}),de=n.map(R,function(G){return g(G,R,Z,X)});return t.flatten(V.concat(ae,$,ie,ue,se,ee,de))}i.validateGrammar=h;function u(R,F){var _=new E;R.accept(_);var X=_.allProductions,Z=t.groupBy(X,m),V=t.pick(Z,function(ie){return ie.length>1}),$=t.map(t.values(V),function(ie){var ue=t.first(ie),ae=F.buildDuplicateFoundError(R,ie),se=o.getProductionDslName(ue),ee={message:ae,type:r.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:R.name,dslName:se,occurrence:ue.idx},de=p(ue);return de&&(ee.parameter=de),ee});return $}function m(R){return o.getProductionDslName(R)+"_#_"+R.idx+"_#_"+p(R)}i.identifyProductionForDuplicates=m;function p(R){return R instanceof A.Terminal?R.terminalType.name:R instanceof A.NonTerminal?R.nonTerminalName:""}var E=(function(R){e(F,R);function F(){var _=R!==null&&R.apply(this,arguments)||this;return _.allProductions=[],_}return F.prototype.visitNonTerminal=function(_){this.allProductions.push(_)},F.prototype.visitOption=function(_){this.allProductions.push(_)},F.prototype.visitRepetitionWithSeparator=function(_){this.allProductions.push(_)},F.prototype.visitRepetitionMandatory=function(_){this.allProductions.push(_)},F.prototype.visitRepetitionMandatoryWithSeparator=function(_){this.allProductions.push(_)},F.prototype.visitRepetition=function(_){this.allProductions.push(_)},F.prototype.visitAlternation=function(_){this.allProductions.push(_)},F.prototype.visitTerminal=function(_){this.allProductions.push(_)},F})(a.GAstVisitor);i.OccurrenceValidationCollector=E;function g(R,F,_,X){var Z=[],V=n.reduce(F,function(ie,ue){return ue.name===R.name?ie+1:ie},0);if(V>1){var $=X.buildDuplicateRuleNameError({topLevelRule:R,grammarName:_});Z.push({message:$,type:r.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:R.name})}return Z}i.validateRuleDoesNotAlreadyExist=g;function l(R,F,_){var X=[],Z;return t.contains(F,R)||(Z="Invalid rule override, rule: ->"+R+"<- cannot be overridden in the grammar: ->"+_+"<-as it is not defined in any of the super grammars ",X.push({message:Z,type:r.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:R})),X}i.validateRuleIsOverridden=l;function d(R,F,_,X){X===void 0&&(X=[]);var Z=[],V=f(F.definition);if(t.isEmpty(V))return[];var $=R.name,ie=t.contains(V,R);ie&&Z.push({message:_.buildLeftRecursionError({topLevelRule:R,leftRecursionPath:X}),type:r.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:$});var ue=t.difference(V,X.concat([R])),ae=t.map(ue,function(se){var ee=t.cloneArr(X);return ee.push(se),d(R,se,_,ee)});return Z.concat(t.flatten(ae))}i.validateNoLeftRecursion=d;function f(R){var F=[];if(t.isEmpty(R))return F;var _=t.first(R);if(_ instanceof A.NonTerminal)F.push(_.referencedRule);else if(_ instanceof A.Alternative||_ instanceof A.Option||_ instanceof A.RepetitionMandatory||_ instanceof A.RepetitionMandatoryWithSeparator||_ instanceof A.RepetitionWithSeparator||_ instanceof A.Repetition)F=F.concat(f(_.definition));else if(_ instanceof A.Alternation)F=t.flatten(t.map(_.definition,function($){return f($.definition)}));else if(!(_ instanceof A.Terminal))throw Error("non exhaustive match");var X=o.isOptionalProd(_),Z=R.length>1;if(X&&Z){var V=t.drop(R);return F.concat(f(V))}else return F}i.getFirstNoneTerminal=f;var C=(function(R){e(F,R);function F(){var _=R!==null&&R.apply(this,arguments)||this;return _.alternations=[],_}return F.prototype.visitAlternation=function(_){this.alternations.push(_)},F})(a.GAstVisitor);function I(R,F){var _=new C;R.accept(_);var X=_.alternations,Z=t.reduce(X,function(V,$){var ie=t.dropRight($.definition),ue=t.map(ie,function(ae,se){var ee=c.nextPossibleTokensAfter([ae],[],null,1);return t.isEmpty(ee)?{message:F.buildEmptyAlternationError({topLevelRule:R,alternation:$,emptyChoiceIdx:se}),type:r.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:R.name,occurrence:$.idx,alternative:se+1}:null});return V.concat(t.compact(ue))},[]);return Z}i.validateEmptyOrAlternative=I;function y(R,F,_){var X=new C;R.accept(X);var Z=X.alternations;Z=n.reject(Z,function($){return $.ignoreAmbiguities===!0});var V=t.reduce(Z,function($,ie){var ue=ie.idx,ae=ie.maxLookahead||F,se=s.getLookaheadPathsForOr(ue,R,ae,ie),ee=Q(se,ie,R,_),de=P(se,ie,R,_);return $.concat(ee,de)},[]);return V}i.validateAmbiguousAlternationAlternatives=y;var v=(function(R){e(F,R);function F(){var _=R!==null&&R.apply(this,arguments)||this;return _.allProductions=[],_}return F.prototype.visitRepetitionWithSeparator=function(_){this.allProductions.push(_)},F.prototype.visitRepetitionMandatory=function(_){this.allProductions.push(_)},F.prototype.visitRepetitionMandatoryWithSeparator=function(_){this.allProductions.push(_)},F.prototype.visitRepetition=function(_){this.allProductions.push(_)},F})(a.GAstVisitor);i.RepetionCollector=v;function L(R,F){var _=new C;R.accept(_);var X=_.alternations,Z=t.reduce(X,function(V,$){return $.definition.length>255&&V.push({message:F.buildTooManyAlternativesError({topLevelRule:R,alternation:$}),type:r.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:R.name,occurrence:$.idx}),V},[]);return Z}i.validateTooManyAlts=L;function H(R,F,_){var X=[];return n.forEach(R,function(Z){var V=new v;Z.accept(V);var $=V.allProductions;n.forEach($,function(ie){var ue=s.getProdType(ie),ae=ie.maxLookahead||F,se=ie.idx,ee=s.getLookaheadPathsForOptionalProd(se,Z,ue,ae),de=ee[0];if(n.isEmpty(n.flatten(de))){var G=_.buildEmptyRepetitionError({topLevelRule:Z,repetition:ie});X.push({message:G,type:r.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:Z.name})}})}),X}i.validateSomeNonEmptyLookaheadPath=H;function Q(R,F,_,X){var Z=[],V=n.reduce(R,function(ie,ue,ae){return F.definition[ae].ignoreAmbiguities===!0||n.forEach(ue,function(se){var ee=[ae];n.forEach(R,function(de,G){ae!==G&&s.containsPath(de,se)&&F.definition[G].ignoreAmbiguities!==!0&&ee.push(G)}),ee.length>1&&!s.containsPath(Z,se)&&(Z.push(se),ie.push({alts:ee,path:se}))}),ie},[]),$=t.map(V,function(ie){var ue=n.map(ie.alts,function(se){return se+1}),ae=X.buildAlternationAmbiguityError({topLevelRule:_,alternation:F,ambiguityIndices:ue,prefixPath:ie.path});return{message:ae,type:r.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:_.name,occurrence:F.idx,alternatives:[ie.alts]}});return $}function P(R,F,_,X){var Z=[],V=n.reduce(R,function($,ie,ue){var ae=n.map(ie,function(se){return{idx:ue,path:se}});return $.concat(ae)},[]);return n.forEach(V,function($){var ie=F.definition[$.idx];if(ie.ignoreAmbiguities!==!0){var ue=$.idx,ae=$.path,se=n.findAll(V,function(de){return F.definition[de.idx].ignoreAmbiguities!==!0&&de.idx<ue&&s.isStrictPrefixOfPath(de.path,ae)}),ee=n.map(se,function(de){var G=[de.idx+1,ue+1],j=F.idx===0?"":F.idx,Y=X.buildAlternationPrefixAmbiguityError({topLevelRule:_,alternation:F,ambiguityIndices:G,prefixPath:de.path});return{message:Y,type:r.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:_.name,occurrence:j,alternatives:G}});Z=Z.concat(ee)}}),Z}i.checkPrefixAlternativesAmbiguities=P;function D(R,F,_){var X=[],Z=n.map(F,function(V){return V.name});return n.forEach(R,function(V){var $=V.name;if(n.contains(Z,$)){var ie=_.buildNamespaceConflictError(V);X.push({message:ie,type:r.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:$})}}),X}}),ao=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.validateGrammar=i.resolveGrammar=void 0;var e=Ne(),t=so(),n=hi(),r=jt();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}),xt=ve(i=>{var e=i&&i.__extends||(function(){var E=function(g,l){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var C in f)Object.prototype.hasOwnProperty.call(f,C)&&(d[C]=f[C])},E(g,l)};return function(g,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");E(g,l);function d(){this.constructor=g}g.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=Ne(),n="MismatchedTokenException",r="NoViableAltException",o="EarlyExitException",s="NotAllInputParsedException",c=[n,r,o,s];Object.freeze(c);function A(E){return t.contains(c,E.name)}i.isRecognitionException=A;var a=(function(E){e(g,E);function g(l,d){var f=this.constructor,C=E.call(this,l)||this;return C.token=d,C.resyncedTokens=[],Object.setPrototypeOf(C,f.prototype),Error.captureStackTrace&&Error.captureStackTrace(C,C.constructor),C}return g})(Error),h=(function(E){e(g,E);function g(l,d,f){var C=E.call(this,l,d)||this;return C.previousToken=f,C.name=n,C}return g})(a);i.MismatchedTokenException=h;var u=(function(E){e(g,E);function g(l,d,f){var C=E.call(this,l,d)||this;return C.previousToken=f,C.name=r,C}return g})(a);i.NoViableAltException=u;var m=(function(E){e(g,E);function g(l,d){var f=E.call(this,l,d)||this;return f.name=s,f}return g})(a);i.NotAllInputParsedException=m;var p=(function(E){e(g,E);function g(l,d,f){var C=E.call(this,l,d)||this;return C.previousToken=f,C.name=o,C}return g})(a);i.EarlyExitException=p}),di=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=pt(),t=Ne(),n=xt(),r=ui(),o=nt();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,m,p){for(var E=this,g=this.findReSyncTokenType(),l=this.exportLexerState(),d=[],f=!1,C=this.LA(1),I=this.LA(1),y=function(){var v=E.LA(0),L=E.errorMessageProvider.buildMismatchTokenMessage({expected:p,actual:C,previous:v,ruleName:E.getCurrRuleFullName()}),H=new n.MismatchedTokenException(L,C,E.LA(0));H.resyncedTokens=t.dropRight(d),E.SAVE_ERROR(H)};!f;)if(this.tokenMatcher(I,p)){y();return}else if(m.call(this)){y(),h.apply(this,u);return}else this.tokenMatcher(I,g)?f=!0:(I=this.SKIP_TOKEN(),this.addToResyncTokens(I,d));this.importLexerState(l)},a.prototype.shouldInRepetitionRecoveryBeTried=function(h,u,m){return!(m===!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 m=this.getCurrentGrammarPath(h,u),p=this.getNextPossibleTokenTypes(m);return p},a.prototype.tryInRuleRecovery=function(h,u){if(this.canRecoverWithSingleTokenInsertion(h,u)){var m=this.getTokenToInsert(h);return m}if(this.canRecoverWithSingleTokenDeletion(h)){var p=this.SKIP_TOKEN();return this.consumeToken(),p}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 m=this;if(!this.canTokenTypeBeInsertedInRecovery(h)||t.isEmpty(u))return!1;var p=this.LA(1),E=t.find(u,function(g){return m.tokenMatcher(p,g)})!==void 0;return E},a.prototype.canRecoverWithSingleTokenDeletion=function(h){var u=this.tokenMatcher(this.LA(2),h);return u},a.prototype.isInCurrentRuleReSyncSet=function(h){var u=this.getCurrFollowKey(),m=this.getFollowSetFromFollowKey(u);return t.contains(m,h)},a.prototype.findReSyncTokenType=function(){for(var h=this.flattenFollowSet(),u=this.LA(1),m=2;;){var p=u.tokenType;if(t.contains(h,p))return p;u=this.LA(m),m++}},a.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return i.EOF_FOLLOW_KEY;var h=this.getLastExplicitRuleShortName(),u=this.getLastExplicitRuleOccurrenceIndex(),m=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(h),idxInCallingRule:u,inRule:this.shortRuleNameToFullName(m)}},a.prototype.buildFullFollowKeyStack=function(){var h=this,u=this.RULE_STACK,m=this.RULE_OCCURRENCE_STACK;return t.map(u,function(p,E){return E===0?i.EOF_FOLLOW_KEY:{ruleName:h.shortRuleNameToFullName(p),idxInCallingRule:m[E],inRule:h.shortRuleNameToFullName(u[E-1])}})},a.prototype.flattenFollowSet=function(){var h=this,u=t.map(this.buildFullFollowKeyStack(),function(m){return h.getFollowSetFromFollowKey(m)});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=[],m=this.LA(1);this.tokenMatcher(m,h)===!1;)m=this.SKIP_TOKEN(),this.addToResyncTokens(m,u);return t.dropRight(u)},a.prototype.attemptInRepetitionRecovery=function(h,u,m,p,E,g,l){},a.prototype.getCurrentGrammarPath=function(h,u){var m=this.getHumanReadableRuleStack(),p=t.cloneArr(this.RULE_OCCURRENCE_STACK),E={ruleStack:m,occurrenceStack:p,lastTok:h,lastTokOccurrence:u};return E},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,m,p,E,g){var l=this.getKeyForAutomaticLookahead(m,p),d=this.firstAfterRepMap[l];if(d===void 0){var f=this.getCurrRuleFullName(),C=this.getGAstProductions()[f],I=new E(C,p);d=I.startWalking(),this.firstAfterRepMap[l]=d}var y=d.token,v=d.occurrence,L=d.isEndOfRule;this.RULE_STACK.length===1&&L&&y===void 0&&(y=e.EOF,v=1),this.shouldInRepetitionRecoveryBeTried(y,v,g)&&this.tryInRepetitionRecovery(a,h,u,y)}i.attemptInRepetitionRecovery=A}),wn=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}),Ao=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LooksAhead=void 0;var e=qt(),t=Ne(),n=nt(),r=wn(),o=Ut(),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),m=u.alternation,p=u.repetition,E=u.option,g=u.repetitionMandatory,l=u.repetitionMandatoryWithSeparator,d=u.repetitionWithSeparator;t.forEach(m,function(f){var C=f.idx===0?"":f.idx;a.TRACE_INIT(""+o.getProductionDslName(f)+C,function(){var I=e.buildLookaheadFuncForOr(f.idx,h,f.maxLookahead||a.maxLookahead,f.hasPredicates,a.dynamicTokensEnabled,a.lookAheadBuilderForAlternatives),y=r.getKeyForAutomaticLookahead(a.fullRuleNameToShort[h.name],r.OR_IDX,f.idx);a.setLaFuncCache(y,I)})}),t.forEach(p,function(f){a.computeLookaheadFunc(h,f.idx,r.MANY_IDX,e.PROD_TYPE.REPETITION,f.maxLookahead,o.getProductionDslName(f))}),t.forEach(E,function(f){a.computeLookaheadFunc(h,f.idx,r.OPTION_IDX,e.PROD_TYPE.OPTION,f.maxLookahead,o.getProductionDslName(f))}),t.forEach(g,function(f){a.computeLookaheadFunc(h,f.idx,r.AT_LEAST_ONE_IDX,e.PROD_TYPE.REPETITION_MANDATORY,f.maxLookahead,o.getProductionDslName(f))}),t.forEach(l,function(f){a.computeLookaheadFunc(h,f.idx,r.AT_LEAST_ONE_SEP_IDX,e.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,f.maxLookahead,o.getProductionDslName(f))}),t.forEach(d,function(f){a.computeLookaheadFunc(h,f.idx,r.MANY_SEP_IDX,e.PROD_TYPE.REPETITION_WITH_SEPARATOR,f.maxLookahead,o.getProductionDslName(f))})})})},c.prototype.computeLookaheadFunc=function(A,a,h,u,m,p){var E=this;this.TRACE_INIT(""+p+(a===0?"":a),function(){var g=e.buildLookaheadFuncForOptionalProd(a,A,m||E.maxLookahead,E.dynamicTokensEnabled,u,E.lookAheadBuilderForOptional),l=r.getKeyForAutomaticLookahead(E.fullRuleNameToShort[A.name],h,a);E.setLaFuncCache(l,g)})},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}),co=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}),fi=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.defineNameProp=i.functionName=i.classNameFromInstance=void 0;var e=Ne();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}),lo=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=Ne(),t=fi();function n(u,m){for(var p=e.keys(u),E=p.length,g=0;g<E;g++)for(var l=p[g],d=u[l],f=d.length,C=0;C<f;C++){var I=d[C];I.tokenTypeIdx===void 0&&this[I.name](I.children,m)}}i.defaultVisit=n;function r(u,m){var p=function(){};t.defineNameProp(p,u+"BaseSemantics");var E={visit:function(g,l){if(e.isArray(g)&&(g=g[0]),!e.isUndefined(g))return this[g.name](g.children,l)},validateVisitor:function(){var g=c(this,m);if(!e.isEmpty(g)){var l=e.map(g,function(d){return d.msg});throw Error("Errors Detected in CST Visitor <"+t.functionName(this.constructor)+`>:
84
- `+(""+l.join(`
83
+ see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`},buildInvalidRuleNameError:function(e){return`deprecated`},buildDuplicateRuleNameError:function(e){return`Duplicate definition, rule: ->`+(e.topLevelRule instanceof i.Rule?e.topLevelRule.name:e.topLevelRule)+`<- is already defined in the grammar: ->`+e.grammarName+`<-`}}}),Xe=G(e=>{"use strict";var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.GastRefResolverVisitor=e.resolveGrammar=void 0;var n=J(),r=K(),i=We();function a(e,t){var n=new o(e,t);return n.resolveRefs(),n.errors}e.resolveGrammar=a;var o=function(e){t(i,e);function i(t,n){var r=e.call(this)||this;return r.nameToTopRule=t,r.errMsgProvider=n,r.errors=[],r}return i.prototype.resolveRefs=function(){var e=this;r.forEach(r.values(this.nameToTopRule),function(t){e.currTopLevel=t,t.accept(e)})},i.prototype.visitNonTerminal=function(e){var t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{var r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:n.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}},i}(i.GAstVisitor);e.GastRefResolverVisitor=o}),Ze=G(e=>{"use strict";var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.nextPossibleTokensAfter=e.possiblePathsFrom=e.NextTerminalAfterAtLeastOneSepWalker=e.NextTerminalAfterAtLeastOneWalker=e.NextTerminalAfterManySepWalker=e.NextTerminalAfterManyWalker=e.AbstractNextTerminalAfterProductionWalker=e.NextAfterTokenWalker=e.AbstractNextPossibleTokensWalker=void 0;var n=Ue(),r=K(),i=Ke(),a=q(),o=function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.topProd=t,r.path=n,r.possibleTokTypes=[],r.nextProductionName=``,r.nextProductionOccurrence=0,r.found=!1,r.isAtEndOfPath=!1,r}return n.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=r.cloneArr(this.path.ruleStack).reverse(),this.occurrenceStack=r.cloneArr(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},n.prototype.walk=function(t,n){n===void 0&&(n=[]),this.found||e.prototype.walk.call(this,t,n)},n.prototype.walkProdRef=function(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){var r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}},n.prototype.updateExpectedNext=function(){r.isEmpty(this.ruleStack)?(this.nextProductionName=``,this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},n}(n.RestWalker);e.AbstractNextPossibleTokensWalker=o,e.NextAfterTokenWalker=function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.path=n,r.nextTerminalName=``,r.nextTerminalOccurrence=0,r.nextTerminalName=r.path.lastTok.name,r.nextTerminalOccurrence=r.path.lastTokOccurrence,r}return n.prototype.walkTerminal=function(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){var r=t.concat(n),o=new a.Alternative({definition:r});this.possibleTokTypes=i.first(o),this.found=!0}},n}(o);var s=function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.topRule=t,r.occurrence=n,r.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},r}return n.prototype.startWalking=function(){return this.walk(this.topRule),this.result},n}(n.RestWalker);e.AbstractNextTerminalAfterProductionWalker=s,e.NextTerminalAfterManyWalker=function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n.prototype.walkMany=function(t,n,i){if(t.idx===this.occurrence){var o=r.first(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof a.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkMany.call(this,t,n,i)},n}(s),e.NextTerminalAfterManySepWalker=function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n.prototype.walkManySep=function(t,n,i){if(t.idx===this.occurrence){var o=r.first(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof a.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkManySep.call(this,t,n,i)},n}(s),e.NextTerminalAfterAtLeastOneWalker=function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n.prototype.walkAtLeastOne=function(t,n,i){if(t.idx===this.occurrence){var o=r.first(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof a.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkAtLeastOne.call(this,t,n,i)},n}(s),e.NextTerminalAfterAtLeastOneSepWalker=function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n.prototype.walkAtLeastOneSep=function(t,n,i){if(t.idx===this.occurrence){var o=r.first(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof a.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkAtLeastOneSep.call(this,t,n,i)},n}(s);function c(e,t,n){n===void 0&&(n=[]),n=r.cloneArr(n);var i=[],o=0;function s(t){return t.concat(r.drop(e,o+1))}function l(e){var r=c(s(e),t,n);return i.concat(r)}for(;n.length<t&&o<e.length;){var u=e[o];if(u instanceof a.Alternative||u instanceof a.NonTerminal)return l(u.definition);if(u instanceof a.Option)i=l(u.definition);else if(u instanceof a.RepetitionMandatory){var d=u.definition.concat([new a.Repetition({definition:u.definition})]);return l(d)}else if(u instanceof a.RepetitionMandatoryWithSeparator){var d=[new a.Alternative({definition:u.definition}),new a.Repetition({definition:[new a.Terminal({terminalType:u.separator})].concat(u.definition)})];return l(d)}else if(u instanceof a.RepetitionWithSeparator){var d=u.definition.concat([new a.Repetition({definition:[new a.Terminal({terminalType:u.separator})].concat(u.definition)})]);i=l(d)}else if(u instanceof a.Repetition){var d=u.definition.concat([new a.Repetition({definition:u.definition})]);i=l(d)}else{if(u instanceof a.Alternation)return r.forEach(u.definition,function(e){r.isEmpty(e.definition)===!1&&(i=l(e.definition))}),i;if(u instanceof a.Terminal)n.push(u.terminalType);else throw Error(`non exhaustive match`)}o++}return i.push({partialPath:n,suffixDef:r.drop(e,o)}),i}e.possiblePathsFrom=c;function l(e,t,n,i){var o=`EXIT_NONE_TERMINAL`,s=[o],c=`EXIT_ALTERNATIVE`,l=!1,d=t.length,f=d-i-1,p=[],m=[];for(m.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!r.isEmpty(m);){var h=m.pop();if(h===c){l&&r.last(m).idx<=f&&m.pop();continue}var g=h.def,_=h.idx,v=h.ruleStack,y=h.occurrenceStack;if(!r.isEmpty(g)){var b=g[0];if(b===o){var x={idx:_,def:r.drop(g),ruleStack:r.dropRight(v),occurrenceStack:r.dropRight(y)};m.push(x)}else if(b instanceof a.Terminal)if(_<d-1){var S=_+1,C=t[S];if(n(C,b.terminalType)){var x={idx:S,def:r.drop(g),ruleStack:v,occurrenceStack:y};m.push(x)}}else if(_===d-1)p.push({nextTokenType:b.terminalType,nextTokenOccurrence:b.idx,ruleStack:v,occurrenceStack:y}),l=!0;else throw Error(`non exhaustive match`);else if(b instanceof a.NonTerminal){var w=r.cloneArr(v);w.push(b.nonTerminalName);var T=r.cloneArr(y);T.push(b.idx);var x={idx:_,def:b.definition.concat(s,r.drop(g)),ruleStack:w,occurrenceStack:T};m.push(x)}else if(b instanceof a.Option){var E={idx:_,def:r.drop(g),ruleStack:v,occurrenceStack:y};m.push(E),m.push(c);var D={idx:_,def:b.definition.concat(r.drop(g)),ruleStack:v,occurrenceStack:y};m.push(D)}else if(b instanceof a.RepetitionMandatory){var O=new a.Repetition({definition:b.definition,idx:b.idx}),k=b.definition.concat([O],r.drop(g)),x={idx:_,def:k,ruleStack:v,occurrenceStack:y};m.push(x)}else if(b instanceof a.RepetitionMandatoryWithSeparator){var A=new a.Terminal({terminalType:b.separator}),O=new a.Repetition({definition:[A].concat(b.definition),idx:b.idx}),k=b.definition.concat([O],r.drop(g)),x={idx:_,def:k,ruleStack:v,occurrenceStack:y};m.push(x)}else if(b instanceof a.RepetitionWithSeparator){var E={idx:_,def:r.drop(g),ruleStack:v,occurrenceStack:y};m.push(E),m.push(c);var A=new a.Terminal({terminalType:b.separator}),j=new a.Repetition({definition:[A].concat(b.definition),idx:b.idx}),k=b.definition.concat([j],r.drop(g)),D={idx:_,def:k,ruleStack:v,occurrenceStack:y};m.push(D)}else if(b instanceof a.Repetition){var E={idx:_,def:r.drop(g),ruleStack:v,occurrenceStack:y};m.push(E),m.push(c);var j=new a.Repetition({definition:b.definition,idx:b.idx}),k=b.definition.concat([j],r.drop(g)),D={idx:_,def:k,ruleStack:v,occurrenceStack:y};m.push(D)}else if(b instanceof a.Alternation)for(var M=b.definition.length-1;M>=0;M--){var N={idx:_,def:b.definition[M].definition.concat(r.drop(g)),ruleStack:v,occurrenceStack:y};m.push(N),m.push(c)}else if(b instanceof a.Alternative)m.push({idx:_,def:b.definition.concat(r.drop(g)),ruleStack:v,occurrenceStack:y});else if(b instanceof a.Rule)m.push(u(b,_,v,y));else throw Error(`non exhaustive match`)}}return p}e.nextPossibleTokensAfter=l;function u(e,t,n,i){var a=r.cloneArr(n);a.push(e.name);var o=r.cloneArr(i);return o.push(1),{idx:t,def:e.definition,ruleStack:a,occurrenceStack:o}}}),Qe=G(e=>{"use strict";var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.areTokenCategoriesNotUsed=e.isStrictPrefixOfPath=e.containsPath=e.getLookaheadPathsForOptionalProd=e.getLookaheadPathsForOr=e.lookAheadSequenceFromAlternatives=e.buildSingleAlternativeLookaheadFunction=e.buildAlternativesLookAheadFunc=e.buildLookaheadFuncForOptionalProd=e.buildLookaheadFuncForOr=e.getProdType=e.PROD_TYPE=void 0;var n=K(),r=Ze(),i=Ue(),a=ze(),o=q(),s=We(),c;(function(e){e[e.OPTION=0]=`OPTION`,e[e.REPETITION=1]=`REPETITION`,e[e.REPETITION_MANDATORY=2]=`REPETITION_MANDATORY`,e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]=`REPETITION_MANDATORY_WITH_SEPARATOR`,e[e.REPETITION_WITH_SEPARATOR=4]=`REPETITION_WITH_SEPARATOR`,e[e.ALTERNATION=5]=`ALTERNATION`})(c=e.PROD_TYPE||={});function l(e){if(e instanceof o.Option)return c.OPTION;if(e instanceof o.Repetition)return c.REPETITION;if(e instanceof o.RepetitionMandatory)return c.REPETITION_MANDATORY;if(e instanceof o.RepetitionMandatoryWithSeparator)return c.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof o.RepetitionWithSeparator)return c.REPETITION_WITH_SEPARATOR;if(e instanceof o.Alternation)return c.ALTERNATION;throw Error(`non exhaustive match`)}e.getProdType=l;function u(e,t,n,r,i,o){var s=b(e,t,n);return o(s,r,w(s)?a.tokenStructuredMatcherNoCategories:a.tokenStructuredMatcher,i)}e.buildLookaheadFuncForOr=u;function d(e,t,n,r,i,o){var s=x(e,t,i,n),c=w(s)?a.tokenStructuredMatcherNoCategories:a.tokenStructuredMatcher;return o(s[0],c,r)}e.buildLookaheadFuncForOptionalProd=d;function f(e,t,r,i){var a=e.length,o=n.every(e,function(e){return n.every(e,function(e){return e.length===1})});if(t)return function(t){for(var i=n.map(t,function(e){return e.GATE}),o=0;o<a;o++){var s=e[o],c=s.length,l=i[o];if(!(l!==void 0&&l.call(this)===!1))e:for(var u=0;u<c;u++){for(var d=s[u],f=d.length,p=0;p<f;p++)if(r(this.LA(p+1),d[p])===!1)continue e;return o}}};if(o&&!i){var s=n.map(e,function(e){return n.flatten(e)}),c=n.reduce(s,function(e,t,r){return n.forEach(t,function(t){n.has(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=r),n.forEach(t.categoryMatches,function(t){n.has(e,t)||(e[t]=r)})}),e},[]);return function(){return c[this.LA(1).tokenTypeIdx]}}else return function(){for(var t=0;t<a;t++){var n=e[t],i=n.length;e:for(var o=0;o<i;o++){for(var s=n[o],c=s.length,l=0;l<c;l++)if(r(this.LA(l+1),s[l])===!1)continue e;return t}}}}e.buildAlternativesLookAheadFunc=f;function p(e,t,r){var i=n.every(e,function(e){return e.length===1}),a=e.length;if(i&&!r){var o=n.flatten(e);if(o.length===1&&n.isEmpty(o[0].categoryMatches)){var s=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}else{var c=n.reduce(o,function(e,t,r){return e[t.tokenTypeIdx]=!0,n.forEach(t.categoryMatches,function(t){e[t]=!0}),e},[]);return function(){return c[this.LA(1).tokenTypeIdx]===!0}}}else return function(){e:for(var n=0;n<a;n++){for(var r=e[n],i=r.length,o=0;o<i;o++)if(t(this.LA(o+1),r[o])===!1)continue e;return!0}return!1}}e.buildSingleAlternativeLookaheadFunction=p;var m=function(e){t(n,e);function n(t,n,r){var i=e.call(this)||this;return i.topProd=t,i.targetOccurrence=n,i.targetProdType=r,i}return n.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},n.prototype.checkIsTarget=function(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t?(this.restDef=n.concat(r),!0):!1},n.prototype.walkOption=function(t,n,r){this.checkIsTarget(t,c.OPTION,n,r)||e.prototype.walkOption.call(this,t,n,r)},n.prototype.walkAtLeastOne=function(t,n,r){this.checkIsTarget(t,c.REPETITION_MANDATORY,n,r)||e.prototype.walkOption.call(this,t,n,r)},n.prototype.walkAtLeastOneSep=function(t,n,r){this.checkIsTarget(t,c.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||e.prototype.walkOption.call(this,t,n,r)},n.prototype.walkMany=function(t,n,r){this.checkIsTarget(t,c.REPETITION,n,r)||e.prototype.walkOption.call(this,t,n,r)},n.prototype.walkManySep=function(t,n,r){this.checkIsTarget(t,c.REPETITION_WITH_SEPARATOR,n,r)||e.prototype.walkOption.call(this,t,n,r)},n}(i.RestWalker),h=function(e){t(n,e);function n(t,n,r){var i=e.call(this)||this;return i.targetOccurrence=t,i.targetProdType=n,i.targetRef=r,i.result=[],i}return n.prototype.checkIsTarget=function(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)},n.prototype.visitOption=function(e){this.checkIsTarget(e,c.OPTION)},n.prototype.visitRepetition=function(e){this.checkIsTarget(e,c.REPETITION)},n.prototype.visitRepetitionMandatory=function(e){this.checkIsTarget(e,c.REPETITION_MANDATORY)},n.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.checkIsTarget(e,c.REPETITION_MANDATORY_WITH_SEPARATOR)},n.prototype.visitRepetitionWithSeparator=function(e){this.checkIsTarget(e,c.REPETITION_WITH_SEPARATOR)},n.prototype.visitAlternation=function(e){this.checkIsTarget(e,c.ALTERNATION)},n}(s.GAstVisitor);function g(e){for(var t=Array(e),n=0;n<e;n++)t[n]=[];return t}function _(e){for(var t=[``],n=0;n<e.length;n++){for(var r=e[n],i=[],a=0;a<t.length;a++){var o=t[a];i.push(o+`_`+r.tokenTypeIdx);for(var s=0;s<r.categoryMatches.length;s++){var c=`_`+r.categoryMatches[s];i.push(o+c)}}t=i}return t}function v(e,t,n){for(var r=0;r<e.length;r++)if(r!==n){for(var i=e[r],a=0;a<t.length;a++)if(i[t[a]]===!0)return!1}return!0}function y(e,t){for(var i=n.map(e,function(e){return r.possiblePathsFrom([e],1)}),a=g(i.length),o=n.map(i,function(e){var t={};return n.forEach(e,function(e){var r=_(e.partialPath);n.forEach(r,function(e){t[e]=!0})}),t}),s=i,c=1;c<=t;c++){var l=s;s=g(l.length);for(var u=function(e){for(var i=l[e],u=0;u<i.length;u++){var d=i[u].partialPath,f=i[u].suffixDef,p=_(d);if(v(o,p,e)||n.isEmpty(f)||d.length===t){var m=a[e];if(S(m,d)===!1){m.push(d);for(var h=0;h<p.length;h++){var g=p[h];o[e][g]=!0}}}else{var y=r.possiblePathsFrom(f,c+1,d);s[e]=s[e].concat(y),n.forEach(y,function(t){var r=_(t.partialPath);n.forEach(r,function(t){o[e][t]=!0})})}}},d=0;d<l.length;d++)u(d)}return a}e.lookAheadSequenceFromAlternatives=y;function b(e,t,n,r){var i=new h(e,c.ALTERNATION,r);return t.accept(i),y(i.result,n)}e.getLookaheadPathsForOr=b;function x(e,t,n,r){var i=new h(e,n);t.accept(i);var a=i.result,s=new m(t,e,n).startWalking();return y([new o.Alternative({definition:a}),new o.Alternative({definition:s})],r)}e.getLookaheadPathsForOptionalProd=x;function S(e,t){e:for(var n=0;n<e.length;n++){var r=e[n];if(r.length===t.length){for(var i=0;i<r.length;i++){var a=t[i],o=r[i];if(!(a===o||o.categoryMatchesMap[a.tokenTypeIdx]!==void 0))continue e}return!0}}return!1}e.containsPath=S;function C(e,t){return e.length<t.length&&n.every(e,function(e,n){var r=t[n];return e===r||r.categoryMatchesMap[e.tokenTypeIdx]})}e.isStrictPrefixOfPath=C;function w(e){return n.every(e,function(e){return n.every(e,function(e){return n.every(e,function(e){return n.isEmpty(e.categoryMatches)})})})}e.areTokenCategoriesNotUsed=w}),$e=G(e=>{"use strict";var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.checkPrefixAlternativesAmbiguities=e.validateSomeNonEmptyLookaheadPath=e.validateTooManyAlts=e.RepetionCollector=e.validateAmbiguousAlternationAlternatives=e.validateEmptyOrAlternative=e.getFirstNoneTerminal=e.validateNoLeftRecursion=e.validateRuleIsOverridden=e.validateRuleDoesNotAlreadyExist=e.OccurrenceValidationCollector=e.identifyProductionForDuplicates=e.validateGrammar=void 0;var n=K(),r=K(),i=J(),a=Ge(),o=Qe(),s=Ze(),c=q(),l=We();function u(e,t,i,a,o){var s=n.map(e,function(e){return d(e,a)}),c=n.map(e,function(e){return _(e,e,a)}),l=[],u=[],f=[];r.every(c,r.isEmpty)&&(l=r.map(e,function(e){return b(e,a)}),u=r.map(e,function(e){return x(e,t,a)}),f=w(e,t,a));var p=D(e,i,a),m=r.map(e,function(e){return C(e,a)}),g=r.map(e,function(t){return h(t,e,o,a)});return n.flatten(s.concat(f,c,l,u,p,m,g))}e.validateGrammar=u;function d(e,t){var r=new m;e.accept(r);var o=r.allProductions,s=n.groupBy(o,f),c=n.pick(s,function(e){return e.length>1});return n.map(n.values(c),function(r){var o=n.first(r),s=t.buildDuplicateFoundError(e,r),c=a.getProductionDslName(o),l={message:s,type:i.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:c,occurrence:o.idx},u=p(o);return u&&(l.parameter=u),l})}function f(e){return a.getProductionDslName(e)+`_#_`+e.idx+`_#_`+p(e)}e.identifyProductionForDuplicates=f;function p(e){return e instanceof c.Terminal?e.terminalType.name:e instanceof c.NonTerminal?e.nonTerminalName:``}var m=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.allProductions=[],t}return n.prototype.visitNonTerminal=function(e){this.allProductions.push(e)},n.prototype.visitOption=function(e){this.allProductions.push(e)},n.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},n.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},n.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},n.prototype.visitRepetition=function(e){this.allProductions.push(e)},n.prototype.visitAlternation=function(e){this.allProductions.push(e)},n.prototype.visitTerminal=function(e){this.allProductions.push(e)},n}(l.GAstVisitor);e.OccurrenceValidationCollector=m;function h(e,t,n,a){var o=[];if(r.reduce(t,function(t,n){return n.name===e.name?t+1:t},0)>1){var s=a.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});o.push({message:s,type:i.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e.name})}return o}e.validateRuleDoesNotAlreadyExist=h;function g(e,t,r){var a=[],o;return n.contains(t,e)||(o=`Invalid rule override, rule: ->`+e+`<- cannot be overridden in the grammar: ->`+r+`<-as it is not defined in any of the super grammars `,a.push({message:o,type:i.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:e})),a}e.validateRuleIsOverridden=g;function _(e,t,r,a){a===void 0&&(a=[]);var o=[],s=v(t.definition);if(n.isEmpty(s))return[];var c=e.name;n.contains(s,e)&&o.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:a}),type:i.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:c});var l=n.difference(s,a.concat([e])),u=n.map(l,function(t){var i=n.cloneArr(a);return i.push(t),_(e,t,r,i)});return o.concat(n.flatten(u))}e.validateNoLeftRecursion=_;function v(e){var t=[];if(n.isEmpty(e))return t;var r=n.first(e);if(r instanceof c.NonTerminal)t.push(r.referencedRule);else if(r instanceof c.Alternative||r instanceof c.Option||r instanceof c.RepetitionMandatory||r instanceof c.RepetitionMandatoryWithSeparator||r instanceof c.RepetitionWithSeparator||r instanceof c.Repetition)t=t.concat(v(r.definition));else if(r instanceof c.Alternation)t=n.flatten(n.map(r.definition,function(e){return v(e.definition)}));else if(!(r instanceof c.Terminal))throw Error(`non exhaustive match`);var i=a.isOptionalProd(r),o=e.length>1;if(i&&o){var s=n.drop(e);return t.concat(v(s))}else return t}e.getFirstNoneTerminal=v;var y=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.alternations=[],t}return n.prototype.visitAlternation=function(e){this.alternations.push(e)},n}(l.GAstVisitor);function b(e,t){var r=new y;e.accept(r);var a=r.alternations;return n.reduce(a,function(r,a){var o=n.dropRight(a.definition),c=n.map(o,function(r,o){var c=s.nextPossibleTokensAfter([r],[],null,1);return n.isEmpty(c)?{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:a,emptyChoiceIdx:o}),type:i.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:a.idx,alternative:o+1}:null});return r.concat(n.compact(c))},[])}e.validateEmptyOrAlternative=b;function x(e,t,i){var a=new y;e.accept(a);var s=a.alternations;return s=r.reject(s,function(e){return e.ignoreAmbiguities===!0}),n.reduce(s,function(n,r){var a=r.idx,s=r.maxLookahead||t,c=o.getLookaheadPathsForOr(a,e,s,r),l=T(c,r,e,i),u=E(c,r,e,i);return n.concat(l,u)},[])}e.validateAmbiguousAlternationAlternatives=x;var S=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.allProductions=[],t}return n.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},n.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},n.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},n.prototype.visitRepetition=function(e){this.allProductions.push(e)},n}(l.GAstVisitor);e.RepetionCollector=S;function C(e,t){var r=new y;e.accept(r);var a=r.alternations;return n.reduce(a,function(n,r){return r.definition.length>255&&n.push({message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:r}),type:i.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:e.name,occurrence:r.idx}),n},[])}e.validateTooManyAlts=C;function w(e,t,n){var a=[];return r.forEach(e,function(e){var s=new S;e.accept(s);var c=s.allProductions;r.forEach(c,function(s){var c=o.getProdType(s),l=s.maxLookahead||t,u=s.idx,d=o.getLookaheadPathsForOptionalProd(u,e,c,l)[0];if(r.isEmpty(r.flatten(d))){var f=n.buildEmptyRepetitionError({topLevelRule:e,repetition:s});a.push({message:f,type:i.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),a}e.validateSomeNonEmptyLookaheadPath=w;function T(e,t,a,s){var c=[],l=r.reduce(e,function(n,i,a){return t.definition[a].ignoreAmbiguities===!0||r.forEach(i,function(i){var s=[a];r.forEach(e,function(e,n){a!==n&&o.containsPath(e,i)&&t.definition[n].ignoreAmbiguities!==!0&&s.push(n)}),s.length>1&&!o.containsPath(c,i)&&(c.push(i),n.push({alts:s,path:i}))}),n},[]);return n.map(l,function(e){var n=r.map(e.alts,function(e){return e+1});return{message:s.buildAlternationAmbiguityError({topLevelRule:a,alternation:t,ambiguityIndices:n,prefixPath:e.path}),type:i.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:a.name,occurrence:t.idx,alternatives:[e.alts]}})}function E(e,t,n,a){var s=[],c=r.reduce(e,function(e,t,n){var i=r.map(t,function(e){return{idx:n,path:e}});return e.concat(i)},[]);return r.forEach(c,function(e){if(t.definition[e.idx].ignoreAmbiguities!==!0){var l=e.idx,u=e.path,d=r.findAll(c,function(e){return t.definition[e.idx].ignoreAmbiguities!==!0&&e.idx<l&&o.isStrictPrefixOfPath(e.path,u)}),f=r.map(d,function(e){var r=[e.idx+1,l+1],o=t.idx===0?``:t.idx;return{message:a.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:r,prefixPath:e.path}),type:i.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:r}});s=s.concat(f)}}),s}e.checkPrefixAlternativesAmbiguities=E;function D(e,t,n){var a=[],o=r.map(t,function(e){return e.name});return r.forEach(e,function(e){var t=e.name;if(r.contains(o,t)){var s=n.buildNamespaceConflictError(e);a.push({message:s,type:i.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),a}}),et=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateGrammar=e.resolveGrammar=void 0;var t=K(),n=Xe(),r=$e(),i=Ye();function a(e){e=t.defaults(e,{errMsgProvider:i.defaultGrammarResolverErrorProvider});var r={};return t.forEach(e.rules,function(e){r[e.name]=e}),n.resolveGrammar(r,e.errMsgProvider)}e.resolveGrammar=a;function o(e){return e=t.defaults(e,{errMsgProvider:i.defaultGrammarValidatorErrorProvider}),r.validateGrammar(e.rules,e.maxLookahead,e.tokenTypes,e.errMsgProvider,e.grammarName)}e.validateGrammar=o}),tt=G(e=>{"use strict";var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.EarlyExitException=e.NotAllInputParsedException=e.NoViableAltException=e.MismatchedTokenException=e.isRecognitionException=void 0;var n=K(),r=`MismatchedTokenException`,i=`NoViableAltException`,a=`EarlyExitException`,o=`NotAllInputParsedException`,s=[r,i,a,o];Object.freeze(s);function c(e){return n.contains(s,e.name)}e.isRecognitionException=c;var l=function(e){t(n,e);function n(t,n){var r=this.constructor,i=e.call(this,t)||this;return i.token=n,i.resyncedTokens=[],Object.setPrototypeOf(i,r.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,i.constructor),i}return n}(Error);e.MismatchedTokenException=function(e){t(n,e);function n(t,n,i){var a=e.call(this,t,n)||this;return a.previousToken=i,a.name=r,a}return n}(l),e.NoViableAltException=function(e){t(n,e);function n(t,n,r){var a=e.call(this,t,n)||this;return a.previousToken=r,a.name=i,a}return n}(l),e.NotAllInputParsedException=function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.name=o,r}return n}(l),e.EarlyExitException=function(e){t(n,e);function n(t,n,r){var i=e.call(this,t,n)||this;return i.previousToken=r,i.name=a,i}return n}(l)}),nt=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.attemptInRepetitionRecovery=e.Recoverable=e.InRuleRecoveryException=e.IN_RULE_RECOVERY_EXCEPTION=e.EOF_FOLLOW_KEY=void 0;var t=He(),n=K(),r=tt(),i=qe(),a=J();e.EOF_FOLLOW_KEY={},e.IN_RULE_RECOVERY_EXCEPTION=`InRuleRecoveryException`;function o(t){this.name=e.IN_RULE_RECOVERY_EXCEPTION,this.message=t}e.InRuleRecoveryException=o,o.prototype=Error.prototype,e.Recoverable=function(){function c(){}return c.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=n.has(e,`recoveryEnabled`)?e.recoveryEnabled:a.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=s)},c.prototype.getTokenToInsert=function(e){var n=t.createTokenInstance(e,``,NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n},c.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},c.prototype.tryInRepetitionRecovery=function(e,t,i,a){for(var o=this,s=this.findReSyncTokenType(),c=this.exportLexerState(),l=[],u=!1,d=this.LA(1),f=this.LA(1),p=function(){var e=o.LA(0),t=o.errorMessageProvider.buildMismatchTokenMessage({expected:a,actual:d,previous:e,ruleName:o.getCurrRuleFullName()}),i=new r.MismatchedTokenException(t,d,o.LA(0));i.resyncedTokens=n.dropRight(l),o.SAVE_ERROR(i)};!u;)if(this.tokenMatcher(f,a)){p();return}else if(i.call(this)){p(),e.apply(this,t);return}else this.tokenMatcher(f,s)?u=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,l));this.importLexerState(c)},c.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,n){return!(n===!1||e===void 0||t===void 0||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))},c.prototype.getFollowsForInRuleRecovery=function(e,t){var n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)},c.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new o(`sad sad panda`)},c.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},c.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var r=this;if(!this.canTokenTypeBeInsertedInRecovery(e)||n.isEmpty(t))return!1;var i=this.LA(1);return n.find(t,function(e){return r.tokenMatcher(i,e)})!==void 0},c.prototype.canRecoverWithSingleTokenDeletion=function(e){return this.tokenMatcher(this.LA(2),e)},c.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return n.contains(r,e)},c.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),r=2;;){var i=t.tokenType;if(n.contains(e,i))return i;t=this.LA(r),r++}},c.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return e.EOF_FOLLOW_KEY;var t=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}},c.prototype.buildFullFollowKeyStack=function(){var t=this,r=this.RULE_STACK,i=this.RULE_OCCURRENCE_STACK;return n.map(r,function(n,a){return a===0?e.EOF_FOLLOW_KEY:{ruleName:t.shortRuleNameToFullName(n),idxInCallingRule:i[a],inRule:t.shortRuleNameToFullName(r[a-1])}})},c.prototype.flattenFollowSet=function(){var e=this,t=n.map(this.buildFullFollowKeyStack(),function(t){return e.getFollowSetFromFollowKey(t)});return n.flatten(t)},c.prototype.getFollowSetFromFollowKey=function(n){if(n===e.EOF_FOLLOW_KEY)return[t.EOF];var r=n.ruleName+n.idxInCallingRule+i.IN+n.inRule;return this.resyncFollows[r]},c.prototype.addToResyncTokens=function(e,n){return this.tokenMatcher(e,t.EOF)||n.push(e),n},c.prototype.reSyncTo=function(e){for(var t=[],r=this.LA(1);this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return n.dropRight(t)},c.prototype.attemptInRepetitionRecovery=function(e,t,n,r,i,a,o){},c.prototype.getCurrentGrammarPath=function(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:n.cloneArr(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}},c.prototype.getHumanReadableRuleStack=function(){var e=this;return n.map(this.RULE_STACK,function(t){return e.shortRuleNameToFullName(t)})},c}();function s(e,n,r,i,a,o,s){var c=this.getKeyForAutomaticLookahead(i,a),l=this.firstAfterRepMap[c];if(l===void 0){var u=this.getCurrRuleFullName(),d=this.getGAstProductions()[u];l=new o(d,a).startWalking(),this.firstAfterRepMap[c]=l}var f=l.token,p=l.occurrence,m=l.isEndOfRule;this.RULE_STACK.length===1&&m&&f===void 0&&(f=t.EOF,p=1),this.shouldInRepetitionRecoveryBeTried(f,p,s)&&this.tryInRepetitionRecovery(e,n,r,f)}e.attemptInRepetitionRecovery=s}),rt=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getKeyForAutomaticLookahead=e.AT_LEAST_ONE_SEP_IDX=e.MANY_SEP_IDX=e.AT_LEAST_ONE_IDX=e.MANY_IDX=e.OPTION_IDX=e.OR_IDX=e.BITS_FOR_ALT_IDX=e.BITS_FOR_RULE_IDX=e.BITS_FOR_OCCURRENCE_IDX=e.BITS_FOR_METHOD_TYPE=void 0,e.BITS_FOR_METHOD_TYPE=4,e.BITS_FOR_OCCURRENCE_IDX=8,e.BITS_FOR_RULE_IDX=12,e.BITS_FOR_ALT_IDX=8,e.OR_IDX=1<<e.BITS_FOR_OCCURRENCE_IDX,e.OPTION_IDX=2<<e.BITS_FOR_OCCURRENCE_IDX,e.MANY_IDX=3<<e.BITS_FOR_OCCURRENCE_IDX,e.AT_LEAST_ONE_IDX=4<<e.BITS_FOR_OCCURRENCE_IDX,e.MANY_SEP_IDX=5<<e.BITS_FOR_OCCURRENCE_IDX,e.AT_LEAST_ONE_SEP_IDX=6<<e.BITS_FOR_OCCURRENCE_IDX;function t(e,t,n){return n|t|e}e.getKeyForAutomaticLookahead=t,32-e.BITS_FOR_ALT_IDX}),it=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LooksAhead=void 0;var t=Qe(),n=K(),r=J(),i=rt(),a=Ge();e.LooksAhead=function(){function e(){}return e.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=n.has(e,`dynamicTokensEnabled`)?e.dynamicTokensEnabled:r.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=n.has(e,`maxLookahead`)?e.maxLookahead:r.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=n.isES2015MapSupported()?new Map:[],n.isES2015MapSupported()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},e.prototype.preComputeLookaheadFunctions=function(e){var r=this;n.forEach(e,function(e){r.TRACE_INIT(e.name+` Rule Lookahead`,function(){var o=a.collectMethods(e),s=o.alternation,c=o.repetition,l=o.option,u=o.repetitionMandatory,d=o.repetitionMandatoryWithSeparator,f=o.repetitionWithSeparator;n.forEach(s,function(n){var o=n.idx===0?``:n.idx;r.TRACE_INIT(``+a.getProductionDslName(n)+o,function(){var a=t.buildLookaheadFuncForOr(n.idx,e,n.maxLookahead||r.maxLookahead,n.hasPredicates,r.dynamicTokensEnabled,r.lookAheadBuilderForAlternatives),o=i.getKeyForAutomaticLookahead(r.fullRuleNameToShort[e.name],i.OR_IDX,n.idx);r.setLaFuncCache(o,a)})}),n.forEach(c,function(n){r.computeLookaheadFunc(e,n.idx,i.MANY_IDX,t.PROD_TYPE.REPETITION,n.maxLookahead,a.getProductionDslName(n))}),n.forEach(l,function(n){r.computeLookaheadFunc(e,n.idx,i.OPTION_IDX,t.PROD_TYPE.OPTION,n.maxLookahead,a.getProductionDslName(n))}),n.forEach(u,function(n){r.computeLookaheadFunc(e,n.idx,i.AT_LEAST_ONE_IDX,t.PROD_TYPE.REPETITION_MANDATORY,n.maxLookahead,a.getProductionDslName(n))}),n.forEach(d,function(n){r.computeLookaheadFunc(e,n.idx,i.AT_LEAST_ONE_SEP_IDX,t.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,n.maxLookahead,a.getProductionDslName(n))}),n.forEach(f,function(n){r.computeLookaheadFunc(e,n.idx,i.MANY_SEP_IDX,t.PROD_TYPE.REPETITION_WITH_SEPARATOR,n.maxLookahead,a.getProductionDslName(n))})})})},e.prototype.computeLookaheadFunc=function(e,n,r,a,o,s){var c=this;this.TRACE_INIT(``+s+(n===0?``:n),function(){var s=t.buildLookaheadFuncForOptionalProd(n,e,o||c.maxLookahead,c.dynamicTokensEnabled,a,c.lookAheadBuilderForOptional),l=i.getKeyForAutomaticLookahead(c.fullRuleNameToShort[e.name],r,n);c.setLaFuncCache(l,s)})},e.prototype.lookAheadBuilderForOptional=function(e,n,r){return t.buildSingleAlternativeLookaheadFunction(e,n,r)},e.prototype.lookAheadBuilderForAlternatives=function(e,n,r,i){return t.buildAlternativesLookAheadFunc(e,n,r,i)},e.prototype.getKeyForAutomaticLookahead=function(e,t){var n=this.getLastExplicitRuleShortName();return i.getKeyForAutomaticLookahead(n,e,t)},e.prototype.getLaFuncFromCache=function(e){},e.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},e.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},e.prototype.setLaFuncCache=function(e,t){},e.prototype.setLaFuncCacheUsingMap=function(e,t){this.lookAheadFuncsCache.set(e,t)},e.prototype.setLaFuncUsingObj=function(e,t){this.lookAheadFuncsCache[e]=t},e}()}),at=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.addNoneTerminalToCst=e.addTerminalToCst=e.setNodeLocationFull=e.setNodeLocationOnlyOffset=void 0;function t(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}e.setNodeLocationOnlyOffset=t;function n(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}e.setNodeLocationFull=n;function r(e,t,n){e.children[n]===void 0?e.children[n]=[t]:e.children[n].push(t)}e.addTerminalToCst=r;function i(e,t,n){e.children[t]===void 0?e.children[t]=[n]:e.children[t].push(n)}e.addNoneTerminalToCst=i}),ot=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineNameProp=e.functionName=e.classNameFromInstance=void 0;var t=K();function n(e){return i(e.constructor)}e.classNameFromInstance=n;var r=`name`;function i(e){return e.name||`anonymous`}e.functionName=i;function a(e,n){var i=Object.getOwnPropertyDescriptor(e,r);return t.isUndefined(i)||i.configurable?(Object.defineProperty(e,r,{enumerable:!1,configurable:!0,writable:!1,value:n}),!0):!1}e.defineNameProp=a}),st=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateRedundantMethods=e.validateMissingCstMethods=e.validateVisitor=e.CstVisitorDefinitionError=e.createBaseVisitorConstructorWithDefaults=e.createBaseSemanticVisitorConstructor=e.defaultVisit=void 0;var t=K(),n=ot();function r(e,n){for(var r=t.keys(e),i=r.length,a=0;a<i;a++)for(var o=r[a],s=e[o],c=s.length,l=0;l<c;l++){var u=s[l];u.tokenTypeIdx===void 0&&this[u.name](u.children,n)}}e.defaultVisit=r;function i(e,r){var i=function(){};return n.defineNameProp(i,e+`BaseSemantics`),i.prototype={visit:function(e,n){if(t.isArray(e)&&(e=e[0]),!t.isUndefined(e))return this[e.name](e.children,n)},validateVisitor:function(){var e=s(this,r);if(!t.isEmpty(e)){var i=t.map(e,function(e){return e.msg});throw Error(`Errors Detected in CST Visitor <`+n.functionName(this.constructor)+`>:
84
+ `+(``+i.join(`
85
85
 
86
86
  `).replace(/\n/g,`
87
- `)))}}};return p.prototype=E,p.prototype.constructor=p,p._RULE_NAMES=m,p}i.createBaseSemanticVisitorConstructor=r;function o(u,m,p){var E=function(){};t.defineNameProp(E,u+"BaseSemanticsWithDefaults");var g=Object.create(p.prototype);return e.forEach(m,function(l){g[l]=n}),E.prototype=g,E.prototype.constructor=E,E}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,m){var p=A(u,m),E=h(u,m);return p.concat(E)}i.validateVisitor=c;function A(u,m){var p=e.map(m,function(E){if(!e.isFunction(u[E]))return{msg:"Missing visitor method: <"+E+"> on "+t.functionName(u.constructor)+" CST Visitor.",type:s.MISSING_METHOD,methodName:E}});return e.compact(p)}i.validateMissingCstMethods=A;var a=["constructor","visit","validateVisitor"];function h(u,m){var p=[];for(var E in u)e.isFunction(u[E])&&!e.contains(a,E)&&!e.contains(m,E)&&p.push({msg:"Redundant visitor method: <"+E+"> on "+t.functionName(u.constructor)+` CST Visitor
87
+ `)))}}},i.prototype.constructor=i,i._RULE_NAMES=r,i}e.createBaseSemanticVisitorConstructor=i;function a(e,i,a){var o=function(){};n.defineNameProp(o,e+`BaseSemanticsWithDefaults`);var s=Object.create(a.prototype);return t.forEach(i,function(e){s[e]=r}),o.prototype=s,o.prototype.constructor=o,o}e.createBaseVisitorConstructorWithDefaults=a;var o;(function(e){e[e.REDUNDANT_METHOD=0]=`REDUNDANT_METHOD`,e[e.MISSING_METHOD=1]=`MISSING_METHOD`})(o=e.CstVisitorDefinitionError||={});function s(e,t){var n=c(e,t),r=u(e,t);return n.concat(r)}e.validateVisitor=s;function c(e,r){var i=t.map(r,function(r){if(!t.isFunction(e[r]))return{msg:`Missing visitor method: <`+r+`> on `+n.functionName(e.constructor)+` CST Visitor.`,type:o.MISSING_METHOD,methodName:r}});return t.compact(i)}e.validateMissingCstMethods=c;var l=[`constructor`,`visit`,`validateVisitor`];function u(e,r){var i=[];for(var a in e)t.isFunction(e[a])&&!t.contains(l,a)&&!t.contains(r,a)&&i.push({msg:`Redundant visitor method: <`+a+`> on `+n.functionName(e.constructor)+` CST Visitor
88
88
  There is no Grammar Rule corresponding to this method's name.
89
- `,type:s.REDUNDANT_METHOD,methodName:E});return p}i.validateRedundantMethods=h}),uo=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TreeBuilder=void 0;var e=co(),t=Ne(),n=lo(),r=nt(),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}),ho=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LexerAdapter=void 0;var e=nt(),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}),fo=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RecognizerApi=void 0;var e=Ne(),t=xt(),n=nt(),r=jt(),o=hi(),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 m=r.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:a,grammarName:this.className}),p={message:m,type:n.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:a};this.definitionErrors.push(p)}this.definedRulesNames.push(a);var E=this.defineRule(a,h,u);return this[a]=E,E},A.prototype.OVERRIDE_RULE=function(a,h,u){u===void 0&&(u=n.DEFAULT_RULE_CONFIG);var m=[];m=m.concat(o.validateRuleIsOverridden(a,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(m);var p=this.defineRule(a,h,u);return this[a]=p,p},A.prototype.BACKTRACK=function(a,h){return function(){this.isBackTrackingStack.push(1);var u=this.saveRecogState();try{return a.apply(this,h),!0}catch(m){if(t.isRecognitionException(m))return!1;throw m}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}),po=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RecognizerEngine=void 0;var e=Ne(),t=wn(),n=xt(),r=qt(),o=Ht(),s=nt(),c=di(),A=pt(),a=kt(),h=fi(),u=(function(){function m(){}return m.prototype.initRecognizerEngine=function(p,E){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(E,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
89
+ `,type:o.REDUNDANT_METHOD,methodName:a});return i}e.validateRedundantMethods=u}),ct=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TreeBuilder=void 0;var t=at(),n=K(),r=st(),i=J();e.TreeBuilder=function(){function e(){}return e.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=n.has(e,`nodeLocationTracking`)?e.nodeLocationTracking:i.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=n.NOOP,this.cstFinallyStateUpdate=n.NOOP,this.cstPostTerminal=n.NOOP,this.cstPostNonTerminal=n.NOOP,this.cstPostRule=n.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=t.setNodeLocationFull,this.setNodeLocationFromNode=t.setNodeLocationFull,this.cstPostRule=n.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=n.NOOP,this.setNodeLocationFromNode=n.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=t.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=t.setNodeLocationOnlyOffset,this.cstPostRule=n.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=n.NOOP,this.setNodeLocationFromNode=n.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=n.NOOP,this.setNodeLocationFromNode=n.NOOP,this.cstPostRule=n.NOOP,this.setInitialNodeLocation=n.NOOP;else throw Error(`Invalid <nodeLocationTracking> config option: "`+e.nodeLocationTracking+`"`)},e.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},e.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},e.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.cstInvocationStateUpdate=function(e,t){var n={name:e,children:{}};this.setInitialNodeLocation(n),this.CST_STACK.push(n)},e.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},e.prototype.cstPostRuleFull=function(e){var t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)},e.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?n.endOffset=t.endOffset:n.startOffset=NaN},e.prototype.cstPostTerminal=function(e,n){var r=this.CST_STACK[this.CST_STACK.length-1];t.addTerminalToCst(r,n,e),this.setNodeLocationFromToken(r.location,n)},e.prototype.cstPostNonTerminal=function(e,n){var r=this.CST_STACK[this.CST_STACK.length-1];t.addNoneTerminalToCst(r,n,e),this.setNodeLocationFromNode(r.location,e.location)},e.prototype.getBaseCstVisitorConstructor=function(){if(n.isUndefined(this.baseCstVisitorConstructor)){var e=r.createBaseSemanticVisitorConstructor(this.className,n.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},e.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(n.isUndefined(this.baseCstVisitorWithDefaultsConstructor)){var e=r.createBaseVisitorConstructorWithDefaults(this.className,n.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},e.prototype.getLastExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-1]},e.prototype.getPreviousExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-2]},e.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},e}()}),lt=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LexerAdapter=void 0;var t=J();e.LexerAdapter=function(){function e(){}return e.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(e.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(this.selfAnalysisDone!==!0)throw Error(`Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.`);this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!1,configurable:!0}),e.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):t.END_OF_FILE},e.prototype.LA=function(e){var n=this.currIdx+e;return n<0||this.tokVectorLength<=n?t.END_OF_FILE:this.tokVector[n]},e.prototype.consumeToken=function(){this.currIdx++},e.prototype.exportLexerState=function(){return this.currIdx},e.prototype.importLexerState=function(e){this.currIdx=e},e.prototype.resetLexerState=function(){this.currIdx=-1},e.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},e.prototype.getLexerPosition=function(){return this.exportLexerState()},e}()}),ut=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RecognizerApi=void 0;var t=K(),n=tt(),r=J(),i=Ye(),a=$e(),o=q();e.RecognizerApi=function(){function e(){}return e.prototype.ACTION=function(e){return e.call(this)},e.prototype.consume=function(e,t,n){return this.consumeInternal(t,e,n)},e.prototype.subrule=function(e,t,n){return this.subruleInternal(t,e,n)},e.prototype.option=function(e,t){return this.optionInternal(t,e)},e.prototype.or=function(e,t){return this.orInternal(t,e)},e.prototype.many=function(e,t){return this.manyInternal(e,t)},e.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},e.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},e.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},e.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},e.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},e.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},e.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},e.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},e.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},e.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},e.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},e.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},e.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},e.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},e.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},e.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},e.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},e.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},e.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},e.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},e.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},e.prototype.OPTION=function(e){return this.optionInternal(e,0)},e.prototype.OPTION1=function(e){return this.optionInternal(e,1)},e.prototype.OPTION2=function(e){return this.optionInternal(e,2)},e.prototype.OPTION3=function(e){return this.optionInternal(e,3)},e.prototype.OPTION4=function(e){return this.optionInternal(e,4)},e.prototype.OPTION5=function(e){return this.optionInternal(e,5)},e.prototype.OPTION6=function(e){return this.optionInternal(e,6)},e.prototype.OPTION7=function(e){return this.optionInternal(e,7)},e.prototype.OPTION8=function(e){return this.optionInternal(e,8)},e.prototype.OPTION9=function(e){return this.optionInternal(e,9)},e.prototype.OR=function(e){return this.orInternal(e,0)},e.prototype.OR1=function(e){return this.orInternal(e,1)},e.prototype.OR2=function(e){return this.orInternal(e,2)},e.prototype.OR3=function(e){return this.orInternal(e,3)},e.prototype.OR4=function(e){return this.orInternal(e,4)},e.prototype.OR5=function(e){return this.orInternal(e,5)},e.prototype.OR6=function(e){return this.orInternal(e,6)},e.prototype.OR7=function(e){return this.orInternal(e,7)},e.prototype.OR8=function(e){return this.orInternal(e,8)},e.prototype.OR9=function(e){return this.orInternal(e,9)},e.prototype.MANY=function(e){this.manyInternal(0,e)},e.prototype.MANY1=function(e){this.manyInternal(1,e)},e.prototype.MANY2=function(e){this.manyInternal(2,e)},e.prototype.MANY3=function(e){this.manyInternal(3,e)},e.prototype.MANY4=function(e){this.manyInternal(4,e)},e.prototype.MANY5=function(e){this.manyInternal(5,e)},e.prototype.MANY6=function(e){this.manyInternal(6,e)},e.prototype.MANY7=function(e){this.manyInternal(7,e)},e.prototype.MANY8=function(e){this.manyInternal(8,e)},e.prototype.MANY9=function(e){this.manyInternal(9,e)},e.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},e.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},e.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},e.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},e.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},e.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},e.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},e.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},e.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},e.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},e.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},e.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},e.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},e.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},e.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},e.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},e.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},e.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},e.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},e.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},e.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},e.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},e.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},e.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},e.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},e.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},e.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},e.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},e.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},e.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},e.prototype.RULE=function(e,n,a){if(a===void 0&&(a=r.DEFAULT_RULE_CONFIG),t.contains(this.definedRulesNames,e)){var o={message:i.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:r.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);var s=this.defineRule(e,n,a);return this[e]=s,s},e.prototype.OVERRIDE_RULE=function(e,t,n){n===void 0&&(n=r.DEFAULT_RULE_CONFIG);var i=[];i=i.concat(a.validateRuleIsOverridden(e,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(i);var o=this.defineRule(e,t,n);return this[e]=o,o},e.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var r=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if(n.isRecognitionException(e))return!1;throw e}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}},e.prototype.getGAstProductions=function(){return this.gastProductionsCache},e.prototype.getSerializedGastProductions=function(){return o.serializeGrammar(t.values(this.gastProductionsCache))},e}()}),dt=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RecognizerEngine=void 0;var t=K(),n=rt(),r=tt(),i=Qe(),a=Ze(),o=J(),s=nt(),c=He(),l=ze(),u=ot();e.RecognizerEngine=function(){function e(){}return e.prototype.initRecognizerEngine=function(e,n){if(this.className=u.classNameFromInstance(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=l.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},t.has(n,`serializedGrammar`))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
90
90
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
91
- For Further details.`);if(e.isArray(p)){if(e.isEmpty(p))throw Error(`A Token Vocabulary cannot be empty.
91
+ For Further details.`);if(t.isArray(e)){if(t.isEmpty(e))throw Error(`A Token Vocabulary cannot be empty.
92
92
  Note that the first argument for the parser constructor
93
- is no longer a Token vector (since v4.0).`);if(typeof p[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
93
+ is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset==`number`)throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
94
94
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
95
- For Further details.`)}if(e.isArray(p))this.tokensMap=e.reduce(p,function(f,C){return f[C.name]=C,f},{});else if(e.has(p,"modes")&&e.every(e.flatten(e.values(p.modes)),a.isTokenType)){var g=e.flatten(e.values(p.modes)),l=e.uniq(g);this.tokensMap=e.reduce(l,function(f,C){return f[C.name]=C,f},{})}else if(e.isObject(p))this.tokensMap=e.cloneObj(p);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(p),function(f){return e.isEmpty(f.categoryMatches)});this.tokenMatcher=d?a.tokenStructuredMatcherNoCategories:a.tokenStructuredMatcher,a.augmentTokenTypes(e.values(this.tokensMap))},m.prototype.defineRule=function(p,E,g){if(this.selfAnalysisDone)throw Error("Grammar rule <"+p+`> may not be defined after the 'performSelfAnalysis' method has been called'
96
- Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var l=e.has(g,"resyncEnabled")?g.resyncEnabled:s.DEFAULT_RULE_CONFIG.resyncEnabled,d=e.has(g,"recoveryValueFunc")?g.recoveryValueFunc:s.DEFAULT_RULE_CONFIG.recoveryValueFunc,f=this.ruleShortNameIdx<<t.BITS_FOR_METHOD_TYPE+t.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[f]=p,this.fullRuleNameToShort[p]=f;function C(v){try{if(this.outputCst===!0){E.apply(this,v);var L=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(L),L}else return E.apply(this,v)}catch(H){return this.invokeRuleCatch(H,l,d)}finally{this.ruleFinallyStateUpdate()}}var I=function(v,L){return v===void 0&&(v=0),this.ruleInvocationStateUpdate(f,p,v),C.call(this,L)},y="ruleName";return I[y]=p,I.originalGrammarAction=E,I},m.prototype.invokeRuleCatch=function(p,E,g){var l=this.RULE_STACK.length===1,d=E&&!this.isBackTracking()&&this.recoveryEnabled;if(n.isRecognitionException(p)){var f=p;if(d){var C=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(C))if(f.resyncedTokens=this.reSyncTo(C),this.outputCst){var I=this.CST_STACK[this.CST_STACK.length-1];return I.recoveredNode=!0,I}else return g();else{if(this.outputCst){var I=this.CST_STACK[this.CST_STACK.length-1];I.recoveredNode=!0,f.partialCstResult=I}throw f}}else{if(l)return this.moveToTerminatedState(),g();throw f}}else throw p},m.prototype.optionInternal=function(p,E){var g=this.getKeyForAutomaticLookahead(t.OPTION_IDX,E);return this.optionInternalLogic(p,E,g)},m.prototype.optionInternalLogic=function(p,E,g){var l=this,d=this.getLaFuncFromCache(g),f,C;if(p.DEF!==void 0){if(f=p.DEF,C=p.GATE,C!==void 0){var I=d;d=function(){return C.call(l)&&I.call(l)}}}else f=p;if(d.call(this)===!0)return f.call(this)},m.prototype.atLeastOneInternal=function(p,E){var g=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_IDX,p);return this.atLeastOneInternalLogic(p,E,g)},m.prototype.atLeastOneInternalLogic=function(p,E,g){var l=this,d=this.getLaFuncFromCache(g),f,C;if(E.DEF!==void 0){if(f=E.DEF,C=E.GATE,C!==void 0){var I=d;d=function(){return C.call(l)&&I.call(l)}}}else f=E;if(d.call(this)===!0)for(var y=this.doSingleRepetition(f);d.call(this)===!0&&y===!0;)y=this.doSingleRepetition(f);else throw this.raiseEarlyExitException(p,r.PROD_TYPE.REPETITION_MANDATORY,E.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[p,E],d,t.AT_LEAST_ONE_IDX,p,o.NextTerminalAfterAtLeastOneWalker)},m.prototype.atLeastOneSepFirstInternal=function(p,E){var g=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_SEP_IDX,p);this.atLeastOneSepFirstInternalLogic(p,E,g)},m.prototype.atLeastOneSepFirstInternalLogic=function(p,E,g){var l=this,d=E.DEF,f=E.SEP,C=this.getLaFuncFromCache(g);if(C.call(this)===!0){d.call(this);for(var I=function(){return l.tokenMatcher(l.LA(1),f)};this.tokenMatcher(this.LA(1),f)===!0;)this.CONSUME(f),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[p,f,I,d,o.NextTerminalAfterAtLeastOneSepWalker],I,t.AT_LEAST_ONE_SEP_IDX,p,o.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(p,r.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,E.ERR_MSG)},m.prototype.manyInternal=function(p,E){var g=this.getKeyForAutomaticLookahead(t.MANY_IDX,p);return this.manyInternalLogic(p,E,g)},m.prototype.manyInternalLogic=function(p,E,g){var l=this,d=this.getLaFuncFromCache(g),f,C;if(E.DEF!==void 0){if(f=E.DEF,C=E.GATE,C!==void 0){var I=d;d=function(){return C.call(l)&&I.call(l)}}}else f=E;for(var y=!0;d.call(this)===!0&&y===!0;)y=this.doSingleRepetition(f);this.attemptInRepetitionRecovery(this.manyInternal,[p,E],d,t.MANY_IDX,p,o.NextTerminalAfterManyWalker,y)},m.prototype.manySepFirstInternal=function(p,E){var g=this.getKeyForAutomaticLookahead(t.MANY_SEP_IDX,p);this.manySepFirstInternalLogic(p,E,g)},m.prototype.manySepFirstInternalLogic=function(p,E,g){var l=this,d=E.DEF,f=E.SEP,C=this.getLaFuncFromCache(g);if(C.call(this)===!0){d.call(this);for(var I=function(){return l.tokenMatcher(l.LA(1),f)};this.tokenMatcher(this.LA(1),f)===!0;)this.CONSUME(f),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[p,f,I,d,o.NextTerminalAfterManySepWalker],I,t.MANY_SEP_IDX,p,o.NextTerminalAfterManySepWalker)}},m.prototype.repetitionSepSecondInternal=function(p,E,g,l,d){for(;g();)this.CONSUME(E),l.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[p,E,g,l,d],g,t.AT_LEAST_ONE_SEP_IDX,p,d)},m.prototype.doSingleRepetition=function(p){var E=this.getLexerPosition();p.call(this);var g=this.getLexerPosition();return g>E},m.prototype.orInternal=function(p,E){var g=this.getKeyForAutomaticLookahead(t.OR_IDX,E),l=e.isArray(p)?p:p.DEF,d=this.getLaFuncFromCache(g),f=d.call(this,l);if(f!==void 0){var C=l[f];return C.ALT.call(this)}this.raiseNoAltException(E,p.ERR_MSG)},m.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var p=this.LA(1),E=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:p,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new n.NotAllInputParsedException(E,p))}},m.prototype.subruleInternal=function(p,E,g){var l;try{var d=g!==void 0?g.ARGS:void 0;return l=p.call(this,E,d),this.cstPostNonTerminal(l,g!==void 0&&g.LABEL!==void 0?g.LABEL:p.ruleName),l}catch(f){this.subruleInternalError(f,g,p.ruleName)}},m.prototype.subruleInternalError=function(p,E,g){throw n.isRecognitionException(p)&&p.partialCstResult!==void 0&&(this.cstPostNonTerminal(p.partialCstResult,E!==void 0&&E.LABEL!==void 0?E.LABEL:g),delete p.partialCstResult),p},m.prototype.consumeInternal=function(p,E,g){var l;try{var d=this.LA(1);this.tokenMatcher(d,p)===!0?(this.consumeToken(),l=d):this.consumeInternalError(p,d,g)}catch(f){l=this.consumeInternalRecovery(p,E,f)}return this.cstPostTerminal(g!==void 0&&g.LABEL!==void 0?g.LABEL:p.name,l),l},m.prototype.consumeInternalError=function(p,E,g){var l,d=this.LA(0);throw g!==void 0&&g.ERR_MSG?l=g.ERR_MSG:l=this.errorMessageProvider.buildMismatchTokenMessage({expected:p,actual:E,previous:d,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new n.MismatchedTokenException(l,E,d))},m.prototype.consumeInternalRecovery=function(p,E,g){if(this.recoveryEnabled&&g.name==="MismatchedTokenException"&&!this.isBackTracking()){var l=this.getFollowsForInRuleRecovery(p,E);try{return this.tryInRuleRecovery(p,l)}catch(d){throw d.name===c.IN_RULE_RECOVERY_EXCEPTION?g:d}}else throw g},m.prototype.saveRecogState=function(){var p=this.errors,E=e.cloneArr(this.RULE_STACK);return{errors:p,lexerState:this.exportLexerState(),RULE_STACK:E,CST_STACK:this.CST_STACK}},m.prototype.reloadRecogState=function(p){this.errors=p.errors,this.importLexerState(p.lexerState),this.RULE_STACK=p.RULE_STACK},m.prototype.ruleInvocationStateUpdate=function(p,E,g){this.RULE_OCCURRENCE_STACK.push(g),this.RULE_STACK.push(p),this.cstInvocationStateUpdate(E,p)},m.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},m.prototype.getCurrRuleFullName=function(){var p=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[p]},m.prototype.shortRuleNameToFullName=function(p){return this.shortRuleNameToFull[p]},m.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),A.EOF)},m.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},m})();i.RecognizerEngine=u}),go=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ErrorHandler=void 0;var e=xt(),t=Ne(),n=qt(),r=nt(),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],m=n.getLookaheadPathsForOptionalProd(c,u,A,this.maxLookahead),p=m[0],E=[],g=1;g<=this.maxLookahead;g++)E.push(this.LA(g));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:p,actual:E,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),m=[],p=1;p<=this.maxLookahead;p++)m.push(this.LA(p));var E=this.LA(0),g=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:u,actual:m,previous:E,customUserDescription:A,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new e.NoViableAltException(g,this.LA(1),E))},s})();i.ErrorHandler=o}),mo=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ContentAssist=void 0;var e=Ht(),t=Ne(),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}),Eo=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GastRecorder=void 0;var e=Ne(),t=Ze(),n=Gt(),r=kt(),o=pt(),s=nt(),c=wn(),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 m=o.createTokenInstance(u,`This IToken indicates the Parser is in Recording Phase
97
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(m);var p={name:`This CSTNode indicates the Parser is in Recording Phase
98
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},E=(function(){function C(){}return C.prototype.initGastRecorder=function(I){this.recordingProdStack=[],this.RECORDING_PHASE=!1},C.prototype.enableRecording=function(){var I=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var y=function(L){var H=L>0?L:"";I["CONSUME"+H]=function(Q,P){return this.consumeInternalRecord(Q,L,P)},I["SUBRULE"+H]=function(Q,P){return this.subruleInternalRecord(Q,L,P)},I["OPTION"+H]=function(Q){return this.optionInternalRecord(Q,L)},I["OR"+H]=function(Q){return this.orInternalRecord(Q,L)},I["MANY"+H]=function(Q){this.manyInternalRecord(L,Q)},I["MANY_SEP"+H]=function(Q){this.manySepFirstInternalRecord(L,Q)},I["AT_LEAST_ONE"+H]=function(Q){this.atLeastOneInternalRecord(L,Q)},I["AT_LEAST_ONE_SEP"+H]=function(Q){this.atLeastOneSepFirstInternalRecord(L,Q)}},v=0;v<10;v++)y(v);I.consume=function(L,H,Q){return this.consumeInternalRecord(H,L,Q)},I.subrule=function(L,H,Q){return this.subruleInternalRecord(H,L,Q)},I.option=function(L,H){return this.optionInternalRecord(H,L)},I.or=function(L,H){return this.orInternalRecord(H,L)},I.many=function(L,H){this.manyInternalRecord(L,H)},I.atLeastOne=function(L,H){this.atLeastOneInternalRecord(L,H)},I.ACTION=I.ACTION_RECORD,I.BACKTRACK=I.BACKTRACK_RECORD,I.LA=I.LA_RECORD})},C.prototype.disableRecording=function(){var I=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var y=0;y<10;y++){var v=y>0?y:"";delete I["CONSUME"+v],delete I["SUBRULE"+v],delete I["OPTION"+v],delete I["OR"+v],delete I["MANY"+v],delete I["MANY_SEP"+v],delete I["AT_LEAST_ONE"+v],delete I["AT_LEAST_ONE_SEP"+v]}delete I.consume,delete I.subrule,delete I.option,delete I.or,delete I.many,delete I.atLeastOne,delete I.ACTION,delete I.BACKTRACK,delete I.LA})},C.prototype.ACTION_RECORD=function(I){},C.prototype.BACKTRACK_RECORD=function(I,y){return function(){return!0}},C.prototype.LA_RECORD=function(I){return s.END_OF_FILE},C.prototype.topLevelRuleRecord=function(I,y){try{var v=new t.Rule({definition:[],name:I});return v.name=I,this.recordingProdStack.push(v),y.call(this),this.recordingProdStack.pop(),v}catch(L){if(L.KNOWN_RECORDER_ERROR!==!0)try{L.message=L.message+`
95
+ For Further details.`)}if(t.isArray(e))this.tokensMap=t.reduce(e,function(e,t){return e[t.name]=t,e},{});else if(t.has(e,`modes`)&&t.every(t.flatten(t.values(e.modes)),l.isTokenType)){var r=t.flatten(t.values(e.modes)),i=t.uniq(r);this.tokensMap=t.reduce(i,function(e,t){return e[t.name]=t,e},{})}else if(t.isObject(e))this.tokensMap=t.cloneObj(e);else throw Error(`<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition`);this.tokensMap.EOF=c.EOF;var a=t.every(t.values(e),function(e){return t.isEmpty(e.categoryMatches)});this.tokenMatcher=a?l.tokenStructuredMatcherNoCategories:l.tokenStructuredMatcher,l.augmentTokenTypes(t.values(this.tokensMap))},e.prototype.defineRule=function(e,r,i){if(this.selfAnalysisDone)throw Error(`Grammar rule <`+e+`> may not be defined after the 'performSelfAnalysis' method has been called'
96
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var a=t.has(i,`resyncEnabled`)?i.resyncEnabled:o.DEFAULT_RULE_CONFIG.resyncEnabled,s=t.has(i,`recoveryValueFunc`)?i.recoveryValueFunc:o.DEFAULT_RULE_CONFIG.recoveryValueFunc,c=this.ruleShortNameIdx<<n.BITS_FOR_METHOD_TYPE+n.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[c]=e,this.fullRuleNameToShort[e]=c;function l(e){try{if(this.outputCst===!0){r.apply(this,e);var t=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(t),t}else return r.apply(this,e)}catch(e){return this.invokeRuleCatch(e,a,s)}finally{this.ruleFinallyStateUpdate()}}var u=function(t,n){return t===void 0&&(t=0),this.ruleInvocationStateUpdate(c,e,t),l.call(this,n)},d=`ruleName`;return u[d]=e,u.originalGrammarAction=r,u},e.prototype.invokeRuleCatch=function(e,t,n){var i=this.RULE_STACK.length===1,a=t&&!this.isBackTracking()&&this.recoveryEnabled;if(r.isRecognitionException(e)){var o=e;if(a){var s=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(s))if(o.resyncedTokens=this.reSyncTo(s),this.outputCst){var c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return n();else{if(this.outputCst){var c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,o.partialCstResult=c}throw o}}else{if(i)return this.moveToTerminatedState(),n();throw o}}else throw e},e.prototype.optionInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(n.OPTION_IDX,t);return this.optionInternalLogic(e,t,r)},e.prototype.optionInternalLogic=function(e,t,n){var r=this,i=this.getLaFuncFromCache(n),a,o;if(e.DEF!==void 0){if(a=e.DEF,o=e.GATE,o!==void 0){var s=i;i=function(){return o.call(r)&&s.call(r)}}}else a=e;if(i.call(this)===!0)return a.call(this)},e.prototype.atLeastOneInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(n.AT_LEAST_ONE_IDX,e);return this.atLeastOneInternalLogic(e,t,r)},e.prototype.atLeastOneInternalLogic=function(e,t,r){var o=this,s=this.getLaFuncFromCache(r),c,l;if(t.DEF!==void 0){if(c=t.DEF,l=t.GATE,l!==void 0){var u=s;s=function(){return l.call(o)&&u.call(o)}}}else c=t;if(s.call(this)===!0)for(var d=this.doSingleRepetition(c);s.call(this)===!0&&d===!0;)d=this.doSingleRepetition(c);else throw this.raiseEarlyExitException(e,i.PROD_TYPE.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],s,n.AT_LEAST_ONE_IDX,e,a.NextTerminalAfterAtLeastOneWalker)},e.prototype.atLeastOneSepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(n.AT_LEAST_ONE_SEP_IDX,e);this.atLeastOneSepFirstInternalLogic(e,t,r)},e.prototype.atLeastOneSepFirstInternalLogic=function(e,t,r){var o=this,s=t.DEF,c=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){s.call(this);for(var l=function(){return o.tokenMatcher(o.LA(1),c)};this.tokenMatcher(this.LA(1),c)===!0;)this.CONSUME(c),s.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,c,l,s,a.NextTerminalAfterAtLeastOneSepWalker],l,n.AT_LEAST_ONE_SEP_IDX,e,a.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(e,i.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)},e.prototype.manyInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(n.MANY_IDX,e);return this.manyInternalLogic(e,t,r)},e.prototype.manyInternalLogic=function(e,t,r){var i=this,o=this.getLaFuncFromCache(r),s,c;if(t.DEF!==void 0){if(s=t.DEF,c=t.GATE,c!==void 0){var l=o;o=function(){return c.call(i)&&l.call(i)}}}else s=t;for(var u=!0;o.call(this)===!0&&u===!0;)u=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],o,n.MANY_IDX,e,a.NextTerminalAfterManyWalker,u)},e.prototype.manySepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(n.MANY_SEP_IDX,e);this.manySepFirstInternalLogic(e,t,r)},e.prototype.manySepFirstInternalLogic=function(e,t,r){var i=this,o=t.DEF,s=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){o.call(this);for(var c=function(){return i.tokenMatcher(i.LA(1),s)};this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,c,o,a.NextTerminalAfterManySepWalker],c,n.MANY_SEP_IDX,e,a.NextTerminalAfterManySepWalker)}},e.prototype.repetitionSepSecondInternal=function(e,t,r,i,a){for(;r();)this.CONSUME(t),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,i,a],r,n.AT_LEAST_ONE_SEP_IDX,e,a)},e.prototype.doSingleRepetition=function(e){var t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t},e.prototype.orInternal=function(e,r){var i=this.getKeyForAutomaticLookahead(n.OR_IDX,r),a=t.isArray(e)?e:e.DEF,o=this.getLaFuncFromCache(i).call(this,a);if(o!==void 0)return a[o].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)},e.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new r.NotAllInputParsedException(t,e))}},e.prototype.subruleInternal=function(e,t,n){var r;try{var i=n===void 0?void 0:n.ARGS;return r=e.call(this,t,i),this.cstPostNonTerminal(r,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),r}catch(t){this.subruleInternalError(t,n,e.ruleName)}},e.prototype.subruleInternalError=function(e,t,n){throw r.isRecognitionException(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:n),delete e.partialCstResult),e},e.prototype.consumeInternal=function(e,t,n){var r;try{var i=this.LA(1);this.tokenMatcher(i,e)===!0?(this.consumeToken(),r=i):this.consumeInternalError(e,i,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,r),r},e.prototype.consumeInternalError=function(e,t,n){var i,a=this.LA(0);throw i=n!==void 0&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new r.MismatchedTokenException(i,t,a))},e.prototype.consumeInternalRecovery=function(e,t,n){if(this.recoveryEnabled&&n.name===`MismatchedTokenException`&&!this.isBackTracking()){var r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===s.IN_RULE_RECOVERY_EXCEPTION?n:e}}else throw n},e.prototype.saveRecogState=function(){var e=this.errors,n=t.cloneArr(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:n,CST_STACK:this.CST_STACK}},e.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},e.prototype.ruleInvocationStateUpdate=function(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t,e)},e.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},e.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},e.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},e.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),c.EOF)},e.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},e}()}),ft=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorHandler=void 0;var t=tt(),n=K(),r=Qe(),i=J();e.ErrorHandler=function(){function e(){}return e.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=n.has(e,`errorMessageProvider`)?e.errorMessageProvider:i.DEFAULT_PARSER_CONFIG.errorMessageProvider},e.prototype.SAVE_ERROR=function(e){if(t.isRecognitionException(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:n.cloneArr(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error(`Trying to save an Error which is not a RecognitionException`)},Object.defineProperty(e.prototype,"errors",{get:function(){return n.cloneArr(this._errors)},set:function(e){this._errors=e},enumerable:!1,configurable:!0}),e.prototype.raiseEarlyExitException=function(e,n,i){for(var a=this.getCurrRuleFullName(),o=this.getGAstProductions()[a],s=r.getLookaheadPathsForOptionalProd(e,o,n,this.maxLookahead)[0],c=[],l=1;l<=this.maxLookahead;l++)c.push(this.LA(l));var u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:s,actual:c,previous:this.LA(0),customUserDescription:i,ruleName:a});throw this.SAVE_ERROR(new t.EarlyExitException(u,this.LA(1),this.LA(0)))},e.prototype.raiseNoAltException=function(e,n){for(var i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=r.getLookaheadPathsForOr(e,a,this.maxLookahead),s=[],c=1;c<=this.maxLookahead;c++)s.push(this.LA(c));var l=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:s,previous:l,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new t.NoViableAltException(u,this.LA(1),l))},e}()}),pt=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContentAssist=void 0;var t=Ze(),n=K();e.ContentAssist=function(){function e(){}return e.prototype.initContentAssist=function(){},e.prototype.computeContentAssist=function(e,r){var i=this.gastProductionsCache[e];if(n.isUndefined(i))throw Error(`Rule ->`+e+`<- does not exist in this grammar.`);return t.nextPossibleTokensAfter([i],r,this.tokenMatcher,this.maxLookahead)},e.prototype.getNextPossibleTokenTypes=function(e){var r=n.first(e.ruleStack),i=this.getGAstProductions()[r];return new t.NextAfterTokenWalker(i,e).startWalking()},e}()}),mt=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GastRecorder=void 0;var t=K(),n=q(),r=Ve(),i=ze(),a=He(),o=J(),s=rt(),c={description:`This Object indicates the Parser is during Recording Phase`};Object.freeze(c);var l=!0,u=2**s.BITS_FOR_OCCURRENCE_IDX-1,d=a.createToken({name:`RECORDING_PHASE_TOKEN`,pattern:r.Lexer.NA});i.augmentTokenTypes([d]);var f=a.createTokenInstance(d,`This IToken indicates the Parser is in Recording Phase
97
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(f);var p={name:`This CSTNode indicates the Parser is in Recording Phase
98
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};e.GastRecorder=function(){function e(){}return e.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},e.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT(`Enable Recording`,function(){for(var t=function(t){var n=t>0?t:``;e[`CONSUME`+n]=function(e,n){return this.consumeInternalRecord(e,t,n)},e[`SUBRULE`+n]=function(e,n){return this.subruleInternalRecord(e,t,n)},e[`OPTION`+n]=function(e){return this.optionInternalRecord(e,t)},e[`OR`+n]=function(e){return this.orInternalRecord(e,t)},e[`MANY`+n]=function(e){this.manyInternalRecord(t,e)},e[`MANY_SEP`+n]=function(e){this.manySepFirstInternalRecord(t,e)},e[`AT_LEAST_ONE`+n]=function(e){this.atLeastOneInternalRecord(t,e)},e[`AT_LEAST_ONE_SEP`+n]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}},n=0;n<10;n++)t(n);e.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},e.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},e.option=function(e,t){return this.optionInternalRecord(t,e)},e.or=function(e,t){return this.orInternalRecord(t,e)},e.many=function(e,t){this.manyInternalRecord(e,t)},e.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD})},e.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT(`Deleting Recording methods`,function(){for(var t=0;t<10;t++){var n=t>0?t:``;delete e[`CONSUME`+n],delete e[`SUBRULE`+n],delete e[`OPTION`+n],delete e[`OR`+n],delete e[`MANY`+n],delete e[`MANY_SEP`+n],delete e[`AT_LEAST_ONE`+n],delete e[`AT_LEAST_ONE_SEP`+n]}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})},e.prototype.ACTION_RECORD=function(e){},e.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},e.prototype.LA_RECORD=function(e){return o.END_OF_FILE},e.prototype.topLevelRuleRecord=function(e,t){try{var r=new n.Rule({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(e){if(e.KNOWN_RECORDER_ERROR!==!0)try{e.message+=`
99
99
  This error was thrown during the "grammar recording phase" For more info see:
100
- https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw L}throw L}},C.prototype.optionInternalRecord=function(I,y){return g.call(this,t.Option,I,y)},C.prototype.atLeastOneInternalRecord=function(I,y){g.call(this,t.RepetitionMandatory,y,I)},C.prototype.atLeastOneSepFirstInternalRecord=function(I,y){g.call(this,t.RepetitionMandatoryWithSeparator,y,I,a)},C.prototype.manyInternalRecord=function(I,y){g.call(this,t.Repetition,y,I)},C.prototype.manySepFirstInternalRecord=function(I,y){g.call(this,t.RepetitionWithSeparator,y,I,a)},C.prototype.orInternalRecord=function(I,y){return l.call(this,I,y)},C.prototype.subruleInternalRecord=function(I,y,v){if(f(y),!I||e.has(I,"ruleName")===!1){var L=new Error("<SUBRULE"+d(y)+"> argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(I)+">")+(`
101
- inside top level rule: <`+this.recordingProdStack[0].name+">"));throw L.KNOWN_RECORDER_ERROR=!0,L}var H=e.peek(this.recordingProdStack),Q=I.ruleName,P=new t.NonTerminal({idx:y,nonTerminalName:Q,referencedRule:void 0});return H.definition.push(P),this.outputCst?p:A},C.prototype.consumeInternalRecord=function(I,y,v){if(f(y),!r.hasShortKeyProperty(I)){var L=new Error("<CONSUME"+d(y)+"> argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(I)+">")+(`
102
- inside top level rule: <`+this.recordingProdStack[0].name+">"));throw L.KNOWN_RECORDER_ERROR=!0,L}var H=e.peek(this.recordingProdStack),Q=new t.Terminal({idx:y,terminalType:I});return H.definition.push(Q),m},C})();i.GastRecorder=E;function g(C,I,y,v){v===void 0&&(v=!1),f(y);var L=e.peek(this.recordingProdStack),H=e.isFunction(I)?I:I.DEF,Q=new C({definition:[],idx:y});return v&&(Q.separator=I.SEP),e.has(I,"MAX_LOOKAHEAD")&&(Q.maxLookahead=I.MAX_LOOKAHEAD),this.recordingProdStack.push(Q),H.call(this),L.definition.push(Q),this.recordingProdStack.pop(),A}function l(C,I){var y=this;f(I);var v=e.peek(this.recordingProdStack),L=e.isArray(C)===!1,H=L===!1?C:C.DEF,Q=new t.Alternation({definition:[],idx:I,ignoreAmbiguities:L&&C.IGNORE_AMBIGUITIES===!0});e.has(C,"MAX_LOOKAHEAD")&&(Q.maxLookahead=C.MAX_LOOKAHEAD);var P=e.some(H,function(D){return e.isFunction(D.GATE)});return Q.hasPredicates=P,v.definition.push(Q),e.forEach(H,function(D){var R=new t.Alternative({definition:[]});Q.definition.push(R),e.has(D,"IGNORE_AMBIGUITIES")?R.ignoreAmbiguities=D.IGNORE_AMBIGUITIES:e.has(D,"GATE")&&(R.ignoreAmbiguities=!0),y.recordingProdStack.push(R),D.ALT.call(y),y.recordingProdStack.pop()}),A}function d(C){return C===0?"":""+C}function f(C){if(C<0||C>h){var I=new Error("Invalid DSL Method idx value: <"+C+`>
103
- `+("Idx value must be a none negative value smaller than "+(h+1)));throw I.KNOWN_RECORDER_ERROR=!0,I}}}),Io=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PerformanceTracer=void 0;var e=Ne(),t=nt(),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}),bo=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}),nt=ve(i=>{var e=i&&i.__extends||(function(){var v=function(L,H){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,P){Q.__proto__=P}||function(Q,P){for(var D in P)Object.prototype.hasOwnProperty.call(P,D)&&(Q[D]=P[D])},v(L,H)};return function(L,H){if(typeof H!="function"&&H!==null)throw new TypeError("Class extends value "+String(H)+" is not a constructor or null");v(L,H);function Q(){this.constructor=L}L.prototype=H===null?Object.create(H):(Q.prototype=H.prototype,new Q)}})();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=Ne(),n=oo(),r=pt(),o=jt(),s=ao(),c=di(),A=Ao(),a=uo(),h=ho(),u=fo(),m=po(),p=go(),E=mo(),g=Eo(),l=Io(),d=bo();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(v){v[v.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",v[v.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",v[v.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",v[v.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",v[v.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",v[v.LEFT_RECURSION=5]="LEFT_RECURSION",v[v.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",v[v.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",v[v.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",v[v.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",v[v.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",v[v.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",v[v.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(i.ParserDefinitionErrorType||(i.ParserDefinitionErrorType={}));function f(v){return v===void 0&&(v=void 0),function(){return v}}i.EMPTY_ALT=f;var C=(function(){function v(L,H){this.definitionErrors=[],this.selfAnalysisDone=!1;var Q=this;if(Q.initErrorHandler(H),Q.initLexerAdapter(),Q.initLooksAhead(H),Q.initRecognizerEngine(L,H),Q.initRecoverable(H),Q.initTreeBuilder(H),Q.initContentAssist(),Q.initGastRecorder(H),Q.initPerformanceTracer(H),t.has(H,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
100
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw e}throw e}},e.prototype.optionInternalRecord=function(e,t){return m.call(this,n.Option,e,t)},e.prototype.atLeastOneInternalRecord=function(e,t){m.call(this,n.RepetitionMandatory,t,e)},e.prototype.atLeastOneSepFirstInternalRecord=function(e,t){m.call(this,n.RepetitionMandatoryWithSeparator,t,e,l)},e.prototype.manyInternalRecord=function(e,t){m.call(this,n.Repetition,t,e)},e.prototype.manySepFirstInternalRecord=function(e,t){m.call(this,n.RepetitionWithSeparator,t,e,l)},e.prototype.orInternalRecord=function(e,t){return h.call(this,e,t)},e.prototype.subruleInternalRecord=function(e,r,i){if(_(r),!e||t.has(e,`ruleName`)===!1){var a=Error(`<SUBRULE`+g(r)+`> argument is invalid`+(` expecting a Parser method reference but got: <`+JSON.stringify(e)+`>`)+(`
101
+ inside top level rule: <`+this.recordingProdStack[0].name+`>`));throw a.KNOWN_RECORDER_ERROR=!0,a}var o=t.peek(this.recordingProdStack),s=e.ruleName,l=new n.NonTerminal({idx:r,nonTerminalName:s,referencedRule:void 0});return o.definition.push(l),this.outputCst?p:c},e.prototype.consumeInternalRecord=function(e,r,a){if(_(r),!i.hasShortKeyProperty(e)){var o=Error(`<CONSUME`+g(r)+`> argument is invalid`+(` expecting a TokenType reference but got: <`+JSON.stringify(e)+`>`)+(`
102
+ inside top level rule: <`+this.recordingProdStack[0].name+`>`));throw o.KNOWN_RECORDER_ERROR=!0,o}var s=t.peek(this.recordingProdStack),c=new n.Terminal({idx:r,terminalType:e});return s.definition.push(c),f},e}();function m(e,n,r,i){i===void 0&&(i=!1),_(r);var a=t.peek(this.recordingProdStack),o=t.isFunction(n)?n:n.DEF,s=new e({definition:[],idx:r});return i&&(s.separator=n.SEP),t.has(n,`MAX_LOOKAHEAD`)&&(s.maxLookahead=n.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),a.definition.push(s),this.recordingProdStack.pop(),c}function h(e,r){var i=this;_(r);var a=t.peek(this.recordingProdStack),o=t.isArray(e)===!1,s=o===!1?e:e.DEF,l=new n.Alternation({definition:[],idx:r,ignoreAmbiguities:o&&e.IGNORE_AMBIGUITIES===!0});return t.has(e,`MAX_LOOKAHEAD`)&&(l.maxLookahead=e.MAX_LOOKAHEAD),l.hasPredicates=t.some(s,function(e){return t.isFunction(e.GATE)}),a.definition.push(l),t.forEach(s,function(e){var r=new n.Alternative({definition:[]});l.definition.push(r),t.has(e,`IGNORE_AMBIGUITIES`)?r.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:t.has(e,`GATE`)&&(r.ignoreAmbiguities=!0),i.recordingProdStack.push(r),e.ALT.call(i),i.recordingProdStack.pop()}),c}function g(e){return e===0?``:``+e}function _(e){if(e<0||e>u){var t=Error(`Invalid DSL Method idx value: <`+e+`>
103
+ `+(`Idx value must be a none negative value smaller than `+(u+1)));throw t.KNOWN_RECORDER_ERROR=!0,t}}}),ht=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PerformanceTracer=void 0;var t=K(),n=J();e.PerformanceTracer=function(){function e(){}return e.prototype.initPerformanceTracer=function(e){if(t.has(e,`traceInitPerf`)){var r=e.traceInitPerf,i=typeof r==`number`;this.traceInitMaxIdent=i?r:1/0,this.traceInitPerf=i?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=n.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(e,n){if(this.traceInitPerf===!0){this.traceInitIndent++;var r=Array(this.traceInitIndent+1).join(` `);this.traceInitIndent<this.traceInitMaxIdent&&console.log(r+`--> <`+e+`>`);var i=t.timer(n),a=i.time,o=i.value,s=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(r+`<-- <`+e+`> time: `+a+`ms`),this.traceInitIndent--,o}else return n()},e}()}),gt=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.applyMixins=void 0;function t(e,t){t.forEach(function(t){var n=t.prototype;Object.getOwnPropertyNames(n).forEach(function(r){if(r!==`constructor`){var i=Object.getOwnPropertyDescriptor(n,r);i&&(i.get||i.set)?Object.defineProperty(e.prototype,r,i):e.prototype[r]=t.prototype[r]}})})}e.applyMixins=t}),J=G(e=>{"use strict";var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.EmbeddedActionsParser=e.CstParser=e.Parser=e.EMPTY_ALT=e.ParserDefinitionErrorType=e.DEFAULT_RULE_CONFIG=e.DEFAULT_PARSER_CONFIG=e.END_OF_FILE=void 0;var n=K(),r=Je(),i=He(),a=Ye(),o=et(),s=nt(),c=it(),l=ct(),u=lt(),d=ut(),f=dt(),p=ft(),m=pt(),h=mt(),g=ht(),_=gt();e.END_OF_FILE=i.createTokenInstance(i.EOF,``,NaN,NaN,NaN,NaN,NaN,NaN),Object.freeze(e.END_OF_FILE),e.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:a.defaultParserErrorProvider,nodeLocationTracking:`none`,traceInitPerf:!1,skipValidations:!1}),e.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0}),(function(e){e[e.INVALID_RULE_NAME=0]=`INVALID_RULE_NAME`,e[e.DUPLICATE_RULE_NAME=1]=`DUPLICATE_RULE_NAME`,e[e.INVALID_RULE_OVERRIDE=2]=`INVALID_RULE_OVERRIDE`,e[e.DUPLICATE_PRODUCTIONS=3]=`DUPLICATE_PRODUCTIONS`,e[e.UNRESOLVED_SUBRULE_REF=4]=`UNRESOLVED_SUBRULE_REF`,e[e.LEFT_RECURSION=5]=`LEFT_RECURSION`,e[e.NONE_LAST_EMPTY_ALT=6]=`NONE_LAST_EMPTY_ALT`,e[e.AMBIGUOUS_ALTS=7]=`AMBIGUOUS_ALTS`,e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]=`CONFLICT_TOKENS_RULES_NAMESPACE`,e[e.INVALID_TOKEN_NAME=9]=`INVALID_TOKEN_NAME`,e[e.NO_NON_EMPTY_LOOKAHEAD=10]=`NO_NON_EMPTY_LOOKAHEAD`,e[e.AMBIGUOUS_PREFIX_ALTS=11]=`AMBIGUOUS_PREFIX_ALTS`,e[e.TOO_MANY_ALTS=12]=`TOO_MANY_ALTS`})(e.ParserDefinitionErrorType||={});function v(e){return e===void 0&&(e=void 0),function(){return e}}e.EMPTY_ALT=v;var y=function(){function t(t,r){this.definitionErrors=[],this.selfAnalysisDone=!1;var i=this;if(i.initErrorHandler(r),i.initLexerAdapter(),i.initLooksAhead(r),i.initRecognizerEngine(t,r),i.initRecoverable(r),i.initTreeBuilder(r),i.initContentAssist(),i.initGastRecorder(r),i.initPerformanceTracer(r),n.has(r,`ignoredIssues`))throw Error(`The <ignoredIssues> IParserConfig property has been deprecated.
104
104
  Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
105
105
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
106
- For further details.`);this.skipValidations=t.has(H,"skipValidations")?H.skipValidations:i.DEFAULT_PARSER_CONFIG.skipValidations}return v.performSelfAnalysis=function(L){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},v.prototype.performSelfAnalysis=function(){var L=this;this.TRACE_INIT("performSelfAnalysis",function(){var H;L.selfAnalysisDone=!0;var Q=L.className;L.TRACE_INIT("toFastProps",function(){t.toFastProperties(L)}),L.TRACE_INIT("Grammar Recording",function(){try{L.enableRecording(),t.forEach(L.definedRulesNames,function(D){var R=L[D],F=R.originalGrammarAction,_=void 0;L.TRACE_INIT(D+" Rule",function(){_=L.topLevelRuleRecord(D,F)}),L.gastProductionsCache[D]=_})}finally{L.disableRecording()}});var P=[];if(L.TRACE_INIT("Grammar Resolving",function(){P=s.resolveGrammar({rules:t.values(L.gastProductionsCache)}),L.definitionErrors=L.definitionErrors.concat(P)}),L.TRACE_INIT("Grammar Validations",function(){if(t.isEmpty(P)&&L.skipValidations===!1){var D=s.validateGrammar({rules:t.values(L.gastProductionsCache),maxLookahead:L.maxLookahead,tokenTypes:t.values(L.tokensMap),errMsgProvider:o.defaultGrammarValidatorErrorProvider,grammarName:Q});L.definitionErrors=L.definitionErrors.concat(D)}}),t.isEmpty(L.definitionErrors)&&(L.recoveryEnabled&&L.TRACE_INIT("computeAllProdsFollows",function(){var D=n.computeAllProdsFollows(t.values(L.gastProductionsCache));L.resyncFollows=D}),L.TRACE_INIT("ComputeLookaheadFunctions",function(){L.preComputeLookaheadFunctions(t.values(L.gastProductionsCache))})),!v.DEFER_DEFINITION_ERRORS_HANDLING&&!t.isEmpty(L.definitionErrors))throw H=t.map(L.definitionErrors,function(D){return D.message}),new Error(`Parser Definition Errors detected:
107
- `+H.join(`
106
+ For further details.`);this.skipValidations=n.has(r,`skipValidations`)?r.skipValidations:e.DEFAULT_PARSER_CONFIG.skipValidations}return t.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},t.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT(`performSelfAnalysis`,function(){var i;e.selfAnalysisDone=!0;var s=e.className;e.TRACE_INIT(`toFastProps`,function(){n.toFastProperties(e)}),e.TRACE_INIT(`Grammar Recording`,function(){try{e.enableRecording(),n.forEach(e.definedRulesNames,function(t){var n=e[t].originalGrammarAction,r=void 0;e.TRACE_INIT(t+` Rule`,function(){r=e.topLevelRuleRecord(t,n)}),e.gastProductionsCache[t]=r})}finally{e.disableRecording()}});var c=[];if(e.TRACE_INIT(`Grammar Resolving`,function(){c=o.resolveGrammar({rules:n.values(e.gastProductionsCache)}),e.definitionErrors=e.definitionErrors.concat(c)}),e.TRACE_INIT(`Grammar Validations`,function(){if(n.isEmpty(c)&&e.skipValidations===!1){var t=o.validateGrammar({rules:n.values(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:n.values(e.tokensMap),errMsgProvider:a.defaultGrammarValidatorErrorProvider,grammarName:s});e.definitionErrors=e.definitionErrors.concat(t)}}),n.isEmpty(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT(`computeAllProdsFollows`,function(){e.resyncFollows=r.computeAllProdsFollows(n.values(e.gastProductionsCache))}),e.TRACE_INIT(`ComputeLookaheadFunctions`,function(){e.preComputeLookaheadFunctions(n.values(e.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!n.isEmpty(e.definitionErrors))throw i=n.map(e.definitionErrors,function(e){return e.message}),Error(`Parser Definition Errors detected:
107
+ `+i.join(`
108
108
  -------------------------------
109
- `))})},v.DEFER_DEFINITION_ERRORS_HANDLING=!1,v})();i.Parser=C,d.applyMixins(C,[c.Recoverable,A.LooksAhead,a.TreeBuilder,h.LexerAdapter,m.RecognizerEngine,u.RecognizerApi,p.ErrorHandler,E.ContentAssist,g.GastRecorder,l.PerformanceTracer]);var I=(function(v){e(L,v);function L(H,Q){Q===void 0&&(Q=i.DEFAULT_PARSER_CONFIG);var P=this,D=t.cloneObj(Q);return D.outputCst=!0,P=v.call(this,H,D)||this,P}return L})(C);i.CstParser=I;var y=(function(v){e(L,v);function L(H,Q){Q===void 0&&(Q=i.DEFAULT_PARSER_CONFIG);var P=this,D=t.cloneObj(Q);return D.outputCst=!1,P=v.call(this,H,D)||this,P}return L})(C);i.EmbeddedActionsParser=y}),Co=ve(i=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSyntaxDiagramsCode=void 0;var e=ai();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=`
109
+ `))})},t.DEFER_DEFINITION_ERRORS_HANDLING=!1,t}();e.Parser=y,_.applyMixins(y,[s.Recoverable,c.LooksAhead,l.TreeBuilder,u.LexerAdapter,f.RecognizerEngine,d.RecognizerApi,p.ErrorHandler,m.ContentAssist,h.GastRecorder,g.PerformanceTracer]),e.CstParser=function(r){t(i,r);function i(t,i){i===void 0&&(i=e.DEFAULT_PARSER_CONFIG);var a=this,o=n.cloneObj(i);return o.outputCst=!0,a=r.call(this,t,o)||this,a}return i}(y),e.EmbeddedActionsParser=function(r){t(i,r);function i(t,i){i===void 0&&(i=e.DEFAULT_PARSER_CONFIG);var a=this,o=n.cloneObj(i);return o.outputCst=!1,a=r.call(this,t,o)||this,a}return i}(y)}),_t=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createSyntaxDiagramsCode=void 0;var t=Pe();function n(e,n){var r=n===void 0?{}:n,i=r.resourceBase,a=i===void 0?`https://unpkg.com/chevrotain@`+t.VERSION+`/diagrams/`:i,o=r.css,s=o===void 0?`https://unpkg.com/chevrotain@`+t.VERSION+`/diagrams/diagrams.css`:o,c=`
110
110
  <!-- This is a generated file -->
111
111
  <!DOCTYPE html>
112
112
  <meta charset="utf-8">
@@ -116,30 +116,30 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
116
116
  }
117
117
  </style>
118
118
 
119
+ `,l=`
120
+ <link rel='stylesheet' href='`+s+`'>
119
121
  `,u=`
120
- <link rel='stylesheet' href='`+a+`'>
121
- `,m=`
122
- <script src='`+c+`vendor/railroad-diagrams.js'><\/script>
123
- <script src='`+c+`src/diagrams_builder.js'><\/script>
124
- <script src='`+c+`src/diagrams_behavior.js'><\/script>
125
- <script src='`+c+`src/main.js'><\/script>
126
- `,p=`
122
+ <script src='`+a+`vendor/railroad-diagrams.js'><\/script>
123
+ <script src='`+a+`src/diagrams_builder.js'><\/script>
124
+ <script src='`+a+`src/diagrams_behavior.js'><\/script>
125
+ <script src='`+a+`src/main.js'><\/script>
126
+ `,d=`
127
127
  <div id="diagrams" align="center"></div>
128
- `,E=`
128
+ `,f=`
129
129
  <script>
130
- window.serializedGrammar = `+JSON.stringify(n,null," ")+`;
130
+ window.serializedGrammar = `+JSON.stringify(e,null,` `)+`;
131
131
  <\/script>
132
- `,g=`
132
+ `;return c+l+u+d+f+`
133
133
  <script>
134
134
  var diagramsDiv = document.getElementById("diagrams");
135
135
  main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);
136
136
  <\/script>
137
- `;return h+u+m+p+E+g}i.createSyntaxDiagramsCode=t}),yo=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=ai();Object.defineProperty(i,"VERSION",{enumerable:!0,get:function(){return e.VERSION}});var t=nt();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=Gt();Object.defineProperty(i,"Lexer",{enumerable:!0,get:function(){return n.Lexer}}),Object.defineProperty(i,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return n.LexerDefinitionErrorType}});var r=pt();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=jt();Object.defineProperty(i,"defaultParserErrorProvider",{enumerable:!0,get:function(){return o.defaultParserErrorProvider}});var s=xt();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=ci();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=St();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.
137
+ `}e.createSyntaxDiagramsCode=n}),vt=G(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Parser=e.createSyntaxDiagramsCode=e.clearCache=e.GAstVisitor=e.serializeProduction=e.serializeGrammar=e.Terminal=e.Rule=e.RepetitionWithSeparator=e.RepetitionMandatoryWithSeparator=e.RepetitionMandatory=e.Repetition=e.Option=e.NonTerminal=e.Alternative=e.Alternation=e.defaultLexerErrorProvider=e.NoViableAltException=e.NotAllInputParsedException=e.MismatchedTokenException=e.isRecognitionException=e.EarlyExitException=e.defaultParserErrorProvider=e.tokenName=e.tokenMatcher=e.tokenLabel=e.EOF=e.createTokenInstance=e.createToken=e.LexerDefinitionErrorType=e.Lexer=e.EMPTY_ALT=e.ParserDefinitionErrorType=e.EmbeddedActionsParser=e.CstParser=e.VERSION=void 0;var t=Pe();Object.defineProperty(e,"VERSION",{enumerable:!0,get:function(){return t.VERSION}});var n=J();Object.defineProperty(e,"CstParser",{enumerable:!0,get:function(){return n.CstParser}}),Object.defineProperty(e,"EmbeddedActionsParser",{enumerable:!0,get:function(){return n.EmbeddedActionsParser}}),Object.defineProperty(e,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return n.ParserDefinitionErrorType}}),Object.defineProperty(e,"EMPTY_ALT",{enumerable:!0,get:function(){return n.EMPTY_ALT}});var r=Ve();Object.defineProperty(e,"Lexer",{enumerable:!0,get:function(){return r.Lexer}}),Object.defineProperty(e,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return r.LexerDefinitionErrorType}});var i=He();Object.defineProperty(e,"createToken",{enumerable:!0,get:function(){return i.createToken}}),Object.defineProperty(e,"createTokenInstance",{enumerable:!0,get:function(){return i.createTokenInstance}}),Object.defineProperty(e,"EOF",{enumerable:!0,get:function(){return i.EOF}}),Object.defineProperty(e,"tokenLabel",{enumerable:!0,get:function(){return i.tokenLabel}}),Object.defineProperty(e,"tokenMatcher",{enumerable:!0,get:function(){return i.tokenMatcher}}),Object.defineProperty(e,"tokenName",{enumerable:!0,get:function(){return i.tokenName}});var a=Ye();Object.defineProperty(e,"defaultParserErrorProvider",{enumerable:!0,get:function(){return a.defaultParserErrorProvider}});var o=tt();Object.defineProperty(e,"EarlyExitException",{enumerable:!0,get:function(){return o.EarlyExitException}}),Object.defineProperty(e,"isRecognitionException",{enumerable:!0,get:function(){return o.isRecognitionException}}),Object.defineProperty(e,"MismatchedTokenException",{enumerable:!0,get:function(){return o.MismatchedTokenException}}),Object.defineProperty(e,"NotAllInputParsedException",{enumerable:!0,get:function(){return o.NotAllInputParsedException}}),Object.defineProperty(e,"NoViableAltException",{enumerable:!0,get:function(){return o.NoViableAltException}});var s=Be();Object.defineProperty(e,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return s.defaultLexerErrorProvider}});var c=q();Object.defineProperty(e,"Alternation",{enumerable:!0,get:function(){return c.Alternation}}),Object.defineProperty(e,"Alternative",{enumerable:!0,get:function(){return c.Alternative}}),Object.defineProperty(e,"NonTerminal",{enumerable:!0,get:function(){return c.NonTerminal}}),Object.defineProperty(e,"Option",{enumerable:!0,get:function(){return c.Option}}),Object.defineProperty(e,"Repetition",{enumerable:!0,get:function(){return c.Repetition}}),Object.defineProperty(e,"RepetitionMandatory",{enumerable:!0,get:function(){return c.RepetitionMandatory}}),Object.defineProperty(e,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return c.RepetitionMandatoryWithSeparator}}),Object.defineProperty(e,"RepetitionWithSeparator",{enumerable:!0,get:function(){return c.RepetitionWithSeparator}}),Object.defineProperty(e,"Rule",{enumerable:!0,get:function(){return c.Rule}}),Object.defineProperty(e,"Terminal",{enumerable:!0,get:function(){return c.Terminal}});var l=q();Object.defineProperty(e,"serializeGrammar",{enumerable:!0,get:function(){return l.serializeGrammar}}),Object.defineProperty(e,"serializeProduction",{enumerable:!0,get:function(){return l.serializeProduction}});var u=We();Object.defineProperty(e,"GAstVisitor",{enumerable:!0,get:function(){return u.GAstVisitor}});function d(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API.
138
138
  It performs no action other than printing this message.
139
- Please avoid using it as it will be completely removed in the future`)}i.clearCache=u;var m=Co();Object.defineProperty(i,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return m.createSyntaxDiagramsCode}});var p=(function(){function E(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
140
- See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return E})();i.Parser=p});const Tt=yo();class Bo extends b.Loader{backgroundTexture;fog;constructor(e){super(e)}load(e,t,n,r){this.backgroundTexture=void 0,this.fog=void 0;const o=this,s=o.path===""?b.LoaderUtils.extractUrlBase(e):o.path,c=new b.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 wo(T.tokens),S=new vo(T.tokenVocabulary),w=s(S.getBaseCstVisitorConstructor()),N=B.lex(k);S.input=N.tokens;const M=S.vrml();if(S.errors.length>0)throw console.error(S.errors),Error("THREE.VRMLLoader2: Parsing errors detected.");return w.visit(M)}function o(){const k=Tt.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}),N=k({name:"NodeName",pattern:new RegExp(S.join("|")),longer_alt:B}),M=k({name:"DEF",pattern:/DEF/,longer_alt:B}),U=k({name:"USE",pattern:/USE/,longer_alt:B}),W=k({name:"ROUTE",pattern:/ROUTE/,longer_alt:B}),ne=k({name:"TO",pattern:/TO/,longer_alt:B}),Ae=k({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),me=k({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),xe=k({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),ke=k({name:"TrueLiteral",pattern:/TRUE/}),be=k({name:"FalseLiteral",pattern:/FALSE/}),Te=k({name:"NullLiteral",pattern:/NULL/}),pe=k({name:"LSquare",pattern:/\[/}),Re=k({name:"RSquare",pattern:/]/}),Ge=k({name:"LCurly",pattern:/{/}),Fe=k({name:"RCurly",pattern:/}/}),Le=k({name:"Comment",pattern:/#.*/,group:Tt.Lexer.SKIPPED}),Ke=[k({name:"WhiteSpace",pattern:/[ ,\s]/,group:Tt.Lexer.SKIPPED}),N,M,U,W,ne,ke,be,Te,w,B,T,Ae,me,xe,pe,Re,Ge,Fe,Le],We={};for(let _e=0,ge=Ke.length;_e<ge;_e++){const Ee=Ke[_e];We[Ee.name]=Ee}return{tokens:Ke,tokenVocabulary:We}}function s(k){class T extends k{constructor(){super(),this.validateVisitor()}vrml(w){const N={version:this.visit(w.version),nodes:[],routes:[]};for(let M=0,U=w.node.length;M<U;M++){const W=w.node[M];N.nodes.push(this.visit(W))}if(w.route)for(let M=0,U=w.route.length;M<U;M++){const W=w.route[M];N.routes.push(this.visit(W))}return N}version(w){return w.Version[0].image}node(w){const N={name:w.NodeName[0].image,fields:[]};if(w.field)for(let M=0,U=w.field.length;M<U;M++){const W=w.field[M];N.fields.push(this.visit(W))}return w.def&&(N.DEF=this.visit(w.def[0])),N}field(w){const N={name:w.Identifier[0].image,type:null,values:null};let M;return w.singleFieldValue&&(M=this.visit(w.singleFieldValue[0])),w.multiFieldValue&&(M=this.visit(w.multiFieldValue[0])),N.type=M.type,N.values=M.values,N}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 N={type:null,values:[]};if(w.node){N.type="node";for(let M=0,U=w.node.length;M<U;M++){const W=w.node[M];N.values.push(S.visit(W))}}if(w.use){N.type="use";for(let M=0,U=w.use.length;M<U;M++){const W=w.use[M];N.values.push(S.visit(W))}}if(w.StringLiteral){N.type="string";for(let M=0,U=w.StringLiteral.length;M<U;M++){const W=w.StringLiteral[M];N.values.push(W.image.replace(/'|"/g,""))}}if(w.NumberLiteral){N.type="number";for(let M=0,U=w.NumberLiteral.length;M<U;M++){const W=w.NumberLiteral[M];N.values.push(parseFloat(W.image))}}if(w.HexLiteral){N.type="hex";for(let M=0,U=w.HexLiteral.length;M<U;M++){const W=w.HexLiteral[M];N.values.push(W.image)}}if(w.TrueLiteral){N.type="boolean";for(let M=0,U=w.TrueLiteral.length;M<U;M++)w.TrueLiteral[M].image==="TRUE"&&N.values.push(!0)}if(w.FalseLiteral){N.type="boolean";for(let M=0,U=w.FalseLiteral.length;M<U;M++)w.FalseLiteral[M].image==="FALSE"&&N.values.push(!1)}return w.NullLiteral&&(N.type="null",w.NullLiteral.forEach(function(){N.values.push(null)})),N}return new T}function c(k){const T=k.nodes,B=new b.Scene;for(let S=0,w=T.length;S<w;S++){const N=T[S];A(N)}for(let S=0,w=T.length;S<w;S++){const N=T[S],M=a(N);M instanceof b.Object3D&&B.add(M),N.name==="WorldInfo"&&(B.userData.worldInfo=M)}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 N=w.values;for(let M=0,U=N.length;M<U;M++)A(N[M])}}}function a(k){return k.USE?ae(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=p(k);break;case"Shape":B=E(k);break;case"Appearance":B=g(k);break;case"Material":B=l(k);break;case"ImageTexture":B=I(k);break;case"PixelTexture":B=C(k);break;case"TextureTransform":B=y(k);break;case"IndexedFaceSet":B=R(k);break;case"IndexedLineSet":B=F(k);break;case"PointSet":B=_(k);break;case"Box":B=X(k);break;case"Cone":B=Z(k);break;case"Cylinder":B=V(k);break;case"Sphere":B=$(k);break;case"ElevationGrid":B=ie(k);break;case"Extrusion":B=ue(k);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":B=v(k);break;case"WorldInfo":B=L(k);break;case"DirectionalLight":B=H(k);break;case"PointLight":B=Q(k);break;case"SpotLight":B=P(k);break;case"Fog":B=D(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"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 b.Group,B=k.fields;for(let S=0,w=B.length;S<w;S++){const N=B[S],M=N.name,U=N.values;switch(M){case"bboxCenter":break;case"bboxSize":break;case"center":break;case"children":se(U,T);break;case"description":break;case"collide":break;case"parameter":break;case"rotation":const W=new b.Vector3(U[0],U[1],U[2]).normalize(),ne=U[3];T.quaternion.setFromAxisAngle(W,ne);break;case"scale":T.scale.set(U[0],U[1],U[2]);break;case"scaleOrientation":break;case"translation":T.position.set(U[0],U[1],U[2]);break;case"proxy":break;case"url":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",M);break}}return T}const m=this;function p(k){const T=new b.Group;let B,S,w,N,M,U,W,ne,Ae,me;const xe=k.fields;for(let ke=0,be=xe.length;ke<be;ke++){const Te=xe[ke],pe=Te.name,Re=Te.values;switch(pe){case"groundAngle":B=Re;break;case"groundColor":S=Re;break;case"backUrl":M=Re;break;case"bottomUrl":U=Re;break;case"frontUrl":W=Re;break;case"leftUrl":ne=Re;break;case"rightUrl":Ae=Re;break;case"topUrl":me=Re;break;case"skyAngle":w=Re;break;case"skyColor":N=Re;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",pe);break}}if(M&&U&&W&&ne&&Ae&&me){const ke=new b.CubeTextureLoader(m.manager);m.backgroundTexture=ke.load([Ae[0],ne[0],me[0],U[0],W[0],M[0]])}else{if(N){const ke=[];for(let be=0;be<N.length;be+=3)ke.push([N[be],N[be+1],N[be+2]]);N=ke}if(S){const ke=[];for(let be=0;be<S.length;be+=3)ke.push([S[be],S[be+1],S[be+2]]);S=ke}this.backgroundTexture=new Qo({skyColor:N,skyAngle:w,groundColor:S,groundAngle:B}).buildTexture()}return T}function E(k){const T=k.fields;let B=new b.MeshBasicMaterial({name:b.Loader.DEFAULT_MATERIAL_NAME,color:0}),S;for(let N=0,M=T.length;N<M;N++){const U=T[N],W=U.name,ne=U.values;switch(W){case"appearance":ne[0]!==null&&(B=a(ne[0]));break;case"geometry":ne[0]!==null&&(S=a(ne[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}let w;if(S&&S.attributes.position){const N=S._type;if(N==="points"){const M=new b.PointsMaterial({name:b.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:B.opacity,transparent:B.transparent});S.attributes.color!==void 0?M.vertexColors=!0:B.isMeshPhongMaterial&&M.color.copy(B.emissive),w=new b.Points(S,M)}else if(N==="line"){const M=new b.LineBasicMaterial({name:b.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:B.opacity,transparent:B.transparent});S.attributes.color!==void 0?M.vertexColors=!0:B.isMeshPhongMaterial&&M.color.copy(B.emissive),w=new b.LineSegments(S,M)}else S._solid!==void 0&&(B.side=S._solid?b.FrontSide:b.DoubleSide),S.attributes.color!==void 0&&(B.vertexColors=!0),w=new b.Mesh(S,B)}else w=new b.Object3D,w.visible=!1;return w}function g(k){let T=new b.MeshPhongMaterial,B;const S=k.fields;for(let w=0,N=S.length;w<N;w++){const M=S[w],U=M.name,W=M.values;switch(U){case"material":if(W[0]!==null){const Ae=a(W[0]);Ae.diffuseColor&&T.color.copy(Ae.diffuseColor),Ae.emissiveColor&&T.emissive.copy(Ae.emissiveColor),Ae.shininess&&(T.shininess=Ae.shininess),Ae.specularColor&&T.specular.copy(Ae.specularColor),Ae.transparency&&(T.opacity=1-Ae.transparency),Ae.transparency>0&&(T.transparent=!0)}else T=new b.MeshBasicMaterial({name:b.Loader.DEFAULT_MATERIAL_NAME,color:0});break;case"texture":const ne=W[0];ne!==null&&(ne.name==="ImageTexture"||ne.name==="PixelTexture"||ne.USE)&&(T.map=a(ne));break;case"textureTransform":W[0]!==null&&(B=a(W[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",U);break}}if(T.map){if(T.map.__type){switch(T.map.__type){case it.INTENSITY_ALPHA:T.opacity=1;break;case it.RGB:T.color.set(16777215);break;case it.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.map&&T.map.fookHolder&&T.map.fookHolder.fooks.push(async w=>{const N=await ko(w.source.data);T.transparent=N,T.needsUpdate=N}),T}function l(k){const T={},B=k.fields;for(let S=0,w=B.length;S<w;S++){const N=B[S],M=N.name,U=N.values;switch(M){case"ambientIntensity":break;case"diffuseColor":T.diffuseColor=new b.Color().setRGB(U[0],U[1],U[2],b.SRGBColorSpace);break;case"emissiveColor":T.emissiveColor=new b.Color().setRGB(U[0],U[1],U[2],b.SRGBColorSpace);break;case"shininess":T.shininess=U[0];break;case"specularColor":T.specularColor=new b.Color().setRGB(U[0],U[1],U[2],b.SRGBColorSpace);break;case"transparency":T.transparency=U[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",M);break}}return T}function d(k,T,B){let S;switch(T){case it.INTENSITY:S=parseInt(k),B.r=S,B.g=S,B.b=S,B.a=1;break;case it.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 it.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 it.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 f(k){let T;switch(k){case 1:T=it.INTENSITY;break;case 2:T=it.INTENSITY_ALPHA;break;case 3:T=it.RGB;break;case 4:T=it.RGBA;break}return T}function C(k){let T,B=b.RepeatWrapping,S=b.RepeatWrapping;const w=k.fields;for(let N=0,M=w.length;N<M;N++){const U=w[N],W=U.name,ne=U.values;switch(W){case"image":const Ae=ne[0],me=ne[1],xe=ne[2],ke=f(xe),be=new Uint8Array(4*Ae*me),Te={r:0,g:0,b:0,a:0};for(let pe=3,Re=0,Ge=ne.length;pe<Ge;pe++,Re++){d(ne[pe],ke,Te);const Fe=Re*4;be[Fe+0]=Te.r,be[Fe+1]=Te.g,be[Fe+2]=Te.b,be[Fe+3]=Te.a}T=new b.DataTexture(be,Ae,me),T.colorSpace=b.SRGBColorSpace,T.needsUpdate=!0,T.__type=ke;break;case"repeatS":ne[0]===!1&&(B=b.ClampToEdgeWrapping);break;case"repeatT":ne[0]===!1&&(S=b.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}return T&&(T.wrapS=B,T.wrapT=S),T}function I(k){let T,B=b.RepeatWrapping,S=b.RepeatWrapping;const w=k.fields;for(let N=0,M=w.length;N<M;N++){const U=w[N],W=U.name,ne=U.values;switch(W){case"url":const Ae=ne[0],me={fooks:[]},xe=ke=>{me.fooks&&me.fooks.map(be=>be(ke))};Ae&&(T=ye.load(Ae,xe)),T&&(T.fookHolder=me);break;case"repeatS":ne[0]===!1&&(B=b.ClampToEdgeWrapping);break;case"repeatT":ne[0]===!1&&(S=b.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}return T&&(T.wrapS=B,T.wrapT=S,T.colorSpace=b.SRGBColorSpace),T}function y(k){const T={center:new b.Vector2,rotation:0,scale:new b.Vector2(1,1),translation:new b.Vector2},B=k.fields;for(let S=0,w=B.length;S<w;S++){const N=B[S],M=N.name,U=N.values;switch(M){case"center":T.center.set(U[0],U[1]);break;case"rotation":T.rotation=U[0];break;case"scale":T.scale.set(U[0],U[1]);break;case"translation":T.translation.set(U[0],U[1]);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",M);break}}return T}function v(k){return k.fields[0]?k.fields[0].values:{}}function L(k){const T={},B=k.fields;for(let S=0,w=B.length;S<w;S++){const N=B[S],M=N.name,U=N.values;switch(M){case"title":T.title=U[0];break;case"info":T.info=U;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",M);break}}return T}function H(k){let T=0;const B=new b.Color(1,1,1),S=new b.Vector3(0,0,-1);let w=1,N=!0;const M=k.fields;for(let Ae=0,me=M.length;Ae<me;Ae++){const xe=M[Ae],ke=xe.name,be=xe.values;switch(ke){case"ambientIntensity":T=be[0];break;case"color":B.set(be[0],be[1],be[2]);break;case"direction":S.set(be[0],be[1],be[2]);break;case"intensity":w=be[0];break;case"on":N=be[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",ke);break}}w=N?w:0;const U=new b.Object3D,W=new b.DirectionalLight(B,w);S.normalize(),S.multiplyScalar(-10),W.position.copy(S),U.add(W);const ne=new b.AmbientLight(B,w*T);return U.add(ne),U}function Q(k){let T=0;const B=new b.Vector3(1,0,0),S=new b.Color(1,1,1);let w=1;const N=new b.Vector3(0,0,0);let M=!0,U=100;const W=k.fields;for(let xe=0,ke=W.length;xe<ke;xe++){const be=W[xe],Te=be.name,pe=be.values;switch(Te){case"ambientIntensity":T=pe[0];break;case"attenuation":B.set(pe[0],pe[1],pe[2]);break;case"color":S.set(pe[0],pe[1],pe[2]);break;case"intensity":w=pe[0];break;case"location":N.set(pe[0],pe[1],pe[2]);break;case"on":M=pe[0];break;case"radius":U=pe[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",Te);break}}w=M?w:0;const ne=new b.Object3D,Ae=new b.PointLight(S,w,U);Ae.position.copy(N),Ae.decay=2,ne.add(Ae);const me=new b.AmbientLight(S,w*T);return ne.add(me),ne}function P(k){let T=0;const B=new b.Vector3(1,0,0);let S=1.570796;const w=new b.Color(1,1,1);let N=.785398;const M=new b.Vector3(0,0,-1);let U=1;const W=new b.Vector3(0,0,-1);let ne=!0,Ae=100;const me=k.fields;for(let pe=0,Re=me.length;pe<Re;pe++){const Ge=me[pe],Fe=Ge.name,Le=Ge.values;switch(Fe){case"ambientIntensity":T=Le[0];break;case"attenuation":B.set(Le[0],Le[1],Le[2]);break;case"beamWidth":S=Le[0];break;case"color":w.set(Le[0],Le[1],Le[2]);break;case"cutOffAngle":N=Le[0];break;case"direction":M.set(Le[0],Le[1],Le[2]);break;case"intensity":U=Le[0];break;case"location":W.set(Le[0],Le[1],Le[2]);break;case"on":ne=Le[0];break;case"radius":Ae=Le[0];break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",Fe);break}}U=ne?U:0;const xe=new b.Object3D;S=S>N?N:S;const ke=1-S/N,be=new b.SpotLight(w,U,Ae,N,ke);M.normalize(),be.position.copy(M),be.decay=0,xe.add(be);const Te=new b.AmbientLight(w,U*T);return xe.add(Te),xe.position.copy(W),xe}function D(k){const T=new b.Color(1,1,1);let B="LINEAR",S=0;const w=k.fields;for(let N=0,M=w.length;N<M;N++){const U=w[N],W=U.name,ne=U.values;switch(W){case"color":T.set(ne[0],ne[1],ne[2]);break;case"fogType":B=ne[0];break;case"visibilityRange":S=ne[0];break;case"set_bind":break;case"isBound":break;default:console.warn("ThreeMFLoader.VRMLLoader2: Unknown field:",W);break}}if(B==="LINEAR")m.fog=new b.Fog(T,0,S);else if(B==="EXPONENTIAL"){let N=.02;S!==0&&(N=2.146/S),m.fog=new b.FogExp2(T,N)}else console.warn("ThreeMFLoader.VRMLLoader2: Unknown fogType:",B);return new b.Object3D}function R(k){let T,B,S,w,N=!0,M=!0,U=0,W,ne,Ae,me,xe=!0,ke=!0;const be=k.fields;for(let He=0,Ke=be.length;He<Ke;He++){const We=be[He],_e=We.name,ge=We.values;switch(_e){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 Ie=ge[0];Ie!==null&&(S=a(Ie));break;case"texCoord":const Ce=ge[0];Ce!==null&&(w=a(Ce));break;case"ccw":N=ge[0];break;case"colorIndex":W=ge;break;case"colorPerVertex":xe=ge[0];break;case"convex":break;case"coordIndex":ne=ge;break;case"creaseAngle":U=ge[0];break;case"normalIndex":Ae=ge;break;case"normalPerVertex":ke=ge[0];break;case"solid":M=ge[0];break;case"texCoordIndex":me=ge;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",_e);break}}if(ne===void 0)return console.warn("THREE.VRMLLoader2: Missing coordIndex."),new b.BufferGeometry;const Te=ee(ne,N);let pe,Re,Ge;if(T){if(xe===!0)if(W&&W.length>0){const He=ee(W,N);pe=ze(Te,He,T,3)}else pe=O(Te,new b.Float32BufferAttribute(T,3));else if(W&&W.length>0){const He=G(T,W),Ke=de(He,ne);pe=Je(Te,Ke)}else{const He=de(T,ne);pe=Je(Te,He)}Qe(pe)}if(S)if(ke===!0)if(Ae&&Ae.length>0){const He=ee(Ae,N);Re=ze(Te,He,S,3)}else Re=O(Te,new b.Float32BufferAttribute(S,3));else if(Ae&&Ae.length>0){const He=G(S,Ae),Ke=de(He,ne);Re=Je(Te,Ke)}else{const He=de(S,ne);Re=Je(Te,He)}else Re=re(Te,B,U);if(w)if(me&&me.length>0){const He=ee(me,N);Ge=ze(Te,He,w,2)}else Ge=O(Te,new b.Float32BufferAttribute(w,2));const Fe=new b.BufferGeometry,Le=O(Te,new b.Float32BufferAttribute(B,3));return Fe.setAttribute("position",Le),Fe.setAttribute("normal",Re),pe&&Fe.setAttribute("color",pe),Ge&&Fe.setAttribute("uv",Ge),Fe._solid=M,Fe._type="mesh",Fe}function F(k){let T,B,S,w,N=!0;const M=k.fields;for(let me=0,xe=M.length;me<xe;me++){const ke=M[me],be=ke.name,Te=ke.values;switch(be){case"color":const pe=Te[0];pe!==null&&(T=a(pe));break;case"coord":const Re=Te[0];Re!==null&&(B=a(Re));break;case"colorIndex":S=Te;break;case"colorPerVertex":N=Te[0];break;case"coordIndex":w=Te;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",be);break}}let U;const W=j(w);if(T){if(N===!0)if(S.length>0){const me=j(S);U=ze(W,me,T,3)}else U=O(W,new b.Float32BufferAttribute(T,3));else if(S.length>0){const me=G(T,S),xe=Y(me,w);U=Ve(W,xe)}else{const me=Y(T,w);U=Ve(W,me)}Qe(U)}const ne=new b.BufferGeometry,Ae=O(W,new b.Float32BufferAttribute(B,3));return ne.setAttribute("position",Ae),U&&ne.setAttribute("color",U),ne._type="line",ne}function _(k){let T,B;const S=k.fields;for(let N=0,M=S.length;N<M;N++){const U=S[N],W=U.name,ne=U.values;switch(W){case"color":const Ae=ne[0];Ae!==null&&(T=a(Ae));break;case"coord":const me=ne[0];me!==null&&(B=a(me));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}const w=new b.BufferGeometry;if(w.setAttribute("position",new b.Float32BufferAttribute(B,3)),T){const N=new b.Float32BufferAttribute(T,3);Qe(N),w.setAttribute("color",N)}return w._type="points",w}function X(k){const T=new b.Vector3(2,2,2),B=k.fields;for(let w=0,N=B.length;w<N;w++){const M=B[w],U=M.name,W=M.values;U==="size"?(T.x=W[0],T.y=W[1],T.z=W[2]):console.warn("THREE.VRMLLoader2: Unknown field:",U)}return new b.BoxGeometry(T.x,T.y,T.z)}function Z(k){let T=1,B=2,S=!1;const w=k.fields;for(let M=0,U=w.length;M<U;M++){const W=w[M],ne=W.name,Ae=W.values;switch(ne){case"bottom":S=!Ae[0];break;case"bottomRadius":T=Ae[0];break;case"height":B=Ae[0];break;case"side":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",ne);break}}return new b.ConeGeometry(T,B,16,1,S)}function V(k){let T=1,B=2;const S=k.fields;for(let N=0,M=S.length;N<M;N++){const U=S[N],W=U.name,ne=U.values;switch(W){case"bottom":break;case"radius":T=ne[0];break;case"height":B=ne[0];break;case"side":break;case"top":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",W);break}}return new b.CylinderGeometry(T,T,B,16,1)}function $(k){let T=1;const B=k.fields;for(let w=0,N=B.length;w<N;w++){const M=B[w],U=M.name,W=M.values;U==="radius"?T=W[0]:console.warn("THREE.VRMLLoader2: Unknown field:",U)}return new b.SphereGeometry(T,16,16)}function ie(k){let T,B,S,w,N=!0,M=!0,U=!0,W=!0,ne=0,Ae=2,me=2,xe=1,ke=1;const be=k.fields;for(let ge=0,Ee=be.length;ge<Ee;ge++){const he=be[ge],Ie=he.name,Ce=he.values;switch(Ie){case"color":const je=Ce[0];je!==null&&(T=a(je));break;case"normal":const ct=Ce[0];ct!==null&&(B=a(ct));break;case"texCoord":const lt=Ce[0];lt!==null&&(S=a(lt));break;case"height":w=Ce;break;case"ccw":W=Ce[0];break;case"colorPerVertex":N=Ce[0];break;case"creaseAngle":ne=Ce[0];break;case"normalPerVertex":M=Ce[0];break;case"solid":U=Ce[0];break;case"xDimension":Ae=Ce[0];break;case"xSpacing":xe=Ce[0];break;case"zDimension":me=Ce[0];break;case"zSpacing":ke=Ce[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Ie);break}}const Te=[],pe=[],Re=[],Ge=[];for(let ge=0;ge<me;ge++)for(let Ee=0;Ee<Ae;Ee++){const he=ge*Ae+Ee,Ie=xe*ge,Ce=w[he],je=ke*Ee;if(Te.push(Ie,Ce,je),T&&N===!0){const ct=T[he*3+0],lt=T[he*3+1],Vt=T[he*3+2];Re.push(ct,lt,Vt)}if(B&&M===!0){const ct=B[he*3+0],lt=B[he*3+1],Vt=B[he*3+2];pe.push(ct,lt,Vt)}if(S){const ct=S[he*2+0],lt=S[he*2+1];Ge.push(ct,lt)}else Ge.push(ge/(Ae-1),Ee/(me-1))}const Fe=[];for(let ge=0;ge<Ae-1;ge++)for(let Ee=0;Ee<me-1;Ee++){const he=ge+Ee*Ae,Ie=ge+(Ee+1)*Ae,Ce=ge+1+(Ee+1)*Ae,je=ge+1+Ee*Ae;W===!0?(Fe.push(he,Ce,Ie),Fe.push(Ce,he,je)):(Fe.push(he,Ie,Ce),Fe.push(Ce,je,he))}const Le=O(Fe,new b.Float32BufferAttribute(Te,3)),He=O(Fe,new b.Float32BufferAttribute(Ge,2));let Ke,We;if(T){if(N===!1){for(let ge=0;ge<Ae-1;ge++)for(let Ee=0;Ee<me-1;Ee++){const he=ge+Ee*(Ae-1),Ie=T[he*3+0],Ce=T[he*3+1],je=T[he*3+2];Re.push(Ie,Ce,je),Re.push(Ie,Ce,je),Re.push(Ie,Ce,je),Re.push(Ie,Ce,je),Re.push(Ie,Ce,je),Re.push(Ie,Ce,je)}Ke=new b.Float32BufferAttribute(Re,3)}else Ke=O(Fe,new b.Float32BufferAttribute(Re,3));Qe(Ke)}if(B)if(M===!1){for(let ge=0;ge<Ae-1;ge++)for(let Ee=0;Ee<me-1;Ee++){const he=ge+Ee*(Ae-1),Ie=B[he*3+0],Ce=B[he*3+1],je=B[he*3+2];pe.push(Ie,Ce,je),pe.push(Ie,Ce,je),pe.push(Ie,Ce,je),pe.push(Ie,Ce,je),pe.push(Ie,Ce,je),pe.push(Ie,Ce,je)}We=new b.Float32BufferAttribute(pe,3)}else We=O(Fe,new b.Float32BufferAttribute(pe,3));else We=re(Fe,Te,ne);const _e=new b.BufferGeometry;return _e.setAttribute("position",Le),_e.setAttribute("normal",We),_e.setAttribute("uv",He),Ke&&_e.setAttribute("color",Ke),_e._solid=U,_e._type="mesh",_e}function ue(k){let T=[1,1,1,-1,-1,-1,-1,1,1,1],B=[0,0,0,0,1,0],S,w,N=!0,M=!0,U=0,W=!0,ne=!0;const Ae=k.fields;for(let _e=0,ge=Ae.length;_e<ge;_e++){const Ee=Ae[_e],he=Ee.name,Ie=Ee.values;switch(he){case"beginCap":N=Ie[0];break;case"ccw":M=Ie[0];break;case"convex":break;case"creaseAngle":U=Ie[0];break;case"crossSection":T=Ie;break;case"endCap":W=Ie[0];break;case"orientation":w=Ie;break;case"scale":S=Ie;break;case"solid":ne=Ie[0];break;case"spine":B=Ie;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",he);break}}const me=T[0]===T[T.length-2]&&T[1]===T[T.length-1],xe=[],ke=new b.Vector3,be=new b.Vector3,Te=new b.Vector3,pe=new b.Vector3,Re=new b.Quaternion;for(let _e=0,ge=0,Ee=0,he=B.length;_e<he;_e+=3,ge+=2,Ee+=4){ke.fromArray(B,_e),be.x=S?S[ge+0]:1,be.y=1,be.z=S?S[ge+1]:1,Te.x=w?w[Ee+0]:0,Te.y=w?w[Ee+1]:0,Te.z=w?w[Ee+2]:1;const Ie=w?w[Ee+3]:0;for(let Ce=0,je=T.length;Ce<je;Ce+=2)pe.x=T[Ce+0],pe.y=0,pe.z=T[Ce+1],pe.multiply(be),Re.setFromAxisAngle(Te,Ie),pe.applyQuaternion(Re),pe.add(ke),xe.push(pe.x,pe.y,pe.z)}const Ge=[],Fe=B.length/3,Le=T.length/2;for(let _e=0;_e<Fe-1;_e++)for(let ge=0;ge<Le-1;ge++){const Ee=ge+_e*Le;let he=ge+1+_e*Le;const Ie=ge+(_e+1)*Le;let Ce=ge+1+(_e+1)*Le;ge===Le-2&&me===!0&&(he=_e*Le,Ce=(_e+1)*Le),M===!0?(Ge.push(Ee,he,Ie),Ge.push(Ie,he,Ce)):(Ge.push(Ee,Ie,he),Ge.push(Ie,Ce,he))}if(N===!0||W===!0){const _e=[];for(let he=0,Ie=T.length;he<Ie;he+=2)_e.push(new b.Vector2(T[he],T[he+1]));const ge=b.ShapeUtils.triangulateShape(_e,[]),Ee=[];for(let he=0,Ie=ge.length;he<Ie;he++){const Ce=ge[he];Ee.push(Ce[0],Ce[1],Ce[2])}if(N===!0)for(let he=0,Ie=Ee.length;he<Ie;he+=3)M===!0?Ge.push(Ee[he+0],Ee[he+1],Ee[he+2]):Ge.push(Ee[he+0],Ee[he+2],Ee[he+1]);if(W===!0){const he=Le*(Fe-1);for(let Ie=0,Ce=Ee.length;Ie<Ce;Ie+=3)M===!0?Ge.push(he+Ee[Ie+0],he+Ee[Ie+2],he+Ee[Ie+1]):Ge.push(he+Ee[Ie+0],he+Ee[Ie+1],he+Ee[Ie+2])}}const He=O(Ge,new b.Float32BufferAttribute(xe,3)),Ke=re(Ge,xe,U),We=new b.BufferGeometry;return We.setAttribute("position",He),We.setAttribute("normal",Ke),We._solid=ne,We._type="mesh",We}function ae(k){const T=n[k],B=a(T);return B.isObject3D||B.isMaterial?B.clone():B}function se(k,T){for(let B=0,S=k.length;B<S;B++){const w=a(k[B]);w instanceof b.Object3D&&T.add(w)}}function ee(k,T){const B=[];let S=0;for(let w=0,N=k.length;w<N;w++){const M=k[S],U=k[w+(T?1:2)],W=k[w+(T?2:1)];B.push(M,U,W),(k[w+3]===-1||w+3>=N)&&(w+=3,S=w+1)}return B}function de(k,T){const B=[];let S=0;for(let w=0,N=T.length;w<N;w++){const M=S*3,U=k[M],W=k[M+1],ne=k[M+2];B.push(U,W,ne),(T[w+3]===-1||w+3>=N)&&(w+=3,S++)}return B}function G(k,T){const B=[];for(let S=0,w=T.length;S<w;S++){const M=T[S]*3,U=k[M],W=k[M+1],ne=k[M+2];B.push(U,W,ne)}return B}function j(k){const T=[];for(let B=0,S=k.length;B<S;B++){const w=k[B],N=k[B+1];T.push(w,N),(k[B+2]===-1||B+2>=S)&&(B+=2)}return T}function Y(k,T){const B=[];let S=0;for(let w=0,N=T.length;w<N;w++){const M=S*3,U=k[M],W=k[M+1],ne=k[M+2];B.push(U,W,ne),(T[w+2]===-1||w+2>=N)&&(w+=2,S++)}return B}const z=new b.Vector3,te=new b.Vector3,oe=new b.Vector3,Be=new b.Vector2,we=new b.Vector2,De=new b.Vector2;function ze(k,T,B,S){const w=[];for(let N=0,M=k.length;N<M;N+=3){const U=T[N],W=T[N+1],ne=T[N+2];S===2?(Be.fromArray(B,U*S),we.fromArray(B,W*S),De.fromArray(B,ne*S),w.push(Be.x,Be.y),w.push(we.x,we.y),w.push(De.x,De.y)):(z.fromArray(B,U*S),te.fromArray(B,W*S),oe.fromArray(B,ne*S),w.push(z.x,z.y,z.z),w.push(te.x,te.y,te.z),w.push(oe.x,oe.y,oe.z))}return new b.Float32BufferAttribute(w,S)}function Je(k,T){const B=[];for(let S=0,w=0,N=k.length;S<N;S+=3,w++)z.fromArray(T,w*3),B.push(z.x,z.y,z.z),B.push(z.x,z.y,z.z),B.push(z.x,z.y,z.z);return new b.Float32BufferAttribute(B,3)}function Ve(k,T){const B=[];for(let S=0,w=0,N=k.length;S<N;S+=2,w++)z.fromArray(T,w*3),B.push(z.x,z.y,z.z),B.push(z.x,z.y,z.z);return new b.Float32BufferAttribute(B,3)}function O(k,T){const B=T.array,S=T.itemSize,w=new B.constructor(k.length*S);let N=0,M=0;for(let U=0,W=k.length;U<W;U++){N=k[U]*S;for(let ne=0;ne<S;ne++)w[M++]=B[N++]}return new b.Float32BufferAttribute(w,S)}const J=new b.Vector3,q=new b.Vector3;function re(k,T,B){const S=[],w={};for(let M=0,U=k.length;M<U;M+=3){const W=k[M],ne=k[M+1],Ae=k[M+2],me=new Ro(W,ne,Ae);z.fromArray(T,W*3),te.fromArray(T,ne*3),oe.fromArray(T,Ae*3),q.subVectors(oe,te),J.subVectors(z,te),q.cross(J),q.normalize(),me.normal.copy(q),w[W]===void 0&&(w[W]=[]),w[ne]===void 0&&(w[ne]=[]),w[Ae]===void 0&&(w[Ae]=[]),w[W].push(me.normal),w[ne].push(me.normal),w[Ae].push(me.normal),S.push(me)}const N=[];for(let M=0,U=S.length;M<U;M++){const W=S[M],ne=fe(w[W.a],W.normal,B),Ae=fe(w[W.b],W.normal,B),me=fe(w[W.c],W.normal,B);z.fromArray(T,W.a*3),te.fromArray(T,W.b*3),oe.fromArray(T,W.c*3),N.push(ne.x,ne.y,ne.z),N.push(Ae.x,Ae.y,Ae.z),N.push(me.x,me.y,me.z)}return new b.Float32BufferAttribute(N,3)}function fe(k,T,B){const S=new b.Vector3;if(B===0)S.copy(T);else for(let w=0,N=k.length;w<N;w++)k[w].angleTo(T)<B&&S.add(k[w]);return S.normalize()}function Qe(k){const T=new b.Color;for(let B=0;B<k.count;B++)T.fromBufferAttribute(k,B),b.ColorManagement.colorSpaceToWorking(T,b.SRGBColorSpace),k.setXYZ(B,T.r,T.g,T.b)}const ye=new b.TextureLoader(this.manager);if(ye.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),e.indexOf("#VRML V2.0")===-1)throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");const le=r(e);return c(le)}}class wo{constructor(e){this.lexer=new Tt.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 To=Tt.CstParser;class vo extends To{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,m=e.NumberLiteral,p=e.TrueLiteral,E=e.FalseLiteral,g=e.NullLiteral,l=e.DEF,d=e.USE,f=e.ROUTE,C=e.TO,I=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(I),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(I)}}])}),t.RULE("use",function(){t.CONSUME(d),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(I)}}])}),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(m)}},{ALT:function(){t.CONSUME(p)}},{ALT:function(){t.CONSUME(E)}},{ALT:function(){t.CONSUME(g)}}])})}),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(m)}},{ALT:function(){t.CONSUME(g)}}])}),t.CONSUME(c)}),t.RULE("route",function(){t.CONSUME(f),t.CONSUME(a),t.CONSUME(C),t.CONSUME2(a)}),this.performSelfAnalysis()}}class Ro{constructor(e,t,n){this.a=e,this.b=t,this.c=n,this.normal=new b.Vector3}}const it={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};class Qo{constructor({skyColor:e=[[0,0,0]],skyAngle:t=[],groundColor:n=[],groundAngle:r=[],size:o=128}={}){this._skyColor=e,this._skyAngle=t,this._groundColor=n,this._groundAngle=r,this._size=o,this._texture=null}applyToScene(e){e.background=this._buildCubeTexture()}buildTexture(){return this._texture||(this._texture=this._buildCubeTexture()),this._texture}dispose(){this._texture&&(this._texture.dispose(),this._texture=null)}_colorAtPitch(e){const t=Math.PI/2;if(e<=t){if(this._skyAngle.length===0)return this._skyColor[0];if(e<=this._skyAngle[0])return this._lerpColor(this._skyColor[0],this._skyColor[1],e/this._skyAngle[0]);const n=this._skyAngle.length-1;if(e>=this._skyAngle[n])return this._skyColor[n+1]??this._skyColor[this._skyColor.length-1];for(let r=0;r<n;r++)if(e<=this._skyAngle[r+1]){const o=(e-this._skyAngle[r])/(this._skyAngle[r+1]-this._skyAngle[r]);return this._lerpColor(this._skyColor[r+1]??this._skyColor[this._skyColor.length-1],this._skyColor[r+2]??this._skyColor[this._skyColor.length-1],o)}return this._skyColor[this._skyColor.length-1]}else{if(this._groundColor.length===0)return this._skyColor[this._skyColor.length-1];const n=e-t;if(this._groundAngle.length===0)return this._groundColor[0];if(n<=this._groundAngle[0])return this._lerpColor(this._groundColor[0],this._groundColor[1],n/this._groundAngle[0]);const r=this._groundAngle.length-1;if(n>=this._groundAngle[r])return this._groundColor[r+1]??this._groundColor[this._groundColor.length-1];for(let o=0;o<r;o++)if(n<=this._groundAngle[o+1]){const s=(n-this._groundAngle[o])/(this._groundAngle[o+1]-this._groundAngle[o]);return this._lerpColor(this._groundColor[o+1]??this._groundColor[this._groundColor.length-1],this._groundColor[o+2]??this._groundColor[this._groundColor.length-1],s)}return this._groundColor[this._groundColor.length-1]}}_lerpColor(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n]}_buildSideCanvas(){const e=this._size,t=document.createElement("canvas");t.width=e,t.height=e;const n=t.getContext("2d"),r=n.createImageData(e,e),o=r.data;for(let s=0;s<e;s++){const A=1-2*((s+.5)/e);for(let a=0;a<e;a++){const u=2*((a+.5)/e)-1,m=1,p=Math.sqrt(u*u+A*A+m*m),E=Math.acos(Math.max(-1,Math.min(1,A/p))),[g,l,d]=this._colorAtPitch(E),f=(s*e+a)*4;o[f]=Math.round(g*255),o[f+1]=Math.round(l*255),o[f+2]=Math.round(d*255),o[f+3]=255}}return n.putImageData(r,0,0),t}_buildTopCanvas(){const e=this._size,t=document.createElement("canvas");t.width=e,t.height=e;const n=t.getContext("2d"),r=n.createImageData(e,e),o=r.data;for(let s=0;s<e;s++){const c=2*(s+.5)/e-1;for(let A=0;A<e;A++){const a=2*(A+.5)/e-1,h=1,u=Math.sqrt(a*a+h*h+c*c),m=Math.acos(Math.max(-1,Math.min(1,h/u))),[p,E,g]=this._colorAtPitch(m),l=(s*e+A)*4;o[l]=Math.round(p*255),o[l+1]=Math.round(E*255),o[l+2]=Math.round(g*255),o[l+3]=255}}return n.putImageData(r,0,0),t}_buildBottomCanvas(){const e=this._size,t=document.createElement("canvas");t.width=e,t.height=e;const n=t.getContext("2d"),r=n.createImageData(e,e),o=r.data;for(let s=0;s<e;s++){const c=2*(s+.5)/e-1;for(let A=0;A<e;A++){const a=2*(A+.5)/e-1,h=-1,u=Math.sqrt(a*a+h*h+c*c),m=Math.acos(Math.max(-1,Math.min(1,h/u))),[p,E,g]=this._colorAtPitch(m),l=(s*e+A)*4;o[l]=Math.round(p*255),o[l+1]=Math.round(E*255),o[l+2]=Math.round(g*255),o[l+3]=255}}return n.putImageData(r,0,0),t}_buildCubeTexture(){const e=this._buildSideCanvas(),t=this._buildTopCanvas(),n=this._buildBottomCanvas(),r=[e,e,t,n,e,e],o=new b.CubeTexture(r);return o.needsUpdate=!0,o.minFilter=b.LinearMipmapLinearFilter,o.magFilter=b.LinearFilter,o}}async function ko(i){await new Promise((o,s)=>{if(i.complete)return o();i.onload=o,i.onerror=s});const e=document.createElement("canvas"),t=e.getContext("2d");e.width=i.naturalWidth,e.height=i.naturalHeight,t.drawImage(i,0,0);const r=t.getImageData(0,0,e.width,e.height).data;for(let o=3;o<r.length;o+=4)if(r[o]<255)return!0;return!1}class So extends b.Loader{constructor(e){super(e),this.animateBonePositions=!0,this.animateBoneRotations=!0,this.animateBoneScales=!0}load(e,t,n,r){const o=this,s=new b.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(p){c(p)!=="HIERARCHY"&&console.error("THREE.BVHLoader2: HIERARCHY expected.");const E=[],g=r(p,c(p),E);c(p)!=="MOTION"&&console.error("THREE.BVHLoader2: MOTION expected.");let l=c(p).split(/[\s]+/);const d=parseInt(l[1]);isNaN(d)&&console.error("THREE.BVHLoader2: Failed to read number of frames."),l=c(p).split(/[\s]+/);const f=parseFloat(l[2]);isNaN(f)&&console.error("THREE.BVHLoader2: Failed to read frame time.");for(let C=0;C<d;C++)l=c(p).split(/[\s]+/),n(l,C*f,g);return E}function n(p,E,g){if(g.type==="ENDSITE")return;const l={time:E,position:new b.Vector3,rotation:new b.Quaternion,scale:new b.Vector3(1,1,1)};g.frames.push(l);const d=new b.Quaternion,f=new b.Vector3(1,0,0),C=new b.Vector3(0,1,0),I=new b.Vector3(0,0,1);for(let y=0;y<g.channels.length;y++)switch(g.channels[y]){case"Xposition":l.position.x=parseFloat(p.shift().trim());break;case"Yposition":l.position.y=parseFloat(p.shift().trim());break;case"Zposition":l.position.z=parseFloat(p.shift().trim());break;case"Xrotation":d.setFromAxisAngle(f,parseFloat(p.shift().trim())*Math.PI/180),l.rotation.multiply(d);break;case"Yrotation":d.setFromAxisAngle(C,parseFloat(p.shift().trim())*Math.PI/180),l.rotation.multiply(d);break;case"Zrotation":d.setFromAxisAngle(I,parseFloat(p.shift().trim())*Math.PI/180),l.rotation.multiply(d);break;case"Xscale":l.scale.x=parseFloat(p.shift().trim());break;case"Yscale":l.scale.y=parseFloat(p.shift().trim());break;case"Zscale":l.scale.z=parseFloat(p.shift().trim());break;default:console.warn("THREE.BVHLoader2: Invalid channel type.")}for(let y=0;y<g.children.length;y++)n(p,E,g.children[y])}function r(p,E,g){const l={name:"",type:"",frames:[]};g.push(l);let d=E.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(p)!=="{"&&console.error("THREE.BVHLoader2: Expected opening { after type & name"),d=c(p).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 f=new b.Vector3(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));if((isNaN(f.x)||isNaN(f.y)||isNaN(f.z))&&console.error("THREE.BVHLoader2: Invalid values of OFFSET."),l.offset=f,l.type!=="ENDSITE"){d=c(p).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(p);if(C==="}")return l;l.children.push(r(p,C,g))}}function o(p,E){const g=new b.Bone;if(E.push(g),g.position.add(p.offset),g.name=p.name,p.type!=="ENDSITE")for(let l=0;l<p.children.length;l++)g.add(o(p.children[l],E));return g}function s(p){const E=[];for(let g=0;g<p.length;g++){const l=p[g];if(l.type==="ENDSITE")continue;const d=[],f=[],C=[],I=[];for(let y=0;y<l.frames.length;y++){const v=l.frames[y];d.push(v.time),f.push(v.position.x+l.offset.x),f.push(v.position.y+l.offset.y),f.push(v.position.z+l.offset.z),C.push(v.rotation.x),C.push(v.rotation.y),C.push(v.rotation.z),C.push(v.rotation.w),I.push(v.scale.x),I.push(v.scale.y),I.push(v.scale.z)}A.animateBonePositions&&E.push(new b.VectorKeyframeTrack(l.name+".position",d,f)),A.animateBoneRotations&&E.push(new b.QuaternionKeyframeTrack(l.name+".quaternion",d,C)),A.animateBoneScales&&E.push(new b.VectorKeyframeTrack(l.name+".scale",d,I))}return new b.AnimationClip("animation",-1,E)}function c(p){let E;for(;(E=p.shift().trim()).length===0;);return E}const A=this,a=e.split(/[\r\n]+/g),h=t(a),u=[];o(h[0],u);const m=s(h);return{skeleton:new b.Skeleton(u),clip:m}}}async function xo(i,e){const t=new K.LoadingManager;t.setURLModifier(c=>(c.startsWith("./")&&(c=c.substring(2)),URL.createObjectURL(cn(i,c))));const n=new Bo(t),r=await n.loadAsync(e),o=n.backgroundTexture,s=n.fog;return{object3D:r,bgTexture:o,fog:s}}let Kt;async function Lo(i,e){Kt||(Kt=new So);const t=Ot(i,e);return await Kt.parse(t)}function _o(i){const e=i.clip.clone(),t=i.skeleton.bones[0].clone(!0),n=[];t.traverse(o=>{o instanceof K.Bone&&n.push(o)});const r=new K.Skeleton(n);return r.calculateInverses(),{clip:e,skeleton:r}}class Tn{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()===K.InterpolateDiscrete?o=new K.DiscreteInterpolant(n.times,n.values,r):n.ValueTypeName==="quaternion"?o=new K.QuaternionLinearInterpolant(n.times,n.values,r):o=new K.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 ce(A[0],A[1],A[2]);else if(s==="quaternion")c.quat=new Me(A[0],A[1],A[2],A[3]);else if(s==="scale")c.scale=new ce(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}}const Do={type:"audio",autoplay:!1,loop:!1,volume:1,positional:{refDistance:1,maxDistance:1e3,rolloffFactor:1,directional:{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}}};async function No(){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 K.AudioListener;static audioLoader=new K.AudioLoader;ready;options;sound;constructor(e,t={}){super(),this.options=Pt(Do,t),this.ready=this.asyncInit(e)}initObject(){return new K.Object3D}async asyncInit(e){if(this.options.type==="positional"){const t=new K.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 K.Audio(At.listener);t.setVolume(this.options.volume),t.setLoop(this.options.loop),this.sound=t}return this.object3D.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 Dn{isDummy=!0;skeleton=new K.Skeleton([new K.Bone]);clip=new K.AnimationClip("dummy")}const Wt={},mt={};class ln extends bn{loop;sound;soundLoop;soundContinue;backgroundTexture;fog;constructor(e,t,n,r,o=!1,s=!0,c,A){super(e,t),this.loop=n,this.sound=r,this.soundLoop=o,this.soundContinue=s,this.backgroundTexture=c,this.fog=A}enable(e,t){super.enable(e,t),this.sound&&(this.sound.play(),this.loop&&!this.soundContinue&&this.motion.setFinishListener(()=>{this.sound?.play()}),this.loop&&!this.soundLoop&&this.motion.setFinishListener(()=>{this.sound?.play()})),t&&(this.backgroundTexture&&(t.scene.background=this.backgroundTexture,t.scene.environment=this.backgroundTexture),this.fog&&(t.scene.fog=this.fog))}disable(e,t){super.disable(e,t),this.sound&&(this.loop&&this.sound.stop(),this.soundContinue||this.sound.stop(),this.motion.setFinishListener=()=>{})}}class pi extends bt{comment=null;tags=[];profiles=[];thumbnails=[];rdf=null;htmlfile="";constructor(e){super(e)}async asyncInit(e){const t=await ni(e),n=new DOMParser,r=Ot(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,"a3"),A=o.getElementsByTagNameNS(s,"c");A[0]&&(this.comment=A[0].textContent);const a=o.getElementsByTagNameNS(s,"tag");Array.from(a).forEach(f=>{const C=f.getAttribute("name");C&&this.tags.push(C)});const h=o.getElementsByTagNameNS(s,"profile");Array.from(h).forEach(f=>{const C=f.getAttribute("uri");C&&this.profiles.push(C)});const u=o.getElementsByTagNameNS(s,"thumbnail");Array.from(u).forEach(f=>{const C=f.getAttribute("src");if(C){const I=cn(t,C);this.thumbnails.push(I)}});const m=o.getElementsByTagNameNS("http://www.w3.org/1999/02/22-rdf-syntax-ns#","RDF");m[0]&&(this.rdf=m[0]);const p=o.getElementsByTagNameNS(s,"htmlfile");if(p[0]){const f=p[0].getAttribute("src");f&&(this.htmlfile=Ot(t,f))}const E=[],g=o.getElementsByTagNameNS(s,"a"),l={};let d;for(const f of Array.from(g)){const C=f.getAttribute("an");if(C){E.push(C),d||(d=C);let I;const y=f.getAttribute("bvh");if(y&&y!=="none"){const ee=t.zipUrl+"!"+y;Wt[ee]||(Wt[ee]=await Lo(t,y)),I=_o(Wt[ee]),I&&I.clip.tracks.forEach(de=>{de.setInterpolation(K.InterpolateDiscrete)})}else I=new Dn;const v={};I.skeleton.bones.forEach(ee=>{v[ee.name]=ee});const L=f.getAttribute("scale"),H=L?Number(L):1,Q=f.getAttribute("offset"),P=new ce;if(Q){const ee=Q.split(" ");P.set(Number(ee[0]),Number(ee[1]),Number(ee[2]))}const D=f.getAttribute("rot"),R=new ce;if(D){const ee=D.split(" ");R.set(Number(ee[0]),Number(ee[1]),Number(ee[2]))}const F=f.getAttribute("loop")==="true";let _,X;const Z={},V=f.getElementsByTagNameNS(s,"p");for(const ee of Array.from(V)){const de=ee.getAttribute("name"),G=ee.getAttribute("wrl");if(de&&G){const j=t.zipUrl+"!"+G;if(!mt[j]){const oe=await xo(t,G);mt[j]=oe.object3D,oe.bgTexture&&(_=oe.bgTexture),oe.fog&&(X=oe.fog)}const Y=ee.getAttribute("scale");if(Y){const oe=Number(Y);mt[j].scale.set(oe,oe,oe)}const z=ee.getAttribute("rot");if(z){const oe=z.split(" ");mt[j].rotation.set(Number(oe[0])/180*Math.PI,Number(oe[1])/180*Math.PI,Number(oe[2])/180*Math.PI,"ZXY")}const te=ee.getAttribute("offset");if(te){const oe=te.split(" ");mt[j].position.set(Number(oe[0]),Number(oe[1]),Number(oe[2]))}Z[de]=mt[j].clone(!0)}}const $=new K.Object3D;$.add(I.skeleton.bones[0]),I instanceof Dn||gi($,Z),Object.values(Z).forEach(ee=>{$.add(ee)}),$.scale.set(H,H,H),R.scale(Math.PI/180),$.setRotationFromEuler(new K.Euler(R.x,R.y,R.z,"ZXY")),$.position.add(P),$.traverse(ee=>{ee.userData.a3js={objectA3:this}});let ie,ue=!1,ae=!0;const se=f.getElementsByTagNameNS(s,"s");if(se[0]){const ee=se[0].getAttribute("file"),de=se[0].getAttribute("type")||"PointSound",G=se[0].getAttribute("loop")||"false";ue=G==="true";const j=se[0].getAttribute("gain")||"1.0",Y=se[0].getAttribute("offset")||"0.0 0.0 0.0",z=se[0].getAttribute("direction")||"0.0 0.0 1.0";ae=(se[0].getAttribute("continue")||"true")==="true";const oe=Y.split(" ").map(J=>Number(J)),Be=new ce(oe[0],oe[1],oe[2]),we=z.split(" ").map(J=>Number(J)),De=new ce(we[0],we[1],we[2]),ze=de==="PointSound"||de==="ConeSound"?"positional":"audio",O=de==="PointSound"?{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}:{coneInnerAngle:30,coneOuterAngle:90,coneOuterGain:.1};if(ee){const J=cn(t,ee),q=URL.createObjectURL(J),re={type:ze,autoplay:!1,loop:G==="true",volume:Number(j),positional:{directional:O}};ie=await new At(q,re).ready,ie.setPosition(Be),ie.lookAt(De),URL.revokeObjectURL(q),$.add(ie.object3D)}}l[C]=new ln({root:$,bones:v,skeleton:I.skeleton},new Tn(I.clip,C),F,ie,ue,ae,_,X)}}return c[0]&&(c[0].getAttribute("haltActionNo")!==null&&(this.haltActionName=E[Number(c[0].getAttribute("haltActionNo"))]),c[0].getAttribute("walkActionNo")!==null&&(this.walkActionName=E[Number(c[0].getAttribute("walkActionNo"))]),c[0].getAttribute("runActionNo")!==null&&(this.runActionName=E[Number(c[0].getAttribute("runActionNo"))]),c[0].getAttribute("minWalkSpeed")!==null&&(this.minWalkSpeed=Number(c[0].getAttribute("minWalkSpeed"))),c[0].getAttribute("minRunSpeed")!==null&&(this.minRunSpeed=Number(c[0].getAttribute("minRunSpeed")))),d&&this.syncInit(d,l),this}}function gi(i,e){if(jr(i)){const t=e[i.name];t&&(i.add(t),delete e[i.name])}i.children&&i.children.forEach(t=>{gi(t,e)})}class mi{scene;objects;physicsWorld=null;physicsDt=1/60;collisionListener;rapierLines;constructor(){this.scene=new K.Scene,this.objects=[],An.isInitialized&&(this.physicsWorld=An.createWorld({gravity:{x:0,y:-9.81,z:0},timestep:this.physicsDt}))}add(e){if(this.scene.add(e.object3D),this.objects.push(e),e.scene=this,this.physicsWorld&&(e.addOneselfToPhysics(this.physicsWorld),e instanceof bt))for(const t of Object.values(e.actions))t.motion.addOneselfToPhysics(this.physicsWorld);e instanceof pi&&e.currentAction instanceof ln&&(e.currentAction.backgroundTexture&&(this.scene.background=e.currentAction.backgroundTexture,this.scene.environment=e.currentAction.backgroundTexture),e.currentAction.fog&&(this.scene.fog=e.currentAction.fog))}remove(e){this.scene.remove(e.object3D);{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.removeOneselfFromPhysics(this.physicsWorld),e instanceof bt))for(const t of Object.values(e.actions))t.motion.removeOneselfFromPhysics(this.physicsWorld);e instanceof bt&&e.currentAction instanceof ln&&(e.currentAction.backgroundTexture&&(this.scene.background=null,this.scene.environment=null),e.currentAction.fog&&(this.scene.fog=null))}removeAll(){[...this.objects].forEach(t=>{this.remove(t)})}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 In){const{vertices:n,colors:r}=this.physicsWorld.world.debugRender();this.rapierLines.geometry.setAttribute("position",new K.BufferAttribute(n,3)),this.rapierLines.geometry.setAttribute("color",new K.BufferAttribute(r,4))}}for(const t of this.objects)t.update(e)}setPhysicsDebugMode(e){e?(this.rapierLines=new K.LineSegments(new K.BufferGeometry,new K.LineBasicMaterial({vertexColors:!0})),this.scene.add(this.rapierLines)):this.rapierLines&&(this.scene.remove(this.rapierLines),this.rapierLines=void 0)}}class vn extends Oe{view;setView(e){this.view=e}lookAt(e,t,n){const r=new ce;typeof e=="number"?r.set(e,t,n):e instanceof Oe?e.getPosition(r):r.set(e);const o=this.upVector?this.upVector:Oe.defaultUpVector,s=st(this.getPosition(),r,o);s.mul(o.x,o.y,o.z,0),this.setQuat(s)}lookAtNow(e,t,n){const r=new ce;typeof e=="number"?r.set(e,t,n):e instanceof Oe?e.getPosition(r):r.set(e);const o=this.upVector?this.upVector:Oe.defaultUpVector,s=st(this.getPosition(),r,o);s.mul(o.x,o.y,o.z,0),this.setQuatNow(s)}}class zt{view;setView(e){this.view=e}update(e){}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){}}class Ei extends zt{lastMousePosition;dx=0;dy=0;isLeftDown=!1;isRightDown=!1;ctrlKey=!1;deltaY=0;target;constructor(e,t,n){super(),this.lastMousePosition={x:0,y:0},typeof e=="number"?this.target=new ce(e,t,n):this.target=new ce(e)}update(e){if(!this.view)return;const t=this.view.camera.getPosition(),n=this.view.camera.getQuat();if(this.isLeftDown&&!this.ctrlKey){const o=Math.sin(-this.dx*.01),s=Math.cos(-this.dx*.01),c=Math.sin(-this.dy*.01),A=Math.cos(-this.dy*.01),a=new ce(1,0,0).apply(n),h=new ce(0,1,0).apply(n),u=new Me(a.x*c,a.y*c,a.z*c,A),m=new Me(h.x*o,h.y*o,h.z*o,s),p=new ce(t);p.sub(this.target),p.apply(u),p.apply(m),p.add(this.target),t.set(p);const E=st(t,this.target,new ce(0,1,0));E.mul(new Me(0,1,0,0)),n.set(E)}else if(this.isLeftDown){x.v0.set(this.target),x.v0.sub(t);const o=.005*x.v0.length(),s=new ce(1,0,0).apply(n).scale(-this.dx*o),c=new ce(0,1,0).apply(n).scale(this.dy*o);t.add(s),t.add(c),this.target.add(s),this.target.add(c)}if(this.deltaY!==0){const r=new ce(this.target).sub(t);this.deltaY>0?r.scale(.05):this.deltaY<0&&r.scale(-.05),t.add(r)}this.view.camera.setPosition(t),this.view.camera.setQuat(n),this.dx=0,this.dy=0,this.deltaY=0}mouseDown(e){e.button===0?(this.isLeftDown=!0,this.lastMousePosition.x=e.clientX,this.lastMousePosition.y=e.clientY):e.button===2&&(this.isRightDown=!0,this.lastMousePosition.x=e.clientX,this.lastMousePosition.y=e.clientY)}mouseMove(e){this.dx+=e.clientX-this.lastMousePosition.x,this.dy+=e.clientY-this.lastMousePosition.y,this.ctrlKey=e.ctrlKey,this.lastMousePosition.x=e.clientX,this.lastMousePosition.y=e.clientY}mouseUp(e){e.button===0?this.isLeftDown=!1:e.button===2&&(this.isRightDown=!1)}mouseWheel(e){this.deltaY=e.deltaY}}const Fo={speed:.1,angSpeed:.01};class Oo extends zt{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextLoc;_avatarNextQuat;_velY;constructor(e,t){super(),this.options={...Fo,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextLoc=new ce,this._avatarNextQuat=new Me,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&&(x.v0.set(0,this.options.angSpeed,0),this._avatarNextQuat.mul(ht(x.v0,"ZXY",x.q0))),this._keyRight&&(x.v0.set(0,-this.options.angSpeed,0),this._avatarNextQuat.mul(ht(x.v0,"ZXY",x.q0))),t.setPosition(this._avatarNextLoc),t.setQuat(this._avatarNextQuat)}}const Mo={speed:5,angSpeed:.3,jumpSpeed:15};class Po extends zt{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextVel;_avatarNextAngVel;_velY;constructor(e,t){super(),this.options={...Mo,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextVel=new ce,this._avatarNextAngVel=new ce,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(0,this.options.angSpeed,0),this._keyRight&&this._avatarNextAngVel.add(0,-this.options.angSpeed,0),t.setLinearVelocity(this._avatarNextVel),t.setAngularVelocity(this._avatarNextAngVel)}}class Lt{scene;camera;controller;constructor(e){e.setView(this),this.camera=e,this.camera.setAudioListener(At.listener),this.camera.setPosition(0,0,3),this.scene=new mi,this.scene.scene.add(this.camera.object3D),this.controller=new Ei(0,0,0),this.controller.setView(this),this.controller.activate()}replaceScene(e){this.scene.scene.remove(this.camera.object3D),e.scene.add(this.camera.object3D);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()}worldToScreen(e){throw new Error("BaseViewはworldToScreen()は実装していません")}screenToWorld(e,t,n){throw new Error("BaseViewはscreenToWorld()は実装していません")}cameraToScreen(e){throw new Error("BaseViewはcameraToScreen()は実装していません")}screenToCamera(e,t,n){throw new Error("BaseViewはscreenToCamera()は実装していません")}async waitForRender(){throw new Error("BaseViewはwaitForRender()は実装していません")}setShadowMap(e){throw new Error("BaseViewはsetShadowMap()は実装していません")}}class Qt extends vn{camera;headLight;constructor(e){super(),this.camera=e,this.headLight=new K.SpotLight(16777215,1,0,Math.PI/3,0,0),this.headLight.position.set(0,0,0);const t=new K.Object3D;t.position.set(0,0,-10),this.headLight.target=t,this.object3D.add(this.camera),this.object3D.add(this.headLight),this.object3D.add(t)}initObject(){return new K.Object3D}setAudioListener(e){this.camera.add(e)}getHeadLight(){return this.headLight}setAspect(e){Hr(this.camera)&&(this.camera.aspect=e,this.camera.updateProjectionMatrix())}setHeadLight(e){e?this.headLight.intensity=1:this.headLight.intensity=0}calcNDC(e){const t=new K.Vector3(e.x,e.y,e.z);return t.project(this.camera),{x:t.x,y:t.y}}}class Ii extends b.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 b.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 Et=new b.Vector3,Nn=new b.Matrix4,Fn=new b.Matrix4,On=new b.Vector3,Mn=new b.Vector3;class bi{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(E,g){E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),g.parent===null&&g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),Nn.copy(g.matrixWorldInverse),Fn.multiplyMatrices(g.projectionMatrix,Nn),h(E,E,g),this.sortObjects&&p(E)},this.setSize=function(E,g){n=E,r=g,o=n/2,s=r/2,A.style.width=E+"px",A.style.height=g+"px"};function a(E){E.isCSS2DObject&&(E.element.style.display="none");for(let g=0,l=E.children.length;g<l;g++)a(E.children[g])}function h(E,g,l){if(E.visible===!1){a(E);return}if(E.isCSS2DObject){Et.setFromMatrixPosition(E.matrixWorld),Et.applyMatrix4(Fn);const d=Et.z>=-1&&Et.z<=1&&E.layers.test(l.layers)===!0,f=E.element;f.style.display=d===!0?"":"none",d===!0&&(E.onBeforeRender(t,g,l),f.style.transform="translate("+-100*E.center.x+"%,"+-100*E.center.y+"%)translate("+(Et.x*o+o)+"px,"+(-Et.y*s+s)+"px)",f.parentNode!==A&&A.appendChild(f),E.onAfterRender(t,g,l));const C={distanceToCameraSquared:u(l,E)};c.objects.set(E,C)}for(let d=0,f=E.children.length;d<f;d++)h(E.children[d],g,l)}function u(E,g){return On.setFromMatrixPosition(E.matrixWorld),Mn.setFromMatrixPosition(g.matrixWorld),On.distanceToSquared(Mn)}function m(E){const g=[];return E.traverseVisible(function(l){l.isCSS2DObject&&g.push(l)}),g}function p(E){const g=m(E).sort(function(d,f){if(d.renderOrder!==f.renderOrder)return f.renderOrder-d.renderOrder;const C=c.objects.get(d).distanceToCameraSquared,I=c.objects.get(f).distanceToCameraSquared;return C-I}),l=g.length;for(let d=0,f=g.length;d<f;d++)g[d].element.style.zIndex=l-d}}}function Pn(i,e){if(e===b.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===b.TriangleFanDrawMode||e===b.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===b.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 Ci extends b.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new qo(t)}),this.register(function(t){return new zo(t)}),this.register(function(t){return new es(t)}),this.register(function(t){return new ts(t)}),this.register(function(t){return new ns(t)}),this.register(function(t){return new Ko(t)}),this.register(function(t){return new Wo(t)}),this.register(function(t){return new Yo(t)}),this.register(function(t){return new Jo(t)}),this.register(function(t){return new Ho(t)}),this.register(function(t){return new Xo(t)}),this.register(function(t){return new Vo(t)}),this.register(function(t){return new $o(t)}),this.register(function(t){return new Zo(t)}),this.register(function(t){return new Uo(t)}),this.register(function(t){return new is(t)}),this.register(function(t){return new rs(t)})}load(e,t,n,r){const o=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const a=b.LoaderUtils.extractUrlBase(e);s=b.LoaderUtils.resolveURL(a,this.path)}else s=b.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 b.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))===yi){try{s[Se.KHR_BINARY_GLTF]=new os(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 Es(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],m=o.extensionsRequired||[];switch(u){case Se.KHR_MATERIALS_UNLIT:s[u]=new jo;break;case Se.KHR_DRACO_MESH_COMPRESSION:s[u]=new ss(o,this.dracoLoader);break;case Se.KHR_TEXTURE_TRANSFORM:s[u]=new as;break;case Se.KHR_MESH_QUANTIZATION:s[u]=new As;break;default:m.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 Go(){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 Uo{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 b.Color(16777215);A.color!==void 0&&h.setRGB(A.color[0],A.color[1],A.color[2],b.LinearSRGBColorSpace);const u=A.range!==void 0?A.range:0;switch(A.type){case"directional":a=new b.DirectionalLight(h),a.target.position.set(0,0,-1),a.add(a.target);break;case"point":a=new b.PointLight(h),a.distance=u;break;case"spot":a=new b.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 jo{constructor(){this.name=Se.KHR_MATERIALS_UNLIT}getMaterialType(){return b.MeshBasicMaterial}extendParams(e,t,n){const r=[];e.color=new b.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],b.LinearSRGBColorSpace),e.opacity=s[3]}o.baseColorTexture!==void 0&&r.push(n.assignTexture(e,"map",o.baseColorTexture,b.SRGBColorSpace))}return Promise.all(r)}}class Ho{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 qo{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:b.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 b.Vector2(c,c)}return Promise.all(o)}}class zo{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:b.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 Vo{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:b.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 Ko{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:b.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 b.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],b.LinearSRGBColorSpace)}return s.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&o.push(n.assignTexture(t,"sheenColorMap",s.sheenColorTexture,b.SRGBColorSpace)),s.sheenRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(o)}}class Wo{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:b.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 Yo{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:b.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 b.Color().setRGB(c[0],c[1],c[2],b.LinearSRGBColorSpace),Promise.all(o)}}class Jo{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:b.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 Xo{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:b.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 b.Color().setRGB(c[0],c[1],c[2],b.LinearSRGBColorSpace),s.specularColorTexture!==void 0&&o.push(n.assignTexture(t,"specularColorMap",s.specularColorTexture,b.SRGBColorSpace)),Promise.all(o)}}class Zo{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:b.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 $o{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:b.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 es{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 ts{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 ns{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 is{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,m=new Uint8Array(c,A,a);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(h,u,m,r.mode,r.filter).then(function(p){return p.buffer}):s.ready.then(function(){const p=new ArrayBuffer(h*u);return s.decodeGltfBuffer(new Uint8Array(p),h,u,m,r.mode,r.filter),p})})}else return null}}class rs{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],m=a[0].count,p=[];for(const E of u){const g=new b.Matrix4,l=new b.Vector3,d=new b.Quaternion,f=new b.Vector3(1,1,1),C=new b.InstancedMesh(E.geometry,E.material,m);for(let I=0;I<m;I++)A.TRANSLATION&&l.fromBufferAttribute(A.TRANSLATION,I),A.ROTATION&&d.fromBufferAttribute(A.ROTATION,I),A.SCALE&&f.fromBufferAttribute(A.SCALE,I),C.setMatrixAt(I,g.compose(l,d,f));for(const I in A)if(I==="_COLOR_0"){const y=A[I];C.instanceColor=new b.InstancedBufferAttribute(y.array,y.itemSize,y.normalized)}else I!=="TRANSLATION"&&I!=="ROTATION"&&I!=="SCALE"&&E.geometry.setAttribute(I,A[I]);b.Object3D.prototype.copy.call(C,E),this.parser.assignFinalMaterial(C),p.push(C)}return h.isGroup?(h.clear(),h.add(...p),h):p[0]}))}}const yi="glTF",Bt=12,Gn={JSON:1313821514,BIN:5130562};class os{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!==yi)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===Gn.JSON){const a=new Uint8Array(e,Bt+s,c);this.content=n.decode(a)}else if(A===Gn.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 ss{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=un[h]||h.toLowerCase();c[u]=s[h]}for(const h in e.attributes){const u=un[h]||h.toLowerCase();if(s[h]!==void 0){const m=n.accessors[e.attributes[h]],p=Ct[m.componentType];a[u]=p.name,A[u]=m.normalized===!0}}return t.getDependency("bufferView",o).then(function(h){return new Promise(function(u,m){r.decodeDracoFile(h,function(p){for(const E in p.attributes){const g=p.attributes[E],l=A[E];l!==void 0&&(g.normalized=l)}u(p)},c,a,b.LinearSRGBColorSpace,m)})})}}class as{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 As{constructor(){this.name=Se.KHR_MESH_QUANTIZATION}}class Bi extends b.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,m=u*u,p=m*u,E=e*a,g=E-a,l=-2*p+3*m,d=p-m,f=1-l,C=d-m+u;for(let I=0;I!==c;I++){const y=s[g+I+c],v=s[g+I+A]*h,L=s[E+I+c],H=s[E+I]*h;o[I]=f*y+C*v+l*L+d*H}return o}}const cs=new b.Quaternion;class ls extends Bi{interpolate_(e,t,n,r){const o=super.interpolate_(e,t,n,r);return cs.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},Ct={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Un={9728:b.NearestFilter,9729:b.LinearFilter,9984:b.NearestMipmapNearestFilter,9985:b.LinearMipmapNearestFilter,9986:b.NearestMipmapLinearFilter,9987:b.LinearMipmapLinearFilter},jn={33071:b.ClampToEdgeWrapping,33648:b.MirroredRepeatWrapping,10497:b.RepeatWrapping},Yt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},un={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"},us={CUBICSPLINE:void 0,LINEAR:b.InterpolateLinear,STEP:b.InterpolateDiscrete},Jt={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function hs(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new b.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:b.FrontSide})),i.DefaultMaterial}function dt(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 ds(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 m=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):i.attributes.position;s.push(m)}if(r){const m=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):i.attributes.normal;c.push(m)}if(o){const m=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):i.attributes.color;A.push(m)}}return Promise.all([Promise.all(s),Promise.all(c),Promise.all(A)]).then(function(a){const h=a[0],u=a[1],m=a[2];return n&&(i.morphAttributes.position=h),r&&(i.morphAttributes.normal=u),o&&(i.morphAttributes.color=m),i.morphTargetsRelative=!0,i})}function fs(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 ps(i){let e;const t=i.extensions&&i.extensions[Se.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Xt(t.attributes):e=i.indices+":"+Xt(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,r=i.targets.length;n<r;n++)e+=":"+Xt(i.targets[n]);return e}function Xt(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 hn(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 gs(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 ms=new b.Matrix4;class Es{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Go,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 b.TextureLoader(this.options.manager):this.textureLoader=new b.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new b.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 dt(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(b.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=Yt[r.type],c=Ct[r.componentType],A=r.normalized===!0,a=new c(r.count*s);return Promise.resolve(new b.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=Yt[r.type],a=Ct[r.componentType],h=a.BYTES_PER_ELEMENT,u=h*A,m=r.byteOffset||0,p=r.bufferView!==void 0?n.bufferViews[r.bufferView].byteStride:void 0,E=r.normalized===!0;let g,l;if(p&&p!==u){const d=Math.floor(m/p),f="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+d+":"+r.count;let C=t.cache.get(f);C||(g=new a(c,d*p,r.count*p/h),C=new b.InterleavedBuffer(g,p/h),t.cache.add(f,C)),l=new b.InterleavedBufferAttribute(C,A,m%p/h,E)}else c===null?g=new a(r.count*A):g=new a(c,m,r.count*A),l=new b.BufferAttribute(g,A,E);if(r.sparse!==void 0){const d=Yt.SCALAR,f=Ct[r.sparse.indices.componentType],C=r.sparse.indices.byteOffset||0,I=r.sparse.values.byteOffset||0,y=new f(s[1],C,r.sparse.count*d),v=new a(s[2],I,r.sparse.count*A);c!==null&&(l=new b.BufferAttribute(l.array.slice(),l.itemSize,l.normalized)),l.normalized=!1;for(let L=0,H=y.length;L<H;L++){const Q=y[L];if(l.setX(Q,v[L*A]),A>=2&&l.setY(Q,v[L*A+1]),A>=3&&l.setZ(Q,v[L*A+2]),A>=4&&l.setW(Q,v[L*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}l.normalized=E}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 m=(o.samplers||{})[s.sampler]||{};return h.magFilter=Un[m.magFilter]||b.LinearFilter,h.minFilter=Un[m.minFilter]||b.LinearMipmapLinearFilter,h.wrapS=jn[m.wrapS]||b.RepeatWrapping,h.wrapT=jn[m.wrapT]||b.RepeatWrapping,h.generateMipmaps=!h.isCompressedTexture&&h.minFilter!==b.NearestFilter&&h.minFilter!==b.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 m=new Blob([u],{type:s.mimeType});return A=c.createObjectURL(m),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(m,p){let E=m;t.isImageBitmapLoader===!0&&(E=function(g){const l=new b.Texture(g);l.needsUpdate=!0,m(l)}),t.load(b.LoaderUtils.resolveURL(u,o.path),E,void 0,p)})}).then(function(u){return a===!0&&c.revokeObjectURL(A),rt(u,s),u.userData.mimeType=s.mimeType||gs(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 b.PointsMaterial,b.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 b.LineBasicMaterial,b.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 b.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 b.Color(1,1,1),c.opacity=1,Array.isArray(u.baseColorFactor)){const m=u.baseColorFactor;c.color.setRGB(m[0],m[1],m[2],b.LinearSRGBColorSpace),c.opacity=m[3]}u.baseColorTexture!==void 0&&a.push(t.assignTexture(c,"map",u.baseColorTexture,b.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(m){return m.getMaterialType&&m.getMaterialType(e)}),a.push(Promise.all(this._invokeAll(function(m){return m.extendMaterialParams&&m.extendMaterialParams(e,c)})))}o.doubleSided===!0&&(c.side=b.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!==b.MeshBasicMaterial&&(a.push(t.assignTexture(c,"normalMap",o.normalTexture)),c.normalScale=new b.Vector2(1,1),o.normalTexture.scale!==void 0)){const u=o.normalTexture.scale;c.normalScale.set(u,u)}if(o.occlusionTexture!==void 0&&s!==b.MeshBasicMaterial&&(a.push(t.assignTexture(c,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&s!==b.MeshBasicMaterial){const u=o.emissiveFactor;c.emissive=new b.Color().setRGB(u[0],u[1],u[2],b.LinearSRGBColorSpace)}return o.emissiveTexture!==void 0&&s!==b.MeshBasicMaterial&&a.push(t.assignTexture(c,"emissiveMap",o.emissiveTexture,b.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&&dt(r,u,o),u})}createUniqueName(e){const t=b.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 Hn(A,c,t)})}const s=[];for(let c=0,A=e.length;c<A;c++){const a=e[c],h=ps(a),u=r[h];if(u)s.push(u.promise);else{let m;a.extensions&&a.extensions[Se.KHR_DRACO_MESH_COMPRESSION]?m=o(a):m=Hn(new b.BufferGeometry,a,t),r[h]={primitive:a,promise:m},s.push(m)}}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?hs(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 p=0,E=h.length;p<E;p++){const g=h[p],l=s[p];let d;const f=a[p];if(l.mode===$e.TRIANGLES||l.mode===$e.TRIANGLE_STRIP||l.mode===$e.TRIANGLE_FAN||l.mode===void 0)d=o.isSkinnedMesh===!0?new b.SkinnedMesh(g,f):new b.Mesh(g,f),d.isSkinnedMesh===!0&&d.normalizeSkinWeights(),l.mode===$e.TRIANGLE_STRIP?d.geometry=Pn(d.geometry,b.TriangleStripDrawMode):l.mode===$e.TRIANGLE_FAN&&(d.geometry=Pn(d.geometry,b.TriangleFanDrawMode));else if(l.mode===$e.LINES)d=new b.LineSegments(g,f);else if(l.mode===$e.LINE_STRIP)d=new b.Line(g,f);else if(l.mode===$e.LINE_LOOP)d=new b.LineLoop(g,f);else if(l.mode===$e.POINTS)d=new b.Points(g,f);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+l.mode);Object.keys(d.geometry.morphAttributes).length>0&&fs(d,o),d.name=t.createUniqueName(o.name||"mesh_"+e),rt(d,o),l.extensions&&dt(r,d,l),t.assignFinalMaterial(d),u.push(d)}for(let p=0,E=u.length;p<E;p++)t.associations.set(u[p],{meshes:e,primitives:p});if(u.length===1)return o.extensions&&dt(r,u[0],o),u[0];const m=new b.Group;o.extensions&&dt(r,m,o),t.associations.set(m,{meshes:e});for(let p=0,E=u.length;p<E;p++)m.add(u[p]);return m})}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 b.PerspectiveCamera(b.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type==="orthographic"&&(t=new b.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 m=new b.Matrix4;o!==null&&m.fromArray(o.array,a*16),A.push(m)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new b.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,m=r.channels.length;u<m;u++){const p=r.channels[u],E=r.samplers[p.sampler],g=p.target,l=g.node,d=r.parameters!==void 0?r.parameters[E.input]:E.input,f=r.parameters!==void 0?r.parameters[E.output]:E.output;g.node!==void 0&&(s.push(this.getDependency("node",l)),c.push(this.getDependency("accessor",d)),A.push(this.getDependency("accessor",f)),a.push(E),h.push(g))}return Promise.all([Promise.all(s),Promise.all(c),Promise.all(A),Promise.all(a),Promise.all(h)]).then(function(u){const m=u[0],p=u[1],E=u[2],g=u[3],l=u[4],d=[];for(let C=0,I=m.length;C<I;C++){const y=m[C],v=p[C],L=E[C],H=g[C],Q=l[C];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const P=n._createAnimationTracks(y,v,L,H,Q);if(P)for(let D=0;D<P.length;D++)d.push(P[D])}const f=new b.AnimationClip(o,void 0,d);return rt(f,r),f})}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],m=a[2];m!==null&&h.traverse(function(p){p.isSkinnedMesh&&p.bind(m,ms)});for(let p=0,E=u.length;p<E;p++)h.add(u[p]);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 b.Bone:a.length>1?h=new b.Group:a.length===1?h=a[0]:h=new b.Object3D,h!==a[0])for(let u=0,m=a.length;u<m;u++)h.add(a[u]);if(o.name&&(h.userData.name=o.name,h.name=s),rt(h,o),o.extensions&&dt(n,h,o),o.matrix!==void 0){const u=new b.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 b.Group;n.name&&(o.name=r.createUniqueName(n.name)),rt(o,n),n.extensions&&dt(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[m,p]of r.associations)(m instanceof b.Material||m instanceof b.Texture)&&u.set(m,p);return h.traverse(m=>{const p=r.associations.get(m);p!=null&&u.set(m,p)}),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(m){m.morphTargetInfluences&&A.push(m.name?m.name:m.uuid)}):A.push(c);let a;switch(ut[o.path]){case ut.weights:a=b.NumberKeyframeTrack;break;case ut.rotation:a=b.QuaternionKeyframeTrack;break;case ut.translation:case ut.scale:a=b.VectorKeyframeTrack;break;default:n.itemSize===1?a=b.NumberKeyframeTrack:a=b.VectorKeyframeTrack;break}const h=r.interpolation!==void 0?us[r.interpolation]:b.InterpolateLinear,u=this._getArrayFromAccessor(n);for(let m=0,p=A.length;m<p;m++){const E=new a(A[m]+"."+ut[o.path],t.array,u,h);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(E),s.push(E)}return s}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=hn(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 b.QuaternionKeyframeTrack?ls:Bi;return new r(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Is(i,e,t){const n=e.attributes,r=new b.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 b.Vector3(A[0],A[1],A[2]),new b.Vector3(a[0],a[1],a[2])),c.normalized){const h=hn(Ct[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 b.Vector3,A=new b.Vector3;for(let a=0,h=o.length;a<h;a++){const u=o[a];if(u.POSITION!==void 0){const m=t.json.accessors[u.POSITION],p=m.min,E=m.max;if(p!==void 0&&E!==void 0){if(A.setX(Math.max(Math.abs(p[0]),Math.abs(E[0]))),A.setY(Math.max(Math.abs(p[1]),Math.abs(E[1]))),A.setZ(Math.max(Math.abs(p[2]),Math.abs(E[2]))),m.normalized){const g=hn(Ct[m.componentType]);A.multiplyScalar(g)}c.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(c)}i.boundingBox=r;const s=new b.Sphere;r.getCenter(s.center),s.radius=r.min.distanceTo(r.max)/2,i.boundingSphere=s}function Hn(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=un[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 b.ColorManagement.workingColorSpace!==b.LinearSRGBColorSpace&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${b.ColorManagement.workingColorSpace}" not supported.`),rt(i,e),Is(i,e,t),Promise.all(r).then(function(){return e.targets!==void 0?ds(i,e.targets,t):i})}const Zt=new WeakMap;class bs extends b.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 b.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,b.SRGBColorSpace,n).catch(n)}decodeDracoFile(e,t,n,r,o=b.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(Zt.has(e)){const A=Zt.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)}),Zt.set(e,{key:n,promise:c}),c}_createGeometry(e){const t=new b.BufferGeometry;e.index&&t.setIndex(new b.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 b.BufferAttribute(o,s);else{const h=new b.InterleavedBuffer(o,c);a=new b.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!==b.SRGBColorSpace)return;const n=new b.Color;for(let r=0,o=e.count;r<o;r++)n.fromBufferAttribute(e,r),b.ColorManagement.colorSpaceToWorking(n,b.SRGBColorSpace),e.setXYZ(r,n.r,n.g,n.b)}_loadLibrary(e,t){const n=new b.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=Cs.toString(),s=["/* draco decoder */",r,"","/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(`
141
- `);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 Cs(){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,m=new u.Decoder;try{const p=t(u,m,new Int8Array(A),a),E=p.attributes.map(g=>g.array.buffer);p.index&&E.push(p.index.array.buffer),self.postMessage({type:"decode",id:c.id,geometry:p},E)}catch(p){console.error(p),self.postMessage({type:"error",id:c.id,error:p.message})}finally{u.destroy(m)}});break}};function t(s,c,A,a){const h=a.attributeIDs,u=a.attributeTypes;let m,p;const E=c.GetEncodedGeometryType(A);if(E===s.TRIANGULAR_MESH)m=new s.Mesh,p=c.DecodeArrayToMesh(A,A.byteLength,m);else if(E===s.POINT_CLOUD)m=new s.PointCloud,p=c.DecodeArrayToPointCloud(A,A.byteLength,m);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!p.ok()||m.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+p.error_msg());const g={index:null,attributes:[]};for(const l in h){const d=self[u[l]];let f,C;if(a.useUniqueIDs)C=h[l],f=c.GetAttributeByUniqueId(m,C);else{if(C=c.GetAttributeId(m,s[h[l]]),C===-1)continue;f=c.GetAttribute(m,C)}const I=r(s,c,m,l,d,f);l==="color"&&(I.vertexColorSpace=a.vertexColorSpace),g.attributes.push(I)}return E===s.TRIANGULAR_MESH&&(g.index=n(s,c,m)),s.destroy(m),g}function n(s,c,A){const h=A.num_faces()*3,u=h*4,m=s._malloc(u);c.GetTrianglesUInt32Array(A,u,m);const p=new Uint32Array(s.HEAPF32.buffer,m,h).slice();return s._free(m),{array:p,itemSize:1}}function r(s,c,A,a,h,u){const m=A.num_points(),p=u.num_components(),E=o(s,h),g=p*h.BYTES_PER_ELEMENT,l=Math.ceil(g/4)*4,d=l/h.BYTES_PER_ELEMENT,f=m*g,C=m*l,I=s._malloc(f);c.GetAttributeDataArrayForAllPoints(A,u,E,f,I);const y=new h(s.HEAPF32.buffer,I,f/h.BYTES_PER_ELEMENT);let v;if(g===l)v=y.slice();else{v=new h(C/h.BYTES_PER_ELEMENT);let L=0;for(let H=0,Q=y.length;H<Q;H++){for(let P=0;P<p;P++)v[L+P]=y[H*p+P];L+=d}}return s._free(I),{name:a,count:m,itemSize:p,array:v,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 ys{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 Bs=0,qn=2,ws=1,zn=2,Ts=0,vs=1,Rs=10,Qs=0,wi=9,Ti=15,vi=16,Ri=22,Qi=37,ki=43,Si=76,xi=83,Li=97,_i=100,Di=103,Ni=109,Fi=122,Oi=123,Mi=131,Pi=132,Gi=133,Ui=134,ji=137,Hi=138,qi=139,zi=140,Vi=141,Ki=142,Wi=145,Yi=146,Ji=148,Xi=152,dn=153,ks=154,fn=155,Ss=156,Zi=157,$i=158,er=165,tr=166,nr=1000054e3,ir=1000054001,rr=1000054004,or=1000054005,Rn=1000066e3,sr=1000066004;class wt{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 Ye=[171,75,84,88,32,50,48,187,13,10,26,10];function Vn(i){return new TextDecoder().decode(i)}function xs(i){const e=new Uint8Array(i.buffer,i.byteOffset,Ye.length);if(e[0]!==Ye[0]||e[1]!==Ye[1]||e[2]!==Ye[2]||e[3]!==Ye[3]||e[4]!==Ye[4]||e[5]!==Ye[5]||e[6]!==Ye[6]||e[7]!==Ye[7]||e[8]!==Ye[8]||e[9]!==Ye[9]||e[10]!==Ye[10]||e[11]!==Ye[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 wt(i,Ye.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,m=new wt(i,Ye.length+n,u,!0);for(let ae=0,se=Math.max(t.levelCount,1);ae<se;ae++)t.levels.push({levelData:new Uint8Array(i.buffer,i.byteOffset+m._nextUint64(),m._nextUint64()),uncompressedByteLength:m._nextUint64()});const p=new wt(i,o,s,!0);p._skip(4);const E=p._nextUint16(),g=p._nextUint16(),l=p._nextUint16(),d=p._nextUint16(),f={vendorId:E,descriptorType:g,versionNumber:l,colorModel:p._nextUint8(),colorPrimaries:p._nextUint8(),transferFunction:p._nextUint8(),flags:p._nextUint8(),texelBlockDimension:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],bytesPlane:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],samples:[]},C=(d/4-6)/4;for(let ae=0;ae<C;ae++){const se={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&se.channelType?(se.sampleLower=p._nextInt32(),se.sampleUpper=p._nextInt32()):(se.sampleLower=p._nextUint32(),se.sampleUpper=p._nextUint32()),f.samples[ae]=se}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(f);const I=new wt(i,c,A,!0);for(;I._offset<A;){const ae=I._nextUint32(),se=I._scan(ae),ee=Vn(se);if(t.keyValue[ee]=I._nextUint8Array(ae-se.byteLength-1),ee.match(/^ktx/i)){const de=Vn(t.keyValue[ee]);t.keyValue[ee]=de.substring(0,de.lastIndexOf("\0"))}I._skip(ae%4?4-ae%4:0)}if(h<=0)return t;const y=new wt(i,a,h,!0),v=y._nextUint16(),L=y._nextUint16(),H=y._nextUint32(),Q=y._nextUint32(),P=y._nextUint32(),D=y._nextUint32(),R=[];for(let ae=0,se=Math.max(t.levelCount,1);ae<se;ae++)R.push({imageFlags:y._nextUint32(),rgbSliceByteOffset:y._nextUint32(),rgbSliceByteLength:y._nextUint32(),alphaSliceByteOffset:y._nextUint32(),alphaSliceByteLength:y._nextUint32()});const F=a+y._offset,_=F+H,X=_+Q,Z=X+P,V=new Uint8Array(i.buffer,i.byteOffset+F,H),$=new Uint8Array(i.buffer,i.byteOffset+_,Q),ie=new Uint8Array(i.buffer,i.byteOffset+X,P),ue=new Uint8Array(i.buffer,i.byteOffset+Z,D);return t.globalData={endpointCount:v,selectorCount:L,imageDescs:R,endpointsData:V,selectorsData:$,tablesData:ie,extendedData:ue},t}let $t,at,pn;const en={env:{emscripten_notify_memory_growth:function(i){pn=new Uint8Array(at.exports.memory.buffer)}}};class Ls{init(){return $t||($t=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Kn).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,en)).then(this._init):WebAssembly.instantiate(Buffer.from(Kn,"base64"),en).then(this._init),$t)}_init(e){at=e.instance,en.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!at)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,r=at.exports.malloc(n);pn.set(e,r),t=t||Number(at.exports.ZSTD_findDecompressedSize(r,n));const o=at.exports.malloc(t),s=at.exports.ZSTD_decompress(o,t,r,n),c=pn.slice(o,o+s);return at.exports.free(r),at.exports.free(o),c}}const Kn="AGFzbQEAAAABpQEVYA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JAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXY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ATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBW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AAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",_s="display-p3",Ds="display-p3-linear";({...b.ColorManagement.spaces[b.SRGBColorSpace]});const tn=new WeakMap;let nn=0,rn;class et extends b.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new ys,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 b.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new b.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(`
142
- `);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})}),nn>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),nn++}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 b.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(tn.has(e))return tn.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 b.CompressedCubeTexture(o,A,a);else{const m=o[0].mipmaps;u=t.layerCount>1?new b.CompressedArrayTexture(m,s,c,t.layerCount,A,a):new b.CompressedTexture(m,s,c,A,a)}return u.minFilter=o[0].mipmaps.length===1?b.LinearFilter:b.LinearMipmapLinearFilter,u.magFilter=b.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=ar(t),u.premultiplyAlpha=!!(h&ws),u}async _createTexture(e,t={}){const n=xs(new Uint8Array(e)),r=n.vkFormat===Rn&&n.dataFormatDescriptor[0].colorModel===167;if(!(n.vkFormat===Qs||r&&!this.workerConfig.astcHDRSupported))return Fs(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 tn.set(e,{promise:c}),c}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),nn--}}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:b.RGBAFormat,RGBA_ASTC_4x4_Format:b.RGBA_ASTC_4x4_Format,RGB_BPTC_UNSIGNED_Format:b.RGB_BPTC_UNSIGNED_Format,RGBA_BPTC_Format:b.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:b.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:b.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:b.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:b.RGB_ETC1_Format,RGB_ETC2_Format:b.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:b.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:b.RGBA_S3TC_DXT1_Format};et.EngineType={UnsignedByteType:b.UnsignedByteType,HalfFloatType:b.HalfFloatType,FloatType:b.FloatType};et.BasisWorker=function(){let i,e,t;const n=_EngineFormat,r=_EngineType,o=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",function(E){const g=E.data;switch(g.type){case"init":i=g.config,c(g.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:l,buffers:d,width:f,height:C,hasAlpha:I,format:y,type:v,dfdFlags:L}=A(g.buffer);self.postMessage({type:"transcode",id:g.id,data:{faces:l,width:f,height:C,hasAlpha:I,format:y,type:v,dfdFlags:L}},d)}catch(l){console.error(l),self.postMessage({type:"error",id:g.id,error:l.message})}});break}});function c(E){e=new Promise(g=>{t={wasmBinary:E,onRuntimeInitialized:g},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(E){const g=new t.KTX2File(new Uint8Array(E));function l(){g.close(),g.delete()}if(!g.isValid())throw l(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let d;if(g.isUASTC())d=s.UASTC;else if(g.isETC1S())d=s.ETC1S;else if(g.isHDR())d=s.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const f=g.getWidth(),C=g.getHeight(),I=g.getLayers()||1,y=g.getLevels(),v=g.getFaces(),L=g.getHasAlpha(),H=g.getDFDFlags(),{transcoderFormat:Q,engineFormat:P,engineType:D}=u(d,f,C,L);if(!f||!C||!y)throw l(),new Error("THREE.KTX2Loader: Invalid texture");if(!g.startTranscoding())throw l(),new Error("THREE.KTX2Loader: .startTranscoding failed");const R=[],F=[];for(let _=0;_<v;_++){const X=[];for(let Z=0;Z<y;Z++){const V=[];let $,ie;for(let ae=0;ae<I;ae++){const se=g.getImageLevelInfo(Z,ae,_);_===0&&Z===0&&ae===0&&(se.origWidth%4!==0||se.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),y>1?($=se.origWidth,ie=se.origHeight):($=se.width,ie=se.height);let ee=new Uint8Array(g.getImageTranscodedSizeInBytes(Z,ae,0,Q));const de=g.transcodeImage(ee,Z,ae,_,Q,0,-1,-1);if(D===r.HalfFloatType&&(ee=new Uint16Array(ee.buffer,ee.byteOffset,ee.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!de)throw l(),new Error("THREE.KTX2Loader: .transcodeImage failed.");V.push(ee)}const ue=p(V);X.push({data:ue,width:$,height:ie}),F.push(ue.buffer)}R.push({mipmaps:X,width:f,height:C,format:P,type:D})}return l(),{faces:R,buffers:F,width:f,height:C,hasAlpha:L,dfdFlags:H,format:P,type:D}}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(E=>E.basisFormat.includes(s.ETC1S)).sort((E,g)=>E.priorityETC1S-g.priorityETC1S),[s.UASTC]:a.filter(E=>E.basisFormat.includes(s.UASTC)).sort((E,g)=>E.priorityUASTC-g.priorityUASTC),[s.UASTC_HDR]:a.filter(E=>E.basisFormat.includes(s.UASTC_HDR)).sort((E,g)=>E.priorityHDR-g.priorityHDR)};function u(E,g,l,d){const f=h[E];for(let C=0;C<f.length;C++){const I=f[C];if(I.if&&!i[I.if]||!I.basisFormat.includes(E)||d&&I.transcoderFormat.length<2||I.needsPowerOfTwo&&!(m(g)&&m(l)))continue;const y=I.transcoderFormat[d?1:0],v=I.engineFormat[d?1:0],L=I.engineType[0];return{transcoderFormat:y,engineFormat:v,engineType:L}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function m(E){return E<=2?!0:(E&E-1)===0&&E!==0}function p(E){if(E.length===1)return E[0];let g=0;for(let f=0;f<E.length;f++){const C=E[f];g+=C.byteLength}const l=new Uint8Array(g);let d=0;for(let f=0;f<E.length;f++){const C=E[f];l.set(C,d),d+=C.byteLength}return l}};const Ns=new Set([b.RGBAFormat,b.RGBFormat,b.RGFormat,b.RedFormat]),on={[Ni]:b.RGBAFormat,[Di]:b.RGFormat,[_i]:b.RedFormat,[Li]:b.RGBAFormat,[xi]:b.RGFormat,[Si]:b.RedFormat,[ki]:b.RGBAFormat,[Qi]:b.RGBAFormat,[Ri]:b.RGFormat,[vi]:b.RGFormat,[Ti]:b.RedFormat,[wi]:b.RedFormat,[Oi]:b.RGBFormat,[Fi]:b.RGBFormat,[Xi]:b.RGBA_ETC2_EAC_Format,[Ji]:b.RGB_ETC2_Format,[dn]:b.R11_EAC_Format,[ks]:b.SIGNED_R11_EAC_Format,[fn]:b.RG11_EAC_Format,[Ss]:b.SIGNED_RG11_EAC_Format,[Rn]:b.RGBA_ASTC_4x4_Format,[$i]:b.RGBA_ASTC_4x4_Format,[Zi]:b.RGBA_ASTC_4x4_Format,[sr]:b.RGBA_ASTC_6x6_Format,[tr]:b.RGBA_ASTC_6x6_Format,[er]:b.RGBA_ASTC_6x6_Format,[Ui]:b.RGBA_S3TC_DXT1_Format,[Gi]:b.RGBA_S3TC_DXT1_Format,[Pi]:b.RGB_S3TC_DXT1_Format,[Mi]:b.RGB_S3TC_DXT1_Format,[Hi]:b.RGBA_S3TC_DXT3_Format,[ji]:b.RGBA_S3TC_DXT3_Format,[zi]:b.SIGNED_RED_RGTC1_Format,[qi]:b.RED_RGTC1_Format,[Ki]:b.SIGNED_RED_GREEN_RGTC2_Format,[Vi]:b.RED_GREEN_RGTC2_Format,[Yi]:b.RGBA_BPTC_Format,[Wi]:b.RGBA_BPTC_Format,[or]:b.RGBA_PVRTC_4BPPV1_Format,[ir]:b.RGBA_PVRTC_4BPPV1_Format,[rr]:b.RGBA_PVRTC_2BPPV1_Format,[nr]:b.RGBA_PVRTC_2BPPV1_Format},It={[Ni]:b.FloatType,[Di]:b.FloatType,[_i]:b.FloatType,[Li]:b.HalfFloatType,[xi]:b.HalfFloatType,[Si]:b.HalfFloatType,[ki]:b.UnsignedByteType,[Qi]:b.UnsignedByteType,[Ri]:b.UnsignedByteType,[vi]:b.UnsignedByteType,[Ti]:b.UnsignedByteType,[wi]:b.UnsignedByteType,[Oi]:b.UnsignedInt5999Type,[Fi]:b.UnsignedInt101111Type,[Xi]:b.UnsignedByteType,[Ji]:b.UnsignedByteType,[dn]:b.UnsignedByteType,[dn]:b.UnsignedByteType,[fn]:b.UnsignedByteType,[fn]:b.UnsignedByteType,[Rn]:b.HalfFloatType,[$i]:b.UnsignedByteType,[Zi]:b.UnsignedByteType,[sr]:b.HalfFloatType,[tr]:b.UnsignedByteType,[er]:b.UnsignedByteType,[Ui]:b.UnsignedByteType,[Gi]:b.UnsignedByteType,[Pi]:b.UnsignedByteType,[Mi]:b.UnsignedByteType,[Hi]:b.UnsignedByteType,[ji]:b.UnsignedByteType,[zi]:b.UnsignedByteType,[qi]:b.UnsignedByteType,[Ki]:b.UnsignedByteType,[Vi]:b.UnsignedByteType,[Yi]:b.UnsignedByteType,[Wi]:b.UnsignedByteType,[or]:b.UnsignedByteType,[ir]:b.UnsignedByteType,[rr]:b.UnsignedByteType,[nr]:b.UnsignedByteType};async function Fs(i){const{vkFormat:e}=i;if(on[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat: "+e);It[e]===void 0&&console.warn('THREE.KTX2Loader: Missing ".type" for vkFormat: '+e);let t;i.supercompressionScheme===qn&&(rn||(rn=new Promise(async s=>{const c=new Ls;await c.init(),s(c)})),t=await rn);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===Bs)u=h.levelData;else if(i.supercompressionScheme===qn)u=t.decode(h.levelData,h.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let m;It[e]===b.FloatType?m=new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):It[e]===b.HalfFloatType?m=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):It[e]===b.UnsignedInt5999Type||It[e]===b.UnsignedInt101111Type?m=new Uint32Array(u.buffer,u.byteOffset,u.byteLength/Uint32Array.BYTES_PER_ELEMENT):m=u,n.push({data:m,width:c,height:A,depth:a})}const r=i.levelCount===0||n.length>1;let o;if(Ns.has(on[e]))o=i.pixelDepth===0?new b.DataTexture(n[0].data,i.pixelWidth,i.pixelHeight):new b.Data3DTexture(n[0].data,i.pixelWidth,i.pixelHeight,i.pixelDepth),o.minFilter=r?b.NearestMipmapNearestFilter:b.NearestFilter,o.magFilter=b.NearestFilter,o.generateMipmaps=i.levelCount===0;else{if(i.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");o=new b.CompressedTexture(n,i.pixelWidth,i.pixelHeight),o.minFilter=r?b.LinearMipmapLinearFilter:b.LinearFilter,o.magFilter=b.LinearFilter}return o.mipmaps=n,o.type=It[e],o.format=on[e],o.colorSpace=ar(i),o.needsUpdate=!0,Promise.resolve(o)}function ar(i){const e=i.dataFormatDescriptor[0];return e.colorPrimaries===vs?e.transferFunction===zn?b.SRGBColorSpace:b.LinearSRGBColorSpace:e.colorPrimaries===Rs?e.transferFunction===zn?_s:Ds:(e.colorPrimaries===Ts||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),b.NoColorSpace)}var Ar=(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 f=new Uint8Array(d.length),C=0;C<d.length;++C){var I=d.charCodeAt(C);f[C]=I>96?I-97:I>64?I-39:I+4}for(var y=0,C=0;C<d.length;++C)f[y++]=f[C]<60?n[f[C]]:(f[C]-60)*64+f[++C];return f.buffer.slice(0,y)}function A(d,f,C,I,y,v,L){var H=d.exports.sbrk,Q=I+3&-4,P=H(Q*y),D=H(v.length),R=new Uint8Array(d.exports.memory.buffer);R.set(v,D);var F=f(P,I,y,D,v.length);if(F==0&&L&&L(P,Q,y),C.set(R.subarray(P,P+I*y)),H(P-H(0)),F!=0)throw new Error("Malformed buffer data: "+F)}var a={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],m=0;function p(d){var f={object:new Worker(d),pending:0,requests:{}};return f.object.onmessage=function(C){var I=C.data;f.pending-=I.count,f.requests[I.id][I.action](I.value),delete f.requests[I.id]},f}function E(d){for(var f="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([f],{type:"text/javascript"}),I=URL.createObjectURL(C),y=u.length;y<d;++y)u[y]=p(I);for(var y=d;y<u.length;++y)u[y].object.postMessage({});u.length=d,URL.revokeObjectURL(I)}function g(d,f,C,I,y){for(var v=u[0],L=1;L<u.length;++L)u[L].pending<v.pending&&(v=u[L]);return new Promise(function(H,Q){var P=new Uint8Array(C),D=++m;v.pending+=d,v.requests[D]={resolve:H,reject:Q},v.object.postMessage({id:D,count:d,size:f,source:P,mode:I,filter:y},[P.buffer])})}function l(d){var f=d.data;if(!f.id)return self.close();self.ready.then(function(C){try{var I=new Uint8Array(f.count*f.size);A(C,C.exports[f.mode],I,f.count,f.size,f.source,C.exports[f.filter]),self.postMessage({id:f.id,count:f.count,action:"resolve",value:I},[I.buffer])}catch(y){self.postMessage({id:f.id,count:f.count,action:"reject",value:y})}})}return{ready:s,supported:!0,useWorkers:function(d){E(d)},decodeVertexBuffer:function(d,f,C,I,y){A(o,o.exports.meshopt_decodeVertexBuffer,d,f,C,I,o.exports[a[y]])},decodeIndexBuffer:function(d,f,C,I){A(o,o.exports.meshopt_decodeIndexBuffer,d,f,C,I)},decodeIndexSequence:function(d,f,C,I){A(o,o.exports.meshopt_decodeIndexSequence,d,f,C,I)},decodeGltfBuffer:function(d,f,C,I,y,v){A(o,o.exports[h[y]],d,f,C,I,o.exports[a[v]])},decodeGltfBufferAsync:function(d,f,C,I,y){return u.length>0?g(d,f,C,h[I],a[y]):s.then(function(){var v=new Uint8Array(d*f);return A(o,o.exports[h[I]],v,d,f,C,o.exports[a[y]]),v})}}})();function Os(i){return"morphTargetDictionary"in i&&i.morphTargetDictionary!==void 0&&"morphTargetInfluences"in i&&Array.isArray(i.morphTargetInfluences)}const Ms={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 _t(i={}){K.Cache.enabled=!0;const e={...Ms,...i};let t=new Ci;const n=new bs;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(Ar),Qn=t}let Qn=new Ci;Qn.setMeshoptDecoder(Ar);class sn extends bn{constructor(e,t){super(e,t)}}class Ps extends bt{gltf;constructor(e){super(e)}async asyncInit(e){if(Nr(e)){let t=null;this.gltf=await Qn.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},Os(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 K.Bone&&r.bones&&(r.bones[s.name]=s),s instanceof K.SkinnedMesh&&(r.skeleton=s.skeleton)}),this.gltf.animations.forEach(s=>{t||(t=s.name),n[s.name]=new sn(r,new Tn(s))}),t?this.syncInit(t,n,o):(t="dummy",n.dummy=new sn(r,new _n),this.syncInit(t,n,o))}else{const t=new K.BoxGeometry,n=new K.MeshStandardMaterial({color:16711680}),r=new K.Mesh(t,n),o="dummy",s={};s.dummy=new sn({root:r},new _n),this.syncInit(o,s)}return this}}const cr={camera:void 0,antialias:!1,transparent:!1};class lr 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=`
139
+ Please avoid using it as it will be completely removed in the future`)}e.clearCache=d;var f=_t();Object.defineProperty(e,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return f.createSyntaxDiagramsCode}}),e.Parser=function(){function e(){throw Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
140
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return e}()})(),yt=class extends c.Loader{backgroundTexture;fog;constructor(e){super(e)}load(e,t,n,r){this.backgroundTexture=void 0,this.fog=void 0;let i=this,a=i.path===``?c.LoaderUtils.extractUrlBase(e):i.path,o=new c.FileLoader(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,function(n){try{t(i.parse(n,a))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)}parse(e,t){let n={};function r(e){let t=i(),n=new bt(t.tokens),r=new St(t.tokenVocabulary),o=a(r.getBaseCstVisitorConstructor());r.input=n.lex(e).tokens;let s=r.vrml();if(r.errors.length>0)throw console.error(r.errors),Error(`THREE.VRMLLoader2: Parsing errors detected.`);return o.visit(s)}function i(){let e=vt.createToken,t=e({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]*/}),n=e({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}),r=`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`.split(`.`),i=e({name:`Version`,pattern:/#VRML.*/,longer_alt:n}),a=e({name:`NodeName`,pattern:new RegExp(r.join(`|`)),longer_alt:n}),o=e({name:`DEF`,pattern:/DEF/,longer_alt:n}),s=e({name:`USE`,pattern:/USE/,longer_alt:n}),c=e({name:`ROUTE`,pattern:/ROUTE/,longer_alt:n}),l=e({name:`TO`,pattern:/TO/,longer_alt:n}),u=e({name:`StringLiteral`,pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),d=e({name:`HexLiteral`,pattern:/0[xX][0-9a-fA-F]+/}),f=e({name:`NumberLiteral`,pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),p=e({name:`TrueLiteral`,pattern:/TRUE/}),m=e({name:`FalseLiteral`,pattern:/FALSE/}),h=e({name:`NullLiteral`,pattern:/NULL/}),g=e({name:`LSquare`,pattern:/\[/}),_=e({name:`RSquare`,pattern:/]/}),v=e({name:`LCurly`,pattern:/{/}),y=e({name:`RCurly`,pattern:/}/}),b=e({name:`Comment`,pattern:/#.*/,group:vt.Lexer.SKIPPED}),x=[e({name:`WhiteSpace`,pattern:/[ ,\s]/,group:vt.Lexer.SKIPPED}),a,o,s,c,l,p,m,h,i,n,t,u,d,f,g,_,v,y,b],S={};for(let e=0,t=x.length;e<t;e++){let t=x[e];S[t.name]=t}return{tokens:x,tokenVocabulary:S}}function a(e){class t extends e{constructor(){super(),this.validateVisitor()}vrml(e){let t={version:this.visit(e.version),nodes:[],routes:[]};for(let n=0,r=e.node.length;n<r;n++){let r=e.node[n];t.nodes.push(this.visit(r))}if(e.route)for(let n=0,r=e.route.length;n<r;n++){let r=e.route[n];t.routes.push(this.visit(r))}return t}version(e){return e.Version[0].image}node(e){let t={name:e.NodeName[0].image,fields:[]};if(e.field)for(let n=0,r=e.field.length;n<r;n++){let r=e.field[n];t.fields.push(this.visit(r))}return e.def&&(t.DEF=this.visit(e.def[0])),t}field(e){let t={name:e.Identifier[0].image,type:null,values:null},n;return e.singleFieldValue&&(n=this.visit(e.singleFieldValue[0])),e.multiFieldValue&&(n=this.visit(e.multiFieldValue[0])),t.type=n.type,t.values=n.values,t}def(e){return(e.Identifier||e.NodeName)[0].image}use(e){return{USE:(e.Identifier||e.NodeName)[0].image}}singleFieldValue(e){return n(this,e)}multiFieldValue(e){return n(this,e)}route(e){return{FROM:e.RouteIdentifier[0].image,TO:e.RouteIdentifier[1].image}}}function n(e,t){let n={type:null,values:[]};if(t.node){n.type=`node`;for(let r=0,i=t.node.length;r<i;r++){let i=t.node[r];n.values.push(e.visit(i))}}if(t.use){n.type=`use`;for(let r=0,i=t.use.length;r<i;r++){let i=t.use[r];n.values.push(e.visit(i))}}if(t.StringLiteral){n.type=`string`;for(let e=0,r=t.StringLiteral.length;e<r;e++){let r=t.StringLiteral[e];n.values.push(r.image.replace(/'|"/g,``))}}if(t.NumberLiteral){n.type=`number`;for(let e=0,r=t.NumberLiteral.length;e<r;e++){let r=t.NumberLiteral[e];n.values.push(parseFloat(r.image))}}if(t.HexLiteral){n.type=`hex`;for(let e=0,r=t.HexLiteral.length;e<r;e++){let r=t.HexLiteral[e];n.values.push(r.image)}}if(t.TrueLiteral){n.type=`boolean`;for(let e=0,r=t.TrueLiteral.length;e<r;e++)t.TrueLiteral[e].image===`TRUE`&&n.values.push(!0)}if(t.FalseLiteral){n.type=`boolean`;for(let e=0,r=t.FalseLiteral.length;e<r;e++)t.FalseLiteral[e].image===`FALSE`&&n.values.push(!1)}return t.NullLiteral&&(n.type=`null`,t.NullLiteral.forEach(function(){n.values.push(null)})),n}return new t}function o(e){let t=e.nodes,n=new c.Scene;for(let e=0,n=t.length;e<n;e++){let n=t[e];s(n)}for(let e=0,r=t.length;e<r;e++){let r=t[e],i=l(r);i instanceof c.Object3D&&n.add(i),r.name===`WorldInfo`&&(n.userData.worldInfo=i)}return n}function s(e){e.DEF&&(n[e.DEF]=e);let t=e.fields;for(let e=0,n=t.length;e<n;e++){let n=t[e];if(n.type===`node`){let e=n.values;for(let t=0,n=e.length;t<n;t++)s(e[t])}}}function l(e){return e.USE?re(e.USE):(e.build===void 0&&(e.build=u(e)),e.build)}function u(e){let t=e.name,n;switch(t){case`Anchor`:case`Group`:case`Transform`:case`Collision`:n=d(e);break;case`Background`:n=p(e);break;case`Shape`:n=m(e);break;case`Appearance`:n=h(e);break;case`Material`:n=g(e);break;case`ImageTexture`:n=b(e);break;case`PixelTexture`:n=y(e);break;case`TextureTransform`:n=x(e);break;case`IndexedFaceSet`:n=O(e);break;case`IndexedLineSet`:n=k(e);break;case`PointSet`:n=A(e);break;case`Box`:n=j(e);break;case`Cone`:n=M(e);break;case`Cylinder`:n=N(e);break;case`Sphere`:n=ee(e);break;case`ElevationGrid`:n=te(e);break;case`Extrusion`:n=ne(e);break;case`Color`:case`Coordinate`:case`Normal`:case`TextureCoordinate`:n=S(e);break;case`WorldInfo`:n=C(e);break;case`DirectionalLight`:n=w(e);break;case`PointLight`:n=T(e);break;case`SpotLight`:n=E(e);break;case`Fog`:n=D(e);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`NavigationInfo`:case`Viewpoint`:break;default:console.warn(`THREE.VRMLLoader2: Unknown node:`,t);break}return n!==void 0&&e.DEF!==void 0&&n.hasOwnProperty(`name`)===!0&&(n.name=e.DEF),n}function d(e){let t=new c.Group,n=e.fields;for(let e=0,r=n.length;e<r;e++){let r=n[e],i=r.name,a=r.values;switch(i){case`bboxCenter`:break;case`bboxSize`:break;case`center`:break;case`children`:ie(a,t);break;case`description`:break;case`collide`:break;case`parameter`:break;case`rotation`:let e=new c.Vector3(a[0],a[1],a[2]).normalize(),n=a[3];t.quaternion.setFromAxisAngle(e,n);break;case`scale`:t.scale.set(a[0],a[1],a[2]);break;case`scaleOrientation`:break;case`translation`:t.position.set(a[0],a[1],a[2]);break;case`proxy`:break;case`url`:break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,i);break}}return t}let f=this;function p(e){let t=new c.Group,n,r,i,a,o,s,l,u,d,p,m=e.fields;for(let e=0,t=m.length;e<t;e++){let t=m[e],c=t.name,f=t.values;switch(c){case`groundAngle`:n=f;break;case`groundColor`:r=f;break;case`backUrl`:o=f;break;case`bottomUrl`:s=f;break;case`frontUrl`:l=f;break;case`leftUrl`:u=f;break;case`rightUrl`:d=f;break;case`topUrl`:p=f;break;case`skyAngle`:i=f;break;case`skyColor`:a=f;break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,c);break}}if(o&&s&&l&&u&&d&&p)f.backgroundTexture=new c.CubeTextureLoader(f.manager).load([d[0],u[0],p[0],s[0],l[0],o[0]]);else{if(a){let e=[];for(let t=0;t<a.length;t+=3)e.push([a[t],a[t+1],a[t+2]]);a=e}if(r){let e=[];for(let t=0;t<r.length;t+=3)e.push([r[t],r[t+1],r[t+2]]);r=e}this.backgroundTexture=new wt({skyColor:a,skyAngle:i,groundColor:r,groundAngle:n}).buildTexture()}return t}function m(e){let t=e.fields,n=new c.MeshBasicMaterial({name:c.Loader.DEFAULT_MATERIAL_NAME,color:0}),r;for(let e=0,i=t.length;e<i;e++){let i=t[e],a=i.name,o=i.values;switch(a){case`appearance`:o[0]!==null&&(n=l(o[0]));break;case`geometry`:o[0]!==null&&(r=l(o[0]));break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,a);break}}let i;if(r&&r.attributes.position){let e=r._type;if(e===`points`){let e=new c.PointsMaterial({name:c.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:n.opacity,transparent:n.transparent});r.attributes.color===void 0?n.isMeshPhongMaterial&&e.color.copy(n.emissive):e.vertexColors=!0,i=new c.Points(r,e)}else if(e===`line`){let e=new c.LineBasicMaterial({name:c.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:n.opacity,transparent:n.transparent});r.attributes.color===void 0?n.isMeshPhongMaterial&&e.color.copy(n.emissive):e.vertexColors=!0,i=new c.LineSegments(r,e)}else r._solid!==void 0&&(n.side=r._solid?c.FrontSide:c.DoubleSide),r.attributes.color!==void 0&&(n.vertexColors=!0),i=new c.Mesh(r,n)}else i=new c.Object3D,i.visible=!1;return i}function h(e){let t=new c.MeshPhongMaterial,n,r=e.fields;for(let e=0,i=r.length;e<i;e++){let i=r[e],a=i.name,o=i.values;switch(a){case`material`:if(o[0]!==null){let e=l(o[0]);e.diffuseColor&&t.color.copy(e.diffuseColor),e.emissiveColor&&t.emissive.copy(e.emissiveColor),e.shininess&&(t.shininess=e.shininess),e.specularColor&&t.specular.copy(e.specularColor),e.transparency&&(t.opacity=1-e.transparency),e.transparency>0&&(t.transparent=!0)}else t=new c.MeshBasicMaterial({name:c.Loader.DEFAULT_MATERIAL_NAME,color:0});break;case`texture`:let e=o[0];e!==null&&(e.name===`ImageTexture`||e.name===`PixelTexture`||e.USE)&&(t.map=l(e));break;case`textureTransform`:o[0]!==null&&(n=l(o[0]));break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,a);break}}if(t.map){if(t.map.__type){switch(t.map.__type){case Y.INTENSITY_ALPHA:t.opacity=1;break;case Y.RGB:t.color.set(16777215);break;case Y.RGBA:t.color.set(16777215),t.opacity=1;break;default:}delete t.map.__type}n&&(t.map.center.copy(n.center),t.map.rotation=n.rotation,t.map.repeat.copy(n.scale),t.map.offset.copy(n.translation))}return t.map&&t.map.fookHolder&&t.map.fookHolder.fooks.push(async e=>{let n=await Tt(e.source.data);t.transparent=n,t.needsUpdate=n}),t}function g(e){let t={},n=e.fields;for(let e=0,r=n.length;e<r;e++){let r=n[e],i=r.name,a=r.values;switch(i){case`ambientIntensity`:break;case`diffuseColor`:t.diffuseColor=new c.Color().setRGB(a[0],a[1],a[2],c.SRGBColorSpace);break;case`emissiveColor`:t.emissiveColor=new c.Color().setRGB(a[0],a[1],a[2],c.SRGBColorSpace);break;case`shininess`:t.shininess=a[0];break;case`specularColor`:t.specularColor=new c.Color().setRGB(a[0],a[1],a[2],c.SRGBColorSpace);break;case`transparency`:t.transparency=a[0];break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,i);break}}return t}function _(e,t,n){let r;switch(t){case Y.INTENSITY:r=parseInt(e),n.r=r,n.g=r,n.b=r,n.a=1;break;case Y.INTENSITY_ALPHA:r=parseInt(`0x`+e.substring(2,4)),n.r=r,n.g=r,n.b=r,n.a=parseInt(`0x`+e.substring(4,6));break;case Y.RGB:n.r=parseInt(`0x`+e.substring(2,4)),n.g=parseInt(`0x`+e.substring(4,6)),n.b=parseInt(`0x`+e.substring(6,8)),n.a=1;break;case Y.RGBA:n.r=parseInt(`0x`+e.substring(2,4)),n.g=parseInt(`0x`+e.substring(4,6)),n.b=parseInt(`0x`+e.substring(6,8)),n.a=parseInt(`0x`+e.substring(8,10));break;default:}}function v(e){let t;switch(e){case 1:t=Y.INTENSITY;break;case 2:t=Y.INTENSITY_ALPHA;break;case 3:t=Y.RGB;break;case 4:t=Y.RGBA;break;default:}return t}function y(e){let t,n=c.RepeatWrapping,r=c.RepeatWrapping,i=e.fields;for(let e=0,a=i.length;e<a;e++){let a=i[e],o=a.name,s=a.values;switch(o){case`image`:let e=s[0],i=s[1],a=s[2],l=v(a),u=new Uint8Array(4*e*i),d={r:0,g:0,b:0,a:0};for(let e=3,t=0,n=s.length;e<n;e++,t++){_(s[e],l,d);let n=t*4;u[n+0]=d.r,u[n+1]=d.g,u[n+2]=d.b,u[n+3]=d.a}t=new c.DataTexture(u,e,i),t.colorSpace=c.SRGBColorSpace,t.needsUpdate=!0,t.__type=l;break;case`repeatS`:s[0]===!1&&(n=c.ClampToEdgeWrapping);break;case`repeatT`:s[0]===!1&&(r=c.ClampToEdgeWrapping);break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,o);break}}return t&&(t.wrapS=n,t.wrapT=r),t}function b(e){let t,n=c.RepeatWrapping,r=c.RepeatWrapping,i=e.fields;for(let e=0,a=i.length;e<a;e++){let a=i[e],o=a.name,s=a.values;switch(o){case`url`:let e=s[0],i={fooks:[]};e&&(t=he.load(e,e=>{i.fooks&&i.fooks.map(t=>t(e))})),t&&(t.fookHolder=i);break;case`repeatS`:s[0]===!1&&(n=c.ClampToEdgeWrapping);break;case`repeatT`:s[0]===!1&&(r=c.ClampToEdgeWrapping);break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,o);break}}return t&&(t.wrapS=n,t.wrapT=r,t.colorSpace=c.SRGBColorSpace),t}function x(e){let t={center:new c.Vector2,rotation:0,scale:new c.Vector2(1,1),translation:new c.Vector2},n=e.fields;for(let e=0,r=n.length;e<r;e++){let r=n[e],i=r.name,a=r.values;switch(i){case`center`:t.center.set(a[0],a[1]);break;case`rotation`:t.rotation=a[0];break;case`scale`:t.scale.set(a[0],a[1]);break;case`translation`:t.translation.set(a[0],a[1]);break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,i);break}}return t}function S(e){return e.fields[0]?e.fields[0].values:{}}function C(e){let t={},n=e.fields;for(let e=0,r=n.length;e<r;e++){let r=n[e],i=r.name,a=r.values;switch(i){case`title`:t.title=a[0];break;case`info`:t.info=a;break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,i);break}}return t}function w(e){let t=0,n=new c.Color(1,1,1),r=new c.Vector3(0,0,-1),i=1,a=!0,o=e.fields;for(let e=0,s=o.length;e<s;e++){let s=o[e],c=s.name,l=s.values;switch(c){case`ambientIntensity`:t=l[0];break;case`color`:n.set(l[0],l[1],l[2]);break;case`direction`:r.set(l[0],l[1],l[2]);break;case`intensity`:i=l[0];break;case`on`:a=l[0];break;default:console.warn(`ThreeMFLoader.VRMLLoader2: Unknown field:`,c);break}}i=a?i:0;let s=new c.Object3D,l=new c.DirectionalLight(n,i);r.normalize(),r.multiplyScalar(-10),l.position.copy(r),s.add(l);let u=new c.AmbientLight(n,i*t);return s.add(u),s}function T(e){let t=0,n=new c.Vector3(1,0,0),r=new c.Color(1,1,1),i=1,a=new c.Vector3(0,0,0),o=!0,s=100,l=e.fields;for(let e=0,c=l.length;e<c;e++){let c=l[e],u=c.name,d=c.values;switch(u){case`ambientIntensity`:t=d[0];break;case`attenuation`:n.set(d[0],d[1],d[2]);break;case`color`:r.set(d[0],d[1],d[2]);break;case`intensity`:i=d[0];break;case`location`:a.set(d[0],d[1],d[2]);break;case`on`:o=d[0];break;case`radius`:s=d[0];break;default:console.warn(`ThreeMFLoader.VRMLLoader2: Unknown field:`,u);break}}i=o?i:0;let u=new c.Object3D,d=new c.PointLight(r,i,s);d.position.copy(a),d.decay=2,u.add(d);let f=new c.AmbientLight(r,i*t);return u.add(f),u}function E(e){let t=0,n=new c.Vector3(1,0,0),r=1.570796,i=new c.Color(1,1,1),a=.785398,o=new c.Vector3(0,0,-1),s=1,l=new c.Vector3(0,0,-1),u=!0,d=100,f=e.fields;for(let e=0,c=f.length;e<c;e++){let c=f[e],p=c.name,m=c.values;switch(p){case`ambientIntensity`:t=m[0];break;case`attenuation`:n.set(m[0],m[1],m[2]);break;case`beamWidth`:r=m[0];break;case`color`:i.set(m[0],m[1],m[2]);break;case`cutOffAngle`:a=m[0];break;case`direction`:o.set(m[0],m[1],m[2]);break;case`intensity`:s=m[0];break;case`location`:l.set(m[0],m[1],m[2]);break;case`on`:u=m[0];break;case`radius`:d=m[0];break;default:console.warn(`ThreeMFLoader.VRMLLoader2: Unknown field:`,p);break}}s=u?s:0;let p=new c.Object3D;r=r>a?a:r;let m=1-r/a,h=new c.SpotLight(i,s,d,a,m);o.normalize(),h.position.copy(o),h.decay=0,p.add(h);let g=new c.AmbientLight(i,s*t);return p.add(g),p.position.copy(l),p}function D(e){let t=new c.Color(1,1,1),n=`LINEAR`,r=0,i=e.fields;for(let e=0,a=i.length;e<a;e++){let a=i[e],o=a.name,s=a.values;switch(o){case`color`:t.set(s[0],s[1],s[2]);break;case`fogType`:n=s[0];break;case`visibilityRange`:r=s[0];break;case`set_bind`:break;case`isBound`:break;default:console.warn(`ThreeMFLoader.VRMLLoader2: Unknown field:`,o);break}}if(n===`LINEAR`)f.fog=new c.Fog(t,0,r);else if(n===`EXPONENTIAL`){let e=.02;r!==0&&(e=2.146/r),f.fog=new c.FogExp2(t,e)}else console.warn(`ThreeMFLoader.VRMLLoader2: Unknown fogType:`,n);return new c.Object3D}function O(e){let t,n,r,i,a=!0,o=!0,s=0,u,d,f,p,m=!0,h=!0,g=e.fields;for(let e=0,c=g.length;e<c;e++){let c=g[e],_=c.name,v=c.values;switch(_){case`color`:let e=v[0];e!==null&&(t=l(e));break;case`coord`:let c=v[0];c!==null&&(n=l(c));break;case`normal`:let g=v[0];g!==null&&(r=l(g));break;case`texCoord`:let y=v[0];y!==null&&(i=l(y));break;case`ccw`:a=v[0];break;case`colorIndex`:u=v;break;case`colorPerVertex`:m=v[0];break;case`convex`:break;case`coordIndex`:d=v;break;case`creaseAngle`:s=v[0];break;case`normalIndex`:f=v;break;case`normalPerVertex`:h=v[0];break;case`solid`:o=v[0];break;case`texCoordIndex`:p=v;break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,_);break}}if(d===void 0)return console.warn(`THREE.VRMLLoader2: Missing coordIndex.`),new c.BufferGeometry;let _=P(d,a),v,y,b;t&&(v=m===!0?u&&u.length>0?le(_,P(u,a),t,3):V(_,new c.Float32BufferAttribute(t,3)):u&&u.length>0?ue(_,ae(F(t,u),d)):ue(_,ae(t,d)),me(v)),y=r?h===!0?f&&f.length>0?le(_,P(f,a),r,3):V(_,new c.Float32BufferAttribute(r,3)):f&&f.length>0?ue(_,ae(F(r,f),d)):ue(_,ae(r,d)):pe(_,n,s),i&&(b=p&&p.length>0?le(_,P(p,a),i,2):V(_,new c.Float32BufferAttribute(i,2)));let x=new c.BufferGeometry,S=V(_,new c.Float32BufferAttribute(n,3));return x.setAttribute(`position`,S),x.setAttribute(`normal`,y),v&&x.setAttribute(`color`,v),b&&x.setAttribute(`uv`,b),x._solid=o,x._type=`mesh`,x}function k(e){let t,n,r,i,a=!0,o=e.fields;for(let e=0,s=o.length;e<s;e++){let s=o[e],c=s.name,u=s.values;switch(c){case`color`:let e=u[0];e!==null&&(t=l(e));break;case`coord`:let o=u[0];o!==null&&(n=l(o));break;case`colorIndex`:r=u;break;case`colorPerVertex`:a=u[0];break;case`coordIndex`:i=u;break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,c);break}}let s,u=oe(i);t&&(s=a===!0?r.length>0?le(u,oe(r),t,3):V(u,new c.Float32BufferAttribute(t,3)):r.length>0?de(u,se(F(t,r),i)):de(u,se(t,i)),me(s));let d=new c.BufferGeometry,f=V(u,new c.Float32BufferAttribute(n,3));return d.setAttribute(`position`,f),s&&d.setAttribute(`color`,s),d._type=`line`,d}function A(e){let t,n,r=e.fields;for(let e=0,i=r.length;e<i;e++){let i=r[e],a=i.name,o=i.values;switch(a){case`color`:let e=o[0];e!==null&&(t=l(e));break;case`coord`:let r=o[0];r!==null&&(n=l(r));break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,a);break}}let i=new c.BufferGeometry;if(i.setAttribute(`position`,new c.Float32BufferAttribute(n,3)),t){let e=new c.Float32BufferAttribute(t,3);me(e),i.setAttribute(`color`,e)}return i._type=`points`,i}function j(e){let t=new c.Vector3(2,2,2),n=e.fields;for(let e=0,r=n.length;e<r;e++){let r=n[e],i=r.name,a=r.values;switch(i){case`size`:t.x=a[0],t.y=a[1],t.z=a[2];break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,i);break}}return new c.BoxGeometry(t.x,t.y,t.z)}function M(e){let t=1,n=2,r=!1,i=e.fields;for(let e=0,a=i.length;e<a;e++){let a=i[e],o=a.name,s=a.values;switch(o){case`bottom`:r=!s[0];break;case`bottomRadius`:t=s[0];break;case`height`:n=s[0];break;case`side`:break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,o);break}}return new c.ConeGeometry(t,n,16,1,r)}function N(e){let t=1,n=2,r=e.fields;for(let e=0,i=r.length;e<i;e++){let i=r[e],a=i.name,o=i.values;switch(a){case`bottom`:break;case`radius`:t=o[0];break;case`height`:n=o[0];break;case`side`:break;case`top`:break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,a);break}}return new c.CylinderGeometry(t,t,n,16,1)}function ee(e){let t=1,n=e.fields;for(let e=0,r=n.length;e<r;e++){let r=n[e],i=r.name,a=r.values;switch(i){case`radius`:t=a[0];break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,i);break}}return new c.SphereGeometry(t,16,16)}function te(e){let t,n,r,i,a=!0,o=!0,s=!0,u=!0,d=0,f=2,p=2,m=1,h=1,g=e.fields;for(let e=0,c=g.length;e<c;e++){let c=g[e],_=c.name,v=c.values;switch(_){case`color`:let e=v[0];e!==null&&(t=l(e));break;case`normal`:let c=v[0];c!==null&&(n=l(c));break;case`texCoord`:let g=v[0];g!==null&&(r=l(g));break;case`height`:i=v;break;case`ccw`:u=v[0];break;case`colorPerVertex`:a=v[0];break;case`creaseAngle`:d=v[0];break;case`normalPerVertex`:o=v[0];break;case`solid`:s=v[0];break;case`xDimension`:f=v[0];break;case`xSpacing`:m=v[0];break;case`zDimension`:p=v[0];break;case`zSpacing`:h=v[0];break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,_);break}}let _=[],v=[],y=[],b=[];for(let e=0;e<p;e++)for(let s=0;s<f;s++){let c=e*f+s,l=m*e,u=i[c],d=h*s;if(_.push(l,u,d),t&&a===!0){let e=t[c*3+0],n=t[c*3+1],r=t[c*3+2];y.push(e,n,r)}if(n&&o===!0){let e=n[c*3+0],t=n[c*3+1],r=n[c*3+2];v.push(e,t,r)}if(r){let e=r[c*2+0],t=r[c*2+1];b.push(e,t)}else b.push(e/(f-1),s/(p-1))}let x=[];for(let e=0;e<f-1;e++)for(let t=0;t<p-1;t++){let n=e+t*f,r=e+(t+1)*f,i=e+1+(t+1)*f,a=e+1+t*f;u===!0?(x.push(n,i,r),x.push(i,n,a)):(x.push(n,r,i),x.push(i,a,n))}let S=V(x,new c.Float32BufferAttribute(_,3)),C=V(x,new c.Float32BufferAttribute(b,2)),w,T;if(t){if(a===!1){for(let e=0;e<f-1;e++)for(let n=0;n<p-1;n++){let r=e+n*(f-1),i=t[r*3+0],a=t[r*3+1],o=t[r*3+2];y.push(i,a,o),y.push(i,a,o),y.push(i,a,o),y.push(i,a,o),y.push(i,a,o),y.push(i,a,o)}w=new c.Float32BufferAttribute(y,3)}else w=V(x,new c.Float32BufferAttribute(y,3));me(w)}if(n)if(o===!1){for(let e=0;e<f-1;e++)for(let t=0;t<p-1;t++){let r=e+t*(f-1),i=n[r*3+0],a=n[r*3+1],o=n[r*3+2];v.push(i,a,o),v.push(i,a,o),v.push(i,a,o),v.push(i,a,o),v.push(i,a,o),v.push(i,a,o)}T=new c.Float32BufferAttribute(v,3)}else T=V(x,new c.Float32BufferAttribute(v,3));else T=pe(x,_,d);let E=new c.BufferGeometry;return E.setAttribute(`position`,S),E.setAttribute(`normal`,T),E.setAttribute(`uv`,C),w&&E.setAttribute(`color`,w),E._solid=s,E._type=`mesh`,E}function ne(e){let t=[1,1,1,-1,-1,-1,-1,1,1,1],n=[0,0,0,0,1,0],r,i,a=!0,o=!0,s=0,l=!0,u=!0,d=e.fields;for(let e=0,c=d.length;e<c;e++){let c=d[e],f=c.name,p=c.values;switch(f){case`beginCap`:a=p[0];break;case`ccw`:o=p[0];break;case`convex`:break;case`creaseAngle`:s=p[0];break;case`crossSection`:t=p;break;case`endCap`:l=p[0];break;case`orientation`:i=p;break;case`scale`:r=p;break;case`solid`:u=p[0];break;case`spine`:n=p;break;default:console.warn(`THREE.VRMLLoader2: Unknown field:`,f);break}}let f=t[0]===t[t.length-2]&&t[1]===t[t.length-1],p=[],m=new c.Vector3,h=new c.Vector3,g=new c.Vector3,_=new c.Vector3,v=new c.Quaternion;for(let e=0,a=0,o=0,s=n.length;e<s;e+=3,a+=2,o+=4){m.fromArray(n,e),h.x=r?r[a+0]:1,h.y=1,h.z=r?r[a+1]:1,g.x=i?i[o+0]:0,g.y=i?i[o+1]:0,g.z=i?i[o+2]:1;let s=i?i[o+3]:0;for(let e=0,n=t.length;e<n;e+=2)_.x=t[e+0],_.y=0,_.z=t[e+1],_.multiply(h),v.setFromAxisAngle(g,s),_.applyQuaternion(v),_.add(m),p.push(_.x,_.y,_.z)}let y=[],b=n.length/3,x=t.length/2;for(let e=0;e<b-1;e++)for(let t=0;t<x-1;t++){let n=t+e*x,r=t+1+e*x,i=t+(e+1)*x,a=t+1+(e+1)*x;t===x-2&&f===!0&&(r=e*x,a=(e+1)*x),o===!0?(y.push(n,r,i),y.push(i,r,a)):(y.push(n,i,r),y.push(i,a,r))}if(a===!0||l===!0){let e=[];for(let n=0,r=t.length;n<r;n+=2)e.push(new c.Vector2(t[n],t[n+1]));let n=c.ShapeUtils.triangulateShape(e,[]),r=[];for(let e=0,t=n.length;e<t;e++){let t=n[e];r.push(t[0],t[1],t[2])}if(a===!0)for(let e=0,t=r.length;e<t;e+=3)o===!0?y.push(r[e+0],r[e+1],r[e+2]):y.push(r[e+0],r[e+2],r[e+1]);if(l===!0){let e=x*(b-1);for(let t=0,n=r.length;t<n;t+=3)o===!0?y.push(e+r[t+0],e+r[t+2],e+r[t+1]):y.push(e+r[t+0],e+r[t+1],e+r[t+2])}}let S=V(y,new c.Float32BufferAttribute(p,3)),C=pe(y,p,s),w=new c.BufferGeometry;return w.setAttribute(`position`,S),w.setAttribute(`normal`,C),w._solid=u,w._type=`mesh`,w}function re(e){let t=n[e],r=l(t);return r.isObject3D||r.isMaterial?r.clone():r}function ie(e,t){for(let n=0,r=e.length;n<r;n++){let r=l(e[n]);r instanceof c.Object3D&&t.add(r)}}function P(e,t){let n=[],r=0;for(let i=0,a=e.length;i<a;i++){let o=e[r],s=e[i+(t?1:2)],c=e[i+(t?2:1)];n.push(o,s,c),(e[i+3]===-1||i+3>=a)&&(i+=3,r=i+1)}return n}function ae(e,t){let n=[],r=0;for(let i=0,a=t.length;i<a;i++){let o=r*3,s=e[o],c=e[o+1],l=e[o+2];n.push(s,c,l),(t[i+3]===-1||i+3>=a)&&(i+=3,r++)}return n}function F(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r]*3,a=e[i],o=e[i+1],s=e[i+2];n.push(a,o,s)}return n}function oe(e){let t=[];for(let n=0,r=e.length;n<r;n++){let i=e[n],a=e[n+1];t.push(i,a),(e[n+2]===-1||n+2>=r)&&(n+=2)}return t}function se(e,t){let n=[],r=0;for(let i=0,a=t.length;i<a;i++){let o=r*3,s=e[o],c=e[o+1],l=e[o+2];n.push(s,c,l),(t[i+2]===-1||i+2>=a)&&(i+=2,r++)}return n}let I=new c.Vector3,L=new c.Vector3,R=new c.Vector3,z=new c.Vector2,ce=new c.Vector2,B=new c.Vector2;function le(e,t,n,r){let i=[];for(let a=0,o=e.length;a<o;a+=3){let e=t[a],o=t[a+1],s=t[a+2];r===2?(z.fromArray(n,e*r),ce.fromArray(n,o*r),B.fromArray(n,s*r),i.push(z.x,z.y),i.push(ce.x,ce.y),i.push(B.x,B.y)):(I.fromArray(n,e*r),L.fromArray(n,o*r),R.fromArray(n,s*r),i.push(I.x,I.y,I.z),i.push(L.x,L.y,L.z),i.push(R.x,R.y,R.z))}return new c.Float32BufferAttribute(i,r)}function ue(e,t){let n=[];for(let r=0,i=0,a=e.length;r<a;r+=3,i++)I.fromArray(t,i*3),n.push(I.x,I.y,I.z),n.push(I.x,I.y,I.z),n.push(I.x,I.y,I.z);return new c.Float32BufferAttribute(n,3)}function de(e,t){let n=[];for(let r=0,i=0,a=e.length;r<a;r+=2,i++)I.fromArray(t,i*3),n.push(I.x,I.y,I.z),n.push(I.x,I.y,I.z);return new c.Float32BufferAttribute(n,3)}function V(e,t){let n=t.array,r=t.itemSize,i=new n.constructor(e.length*r),a=0,o=0;for(let t=0,s=e.length;t<s;t++){a=e[t]*r;for(let e=0;e<r;e++)i[o++]=n[a++]}return new c.Float32BufferAttribute(i,r)}let fe=new c.Vector3,H=new c.Vector3;function pe(e,t,n){let r=[],i={};for(let n=0,a=e.length;n<a;n+=3){let a=e[n],o=e[n+1],s=e[n+2],c=new Ct(a,o,s);I.fromArray(t,a*3),L.fromArray(t,o*3),R.fromArray(t,s*3),H.subVectors(R,L),fe.subVectors(I,L),H.cross(fe),H.normalize(),c.normal.copy(H),i[a]===void 0&&(i[a]=[]),i[o]===void 0&&(i[o]=[]),i[s]===void 0&&(i[s]=[]),i[a].push(c.normal),i[o].push(c.normal),i[s].push(c.normal),r.push(c)}let a=[];for(let e=0,o=r.length;e<o;e++){let o=r[e],s=U(i[o.a],o.normal,n),c=U(i[o.b],o.normal,n),l=U(i[o.c],o.normal,n);I.fromArray(t,o.a*3),L.fromArray(t,o.b*3),R.fromArray(t,o.c*3),a.push(s.x,s.y,s.z),a.push(c.x,c.y,c.z),a.push(l.x,l.y,l.z)}return new c.Float32BufferAttribute(a,3)}function U(e,t,n){let r=new c.Vector3;if(n===0)r.copy(t);else for(let i=0,a=e.length;i<a;i++)e[i].angleTo(t)<n&&r.add(e[i]);return r.normalize()}function me(e){let t=new c.Color;for(let n=0;n<e.count;n++)t.fromBufferAttribute(e,n),c.ColorManagement.colorSpaceToWorking(t,c.SRGBColorSpace),e.setXYZ(n,t.r,t.g,t.b)}let he=new c.TextureLoader(this.manager);if(he.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),e.indexOf(`#VRML V2.0`)===-1)throw Error(`THREE.VRMLLexer: Version of VRML asset not supported.`);return o(r(e))}},bt=class{constructor(e){this.lexer=new vt.Lexer(e)}lex(e){let t=this.lexer.tokenize(e);if(t.errors.length>0)throw console.error(t.errors),Error(`THREE.VRMLLexer: Lexing errors detected.`);return t}},xt=vt.CstParser,St=class extends xt{constructor(e){super(e);let t=this,n=e.Version,r=e.LCurly,i=e.RCurly,a=e.LSquare,o=e.RSquare,s=e.Identifier,c=e.RouteIdentifier,l=e.StringLiteral,u=e.HexLiteral,d=e.NumberLiteral,f=e.TrueLiteral,p=e.FalseLiteral,m=e.NullLiteral,h=e.DEF,g=e.USE,_=e.ROUTE,v=e.TO,y=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(y),t.CONSUME(r),t.MANY(function(){t.SUBRULE(t.field)}),t.CONSUME(i)}),t.RULE(`field`,function(){t.CONSUME(s),t.OR2([{ALT:function(){t.SUBRULE(t.singleFieldValue)}},{ALT:function(){t.SUBRULE(t.multiFieldValue)}}])}),t.RULE(`def`,function(){t.CONSUME(h),t.OR([{ALT:function(){t.CONSUME(s)}},{ALT:function(){t.CONSUME(y)}}])}),t.RULE(`use`,function(){t.CONSUME(g),t.OR([{ALT:function(){t.CONSUME(s)}},{ALT:function(){t.CONSUME(y)}}])}),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(l)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(d)}},{ALT:function(){t.CONSUME(f)}},{ALT:function(){t.CONSUME(p)}},{ALT:function(){t.CONSUME(m)}}])})}),t.RULE(`multiFieldValue`,function(){t.CONSUME(a),t.MANY(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(l)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(d)}},{ALT:function(){t.CONSUME(m)}}])}),t.CONSUME(o)}),t.RULE(`route`,function(){t.CONSUME(_),t.CONSUME(c),t.CONSUME(v),t.CONSUME2(c)}),this.performSelfAnalysis()}},Ct=class{constructor(e,t,n){this.a=e,this.b=t,this.c=n,this.normal=new c.Vector3}},Y={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4},wt=class{constructor({skyColor:e=[[0,0,0]],skyAngle:t=[],groundColor:n=[],groundAngle:r=[],size:i=128}={}){this._skyColor=e,this._skyAngle=t,this._groundColor=n,this._groundAngle=r,this._size=i,this._texture=null}applyToScene(e){e.background=this._buildCubeTexture()}buildTexture(){return this._texture||=this._buildCubeTexture(),this._texture}dispose(){this._texture&&=(this._texture.dispose(),null)}_colorAtPitch(e){let t=Math.PI/2;if(e<=t){if(this._skyAngle.length===0)return this._skyColor[0];if(e<=this._skyAngle[0])return this._lerpColor(this._skyColor[0],this._skyColor[1],e/this._skyAngle[0]);let t=this._skyAngle.length-1;if(e>=this._skyAngle[t])return this._skyColor[t+1]??this._skyColor[this._skyColor.length-1];for(let n=0;n<t;n++)if(e<=this._skyAngle[n+1]){let t=(e-this._skyAngle[n])/(this._skyAngle[n+1]-this._skyAngle[n]);return this._lerpColor(this._skyColor[n+1]??this._skyColor[this._skyColor.length-1],this._skyColor[n+2]??this._skyColor[this._skyColor.length-1],t)}return this._skyColor[this._skyColor.length-1]}else{if(this._groundColor.length===0)return this._skyColor[this._skyColor.length-1];let n=e-t;if(this._groundAngle.length===0)return this._groundColor[0];if(n<=this._groundAngle[0])return this._lerpColor(this._groundColor[0],this._groundColor[1],n/this._groundAngle[0]);let r=this._groundAngle.length-1;if(n>=this._groundAngle[r])return this._groundColor[r+1]??this._groundColor[this._groundColor.length-1];for(let e=0;e<r;e++)if(n<=this._groundAngle[e+1]){let t=(n-this._groundAngle[e])/(this._groundAngle[e+1]-this._groundAngle[e]);return this._lerpColor(this._groundColor[e+1]??this._groundColor[this._groundColor.length-1],this._groundColor[e+2]??this._groundColor[this._groundColor.length-1],t)}return this._groundColor[this._groundColor.length-1]}}_lerpColor(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n]}_buildSideCanvas(){let e=this._size,t=document.createElement(`canvas`);t.width=e,t.height=e;let n=t.getContext(`2d`),r=n.createImageData(e,e),i=r.data;for(let t=0;t<e;t++){let n=1-2*((t+.5)/e);for(let r=0;r<e;r++){let a=2*((r+.5)/e)-1,o=Math.sqrt(a*a+n*n+1),s=Math.acos(Math.max(-1,Math.min(1,n/o))),[c,l,u]=this._colorAtPitch(s),d=(t*e+r)*4;i[d]=Math.round(c*255),i[d+1]=Math.round(l*255),i[d+2]=Math.round(u*255),i[d+3]=255}}return n.putImageData(r,0,0),t}_buildTopCanvas(){let e=this._size,t=document.createElement(`canvas`);t.width=e,t.height=e;let n=t.getContext(`2d`),r=n.createImageData(e,e),i=r.data;for(let t=0;t<e;t++){let n=2*(t+.5)/e-1;for(let r=0;r<e;r++){let a=2*(r+.5)/e-1,o=Math.sqrt(a*a+1+n*n),s=Math.acos(Math.max(-1,Math.min(1,1/o))),[c,l,u]=this._colorAtPitch(s),d=(t*e+r)*4;i[d]=Math.round(c*255),i[d+1]=Math.round(l*255),i[d+2]=Math.round(u*255),i[d+3]=255}}return n.putImageData(r,0,0),t}_buildBottomCanvas(){let e=this._size,t=document.createElement(`canvas`);t.width=e,t.height=e;let n=t.getContext(`2d`),r=n.createImageData(e,e),i=r.data;for(let t=0;t<e;t++){let n=2*(t+.5)/e-1;for(let r=0;r<e;r++){let a=2*(r+.5)/e-1,o=Math.sqrt(a*a+1+n*n),s=Math.acos(Math.max(-1,Math.min(1,-1/o))),[c,l,u]=this._colorAtPitch(s),d=(t*e+r)*4;i[d]=Math.round(c*255),i[d+1]=Math.round(l*255),i[d+2]=Math.round(u*255),i[d+3]=255}}return n.putImageData(r,0,0),t}_buildCubeTexture(){let e=this._buildSideCanvas(),t=new c.CubeTexture([e,e,this._buildTopCanvas(),this._buildBottomCanvas(),e,e]);return t.needsUpdate=!0,t.minFilter=c.LinearMipmapLinearFilter,t.magFilter=c.LinearFilter,t}};async function Tt(e){await new Promise((t,n)=>{if(e.complete)return t();e.onload=t,e.onerror=n});let t=document.createElement(`canvas`),n=t.getContext(`2d`);t.width=e.naturalWidth,t.height=e.naturalHeight,n.drawImage(e,0,0);let r=n.getImageData(0,0,t.width,t.height).data;for(let e=3;e<r.length;e+=4)if(r[e]<255)return!0;return!1}var Et=class extends c.Loader{constructor(e){super(e),this.animateBonePositions=!0,this.animateBoneRotations=!0,this.animateBoneScales=!0}load(e,t,n,r){let i=this,a=new c.FileLoader(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,function(n){try{t(i.parse(n))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)}parse(e){function t(e){o(e)!==`HIERARCHY`&&console.error(`THREE.BVHLoader2: HIERARCHY expected.`);let t=[],i=r(e,o(e),t);o(e)!==`MOTION`&&console.error(`THREE.BVHLoader2: MOTION expected.`);let a=o(e).split(/[\s]+/),s=parseInt(a[1]);isNaN(s)&&console.error(`THREE.BVHLoader2: Failed to read number of frames.`),a=o(e).split(/[\s]+/);let c=parseFloat(a[2]);isNaN(c)&&console.error(`THREE.BVHLoader2: Failed to read frame time.`);for(let t=0;t<s;t++)a=o(e).split(/[\s]+/),n(a,t*c,i);return t}function n(e,t,r){if(r.type===`ENDSITE`)return;let i={time:t,position:new c.Vector3,rotation:new c.Quaternion,scale:new c.Vector3(1,1,1)};r.frames.push(i);let a=new c.Quaternion,o=new c.Vector3(1,0,0),s=new c.Vector3(0,1,0),l=new c.Vector3(0,0,1);for(let t=0;t<r.channels.length;t++)switch(r.channels[t]){case`Xposition`:i.position.x=parseFloat(e.shift().trim());break;case`Yposition`:i.position.y=parseFloat(e.shift().trim());break;case`Zposition`:i.position.z=parseFloat(e.shift().trim());break;case`Xrotation`:a.setFromAxisAngle(o,parseFloat(e.shift().trim())*Math.PI/180),i.rotation.multiply(a);break;case`Yrotation`:a.setFromAxisAngle(s,parseFloat(e.shift().trim())*Math.PI/180),i.rotation.multiply(a);break;case`Zrotation`:a.setFromAxisAngle(l,parseFloat(e.shift().trim())*Math.PI/180),i.rotation.multiply(a);break;case`Xscale`:i.scale.x=parseFloat(e.shift().trim());break;case`Yscale`:i.scale.y=parseFloat(e.shift().trim());break;case`Zscale`:i.scale.z=parseFloat(e.shift().trim());break;default:console.warn(`THREE.BVHLoader2: Invalid channel type.`)}for(let i=0;i<r.children.length;i++)n(e,t,r.children[i])}function r(e,t,n){let i={name:``,type:``,frames:[]};n.push(i);let a=t.split(/[\s]+/);a[0].toUpperCase()===`END`&&a[1].toUpperCase()===`SITE`?(i.type=`ENDSITE`,i.name=`ENDSITE`):(i.name=a[1],i.type=a[0].toUpperCase()),o(e)!==`{`&&console.error(`THREE.BVHLoader2: Expected opening { after type & name`),a=o(e).split(/[\s]+/),a[0]!==`OFFSET`&&console.error(`THREE.BVHLoader2: Expected OFFSET but got: `+a[0]),a.length!==4&&console.error(`THREE.BVHLoader2: Invalid number of values for OFFSET.`);let s=new c.Vector3(parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3]));if((isNaN(s.x)||isNaN(s.y)||isNaN(s.z))&&console.error(`THREE.BVHLoader2: Invalid values of OFFSET.`),i.offset=s,i.type!==`ENDSITE`){a=o(e).split(/[\s]+/),a[0]!==`CHANNELS`&&console.error(`THREE.BVHLoader2: Expected CHANNELS definition.`);let t=parseInt(a[1]);i.channels=a.splice(2,t),i.children=[]}for(;;){let t=o(e);if(t===`}`)return i;i.children.push(r(e,t,n))}}function i(e,t){let n=new c.Bone;if(t.push(n),n.position.add(e.offset),n.name=e.name,e.type!==`ENDSITE`)for(let r=0;r<e.children.length;r++)n.add(i(e.children[r],t));return n}function a(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(r.type===`ENDSITE`)continue;let i=[],a=[],o=[],l=[];for(let e=0;e<r.frames.length;e++){let t=r.frames[e];i.push(t.time),a.push(t.position.x+r.offset.x),a.push(t.position.y+r.offset.y),a.push(t.position.z+r.offset.z),o.push(t.rotation.x),o.push(t.rotation.y),o.push(t.rotation.z),o.push(t.rotation.w),l.push(t.scale.x),l.push(t.scale.y),l.push(t.scale.z)}s.animateBonePositions&&t.push(new c.VectorKeyframeTrack(r.name+`.position`,i,a)),s.animateBoneRotations&&t.push(new c.QuaternionKeyframeTrack(r.name+`.quaternion`,i,o)),s.animateBoneScales&&t.push(new c.VectorKeyframeTrack(r.name+`.scale`,i,l))}return new c.AnimationClip(`animation`,-1,t)}function o(e){let t;for(;(t=e.shift().trim()).length===0;);return t}let s=this,l=t(e.split(/[\r\n]+/g)),u=[];i(l[0],u);let d=a(l);return{skeleton:new c.Skeleton(u),clip:d}}};async function Dt(e,t){let n=new c.LoadingManager;n.setURLModifier(t=>(t.startsWith(`./`)&&(t=t.substring(2)),URL.createObjectURL(_e(e,t))));let r=new yt(n);return{object3D:await r.loadAsync(t),bgTexture:r.backgroundTexture,fog:r.fog}}var Ot;async function kt(e,t){Ot||=new Et;let n=ge(e,t);return await Ot.parse(n)}function At(e){let t=e.clip.clone(),n=e.skeleton.bones[0].clone(!0),r=[];n.traverse(e=>{e instanceof c.Bone&&r.push(e)});let i=new c.Skeleton(r);return i.calculateInverses(),{clip:t,skeleton:i}}var jt=class{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(let t of e.tracks){let e=t.getValueSize(),n;n=t.getInterpolation()===c.InterpolateDiscrete?new c.DiscreteInterpolant(t.times,t.values,e):t.ValueTypeName===`quaternion`?new c.QuaternionLinearInterpolant(t.times,t.values,e):new c.LinearInterpolant(t.times,t.values,e),this.interpolants[t.name]=n}}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());let t={};for(let[e,n]of Object.entries(this.interpolants)){let r=e.substring(0,e.lastIndexOf(`.`)),i=e.substring(e.lastIndexOf(`.`)+1,e.length),a=t[r];a||(a={},t[r]=a);let o=n.evaluate(this.time);if(i===`position`)a.loc=new u(o[0],o[1],o[2]);else if(i===`quaternion`)a.quat=new d(o[0],o[1],o[2],o[3]);else if(i===`scale`)a.scale=new u(o[0],o[1],o[2]);else if(i===`morphTargetInfluences`){a.morphs||=[];let e=Array.from(o);a.morphs.push({name:r,vals:e})}else console.warn(`ClipMotion: update. unknown property(${i})`)}return t}},Mt={type:`audio`,autoplay:!1,loop:!1,volume:1,positional:{refDistance:1,maxDistance:1e3,rolloffFactor:1,directional:{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}}};async function Nt(){try{Pt.listener.context.state!==`running`&&await Pt.listener.context.resume()}catch{console.warn(`AudioContext resume failed. Did you call on user gesture?`)}}var Pt=class e extends W{static listener=new c.AudioListener;static audioLoader=new c.AudioLoader;ready;options;sound;constructor(e,t={}){super(),this.options=be(Mt,t),this.ready=this.asyncInit(e)}initObject(){return new c.Object3D}async asyncInit(t){if(this.options.type===`positional`){let t=new c.PositionalAudio(e.listener);t.setRefDistance(this.options.positional.refDistance),t.setMaxDistance(this.options.positional.maxDistance),t.setRolloffFactor(this.options.positional.rolloffFactor);let 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{let t=new c.Audio(e.listener);t.setVolume(this.options.volume),t.setLoop(this.options.loop),this.sound=t}return this.object3D.add(this.sound),new Promise(n=>{e.audioLoader.load(t,e=>{this.sound&&this.sound.setBuffer(e),n(this)})})}play(){this.sound?.stop(),this.sound?.play()}stop(){this.sound?.stop()}},Ft=class{isDummy=!0;skeleton=new c.Skeleton([new c.Bone]);clip=new c.AnimationClip(`dummy`)},It={},Lt={},Rt=class extends je{loop;sound;soundLoop;soundContinue;backgroundTexture;fog;constructor(e,t,n,r,i=!1,a=!0,o,s){super(e,t),this.loop=n,this.sound=r,this.soundLoop=i,this.soundContinue=a,this.backgroundTexture=o,this.fog=s}enable(e,t){super.enable(e,t),this.sound&&(this.sound.play(),this.loop&&!this.soundContinue&&this.motion.setFinishListener(()=>{this.sound?.play()}),this.loop&&!this.soundLoop&&this.motion.setFinishListener(()=>{this.sound?.play()})),t&&(this.backgroundTexture&&(t.scene.background=this.backgroundTexture,t.scene.environment=this.backgroundTexture),this.fog&&(t.scene.fog=this.fog))}disable(e,t){super.disable(e,t),this.sound&&(this.loop&&this.sound.stop(),this.soundContinue||this.sound.stop(),this.motion.setFinishListener=()=>{})}},zt=class extends Me{comment=null;tags=[];profiles=[];thumbnails=[];rdf=null;htmlfile=``;constructor(e){super(e)}async asyncInit(e){let t=await he(e),n=new DOMParser,r=ge(t,`CATALOG.XML`),i=n.parseFromString(r,`application/xml`);if(i.querySelector(`parsererror`))return console.error(`Acerola3D.asyncInit(): CATALOG.XML parse error.`),this;let a=`http://acerola3d.sourceforge.jp/a3/catalog`,o=i.getElementsByTagNameNS(a,`a3`),s=i.getElementsByTagNameNS(a,`c`);s[0]&&(this.comment=s[0].textContent);let l=i.getElementsByTagNameNS(a,`tag`);Array.from(l).forEach(e=>{let t=e.getAttribute(`name`);t&&this.tags.push(t)});let d=i.getElementsByTagNameNS(a,`profile`);Array.from(d).forEach(e=>{let t=e.getAttribute(`uri`);t&&this.profiles.push(t)});let f=i.getElementsByTagNameNS(a,`thumbnail`);Array.from(f).forEach(e=>{let n=e.getAttribute(`src`);if(n){let e=_e(t,n);this.thumbnails.push(e)}});let p=i.getElementsByTagNameNS(`http://www.w3.org/1999/02/22-rdf-syntax-ns#`,`RDF`);p[0]&&(this.rdf=p[0]);let m=i.getElementsByTagNameNS(a,`htmlfile`);if(m[0]){let e=m[0].getAttribute(`src`);e&&(this.htmlfile=ge(t,e))}let h=[],g=i.getElementsByTagNameNS(a,`a`),_={},v;for(let e of Array.from(g)){let n=e.getAttribute(`an`);if(n){h.push(n),v||=n;let r,i=e.getAttribute(`bvh`);if(i&&i!==`none`){let e=t.zipUrl+`!`+i;It[e]||(It[e]=await kt(t,i)),r=At(It[e]),r&&r.clip.tracks.forEach(e=>{e.setInterpolation(c.InterpolateDiscrete)})}else r=new Ft;let o={};r.skeleton.bones.forEach(e=>{o[e.name]=e});let s=e.getAttribute(`scale`),l=s?Number(s):1,d=e.getAttribute(`offset`),f=new u;if(d){let e=d.split(` `);f.set(Number(e[0]),Number(e[1]),Number(e[2]))}let p=e.getAttribute(`rot`),m=new u;if(p){let e=p.split(` `);m.set(Number(e[0]),Number(e[1]),Number(e[2]))}let g=e.getAttribute(`loop`)===`true`,y,b,x={},S=e.getElementsByTagNameNS(a,`p`);for(let e of Array.from(S)){let n=e.getAttribute(`name`),r=e.getAttribute(`wrl`);if(n&&r){let i=t.zipUrl+`!`+r;if(!Lt[i]){let e=await Dt(t,r);Lt[i]=e.object3D,e.bgTexture&&(y=e.bgTexture),e.fog&&(b=e.fog)}let a=e.getAttribute(`scale`);if(a){let e=Number(a);Lt[i].scale.set(e,e,e)}let o=e.getAttribute(`rot`);if(o){let e=o.split(` `);Lt[i].rotation.set(Number(e[0])/180*Math.PI,Number(e[1])/180*Math.PI,Number(e[2])/180*Math.PI,`ZXY`)}let s=e.getAttribute(`offset`);if(s){let e=s.split(` `);Lt[i].position.set(Number(e[0]),Number(e[1]),Number(e[2]))}x[n]=Lt[i].clone(!0)}}let C=new c.Object3D;C.add(r.skeleton.bones[0]),r instanceof Ft||Bt(C,x),Object.values(x).forEach(e=>{C.add(e)}),C.scale.set(l,l,l),m.scale(Math.PI/180),C.setRotationFromEuler(new c.Euler(m.x,m.y,m.z,`ZXY`)),C.position.add(f),C.traverse(e=>{e.userData.a3js={objectA3:this}});let w,T=!1,E=!0,D=e.getElementsByTagNameNS(a,`s`);if(D[0]){let e=D[0].getAttribute(`file`),n=D[0].getAttribute(`type`)||`PointSound`,r=D[0].getAttribute(`loop`)||`false`;T=r===`true`;let i=D[0].getAttribute(`gain`)||`1.0`,a=D[0].getAttribute(`offset`)||`0.0 0.0 0.0`,o=D[0].getAttribute(`direction`)||`0.0 0.0 1.0`;E=(D[0].getAttribute(`continue`)||`true`)===`true`;let s=a.split(` `).map(e=>Number(e)),c=new u(s[0],s[1],s[2]),l=o.split(` `).map(e=>Number(e)),d=new u(l[0],l[1],l[2]),f=n===`PointSound`||n===`ConeSound`?`positional`:`audio`,p=n===`PointSound`?{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}:{coneInnerAngle:30,coneOuterAngle:90,coneOuterGain:.1};if(e){let n=_e(t,e),a=URL.createObjectURL(n);w=await new Pt(a,{type:f,autoplay:!1,loop:r===`true`,volume:Number(i),positional:{directional:p}}).ready,w.setPosition(c),w.lookAt(d),URL.revokeObjectURL(a),C.add(w.object3D)}}_[n]=new Rt({root:C,bones:o,skeleton:r.skeleton},new jt(r.clip,n),g,w,T,E,y,b)}}return o[0]&&(o[0].getAttribute(`haltActionNo`)!==null&&(this.haltActionName=h[Number(o[0].getAttribute(`haltActionNo`))]),o[0].getAttribute(`walkActionNo`)!==null&&(this.walkActionName=h[Number(o[0].getAttribute(`walkActionNo`))]),o[0].getAttribute(`runActionNo`)!==null&&(this.runActionName=h[Number(o[0].getAttribute(`runActionNo`))]),o[0].getAttribute(`minWalkSpeed`)!==null&&(this.minWalkSpeed=Number(o[0].getAttribute(`minWalkSpeed`))),o[0].getAttribute(`minRunSpeed`)!==null&&(this.minRunSpeed=Number(o[0].getAttribute(`minRunSpeed`)))),v&&this.syncInit(v,_),this}};function Bt(e,t){if(se(e)){let n=t[e.name];n&&(e.add(n),delete t[e.name])}e.children&&e.children.forEach(e=>{Bt(e,t)})}var Vt=class{scene;objects;physicsWorld=null;physicsDt=1/60;collisionListener;rapierLines;constructor(){this.scene=new c.Scene,this.objects=[],H.isInitialized&&(this.physicsWorld=H.createWorld({gravity:{x:0,y:-9.81,z:0},timestep:this.physicsDt}))}add(e){if(this.scene.add(e.object3D),this.objects.push(e),e.scene=this,this.physicsWorld&&(e.addOneselfToPhysics(this.physicsWorld),e instanceof Me))for(let t of Object.values(e.actions))t.motion.addOneselfToPhysics(this.physicsWorld);e instanceof zt&&e.currentAction instanceof Rt&&(e.currentAction.backgroundTexture&&(this.scene.background=e.currentAction.backgroundTexture,this.scene.environment=e.currentAction.backgroundTexture),e.currentAction.fog&&(this.scene.fog=e.currentAction.fog))}remove(e){this.scene.remove(e.object3D);{let 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.removeOneselfFromPhysics(this.physicsWorld),e instanceof Me))for(let t of Object.values(e.actions))t.motion.removeOneselfFromPhysics(this.physicsWorld);e instanceof Me&&e.currentAction instanceof Rt&&(e.currentAction.backgroundTexture&&(this.scene.background=null,this.scene.environment=null),e.currentAction.fog&&(this.scene.fog=null))}removeAll(){[...this.objects].forEach(e=>{this.remove(e)})}setCollisionListener(e){this.collisionListener=e}update(e){if(this.physicsWorld){this.physicsWorld.update(e);let t=this.physicsWorld.getCollisions();if(t.forEach(e=>{e.objectA.handleCollision(e.objectB,e.started,e.partOfA,e.partOfB),e.objectB.handleCollision(e.objectA,e.started,e.partOfB,e.partOfA)}),this.collisionListener&&t.length>0&&this.collisionListener(t),this.rapierLines&&this.physicsWorld instanceof B){let{vertices:e,colors:t}=this.physicsWorld.world.debugRender();this.rapierLines.geometry.setAttribute(`position`,new c.BufferAttribute(e,3)),this.rapierLines.geometry.setAttribute(`color`,new c.BufferAttribute(t,4))}}for(let t of this.objects)t.update(e)}setPhysicsDebugMode(e){e?(this.rapierLines=new c.LineSegments(new c.BufferGeometry,new c.LineBasicMaterial({vertexColors:!0})),this.scene.add(this.rapierLines)):this.rapierLines&&=(this.scene.remove(this.rapierLines),void 0)}},Ht=class extends W{view;setView(e){this.view=e}lookAt(e,t,n){let r=new u;typeof e==`number`?r.set(e,t,n):e instanceof W?e.getPosition(r):r.set(e);let i=this.upVector?this.upVector:W.defaultUpVector,a=p(this.getPosition(),r,i);a.mul(i.x,i.y,i.z,0),this.setQuat(a)}lookAtNow(e,t,n){let r=new u;typeof e==`number`?r.set(e,t,n):e instanceof W?e.getPosition(r):r.set(e);let i=this.upVector?this.upVector:W.defaultUpVector,a=p(this.getPosition(),r,i);a.mul(i.x,i.y,i.z,0),this.setQuatNow(a)}},Ut=class{view;setView(e){this.view=e}update(e){}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){}},Wt=class extends Ut{lastMousePosition;dx=0;dy=0;isLeftDown=!1;isRightDown=!1;ctrlKey=!1;deltaY=0;target;constructor(e,t,n){super(),this.lastMousePosition={x:0,y:0},typeof e==`number`?this.target=new u(e,t,n):this.target=new u(e)}update(e){if(!this.view)return;let t=this.view.camera.getPosition(),n=this.view.camera.getQuat();if(this.isLeftDown&&!this.ctrlKey){let e=.01,r=Math.sin(-this.dx*e),i=Math.cos(-this.dx*e),a=Math.sin(-this.dy*e),o=Math.cos(-this.dy*e),s=new u(1,0,0).apply(n),c=new u(0,1,0).apply(n),l=new d(s.x*a,s.y*a,s.z*a,o),f=new d(c.x*r,c.y*r,c.z*r,i),m=new u(t);m.sub(this.target),m.apply(l),m.apply(f),m.add(this.target),t.set(m);let h=p(t,this.target,new u(0,1,0));h.mul(new d(0,1,0,0)),n.set(h)}else if(this.isLeftDown){U.v0.set(this.target),U.v0.sub(t);let e=.005*U.v0.length(),r=new u(1,0,0).apply(n).scale(-this.dx*e),i=new u(0,1,0).apply(n).scale(this.dy*e);t.add(r),t.add(i),this.target.add(r),this.target.add(i)}if(this.deltaY!==0){let e=new u(this.target).sub(t);this.deltaY>0?e.scale(.05):this.deltaY<0&&e.scale(-.05),t.add(e)}this.view.camera.setPosition(t),this.view.camera.setQuat(n),this.dx=0,this.dy=0,this.deltaY=0}mouseDown(e){e.button===0?(this.isLeftDown=!0,this.lastMousePosition.x=e.clientX,this.lastMousePosition.y=e.clientY):e.button===2&&(this.isRightDown=!0,this.lastMousePosition.x=e.clientX,this.lastMousePosition.y=e.clientY)}mouseMove(e){this.dx+=e.clientX-this.lastMousePosition.x,this.dy+=e.clientY-this.lastMousePosition.y,this.ctrlKey=e.ctrlKey,this.lastMousePosition.x=e.clientX,this.lastMousePosition.y=e.clientY}mouseUp(e){e.button===0?this.isLeftDown=!1:e.button===2&&(this.isRightDown=!1)}mouseWheel(e){this.deltaY=e.deltaY}},Gt={speed:.1,angSpeed:.01},Kt=class extends Ut{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextLoc;_avatarNextQuat;_velY;constructor(e,t){super(),this.options={...Gt,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextLoc=new u,this._avatarNextQuat=new d,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){let t=this._avatar,n=new v;n.set(t);let r=t.getUnitVecZ().scale(this.options.speed),i=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(i),this._keyS&&this._avatarNextLoc.sub(r),this._keyD&&this._avatarNextLoc.sub(i),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&&(U.v0.set(0,this.options.angSpeed,0),this._avatarNextQuat.mul(m(U.v0,`ZXY`,U.q0))),this._keyRight&&(U.v0.set(0,-this.options.angSpeed,0),this._avatarNextQuat.mul(m(U.v0,`ZXY`,U.q0))),t.setPosition(this._avatarNextLoc),t.setQuat(this._avatarNextQuat)}},qt={speed:5,angSpeed:.3,jumpSpeed:15},Jt=class extends Ut{options;_avatar;_keyW;_keyA;_keyS;_keyD;_keyLeft;_keyRight;_keySpace;_avatarNextVel;_avatarNextAngVel;_velY;constructor(e,t){super(),this.options={...qt,...t},this._avatar=e,this._keyW=this._keyA=this._keyS=this._keyD=!1,this._keyLeft=this._keyRight=!1,this._keySpace=!1,this._avatarNextVel=new u,this._avatarNextAngVel=new u,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){let t=this._avatar;new v().set(t);let n=t.getUnitVecZ().scale(this.options.speed),r=t.getUnitVecX().scale(this.options.speed);this._avatarNextVel.set(0,0,0),this._avatarNextAngVel.set(0,0,0),this._keyW&&this._avatarNextVel.add(n),this._keyA&&this._avatarNextVel.add(r),this._keyS&&this._avatarNextVel.sub(n),this._keyD&&this._avatarNextVel.sub(r),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(0,this.options.angSpeed,0),this._keyRight&&this._avatarNextAngVel.add(0,-this.options.angSpeed,0),t.setLinearVelocity(this._avatarNextVel),t.setAngularVelocity(this._avatarNextAngVel)}},Yt=class{scene;camera;controller;constructor(e){e.setView(this),this.camera=e,this.camera.setAudioListener(Pt.listener),this.camera.setPosition(0,0,3),this.scene=new Vt,this.scene.scene.add(this.camera.object3D),this.controller=new Wt(0,0,0),this.controller.setView(this),this.controller.activate()}replaceScene(e){this.scene.scene.remove(this.camera.object3D),e.scene.add(this.camera.object3D);let 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()}worldToScreen(e){throw Error(`BaseViewはworldToScreen()は実装していません`)}screenToWorld(e,t,n){throw Error(`BaseViewはscreenToWorld()は実装していません`)}cameraToScreen(e){throw Error(`BaseViewはcameraToScreen()は実装していません`)}screenToCamera(e,t,n){throw Error(`BaseViewはscreenToCamera()は実装していません`)}async waitForRender(){throw Error(`BaseViewはwaitForRender()は実装していません`)}setShadowMap(e){throw Error(`BaseViewはsetShadowMap()は実装していません`)}},Xt=class extends Ht{camera;headLight;constructor(e){super(),this.camera=e,this.headLight=new c.SpotLight(16777215,1,0,Math.PI/3,0,0),this.headLight.position.set(0,0,0);let t=new c.Object3D;t.position.set(0,0,-10),this.headLight.target=t,this.object3D.add(this.camera),this.object3D.add(this.headLight),this.object3D.add(t)}initObject(){return new c.Object3D}setAudioListener(e){this.camera.add(e)}getHeadLight(){return this.headLight}setAspect(e){I(this.camera)&&(this.camera.aspect=e,this.camera.updateProjectionMatrix())}setHeadLight(e){e?this.headLight.intensity=1:this.headLight.intensity=0}calcNDC(e){let t=new c.Vector3(e.x,e.y,e.z);return t.project(this.camera),{x:t.x,y:t.y}}},Zt=class extends c.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 c.Vector2(.5,.5),this.addEventListener(`removed`,function(){this.traverse(function(e){e.element&&e.element instanceof e.element.ownerDocument.defaultView.Element&&e.element.parentNode!==null&&e.element.remove()})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}},Qt=new c.Vector3,$t=new c.Matrix4,en=new c.Matrix4,tn=new c.Vector3,nn=new c.Vector3,rn=class{constructor(e={}){let t=this,n,r,i,a,o={objects:new WeakMap},s=e.element===void 0?document.createElement(`div`):e.element;s.style.overflow=`hidden`,this.domElement=s,this.sortObjects=!0,this.getSize=function(){return{width:n,height:r}},this.render=function(e,t){e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),$t.copy(t.matrixWorldInverse),en.multiplyMatrices(t.projectionMatrix,$t),l(e,e,t),this.sortObjects&&f(e)},this.setSize=function(e,t){n=e,r=t,i=n/2,a=r/2,s.style.width=e+`px`,s.style.height=t+`px`};function c(e){e.isCSS2DObject&&(e.element.style.display=`none`);for(let t=0,n=e.children.length;t<n;t++)c(e.children[t])}function l(e,n,r){if(e.visible===!1){c(e);return}if(e.isCSS2DObject){Qt.setFromMatrixPosition(e.matrixWorld),Qt.applyMatrix4(en);let c=Qt.z>=-1&&Qt.z<=1&&e.layers.test(r.layers)===!0,l=e.element;l.style.display=c===!0?``:`none`,c===!0&&(e.onBeforeRender(t,n,r),l.style.transform=`translate(`+-100*e.center.x+`%,`+-100*e.center.y+`%)translate(`+(Qt.x*i+i)+`px,`+(-Qt.y*a+a)+`px)`,l.parentNode!==s&&s.appendChild(l),e.onAfterRender(t,n,r));let d={distanceToCameraSquared:u(r,e)};o.objects.set(e,d)}for(let t=0,i=e.children.length;t<i;t++)l(e.children[t],n,r)}function u(e,t){return tn.setFromMatrixPosition(e.matrixWorld),nn.setFromMatrixPosition(t.matrixWorld),tn.distanceToSquared(nn)}function d(e){let t=[];return e.traverseVisible(function(e){e.isCSS2DObject&&t.push(e)}),t}function f(e){let t=d(e).sort(function(e,t){return e.renderOrder===t.renderOrder?o.objects.get(e).distanceToCameraSquared-o.objects.get(t).distanceToCameraSquared:t.renderOrder-e.renderOrder}),n=t.length;for(let e=0,r=t.length;e<r;e++)t[e].element.style.zIndex=n-e}}};function an(e,t){if(t===c.TrianglesDrawMode)return console.warn(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.`),e;if(t===c.TriangleFanDrawMode||t===c.TriangleStripDrawMode){let n=e.getIndex();if(n===null){let t=[],r=e.getAttribute(`position`);if(r!==void 0){for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}else return console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.`),e}let r=n.count-2,i=[];if(t===c.TriangleFanDrawMode)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.`);let a=e.clone();return a.setIndex(i),a.clearGroups(),a}else return console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:`,t),e}function on(e){let t=new Map,n=new Map,r=e.clone();return sn(e,r,function(e,r){t.set(r,e),n.set(e,r)}),r.traverse(function(e){if(!e.isSkinnedMesh)return;let r=e,i=t.get(e),a=i.skeleton.bones;r.skeleton=i.skeleton.clone(),r.bindMatrix.copy(i.bindMatrix),r.skeleton.bones=a.map(function(e){return n.get(e)}),r.bind(r.skeleton,r.bindMatrix)}),r}function sn(e,t,n){n(e,t);for(let r=0;r<e.children.length;r++)sn(e.children[r],t.children[r],n)}var cn=class extends c.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new pn(e)}),this.register(function(e){return new mn(e)}),this.register(function(e){return new Cn(e)}),this.register(function(e){return new wn(e)}),this.register(function(e){return new Tn(e)}),this.register(function(e){return new gn(e)}),this.register(function(e){return new _n(e)}),this.register(function(e){return new vn(e)}),this.register(function(e){return new yn(e)}),this.register(function(e){return new fn(e)}),this.register(function(e){return new bn(e)}),this.register(function(e){return new hn(e)}),this.register(function(e){return new Sn(e)}),this.register(function(e){return new xn(e)}),this.register(function(e){return new un(e)}),this.register(function(e){return new En(e,Z.EXT_MESHOPT_COMPRESSION)}),this.register(function(e){return new En(e,Z.KHR_MESHOPT_COMPRESSION)}),this.register(function(e){return new Dn(e)})}load(e,t,n,r){let i=this,a;if(this.resourcePath!==``)a=this.resourcePath;else if(this.path!==``){let t=c.LoaderUtils.extractUrlBase(e);a=c.LoaderUtils.resolveURL(t,this.path)}else a=c.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);let o=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},s=new c.FileLoader(this.manager);s.setPath(this.path),s.setResponseType(`arraybuffer`),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(n){try{i.parse(n,a,function(n){t(n),i.manager.itemEnd(e)},o)}catch(e){o(e)}},n,o)}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 i,a={},o={},s=new TextDecoder;if(typeof e==`string`)i=JSON.parse(e);else if(e instanceof ArrayBuffer)if(s.decode(new Uint8Array(e,0,4))===On){try{a[Z.KHR_BINARY_GLTF]=new jn(e)}catch(e){r&&r(e);return}i=JSON.parse(a[Z.KHR_BINARY_GLTF].content)}else i=JSON.parse(s.decode(e));else i=e;if(i.asset===void 0||i.asset.version[0]<2){r&&r(Error(`THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.`));return}let c=new nr(i,{path:t||this.resourcePath||``,crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){let t=this.pluginCallbacks[e](c);t.name||console.error(`THREE.GLTFLoader: Invalid plugin found: missing name`),o[t.name]=t,a[t.name]=!0}if(i.extensionsUsed)for(let e=0;e<i.extensionsUsed.length;++e){let t=i.extensionsUsed[e],n=i.extensionsRequired||[];switch(t){case Z.KHR_MATERIALS_UNLIT:a[t]=new dn;break;case Z.KHR_DRACO_MESH_COMPRESSION:a[t]=new Mn(i,this.dracoLoader);break;case Z.KHR_TEXTURE_TRANSFORM:a[t]=new Nn;break;case Z.KHR_MESH_QUANTIZATION:a[t]=new Pn;break;default:n.indexOf(t)>=0&&o[t]===void 0&&console.warn(`THREE.GLTFLoader: Unknown extension "`+t+`".`)}}c.setExtensions(a),c.setPlugins(o),c.parse(n,r)}parseAsync(e,t){let n=this;return new Promise(function(r,i){n.parse(e,t,r,i)})}};function ln(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}function X(e,t,n){let r=e.json.materials[t];return r.extensions&&r.extensions[n]?r.extensions[n]:null}var Z={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`,KHR_MESHOPT_COMPRESSION:`KHR_meshopt_compression`,EXT_MESH_GPU_INSTANCING:`EXT_mesh_gpu_instancing`},un=class{constructor(e){this.parser=e,this.name=Z.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){let r=t[n];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){let t=this.parser,n=`light:`+e,r=t.cache.get(n);if(r)return r;let i=t.json,a=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e],o,s=new c.Color(16777215);a.color!==void 0&&s.setRGB(a.color[0],a.color[1],a.color[2],c.LinearSRGBColorSpace);let l=a.range===void 0?0:a.range;switch(a.type){case`directional`:o=new c.DirectionalLight(s),o.target.position.set(0,0,-1),o.add(o.target);break;case`point`:o=new c.PointLight(s),o.distance=l;break;case`spot`:o=new c.SpotLight(s),o.distance=l,a.spot=a.spot||{},a.spot.innerConeAngle=a.spot.innerConeAngle===void 0?0:a.spot.innerConeAngle,a.spot.outerConeAngle=a.spot.outerConeAngle===void 0?Math.PI/4:a.spot.outerConeAngle,o.angle=a.spot.outerConeAngle,o.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,o.target.position.set(0,0,-1),o.add(o.target);break;default:throw Error(`THREE.GLTFLoader: Unexpected light type: `+a.type)}return o.position.set(0,0,0),Jn(o,a),a.intensity!==void 0&&(o.intensity=a.intensity),o.name=t.createUniqueName(a.name||`light_`+e),r=Promise.resolve(o),t.cache.add(n,r),r}getDependency(e,t){if(e===`light`)return this._loadLight(t)}createNodeAttachment(e){let t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return i===void 0?null:this._loadLight(i).then(function(e){return n._getNodeRef(t.cache,i,e)})}},dn=class{constructor(){this.name=Z.KHR_MATERIALS_UNLIT}getMaterialType(){return c.MeshBasicMaterial}extendParams(e,t,n){let r=[];e.color=new c.Color(1,1,1),e.opacity=1;let i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){let t=i.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],c.LinearSRGBColorSpace),e.opacity=t[3]}i.baseColorTexture!==void 0&&r.push(n.assignTexture(e,`map`,i.baseColorTexture,c.SRGBColorSpace))}return Promise.all(r)}},fn=class{constructor(e){this.parser=e,this.name=Z.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let n=X(this.parser,e,this.name);return n===null||n.emissiveStrength!==void 0&&(t.emissiveIntensity=n.emissiveStrength),Promise.resolve()}},pn=class{constructor(e){this.parser=e,this.name=Z.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){return X(this.parser,e,this.name)===null?null:c.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=X(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];if(n.clearcoatFactor!==void 0&&(t.clearcoat=n.clearcoatFactor),n.clearcoatTexture!==void 0&&r.push(this.parser.assignTexture(t,`clearcoatMap`,n.clearcoatTexture)),n.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=n.clearcoatRoughnessFactor),n.clearcoatRoughnessTexture!==void 0&&r.push(this.parser.assignTexture(t,`clearcoatRoughnessMap`,n.clearcoatRoughnessTexture)),n.clearcoatNormalTexture!==void 0&&(r.push(this.parser.assignTexture(t,`clearcoatNormalMap`,n.clearcoatNormalTexture)),n.clearcoatNormalTexture.scale!==void 0)){let e=n.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new c.Vector2(e,e)}return Promise.all(r)}},mn=class{constructor(e){this.parser=e,this.name=Z.KHR_MATERIALS_DISPERSION}getMaterialType(e){return X(this.parser,e,this.name)===null?null:c.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=X(this.parser,e,this.name);return n===null||(t.dispersion=n.dispersion===void 0?0:n.dispersion),Promise.resolve()}},hn=class{constructor(e){this.parser=e,this.name=Z.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){return X(this.parser,e,this.name)===null?null:c.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=X(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.iridescenceFactor!==void 0&&(t.iridescence=n.iridescenceFactor),n.iridescenceTexture!==void 0&&r.push(this.parser.assignTexture(t,`iridescenceMap`,n.iridescenceTexture)),n.iridescenceIor!==void 0&&(t.iridescenceIOR=n.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),n.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=n.iridescenceThicknessMinimum),n.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=n.iridescenceThicknessMaximum),n.iridescenceThicknessTexture!==void 0&&r.push(this.parser.assignTexture(t,`iridescenceThicknessMap`,n.iridescenceThicknessTexture)),Promise.all(r)}},gn=class{constructor(e){this.parser=e,this.name=Z.KHR_MATERIALS_SHEEN}getMaterialType(e){return X(this.parser,e,this.name)===null?null:c.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=X(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];if(t.sheenColor=new c.Color(0,0,0),t.sheenRoughness=0,t.sheen=1,n.sheenColorFactor!==void 0){let e=n.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],c.LinearSRGBColorSpace)}return n.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=n.sheenRoughnessFactor),n.sheenColorTexture!==void 0&&r.push(this.parser.assignTexture(t,`sheenColorMap`,n.sheenColorTexture,c.SRGBColorSpace)),n.sheenRoughnessTexture!==void 0&&r.push(this.parser.assignTexture(t,`sheenRoughnessMap`,n.sheenRoughnessTexture)),Promise.all(r)}},_n=class{constructor(e){this.parser=e,this.name=Z.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){return X(this.parser,e,this.name)===null?null:c.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=X(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.transmissionFactor!==void 0&&(t.transmission=n.transmissionFactor),n.transmissionTexture!==void 0&&r.push(this.parser.assignTexture(t,`transmissionMap`,n.transmissionTexture)),Promise.all(r)}},vn=class{constructor(e){this.parser=e,this.name=Z.KHR_MATERIALS_VOLUME}getMaterialType(e){return X(this.parser,e,this.name)===null?null:c.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=X(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];t.thickness=n.thicknessFactor===void 0?0:n.thicknessFactor,n.thicknessTexture!==void 0&&r.push(this.parser.assignTexture(t,`thicknessMap`,n.thicknessTexture)),t.attenuationDistance=n.attenuationDistance||1/0;let i=n.attenuationColor||[1,1,1];return t.attenuationColor=new c.Color().setRGB(i[0],i[1],i[2],c.LinearSRGBColorSpace),Promise.all(r)}},yn=class{constructor(e){this.parser=e,this.name=Z.KHR_MATERIALS_IOR}getMaterialType(e){return X(this.parser,e,this.name)===null?null:c.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=X(this.parser,e,this.name);return n===null?Promise.resolve():(t.ior=n.ior===void 0?1.5:n.ior,t.ior===0&&(t.ior=1e3),Promise.resolve())}},bn=class{constructor(e){this.parser=e,this.name=Z.KHR_MATERIALS_SPECULAR}getMaterialType(e){return X(this.parser,e,this.name)===null?null:c.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=X(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];t.specularIntensity=n.specularFactor===void 0?1:n.specularFactor,n.specularTexture!==void 0&&r.push(this.parser.assignTexture(t,`specularIntensityMap`,n.specularTexture));let i=n.specularColorFactor||[1,1,1];return t.specularColor=new c.Color().setRGB(i[0],i[1],i[2],c.LinearSRGBColorSpace),n.specularColorTexture!==void 0&&r.push(this.parser.assignTexture(t,`specularColorMap`,n.specularColorTexture,c.SRGBColorSpace)),Promise.all(r)}},xn=class{constructor(e){this.parser=e,this.name=Z.EXT_MATERIALS_BUMP}getMaterialType(e){return X(this.parser,e,this.name)===null?null:c.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=X(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return t.bumpScale=n.bumpFactor===void 0?1:n.bumpFactor,n.bumpTexture!==void 0&&r.push(this.parser.assignTexture(t,`bumpMap`,n.bumpTexture)),Promise.all(r)}},Sn=class{constructor(e){this.parser=e,this.name=Z.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){return X(this.parser,e,this.name)===null?null:c.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=X(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.anisotropyStrength!==void 0&&(t.anisotropy=n.anisotropyStrength),n.anisotropyRotation!==void 0&&(t.anisotropyRotation=n.anisotropyRotation),n.anisotropyTexture!==void 0&&r.push(this.parser.assignTexture(t,`anisotropyMap`,n.anisotropyTexture)),Promise.all(r)}},Cn=class{constructor(e){this.parser=e,this.name=Z.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;let i=r.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures`);return null}return t.loadTextureImage(e,i.source,a)}},wn=class{constructor(e){this.parser=e,this.name=Z.EXT_TEXTURE_WEBP}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},Tn=class{constructor(e){this.parser=e,this.name=Z.EXT_TEXTURE_AVIF}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},En=class{constructor(e,t){this.name=t,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let e=n.extensions[this.name],r=this.parser.getDependency(`buffer`,e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return r.then(function(t){let n=e.byteOffset||0,r=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}else return null}},Dn=class{constructor(e){this.name=Z.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;let r=t.meshes[n.mesh];for(let e of r.primitives)if(e.mode!==Q.TRIANGLES&&e.mode!==Q.TRIANGLE_STRIP&&e.mode!==Q.TRIANGLE_FAN&&e.mode!==void 0)return null;let i=n.extensions[this.name].attributes,a=[],o={};for(let e in i)a.push(this.parser.getDependency(`accessor`,i[e]).then(t=>(o[e]=t,o[e])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(e=>{let t=e.pop(),n=t.isGroup?t.children:[t],r=e[0].count,i=[];for(let e of n){let t=new c.Matrix4,n=new c.Vector3,a=new c.Quaternion,s=new c.Vector3(1,1,1),l=new c.InstancedMesh(e.geometry,e.material,r);for(let e=0;e<r;e++)o.TRANSLATION&&n.fromBufferAttribute(o.TRANSLATION,e),o.ROTATION&&a.fromBufferAttribute(o.ROTATION,e),o.SCALE&&s.fromBufferAttribute(o.SCALE,e),l.setMatrixAt(e,t.compose(n,a,s));for(let t in o)if(t===`_COLOR_0`){let e=o[t];l.instanceColor=new c.InstancedBufferAttribute(e.array,e.itemSize,e.normalized)}else t!==`TRANSLATION`&&t!==`ROTATION`&&t!==`SCALE`&&e.geometry.setAttribute(t,o[t]);c.Object3D.prototype.copy.call(l,e),this.parser.assignFinalMaterial(l),i.push(l)}return t.isGroup?(t.clear(),t.add(...i),t):i[0]}))}},On=`glTF`,kn=12,An={JSON:1313821514,BIN:5130562},jn=class{constructor(e){this.name=Z.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,kn),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!==On)throw Error(`THREE.GLTFLoader: Unsupported glTF-Binary header.`);if(this.header.version<2)throw Error(`THREE.GLTFLoader: Legacy binary file detected.`);let r=this.header.length-kn,i=new DataView(e,kn),a=0;for(;a<r;){let t=i.getUint32(a,!0);a+=4;let r=i.getUint32(a,!0);if(a+=4,r===An.JSON){let r=new Uint8Array(e,kn+a,t);this.content=n.decode(r)}else if(r===An.BIN){let n=kn+a;this.body=e.slice(n,n+t)}a+=t}if(this.content===null)throw Error(`THREE.GLTFLoader: JSON content not found.`)}},Mn=class{constructor(e,t){if(!t)throw Error(`THREE.GLTFLoader: No DRACOLoader instance provided.`);this.name=Z.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},l={};for(let e in a){let t=Hn[e]||e.toLowerCase();o[t]=a[e]}for(let t in e.attributes){let r=Hn[t]||t.toLowerCase();if(a[t]!==void 0){let i=n.accessors[e.attributes[t]];l[r]=Rn[i.componentType].name,s[r]=i.normalized===!0}}return t.getDependency(`bufferView`,i).then(function(e){return new Promise(function(t,n){r.decodeDracoFile(e,function(e){for(let t in e.attributes){let n=e.attributes[t],r=s[t];r!==void 0&&(n.normalized=r)}t(e)},o,l,c.LinearSRGBColorSpace,n)})})}},Nn=class{constructor(){this.name=Z.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=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)}},Pn=class{constructor(){this.name=Z.KHR_MESH_QUANTIZATION}},Fn=class extends c.Interpolant{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let e=0;e!==r;e++)t[e]=n[i+e];return t}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=o*2,c=o*3,l=r-t,u=(n-t)/l,d=u*u,f=d*u,p=e*c,m=p-c,h=-2*f+3*d,g=f-d,_=1-h,v=g-d+u;for(let e=0;e!==o;e++){let t=a[m+e+o],n=a[m+e+s]*l,r=a[p+e+o],c=a[p+e]*l;i[e]=_*t+v*n+h*r+g*c}return i}},In=new c.Quaternion,Ln=class extends Fn{interpolate_(e,t,n,r){let i=super.interpolate_(e,t,n,r);return In.fromArray(i).normalize().toArray(i),i}},Q={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Rn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},zn={9728:c.NearestFilter,9729:c.LinearFilter,9984:c.NearestMipmapNearestFilter,9985:c.LinearMipmapNearestFilter,9986:c.NearestMipmapLinearFilter,9987:c.LinearMipmapLinearFilter},Bn={33071:c.ClampToEdgeWrapping,33648:c.MirroredRepeatWrapping,10497:c.RepeatWrapping},Vn={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Hn={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`},Un={scale:`scale`,translation:`position`,rotation:`quaternion`,weights:`morphTargetInfluences`},Wn={CUBICSPLINE:void 0,LINEAR:c.InterpolateLinear,STEP:c.InterpolateDiscrete},Gn={OPAQUE:`OPAQUE`,MASK:`MASK`,BLEND:`BLEND`};function Kn(e){return e.DefaultMaterial===void 0&&(e.DefaultMaterial=new c.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:c.FrontSide})),e.DefaultMaterial}function qn(e,t,n){for(let r in n.extensions)e[r]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function Jn(e,t){t.extras!==void 0&&(typeof t.extras==`object`?Object.assign(e.userData,t.extras):console.warn(`THREE.GLTFLoader: Ignoring primitive type .extras, `+t.extras))}function Yn(e,t,n){let r=!1,i=!1,a=!1;for(let e=0,n=t.length;e<n;e++){let n=t[e];if(n.POSITION!==void 0&&(r=!0),n.NORMAL!==void 0&&(i=!0),n.COLOR_0!==void 0&&(a=!0),r&&i&&a)break}if(!r&&!i&&!a)return Promise.resolve(e);let o=[],s=[],c=[];for(let l=0,u=t.length;l<u;l++){let u=t[l];if(r){let t=u.POSITION===void 0?e.attributes.position:n.getDependency(`accessor`,u.POSITION);o.push(t)}if(i){let t=u.NORMAL===void 0?e.attributes.normal:n.getDependency(`accessor`,u.NORMAL);s.push(t)}if(a){let t=u.COLOR_0===void 0?e.attributes.color:n.getDependency(`accessor`,u.COLOR_0);c.push(t)}}return Promise.all([Promise.all(o),Promise.all(s),Promise.all(c)]).then(function(t){let n=t[0],o=t[1],s=t[2];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=o),a&&(e.morphAttributes.color=s),e.morphTargetsRelative=!0,e})}function Xn(e,t){if(e.updateMorphTargets(),t.weights!==void 0)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){let n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn(`THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.`)}}function Zn(e){let t,n=e.extensions&&e.extensions[Z.KHR_DRACO_MESH_COMPRESSION];if(t=n?`draco:`+n.bufferView+`:`+n.indices+`:`+Qn(n.attributes):e.indices+`:`+Qn(e.attributes)+`:`+e.mode,e.targets!==void 0)for(let n=0,r=e.targets.length;n<r;n++)t+=`:`+Qn(e.targets[n]);return t}function Qn(e){let t=``,n=Object.keys(e).sort();for(let r=0,i=n.length;r<i;r++)t+=n[r]+`:`+e[n[r]]+`;`;return t}function $n(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw Error(`THREE.GLTFLoader: Unsupported normalized accessor component type.`)}}function er(e){return e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0?`image/jpeg`:e.search(/\.webp($|\?)/i)>0||e.search(/^data\:image\/webp/)===0?`image/webp`:e.search(/\.ktx2($|\?)/i)>0||e.search(/^data\:image\/ktx2/)===0?`image/ktx2`:`image/png`}var tr=new c.Matrix4,nr=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new ln,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,i=!1,a=-1;if(typeof navigator<`u`&&navigator.userAgent!==void 0){let e=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(e)===!0;let t=e.match(/Version\/(\d+)/);r=n&&t?parseInt(t[1],10):-1,i=e.indexOf(`Firefox`)>-1,a=i?e.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>`u`||n&&r<17||i&&a<98?this.textureLoader=new c.TextureLoader(this.options.manager):this.textureLoader=new c.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new c.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){let n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([n.getDependencies(`scene`),n.getDependencies(`animation`),n.getDependencies(`camera`)])}).then(function(t){let a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};return qn(i,a,r),Jn(a,r),Promise.all(n._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){for(let e of a.scenes)e.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n<r;n++){let r=t[n].joints;for(let t=0,n=r.length;t<n;t++)e[r[t]].isBone=!0}for(let t=0,r=e.length;t<r;t++){let r=e[t];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(n[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.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;let r=n.clone(),i=(e,t)=>{let n=this.associations.get(e);n!=null&&this.associations.set(t,n);for(let[n,r]of e.children.entries())i(r,t.children[n])};return i(n,r),r.name+=`_instance_`+ e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){let r=e(t[n]);if(r)return r}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let n=[];for(let r=0;r<t.length;r++){let i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){let n=e+`:`+t,r=this.cache.get(n);if(!r){switch(e){case`scene`:r=this.loadScene(t);break;case`node`:r=this._invokeOne(function(e){return e.loadNode&&e.loadNode(t)});break;case`mesh`:r=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case`accessor`:r=this.loadAccessor(t);break;case`bufferView`:r=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case`buffer`:r=this.loadBuffer(t);break;case`material`:r=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case`texture`:r=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case`skin`:r=this.loadSkin(t);break;case`animation`:r=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case`camera`:r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}),!r)throw Error(`Unknown type: `+e);break}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){let n=this,r=this.json[e+(e===`mesh`?`es`:`s`)]||[];t=Promise.all(r.map(function(t,r){return n.getDependency(e,r)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!==`arraybuffer`)throw Error(`THREE.GLTFLoader: `+t.type+` buffer type is not supported.`);if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Z.KHR_BINARY_GLTF].body);let r=this.options;return new Promise(function(e,i){n.load(c.LoaderUtils.resolveURL(t.uri,r.path),e,void 0,function(){i(Error(`THREE.GLTFLoader: Failed to load buffer "`+t.uri+`".`))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency(`buffer`,t.buffer).then(function(e){let n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)})}loadAccessor(e){let t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){let e=Vn[r.type],t=Rn[r.componentType],n=r.normalized===!0,i=new t(r.count*e);return Promise.resolve(new c.BufferAttribute(i,e,n))}let i=[];return r.bufferView===void 0?i.push(null):i.push(this.getDependency(`bufferView`,r.bufferView)),r.sparse!==void 0&&(i.push(this.getDependency(`bufferView`,r.sparse.indices.bufferView)),i.push(this.getDependency(`bufferView`,r.sparse.values.bufferView))),Promise.all(i).then(function(e){let i=e[0],a=Vn[r.type],o=Rn[r.componentType],s=o.BYTES_PER_ELEMENT,l=s*a,u=r.byteOffset||0,d=r.bufferView===void 0?void 0:n.bufferViews[r.bufferView].byteStride,f=r.normalized===!0,p,m;if(d&&d!==l){let e=Math.floor(u/d),n=`InterleavedBuffer:`+r.bufferView+`:`+r.componentType+`:`+e+`:`+r.count,l=t.cache.get(n);l||(p=new o(i,e*d,r.count*d/s),l=new c.InterleavedBuffer(p,d/s),t.cache.add(n,l)),m=new c.InterleavedBufferAttribute(l,a,u%d/s,f)}else p=i===null?new o(r.count*a):new o(i,u,r.count*a),m=new c.BufferAttribute(p,a,f);if(r.sparse!==void 0){let t=Vn.SCALAR,n=Rn[r.sparse.indices.componentType],s=r.sparse.indices.byteOffset||0,l=r.sparse.values.byteOffset||0,u=new n(e[1],s,r.sparse.count*t),d=new o(e[2],l,r.sparse.count*a);i!==null&&(m=new c.BufferAttribute(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let e=0,t=u.length;e<t;e++){let t=u[e];if(m.setX(t,d[e*a]),a>=2&&m.setY(t,d[e*a+1]),a>=3&&m.setZ(t,d[e*a+2]),a>=4&&m.setW(t,d[e*a+3]),a>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}m.normalized=f}return m})}loadTexture(e){let t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r],a=this.textureLoader;if(i.uri){let e=n.manager.getHandler(i.uri);e!==null&&(a=e)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){let r=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+`:`+a.sampler;if(this.textureCache[s])return this.textureCache[s];let l=this.loadImageSource(t,n).then(function(t){t.flipY=!1,t.name=a.name||o.name||``,t.name===``&&typeof o.uri==`string`&&o.uri.startsWith(`data:image/`)===!1&&(t.name=o.uri);let n=(i.samplers||{})[a.sampler]||{};return t.magFilter=zn[n.magFilter]||c.LinearFilter,t.minFilter=zn[n.minFilter]||c.LinearMipmapLinearFilter,t.wrapS=Bn[n.wrapS]||c.RepeatWrapping,t.wrapT=Bn[n.wrapT]||c.RepeatWrapping,t.generateMipmaps=!t.isCompressedTexture&&t.minFilter!==c.NearestFilter&&t.minFilter!==c.LinearFilter,r.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=l,l}loadImageSource(e,t){let n=this,r=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(e=>e.clone());let a=r.images[e],o=self.URL||self.webkitURL,s=a.uri||``,l=!1;if(a.bufferView!==void 0)s=n.getDependency(`bufferView`,a.bufferView).then(function(e){l=!0;let t=new Blob([e],{type:a.mimeType});return s=o.createObjectURL(t),s});else if(a.uri===void 0)throw Error(`THREE.GLTFLoader: Image `+e+` is missing URI and bufferView`);let u=Promise.resolve(s).then(function(e){return new Promise(function(n,r){let a=n;t.isImageBitmapLoader===!0&&(a=function(e){let t=new c.Texture(e);t.needsUpdate=!0,n(t)}),t.load(c.LoaderUtils.resolveURL(e,i.path),a,void 0,r)})}).then(function(e){return l===!0&&o.revokeObjectURL(s),Jn(e,a),e.userData.mimeType=a.mimeType||er(a.uri),e}).catch(function(e){throw console.error(`THREE.GLTFLoader: Couldn't load texture`,s),e});return this.sourceCache[e]=u,u}assignTexture(e,t,n,r){let i=this;return this.getDependency(`texture`,n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),i.extensions[Z.KHR_TEXTURE_TRANSFORM]){let e=n.extensions===void 0?void 0:n.extensions[Z.KHR_TEXTURE_TRANSFORM];if(e){let t=i.associations.get(a);a=i.extensions[Z.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return r!==void 0&&(a.colorSpace=r),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,n=e.material,r=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){let e=`PointsMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new c.PointsMaterial,c.Material.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){let e=`LineBasicMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new c.LineBasicMaterial,c.Material.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(r||i||a){let e=`ClonedMaterial:`+n.uuid+`:`;r&&(e+=`derivative-tangents:`),i&&(e+=`vertex-colors:`),a&&(e+=`flat-shading:`);let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return c.MeshStandardMaterial}loadMaterial(e){let t=this,n=this.json,r=this.extensions,i=n.materials[e],a,o={},s=i.extensions||{},l=[];if(s[Z.KHR_MATERIALS_UNLIT]){let e=r[Z.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),l.push(e.extendParams(o,i,t))}else{let n=i.pbrMetallicRoughness||{};if(o.color=new c.Color(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],c.LinearSRGBColorSpace),o.opacity=e[3]}n.baseColorTexture!==void 0&&l.push(t.assignTexture(o,`map`,n.baseColorTexture,c.SRGBColorSpace)),o.metalness=n.metallicFactor===void 0?1:n.metallicFactor,o.roughness=n.roughnessFactor===void 0?1:n.roughnessFactor,n.metallicRoughnessTexture!==void 0&&(l.push(t.assignTexture(o,`metalnessMap`,n.metallicRoughnessTexture)),l.push(t.assignTexture(o,`roughnessMap`,n.metallicRoughnessTexture))),a=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}i.doubleSided===!0&&(o.side=c.DoubleSide);let u=i.alphaMode||Gn.OPAQUE;if(u===Gn.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,u===Gn.MASK&&(o.alphaTest=i.alphaCutoff===void 0?.5:i.alphaCutoff)),i.normalTexture!==void 0&&a!==c.MeshBasicMaterial&&(l.push(t.assignTexture(o,`normalMap`,i.normalTexture)),o.normalScale=new c.Vector2(1,1),i.normalTexture.scale!==void 0)){let e=i.normalTexture.scale;o.normalScale.set(e,e)}if(i.occlusionTexture!==void 0&&a!==c.MeshBasicMaterial&&(l.push(t.assignTexture(o,`aoMap`,i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&a!==c.MeshBasicMaterial){let e=i.emissiveFactor;o.emissive=new c.Color().setRGB(e[0],e[1],e[2],c.LinearSRGBColorSpace)}return i.emissiveTexture!==void 0&&a!==c.MeshBasicMaterial&&l.push(t.assignTexture(o,`emissiveMap`,i.emissiveTexture,c.SRGBColorSpace)),Promise.all(l).then(function(){let n=new a(o);return i.name&&(n.name=i.name),Jn(n,i),t.associations.set(n,{materials:e}),i.extensions&&qn(r,n,i),n})}createUniqueName(e){let t=c.PropertyBinding.sanitizeNodeName(e||``);return t in this.nodeNamesUsed?t+`_`+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[Z.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(n){return ir(n,e,t)})}let a=[];for(let n=0,o=e.length;n<o;n++){let o=e[n],s=Zn(o),l=r[s];if(l)a.push(l.promise);else{let e;e=o.extensions&&o.extensions[Z.KHR_DRACO_MESH_COMPRESSION]?i(o):ir(new c.BufferGeometry,o,t),r[s]={primitive:o,promise:e},a.push(e)}}return Promise.all(a)}loadMesh(e){let t=this,n=this.json,r=this.extensions,i=n.meshes[e],a=i.primitives,o=[];for(let e=0,t=a.length;e<t;e++){let t=a[e].material===void 0?Kn(this.cache):this.getDependency(`material`,a[e].material);o.push(t)}return o.push(t.loadGeometries(a)),Promise.all(o).then(function(n){let o=n.slice(0,n.length-1),s=n[n.length-1],l=[];for(let n=0,u=s.length;n<u;n++){let u=s[n],d=a[n],f,p=o[n];if(d.mode===Q.TRIANGLES||d.mode===Q.TRIANGLE_STRIP||d.mode===Q.TRIANGLE_FAN||d.mode===void 0)f=i.isSkinnedMesh===!0?new c.SkinnedMesh(u,p):new c.Mesh(u,p),f.isSkinnedMesh===!0&&f.normalizeSkinWeights(),d.mode===Q.TRIANGLE_STRIP?f.geometry=an(f.geometry,c.TriangleStripDrawMode):d.mode===Q.TRIANGLE_FAN&&(f.geometry=an(f.geometry,c.TriangleFanDrawMode));else if(d.mode===Q.LINES)f=new c.LineSegments(u,p);else if(d.mode===Q.LINE_STRIP)f=new c.Line(u,p);else if(d.mode===Q.LINE_LOOP)f=new c.LineLoop(u,p);else if(d.mode===Q.POINTS)f=new c.Points(u,p);else throw Error(`THREE.GLTFLoader: Primitive mode unsupported: `+d.mode);Object.keys(f.geometry.morphAttributes).length>0&&Xn(f,i),f.name=t.createUniqueName(i.name||`mesh_`+e),Jn(f,i),d.extensions&&qn(r,f,d),t.assignFinalMaterial(f),l.push(f)}for(let n=0,r=l.length;n<r;n++)t.associations.set(l[n],{meshes:e,primitives:n});if(l.length===1)return i.extensions&&qn(r,l[0],i),l[0];let u=new c.Group;i.extensions&&qn(r,u,i),t.associations.set(u,{meshes:e});for(let e=0,t=l.length;e<t;e++)u.add(l[e]);return u})}loadCamera(e){let t,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 c.PerspectiveCamera(c.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type===`orthographic`&&(t=new c.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),Jn(t,n),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],n=[];for(let e=0,r=t.joints.length;e<r;e++)n.push(this._loadNodeShallow(t.joints[e]));return t.inverseBindMatrices===void 0?n.push(null):n.push(this.getDependency(`accessor`,t.inverseBindMatrices)),Promise.all(n).then(function(e){let n=e.pop(),r=e,i=[],a=[];for(let e=0,o=r.length;e<o;e++){let o=r[e];if(o){i.push(o);let t=new c.Matrix4;n!==null&&t.fromArray(n.array,e*16),a.push(t)}else console.warn(`THREE.GLTFLoader: Joint "%s" could not be found.`,t.joints[e])}return new c.Skeleton(i,a)})}loadAnimation(e){let t=this.json,n=this,r=t.animations[e],i=r.name?r.name:`animation_`+e,a=[],o=[],s=[],l=[],u=[];for(let e=0,t=r.channels.length;e<t;e++){let t=r.channels[e],n=r.samplers[t.sampler],i=t.target,c=i.node,d=r.parameters===void 0?n.input:r.parameters[n.input],f=r.parameters===void 0?n.output:r.parameters[n.output];i.node!==void 0&&(a.push(this.getDependency(`node`,c)),o.push(this.getDependency(`accessor`,d)),s.push(this.getDependency(`accessor`,f)),l.push(n),u.push(i))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(s),Promise.all(l),Promise.all(u)]).then(function(e){let t=e[0],a=e[1],o=e[2],s=e[3],l=e[4],u=[];for(let e=0,r=t.length;e<r;e++){let r=t[e],i=a[e],c=o[e],d=s[e],f=l[e];if(r===void 0)continue;r.updateMatrix&&r.updateMatrix();let p=n._createAnimationTracks(r,i,c,d,f);if(p)for(let e=0;e<p.length;e++)u.push(p[e])}let d=new c.AnimationClip(i,void 0,u);return Jn(d,r),d})}createNodeMesh(e){let t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency(`mesh`,r.mesh).then(function(e){let t=n._getNodeRef(n.meshCache,r.mesh,e);return r.weights!==void 0&&t.traverse(function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]}),t})}loadNode(e){let t=this.json,n=this,r=t.nodes[e],i=n._loadNodeShallow(e),a=[],o=r.children||[];for(let e=0,t=o.length;e<t;e++)a.push(n.getDependency(`node`,o[e]));let s=r.skin===void 0?Promise.resolve(null):n.getDependency(`skin`,r.skin);return Promise.all([i,Promise.all(a),s]).then(function(e){let t=e[0],n=e[1],r=e[2];r!==null&&t.traverse(function(e){e.isSkinnedMesh&&e.bind(r,tr)});for(let e=0,r=n.length;e<r;e++)t.add(n[e]);if(t.userData.pivot!==void 0&&n.length>0){let e=t.userData.pivot,r=n[0];t.pivot=new c.Vector3().fromArray(e),t.position.x-=e[0],t.position.y-=e[1],t.position.z-=e[2],r.position.set(0,0,0),delete t.userData.pivot}return t})}_loadNodeShallow(e){let t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];let i=t.nodes[e],a=i.name?r.createUniqueName(i.name):``,o=[],s=r._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return s&&o.push(s),i.camera!==void 0&&o.push(r.getDependency(`camera`,i.camera).then(function(e){return r._getNodeRef(r.cameraCache,i.camera,e)})),r._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){o.push(e)}),this.nodeCache[e]=Promise.all(o).then(function(t){let o;if(o=i.isBone===!0?new c.Bone:t.length>1?new c.Group:t.length===1?t[0]:new c.Object3D,o!==t[0])for(let e=0,n=t.length;e<n;e++)o.add(t[e]);if(i.name&&(o.userData.name=i.name,o.name=a),Jn(o,i),i.extensions&&qn(n,o,i),i.matrix!==void 0){let e=new c.Matrix4;e.fromArray(i.matrix),o.applyMatrix4(e)}else i.translation!==void 0&&o.position.fromArray(i.translation),i.rotation!==void 0&&o.quaternion.fromArray(i.rotation),i.scale!==void 0&&o.scale.fromArray(i.scale);if(!r.associations.has(o))r.associations.set(o,{});else if(i.mesh!==void 0&&r.meshCache.refs[i.mesh]>1){let e=r.associations.get(o);r.associations.set(o,{...e})}return r.associations.get(o).nodes=e,o}),this.nodeCache[e]}loadScene(e){let t=this.extensions,n=this.json.scenes[e],r=this,i=new c.Group;n.name&&(i.name=r.createUniqueName(n.name)),Jn(i,n),n.extensions&&qn(t,i,n);let a=n.nodes||[],o=[];for(let e=0,t=a.length;e<t;e++)o.push(r.getDependency(`node`,a[e]));return Promise.all(o).then(function(e){for(let t=0,n=e.length;t<n;t++){let n=e[t];n.parent===null?i.add(n):i.add(on(n))}return r.associations=(e=>{let t=new Map;for(let[e,n]of r.associations)(e instanceof c.Material||e instanceof c.Texture)&&t.set(e,n);return e.traverse(e=>{let n=r.associations.get(e);n!=null&&t.set(e,n)}),t})(i),i})}_createAnimationTracks(e,t,n,r,i){let a=[],o=e.name?e.name:e.uuid,s=[];function l(e){e.morphTargetInfluences&&s.push(e.name?e.name:e.uuid)}Un[i.path]===Un.weights?(l(e),e.isGroup&&e.children.forEach(l)):s.push(o);let u;switch(Un[i.path]){case Un.weights:u=c.NumberKeyframeTrack;break;case Un.rotation:u=c.QuaternionKeyframeTrack;break;case Un.translation:case Un.scale:u=c.VectorKeyframeTrack;break;default:switch(n.itemSize){case 1:u=c.NumberKeyframeTrack;break;default:u=c.VectorKeyframeTrack;break}break}let d=r.interpolation===void 0?c.InterpolateLinear:Wn[r.interpolation],f=this._getArrayFromAccessor(n);for(let e=0,n=s.length;e<n;e++){let n=new u(s[e]+`.`+Un[i.path],t.array,f,d);r.interpolation===`CUBICSPLINE`&&this._createCubicSplineTrackInterpolant(n),a.push(n)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let e=$n(t.constructor),n=new Float32Array(t.length);for(let r=0,i=t.length;r<i;r++)n[r]=t[r]*e;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof c.QuaternionKeyframeTrack?Ln:Fn)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}};function rr(e,t,n){let r=t.attributes,i=new c.Box3;if(r.POSITION!==void 0){let e=n.json.accessors[r.POSITION],t=e.min,a=e.max;if(t!==void 0&&a!==void 0){if(i.set(new c.Vector3(t[0],t[1],t[2]),new c.Vector3(a[0],a[1],a[2])),e.normalized){let t=$n(Rn[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}else{console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`);return}}else return;let a=t.targets;if(a!==void 0){let e=new c.Vector3,t=new c.Vector3;for(let r=0,i=a.length;r<i;r++){let i=a[r];if(i.POSITION!==void 0){let r=n.json.accessors[i.POSITION],a=r.min,o=r.max;if(a!==void 0&&o!==void 0){if(t.setX(Math.max(Math.abs(a[0]),Math.abs(o[0]))),t.setY(Math.max(Math.abs(a[1]),Math.abs(o[1]))),t.setZ(Math.max(Math.abs(a[2]),Math.abs(o[2]))),r.normalized){let e=$n(Rn[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`)}}i.expandByVector(e)}e.boundingBox=i;let o=new c.Sphere;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=o}function ir(e,t,n){let r=t.attributes,i=[];function a(t,r){return n.getDependency(`accessor`,t).then(function(t){e.setAttribute(r,t)})}for(let t in r){let n=Hn[t]||t.toLowerCase();n in e.attributes||i.push(a(r[t],n))}if(t.indices!==void 0&&!e.index){let r=n.getDependency(`accessor`,t.indices).then(function(t){e.setIndex(t)});i.push(r)}return c.ColorManagement.workingColorSpace!==c.LinearSRGBColorSpace&&`COLOR_0`in r&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${c.ColorManagement.workingColorSpace}" not supported.`),Jn(e,t),rr(e,t,n),Promise.all(i).then(function(){return t.targets===void 0?e:Yn(e,t.targets,n)})}var ar=new WeakMap,or=class extends c.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){let i=new c.FileLoader(this.manager);i.setPath(this.path),i.setResponseType(`arraybuffer`),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,e=>{this.parse(e,t,r)},n,r)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,c.SRGBColorSpace,n).catch(n)}decodeDracoFile(e,t,n,r,i=c.LinearSRGBColorSpace,a=()=>{}){let o={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:i};return this.decodeGeometry(e,o).then(t).catch(a)}decodeGeometry(e,t){let n=JSON.stringify(t);if(ar.has(e)){let t=ar.get(e);if(t.key===n)return t.promise;if(e.byteLength===0)throw Error(`THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.`)}let r,i=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(i,a).then(n=>(r=n,new Promise((n,a)=>{r._callbacks[i]={resolve:n,reject:a},r.postMessage({type:`decode`,id:i,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),ar.set(e,{key:n,promise:o}),o}_createGeometry(e){let t=new c.BufferGeometry;e.index&&t.setIndex(new c.BufferAttribute(e.index.array,1));for(let n=0;n<e.attributes.length;n++){let{name:r,array:i,itemSize:a,stride:o,vertexColorSpace:s}=e.attributes[n],l;l=a===o?new c.BufferAttribute(i,a):new c.InterleavedBufferAttribute(new c.InterleavedBuffer(i,o),a,0),r===`color`&&(this._assignVertexColorSpace(l,s),l.normalized=!(i instanceof Float32Array)),t.setAttribute(r,l)}return t}_assignVertexColorSpace(e,t){if(t!==c.SRGBColorSpace)return;let n=new c.Color;for(let t=0,r=e.count;t<r;t++)n.fromBufferAttribute(e,t),c.ColorManagement.colorSpaceToWorking(n,c.SRGBColorSpace),e.setXYZ(t,n.r,n.g,n.b)}_loadLibrary(e,t){let n=new c.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((t,r)=>{n.load(e,t,void 0,r)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let 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(t=>{let n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let r=sr.toString(),i=[`/* draco decoder */`,n,``,`/* worker */`,r.substring(r.indexOf(`{`)+1,r.lastIndexOf(`}`))].join(`
141
+ `);this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:`init`,decoderConfig:this.decoderConfig}),e.onmessage=function(t){let n=t.data;switch(n.type){case`decode`:e._callbacks[n.id].resolve(n);break;case`error`:e._callbacks[n.id].reject(n);break;default:console.error(`THREE.DRACOLoader: Unexpected message, "`+n.type+`"`)}},this.workerPool.push(e)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});let 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 sr(){let e,t;onmessage=function(r){let i=r.data;switch(i.type){case`init`:e=i.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case`decode`:let r=i.buffer,a=i.taskConfig;t.then(e=>{let t=e.draco,o=new t.Decoder;try{let e=n(t,o,new Int8Array(r),a),s=e.attributes.map(e=>e.array.buffer);e.index&&s.push(e.index.array.buffer),self.postMessage({type:`decode`,id:i.id,geometry:e},s)}catch(e){console.error(e),self.postMessage({type:`error`,id:i.id,error:e.message})}finally{t.destroy(o)}});break}};function n(e,t,n,a){let o=a.attributeIDs,s=a.attributeTypes,c,l,u=t.GetEncodedGeometryType(n);if(u===e.TRIANGULAR_MESH)c=new e.Mesh,l=t.DecodeArrayToMesh(n,n.byteLength,c);else if(u===e.POINT_CLOUD)c=new e.PointCloud,l=t.DecodeArrayToPointCloud(n,n.byteLength,c);else throw Error(`THREE.DRACOLoader: Unexpected geometry type.`);if(!l.ok()||c.ptr===0)throw Error(`THREE.DRACOLoader: Decoding failed: `+l.error_msg());let d={index:null,attributes:[]};for(let n in o){let r=self[s[n]],l,u;if(a.useUniqueIDs)u=o[n],l=t.GetAttributeByUniqueId(c,u);else{if(u=t.GetAttributeId(c,e[o[n]]),u===-1)continue;l=t.GetAttribute(c,u)}let f=i(e,t,c,n,r,l);n===`color`&&(f.vertexColorSpace=a.vertexColorSpace),d.attributes.push(f)}return u===e.TRIANGULAR_MESH&&(d.index=r(e,t,c)),e.destroy(c),d}function r(e,t,n){let r=n.num_faces()*3,i=r*4,a=e._malloc(i);t.GetTrianglesUInt32Array(n,i,a);let o=new Uint32Array(e.HEAPF32.buffer,a,r).slice();return e._free(a),{array:o,itemSize:1}}function i(e,t,n,r,i,o){let s=n.num_points(),c=o.num_components(),l=a(e,i),u=c*i.BYTES_PER_ELEMENT,d=Math.ceil(u/4)*4,f=d/i.BYTES_PER_ELEMENT,p=s*u,m=s*d,h=e._malloc(p);t.GetAttributeDataArrayForAllPoints(n,o,l,p,h);let g=new i(e.HEAPF32.buffer,h,p/i.BYTES_PER_ELEMENT),_;if(u===d)_=g.slice();else{_=new i(m/i.BYTES_PER_ELEMENT);let e=0;for(let t=0,n=g.length;t<n;t++){for(let n=0;n<c;n++)_[e+n]=g[t*c+n];e+=f}}return e._free(h),{name:r,count:s,itemSize:c,array:_,stride:f}}function a(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}}var cr=class{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}_initWorker(e){if(!this.workers[e]){let 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){let n=this.workersResolve[e];if(n&&n(t),this.queue.length){let{resolve:t,msg:n,transfer:r}=this.queue.shift();this.workersResolve[e]=t,this.workers[e].postMessage(n,r)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{let r=this._getIdleWorker();r===-1?this.queue.push({resolve:n,msg:e,transfer:t}):(this._initWorker(r),this.workerStatus|=1<<r,this.workersResolve[r]=n,this.workers[r].postMessage(e,t))})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}},lr=1000054e3,ur=1000054001,dr=1000054004,fr=1000054005,pr=1000066e3,mr=1000066004,hr=class{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(){let e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){let e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){let e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){let e=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){let e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){let 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){let n=this._offset,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)}};new Uint8Array([0]);var $=[171,75,84,88,32,50,48,187,13,10,26,10];function gr(e){return new TextDecoder().decode(e)}function _r(e){let t=new Uint8Array(e.buffer,e.byteOffset,$.length);if(t[0]!==$[0]||t[1]!==$[1]||t[2]!==$[2]||t[3]!==$[3]||t[4]!==$[4]||t[5]!==$[5]||t[6]!==$[6]||t[7]!==$[7]||t[8]!==$[8]||t[9]!==$[9]||t[10]!==$[10]||t[11]!==$[11])throw Error(`Missing KTX 2.0 identifier.`);let n={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},r=17*Uint32Array.BYTES_PER_ELEMENT,i=new hr(e,$.length,r,!0);n.vkFormat=i._nextUint32(),n.typeSize=i._nextUint32(),n.pixelWidth=i._nextUint32(),n.pixelHeight=i._nextUint32(),n.pixelDepth=i._nextUint32(),n.layerCount=i._nextUint32(),n.faceCount=i._nextUint32(),n.levelCount=i._nextUint32(),n.supercompressionScheme=i._nextUint32();let a=i._nextUint32(),o=i._nextUint32(),s=i._nextUint32(),c=i._nextUint32(),l=i._nextUint64(),u=i._nextUint64(),d=3*Math.max(n.levelCount,1)*8,f=new hr(e,$.length+r,d,!0);for(let t=0,r=Math.max(n.levelCount,1);t<r;t++)n.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+f._nextUint64(),f._nextUint64()),uncompressedByteLength:f._nextUint64()});let p=new hr(e,a,o,!0);p._skip(4);let m=p._nextUint16(),h=p._nextUint16(),g=p._nextUint16(),_=p._nextUint16(),v={vendorId:m,descriptorType:h,versionNumber:g,colorModel:p._nextUint8(),colorPrimaries:p._nextUint8(),transferFunction:p._nextUint8(),flags:p._nextUint8(),texelBlockDimension:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],bytesPlane:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],samples:[]},y=(_/4-6)/4;for(let e=0;e<y;e++){let t={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&t.channelType?(t.sampleLower=p._nextInt32(),t.sampleUpper=p._nextInt32()):(t.sampleLower=p._nextUint32(),t.sampleUpper=p._nextUint32()),v.samples[e]=t}n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(v);let b=new hr(e,s,c,!0);for(;b._offset<c;){let e=b._nextUint32(),t=b._scan(e),r=gr(t);if(n.keyValue[r]=b._nextUint8Array(e-t.byteLength-1),r.match(/^ktx/i)){let e=gr(n.keyValue[r]);n.keyValue[r]=e.substring(0,e.lastIndexOf(`\0`))}b._skip(e%4?4-e%4:0)}if(u<=0)return n;let x=new hr(e,l,u,!0),S=x._nextUint16(),C=x._nextUint16(),w=x._nextUint32(),T=x._nextUint32(),E=x._nextUint32(),D=x._nextUint32(),O=[];for(let e=0,t=Math.max(n.levelCount,1);e<t;e++)O.push({imageFlags:x._nextUint32(),rgbSliceByteOffset:x._nextUint32(),rgbSliceByteLength:x._nextUint32(),alphaSliceByteOffset:x._nextUint32(),alphaSliceByteLength:x._nextUint32()});let k=l+x._offset,A=k+w,j=A+T,M=j+E;return n.globalData={endpointCount:S,selectorCount:C,imageDescs:O,endpointsData:new Uint8Array(e.buffer,e.byteOffset+k,w),selectorsData:new Uint8Array(e.buffer,e.byteOffset+A,T),tablesData:new Uint8Array(e.buffer,e.byteOffset+j,E),extendedData:new Uint8Array(e.buffer,e.byteOffset+M,D)},n}var vr,yr,br,xr={env:{emscripten_notify_memory_growth:function(e){br=new Uint8Array(yr.exports.memory.buffer)}}},Sr=class{init(){return vr||(vr=typeof fetch<`u`?fetch(`data:application/wasm;base64,`+Cr).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,xr)).then(this._init):WebAssembly.instantiate(Buffer.from(Cr,`base64`),xr).then(this._init),vr)}_init(e){yr=e.instance,xr.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!yr)throw Error(`ZSTDDecoder: Await .init() before decoding.`);let n=e.byteLength,r=yr.exports.malloc(n);br.set(e,r),t||=Number(yr.exports.ZSTD_findDecompressedSize(r,n));let i=yr.exports.malloc(t),a=yr.exports.ZSTD_decompress(i,t,r,n),o=br.slice(i,i+a);return yr.exports.free(r),yr.exports.free(i),o}},Cr=`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/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJ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xIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQ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EBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACAB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8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ`,wr=`display-p3`,Tr=`display-p3-linear`;({...c.ColorManagement.spaces[c.SRGBColorSpace]}),c.SRGBColorSpace;var Er=new WeakMap,Dr=0,Or,kr=class e extends c.Loader{constructor(e){super(e),this.transcoderPath=``,this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new cr,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!==void 0&&navigator.userAgent!==void 0&&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){let t=new c.FileLoader(this.manager);t.setPath(this.transcoderPath),t.setWithCredentials(this.withCredentials);let n=t.loadAsync(`basis_transcoder.js`),r=new c.FileLoader(this.manager);r.setPath(this.transcoderPath),r.setResponseType(`arraybuffer`),r.setWithCredentials(this.withCredentials);let i=r.loadAsync(`basis_transcoder.wasm`);this.transcoderPending=Promise.all([n,i]).then(([t,n])=>{let r=e.BasisWorker.toString(),i=[`/* constants */`,`let _EngineFormat = `+JSON.stringify(e.EngineFormat),`let _EngineType = `+JSON.stringify(e.EngineType),`let _TranscoderFormat = `+JSON.stringify(e.TranscoderFormat),`let _BasisFormat = `+JSON.stringify(e.BasisFormat),`/* basis_transcoder.js */`,t,`/* worker */`,r.substring(r.indexOf(`{`)+1,r.lastIndexOf(`}`))].join(`
142
+ `);this.workerSourceURL=URL.createObjectURL(new Blob([i])),this.transcoderBinary=n,this.workerPool.setWorkerCreator(()=>{let e=new Worker(this.workerSourceURL),t=this.transcoderBinary.slice(0);return e.postMessage({type:`init`,config:this.workerConfig,transcoderBinary:t},[t]),e})}),Dr>0&&console.warn(`THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances.`),Dr++}return this.transcoderPending}load(e,t,n,r){if(this.workerConfig===null)throw Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");let i=new c.FileLoader(this.manager);i.setPath(this.path),i.setCrossOrigin(this.crossOrigin),i.setWithCredentials(this.withCredentials),i.setRequestHeader(this.requestHeader),i.setResponseType(`arraybuffer`),i.load(e,e=>{this.parse(e,t,r)},n,r)}parse(e,t,n){if(this.workerConfig===null)throw Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Er.has(e))return Er.get(e).promise.then(t).catch(n);this._createTexture(e).then(e=>t?t(e):null).catch(n)}_createTextureFrom(e,t){let{type:n,error:r,data:{faces:i,width:a,height:o,format:s,type:l,dfdFlags:u}}=e;if(n===`error`)return Promise.reject(r);let d;if(t.faceCount===6)d=new c.CompressedCubeTexture(i,s,l);else{let e=i[0].mipmaps;d=t.layerCount>1?new c.CompressedArrayTexture(e,a,o,t.layerCount,s,l):new c.CompressedTexture(e,a,o,s,l)}return d.minFilter=i[0].mipmaps.length===1?c.LinearFilter:c.LinearMipmapLinearFilter,d.magFilter=c.LinearFilter,d.generateMipmaps=!1,d.needsUpdate=!0,d.colorSpace=Pr(t),d.premultiplyAlpha=!!(u&1),d}async _createTexture(e,t={}){let n=_r(new Uint8Array(e)),r=n.vkFormat===1000066e3&&n.dataFormatDescriptor[0].colorModel===167;if(!(n.vkFormat===0||r&&!this.workerConfig.astcHDRSupported))return Nr(n);let i=t,a=this.init().then(()=>this.workerPool.postMessage({type:`transcode`,buffer:e,taskConfig:i},[e])).then(e=>this._createTextureFrom(e.data,n));return Er.set(e,{promise:a}),a}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Dr--}};kr.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2},kr.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},kr.EngineFormat={RGBAFormat:c.RGBAFormat,RGBA_ASTC_4x4_Format:c.RGBA_ASTC_4x4_Format,RGB_BPTC_UNSIGNED_Format:c.RGB_BPTC_UNSIGNED_Format,RGBA_BPTC_Format:c.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:c.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:c.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:c.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:c.RGB_ETC1_Format,RGB_ETC2_Format:c.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:c.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:c.RGBA_S3TC_DXT1_Format},kr.EngineType={UnsignedByteType:c.UnsignedByteType,HalfFloatType:c.HalfFloatType,FloatType:c.FloatType},kr.BasisWorker=function(){let e,t,n,r=_EngineFormat,i=_EngineType,a=_TranscoderFormat,o=_BasisFormat;self.addEventListener(`message`,function(n){let r=n.data;switch(r.type){case`init`:e=r.config,s(r.transcoderBinary);break;case`transcode`:t.then(()=>{try{let{faces:e,buffers:t,width:n,height:i,hasAlpha:a,format:o,type:s,dfdFlags:l}=c(r.buffer);self.postMessage({type:`transcode`,id:r.id,data:{faces:e,width:n,height:i,hasAlpha:a,format:o,type:s,dfdFlags:l}},t)}catch(e){console.error(e),self.postMessage({type:`error`,id:r.id,error:e.message})}});break}});function s(e){t=new Promise(t=>{n={wasmBinary:e,onRuntimeInitialized:t},BASIS(n)}).then(()=>{n.initializeBasis(),n.KTX2File===void 0&&console.warn(`THREE.KTX2Loader: Please update Basis Universal transcoder.`)})}function c(e){let t=new n.KTX2File(new Uint8Array(e));function r(){t.close(),t.delete()}if(!t.isValid())throw r(),Error(`THREE.KTX2Loader: Invalid or unsupported .ktx2 file`);let a;if(t.isUASTC())a=o.UASTC;else if(t.isETC1S())a=o.ETC1S;else if(t.isHDR())a=o.UASTC_HDR;else throw Error(`THREE.KTX2Loader: Unknown Basis encoding`);let s=t.getWidth(),c=t.getHeight(),l=t.getLayers()||1,u=t.getLevels(),f=t.getFaces(),m=t.getHasAlpha(),h=t.getDFDFlags(),{transcoderFormat:g,engineFormat:_,engineType:v}=d(a,s,c,m);if(!s||!c||!u)throw r(),Error(`THREE.KTX2Loader: Invalid texture`);if(!t.startTranscoding())throw r(),Error(`THREE.KTX2Loader: .startTranscoding failed`);let y=[],b=[];for(let e=0;e<f;e++){let n=[];for(let a=0;a<u;a++){let o=[],s,c;for(let n=0;n<l;n++){let l=t.getImageLevelInfo(a,n,e);e===0&&a===0&&n===0&&(l.origWidth%4!=0||l.origHeight%4!=0)&&console.warn(`THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions.`),u>1?(s=l.origWidth,c=l.origHeight):(s=l.width,c=l.height);let d=new Uint8Array(t.getImageTranscodedSizeInBytes(a,n,0,g)),f=t.transcodeImage(d,a,n,e,g,0,-1,-1);if(v===i.HalfFloatType&&(d=new Uint16Array(d.buffer,d.byteOffset,d.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!f)throw r(),Error(`THREE.KTX2Loader: .transcodeImage failed.`);o.push(d)}let d=p(o);n.push({data:d,width:s,height:c}),b.push(d.buffer)}y.push({mipmaps:n,width:s,height:c,format:_,type:v})}return r(),{faces:y,buffers:b,width:s,height:c,hasAlpha:m,dfdFlags:h,format:_,type:v}}let l=[{if:`astcSupported`,basisFormat:[o.UASTC],transcoderFormat:[a.ASTC_4x4,a.ASTC_4x4],engineFormat:[r.RGBA_ASTC_4x4_Format,r.RGBA_ASTC_4x4_Format],engineType:[i.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:`bptcSupported`,basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[a.BC7_M5,a.BC7_M5],engineFormat:[r.RGBA_BPTC_Format,r.RGBA_BPTC_Format],engineType:[i.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:`dxtSupported`,basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[a.BC1,a.BC3],engineFormat:[r.RGBA_S3TC_DXT1_Format,r.RGBA_S3TC_DXT5_Format],engineType:[i.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:`etc2Supported`,basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[a.ETC1,a.ETC2],engineFormat:[r.RGB_ETC2_Format,r.RGBA_ETC2_EAC_Format],engineType:[i.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:`etc1Supported`,basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[a.ETC1],engineFormat:[r.RGB_ETC1_Format],engineType:[i.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:`pvrtcSupported`,basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[a.PVRTC1_4_RGB,a.PVRTC1_4_RGBA],engineFormat:[r.RGB_PVRTC_4BPPV1_Format,r.RGBA_PVRTC_4BPPV1_Format],engineType:[i.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:`bptcSupported`,basisFormat:[o.UASTC_HDR],transcoderFormat:[a.BC6H],engineFormat:[r.RGB_BPTC_UNSIGNED_Format],engineType:[i.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[a.RGBA32,a.RGBA32],engineFormat:[r.RGBAFormat,r.RGBAFormat],engineType:[i.UnsignedByteType,i.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[o.UASTC_HDR],transcoderFormat:[a.RGBA_HALF],engineFormat:[r.RGBAFormat],engineType:[i.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],u={[o.ETC1S]:l.filter(e=>e.basisFormat.includes(o.ETC1S)).sort((e,t)=>e.priorityETC1S-t.priorityETC1S),[o.UASTC]:l.filter(e=>e.basisFormat.includes(o.UASTC)).sort((e,t)=>e.priorityUASTC-t.priorityUASTC),[o.UASTC_HDR]:l.filter(e=>e.basisFormat.includes(o.UASTC_HDR)).sort((e,t)=>e.priorityHDR-t.priorityHDR)};function d(t,n,r,i){let a=u[t];for(let o=0;o<a.length;o++){let s=a[o];if(!(s.if&&!e[s.if])&&s.basisFormat.includes(t)&&!(i&&s.transcoderFormat.length<2)&&!(s.needsPowerOfTwo&&!(f(n)&&f(r))))return{transcoderFormat:s.transcoderFormat[+!!i],engineFormat:s.engineFormat[+!!i],engineType:s.engineType[0]}}throw Error(`THREE.KTX2Loader: Failed to identify transcoding target.`)}function f(e){return e<=2?!0:(e&e-1)==0&&e!==0}function p(e){if(e.length===1)return e[0];let t=0;for(let n=0;n<e.length;n++){let r=e[n];t+=r.byteLength}let n=new Uint8Array(t),r=0;for(let t=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.byteLength}return n}};var Ar=new Set([c.RGBAFormat,c.RGBFormat,c.RGFormat,c.RedFormat]),jr={109:c.RGBAFormat,103:c.RGFormat,100:c.RedFormat,97:c.RGBAFormat,83:c.RGFormat,76:c.RedFormat,91:c.RGBAFormat,43:c.RGBAFormat,37:c.RGBAFormat,22:c.RGFormat,16:c.RGFormat,15:c.RedFormat,9:c.RedFormat,123:c.RGBFormat,122:c.RGBFormat,152:c.RGBA_ETC2_EAC_Format,148:c.RGB_ETC2_Format,153:c.R11_EAC_Format,154:c.SIGNED_R11_EAC_Format,155:c.RG11_EAC_Format,156:c.SIGNED_RG11_EAC_Format,[pr]:c.RGBA_ASTC_4x4_Format,158:c.RGBA_ASTC_4x4_Format,157:c.RGBA_ASTC_4x4_Format,[mr]:c.RGBA_ASTC_6x6_Format,166:c.RGBA_ASTC_6x6_Format,165:c.RGBA_ASTC_6x6_Format,134:c.RGBA_S3TC_DXT1_Format,133:c.RGBA_S3TC_DXT1_Format,132:c.RGB_S3TC_DXT1_Format,131:c.RGB_S3TC_DXT1_Format,138:c.RGBA_S3TC_DXT5_Format,137:c.RGBA_S3TC_DXT5_Format,140:c.SIGNED_RED_RGTC1_Format,139:c.RED_RGTC1_Format,142:c.SIGNED_RED_GREEN_RGTC2_Format,141:c.RED_GREEN_RGTC2_Format,146:c.RGBA_BPTC_Format,145:c.RGBA_BPTC_Format,[fr]:c.RGBA_PVRTC_4BPPV1_Format,[ur]:c.RGBA_PVRTC_4BPPV1_Format,[dr]:c.RGBA_PVRTC_2BPPV1_Format,[lr]:c.RGBA_PVRTC_2BPPV1_Format},Mr={109:c.FloatType,103:c.FloatType,100:c.FloatType,97:c.HalfFloatType,83:c.HalfFloatType,76:c.HalfFloatType,91:c.UnsignedShortType,43:c.UnsignedByteType,37:c.UnsignedByteType,22:c.UnsignedByteType,16:c.UnsignedByteType,15:c.UnsignedByteType,9:c.UnsignedByteType,123:c.UnsignedInt5999Type,122:c.UnsignedInt101111Type,152:c.UnsignedByteType,148:c.UnsignedByteType,153:c.UnsignedByteType,154:c.UnsignedByteType,155:c.UnsignedByteType,156:c.UnsignedByteType,[pr]:c.HalfFloatType,158:c.UnsignedByteType,157:c.UnsignedByteType,[mr]:c.HalfFloatType,166:c.UnsignedByteType,165:c.UnsignedByteType,134:c.UnsignedByteType,133:c.UnsignedByteType,132:c.UnsignedByteType,131:c.UnsignedByteType,138:c.UnsignedByteType,137:c.UnsignedByteType,140:c.UnsignedByteType,139:c.UnsignedByteType,142:c.UnsignedByteType,141:c.UnsignedByteType,146:c.UnsignedByteType,145:c.UnsignedByteType,[fr]:c.UnsignedByteType,[ur]:c.UnsignedByteType,[dr]:c.UnsignedByteType,[lr]:c.UnsignedByteType};async function Nr(e){let{vkFormat:t}=e;if(jr[t]===void 0)throw Error(`THREE.KTX2Loader: Unsupported vkFormat: `+t);Mr[t]===void 0&&console.warn(`THREE.KTX2Loader: Missing ".type" for vkFormat: `+t);let n;e.supercompressionScheme===2&&(Or||=new Promise(async e=>{let t=new Sr;await t.init(),e(t)}),n=await Or);let r=[];for(let i=0;i<e.levels.length;i++){let a=Math.max(1,e.pixelWidth>>i),o=Math.max(1,e.pixelHeight>>i),s=e.pixelDepth?Math.max(1,e.pixelDepth>>i):0,l=e.levels[i],u;if(e.supercompressionScheme===0)u=l.levelData;else if(e.supercompressionScheme===2)u=n.decode(l.levelData,l.uncompressedByteLength);else throw Error(`THREE.KTX2Loader: Unsupported supercompressionScheme.`);let d;d=Mr[t]===c.FloatType?new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):Mr[t]===c.HalfFloatType||Mr[t]===c.UnsignedShortType?new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):Mr[t]===c.UnsignedInt5999Type||Mr[t]===c.UnsignedInt101111Type?new Uint32Array(u.buffer,u.byteOffset,u.byteLength/Uint32Array.BYTES_PER_ELEMENT):u,r.push({data:d,width:a,height:o,depth:s})}let i=e.levelCount===0||r.length>1,a;if(Ar.has(jr[t]))a=e.pixelDepth===0?new c.DataTexture(r[0].data,e.pixelWidth,e.pixelHeight):new c.Data3DTexture(r[0].data,e.pixelWidth,e.pixelHeight,e.pixelDepth),a.minFilter=i?c.NearestMipmapNearestFilter:c.NearestFilter,a.magFilter=c.NearestFilter,a.generateMipmaps=e.levelCount===0;else{if(e.pixelDepth>0)throw Error(`THREE.KTX2Loader: Unsupported pixelDepth.`);a=new c.CompressedTexture(r,e.pixelWidth,e.pixelHeight),a.minFilter=i?c.LinearMipmapLinearFilter:c.LinearFilter,a.magFilter=c.LinearFilter}return a.mipmaps=r,a.type=Mr[t],a.format=jr[t],a.colorSpace=Pr(e),a.needsUpdate=!0,Promise.resolve(a)}function Pr(e){let t=e.dataFormatDescriptor[0];return t.colorPrimaries===1?t.transferFunction===2?c.SRGBColorSpace:c.LinearSRGBColorSpace:t.colorPrimaries===10?t.transferFunction===2?wr:Tr:(t.colorPrimaries===0||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${t.colorPrimaries}"`),c.NoColorSpace)}var Fr=(function(){var e=`b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq:VZkdbk:XYi5ud9:du8Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCabaOad2fhXaAcethQaxaDfhiaOaeaoaeao6E9RhLalcl4cifcd4hKazcj;cbfaAfhYcbh8AazcjdfhEaHh3incbh5dnawTmbaxa8Acd4fRbbh5kcbh8Eazcj;cbfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcj;cbfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcj;cbfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaK6mva8FaKfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasa8Acd4fRbbgociGPlbedrbkaATmdaza8Afh8Fazcj;cbfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeaza8Afhaazcj;cbfhhcbhoceh8EaYh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaLaocefgofmbka8FaQfh8FcdhoaacdfhaahaQfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8Eaza8AfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaYhainazcj;cbfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3a8Aclfg8Aad6mbkaXazcjdfaAad2z:jjjjb8AazazcjdfaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk: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:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb`,t=`b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:W9Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:JBl8Aud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fhOaPaDfhAasaeaH9RaHasfae6EgCcsfgocl4cifcd4hXavcj;cbfaoc9WGgQcetfhLavcj;cbfaQci2fhKavcj;cbfaQfhYcbh8Aaoc;ab6hEincbh3dnawTmbaPa8Acd4fRbbh3kcbh5avcj;cbfh8Eindndndndna3a5cet4ciGgoc9:fPdebdkaxaA9RaQ6mwdnaQTmbavcj;cbfa5aQ2faAaQ;8qbbkaAaCfhAxdkaQTmeavcj;cbfa5aQ2fcbaQ;8kbxekaxaA9RaX6moaoclVcbawEhraAaXfhocbhidnaEmbaxao9Rc;Gb6mbcbhlina8EalfhidndndndndndnaAalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaiaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaiczfaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaicafaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaQ0meaihlaxao9Rc;Fb0mbkkdnaiaQ9pmbaici4hlinaxao9RcK6mwa8EaifhqdndndndndndnaAaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1: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NpmwKDYq8AkEx3m5P8Es8Fg8KpmbezHdiOAlvCXorQLg8Faip:Rea8Falp:Tep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8Ja8KpmwDKYqk8AExm35Ps8E8Fg8Faip:Rea8Falp:Tep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9AbbbaradfhraoczfgoaQ6mbkka8Aclfg8Aad6mbkdnaCad2goTmbaOavcjdfao;8qbbkdnammbavavcjdfaCcufad2fad;8qbbkaCaHfhHc9:hoaAhPaAmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb`,n=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]),r=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 i=WebAssembly.validate(n)?s(t):s(e),a,o=WebAssembly.instantiate(i,{}).then(function(e){a=e.instance,a.exports.__wasm_call_ctors()});function s(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;++n){var i=e.charCodeAt(n);t[n]=i>96?i-97:i>64?i-39:i+4}for(var a=0,n=0;n<e.length;++n)t[a++]=t[n]<60?r[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,a)}function c(e,t,n,r,i,a,o){var s=e.exports.sbrk,c=r+3&-4,l=s(c*i),u=s(a.length),d=new Uint8Array(e.exports.memory.buffer);d.set(a,u);var f=t(l,r,i,u,a.length);if(f==0&&o&&o(l,c,i),n.set(d.subarray(l,l+r*i)),s(l-s(0)),f!=0)throw Error(`Malformed buffer data: `+f)}var l={NONE:``,OCTAHEDRAL:`meshopt_decodeFilterOct`,QUATERNION:`meshopt_decodeFilterQuat`,EXPONENTIAL:`meshopt_decodeFilterExp`,COLOR:`meshopt_decodeFilterColor`},u={ATTRIBUTES:`meshopt_decodeVertexBuffer`,TRIANGLES:`meshopt_decodeIndexBuffer`,INDICES:`meshopt_decodeIndexSequence`},d=[],f=0;function p(e){var t={object:new Worker(e),pending:0,requests:{}};return t.object.onmessage=function(e){var n=e.data;t.pending-=n.count,t.requests[n.id][n.action](n.value),delete t.requests[n.id]},t}function m(e){for(var t=`self.ready = WebAssembly.instantiate(new Uint8Array([`+new Uint8Array(i)+`]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = `+g.name+`;`+c.toString()+g.toString(),n=new Blob([t],{type:`text/javascript`}),r=URL.createObjectURL(n),a=d.length;a<e;++a)d[a]=p(r);for(var a=e;a<d.length;++a)d[a].object.postMessage({});d.length=e,URL.revokeObjectURL(r)}function h(e,t,n,r,i){for(var a=d[0],o=1;o<d.length;++o)d[o].pending<a.pending&&(a=d[o]);return new Promise(function(o,s){var c=new Uint8Array(n),l=++f;a.pending+=e,a.requests[l]={resolve:o,reject:s},a.object.postMessage({id:l,count:e,size:t,source:c,mode:r,filter:i},[c.buffer])})}function g(e){var t=e.data;self.ready.then(function(e){if(!t.id)return self.close();try{var n=new Uint8Array(t.count*t.size);c(e,e.exports[t.mode],n,t.count,t.size,t.source,e.exports[t.filter]),self.postMessage({id:t.id,count:t.count,action:`resolve`,value:n},[n.buffer])}catch(e){self.postMessage({id:t.id,count:t.count,action:`reject`,value:e})}})}return{ready:o,supported:!0,useWorkers:function(e){m(e)},decodeVertexBuffer:function(e,t,n,r,i){c(a,a.exports.meshopt_decodeVertexBuffer,e,t,n,r,a.exports[l[i]])},decodeIndexBuffer:function(e,t,n,r){c(a,a.exports.meshopt_decodeIndexBuffer,e,t,n,r)},decodeIndexSequence:function(e,t,n,r){c(a,a.exports.meshopt_decodeIndexSequence,e,t,n,r)},decodeGltfBuffer:function(e,t,n,r,i,o){c(a,a.exports[u[i]],e,t,n,r,a.exports[l[o]])},decodeGltfBufferAsync:function(e,t,n,r,i){return d.length>0?h(e,t,n,u[r],l[i]):o.then(function(){var o=new Uint8Array(e*t);return c(a,a.exports[u[r]],o,e,t,n,a.exports[l[i]]),o})}}})();function Ir(e){return`morphTargetDictionary`in e&&e.morphTargetDictionary!==void 0&&`morphTargetInfluences`in e&&Array.isArray(e.morphTargetInfluences)}var Lr={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 Rr(e={}){c.Cache.enabled=!0;let t={...Lr,...e},n=new cn,r=new or;if(r.setDecoderPath(t.draco),n.setDRACOLoader(r),t.renderer){let e=new kr;e.setTranscoderPath(t.ktx2),e.detectSupport(t.renderer),n.setKTX2Loader(e)}t.meshopt&&n.setMeshoptDecoder(Fr),zr=n}var zr=new cn;zr.setMeshoptDecoder(Fr);var Br=class extends je{constructor(e,t){super(e,t)}},Vr=class extends Me{gltf;constructor(e){super(e)}async asyncInit(e){if(te(e)){let t=null;this.gltf=await zr.loadAsync(e);let n={},r={root:this.gltf.scene,bones:{},skeleton:void 0},i={};this.gltf.scene.traverse(e=>{if(e.userData.a3js={objectA3:this},Ir(e)){let{morphTargetDictionary:t,morphTargetInfluences:n}=e;Object.keys(t).forEach(r=>{let a=e.name+`.`+r;i[a]={array:n,idx:t[r]}})}e instanceof c.Bone&&r.bones&&(r.bones[e.name]=e),e instanceof c.SkinnedMesh&&(r.skeleton=e.skeleton)}),this.gltf.animations.forEach(e=>{t||=e.name,n[e.name]=new Br(r,new jt(e))}),t?this.syncInit(t,n,i):(t=`dummy`,n.dummy=new Br(r,new Ne),this.syncInit(t,n,i))}else{let e=new c.BoxGeometry,t=new c.MeshStandardMaterial({color:16711680}),n=new c.Mesh(e,t),r={};r.dummy=new Br({root:n},new Ne),this.syncInit(`dummy`,r)}return this}},Hr={camera:void 0,antialias:!1,transparent:!1},Ur=class 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=`
143
143
  <style>
144
144
  :host {
145
145
  display: block;
@@ -152,7 +152,7 @@ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return E}
152
152
  }
153
153
  </style>
154
154
  <slot></slot>
155
- `,this.options={...cr,...e},this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{const n=new K.PerspectiveCamera(75,2,.01,1e3);n.aspect=300/150,this.camera3js=n,this.camera=new Qt(this.camera3js)}this.base=new Lt(this.camera),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.timer=new K.Timer;const t={antialias:this.options.antialias,alpha:this.options.transparent};this.renderer=new K.WebGLRenderer(t),_t({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 bi,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),Gs(this.camera3js)?(this.camera3js.aspect=n/r,this.camera3js.updateProjectionMatrix()):Us(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 K.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new K.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 K.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(),s=this.camera3js.position;return new ce(s.x+o.x*n,s.y+o.y*n,s.z+o.z*n)}cameraToScreen(e){const n=new K.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return x.v0.set(n),this.worldToScreen(x.v0)}screenToCamera(e,t,n){const r=this.screenToWorld(e,t,n),o=new K.Vector3(r.x,r.y,r.z);return r.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),r}myMouseClickedListener=async e=>{if(this.camera instanceof Qt){const t=new K.Raycaster,n=new K.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)})})}setShadowMap(e){this.renderer.shadowMap.enabled=e}}customElements.define("canvas-a3",lr);function Gs(i){return i.isPerspectiveCamera===!0}function Us(i){return i.isOrthographicCamera===!0}const ur={width:600,height:300,camera:void 0};class hr 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={...ur,...n,width:e,height:t},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
155
+ `,this.options={...Hr,...e},this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{let e=new c.PerspectiveCamera(75,300/150,.01,1e3);e.aspect=300/150,this.camera3js=e,this.camera=new Xt(this.camera3js)}this.base=new Yt(this.camera),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.timer=new c.Timer;let t={antialias:this.options.antialias,alpha:this.options.transparent};this.renderer=new c.WebGLRenderer(t),Rr({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 rn,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`,e=>{this.controller?.mouseDown(e)}),this._css2DCanvas.addEventListener(`mouseup`,e=>{this.controller?.mouseUp(e)}),this._css2DCanvas.addEventListener(`mousemove`,e=>{this.controller?.mouseMove(e)}),this._css2DCanvas.addEventListener(`click`,e=>{this.controller?.mouseClick(e)}),this._css2DCanvas.addEventListener(`mouseenter`,e=>{this.controller?.mouseEnter(e)}),this._css2DCanvas.addEventListener(`mouseleave`,e=>{this.controller?.mouseLeave(e)}),this._css2DCanvas.addEventListener(`wheel`,e=>{this.controller?.mouseWheel(e)}),this._css2DCanvas.addEventListener(`touchstart`,e=>{this.controller?.touchStart(e)}),this._css2DCanvas.addEventListener(`touchmove`,e=>{this.controller?.touchMove(e)}),this._css2DCanvas.addEventListener(`touchend`,e=>{this.controller?.touchEnd(e)}),this._css2DCanvas.addEventListener(`touchcancel`,e=>{this.controller?.touchCancel(e)})}keyDownListener=e=>{this.controller?.keyDown(e)};keyUpListener=e=>{this.controller?.keyUp(e)};keyPressListener=e=>{this.controller?.keyPress(e)};connectedCallback(){this.ro=new ResizeObserver(e=>{let 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),Wr(this.camera3js)?(this.camera3js.aspect=n/r,this.camera3js.updateProjectionMatrix()):Gr(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();let 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){let t=new c.Vector3(e.x,e.y,e.z);t.project(this.camera3js);let n=new c.Vector2;return this.renderer.getSize(n),{x:(t.x+1)/2*n.x,y:(1-t.y)/2*n.y}}screenToWorld(e,t,n){let r=new c.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);r.unproject(this.camera3js);let i=r.sub(this.camera3js.position).normalize(),a=this.camera3js.position;return new u(a.x+i.x*n,a.y+i.y*n,a.z+i.z*n)}cameraToScreen(e){let t=new c.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return U.v0.set(t),this.worldToScreen(U.v0)}screenToCamera(e,t,n){let r=this.screenToWorld(e,t,n),i=new c.Vector3(r.x,r.y,r.z);return r.set(i.applyMatrix4(this.camera3js.matrixWorldInverse)),r}myMouseClickedListener=async e=>{if(this.camera instanceof Xt){let t=new c.Raycaster,n=new c.Vector2,r=e.target.getBoundingClientRect(),i=e.clientX-r.left,a=e.clientY-r.top;n.x=2*(i/r.width)-1,n.y=-2*(a/r.height)+1,t.setFromCamera(n,this.camera.camera);let o=t.intersectObjects(this.scene.scene.children),s=[];o.forEach(e=>{let t=e.object.userData.a3js?.objectA3;s.push({three:e.object,a3js:t})}),s.length>0&&await s[0].a3js.clicked(),this.dispatchEvent(new CustomEvent(`click3d`,{detail:{value:s}}))}};alert(e,t){return new Promise(n=>{let r=document.createElement(`div`);r.style.cssText=`position: absolute; top: 0px; width: 100%; height: 100%; display: flex; flex-direction: column; z-index: 3;`;let i=document.createElement(`p`);i.style.cssText=`width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;`,i.textContent=e,r.appendChild(i);let a=document.createElement(`button`);a.textContent=`OK!`,r.appendChild(a),this.shadowRoot.appendChild(r),a.addEventListener(`click`,async()=>{t&&await t(),this.shadowRoot.removeChild(r),n()})})}prompt(e,t){return new Promise(n=>{let r=document.createElement(`div`);r.style.cssText=`position: absolute; top: 0px; width: 100%; height: 100%; display: flex; flex-direction: column; z-index: 3;`;let i=document.createElement(`p`);i.style.cssText=`width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;`,i.textContent=e,r.appendChild(i);let a=document.createElement(`input`);a.setAttribute(`type`,`text`),r.appendChild(a);let o=document.createElement(`button`);o.textContent=`OK!`,r.appendChild(o),this.shadowRoot.appendChild(r),o.addEventListener(`click`,async()=>{t&&await t(),this.shadowRoot.removeChild(r),n(a.value)})})}setShadowMap(e){this.renderer.shadowMap.enabled=e}};customElements.define(`canvas-a3`,Ur);function Wr(e){return e.isPerspectiveCamera===!0}function Gr(e){return e.isOrthographicCamera===!0}var Kr={width:600,height:300,camera:void 0},qr=class 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={...Kr,...n,width:e,height:t},this.attachShadow({mode:`open`}),this.shadowRoot.innerHTML=`
156
156
  <style>
157
157
  :host {
158
158
  position: absolute;
@@ -196,7 +196,7 @@ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return E}
196
196
  </div>
197
197
  <div class="content">
198
198
  </div>
199
- `,this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{const o=new K.PerspectiveCamera(75,e/t,.01,1e3);o.aspect=e/t,this.camera3js=o,this.camera=new Qt(this.camera3js)}this.base=new Lt(this.camera),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.timer=new K.Timer,this.renderer=new K.WebGLRenderer,_t({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 bi,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,js(this.camera3js)?(this.camera3js.aspect=r/o,this.camera3js.updateProjectionMatrix()):Hs(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 K.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new K.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 K.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(),s=this.camera3js.position;return new ce(s.x+o.x*n,s.y+o.y*n,s.z+o.z*n)}cameraToScreen(e){const n=new K.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return x.v0.set(n),this.worldToScreen(x.v0)}screenToCamera(e,t,n){const r=this.screenToWorld(e,t,n),o=new K.Vector3(r.x,r.y,r.z);return r.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),r}myMouseClickedListener=async e=>{if(this.camera instanceof Qt){const t=new K.Raycaster,n=new K.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)})})}setShadowMap(e){this.renderer.shadowMap.enabled=e}}customElements.define("window-a3",hr);function js(i){return i.isPerspectiveCamera===!0}function Hs(i){return i.isOrthographicCamera===!0}const qs=`
199
+ `,this.options.camera)this.camera3js=this.options.camera.camera,this.camera=this.options.camera;else{let n=new c.PerspectiveCamera(75,e/t,.01,1e3);n.aspect=e/t,this.camera3js=n,this.camera=new Xt(this.camera3js)}this.base=new Yt(this.camera),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.timer=new c.Timer,this.renderer=new c.WebGLRenderer,Rr({renderer:this.renderer}),this.renderer.setSize(e,t),this.renderer.domElement.width=e,this.renderer.domElement.height=t;let r=this.shadowRoot.querySelector(`.content`);r.appendChild(this.renderer.domElement),this._canvas=this.shadowRoot.querySelector(`canvas`),this.css2DRenderer=new rn,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`,e=>{this.controller?.mouseDown(e)}),this._css2DCanvas.addEventListener(`mouseup`,e=>{this.controller?.mouseUp(e)}),this._css2DCanvas.addEventListener(`mousemove`,e=>{this.controller?.mouseMove(e)}),this._css2DCanvas.addEventListener(`click`,e=>{this.controller?.mouseClick(e)}),this._css2DCanvas.addEventListener(`mouseenter`,e=>{this.controller?.mouseEnter(e)}),this._css2DCanvas.addEventListener(`mouseleave`,e=>{this.controller?.mouseLeave(e)}),this._css2DCanvas.addEventListener(`wheel`,e=>{this.controller?.mouseWheel(e)}),this._css2DCanvas.addEventListener(`touchstart`,e=>{this.controller?.touchStart(e)}),this._css2DCanvas.addEventListener(`touchmove`,e=>{this.controller?.touchMove(e)}),this._css2DCanvas.addEventListener(`touchend`,e=>{this.controller?.touchEnd(e)}),this._css2DCanvas.addEventListener(`touchcancel`,e=>{this.controller?.touchCancel(e)}),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(){let e=this.shadowRoot.querySelector(`.content`),t=e.clientWidth,n=e.clientHeight,r=Math.floor(t),i=Math.floor(n);(this._canvas.width!==r||this._canvas.height!==i)&&(this._canvas.width=r,this._canvas.height=i,Jr(this.camera3js)?(this.camera3js.aspect=r/i,this.camera3js.updateProjectionMatrix()):Yr(this.camera3js)&&this.camera3js.updateProjectionMatrix(),this.renderer.setSize(r,i),this.css2DRenderer.setSize(r,i))}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()});let 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;let t=this.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=this._borderSize,a=``;r<i?a+=`n`:r>t.height-i&&(a+=`s`),n<i?a+=`w`:n>t.width-i&&(a+=`e`),this._resizeDir=a,this.style.cursor=this._cursorFromDir(a)};_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){let 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();let 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){let t=new c.Vector3(e.x,e.y,e.z);t.project(this.camera3js);let n=new c.Vector2;return this.renderer.getSize(n),{x:(t.x+1)/2*n.x,y:(1-t.y)/2*n.y}}screenToWorld(e,t,n){let r=new c.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);r.unproject(this.camera3js);let i=r.sub(this.camera3js.position).normalize(),a=this.camera3js.position;return new u(a.x+i.x*n,a.y+i.y*n,a.z+i.z*n)}cameraToScreen(e){let t=new c.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return U.v0.set(t),this.worldToScreen(U.v0)}screenToCamera(e,t,n){let r=this.screenToWorld(e,t,n),i=new c.Vector3(r.x,r.y,r.z);return r.set(i.applyMatrix4(this.camera3js.matrixWorldInverse)),r}myMouseClickedListener=async e=>{if(this.camera instanceof Xt){let t=new c.Raycaster,n=new c.Vector2,r=e.target.getBoundingClientRect(),i=e.clientX-r.left,a=e.clientY-r.top;n.x=2*(i/r.width)-1,n.y=-2*(a/r.height)+1,t.setFromCamera(n,this.camera.camera);let o=t.intersectObjects(this.scene.scene.children),s=[];o.forEach(e=>{let t=e.object.userData.a3js?.objectA3;s.push({three:e.object,a3js:t})}),s.length>0&&await s[0].a3js.clicked(),this.dispatchEvent(new CustomEvent(`click3d`,{detail:{value:s}}))}};alert(e,t){return new Promise(n=>{let r=document.createElement(`div`);r.style.cssText=`position: absolute; top: 28px; width: 100%; height: 100%; display: flex; flex-direction: column;`;let i=document.createElement(`p`);i.style.cssText=`width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;`,i.textContent=e,r.appendChild(i);let a=document.createElement(`button`);a.textContent=`OK!`,r.appendChild(a),this.shadowRoot.appendChild(r),a.addEventListener(`click`,async()=>{t&&await t(),this.shadowRoot.removeChild(r),n()})})}prompt(e,t){return new Promise(n=>{let r=document.createElement(`div`);r.style.cssText=`position: absolute; top: 28px; width: 100%; height: 100%; display: flex; flex-direction: column;`;let i=document.createElement(`p`);i.style.cssText=`width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;`,i.textContent=e,r.appendChild(i);let a=document.createElement(`input`);a.setAttribute(`type`,`text`),r.appendChild(a);let o=document.createElement(`button`);o.textContent=`OK!`,r.appendChild(o),this.shadowRoot.appendChild(r),o.addEventListener(`click`,async()=>{t&&await t(),this.shadowRoot.removeChild(r),n(a.value)})})}setShadowMap(e){this.renderer.shadowMap.enabled=e}};customElements.define(`window-a3`,qr);function Jr(e){return e.isPerspectiveCamera===!0}function Yr(e){return e.isOrthographicCamera===!0}var Xr=`
200
200
  color: white;
201
201
  padding: 5px 10px;
202
202
  background: rgba(0, 0, 0, 0.6);
@@ -205,8 +205,8 @@ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return E}
205
205
  font-family: sans-serif;
206
206
  font-size: 14px;
207
207
  pointer-events: none; /* マウスイベントを透過させて背後の操作を邪魔しない */
208
- `,gn={testMode:!0};class zs extends Oe{constructor(e={}){super(e);const t={...gn,...e};this.setTransformer(new Wn(t))}initObject(){const e=new K.BoxGeometry,t=new K.MeshStandardMaterial({color:65280}),n=new K.Mesh(e,t),r=document.createElement("div");r.textContent="Hello Box!",r.style.cssText=qs;const o=new Ii(r);return o.position.set(0,.8,0),n.add(o),n}initTransformer(e){const t=Pt(gn,e);return new Wn(t)}}class Wn extends vt{testMode=!0;rot=new ce;constructor(e){super(),this.testMode=e.testMode}update(e){super.update(e),this.testMode&&(this.rot.add(e,e,e),ht(this.rot,"ZXY",this.transform.quat))}}class Vs extends b.Loader{constructor(e){super(e)}load(e,t,n,r){const o=this,s=new b.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 dr(e)}}class dr{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100,n="ltr"){const r=[],o=Ks(e,t,this.data,n);for(let s=0,c=o.length;s<c;s++)r.push(...o[s].toShapes());return r}}function Ks(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===`
209
- `)A=0,a-=s;else{const m=Ws(u,o,A,a,t);n=="tb"?(A=0,a+=t.ascender*o):A+=m.offsetX,c.push(m.path)}}return c}function Ws(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 b.ShapePath;let c,A,a,h,u,m,p,E;if(o.o){const g=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let l=0,d=g.length;l<d;)switch(g[l++]){case"m":c=g[l++]*e+t,A=g[l++]*e+n,s.moveTo(c,A);break;case"l":c=g[l++]*e+t,A=g[l++]*e+n,s.lineTo(c,A);break;case"q":a=g[l++]*e+t,h=g[l++]*e+n,u=g[l++]*e+t,m=g[l++]*e+n,s.quadraticCurveTo(u,m,a,h);break;case"b":a=g[l++]*e+t,h=g[l++]*e+n,u=g[l++]*e+t,m=g[l++]*e+n,p=g[l++]*e+t,E=g[l++]*e+n,s.bezierCurveTo(u,m,p,E,a,h);break}}return{offsetX:o.ha*e,path:s}}class Ys extends b.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 Mt=null;async function Js(i){if(i.match(/.zip$/i)){let e=i.substring(i.lastIndexOf("/"));e=e.substring(0,e.length-4);const t=await ni(i),n=Ot(t,e);Mt=new dr(JSON.parse(n))}else Mt=await new Vs().loadAsync(i)}const fr={color:16711680};class Xs extends Oe{options;constructor(e,t){const n={...fr,...t},r={text:e,color:n.color};super(r),this.options=n}initObject(e){let t=e.text;if(Mt==null){const n=new K.BoxGeometry,r=new K.MeshStandardMaterial({color:16711680});return new K.Mesh(n,r)}else{const n={font:Mt,size:1,depth:.5,curveSegments:12},r=new Ys(t,n);r.center();const o=new K.MeshStandardMaterial({color:e.color});return new K.Mesh(r,o)}}}class Zs 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 K.BoxGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new K.MeshStandardMaterial({color:o});return new K.Mesh(r,s)}}class ea 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 K.SphereGeometry(...t),o=n.length>0?n[0]:"rgb(128,128,128)",s=new K.MeshStandardMaterial({color:o});return new K.Mesh(r,s)}}const an={direction:{x:-1,y:-1,z:-1},colorDL:16777215,colorAL:16777215,intensityDL:1,intensityAL:.4};function ta(i){let e=!0;return e&&=typeof i.x=="number",e&&=typeof i.y=="number",e&&=typeof i.z=="number",e}function na(i){let e=!0;return e&&=ta(i.direction),e&&=typeof i.colorDL=="number",e&&=typeof i.colorAL=="number",e&&=typeof i.intensityDL=="number",e&&=typeof i.intensityAL=="number",e}class ia extends Oe{completeOptions;constructor(e=an){const t={...an,...e};super(t),this.completeOptions=t}initObject(e){let t=an;na(e)&&(t=e);const n=new K.Object3D;return this.directionalLight=new K.DirectionalLight(t.colorDL,t.intensityDL),this.directionalLight.target.position.set(t.direction.x,t.direction.y,t.direction.z),n.add(this.directionalLight),n.add(this.directionalLight.target),this.ambientLight=new K.AmbientLight(t.colorAL,t.intensityAL),n.add(this.ambientLight),n}setDebugMode(e){this.directionalLight&&(e?(this.cameraHelper||(this.cameraHelper=new K.CameraHelper(this.directionalLight.shadow.camera)),this.object3D.add(this.cameraHelper)):this.cameraHelper&&this.object3D.remove(this.cameraHelper))}}class ra extends Oe{constructor(e){super(e)}initObject(e){const t=new K.PlaneGeometry(1,1),n=new K.TextureLoader().load(e),r=new K.MeshBasicMaterial({map:n});return new K.Mesh(t,r)}}class oa extends Oe{constructor(e){super(e);const t=this.object3D.children[0];this.object3D.addEventListener("removed",()=>{t.element.remove()})}initObject(e){return new Ii(e)}}const pr={touchDevice:navigator.maxTouchPoints>0,width:"600px",height:"300px"};class gr extends HTMLElement{options;canvas;scene;camera;controller;_maxDistance;_leftActive;_leftCenter;leftJoystick;_rightActive;_rightCenter;rightJoystick;leftButton;rightButton;_leftButtonCount;_rightButtonCount;keys;_ro;constructor(e={}){super(),this.options={...pr,...e},this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
208
+ `,Zr={testMode:!0},Qr=class extends W{constructor(e={}){super(e);let t={...Zr,...e};this.setTransformer(new $r(t))}initObject(){let e=new c.BoxGeometry,t=new c.MeshStandardMaterial({color:65280}),n=new c.Mesh(e,t),r=document.createElement(`div`);r.textContent=`Hello Box!`,r.style.cssText=Xr;let i=new Zt(r);return i.position.set(0,.8,0),n.add(i),n}initTransformer(e){return new $r(be(Zr,e))}},$r=class extends y{testMode=!0;rot=new u;constructor(e){super(),this.testMode=e.testMode}update(e){super.update(e),this.testMode&&(this.rot.add(e,e,e),m(this.rot,`ZXY`,this.transform.quat))}},ei=class extends c.Loader{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new c.FileLoader(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(e){let n=i.parse(JSON.parse(e));t&&t(n)},n,r)}parse(e){return new ti(e)}},ti=class{constructor(e){this.isFont=!0,this.type=`Font`,this.data=e}generateShapes(e,t=100,n=`ltr`){let r=[],i=ni(e,t,this.data,n);for(let e=0,t=i.length;e<t;e++)r.push(...i[e].toShapes());return r}};function ni(e,t,n,r){let i=Array.from(e),a=t/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*a,s=[],c=0,l=0;(r==`rtl`||r==`tb`)&&i.reverse();for(let e=0;e<i.length;e++){let t=i[e];if(t===`
209
+ `)c=0,l-=o;else{let e=ri(t,a,c,l,n);r==`tb`?(c=0,l+=n.ascender*a):c+=e.offsetX,s.push(e.path)}}return s}function ri(e,t,n,r,i){let a=i.glyphs[e]||i.glyphs[`?`];if(!a){console.error(`THREE.Font: character "`+e+`" does not exists in font family `+i.familyName+`.`);return}let o=new c.ShapePath,s,l,u,d,f,p,m,h;if(a.o){let e=a._cachedOutline||=a.o.split(` `);for(let i=0,a=e.length;i<a;)switch(e[i++]){case`m`:s=e[i++]*t+n,l=e[i++]*t+r,o.moveTo(s,l);break;case`l`:s=e[i++]*t+n,l=e[i++]*t+r,o.lineTo(s,l);break;case`q`:u=e[i++]*t+n,d=e[i++]*t+r,f=e[i++]*t+n,p=e[i++]*t+r,o.quadraticCurveTo(f,p,u,d);break;case`b`:u=e[i++]*t+n,d=e[i++]*t+r,f=e[i++]*t+n,p=e[i++]*t+r,m=e[i++]*t+n,h=e[i++]*t+r,o.bezierCurveTo(f,p,m,h,u,d);break}}return{offsetX:a.ha*t,path:o}}var ii=class e extends c.ExtrudeGeometry{constructor(e,t={}){let n=t.font;if(n===void 0)super();else{let 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`}toJSON(){return super.toJSON()}static fromJSON(t){let n=t.options;return n.font=new ti(n.font.data),new e(n.text,n)}},ai=null;async function oi(e){if(e.match(/.zip$/i)){let t=e.substring(e.lastIndexOf(`/`));t=t.substring(0,t.length-4);let n=ge(await he(e),t);ai=new ti(JSON.parse(n))}else ai=await new ei().loadAsync(e)}var si={color:16711680},ci=class extends W{options;constructor(e,t){let n={...si,...t},r={text:e,color:n.color};super(r),this.options=n}initObject(e){let t=e.text;if(ai==null){let e=new c.BoxGeometry,t=new c.MeshStandardMaterial({color:16711680});return new c.Mesh(e,t)}else{let n=new ii(t,{font:ai,size:1,depth:.5,curveSegments:12});n.center();let r=new c.MeshStandardMaterial({color:e.color});return new c.Mesh(n,r)}}},li=class extends W{constructor(e){super(e)}initObject(e){return e}},ui=class extends W{constructor(...e){super(e)}initObject(e){let t=e.filter(e=>typeof e==`number`),n=e.filter(e=>typeof e==`string`),r=new c.BoxGeometry(...t),i=n.length>0?n[0]:`rgb(128,128,128)`,a=new c.MeshStandardMaterial({color:i});return new c.Mesh(r,a)}},di=class extends W{constructor(...e){super(e)}initObject(e){let t=e.filter(e=>typeof e==`number`),n=e.filter(e=>typeof e==`string`),r=new c.SphereGeometry(...t),i=n.length>0?n[0]:`rgb(128,128,128)`,a=new c.MeshStandardMaterial({color:i});return new c.Mesh(r,a)}},fi={direction:{x:-1,y:-1,z:-1},colorDL:16777215,colorAL:16777215,intensityDL:1,intensityAL:.4};function pi(e){let t=!0;return t&&=typeof e.x==`number`,t&&=typeof e.y==`number`,t&&=typeof e.z==`number`,t}function mi(e){let t=!0;return t&&=pi(e.direction),t&&=typeof e.colorDL==`number`,t&&=typeof e.colorAL==`number`,t&&=typeof e.intensityDL==`number`,t&&=typeof e.intensityAL==`number`,t}var hi=class extends W{completeOptions;constructor(e=fi){let t={...fi,...e};super(t),this.completeOptions=t}initObject(e){let t=fi;mi(e)&&(t=e);let n=new c.Object3D;return this.directionalLight=new c.DirectionalLight(t.colorDL,t.intensityDL),this.directionalLight.target.position.set(t.direction.x,t.direction.y,t.direction.z),n.add(this.directionalLight),n.add(this.directionalLight.target),this.ambientLight=new c.AmbientLight(t.colorAL,t.intensityAL),n.add(this.ambientLight),n}setDebugMode(e){this.directionalLight&&(e?(this.cameraHelper||=new c.CameraHelper(this.directionalLight.shadow.camera),this.object3D.add(this.cameraHelper)):this.cameraHelper&&this.object3D.remove(this.cameraHelper))}},gi=class extends W{constructor(e){super(e)}initObject(e){let t=new c.PlaneGeometry(1,1),n=new c.TextureLoader().load(e),r=new c.MeshBasicMaterial({map:n});return new c.Mesh(t,r)}},_i=class extends W{constructor(e){super(e);let t=this.object3D.children[0];this.object3D.addEventListener(`removed`,()=>{t.element.remove()})}initObject(e){return new Zt(e)}},vi={touchDevice:navigator.maxTouchPoints>0,width:`600px`,height:`300px`},yi=class extends HTMLElement{options;canvas;scene;camera;controller;_maxDistance;_leftActive;_leftCenter;leftJoystick;_leftPointerId=null;_rightActive;_rightCenter;rightJoystick;_rightPointerId=null;leftButton;rightButton;_leftButtonCount;_rightButtonCount;keys;_ro;constructor(e={}){super(),this.options={...vi,...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 E}
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,this._leftButtonCount=0,this._rightButtonCount=0;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 m=Math.atan2(A,c);h=Math.cos(m)*this._maxDistance,u=Math.sin(m)*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 m=Math.atan2(A,c);h=Math.cos(m)*this._maxDistance,u=Math.sin(m)*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,this._leftButtonCount++}),r.addEventListener("pointerup",()=>{this.leftButton=!1});const o=this.shadowRoot.querySelector(".btn.right");o&&(o.addEventListener("pointerdown",()=>{this.rightButton=!0,this._rightButtonCount++}),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._leftButtonCount++):this.leftButton=!1,this.keys.has("Enter")?(this.rightButton=!0,this._rightButtonCount++):this.rightButton=!1}getLeftButtonCount(){const e=this._leftButtonCount;return this._leftButtonCount=0,e}getRightButtonCount(){const e=this._rightButtonCount;return this._rightButtonCount=0,e}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)}setShadowMap(e){this.canvas.setShadowMap(e)}}customElements.define("game-canvas-a3",gr);const mr={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 sa{opt;trans;motion;constructor(e){this.opt={...mr,...e},this.trans=new Er(this),this.motion=new Ir(this)}steer(e){this.trans.controller&&(this.trans.controller.setWheelSteering(0,e),this.trans.controller.setWheelSteering(1,e))}accelerate(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 Er{cc;transform;objectA3;controller;chassisBodyDesc;chassisBody;chassisColliderDesc;chassisCollider;constructor(e){this.cc=e,this.transform=new qe}init(e,t){this.transform.set(e),this.objectA3=t,this.chassisBodyDesc=new Pe.RigidBodyDesc(Pe.RigidBodyType.Dynamic),this.chassisColliderDesc=Pe.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&&tt.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.chassisCollider&&(e.world.removeCollider(this.chassisCollider,!0),tt.delete(this.chassisCollider.handle),this.chassisCollider=void 0),this.chassisBody&&e.world.removeRigidBody(this.chassisBody),this.chassisBody=void 0}setPosition(e){}setPositionNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinearVelocity(e){}getLinearVelocity(e){return e||(e=new ce),this.chassisBody?e.set(this.chassisBody.linvel()):this.chassisBodyDesc&&e.set(this.chassisBodyDesc.linvel),e}setAngularVelocity(e){}getAngularVelocity(e){return e||(e=new ce),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 ce;update(e){if(this.cc.opt.aerodynamicDrag>0&&this.chassisBody){const t=new ce(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.transform.loc.set(this.chassisBody.translation()),this.chassisBody&&this.transform.quat.set(this.chassisBody.rotation())}}class Ir{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 ce(this.cm.trans.chassisBody.translation()),n=new Me(this.cm.trans.chassisBody.rotation()),r=new Me(-n.x,-n.y,-n.z,n.w),o=new ce(this.cm.trans.chassisBody.translation());o.add(this.cm.opt.chassisOffset),o.sub(t);const s=new Me(this.cm.trans.chassisBody.rotation());s.mul(r);const c=new Me,A=new ce,a=new Me;{const l=this.cm.opt.wheelFrontAxle,d=this.cm.trans.controller.wheelSuspensionLength(0)||0,f=this.cm.trans.controller.wheelSteering(0)||0,C=this.cm.trans.controller.wheelRotation(0)||0;A.set(-this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),A.sub(0,d,0),a.set(0,Math.sin(f/2),0,Math.cos(f/2)),c.set(l.x*Math.sin(C/2),l.y*Math.sin(C/2),l.z*Math.sin(C/2),Math.cos(C/2)),a.mul(c)}const h=new ce,u=new Me;{const l=this.cm.opt.wheelFrontAxle,d=this.cm.trans.controller.wheelSuspensionLength(1)||0,f=this.cm.trans.controller.wheelSteering(1)||0,C=this.cm.trans.controller.wheelRotation(1)||0;h.set(this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),h.sub(0,d,0),u.set(0,Math.sin(f/2),0,Math.cos(f/2)),c.set(l.x*Math.sin(C/2),l.y*Math.sin(C/2),l.z*Math.sin(C/2),Math.cos(C/2)),u.mul(c)}const m=new ce,p=new Me;{const l=this.cm.opt.wheelRearAxle,d=this.cm.trans.controller.wheelSuspensionLength(2)||0,f=this.cm.trans.controller.wheelSteering(2)||0,C=this.cm.trans.controller.wheelRotation(2)||0;m.set(-this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),m.sub(0,d,0),p.set(0,Math.sin(f/2),0,Math.cos(f/2)),c.set(l.x*Math.sin(C/2),l.y*Math.sin(C/2),l.z*Math.sin(C/2),Math.cos(C/2)),p.mul(c)}const E=new ce,g=new Me;{const l=this.cm.opt.wheelRearAxle,d=this.cm.trans.controller.wheelSuspensionLength(3)||0,f=this.cm.trans.controller.wheelSteering(3)||0,C=this.cm.trans.controller.wheelRotation(3)||0;E.set(this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),E.sub(0,d,0),g.set(0,Math.sin(f/2),0,Math.cos(f/2)),c.set(l.x*Math.sin(C/2),l.y*Math.sin(C/2),l.z*Math.sin(C/2),Math.cos(C/2)),g.mul(c)}return{chassis:{loc:o,quat:s},frontRight:{loc:h,quat:u},frontLeft:{loc:A,quat:a},rearRight:{loc:E,quat:g},rearLeft:{loc:m,quat:p}}}}class kn extends vn{camera;headLight;constructor(e){super(),this.camera=e??new K.PerspectiveCamera(75,1,.01,1e3),this.headLight=new K.SpotLight(16777215,1,0,Math.PI/3,0,0),this.headLight.position.set(0,0,0);const t=new K.Object3D;t.position.set(0,0,-10),this.headLight.target=t,this.object3D.add(this.camera),this.object3D.add(this.headLight),this.object3D.add(t)}initObject(){return new K.Object3D}setAudioListener(e){this.camera.add(e)}setHeadLight(e){this.headLight.intensity=e?1:0}calcNDC(e){const t=new K.Vector3(e.x,e.y,e.z);return t.project(this.camera),{x:t.x,y:t.y}}}const br={camera:void 0,antialias:!1,optionalFeatures:["local-floor"],requiredFeatures:[]};class Cr extends HTMLElement{options;base;renderer;scene;camera;controller;camera3js;timer;vrButton;currentSession=null;constructor(e){super(),this.options={...br,...e},this.options.camera?(this.camera3js=this.options.camera.camera,this.camera=this.options.camera):(this.camera3js=new K.PerspectiveCamera(75,1,.01,1e3),this.camera=new kn(this.camera3js)),this.base=new Lt(this.camera),this.scene=this.base.scene,this.controller=this.base.controller,this.timer=new K.Timer,this.renderer=new K.WebGLRenderer({antialias:this.options.antialias}),this.renderer.xr.enabled=!0,_t({renderer:this.renderer}),this.vrButton=this.createVRButton(),this.renderer.setAnimationLoop(this.renderingLoop)}connectedCallback(){this.appendChild(this.vrButton)}createVRButton(){const e=document.createElement("button");return e.textContent="VR非対応",e.disabled=!0,navigator.xr&&navigator.xr.isSessionSupported("immersive-vr").then(t=>{t?(e.textContent="VRに入る",e.disabled=!1,e.addEventListener("click",()=>this.onButtonClick())):e.textContent="VR非対応"}),e}async onButtonClick(){if(this.currentSession){await this.currentSession.end();return}const e={optionalFeatures:this.options.optionalFeatures,requiredFeatures:this.options.requiredFeatures},t=await navigator.xr.requestSession("immersive-vr",e);this.renderer.xr.setSession(t),this.currentSession=t,this.vrButton.textContent="VRを終了",t.addEventListener("end",()=>{this.currentSession=null,this.vrButton.textContent="VRに入る"})}disconnectedCallback(){this.renderer.setAnimationLoop(null),this.currentSession&&this.currentSession.end()}replaceScene(e){return this.scene=e,this.base.replaceScene(e)}setController(e){this.controller=e,this.base.setController(e)}renderingLoop=()=>{this.timer.update();const e=this.timer.getDelta();this.base.updateScene(e),this.renderer.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 K.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new K.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 K.Vector2;this.renderer.getSize(r);const o=new K.Vector3(e/r.x*2-1,-(t/r.y)*2+1,.5);o.unproject(this.camera3js);const s=o.sub(this.camera3js.position).normalize(),c=this.camera3js.position;return new ce(c.x+s.x*n,c.y+s.y*n,c.z+s.z*n)}cameraToScreen(e){const n=new K.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return x.v0.set(n),this.worldToScreen(x.v0)}screenToCamera(e,t,n){const r=this.screenToWorld(e,t,n),o=new K.Vector3(r.x,r.y,r.z);return r.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),r}setShadowMap(e){this.renderer.shadowMap.enabled=e}}customElements.define("vr-view-a3",Cr);const yr={camera:void 0,antialias:!1,optionalFeatures:["local-floor"],requiredFeatures:[]};class Br extends HTMLElement{options;base;renderer;scene;camera;controller;camera3js;timer;arButton;currentSession=null;constructor(e){super(),this.options={...yr,...e},this.options.camera?(this.camera3js=this.options.camera.camera,this.camera=this.options.camera):(this.camera3js=new K.PerspectiveCamera(75,1,.01,1e3),this.camera=new kn(this.camera3js)),this.base=new Lt(this.camera),this.scene=this.base.scene,this.controller=this.base.controller,this.timer=new K.Timer,this.renderer=new K.WebGLRenderer({antialias:this.options.antialias,alpha:!0}),this.renderer.xr.enabled=!0,_t({renderer:this.renderer}),this.arButton=this.createARButton(),this.renderer.setAnimationLoop(this.renderingLoop)}connectedCallback(){this.appendChild(this.arButton)}createARButton(){const e=document.createElement("button");return e.textContent="AR非対応",e.disabled=!0,navigator.xr&&navigator.xr.isSessionSupported("immersive-ar").then(t=>{t?(e.textContent="ARに入る",e.disabled=!1,e.addEventListener("click",()=>this.onButtonClick())):e.textContent="AR非対応"}),e}async onButtonClick(){if(this.currentSession){await this.currentSession.end();return}const e={optionalFeatures:this.options.optionalFeatures,requiredFeatures:this.options.requiredFeatures},t=await navigator.xr.requestSession("immersive-ar",e);this.renderer.xr.setSession(t),this.currentSession=t,this.arButton.textContent="ARを終了",t.addEventListener("end",()=>{this.currentSession=null,this.arButton.textContent="ARに入る"})}disconnectedCallback(){this.renderer.setAnimationLoop(null),this.currentSession&&this.currentSession.end()}replaceScene(e){return this.scene=e,this.base.replaceScene(e)}setController(e){this.controller=e,this.base.setController(e)}renderingLoop=()=>{this.timer.update();const e=this.timer.getDelta();this.base.updateScene(e),this.renderer.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 K.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const n=new K.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 K.Vector2;this.renderer.getSize(r);const o=new K.Vector3(e/r.x*2-1,-(t/r.y)*2+1,.5);o.unproject(this.camera3js);const s=o.sub(this.camera3js.position).normalize(),c=this.camera3js.position;return new ce(c.x+s.x*n,c.y+s.y*n,c.z+s.z*n)}cameraToScreen(e){const n=new K.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return x.v0.set(n),this.worldToScreen(x.v0)}screenToCamera(e,t,n){const r=this.screenToWorld(e,t,n),o=new K.Vector3(r.x,r.y,r.z);return r.set(o.applyMatrix4(this.camera3js.matrixWorldInverse)),r}setShadowMap(e){this.renderer.shadowMap.enabled=e}}customElements.define("ar-view-a3",Br);exports.ARView=Br;exports.Acerola3D=pi;exports.Action=bn;exports.ActionObject=bt;exports.AvatarPositionController=Oo;exports.AvatarVelocityController=Po;exports.BaseController=zt;exports.BaseView=Lt;exports.BillboardTransformer=Zn;exports.Box=$s;exports.Camera=vn;exports.Canvas=lr;exports.CarControl=sa;exports.CarMotion=Ir;exports.CarTransformer=Er;exports.ClipMotion=Tn;exports.DefaultTransformer=vt;exports.DynamicCharacterTransformer=si;exports.FollowTransformer=ti;exports.GLTF=Ps;exports.GameCanvas=gr;exports.Html3D=oa;exports.ImagePlane=ra;exports.KinematicCharacterTransformer=ri;exports.ObjectA3=Oe;exports.OrbitController=Ei;exports.Quat=Me;exports.RapierPhysicsEngine=Rt;exports.RapierPhysicsWorld=In;exports.SampleObject=zs;exports.Scene=mi;exports.SmoothBillboardTransformer=$n;exports.SmoothTransformer=mn;exports.Sound=At;exports.Sphere=ea;exports.StandardLights=ia;exports.StaticTransformer=Jn;exports.Text3D=Xs;exports.ThreeCamera=Qt;exports.ThreeObject=Zs;exports.Transform=qe;exports.VRView=Cr;exports.Vec3=ce;exports.Window=hr;exports.XRCamera=kn;exports.asyncSleep=Jr;exports.collisionMap=tt;exports.deepMerge=Pt;exports.defaultARViewOptions=yr;exports.defaultCanvasOptions=cr;exports.defaultCarControlOptions=mr;exports.defaultDynamicCharacterTransformerOptions=oi;exports.defaultFollowTransformerOptions=ei;exports.defaultGameCanvasOptions=pr;exports.defaultKinematicCharacterTransformerOptions=ii;exports.defaultSampleObjectOptions=gn;exports.defaultSmoothTransformerOptions=Xn;exports.defaultText3DOptions=fr;exports.defaultVRViewOptions=br;exports.defaultWindowOptions=ur;exports.eulerToQuaternion=ht;exports.getLookAtQuaternion=st;exports.initFont=Js;exports.initPhysics=Yr;exports.initSound=No;exports.recreateGLTFLoader=_t;
293
- //# sourceMappingURL=a3js.cjs.js.map
292
+ `,this.style.touchAction=`none`,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._leftPointerId,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,this._leftButtonCount=0,this._rightButtonCount=0;let t=this.shadowRoot.querySelector(`.joystick.left .stick`);if(!t)return;t.addEventListener(`pointerdown`,e=>{if(this._leftPointerId!==null)return;this._leftPointerId=e.pointerId,this._leftActive=!0,t.setPointerCapture(e.pointerId);let n=t.getBoundingClientRect();this._leftCenter.x=n.left+n.width/2,this._leftCenter.y=n.top+n.height/2}),t.addEventListener(`pointermove`,e=>{if(!this._leftActive||e.pointerId!==this._leftPointerId)return;let n=e.clientX-this._leftCenter.x,r=e.clientY-this._leftCenter.y,i=Math.sqrt(n*n+r*r),a=n,o=r;if(i>this._maxDistance){let e=Math.atan2(r,n);a=Math.cos(e)*this._maxDistance,o=Math.sin(e)*this._maxDistance}t.style.transform=`translate(calc(-50% + ${a}px), calc(-50% + ${o}px))`,this.leftJoystick.x=a/this._maxDistance,this.leftJoystick.y=-(o/this._maxDistance)});let n=e=>{e.pointerId===this._leftPointerId&&(this._leftPointerId=null,this._leftActive=!1,t.style.transform=`translate(-50%, -50%)`,this.leftJoystick.x=0,this.leftJoystick.y=0)};t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n);let r=this.shadowRoot.querySelector(`.joystick.right .stick`);if(!r)return;r.addEventListener(`pointerdown`,e=>{if(this._rightPointerId!==null)return;this._rightPointerId=e.pointerId,this._rightActive=!0;let t=r.getBoundingClientRect();this._rightCenter.x=t.left+t.width/2,this._rightCenter.y=t.top+t.height/2,r.setPointerCapture(e.pointerId)}),r.addEventListener(`pointermove`,e=>{if(!this._rightActive||e.pointerId!==this._rightPointerId)return;let t=e.clientX-this._rightCenter.x,n=e.clientY-this._rightCenter.y,i=Math.sqrt(t*t+n*n),a=t,o=n;if(i>this._maxDistance){let e=Math.atan2(n,t);a=Math.cos(e)*this._maxDistance,o=Math.sin(e)*this._maxDistance}r.style.transform=`translate(calc(-50% + ${a}px), calc(-50% + ${o}px))`,this.rightJoystick.x=a/this._maxDistance,this.rightJoystick.y=-(o/this._maxDistance)});let i=e=>{e.pointerId===this._rightPointerId&&(this._rightPointerId=null,this._rightActive=!1,r.style.transform=`translate(-50%, -50%)`,this.rightJoystick.x=0,this.rightJoystick.y=0)};r.addEventListener(`pointerup`,i),r.addEventListener(`pointercancel`,i);let a=this.shadowRoot.querySelector(`.btn.left`);if(!a)return;a.addEventListener(`pointerdown`,()=>{this.leftButton=!0,this._leftButtonCount++}),a.addEventListener(`pointerup`,()=>{this.leftButton=!1});let o=this.shadowRoot.querySelector(`.btn.right`);o&&(o.addEventListener(`pointerdown`,()=>{this.rightButton=!0,this._rightButtonCount++}),o.addEventListener(`pointerup`,()=>{this.rightButton=!1}),window.addEventListener(`keydown`,this.keyDownListener),window.addEventListener(`keyup`,this.keyUpListener),this.options.touchDevice||(this.shadowRoot.querySelectorAll(`.joystick`).forEach(e=>{e.style.display=`none`}),this.shadowRoot.querySelectorAll(`.btn`).forEach(e=>{e.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=>{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;if(!(n===0||r===0))if(n>r){let e=this.shadowRoot.querySelector(`.btn.left`);e.style.bottom=`50px`,e.style.left=`200px`;let t=this.shadowRoot.querySelector(`.btn.right`);t.style.bottom=`50px`,t.style.right=`200px`}else{let e=this.shadowRoot.querySelector(`.btn.left`);e.style.bottom=`200px`,e.style.left=`50px`;let t=this.shadowRoot.querySelector(`.btn.right`);t.style.bottom=`200px`,t.style.right=`50px`}}),this._ro.observe(this)}disconnectedCallback(){this._ro?.disconnect(),window.removeEventListener(`keydown`,this.keyDownListener),window.removeEventListener(`keyup`,this.keyUpListener)}updateUIFromKeyInfo(){let e={x:0,y:0},t={x:0,y:0};this.keys.has(`KeyW`)&&(e.y+=1),this.keys.has(`KeyA`)&&--e.x,this.keys.has(`KeyS`)&&--e.y,this.keys.has(`KeyD`)&&(e.x+=1),this.keys.has(`ArrowUp`)&&(t.y+=1),this.keys.has(`ArrowLeft`)&&--t.x,this.keys.has(`ArrowDown`)&&--t.y,this.keys.has(`ArrowRight`)&&(t.x+=1);let n=Math.sqrt(e.x*e.x+e.y*e.y);n>0&&(e.x/=n,e.y/=n),this.leftJoystick=e;let 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._leftButtonCount++):this.leftButton=!1,this.keys.has(`Enter`)?(this.rightButton=!0,this._rightButtonCount++):this.rightButton=!1}getLeftButtonCount(){let e=this._leftButtonCount;return this._leftButtonCount=0,e}getRightButtonCount(){let e=this._rightButtonCount;return this._rightButtonCount=0,e}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)}setShadowMap(e){this.canvas.setShadowMap(e)}};customElements.define(`game-canvas-a3`,yi);var bi={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},xi=class{opt;trans;motion;constructor(e){this.opt={...bi,...e},this.trans=new Si(this),this.motion=new Ci(this)}steer(e){this.trans.controller&&(this.trans.controller.setWheelSteering(0,e),this.trans.controller.setWheelSteering(1,e))}accelerate(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))}},Si=class{cc;transform;objectA3;controller;chassisBodyDesc;chassisBody;chassisColliderDesc;chassisCollider;constructor(e){this.cc=e,this.transform=new v}init(e,t){this.transform.set(e),this.objectA3=t,this.chassisBodyDesc=new R.RigidBodyDesc(R.RigidBodyType.Dynamic),this.chassisColliderDesc=R.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&&z.set(this.chassisCollider.handle,this.objectA3),this.chassisBody&&(this.controller=e.world.createVehicleController(this.chassisBody)),this.controller){let e={x:0,y:0,z:0};e.x=-this.cc.opt.wheelFrontAxleLength/2,e.y=this.cc.opt.wheelFrontYPosition,e.z=this.cc.opt.wheelFrontZPosition,this.controller.addWheel(e,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),e.x=this.cc.opt.wheelFrontAxleLength/2,e.y=this.cc.opt.wheelFrontYPosition,e.z=this.cc.opt.wheelFrontZPosition,this.controller.addWheel(e,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),e.x=-this.cc.opt.wheelRearAxleLength/2,e.y=this.cc.opt.wheelRearYPosition,e.z=this.cc.opt.wheelRearZPosition,this.controller.addWheel(e,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),e.x=this.cc.opt.wheelRearAxleLength/2,e.y=this.cc.opt.wheelRearYPosition,e.z=this.cc.opt.wheelRearZPosition,this.controller.addWheel(e,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.chassisCollider&&=(e.world.removeCollider(this.chassisCollider,!0),z.delete(this.chassisCollider.handle),void 0),this.chassisBody&&e.world.removeRigidBody(this.chassisBody),this.chassisBody=void 0}setPosition(e){}setPositionNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}setLinearVelocity(e){}getLinearVelocity(e){return e||=new u,this.chassisBody?e.set(this.chassisBody.linvel()):this.chassisBodyDesc&&e.set(this.chassisBodyDesc.linvel),e}setAngularVelocity(e){}getAngularVelocity(e){return e||=new u,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 u;update(e){if(this.cc.opt.aerodynamicDrag>0&&this.chassisBody){let e=new u(this.chassisBody.linvel());Math.abs(e.y)>3&&e.set(e.x,3*e.y/Math.abs(e.y),e.z),this.vv.lerp(this.vv,e,.9);let t=this.vv.length();t!==0&&(e.set(this.vv),e.normalize(),e.scale(-t*t*this.cc.opt.aerodynamicDrag),this.chassisBody.resetForces(!0),this.chassisBody.addForce({x:e.x,y:e.y,z:e.z},!0))}this.controller?.updateVehicle(e),this.chassisBody&&this.transform.loc.set(this.chassisBody.translation()),this.chassisBody&&this.transform.quat.set(this.chassisBody.rotation())}},Ci=class{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||!this.cm.trans.controller)return{};let t=new u(this.cm.trans.chassisBody.translation()),n=new d(this.cm.trans.chassisBody.rotation()),r=new d(-n.x,-n.y,-n.z,n.w),i=new u(this.cm.trans.chassisBody.translation());i.add(this.cm.opt.chassisOffset),i.sub(t);let a=new d(this.cm.trans.chassisBody.rotation());a.mul(r);let o=new d,s=new u,c=new d;{let e=this.cm.opt.wheelFrontAxle,t=this.cm.trans.controller.wheelSuspensionLength(0)||0,n=this.cm.trans.controller.wheelSteering(0)||0,r=this.cm.trans.controller.wheelRotation(0)||0;s.set(-this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),s.sub(0,t,0),c.set(0,Math.sin(n/2),0,Math.cos(n/2)),o.set(e.x*Math.sin(r/2),e.y*Math.sin(r/2),e.z*Math.sin(r/2),Math.cos(r/2)),c.mul(o)}let l=new u,f=new d;{let e=this.cm.opt.wheelFrontAxle,t=this.cm.trans.controller.wheelSuspensionLength(1)||0,n=this.cm.trans.controller.wheelSteering(1)||0,r=this.cm.trans.controller.wheelRotation(1)||0;l.set(this.cm.opt.wheelFrontAxleLength/2,this.cm.opt.wheelFrontYPosition,this.cm.opt.wheelFrontZPosition),l.sub(0,t,0),f.set(0,Math.sin(n/2),0,Math.cos(n/2)),o.set(e.x*Math.sin(r/2),e.y*Math.sin(r/2),e.z*Math.sin(r/2),Math.cos(r/2)),f.mul(o)}let p=new u,m=new d;{let e=this.cm.opt.wheelRearAxle,t=this.cm.trans.controller.wheelSuspensionLength(2)||0,n=this.cm.trans.controller.wheelSteering(2)||0,r=this.cm.trans.controller.wheelRotation(2)||0;p.set(-this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),p.sub(0,t,0),m.set(0,Math.sin(n/2),0,Math.cos(n/2)),o.set(e.x*Math.sin(r/2),e.y*Math.sin(r/2),e.z*Math.sin(r/2),Math.cos(r/2)),m.mul(o)}let h=new u,g=new d;{let e=this.cm.opt.wheelRearAxle,t=this.cm.trans.controller.wheelSuspensionLength(3)||0,n=this.cm.trans.controller.wheelSteering(3)||0,r=this.cm.trans.controller.wheelRotation(3)||0;h.set(this.cm.opt.wheelRearAxleLength/2,this.cm.opt.wheelRearYPosition,this.cm.opt.wheelRearZPosition),h.sub(0,t,0),g.set(0,Math.sin(n/2),0,Math.cos(n/2)),o.set(e.x*Math.sin(r/2),e.y*Math.sin(r/2),e.z*Math.sin(r/2),Math.cos(r/2)),g.mul(o)}return{chassis:{loc:i,quat:a},frontRight:{loc:l,quat:f},frontLeft:{loc:s,quat:c},rearRight:{loc:h,quat:g},rearLeft:{loc:p,quat:m}}}},wi=class extends Ht{camera;headLight;constructor(e){super(),this.camera=e??new c.PerspectiveCamera(75,1,.01,1e3),this.headLight=new c.SpotLight(16777215,1,0,Math.PI/3,0,0),this.headLight.position.set(0,0,0);let t=new c.Object3D;t.position.set(0,0,-10),this.headLight.target=t,this.object3D.add(this.camera),this.object3D.add(this.headLight),this.object3D.add(t)}initObject(){return new c.Object3D}setAudioListener(e){this.camera.add(e)}setHeadLight(e){this.headLight.intensity=+!!e}calcNDC(e){let t=new c.Vector3(e.x,e.y,e.z);return t.project(this.camera),{x:t.x,y:t.y}}},Ti={camera:void 0,antialias:!1,optionalFeatures:[`local-floor`],requiredFeatures:[]},Ei=class extends HTMLElement{options;base;renderer;scene;camera;controller;camera3js;timer;vrButton;currentSession=null;constructor(e){super(),this.options={...Ti,...e},this.options.camera?(this.camera3js=this.options.camera.camera,this.camera=this.options.camera):(this.camera3js=new c.PerspectiveCamera(75,1,.01,1e3),this.camera=new wi(this.camera3js)),this.base=new Yt(this.camera),this.scene=this.base.scene,this.controller=this.base.controller,this.timer=new c.Timer,this.renderer=new c.WebGLRenderer({antialias:this.options.antialias}),this.renderer.xr.enabled=!0,Rr({renderer:this.renderer}),this.vrButton=this.createVRButton(),this.renderer.setAnimationLoop(this.renderingLoop)}connectedCallback(){this.appendChild(this.vrButton)}createVRButton(){let e=document.createElement(`button`);return e.textContent=`VR非対応`,e.disabled=!0,navigator.xr&&navigator.xr.isSessionSupported(`immersive-vr`).then(t=>{t?(e.textContent=`VRに入る`,e.disabled=!1,e.addEventListener(`click`,()=>this.onButtonClick())):e.textContent=`VR非対応`}),e}async onButtonClick(){if(this.currentSession){await this.currentSession.end();return}let e={optionalFeatures:this.options.optionalFeatures,requiredFeatures:this.options.requiredFeatures},t=await navigator.xr.requestSession(`immersive-vr`,e);this.renderer.xr.setSession(t),this.currentSession=t,this.vrButton.textContent=`VRを終了`,t.addEventListener(`end`,()=>{this.currentSession=null,this.vrButton.textContent=`VRに入る`})}disconnectedCallback(){this.renderer.setAnimationLoop(null),this.currentSession&&this.currentSession.end()}replaceScene(e){return this.scene=e,this.base.replaceScene(e)}setController(e){this.controller=e,this.base.setController(e)}renderingLoop=()=>{this.timer.update();let e=this.timer.getDelta();this.base.updateScene(e),this.renderer.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){let t=new c.Vector3(e.x,e.y,e.z);t.project(this.camera3js);let n=new c.Vector2;return this.renderer.getSize(n),{x:(t.x+1)/2*n.x,y:(1-t.y)/2*n.y}}screenToWorld(e,t,n){let r=new c.Vector2;this.renderer.getSize(r);let i=new c.Vector3(e/r.x*2-1,-(t/r.y)*2+1,.5);i.unproject(this.camera3js);let a=i.sub(this.camera3js.position).normalize(),o=this.camera3js.position;return new u(o.x+a.x*n,o.y+a.y*n,o.z+a.z*n)}cameraToScreen(e){let t=new c.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return U.v0.set(t),this.worldToScreen(U.v0)}screenToCamera(e,t,n){let r=this.screenToWorld(e,t,n),i=new c.Vector3(r.x,r.y,r.z);return r.set(i.applyMatrix4(this.camera3js.matrixWorldInverse)),r}setShadowMap(e){this.renderer.shadowMap.enabled=e}};customElements.define(`vr-view-a3`,Ei);var Di={camera:void 0,antialias:!1,optionalFeatures:[`local-floor`],requiredFeatures:[]},Oi=class extends HTMLElement{options;base;renderer;scene;camera;controller;camera3js;timer;arButton;currentSession=null;constructor(e){super(),this.options={...Di,...e},this.options.camera?(this.camera3js=this.options.camera.camera,this.camera=this.options.camera):(this.camera3js=new c.PerspectiveCamera(75,1,.01,1e3),this.camera=new wi(this.camera3js)),this.base=new Yt(this.camera),this.scene=this.base.scene,this.controller=this.base.controller,this.timer=new c.Timer,this.renderer=new c.WebGLRenderer({antialias:this.options.antialias,alpha:!0}),this.renderer.xr.enabled=!0,Rr({renderer:this.renderer}),this.arButton=this.createARButton(),this.renderer.setAnimationLoop(this.renderingLoop)}connectedCallback(){this.appendChild(this.arButton)}createARButton(){let e=document.createElement(`button`);return e.textContent=`AR非対応`,e.disabled=!0,navigator.xr&&navigator.xr.isSessionSupported(`immersive-ar`).then(t=>{t?(e.textContent=`ARに入る`,e.disabled=!1,e.addEventListener(`click`,()=>this.onButtonClick())):e.textContent=`AR非対応`}),e}async onButtonClick(){if(this.currentSession){await this.currentSession.end();return}let e={optionalFeatures:this.options.optionalFeatures,requiredFeatures:this.options.requiredFeatures},t=await navigator.xr.requestSession(`immersive-ar`,e);this.renderer.xr.setSession(t),this.currentSession=t,this.arButton.textContent=`ARを終了`,t.addEventListener(`end`,()=>{this.currentSession=null,this.arButton.textContent=`ARに入る`})}disconnectedCallback(){this.renderer.setAnimationLoop(null),this.currentSession&&this.currentSession.end()}replaceScene(e){return this.scene=e,this.base.replaceScene(e)}setController(e){this.controller=e,this.base.setController(e)}renderingLoop=()=>{this.timer.update();let e=this.timer.getDelta();this.base.updateScene(e),this.renderer.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){let t=new c.Vector3(e.x,e.y,e.z);t.project(this.camera3js);let n=new c.Vector2;return this.renderer.getSize(n),{x:(t.x+1)/2*n.x,y:(1-t.y)/2*n.y}}screenToWorld(e,t,n){let r=new c.Vector2;this.renderer.getSize(r);let i=new c.Vector3(e/r.x*2-1,-(t/r.y)*2+1,.5);i.unproject(this.camera3js);let a=i.sub(this.camera3js.position).normalize(),o=this.camera3js.position;return new u(o.x+a.x*n,o.y+a.y*n,o.z+a.z*n)}cameraToScreen(e){let t=new c.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return U.v0.set(t),this.worldToScreen(U.v0)}screenToCamera(e,t,n){let r=this.screenToWorld(e,t,n),i=new c.Vector3(r.x,r.y,r.z);return r.set(i.applyMatrix4(this.camera3js.matrixWorldInverse)),r}setShadowMap(e){this.renderer.shadowMap.enabled=e}};customElements.define(`ar-view-a3`,Oi),exports.ARView=Oi,exports.Acerola3D=zt,exports.Action=je,exports.ActionObject=Me,exports.AvatarPositionController=Kt,exports.AvatarVelocityController=Jt,exports.BaseController=Ut,exports.BaseView=Yt,exports.BillboardTransformer=A,exports.Box=ui,exports.Camera=Ht,exports.Canvas=Ur,exports.CarControl=xi,exports.CarMotion=Ci,exports.CarTransformer=Si,exports.ClipMotion=jt,exports.DefaultTransformer=y,exports.DynamicCharacterTransformer=Te,exports.FollowTransformer=ee,exports.GLTF=Vr,exports.GameCanvas=yi,exports.Html3D=_i,exports.ImagePlane=gi,exports.KinematicCharacterTransformer=Se,exports.ObjectA3=W,exports.OrbitController=Wt,exports.Quat=d,exports.RapierPhysicsEngine=ce,exports.RapierPhysicsWorld=B,exports.SampleObject=Qr,exports.Scene=Vt,exports.SmoothBillboardTransformer=M,exports.SmoothTransformer=S,exports.Sound=Pt,exports.Sphere=di,exports.StandardLights=hi,exports.StaticTransformer=b,exports.Text3D=ci,exports.ThreeCamera=Xt,exports.ThreeObject=li,exports.Transform=v,exports.VRView=Ei,exports.Vec3=u,exports.Window=qr,exports.XRCamera=wi,exports.asyncSleep=me,exports.collisionMap=z,exports.deepMerge=be,exports.defaultARViewOptions=Di,exports.defaultCanvasOptions=Hr,exports.defaultCarControlOptions=bi,exports.defaultDynamicCharacterTransformerOptions=we,exports.defaultFollowTransformerOptions=N,exports.defaultGameCanvasOptions=vi,exports.defaultKinematicCharacterTransformerOptions=xe,exports.defaultSampleObjectOptions=Zr,exports.defaultSetLightShadowOptions=ke,exports.defaultSmoothTransformerOptions=x,exports.defaultText3DOptions=si,exports.defaultVRViewOptions=Ti,exports.defaultWindowOptions=Kr,exports.eulerToQuaternion=m,exports.getLookAtQuaternion=p,exports.initFont=oi,exports.initPhysics=pe,exports.initSound=Nt,exports.recreateGLTFLoader=Rr;
293
+ //# sourceMappingURL=a3js.cjs.js.map