a3js 0.0.25 → 0.0.26
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 +96 -95
- package/dist/a3js.cjs.js.map +1 -1
- package/dist/a3js.es.js +8161 -7051
- package/dist/a3js.es.js.map +1 -1
- package/package.json +1 -1
package/dist/a3js.cjs.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
"use strict";var Nn=Object.create;var Gt=Object.defineProperty;var wn=Object.getOwnPropertyDescriptor;var kn=Object.getOwnPropertyNames;var Cn=Object.getPrototypeOf,Mn=Object.prototype.hasOwnProperty;var Pn=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of kn(e))!Mn.call(n,r)&&r!==t&&Gt(n,r,{get:()=>e[r],enumerable:!(i=wn(e,r))||i.enumerable});return n};var Dn=(n,e,t)=>(t=n!=null?Nn(Cn(n)):{},Pn(e||!n||!n.__esModule?Gt(t,"default",{value:n,enumerable:!0}):t,n));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("three"),$t=require("fflate");function Fn(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const se=Fn(R);function en(n){return typeof n=="string"}function Mt(n){return n.isMesh===!0}function Un(n){return n.type==="RoundedBoxGeometry"}function jn(n){return n.type==="BoxGeometry"}function Bn(n){return n.type==="SphereGeometry"}function Gn(n){return n.type==="IcosahedronGeometry"}function zn(n){return n.type==="CylinderGeometry"}function Vn(n){return n.type==="CapsuleGeometry"}function Hn(n){return n.isBone===!0}function Wn(n){return n.isPerspectiveCamera===!0}class ke{_x;_y;_z;_w;get x(){return this._x}get y(){return this._y}get z(){return this._z}get w(){return this._w}constructor(e,t,i,r){typeof e=="number"?(this._x=e,this._y=t,this._z=i,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 ke(this)}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,i,r){return typeof e=="number"?(this._x=e,this._y=t,this._z=i,this._w=r):(this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w),this}mul(e,t,i,r){const a=new ke(this),o=new ke;return typeof e=="number"?o.set(e,t,i,r):o.set(e),this._x=a.w*o.x+a.x*o.w+a.y*o.z-a.z*o.y,this._y=a.w*o.y-a.x*o.z+a.y*o.w+a.z*o.x,this._z=a.w*o.z+a.x*o.y-a.y*o.x+a.z*o.w,this._w=a.w*o.w-a.x*o.x-a.y*o.y-a.z*o.z,this}lerp(e,t,i){this._x=(1-i)*e.x+i*t.x,this._y=(1-i)*e.y+i*t.y,this._z=(1-i)*e.z+i*t.z,this._w=(1-i)*e.w+i*t.w}slerp(e,t,i){if(i<0||i>1){console.warn("Quat.slerp(): t must be in [0,1]");return}const r=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w;if(r<.9995){const a=Math.acos(r),o=Math.sin((1-i)*a)/Math.sin(a),u=Math.sin(i*a)/Math.sin(a);this._x=o*e.x+u*t.x,this._y=o*e.y+u*t.y,this._z=o*e.z+u*t.z,this._w=o*e.w+u*t.w}else{this._x=(1-i)*e.x+i*t.x,this._y=(1-i)*e.y+i*t.y,this._z=(1-i)*e.z+i*t.z,this._w=(1-i)*e.w+i*t.w;const a=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w);a<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/a,this._y*=1/a,this._z*=1/a,this._w*=1/a)}}}function ct(n,e,t){t.normalize();const i=e.clone().sub(n).normalize(),r=new Ae().cross(i,t).normalize(),a=new Ae().cross(r,i),o=r.x,u=a.x,c=-i.x,s=r.y,f=a.y,h=-i.y,g=r.z,p=a.z,T=-i.z,m=o+f+T;if(m>0){const l=Math.sqrt(m+1)*2;return new ke((p-h)/l,(c-g)/l,(s-u)/l,.25*l)}else if(o>f&&o>T){const l=Math.sqrt(1+o-f-T)*2;return new ke(.25*l,(u+s)/l,(c+g)/l,(p-h)/l)}else if(f>T){const l=Math.sqrt(1+f-o-T)*2;return new ke((u+s)/l,.25*l,(h+p)/l,(c-g)/l)}else{const l=Math.sqrt(1+T-o-f)*2;return new ke((c+g)/l,(h+p)/l,.25*l,(s-u)/l)}}function tn(n,e="XYZ"){const t=new ke(0,0,0,1);for(let i=0;i<3;i++)switch(e.charAt(i)){case"X":t.mul(new ke(Math.sin(n.x),0,0,Math.cos(n.x)));break;case"Y":t.mul(new ke(0,Math.sin(n.y),0,Math.cos(n.y)));break;case"Z":t.mul(new ke(0,0,Math.sin(n.z),Math.cos(n.z)));break}return t}class Ae{_x;_y;_z;get x(){return this._x}get y(){return this._y}get z(){return this._z}constructor(e,t,i){typeof e=="number"?(this._x=e,this._y=t,this._z=i):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 Ae(this)}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,i){return typeof e=="number"?(this._x=e,this._y=t,this._z=i):(this._x=e.x,this._y=e.y,this._z=e.z),this}add(e,t,i){return typeof e=="number"?(this._x+=e,this._y+=t,this._z+=i):(this._x+=e.x,this._y+=e.y,this._z+=e.z),this}sub(e,t,i){return typeof e=="number"?(this._x-=e,this._y-=t,this._z-=i):(this._x-=e.x,this._y-=e.y,this._z-=e.z),this}scale(e){return this._x*=e,this._y*=e,this._z*=e,this}cross(e,t){return this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this}apply(e,t,i,r){const a=new ke;typeof e=="number"?a.set(e,t,i,r):a.set(e);const o=new ke(this._x,this._y,this._z,0),u=new ke(a).conjugate();return a.mul(o).mul(u),this._x=a.x,this._y=a.y,this._z=a.z,this}lerp(e,t,i){this._x=(1-i)*e.x+i*t.x,this._y=(1-i)*e.y+i*t.y,this._z=(1-i)*e.z+i*t.z}}class tt{objectA3;object3D;interpolation;billboard;constructor(e){this.objectA3=e,this.object3D=e?.object}setObject(e){this.objectA3=e,this.object3D=e.object}detachObject(e){this.objectA3=void 0,this.object3D=void 0}enableInterpolation(e){e&&!this.interpolation&&this.object3D?this.interpolation=new Kn(this.object3D):!e&&this.interpolation&&(this.interpolation=void 0)}enableBillboard(e){e&&this.billboard?this.billboard.setTarget(e.object):e&&!this.billboard&&this.objectA3?this.billboard=new Yn(this.objectA3,e.object):this.billboard=void 0}update(e){this.interpolation&&this.interpolation.update(e),this.billboard&&this.billboard.update()}setLocation(e){this.interpolation?this.interpolation.setLocation(e):this.object3D?.position.set(e.x,e.y,e.z),this.billboard&&this.billboard.update()}setLocationNow(e){this.interpolation?this.interpolation.setLocationNow(e):this.object3D?.position.set(e.x,e.y,e.z),this.billboard&&this.billboard.update()}setQuat(e){this.billboard||(this.interpolation?this.interpolation.setQuat(e):this.object3D?.quaternion.set(e.x,e.y,e.z,e.w))}setQuatNow(e){this.billboard||(this.interpolation?this.interpolation.setQuatNow(e):this.object3D?.quaternion.set(e.x,e.y,e.z,e.w))}setScale(e){this.interpolation?this.interpolation.setScale(e):this.object3D?.scale.set(e.x,e.y,e.z)}setScaleNow(e){this.interpolation?this.interpolation.setScaleNow(e):this.object3D?.scale.set(e.x,e.y,e.z)}controlMotion(...e){}setPause(e){}setTime(e){}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}}class Kn{obj;firstLoc;firstRot;firstScale;nowLoc;nowRot;nowScale;lastLoc;lastRot;lastScale;nowTime;duration;constructor(e){this.obj=e,this.firstLoc=new Ae(e.position),this.firstRot=new ke(e.quaternion),this.firstScale=new Ae(e.scale),this.nowLoc=new Ae(e.position),this.nowRot=new ke(e.quaternion),this.nowScale=new Ae(e.scale),this.lastLoc=new Ae(e.position),this.lastRot=new ke(e.quaternion),this.lastScale=new Ae(e.scale),this.nowTime=0,this.duration=1}setLocation(e){this.firstLoc.set(this.obj.position),this.firstRot.set(this.obj.quaternion),this.firstScale.set(this.obj.scale),this.lastLoc.set(e),this.nowTime=0}setLocationNow(e){this.setLocation(e),this.nowTime=1}setQuat(e){this.firstLoc.set(this.obj.position),this.firstRot.set(this.obj.quaternion),this.firstScale.set(this.obj.scale),this.lastRot.set(e),this.nowTime=0}setQuatNow(e){this.setQuat(e),this.nowTime=1}setScale(e){this.firstLoc.set(this.obj.position),this.firstRot.set(this.obj.quaternion),this.firstScale.set(this.obj.scale),this.lastScale.set(e),this.nowTime=0}setScaleNow(e){this.setScale(e),this.nowTime=1}smoothstep(e){return e*e*(3-2*e)}update(e){this.nowTime+=e,this.nowTime>this.duration&&(this.nowTime=this.duration);const t=this.nowTime/this.duration,i=this.smoothstep(t);this.nowLoc.lerp(this.firstLoc,this.lastLoc,i),this.nowRot.slerp(this.firstRot,this.lastRot,i),this.nowScale.lerp(this.firstScale,this.lastScale,i),this.obj.position.set(this.nowLoc.x,this.nowLoc.y,this.nowLoc.z),this.obj.quaternion.set(this.nowRot.x,this.nowRot.y,this.nowRot.z,this.nowRot.w),this.obj.scale.set(this.nowScale.x,this.nowScale.y,this.nowScale.z)}}class Yn{up;obj;target;tmpObjLoc=new Ae;tmpTargetLoc=new Ae;constructor(e,t){this.up=new Ae,e.upVector?this.up.set(e.upVector):this.up.set(je.defaultUpVector),this.obj=e.object,this.target=t}setTarget(e){this.target=e}update(){this.tmpObjLoc.set(this.obj.position),this.tmpTargetLoc.set(this.target.position);const e=ct(this.tmpObjLoc,this.tmpTargetLoc,this.up);this.obj.quaternion.set(e.x,e.y,e.z,e.w)}}const nn={rigidBody:"dynamic",collider:"solid",meshCollider:"convex_hull",mass:1,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1};class rn extends tt{}let Ve;const xt=new Map;class lt{static RAPIER;isInitialized=!1;constructor(){}async init(){if(!lt.RAPIER){const e=await import("@dimforge/rapier3d-compat");await e.init(),lt.RAPIER=e,Ve=e,this.isInitialized=!0}}createWorld(e){let t=.016666666666666666;this.isRapierWorldOption(e)&&(t=e.timestep);const i=new Ve.World(e.gravity);return new Xn(i,t)}isRapierWorldOption(e){return"timestep"in e}}class Xn{world;timestep;collisionEventQueue;constructor(e,t){this.world=e,this.timestep=t,this.collisionEventQueue=new Ve.EventQueue(!0),this.world.integrationParameters.dt=this.timestep}add(e){e instanceof zt&&e.addOneselfToPhysics(this)}remove(e){e instanceof zt&&e.removeOneselfFromPhysics(this)}update(e){const t=Math.ceil(e/this.timestep);for(let i=0;i<t;i++)this.world.step(this.collisionEventQueue)}getCollisions(){const e=[];return this.collisionEventQueue.drainCollisionEvents((t,i,r)=>{const a=xt.get(t),o=xt.get(i);a&&o&&e.push({objectA:a,partOfA:t,objectB:o,partOfB:i,started:r})}),e}}class zt extends rn{}class qn extends rn{bodyDesc;body;colliderDescs;colliders;completeOption;constructor(e,t={}){super(e),this.colliderDescs=[],this.colliders=[],this.completeOption={...nn,...t}}setObject(e){super.setObject(e),this.bodyDesc=void 0,this.body=void 0,this.colliderDescs=[],this.colliders=[],this.myInitialize(e)}detachObject(e){this.bodyDesc=void 0,this.body=void 0,this.colliderDescs=[],this.colliders=[]}myInitialize(e){const t=this.completeOption;switch(t.rigidBody){case"dynamic":this.bodyDesc=Ve.RigidBodyDesc.dynamic();break;case"kinematic":this.bodyDesc=Ve.RigidBodyDesc.kinematicPositionBased();break;case"fixed":this.bodyDesc=Ve.RigidBodyDesc.fixed();break}this.bodyDesc.setTranslation(e.object.position.x,e.object.position.y,e.object.position.z),this.bodyDesc.setRotation({x:e.object.quaternion.x,y:e.object.quaternion.y,z:e.object.quaternion.z,w:e.object.quaternion.w});const i=[];e.object.traverse(a=>{if(Mt(a)){const o=Jn(a.geometry),u=t.membership<<16|t.filter;if(o)o.colliderDesc.setCollisionGroups(u),t.collisionDetection&&o.colliderDesc.setActiveEvents(Ve.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(o.colliderDesc),o.colliderDesc.setRestitution(t.restitution).setFriction(t.friction),i.push(o.volume);else{let c,s;switch(t.meshCollider){case"tri_mesh":c=Qn(a),s=Vt(a.geometry);break;case"convex_hull":c=Zn(a),s=Vt(a.geometry);break}c&&(c.setCollisionGroups(u),t.collisionDetection&&c.setActiveEvents(Ve.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(c),i.push(s))}}});let r=i.reduce((a,o)=>a+o,0);for(let a=0;a<this.colliderDescs.length;a++)this.colliderDescs[a].setRestitution(t.restitution),this.colliderDescs[a].setFriction(t.friction),this.colliderDescs[a].setMass(t.mass*(i[a]/r))}update(e){if(this.body){const t=this.body.translation();this.object3D?.position.set(t.x,t.y,t.z);const i=this.body.rotation();this.object3D?.quaternion.set(i.x,i.y,i.z,i.w)}}setLocation(e){}setLocationNow(e){this.body&&this.body.setTranslation(e,!0)}setQuat(e){}setQuatNow(e){this.body&&this.body.setRotation(e,!0)}setScale(e){}setScaleNow(e){}addOneselfToPhysics(e){this.bodyDesc&&(this.body=e.world.createRigidBody(this.bodyDesc)),this.colliderDescs.forEach(t=>{const i=e.world.createCollider(t,this.body);this.colliders.push(i),this.objectA3&&xt.set(i.handle,this.objectA3)})}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.colliders.forEach(t=>{e.world.removeCollider(t,!1)})}}function Qn(n){let e=null;if(Mt(n)){const t=n;t.updateWorldMatrix(!0,!0);const i=t.geometry.clone();i.applyMatrix4(t.matrixWorld);const r=i.attributes.position.array;let a=i.index?i.index.array:null;if(a)a instanceof Uint32Array||(a=new Uint32Array(a));else{const o=i.attributes.position.count;a=new Uint32Array(o);for(let u=0;u<o;u++)a[u]=u}r instanceof Float32Array&&(e=Ve.ColliderDesc.trimesh(r,a))}return e}function Zn(n){let e=null;if(Mt(n)){const t=n;t.updateWorldMatrix(!0,!0);const i=t.geometry.clone();i.applyMatrix4(t.matrixWorld);const r=i.attributes.position.array;r instanceof Float32Array&&(e=Ve.ColliderDesc.convexHull(r))}return e}function Vt(n){const e=n.attributes.position;if(!e)throw new Error("position attribute not found");const t=n.index,i=e.array;let r=0;const a=new se.Vector3,o=new se.Vector3,u=new se.Vector3;if(t){const c=t.array;for(let s=0;s<c.length;s+=3){const f=c[s]*3,h=c[s+1]*3,g=c[s+2]*3;a.set(i[f],i[f+1],i[f+2]),o.set(i[h],i[h+1],i[h+2]),u.set(i[g],i[g+1],i[g+2]),r+=a.dot(o.clone().cross(u))}}else for(let c=0;c<i.length;c+=9)a.set(i[c],i[c+1],i[c+2]),o.set(i[c+3],i[c+4],i[c+5]),u.set(i[c+6],i[c+7],i[c+8]),r+=a.dot(o.clone().cross(u));return Math.abs(r)/6}function Jn(n){if(Un(n)){const e=n.parameters,t=typeof e?.width=="number"?e.width/2:.5,i=typeof e?.height=="number"?e.height/2:.5,r=typeof e?.depth=="number"?e.depth/2:.5,a=.1;return{colliderDesc:Ve.ColliderDesc.roundCuboid(t-a,i-a,r-a,a),volume:2*t*2*i*2*r}}else if(jn(n)){const e=n.parameters,t=typeof e?.width=="number"?e.width/2:.5,i=typeof e?.height=="number"?e.height/2:.5,r=typeof e?.depth=="number"?e.depth/2:.5;return{colliderDesc:Ve.ColliderDesc.cuboid(t,i,r),volume:2*t*2*i*2*r}}else if(Bn(n)){const e=n.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:Ve.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(Gn(n)){const e=n.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:Ve.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(zn(n)){const e=n.parameters,t=typeof e?.radiusBottom=="number"?e.radiusBottom:.5,i=typeof e?.height=="number"?e.height:.5;return{colliderDesc:Ve.ColliderDesc.cylinder(i/2,t),volume:Math.PI*t*t*i}}else if(Vn(n)){const e=n.parameters,t=typeof e?.radius=="number"?e.radius:.5,i=typeof e?.height=="number"?e.height:.5;return{colliderDesc:Ve.ColliderDesc.capsule(i/2,t),volume:4/3*Math.PI*t*t*t+Math.PI*t*t*i}}return null}const It=new lt;async function $n(){await It.init()}class on{scene;objects;physicsWorld=null;physicsDt=1/60;collisionListener;constructor(){this.scene=new se.Scene,this.objects=[],It.isInitialized&&(this.physicsWorld=It.createWorld({gravity:{x:0,y:-9.81,z:0},timestep:this.physicsDt}))}add(e){this.scene.add(e.object),this.objects.push(e),e.scene=this,this.physicsWorld&&e.motion.addOneselfToPhysics(this.physicsWorld)}remove(e){this.scene.remove(e.object);{const t=this.objects.indexOf(e);this.objects[t]=this.objects[this.objects.length-1],this.objects.pop()}e.scene=null,this.physicsWorld&&e.motion.removeOneselfFromPhysics(this.physicsWorld)}setCollisionListener(e){this.collisionListener=e}update(e){if(this.physicsWorld){this.physicsWorld.update(e);const t=this.physicsWorld.getCollisions();t.forEach(i=>{i.objectA.handleCollision(i.objectB,i.started,i.partOfA,i.partOfB),i.objectB.handleCollision(i.objectA,i.started,i.partOfB,i.partOfA)}),this.collisionListener&&t.length>0&&this.collisionListener(t)}for(const t of this.objects)t.update(e)}}class je{static defaultRotationOrder="XYZ";static defaultUpVector=new Ae(0,1,0);rotationOrder=null;upVector=null;object;scene=null;balloon=null;motion;parent=null;children=[];clickListener;constructor(e){this.object=this.initObject(e),this.object.traverse(t=>{t.userData.a3js={objectA3:this}}),this.motion=this.initMotion(),this.motion.setObject(this)}initMotion(e){return new tt(this)}setMotion(e){e.setObject(this),this.motion=e}detachMotion(){const e=new tt(this),t=this.motion;return t.detachObject(this),this.motion=e,e.setObject(this),t}replaceMotion(e){const t=this.motion;return t.detachObject(this),this.motion=e,e.setObject(this),t}controlMotion(...e){this.motion.controlMotion(...e)}enableInterpolation(e){this.motion.enableInterpolation(e)}initDefaultPhysics(e){const t={...nn,...e};this.motion=new qn(this,t),this.motion.setObject(this)}update(e){this.motion.update(e),this.children.forEach(t=>{t.update(e)})}add(e){if(e.scene){console.warn("ObjectA3.add(obj) is ignored.");return}if(e.parent){console.warn("ObjectA3.add(obj) is ignored.");return}this.children.push(e),e.parent=this,this.object.add(e.object)}remove(e){if(e.parent!==this){console.warn("ObjectA3.remove(obj) is ignored.");return}const t=this.children.indexOf(e);this.children.splice(t,1),e.parent=null,this.object.remove(e.object)}setBalloon(e){this.balloon?this.balloon.message=e:this.balloon=new er(e)}setClickListener(e){this.clickListener=e}handleCollision(e,t,i,r){}async clicked(){this.clickListener&&await this.clickListener(this)}get locX(){return this.object.position.x}get locY(){return this.object.position.y}get locZ(){return this.object.position.z}setLocation(e,t,i){const r=new Ae;typeof e=="number"?r.set(e,t,i):r.set(e),this.motion.setLocation(r)}setLocationNow(e,t,i){const r=new Ae;typeof e=="number"?r.set(e,t,i):r.set(e),this.motion.setLocationNow(r),this.object.position.set(r.x,r.y,r.z)}get quatX(){return this.object.quaternion.x}get quatY(){return this.object.quaternion.y}get quatZ(){return this.object.quaternion.z}get quatW(){return this.object.quaternion.w}setQuat(e,t,i,r){const a=new ke;typeof e=="number"?a.set(e,t,i,r):a.set(e),this.motion.setQuat(a)}setQuatNow(e,t,i,r){const a=new ke;typeof e=="number"?a.set(e,t,i,r):a.set(e),this.motion.setQuatNow(a)}get scaleX(){return this.object.scale.x}get scaleY(){return this.object.scale.y}get scaleZ(){return this.object.scale.z}setScale(e,t,i){const r=new Ae;typeof e=="number"?r.set(e,t,i):r.set(e),this.motion.setScale(r)}setScaleNow(e,t,i){const r=new Ae;typeof e=="number"?r.set(e,t,i):r.set(e),this.motion.setScaleNow(r)}setRotation(e,t,i){const r=new Ae;typeof e=="number"?r.set(e,t,i):r.set(e),r.scale(Math.PI/360);const a=this.rotationOrder?this.rotationOrder:je.defaultRotationOrder,o=tn(r,a);this.setQuat(o)}setRotationNow(e,t,i){const r=new Ae;typeof e=="number"?r.set(e,t,i):r.set(e);const a=this.rotationOrder?this.rotationOrder:je.defaultRotationOrder,o=new ke(0,0,0,1);for(let u=0;u<3;u++)switch(a.charAt(u)){case"X":o.mul(new ke(Math.sin(r.x),0,0,Math.cos(r.x)));break;case"Y":o.mul(new ke(0,Math.sin(r.y),0,Math.cos(r.y)));break;case"Z":o.mul(new ke(0,0,Math.sin(r.z),Math.cos(r.z)));break}this.setQuatNow(o)}lookAt(e,t,i){const r=new Ae;typeof e=="number"?r.set(e,t,i):e instanceof je?r.set(e.locX,e.locY,e.locZ):r.set(e);const a=this.upVector?this.upVector:je.defaultUpVector,o=ct(new Ae(this.object.position),r,a);this.setQuat(o)}lookAtNow(e,t,i){const r=new Ae;typeof e=="number"?r.set(e,t,i):e instanceof je?r.set(e.locX,e.locY,e.locZ):r.set(e);const a=this.upVector?this.upVector:je.defaultUpVector,o=ct(new Ae(this.object.position),r,a);this.setQuatNow(o)}getUnitVecX(){return new Ae(1,0,0).apply(this.object.quaternion)}getUnitVecY(){return new Ae(0,1,0).apply(this.object.quaternion)}getUnitVecZ(){return new Ae(0,0,1).apply(this.object.quaternion)}}class er{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 sn extends je{controller;setController(e){this.controller=e}setLocation(e,t,i){typeof e=="number"?super.setLocation(e,t,i):super.setLocation(e),this.controller?.setCameraLocation(this.object.position)}}class an{view;constructor(e){this.view=e,e.setController(this)}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){}setCameraLocation(e){}setCameraLocationNow(e){}setCameraQuat(e){}setCameraQuatNow(e){}setCameraScale(e){}setCameraScaleNow(e){}}class cn extends an{preMouse;leftClick=!1;target;cameraLoc=new Ae(0,0,3);cameraQuat=new ke(0,0,0,1);constructor(e,t,i,r){super(e),this.preMouse={x:0,y:0},typeof t=="number"?this.target=new Ae(t,i,r):this.target=new Ae(t)}update(e){this.view.camera.setLocation(this.cameraLoc),this.view.camera.setQuat(this.cameraQuat)}mouseDown(e){e.button===0&&(this.leftClick=!0,this.preMouse.x=e.clientX,this.preMouse.y=e.clientY)}mouseMove(e){if(this.leftClick===!1)return;const t=.01,i=t*(e.clientX-this.preMouse.x),r=t*(e.clientY-this.preMouse.y),a=Math.sin(-i),o=Math.cos(-i),u=Math.sin(-r),c=Math.cos(-r),s=new Ae(1,0,0).apply(this.cameraQuat),f=new Ae(0,1,0).apply(this.cameraQuat),h=new ke(s.x*u,s.y*u,s.z*u,c),g=new ke(f.x*a,f.y*a,f.z*a,o),p=new Ae(this.cameraLoc);p.sub(this.target),p.apply(h),p.apply(g),p.add(this.target),this.cameraLoc.set(p);const T=ct(this.cameraLoc,this.target,new Ae(0,1,0));this.cameraQuat.set(T),this.preMouse.x=e.clientX,this.preMouse.y=e.clientY}mouseUp(e){e.button===0&&(this.leftClick=!1)}mouseWheel(e){const t=new Ae(this.target).sub(this.cameraLoc);e.deltaY>0?t.scale(.05):e.deltaY<0&&t.scale(-.05),this.cameraLoc.add(t)}setCameraLocation(e){this.cameraLoc.set(e)}setCameraLocationNow(e){this.cameraLoc.set(e)}}function tr(n){return new Promise(e=>{setTimeout(()=>{e()},n)})}async function ln(n){const t=await(await fetch(n)).arrayBuffer(),i=await new Promise((r,a)=>{$t.unzip(new Uint8Array(t),(o,u)=>{o?a(o):r(u)})});return{zipUrl:n,unzipped:i}}function Pt(n,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),n.unzipped[e])return $t.strFromU8(n.unzipped[e]);throw new Error(`readStringFromUnzippedA3(): no file at ${e}`)}function nr(n,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),n.unzipped[e]){const t=ir(e);return new Blob([new Uint8Array(n.unzipped[e])],{type:t})}else throw new Error(`readBlobFromUnzippedA3(): no file at ${e}`)}const rr={"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 ir(n){for(const[e,t]of Object.entries(rr))if(t.test(n))return e;return"application/octet-stream"}function yt(n,e){if(!e)return n;const t={...n};for(const i in e)typeof n[i]=="object"&&typeof e[i]=="object"?t[i]=yt(n[i],e[i]):t[i]=e[i];return t}const or={type:"audio",autoplay:!1,loop:!1,volume:1,positional:{refDistance:1,maxDistance:1e3,rolloffFactor:1,directional:{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}}};async function sr(){try{$e.listener.context.state!=="running"&&await $e.listener.context.resume()}catch{console.warn("AudioContext resume failed. Did you call on user gesture?")}}class $e extends je{static listener=new se.AudioListener;static audioLoader=new se.AudioLoader;ready;config;sound;constructor(e,t={}){super(),this.config=yt(or,t),this.ready=this.asyncInit(e)}initObject(){return new se.Object3D}async asyncInit(e){if(this.config.type==="positional"){const t=new se.PositionalAudio($e.listener);t.setRefDistance(this.config.positional.refDistance),t.setMaxDistance(this.config.positional.maxDistance),t.setRolloffFactor(this.config.positional.rolloffFactor);const i=this.config.positional.directional;t.setDirectionalCone(i.coneInnerAngle,i.coneOuterAngle,i.coneOuterGain),t.setVolume(this.config.volume),t.setLoop(this.config.loop),this.sound=t}else{const t=new se.Audio($e.listener);t.setVolume(this.config.volume),t.setLoop(this.config.loop),this.sound=t}return this.object.add(this.sound),new Promise(t=>{$e.audioLoader.load(e,i=>{this.sound&&this.sound.setBuffer(i),t(this)})})}play(){this.sound?.play()}}class Dt{scene;camera;controller;constructor(e){this.scene=new on,this.camera=e,this.camera.setAudioListener($e.listener),this.scene.scene.add(this.camera.object),this.camera.setLocation(0,0,3),this.controller=new cn(this,0,0,0),this.camera.setController(this.controller)}replaceScene(e){this.scene.scene.remove(this.camera.object),e.scene.add(this.camera.object);const t=this.scene;return this.scene=e,t}updateScene(e){this.scene.update(e),this.controller?.update(e),this.camera.update(e)}setController(e){this.controller?.deactivate(),this.controller=e,this.controller.activate(),this.camera.setController(e)}worldToScreen(e){throw new Error("ViewBaseはworldToScreen()は実装していません")}screenToWorld(e,t,i){throw new Error("ViewBaseはscreenToWorld()は実装していません")}cameraToScreen(e){throw new Error("ViewBaseはcameraToScreen()は実装していません")}screenToCamera(e,t,i){throw new Error("ViewBaseはscreenToCamera()は実装していません")}}class ut extends sn{camera;headLight;constructor(e){super(),this.camera=e,this.headLight=new se.SpotLight(16777215,1,0,Math.PI/3,0,0),this.headLight.rotation.x=3.14/2,this.object.add(this.camera),this.object.add(this.headLight)}initObject(){return new se.Object3D}setAudioListener(e){this.camera.add(e)}getHeadLight(){return this.headLight}setAspect(e){Wn(this.camera)&&(this.camera.aspect=e,this.camera.updateProjectionMatrix())}setHeadLightEnable(e){e?this.headLight.intensity=1:this.headLight.intensity=0}calcNDC(e){const t=new se.Vector3(e.x,e.y,e.z);return t.project(this.camera),{x:t.x,y:t.y}}}class un extends R.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 R.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 rt=new R.Vector3,Ht=new R.Matrix4,Wt=new R.Matrix4,Kt=new R.Vector3,Yt=new R.Vector3;class hn{constructor(e={}){const t=this;let i,r,a,o;const u={objects:new WeakMap},c=e.element!==void 0?e.element:document.createElement("div");c.style.overflow="hidden",this.domElement=c,this.sortObjects=!0,this.getSize=function(){return{width:i,height:r}},this.render=function(T,m){T.matrixWorldAutoUpdate===!0&&T.updateMatrixWorld(),m.parent===null&&m.matrixWorldAutoUpdate===!0&&m.updateMatrixWorld(),Ht.copy(m.matrixWorldInverse),Wt.multiplyMatrices(m.projectionMatrix,Ht),f(T,T,m),this.sortObjects&&p(T)},this.setSize=function(T,m){i=T,r=m,a=i/2,o=r/2,c.style.width=T+"px",c.style.height=m+"px"};function s(T){T.isCSS2DObject&&(T.element.style.display="none");for(let m=0,l=T.children.length;m<l;m++)s(T.children[m])}function f(T,m,l){if(T.visible===!1){s(T);return}if(T.isCSS2DObject){rt.setFromMatrixPosition(T.matrixWorld),rt.applyMatrix4(Wt);const d=rt.z>=-1&&rt.z<=1&&T.layers.test(l.layers)===!0,y=T.element;y.style.display=d===!0?"":"none",d===!0&&(T.onBeforeRender(t,m,l),y.style.transform="translate("+-100*T.center.x+"%,"+-100*T.center.y+"%)translate("+(rt.x*a+a)+"px,"+(-rt.y*o+o)+"px)",y.parentNode!==c&&c.appendChild(y),T.onAfterRender(t,m,l));const v={distanceToCameraSquared:h(l,T)};u.objects.set(T,v)}for(let d=0,y=T.children.length;d<y;d++)f(T.children[d],m,l)}function h(T,m){return Kt.setFromMatrixPosition(T.matrixWorld),Yt.setFromMatrixPosition(m.matrixWorld),Kt.distanceToSquared(Yt)}function g(T){const m=[];return T.traverseVisible(function(l){l.isCSS2DObject&&m.push(l)}),m}function p(T){const m=g(T).sort(function(d,y){if(d.renderOrder!==y.renderOrder)return y.renderOrder-d.renderOrder;const v=u.objects.get(d).distanceToCameraSquared,E=u.objects.get(y).distanceToCameraSquared;return v-E}),l=m.length;for(let d=0,y=m.length;d<y;d++)m[d].element.style.zIndex=l-d}}}class fn extends HTMLElement{ro;base;renderer;css2DRenderer;scene;camera;controller;camera3js;clock;_canvas;_css2DCanvas;constructor(e){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
1
|
+
"use strict";var Ui=Object.create;var ln=Object.defineProperty;var Hi=Object.getOwnPropertyDescriptor;var ji=Object.getOwnPropertyNames;var qi=Object.getPrototypeOf,Ki=Object.prototype.hasOwnProperty;var zi=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ji(e))!Ki.call(n,i)&&i!==t&&ln(n,i,{get:()=>e[i],enumerable:!(r=Hi(e,i))||r.enumerable});return n};var Vi=(n,e,t)=>(t=n!=null?Ui(qi(n)):{},zi(e||!n||!n.__esModule?ln(t,"default",{value:n,enumerable:!0}):t,n));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("three"),vn=require("fflate");function Yi(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const se=Yi(I);function kn(n){return typeof n=="string"}function $t(n){return n.isMesh===!0}function Wi(n){return n.type==="RoundedBoxGeometry"}function Ji(n){return n.type==="BoxGeometry"}function Xi(n){return n.type==="SphereGeometry"}function Zi(n){return n.type==="IcosahedronGeometry"}function $i(n){return n.type==="CylinderGeometry"}function er(n){return n.type==="CapsuleGeometry"}function tr(n){return n.isBone===!0}function nr(n){return n.isPerspectiveCamera===!0}class Ie{_x;_y;_z;get x(){return this._x}get y(){return this._y}get z(){return this._z}constructor(e,t,r){typeof e=="number"?(this._x=e,this._y=t,this._z=r):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 Ie(this)}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,r){return typeof e=="number"?(this._x=e,this._y=t,this._z=r):(this._x=e.x,this._y=e.y,this._z=e.z),this}add(e,t,r){return typeof e=="number"?(this._x+=e,this._y+=t,this._z+=r):(this._x+=e.x,this._y+=e.y,this._z+=e.z),this}sub(e,t,r){return typeof e=="number"?(this._x-=e,this._y-=t,this._z-=r):(this._x-=e.x,this._y-=e.y,this._z-=e.z),this}scale(e){return this._x*=e,this._y*=e,this._z*=e,this}cross(e,t){return this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this}apply(e,t,r,i){const s=new we;typeof e=="number"?s.set(e,t,r,i):s.set(e);const o=new we(this._x,this._y,this._z,0),c=new we(s).conjugate();return s.mul(o).mul(c),this._x=s.x,this._y=s.y,this._z=s.z,this}lerp(e,t,r){this._x=(1-r)*e.x+r*t.x,this._y=(1-r)*e.y+r*t.y,this._z=(1-r)*e.z+r*t.z}}class we{_x;_y;_z;_w;get x(){return this._x}get y(){return this._y}get z(){return this._z}get w(){return this._w}constructor(e,t,r,i){typeof e=="number"?(this._x=e,this._y=t,this._z=r,this._w=i):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 we(this)}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,r,i){return typeof e=="number"?(this._x=e,this._y=t,this._z=r,this._w=i):(this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w),this}mul(e,t,r,i){const s=new we(this),o=new we;return typeof e=="number"?o.set(e,t,r,i):o.set(e),this._x=s.w*o.x+s.x*o.w+s.y*o.z-s.z*o.y,this._y=s.w*o.y-s.x*o.z+s.y*o.w+s.z*o.x,this._z=s.w*o.z+s.x*o.y-s.y*o.x+s.z*o.w,this._w=s.w*o.w-s.x*o.x-s.y*o.y-s.z*o.z,this}lerp(e,t,r){this._x=(1-r)*e.x+r*t.x,this._y=(1-r)*e.y+r*t.y,this._z=(1-r)*e.z+r*t.z,this._w=(1-r)*e.w+r*t.w}slerp(e,t,r){if(r<0||r>1){console.warn("Quat.slerp(): t must be in [0,1]");return}const i=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w;if(i<.9995){const s=Math.acos(i),o=Math.sin((1-r)*s)/Math.sin(s),c=Math.sin(r*s)/Math.sin(s);this._x=o*e.x+c*t.x,this._y=o*e.y+c*t.y,this._z=o*e.z+c*t.z,this._w=o*e.w+c*t.w}else{this._x=(1-r)*e.x+r*t.x,this._y=(1-r)*e.y+r*t.y,this._z=(1-r)*e.z+r*t.z,this._w=(1-r)*e.w+r*t.w;const s=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w);s<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/s,this._y*=1/s,this._z*=1/s,this._w*=1/s)}}}function lt(n,e,t){t.normalize();const r=e.clone().sub(n).normalize(),i=new Ie().cross(r,t).normalize(),s=new Ie().cross(i,r),o=i.x,c=s.x,A=-r.x,a=i.y,f=s.y,u=-r.y,b=i.z,d=s.z,E=-r.z,g=o+f+E;if(g>0){const l=Math.sqrt(g+1)*2;return new we((d-u)/l,(A-b)/l,(a-c)/l,.25*l)}else if(o>f&&o>E){const l=Math.sqrt(1+o-f-E)*2;return new we(.25*l,(c+a)/l,(A+b)/l,(d-u)/l)}else if(f>E){const l=Math.sqrt(1+f-o-E)*2;return new we((c+a)/l,.25*l,(u+d)/l,(A-b)/l)}else{const l=Math.sqrt(1+E-o-f)*2;return new we((A+b)/l,(u+d)/l,.25*l,(a-c)/l)}}function en(n,e="XYZ"){const t=new we(0,0,0,1);for(let r=0;r<3;r++)switch(e.charAt(r)){case"X":t.mul(new we(Math.sin(n.x),0,0,Math.cos(n.x)));break;case"Y":t.mul(new we(0,Math.sin(n.y),0,Math.cos(n.y)));break;case"Z":t.mul(new we(0,0,Math.sin(n.z),Math.cos(n.z)));break}return t}class Ke{loc;quat;scale;constructor(){this.loc=new Ie,this.quat=new we,this.scale=new Ie(1,1,1)}set(e){if(e instanceof Ke)this.loc.set(e.loc),this.quat.set(e.quat),this.scale.set(e.scale);else{const t=e.trans;this.loc.set(t.loc),this.quat.set(t.quat),this.scale.set(t.scale)}return this}write(e){e instanceof Me?(e.object.position.set(this.loc.x,this.loc.y,this.loc.z),e.object.quaternion.set(this.quat.x,this.quat.y,this.quat.z,this.quat.w),e.object.scale.set(this.scale.x,this.scale.y,this.scale.z)):(e.position.set(this.loc.x,this.loc.y,this.loc.z),e.quaternion.set(this.quat.x,this.quat.y,this.quat.z,this.quat.w),e.scale.set(this.scale.x,this.scale.y,this.scale.z))}blend(e,t){return this.loc.lerp(this.loc,e.loc,t),this.quat.slerp(this.quat,e.quat,t),this.scale.lerp(this.scale,e.scale,t),this}clone(){const e=new Ke;return e.set(this),e}}const qt={rigidBody:"dynamic",collider:"solid",meshCollider:"convex_hull",mass:1,friction:.5,restitution:.5,membership:1,filter:1,collisionDetection:!1};let Ue;const ut=new Map;class pt{static RAPIER;isInitialized=!1;constructor(){}async init(){if(!pt.RAPIER){const e=await import("@dimforge/rapier3d-compat");await e.init(),pt.RAPIER=e,Ue=e,this.isInitialized=!0}}createWorld(e){let t=.016666666666666666;this.isRapierWorldOption(e)&&(t=e.timestep);const r=new Ue.World(e.gravity);return new Sn(r,t)}isRapierWorldOption(e){return"timestep"in e}}class Sn{world;timestep;collisionEventQueue;constructor(e,t){this.world=e,this.timestep=t,this.collisionEventQueue=new Ue.EventQueue(!0),this.world.integrationParameters.dt=this.timestep}add(e){e.addOneselfToPhysics(this)}remove(e){e.removeOneselfFromPhysics(this)}update(e){const t=Math.ceil(e/this.timestep);for(let r=0;r<t;r++)this.world.step(this.collisionEventQueue)}getCollisions(){const e=[];return this.collisionEventQueue.drainCollisionEvents((t,r,i)=>{const s=ut.get(t),o=ut.get(r);s&&o&&e.push({objectA:s,partOfA:t,objectB:o,partOfB:r,started:i})}),e}}class un{objectA3;bodyDesc;body;colliderDescs;colliders;completeOption;constructor(e,t={}){this.objectA3=e,this.colliderDescs=[],this.colliders=[],this.completeOption={...qt,...t};const r=this.completeOption;switch(r.rigidBody){case"dynamic":this.bodyDesc=Ue.RigidBodyDesc.dynamic();break;case"kinematic":this.bodyDesc=Ue.RigidBodyDesc.kinematicPositionBased();break;case"fixed":this.bodyDesc=Ue.RigidBodyDesc.fixed();break}this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.bodyDesc.setRotation({x:e.quat.x,y:e.quat.y,z:e.quat.z,w:e.quat.w});const i=[];e.object.traverse(o=>{if($t(o)){const c=or(o.geometry),A=r.membership<<16|r.filter;if(c)c.colliderDesc.setCollisionGroups(A),r.collisionDetection&&c.colliderDesc.setActiveEvents(Ue.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(c.colliderDesc),c.colliderDesc.setRestitution(r.restitution).setFriction(r.friction),i.push(c.volume);else{let a,f;switch(r.meshCollider){case"tri_mesh":a=ir(o),f=hn(o.geometry);break;case"convex_hull":a=rr(o),f=hn(o.geometry);break}a&&(a.setCollisionGroups(A),r.collisionDetection&&a.setActiveEvents(Ue.ActiveEvents.COLLISION_EVENTS),this.colliderDescs.push(a),i.push(f))}}});let s=i.reduce((o,c)=>o+c,0);for(let o=0;o<this.colliderDescs.length;o++)this.colliderDescs[o].setRestitution(r.restitution),this.colliderDescs[o].setFriction(r.friction),this.colliderDescs[o].setMass(r.mass*(i[o]/s))}init(e){}addOneselfToPhysics(e){this.body=e.world.createRigidBody(this.bodyDesc),this.colliderDescs.forEach(t=>{const r=e.world.createCollider(t,this.body);this.colliders.push(r),ut.set(r.handle,this.objectA3)})}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.colliders.forEach(t=>{e.world.removeCollider(t,!1),ut.delete(t.handle)})}getTrans(e){this.body?(e.loc.set(this.body.translation()),e.quat.set(this.body.rotation())):(e.loc.set(this.bodyDesc.translation),e.quat.set(this.bodyDesc.rotation))}setLocation(e){}setLocationNow(e){this.body?this.body.setTranslation(e,!0):this.bodyDesc.setTranslation(e.x,e.y,e.z)}setQuat(e){}setQuatNow(e){this.body?this.body.setRotation(e,!0):this.bodyDesc.setRotation(e)}setScale(e){}setScaleNow(e){}update(e,t){if(this.body){const r=this.body.translation();t.loc.set(r.x,r.y,r.z);const i=this.body.rotation();t.quat.set(i.x,i.y,i.z,i.w)}}}function ir(n){let e=null;if($t(n)){const t=n;t.updateWorldMatrix(!0,!0);const r=t.geometry.clone();r.applyMatrix4(t.matrixWorld);const i=r.attributes.position.array;let s=r.index?r.index.array:null;if(s)s instanceof Uint32Array||(s=new Uint32Array(s));else{const o=r.attributes.position.count;s=new Uint32Array(o);for(let c=0;c<o;c++)s[c]=c}i instanceof Float32Array&&(e=Ue.ColliderDesc.trimesh(i,s))}return e}function rr(n){let e=null;if($t(n)){const t=n;t.updateWorldMatrix(!0,!0);const r=t.geometry.clone();r.applyMatrix4(t.matrixWorld);const i=r.attributes.position.array;i instanceof Float32Array&&(e=Ue.ColliderDesc.convexHull(i))}return e}function hn(n){const e=n.attributes.position;if(!e)throw new Error("position attribute not found");const t=n.index,r=e.array;let i=0;const s=new se.Vector3,o=new se.Vector3,c=new se.Vector3;if(t){const A=t.array;for(let a=0;a<A.length;a+=3){const f=A[a]*3,u=A[a+1]*3,b=A[a+2]*3;s.set(r[f],r[f+1],r[f+2]),o.set(r[u],r[u+1],r[u+2]),c.set(r[b],r[b+1],r[b+2]),i+=s.dot(o.clone().cross(c))}}else for(let A=0;A<r.length;A+=9)s.set(r[A],r[A+1],r[A+2]),o.set(r[A+3],r[A+4],r[A+5]),c.set(r[A+6],r[A+7],r[A+8]),i+=s.dot(o.clone().cross(c));return Math.abs(i)/6}function or(n){if(Wi(n)){const e=n.parameters,t=typeof e?.width=="number"?e.width/2:.5,r=typeof e?.height=="number"?e.height/2:.5,i=typeof e?.depth=="number"?e.depth/2:.5,s=.1;return{colliderDesc:Ue.ColliderDesc.roundCuboid(t-s,r-s,i-s,s),volume:2*t*2*r*2*i}}else if(Ji(n)){const e=n.parameters,t=typeof e?.width=="number"?e.width/2:.5,r=typeof e?.height=="number"?e.height/2:.5,i=typeof e?.depth=="number"?e.depth/2:.5;return{colliderDesc:Ue.ColliderDesc.cuboid(t,r,i),volume:2*t*2*r*2*i}}else if(Xi(n)){const e=n.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:Ue.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if(Zi(n)){const e=n.parameters,t=typeof e?.radius=="number"?e.radius:1;return{colliderDesc:Ue.ColliderDesc.ball(t),volume:4/3*Math.PI*t*t*t}}else if($i(n)){const e=n.parameters,t=typeof e?.radiusBottom=="number"?e.radiusBottom:.5,r=typeof e?.height=="number"?e.height:.5;return{colliderDesc:Ue.ColliderDesc.cylinder(r/2,t),volume:Math.PI*t*t*r}}else if(er(n)){const e=n.parameters,t=typeof e?.radius=="number"?e.radius:.5,r=typeof e?.height=="number"?e.height:.5;return{colliderDesc:Ue.ColliderDesc.capsule(r/2,t),volume:4/3*Math.PI*t*t*t+Math.PI*t*t*r}}return null}const Kt=new pt;async function sr(){await Kt.init()}class Ln{scene;objects;physicsWorld=null;physicsDt=1/60;collisionListener;rapierLines;constructor(){this.scene=new se.Scene,this.objects=[],Kt.isInitialized&&(this.physicsWorld=Kt.createWorld({gravity:{x:0,y:-9.81,z:0},timestep:this.physicsDt}))}add(e){if(this.scene.add(e.object),this.objects.push(e),e.scene=this,this.physicsWorld){e.rootMotion.addOneselfToPhysics(this.physicsWorld);for(const t of Object.values(e.poseMotions))t.addOneselfToPhysics(this.physicsWorld)}}remove(e){this.scene.remove(e.object);{const t=this.objects.indexOf(e);this.objects[t]=this.objects[this.objects.length-1],this.objects.pop()}if(e.scene=void 0,this.physicsWorld){e.rootMotion.removeOneselfFromPhysics(this.physicsWorld);for(const t of Object.values(e.poseMotions))t.removeOneselfFromPhysics(this.physicsWorld)}}setCollisionListener(e){this.collisionListener=e}update(e){if(this.physicsWorld){this.physicsWorld.update(e);const t=this.physicsWorld.getCollisions();if(t.forEach(r=>{r.objectA.handleCollision(r.objectB,r.started,r.partOfA,r.partOfB),r.objectB.handleCollision(r.objectA,r.started,r.partOfB,r.partOfA)}),this.collisionListener&&t.length>0&&this.collisionListener(t),this.rapierLines&&this.physicsWorld instanceof Sn){const{vertices:r,colors:i}=this.physicsWorld.world.debugRender();this.rapierLines.geometry.setAttribute("position",new se.BufferAttribute(r,3)),this.rapierLines.geometry.setAttribute("color",new se.BufferAttribute(i,4))}}for(const t of this.objects)t.update(e)}rapierDebug(e){e?(this.rapierLines=new se.LineSegments(new se.BufferGeometry,new se.LineBasicMaterial({vertexColors:!0})),this.scene.add(this.rapierLines)):this.rapierLines&&(this.scene.remove(this.rapierLines),this.rapierLines=void 0)}}class zt{nextTrans;constructor(){this.nextTrans=new Ke}init(e){this.nextTrans.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}getTrans(e){e.set(this.nextTrans)}setLocation(e){this.nextTrans.loc.set(e)}setLocationNow(e){this.nextTrans.loc.set(e)}setQuat(e){this.nextTrans.quat.set(e)}setQuatNow(e){this.nextTrans.quat.set(e)}setScale(e){this.nextTrans.scale.set(e)}setScaleNow(e){this.nextTrans.scale.set(e)}update(e,t){return t.set(this.nextTrans),t}}class _n{firstTrans;nowTrans;lastTrans;nowTime;duration;constructor(){this.firstTrans=new Ke,this.nowTrans=new Ke,this.lastTrans=new Ke,this.nowTime=0,this.duration=1}init(e){this.firstTrans.set(e),this.nowTrans.set(e),this.lastTrans.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}getTrans(e){e.set(this.nowTrans)}setLocation(e){this.firstTrans.set(this.nowTrans),this.lastTrans.loc.set(e),this.nowTime=0}setLocationNow(e){this.setLocation(e),this.nowTime=1}setQuat(e){this.firstTrans.set(this.nowTrans),this.lastTrans.quat.set(e),this.nowTime=0}setQuatNow(e){this.setQuat(e),this.nowTime=1}setScale(e){this.firstTrans.set(this.nowTrans),this.lastTrans.scale.set(e),this.nowTime=0}setScaleNow(e){this.setScale(e),this.nowTime=1}smoothstep(e){return e*e*(3-2*e)}update(e,t){this.nowTime+=e,this.nowTime>this.duration&&(this.nowTime=this.duration);const r=this.nowTime/this.duration,i=this.smoothstep(r);this.nowTrans.set(this.firstTrans),this.nowTrans.blend(this.lastTrans,i),t.set(this.nowTrans)}}const Ct=new Ie,Bt=new Ie;class ar{up;target;lastTrans;constructor(e){this.up=new Ie(0,1,0),this.target=e,this.lastTrans=new Ke}setTarget(e){this.target=e}init(e){e.upVector?this.up=e.upVector:this.up=Me.defaultUpVector,this.lastTrans.set(e)}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}getTrans(e){e.set(this.lastTrans)}setLocation(e){}setLocationNow(e){}setQuat(e){}setQuatNow(e){}setScale(e){}setScaleNow(e){}update(e,t){Ct.set(t.loc),Bt.set(this.target.trans.loc);const r=lt(Ct,Bt,this.up);t.quat.set(r),this.lastTrans.set(t)}}class Ar extends _n{up;target;constructor(e){super(),this.up=new Ie(0,1,0),this.target=e}init(e){super.init(e),e.upVector?this.up=e.upVector:this.up=Me.defaultUpVector}setQuat(e){}setQuatNow(e){}update(e,t){super.update(e,t),Ct.set(t.loc),Bt.set(this.target.trans.loc);const r=lt(Ct,Bt,this.up);t.quat.set(r),this.nowTrans.set(t)}}const it={v0:new Ie,v1:new Ie,v2:new Ie,v3:new Ie,v4:new Ie,q0:new we,q1:new we,q2:new we,q3:new we,q4:new we,t0:new Ke,t1:new Ke,t2:new Ke,t3:new Ke,t4:new Ke};function cr(n){return new Promise(e=>{setTimeout(()=>{e()},n)})}async function xn(n){const t=await(await fetch(n)).arrayBuffer(),r=await new Promise((i,s)=>{vn.unzip(new Uint8Array(t),(o,c)=>{o?s(o):i(c)})});return{zipUrl:n,unzipped:r}}function tn(n,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),n.unzipped[e])return vn.strFromU8(n.unzipped[e]);throw new Error(`readStringFromUnzippedA3(): no file at ${e}`)}function lr(n,e){if(e=e.replace(/^\.\//,"").replace(/^\//,""),n.unzipped[e]){const t=hr(e);return new Blob([new Uint8Array(n.unzipped[e])],{type:t})}else throw new Error(`readBlobFromUnzippedA3(): no file at ${e}`)}const ur={"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 hr(n){for(const[e,t]of Object.entries(ur))if(t.test(n))return e;return"application/octet-stream"}function Tt(n,e){if(!e)return n;const t={...n};for(const r in e)typeof n[r]=="object"&&typeof e[r]=="object"?t[r]=Tt(n[r],e[r]):t[r]=e[r];return t}class Me{static defaultRotationOrder="XYZ";static defaultUpVector=new Ie(0,1,0);rotationOrder;upVector;object;scene;balloon;rootMotion;poseMotions;statePoseMotion;emotePoseMotion;currentPoseMotion;parent;children=[];clickListener;skeletons;bones;morphs;morphsOverwrite;constructor(e){this.skeletons=[],this.bones={},this.morphs={},this.morphsOverwrite=!1,this.object=this.initObject(e),this.object.traverse(t=>{t.userData.a3js={objectA3:this}}),this.rootMotion=this.initRootMotion(e),this.poseMotions=this.initPoseMotions(e)}initRootMotion(e){return new zt}setRootMotion(e){this.rootMotion=e}getRootMotion(){return this.rootMotion}setRootMotionMode(e,t){if(e==="Default")this.setRootMotion(new zt);else if(e==="Interpolation")this.setRootMotion(new _n);else if(e==="Billboard")this.setRootMotion(new ar(t));else if(e==="InterpolationBillboard")this.setRootMotion(new Ar(t));else if(e==="SimplePhysics"){const r={...qt,...t};this.setRootMotion(new un(this,r))}}initPoseMotions(e){return{}}setPoseMotions(e){this.poseMotions=e}getPoseMotions(){return this.poseMotions}getPoseMotion(e){return this.poseMotions[e]}addPoseMotion(e,t){this.poseMotions[e]=t}removePoseMotion(e){const t=this.poseMotions[e];return delete this.poseMotions[e],t}setState(e){this.statePoseMotion=this.poseMotions[e],this.statePoseMotion&&(this.currentPoseMotion?.cleanup3D(this),this.statePoseMotion.prepare3D(this),this.statePoseMotion.playCount=0,this.statePoseMotion.time=0,this.currentPoseMotion=this.statePoseMotion)}setEmote(e){this.emotePoseMotion=this.poseMotions[e],this.emotePoseMotion&&(this.currentPoseMotion?.cleanup3D(this),this.emotePoseMotion.prepare3D(this),this.emotePoseMotion.playCount=0,this.emotePoseMotion.time=0,this.currentPoseMotion=this.emotePoseMotion)}setMorphsOverwrite(e){this.morphsOverwrite=e}morph(e,t){if(e in this.morphs){const{array:r,idx:i}=this.morphs[e];r[i]=t}}initSimplePhysics(e){const t={...qt,...e};this.rootMotion=new un(this,t),this.poseMotions={}}pose={};update(e){this.rootMotion.update(e,it.t0),it.t0.write(this);let t;if(this.emotePoseMotion&&this.emotePoseMotion.playCount<=0?(t=this.emotePoseMotion.update(e),this.emotePoseMotion.playCount>0&&(this.emotePoseMotion.cleanup3D(this),this.emotePoseMotion=void 0,this.statePoseMotion&&this.statePoseMotion.prepare3D(this))):this.statePoseMotion&&(t=this.statePoseMotion.update(e)),t&&this.bones)for(const[r,i]of Object.entries(t)){const s=this.bones[r];if(s&&(i.loc&&s.position.set(i.loc.x,i.loc.y,i.loc.z),i.quat&&s.quaternion.set(i.quat.x,i.quat.y,i.quat.z,i.quat.w),i.scale&&s.scale.set(i.scale.x,i.scale.y,i.scale.z)),!this.morphsOverwrite&&i.morphs){for(const o of i.morphs)for(const c of Object.keys(this.morphs))if(c.startsWith(o.name)){const{array:A}=this.morphs[c];for(let a=0;a<A.length;a++)A[a]=o.vals[a];break}}}this.object.updateMatrixWorld(!0),this.skeletons.forEach(r=>{r.update()}),this.children.forEach(r=>{r.update(e)})}add(e){if(e.scene){console.warn("ObjectA3.add(obj) is ignored.");return}if(e.parent){console.warn("ObjectA3.add(obj) is ignored.");return}this.children.push(e),e.parent=this,this.object.add(e.object)}remove(e){if(e.parent!==this){console.warn("ObjectA3.remove(obj) is ignored.");return}const t=this.children.indexOf(e);this.children.splice(t,1),e.parent=void 0,this.object.remove(e.object)}setBalloon(e){this.balloon?this.balloon.message=e:this.balloon=new fr(e)}setClickListener(e){this.clickListener=e}handleCollision(e,t,r,i){}async clicked(){this.clickListener&&await this.clickListener(this)}get trans(){return this.rootMotion.getTrans(it.t0),it.t0.clone()}get loc(){return this.trans.loc.clone()}setLocation(e,t,r){const i=new Ie;typeof e=="number"?i.set(e,t,r):i.set(e),this.rootMotion.setLocation(i)}setLocationNow(e,t,r){const i=new Ie;typeof e=="number"?i.set(e,t,r):i.set(e),this.rootMotion.setLocationNow(i)}get quat(){return this.trans.quat.clone()}setQuat(e,t,r,i){const s=new we;typeof e=="number"?s.set(e,t,r,i):s.set(e),this.rootMotion.setQuat(s)}setQuatNow(e,t,r,i){const s=new we;typeof e=="number"?s.set(e,t,r,i):s.set(e),this.rootMotion.setQuatNow(s)}get scale(){return this.trans.scale.clone()}setScale(e,t,r){const i=new Ie;typeof e=="number"?i.set(e,t,r):i.set(e),this.rootMotion.setScale(i)}setScaleNow(e,t,r){const i=new Ie;typeof e=="number"?i.set(e,t,r):i.set(e),this.rootMotion.setScaleNow(i)}setRotation(e,t,r){const i=new Ie;typeof e=="number"?i.set(e,t,r):i.set(e),i.scale(Math.PI/360);const s=this.rotationOrder?this.rotationOrder:Me.defaultRotationOrder,o=en(i,s);this.setQuat(o)}setRotationNow(e,t,r){const i=new Ie;typeof e=="number"?i.set(e,t,r):i.set(e);const s=this.rotationOrder?this.rotationOrder:Me.defaultRotationOrder,o=new we(0,0,0,1);for(let c=0;c<3;c++)switch(s.charAt(c)){case"X":o.mul(new we(Math.sin(i.x),0,0,Math.cos(i.x)));break;case"Y":o.mul(new we(0,Math.sin(i.y),0,Math.cos(i.y)));break;case"Z":o.mul(new we(0,0,Math.sin(i.z),Math.cos(i.z)));break}this.setQuatNow(o)}lookAt(e,t,r){const i=new Ie;typeof e=="number"?i.set(e,t,r):e instanceof Me?i.set(e.loc):i.set(e);const s=this.upVector?this.upVector:Me.defaultUpVector,o=lt(this.loc,i,s);this.setQuat(o)}lookAtNow(e,t,r){const i=new Ie;typeof e=="number"?i.set(e,t,r):e instanceof Me?i.set(e.loc):i.set(e);const s=this.upVector?this.upVector:Me.defaultUpVector,o=lt(this.loc,i,s);this.setQuatNow(o)}getUnitVecX(){return new Ie(1,0,0).apply(this.object.quaternion)}getUnitVecY(){return new Ie(0,1,0).apply(this.object.quaternion)}getUnitVecZ(){return new Ie(0,0,1).apply(this.object.quaternion)}}class fr{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 Nn extends Me{controller;setController(e){this.controller=e}setLocation(e,t,r){const i=new Ie;typeof e=="number"?(super.setLocation(e,t,r),i.set(e,t,r)):(super.setLocation(e),i.set(e)),this.controller?.setCameraLocation(i)}}class Dn{view;constructor(e){this.view=e,e.setController(this)}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){}setCameraLocation(e){}setCameraLocationNow(e){}setCameraQuat(e){}setCameraQuatNow(e){}setCameraScale(e){}setCameraScaleNow(e){}}class On extends Dn{preMouse;leftClick=!1;target;cameraLoc=new Ie(0,0,3);cameraQuat=new we(0,0,0,1);constructor(e,t,r,i){super(e),this.preMouse={x:0,y:0},typeof t=="number"?this.target=new Ie(t,r,i):this.target=new Ie(t)}update(e){this.view.camera.setLocation(this.cameraLoc),this.view.camera.setQuat(this.cameraQuat)}mouseDown(e){e.button===0&&(this.leftClick=!0,this.preMouse.x=e.clientX,this.preMouse.y=e.clientY)}mouseMove(e){if(this.leftClick===!1)return;const t=.01,r=t*(e.clientX-this.preMouse.x),i=t*(e.clientY-this.preMouse.y),s=Math.sin(-r),o=Math.cos(-r),c=Math.sin(-i),A=Math.cos(-i),a=new Ie(1,0,0).apply(this.cameraQuat),f=new Ie(0,1,0).apply(this.cameraQuat),u=new we(a.x*c,a.y*c,a.z*c,A),b=new we(f.x*s,f.y*s,f.z*s,o),d=new Ie(this.cameraLoc);d.sub(this.target),d.apply(u),d.apply(b),d.add(this.target),this.cameraLoc.set(d);const E=lt(this.cameraLoc,this.target,new Ie(0,1,0));this.cameraQuat.set(E),this.preMouse.x=e.clientX,this.preMouse.y=e.clientY}mouseUp(e){e.button===0&&(this.leftClick=!1)}mouseWheel(e){const t=new Ie(this.target).sub(this.cameraLoc);e.deltaY>0?t.scale(.05):e.deltaY<0&&t.scale(-.05),this.cameraLoc.add(t)}setCameraLocation(e){this.cameraLoc.set(e)}setCameraLocationNow(e){this.cameraLoc.set(e)}}const dr={type:"audio",autoplay:!1,loop:!1,volume:1,positional:{refDistance:1,maxDistance:1e3,rolloffFactor:1,directional:{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0}}};async function pr(){try{rt.listener.context.state!=="running"&&await rt.listener.context.resume()}catch{console.warn("AudioContext resume failed. Did you call on user gesture?")}}class rt extends Me{static listener=new se.AudioListener;static audioLoader=new se.AudioLoader;ready;config;sound;constructor(e,t={}){super(),this.config=Tt(dr,t),this.ready=this.asyncInit(e)}initObject(){return new se.Object3D}async asyncInit(e){if(this.config.type==="positional"){const t=new se.PositionalAudio(rt.listener);t.setRefDistance(this.config.positional.refDistance),t.setMaxDistance(this.config.positional.maxDistance),t.setRolloffFactor(this.config.positional.rolloffFactor);const r=this.config.positional.directional;t.setDirectionalCone(r.coneInnerAngle,r.coneOuterAngle,r.coneOuterGain),t.setVolume(this.config.volume),t.setLoop(this.config.loop),this.sound=t}else{const t=new se.Audio(rt.listener);t.setVolume(this.config.volume),t.setLoop(this.config.loop),this.sound=t}return this.object.add(this.sound),new Promise(t=>{rt.audioLoader.load(e,r=>{this.sound&&this.sound.setBuffer(r),t(this)})})}play(){this.sound?.play()}}class Fn{scene;camera;controller;constructor(e){this.scene=new Ln,this.camera=e,this.camera.setAudioListener(rt.listener),this.scene.scene.add(this.camera.object),this.camera.setLocation(0,0,3),this.controller=new On(this,0,0,0),this.camera.setController(this.controller)}replaceScene(e){this.scene.scene.remove(this.camera.object),e.scene.add(this.camera.object);const t=this.scene;return this.scene=e,t}updateScene(e){this.scene.update(e),this.controller?.update(e),this.camera.update(e)}setController(e){this.controller?.deactivate(),this.controller=e,this.controller.activate(),this.camera.setController(e)}worldToScreen(e){throw new Error("ViewBaseはworldToScreen()は実装していません")}screenToWorld(e,t,r){throw new Error("ViewBaseはscreenToWorld()は実装していません")}cameraToScreen(e){throw new Error("ViewBaseはcameraToScreen()は実装していません")}screenToCamera(e,t,r){throw new Error("ViewBaseはscreenToCamera()は実装していません")}}class gt extends Nn{camera;headLight;constructor(e){super(),this.camera=e,this.headLight=new se.SpotLight(16777215,1,0,Math.PI/3,0,0),this.headLight.rotation.x=3.14/2,this.object.add(this.camera),this.object.add(this.headLight)}initObject(){return new se.Object3D}setAudioListener(e){this.camera.add(e)}getHeadLight(){return this.headLight}setAspect(e){nr(this.camera)&&(this.camera.aspect=e,this.camera.updateProjectionMatrix())}setHeadLightEnable(e){e?this.headLight.intensity=1:this.headLight.intensity=0}calcNDC(e){const t=new se.Vector3(e.x,e.y,e.z);return t.project(this.camera),{x:t.x,y:t.y}}}class Mn extends I.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 I.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 at=new I.Vector3,fn=new I.Matrix4,dn=new I.Matrix4,pn=new I.Vector3,gn=new I.Vector3;class Pn{constructor(e={}){const t=this;let r,i,s,o;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:r,height:i}},this.render=function(E,g){E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),g.parent===null&&g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),fn.copy(g.matrixWorldInverse),dn.multiplyMatrices(g.projectionMatrix,fn),f(E,E,g),this.sortObjects&&d(E)},this.setSize=function(E,g){r=E,i=g,s=r/2,o=i/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 f(E,g,l){if(E.visible===!1){a(E);return}if(E.isCSS2DObject){at.setFromMatrixPosition(E.matrixWorld),at.applyMatrix4(dn);const h=at.z>=-1&&at.z<=1&&E.layers.test(l.layers)===!0,p=E.element;p.style.display=h===!0?"":"none",h===!0&&(E.onBeforeRender(t,g,l),p.style.transform="translate("+-100*E.center.x+"%,"+-100*E.center.y+"%)translate("+(at.x*s+s)+"px,"+(-at.y*o+o)+"px)",p.parentNode!==A&&A.appendChild(p),E.onAfterRender(t,g,l));const C={distanceToCameraSquared:u(l,E)};c.objects.set(E,C)}for(let h=0,p=E.children.length;h<p;h++)f(E.children[h],g,l)}function u(E,g){return pn.setFromMatrixPosition(E.matrixWorld),gn.setFromMatrixPosition(g.matrixWorld),pn.distanceToSquared(gn)}function b(E){const g=[];return E.traverseVisible(function(l){l.isCSS2DObject&&g.push(l)}),g}function d(E){const g=b(E).sort(function(h,p){if(h.renderOrder!==p.renderOrder)return p.renderOrder-h.renderOrder;const C=c.objects.get(h).distanceToCameraSquared,m=c.objects.get(p).distanceToCameraSquared;return C-m}),l=g.length;for(let h=0,p=g.length;h<p;h++)g[h].element.style.zIndex=l-h}}}function En(n,e){if(e===I.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===I.TriangleFanDrawMode||e===I.TriangleStripDrawMode){let t=n.getIndex();if(t===null){const o=[],c=n.getAttribute("position");if(c!==void 0){for(let A=0;A<c.count;A++)o.push(A);n.setIndex(o),t=n.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const r=t.count-2,i=[];if(e===I.TriangleFanDrawMode)for(let o=1;o<=r;o++)i.push(t.getX(0)),i.push(t.getX(o)),i.push(t.getX(o+1));else for(let o=0;o<r;o++)o%2===0?(i.push(t.getX(o)),i.push(t.getX(o+1)),i.push(t.getX(o+2))):(i.push(t.getX(o+2)),i.push(t.getX(o+1)),i.push(t.getX(o)));i.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=n.clone();return s.setIndex(i),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),n}class Gn extends I.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new br(t)}),this.register(function(t){return new Cr(t)}),this.register(function(t){return new Sr(t)}),this.register(function(t){return new Lr(t)}),this.register(function(t){return new _r(t)}),this.register(function(t){return new yr(t)}),this.register(function(t){return new Tr(t)}),this.register(function(t){return new Rr(t)}),this.register(function(t){return new Qr(t)}),this.register(function(t){return new mr(t)}),this.register(function(t){return new wr(t)}),this.register(function(t){return new Br(t)}),this.register(function(t){return new kr(t)}),this.register(function(t){return new vr(t)}),this.register(function(t){return new Er(t)}),this.register(function(t){return new xr(t)}),this.register(function(t){return new Nr(t)})}load(e,t,r,i){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const a=I.LoaderUtils.extractUrlBase(e);o=I.LoaderUtils.resolveURL(a,this.path)}else o=I.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const c=function(a){i?i(a):console.error(a),s.manager.itemError(e),s.manager.itemEnd(e)},A=new I.FileLoader(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(a){try{s.parse(a,o,function(f){t(f),s.manager.itemEnd(e)},c)}catch(f){c(f)}},r,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,r,i){let s;const o={},c={},A=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(A.decode(new Uint8Array(e,0,4))===Un){try{o[ye.KHR_BINARY_GLTF]=new Dr(e)}catch(u){i&&i(u);return}s=JSON.parse(o[ye.KHR_BINARY_GLTF].content)}else s=JSON.parse(A.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const a=new Yr(s,{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 f=0;f<this.pluginCallbacks.length;f++){const u=this.pluginCallbacks[f](a);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),c[u.name]=u,o[u.name]=!0}if(s.extensionsUsed)for(let f=0;f<s.extensionsUsed.length;++f){const u=s.extensionsUsed[f],b=s.extensionsRequired||[];switch(u){case ye.KHR_MATERIALS_UNLIT:o[u]=new Ir;break;case ye.KHR_DRACO_MESH_COMPRESSION:o[u]=new Or(s,this.dracoLoader);break;case ye.KHR_TEXTURE_TRANSFORM:o[u]=new Fr;break;case ye.KHR_MESH_QUANTIZATION:o[u]=new Mr;break;default:b.indexOf(u)>=0&&c[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}a.setExtensions(o),a.setPlugins(c),a.parse(r,i)}parseAsync(e,t){const r=this;return new Promise(function(i,s){r.parse(e,t,i,s)})}}function gr(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const ye={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 Er{constructor(e){this.parser=e,this.name=ye.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,i=t.length;r<i;r++){const s=t[r];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,r="light:"+e;let i=t.cache.get(r);if(i)return i;const s=t.json,A=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let a;const f=new I.Color(16777215);A.color!==void 0&&f.setRGB(A.color[0],A.color[1],A.color[2],I.LinearSRGBColorSpace);const u=A.range!==void 0?A.range:0;switch(A.type){case"directional":a=new I.DirectionalLight(f),a.target.position.set(0,0,-1),a.add(a.target);break;case"point":a=new I.PointLight(f),a.distance=u;break;case"spot":a=new I.SpotLight(f),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),Ze(a,A),A.intensity!==void 0&&(a.intensity=A.intensity),a.name=t.createUniqueName(A.name||"light_"+e),i=Promise.resolve(a),t.cache.add(r,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,r=this.parser,s=r.json.nodes[e],c=(s.extensions&&s.extensions[this.name]||{}).light;return c===void 0?null:this._loadLight(c).then(function(A){return r._getNodeRef(t.cache,c,A)})}}class Ir{constructor(){this.name=ye.KHR_MATERIALS_UNLIT}getMaterialType(){return I.MeshBasicMaterial}extendParams(e,t,r){const i=[];e.color=new I.Color(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],I.LinearSRGBColorSpace),e.opacity=o[3]}s.baseColorTexture!==void 0&&i.push(r.assignTexture(e,"map",s.baseColorTexture,I.SRGBColorSpace))}return Promise.all(i)}}class mr{constructor(e){this.parser=e,this.name=ye.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name].emissiveStrength;return s!==void 0&&(t.emissiveIntensity=s),Promise.resolve()}}class br{constructor(e){this.parser=e,this.name=ye.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(r.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(r.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(r.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const c=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new I.Vector2(c,c)}return Promise.all(s)}}class Cr{constructor(e){this.parser=e,this.name=ye.KHR_MATERIALS_DISPERSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name];return t.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class Br{constructor(e){this.parser=e,this.name=ye.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(r.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(r.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class yr{constructor(e){this.parser=e,this.name=ye.KHR_MATERIALS_SHEEN}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new I.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=i.extensions[this.name];if(o.sheenColorFactor!==void 0){const c=o.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],I.LinearSRGBColorSpace)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(r.assignTexture(t,"sheenColorMap",o.sheenColorTexture,I.SRGBColorSpace)),o.sheenRoughnessTexture!==void 0&&s.push(r.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class Tr{constructor(e){this.parser=e,this.name=ye.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(r.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class Rr{constructor(e){this.parser=e,this.name=ye.KHR_MATERIALS_VOLUME}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(r.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const c=o.attenuationColor||[1,1,1];return t.attenuationColor=new I.Color().setRGB(c[0],c[1],c[2],I.LinearSRGBColorSpace),Promise.all(s)}}class Qr{constructor(e){this.parser=e,this.name=ye.KHR_MATERIALS_IOR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name];return t.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class wr{constructor(e){this.parser=e,this.name=ye.KHR_MATERIALS_SPECULAR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(r.assignTexture(t,"specularIntensityMap",o.specularTexture));const c=o.specularColorFactor||[1,1,1];return t.specularColor=new I.Color().setRGB(c[0],c[1],c[2],I.LinearSRGBColorSpace),o.specularColorTexture!==void 0&&s.push(r.assignTexture(t,"specularColorMap",o.specularColorTexture,I.SRGBColorSpace)),Promise.all(s)}}class vr{constructor(e){this.parser=e,this.name=ye.EXT_MATERIALS_BUMP}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(r.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class kr{constructor(e){this.parser=e,this.name=ye.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:I.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(r.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class Sr{constructor(e){this.parser=e,this.name=ye.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,r=t.json,i=r.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const s=i.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class Lr{constructor(e){this.parser=e,this.name=ye.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,r=this.parser,i=r.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],c=i.images[o.source];let A=r.textureLoader;if(c.uri){const a=r.options.manager.getHandler(c.uri);a!==null&&(A=a)}return r.loadTextureImage(e,o.source,A)}}class _r{constructor(e){this.parser=e,this.name=ye.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,r=this.parser,i=r.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],c=i.images[o.source];let A=r.textureLoader;if(c.uri){const a=r.options.manager.getHandler(c.uri);a!==null&&(A=a)}return r.loadTextureImage(e,o.source,A)}}class xr{constructor(e){this.name=ye.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.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 s.then(function(c){const A=i.byteOffset||0,a=i.byteLength||0,f=i.count,u=i.byteStride,b=new Uint8Array(c,A,a);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(f,u,b,i.mode,i.filter).then(function(d){return d.buffer}):o.ready.then(function(){const d=new ArrayBuffer(f*u);return o.decodeGltfBuffer(new Uint8Array(d),f,u,b,i.mode,i.filter),d})})}else return null}}class Nr{constructor(e){this.name=ye.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=t.meshes[r.mesh];for(const a of i.primitives)if(a.mode!==Ye.TRIANGLES&&a.mode!==Ye.TRIANGLE_STRIP&&a.mode!==Ye.TRIANGLE_FAN&&a.mode!==void 0)return null;const o=r.extensions[this.name].attributes,c=[],A={};for(const a in o)c.push(this.parser.getDependency("accessor",o[a]).then(f=>(A[a]=f,A[a])));return c.length<1?null:(c.push(this.parser.createNodeMesh(e)),Promise.all(c).then(a=>{const f=a.pop(),u=f.isGroup?f.children:[f],b=a[0].count,d=[];for(const E of u){const g=new I.Matrix4,l=new I.Vector3,h=new I.Quaternion,p=new I.Vector3(1,1,1),C=new I.InstancedMesh(E.geometry,E.material,b);for(let m=0;m<b;m++)A.TRANSLATION&&l.fromBufferAttribute(A.TRANSLATION,m),A.ROTATION&&h.fromBufferAttribute(A.ROTATION,m),A.SCALE&&p.fromBufferAttribute(A.SCALE,m),C.setMatrixAt(m,g.compose(l,h,p));for(const m in A)if(m==="_COLOR_0"){const y=A[m];C.instanceColor=new I.InstancedBufferAttribute(y.array,y.itemSize,y.normalized)}else m!=="TRANSLATION"&&m!=="ROTATION"&&m!=="SCALE"&&E.geometry.setAttribute(m,A[m]);I.Object3D.prototype.copy.call(C,E),this.parser.assignFinalMaterial(C),d.push(C)}return f.isGroup?(f.clear(),f.add(...d),f):d[0]}))}}const Un="glTF",ht=12,In={JSON:1313821514,BIN:5130562};class Dr{constructor(e){this.name=ye.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,ht),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Un)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-ht,s=new DataView(e,ht);let o=0;for(;o<i;){const c=s.getUint32(o,!0);o+=4;const A=s.getUint32(o,!0);if(o+=4,A===In.JSON){const a=new Uint8Array(e,ht+o,c);this.content=r.decode(a)}else if(A===In.BIN){const a=ht+o;this.body=e.slice(a,a+c)}o+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Or{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ye.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const r=this.json,i=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,c={},A={},a={};for(const f in o){const u=Vt[f]||f.toLowerCase();c[u]=o[f]}for(const f in e.attributes){const u=Vt[f]||f.toLowerCase();if(o[f]!==void 0){const b=r.accessors[e.attributes[f]],d=ct[b.componentType];a[u]=d.name,A[u]=b.normalized===!0}}return t.getDependency("bufferView",s).then(function(f){return new Promise(function(u,b){i.decodeDracoFile(f,function(d){for(const E in d.attributes){const g=d.attributes[E],l=A[E];l!==void 0&&(g.normalized=l)}u(d)},c,a,I.LinearSRGBColorSpace,b)})})}}class Fr{constructor(){this.name=ye.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 Mr{constructor(){this.name=ye.KHR_MESH_QUANTIZATION}}class Hn extends I.Interpolant{constructor(e,t,r,i){super(e,t,r,i)}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=r[s+o];return t}interpolate_(e,t,r,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,A=c*2,a=c*3,f=i-t,u=(r-t)/f,b=u*u,d=b*u,E=e*a,g=E-a,l=-2*d+3*b,h=d-b,p=1-l,C=h-b+u;for(let m=0;m!==c;m++){const y=o[g+m+c],v=o[g+m+A]*f,S=o[E+m+c],U=o[E+m]*f;s[m]=p*y+C*v+l*S+h*U}return s}}const Pr=new I.Quaternion;class Gr extends Hn{interpolate_(e,t,r,i){const s=super.interpolate_(e,t,r,i);return Pr.fromArray(s).normalize().toArray(s),s}}const Ye={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},mn={9728:I.NearestFilter,9729:I.LinearFilter,9984:I.NearestMipmapNearestFilter,9985:I.LinearMipmapNearestFilter,9986:I.NearestMipmapLinearFilter,9987:I.LinearMipmapLinearFilter},bn={33071:I.ClampToEdgeWrapping,33648:I.MirroredRepeatWrapping,10497:I.RepeatWrapping},Lt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Vt={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"},nt={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Ur={CUBICSPLINE:void 0,LINEAR:I.InterpolateLinear,STEP:I.InterpolateDiscrete},_t={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Hr(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new I.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:I.FrontSide})),n.DefaultMaterial}function ot(n,e,t){for(const r in t.extensions)n[r]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=t.extensions[r])}function Ze(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function jr(n,e,t){let r=!1,i=!1,s=!1;for(let a=0,f=e.length;a<f;a++){const u=e[a];if(u.POSITION!==void 0&&(r=!0),u.NORMAL!==void 0&&(i=!0),u.COLOR_0!==void 0&&(s=!0),r&&i&&s)break}if(!r&&!i&&!s)return Promise.resolve(n);const o=[],c=[],A=[];for(let a=0,f=e.length;a<f;a++){const u=e[a];if(r){const b=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):n.attributes.position;o.push(b)}if(i){const b=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):n.attributes.normal;c.push(b)}if(s){const b=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):n.attributes.color;A.push(b)}}return Promise.all([Promise.all(o),Promise.all(c),Promise.all(A)]).then(function(a){const f=a[0],u=a[1],b=a[2];return r&&(n.morphAttributes.position=f),i&&(n.morphAttributes.normal=u),s&&(n.morphAttributes.color=b),n.morphTargetsRelative=!0,n})}function qr(n,e){if(n.updateMorphTargets(),e.weights!==void 0)for(let t=0,r=e.weights.length;t<r;t++)n.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(n.morphTargetInfluences.length===t.length){n.morphTargetDictionary={};for(let r=0,i=t.length;r<i;r++)n.morphTargetDictionary[t[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Kr(n){let e;const t=n.extensions&&n.extensions[ye.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+xt(t.attributes):e=n.indices+":"+xt(n.attributes)+":"+n.mode,n.targets!==void 0)for(let r=0,i=n.targets.length;r<i;r++)e+=":"+xt(n.targets[r]);return e}function xt(n){let e="";const t=Object.keys(n).sort();for(let r=0,i=t.length;r<i;r++)e+=t[r]+":"+n[t[r]]+";";return e}function Yt(n){switch(n){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 zr(n){return n.search(/\.jpe?g($|\?)/i)>0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":n.search(/\.ktx2($|\?)/i)>0||n.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const Vr=new I.Matrix4;class Yr{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new gr,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=-1,s=!1,o=-1;if(typeof navigator<"u"){const c=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(c)===!0;const A=c.match(/Version\/(\d+)/);i=r&&A?parseInt(A[1],10):-1,s=c.indexOf("Firefox")>-1,o=s?c.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||s&&o<98?this.textureLoader=new I.TextureLoader(this.options.manager):this.textureLoader=new I.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new I.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 r=this,i=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(o){const c={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:r,userData:{}};return ot(s,c,i),Ze(c,i),Promise.all(r._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||[],r=this.json.meshes||[];for(let i=0,s=t.length;i<s;i++){const o=t[i].joints;for(let c=0,A=o.length;c<A;c++)e[o[c]].isBone=!0}for(let i=0,s=e.length;i<s;i++){const o=e[i];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(r[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.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,r){if(e.refs[t]<=1)return r;const i=r.clone(),s=(o,c)=>{const A=this.associations.get(o);A!=null&&this.associations.set(c,A);for(const[a,f]of o.children.entries())s(f,c.children[a])};return s(r,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r<t.length;r++){const i=e(t[r]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const r=[];for(let i=0;i<t.length;i++){const s=e(t[i]);s&&r.push(s)}return r}getDependency(e,t){const r=e+":"+t;let i=this.cache.get(r);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":i=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(r,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const r=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(s,o){return r.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],r=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[ye.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(s,o){r.load(I.LoaderUtils.resolveURL(t.uri,i.path),s,void 0,function(){o(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(r){const i=t.byteLength||0,s=t.byteOffset||0;return r.slice(s,s+i)})}loadAccessor(e){const t=this,r=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const o=Lt[i.type],c=ct[i.componentType],A=i.normalized===!0,a=new c(i.count*o);return Promise.resolve(new I.BufferAttribute(a,o,A))}const s=[];return i.bufferView!==void 0?s.push(this.getDependency("bufferView",i.bufferView)):s.push(null),i.sparse!==void 0&&(s.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(s).then(function(o){const c=o[0],A=Lt[i.type],a=ct[i.componentType],f=a.BYTES_PER_ELEMENT,u=f*A,b=i.byteOffset||0,d=i.bufferView!==void 0?r.bufferViews[i.bufferView].byteStride:void 0,E=i.normalized===!0;let g,l;if(d&&d!==u){const h=Math.floor(b/d),p="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+h+":"+i.count;let C=t.cache.get(p);C||(g=new a(c,h*d,i.count*d/f),C=new I.InterleavedBuffer(g,d/f),t.cache.add(p,C)),l=new I.InterleavedBufferAttribute(C,A,b%d/f,E)}else c===null?g=new a(i.count*A):g=new a(c,b,i.count*A),l=new I.BufferAttribute(g,A,E);if(i.sparse!==void 0){const h=Lt.SCALAR,p=ct[i.sparse.indices.componentType],C=i.sparse.indices.byteOffset||0,m=i.sparse.values.byteOffset||0,y=new p(o[1],C,i.sparse.count*h),v=new a(o[2],m,i.sparse.count*A);c!==null&&(l=new I.BufferAttribute(l.array.slice(),l.itemSize,l.normalized)),l.normalized=!1;for(let S=0,U=y.length;S<U;S++){const w=y[S];if(l.setX(w,v[S*A]),A>=2&&l.setY(w,v[S*A+1]),A>=3&&l.setZ(w,v[S*A+2]),A>=4&&l.setW(w,v[S*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,r=this.options,s=t.textures[e].source,o=t.images[s];let c=this.textureLoader;if(o.uri){const A=r.manager.getHandler(o.uri);A!==null&&(c=A)}return this.loadTextureImage(e,s,c)}loadTextureImage(e,t,r){const i=this,s=this.json,o=s.textures[e],c=s.images[t],A=(c.uri||c.bufferView)+":"+o.sampler;if(this.textureCache[A])return this.textureCache[A];const a=this.loadImageSource(t,r).then(function(f){f.flipY=!1,f.name=o.name||c.name||"",f.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(f.name=c.uri);const b=(s.samplers||{})[o.sampler]||{};return f.magFilter=mn[b.magFilter]||I.LinearFilter,f.minFilter=mn[b.minFilter]||I.LinearMipmapLinearFilter,f.wrapS=bn[b.wrapS]||I.RepeatWrapping,f.wrapT=bn[b.wrapT]||I.RepeatWrapping,f.generateMipmaps=!f.isCompressedTexture&&f.minFilter!==I.NearestFilter&&f.minFilter!==I.LinearFilter,i.associations.set(f,{textures:e}),f}).catch(function(){return null});return this.textureCache[A]=a,a}loadImageSource(e,t){const r=this,i=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const o=i.images[e],c=self.URL||self.webkitURL;let A=o.uri||"",a=!1;if(o.bufferView!==void 0)A=r.getDependency("bufferView",o.bufferView).then(function(u){a=!0;const b=new Blob([u],{type:o.mimeType});return A=c.createObjectURL(b),A});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const f=Promise.resolve(A).then(function(u){return new Promise(function(b,d){let E=b;t.isImageBitmapLoader===!0&&(E=function(g){const l=new I.Texture(g);l.needsUpdate=!0,b(l)}),t.load(I.LoaderUtils.resolveURL(u,s.path),E,void 0,d)})}).then(function(u){return a===!0&&c.revokeObjectURL(A),Ze(u,o),u.userData.mimeType=o.mimeType||zr(o.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),u});return this.sourceCache[e]=f,f}assignTexture(e,t,r,i){const s=this;return this.getDependency("texture",r.index).then(function(o){if(!o)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(o=o.clone(),o.channel=r.texCoord),s.extensions[ye.KHR_TEXTURE_TRANSFORM]){const c=r.extensions!==void 0?r.extensions[ye.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const A=s.associations.get(o);o=s.extensions[ye.KHR_TEXTURE_TRANSFORM].extendTexture(o,c),s.associations.set(o,A)}}return i!==void 0&&(o.colorSpace=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const i=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const c="PointsMaterial:"+r.uuid;let A=this.cache.get(c);A||(A=new I.PointsMaterial,I.Material.prototype.copy.call(A,r),A.color.copy(r.color),A.map=r.map,A.sizeAttenuation=!1,this.cache.add(c,A)),r=A}else if(e.isLine){const c="LineBasicMaterial:"+r.uuid;let A=this.cache.get(c);A||(A=new I.LineBasicMaterial,I.Material.prototype.copy.call(A,r),A.color.copy(r.color),A.map=r.map,this.cache.add(c,A)),r=A}if(i||s||o){let c="ClonedMaterial:"+r.uuid+":";i&&(c+="derivative-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:");let A=this.cache.get(c);A||(A=r.clone(),s&&(A.vertexColors=!0),o&&(A.flatShading=!0),i&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(c,A),this.associations.set(A,this.associations.get(r))),r=A}e.material=r}getMaterialType(){return I.MeshStandardMaterial}loadMaterial(e){const t=this,r=this.json,i=this.extensions,s=r.materials[e];let o;const c={},A=s.extensions||{},a=[];if(A[ye.KHR_MATERIALS_UNLIT]){const u=i[ye.KHR_MATERIALS_UNLIT];o=u.getMaterialType(),a.push(u.extendParams(c,s,t))}else{const u=s.pbrMetallicRoughness||{};if(c.color=new I.Color(1,1,1),c.opacity=1,Array.isArray(u.baseColorFactor)){const b=u.baseColorFactor;c.color.setRGB(b[0],b[1],b[2],I.LinearSRGBColorSpace),c.opacity=b[3]}u.baseColorTexture!==void 0&&a.push(t.assignTexture(c,"map",u.baseColorTexture,I.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))),o=this._invokeOne(function(b){return b.getMaterialType&&b.getMaterialType(e)}),a.push(Promise.all(this._invokeAll(function(b){return b.extendMaterialParams&&b.extendMaterialParams(e,c)})))}s.doubleSided===!0&&(c.side=I.DoubleSide);const f=s.alphaMode||_t.OPAQUE;if(f===_t.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,f===_t.MASK&&(c.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==I.MeshBasicMaterial&&(a.push(t.assignTexture(c,"normalMap",s.normalTexture)),c.normalScale=new I.Vector2(1,1),s.normalTexture.scale!==void 0)){const u=s.normalTexture.scale;c.normalScale.set(u,u)}if(s.occlusionTexture!==void 0&&o!==I.MeshBasicMaterial&&(a.push(t.assignTexture(c,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==I.MeshBasicMaterial){const u=s.emissiveFactor;c.emissive=new I.Color().setRGB(u[0],u[1],u[2],I.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&o!==I.MeshBasicMaterial&&a.push(t.assignTexture(c,"emissiveMap",s.emissiveTexture,I.SRGBColorSpace)),Promise.all(a).then(function(){const u=new o(c);return s.name&&(u.name=s.name),Ze(u,s),t.associations.set(u,{materials:e}),s.extensions&&ot(i,u,s),u})}createUniqueName(e){const t=I.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,i=this.primitiveCache;function s(c){return r[ye.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(A){return Cn(A,c,t)})}const o=[];for(let c=0,A=e.length;c<A;c++){const a=e[c],f=Kr(a),u=i[f];if(u)o.push(u.promise);else{let b;a.extensions&&a.extensions[ye.KHR_DRACO_MESH_COMPRESSION]?b=s(a):b=Cn(new I.BufferGeometry,a,t),i[f]={primitive:a,promise:b},o.push(b)}}return Promise.all(o)}loadMesh(e){const t=this,r=this.json,i=this.extensions,s=r.meshes[e],o=s.primitives,c=[];for(let A=0,a=o.length;A<a;A++){const f=o[A].material===void 0?Hr(this.cache):this.getDependency("material",o[A].material);c.push(f)}return c.push(t.loadGeometries(o)),Promise.all(c).then(function(A){const a=A.slice(0,A.length-1),f=A[A.length-1],u=[];for(let d=0,E=f.length;d<E;d++){const g=f[d],l=o[d];let h;const p=a[d];if(l.mode===Ye.TRIANGLES||l.mode===Ye.TRIANGLE_STRIP||l.mode===Ye.TRIANGLE_FAN||l.mode===void 0)h=s.isSkinnedMesh===!0?new I.SkinnedMesh(g,p):new I.Mesh(g,p),h.isSkinnedMesh===!0&&h.normalizeSkinWeights(),l.mode===Ye.TRIANGLE_STRIP?h.geometry=En(h.geometry,I.TriangleStripDrawMode):l.mode===Ye.TRIANGLE_FAN&&(h.geometry=En(h.geometry,I.TriangleFanDrawMode));else if(l.mode===Ye.LINES)h=new I.LineSegments(g,p);else if(l.mode===Ye.LINE_STRIP)h=new I.Line(g,p);else if(l.mode===Ye.LINE_LOOP)h=new I.LineLoop(g,p);else if(l.mode===Ye.POINTS)h=new I.Points(g,p);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+l.mode);Object.keys(h.geometry.morphAttributes).length>0&&qr(h,s),h.name=t.createUniqueName(s.name||"mesh_"+e),Ze(h,s),l.extensions&&ot(i,h,l),t.assignFinalMaterial(h),u.push(h)}for(let d=0,E=u.length;d<E;d++)t.associations.set(u[d],{meshes:e,primitives:d});if(u.length===1)return s.extensions&&ot(i,u[0],s),u[0];const b=new I.Group;s.extensions&&ot(i,b,s),t.associations.set(b,{meshes:e});for(let d=0,E=u.length;d<E;d++)b.add(u[d]);return b})}loadCamera(e){let t;const r=this.json.cameras[e],i=r[r.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return r.type==="perspective"?t=new I.PerspectiveCamera(I.MathUtils.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):r.type==="orthographic"&&(t=new I.OrthographicCamera(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),r.name&&(t.name=this.createUniqueName(r.name)),Ze(t,r),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],r=[];for(let i=0,s=t.joints.length;i<s;i++)r.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?r.push(this.getDependency("accessor",t.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(i){const s=i.pop(),o=i,c=[],A=[];for(let a=0,f=o.length;a<f;a++){const u=o[a];if(u){c.push(u);const b=new I.Matrix4;s!==null&&b.fromArray(s.array,a*16),A.push(b)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new I.Skeleton(c,A)})}loadAnimation(e){const t=this.json,r=this,i=t.animations[e],s=i.name?i.name:"animation_"+e,o=[],c=[],A=[],a=[],f=[];for(let u=0,b=i.channels.length;u<b;u++){const d=i.channels[u],E=i.samplers[d.sampler],g=d.target,l=g.node,h=i.parameters!==void 0?i.parameters[E.input]:E.input,p=i.parameters!==void 0?i.parameters[E.output]:E.output;g.node!==void 0&&(o.push(this.getDependency("node",l)),c.push(this.getDependency("accessor",h)),A.push(this.getDependency("accessor",p)),a.push(E),f.push(g))}return Promise.all([Promise.all(o),Promise.all(c),Promise.all(A),Promise.all(a),Promise.all(f)]).then(function(u){const b=u[0],d=u[1],E=u[2],g=u[3],l=u[4],h=[];for(let C=0,m=b.length;C<m;C++){const y=b[C],v=d[C],S=E[C],U=g[C],w=l[C];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const M=r._createAnimationTracks(y,v,S,U,w);if(M)for(let _=0;_<M.length;_++)h.push(M[_])}const p=new I.AnimationClip(s,void 0,h);return Ze(p,i),p})}createNodeMesh(e){const t=this.json,r=this,i=t.nodes[e];return i.mesh===void 0?null:r.getDependency("mesh",i.mesh).then(function(s){const o=r._getNodeRef(r.meshCache,i.mesh,s);return i.weights!==void 0&&o.traverse(function(c){if(c.isMesh)for(let A=0,a=i.weights.length;A<a;A++)c.morphTargetInfluences[A]=i.weights[A]}),o})}loadNode(e){const t=this.json,r=this,i=t.nodes[e],s=r._loadNodeShallow(e),o=[],c=i.children||[];for(let a=0,f=c.length;a<f;a++)o.push(r.getDependency("node",c[a]));const A=i.skin===void 0?Promise.resolve(null):r.getDependency("skin",i.skin);return Promise.all([s,Promise.all(o),A]).then(function(a){const f=a[0],u=a[1],b=a[2];b!==null&&f.traverse(function(d){d.isSkinnedMesh&&d.bind(b,Vr)});for(let d=0,E=u.length;d<E;d++)f.add(u[d]);return f})}_loadNodeShallow(e){const t=this.json,r=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?i.createUniqueName(s.name):"",c=[],A=i._invokeOne(function(a){return a.createNodeMesh&&a.createNodeMesh(e)});return A&&c.push(A),s.camera!==void 0&&c.push(i.getDependency("camera",s.camera).then(function(a){return i._getNodeRef(i.cameraCache,s.camera,a)})),i._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 f;if(s.isBone===!0?f=new I.Bone:a.length>1?f=new I.Group:a.length===1?f=a[0]:f=new I.Object3D,f!==a[0])for(let u=0,b=a.length;u<b;u++)f.add(a[u]);if(s.name&&(f.userData.name=s.name,f.name=o),Ze(f,s),s.extensions&&ot(r,f,s),s.matrix!==void 0){const u=new I.Matrix4;u.fromArray(s.matrix),f.applyMatrix4(u)}else s.translation!==void 0&&f.position.fromArray(s.translation),s.rotation!==void 0&&f.quaternion.fromArray(s.rotation),s.scale!==void 0&&f.scale.fromArray(s.scale);if(!i.associations.has(f))i.associations.set(f,{});else if(s.mesh!==void 0&&i.meshCache.refs[s.mesh]>1){const u=i.associations.get(f);i.associations.set(f,{...u})}return i.associations.get(f).nodes=e,f}),this.nodeCache[e]}loadScene(e){const t=this.extensions,r=this.json.scenes[e],i=this,s=new I.Group;r.name&&(s.name=i.createUniqueName(r.name)),Ze(s,r),r.extensions&&ot(t,s,r);const o=r.nodes||[],c=[];for(let A=0,a=o.length;A<a;A++)c.push(i.getDependency("node",o[A]));return Promise.all(c).then(function(A){for(let f=0,u=A.length;f<u;f++)s.add(A[f]);const a=f=>{const u=new Map;for(const[b,d]of i.associations)(b instanceof I.Material||b instanceof I.Texture)&&u.set(b,d);return f.traverse(b=>{const d=i.associations.get(b);d!=null&&u.set(b,d)}),u};return i.associations=a(s),s})}_createAnimationTracks(e,t,r,i,s){const o=[],c=e.name?e.name:e.uuid,A=[];nt[s.path]===nt.weights?e.traverse(function(b){b.morphTargetInfluences&&A.push(b.name?b.name:b.uuid)}):A.push(c);let a;switch(nt[s.path]){case nt.weights:a=I.NumberKeyframeTrack;break;case nt.rotation:a=I.QuaternionKeyframeTrack;break;case nt.translation:case nt.scale:a=I.VectorKeyframeTrack;break;default:r.itemSize===1?a=I.NumberKeyframeTrack:a=I.VectorKeyframeTrack;break}const f=i.interpolation!==void 0?Ur[i.interpolation]:I.InterpolateLinear,u=this._getArrayFromAccessor(r);for(let b=0,d=A.length;b<d;b++){const E=new a(A[b]+"."+nt[s.path],t.array,u,f);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(E),o.push(E)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const r=Yt(t.constructor),i=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)i[s]=t[s]*r;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(r){const i=this instanceof I.QuaternionKeyframeTrack?Gr:Hn;return new i(this.times,this.values,this.getValueSize()/3,r)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Wr(n,e,t){const r=e.attributes,i=new I.Box3;if(r.POSITION!==void 0){const c=t.json.accessors[r.POSITION],A=c.min,a=c.max;if(A!==void 0&&a!==void 0){if(i.set(new I.Vector3(A[0],A[1],A[2]),new I.Vector3(a[0],a[1],a[2])),c.normalized){const f=Yt(ct[c.componentType]);i.min.multiplyScalar(f),i.max.multiplyScalar(f)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const c=new I.Vector3,A=new I.Vector3;for(let a=0,f=s.length;a<f;a++){const u=s[a];if(u.POSITION!==void 0){const b=t.json.accessors[u.POSITION],d=b.min,E=b.max;if(d!==void 0&&E!==void 0){if(A.setX(Math.max(Math.abs(d[0]),Math.abs(E[0]))),A.setY(Math.max(Math.abs(d[1]),Math.abs(E[1]))),A.setZ(Math.max(Math.abs(d[2]),Math.abs(E[2]))),b.normalized){const g=Yt(ct[b.componentType]);A.multiplyScalar(g)}c.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(c)}n.boundingBox=i;const o=new I.Sphere;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,n.boundingSphere=o}function Cn(n,e,t){const r=e.attributes,i=[];function s(o,c){return t.getDependency("accessor",o).then(function(A){n.setAttribute(c,A)})}for(const o in r){const c=Vt[o]||o.toLowerCase();c in n.attributes||i.push(s(r[o],c))}if(e.indices!==void 0&&!n.index){const o=t.getDependency("accessor",e.indices).then(function(c){n.setIndex(c)});i.push(o)}return I.ColorManagement.workingColorSpace!==I.LinearSRGBColorSpace&&"COLOR_0"in r&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${I.ColorManagement.workingColorSpace}" not supported.`),Ze(n,e),Wr(n,e,t),Promise.all(i).then(function(){return e.targets!==void 0?jr(n,e.targets,t):n})}const Nt=new WeakMap;class Jr extends I.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,r,i){const s=new I.FileLoader(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{this.parse(o,t,i)},r,i)}parse(e,t,r=()=>{}){this.decodeDracoFile(e,t,null,null,I.SRGBColorSpace,r).catch(r)}decodeDracoFile(e,t,r,i,s=I.LinearSRGBColorSpace,o=()=>{}){const c={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!r,vertexColorSpace:s};return this.decodeGeometry(e,c).then(t).catch(o)}decodeGeometry(e,t){const r=JSON.stringify(t);if(Nt.has(e)){const A=Nt.get(e);if(A.key===r)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 i;const s=this.workerNextTaskID++,o=e.byteLength,c=this._getWorker(s,o).then(A=>(i=A,new Promise((a,f)=>{i._callbacks[s]={resolve:a,reject:f},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return c.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),Nt.set(e,{key:r,promise:c}),c}_createGeometry(e){const t=new I.BufferGeometry;e.index&&t.setIndex(new I.BufferAttribute(e.index.array,1));for(let r=0;r<e.attributes.length;r++){const{name:i,array:s,itemSize:o,stride:c,vertexColorSpace:A}=e.attributes[r];let a;if(o===c)a=new I.BufferAttribute(s,o);else{const f=new I.InterleavedBuffer(s,c);a=new I.InterleavedBufferAttribute(f,o,0)}i==="color"&&(this._assignVertexColorSpace(a,A),a.normalized=!(s instanceof Float32Array)),t.setAttribute(i,a)}return t}_assignVertexColorSpace(e,t){if(t!==I.SRGBColorSpace)return;const r=new I.Color;for(let i=0,s=e.count;i<s;i++)r.fromBufferAttribute(e,i),I.ColorManagement.colorSpaceToWorking(r,I.SRGBColorSpace),e.setXYZ(i,r.r,r.g,r.b)}_loadLibrary(e,t){const r=new I.FileLoader(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),r.setWithCredentials(this.withCredentials),new Promise((i,s)=>{r.load(e,i,void 0,s)})}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(r=>{const i=r[0];e||(this.decoderConfig.wasmBinary=r[1]);const s=Xr.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(`
|
|
2
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const i=new Worker(this.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:this.decoderConfig}),i.onmessage=function(s){const o=s.data;switch(o.type){case"decode":i._callbacks[o.id].resolve(o);break;case"error":i._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(i)}else this.workerPool.sort(function(i,s){return i._taskLoad>s._taskLoad?-1:1});const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_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 Xr(){let n,e;onmessage=function(o){const c=o.data;switch(c.type){case"init":n=c.decoderConfig,e=new Promise(function(f){n.onModuleLoaded=function(u){f({draco:u})},DracoDecoderModule(n)});break;case"decode":const A=c.buffer,a=c.taskConfig;e.then(f=>{const u=f.draco,b=new u.Decoder;try{const d=t(u,b,new Int8Array(A),a),E=d.attributes.map(g=>g.array.buffer);d.index&&E.push(d.index.array.buffer),self.postMessage({type:"decode",id:c.id,geometry:d},E)}catch(d){console.error(d),self.postMessage({type:"error",id:c.id,error:d.message})}finally{u.destroy(b)}});break}};function t(o,c,A,a){const f=a.attributeIDs,u=a.attributeTypes;let b,d;const E=c.GetEncodedGeometryType(A);if(E===o.TRIANGULAR_MESH)b=new o.Mesh,d=c.DecodeArrayToMesh(A,A.byteLength,b);else if(E===o.POINT_CLOUD)b=new o.PointCloud,d=c.DecodeArrayToPointCloud(A,A.byteLength,b);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!d.ok()||b.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+d.error_msg());const g={index:null,attributes:[]};for(const l in f){const h=self[u[l]];let p,C;if(a.useUniqueIDs)C=f[l],p=c.GetAttributeByUniqueId(b,C);else{if(C=c.GetAttributeId(b,o[f[l]]),C===-1)continue;p=c.GetAttribute(b,C)}const m=i(o,c,b,l,h,p);l==="color"&&(m.vertexColorSpace=a.vertexColorSpace),g.attributes.push(m)}return E===o.TRIANGULAR_MESH&&(g.index=r(o,c,b)),o.destroy(b),g}function r(o,c,A){const f=A.num_faces()*3,u=f*4,b=o._malloc(u);c.GetTrianglesUInt32Array(A,u,b);const d=new Uint32Array(o.HEAPF32.buffer,b,f).slice();return o._free(b),{array:d,itemSize:1}}function i(o,c,A,a,f,u){const b=A.num_points(),d=u.num_components(),E=s(o,f),g=d*f.BYTES_PER_ELEMENT,l=Math.ceil(g/4)*4,h=l/f.BYTES_PER_ELEMENT,p=b*g,C=b*l,m=o._malloc(p);c.GetAttributeDataArrayForAllPoints(A,u,E,p,m);const y=new f(o.HEAPF32.buffer,m,p/f.BYTES_PER_ELEMENT);let v;if(g===l)v=y.slice();else{v=new f(C/f.BYTES_PER_ELEMENT);let S=0;for(let U=0,w=y.length;U<w;U++){for(let M=0;M<d;M++)v[S+M]=y[U*d+M];S+=h}}return o._free(m),{name:a,count:b,itemSize:d,array:v,stride:h}}function s(o,c){switch(c){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}class Zr{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 r=this.workersResolve[e];if(r&&r(t),this.queue.length){const{resolve:i,msg:s,transfer:o}=this.queue.shift();this.workersResolve[e]=i,this.workers[e].postMessage(s,o)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(r=>{const i=this._getIdleWorker();i!==-1?(this._initWorker(i),this.workerStatus|=1<<i,this.workersResolve[i]=r,this.workers[i].postMessage(e,t)):this.queue.push({resolve:r,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 $r=0,Bn=2,eo=1,yn=2,to=0,no=1,io=10,ro=0,jn=9,qn=15,Kn=16,zn=22,Vn=37,Yn=43,Wn=76,Jn=83,Xn=97,Zn=100,$n=103,ei=109,ti=122,ni=123,ii=131,ri=132,oi=133,si=134,ai=137,Ai=138,ci=139,li=140,ui=141,hi=142,fi=145,di=146,pi=148,gi=152,Wt=153,oo=154,Jt=155,so=156,Ei=157,Ii=158,mi=165,bi=166,Ci=1000054e3,Bi=1000054001,yi=1000054004,Ti=1000054005,nn=1000066e3,Ri=1000066004;class ft{constructor(e,t,r,i){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,r),this._littleEndian=i,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 r=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==t&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+r,i)}}const qe=[171,75,84,88,32,50,48,187,13,10,26,10];function Tn(n){return new TextDecoder().decode(n)}function ao(n){const e=new Uint8Array(n.buffer,n.byteOffset,qe.length);if(e[0]!==qe[0]||e[1]!==qe[1]||e[2]!==qe[2]||e[3]!==qe[3]||e[4]!==qe[4]||e[5]!==qe[5]||e[6]!==qe[6]||e[7]!==qe[7]||e[8]!==qe[8]||e[9]!==qe[9]||e[10]!==qe[10]||e[11]!==qe[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},r=17*Uint32Array.BYTES_PER_ELEMENT,i=new ft(n,qe.length,r,!0);t.vkFormat=i._nextUint32(),t.typeSize=i._nextUint32(),t.pixelWidth=i._nextUint32(),t.pixelHeight=i._nextUint32(),t.pixelDepth=i._nextUint32(),t.layerCount=i._nextUint32(),t.faceCount=i._nextUint32(),t.levelCount=i._nextUint32(),t.supercompressionScheme=i._nextUint32();const s=i._nextUint32(),o=i._nextUint32(),c=i._nextUint32(),A=i._nextUint32(),a=i._nextUint64(),f=i._nextUint64(),u=3*Math.max(t.levelCount,1)*8,b=new ft(n,qe.length+r,u,!0);for(let ie=0,re=Math.max(t.levelCount,1);ie<re;ie++)t.levels.push({levelData:new Uint8Array(n.buffer,n.byteOffset+b._nextUint64(),b._nextUint64()),uncompressedByteLength:b._nextUint64()});const d=new ft(n,s,o,!0);d._skip(4);const E=d._nextUint16(),g=d._nextUint16(),l=d._nextUint16(),h=d._nextUint16(),p={vendorId:E,descriptorType:g,versionNumber:l,colorModel:d._nextUint8(),colorPrimaries:d._nextUint8(),transferFunction:d._nextUint8(),flags:d._nextUint8(),texelBlockDimension:[d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8()],bytesPlane:[d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8()],samples:[]},C=(h/4-6)/4;for(let ie=0;ie<C;ie++){const re={bitOffset:d._nextUint16(),bitLength:d._nextUint8(),channelType:d._nextUint8(),samplePosition:[d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&re.channelType?(re.sampleLower=d._nextInt32(),re.sampleUpper=d._nextInt32()):(re.sampleLower=d._nextUint32(),re.sampleUpper=d._nextUint32()),p.samples[ie]=re}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(p);const m=new ft(n,c,A,!0);for(;m._offset<A;){const ie=m._nextUint32(),re=m._scan(ie),ee=Tn(re);if(t.keyValue[ee]=m._nextUint8Array(ie-re.byteLength-1),ee.match(/^ktx/i)){const le=Tn(t.keyValue[ee]);t.keyValue[ee]=le.substring(0,le.lastIndexOf("\0"))}m._skip(ie%4?4-ie%4:0)}if(f<=0)return t;const y=new ft(n,a,f,!0),v=y._nextUint16(),S=y._nextUint16(),U=y._nextUint32(),w=y._nextUint32(),M=y._nextUint32(),_=y._nextUint32(),k=[];for(let ie=0,re=Math.max(t.levelCount,1);ie<re;ie++)k.push({imageFlags:y._nextUint32(),rgbSliceByteOffset:y._nextUint32(),rgbSliceByteLength:y._nextUint32(),alphaSliceByteOffset:y._nextUint32(),alphaSliceByteLength:y._nextUint32()});const D=a+y._offset,L=D+U,V=L+w,W=V+M,j=new Uint8Array(n.buffer,n.byteOffset+D,U),J=new Uint8Array(n.buffer,n.byteOffset+L,w),Z=new Uint8Array(n.buffer,n.byteOffset+V,M),Ae=new Uint8Array(n.buffer,n.byteOffset+W,_);return t.globalData={endpointCount:v,selectorCount:S,imageDescs:k,endpointsData:j,selectorsData:J,tablesData:Z,extendedData:Ae},t}let Dt,$e,Xt;const Ot={env:{emscripten_notify_memory_growth:function(n){Xt=new Uint8Array($e.exports.memory.buffer)}}};class Ao{init(){return Dt||(Dt=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Rn).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Ot)).then(this._init):WebAssembly.instantiate(Buffer.from(Rn,"base64"),Ot).then(this._init),Dt)}_init(e){$e=e.instance,Ot.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!$e)throw new Error("ZSTDDecoder: Await .init() before decoding.");const r=e.byteLength,i=$e.exports.malloc(r);Xt.set(e,i),t=t||Number($e.exports.ZSTD_findDecompressedSize(i,r));const s=$e.exports.malloc(t),o=$e.exports.ZSTD_decompress(s,t,i,r),c=Xt.slice(s,s+o);return $e.exports.free(i),$e.exports.free(s),c}}const Rn="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IAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQh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ASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigC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C0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY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wOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEE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",co="display-p3",lo="display-p3-linear";({...I.ColorManagement.spaces[I.SRGBColorSpace]});const Ft=new WeakMap;let Mt=0,Pt;class We extends I.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new Zr,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 I.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),r=new I.FileLoader(this.manager);r.setPath(this.transcoderPath),r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials);const i=r.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then(([s,o])=>{const c=We.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(We.EngineFormat),"let _EngineType = "+JSON.stringify(We.EngineType),"let _TranscoderFormat = "+JSON.stringify(We.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(We.BasisFormat),"/* basis_transcoder.js */",s,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
|
|
3
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=o,this.workerPool.setWorkerCreator(()=>{const a=new Worker(this.workerSourceURL),f=this.transcoderBinary.slice(0);return a.postMessage({type:"init",config:this.workerConfig,transcoderBinary:f},[f]),a})}),Mt>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Mt++}return this.transcoderPending}load(e,t,r,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new I.FileLoader(this.manager);s.setPath(this.path),s.setCrossOrigin(this.crossOrigin),s.setWithCredentials(this.withCredentials),s.setRequestHeader(this.requestHeader),s.setResponseType("arraybuffer"),s.load(e,o=>{this.parse(o,t,i)},r,i)}parse(e,t,r){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Ft.has(e))return Ft.get(e).promise.then(t).catch(r);this._createTexture(e).then(i=>t?t(i):null).catch(r)}_createTextureFrom(e,t){const{type:r,error:i,data:{faces:s,width:o,height:c,format:A,type:a,dfdFlags:f}}=e;if(r==="error")return Promise.reject(i);let u;if(t.faceCount===6)u=new I.CompressedCubeTexture(s,A,a);else{const b=s[0].mipmaps;u=t.layerCount>1?new I.CompressedArrayTexture(b,o,c,t.layerCount,A,a):new I.CompressedTexture(b,o,c,A,a)}return u.minFilter=s[0].mipmaps.length===1?I.LinearFilter:I.LinearMipmapLinearFilter,u.magFilter=I.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=Qi(t),u.premultiplyAlpha=!!(f&eo),u}async _createTexture(e,t={}){const r=ao(new Uint8Array(e)),i=r.vkFormat===nn&&r.dataFormatDescriptor[0].colorModel===167;if(!(r.vkFormat===ro||i&&!this.workerConfig.astcHDRSupported))return ho(r);const o=t,c=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:o},[e])).then(A=>this._createTextureFrom(A.data,r));return Ft.set(e,{promise:c}),c}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Mt--}}We.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2};We.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};We.EngineFormat={RGBAFormat:I.RGBAFormat,RGBA_ASTC_4x4_Format:I.RGBA_ASTC_4x4_Format,RGB_BPTC_UNSIGNED_Format:I.RGB_BPTC_UNSIGNED_Format,RGBA_BPTC_Format:I.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:I.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:I.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:I.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:I.RGB_ETC1_Format,RGB_ETC2_Format:I.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:I.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:I.RGBA_S3TC_DXT1_Format};We.EngineType={UnsignedByteType:I.UnsignedByteType,HalfFloatType:I.HalfFloatType,FloatType:I.FloatType};We.BasisWorker=function(){let n,e,t;const r=_EngineFormat,i=_EngineType,s=_TranscoderFormat,o=_BasisFormat;self.addEventListener("message",function(E){const g=E.data;switch(g.type){case"init":n=g.config,c(g.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:l,buffers:h,width:p,height:C,hasAlpha:m,format:y,type:v,dfdFlags:S}=A(g.buffer);self.postMessage({type:"transcode",id:g.id,data:{faces:l,width:p,height:C,hasAlpha:m,format:y,type:v,dfdFlags:S}},h)}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 h;if(g.isUASTC())h=o.UASTC;else if(g.isETC1S())h=o.ETC1S;else if(g.isHDR())h=o.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const p=g.getWidth(),C=g.getHeight(),m=g.getLayers()||1,y=g.getLevels(),v=g.getFaces(),S=g.getHasAlpha(),U=g.getDFDFlags(),{transcoderFormat:w,engineFormat:M,engineType:_}=u(h,p,C,S);if(!p||!C||!y)throw l(),new Error("THREE.KTX2Loader: Invalid texture");if(!g.startTranscoding())throw l(),new Error("THREE.KTX2Loader: .startTranscoding failed");const k=[],D=[];for(let L=0;L<v;L++){const V=[];for(let W=0;W<y;W++){const j=[];let J,Z;for(let ie=0;ie<m;ie++){const re=g.getImageLevelInfo(W,ie,L);L===0&&W===0&&ie===0&&(re.origWidth%4!==0||re.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),y>1?(J=re.origWidth,Z=re.origHeight):(J=re.width,Z=re.height);let ee=new Uint8Array(g.getImageTranscodedSizeInBytes(W,ie,0,w));const le=g.transcodeImage(ee,W,ie,L,w,0,-1,-1);if(_===i.HalfFloatType&&(ee=new Uint16Array(ee.buffer,ee.byteOffset,ee.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!le)throw l(),new Error("THREE.KTX2Loader: .transcodeImage failed.");j.push(ee)}const Ae=d(j);V.push({data:Ae,width:J,height:Z}),D.push(Ae.buffer)}k.push({mipmaps:V,width:p,height:C,format:M,type:_})}return l(),{faces:k,buffers:D,width:p,height:C,hasAlpha:S,dfdFlags:U,format:M,type:_}}const a=[{if:"astcSupported",basisFormat:[o.UASTC],transcoderFormat:[s.ASTC_4x4,s.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:[s.BC7_M5,s.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:[s.BC1,s.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:[s.ETC1,s.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:[s.ETC1],engineFormat:[r.RGB_ETC1_Format],engineType:[i.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[s.PVRTC1_4_RGB,s.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:[s.BC6H],engineFormat:[r.RGB_BPTC_UNSIGNED_Format],engineType:[i.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[s.RGBA32,s.RGBA32],engineFormat:[r.RGBAFormat,r.RGBAFormat],engineType:[i.UnsignedByteType,i.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[o.UASTC_HDR],transcoderFormat:[s.RGBA_HALF],engineFormat:[r.RGBAFormat],engineType:[i.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],f={[o.ETC1S]:a.filter(E=>E.basisFormat.includes(o.ETC1S)).sort((E,g)=>E.priorityETC1S-g.priorityETC1S),[o.UASTC]:a.filter(E=>E.basisFormat.includes(o.UASTC)).sort((E,g)=>E.priorityUASTC-g.priorityUASTC),[o.UASTC_HDR]:a.filter(E=>E.basisFormat.includes(o.UASTC_HDR)).sort((E,g)=>E.priorityHDR-g.priorityHDR)};function u(E,g,l,h){const p=f[E];for(let C=0;C<p.length;C++){const m=p[C];if(m.if&&!n[m.if]||!m.basisFormat.includes(E)||h&&m.transcoderFormat.length<2||m.needsPowerOfTwo&&!(b(g)&&b(l)))continue;const y=m.transcoderFormat[h?1:0],v=m.engineFormat[h?1:0],S=m.engineType[0];return{transcoderFormat:y,engineFormat:v,engineType:S}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function b(E){return E<=2?!0:(E&E-1)===0&&E!==0}function d(E){if(E.length===1)return E[0];let g=0;for(let p=0;p<E.length;p++){const C=E[p];g+=C.byteLength}const l=new Uint8Array(g);let h=0;for(let p=0;p<E.length;p++){const C=E[p];l.set(C,h),h+=C.byteLength}return l}};const uo=new Set([I.RGBAFormat,I.RGBFormat,I.RGFormat,I.RedFormat]),Gt={[ei]:I.RGBAFormat,[$n]:I.RGFormat,[Zn]:I.RedFormat,[Xn]:I.RGBAFormat,[Jn]:I.RGFormat,[Wn]:I.RedFormat,[Yn]:I.RGBAFormat,[Vn]:I.RGBAFormat,[zn]:I.RGFormat,[Kn]:I.RGFormat,[qn]:I.RedFormat,[jn]:I.RedFormat,[ni]:I.RGBFormat,[ti]:I.RGBFormat,[gi]:I.RGBA_ETC2_EAC_Format,[pi]:I.RGB_ETC2_Format,[Wt]:I.R11_EAC_Format,[oo]:I.SIGNED_R11_EAC_Format,[Jt]:I.RG11_EAC_Format,[so]:I.SIGNED_RG11_EAC_Format,[nn]:I.RGBA_ASTC_4x4_Format,[Ii]:I.RGBA_ASTC_4x4_Format,[Ei]:I.RGBA_ASTC_4x4_Format,[Ri]:I.RGBA_ASTC_6x6_Format,[bi]:I.RGBA_ASTC_6x6_Format,[mi]:I.RGBA_ASTC_6x6_Format,[si]:I.RGBA_S3TC_DXT1_Format,[oi]:I.RGBA_S3TC_DXT1_Format,[ri]:I.RGB_S3TC_DXT1_Format,[ii]:I.RGB_S3TC_DXT1_Format,[Ai]:I.RGBA_S3TC_DXT3_Format,[ai]:I.RGBA_S3TC_DXT3_Format,[li]:I.SIGNED_RED_RGTC1_Format,[ci]:I.RED_RGTC1_Format,[hi]:I.SIGNED_RED_GREEN_RGTC2_Format,[ui]:I.RED_GREEN_RGTC2_Format,[di]:I.RGBA_BPTC_Format,[fi]:I.RGBA_BPTC_Format,[Ti]:I.RGBA_PVRTC_4BPPV1_Format,[Bi]:I.RGBA_PVRTC_4BPPV1_Format,[yi]:I.RGBA_PVRTC_2BPPV1_Format,[Ci]:I.RGBA_PVRTC_2BPPV1_Format},At={[ei]:I.FloatType,[$n]:I.FloatType,[Zn]:I.FloatType,[Xn]:I.HalfFloatType,[Jn]:I.HalfFloatType,[Wn]:I.HalfFloatType,[Yn]:I.UnsignedByteType,[Vn]:I.UnsignedByteType,[zn]:I.UnsignedByteType,[Kn]:I.UnsignedByteType,[qn]:I.UnsignedByteType,[jn]:I.UnsignedByteType,[ni]:I.UnsignedInt5999Type,[ti]:I.UnsignedInt101111Type,[gi]:I.UnsignedByteType,[pi]:I.UnsignedByteType,[Wt]:I.UnsignedByteType,[Wt]:I.UnsignedByteType,[Jt]:I.UnsignedByteType,[Jt]:I.UnsignedByteType,[nn]:I.HalfFloatType,[Ii]:I.UnsignedByteType,[Ei]:I.UnsignedByteType,[Ri]:I.HalfFloatType,[bi]:I.UnsignedByteType,[mi]:I.UnsignedByteType,[si]:I.UnsignedByteType,[oi]:I.UnsignedByteType,[ri]:I.UnsignedByteType,[ii]:I.UnsignedByteType,[Ai]:I.UnsignedByteType,[ai]:I.UnsignedByteType,[li]:I.UnsignedByteType,[ci]:I.UnsignedByteType,[hi]:I.UnsignedByteType,[ui]:I.UnsignedByteType,[di]:I.UnsignedByteType,[fi]:I.UnsignedByteType,[Ti]:I.UnsignedByteType,[Bi]:I.UnsignedByteType,[yi]:I.UnsignedByteType,[Ci]:I.UnsignedByteType};async function ho(n){const{vkFormat:e}=n;if(Gt[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat: "+e);At[e]===void 0&&console.warn('THREE.KTX2Loader: Missing ".type" for vkFormat: '+e);let t;n.supercompressionScheme===Bn&&(Pt||(Pt=new Promise(async o=>{const c=new Ao;await c.init(),o(c)})),t=await Pt);const r=[];for(let o=0;o<n.levels.length;o++){const c=Math.max(1,n.pixelWidth>>o),A=Math.max(1,n.pixelHeight>>o),a=n.pixelDepth?Math.max(1,n.pixelDepth>>o):0,f=n.levels[o];let u;if(n.supercompressionScheme===$r)u=f.levelData;else if(n.supercompressionScheme===Bn)u=t.decode(f.levelData,f.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let b;At[e]===I.FloatType?b=new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):At[e]===I.HalfFloatType?b=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):At[e]===I.UnsignedInt5999Type||At[e]===I.UnsignedInt101111Type?b=new Uint32Array(u.buffer,u.byteOffset,u.byteLength/Uint32Array.BYTES_PER_ELEMENT):b=u,r.push({data:b,width:c,height:A,depth:a})}const i=n.levelCount===0||r.length>1;let s;if(uo.has(Gt[e]))s=n.pixelDepth===0?new I.DataTexture(r[0].data,n.pixelWidth,n.pixelHeight):new I.Data3DTexture(r[0].data,n.pixelWidth,n.pixelHeight,n.pixelDepth),s.minFilter=i?I.NearestMipmapNearestFilter:I.NearestFilter,s.magFilter=I.NearestFilter,s.generateMipmaps=n.levelCount===0;else{if(n.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");s=new I.CompressedTexture(r,n.pixelWidth,n.pixelHeight),s.minFilter=i?I.LinearMipmapLinearFilter:I.LinearFilter,s.magFilter=I.LinearFilter}return s.mipmaps=r,s.type=At[e],s.format=Gt[e],s.colorSpace=Qi(n),s.needsUpdate=!0,Promise.resolve(s)}function Qi(n){const e=n.dataFormatDescriptor[0];return e.colorPrimaries===no?e.transferFunction===yn?I.SRGBColorSpace:I.LinearSRGBColorSpace:e.colorPrimaries===io?e.transferFunction===yn?co:lo:(e.colorPrimaries===to||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),I.NoColorSpace)}class rn{name;time;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 r of e.tracks){const i=r.getValueSize();let s;r.ValueTypeName==="quaternion"?s=new se.QuaternionLinearInterpolant(r.times,r.values,i):s=new se.LinearInterpolant(r.times,r.values,i),this.interpolants[r.name]=s}}init(e){}addOneselfToPhysics(e){}removeOneselfFromPhysics(e){}prepare3D(e){}cleanup3D(e){}setPause(e){this.isPaused=e}setTime(e){this.time=e}update(e){this.time+=e,this.time>this.duration&&(this.time-=this.duration,this.playCount++);const t={};for(const[r,i]of Object.entries(this.interpolants)){const[s,o]=r.split(".");let c=t[s];c||(c={},t[s]=c);const A=i.evaluate(this.time);if(o==="position")c.loc=new Ie(A[0],A[1],A[2]);else if(o==="quaternion")c.quat=new we(A[0],A[1],A[2],A[3]);else if(o==="scale")c.scale=new Ie(A[0],A[1],A[2]);else if(o==="morphTargetInfluences"){c.morphs||(c.morphs=[]);const a=Array.from(A);c.morphs.push({name:s,vals:a})}else console.warn(`ClipPoseMotion: update. unknown property(${o})`)}return t}}var wi=(function(){var n="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]),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(t)?c(e):c(n),s,o=WebAssembly.instantiate(i,{}).then(function(h){s=h.instance,s.exports.__wasm_call_ctors()});function c(h){for(var p=new Uint8Array(h.length),C=0;C<h.length;++C){var m=h.charCodeAt(C);p[C]=m>96?m-97:m>64?m-39:m+4}for(var y=0,C=0;C<h.length;++C)p[y++]=p[C]<60?r[p[C]]:(p[C]-60)*64+p[++C];return p.buffer.slice(0,y)}function A(h,p,C,m,y,v,S){var U=h.exports.sbrk,w=m+3&-4,M=U(w*y),_=U(v.length),k=new Uint8Array(h.exports.memory.buffer);k.set(v,_);var D=p(M,m,y,_,v.length);if(D==0&&S&&S(M,w,y),C.set(k.subarray(M,M+m*y)),U(M-U(0)),D!=0)throw new Error("Malformed buffer data: "+D)}var a={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],b=0;function d(h){var p={object:new Worker(h),pending:0,requests:{}};return p.object.onmessage=function(C){var m=C.data;p.pending-=m.count,p.requests[m.id][m.action](m.value),delete p.requests[m.id]},p}function E(h){for(var p="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(i)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+l.name+";"+A.toString()+l.toString(),C=new Blob([p],{type:"text/javascript"}),m=URL.createObjectURL(C),y=u.length;y<h;++y)u[y]=d(m);for(var y=h;y<u.length;++y)u[y].object.postMessage({});u.length=h,URL.revokeObjectURL(m)}function g(h,p,C,m,y){for(var v=u[0],S=1;S<u.length;++S)u[S].pending<v.pending&&(v=u[S]);return new Promise(function(U,w){var M=new Uint8Array(C),_=++b;v.pending+=h,v.requests[_]={resolve:U,reject:w},v.object.postMessage({id:_,count:h,size:p,source:M,mode:m,filter:y},[M.buffer])})}function l(h){var p=h.data;if(!p.id)return self.close();self.ready.then(function(C){try{var m=new Uint8Array(p.count*p.size);A(C,C.exports[p.mode],m,p.count,p.size,p.source,C.exports[p.filter]),self.postMessage({id:p.id,count:p.count,action:"resolve",value:m},[m.buffer])}catch(y){self.postMessage({id:p.id,count:p.count,action:"reject",value:y})}})}return{ready:o,supported:!0,useWorkers:function(h){E(h)},decodeVertexBuffer:function(h,p,C,m,y){A(s,s.exports.meshopt_decodeVertexBuffer,h,p,C,m,s.exports[a[y]])},decodeIndexBuffer:function(h,p,C,m){A(s,s.exports.meshopt_decodeIndexBuffer,h,p,C,m)},decodeIndexSequence:function(h,p,C,m){A(s,s.exports.meshopt_decodeIndexSequence,h,p,C,m)},decodeGltfBuffer:function(h,p,C,m,y,v){A(s,s.exports[f[y]],h,p,C,m,s.exports[a[v]])},decodeGltfBufferAsync:function(h,p,C,m,y){return u.length>0?g(h,p,C,f[m],a[y]):o.then(function(){var v=new Uint8Array(h*p);return A(s,s.exports[f[m]],v,h,p,C,s.exports[a[y]]),v})}}})();function fo(n){return"morphTargetDictionary"in n&&n.morphTargetDictionary!==void 0&&"morphTargetInfluences"in n&&Array.isArray(n.morphTargetInfluences)}const po={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 vi(n={}){const e={...po,...n};let t=new Gn;const r=new Jr;if(r.setDecoderPath(e.draco),t.setDRACOLoader(r),e.renderer){const i=new We;i.setTranscoderPath(e.ktx2),i.detectSupport(e.renderer),t.setKTX2Loader(i)}e.meshopt&&t.setMeshoptDecoder(wi),on=t}let on=new Gn;on.setMeshoptDecoder(wi);class go extends Me{ready;gltf;constructor(e){super(),this.ready=this.asyncInit(e)}initObject(){return new se.Object3D}async asyncInit(e){if(kn(e)){console.log(`File: ${e}`),this.gltf=await on.loadAsync(e),this.bones={},this.skeletons=[],this.morphs={},this.gltf.scene.traverse(r=>{if(r.userData.a3js={objectA3:this},fo(r)){const{morphTargetDictionary:i,morphTargetInfluences:s}=r;Object.keys(i).forEach(o=>{const c=r.name+"."+o,A=i[o];this.morphs[c]={array:s,idx:A},console.log(`morphName="${c}"`)})}r instanceof se.Bone&&(this.bones[r.name]=r),r instanceof se.SkinnedMesh&&this.skeletons.push(r.skeleton)});const t={};this.gltf.animations.forEach(r=>{t[r.name]=new rn(r),console.log(`anim.name="${r.name}"`)}),this.setPoseMotions(t),this.object.add(this.gltf.scene)}else{const t=new se.BoxGeometry,r=new se.MeshStandardMaterial({color:16711680}),i=new se.Mesh(t,r);this.object.add(i)}return this}}class ki extends HTMLElement{ro;base;renderer;css2DRenderer;scene;camera;controller;camera3js;clock;_canvas;_css2DCanvas;constructor(e){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
2
4
|
<style>
|
|
3
5
|
:host {
|
|
4
6
|
width: 100%;
|
|
@@ -21,7 +23,7 @@
|
|
|
21
23
|
}
|
|
22
24
|
</style>
|
|
23
25
|
<slot></slog>
|
|
24
|
-
`,e||(e={}),e.camera||(e.camera=new se.PerspectiveCamera(75,300/150,.1,1e3)),this.camera3js=e.camera;const t=new
|
|
26
|
+
`,e||(e={}),e.camera||(e.camera=new se.PerspectiveCamera(75,300/150,.1,1e3)),this.camera3js=e.camera;const t=new gt(e.camera);this.base=new Fn(t),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.clock=new se.Clock;const r={antialias:e.antialias?e.antialias:!1,alpha:e.transparent?e.transparent:!1};this.renderer=new se.WebGLRenderer(r),vi({renderer:this.renderer}),this.renderer.setSize(600,300),"opaque"in e&&this.renderer.setClearAlpha(0),this._canvas=this.renderer.domElement,this._canvas.width=600,this._canvas.height=300,this.appendChild(this._canvas),this.css2DRenderer=new Pn,this._css2DCanvas=this.css2DRenderer.domElement,this._css2DCanvas.style.position="absolute",this._css2DCanvas.style.top="0px",this.appendChild(this._css2DCanvas),this.animationFrameId=requestAnimationFrame(this.renderingLoop),this._css2DCanvas.addEventListener("click",this.myMouseClickedListener),window.addEventListener("keydown",i=>{this.controller?.keyDown(i)}),window.addEventListener("keyup",i=>{this.controller?.keyUp(i)}),window.addEventListener("keypress",i=>{this.controller?.keyPress(i)}),this._css2DCanvas.addEventListener("mousedown",i=>{this.controller?.mouseDown(i)}),this._css2DCanvas.addEventListener("mouseup",i=>{this.controller?.mouseUp(i)}),this._css2DCanvas.addEventListener("mousemove",i=>{this.controller?.mouseMove(i)}),this._css2DCanvas.addEventListener("click",i=>{this.controller?.mouseClick(i)}),this._css2DCanvas.addEventListener("mouseenter",i=>{this.controller?.mouseEnter(i)}),this._css2DCanvas.addEventListener("mouseleave",i=>{this.controller?.mouseLeave(i)}),this._css2DCanvas.addEventListener("wheel",i=>{this.controller?.mouseWheel(i)}),this._css2DCanvas.addEventListener("touchstart",i=>{this.controller?.touchStart(i)}),this._css2DCanvas.addEventListener("touchmove",i=>{this.controller?.touchMove(i)}),this._css2DCanvas.addEventListener("touchend",i=>{this.controller?.touchEnd(i)}),this._css2DCanvas.addEventListener("touchcancel",i=>{this.controller?.touchCancel(i)})}connectedCallback(){this.ro=new ResizeObserver(()=>{const e=window.devicePixelRatio||1,t=Math.floor(this.clientWidth*e),r=Math.floor(this.clientHeight*e);(this._canvas.width!==t||this._canvas.height!==r)&&(this._canvas.width=t,this._canvas.height=r,Eo(this.camera3js)&&(this.camera3js.aspect=t/r,this.camera3js.updateProjectionMatrix()),this.renderer.setSize(t,r),this.css2DRenderer.setSize(t,r))}),this.ro.observe(this)}disconnectedCallback(){this.ro?.disconnect()}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);const e=this.clock.getDelta();this.base.updateScene(e),this.renderer.render(this.scene.scene,this.camera3js),this.css2DRenderer.render(this.scene.scene,this.camera3js)};worldToScreen(e){const t=new se.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const r=new se.Vector2;this.renderer.getSize(r);const i=(t.x+1)/2*r.x,s=(1-t.y)/2*r.y;return{x:i,y:s}}screenToWorld(e,t,r){const i=new se.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);i.unproject(this.camera3js);const s=i.sub(this.camera3js.position).normalize();return new Ie(this.camera3js.position.clone().add(s.multiplyScalar(r)))}cameraToScreen(e){const r=new se.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return it.v0.set(r),this.worldToScreen(it.v0)}screenToCamera(e,t,r){const i=this.screenToWorld(e,t,r),s=new se.Vector3(i.x,i.y,i.z);return i.set(s.applyMatrix4(this.camera3js.matrixWorldInverse)),i}myMouseClickedListener=async e=>{if(this.camera instanceof gt){const t=new se.Raycaster,r=new se.Vector2,i=e.target.getBoundingClientRect(),s=e.clientX-i.left,o=e.clientY-i.top;r.x=2*(s/i.width)-1,r.y=-2*(o/i.height)+1,t.setFromCamera(r,this.camera.camera);const c=t.intersectObjects(this.scene.scene.children),A=[];c.forEach(a=>{const f=a.object.userData.a3js?.objectA3;A.push({three:a.object,a3js:f})}),A.length>0&&await A[0].a3js.clicked(),this.dispatchEvent(new CustomEvent("click3d",{detail:{value:A}}))}};alert(e,t){return new Promise(r=>{const i=document.createElement("div");i.style.cssText="position: absolute; top: 0px; width: 100%; height: 100%; display: flex; flex-direction: column;";const s=document.createElement("p");s.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",s.textContent=e,i.appendChild(s);const o=document.createElement("button");o.textContent="OK!",i.appendChild(o),this.appendChild(i),o.addEventListener("click",async()=>{t&&await t(),this.removeChild(i),r()})})}}customElements.define("canvas-a3",ki);function Eo(n){return n.isPerspectiveCamera===!0}class Si 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;base;renderer;css2DRenderer;scene;camera;controller;camera3js;clock;constructor(e=600,t=300){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`
|
|
25
27
|
<style>
|
|
26
28
|
:host {
|
|
27
29
|
position: absolute;
|
|
@@ -66,7 +68,7 @@
|
|
|
66
68
|
<div class="content">
|
|
67
69
|
<slot></slot>
|
|
68
70
|
</div>
|
|
69
|
-
`,this.camera3js=new se.PerspectiveCamera(75,e/t,.1,1e3),this.camera3js.aspect=e/t;const
|
|
71
|
+
`,this.camera3js=new se.PerspectiveCamera(75,e/t,.1,1e3),this.camera3js.aspect=e/t;const r=new gt(this.camera3js);this.base=new Fn(r),this.scene=this.base.scene,this.camera=this.base.camera,this.controller=this.base.controller,this.clock=new se.Clock,this.renderer=new se.WebGLRenderer,vi({renderer:this.renderer}),this.renderer.setSize(e,t),this._canvas=this.renderer.domElement,this._canvas.width=e,this._canvas.width=t,this.appendChild(this._canvas),this.css2DRenderer=new Pn,this.css2DRenderer.setSize(e,t),this._css2DCanvas=this.css2DRenderer.domElement,this._css2DCanvas.style.position="absolute",this._css2DCanvas.style.top="28px",this.appendChild(this._css2DCanvas),this._css2DCanvas.addEventListener("click",this.myMouseClickedListener),window.addEventListener("keydown",i=>{this.controller?.keyDown(i)}),window.addEventListener("keyup",i=>{this.controller?.keyUp(i)}),window.addEventListener("keypress",i=>{this.controller?.keyPress(i)}),this._css2DCanvas.addEventListener("mousedown",i=>{this.controller?.mouseDown(i)}),this._css2DCanvas.addEventListener("mouseup",i=>{this.controller?.mouseUp(i)}),this._css2DCanvas.addEventListener("mousemove",i=>{this.controller?.mouseMove(i)}),this._css2DCanvas.addEventListener("click",i=>{this.controller?.mouseClick(i)}),this._css2DCanvas.addEventListener("mouseenter",i=>{this.controller?.mouseEnter(i)}),this._css2DCanvas.addEventListener("mouseleave",i=>{this.controller?.mouseLeave(i)}),this._css2DCanvas.addEventListener("wheel",i=>{this.controller?.mouseWheel(i)}),this._css2DCanvas.addEventListener("touchstart",i=>{this.controller?.touchStart(i)}),this._css2DCanvas.addEventListener("touchmove",i=>{this.controller?.touchMove(i)}),this._css2DCanvas.addEventListener("touchend",i=>{this.controller?.touchEnd(i)}),this._css2DCanvas.addEventListener("touchcancel",i=>{this.controller?.touchCancel(i)}),document.body?document.body.appendChild(this):document.addEventListener("DOMContentLoaded",()=>{document.body.append(this)},{once:!0}),this.animationFrameId=requestAnimationFrame(this.renderingLoop)}_resizeCanvasToContent(){const e=this.shadowRoot.querySelector(".content");let t=e.clientWidth,r=e.clientHeight;const i=window.devicePixelRatio||1,s=Math.floor(t*i),o=Math.floor(r*i);(this._canvas.width!==s||this._canvas.height!==o)&&(this._canvas.width=s,this._canvas.height=o,this.camera3js.aspect=s/o,this.camera3js.updateProjectionMatrix(),this.renderer.setSize(s,o),this.css2DRenderer.setSize(s,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()}_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(),r=e.clientX-t.left,i=e.clientY-t.top,s=this._borderSize;let o="";i<s?o+="n":i>t.height-s&&(o+="s"),r<s?o+="w":r>t.width-s&&(o+="e"),this._resizeDir=o,this.style.cursor=this._cursorFromDir(o)};_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,r=e.clientY-this._startMouseY;this._resizeDir.includes("e")&&(this.style.width=`${this._startWidth+t}px`),this._resizeDir.includes("s")&&(this.style.height=`${this._startHeight+r}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-r}px`,this.style.top=`${this._startTop+r}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);const e=this.clock.getDelta();this.base.updateScene(e),this.renderer.render(this.scene.scene,this.camera3js),this.css2DRenderer.render(this.scene.scene,this.camera3js)};worldToScreen(e){const t=new se.Vector3(e.x,e.y,e.z);t.project(this.camera3js);const r=new se.Vector2;this.renderer.getSize(r);const i=(t.x+1)/2*r.x,s=(1-t.y)/2*r.y;return{x:i,y:s}}screenToWorld(e,t,r){const i=new se.Vector3(e/this._canvas.clientWidth*2-1,-(t/this._canvas.clientHeight)*2+1,.5);i.unproject(this.camera3js);const s=i.sub(this.camera3js.position).normalize();return new Ie(this.camera3js.position.clone().add(s.multiplyScalar(r)))}cameraToScreen(e){const r=new se.Vector3(e.x,e.y,e.z).applyMatrix4(this.camera3js.matrixWorld);return it.v0.set(r),this.worldToScreen(it.v0)}screenToCamera(e,t,r){const i=this.screenToWorld(e,t,r),s=new se.Vector3(i.x,i.y,i.z);return i.set(s.applyMatrix4(this.camera3js.matrixWorldInverse)),i}myMouseClickedListener=async e=>{if(this.camera instanceof gt){const t=new se.Raycaster,r=new se.Vector2,i=e.target.getBoundingClientRect(),s=e.clientX-i.left,o=e.clientY-i.top;r.x=2*(s/i.width)-1,r.y=-2*(o/i.height)+1,t.setFromCamera(r,this.camera.camera);const c=t.intersectObjects(this.scene.scene.children),A=[];c.forEach(a=>{const f=a.object.userData.a3js?.objectA3;A.push({three:a.object,a3js:f})}),A.length>0&&await A[0].a3js.clicked(),this.dispatchEvent(new CustomEvent("click3d",{detail:{value:A}}))}};alert(e,t){return new Promise(r=>{const i=document.createElement("div");i.style.cssText="position: absolute; top: 28px; width: 100%; height: 100%; display: flex; flex-direction: column;";const s=document.createElement("p");s.style.cssText="width: 80%; margin: 0 auto; color: red; text-align: center; border: 3px solid red;",s.textContent=e,i.appendChild(s);const o=document.createElement("button");o.textContent="OK!",i.appendChild(o),this.appendChild(i),o.addEventListener("click",async()=>{t&&await t(),this.removeChild(i),r()})})}}customElements.define("window-a3",Si);const Io=`
|
|
70
72
|
color: white;
|
|
71
73
|
padding: 5px 10px;
|
|
72
74
|
background: rgba(0, 0, 0, 0.6);
|
|
@@ -75,117 +77,116 @@
|
|
|
75
77
|
font-family: sans-serif;
|
|
76
78
|
font-size: 14px;
|
|
77
79
|
pointer-events: none; /* マウスイベントを透過させて背後の操作を邪魔しない */
|
|
78
|
-
`,
|
|
79
|
-
`)c=0,s-=o;else{const g=pr(h,a,c,s,t);i=="tb"?(c=0,s+=t.ascender*a):c+=g.offsetX,u.push(g.path)}}return u}function pr(n,e,t,i,r){const a=r.glyphs[n]||r.glyphs["?"];if(!a){console.error('THREE.Font: character "'+n+'" does not exists in font family '+r.familyName+".");return}const o=new R.ShapePath;let u,c,s,f,h,g,p,T;if(a.o){const m=a._cachedOutline||(a._cachedOutline=a.o.split(" "));for(let l=0,d=m.length;l<d;)switch(m[l++]){case"m":u=m[l++]*e+t,c=m[l++]*e+i,o.moveTo(u,c);break;case"l":u=m[l++]*e+t,c=m[l++]*e+i,o.lineTo(u,c);break;case"q":s=m[l++]*e+t,f=m[l++]*e+i,h=m[l++]*e+t,g=m[l++]*e+i,o.quadraticCurveTo(h,g,s,f);break;case"b":s=m[l++]*e+t,f=m[l++]*e+i,h=m[l++]*e+t,g=m[l++]*e+i,p=m[l++]*e+t,T=m[l++]*e+i,o.bezierCurveTo(h,g,p,T,s,f);break}}return{offsetX:a.ha*e,path:o}}class mr extends R.ExtrudeGeometry{constructor(e,t={}){const i=t.font;if(i===void 0)super();else{const r=i.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 yr(n){if(n.match(/.zip$/i)){let e=n.substring(n.lastIndexOf("/"));e=e.substring(0,e.length-4);const t=await ln(n),i=Pt(t,e);mt=new pn(JSON.parse(i))}else mt=await new fr().loadAsync(n)}class gr extends je{initObject(e){let t;if(en(e)?t=e:t="ERROR",mt==null){const i=new se.BoxGeometry,r=new se.MeshStandardMaterial({color:16711680});return new se.Mesh(i,r)}else{const i={font:mt,size:1,depth:.5,curveSegments:12},r=new mr(t,i);r.center();const a=new se.MeshStandardMaterial({color:65280});return new se.Mesh(r,a)}}}function Xt(n,e){if(e===R.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===R.TriangleFanDrawMode||e===R.TriangleStripDrawMode){let t=n.getIndex();if(t===null){const o=[],u=n.getAttribute("position");if(u!==void 0){for(let c=0;c<u.count;c++)o.push(c);n.setIndex(o),t=n.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const i=t.count-2,r=[];if(e===R.TriangleFanDrawMode)for(let o=1;o<=i;o++)r.push(t.getX(0)),r.push(t.getX(o)),r.push(t.getX(o+1));else for(let o=0;o<i;o++)o%2===0?(r.push(t.getX(o)),r.push(t.getX(o+1)),r.push(t.getX(o+2))):(r.push(t.getX(o+2)),r.push(t.getX(o+1)),r.push(t.getX(o)));r.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=n.clone();return a.setIndex(r),a.clearGroups(),a}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),n}class Tr extends R.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new _r(t)}),this.register(function(t){return new br(t)}),this.register(function(t){return new Cr(t)}),this.register(function(t){return new Mr(t)}),this.register(function(t){return new Pr(t)}),this.register(function(t){return new Sr(t)}),this.register(function(t){return new Or(t)}),this.register(function(t){return new xr(t)}),this.register(function(t){return new Ir(t)}),this.register(function(t){return new Ar(t)}),this.register(function(t){return new Nr(t)}),this.register(function(t){return new Lr(t)}),this.register(function(t){return new kr(t)}),this.register(function(t){return new wr(t)}),this.register(function(t){return new vr(t)}),this.register(function(t){return new Dr(t)}),this.register(function(t){return new Fr(t)})}load(e,t,i,r){const a=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const s=R.LoaderUtils.extractUrlBase(e);o=R.LoaderUtils.resolveURL(s,this.path)}else o=R.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const u=function(s){r?r(s):console.error(s),a.manager.itemError(e),a.manager.itemEnd(e)},c=new R.FileLoader(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(e,function(s){try{a.parse(s,o,function(f){t(f),a.manager.itemEnd(e)},u)}catch(f){u(f)}},i,u)}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,i,r){let a;const o={},u={},c=new TextDecoder;if(typeof e=="string")a=JSON.parse(e);else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===mn){try{o[_e.KHR_BINARY_GLTF]=new Ur(e)}catch(h){r&&r(h);return}a=JSON.parse(o[_e.KHR_BINARY_GLTF].content)}else a=JSON.parse(c.decode(e));else a=e;if(a.asset===void 0||a.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const s=new Zr(a,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});s.fileLoader.setRequestHeader(this.requestHeader);for(let f=0;f<this.pluginCallbacks.length;f++){const h=this.pluginCallbacks[f](s);h.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),u[h.name]=h,o[h.name]=!0}if(a.extensionsUsed)for(let f=0;f<a.extensionsUsed.length;++f){const h=a.extensionsUsed[f],g=a.extensionsRequired||[];switch(h){case _e.KHR_MATERIALS_UNLIT:o[h]=new Rr;break;case _e.KHR_DRACO_MESH_COMPRESSION:o[h]=new jr(a,this.dracoLoader);break;case _e.KHR_TEXTURE_TRANSFORM:o[h]=new Br;break;case _e.KHR_MESH_QUANTIZATION:o[h]=new Gr;break;default:g.indexOf(h)>=0&&u[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}s.setExtensions(o),s.setPlugins(u),s.parse(i,r)}parseAsync(e,t){const i=this;return new Promise(function(r,a){i.parse(e,t,r,a)})}}function Er(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const _e={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class vr{constructor(e){this.parser=e,this.name=_e.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i<r;i++){const a=t[i];a.extensions&&a.extensions[this.name]&&a.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,a.extensions[this.name].light)}}_loadLight(e){const t=this.parser,i="light:"+e;let r=t.cache.get(i);if(r)return r;const a=t.json,c=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e];let s;const f=new R.Color(16777215);c.color!==void 0&&f.setRGB(c.color[0],c.color[1],c.color[2],R.LinearSRGBColorSpace);const h=c.range!==void 0?c.range:0;switch(c.type){case"directional":s=new R.DirectionalLight(f),s.target.position.set(0,0,-1),s.add(s.target);break;case"point":s=new R.PointLight(f),s.distance=h;break;case"spot":s=new R.SpotLight(f),s.distance=h,c.spot=c.spot||{},c.spot.innerConeAngle=c.spot.innerConeAngle!==void 0?c.spot.innerConeAngle:0,c.spot.outerConeAngle=c.spot.outerConeAngle!==void 0?c.spot.outerConeAngle:Math.PI/4,s.angle=c.spot.outerConeAngle,s.penumbra=1-c.spot.innerConeAngle/c.spot.outerConeAngle,s.target.position.set(0,0,-1),s.add(s.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+c.type)}return s.position.set(0,0,0),qe(s,c),c.intensity!==void 0&&(s.intensity=c.intensity),s.name=t.createUniqueName(c.name||"light_"+e),r=Promise.resolve(s),t.cache.add(i,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,i=this.parser,a=i.json.nodes[e],u=(a.extensions&&a.extensions[this.name]||{}).light;return u===void 0?null:this._loadLight(u).then(function(c){return i._getNodeRef(t.cache,u,c)})}}class Rr{constructor(){this.name=_e.KHR_MATERIALS_UNLIT}getMaterialType(){return R.MeshBasicMaterial}extendParams(e,t,i){const r=[];e.color=new R.Color(1,1,1),e.opacity=1;const a=t.pbrMetallicRoughness;if(a){if(Array.isArray(a.baseColorFactor)){const o=a.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],R.LinearSRGBColorSpace),e.opacity=o[3]}a.baseColorTexture!==void 0&&r.push(i.assignTexture(e,"map",a.baseColorTexture,R.SRGBColorSpace))}return Promise.all(r)}}class Ar{constructor(e){this.parser=e,this.name=_e.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 a=r.extensions[this.name].emissiveStrength;return a!==void 0&&(t.emissiveIntensity=a),Promise.resolve()}}class _r{constructor(e){this.parser=e,this.name=_e.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:R.MeshPhysicalMaterial}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],o=r.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&a.push(i.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&a.push(i.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(a.push(i.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const u=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new R.Vector2(u,u)}return Promise.all(a)}}class br{constructor(e){this.parser=e,this.name=_e.KHR_MATERIALS_DISPERSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:R.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=r.extensions[this.name];return t.dispersion=a.dispersion!==void 0?a.dispersion:0,Promise.resolve()}}class Lr{constructor(e){this.parser=e,this.name=_e.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:R.MeshPhysicalMaterial}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],o=r.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&a.push(i.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&a.push(i.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(a)}}class Sr{constructor(e){this.parser=e,this.name=_e.KHR_MATERIALS_SHEEN}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:R.MeshPhysicalMaterial}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[];t.sheenColor=new R.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=r.extensions[this.name];if(o.sheenColorFactor!==void 0){const u=o.sheenColorFactor;t.sheenColor.setRGB(u[0],u[1],u[2],R.LinearSRGBColorSpace)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&a.push(i.assignTexture(t,"sheenColorMap",o.sheenColorTexture,R.SRGBColorSpace)),o.sheenRoughnessTexture!==void 0&&a.push(i.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(a)}}class Or{constructor(e){this.parser=e,this.name=_e.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:R.MeshPhysicalMaterial}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],o=r.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&a.push(i.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(a)}}class xr{constructor(e){this.parser=e,this.name=_e.KHR_MATERIALS_VOLUME}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:R.MeshPhysicalMaterial}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],o=r.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&a.push(i.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const u=o.attenuationColor||[1,1,1];return t.attenuationColor=new R.Color().setRGB(u[0],u[1],u[2],R.LinearSRGBColorSpace),Promise.all(a)}}class Ir{constructor(e){this.parser=e,this.name=_e.KHR_MATERIALS_IOR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:R.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=r.extensions[this.name];return t.ior=a.ior!==void 0?a.ior:1.5,Promise.resolve()}}class Nr{constructor(e){this.parser=e,this.name=_e.KHR_MATERIALS_SPECULAR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:R.MeshPhysicalMaterial}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],o=r.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&a.push(i.assignTexture(t,"specularIntensityMap",o.specularTexture));const u=o.specularColorFactor||[1,1,1];return t.specularColor=new R.Color().setRGB(u[0],u[1],u[2],R.LinearSRGBColorSpace),o.specularColorTexture!==void 0&&a.push(i.assignTexture(t,"specularColorMap",o.specularColorTexture,R.SRGBColorSpace)),Promise.all(a)}}class wr{constructor(e){this.parser=e,this.name=_e.EXT_MATERIALS_BUMP}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:R.MeshPhysicalMaterial}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],o=r.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&a.push(i.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(a)}}class kr{constructor(e){this.parser=e,this.name=_e.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:R.MeshPhysicalMaterial}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],o=r.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&a.push(i.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(a)}}class Cr{constructor(e){this.parser=e,this.name=_e.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,i=t.json,r=i.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const a=r.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,a.source,o)}}class Mr{constructor(e){this.parser=e,this.name=_e.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,i=this.parser,r=i.json,a=r.textures[e];if(!a.extensions||!a.extensions[t])return null;const o=a.extensions[t],u=r.images[o.source];let c=i.textureLoader;if(u.uri){const s=i.options.manager.getHandler(u.uri);s!==null&&(c=s)}return i.loadTextureImage(e,o.source,c)}}class Pr{constructor(e){this.parser=e,this.name=_e.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,i=this.parser,r=i.json,a=r.textures[e];if(!a.extensions||!a.extensions[t])return null;const o=a.extensions[t],u=r.images[o.source];let c=i.textureLoader;if(u.uri){const s=i.options.manager.getHandler(u.uri);s!==null&&(c=s)}return i.loadTextureImage(e,o.source,c)}}class Dr{constructor(e){this.name=_e.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],a=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.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 a.then(function(u){const c=r.byteOffset||0,s=r.byteLength||0,f=r.count,h=r.byteStride,g=new Uint8Array(u,c,s);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(f,h,g,r.mode,r.filter).then(function(p){return p.buffer}):o.ready.then(function(){const p=new ArrayBuffer(f*h);return o.decodeGltfBuffer(new Uint8Array(p),f,h,g,r.mode,r.filter),p})})}else return null}}class Fr{constructor(e){this.name=_e.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=t.meshes[i.mesh];for(const s of r.primitives)if(s.mode!==Ke.TRIANGLES&&s.mode!==Ke.TRIANGLE_STRIP&&s.mode!==Ke.TRIANGLE_FAN&&s.mode!==void 0)return null;const o=i.extensions[this.name].attributes,u=[],c={};for(const s in o)u.push(this.parser.getDependency("accessor",o[s]).then(f=>(c[s]=f,c[s])));return u.length<1?null:(u.push(this.parser.createNodeMesh(e)),Promise.all(u).then(s=>{const f=s.pop(),h=f.isGroup?f.children:[f],g=s[0].count,p=[];for(const T of h){const m=new R.Matrix4,l=new R.Vector3,d=new R.Quaternion,y=new R.Vector3(1,1,1),v=new R.InstancedMesh(T.geometry,T.material,g);for(let E=0;E<g;E++)c.TRANSLATION&&l.fromBufferAttribute(c.TRANSLATION,E),c.ROTATION&&d.fromBufferAttribute(c.ROTATION,E),c.SCALE&&y.fromBufferAttribute(c.SCALE,E),v.setMatrixAt(E,m.compose(l,d,y));for(const E in c)if(E==="_COLOR_0"){const S=c[E];v.instanceColor=new R.InstancedBufferAttribute(S.array,S.itemSize,S.normalized)}else E!=="TRANSLATION"&&E!=="ROTATION"&&E!=="SCALE"&&T.geometry.setAttribute(E,c[E]);R.Object3D.prototype.copy.call(v,T),this.parser.assignFinalMaterial(v),p.push(v)}return f.isGroup?(f.clear(),f.add(...p),f):p[0]}))}}const mn="glTF",ot=12,qt={JSON:1313821514,BIN:5130562};class Ur{constructor(e){this.name=_e.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,ot),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==mn)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-ot,a=new DataView(e,ot);let o=0;for(;o<r;){const u=a.getUint32(o,!0);o+=4;const c=a.getUint32(o,!0);if(o+=4,c===qt.JSON){const s=new Uint8Array(e,ot+o,u);this.content=i.decode(s)}else if(c===qt.BIN){const s=ot+o;this.body=e.slice(s,s+u)}o+=u}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class jr{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=_e.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const i=this.json,r=this.dracoLoader,a=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,u={},c={},s={};for(const f in o){const h=Nt[f]||f.toLowerCase();u[h]=o[f]}for(const f in e.attributes){const h=Nt[f]||f.toLowerCase();if(o[f]!==void 0){const g=i.accessors[e.attributes[f]],p=it[g.componentType];s[h]=p.name,c[h]=g.normalized===!0}}return t.getDependency("bufferView",a).then(function(f){return new Promise(function(h,g){r.decodeDracoFile(f,function(p){for(const T in p.attributes){const m=p.attributes[T],l=c[T];l!==void 0&&(m.normalized=l)}h(p)},u,s,R.LinearSRGBColorSpace,g)})})}}class Br{constructor(){this.name=_e.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 Gr{constructor(){this.name=_e.KHR_MESH_QUANTIZATION}}class yn extends R.Interpolant{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,a=e*r*3+r;for(let o=0;o!==r;o++)t[o]=i[a+o];return t}interpolate_(e,t,i,r){const a=this.resultBuffer,o=this.sampleValues,u=this.valueSize,c=u*2,s=u*3,f=r-t,h=(i-t)/f,g=h*h,p=g*h,T=e*s,m=T-s,l=-2*p+3*g,d=p-g,y=1-l,v=d-g+h;for(let E=0;E!==u;E++){const S=o[m+E+u],I=o[m+E+c]*f,k=o[T+E+u],H=o[T+E]*f;a[E]=y*S+v*I+l*k+d*H}return a}}const zr=new R.Quaternion;class Vr extends yn{interpolate_(e,t,i,r){const a=super.interpolate_(e,t,i,r);return zr.fromArray(a).normalize().toArray(a),a}}const Ke={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},it={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Qt={9728:R.NearestFilter,9729:R.LinearFilter,9984:R.NearestMipmapNearestFilter,9985:R.LinearMipmapNearestFilter,9986:R.NearestMipmapLinearFilter,9987:R.LinearMipmapLinearFilter},Zt={33071:R.ClampToEdgeWrapping,33648:R.MirroredRepeatWrapping,10497:R.RepeatWrapping},_t={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Nt={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"},Je={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Hr={CUBICSPLINE:void 0,LINEAR:R.InterpolateLinear,STEP:R.InterpolateDiscrete},bt={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Wr(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new R.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:R.FrontSide})),n.DefaultMaterial}function et(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function qe(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function Kr(n,e,t){let i=!1,r=!1,a=!1;for(let s=0,f=e.length;s<f;s++){const h=e[s];if(h.POSITION!==void 0&&(i=!0),h.NORMAL!==void 0&&(r=!0),h.COLOR_0!==void 0&&(a=!0),i&&r&&a)break}if(!i&&!r&&!a)return Promise.resolve(n);const o=[],u=[],c=[];for(let s=0,f=e.length;s<f;s++){const h=e[s];if(i){const g=h.POSITION!==void 0?t.getDependency("accessor",h.POSITION):n.attributes.position;o.push(g)}if(r){const g=h.NORMAL!==void 0?t.getDependency("accessor",h.NORMAL):n.attributes.normal;u.push(g)}if(a){const g=h.COLOR_0!==void 0?t.getDependency("accessor",h.COLOR_0):n.attributes.color;c.push(g)}}return Promise.all([Promise.all(o),Promise.all(u),Promise.all(c)]).then(function(s){const f=s[0],h=s[1],g=s[2];return i&&(n.morphAttributes.position=f),r&&(n.morphAttributes.normal=h),a&&(n.morphAttributes.color=g),n.morphTargetsRelative=!0,n})}function Yr(n,e){if(n.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)n.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(n.morphTargetInfluences.length===t.length){n.morphTargetDictionary={};for(let i=0,r=t.length;i<r;i++)n.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Xr(n){let e;const t=n.extensions&&n.extensions[_e.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Lt(t.attributes):e=n.indices+":"+Lt(n.attributes)+":"+n.mode,n.targets!==void 0)for(let i=0,r=n.targets.length;i<r;i++)e+=":"+Lt(n.targets[i]);return e}function Lt(n){let e="";const t=Object.keys(n).sort();for(let i=0,r=t.length;i<r;i++)e+=t[i]+":"+n[t[i]]+";";return e}function wt(n){switch(n){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 qr(n){return n.search(/\.jpe?g($|\?)/i)>0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":n.search(/\.ktx2($|\?)/i)>0||n.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const Qr=new R.Matrix4;class Zr{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Er,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 i=!1,r=-1,a=!1,o=-1;if(typeof navigator<"u"){const u=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(u)===!0;const c=u.match(/Version\/(\d+)/);r=i&&c?parseInt(c[1],10):-1,a=u.indexOf("Firefox")>-1,o=a?u.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&r<17||a&&o<98?this.textureLoader=new R.TextureLoader(this.options.manager):this.textureLoader=new R.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new R.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 i=this,r=this.json,a=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const u={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};return et(a,u,r),qe(u,r),Promise.all(i._invokeAll(function(c){return c.afterRoot&&c.afterRoot(u)})).then(function(){for(const c of u.scenes)c.updateMatrixWorld();e(u)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,a=t.length;r<a;r++){const o=t[r].joints;for(let u=0,c=o.length;u<c;u++)e[o[u]].isBone=!0}for(let r=0,a=e.length;r<a;r++){const o=e[r];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(i[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.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,i){if(e.refs[t]<=1)return i;const r=i.clone(),a=(o,u)=>{const c=this.associations.get(o);c!=null&&this.associations.set(u,c);for(const[s,f]of o.children.entries())a(f,u.children[s])};return a(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const r=e(t[i]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let r=0;r<t.length;r++){const a=e(t[r]);a&&i.push(a)}return i}getDependency(e,t){const i=e+":"+t;let r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne(function(a){return a.loadNode&&a.loadNode(t)});break;case"mesh":r=this._invokeOne(function(a){return a.loadMesh&&a.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(a){return a.loadBufferView&&a.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(a){return a.loadMaterial&&a.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(a){return a.loadTexture&&a.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(a){return a.loadAnimation&&a.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(a){return a!=this&&a.getDependency&&a.getDependency(e,t)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(i,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(a,o){return i.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=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[_e.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(a,o){i.load(R.LoaderUtils.resolveURL(t.uri,r.path),a,void 0,function(){o(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(i){const r=t.byteLength||0,a=t.byteOffset||0;return i.slice(a,a+r)})}loadAccessor(e){const t=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const o=_t[r.type],u=it[r.componentType],c=r.normalized===!0,s=new u(r.count*o);return Promise.resolve(new R.BufferAttribute(s,o,c))}const a=[];return r.bufferView!==void 0?a.push(this.getDependency("bufferView",r.bufferView)):a.push(null),r.sparse!==void 0&&(a.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),a.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(a).then(function(o){const u=o[0],c=_t[r.type],s=it[r.componentType],f=s.BYTES_PER_ELEMENT,h=f*c,g=r.byteOffset||0,p=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,T=r.normalized===!0;let m,l;if(p&&p!==h){const d=Math.floor(g/p),y="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+d+":"+r.count;let v=t.cache.get(y);v||(m=new s(u,d*p,r.count*p/f),v=new R.InterleavedBuffer(m,p/f),t.cache.add(y,v)),l=new R.InterleavedBufferAttribute(v,c,g%p/f,T)}else u===null?m=new s(r.count*c):m=new s(u,g,r.count*c),l=new R.BufferAttribute(m,c,T);if(r.sparse!==void 0){const d=_t.SCALAR,y=it[r.sparse.indices.componentType],v=r.sparse.indices.byteOffset||0,E=r.sparse.values.byteOffset||0,S=new y(o[1],v,r.sparse.count*d),I=new s(o[2],E,r.sparse.count*c);u!==null&&(l=new R.BufferAttribute(l.array.slice(),l.itemSize,l.normalized)),l.normalized=!1;for(let k=0,H=S.length;k<H;k++){const x=S[k];if(l.setX(x,I[k*c]),c>=2&&l.setY(x,I[k*c+1]),c>=3&&l.setZ(x,I[k*c+2]),c>=4&&l.setW(x,I[k*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}l.normalized=T}return l})}loadTexture(e){const t=this.json,i=this.options,a=t.textures[e].source,o=t.images[a];let u=this.textureLoader;if(o.uri){const c=i.manager.getHandler(o.uri);c!==null&&(u=c)}return this.loadTextureImage(e,a,u)}loadTextureImage(e,t,i){const r=this,a=this.json,o=a.textures[e],u=a.images[t],c=(u.uri||u.bufferView)+":"+o.sampler;if(this.textureCache[c])return this.textureCache[c];const s=this.loadImageSource(t,i).then(function(f){f.flipY=!1,f.name=o.name||u.name||"",f.name===""&&typeof u.uri=="string"&&u.uri.startsWith("data:image/")===!1&&(f.name=u.uri);const g=(a.samplers||{})[o.sampler]||{};return f.magFilter=Qt[g.magFilter]||R.LinearFilter,f.minFilter=Qt[g.minFilter]||R.LinearMipmapLinearFilter,f.wrapS=Zt[g.wrapS]||R.RepeatWrapping,f.wrapT=Zt[g.wrapT]||R.RepeatWrapping,f.generateMipmaps=!f.isCompressedTexture&&f.minFilter!==R.NearestFilter&&f.minFilter!==R.LinearFilter,r.associations.set(f,{textures:e}),f}).catch(function(){return null});return this.textureCache[c]=s,s}loadImageSource(e,t){const i=this,r=this.json,a=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const o=r.images[e],u=self.URL||self.webkitURL;let c=o.uri||"",s=!1;if(o.bufferView!==void 0)c=i.getDependency("bufferView",o.bufferView).then(function(h){s=!0;const g=new Blob([h],{type:o.mimeType});return c=u.createObjectURL(g),c});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const f=Promise.resolve(c).then(function(h){return new Promise(function(g,p){let T=g;t.isImageBitmapLoader===!0&&(T=function(m){const l=new R.Texture(m);l.needsUpdate=!0,g(l)}),t.load(R.LoaderUtils.resolveURL(h,a.path),T,void 0,p)})}).then(function(h){return s===!0&&u.revokeObjectURL(c),qe(h,o),h.userData.mimeType=o.mimeType||qr(o.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),h});return this.sourceCache[e]=f,f}assignTexture(e,t,i,r){const a=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),a.extensions[_e.KHR_TEXTURE_TRANSFORM]){const u=i.extensions!==void 0?i.extensions[_e.KHR_TEXTURE_TRANSFORM]:void 0;if(u){const c=a.associations.get(o);o=a.extensions[_e.KHR_TEXTURE_TRANSFORM].extendTexture(o,u),a.associations.set(o,c)}}return r!==void 0&&(o.colorSpace=r),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent===void 0,a=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const u="PointsMaterial:"+i.uuid;let c=this.cache.get(u);c||(c=new R.PointsMaterial,R.Material.prototype.copy.call(c,i),c.color.copy(i.color),c.map=i.map,c.sizeAttenuation=!1,this.cache.add(u,c)),i=c}else if(e.isLine){const u="LineBasicMaterial:"+i.uuid;let c=this.cache.get(u);c||(c=new R.LineBasicMaterial,R.Material.prototype.copy.call(c,i),c.color.copy(i.color),c.map=i.map,this.cache.add(u,c)),i=c}if(r||a||o){let u="ClonedMaterial:"+i.uuid+":";r&&(u+="derivative-tangents:"),a&&(u+="vertex-colors:"),o&&(u+="flat-shading:");let c=this.cache.get(u);c||(c=i.clone(),a&&(c.vertexColors=!0),o&&(c.flatShading=!0),r&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(u,c),this.associations.set(c,this.associations.get(i))),i=c}e.material=i}getMaterialType(){return R.MeshStandardMaterial}loadMaterial(e){const t=this,i=this.json,r=this.extensions,a=i.materials[e];let o;const u={},c=a.extensions||{},s=[];if(c[_e.KHR_MATERIALS_UNLIT]){const h=r[_e.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),s.push(h.extendParams(u,a,t))}else{const h=a.pbrMetallicRoughness||{};if(u.color=new R.Color(1,1,1),u.opacity=1,Array.isArray(h.baseColorFactor)){const g=h.baseColorFactor;u.color.setRGB(g[0],g[1],g[2],R.LinearSRGBColorSpace),u.opacity=g[3]}h.baseColorTexture!==void 0&&s.push(t.assignTexture(u,"map",h.baseColorTexture,R.SRGBColorSpace)),u.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,u.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(s.push(t.assignTexture(u,"metalnessMap",h.metallicRoughnessTexture)),s.push(t.assignTexture(u,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(g){return g.getMaterialType&&g.getMaterialType(e)}),s.push(Promise.all(this._invokeAll(function(g){return g.extendMaterialParams&&g.extendMaterialParams(e,u)})))}a.doubleSided===!0&&(u.side=R.DoubleSide);const f=a.alphaMode||bt.OPAQUE;if(f===bt.BLEND?(u.transparent=!0,u.depthWrite=!1):(u.transparent=!1,f===bt.MASK&&(u.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&o!==R.MeshBasicMaterial&&(s.push(t.assignTexture(u,"normalMap",a.normalTexture)),u.normalScale=new R.Vector2(1,1),a.normalTexture.scale!==void 0)){const h=a.normalTexture.scale;u.normalScale.set(h,h)}if(a.occlusionTexture!==void 0&&o!==R.MeshBasicMaterial&&(s.push(t.assignTexture(u,"aoMap",a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(u.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&o!==R.MeshBasicMaterial){const h=a.emissiveFactor;u.emissive=new R.Color().setRGB(h[0],h[1],h[2],R.LinearSRGBColorSpace)}return a.emissiveTexture!==void 0&&o!==R.MeshBasicMaterial&&s.push(t.assignTexture(u,"emissiveMap",a.emissiveTexture,R.SRGBColorSpace)),Promise.all(s).then(function(){const h=new o(u);return a.name&&(h.name=a.name),qe(h,a),t.associations.set(h,{materials:e}),a.extensions&&et(r,h,a),h})}createUniqueName(e){const t=R.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function a(u){return i[_e.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(u,t).then(function(c){return Jt(c,u,t)})}const o=[];for(let u=0,c=e.length;u<c;u++){const s=e[u],f=Xr(s),h=r[f];if(h)o.push(h.promise);else{let g;s.extensions&&s.extensions[_e.KHR_DRACO_MESH_COMPRESSION]?g=a(s):g=Jt(new R.BufferGeometry,s,t),r[f]={primitive:s,promise:g},o.push(g)}}return Promise.all(o)}loadMesh(e){const t=this,i=this.json,r=this.extensions,a=i.meshes[e],o=a.primitives,u=[];for(let c=0,s=o.length;c<s;c++){const f=o[c].material===void 0?Wr(this.cache):this.getDependency("material",o[c].material);u.push(f)}return u.push(t.loadGeometries(o)),Promise.all(u).then(function(c){const s=c.slice(0,c.length-1),f=c[c.length-1],h=[];for(let p=0,T=f.length;p<T;p++){const m=f[p],l=o[p];let d;const y=s[p];if(l.mode===Ke.TRIANGLES||l.mode===Ke.TRIANGLE_STRIP||l.mode===Ke.TRIANGLE_FAN||l.mode===void 0)d=a.isSkinnedMesh===!0?new R.SkinnedMesh(m,y):new R.Mesh(m,y),d.isSkinnedMesh===!0&&d.normalizeSkinWeights(),l.mode===Ke.TRIANGLE_STRIP?d.geometry=Xt(d.geometry,R.TriangleStripDrawMode):l.mode===Ke.TRIANGLE_FAN&&(d.geometry=Xt(d.geometry,R.TriangleFanDrawMode));else if(l.mode===Ke.LINES)d=new R.LineSegments(m,y);else if(l.mode===Ke.LINE_STRIP)d=new R.Line(m,y);else if(l.mode===Ke.LINE_LOOP)d=new R.LineLoop(m,y);else if(l.mode===Ke.POINTS)d=new R.Points(m,y);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+l.mode);Object.keys(d.geometry.morphAttributes).length>0&&Yr(d,a),d.name=t.createUniqueName(a.name||"mesh_"+e),qe(d,a),l.extensions&&et(r,d,l),t.assignFinalMaterial(d),h.push(d)}for(let p=0,T=h.length;p<T;p++)t.associations.set(h[p],{meshes:e,primitives:p});if(h.length===1)return a.extensions&&et(r,h[0],a),h[0];const g=new R.Group;a.extensions&&et(r,g,a),t.associations.set(g,{meshes:e});for(let p=0,T=h.length;p<T;p++)g.add(h[p]);return g})}loadCamera(e){let t;const i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new R.PerspectiveCamera(R.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new R.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),qe(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i=[];for(let r=0,a=t.joints.length;r<a;r++)i.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(r){const a=r.pop(),o=r,u=[],c=[];for(let s=0,f=o.length;s<f;s++){const h=o[s];if(h){u.push(h);const g=new R.Matrix4;a!==null&&g.fromArray(a.array,s*16),c.push(g)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[s])}return new R.Skeleton(u,c)})}loadAnimation(e){const t=this.json,i=this,r=t.animations[e],a=r.name?r.name:"animation_"+e,o=[],u=[],c=[],s=[],f=[];for(let h=0,g=r.channels.length;h<g;h++){const p=r.channels[h],T=r.samplers[p.sampler],m=p.target,l=m.node,d=r.parameters!==void 0?r.parameters[T.input]:T.input,y=r.parameters!==void 0?r.parameters[T.output]:T.output;m.node!==void 0&&(o.push(this.getDependency("node",l)),u.push(this.getDependency("accessor",d)),c.push(this.getDependency("accessor",y)),s.push(T),f.push(m))}return Promise.all([Promise.all(o),Promise.all(u),Promise.all(c),Promise.all(s),Promise.all(f)]).then(function(h){const g=h[0],p=h[1],T=h[2],m=h[3],l=h[4],d=[];for(let v=0,E=g.length;v<E;v++){const S=g[v],I=p[v],k=T[v],H=m[v],x=l[v];if(S===void 0)continue;S.updateMatrix&&S.updateMatrix();const B=i._createAnimationTracks(S,I,k,H,x);if(B)for(let P=0;P<B.length;P++)d.push(B[P])}const y=new R.AnimationClip(a,void 0,d);return qe(y,r),y})}createNodeMesh(e){const t=this.json,i=this,r=t.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(a){const o=i._getNodeRef(i.meshCache,r.mesh,a);return r.weights!==void 0&&o.traverse(function(u){if(u.isMesh)for(let c=0,s=r.weights.length;c<s;c++)u.morphTargetInfluences[c]=r.weights[c]}),o})}loadNode(e){const t=this.json,i=this,r=t.nodes[e],a=i._loadNodeShallow(e),o=[],u=r.children||[];for(let s=0,f=u.length;s<f;s++)o.push(i.getDependency("node",u[s]));const c=r.skin===void 0?Promise.resolve(null):i.getDependency("skin",r.skin);return Promise.all([a,Promise.all(o),c]).then(function(s){const f=s[0],h=s[1],g=s[2];g!==null&&f.traverse(function(p){p.isSkinnedMesh&&p.bind(g,Qr)});for(let p=0,T=h.length;p<T;p++)f.add(h[p]);return f})}_loadNodeShallow(e){const t=this.json,i=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const a=t.nodes[e],o=a.name?r.createUniqueName(a.name):"",u=[],c=r._invokeOne(function(s){return s.createNodeMesh&&s.createNodeMesh(e)});return c&&u.push(c),a.camera!==void 0&&u.push(r.getDependency("camera",a.camera).then(function(s){return r._getNodeRef(r.cameraCache,a.camera,s)})),r._invokeAll(function(s){return s.createNodeAttachment&&s.createNodeAttachment(e)}).forEach(function(s){u.push(s)}),this.nodeCache[e]=Promise.all(u).then(function(s){let f;if(a.isBone===!0?f=new R.Bone:s.length>1?f=new R.Group:s.length===1?f=s[0]:f=new R.Object3D,f!==s[0])for(let h=0,g=s.length;h<g;h++)f.add(s[h]);if(a.name&&(f.userData.name=a.name,f.name=o),qe(f,a),a.extensions&&et(i,f,a),a.matrix!==void 0){const h=new R.Matrix4;h.fromArray(a.matrix),f.applyMatrix4(h)}else a.translation!==void 0&&f.position.fromArray(a.translation),a.rotation!==void 0&&f.quaternion.fromArray(a.rotation),a.scale!==void 0&&f.scale.fromArray(a.scale);if(!r.associations.has(f))r.associations.set(f,{});else if(a.mesh!==void 0&&r.meshCache.refs[a.mesh]>1){const h=r.associations.get(f);r.associations.set(f,{...h})}return r.associations.get(f).nodes=e,f}),this.nodeCache[e]}loadScene(e){const t=this.extensions,i=this.json.scenes[e],r=this,a=new R.Group;i.name&&(a.name=r.createUniqueName(i.name)),qe(a,i),i.extensions&&et(t,a,i);const o=i.nodes||[],u=[];for(let c=0,s=o.length;c<s;c++)u.push(r.getDependency("node",o[c]));return Promise.all(u).then(function(c){for(let f=0,h=c.length;f<h;f++)a.add(c[f]);const s=f=>{const h=new Map;for(const[g,p]of r.associations)(g instanceof R.Material||g instanceof R.Texture)&&h.set(g,p);return f.traverse(g=>{const p=r.associations.get(g);p!=null&&h.set(g,p)}),h};return r.associations=s(a),a})}_createAnimationTracks(e,t,i,r,a){const o=[],u=e.name?e.name:e.uuid,c=[];Je[a.path]===Je.weights?e.traverse(function(g){g.morphTargetInfluences&&c.push(g.name?g.name:g.uuid)}):c.push(u);let s;switch(Je[a.path]){case Je.weights:s=R.NumberKeyframeTrack;break;case Je.rotation:s=R.QuaternionKeyframeTrack;break;case Je.translation:case Je.scale:s=R.VectorKeyframeTrack;break;default:i.itemSize===1?s=R.NumberKeyframeTrack:s=R.VectorKeyframeTrack;break}const f=r.interpolation!==void 0?Hr[r.interpolation]:R.InterpolateLinear,h=this._getArrayFromAccessor(i);for(let g=0,p=c.length;g<p;g++){const T=new s(c[g]+"."+Je[a.path],t.array,h,f);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(T),o.push(T)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const i=wt(t.constructor),r=new Float32Array(t.length);for(let a=0,o=t.length;a<o;a++)r[a]=t[a]*i;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(i){const r=this instanceof R.QuaternionKeyframeTrack?Vr:yn;return new r(this.times,this.values,this.getValueSize()/3,i)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Jr(n,e,t){const i=e.attributes,r=new R.Box3;if(i.POSITION!==void 0){const u=t.json.accessors[i.POSITION],c=u.min,s=u.max;if(c!==void 0&&s!==void 0){if(r.set(new R.Vector3(c[0],c[1],c[2]),new R.Vector3(s[0],s[1],s[2])),u.normalized){const f=wt(it[u.componentType]);r.min.multiplyScalar(f),r.max.multiplyScalar(f)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const a=e.targets;if(a!==void 0){const u=new R.Vector3,c=new R.Vector3;for(let s=0,f=a.length;s<f;s++){const h=a[s];if(h.POSITION!==void 0){const g=t.json.accessors[h.POSITION],p=g.min,T=g.max;if(p!==void 0&&T!==void 0){if(c.setX(Math.max(Math.abs(p[0]),Math.abs(T[0]))),c.setY(Math.max(Math.abs(p[1]),Math.abs(T[1]))),c.setZ(Math.max(Math.abs(p[2]),Math.abs(T[2]))),g.normalized){const m=wt(it[g.componentType]);c.multiplyScalar(m)}u.max(c)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(u)}n.boundingBox=r;const o=new R.Sphere;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,n.boundingSphere=o}function Jt(n,e,t){const i=e.attributes,r=[];function a(o,u){return t.getDependency("accessor",o).then(function(c){n.setAttribute(u,c)})}for(const o in i){const u=Nt[o]||o.toLowerCase();u in n.attributes||r.push(a(i[o],u))}if(e.indices!==void 0&&!n.index){const o=t.getDependency("accessor",e.indices).then(function(u){n.setIndex(u)});r.push(o)}return R.ColorManagement.workingColorSpace!==R.LinearSRGBColorSpace&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${R.ColorManagement.workingColorSpace}" not supported.`),qe(n,e),Jr(n,e,t),Promise.all(r).then(function(){return e.targets!==void 0?Kr(n,e.targets,t):n})}const St=new WeakMap;class $r extends R.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,i,r){const a=new R.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,o=>{this.parse(o,t,r)},i,r)}parse(e,t,i=()=>{}){this.decodeDracoFile(e,t,null,null,R.SRGBColorSpace,i).catch(i)}decodeDracoFile(e,t,i,r,a=R.LinearSRGBColorSpace,o=()=>{}){const u={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i,vertexColorSpace:a};return this.decodeGeometry(e,u).then(t).catch(o)}decodeGeometry(e,t){const i=JSON.stringify(t);if(St.has(e)){const c=St.get(e);if(c.key===i)return c.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 a=this.workerNextTaskID++,o=e.byteLength,u=this._getWorker(a,o).then(c=>(r=c,new Promise((s,f)=>{r._callbacks[a]={resolve:s,reject:f},r.postMessage({type:"decode",id:a,taskConfig:t,buffer:e},[e])}))).then(c=>this._createGeometry(c.geometry));return u.catch(()=>!0).then(()=>{r&&a&&this._releaseTask(r,a)}),St.set(e,{key:i,promise:u}),u}_createGeometry(e){const t=new R.BufferGeometry;e.index&&t.setIndex(new R.BufferAttribute(e.index.array,1));for(let i=0;i<e.attributes.length;i++){const{name:r,array:a,itemSize:o,stride:u,vertexColorSpace:c}=e.attributes[i];let s;if(o===u)s=new R.BufferAttribute(a,o);else{const f=new R.InterleavedBuffer(a,u);s=new R.InterleavedBufferAttribute(f,o,0)}r==="color"&&(this._assignVertexColorSpace(s,c),s.normalized=!(a instanceof Float32Array)),t.setAttribute(r,s)}return t}_assignVertexColorSpace(e,t){if(t!==R.SRGBColorSpace)return;const i=new R.Color;for(let r=0,a=e.count;r<a;r++)i.fromBufferAttribute(e,r),R.ColorManagement.colorSpaceToWorking(i,R.SRGBColorSpace),e.setXYZ(r,i.r,i.g,i.b)}_loadLibrary(e,t){const i=new R.FileLoader(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise((r,a)=>{i.load(e,r,void 0,a)})}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(i=>{const r=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const a=ei.toString(),o=["/* draco decoder */",r,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join(`
|
|
80
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),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(a){const o=a.data;switch(o.type){case"decode":r._callbacks[o.id].resolve(o);break;case"error":r._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,a){return r._taskLoad>a._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_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 ei(){let n,e;onmessage=function(o){const u=o.data;switch(u.type){case"init":n=u.decoderConfig,e=new Promise(function(f){n.onModuleLoaded=function(h){f({draco:h})},DracoDecoderModule(n)});break;case"decode":const c=u.buffer,s=u.taskConfig;e.then(f=>{const h=f.draco,g=new h.Decoder;try{const p=t(h,g,new Int8Array(c),s),T=p.attributes.map(m=>m.array.buffer);p.index&&T.push(p.index.array.buffer),self.postMessage({type:"decode",id:u.id,geometry:p},T)}catch(p){console.error(p),self.postMessage({type:"error",id:u.id,error:p.message})}finally{h.destroy(g)}});break}};function t(o,u,c,s){const f=s.attributeIDs,h=s.attributeTypes;let g,p;const T=u.GetEncodedGeometryType(c);if(T===o.TRIANGULAR_MESH)g=new o.Mesh,p=u.DecodeArrayToMesh(c,c.byteLength,g);else if(T===o.POINT_CLOUD)g=new o.PointCloud,p=u.DecodeArrayToPointCloud(c,c.byteLength,g);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!p.ok()||g.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+p.error_msg());const m={index:null,attributes:[]};for(const l in f){const d=self[h[l]];let y,v;if(s.useUniqueIDs)v=f[l],y=u.GetAttributeByUniqueId(g,v);else{if(v=u.GetAttributeId(g,o[f[l]]),v===-1)continue;y=u.GetAttribute(g,v)}const E=r(o,u,g,l,d,y);l==="color"&&(E.vertexColorSpace=s.vertexColorSpace),m.attributes.push(E)}return T===o.TRIANGULAR_MESH&&(m.index=i(o,u,g)),o.destroy(g),m}function i(o,u,c){const f=c.num_faces()*3,h=f*4,g=o._malloc(h);u.GetTrianglesUInt32Array(c,h,g);const p=new Uint32Array(o.HEAPF32.buffer,g,f).slice();return o._free(g),{array:p,itemSize:1}}function r(o,u,c,s,f,h){const g=c.num_points(),p=h.num_components(),T=a(o,f),m=p*f.BYTES_PER_ELEMENT,l=Math.ceil(m/4)*4,d=l/f.BYTES_PER_ELEMENT,y=g*m,v=g*l,E=o._malloc(y);u.GetAttributeDataArrayForAllPoints(c,h,T,y,E);const S=new f(o.HEAPF32.buffer,E,y/f.BYTES_PER_ELEMENT);let I;if(m===l)I=S.slice();else{I=new f(v/f.BYTES_PER_ELEMENT);let k=0;for(let H=0,x=S.length;H<x;H++){for(let B=0;B<p;B++)I[k+B]=S[H*p+B];k+=d}}return o._free(E),{name:s,count:g,itemSize:p,array:I,stride:d}}function a(o,u){switch(u){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function ti(n){return"morphTargetDictionary"in n&&n.morphTargetDictionary!==void 0&&"morphTargetInfluences"in n&&Array.isArray(n.morphTargetInfluences)}const gn=new Tr,Tn=new $r;Tn.setDecoderPath("/examples/jsm/libs/draco/");gn.setDRACOLoader(Tn);class En extends je{ready;gltf;constructor(e){super(),this.ready=this.asyncInit(e)}initObject(){return new se.Object3D}initMotion(){return new vn(this)}async asyncInit(e){if(en(e))console.log(`File: ${e}`),this.gltf=await gn.loadAsync(e),this.gltf.scene.traverse(t=>{t.userData.a3js={objectA3:this}}),this.object.add(this.gltf.scene);else{const t=new se.BoxGeometry,i=new se.MeshStandardMaterial({color:16711680}),r=new se.Mesh(t,i);this.object.add(r)}return this.motion.setObject(this),this}}class vn extends tt{isPaused;gltf;mixer;clips;actions;morphs;constructor(e){super(e),this.isPaused=!1,this.clips={},this.actions={},this.morphs={}}setObject(e){e instanceof En?(super.setObject(e),this.gltf=e.gltf,this.myInitialize(e)):console.warn("GLTFMotion can set only GLTF object.")}myInitialize(e){if(this.gltf){this.mixer=new se.AnimationMixer(this.gltf.scene),this.actions={},console.log(" actions(from model):");const t={};for(let i=0;i<this.gltf.animations.length;i++){const r=this.gltf.animations[i];t[r.name]=r,this.actions[r.name]=this.mixer.clipAction(r),console.log(` ${r.name}`)}console.log(" actions(from motion):");for(const i of Object.values(this.clips))t[i.name]=i,this.actions[i.name]=this.mixer.clipAction(i),console.log(` ${i.name}`);this.clips=t,console.log(" morphs:"),this.morphs={},this.gltf.scene.traverse(i=>{if(ti(i)){const{morphTargetDictionary:r,morphTargetInfluences:a}=i;Object.keys(r).forEach(o=>{const u=i.name+"."+o,c=r[o];this.morphs[u]={array:a,idx:c},console.log(` ${u}`)})}})}}detachObject(e){this.mixer?.stopAllAction(),this.gltf&&this.mixer?.uncacheRoot(this.gltf.scene),this.mixer=void 0,this.actions={},this.morphs={},this.gltf=void 0,this.isPaused=!1}update(e){super.update(e),this.isPaused||this.mixer?.update(e)}controlMotion(...e){if(e[0]){this.mixer?.stopAllAction();const t=this.actions[e[0]];t&&t.play()}if(e[1]){const t=e[1];if(e[2]){const i=Number(e[2]);if(t in this.morphs){const{array:r,idx:a}=this.morphs[e[1]];r[a]=i}}}}setPause(e){this.isPaused=e}setTime(e){this.mixer?.setTime(e)}}var ve=(n,e)=>()=>(e||(e={exports:{}},n(e.exports,e)),e.exports),Rn=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.VERSION=void 0,n.VERSION="9.0.1"}),xe=ve((n,e)=>{var t=n&&n.__spreadArray||function(F,Y){for(var z=0,ee=Y.length,de=F.length;z<ee;z++,de++)F[de]=Y[z];return F};Object.defineProperty(n,"__esModule",{value:!0}),n.toFastProperties=n.timer=n.peek=n.isES2015MapSupported=n.PRINT_WARNING=n.PRINT_ERROR=n.packArray=n.IDENTITY=n.NOOP=n.merge=n.groupBy=n.defaults=n.assignNoOverwrite=n.assign=n.zipObject=n.sortBy=n.indexOf=n.some=n.difference=n.every=n.isObject=n.isRegExp=n.isArray=n.partial=n.uniq=n.compact=n.reduce=n.findAll=n.find=n.cloneObj=n.cloneArr=n.contains=n.has=n.pick=n.reject=n.filter=n.dropRight=n.drop=n.isFunction=n.isUndefined=n.isString=n.forEach=n.last=n.first=n.flatten=n.map=n.mapValues=n.values=n.keys=n.isEmpty=void 0;function i(F){return F&&F.length===0}n.isEmpty=i;function r(F){return F==null?[]:Object.keys(F)}n.keys=r;function a(F){for(var Y=[],z=Object.keys(F),ee=0;ee<z.length;ee++)Y.push(F[z[ee]]);return Y}n.values=a;function o(F,Y){for(var z=[],ee=r(F),de=0;de<ee.length;de++){var be=ee[de];z.push(Y.call(null,F[be],be))}return z}n.mapValues=o;function u(F,Y){for(var z=[],ee=0;ee<F.length;ee++)z.push(Y.call(null,F[ee],ee));return z}n.map=u;function c(F){for(var Y=[],z=0;z<F.length;z++){var ee=F[z];Array.isArray(ee)?Y=Y.concat(c(ee)):Y.push(ee)}return Y}n.flatten=c;function s(F){return i(F)?void 0:F[0]}n.first=s;function f(F){var Y=F&&F.length;return Y?F[Y-1]:void 0}n.last=f;function h(F,Y){if(Array.isArray(F))for(var z=0;z<F.length;z++)Y.call(null,F[z],z);else if(Q(F))for(var ee=r(F),z=0;z<ee.length;z++){var de=ee[z],be=F[de];Y.call(null,be,de)}else throw Error("non exhaustive match")}n.forEach=h;function g(F){return typeof F=="string"}n.isString=g;function p(F){return F===void 0}n.isUndefined=p;function T(F){return F instanceof Function}n.isFunction=T;function m(F,Y){return Y===void 0&&(Y=1),F.slice(Y,F.length)}n.drop=m;function l(F,Y){return Y===void 0&&(Y=1),F.slice(0,F.length-Y)}n.dropRight=l;function d(F,Y){var z=[];if(Array.isArray(F))for(var ee=0;ee<F.length;ee++){var de=F[ee];Y.call(null,de)&&z.push(de)}return z}n.filter=d;function y(F,Y){return d(F,function(z){return!Y(z)})}n.reject=y;function v(F,Y){for(var z=Object.keys(F),ee={},de=0;de<z.length;de++){var be=z[de],b=F[be];Y(b)&&(ee[be]=b)}return ee}n.pick=v;function E(F,Y){return Q(F)?F.hasOwnProperty(Y):!1}n.has=E;function S(F,Y){return H(F,function(z){return z===Y})!==void 0}n.contains=S;function I(F){for(var Y=[],z=0;z<F.length;z++)Y.push(F[z]);return Y}n.cloneArr=I;function k(F){var Y={};for(var z in F)Object.prototype.hasOwnProperty.call(F,z)&&(Y[z]=F[z]);return Y}n.cloneObj=k;function H(F,Y){for(var z=0;z<F.length;z++){var ee=F[z];if(Y.call(null,ee))return ee}}n.find=H;function x(F,Y){for(var z=[],ee=0;ee<F.length;ee++){var de=F[ee];Y.call(null,de)&&z.push(de)}return z}n.findAll=x;function B(F,Y,z){for(var ee=Array.isArray(F),de=ee?F:a(F),be=ee?[]:r(F),b=z,A=0;A<de.length;A++)b=Y.call(null,b,de[A],ee?A:be[A]);return b}n.reduce=B;function P(F){return y(F,function(Y){return Y==null})}n.compact=P;function O(F,Y){Y===void 0&&(Y=function(ee){return ee});var z=[];return B(F,function(ee,de){var be=Y(de);return S(z,be)?ee:(z.push(be),ee.concat(de))},[])}n.uniq=O;function M(F){for(var Y=[],z=1;z<arguments.length;z++)Y[z-1]=arguments[z];var ee=[null],de=ee.concat(Y);return Function.bind.apply(F,de)}n.partial=M;function C(F){return Array.isArray(F)}n.isArray=C;function X(F){return F instanceof RegExp}n.isRegExp=X;function Q(F){return F instanceof Object}n.isObject=Q;function W(F,Y){for(var z=0;z<F.length;z++)if(!Y(F[z],z))return!1;return!0}n.every=W;function $(F,Y){return y(F,function(z){return S(Y,z)})}n.difference=$;function te(F,Y){for(var z=0;z<F.length;z++)if(Y(F[z]))return!0;return!1}n.some=te;function ce(F,Y){for(var z=0;z<F.length;z++)if(F[z]===Y)return z;return-1}n.indexOf=ce;function ae(F,Y){var z=I(F);return z.sort(function(ee,de){return Y(ee)-Y(de)}),z}n.sortBy=ae;function le(F,Y){if(F.length!==Y.length)throw Error("can't zipObject with different number of keys and values!");for(var z={},ee=0;ee<F.length;ee++)z[F[ee]]=Y[ee];return z}n.zipObject=le;function ne(F){for(var Y=[],z=1;z<arguments.length;z++)Y[z-1]=arguments[z];for(var ee=0;ee<Y.length;ee++)for(var de=Y[ee],be=r(de),b=0;b<be.length;b++){var A=be[b];F[A]=de[A]}return F}n.assign=ne;function pe(F){for(var Y=[],z=1;z<arguments.length;z++)Y[z-1]=arguments[z];for(var ee=0;ee<Y.length;ee++)for(var de=Y[ee],be=r(de),b=0;b<be.length;b++){var A=be[b];E(F,A)||(F[A]=de[A])}return F}n.assignNoOverwrite=pe;function U(){for(var F=[],Y=0;Y<arguments.length;Y++)F[Y]=arguments[Y];return pe.apply(void 0,t([{}],F))}n.defaults=U;function G(F,Y){var z={};return h(F,function(ee){var de=Y(ee),be=z[de];be?be.push(ee):z[de]=[ee]}),z}n.groupBy=G;function K(F,Y){for(var z=k(F),ee=r(Y),de=0;de<ee.length;de++){var be=ee[de],b=Y[be];z[be]=b}return z}n.merge=K;function q(){}n.NOOP=q;function J(F){return F}n.IDENTITY=J;function ie(F){for(var Y=[],z=0;z<F.length;z++){var ee=F[z];Y.push(ee!==void 0?ee:void 0)}return Y}n.packArray=ie;function Te(F){console&&console.error&&console.error("Error: "+F)}n.PRINT_ERROR=Te;function ye(F){console&&console.warn&&console.warn("Warning: "+F)}n.PRINT_WARNING=ye;function we(){return typeof Map=="function"}n.isES2015MapSupported=we;function Be(F){return F[F.length-1]}n.peek=Be;function We(F){var Y=new Date().getTime(),z=F(),ee=new Date().getTime(),de=ee-Y;return{time:de,value:z}}n.timer=We;function Ue(F){function Y(){}Y.prototype=F;var z=new Y;function ee(){return typeof z.bar}return ee(),ee(),F}n.toFastProperties=Ue}),Ft=ve((n,e)=>{(function(t,i){typeof define=="function"&&define.amd?define([],i):typeof e=="object"&&e.exports?e.exports=i():t.regexpToAst=i()})(typeof self<"u"?self:n,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 y={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":c(y,"global");break;case"i":c(y,"ignoreCase");break;case"m":c(y,"multiLine");break;case"u":c(y,"unicode");break;case"y":c(y,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:y,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}s(d);var y=this.disjunction();return this.consumeChar(")"),{type:d,value:y,loc:this.loc(l)}}f()},t.prototype.quantifier=function(l){var d,y=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 v=this.integerIncludingZero();switch(this.popChar()){case"}":d={atLeast:v,atMost:v};break;case",":var E;this.isDigit()?(E=this.integerIncludingZero(),d={atLeast:v,atMost:E}):d={atLeast:v,atMost:1/0},this.consumeChar("}");break}if(l===!0&&d===void 0)return;s(d);break}if(!(l===!0&&d===void 0))return s(d),this.peekChar(0)==="?"?(this.consumeChar("?"),d.greedy=!1):d.greedy=!0,d.type="Quantifier",d.loc=this.loc(y),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()),s(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:[o(`
|
|
81
|
-
`)
|
|
82
|
-
|
|
83
|
-
`:case"\r":case"\u2028":case"\u2029":
|
|
84
|
-
`:case"\r":case"\u2028":case"\u2029":
|
|
85
|
-
`: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:o(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`
|
|
80
|
+
`,Qn={testMode:!0};class mo extends Me{constructor(e={}){super(e);const t={...Qn,...e};this.setRootMotion(new wn(t))}initObject(){const e=new se.BoxGeometry,t=new se.MeshStandardMaterial({color:65280}),r=new se.Mesh(e,t),i=document.createElement("div");i.textContent="Hello Box!",i.style.cssText=Io;const s=new Mn(i);return s.position.set(0,.8,0),r.add(s),r}initRootMotions(e){const t=Tt(Qn,e);return[new wn(t)]}}class wn extends zt{testMode=!0;rot=new Ie;constructor(e){super(),this.testMode=e.testMode}update(e,t){if(super.update(e,t),this.testMode){this.rot.add(e,e,e);const r=en(this.rot);t.quat.set(r)}return t}}class bo extends I.Loader{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new I.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(c){const A=s.parse(JSON.parse(c));t&&t(A)},r,i)}parse(e){return new Li(e)}}class Li{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100,r="ltr"){const i=[],s=Co(e,t,this.data,r);for(let o=0,c=s.length;o<c;o++)i.push(...s[o].toShapes());return i}}function Co(n,e,t,r){const i=Array.from(n),s=e/t.resolution,o=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*s,c=[];let A=0,a=0;(r=="rtl"||r=="tb")&&i.reverse();for(let f=0;f<i.length;f++){const u=i[f];if(u===`
|
|
81
|
+
`)A=0,a-=o;else{const b=Bo(u,s,A,a,t);r=="tb"?(A=0,a+=t.ascender*s):A+=b.offsetX,c.push(b.path)}}return c}function Bo(n,e,t,r,i){const s=i.glyphs[n]||i.glyphs["?"];if(!s){console.error('THREE.Font: character "'+n+'" does not exists in font family '+i.familyName+".");return}const o=new I.ShapePath;let c,A,a,f,u,b,d,E;if(s.o){const g=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let l=0,h=g.length;l<h;)switch(g[l++]){case"m":c=g[l++]*e+t,A=g[l++]*e+r,o.moveTo(c,A);break;case"l":c=g[l++]*e+t,A=g[l++]*e+r,o.lineTo(c,A);break;case"q":a=g[l++]*e+t,f=g[l++]*e+r,u=g[l++]*e+t,b=g[l++]*e+r,o.quadraticCurveTo(u,b,a,f);break;case"b":a=g[l++]*e+t,f=g[l++]*e+r,u=g[l++]*e+t,b=g[l++]*e+r,d=g[l++]*e+t,E=g[l++]*e+r,o.bezierCurveTo(u,b,d,E,a,f);break}}return{offsetX:s.ha*e,path:o}}class yo extends I.ExtrudeGeometry{constructor(e,t={}){const r=t.font;if(r===void 0)super();else{const i=r.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(i,t)}this.type="TextGeometry"}}let yt=null;async function To(n){if(n.match(/.zip$/i)){let e=n.substring(n.lastIndexOf("/"));e=e.substring(0,e.length-4);const t=await xn(n),r=tn(t,e);yt=new Li(JSON.parse(r))}else yt=await new bo().loadAsync(n)}class Ro extends Me{initObject(e){let t;if(kn(e)?t=e:t="ERROR",yt==null){const r=new se.BoxGeometry,i=new se.MeshStandardMaterial({color:16711680});return new se.Mesh(r,i)}else{const r={font:yt,size:1,depth:.5,curveSegments:12},i=new yo(t,r);i.center();const s=new se.MeshStandardMaterial({color:65280});return new se.Mesh(i,s)}}}var Ce=(n,e)=>()=>(e||(e={exports:{}},n(e.exports,e)),e.exports),_i=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.VERSION=void 0,n.VERSION="9.0.1"}),ke=Ce((n,e)=>{var t=n&&n.__spreadArray||function(F,Y){for(var q=0,ne=Y.length,de=F.length;q<ne;q++,de++)F[de]=Y[q];return F};Object.defineProperty(n,"__esModule",{value:!0}),n.toFastProperties=n.timer=n.peek=n.isES2015MapSupported=n.PRINT_WARNING=n.PRINT_ERROR=n.packArray=n.IDENTITY=n.NOOP=n.merge=n.groupBy=n.defaults=n.assignNoOverwrite=n.assign=n.zipObject=n.sortBy=n.indexOf=n.some=n.difference=n.every=n.isObject=n.isRegExp=n.isArray=n.partial=n.uniq=n.compact=n.reduce=n.findAll=n.find=n.cloneObj=n.cloneArr=n.contains=n.has=n.pick=n.reject=n.filter=n.dropRight=n.drop=n.isFunction=n.isUndefined=n.isString=n.forEach=n.last=n.first=n.flatten=n.map=n.mapValues=n.values=n.keys=n.isEmpty=void 0;function r(F){return F&&F.length===0}n.isEmpty=r;function i(F){return F==null?[]:Object.keys(F)}n.keys=i;function s(F){for(var Y=[],q=Object.keys(F),ne=0;ne<q.length;ne++)Y.push(F[q[ne]]);return Y}n.values=s;function o(F,Y){for(var q=[],ne=i(F),de=0;de<ne.length;de++){var Te=ne[de];q.push(Y.call(null,F[Te],Te))}return q}n.mapValues=o;function c(F,Y){for(var q=[],ne=0;ne<F.length;ne++)q.push(Y.call(null,F[ne],ne));return q}n.map=c;function A(F){for(var Y=[],q=0;q<F.length;q++){var ne=F[q];Array.isArray(ne)?Y=Y.concat(A(ne)):Y.push(ne)}return Y}n.flatten=A;function a(F){return r(F)?void 0:F[0]}n.first=a;function f(F){var Y=F&&F.length;return Y?F[Y-1]:void 0}n.last=f;function u(F,Y){if(Array.isArray(F))for(var q=0;q<F.length;q++)Y.call(null,F[q],q);else if(W(F))for(var ne=i(F),q=0;q<ne.length;q++){var de=ne[q],Te=F[de];Y.call(null,Te,de)}else throw Error("non exhaustive match")}n.forEach=u;function b(F){return typeof F=="string"}n.isString=b;function d(F){return F===void 0}n.isUndefined=d;function E(F){return F instanceof Function}n.isFunction=E;function g(F,Y){return Y===void 0&&(Y=1),F.slice(Y,F.length)}n.drop=g;function l(F,Y){return Y===void 0&&(Y=1),F.slice(0,F.length-Y)}n.dropRight=l;function h(F,Y){var q=[];if(Array.isArray(F))for(var ne=0;ne<F.length;ne++){var de=F[ne];Y.call(null,de)&&q.push(de)}return q}n.filter=h;function p(F,Y){return h(F,function(q){return!Y(q)})}n.reject=p;function C(F,Y){for(var q=Object.keys(F),ne={},de=0;de<q.length;de++){var Te=q[de],R=F[Te];Y(R)&&(ne[Te]=R)}return ne}n.pick=C;function m(F,Y){return W(F)?F.hasOwnProperty(Y):!1}n.has=m;function y(F,Y){return U(F,function(q){return q===Y})!==void 0}n.contains=y;function v(F){for(var Y=[],q=0;q<F.length;q++)Y.push(F[q]);return Y}n.cloneArr=v;function S(F){var Y={};for(var q in F)Object.prototype.hasOwnProperty.call(F,q)&&(Y[q]=F[q]);return Y}n.cloneObj=S;function U(F,Y){for(var q=0;q<F.length;q++){var ne=F[q];if(Y.call(null,ne))return ne}}n.find=U;function w(F,Y){for(var q=[],ne=0;ne<F.length;ne++){var de=F[ne];Y.call(null,de)&&q.push(de)}return q}n.findAll=w;function M(F,Y,q){for(var ne=Array.isArray(F),de=ne?F:s(F),Te=ne?[]:i(F),R=q,B=0;B<de.length;B++)R=Y.call(null,R,de[B],ne?B:Te[B]);return R}n.reduce=M;function _(F){return p(F,function(Y){return Y==null})}n.compact=_;function k(F,Y){Y===void 0&&(Y=function(ne){return ne});var q=[];return M(F,function(ne,de){var Te=Y(de);return y(q,Te)?ne:(q.push(Te),ne.concat(de))},[])}n.uniq=k;function D(F){for(var Y=[],q=1;q<arguments.length;q++)Y[q-1]=arguments[q];var ne=[null],de=ne.concat(Y);return Function.bind.apply(F,de)}n.partial=D;function L(F){return Array.isArray(F)}n.isArray=L;function V(F){return F instanceof RegExp}n.isRegExp=V;function W(F){return F instanceof Object}n.isObject=W;function j(F,Y){for(var q=0;q<F.length;q++)if(!Y(F[q],q))return!1;return!0}n.every=j;function J(F,Y){return p(F,function(q){return y(Y,q)})}n.difference=J;function Z(F,Y){for(var q=0;q<F.length;q++)if(Y(F[q]))return!0;return!1}n.some=Z;function Ae(F,Y){for(var q=0;q<F.length;q++)if(F[q]===Y)return q;return-1}n.indexOf=Ae;function ie(F,Y){var q=v(F);return q.sort(function(ne,de){return Y(ne)-Y(de)}),q}n.sortBy=ie;function re(F,Y){if(F.length!==Y.length)throw Error("can't zipObject with different number of keys and values!");for(var q={},ne=0;ne<F.length;ne++)q[F[ne]]=Y[ne];return q}n.zipObject=re;function ee(F){for(var Y=[],q=1;q<arguments.length;q++)Y[q-1]=arguments[q];for(var ne=0;ne<Y.length;ne++)for(var de=Y[ne],Te=i(de),R=0;R<Te.length;R++){var B=Te[R];F[B]=de[B]}return F}n.assign=ee;function le(F){for(var Y=[],q=1;q<arguments.length;q++)Y[q-1]=arguments[q];for(var ne=0;ne<Y.length;ne++)for(var de=Y[ne],Te=i(de),R=0;R<Te.length;R++){var B=Te[R];m(F,B)||(F[B]=de[B])}return F}n.assignNoOverwrite=le;function P(){for(var F=[],Y=0;Y<arguments.length;Y++)F[Y]=arguments[Y];return le.apply(void 0,t([{}],F))}n.defaults=P;function H(F,Y){var q={};return u(F,function(ne){var de=Y(ne),Te=q[de];Te?Te.push(ne):q[de]=[ne]}),q}n.groupBy=H;function z(F,Y){for(var q=S(F),ne=i(Y),de=0;de<ne.length;de++){var Te=ne[de],R=Y[Te];q[Te]=R}return q}n.merge=z;function X(){}n.NOOP=X;function te(F){return F}n.IDENTITY=te;function ae(F){for(var Y=[],q=0;q<F.length;q++){var ne=F[q];Y.push(ne!==void 0?ne:void 0)}return Y}n.packArray=ae;function me(F){console&&console.error&&console.error("Error: "+F)}n.PRINT_ERROR=me;function ge(F){console&&console.warn&&console.warn("Warning: "+F)}n.PRINT_WARNING=ge;function _e(){return typeof Map=="function"}n.isES2015MapSupported=_e;function Ge(F){return F[F.length-1]}n.peek=Ge;function Ve(F){var Y=new Date().getTime(),q=F(),ne=new Date().getTime(),de=ne-Y;return{time:de,value:q}}n.timer=Ve;function Pe(F){function Y(){}Y.prototype=F;var q=new Y;function ne(){return typeof q.bar}return ne(),ne(),F}n.toFastProperties=Pe}),sn=Ce((n,e)=>{(function(t,r){typeof define=="function"&&define.amd?define([],r):typeof e=="object"&&e.exports?e.exports=r():t.regexpToAst=r()})(typeof self<"u"?self:n,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 h=this.disjunction();this.consumeChar("/");for(var p={type:"Flags",loc:{begin:this.idx,end:l.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":A(p,"global");break;case"i":A(p,"ignoreCase");break;case"m":A(p,"multiLine");break;case"u":A(p,"unicode");break;case"y":A(p,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:p,value:h,loc:this.loc(0)}},t.prototype.disjunction=function(){var l=[],h=this.idx;for(l.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),l.push(this.alternative());return{type:"Disjunction",value:l,loc:this.loc(h)}},t.prototype.alternative=function(){for(var l=[],h=this.idx;this.isTerm();)l.push(this.term());return{type:"Alternative",value:l,loc:this.loc(h)}},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 h;switch(this.popChar()){case"=":h="Lookahead";break;case"!":h="NegativeLookahead";break}a(h);var p=this.disjunction();return this.consumeChar(")"),{type:h,value:p,loc:this.loc(l)}}f()},t.prototype.quantifier=function(l){var h,p=this.idx;switch(this.popChar()){case"*":h={atLeast:0,atMost:1/0};break;case"+":h={atLeast:1,atMost:1/0};break;case"?":h={atLeast:0,atMost:1};break;case"{":var C=this.integerIncludingZero();switch(this.popChar()){case"}":h={atLeast:C,atMost:C};break;case",":var m;this.isDigit()?(m=this.integerIncludingZero(),h={atLeast:C,atMost:m}):h={atLeast:C,atMost:1/0},this.consumeChar("}");break}if(l===!0&&h===void 0)return;a(h);break}if(!(l===!0&&h===void 0))return a(h),this.peekChar(0)==="?"?(this.consumeChar("?"),h.greedy=!1):h.greedy=!0,h.type="Quantifier",h.loc=this.loc(p),h},t.prototype.atom=function(){var l,h=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(h),this.isQuantifier()&&(l.quantifier=this.quantifier()),l},t.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[o(`
|
|
82
|
+
`),o("\r"),o("\u2028"),o("\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,h=!1;switch(this.popChar()){case"d":l=b;break;case"D":l=b,h=!0;break;case"s":l=E;break;case"S":l=E,h=!0;break;case"w":l=d;break;case"W":l=d,h=!0;break}return a(l),{type:"Set",value:l,complement:h}},t.prototype.controlEscapeAtom=function(){var l;switch(this.popChar()){case"f":l=o("\f");break;case"n":l=o(`
|
|
83
|
+
`);break;case"r":l=o("\r");break;case"t":l=o(" ");break;case"v":l=o("\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 h=l.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:h}},t.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:o("\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:o(l)}},t.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
|
|
84
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var l=this.popChar();return{type:"Character",value:o(l)}}},t.prototype.characterClass=function(){var l=[],h=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),h=!0);this.isClassAtom();){var p=this.classAtom(),C=p.type==="Character";if(C&&this.isRangeDash()){this.consumeChar("-");var m=this.classAtom(),y=m.type==="Character";if(y){if(m.value<p.value)throw Error("Range out of order in character class");l.push({from:p.value,to:m.value})}else c(p.value,l),l.push(o("-")),c(m.value,l)}else c(p.value,l)}return this.consumeChar("]"),{type:"Set",complement:h,value:l}},t.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
|
|
85
|
+
`: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:o("\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 h=this.disjunction();this.consumeChar(")");var p={type:"Group",capturing:l,value:h};return l&&(p.idx=this.groupIdx),p},t.prototype.positiveInteger=function(){var l=this.popChar();if(s.test(l)===!1)throw Error("Expecting a positive integer");for(;i.test(this.peekChar(0));)l+=this.popChar();return parseInt(l,10)},t.prototype.integerIncludingZero=function(){var l=this.popChar();if(i.test(l)===!1)throw Error("Expecting an integer");for(;i.test(this.peekChar(0));)l+=this.popChar();return parseInt(l,10)},t.prototype.patternCharacter=function(){var l=this.popChar();switch(l){case`
|
|
86
|
+
`: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:o(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 i.test(this.peekChar(0))},t.prototype.isClassAtom=function(l){switch(l===void 0&&(l=0),this.peekChar(l)){case"]":case`
|
|
86
87
|
`: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`
|
|
87
|
-
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.parseHexDigits=function(l){for(var
|
|
88
|
-
`),o("\r"),o(" "),o("\v"),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o("\u2028"),o("\u2029"),o(" "),o(" "),o(" "),o("\uFEFF")];function
|
|
89
|
-
`;function
|
|
88
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.parseHexDigits=function(l){for(var h="",p=0;p<l;p++){var C=this.popChar();if(r.test(C)===!1)throw Error("Expecting a HexDecimal digits");h+=C}var m=parseInt(h,16);return{type:"Character",value:m}},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 r=/[0-9a-fA-F]/,i=/[0-9]/,s=/[1-9]/;function o(l){return l.charCodeAt(0)}function c(l,h){l.length!==void 0?l.forEach(function(p){h.push(p)}):h.push(l)}function A(l,h){if(l[h]===!0)throw"duplicate flag "+h;l[h]=!0}function a(l){if(l===void 0)throw Error("Internal Error - Should never get here!")}function f(){throw Error("Internal Error - Should never get here!")}var u,b=[];for(u=o("0");u<=o("9");u++)b.push(u);var d=[o("_")].concat(b);for(u=o("a");u<=o("z");u++)d.push(u);for(u=o("A");u<=o("Z");u++)d.push(u);var E=[o(" "),o("\f"),o(`
|
|
89
|
+
`),o("\r"),o(" "),o("\v"),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o("\u2028"),o("\u2029"),o(" "),o(" "),o(" "),o("\uFEFF")];function g(){}return g.prototype.visitChildren=function(l){for(var h in l){var p=l[h];l.hasOwnProperty(h)&&(p.type!==void 0?this.visit(p):Array.isArray(p)&&p.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"}})}),an=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clearRegExpParserCache=n.getRegExpAst=void 0;var e=sn(),t={},r=new e.RegExpParser;function i(o){var c=o.toString();if(t.hasOwnProperty(c))return t[c];var A=r.pattern(c);return t[c]=A,A}n.getRegExpAst=i;function s(){t={}}n.clearRegExpParserCache=s}),Qo=Ce(n=>{var e=n&&n.__extends||(function(){var g=function(l,h){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,C){p.__proto__=C}||function(p,C){for(var m in C)Object.prototype.hasOwnProperty.call(C,m)&&(p[m]=C[m])},g(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");g(l,h);function p(){this.constructor=l}l.prototype=h===null?Object.create(h):(p.prototype=h.prototype,new p)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.canMatchCharCode=n.firstCharOptimizedIndices=n.getOptimizedStartCodesIndices=n.failedOptimizationPrefixMsg=void 0;var t=sn(),r=ke(),i=an(),s=xi(),o="Complement Sets are not supported for first char optimization";n.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
|
|
90
|
+
`;function c(g,l){l===void 0&&(l=!1);try{var h=i.getRegExpAst(g),p=A(h.value,{},h.flags.ignoreCase);return p}catch(m){if(m.message===o)l&&r.PRINT_WARNING(""+n.failedOptimizationPrefixMsg+(" Unable to optimize: < "+g.toString()+` >
|
|
90
91
|
`)+` Complement Sets cannot be automatically optimized.
|
|
91
92
|
This will disable the lexer's first char optimizations.
|
|
92
|
-
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var
|
|
93
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var C="";l&&(C=`
|
|
93
94
|
This will disable the lexer's first char optimizations.
|
|
94
|
-
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),
|
|
95
|
-
`+(" Failed parsing: < "+
|
|
95
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),r.PRINT_ERROR(n.failedOptimizationPrefixMsg+`
|
|
96
|
+
`+(" Failed parsing: < "+g.toString()+` >
|
|
96
97
|
`)+(" Using the regexp-to-ast library version: "+t.VERSION+`
|
|
97
|
-
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+
|
|
98
|
-
`],tracer:function(
|
|
98
|
+
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+C)}}return[]}n.getOptimizedStartCodesIndices=c;function A(g,l,h){switch(g.type){case"Disjunction":for(var p=0;p<g.value.length;p++)A(g.value[p],l,h);break;case"Alternative":for(var C=g.value,p=0;p<C.length;p++){var m=C[p];switch(m.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var y=m;switch(y.type){case"Character":a(y.value,l,h);break;case"Set":if(y.complement===!0)throw Error(o);r.forEach(y.value,function(U){if(typeof U=="number")a(U,l,h);else{var w=U;if(h===!0)for(var M=w.from;M<=w.to;M++)a(M,l,h);else{for(var M=w.from;M<=w.to&&M<s.minOptimizationVal;M++)a(M,l,h);if(w.to>=s.minOptimizationVal)for(var _=w.from>=s.minOptimizationVal?w.from:s.minOptimizationVal,k=w.to,D=s.charCodeToOptimizedIndex(_),L=s.charCodeToOptimizedIndex(k),V=D;V<=L;V++)l[V]=V}}});break;case"Group":A(y.value,l,h);break;default:throw Error("Non Exhaustive Match")}var v=y.quantifier!==void 0&&y.quantifier.atLeast===0;if(y.type==="Group"&&b(y)===!1||y.type!=="Group"&&v===!1)break}break;default:throw Error("non exhaustive match!")}return r.values(l)}n.firstCharOptimizedIndices=A;function a(g,l,h){var p=s.charCodeToOptimizedIndex(g);l[p]=p,h===!0&&f(g,l)}function f(g,l){var h=String.fromCharCode(g),p=h.toUpperCase();if(p!==h){var C=s.charCodeToOptimizedIndex(p.charCodeAt(0));l[C]=C}else{var m=h.toLowerCase();if(m!==h){var C=s.charCodeToOptimizedIndex(m.charCodeAt(0));l[C]=C}}}function u(g,l){return r.find(g.value,function(h){if(typeof h=="number")return r.contains(l,h);var p=h;return r.find(l,function(C){return p.from<=C&&C<=p.to})!==void 0})}function b(g){return g.quantifier&&g.quantifier.atLeast===0?!0:g.value?r.isArray(g.value)?r.every(g.value,b):b(g.value):!1}var d=(function(g){e(l,g);function l(h){var p=g.call(this)||this;return p.targetCharCodes=h,p.found=!1,p}return l.prototype.visitChildren=function(h){if(this.found!==!0){switch(h.type){case"Lookahead":this.visitLookahead(h);return;case"NegativeLookahead":this.visitNegativeLookahead(h);return}g.prototype.visitChildren.call(this,h)}},l.prototype.visitCharacter=function(h){r.contains(this.targetCharCodes,h.value)&&(this.found=!0)},l.prototype.visitSet=function(h){h.complement?u(h,this.targetCharCodes)===void 0&&(this.found=!0):u(h,this.targetCharCodes)!==void 0&&(this.found=!0)},l})(t.BaseRegExpVisitor);function E(g,l){if(l instanceof RegExp){var h=i.getRegExpAst(l),p=new d(g);return p.visit(h),p.found}else return r.find(l,function(C){return r.contains(g,C.charCodeAt(0))})!==void 0}n.canMatchCharCode=E}),xi=Ce(n=>{var e=n&&n.__extends||(function(){var P=function(H,z){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,te){X.__proto__=te}||function(X,te){for(var ae in te)Object.prototype.hasOwnProperty.call(te,ae)&&(X[ae]=te[ae])},P(H,z)};return function(H,z){if(typeof z!="function"&&z!==null)throw new TypeError("Class extends value "+String(z)+" is not a constructor or null");P(H,z);function X(){this.constructor=H}H.prototype=z===null?Object.create(z):(X.prototype=z.prototype,new X)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.charCodeToOptimizedIndex=n.minOptimizationVal=n.buildLineBreakIssueMessage=n.LineTerminatorOptimizedTester=n.isShortPattern=n.isCustomPattern=n.cloneEmptyGroups=n.performWarningRuntimeChecks=n.performRuntimeChecks=n.addStickyFlag=n.addStartOfInput=n.findUnreachablePatterns=n.findModesThatDoNotExist=n.findInvalidGroupType=n.findDuplicatePatterns=n.findUnsupportedFlags=n.findStartOfInputAnchor=n.findEmptyMatchRegExps=n.findEndOfInputAnchor=n.findInvalidPatterns=n.findMissingPatterns=n.validatePatterns=n.analyzeTokenTypes=n.enableSticky=n.disableSticky=n.SUPPORT_STICKY=n.MODES=n.DEFAULT_MODE=void 0;var t=sn(),r=Rt(),i=ke(),s=Qo(),o=an(),c="PATTERN";n.DEFAULT_MODE="defaultMode",n.MODES="modes",n.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function A(){n.SUPPORT_STICKY=!1}n.disableSticky=A;function a(){n.SUPPORT_STICKY=!0}n.enableSticky=a;function f(P,H){H=i.defaults(H,{useSticky:n.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
99
|
+
`],tracer:function(R,B){return B()}});var z=H.tracer;z("initCharCodeToOptimizedIndexMap",function(){le()});var X;z("Reject Lexer.NA",function(){X=i.reject(P,function(R){return R[c]===r.Lexer.NA})});var te=!1,ae;z("Transform Patterns",function(){te=!1,ae=i.map(X,function(R){var B=R[c];if(i.isRegExp(B)){var T=B.source;return T.length===1&&T!=="^"&&T!=="$"&&T!=="."&&!B.ignoreCase?T:T.length===2&&T[0]==="\\"&&!i.contains(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],T[1])?T[1]:H.useSticky?k(B):_(B)}else{if(i.isFunction(B))return te=!0,{exec:B};if(i.has(B,"exec"))return te=!0,B;if(typeof B=="string"){if(B.length===1)return B;var x=B.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),Q=new RegExp(x);return H.useSticky?k(Q):_(Q)}else throw Error("non exhaustive match")}})});var me,ge,_e,Ge,Ve;z("misc mapping",function(){me=i.map(X,function(R){return R.tokenTypeIdx}),ge=i.map(X,function(R){var B=R.GROUP;if(B!==r.Lexer.SKIPPED){if(i.isString(B))return B;if(i.isUndefined(B))return!1;throw Error("non exhaustive match")}}),_e=i.map(X,function(R){var B=R.LONGER_ALT;if(B){var T=i.indexOf(X,B);return T}}),Ge=i.map(X,function(R){return R.PUSH_MODE}),Ve=i.map(X,function(R){return i.has(R,"POP_MODE")})});var Pe;z("Line Terminator Handling",function(){var R=Ae(H.lineTerminatorCharacters);Pe=i.map(X,function(B){return!1}),H.positionTracking!=="onlyOffset"&&(Pe=i.map(X,function(B){if(i.has(B,"LINE_BREAKS"))return B.LINE_BREAKS;if(J(B,R)===!1)return s.canMatchCharCode(R,B.PATTERN)}))});var F,Y,q,ne;z("Misc Mapping #2",function(){F=i.map(X,W),Y=i.map(ae,j),q=i.reduce(X,function(R,B){var T=B.GROUP;return i.isString(T)&&T!==r.Lexer.SKIPPED&&(R[T]=[]),R},{}),ne=i.map(ae,function(R,B){return{pattern:ae[B],longerAlt:_e[B],canLineTerminator:Pe[B],isCustom:F[B],short:Y[B],group:ge[B],push:Ge[B],pop:Ve[B],tokenTypeIdx:me[B],tokenType:X[B]}})});var de=!0,Te=[];return H.safeMode||z("First Char Optimization",function(){Te=i.reduce(X,function(R,B,T){if(typeof B.PATTERN=="string"){var x=B.PATTERN.charCodeAt(0),Q=ee(x);ie(R,Q,ne[T])}else if(i.isArray(B.START_CHARS_HINT)){var N;i.forEach(B.START_CHARS_HINT,function(G){var K=typeof G=="string"?G.charCodeAt(0):G,$=ee(K);N!==$&&(N=$,ie(R,$,ne[T]))})}else if(i.isRegExp(B.PATTERN))if(B.PATTERN.unicode)de=!1,H.ensureOptimizations&&i.PRINT_ERROR(""+s.failedOptimizationPrefixMsg+(" Unable to analyze < "+B.PATTERN.toString()+` > pattern.
|
|
99
100
|
`)+` The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
100
101
|
This will disable the lexer's first char optimizations.
|
|
101
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var
|
|
102
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var O=s.getOptimizedStartCodesIndices(B.PATTERN,H.ensureOptimizations);i.isEmpty(O)&&(de=!1),i.forEach(O,function(G){ie(R,G,ne[T])})}else H.ensureOptimizations&&i.PRINT_ERROR(""+s.failedOptimizationPrefixMsg+(" TokenType: <"+B.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
102
103
|
`)+` This will disable the lexer's first char optimizations.
|
|
103
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),de=!1;return
|
|
104
|
-
Token Type: ->`+
|
|
105
|
-
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:
|
|
106
|
-
Token Type: ->`+
|
|
107
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:
|
|
108
|
-
`+("Because it appears AFTER the Token Type ->"+
|
|
109
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
|
|
110
|
-
`,type:
|
|
111
|
-
`,type:
|
|
112
|
-
`,type:
|
|
113
|
-
`),type:
|
|
104
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),de=!1;return R},[])}),z("ArrayPacking",function(){Te=i.packArray(Te)}),{emptyGroups:q,patternIdxToConfig:ne,charCodeToPatternIdxToConfig:Te,hasCustom:te,canBeOptimized:de}}n.analyzeTokenTypes=f;function u(P,H){var z=[],X=d(P);z=z.concat(X.errors);var te=E(X.valid),ae=te.valid;return z=z.concat(te.errors),z=z.concat(b(ae)),z=z.concat(v(ae)),z=z.concat(S(ae,H)),z=z.concat(U(ae)),z}n.validatePatterns=u;function b(P){var H=[],z=i.filter(P,function(X){return i.isRegExp(X[c])});return H=H.concat(l(z)),H=H.concat(C(z)),H=H.concat(m(z)),H=H.concat(y(z)),H=H.concat(h(z)),H}function d(P){var H=i.filter(P,function(te){return!i.has(te,c)}),z=i.map(H,function(te){return{message:"Token Type: ->"+te.name+"<- missing static 'PATTERN' property",type:r.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[te]}}),X=i.difference(P,H);return{errors:z,valid:X}}n.findMissingPatterns=d;function E(P){var H=i.filter(P,function(te){var ae=te[c];return!i.isRegExp(ae)&&!i.isFunction(ae)&&!i.has(ae,"exec")&&!i.isString(ae)}),z=i.map(H,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:r.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[te]}}),X=i.difference(P,H);return{errors:z,valid:X}}n.findInvalidPatterns=E;var g=/[^\\][\$]/;function l(P){var H=(function(te){e(ae,te);function ae(){var me=te!==null&&te.apply(this,arguments)||this;return me.found=!1,me}return ae.prototype.visitEndAnchor=function(me){this.found=!0},ae})(t.BaseRegExpVisitor),z=i.filter(P,function(te){var ae=te[c];try{var me=o.getRegExpAst(ae),ge=new H;return ge.visit(me),ge.found}catch{return g.test(ae.source)}}),X=i.map(z,function(te){return{message:`Unexpected RegExp Anchor Error:
|
|
105
|
+
Token Type: ->`+te.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
106
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:r.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[te]}});return X}n.findEndOfInputAnchor=l;function h(P){var H=i.filter(P,function(X){var te=X[c];return te.test("")}),z=i.map(H,function(X){return{message:"Token Type: ->"+X.name+"<- static 'PATTERN' must not match an empty string",type:r.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[X]}});return z}n.findEmptyMatchRegExps=h;var p=/[^\\[][\^]|^\^/;function C(P){var H=(function(te){e(ae,te);function ae(){var me=te!==null&&te.apply(this,arguments)||this;return me.found=!1,me}return ae.prototype.visitStartAnchor=function(me){this.found=!0},ae})(t.BaseRegExpVisitor),z=i.filter(P,function(te){var ae=te[c];try{var me=o.getRegExpAst(ae),ge=new H;return ge.visit(me),ge.found}catch{return p.test(ae.source)}}),X=i.map(z,function(te){return{message:`Unexpected RegExp Anchor Error:
|
|
107
|
+
Token Type: ->`+te.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
108
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:r.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[te]}});return X}n.findStartOfInputAnchor=C;function m(P){var H=i.filter(P,function(X){var te=X[c];return te instanceof RegExp&&(te.multiline||te.global)}),z=i.map(H,function(X){return{message:"Token Type: ->"+X.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:r.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[X]}});return z}n.findUnsupportedFlags=m;function y(P){var H=[],z=i.map(P,function(ae){return i.reduce(P,function(me,ge){return ae.PATTERN.source===ge.PATTERN.source&&!i.contains(H,ge)&&ge.PATTERN!==r.Lexer.NA&&(H.push(ge),me.push(ge)),me},[])});z=i.compact(z);var X=i.filter(z,function(ae){return ae.length>1}),te=i.map(X,function(ae){var me=i.map(ae,function(_e){return _e.name}),ge=i.first(ae).PATTERN;return{message:"The same RegExp pattern ->"+ge+"<-"+("has been used in all of the following Token Types: "+me.join(", ")+" <-"),type:r.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:ae}});return te}n.findDuplicatePatterns=y;function v(P){var H=i.filter(P,function(X){if(!i.has(X,"GROUP"))return!1;var te=X.GROUP;return te!==r.Lexer.SKIPPED&&te!==r.Lexer.NA&&!i.isString(te)}),z=i.map(H,function(X){return{message:"Token Type: ->"+X.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:r.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[X]}});return z}n.findInvalidGroupType=v;function S(P,H){var z=i.filter(P,function(te){return te.PUSH_MODE!==void 0&&!i.contains(H,te.PUSH_MODE)}),X=i.map(z,function(te){var ae="Token Type: ->"+te.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+te.PUSH_MODE+"<-which does not exist";return{message:ae,type:r.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[te]}});return X}n.findModesThatDoNotExist=S;function U(P){var H=[],z=i.reduce(P,function(X,te,ae){var me=te.PATTERN;return me===r.Lexer.NA||(i.isString(me)?X.push({str:me,idx:ae,tokenType:te}):i.isRegExp(me)&&M(me)&&X.push({str:me.source,idx:ae,tokenType:te})),X},[]);return i.forEach(P,function(X,te){i.forEach(z,function(ae){var me=ae.str,ge=ae.idx,_e=ae.tokenType;if(te<ge&&w(me,X.PATTERN)){var Ge="Token: ->"+_e.name+`<- can never be matched.
|
|
109
|
+
`+("Because it appears AFTER the Token Type ->"+X.name+"<-")+`in the lexer's definition.
|
|
110
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;H.push({message:Ge,type:r.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[X,_e]})}})}),H}n.findUnreachablePatterns=U;function w(P,H){if(i.isRegExp(H)){var z=H.exec(P);return z!==null&&z.index===0}else{if(i.isFunction(H))return H(P,0,[],{});if(i.has(H,"exec"))return H.exec(P,0,[],{});if(typeof H=="string")return H===P;throw Error("non exhaustive match")}}function M(P){var H=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return i.find(H,function(z){return P.source.indexOf(z)!==-1})===void 0}function _(P){var H=P.ignoreCase?"i":"";return new RegExp("^(?:"+P.source+")",H)}n.addStartOfInput=_;function k(P){var H=P.ignoreCase?"iy":"y";return new RegExp(""+P.source,H)}n.addStickyFlag=k;function D(P,H,z){var X=[];return i.has(P,n.DEFAULT_MODE)||X.push({message:"A MultiMode Lexer cannot be initialized without a <"+n.DEFAULT_MODE+`> property in its definition
|
|
111
|
+
`,type:r.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),i.has(P,n.MODES)||X.push({message:"A MultiMode Lexer cannot be initialized without a <"+n.MODES+`> property in its definition
|
|
112
|
+
`,type:r.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),i.has(P,n.MODES)&&i.has(P,n.DEFAULT_MODE)&&!i.has(P.modes,P.defaultMode)&&X.push({message:"A MultiMode Lexer cannot be initialized with a "+n.DEFAULT_MODE+": <"+P.defaultMode+`>which does not exist
|
|
113
|
+
`,type:r.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),i.has(P,n.MODES)&&i.forEach(P.modes,function(te,ae){i.forEach(te,function(me,ge){i.isUndefined(me)&&X.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+ae+"> at index: <"+ge+`>
|
|
114
|
+
`),type:r.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),X}n.performRuntimeChecks=D;function L(P,H,z){var X=[],te=!1,ae=i.compact(i.flatten(i.mapValues(P.modes,function(_e){return _e}))),me=i.reject(ae,function(_e){return _e[c]===r.Lexer.NA}),ge=Ae(z);return H&&i.forEach(me,function(_e){var Ge=J(_e,ge);if(Ge!==!1){var Ve=Z(_e,Ge),Pe={message:Ve,type:Ge.issue,tokenType:_e};X.push(Pe)}else i.has(_e,"LINE_BREAKS")?_e.LINE_BREAKS===!0&&(te=!0):s.canMatchCharCode(ge,_e.PATTERN)&&(te=!0)}),H&&!te&&X.push({message:`Warning: No LINE_BREAKS Found.
|
|
114
115
|
This Lexer has been defined to track line and column information,
|
|
115
116
|
But none of the Token Types can be identified as matching a line terminator.
|
|
116
117
|
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
117
|
-
for details.`,type:
|
|
118
|
-
`+(" The problem is in the <"+
|
|
119
|
-
`)+(" Root cause: "+
|
|
120
|
-
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(
|
|
121
|
-
`+(" The problem is in the <"+
|
|
122
|
-
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}n.buildLineBreakIssueMessage=
|
|
123
|
-
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:
|
|
124
|
-
a boolean 2nd argument is no longer supported`);this.config=t.merge(o,f);var
|
|
125
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(f.safeMode&&f.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');
|
|
118
|
+
for details.`,type:r.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),X}n.performWarningRuntimeChecks=L;function V(P){var H={},z=i.keys(P);return i.forEach(z,function(X){var te=P[X];if(i.isArray(te))H[X]=[];else throw Error("non exhaustive match")}),H}n.cloneEmptyGroups=V;function W(P){var H=P.PATTERN;if(i.isRegExp(H))return!1;if(i.isFunction(H)||i.has(H,"exec"))return!0;if(i.isString(H))return!1;throw Error("non exhaustive match")}n.isCustomPattern=W;function j(P){return i.isString(P)&&P.length===1?P.charCodeAt(0):!1}n.isShortPattern=j,n.LineTerminatorOptimizedTester={test:function(P){for(var H=P.length,z=this.lastIndex;z<H;z++){var X=P.charCodeAt(z);if(X===10)return this.lastIndex=z+1,!0;if(X===13)return P.charCodeAt(z+1)===10?this.lastIndex=z+2:this.lastIndex=z+1,!0}return!1},lastIndex:0};function J(P,H){if(i.has(P,"LINE_BREAKS"))return!1;if(i.isRegExp(P.PATTERN)){try{s.canMatchCharCode(H,P.PATTERN)}catch(z){return{issue:r.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:z.message}}return!1}else{if(i.isString(P.PATTERN))return!1;if(W(P))return{issue:r.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Z(P,H){if(H.issue===r.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
119
|
+
`+(" The problem is in the <"+P.name+`> Token Type
|
|
120
|
+
`)+(" Root cause: "+H.errMsg+`.
|
|
121
|
+
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(H.issue===r.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
122
|
+
`+(" The problem is in the <"+P.name+`> Token Type
|
|
123
|
+
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}n.buildLineBreakIssueMessage=Z;function Ae(P){var H=i.map(P,function(z){return i.isString(z)&&z.length>0?z.charCodeAt(0):z});return H}function ie(P,H,z){P[H]===void 0?P[H]=[z]:P[H].push(z)}n.minOptimizationVal=256;var re=[];function ee(P){return P<n.minOptimizationVal?P:re[P]}n.charCodeToOptimizedIndex=ee;function le(){if(i.isEmpty(re)){re=new Array(65536);for(var P=0;P<65536;P++)re[P]=P>255?255+~~(P/255):P}}}),Et=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isTokenType=n.hasExtendingTokensTypesMapProperty=n.hasExtendingTokensTypesProperty=n.hasCategoriesProperty=n.hasShortKeyProperty=n.singleAssignCategoriesToksMap=n.assignCategoriesMapProp=n.assignCategoriesTokensProp=n.assignTokenDefaultProps=n.expandCategories=n.augmentTokenTypes=n.tokenIdxToClass=n.tokenShortNameIdx=n.tokenStructuredMatcherNoCategories=n.tokenStructuredMatcher=void 0;var e=ke();function t(g,l){var h=g.tokenTypeIdx;return h===l.tokenTypeIdx?!0:l.isParent===!0&&l.categoryMatchesMap[h]===!0}n.tokenStructuredMatcher=t;function r(g,l){return g.tokenTypeIdx===l.tokenTypeIdx}n.tokenStructuredMatcherNoCategories=r,n.tokenShortNameIdx=1,n.tokenIdxToClass={};function i(g){var l=s(g);o(l),A(l),c(l),e.forEach(l,function(h){h.isParent=h.categoryMatches.length>0})}n.augmentTokenTypes=i;function s(g){for(var l=e.cloneArr(g),h=g,p=!0;p;){h=e.compact(e.flatten(e.map(h,function(m){return m.CATEGORIES})));var C=e.difference(h,l);l=l.concat(C),e.isEmpty(C)?p=!1:h=C}return l}n.expandCategories=s;function o(g){e.forEach(g,function(l){f(l)||(n.tokenIdxToClass[n.tokenShortNameIdx]=l,l.tokenTypeIdx=n.tokenShortNameIdx++),u(l)&&!e.isArray(l.CATEGORIES)&&(l.CATEGORIES=[l.CATEGORIES]),u(l)||(l.CATEGORIES=[]),b(l)||(l.categoryMatches=[]),d(l)||(l.categoryMatchesMap={})})}n.assignTokenDefaultProps=o;function c(g){e.forEach(g,function(l){l.categoryMatches=[],e.forEach(l.categoryMatchesMap,function(h,p){l.categoryMatches.push(n.tokenIdxToClass[p].tokenTypeIdx)})})}n.assignCategoriesTokensProp=c;function A(g){e.forEach(g,function(l){a([],l)})}n.assignCategoriesMapProp=A;function a(g,l){e.forEach(g,function(h){l.categoryMatchesMap[h.tokenTypeIdx]=!0}),e.forEach(l.CATEGORIES,function(h){var p=g.concat(l);e.contains(p,h)||a(p,h)})}n.singleAssignCategoriesToksMap=a;function f(g){return e.has(g,"tokenTypeIdx")}n.hasShortKeyProperty=f;function u(g){return e.has(g,"CATEGORIES")}n.hasCategoriesProperty=u;function b(g){return e.has(g,"categoryMatches")}n.hasExtendingTokensTypesProperty=b;function d(g){return e.has(g,"categoryMatchesMap")}n.hasExtendingTokensTypesMapProperty=d;function E(g){return e.has(g,"tokenTypeIdx")}n.isTokenType=E}),Ni=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.defaultLexerErrorProvider=void 0,n.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,r,i,s){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+","+(" skipped "+r+" characters.")}}}),Rt=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Lexer=n.LexerDefinitionErrorType=void 0;var e=xi(),t=ke(),r=Et(),i=Ni(),s=an();(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"})(n.LexerDefinitionErrorType||(n.LexerDefinitionErrorType={}));var o={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
124
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:i.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(o);var c=(function(){function A(a,f){var u=this;if(f===void 0&&(f=o),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 f=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
125
|
+
a boolean 2nd argument is no longer supported`);this.config=t.merge(o,f);var b=this.config.traceInitPerf;b===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof b=="number"&&(this.traceInitMaxIdent=b,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var d,E=!0;u.TRACE_INIT("Lexer Config handling",function(){if(u.config.lineTerminatorsPattern===o.lineTerminatorsPattern)u.config.lineTerminatorsPattern=e.LineTerminatorOptimizedTester;else if(u.config.lineTerminatorCharacters===o.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
126
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(f.safeMode&&f.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)?(d={modes:{}},d.modes[e.DEFAULT_MODE]=t.cloneArr(a),d[e.DEFAULT_MODE]=e.DEFAULT_MODE):(E=!1,d=t.cloneObj(a))}),u.config.skipValidations===!1&&(u.TRACE_INIT("performRuntimeChecks",function(){u.lexerDefinitionErrors=u.lexerDefinitionErrors.concat(e.performRuntimeChecks(d,u.trackStartLines,u.config.lineTerminatorCharacters))}),u.TRACE_INIT("performWarningRuntimeChecks",function(){u.lexerDefinitionWarning=u.lexerDefinitionWarning.concat(e.performWarningRuntimeChecks(d,u.trackStartLines,u.config.lineTerminatorCharacters))})),d.modes=d.modes?d.modes:{},t.forEach(d.modes,function(p,C){d.modes[C]=t.reject(p,function(m){return t.isUndefined(m)})});var g=t.keys(d.modes);if(t.forEach(d.modes,function(p,C){u.TRACE_INIT("Mode: <"+C+"> processing",function(){if(u.modes.push(C),u.config.skipValidations===!1&&u.TRACE_INIT("validatePatterns",function(){u.lexerDefinitionErrors=u.lexerDefinitionErrors.concat(e.validatePatterns(p,g))}),t.isEmpty(u.lexerDefinitionErrors)){r.augmentTokenTypes(p);var m;u.TRACE_INIT("analyzeTokenTypes",function(){m=e.analyzeTokenTypes(p,{lineTerminatorCharacters:u.config.lineTerminatorCharacters,positionTracking:f.positionTracking,ensureOptimizations:f.ensureOptimizations,safeMode:f.safeMode,tracer:u.TRACE_INIT.bind(u)})}),u.patternIdxToConfig[C]=m.patternIdxToConfig,u.charCodeToPatternIdxToConfig[C]=m.charCodeToPatternIdxToConfig,u.emptyGroups=t.merge(u.emptyGroups,m.emptyGroups),u.hasCustom=m.hasCustom||u.hasCustom,u.canModeBeOptimized[C]=m.canBeOptimized}})}),u.defaultMode=d.defaultMode,!t.isEmpty(u.lexerDefinitionErrors)&&!u.config.deferDefinitionErrorsHandling){var l=t.map(u.lexerDefinitionErrors,function(p){return p.message}),h=l.join(`-----------------------
|
|
126
127
|
`);throw new Error(`Errors detected in definition of Lexer:
|
|
127
|
-
`+
|
|
128
|
+
`+h)}t.forEach(u.lexerDefinitionWarning,function(p){t.PRINT_WARNING(p.message)}),u.TRACE_INIT("Choosing sub-methods implementations",function(){if(e.SUPPORT_STICKY?(u.chopInput=t.IDENTITY,u.match=u.matchWithTest):(u.updateLastIndex=t.NOOP,u.match=u.matchWithExec),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 p=t.reduce(u.canModeBeOptimized,function(C,m,y){return m===!1&&C.push(y),C},[]);if(f.ensureOptimizations&&!t.isEmpty(p))throw Error("Lexer Modes: < "+p.join(", ")+` > cannot be optimized.
|
|
128
129
|
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
129
|
-
Or inspect the console log for details on how to resolve these issues.`)}),
|
|
130
|
+
Or inspect the console log for details on how to resolve these issues.`)}),u.TRACE_INIT("clearRegExpParserCache",function(){s.clearRegExpParserCache()}),u.TRACE_INIT("toFastProperties",function(){t.toFastProperties(u)})})}return A.prototype.tokenize=function(a,f){if(f===void 0&&(f=this.defaultMode),!t.isEmpty(this.lexerDefinitionErrors)){var u=t.map(this.lexerDefinitionErrors,function(E){return E.message}),b=u.join(`-----------------------
|
|
130
131
|
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
131
|
-
`+
|
|
132
|
-
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return e.has(E,c)&&(I.CATEGORIES=E[c]),i.augmentTokenTypes([I]),e.has(E,s)&&(I.LABEL=E[s]),e.has(E,f)&&(I.GROUP=E[f]),e.has(E,g)&&(I.POP_MODE=E[g]),e.has(E,h)&&(I.PUSH_MODE=E[h]),e.has(E,p)&&(I.LONGER_ALT=E[p]),e.has(E,T)&&(I.LINE_BREAKS=E[T]),e.has(E,m)&&(I.START_CHARS_HINT=E[m]),I}n.EOF=l({name:"EOF",pattern:t.Lexer.NA}),i.augmentTokenTypes([n.EOF]);function y(E,S,I,k,H,x,B,P){return{image:S,startOffset:I,endOffset:k,startLine:H,endLine:x,startColumn:B,endColumn:P,tokenTypeIdx:E.tokenTypeIdx,tokenType:E}}n.createTokenInstance=y;function v(E,S){return i.tokenStructuredMatcher(E,S)}n.tokenMatcher=v}),He=ve(n=>{var e=n&&n.__extends||(function(){var d=function(y,v){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,S){E.__proto__=S}||function(E,S){for(var I in S)Object.prototype.hasOwnProperty.call(S,I)&&(E[I]=S[I])},d(y,v)};return function(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");d(y,v);function E(){this.constructor=y}y.prototype=v===null?Object.create(v):(E.prototype=v.prototype,new E)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.serializeProduction=n.serializeGrammar=n.Terminal=n.Alternation=n.RepetitionWithSeparator=n.Repetition=n.RepetitionMandatoryWithSeparator=n.RepetitionMandatory=n.Option=n.Alternative=n.Rule=n.NonTerminal=n.AbstractProduction=void 0;var t=xe(),i=nt(),r=(function(){function d(y){this._definition=y}return Object.defineProperty(d.prototype,"definition",{get:function(){return this._definition},set:function(y){this._definition=y},enumerable:!1,configurable:!0}),d.prototype.accept=function(y){y.visit(this),t.forEach(this.definition,function(v){v.accept(y)})},d})();n.AbstractProduction=r;var a=(function(d){e(y,d);function y(v){var E=d.call(this,[])||this;return E.idx=1,t.assign(E,t.pick(v,function(S){return S!==void 0})),E}return Object.defineProperty(y.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(v){},enumerable:!1,configurable:!0}),y.prototype.accept=function(v){v.visit(this)},y})(r);n.NonTerminal=a;var o=(function(d){e(y,d);function y(v){var E=d.call(this,v.definition)||this;return E.orgText="",t.assign(E,t.pick(v,function(S){return S!==void 0})),E}return y})(r);n.Rule=o;var u=(function(d){e(y,d);function y(v){var E=d.call(this,v.definition)||this;return E.ignoreAmbiguities=!1,t.assign(E,t.pick(v,function(S){return S!==void 0})),E}return y})(r);n.Alternative=u;var c=(function(d){e(y,d);function y(v){var E=d.call(this,v.definition)||this;return E.idx=1,t.assign(E,t.pick(v,function(S){return S!==void 0})),E}return y})(r);n.Option=c;var s=(function(d){e(y,d);function y(v){var E=d.call(this,v.definition)||this;return E.idx=1,t.assign(E,t.pick(v,function(S){return S!==void 0})),E}return y})(r);n.RepetitionMandatory=s;var f=(function(d){e(y,d);function y(v){var E=d.call(this,v.definition)||this;return E.idx=1,t.assign(E,t.pick(v,function(S){return S!==void 0})),E}return y})(r);n.RepetitionMandatoryWithSeparator=f;var h=(function(d){e(y,d);function y(v){var E=d.call(this,v.definition)||this;return E.idx=1,t.assign(E,t.pick(v,function(S){return S!==void 0})),E}return y})(r);n.Repetition=h;var g=(function(d){e(y,d);function y(v){var E=d.call(this,v.definition)||this;return E.idx=1,t.assign(E,t.pick(v,function(S){return S!==void 0})),E}return y})(r);n.RepetitionWithSeparator=g;var p=(function(d){e(y,d);function y(v){var E=d.call(this,v.definition)||this;return E.idx=1,E.ignoreAmbiguities=!1,E.hasPredicates=!1,t.assign(E,t.pick(v,function(S){return S!==void 0})),E}return Object.defineProperty(y.prototype,"definition",{get:function(){return this._definition},set:function(v){this._definition=v},enumerable:!1,configurable:!0}),y})(r);n.Alternation=p;var T=(function(){function d(y){this.idx=1,t.assign(this,t.pick(y,function(v){return v!==void 0}))}return d.prototype.accept=function(y){y.visit(this)},d})();n.Terminal=T;function m(d){return t.map(d,l)}n.serializeGrammar=m;function l(d){function y(S){return t.map(S,l)}if(d instanceof a)return{type:"NonTerminal",name:d.nonTerminalName,idx:d.idx};if(d instanceof u)return{type:"Alternative",definition:y(d.definition)};if(d instanceof c)return{type:"Option",idx:d.idx,definition:y(d.definition)};if(d instanceof s)return{type:"RepetitionMandatory",idx:d.idx,definition:y(d.definition)};if(d instanceof f)return{type:"RepetitionMandatoryWithSeparator",idx:d.idx,separator:l(new T({terminalType:d.separator})),definition:y(d.definition)};if(d instanceof g)return{type:"RepetitionWithSeparator",idx:d.idx,separator:l(new T({terminalType:d.separator})),definition:y(d.definition)};if(d instanceof h)return{type:"Repetition",idx:d.idx,definition:y(d.definition)};if(d instanceof p)return{type:"Alternation",idx:d.idx,definition:y(d.definition)};if(d instanceof T){var v={type:"Terminal",name:d.terminalType.name,label:i.tokenLabel(d.terminalType),idx:d.idx},E=d.terminalType.PATTERN;return d.terminalType.PATTERN&&(v.pattern=t.isRegExp(E)?E.source:E),v}else{if(d instanceof o)return{type:"Rule",name:d.name,orgText:d.orgText,definition:y(d.definition)};throw Error("non exhaustive match")}}n.serializeProduction=l}),jt=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RestWalker=void 0;var e=xe(),t=He(),i=(function(){function a(){}return a.prototype.walk=function(o,u){var c=this;u===void 0&&(u=[]),e.forEach(o.definition,function(s,f){var h=e.drop(o.definition,f+1);if(s instanceof t.NonTerminal)c.walkProdRef(s,h,u);else if(s instanceof t.Terminal)c.walkTerminal(s,h,u);else if(s instanceof t.Alternative)c.walkFlat(s,h,u);else if(s instanceof t.Option)c.walkOption(s,h,u);else if(s instanceof t.RepetitionMandatory)c.walkAtLeastOne(s,h,u);else if(s instanceof t.RepetitionMandatoryWithSeparator)c.walkAtLeastOneSep(s,h,u);else if(s instanceof t.RepetitionWithSeparator)c.walkManySep(s,h,u);else if(s instanceof t.Repetition)c.walkMany(s,h,u);else if(s instanceof t.Alternation)c.walkOr(s,h,u);else throw Error("non exhaustive match")})},a.prototype.walkTerminal=function(o,u,c){},a.prototype.walkProdRef=function(o,u,c){},a.prototype.walkFlat=function(o,u,c){var s=u.concat(c);this.walk(o,s)},a.prototype.walkOption=function(o,u,c){var s=u.concat(c);this.walk(o,s)},a.prototype.walkAtLeastOne=function(o,u,c){var s=[new t.Option({definition:o.definition})].concat(u,c);this.walk(o,s)},a.prototype.walkAtLeastOneSep=function(o,u,c){var s=r(o,u,c);this.walk(o,s)},a.prototype.walkMany=function(o,u,c){var s=[new t.Option({definition:o.definition})].concat(u,c);this.walk(o,s)},a.prototype.walkManySep=function(o,u,c){var s=r(o,u,c);this.walk(o,s)},a.prototype.walkOr=function(o,u,c){var s=this,f=u.concat(c);e.forEach(o.definition,function(h){var g=new t.Alternative({definition:[h]});s.walk(g,f)})},a})();n.RestWalker=i;function r(a,o,u){var c=[new t.Option({definition:[new t.Terminal({terminalType:a.separator})].concat(a.definition)})],s=c.concat(o,u);return s}}),ft=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GAstVisitor=void 0;var e=He(),t=(function(){function i(){}return i.prototype.visit=function(r){var a=r;switch(a.constructor){case e.NonTerminal:return this.visitNonTerminal(a);case e.Alternative:return this.visitAlternative(a);case e.Option:return this.visitOption(a);case e.RepetitionMandatory:return this.visitRepetitionMandatory(a);case e.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(a);case e.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(a);case e.Repetition:return this.visitRepetition(a);case e.Alternation:return this.visitAlternation(a);case e.Terminal:return this.visitTerminal(a);case e.Rule:return this.visitRule(a);default:throw Error("non exhaustive match")}},i.prototype.visitNonTerminal=function(r){},i.prototype.visitAlternative=function(r){},i.prototype.visitOption=function(r){},i.prototype.visitRepetition=function(r){},i.prototype.visitRepetitionMandatory=function(r){},i.prototype.visitRepetitionMandatoryWithSeparator=function(r){},i.prototype.visitRepetitionWithSeparator=function(r){},i.prototype.visitAlternation=function(r){},i.prototype.visitTerminal=function(r){},i.prototype.visitRule=function(r){},i})();n.GAstVisitor=t}),Tt=ve(n=>{var e=n&&n.__extends||(function(){var g=function(p,T){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,l){m.__proto__=l}||function(m,l){for(var d in l)Object.prototype.hasOwnProperty.call(l,d)&&(m[d]=l[d])},g(p,T)};return function(p,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");g(p,T);function m(){this.constructor=p}p.prototype=T===null?Object.create(T):(m.prototype=T.prototype,new m)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.collectMethods=n.DslMethodsCollectorVisitor=n.getProductionDslName=n.isBranchingProd=n.isOptionalProd=n.isSequenceProd=void 0;var t=xe(),i=He(),r=ft();function a(g){return g instanceof i.Alternative||g instanceof i.Option||g instanceof i.Repetition||g instanceof i.RepetitionMandatory||g instanceof i.RepetitionMandatoryWithSeparator||g instanceof i.RepetitionWithSeparator||g instanceof i.Terminal||g instanceof i.Rule}n.isSequenceProd=a;function o(g,p){p===void 0&&(p=[]);var T=g instanceof i.Option||g instanceof i.Repetition||g instanceof i.RepetitionWithSeparator;return T?!0:g instanceof i.Alternation?t.some(g.definition,function(m){return o(m,p)}):g instanceof i.NonTerminal&&t.contains(p,g)?!1:g instanceof i.AbstractProduction?(g instanceof i.NonTerminal&&p.push(g),t.every(g.definition,function(m){return o(m,p)})):!1}n.isOptionalProd=o;function u(g){return g instanceof i.Alternation}n.isBranchingProd=u;function c(g){if(g instanceof i.NonTerminal)return"SUBRULE";if(g instanceof i.Option)return"OPTION";if(g instanceof i.Alternation)return"OR";if(g instanceof i.RepetitionMandatory)return"AT_LEAST_ONE";if(g instanceof i.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(g instanceof i.RepetitionWithSeparator)return"MANY_SEP";if(g instanceof i.Repetition)return"MANY";if(g instanceof i.Terminal)return"CONSUME";throw Error("non exhaustive match")}n.getProductionDslName=c;var s=(function(g){e(p,g);function p(){var T=g!==null&&g.apply(this,arguments)||this;return T.separator="-",T.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},T}return p.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},p.prototype.visitTerminal=function(T){var m=T.terminalType.name+this.separator+"Terminal";t.has(this.dslMethods,m)||(this.dslMethods[m]=[]),this.dslMethods[m].push(T)},p.prototype.visitNonTerminal=function(T){var m=T.nonTerminalName+this.separator+"Terminal";t.has(this.dslMethods,m)||(this.dslMethods[m]=[]),this.dslMethods[m].push(T)},p.prototype.visitOption=function(T){this.dslMethods.option.push(T)},p.prototype.visitRepetitionWithSeparator=function(T){this.dslMethods.repetitionWithSeparator.push(T)},p.prototype.visitRepetitionMandatory=function(T){this.dslMethods.repetitionMandatory.push(T)},p.prototype.visitRepetitionMandatoryWithSeparator=function(T){this.dslMethods.repetitionMandatoryWithSeparator.push(T)},p.prototype.visitRepetition=function(T){this.dslMethods.repetition.push(T)},p.prototype.visitAlternation=function(T){this.dslMethods.alternation.push(T)},p})(r.GAstVisitor);n.DslMethodsCollectorVisitor=s;var f=new s;function h(g){f.reset(),g.accept(f);var p=f.dslMethods;return f.reset(),p}n.collectMethods=h}),bn=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.firstForTerminal=n.firstForBranching=n.firstForSequence=n.first=void 0;var e=xe(),t=He(),i=Tt();function r(c){if(c instanceof t.NonTerminal)return r(c.referencedRule);if(c instanceof t.Terminal)return u(c);if(i.isSequenceProd(c))return a(c);if(i.isBranchingProd(c))return o(c);throw Error("non exhaustive match")}n.first=r;function a(c){for(var s=[],f=c.definition,h=0,g=f.length>h,p,T=!0;g&&T;)p=f[h],T=i.isOptionalProd(p),s=s.concat(r(p)),h=h+1,g=f.length>h;return e.uniq(s)}n.firstForSequence=a;function o(c){var s=e.map(c.definition,function(f){return r(f)});return e.uniq(e.flatten(s))}n.firstForBranching=o;function u(c){return[c.terminalType]}n.firstForTerminal=u}),Ln=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IN=void 0,n.IN="_~IN~_"}),ri=ve(n=>{var e=n&&n.__extends||(function(){var h=function(g,p){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,m){T.__proto__=m}||function(T,m){for(var l in m)Object.prototype.hasOwnProperty.call(m,l)&&(T[l]=m[l])},h(g,p)};return function(g,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");h(g,p);function T(){this.constructor=g}g.prototype=p===null?Object.create(p):(T.prototype=p.prototype,new T)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.buildInProdFollowPrefix=n.buildBetweenProdsFollowPrefix=n.computeAllProdsFollows=n.ResyncFollowsWalker=void 0;var t=jt(),i=bn(),r=xe(),a=Ln(),o=He(),u=(function(h){e(g,h);function g(p){var T=h.call(this)||this;return T.topProd=p,T.follows={},T}return g.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},g.prototype.walkTerminal=function(p,T,m){},g.prototype.walkProdRef=function(p,T,m){var l=s(p.referencedRule,p.idx)+this.topProd.name,d=T.concat(m),y=new o.Alternative({definition:d}),v=i.first(y);this.follows[l]=v},g})(t.RestWalker);n.ResyncFollowsWalker=u;function c(h){var g={};return r.forEach(h,function(p){var T=new u(p).startWalking();r.assign(g,T)}),g}n.computeAllProdsFollows=c;function s(h,g){return h.name+g+a.IN}n.buildBetweenProdsFollowPrefix=s;function f(h){var g=h.terminalType.name;return g+h.idx+a.IN}n.buildInProdFollowPrefix=f}),Et=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.defaultGrammarValidatorErrorProvider=n.defaultGrammarResolverErrorProvider=n.defaultParserErrorProvider=void 0;var e=nt(),t=xe(),i=xe(),r=He(),a=Tt();n.defaultParserErrorProvider={buildMismatchTokenMessage:function(o){var u=o.expected,c=o.actual;o.previous,o.ruleName;var s=e.hasTokenLabel(u),f=s?"--> "+e.tokenLabel(u)+" <--":"token of type --> "+u.name+" <--",h="Expecting "+f+" but found --> '"+c.image+"' <--";return h},buildNotAllInputParsedMessage:function(o){var u=o.firstRedundant;return o.ruleName,"Redundant input, expecting EOF but found: "+u.image},buildNoViableAltMessage:function(o){var u=o.expectedPathsPerAlt,c=o.actual;o.previous;var s=o.customUserDescription;o.ruleName;var f="Expecting: ",h=i.first(c).image,g=`
|
|
133
|
-
but found: '`+
|
|
134
|
-
`+
|
|
135
|
-
`);return f+l+
|
|
136
|
-
but found: '`+
|
|
137
|
-
`+("<"+
|
|
138
|
-
inside top level rule: ->`+o.name+"<-";return
|
|
139
|
-
appears more than once (`+
|
|
132
|
+
`+b)}var d=this.tokenizeInternal(a,f);return d},A.prototype.tokenizeInternal=function(a,f){var u=this,b,d,E,g,l,h,p,C,m,y,v,S,U,w,M=a,_=M.length,k=0,D=0,L=this.hasCustom?0:Math.floor(a.length/10),V=new Array(L),W=[],j=this.trackStartLines?1:void 0,J=this.trackStartLines?1:void 0,Z=e.cloneEmptyGroups(this.emptyGroups),Ae=this.trackStartLines,ie=this.config.lineTerminatorsPattern,re=0,ee=[],le=[],P=[],H=[];Object.freeze(H);var z=void 0;function X(){return ee}function te(N){var O=e.charCodeToOptimizedIndex(N),G=le[O];return G===void 0?H:G}var ae=function(N){if(P.length===1&&N.tokenType.PUSH_MODE===void 0){var O=u.config.errorMessageProvider.buildUnableToPopLexerModeMessage(N);W.push({offset:N.startOffset,line:N.startLine!==void 0?N.startLine:void 0,column:N.startColumn!==void 0?N.startColumn:void 0,length:N.image.length,message:O})}else{P.pop();var G=t.last(P);ee=u.patternIdxToConfig[G],le=u.charCodeToPatternIdxToConfig[G],re=ee.length;var K=u.canModeBeOptimized[G]&&u.config.safeMode===!1;le&&K?z=te:z=X}};function me(N){P.push(N),le=this.charCodeToPatternIdxToConfig[N],ee=this.patternIdxToConfig[N],re=ee.length,re=ee.length;var O=this.canModeBeOptimized[N]&&this.config.safeMode===!1;le&&O?z=te:z=X}me.call(this,f);for(var ge;k<_;){l=null;var _e=M.charCodeAt(k),Ge=z(_e),Ve=Ge.length;for(b=0;b<Ve;b++){ge=Ge[b];var Pe=ge.pattern;h=null;var F=ge.short;if(F!==!1?_e===F&&(l=Pe):ge.isCustom===!0?(w=Pe.exec(M,k,V,Z),w!==null?(l=w[0],w.payload!==void 0&&(h=w.payload)):l=null):(this.updateLastIndex(Pe,k),l=this.match(Pe,a,k)),l!==null){if(g=ge.longerAlt,g!==void 0){var Y=ee[g],q=Y.pattern;p=null,Y.isCustom===!0?(w=q.exec(M,k,V,Z),w!==null?(E=w[0],w.payload!==void 0&&(p=w.payload)):E=null):(this.updateLastIndex(q,k),E=this.match(q,a,k)),E&&E.length>l.length&&(l=E,h=p,ge=Y)}break}}if(l!==null){if(C=l.length,m=ge.group,m!==void 0&&(y=ge.tokenTypeIdx,v=this.createTokenInstance(l,k,y,ge.tokenType,j,J,C),this.handlePayload(v,h),m===!1?D=this.addToken(V,D,v):Z[m].push(v)),a=this.chopInput(a,C),k=k+C,J=this.computeNewColumn(J,C),Ae===!0&&ge.canLineTerminator===!0){var ne=0,de=void 0,Te=void 0;ie.lastIndex=0;do de=ie.test(l),de===!0&&(Te=ie.lastIndex-1,ne++);while(de===!0);ne!==0&&(j=j+ne,J=C-Te,this.updateTokenEndLineColumnLocation(v,m,Te,ne,j,J,C))}this.handleModes(ge,ae,me,v)}else{for(var R=k,B=j,T=J,x=!1;!x&&k<_;)for(M.charCodeAt(k),a=this.chopInput(a,1),k++,d=0;d<re;d++){var Q=ee[d],Pe=Q.pattern,F=Q.short;if(F!==!1?M.charCodeAt(k)===F&&(x=!0):Q.isCustom===!0?x=Pe.exec(M,k,V,Z)!==null:(this.updateLastIndex(Pe,k),x=Pe.exec(a)!==null),x===!0)break}S=k-R,U=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(M,R,S,B,T),W.push({offset:R,line:B,column:T,length:S,message:U})}}return this.hasCustom||(V.length=D),{tokens:V,groups:Z,errors:W}},A.prototype.handleModes=function(a,f,u,b){if(a.pop===!0){var d=a.push;f(b),d!==void 0&&u.call(this,d)}else a.push!==void 0&&u.call(this,a.push)},A.prototype.chopInput=function(a,f){return a.substring(f)},A.prototype.updateLastIndex=function(a,f){a.lastIndex=f},A.prototype.updateTokenEndLineColumnLocation=function(a,f,u,b,d,E,g){var l,h;f!==void 0&&(l=u===g-1,h=l?-1:0,b===1&&l===!0||(a.endLine=d+h,a.endColumn=E-1+-h))},A.prototype.computeNewColumn=function(a,f){return a+f},A.prototype.createTokenInstance=function(){for(var a=[],f=0;f<arguments.length;f++)a[f]=arguments[f];return null},A.prototype.createOffsetOnlyToken=function(a,f,u,b){return{image:a,startOffset:f,tokenTypeIdx:u,tokenType:b}},A.prototype.createStartOnlyToken=function(a,f,u,b,d,E){return{image:a,startOffset:f,startLine:d,startColumn:E,tokenTypeIdx:u,tokenType:b}},A.prototype.createFullToken=function(a,f,u,b,d,E,g){return{image:a,startOffset:f,endOffset:f+g-1,startLine:d,endLine:d,startColumn:E,endColumn:E+g-1,tokenTypeIdx:u,tokenType:b}},A.prototype.addToken=function(a,f,u){return 666},A.prototype.addTokenUsingPush=function(a,f,u){return a.push(u),f},A.prototype.addTokenUsingMemberAccess=function(a,f,u){return a[f]=u,f++,f},A.prototype.handlePayload=function(a,f){},A.prototype.handlePayloadNoCustom=function(a,f){},A.prototype.handlePayloadWithCustom=function(a,f){f!==null&&(a.payload=f)},A.prototype.match=function(a,f,u){return null},A.prototype.matchWithTest=function(a,f,u){var b=a.test(f);return b===!0?f.substring(u,a.lastIndex):null},A.prototype.matchWithExec=function(a,f){var u=a.exec(f);return u!==null?u[0]:u},A.prototype.TRACE_INIT=function(a,f){if(this.traceInitPerf===!0){this.traceInitIndent++;var u=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(u+"--> <"+a+">");var b=t.timer(f),d=b.time,E=b.value,g=d>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&g(u+"<-- <"+a+"> time: "+d+"ms"),this.traceInitIndent--,E}else return f()},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})();n.Lexer=c}),st=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tokenMatcher=n.createTokenInstance=n.EOF=n.createToken=n.hasTokenLabel=n.tokenName=n.tokenLabel=void 0;var e=ke(),t=Rt(),r=Et();function i(m){return o(m)?m.LABEL:m.name}n.tokenLabel=i;function s(m){return m.name}n.tokenName=s;function o(m){return e.isString(m.LABEL)&&m.LABEL!==""}n.hasTokenLabel=o;var c="parent",A="categories",a="label",f="group",u="push_mode",b="pop_mode",d="longer_alt",E="line_breaks",g="start_chars_hint";function l(m){return h(m)}n.createToken=l;function h(m){var y=m.pattern,v={};if(v.name=m.name,e.isUndefined(y)||(v.PATTERN=y),e.has(m,c))throw`The parent property is no longer supported.
|
|
133
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return e.has(m,A)&&(v.CATEGORIES=m[A]),r.augmentTokenTypes([v]),e.has(m,a)&&(v.LABEL=m[a]),e.has(m,f)&&(v.GROUP=m[f]),e.has(m,b)&&(v.POP_MODE=m[b]),e.has(m,u)&&(v.PUSH_MODE=m[u]),e.has(m,d)&&(v.LONGER_ALT=m[d]),e.has(m,E)&&(v.LINE_BREAKS=m[E]),e.has(m,g)&&(v.START_CHARS_HINT=m[g]),v}n.EOF=l({name:"EOF",pattern:t.Lexer.NA}),r.augmentTokenTypes([n.EOF]);function p(m,y,v,S,U,w,M,_){return{image:y,startOffset:v,endOffset:S,startLine:U,endLine:w,startColumn:M,endColumn:_,tokenTypeIdx:m.tokenTypeIdx,tokenType:m}}n.createTokenInstance=p;function C(m,y){return r.tokenStructuredMatcher(m,y)}n.tokenMatcher=C}),ze=Ce(n=>{var e=n&&n.__extends||(function(){var h=function(p,C){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,y){m.__proto__=y}||function(m,y){for(var v in y)Object.prototype.hasOwnProperty.call(y,v)&&(m[v]=y[v])},h(p,C)};return function(p,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");h(p,C);function m(){this.constructor=p}p.prototype=C===null?Object.create(C):(m.prototype=C.prototype,new m)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.serializeProduction=n.serializeGrammar=n.Terminal=n.Alternation=n.RepetitionWithSeparator=n.Repetition=n.RepetitionMandatoryWithSeparator=n.RepetitionMandatory=n.Option=n.Alternative=n.Rule=n.NonTerminal=n.AbstractProduction=void 0;var t=ke(),r=st(),i=(function(){function h(p){this._definition=p}return Object.defineProperty(h.prototype,"definition",{get:function(){return this._definition},set:function(p){this._definition=p},enumerable:!1,configurable:!0}),h.prototype.accept=function(p){p.visit(this),t.forEach(this.definition,function(C){C.accept(p)})},h})();n.AbstractProduction=i;var s=(function(h){e(p,h);function p(C){var m=h.call(this,[])||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return Object.defineProperty(p.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(C){},enumerable:!1,configurable:!0}),p.prototype.accept=function(C){C.visit(this)},p})(i);n.NonTerminal=s;var o=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.orgText="",t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);n.Rule=o;var c=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.ignoreAmbiguities=!1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);n.Alternative=c;var A=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);n.Option=A;var a=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);n.RepetitionMandatory=a;var f=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);n.RepetitionMandatoryWithSeparator=f;var u=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);n.Repetition=u;var b=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return p})(i);n.RepetitionWithSeparator=b;var d=(function(h){e(p,h);function p(C){var m=h.call(this,C.definition)||this;return m.idx=1,m.ignoreAmbiguities=!1,m.hasPredicates=!1,t.assign(m,t.pick(C,function(y){return y!==void 0})),m}return Object.defineProperty(p.prototype,"definition",{get:function(){return this._definition},set:function(C){this._definition=C},enumerable:!1,configurable:!0}),p})(i);n.Alternation=d;var E=(function(){function h(p){this.idx=1,t.assign(this,t.pick(p,function(C){return C!==void 0}))}return h.prototype.accept=function(p){p.visit(this)},h})();n.Terminal=E;function g(h){return t.map(h,l)}n.serializeGrammar=g;function l(h){function p(y){return t.map(y,l)}if(h instanceof s)return{type:"NonTerminal",name:h.nonTerminalName,idx:h.idx};if(h instanceof c)return{type:"Alternative",definition:p(h.definition)};if(h instanceof A)return{type:"Option",idx:h.idx,definition:p(h.definition)};if(h instanceof a)return{type:"RepetitionMandatory",idx:h.idx,definition:p(h.definition)};if(h instanceof f)return{type:"RepetitionMandatoryWithSeparator",idx:h.idx,separator:l(new E({terminalType:h.separator})),definition:p(h.definition)};if(h instanceof b)return{type:"RepetitionWithSeparator",idx:h.idx,separator:l(new E({terminalType:h.separator})),definition:p(h.definition)};if(h instanceof u)return{type:"Repetition",idx:h.idx,definition:p(h.definition)};if(h instanceof d)return{type:"Alternation",idx:h.idx,definition:p(h.definition)};if(h instanceof E){var C={type:"Terminal",name:h.terminalType.name,label:r.tokenLabel(h.terminalType),idx:h.idx},m=h.terminalType.PATTERN;return h.terminalType.PATTERN&&(C.pattern=t.isRegExp(m)?m.source:m),C}else{if(h instanceof o)return{type:"Rule",name:h.name,orgText:h.orgText,definition:p(h.definition)};throw Error("non exhaustive match")}}n.serializeProduction=l}),An=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RestWalker=void 0;var e=ke(),t=ze(),r=(function(){function s(){}return s.prototype.walk=function(o,c){var A=this;c===void 0&&(c=[]),e.forEach(o.definition,function(a,f){var u=e.drop(o.definition,f+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")})},s.prototype.walkTerminal=function(o,c,A){},s.prototype.walkProdRef=function(o,c,A){},s.prototype.walkFlat=function(o,c,A){var a=c.concat(A);this.walk(o,a)},s.prototype.walkOption=function(o,c,A){var a=c.concat(A);this.walk(o,a)},s.prototype.walkAtLeastOne=function(o,c,A){var a=[new t.Option({definition:o.definition})].concat(c,A);this.walk(o,a)},s.prototype.walkAtLeastOneSep=function(o,c,A){var a=i(o,c,A);this.walk(o,a)},s.prototype.walkMany=function(o,c,A){var a=[new t.Option({definition:o.definition})].concat(c,A);this.walk(o,a)},s.prototype.walkManySep=function(o,c,A){var a=i(o,c,A);this.walk(o,a)},s.prototype.walkOr=function(o,c,A){var a=this,f=c.concat(A);e.forEach(o.definition,function(u){var b=new t.Alternative({definition:[u]});a.walk(b,f)})},s})();n.RestWalker=r;function i(s,o,c){var A=[new t.Option({definition:[new t.Terminal({terminalType:s.separator})].concat(s.definition)})],a=A.concat(o,c);return a}}),It=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GAstVisitor=void 0;var e=ze(),t=(function(){function r(){}return r.prototype.visit=function(i){var s=i;switch(s.constructor){case e.NonTerminal:return this.visitNonTerminal(s);case e.Alternative:return this.visitAlternative(s);case e.Option:return this.visitOption(s);case e.RepetitionMandatory:return this.visitRepetitionMandatory(s);case e.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(s);case e.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(s);case e.Repetition:return this.visitRepetition(s);case e.Alternation:return this.visitAlternation(s);case e.Terminal:return this.visitTerminal(s);case e.Rule:return this.visitRule(s);default:throw Error("non exhaustive match")}},r.prototype.visitNonTerminal=function(i){},r.prototype.visitAlternative=function(i){},r.prototype.visitOption=function(i){},r.prototype.visitRepetition=function(i){},r.prototype.visitRepetitionMandatory=function(i){},r.prototype.visitRepetitionMandatoryWithSeparator=function(i){},r.prototype.visitRepetitionWithSeparator=function(i){},r.prototype.visitAlternation=function(i){},r.prototype.visitTerminal=function(i){},r.prototype.visitRule=function(i){},r})();n.GAstVisitor=t}),Qt=Ce(n=>{var e=n&&n.__extends||(function(){var b=function(d,E){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,l){g.__proto__=l}||function(g,l){for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(g[h]=l[h])},b(d,E)};return function(d,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");b(d,E);function g(){this.constructor=d}d.prototype=E===null?Object.create(E):(g.prototype=E.prototype,new g)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.collectMethods=n.DslMethodsCollectorVisitor=n.getProductionDslName=n.isBranchingProd=n.isOptionalProd=n.isSequenceProd=void 0;var t=ke(),r=ze(),i=It();function s(b){return b instanceof r.Alternative||b instanceof r.Option||b instanceof r.Repetition||b instanceof r.RepetitionMandatory||b instanceof r.RepetitionMandatoryWithSeparator||b instanceof r.RepetitionWithSeparator||b instanceof r.Terminal||b instanceof r.Rule}n.isSequenceProd=s;function o(b,d){d===void 0&&(d=[]);var E=b instanceof r.Option||b instanceof r.Repetition||b instanceof r.RepetitionWithSeparator;return E?!0:b instanceof r.Alternation?t.some(b.definition,function(g){return o(g,d)}):b instanceof r.NonTerminal&&t.contains(d,b)?!1:b instanceof r.AbstractProduction?(b instanceof r.NonTerminal&&d.push(b),t.every(b.definition,function(g){return o(g,d)})):!1}n.isOptionalProd=o;function c(b){return b instanceof r.Alternation}n.isBranchingProd=c;function A(b){if(b instanceof r.NonTerminal)return"SUBRULE";if(b instanceof r.Option)return"OPTION";if(b instanceof r.Alternation)return"OR";if(b instanceof r.RepetitionMandatory)return"AT_LEAST_ONE";if(b instanceof r.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(b instanceof r.RepetitionWithSeparator)return"MANY_SEP";if(b instanceof r.Repetition)return"MANY";if(b instanceof r.Terminal)return"CONSUME";throw Error("non exhaustive match")}n.getProductionDslName=A;var a=(function(b){e(d,b);function d(){var E=b!==null&&b.apply(this,arguments)||this;return E.separator="-",E.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},E}return d.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},d.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)},d.prototype.visitNonTerminal=function(E){var g=E.nonTerminalName+this.separator+"Terminal";t.has(this.dslMethods,g)||(this.dslMethods[g]=[]),this.dslMethods[g].push(E)},d.prototype.visitOption=function(E){this.dslMethods.option.push(E)},d.prototype.visitRepetitionWithSeparator=function(E){this.dslMethods.repetitionWithSeparator.push(E)},d.prototype.visitRepetitionMandatory=function(E){this.dslMethods.repetitionMandatory.push(E)},d.prototype.visitRepetitionMandatoryWithSeparator=function(E){this.dslMethods.repetitionMandatoryWithSeparator.push(E)},d.prototype.visitRepetition=function(E){this.dslMethods.repetition.push(E)},d.prototype.visitAlternation=function(E){this.dslMethods.alternation.push(E)},d})(i.GAstVisitor);n.DslMethodsCollectorVisitor=a;var f=new a;function u(b){f.reset(),b.accept(f);var d=f.dslMethods;return f.reset(),d}n.collectMethods=u}),Di=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.firstForTerminal=n.firstForBranching=n.firstForSequence=n.first=void 0;var e=ke(),t=ze(),r=Qt();function i(A){if(A instanceof t.NonTerminal)return i(A.referencedRule);if(A instanceof t.Terminal)return c(A);if(r.isSequenceProd(A))return s(A);if(r.isBranchingProd(A))return o(A);throw Error("non exhaustive match")}n.first=i;function s(A){for(var a=[],f=A.definition,u=0,b=f.length>u,d,E=!0;b&&E;)d=f[u],E=r.isOptionalProd(d),a=a.concat(i(d)),u=u+1,b=f.length>u;return e.uniq(a)}n.firstForSequence=s;function o(A){var a=e.map(A.definition,function(f){return i(f)});return e.uniq(e.flatten(a))}n.firstForBranching=o;function c(A){return[A.terminalType]}n.firstForTerminal=c}),Oi=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IN=void 0,n.IN="_~IN~_"}),wo=Ce(n=>{var e=n&&n.__extends||(function(){var u=function(b,d){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(b,d)};return function(b,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");u(b,d);function E(){this.constructor=b}b.prototype=d===null?Object.create(d):(E.prototype=d.prototype,new E)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.buildInProdFollowPrefix=n.buildBetweenProdsFollowPrefix=n.computeAllProdsFollows=n.ResyncFollowsWalker=void 0;var t=An(),r=Di(),i=ke(),s=Oi(),o=ze(),c=(function(u){e(b,u);function b(d){var E=u.call(this)||this;return E.topProd=d,E.follows={},E}return b.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},b.prototype.walkTerminal=function(d,E,g){},b.prototype.walkProdRef=function(d,E,g){var l=a(d.referencedRule,d.idx)+this.topProd.name,h=E.concat(g),p=new o.Alternative({definition:h}),C=r.first(p);this.follows[l]=C},b})(t.RestWalker);n.ResyncFollowsWalker=c;function A(u){var b={};return i.forEach(u,function(d){var E=new c(d).startWalking();i.assign(b,E)}),b}n.computeAllProdsFollows=A;function a(u,b){return u.name+b+s.IN}n.buildBetweenProdsFollowPrefix=a;function f(u){var b=u.terminalType.name;return b+u.idx+s.IN}n.buildInProdFollowPrefix=f}),wt=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.defaultGrammarValidatorErrorProvider=n.defaultGrammarResolverErrorProvider=n.defaultParserErrorProvider=void 0;var e=st(),t=ke(),r=ke(),i=ze(),s=Qt();n.defaultParserErrorProvider={buildMismatchTokenMessage:function(o){var c=o.expected,A=o.actual;o.previous,o.ruleName;var a=e.hasTokenLabel(c),f=a?"--> "+e.tokenLabel(c)+" <--":"token of type --> "+c.name+" <--",u="Expecting "+f+" but found --> '"+A.image+"' <--";return u},buildNotAllInputParsedMessage:function(o){var c=o.firstRedundant;return o.ruleName,"Redundant input, expecting EOF but found: "+c.image},buildNoViableAltMessage:function(o){var c=o.expectedPathsPerAlt,A=o.actual;o.previous;var a=o.customUserDescription;o.ruleName;var f="Expecting: ",u=r.first(A).image,b=`
|
|
134
|
+
but found: '`+u+"'";if(a)return f+a+b;var d=r.reduce(c,function(h,p){return h.concat(p)},[]),E=r.map(d,function(h){return"["+r.map(h,function(p){return e.tokenLabel(p)}).join(", ")+"]"}),g=r.map(E,function(h,p){return" "+(p+1)+". "+h}),l=`one of these possible Token sequences:
|
|
135
|
+
`+g.join(`
|
|
136
|
+
`);return f+l+b},buildEarlyExitMessage:function(o){var c=o.expectedIterationPaths,A=o.actual,a=o.customUserDescription;o.ruleName;var f="Expecting: ",u=r.first(A).image,b=`
|
|
137
|
+
but found: '`+u+"'";if(a)return f+a+b;var d=r.map(c,function(g){return"["+r.map(g,function(l){return e.tokenLabel(l)}).join(",")+"]"}),E=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
138
|
+
`+("<"+d.join(" ,")+">");return f+E+b}},Object.freeze(n.defaultParserErrorProvider),n.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(o,c){var A="Invalid grammar, reference to a rule which is not defined: ->"+c.nonTerminalName+`<-
|
|
139
|
+
inside top level rule: ->`+o.name+"<-";return A}},n.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(o,c){function A(l){return l instanceof i.Terminal?l.terminalType.name:l instanceof i.NonTerminal?l.nonTerminalName:""}var a=o.name,f=r.first(c),u=f.idx,b=s.getProductionDslName(f),d=A(f),E=u>0,g="->"+b+(E?u:"")+"<- "+(d?"with argument: ->"+d+"<-":"")+`
|
|
140
|
+
appears more than once (`+c.length+" times) in the top level rule: ->"+a+`<-.
|
|
140
141
|
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
141
|
-
`;return
|
|
142
|
-
`),
|
|
142
|
+
`;return g=g.replace(/[ \t]+/g," "),g=g.replace(/\s\s+/g,`
|
|
143
|
+
`),g},buildNamespaceConflictError:function(o){var c=`Namespace conflict found in grammar.
|
|
143
144
|
`+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+o.name+`>.
|
|
144
145
|
`)+`To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
145
146
|
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
146
|
-
and Non-Terminal names start with a lower case letter.`;return
|
|
147
|
-
`+("in <OR"+
|
|
148
|
-
`)+("<"+
|
|
147
|
+
and Non-Terminal names start with a lower case letter.`;return c},buildAlternationPrefixAmbiguityError:function(o){var c=r.map(o.prefixPath,function(f){return e.tokenLabel(f)}).join(", "),A=o.alternation.idx===0?"":o.alternation.idx,a="Ambiguous alternatives: <"+o.ambiguityIndices.join(" ,")+`> due to common lookahead prefix
|
|
148
|
+
`+("in <OR"+A+"> inside <"+o.topLevelRule.name+`> Rule,
|
|
149
|
+
`)+("<"+c+`> may appears as a prefix path in all these alternatives.
|
|
149
150
|
`)+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
150
|
-
For Further details.`;return
|
|
151
|
-
`)+("<"+
|
|
152
|
-
`);return
|
|
153
|
-
For Further details.`,
|
|
154
|
-
This could lead to an infinite loop.`;return
|
|
155
|
-
`)+"Only the last alternative may be an empty alternative.";return
|
|
151
|
+
For Further details.`;return a},buildAlternationAmbiguityError:function(o){var c=r.map(o.prefixPath,function(f){return e.tokenLabel(f)}).join(", "),A=o.alternation.idx===0?"":o.alternation.idx,a="Ambiguous Alternatives Detected: <"+o.ambiguityIndices.join(" ,")+"> in <OR"+A+">"+(" inside <"+o.topLevelRule.name+`> Rule,
|
|
152
|
+
`)+("<"+c+`> may appears as a prefix path in all these alternatives.
|
|
153
|
+
`);return a=a+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
154
|
+
For Further details.`,a},buildEmptyRepetitionError:function(o){var c=s.getProductionDslName(o.repetition);o.repetition.idx!==0&&(c+=o.repetition.idx);var A="The repetition <"+c+"> within Rule <"+o.topLevelRule.name+`> can never consume any tokens.
|
|
155
|
+
This could lead to an infinite loop.`;return A},buildTokenNameError:function(o){return"deprecated"},buildEmptyAlternationError:function(o){var c="Ambiguous empty alternative: <"+(o.emptyChoiceIdx+1)+">"+(" in <OR"+o.alternation.idx+"> inside <"+o.topLevelRule.name+`> Rule.
|
|
156
|
+
`)+"Only the last alternative may be an empty alternative.";return c},buildTooManyAlternativesError:function(o){var c=`An Alternation cannot have more than 256 alternatives:
|
|
156
157
|
`+("<OR"+o.alternation.idx+"> inside <"+o.topLevelRule.name+`> Rule.
|
|
157
|
-
has `+(o.alternation.definition.length+1)+" alternatives.");return
|
|
158
|
-
`+("rule: <"+
|
|
158
|
+
has `+(o.alternation.definition.length+1)+" alternatives.");return c},buildLeftRecursionError:function(o){var c=o.topLevelRule.name,A=t.map(o.leftRecursionPath,function(u){return u.name}),a=c+" --> "+A.concat([c]).join(" --> "),f=`Left Recursion found in grammar.
|
|
159
|
+
`+("rule: <"+c+`> can be invoked from itself (directly or indirectly)
|
|
159
160
|
`)+(`without consuming any Tokens. The grammar path that causes this is:
|
|
160
|
-
`+
|
|
161
|
+
`+a+`
|
|
161
162
|
`)+` To fix this refactor your grammar to remove the left recursion.
|
|
162
|
-
see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return f},buildInvalidRuleNameError:function(o){return"deprecated"},buildDuplicateRuleNameError:function(o){var u;o.topLevelRule instanceof r.Rule?u=o.topLevelRule.name:u=o.topLevelRule;var c="Duplicate definition, rule: ->"+u+"<- is already defined in the grammar: ->"+o.grammarName+"<-";return c}}}),ii=ve(n=>{var e=n&&n.__extends||(function(){var u=function(c,s){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(f[g]=h[g])},u(c,s)};return function(c,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");u(c,s);function f(){this.constructor=c}c.prototype=s===null?Object.create(s):(f.prototype=s.prototype,new f)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.GastRefResolverVisitor=n.resolveGrammar=void 0;var t=Ye(),i=xe(),r=ft();function a(u,c){var s=new o(u,c);return s.resolveRefs(),s.errors}n.resolveGrammar=a;var o=(function(u){e(c,u);function c(s,f){var h=u.call(this)||this;return h.nameToTopRule=s,h.errMsgProvider=f,h.errors=[],h}return c.prototype.resolveRefs=function(){var s=this;i.forEach(i.values(this.nameToTopRule),function(f){s.currTopLevel=f,f.accept(s)})},c.prototype.visitNonTerminal=function(s){var f=this.nameToTopRule[s.nonTerminalName];if(f)s.referencedRule=f;else{var h=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,s);this.errors.push({message:h,type:t.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:s.nonTerminalName})}},c})(r.GAstVisitor);n.GastRefResolverVisitor=o}),vt=ve(n=>{var e=n&&n.__extends||(function(){var l=function(d,y){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,E){v.__proto__=E}||function(v,E){for(var S in E)Object.prototype.hasOwnProperty.call(E,S)&&(v[S]=E[S])},l(d,y)};return function(d,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");l(d,y);function v(){this.constructor=d}d.prototype=y===null?Object.create(y):(v.prototype=y.prototype,new v)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.nextPossibleTokensAfter=n.possiblePathsFrom=n.NextTerminalAfterAtLeastOneSepWalker=n.NextTerminalAfterAtLeastOneWalker=n.NextTerminalAfterManySepWalker=n.NextTerminalAfterManyWalker=n.AbstractNextTerminalAfterProductionWalker=n.NextAfterTokenWalker=n.AbstractNextPossibleTokensWalker=void 0;var t=jt(),i=xe(),r=bn(),a=He(),o=(function(l){e(d,l);function d(y,v){var E=l.call(this)||this;return E.topProd=y,E.path=v,E.possibleTokTypes=[],E.nextProductionName="",E.nextProductionOccurrence=0,E.found=!1,E.isAtEndOfPath=!1,E}return d.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=i.cloneArr(this.path.ruleStack).reverse(),this.occurrenceStack=i.cloneArr(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},d.prototype.walk=function(y,v){v===void 0&&(v=[]),this.found||l.prototype.walk.call(this,y,v)},d.prototype.walkProdRef=function(y,v,E){if(y.referencedRule.name===this.nextProductionName&&y.idx===this.nextProductionOccurrence){var S=v.concat(E);this.updateExpectedNext(),this.walk(y.referencedRule,S)}},d.prototype.updateExpectedNext=function(){i.isEmpty(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},d})(t.RestWalker);n.AbstractNextPossibleTokensWalker=o;var u=(function(l){e(d,l);function d(y,v){var E=l.call(this,y,v)||this;return E.path=v,E.nextTerminalName="",E.nextTerminalOccurrence=0,E.nextTerminalName=E.path.lastTok.name,E.nextTerminalOccurrence=E.path.lastTokOccurrence,E}return d.prototype.walkTerminal=function(y,v,E){if(this.isAtEndOfPath&&y.terminalType.name===this.nextTerminalName&&y.idx===this.nextTerminalOccurrence&&!this.found){var S=v.concat(E),I=new a.Alternative({definition:S});this.possibleTokTypes=r.first(I),this.found=!0}},d})(o);n.NextAfterTokenWalker=u;var c=(function(l){e(d,l);function d(y,v){var E=l.call(this)||this;return E.topRule=y,E.occurrence=v,E.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},E}return d.prototype.startWalking=function(){return this.walk(this.topRule),this.result},d})(t.RestWalker);n.AbstractNextTerminalAfterProductionWalker=c;var s=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.prototype.walkMany=function(y,v,E){if(y.idx===this.occurrence){var S=i.first(v.concat(E));this.result.isEndOfRule=S===void 0,S instanceof a.Terminal&&(this.result.token=S.terminalType,this.result.occurrence=S.idx)}else l.prototype.walkMany.call(this,y,v,E)},d})(c);n.NextTerminalAfterManyWalker=s;var f=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.prototype.walkManySep=function(y,v,E){if(y.idx===this.occurrence){var S=i.first(v.concat(E));this.result.isEndOfRule=S===void 0,S instanceof a.Terminal&&(this.result.token=S.terminalType,this.result.occurrence=S.idx)}else l.prototype.walkManySep.call(this,y,v,E)},d})(c);n.NextTerminalAfterManySepWalker=f;var h=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.prototype.walkAtLeastOne=function(y,v,E){if(y.idx===this.occurrence){var S=i.first(v.concat(E));this.result.isEndOfRule=S===void 0,S instanceof a.Terminal&&(this.result.token=S.terminalType,this.result.occurrence=S.idx)}else l.prototype.walkAtLeastOne.call(this,y,v,E)},d})(c);n.NextTerminalAfterAtLeastOneWalker=h;var g=(function(l){e(d,l);function d(){return l!==null&&l.apply(this,arguments)||this}return d.prototype.walkAtLeastOneSep=function(y,v,E){if(y.idx===this.occurrence){var S=i.first(v.concat(E));this.result.isEndOfRule=S===void 0,S instanceof a.Terminal&&(this.result.token=S.terminalType,this.result.occurrence=S.idx)}else l.prototype.walkAtLeastOneSep.call(this,y,v,E)},d})(c);n.NextTerminalAfterAtLeastOneSepWalker=g;function p(l,d,y){y===void 0&&(y=[]),y=i.cloneArr(y);var v=[],E=0;function S(x){return x.concat(i.drop(l,E+1))}function I(x){var B=p(S(x),d,y);return v.concat(B)}for(;y.length<d&&E<l.length;){var k=l[E];if(k instanceof a.Alternative||k instanceof a.NonTerminal)return I(k.definition);if(k instanceof a.Option)v=I(k.definition);else if(k instanceof a.RepetitionMandatory){var H=k.definition.concat([new a.Repetition({definition:k.definition})]);return I(H)}else if(k instanceof a.RepetitionMandatoryWithSeparator){var H=[new a.Alternative({definition:k.definition}),new a.Repetition({definition:[new a.Terminal({terminalType:k.separator})].concat(k.definition)})];return I(H)}else if(k instanceof a.RepetitionWithSeparator){var H=k.definition.concat([new a.Repetition({definition:[new a.Terminal({terminalType:k.separator})].concat(k.definition)})]);v=I(H)}else if(k instanceof a.Repetition){var H=k.definition.concat([new a.Repetition({definition:k.definition})]);v=I(H)}else{if(k instanceof a.Alternation)return i.forEach(k.definition,function(x){i.isEmpty(x.definition)===!1&&(v=I(x.definition))}),v;if(k instanceof a.Terminal)y.push(k.terminalType);else throw Error("non exhaustive match")}E++}return v.push({partialPath:y,suffixDef:i.drop(l,E)}),v}n.possiblePathsFrom=p;function T(l,d,y,v){var E="EXIT_NONE_TERMINAL",S=[E],I="EXIT_ALTERNATIVE",k=!1,H=d.length,x=H-v-1,B=[],P=[];for(P.push({idx:-1,def:l,ruleStack:[],occurrenceStack:[]});!i.isEmpty(P);){var O=P.pop();if(O===I){k&&i.last(P).idx<=x&&P.pop();continue}var M=O.def,C=O.idx,X=O.ruleStack,Q=O.occurrenceStack;if(!i.isEmpty(M)){var W=M[0];if(W===E){var $={idx:C,def:i.drop(M),ruleStack:i.dropRight(X),occurrenceStack:i.dropRight(Q)};P.push($)}else if(W instanceof a.Terminal)if(C<H-1){var te=C+1,ce=d[te];if(y(ce,W.terminalType)){var $={idx:te,def:i.drop(M),ruleStack:X,occurrenceStack:Q};P.push($)}}else if(C===H-1)B.push({nextTokenType:W.terminalType,nextTokenOccurrence:W.idx,ruleStack:X,occurrenceStack:Q}),k=!0;else throw Error("non exhaustive match");else if(W instanceof a.NonTerminal){var ae=i.cloneArr(X);ae.push(W.nonTerminalName);var le=i.cloneArr(Q);le.push(W.idx);var $={idx:C,def:W.definition.concat(S,i.drop(M)),ruleStack:ae,occurrenceStack:le};P.push($)}else if(W instanceof a.Option){var ne={idx:C,def:i.drop(M),ruleStack:X,occurrenceStack:Q};P.push(ne),P.push(I);var pe={idx:C,def:W.definition.concat(i.drop(M)),ruleStack:X,occurrenceStack:Q};P.push(pe)}else if(W instanceof a.RepetitionMandatory){var U=new a.Repetition({definition:W.definition,idx:W.idx}),G=W.definition.concat([U],i.drop(M)),$={idx:C,def:G,ruleStack:X,occurrenceStack:Q};P.push($)}else if(W instanceof a.RepetitionMandatoryWithSeparator){var K=new a.Terminal({terminalType:W.separator}),U=new a.Repetition({definition:[K].concat(W.definition),idx:W.idx}),G=W.definition.concat([U],i.drop(M)),$={idx:C,def:G,ruleStack:X,occurrenceStack:Q};P.push($)}else if(W instanceof a.RepetitionWithSeparator){var ne={idx:C,def:i.drop(M),ruleStack:X,occurrenceStack:Q};P.push(ne),P.push(I);var K=new a.Terminal({terminalType:W.separator}),q=new a.Repetition({definition:[K].concat(W.definition),idx:W.idx}),G=W.definition.concat([q],i.drop(M)),pe={idx:C,def:G,ruleStack:X,occurrenceStack:Q};P.push(pe)}else if(W instanceof a.Repetition){var ne={idx:C,def:i.drop(M),ruleStack:X,occurrenceStack:Q};P.push(ne),P.push(I);var q=new a.Repetition({definition:W.definition,idx:W.idx}),G=W.definition.concat([q],i.drop(M)),pe={idx:C,def:G,ruleStack:X,occurrenceStack:Q};P.push(pe)}else if(W instanceof a.Alternation)for(var J=W.definition.length-1;J>=0;J--){var ie=W.definition[J],Te={idx:C,def:ie.definition.concat(i.drop(M)),ruleStack:X,occurrenceStack:Q};P.push(Te),P.push(I)}else if(W instanceof a.Alternative)P.push({idx:C,def:W.definition.concat(i.drop(M)),ruleStack:X,occurrenceStack:Q});else if(W instanceof a.Rule)P.push(m(W,C,X,Q));else throw Error("non exhaustive match")}}return B}n.nextPossibleTokensAfter=T;function m(l,d,y,v){var E=i.cloneArr(y);E.push(l.name);var S=i.cloneArr(v);return S.push(1),{idx:d,def:l.definition,ruleStack:E,occurrenceStack:S}}}),Rt=ve(n=>{var e=n&&n.__extends||(function(){var x=function(B,P){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,M){O.__proto__=M}||function(O,M){for(var C in M)Object.prototype.hasOwnProperty.call(M,C)&&(O[C]=M[C])},x(B,P)};return function(B,P){if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");x(B,P);function O(){this.constructor=B}B.prototype=P===null?Object.create(P):(O.prototype=P.prototype,new O)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.areTokenCategoriesNotUsed=n.isStrictPrefixOfPath=n.containsPath=n.getLookaheadPathsForOptionalProd=n.getLookaheadPathsForOr=n.lookAheadSequenceFromAlternatives=n.buildSingleAlternativeLookaheadFunction=n.buildAlternativesLookAheadFunc=n.buildLookaheadFuncForOptionalProd=n.buildLookaheadFuncForOr=n.getProdType=n.PROD_TYPE=void 0;var t=xe(),i=vt(),r=jt(),a=ht(),o=He(),u=ft(),c;(function(x){x[x.OPTION=0]="OPTION",x[x.REPETITION=1]="REPETITION",x[x.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",x[x.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",x[x.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",x[x.ALTERNATION=5]="ALTERNATION"})(c=n.PROD_TYPE||(n.PROD_TYPE={}));function s(x){if(x instanceof o.Option)return c.OPTION;if(x instanceof o.Repetition)return c.REPETITION;if(x instanceof o.RepetitionMandatory)return c.REPETITION_MANDATORY;if(x instanceof o.RepetitionMandatoryWithSeparator)return c.REPETITION_MANDATORY_WITH_SEPARATOR;if(x instanceof o.RepetitionWithSeparator)return c.REPETITION_WITH_SEPARATOR;if(x instanceof o.Alternation)return c.ALTERNATION;throw Error("non exhaustive match")}n.getProdType=s;function f(x,B,P,O,M,C){var X=E(x,B,P),Q=H(X)?a.tokenStructuredMatcherNoCategories:a.tokenStructuredMatcher;return C(X,O,Q,M)}n.buildLookaheadFuncForOr=f;function h(x,B,P,O,M,C){var X=S(x,B,M,P),Q=H(X)?a.tokenStructuredMatcherNoCategories:a.tokenStructuredMatcher;return C(X[0],Q,O)}n.buildLookaheadFuncForOptionalProd=h;function g(x,B,P,O){var M=x.length,C=t.every(x,function(W){return t.every(W,function($){return $.length===1})});if(B)return function(W){for(var $=t.map(W,function(q){return q.GATE}),te=0;te<M;te++){var ce=x[te],ae=ce.length,le=$[te];if(!(le!==void 0&&le.call(this)===!1))e:for(var ne=0;ne<ae;ne++){for(var pe=ce[ne],U=pe.length,G=0;G<U;G++){var K=this.LA(G+1);if(P(K,pe[G])===!1)continue e}return te}}};if(C&&!O){var X=t.map(x,function(W){return t.flatten(W)}),Q=t.reduce(X,function(W,$,te){return t.forEach($,function(ce){t.has(W,ce.tokenTypeIdx)||(W[ce.tokenTypeIdx]=te),t.forEach(ce.categoryMatches,function(ae){t.has(W,ae)||(W[ae]=te)})}),W},[]);return function(){var W=this.LA(1);return Q[W.tokenTypeIdx]}}else return function(){for(var W=0;W<M;W++){var $=x[W],te=$.length;e:for(var ce=0;ce<te;ce++){for(var ae=$[ce],le=ae.length,ne=0;ne<le;ne++){var pe=this.LA(ne+1);if(P(pe,ae[ne])===!1)continue e}return W}}}}n.buildAlternativesLookAheadFunc=g;function p(x,B,P){var O=t.every(x,function($){return $.length===1}),M=x.length;if(O&&!P){var C=t.flatten(x);if(C.length===1&&t.isEmpty(C[0].categoryMatches)){var X=C[0],Q=X.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===Q}}else{var W=t.reduce(C,function($,te,ce){return $[te.tokenTypeIdx]=!0,t.forEach(te.categoryMatches,function(ae){$[ae]=!0}),$},[]);return function(){var $=this.LA(1);return W[$.tokenTypeIdx]===!0}}}else return function(){e:for(var $=0;$<M;$++){for(var te=x[$],ce=te.length,ae=0;ae<ce;ae++){var le=this.LA(ae+1);if(B(le,te[ae])===!1)continue e}return!0}return!1}}n.buildSingleAlternativeLookaheadFunction=p;var T=(function(x){e(B,x);function B(P,O,M){var C=x.call(this)||this;return C.topProd=P,C.targetOccurrence=O,C.targetProdType=M,C}return B.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},B.prototype.checkIsTarget=function(P,O,M,C){return P.idx===this.targetOccurrence&&this.targetProdType===O?(this.restDef=M.concat(C),!0):!1},B.prototype.walkOption=function(P,O,M){this.checkIsTarget(P,c.OPTION,O,M)||x.prototype.walkOption.call(this,P,O,M)},B.prototype.walkAtLeastOne=function(P,O,M){this.checkIsTarget(P,c.REPETITION_MANDATORY,O,M)||x.prototype.walkOption.call(this,P,O,M)},B.prototype.walkAtLeastOneSep=function(P,O,M){this.checkIsTarget(P,c.REPETITION_MANDATORY_WITH_SEPARATOR,O,M)||x.prototype.walkOption.call(this,P,O,M)},B.prototype.walkMany=function(P,O,M){this.checkIsTarget(P,c.REPETITION,O,M)||x.prototype.walkOption.call(this,P,O,M)},B.prototype.walkManySep=function(P,O,M){this.checkIsTarget(P,c.REPETITION_WITH_SEPARATOR,O,M)||x.prototype.walkOption.call(this,P,O,M)},B})(r.RestWalker),m=(function(x){e(B,x);function B(P,O,M){var C=x.call(this)||this;return C.targetOccurrence=P,C.targetProdType=O,C.targetRef=M,C.result=[],C}return B.prototype.checkIsTarget=function(P,O){P.idx===this.targetOccurrence&&this.targetProdType===O&&(this.targetRef===void 0||P===this.targetRef)&&(this.result=P.definition)},B.prototype.visitOption=function(P){this.checkIsTarget(P,c.OPTION)},B.prototype.visitRepetition=function(P){this.checkIsTarget(P,c.REPETITION)},B.prototype.visitRepetitionMandatory=function(P){this.checkIsTarget(P,c.REPETITION_MANDATORY)},B.prototype.visitRepetitionMandatoryWithSeparator=function(P){this.checkIsTarget(P,c.REPETITION_MANDATORY_WITH_SEPARATOR)},B.prototype.visitRepetitionWithSeparator=function(P){this.checkIsTarget(P,c.REPETITION_WITH_SEPARATOR)},B.prototype.visitAlternation=function(P){this.checkIsTarget(P,c.ALTERNATION)},B})(u.GAstVisitor);function l(x){for(var B=new Array(x),P=0;P<x;P++)B[P]=[];return B}function d(x){for(var B=[""],P=0;P<x.length;P++){for(var O=x[P],M=[],C=0;C<B.length;C++){var X=B[C];M.push(X+"_"+O.tokenTypeIdx);for(var Q=0;Q<O.categoryMatches.length;Q++){var W="_"+O.categoryMatches[Q];M.push(X+W)}}B=M}return B}function y(x,B,P){for(var O=0;O<x.length;O++)if(O!==P)for(var M=x[O],C=0;C<B.length;C++){var X=B[C];if(M[X]===!0)return!1}return!0}function v(x,B){for(var P=t.map(x,function(te){return i.possiblePathsFrom([te],1)}),O=l(P.length),M=t.map(P,function(te){var ce={};return t.forEach(te,function(ae){var le=d(ae.partialPath);t.forEach(le,function(ne){ce[ne]=!0})}),ce}),C=P,X=1;X<=B;X++){var Q=C;C=l(Q.length);for(var W=function(te){for(var ce=Q[te],ae=0;ae<ce.length;ae++){var le=ce[ae].partialPath,ne=ce[ae].suffixDef,pe=d(le),U=y(M,pe,te);if(U||t.isEmpty(ne)||le.length===B){var G=O[te];if(I(G,le)===!1){G.push(le);for(var K=0;K<pe.length;K++){var q=pe[K];M[te][q]=!0}}}else{var J=i.possiblePathsFrom(ne,X+1,le);C[te]=C[te].concat(J),t.forEach(J,function(ie){var Te=d(ie.partialPath);t.forEach(Te,function(ye){M[te][ye]=!0})})}}},$=0;$<Q.length;$++)W($)}return O}n.lookAheadSequenceFromAlternatives=v;function E(x,B,P,O){var M=new m(x,c.ALTERNATION,O);return B.accept(M),v(M.result,P)}n.getLookaheadPathsForOr=E;function S(x,B,P,O){var M=new m(x,P);B.accept(M);var C=M.result,X=new T(B,x,P),Q=X.startWalking(),W=new o.Alternative({definition:C}),$=new o.Alternative({definition:Q});return v([W,$],O)}n.getLookaheadPathsForOptionalProd=S;function I(x,B){e:for(var P=0;P<x.length;P++){var O=x[P];if(O.length===B.length){for(var M=0;M<O.length;M++){var C=B[M],X=O[M],Q=C===X||X.categoryMatchesMap[C.tokenTypeIdx]!==void 0;if(Q===!1)continue e}return!0}}return!1}n.containsPath=I;function k(x,B){return x.length<B.length&&t.every(x,function(P,O){var M=B[O];return P===M||M.categoryMatchesMap[P.tokenTypeIdx]})}n.isStrictPrefixOfPath=k;function H(x){return t.every(x,function(B){return t.every(B,function(P){return t.every(P,function(O){return t.isEmpty(O.categoryMatches)})})})}n.areTokenCategoriesNotUsed=H}),Sn=ve(n=>{var e=n&&n.__extends||(function(){var O=function(M,C){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,Q){X.__proto__=Q}||function(X,Q){for(var W in Q)Object.prototype.hasOwnProperty.call(Q,W)&&(X[W]=Q[W])},O(M,C)};return function(M,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");O(M,C);function X(){this.constructor=M}M.prototype=C===null?Object.create(C):(X.prototype=C.prototype,new X)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.checkPrefixAlternativesAmbiguities=n.validateSomeNonEmptyLookaheadPath=n.validateTooManyAlts=n.RepetionCollector=n.validateAmbiguousAlternationAlternatives=n.validateEmptyOrAlternative=n.getFirstNoneTerminal=n.validateNoLeftRecursion=n.validateRuleIsOverridden=n.validateRuleDoesNotAlreadyExist=n.OccurrenceValidationCollector=n.identifyProductionForDuplicates=n.validateGrammar=void 0;var t=xe(),i=xe(),r=Ye(),a=Tt(),o=Rt(),u=vt(),c=He(),s=ft();function f(O,M,C,X,Q){var W=t.map(O,function(U){return h(U,X)}),$=t.map(O,function(U){return d(U,U,X)}),te=[],ce=[],ae=[];i.every($,i.isEmpty)&&(te=i.map(O,function(U){return E(U,X)}),ce=i.map(O,function(U){return S(U,M,X)}),ae=H(O,M,X));var le=P(O,C,X),ne=i.map(O,function(U){return k(U,X)}),pe=i.map(O,function(U){return m(U,O,Q,X)});return t.flatten(W.concat(ae,$,te,ce,le,ne,pe))}n.validateGrammar=f;function h(O,M){var C=new T;O.accept(C);var X=C.allProductions,Q=t.groupBy(X,g),W=t.pick(Q,function(te){return te.length>1}),$=t.map(t.values(W),function(te){var ce=t.first(te),ae=M.buildDuplicateFoundError(O,te),le=a.getProductionDslName(ce),ne={message:ae,type:r.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:O.name,dslName:le,occurrence:ce.idx},pe=p(ce);return pe&&(ne.parameter=pe),ne});return $}function g(O){return a.getProductionDslName(O)+"_#_"+O.idx+"_#_"+p(O)}n.identifyProductionForDuplicates=g;function p(O){return O instanceof c.Terminal?O.terminalType.name:O instanceof c.NonTerminal?O.nonTerminalName:""}var T=(function(O){e(M,O);function M(){var C=O!==null&&O.apply(this,arguments)||this;return C.allProductions=[],C}return M.prototype.visitNonTerminal=function(C){this.allProductions.push(C)},M.prototype.visitOption=function(C){this.allProductions.push(C)},M.prototype.visitRepetitionWithSeparator=function(C){this.allProductions.push(C)},M.prototype.visitRepetitionMandatory=function(C){this.allProductions.push(C)},M.prototype.visitRepetitionMandatoryWithSeparator=function(C){this.allProductions.push(C)},M.prototype.visitRepetition=function(C){this.allProductions.push(C)},M.prototype.visitAlternation=function(C){this.allProductions.push(C)},M.prototype.visitTerminal=function(C){this.allProductions.push(C)},M})(s.GAstVisitor);n.OccurrenceValidationCollector=T;function m(O,M,C,X){var Q=[],W=i.reduce(M,function(te,ce){return ce.name===O.name?te+1:te},0);if(W>1){var $=X.buildDuplicateRuleNameError({topLevelRule:O,grammarName:C});Q.push({message:$,type:r.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:O.name})}return Q}n.validateRuleDoesNotAlreadyExist=m;function l(O,M,C){var X=[],Q;return t.contains(M,O)||(Q="Invalid rule override, rule: ->"+O+"<- cannot be overridden in the grammar: ->"+C+"<-as it is not defined in any of the super grammars ",X.push({message:Q,type:r.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:O})),X}n.validateRuleIsOverridden=l;function d(O,M,C,X){X===void 0&&(X=[]);var Q=[],W=y(M.definition);if(t.isEmpty(W))return[];var $=O.name,te=t.contains(W,O);te&&Q.push({message:C.buildLeftRecursionError({topLevelRule:O,leftRecursionPath:X}),type:r.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:$});var ce=t.difference(W,X.concat([O])),ae=t.map(ce,function(le){var ne=t.cloneArr(X);return ne.push(le),d(O,le,C,ne)});return Q.concat(t.flatten(ae))}n.validateNoLeftRecursion=d;function y(O){var M=[];if(t.isEmpty(O))return M;var C=t.first(O);if(C instanceof c.NonTerminal)M.push(C.referencedRule);else if(C instanceof c.Alternative||C instanceof c.Option||C instanceof c.RepetitionMandatory||C instanceof c.RepetitionMandatoryWithSeparator||C instanceof c.RepetitionWithSeparator||C instanceof c.Repetition)M=M.concat(y(C.definition));else if(C instanceof c.Alternation)M=t.flatten(t.map(C.definition,function($){return y($.definition)}));else if(!(C instanceof c.Terminal))throw Error("non exhaustive match");var X=a.isOptionalProd(C),Q=O.length>1;if(X&&Q){var W=t.drop(O);return M.concat(y(W))}else return M}n.getFirstNoneTerminal=y;var v=(function(O){e(M,O);function M(){var C=O!==null&&O.apply(this,arguments)||this;return C.alternations=[],C}return M.prototype.visitAlternation=function(C){this.alternations.push(C)},M})(s.GAstVisitor);function E(O,M){var C=new v;O.accept(C);var X=C.alternations,Q=t.reduce(X,function(W,$){var te=t.dropRight($.definition),ce=t.map(te,function(ae,le){var ne=u.nextPossibleTokensAfter([ae],[],null,1);return t.isEmpty(ne)?{message:M.buildEmptyAlternationError({topLevelRule:O,alternation:$,emptyChoiceIdx:le}),type:r.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:O.name,occurrence:$.idx,alternative:le+1}:null});return W.concat(t.compact(ce))},[]);return Q}n.validateEmptyOrAlternative=E;function S(O,M,C){var X=new v;O.accept(X);var Q=X.alternations;Q=i.reject(Q,function($){return $.ignoreAmbiguities===!0});var W=t.reduce(Q,function($,te){var ce=te.idx,ae=te.maxLookahead||M,le=o.getLookaheadPathsForOr(ce,O,ae,te),ne=x(le,te,O,C),pe=B(le,te,O,C);return $.concat(ne,pe)},[]);return W}n.validateAmbiguousAlternationAlternatives=S;var I=(function(O){e(M,O);function M(){var C=O!==null&&O.apply(this,arguments)||this;return C.allProductions=[],C}return M.prototype.visitRepetitionWithSeparator=function(C){this.allProductions.push(C)},M.prototype.visitRepetitionMandatory=function(C){this.allProductions.push(C)},M.prototype.visitRepetitionMandatoryWithSeparator=function(C){this.allProductions.push(C)},M.prototype.visitRepetition=function(C){this.allProductions.push(C)},M})(s.GAstVisitor);n.RepetionCollector=I;function k(O,M){var C=new v;O.accept(C);var X=C.alternations,Q=t.reduce(X,function(W,$){return $.definition.length>255&&W.push({message:M.buildTooManyAlternativesError({topLevelRule:O,alternation:$}),type:r.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:O.name,occurrence:$.idx}),W},[]);return Q}n.validateTooManyAlts=k;function H(O,M,C){var X=[];return i.forEach(O,function(Q){var W=new I;Q.accept(W);var $=W.allProductions;i.forEach($,function(te){var ce=o.getProdType(te),ae=te.maxLookahead||M,le=te.idx,ne=o.getLookaheadPathsForOptionalProd(le,Q,ce,ae),pe=ne[0];if(i.isEmpty(i.flatten(pe))){var U=C.buildEmptyRepetitionError({topLevelRule:Q,repetition:te});X.push({message:U,type:r.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:Q.name})}})}),X}n.validateSomeNonEmptyLookaheadPath=H;function x(O,M,C,X){var Q=[],W=i.reduce(O,function(te,ce,ae){return M.definition[ae].ignoreAmbiguities===!0||i.forEach(ce,function(le){var ne=[ae];i.forEach(O,function(pe,U){ae!==U&&o.containsPath(pe,le)&&M.definition[U].ignoreAmbiguities!==!0&&ne.push(U)}),ne.length>1&&!o.containsPath(Q,le)&&(Q.push(le),te.push({alts:ne,path:le}))}),te},[]),$=t.map(W,function(te){var ce=i.map(te.alts,function(le){return le+1}),ae=X.buildAlternationAmbiguityError({topLevelRule:C,alternation:M,ambiguityIndices:ce,prefixPath:te.path});return{message:ae,type:r.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:C.name,occurrence:M.idx,alternatives:[te.alts]}});return $}function B(O,M,C,X){var Q=[],W=i.reduce(O,function($,te,ce){var ae=i.map(te,function(le){return{idx:ce,path:le}});return $.concat(ae)},[]);return i.forEach(W,function($){var te=M.definition[$.idx];if(te.ignoreAmbiguities!==!0){var ce=$.idx,ae=$.path,le=i.findAll(W,function(pe){return M.definition[pe.idx].ignoreAmbiguities!==!0&&pe.idx<ce&&o.isStrictPrefixOfPath(pe.path,ae)}),ne=i.map(le,function(pe){var U=[pe.idx+1,ce+1],G=M.idx===0?"":M.idx,K=X.buildAlternationPrefixAmbiguityError({topLevelRule:C,alternation:M,ambiguityIndices:U,prefixPath:pe.path});return{message:K,type:r.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:C.name,occurrence:G,alternatives:U}});Q=Q.concat(ne)}}),Q}n.checkPrefixAlternativesAmbiguities=B;function P(O,M,C){var X=[],Q=i.map(M,function(W){return W.name});return i.forEach(O,function(W){var $=W.name;if(i.contains(Q,$)){var te=C.buildNamespaceConflictError(W);X.push({message:te,type:r.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:$})}}),X}}),oi=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.validateGrammar=n.resolveGrammar=void 0;var e=xe(),t=ii(),i=Sn(),r=Et();function a(u){u=e.defaults(u,{errMsgProvider:r.defaultGrammarResolverErrorProvider});var c={};return e.forEach(u.rules,function(s){c[s.name]=s}),t.resolveGrammar(c,u.errMsgProvider)}n.resolveGrammar=a;function o(u){return u=e.defaults(u,{errMsgProvider:r.defaultGrammarValidatorErrorProvider}),i.validateGrammar(u.rules,u.maxLookahead,u.tokenTypes,u.errMsgProvider,u.grammarName)}n.validateGrammar=o}),dt=ve(n=>{var e=n&&n.__extends||(function(){var T=function(m,l){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,y){d.__proto__=y}||function(d,y){for(var v in y)Object.prototype.hasOwnProperty.call(y,v)&&(d[v]=y[v])},T(m,l)};return function(m,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");T(m,l);function d(){this.constructor=m}m.prototype=l===null?Object.create(l):(d.prototype=l.prototype,new d)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.EarlyExitException=n.NotAllInputParsedException=n.NoViableAltException=n.MismatchedTokenException=n.isRecognitionException=void 0;var t=xe(),i="MismatchedTokenException",r="NoViableAltException",a="EarlyExitException",o="NotAllInputParsedException",u=[i,r,a,o];Object.freeze(u);function c(T){return t.contains(u,T.name)}n.isRecognitionException=c;var s=(function(T){e(m,T);function m(l,d){var y=this.constructor,v=T.call(this,l)||this;return v.token=d,v.resyncedTokens=[],Object.setPrototypeOf(v,y.prototype),Error.captureStackTrace&&Error.captureStackTrace(v,v.constructor),v}return m})(Error),f=(function(T){e(m,T);function m(l,d,y){var v=T.call(this,l,d)||this;return v.previousToken=y,v.name=i,v}return m})(s);n.MismatchedTokenException=f;var h=(function(T){e(m,T);function m(l,d,y){var v=T.call(this,l,d)||this;return v.previousToken=y,v.name=r,v}return m})(s);n.NoViableAltException=h;var g=(function(T){e(m,T);function m(l,d){var y=T.call(this,l,d)||this;return y.name=o,y}return m})(s);n.NotAllInputParsedException=g;var p=(function(T){e(m,T);function m(l,d,y){var v=T.call(this,l,d)||this;return v.previousToken=y,v.name=a,v}return m})(s);n.EarlyExitException=p}),On=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.attemptInRepetitionRecovery=n.Recoverable=n.InRuleRecoveryException=n.IN_RULE_RECOVERY_EXCEPTION=n.EOF_FOLLOW_KEY=void 0;var e=nt(),t=xe(),i=dt(),r=Ln(),a=Ye();n.EOF_FOLLOW_KEY={},n.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function o(s){this.name=n.IN_RULE_RECOVERY_EXCEPTION,this.message=s}n.InRuleRecoveryException=o,o.prototype=Error.prototype;var u=(function(){function s(){}return s.prototype.initRecoverable=function(f){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=t.has(f,"recoveryEnabled")?f.recoveryEnabled:a.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=c)},s.prototype.getTokenToInsert=function(f){var h=e.createTokenInstance(f,"",NaN,NaN,NaN,NaN,NaN,NaN);return h.isInsertedInRecovery=!0,h},s.prototype.canTokenTypeBeInsertedInRecovery=function(f){return!0},s.prototype.tryInRepetitionRecovery=function(f,h,g,p){for(var T=this,m=this.findReSyncTokenType(),l=this.exportLexerState(),d=[],y=!1,v=this.LA(1),E=this.LA(1),S=function(){var I=T.LA(0),k=T.errorMessageProvider.buildMismatchTokenMessage({expected:p,actual:v,previous:I,ruleName:T.getCurrRuleFullName()}),H=new i.MismatchedTokenException(k,v,T.LA(0));H.resyncedTokens=t.dropRight(d),T.SAVE_ERROR(H)};!y;)if(this.tokenMatcher(E,p)){S();return}else if(g.call(this)){S(),f.apply(this,h);return}else this.tokenMatcher(E,m)?y=!0:(E=this.SKIP_TOKEN(),this.addToResyncTokens(E,d));this.importLexerState(l)},s.prototype.shouldInRepetitionRecoveryBeTried=function(f,h,g){return!(g===!1||f===void 0||h===void 0||this.tokenMatcher(this.LA(1),f)||this.isBackTracking()||this.canPerformInRuleRecovery(f,this.getFollowsForInRuleRecovery(f,h)))},s.prototype.getFollowsForInRuleRecovery=function(f,h){var g=this.getCurrentGrammarPath(f,h),p=this.getNextPossibleTokenTypes(g);return p},s.prototype.tryInRuleRecovery=function(f,h){if(this.canRecoverWithSingleTokenInsertion(f,h)){var g=this.getTokenToInsert(f);return g}if(this.canRecoverWithSingleTokenDeletion(f)){var p=this.SKIP_TOKEN();return this.consumeToken(),p}throw new o("sad sad panda")},s.prototype.canPerformInRuleRecovery=function(f,h){return this.canRecoverWithSingleTokenInsertion(f,h)||this.canRecoverWithSingleTokenDeletion(f)},s.prototype.canRecoverWithSingleTokenInsertion=function(f,h){var g=this;if(!this.canTokenTypeBeInsertedInRecovery(f)||t.isEmpty(h))return!1;var p=this.LA(1),T=t.find(h,function(m){return g.tokenMatcher(p,m)})!==void 0;return T},s.prototype.canRecoverWithSingleTokenDeletion=function(f){var h=this.tokenMatcher(this.LA(2),f);return h},s.prototype.isInCurrentRuleReSyncSet=function(f){var h=this.getCurrFollowKey(),g=this.getFollowSetFromFollowKey(h);return t.contains(g,f)},s.prototype.findReSyncTokenType=function(){for(var f=this.flattenFollowSet(),h=this.LA(1),g=2;;){var p=h.tokenType;if(t.contains(f,p))return p;h=this.LA(g),g++}},s.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return n.EOF_FOLLOW_KEY;var f=this.getLastExplicitRuleShortName(),h=this.getLastExplicitRuleOccurrenceIndex(),g=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(f),idxInCallingRule:h,inRule:this.shortRuleNameToFullName(g)}},s.prototype.buildFullFollowKeyStack=function(){var f=this,h=this.RULE_STACK,g=this.RULE_OCCURRENCE_STACK;return t.map(h,function(p,T){return T===0?n.EOF_FOLLOW_KEY:{ruleName:f.shortRuleNameToFullName(p),idxInCallingRule:g[T],inRule:f.shortRuleNameToFullName(h[T-1])}})},s.prototype.flattenFollowSet=function(){var f=this,h=t.map(this.buildFullFollowKeyStack(),function(g){return f.getFollowSetFromFollowKey(g)});return t.flatten(h)},s.prototype.getFollowSetFromFollowKey=function(f){if(f===n.EOF_FOLLOW_KEY)return[e.EOF];var h=f.ruleName+f.idxInCallingRule+r.IN+f.inRule;return this.resyncFollows[h]},s.prototype.addToResyncTokens=function(f,h){return this.tokenMatcher(f,e.EOF)||h.push(f),h},s.prototype.reSyncTo=function(f){for(var h=[],g=this.LA(1);this.tokenMatcher(g,f)===!1;)g=this.SKIP_TOKEN(),this.addToResyncTokens(g,h);return t.dropRight(h)},s.prototype.attemptInRepetitionRecovery=function(f,h,g,p,T,m,l){},s.prototype.getCurrentGrammarPath=function(f,h){var g=this.getHumanReadableRuleStack(),p=t.cloneArr(this.RULE_OCCURRENCE_STACK),T={ruleStack:g,occurrenceStack:p,lastTok:f,lastTokOccurrence:h};return T},s.prototype.getHumanReadableRuleStack=function(){var f=this;return t.map(this.RULE_STACK,function(h){return f.shortRuleNameToFullName(h)})},s})();n.Recoverable=u;function c(s,f,h,g,p,T,m){var l=this.getKeyForAutomaticLookahead(g,p),d=this.firstAfterRepMap[l];if(d===void 0){var y=this.getCurrRuleFullName(),v=this.getGAstProductions()[y],E=new T(v,p);d=E.startWalking(),this.firstAfterRepMap[l]=d}var S=d.token,I=d.occurrence,k=d.isEndOfRule;this.RULE_STACK.length===1&&k&&S===void 0&&(S=e.EOF,I=1),this.shouldInRepetitionRecoveryBeTried(S,I,m)&&this.tryInRepetitionRecovery(s,f,h,S)}n.attemptInRepetitionRecovery=c}),Bt=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getKeyForAutomaticLookahead=n.AT_LEAST_ONE_SEP_IDX=n.MANY_SEP_IDX=n.AT_LEAST_ONE_IDX=n.MANY_IDX=n.OPTION_IDX=n.OR_IDX=n.BITS_FOR_ALT_IDX=n.BITS_FOR_RULE_IDX=n.BITS_FOR_OCCURRENCE_IDX=n.BITS_FOR_METHOD_TYPE=void 0,n.BITS_FOR_METHOD_TYPE=4,n.BITS_FOR_OCCURRENCE_IDX=8,n.BITS_FOR_RULE_IDX=12,n.BITS_FOR_ALT_IDX=8,n.OR_IDX=1<<n.BITS_FOR_OCCURRENCE_IDX,n.OPTION_IDX=2<<n.BITS_FOR_OCCURRENCE_IDX,n.MANY_IDX=3<<n.BITS_FOR_OCCURRENCE_IDX,n.AT_LEAST_ONE_IDX=4<<n.BITS_FOR_OCCURRENCE_IDX,n.MANY_SEP_IDX=5<<n.BITS_FOR_OCCURRENCE_IDX,n.AT_LEAST_ONE_SEP_IDX=6<<n.BITS_FOR_OCCURRENCE_IDX;function e(t,i,r){return r|i|t}n.getKeyForAutomaticLookahead=e,32-n.BITS_FOR_ALT_IDX}),si=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LooksAhead=void 0;var e=Rt(),t=xe(),i=Ye(),r=Bt(),a=Tt(),o=(function(){function u(){}return u.prototype.initLooksAhead=function(c){this.dynamicTokensEnabled=t.has(c,"dynamicTokensEnabled")?c.dynamicTokensEnabled:i.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=t.has(c,"maxLookahead")?c.maxLookahead:i.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)},u.prototype.preComputeLookaheadFunctions=function(c){var s=this;t.forEach(c,function(f){s.TRACE_INIT(f.name+" Rule Lookahead",function(){var h=a.collectMethods(f),g=h.alternation,p=h.repetition,T=h.option,m=h.repetitionMandatory,l=h.repetitionMandatoryWithSeparator,d=h.repetitionWithSeparator;t.forEach(g,function(y){var v=y.idx===0?"":y.idx;s.TRACE_INIT(""+a.getProductionDslName(y)+v,function(){var E=e.buildLookaheadFuncForOr(y.idx,f,y.maxLookahead||s.maxLookahead,y.hasPredicates,s.dynamicTokensEnabled,s.lookAheadBuilderForAlternatives),S=r.getKeyForAutomaticLookahead(s.fullRuleNameToShort[f.name],r.OR_IDX,y.idx);s.setLaFuncCache(S,E)})}),t.forEach(p,function(y){s.computeLookaheadFunc(f,y.idx,r.MANY_IDX,e.PROD_TYPE.REPETITION,y.maxLookahead,a.getProductionDslName(y))}),t.forEach(T,function(y){s.computeLookaheadFunc(f,y.idx,r.OPTION_IDX,e.PROD_TYPE.OPTION,y.maxLookahead,a.getProductionDslName(y))}),t.forEach(m,function(y){s.computeLookaheadFunc(f,y.idx,r.AT_LEAST_ONE_IDX,e.PROD_TYPE.REPETITION_MANDATORY,y.maxLookahead,a.getProductionDslName(y))}),t.forEach(l,function(y){s.computeLookaheadFunc(f,y.idx,r.AT_LEAST_ONE_SEP_IDX,e.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,y.maxLookahead,a.getProductionDslName(y))}),t.forEach(d,function(y){s.computeLookaheadFunc(f,y.idx,r.MANY_SEP_IDX,e.PROD_TYPE.REPETITION_WITH_SEPARATOR,y.maxLookahead,a.getProductionDslName(y))})})})},u.prototype.computeLookaheadFunc=function(c,s,f,h,g,p){var T=this;this.TRACE_INIT(""+p+(s===0?"":s),function(){var m=e.buildLookaheadFuncForOptionalProd(s,c,g||T.maxLookahead,T.dynamicTokensEnabled,h,T.lookAheadBuilderForOptional),l=r.getKeyForAutomaticLookahead(T.fullRuleNameToShort[c.name],f,s);T.setLaFuncCache(l,m)})},u.prototype.lookAheadBuilderForOptional=function(c,s,f){return e.buildSingleAlternativeLookaheadFunction(c,s,f)},u.prototype.lookAheadBuilderForAlternatives=function(c,s,f,h){return e.buildAlternativesLookAheadFunc(c,s,f,h)},u.prototype.getKeyForAutomaticLookahead=function(c,s){var f=this.getLastExplicitRuleShortName();return r.getKeyForAutomaticLookahead(f,c,s)},u.prototype.getLaFuncFromCache=function(c){},u.prototype.getLaFuncFromMap=function(c){return this.lookAheadFuncsCache.get(c)},u.prototype.getLaFuncFromObj=function(c){return this.lookAheadFuncsCache[c]},u.prototype.setLaFuncCache=function(c,s){},u.prototype.setLaFuncCacheUsingMap=function(c,s){this.lookAheadFuncsCache.set(c,s)},u.prototype.setLaFuncUsingObj=function(c,s){this.lookAheadFuncsCache[c]=s},u})();n.LooksAhead=o}),ai=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addNoneTerminalToCst=n.addTerminalToCst=n.setNodeLocationFull=n.setNodeLocationOnlyOffset=void 0;function e(a,o){isNaN(a.startOffset)===!0?(a.startOffset=o.startOffset,a.endOffset=o.endOffset):a.endOffset<o.endOffset&&(a.endOffset=o.endOffset)}n.setNodeLocationOnlyOffset=e;function t(a,o){isNaN(a.startOffset)===!0?(a.startOffset=o.startOffset,a.startColumn=o.startColumn,a.startLine=o.startLine,a.endOffset=o.endOffset,a.endColumn=o.endColumn,a.endLine=o.endLine):a.endOffset<o.endOffset&&(a.endOffset=o.endOffset,a.endColumn=o.endColumn,a.endLine=o.endLine)}n.setNodeLocationFull=t;function i(a,o,u){a.children[u]===void 0?a.children[u]=[o]:a.children[u].push(o)}n.addTerminalToCst=i;function r(a,o,u){a.children[o]===void 0?a.children[o]=[u]:a.children[o].push(u)}n.addNoneTerminalToCst=r}),xn=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.defineNameProp=n.functionName=n.classNameFromInstance=void 0;var e=xe();function t(o){return r(o.constructor)}n.classNameFromInstance=t;var i="name";function r(o){var u=o.name;return u||"anonymous"}n.functionName=r;function a(o,u){var c=Object.getOwnPropertyDescriptor(o,i);return e.isUndefined(c)||c.configurable?(Object.defineProperty(o,i,{enumerable:!1,configurable:!0,writable:!1,value:u}),!0):!1}n.defineNameProp=a}),ci=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.validateRedundantMethods=n.validateMissingCstMethods=n.validateVisitor=n.CstVisitorDefinitionError=n.createBaseVisitorConstructorWithDefaults=n.createBaseSemanticVisitorConstructor=n.defaultVisit=void 0;var e=xe(),t=xn();function i(h,g){for(var p=e.keys(h),T=p.length,m=0;m<T;m++)for(var l=p[m],d=h[l],y=d.length,v=0;v<y;v++){var E=d[v];E.tokenTypeIdx===void 0&&this[E.name](E.children,g)}}n.defaultVisit=i;function r(h,g){var p=function(){};t.defineNameProp(p,h+"BaseSemantics");var T={visit:function(m,l){if(e.isArray(m)&&(m=m[0]),!e.isUndefined(m))return this[m.name](m.children,l)},validateVisitor:function(){var m=u(this,g);if(!e.isEmpty(m)){var l=e.map(m,function(d){return d.msg});throw Error("Errors Detected in CST Visitor <"+t.functionName(this.constructor)+`>:
|
|
163
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return f},buildInvalidRuleNameError:function(o){return"deprecated"},buildDuplicateRuleNameError:function(o){var c;o.topLevelRule instanceof i.Rule?c=o.topLevelRule.name:c=o.topLevelRule;var A="Duplicate definition, rule: ->"+c+"<- is already defined in the grammar: ->"+o.grammarName+"<-";return A}}}),vo=Ce(n=>{var e=n&&n.__extends||(function(){var c=function(A,a){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,u){f.__proto__=u}||function(f,u){for(var b in u)Object.prototype.hasOwnProperty.call(u,b)&&(f[b]=u[b])},c(A,a)};return function(A,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");c(A,a);function f(){this.constructor=A}A.prototype=a===null?Object.create(a):(f.prototype=a.prototype,new f)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.GastRefResolverVisitor=n.resolveGrammar=void 0;var t=Je(),r=ke(),i=It();function s(c,A){var a=new o(c,A);return a.resolveRefs(),a.errors}n.resolveGrammar=s;var o=(function(c){e(A,c);function A(a,f){var u=c.call(this)||this;return u.nameToTopRule=a,u.errMsgProvider=f,u.errors=[],u}return A.prototype.resolveRefs=function(){var a=this;r.forEach(r.values(this.nameToTopRule),function(f){a.currTopLevel=f,f.accept(a)})},A.prototype.visitNonTerminal=function(a){var f=this.nameToTopRule[a.nonTerminalName];if(f)a.referencedRule=f;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})(i.GAstVisitor);n.GastRefResolverVisitor=o}),vt=Ce(n=>{var e=n&&n.__extends||(function(){var l=function(h,p){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,m){C.__proto__=m}||function(C,m){for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(C[y]=m[y])},l(h,p)};return function(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");l(h,p);function C(){this.constructor=h}h.prototype=p===null?Object.create(p):(C.prototype=p.prototype,new C)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.nextPossibleTokensAfter=n.possiblePathsFrom=n.NextTerminalAfterAtLeastOneSepWalker=n.NextTerminalAfterAtLeastOneWalker=n.NextTerminalAfterManySepWalker=n.NextTerminalAfterManyWalker=n.AbstractNextTerminalAfterProductionWalker=n.NextAfterTokenWalker=n.AbstractNextPossibleTokensWalker=void 0;var t=An(),r=ke(),i=Di(),s=ze(),o=(function(l){e(h,l);function h(p,C){var m=l.call(this)||this;return m.topProd=p,m.path=C,m.possibleTokTypes=[],m.nextProductionName="",m.nextProductionOccurrence=0,m.found=!1,m.isAtEndOfPath=!1,m}return h.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},h.prototype.walk=function(p,C){C===void 0&&(C=[]),this.found||l.prototype.walk.call(this,p,C)},h.prototype.walkProdRef=function(p,C,m){if(p.referencedRule.name===this.nextProductionName&&p.idx===this.nextProductionOccurrence){var y=C.concat(m);this.updateExpectedNext(),this.walk(p.referencedRule,y)}},h.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())},h})(t.RestWalker);n.AbstractNextPossibleTokensWalker=o;var c=(function(l){e(h,l);function h(p,C){var m=l.call(this,p,C)||this;return m.path=C,m.nextTerminalName="",m.nextTerminalOccurrence=0,m.nextTerminalName=m.path.lastTok.name,m.nextTerminalOccurrence=m.path.lastTokOccurrence,m}return h.prototype.walkTerminal=function(p,C,m){if(this.isAtEndOfPath&&p.terminalType.name===this.nextTerminalName&&p.idx===this.nextTerminalOccurrence&&!this.found){var y=C.concat(m),v=new s.Alternative({definition:y});this.possibleTokTypes=i.first(v),this.found=!0}},h})(o);n.NextAfterTokenWalker=c;var A=(function(l){e(h,l);function h(p,C){var m=l.call(this)||this;return m.topRule=p,m.occurrence=C,m.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},m}return h.prototype.startWalking=function(){return this.walk(this.topRule),this.result},h})(t.RestWalker);n.AbstractNextTerminalAfterProductionWalker=A;var a=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkMany=function(p,C,m){if(p.idx===this.occurrence){var y=r.first(C.concat(m));this.result.isEndOfRule=y===void 0,y instanceof s.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkMany.call(this,p,C,m)},h})(A);n.NextTerminalAfterManyWalker=a;var f=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkManySep=function(p,C,m){if(p.idx===this.occurrence){var y=r.first(C.concat(m));this.result.isEndOfRule=y===void 0,y instanceof s.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkManySep.call(this,p,C,m)},h})(A);n.NextTerminalAfterManySepWalker=f;var u=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkAtLeastOne=function(p,C,m){if(p.idx===this.occurrence){var y=r.first(C.concat(m));this.result.isEndOfRule=y===void 0,y instanceof s.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkAtLeastOne.call(this,p,C,m)},h})(A);n.NextTerminalAfterAtLeastOneWalker=u;var b=(function(l){e(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.prototype.walkAtLeastOneSep=function(p,C,m){if(p.idx===this.occurrence){var y=r.first(C.concat(m));this.result.isEndOfRule=y===void 0,y instanceof s.Terminal&&(this.result.token=y.terminalType,this.result.occurrence=y.idx)}else l.prototype.walkAtLeastOneSep.call(this,p,C,m)},h})(A);n.NextTerminalAfterAtLeastOneSepWalker=b;function d(l,h,p){p===void 0&&(p=[]),p=r.cloneArr(p);var C=[],m=0;function y(w){return w.concat(r.drop(l,m+1))}function v(w){var M=d(y(w),h,p);return C.concat(M)}for(;p.length<h&&m<l.length;){var S=l[m];if(S instanceof s.Alternative||S instanceof s.NonTerminal)return v(S.definition);if(S instanceof s.Option)C=v(S.definition);else if(S instanceof s.RepetitionMandatory){var U=S.definition.concat([new s.Repetition({definition:S.definition})]);return v(U)}else if(S instanceof s.RepetitionMandatoryWithSeparator){var U=[new s.Alternative({definition:S.definition}),new s.Repetition({definition:[new s.Terminal({terminalType:S.separator})].concat(S.definition)})];return v(U)}else if(S instanceof s.RepetitionWithSeparator){var U=S.definition.concat([new s.Repetition({definition:[new s.Terminal({terminalType:S.separator})].concat(S.definition)})]);C=v(U)}else if(S instanceof s.Repetition){var U=S.definition.concat([new s.Repetition({definition:S.definition})]);C=v(U)}else{if(S instanceof s.Alternation)return r.forEach(S.definition,function(w){r.isEmpty(w.definition)===!1&&(C=v(w.definition))}),C;if(S instanceof s.Terminal)p.push(S.terminalType);else throw Error("non exhaustive match")}m++}return C.push({partialPath:p,suffixDef:r.drop(l,m)}),C}n.possiblePathsFrom=d;function E(l,h,p,C){var m="EXIT_NONE_TERMINAL",y=[m],v="EXIT_ALTERNATIVE",S=!1,U=h.length,w=U-C-1,M=[],_=[];for(_.push({idx:-1,def:l,ruleStack:[],occurrenceStack:[]});!r.isEmpty(_);){var k=_.pop();if(k===v){S&&r.last(_).idx<=w&&_.pop();continue}var D=k.def,L=k.idx,V=k.ruleStack,W=k.occurrenceStack;if(!r.isEmpty(D)){var j=D[0];if(j===m){var J={idx:L,def:r.drop(D),ruleStack:r.dropRight(V),occurrenceStack:r.dropRight(W)};_.push(J)}else if(j instanceof s.Terminal)if(L<U-1){var Z=L+1,Ae=h[Z];if(p(Ae,j.terminalType)){var J={idx:Z,def:r.drop(D),ruleStack:V,occurrenceStack:W};_.push(J)}}else if(L===U-1)M.push({nextTokenType:j.terminalType,nextTokenOccurrence:j.idx,ruleStack:V,occurrenceStack:W}),S=!0;else throw Error("non exhaustive match");else if(j instanceof s.NonTerminal){var ie=r.cloneArr(V);ie.push(j.nonTerminalName);var re=r.cloneArr(W);re.push(j.idx);var J={idx:L,def:j.definition.concat(y,r.drop(D)),ruleStack:ie,occurrenceStack:re};_.push(J)}else if(j instanceof s.Option){var ee={idx:L,def:r.drop(D),ruleStack:V,occurrenceStack:W};_.push(ee),_.push(v);var le={idx:L,def:j.definition.concat(r.drop(D)),ruleStack:V,occurrenceStack:W};_.push(le)}else if(j instanceof s.RepetitionMandatory){var P=new s.Repetition({definition:j.definition,idx:j.idx}),H=j.definition.concat([P],r.drop(D)),J={idx:L,def:H,ruleStack:V,occurrenceStack:W};_.push(J)}else if(j instanceof s.RepetitionMandatoryWithSeparator){var z=new s.Terminal({terminalType:j.separator}),P=new s.Repetition({definition:[z].concat(j.definition),idx:j.idx}),H=j.definition.concat([P],r.drop(D)),J={idx:L,def:H,ruleStack:V,occurrenceStack:W};_.push(J)}else if(j instanceof s.RepetitionWithSeparator){var ee={idx:L,def:r.drop(D),ruleStack:V,occurrenceStack:W};_.push(ee),_.push(v);var z=new s.Terminal({terminalType:j.separator}),X=new s.Repetition({definition:[z].concat(j.definition),idx:j.idx}),H=j.definition.concat([X],r.drop(D)),le={idx:L,def:H,ruleStack:V,occurrenceStack:W};_.push(le)}else if(j instanceof s.Repetition){var ee={idx:L,def:r.drop(D),ruleStack:V,occurrenceStack:W};_.push(ee),_.push(v);var X=new s.Repetition({definition:j.definition,idx:j.idx}),H=j.definition.concat([X],r.drop(D)),le={idx:L,def:H,ruleStack:V,occurrenceStack:W};_.push(le)}else if(j instanceof s.Alternation)for(var te=j.definition.length-1;te>=0;te--){var ae=j.definition[te],me={idx:L,def:ae.definition.concat(r.drop(D)),ruleStack:V,occurrenceStack:W};_.push(me),_.push(v)}else if(j instanceof s.Alternative)_.push({idx:L,def:j.definition.concat(r.drop(D)),ruleStack:V,occurrenceStack:W});else if(j instanceof s.Rule)_.push(g(j,L,V,W));else throw Error("non exhaustive match")}}return M}n.nextPossibleTokensAfter=E;function g(l,h,p,C){var m=r.cloneArr(p);m.push(l.name);var y=r.cloneArr(C);return y.push(1),{idx:h,def:l.definition,ruleStack:m,occurrenceStack:y}}}),kt=Ce(n=>{var e=n&&n.__extends||(function(){var w=function(M,_){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,D){k.__proto__=D}||function(k,D){for(var L in D)Object.prototype.hasOwnProperty.call(D,L)&&(k[L]=D[L])},w(M,_)};return function(M,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");w(M,_);function k(){this.constructor=M}M.prototype=_===null?Object.create(_):(k.prototype=_.prototype,new k)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.areTokenCategoriesNotUsed=n.isStrictPrefixOfPath=n.containsPath=n.getLookaheadPathsForOptionalProd=n.getLookaheadPathsForOr=n.lookAheadSequenceFromAlternatives=n.buildSingleAlternativeLookaheadFunction=n.buildAlternativesLookAheadFunc=n.buildLookaheadFuncForOptionalProd=n.buildLookaheadFuncForOr=n.getProdType=n.PROD_TYPE=void 0;var t=ke(),r=vt(),i=An(),s=Et(),o=ze(),c=It(),A;(function(w){w[w.OPTION=0]="OPTION",w[w.REPETITION=1]="REPETITION",w[w.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",w[w.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",w[w.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",w[w.ALTERNATION=5]="ALTERNATION"})(A=n.PROD_TYPE||(n.PROD_TYPE={}));function a(w){if(w instanceof o.Option)return A.OPTION;if(w instanceof o.Repetition)return A.REPETITION;if(w instanceof o.RepetitionMandatory)return A.REPETITION_MANDATORY;if(w instanceof o.RepetitionMandatoryWithSeparator)return A.REPETITION_MANDATORY_WITH_SEPARATOR;if(w instanceof o.RepetitionWithSeparator)return A.REPETITION_WITH_SEPARATOR;if(w instanceof o.Alternation)return A.ALTERNATION;throw Error("non exhaustive match")}n.getProdType=a;function f(w,M,_,k,D,L){var V=m(w,M,_),W=U(V)?s.tokenStructuredMatcherNoCategories:s.tokenStructuredMatcher;return L(V,k,W,D)}n.buildLookaheadFuncForOr=f;function u(w,M,_,k,D,L){var V=y(w,M,D,_),W=U(V)?s.tokenStructuredMatcherNoCategories:s.tokenStructuredMatcher;return L(V[0],W,k)}n.buildLookaheadFuncForOptionalProd=u;function b(w,M,_,k){var D=w.length,L=t.every(w,function(j){return t.every(j,function(J){return J.length===1})});if(M)return function(j){for(var J=t.map(j,function(X){return X.GATE}),Z=0;Z<D;Z++){var Ae=w[Z],ie=Ae.length,re=J[Z];if(!(re!==void 0&&re.call(this)===!1))e:for(var ee=0;ee<ie;ee++){for(var le=Ae[ee],P=le.length,H=0;H<P;H++){var z=this.LA(H+1);if(_(z,le[H])===!1)continue e}return Z}}};if(L&&!k){var V=t.map(w,function(j){return t.flatten(j)}),W=t.reduce(V,function(j,J,Z){return t.forEach(J,function(Ae){t.has(j,Ae.tokenTypeIdx)||(j[Ae.tokenTypeIdx]=Z),t.forEach(Ae.categoryMatches,function(ie){t.has(j,ie)||(j[ie]=Z)})}),j},[]);return function(){var j=this.LA(1);return W[j.tokenTypeIdx]}}else return function(){for(var j=0;j<D;j++){var J=w[j],Z=J.length;e:for(var Ae=0;Ae<Z;Ae++){for(var ie=J[Ae],re=ie.length,ee=0;ee<re;ee++){var le=this.LA(ee+1);if(_(le,ie[ee])===!1)continue e}return j}}}}n.buildAlternativesLookAheadFunc=b;function d(w,M,_){var k=t.every(w,function(J){return J.length===1}),D=w.length;if(k&&!_){var L=t.flatten(w);if(L.length===1&&t.isEmpty(L[0].categoryMatches)){var V=L[0],W=V.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===W}}else{var j=t.reduce(L,function(J,Z,Ae){return J[Z.tokenTypeIdx]=!0,t.forEach(Z.categoryMatches,function(ie){J[ie]=!0}),J},[]);return function(){var J=this.LA(1);return j[J.tokenTypeIdx]===!0}}}else return function(){e:for(var J=0;J<D;J++){for(var Z=w[J],Ae=Z.length,ie=0;ie<Ae;ie++){var re=this.LA(ie+1);if(M(re,Z[ie])===!1)continue e}return!0}return!1}}n.buildSingleAlternativeLookaheadFunction=d;var E=(function(w){e(M,w);function M(_,k,D){var L=w.call(this)||this;return L.topProd=_,L.targetOccurrence=k,L.targetProdType=D,L}return M.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},M.prototype.checkIsTarget=function(_,k,D,L){return _.idx===this.targetOccurrence&&this.targetProdType===k?(this.restDef=D.concat(L),!0):!1},M.prototype.walkOption=function(_,k,D){this.checkIsTarget(_,A.OPTION,k,D)||w.prototype.walkOption.call(this,_,k,D)},M.prototype.walkAtLeastOne=function(_,k,D){this.checkIsTarget(_,A.REPETITION_MANDATORY,k,D)||w.prototype.walkOption.call(this,_,k,D)},M.prototype.walkAtLeastOneSep=function(_,k,D){this.checkIsTarget(_,A.REPETITION_MANDATORY_WITH_SEPARATOR,k,D)||w.prototype.walkOption.call(this,_,k,D)},M.prototype.walkMany=function(_,k,D){this.checkIsTarget(_,A.REPETITION,k,D)||w.prototype.walkOption.call(this,_,k,D)},M.prototype.walkManySep=function(_,k,D){this.checkIsTarget(_,A.REPETITION_WITH_SEPARATOR,k,D)||w.prototype.walkOption.call(this,_,k,D)},M})(i.RestWalker),g=(function(w){e(M,w);function M(_,k,D){var L=w.call(this)||this;return L.targetOccurrence=_,L.targetProdType=k,L.targetRef=D,L.result=[],L}return M.prototype.checkIsTarget=function(_,k){_.idx===this.targetOccurrence&&this.targetProdType===k&&(this.targetRef===void 0||_===this.targetRef)&&(this.result=_.definition)},M.prototype.visitOption=function(_){this.checkIsTarget(_,A.OPTION)},M.prototype.visitRepetition=function(_){this.checkIsTarget(_,A.REPETITION)},M.prototype.visitRepetitionMandatory=function(_){this.checkIsTarget(_,A.REPETITION_MANDATORY)},M.prototype.visitRepetitionMandatoryWithSeparator=function(_){this.checkIsTarget(_,A.REPETITION_MANDATORY_WITH_SEPARATOR)},M.prototype.visitRepetitionWithSeparator=function(_){this.checkIsTarget(_,A.REPETITION_WITH_SEPARATOR)},M.prototype.visitAlternation=function(_){this.checkIsTarget(_,A.ALTERNATION)},M})(c.GAstVisitor);function l(w){for(var M=new Array(w),_=0;_<w;_++)M[_]=[];return M}function h(w){for(var M=[""],_=0;_<w.length;_++){for(var k=w[_],D=[],L=0;L<M.length;L++){var V=M[L];D.push(V+"_"+k.tokenTypeIdx);for(var W=0;W<k.categoryMatches.length;W++){var j="_"+k.categoryMatches[W];D.push(V+j)}}M=D}return M}function p(w,M,_){for(var k=0;k<w.length;k++)if(k!==_)for(var D=w[k],L=0;L<M.length;L++){var V=M[L];if(D[V]===!0)return!1}return!0}function C(w,M){for(var _=t.map(w,function(Z){return r.possiblePathsFrom([Z],1)}),k=l(_.length),D=t.map(_,function(Z){var Ae={};return t.forEach(Z,function(ie){var re=h(ie.partialPath);t.forEach(re,function(ee){Ae[ee]=!0})}),Ae}),L=_,V=1;V<=M;V++){var W=L;L=l(W.length);for(var j=function(Z){for(var Ae=W[Z],ie=0;ie<Ae.length;ie++){var re=Ae[ie].partialPath,ee=Ae[ie].suffixDef,le=h(re),P=p(D,le,Z);if(P||t.isEmpty(ee)||re.length===M){var H=k[Z];if(v(H,re)===!1){H.push(re);for(var z=0;z<le.length;z++){var X=le[z];D[Z][X]=!0}}}else{var te=r.possiblePathsFrom(ee,V+1,re);L[Z]=L[Z].concat(te),t.forEach(te,function(ae){var me=h(ae.partialPath);t.forEach(me,function(ge){D[Z][ge]=!0})})}}},J=0;J<W.length;J++)j(J)}return k}n.lookAheadSequenceFromAlternatives=C;function m(w,M,_,k){var D=new g(w,A.ALTERNATION,k);return M.accept(D),C(D.result,_)}n.getLookaheadPathsForOr=m;function y(w,M,_,k){var D=new g(w,_);M.accept(D);var L=D.result,V=new E(M,w,_),W=V.startWalking(),j=new o.Alternative({definition:L}),J=new o.Alternative({definition:W});return C([j,J],k)}n.getLookaheadPathsForOptionalProd=y;function v(w,M){e:for(var _=0;_<w.length;_++){var k=w[_];if(k.length===M.length){for(var D=0;D<k.length;D++){var L=M[D],V=k[D],W=L===V||V.categoryMatchesMap[L.tokenTypeIdx]!==void 0;if(W===!1)continue e}return!0}}return!1}n.containsPath=v;function S(w,M){return w.length<M.length&&t.every(w,function(_,k){var D=M[k];return _===D||D.categoryMatchesMap[_.tokenTypeIdx]})}n.isStrictPrefixOfPath=S;function U(w){return t.every(w,function(M){return t.every(M,function(_){return t.every(_,function(k){return t.isEmpty(k.categoryMatches)})})})}n.areTokenCategoriesNotUsed=U}),Fi=Ce(n=>{var e=n&&n.__extends||(function(){var k=function(D,L){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(V,W){V.__proto__=W}||function(V,W){for(var j in W)Object.prototype.hasOwnProperty.call(W,j)&&(V[j]=W[j])},k(D,L)};return function(D,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");k(D,L);function V(){this.constructor=D}D.prototype=L===null?Object.create(L):(V.prototype=L.prototype,new V)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.checkPrefixAlternativesAmbiguities=n.validateSomeNonEmptyLookaheadPath=n.validateTooManyAlts=n.RepetionCollector=n.validateAmbiguousAlternationAlternatives=n.validateEmptyOrAlternative=n.getFirstNoneTerminal=n.validateNoLeftRecursion=n.validateRuleIsOverridden=n.validateRuleDoesNotAlreadyExist=n.OccurrenceValidationCollector=n.identifyProductionForDuplicates=n.validateGrammar=void 0;var t=ke(),r=ke(),i=Je(),s=Qt(),o=kt(),c=vt(),A=ze(),a=It();function f(k,D,L,V,W){var j=t.map(k,function(P){return u(P,V)}),J=t.map(k,function(P){return h(P,P,V)}),Z=[],Ae=[],ie=[];r.every(J,r.isEmpty)&&(Z=r.map(k,function(P){return m(P,V)}),Ae=r.map(k,function(P){return y(P,D,V)}),ie=U(k,D,V));var re=_(k,L,V),ee=r.map(k,function(P){return S(P,V)}),le=r.map(k,function(P){return g(P,k,W,V)});return t.flatten(j.concat(ie,J,Z,Ae,re,ee,le))}n.validateGrammar=f;function u(k,D){var L=new E;k.accept(L);var V=L.allProductions,W=t.groupBy(V,b),j=t.pick(W,function(Z){return Z.length>1}),J=t.map(t.values(j),function(Z){var Ae=t.first(Z),ie=D.buildDuplicateFoundError(k,Z),re=s.getProductionDslName(Ae),ee={message:ie,type:i.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:k.name,dslName:re,occurrence:Ae.idx},le=d(Ae);return le&&(ee.parameter=le),ee});return J}function b(k){return s.getProductionDslName(k)+"_#_"+k.idx+"_#_"+d(k)}n.identifyProductionForDuplicates=b;function d(k){return k instanceof A.Terminal?k.terminalType.name:k instanceof A.NonTerminal?k.nonTerminalName:""}var E=(function(k){e(D,k);function D(){var L=k!==null&&k.apply(this,arguments)||this;return L.allProductions=[],L}return D.prototype.visitNonTerminal=function(L){this.allProductions.push(L)},D.prototype.visitOption=function(L){this.allProductions.push(L)},D.prototype.visitRepetitionWithSeparator=function(L){this.allProductions.push(L)},D.prototype.visitRepetitionMandatory=function(L){this.allProductions.push(L)},D.prototype.visitRepetitionMandatoryWithSeparator=function(L){this.allProductions.push(L)},D.prototype.visitRepetition=function(L){this.allProductions.push(L)},D.prototype.visitAlternation=function(L){this.allProductions.push(L)},D.prototype.visitTerminal=function(L){this.allProductions.push(L)},D})(a.GAstVisitor);n.OccurrenceValidationCollector=E;function g(k,D,L,V){var W=[],j=r.reduce(D,function(Z,Ae){return Ae.name===k.name?Z+1:Z},0);if(j>1){var J=V.buildDuplicateRuleNameError({topLevelRule:k,grammarName:L});W.push({message:J,type:i.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:k.name})}return W}n.validateRuleDoesNotAlreadyExist=g;function l(k,D,L){var V=[],W;return t.contains(D,k)||(W="Invalid rule override, rule: ->"+k+"<- cannot be overridden in the grammar: ->"+L+"<-as it is not defined in any of the super grammars ",V.push({message:W,type:i.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:k})),V}n.validateRuleIsOverridden=l;function h(k,D,L,V){V===void 0&&(V=[]);var W=[],j=p(D.definition);if(t.isEmpty(j))return[];var J=k.name,Z=t.contains(j,k);Z&&W.push({message:L.buildLeftRecursionError({topLevelRule:k,leftRecursionPath:V}),type:i.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:J});var Ae=t.difference(j,V.concat([k])),ie=t.map(Ae,function(re){var ee=t.cloneArr(V);return ee.push(re),h(k,re,L,ee)});return W.concat(t.flatten(ie))}n.validateNoLeftRecursion=h;function p(k){var D=[];if(t.isEmpty(k))return D;var L=t.first(k);if(L instanceof A.NonTerminal)D.push(L.referencedRule);else if(L instanceof A.Alternative||L instanceof A.Option||L instanceof A.RepetitionMandatory||L instanceof A.RepetitionMandatoryWithSeparator||L instanceof A.RepetitionWithSeparator||L instanceof A.Repetition)D=D.concat(p(L.definition));else if(L instanceof A.Alternation)D=t.flatten(t.map(L.definition,function(J){return p(J.definition)}));else if(!(L instanceof A.Terminal))throw Error("non exhaustive match");var V=s.isOptionalProd(L),W=k.length>1;if(V&&W){var j=t.drop(k);return D.concat(p(j))}else return D}n.getFirstNoneTerminal=p;var C=(function(k){e(D,k);function D(){var L=k!==null&&k.apply(this,arguments)||this;return L.alternations=[],L}return D.prototype.visitAlternation=function(L){this.alternations.push(L)},D})(a.GAstVisitor);function m(k,D){var L=new C;k.accept(L);var V=L.alternations,W=t.reduce(V,function(j,J){var Z=t.dropRight(J.definition),Ae=t.map(Z,function(ie,re){var ee=c.nextPossibleTokensAfter([ie],[],null,1);return t.isEmpty(ee)?{message:D.buildEmptyAlternationError({topLevelRule:k,alternation:J,emptyChoiceIdx:re}),type:i.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:k.name,occurrence:J.idx,alternative:re+1}:null});return j.concat(t.compact(Ae))},[]);return W}n.validateEmptyOrAlternative=m;function y(k,D,L){var V=new C;k.accept(V);var W=V.alternations;W=r.reject(W,function(J){return J.ignoreAmbiguities===!0});var j=t.reduce(W,function(J,Z){var Ae=Z.idx,ie=Z.maxLookahead||D,re=o.getLookaheadPathsForOr(Ae,k,ie,Z),ee=w(re,Z,k,L),le=M(re,Z,k,L);return J.concat(ee,le)},[]);return j}n.validateAmbiguousAlternationAlternatives=y;var v=(function(k){e(D,k);function D(){var L=k!==null&&k.apply(this,arguments)||this;return L.allProductions=[],L}return D.prototype.visitRepetitionWithSeparator=function(L){this.allProductions.push(L)},D.prototype.visitRepetitionMandatory=function(L){this.allProductions.push(L)},D.prototype.visitRepetitionMandatoryWithSeparator=function(L){this.allProductions.push(L)},D.prototype.visitRepetition=function(L){this.allProductions.push(L)},D})(a.GAstVisitor);n.RepetionCollector=v;function S(k,D){var L=new C;k.accept(L);var V=L.alternations,W=t.reduce(V,function(j,J){return J.definition.length>255&&j.push({message:D.buildTooManyAlternativesError({topLevelRule:k,alternation:J}),type:i.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:k.name,occurrence:J.idx}),j},[]);return W}n.validateTooManyAlts=S;function U(k,D,L){var V=[];return r.forEach(k,function(W){var j=new v;W.accept(j);var J=j.allProductions;r.forEach(J,function(Z){var Ae=o.getProdType(Z),ie=Z.maxLookahead||D,re=Z.idx,ee=o.getLookaheadPathsForOptionalProd(re,W,Ae,ie),le=ee[0];if(r.isEmpty(r.flatten(le))){var P=L.buildEmptyRepetitionError({topLevelRule:W,repetition:Z});V.push({message:P,type:i.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:W.name})}})}),V}n.validateSomeNonEmptyLookaheadPath=U;function w(k,D,L,V){var W=[],j=r.reduce(k,function(Z,Ae,ie){return D.definition[ie].ignoreAmbiguities===!0||r.forEach(Ae,function(re){var ee=[ie];r.forEach(k,function(le,P){ie!==P&&o.containsPath(le,re)&&D.definition[P].ignoreAmbiguities!==!0&&ee.push(P)}),ee.length>1&&!o.containsPath(W,re)&&(W.push(re),Z.push({alts:ee,path:re}))}),Z},[]),J=t.map(j,function(Z){var Ae=r.map(Z.alts,function(re){return re+1}),ie=V.buildAlternationAmbiguityError({topLevelRule:L,alternation:D,ambiguityIndices:Ae,prefixPath:Z.path});return{message:ie,type:i.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:L.name,occurrence:D.idx,alternatives:[Z.alts]}});return J}function M(k,D,L,V){var W=[],j=r.reduce(k,function(J,Z,Ae){var ie=r.map(Z,function(re){return{idx:Ae,path:re}});return J.concat(ie)},[]);return r.forEach(j,function(J){var Z=D.definition[J.idx];if(Z.ignoreAmbiguities!==!0){var Ae=J.idx,ie=J.path,re=r.findAll(j,function(le){return D.definition[le.idx].ignoreAmbiguities!==!0&&le.idx<Ae&&o.isStrictPrefixOfPath(le.path,ie)}),ee=r.map(re,function(le){var P=[le.idx+1,Ae+1],H=D.idx===0?"":D.idx,z=V.buildAlternationPrefixAmbiguityError({topLevelRule:L,alternation:D,ambiguityIndices:P,prefixPath:le.path});return{message:z,type:i.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:L.name,occurrence:H,alternatives:P}});W=W.concat(ee)}}),W}n.checkPrefixAlternativesAmbiguities=M;function _(k,D,L){var V=[],W=r.map(D,function(j){return j.name});return r.forEach(k,function(j){var J=j.name;if(r.contains(W,J)){var Z=L.buildNamespaceConflictError(j);V.push({message:Z,type:i.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:J})}}),V}}),ko=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.validateGrammar=n.resolveGrammar=void 0;var e=ke(),t=vo(),r=Fi(),i=wt();function s(c){c=e.defaults(c,{errMsgProvider:i.defaultGrammarResolverErrorProvider});var A={};return e.forEach(c.rules,function(a){A[a.name]=a}),t.resolveGrammar(A,c.errMsgProvider)}n.resolveGrammar=s;function o(c){return c=e.defaults(c,{errMsgProvider:i.defaultGrammarValidatorErrorProvider}),r.validateGrammar(c.rules,c.maxLookahead,c.tokenTypes,c.errMsgProvider,c.grammarName)}n.validateGrammar=o}),mt=Ce(n=>{var e=n&&n.__extends||(function(){var E=function(g,l){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var C in p)Object.prototype.hasOwnProperty.call(p,C)&&(h[C]=p[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 h(){this.constructor=g}g.prototype=l===null?Object.create(l):(h.prototype=l.prototype,new h)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.EarlyExitException=n.NotAllInputParsedException=n.NoViableAltException=n.MismatchedTokenException=n.isRecognitionException=void 0;var t=ke(),r="MismatchedTokenException",i="NoViableAltException",s="EarlyExitException",o="NotAllInputParsedException",c=[r,i,s,o];Object.freeze(c);function A(E){return t.contains(c,E.name)}n.isRecognitionException=A;var a=(function(E){e(g,E);function g(l,h){var p=this.constructor,C=E.call(this,l)||this;return C.token=h,C.resyncedTokens=[],Object.setPrototypeOf(C,p.prototype),Error.captureStackTrace&&Error.captureStackTrace(C,C.constructor),C}return g})(Error),f=(function(E){e(g,E);function g(l,h,p){var C=E.call(this,l,h)||this;return C.previousToken=p,C.name=r,C}return g})(a);n.MismatchedTokenException=f;var u=(function(E){e(g,E);function g(l,h,p){var C=E.call(this,l,h)||this;return C.previousToken=p,C.name=i,C}return g})(a);n.NoViableAltException=u;var b=(function(E){e(g,E);function g(l,h){var p=E.call(this,l,h)||this;return p.name=o,p}return g})(a);n.NotAllInputParsedException=b;var d=(function(E){e(g,E);function g(l,h,p){var C=E.call(this,l,h)||this;return C.previousToken=p,C.name=s,C}return g})(a);n.EarlyExitException=d}),Mi=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.attemptInRepetitionRecovery=n.Recoverable=n.InRuleRecoveryException=n.IN_RULE_RECOVERY_EXCEPTION=n.EOF_FOLLOW_KEY=void 0;var e=st(),t=ke(),r=mt(),i=Oi(),s=Je();n.EOF_FOLLOW_KEY={},n.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function o(a){this.name=n.IN_RULE_RECOVERY_EXCEPTION,this.message=a}n.InRuleRecoveryException=o,o.prototype=Error.prototype;var c=(function(){function a(){}return a.prototype.initRecoverable=function(f){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=t.has(f,"recoveryEnabled")?f.recoveryEnabled:s.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=A)},a.prototype.getTokenToInsert=function(f){var u=e.createTokenInstance(f,"",NaN,NaN,NaN,NaN,NaN,NaN);return u.isInsertedInRecovery=!0,u},a.prototype.canTokenTypeBeInsertedInRecovery=function(f){return!0},a.prototype.tryInRepetitionRecovery=function(f,u,b,d){for(var E=this,g=this.findReSyncTokenType(),l=this.exportLexerState(),h=[],p=!1,C=this.LA(1),m=this.LA(1),y=function(){var v=E.LA(0),S=E.errorMessageProvider.buildMismatchTokenMessage({expected:d,actual:C,previous:v,ruleName:E.getCurrRuleFullName()}),U=new r.MismatchedTokenException(S,C,E.LA(0));U.resyncedTokens=t.dropRight(h),E.SAVE_ERROR(U)};!p;)if(this.tokenMatcher(m,d)){y();return}else if(b.call(this)){y(),f.apply(this,u);return}else this.tokenMatcher(m,g)?p=!0:(m=this.SKIP_TOKEN(),this.addToResyncTokens(m,h));this.importLexerState(l)},a.prototype.shouldInRepetitionRecoveryBeTried=function(f,u,b){return!(b===!1||f===void 0||u===void 0||this.tokenMatcher(this.LA(1),f)||this.isBackTracking()||this.canPerformInRuleRecovery(f,this.getFollowsForInRuleRecovery(f,u)))},a.prototype.getFollowsForInRuleRecovery=function(f,u){var b=this.getCurrentGrammarPath(f,u),d=this.getNextPossibleTokenTypes(b);return d},a.prototype.tryInRuleRecovery=function(f,u){if(this.canRecoverWithSingleTokenInsertion(f,u)){var b=this.getTokenToInsert(f);return b}if(this.canRecoverWithSingleTokenDeletion(f)){var d=this.SKIP_TOKEN();return this.consumeToken(),d}throw new o("sad sad panda")},a.prototype.canPerformInRuleRecovery=function(f,u){return this.canRecoverWithSingleTokenInsertion(f,u)||this.canRecoverWithSingleTokenDeletion(f)},a.prototype.canRecoverWithSingleTokenInsertion=function(f,u){var b=this;if(!this.canTokenTypeBeInsertedInRecovery(f)||t.isEmpty(u))return!1;var d=this.LA(1),E=t.find(u,function(g){return b.tokenMatcher(d,g)})!==void 0;return E},a.prototype.canRecoverWithSingleTokenDeletion=function(f){var u=this.tokenMatcher(this.LA(2),f);return u},a.prototype.isInCurrentRuleReSyncSet=function(f){var u=this.getCurrFollowKey(),b=this.getFollowSetFromFollowKey(u);return t.contains(b,f)},a.prototype.findReSyncTokenType=function(){for(var f=this.flattenFollowSet(),u=this.LA(1),b=2;;){var d=u.tokenType;if(t.contains(f,d))return d;u=this.LA(b),b++}},a.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return n.EOF_FOLLOW_KEY;var f=this.getLastExplicitRuleShortName(),u=this.getLastExplicitRuleOccurrenceIndex(),b=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(f),idxInCallingRule:u,inRule:this.shortRuleNameToFullName(b)}},a.prototype.buildFullFollowKeyStack=function(){var f=this,u=this.RULE_STACK,b=this.RULE_OCCURRENCE_STACK;return t.map(u,function(d,E){return E===0?n.EOF_FOLLOW_KEY:{ruleName:f.shortRuleNameToFullName(d),idxInCallingRule:b[E],inRule:f.shortRuleNameToFullName(u[E-1])}})},a.prototype.flattenFollowSet=function(){var f=this,u=t.map(this.buildFullFollowKeyStack(),function(b){return f.getFollowSetFromFollowKey(b)});return t.flatten(u)},a.prototype.getFollowSetFromFollowKey=function(f){if(f===n.EOF_FOLLOW_KEY)return[e.EOF];var u=f.ruleName+f.idxInCallingRule+i.IN+f.inRule;return this.resyncFollows[u]},a.prototype.addToResyncTokens=function(f,u){return this.tokenMatcher(f,e.EOF)||u.push(f),u},a.prototype.reSyncTo=function(f){for(var u=[],b=this.LA(1);this.tokenMatcher(b,f)===!1;)b=this.SKIP_TOKEN(),this.addToResyncTokens(b,u);return t.dropRight(u)},a.prototype.attemptInRepetitionRecovery=function(f,u,b,d,E,g,l){},a.prototype.getCurrentGrammarPath=function(f,u){var b=this.getHumanReadableRuleStack(),d=t.cloneArr(this.RULE_OCCURRENCE_STACK),E={ruleStack:b,occurrenceStack:d,lastTok:f,lastTokOccurrence:u};return E},a.prototype.getHumanReadableRuleStack=function(){var f=this;return t.map(this.RULE_STACK,function(u){return f.shortRuleNameToFullName(u)})},a})();n.Recoverable=c;function A(a,f,u,b,d,E,g){var l=this.getKeyForAutomaticLookahead(b,d),h=this.firstAfterRepMap[l];if(h===void 0){var p=this.getCurrRuleFullName(),C=this.getGAstProductions()[p],m=new E(C,d);h=m.startWalking(),this.firstAfterRepMap[l]=h}var y=h.token,v=h.occurrence,S=h.isEndOfRule;this.RULE_STACK.length===1&&S&&y===void 0&&(y=e.EOF,v=1),this.shouldInRepetitionRecoveryBeTried(y,v,g)&&this.tryInRepetitionRecovery(a,f,u,y)}n.attemptInRepetitionRecovery=A}),cn=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getKeyForAutomaticLookahead=n.AT_LEAST_ONE_SEP_IDX=n.MANY_SEP_IDX=n.AT_LEAST_ONE_IDX=n.MANY_IDX=n.OPTION_IDX=n.OR_IDX=n.BITS_FOR_ALT_IDX=n.BITS_FOR_RULE_IDX=n.BITS_FOR_OCCURRENCE_IDX=n.BITS_FOR_METHOD_TYPE=void 0,n.BITS_FOR_METHOD_TYPE=4,n.BITS_FOR_OCCURRENCE_IDX=8,n.BITS_FOR_RULE_IDX=12,n.BITS_FOR_ALT_IDX=8,n.OR_IDX=1<<n.BITS_FOR_OCCURRENCE_IDX,n.OPTION_IDX=2<<n.BITS_FOR_OCCURRENCE_IDX,n.MANY_IDX=3<<n.BITS_FOR_OCCURRENCE_IDX,n.AT_LEAST_ONE_IDX=4<<n.BITS_FOR_OCCURRENCE_IDX,n.MANY_SEP_IDX=5<<n.BITS_FOR_OCCURRENCE_IDX,n.AT_LEAST_ONE_SEP_IDX=6<<n.BITS_FOR_OCCURRENCE_IDX;function e(t,r,i){return i|r|t}n.getKeyForAutomaticLookahead=e,32-n.BITS_FOR_ALT_IDX}),So=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LooksAhead=void 0;var e=kt(),t=ke(),r=Je(),i=cn(),s=Qt(),o=(function(){function c(){}return c.prototype.initLooksAhead=function(A){this.dynamicTokensEnabled=t.has(A,"dynamicTokensEnabled")?A.dynamicTokensEnabled:r.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=t.has(A,"maxLookahead")?A.maxLookahead:r.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(f){a.TRACE_INIT(f.name+" Rule Lookahead",function(){var u=s.collectMethods(f),b=u.alternation,d=u.repetition,E=u.option,g=u.repetitionMandatory,l=u.repetitionMandatoryWithSeparator,h=u.repetitionWithSeparator;t.forEach(b,function(p){var C=p.idx===0?"":p.idx;a.TRACE_INIT(""+s.getProductionDslName(p)+C,function(){var m=e.buildLookaheadFuncForOr(p.idx,f,p.maxLookahead||a.maxLookahead,p.hasPredicates,a.dynamicTokensEnabled,a.lookAheadBuilderForAlternatives),y=i.getKeyForAutomaticLookahead(a.fullRuleNameToShort[f.name],i.OR_IDX,p.idx);a.setLaFuncCache(y,m)})}),t.forEach(d,function(p){a.computeLookaheadFunc(f,p.idx,i.MANY_IDX,e.PROD_TYPE.REPETITION,p.maxLookahead,s.getProductionDslName(p))}),t.forEach(E,function(p){a.computeLookaheadFunc(f,p.idx,i.OPTION_IDX,e.PROD_TYPE.OPTION,p.maxLookahead,s.getProductionDslName(p))}),t.forEach(g,function(p){a.computeLookaheadFunc(f,p.idx,i.AT_LEAST_ONE_IDX,e.PROD_TYPE.REPETITION_MANDATORY,p.maxLookahead,s.getProductionDslName(p))}),t.forEach(l,function(p){a.computeLookaheadFunc(f,p.idx,i.AT_LEAST_ONE_SEP_IDX,e.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,p.maxLookahead,s.getProductionDslName(p))}),t.forEach(h,function(p){a.computeLookaheadFunc(f,p.idx,i.MANY_SEP_IDX,e.PROD_TYPE.REPETITION_WITH_SEPARATOR,p.maxLookahead,s.getProductionDslName(p))})})})},c.prototype.computeLookaheadFunc=function(A,a,f,u,b,d){var E=this;this.TRACE_INIT(""+d+(a===0?"":a),function(){var g=e.buildLookaheadFuncForOptionalProd(a,A,b||E.maxLookahead,E.dynamicTokensEnabled,u,E.lookAheadBuilderForOptional),l=i.getKeyForAutomaticLookahead(E.fullRuleNameToShort[A.name],f,a);E.setLaFuncCache(l,g)})},c.prototype.lookAheadBuilderForOptional=function(A,a,f){return e.buildSingleAlternativeLookaheadFunction(A,a,f)},c.prototype.lookAheadBuilderForAlternatives=function(A,a,f,u){return e.buildAlternativesLookAheadFunc(A,a,f,u)},c.prototype.getKeyForAutomaticLookahead=function(A,a){var f=this.getLastExplicitRuleShortName();return i.getKeyForAutomaticLookahead(f,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})();n.LooksAhead=o}),Lo=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addNoneTerminalToCst=n.addTerminalToCst=n.setNodeLocationFull=n.setNodeLocationOnlyOffset=void 0;function e(s,o){isNaN(s.startOffset)===!0?(s.startOffset=o.startOffset,s.endOffset=o.endOffset):s.endOffset<o.endOffset&&(s.endOffset=o.endOffset)}n.setNodeLocationOnlyOffset=e;function t(s,o){isNaN(s.startOffset)===!0?(s.startOffset=o.startOffset,s.startColumn=o.startColumn,s.startLine=o.startLine,s.endOffset=o.endOffset,s.endColumn=o.endColumn,s.endLine=o.endLine):s.endOffset<o.endOffset&&(s.endOffset=o.endOffset,s.endColumn=o.endColumn,s.endLine=o.endLine)}n.setNodeLocationFull=t;function r(s,o,c){s.children[c]===void 0?s.children[c]=[o]:s.children[c].push(o)}n.addTerminalToCst=r;function i(s,o,c){s.children[o]===void 0?s.children[o]=[c]:s.children[o].push(c)}n.addNoneTerminalToCst=i}),Pi=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.defineNameProp=n.functionName=n.classNameFromInstance=void 0;var e=ke();function t(o){return i(o.constructor)}n.classNameFromInstance=t;var r="name";function i(o){var c=o.name;return c||"anonymous"}n.functionName=i;function s(o,c){var A=Object.getOwnPropertyDescriptor(o,r);return e.isUndefined(A)||A.configurable?(Object.defineProperty(o,r,{enumerable:!1,configurable:!0,writable:!1,value:c}),!0):!1}n.defineNameProp=s}),_o=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.validateRedundantMethods=n.validateMissingCstMethods=n.validateVisitor=n.CstVisitorDefinitionError=n.createBaseVisitorConstructorWithDefaults=n.createBaseSemanticVisitorConstructor=n.defaultVisit=void 0;var e=ke(),t=Pi();function r(u,b){for(var d=e.keys(u),E=d.length,g=0;g<E;g++)for(var l=d[g],h=u[l],p=h.length,C=0;C<p;C++){var m=h[C];m.tokenTypeIdx===void 0&&this[m.name](m.children,b)}}n.defaultVisit=r;function i(u,b){var d=function(){};t.defineNameProp(d,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,b);if(!e.isEmpty(g)){var l=e.map(g,function(h){return h.msg});throw Error("Errors Detected in CST Visitor <"+t.functionName(this.constructor)+`>:
|
|
163
164
|
`+(""+l.join(`
|
|
164
165
|
|
|
165
166
|
`).replace(/\n/g,`
|
|
166
|
-
`)))}}};return
|
|
167
|
+
`)))}}};return d.prototype=E,d.prototype.constructor=d,d._RULE_NAMES=b,d}n.createBaseSemanticVisitorConstructor=i;function s(u,b,d){var E=function(){};t.defineNameProp(E,u+"BaseSemanticsWithDefaults");var g=Object.create(d.prototype);return e.forEach(b,function(l){g[l]=r}),E.prototype=g,E.prototype.constructor=E,E}n.createBaseVisitorConstructorWithDefaults=s;var o;(function(u){u[u.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",u[u.MISSING_METHOD=1]="MISSING_METHOD"})(o=n.CstVisitorDefinitionError||(n.CstVisitorDefinitionError={}));function c(u,b){var d=A(u,b),E=f(u,b);return d.concat(E)}n.validateVisitor=c;function A(u,b){var d=e.map(b,function(E){if(!e.isFunction(u[E]))return{msg:"Missing visitor method: <"+E+"> on "+t.functionName(u.constructor)+" CST Visitor.",type:o.MISSING_METHOD,methodName:E}});return e.compact(d)}n.validateMissingCstMethods=A;var a=["constructor","visit","validateVisitor"];function f(u,b){var d=[];for(var E in u)e.isFunction(u[E])&&!e.contains(a,E)&&!e.contains(b,E)&&d.push({msg:"Redundant visitor method: <"+E+"> on "+t.functionName(u.constructor)+` CST Visitor
|
|
167
168
|
There is no Grammar Rule corresponding to this method's name.
|
|
168
|
-
`,type:o.REDUNDANT_METHOD,methodName:T});return p}n.validateRedundantMethods=f}),li=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TreeBuilder=void 0;var e=ai(),t=xe(),i=ci(),r=Ye(),a=(function(){function o(){}return o.prototype.initTreeBuilder=function(u){if(this.CST_STACK=[],this.outputCst=u.outputCst,this.nodeLocationTracking=t.has(u,"nodeLocationTracking")?u.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: "'+u.nodeLocationTracking+'"')},o.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(u){u.location={startOffset:NaN,endOffset:NaN}},o.prototype.setInitialNodeLocationOnlyOffsetRegular=function(u){u.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},o.prototype.setInitialNodeLocationFullRecovery=function(u){u.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},o.prototype.setInitialNodeLocationFullRegular=function(u){var c=this.LA(1);u.location={startOffset:c.startOffset,startLine:c.startLine,startColumn:c.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},o.prototype.cstInvocationStateUpdate=function(u,c){var s={name:u,children:{}};this.setInitialNodeLocation(s),this.CST_STACK.push(s)},o.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},o.prototype.cstPostRuleFull=function(u){var c=this.LA(0),s=u.location;s.startOffset<=c.startOffset?(s.endOffset=c.endOffset,s.endLine=c.endLine,s.endColumn=c.endColumn):(s.startOffset=NaN,s.startLine=NaN,s.startColumn=NaN)},o.prototype.cstPostRuleOnlyOffset=function(u){var c=this.LA(0),s=u.location;s.startOffset<=c.startOffset?s.endOffset=c.endOffset:s.startOffset=NaN},o.prototype.cstPostTerminal=function(u,c){var s=this.CST_STACK[this.CST_STACK.length-1];e.addTerminalToCst(s,c,u),this.setNodeLocationFromToken(s.location,c)},o.prototype.cstPostNonTerminal=function(u,c){var s=this.CST_STACK[this.CST_STACK.length-1];e.addNoneTerminalToCst(s,c,u),this.setNodeLocationFromNode(s.location,u.location)},o.prototype.getBaseCstVisitorConstructor=function(){if(t.isUndefined(this.baseCstVisitorConstructor)){var u=i.createBaseSemanticVisitorConstructor(this.className,t.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=u,u}return this.baseCstVisitorConstructor},o.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(t.isUndefined(this.baseCstVisitorWithDefaultsConstructor)){var u=i.createBaseVisitorConstructorWithDefaults(this.className,t.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=u,u}return this.baseCstVisitorWithDefaultsConstructor},o.prototype.getLastExplicitRuleShortName=function(){var u=this.RULE_STACK;return u[u.length-1]},o.prototype.getPreviousExplicitRuleShortName=function(){var u=this.RULE_STACK;return u[u.length-2]},o.prototype.getLastExplicitRuleOccurrenceIndex=function(){var u=this.RULE_OCCURRENCE_STACK;return u[u.length-1]},o})();n.TreeBuilder=a}),ui=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LexerAdapter=void 0;var e=Ye(),t=(function(){function i(){}return i.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(i.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}),i.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):e.END_OF_FILE},i.prototype.LA=function(r){var a=this.currIdx+r;return a<0||this.tokVectorLength<=a?e.END_OF_FILE:this.tokVector[a]},i.prototype.consumeToken=function(){this.currIdx++},i.prototype.exportLexerState=function(){return this.currIdx},i.prototype.importLexerState=function(r){this.currIdx=r},i.prototype.resetLexerState=function(){this.currIdx=-1},i.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},i.prototype.getLexerPosition=function(){return this.exportLexerState()},i})();n.LexerAdapter=t}),hi=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RecognizerApi=void 0;var e=xe(),t=dt(),i=Ye(),r=Et(),a=Sn(),o=He(),u=(function(){function c(){}return c.prototype.ACTION=function(s){return s.call(this)},c.prototype.consume=function(s,f,h){return this.consumeInternal(f,s,h)},c.prototype.subrule=function(s,f,h){return this.subruleInternal(f,s,h)},c.prototype.option=function(s,f){return this.optionInternal(f,s)},c.prototype.or=function(s,f){return this.orInternal(f,s)},c.prototype.many=function(s,f){return this.manyInternal(s,f)},c.prototype.atLeastOne=function(s,f){return this.atLeastOneInternal(s,f)},c.prototype.CONSUME=function(s,f){return this.consumeInternal(s,0,f)},c.prototype.CONSUME1=function(s,f){return this.consumeInternal(s,1,f)},c.prototype.CONSUME2=function(s,f){return this.consumeInternal(s,2,f)},c.prototype.CONSUME3=function(s,f){return this.consumeInternal(s,3,f)},c.prototype.CONSUME4=function(s,f){return this.consumeInternal(s,4,f)},c.prototype.CONSUME5=function(s,f){return this.consumeInternal(s,5,f)},c.prototype.CONSUME6=function(s,f){return this.consumeInternal(s,6,f)},c.prototype.CONSUME7=function(s,f){return this.consumeInternal(s,7,f)},c.prototype.CONSUME8=function(s,f){return this.consumeInternal(s,8,f)},c.prototype.CONSUME9=function(s,f){return this.consumeInternal(s,9,f)},c.prototype.SUBRULE=function(s,f){return this.subruleInternal(s,0,f)},c.prototype.SUBRULE1=function(s,f){return this.subruleInternal(s,1,f)},c.prototype.SUBRULE2=function(s,f){return this.subruleInternal(s,2,f)},c.prototype.SUBRULE3=function(s,f){return this.subruleInternal(s,3,f)},c.prototype.SUBRULE4=function(s,f){return this.subruleInternal(s,4,f)},c.prototype.SUBRULE5=function(s,f){return this.subruleInternal(s,5,f)},c.prototype.SUBRULE6=function(s,f){return this.subruleInternal(s,6,f)},c.prototype.SUBRULE7=function(s,f){return this.subruleInternal(s,7,f)},c.prototype.SUBRULE8=function(s,f){return this.subruleInternal(s,8,f)},c.prototype.SUBRULE9=function(s,f){return this.subruleInternal(s,9,f)},c.prototype.OPTION=function(s){return this.optionInternal(s,0)},c.prototype.OPTION1=function(s){return this.optionInternal(s,1)},c.prototype.OPTION2=function(s){return this.optionInternal(s,2)},c.prototype.OPTION3=function(s){return this.optionInternal(s,3)},c.prototype.OPTION4=function(s){return this.optionInternal(s,4)},c.prototype.OPTION5=function(s){return this.optionInternal(s,5)},c.prototype.OPTION6=function(s){return this.optionInternal(s,6)},c.prototype.OPTION7=function(s){return this.optionInternal(s,7)},c.prototype.OPTION8=function(s){return this.optionInternal(s,8)},c.prototype.OPTION9=function(s){return this.optionInternal(s,9)},c.prototype.OR=function(s){return this.orInternal(s,0)},c.prototype.OR1=function(s){return this.orInternal(s,1)},c.prototype.OR2=function(s){return this.orInternal(s,2)},c.prototype.OR3=function(s){return this.orInternal(s,3)},c.prototype.OR4=function(s){return this.orInternal(s,4)},c.prototype.OR5=function(s){return this.orInternal(s,5)},c.prototype.OR6=function(s){return this.orInternal(s,6)},c.prototype.OR7=function(s){return this.orInternal(s,7)},c.prototype.OR8=function(s){return this.orInternal(s,8)},c.prototype.OR9=function(s){return this.orInternal(s,9)},c.prototype.MANY=function(s){this.manyInternal(0,s)},c.prototype.MANY1=function(s){this.manyInternal(1,s)},c.prototype.MANY2=function(s){this.manyInternal(2,s)},c.prototype.MANY3=function(s){this.manyInternal(3,s)},c.prototype.MANY4=function(s){this.manyInternal(4,s)},c.prototype.MANY5=function(s){this.manyInternal(5,s)},c.prototype.MANY6=function(s){this.manyInternal(6,s)},c.prototype.MANY7=function(s){this.manyInternal(7,s)},c.prototype.MANY8=function(s){this.manyInternal(8,s)},c.prototype.MANY9=function(s){this.manyInternal(9,s)},c.prototype.MANY_SEP=function(s){this.manySepFirstInternal(0,s)},c.prototype.MANY_SEP1=function(s){this.manySepFirstInternal(1,s)},c.prototype.MANY_SEP2=function(s){this.manySepFirstInternal(2,s)},c.prototype.MANY_SEP3=function(s){this.manySepFirstInternal(3,s)},c.prototype.MANY_SEP4=function(s){this.manySepFirstInternal(4,s)},c.prototype.MANY_SEP5=function(s){this.manySepFirstInternal(5,s)},c.prototype.MANY_SEP6=function(s){this.manySepFirstInternal(6,s)},c.prototype.MANY_SEP7=function(s){this.manySepFirstInternal(7,s)},c.prototype.MANY_SEP8=function(s){this.manySepFirstInternal(8,s)},c.prototype.MANY_SEP9=function(s){this.manySepFirstInternal(9,s)},c.prototype.AT_LEAST_ONE=function(s){this.atLeastOneInternal(0,s)},c.prototype.AT_LEAST_ONE1=function(s){return this.atLeastOneInternal(1,s)},c.prototype.AT_LEAST_ONE2=function(s){this.atLeastOneInternal(2,s)},c.prototype.AT_LEAST_ONE3=function(s){this.atLeastOneInternal(3,s)},c.prototype.AT_LEAST_ONE4=function(s){this.atLeastOneInternal(4,s)},c.prototype.AT_LEAST_ONE5=function(s){this.atLeastOneInternal(5,s)},c.prototype.AT_LEAST_ONE6=function(s){this.atLeastOneInternal(6,s)},c.prototype.AT_LEAST_ONE7=function(s){this.atLeastOneInternal(7,s)},c.prototype.AT_LEAST_ONE8=function(s){this.atLeastOneInternal(8,s)},c.prototype.AT_LEAST_ONE9=function(s){this.atLeastOneInternal(9,s)},c.prototype.AT_LEAST_ONE_SEP=function(s){this.atLeastOneSepFirstInternal(0,s)},c.prototype.AT_LEAST_ONE_SEP1=function(s){this.atLeastOneSepFirstInternal(1,s)},c.prototype.AT_LEAST_ONE_SEP2=function(s){this.atLeastOneSepFirstInternal(2,s)},c.prototype.AT_LEAST_ONE_SEP3=function(s){this.atLeastOneSepFirstInternal(3,s)},c.prototype.AT_LEAST_ONE_SEP4=function(s){this.atLeastOneSepFirstInternal(4,s)},c.prototype.AT_LEAST_ONE_SEP5=function(s){this.atLeastOneSepFirstInternal(5,s)},c.prototype.AT_LEAST_ONE_SEP6=function(s){this.atLeastOneSepFirstInternal(6,s)},c.prototype.AT_LEAST_ONE_SEP7=function(s){this.atLeastOneSepFirstInternal(7,s)},c.prototype.AT_LEAST_ONE_SEP8=function(s){this.atLeastOneSepFirstInternal(8,s)},c.prototype.AT_LEAST_ONE_SEP9=function(s){this.atLeastOneSepFirstInternal(9,s)},c.prototype.RULE=function(s,f,h){if(h===void 0&&(h=i.DEFAULT_RULE_CONFIG),e.contains(this.definedRulesNames,s)){var g=r.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:s,grammarName:this.className}),p={message:g,type:i.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:s};this.definitionErrors.push(p)}this.definedRulesNames.push(s);var T=this.defineRule(s,f,h);return this[s]=T,T},c.prototype.OVERRIDE_RULE=function(s,f,h){h===void 0&&(h=i.DEFAULT_RULE_CONFIG);var g=[];g=g.concat(a.validateRuleIsOverridden(s,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(g);var p=this.defineRule(s,f,h);return this[s]=p,p},c.prototype.BACKTRACK=function(s,f){return function(){this.isBackTrackingStack.push(1);var h=this.saveRecogState();try{return s.apply(this,f),!0}catch(g){if(t.isRecognitionException(g))return!1;throw g}finally{this.reloadRecogState(h),this.isBackTrackingStack.pop()}}},c.prototype.getGAstProductions=function(){return this.gastProductionsCache},c.prototype.getSerializedGastProductions=function(){return o.serializeGrammar(e.values(this.gastProductionsCache))},c})();n.RecognizerApi=u}),fi=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RecognizerEngine=void 0;var e=xe(),t=Bt(),i=dt(),r=Rt(),a=vt(),o=Ye(),u=On(),c=nt(),s=ht(),f=xn(),h=(function(){function g(){}return g.prototype.initRecognizerEngine=function(p,T){if(this.className=f.classNameFromInstance(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=s.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},e.has(T,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
169
|
+
`,type:o.REDUNDANT_METHOD,methodName:E});return d}n.validateRedundantMethods=f}),xo=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TreeBuilder=void 0;var e=Lo(),t=ke(),r=_o(),i=Je(),s=(function(){function o(){}return o.prototype.initTreeBuilder=function(c){if(this.CST_STACK=[],this.outputCst=c.outputCst,this.nodeLocationTracking=t.has(c,"nodeLocationTracking")?c.nodeLocationTracking:i.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+'"')},o.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(c){c.location={startOffset:NaN,endOffset:NaN}},o.prototype.setInitialNodeLocationOnlyOffsetRegular=function(c){c.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},o.prototype.setInitialNodeLocationFullRecovery=function(c){c.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},o.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}},o.prototype.cstInvocationStateUpdate=function(c,A){var a={name:c,children:{}};this.setInitialNodeLocation(a),this.CST_STACK.push(a)},o.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},o.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)},o.prototype.cstPostRuleOnlyOffset=function(c){var A=this.LA(0),a=c.location;a.startOffset<=A.startOffset?a.endOffset=A.endOffset:a.startOffset=NaN},o.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)},o.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)},o.prototype.getBaseCstVisitorConstructor=function(){if(t.isUndefined(this.baseCstVisitorConstructor)){var c=r.createBaseSemanticVisitorConstructor(this.className,t.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=c,c}return this.baseCstVisitorConstructor},o.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(t.isUndefined(this.baseCstVisitorWithDefaultsConstructor)){var c=r.createBaseVisitorConstructorWithDefaults(this.className,t.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=c,c}return this.baseCstVisitorWithDefaultsConstructor},o.prototype.getLastExplicitRuleShortName=function(){var c=this.RULE_STACK;return c[c.length-1]},o.prototype.getPreviousExplicitRuleShortName=function(){var c=this.RULE_STACK;return c[c.length-2]},o.prototype.getLastExplicitRuleOccurrenceIndex=function(){var c=this.RULE_OCCURRENCE_STACK;return c[c.length-1]},o})();n.TreeBuilder=s}),No=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LexerAdapter=void 0;var e=Je(),t=(function(){function r(){}return r.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(r.prototype,"input",{get:function(){return this.tokVector},set:function(i){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=i,this.tokVectorLength=i.length},enumerable:!1,configurable:!0}),r.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):e.END_OF_FILE},r.prototype.LA=function(i){var s=this.currIdx+i;return s<0||this.tokVectorLength<=s?e.END_OF_FILE:this.tokVector[s]},r.prototype.consumeToken=function(){this.currIdx++},r.prototype.exportLexerState=function(){return this.currIdx},r.prototype.importLexerState=function(i){this.currIdx=i},r.prototype.resetLexerState=function(){this.currIdx=-1},r.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},r.prototype.getLexerPosition=function(){return this.exportLexerState()},r})();n.LexerAdapter=t}),Do=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RecognizerApi=void 0;var e=ke(),t=mt(),r=Je(),i=wt(),s=Fi(),o=ze(),c=(function(){function A(){}return A.prototype.ACTION=function(a){return a.call(this)},A.prototype.consume=function(a,f,u){return this.consumeInternal(f,a,u)},A.prototype.subrule=function(a,f,u){return this.subruleInternal(f,a,u)},A.prototype.option=function(a,f){return this.optionInternal(f,a)},A.prototype.or=function(a,f){return this.orInternal(f,a)},A.prototype.many=function(a,f){return this.manyInternal(a,f)},A.prototype.atLeastOne=function(a,f){return this.atLeastOneInternal(a,f)},A.prototype.CONSUME=function(a,f){return this.consumeInternal(a,0,f)},A.prototype.CONSUME1=function(a,f){return this.consumeInternal(a,1,f)},A.prototype.CONSUME2=function(a,f){return this.consumeInternal(a,2,f)},A.prototype.CONSUME3=function(a,f){return this.consumeInternal(a,3,f)},A.prototype.CONSUME4=function(a,f){return this.consumeInternal(a,4,f)},A.prototype.CONSUME5=function(a,f){return this.consumeInternal(a,5,f)},A.prototype.CONSUME6=function(a,f){return this.consumeInternal(a,6,f)},A.prototype.CONSUME7=function(a,f){return this.consumeInternal(a,7,f)},A.prototype.CONSUME8=function(a,f){return this.consumeInternal(a,8,f)},A.prototype.CONSUME9=function(a,f){return this.consumeInternal(a,9,f)},A.prototype.SUBRULE=function(a,f){return this.subruleInternal(a,0,f)},A.prototype.SUBRULE1=function(a,f){return this.subruleInternal(a,1,f)},A.prototype.SUBRULE2=function(a,f){return this.subruleInternal(a,2,f)},A.prototype.SUBRULE3=function(a,f){return this.subruleInternal(a,3,f)},A.prototype.SUBRULE4=function(a,f){return this.subruleInternal(a,4,f)},A.prototype.SUBRULE5=function(a,f){return this.subruleInternal(a,5,f)},A.prototype.SUBRULE6=function(a,f){return this.subruleInternal(a,6,f)},A.prototype.SUBRULE7=function(a,f){return this.subruleInternal(a,7,f)},A.prototype.SUBRULE8=function(a,f){return this.subruleInternal(a,8,f)},A.prototype.SUBRULE9=function(a,f){return this.subruleInternal(a,9,f)},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,f,u){if(u===void 0&&(u=r.DEFAULT_RULE_CONFIG),e.contains(this.definedRulesNames,a)){var b=i.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:a,grammarName:this.className}),d={message:b,type:r.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:a};this.definitionErrors.push(d)}this.definedRulesNames.push(a);var E=this.defineRule(a,f,u);return this[a]=E,E},A.prototype.OVERRIDE_RULE=function(a,f,u){u===void 0&&(u=r.DEFAULT_RULE_CONFIG);var b=[];b=b.concat(s.validateRuleIsOverridden(a,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(b);var d=this.defineRule(a,f,u);return this[a]=d,d},A.prototype.BACKTRACK=function(a,f){return function(){this.isBackTrackingStack.push(1);var u=this.saveRecogState();try{return a.apply(this,f),!0}catch(b){if(t.isRecognitionException(b))return!1;throw b}finally{this.reloadRecogState(u),this.isBackTrackingStack.pop()}}},A.prototype.getGAstProductions=function(){return this.gastProductionsCache},A.prototype.getSerializedGastProductions=function(){return o.serializeGrammar(e.values(this.gastProductionsCache))},A})();n.RecognizerApi=c}),Oo=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RecognizerEngine=void 0;var e=ke(),t=cn(),r=mt(),i=kt(),s=vt(),o=Je(),c=Mi(),A=st(),a=Et(),f=Pi(),u=(function(){function b(){}return b.prototype.initRecognizerEngine=function(d,E){if(this.className=f.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.
|
|
169
170
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
170
|
-
For Further details.`);if(e.isArray(
|
|
171
|
+
For Further details.`);if(e.isArray(d)){if(e.isEmpty(d))throw Error(`A Token Vocabulary cannot be empty.
|
|
171
172
|
Note that the first argument for the parser constructor
|
|
172
|
-
is no longer a Token vector (since v4.0).`);if(typeof
|
|
173
|
+
is no longer a Token vector (since v4.0).`);if(typeof d[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
173
174
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
174
|
-
For Further details.`)}if(e.isArray(
|
|
175
|
-
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var l=e.has(m,"resyncEnabled")?m.resyncEnabled:o.DEFAULT_RULE_CONFIG.resyncEnabled,d=e.has(m,"recoveryValueFunc")?m.recoveryValueFunc:o.DEFAULT_RULE_CONFIG.recoveryValueFunc,y=this.ruleShortNameIdx<<t.BITS_FOR_METHOD_TYPE+t.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[y]=p,this.fullRuleNameToShort[p]=y;function v(I){try{if(this.outputCst===!0){T.apply(this,I);var k=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(k),k}else return T.apply(this,I)}catch(H){return this.invokeRuleCatch(H,l,d)}finally{this.ruleFinallyStateUpdate()}}var E=function(I,k){return I===void 0&&(I=0),this.ruleInvocationStateUpdate(y,p,I),v.call(this,k)},S="ruleName";return E[S]=p,E.originalGrammarAction=T,E},g.prototype.invokeRuleCatch=function(p,T,m){var l=this.RULE_STACK.length===1,d=T&&!this.isBackTracking()&&this.recoveryEnabled;if(i.isRecognitionException(p)){var y=p;if(d){var v=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(v))if(y.resyncedTokens=this.reSyncTo(v),this.outputCst){var E=this.CST_STACK[this.CST_STACK.length-1];return E.recoveredNode=!0,E}else return m();else{if(this.outputCst){var E=this.CST_STACK[this.CST_STACK.length-1];E.recoveredNode=!0,y.partialCstResult=E}throw y}}else{if(l)return this.moveToTerminatedState(),m();throw y}}else throw p},g.prototype.optionInternal=function(p,T){var m=this.getKeyForAutomaticLookahead(t.OPTION_IDX,T);return this.optionInternalLogic(p,T,m)},g.prototype.optionInternalLogic=function(p,T,m){var l=this,d=this.getLaFuncFromCache(m),y,v;if(p.DEF!==void 0){if(y=p.DEF,v=p.GATE,v!==void 0){var E=d;d=function(){return v.call(l)&&E.call(l)}}}else y=p;if(d.call(this)===!0)return y.call(this)},g.prototype.atLeastOneInternal=function(p,T){var m=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_IDX,p);return this.atLeastOneInternalLogic(p,T,m)},g.prototype.atLeastOneInternalLogic=function(p,T,m){var l=this,d=this.getLaFuncFromCache(m),y,v;if(T.DEF!==void 0){if(y=T.DEF,v=T.GATE,v!==void 0){var E=d;d=function(){return v.call(l)&&E.call(l)}}}else y=T;if(d.call(this)===!0)for(var S=this.doSingleRepetition(y);d.call(this)===!0&&S===!0;)S=this.doSingleRepetition(y);else throw this.raiseEarlyExitException(p,r.PROD_TYPE.REPETITION_MANDATORY,T.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[p,T],d,t.AT_LEAST_ONE_IDX,p,a.NextTerminalAfterAtLeastOneWalker)},g.prototype.atLeastOneSepFirstInternal=function(p,T){var m=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_SEP_IDX,p);this.atLeastOneSepFirstInternalLogic(p,T,m)},g.prototype.atLeastOneSepFirstInternalLogic=function(p,T,m){var l=this,d=T.DEF,y=T.SEP,v=this.getLaFuncFromCache(m);if(v.call(this)===!0){d.call(this);for(var E=function(){return l.tokenMatcher(l.LA(1),y)};this.tokenMatcher(this.LA(1),y)===!0;)this.CONSUME(y),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[p,y,E,d,a.NextTerminalAfterAtLeastOneSepWalker],E,t.AT_LEAST_ONE_SEP_IDX,p,a.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(p,r.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,T.ERR_MSG)},g.prototype.manyInternal=function(p,T){var m=this.getKeyForAutomaticLookahead(t.MANY_IDX,p);return this.manyInternalLogic(p,T,m)},g.prototype.manyInternalLogic=function(p,T,m){var l=this,d=this.getLaFuncFromCache(m),y,v;if(T.DEF!==void 0){if(y=T.DEF,v=T.GATE,v!==void 0){var E=d;d=function(){return v.call(l)&&E.call(l)}}}else y=T;for(var S=!0;d.call(this)===!0&&S===!0;)S=this.doSingleRepetition(y);this.attemptInRepetitionRecovery(this.manyInternal,[p,T],d,t.MANY_IDX,p,a.NextTerminalAfterManyWalker,S)},g.prototype.manySepFirstInternal=function(p,T){var m=this.getKeyForAutomaticLookahead(t.MANY_SEP_IDX,p);this.manySepFirstInternalLogic(p,T,m)},g.prototype.manySepFirstInternalLogic=function(p,T,m){var l=this,d=T.DEF,y=T.SEP,v=this.getLaFuncFromCache(m);if(v.call(this)===!0){d.call(this);for(var E=function(){return l.tokenMatcher(l.LA(1),y)};this.tokenMatcher(this.LA(1),y)===!0;)this.CONSUME(y),d.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[p,y,E,d,a.NextTerminalAfterManySepWalker],E,t.MANY_SEP_IDX,p,a.NextTerminalAfterManySepWalker)}},g.prototype.repetitionSepSecondInternal=function(p,T,m,l,d){for(;m();)this.CONSUME(T),l.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[p,T,m,l,d],m,t.AT_LEAST_ONE_SEP_IDX,p,d)},g.prototype.doSingleRepetition=function(p){var T=this.getLexerPosition();p.call(this);var m=this.getLexerPosition();return m>T},g.prototype.orInternal=function(p,T){var m=this.getKeyForAutomaticLookahead(t.OR_IDX,T),l=e.isArray(p)?p:p.DEF,d=this.getLaFuncFromCache(m),y=d.call(this,l);if(y!==void 0){var v=l[y];return v.ALT.call(this)}this.raiseNoAltException(T,p.ERR_MSG)},g.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),T=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:p,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new i.NotAllInputParsedException(T,p))}},g.prototype.subruleInternal=function(p,T,m){var l;try{var d=m!==void 0?m.ARGS:void 0;return l=p.call(this,T,d),this.cstPostNonTerminal(l,m!==void 0&&m.LABEL!==void 0?m.LABEL:p.ruleName),l}catch(y){this.subruleInternalError(y,m,p.ruleName)}},g.prototype.subruleInternalError=function(p,T,m){throw i.isRecognitionException(p)&&p.partialCstResult!==void 0&&(this.cstPostNonTerminal(p.partialCstResult,T!==void 0&&T.LABEL!==void 0?T.LABEL:m),delete p.partialCstResult),p},g.prototype.consumeInternal=function(p,T,m){var l;try{var d=this.LA(1);this.tokenMatcher(d,p)===!0?(this.consumeToken(),l=d):this.consumeInternalError(p,d,m)}catch(y){l=this.consumeInternalRecovery(p,T,y)}return this.cstPostTerminal(m!==void 0&&m.LABEL!==void 0?m.LABEL:p.name,l),l},g.prototype.consumeInternalError=function(p,T,m){var l,d=this.LA(0);throw m!==void 0&&m.ERR_MSG?l=m.ERR_MSG:l=this.errorMessageProvider.buildMismatchTokenMessage({expected:p,actual:T,previous:d,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new i.MismatchedTokenException(l,T,d))},g.prototype.consumeInternalRecovery=function(p,T,m){if(this.recoveryEnabled&&m.name==="MismatchedTokenException"&&!this.isBackTracking()){var l=this.getFollowsForInRuleRecovery(p,T);try{return this.tryInRuleRecovery(p,l)}catch(d){throw d.name===u.IN_RULE_RECOVERY_EXCEPTION?m:d}}else throw m},g.prototype.saveRecogState=function(){var p=this.errors,T=e.cloneArr(this.RULE_STACK);return{errors:p,lexerState:this.exportLexerState(),RULE_STACK:T,CST_STACK:this.CST_STACK}},g.prototype.reloadRecogState=function(p){this.errors=p.errors,this.importLexerState(p.lexerState),this.RULE_STACK=p.RULE_STACK},g.prototype.ruleInvocationStateUpdate=function(p,T,m){this.RULE_OCCURRENCE_STACK.push(m),this.RULE_STACK.push(p),this.cstInvocationStateUpdate(T,p)},g.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},g.prototype.getCurrRuleFullName=function(){var p=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[p]},g.prototype.shortRuleNameToFullName=function(p){return this.shortRuleNameToFull[p]},g.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),c.EOF)},g.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},g})();n.RecognizerEngine=h}),di=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ErrorHandler=void 0;var e=dt(),t=xe(),i=Rt(),r=Ye(),a=(function(){function o(){}return o.prototype.initErrorHandler=function(u){this._errors=[],this.errorMessageProvider=t.has(u,"errorMessageProvider")?u.errorMessageProvider:r.DEFAULT_PARSER_CONFIG.errorMessageProvider},o.prototype.SAVE_ERROR=function(u){if(e.isRecognitionException(u))return u.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:t.cloneArr(this.RULE_OCCURRENCE_STACK)},this._errors.push(u),u;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(o.prototype,"errors",{get:function(){return t.cloneArr(this._errors)},set:function(u){this._errors=u},enumerable:!1,configurable:!0}),o.prototype.raiseEarlyExitException=function(u,c,s){for(var f=this.getCurrRuleFullName(),h=this.getGAstProductions()[f],g=i.getLookaheadPathsForOptionalProd(u,h,c,this.maxLookahead),p=g[0],T=[],m=1;m<=this.maxLookahead;m++)T.push(this.LA(m));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:p,actual:T,previous:this.LA(0),customUserDescription:s,ruleName:f});throw this.SAVE_ERROR(new e.EarlyExitException(l,this.LA(1),this.LA(0)))},o.prototype.raiseNoAltException=function(u,c){for(var s=this.getCurrRuleFullName(),f=this.getGAstProductions()[s],h=i.getLookaheadPathsForOr(u,f,this.maxLookahead),g=[],p=1;p<=this.maxLookahead;p++)g.push(this.LA(p));var T=this.LA(0),m=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:h,actual:g,previous:T,customUserDescription:c,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new e.NoViableAltException(m,this.LA(1),T))},o})();n.ErrorHandler=a}),pi=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ContentAssist=void 0;var e=vt(),t=xe(),i=(function(){function r(){}return r.prototype.initContentAssist=function(){},r.prototype.computeContentAssist=function(a,o){var u=this.gastProductionsCache[a];if(t.isUndefined(u))throw Error("Rule ->"+a+"<- does not exist in this grammar.");return e.nextPossibleTokensAfter([u],o,this.tokenMatcher,this.maxLookahead)},r.prototype.getNextPossibleTokenTypes=function(a){var o=t.first(a.ruleStack),u=this.getGAstProductions(),c=u[o],s=new e.NextAfterTokenWalker(c,a).startWalking();return s},r})();n.ContentAssist=i}),mi=ve(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GastRecorder=void 0;var e=xe(),t=He(),i=gt(),r=ht(),a=nt(),o=Ye(),u=Bt(),c={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(c);var s=!0,f=Math.pow(2,u.BITS_FOR_OCCURRENCE_IDX)-1,h=a.createToken({name:"RECORDING_PHASE_TOKEN",pattern:i.Lexer.NA});r.augmentTokenTypes([h]);var g=a.createTokenInstance(h,`This IToken indicates the Parser is in Recording Phase
|
|
176
|
-
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(
|
|
177
|
-
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},
|
|
175
|
+
For Further details.`)}if(e.isArray(d))this.tokensMap=e.reduce(d,function(p,C){return p[C.name]=C,p},{});else if(e.has(d,"modes")&&e.every(e.flatten(e.values(d.modes)),a.isTokenType)){var g=e.flatten(e.values(d.modes)),l=e.uniq(g);this.tokensMap=e.reduce(l,function(p,C){return p[C.name]=C,p},{})}else if(e.isObject(d))this.tokensMap=e.cloneObj(d);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 h=e.every(e.values(d),function(p){return e.isEmpty(p.categoryMatches)});this.tokenMatcher=h?a.tokenStructuredMatcherNoCategories:a.tokenStructuredMatcher,a.augmentTokenTypes(e.values(this.tokensMap))},b.prototype.defineRule=function(d,E,g){if(this.selfAnalysisDone)throw Error("Grammar rule <"+d+`> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
176
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var l=e.has(g,"resyncEnabled")?g.resyncEnabled:o.DEFAULT_RULE_CONFIG.resyncEnabled,h=e.has(g,"recoveryValueFunc")?g.recoveryValueFunc:o.DEFAULT_RULE_CONFIG.recoveryValueFunc,p=this.ruleShortNameIdx<<t.BITS_FOR_METHOD_TYPE+t.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[p]=d,this.fullRuleNameToShort[d]=p;function C(v){try{if(this.outputCst===!0){E.apply(this,v);var S=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(S),S}else return E.apply(this,v)}catch(U){return this.invokeRuleCatch(U,l,h)}finally{this.ruleFinallyStateUpdate()}}var m=function(v,S){return v===void 0&&(v=0),this.ruleInvocationStateUpdate(p,d,v),C.call(this,S)},y="ruleName";return m[y]=d,m.originalGrammarAction=E,m},b.prototype.invokeRuleCatch=function(d,E,g){var l=this.RULE_STACK.length===1,h=E&&!this.isBackTracking()&&this.recoveryEnabled;if(r.isRecognitionException(d)){var p=d;if(h){var C=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(C))if(p.resyncedTokens=this.reSyncTo(C),this.outputCst){var m=this.CST_STACK[this.CST_STACK.length-1];return m.recoveredNode=!0,m}else return g();else{if(this.outputCst){var m=this.CST_STACK[this.CST_STACK.length-1];m.recoveredNode=!0,p.partialCstResult=m}throw p}}else{if(l)return this.moveToTerminatedState(),g();throw p}}else throw d},b.prototype.optionInternal=function(d,E){var g=this.getKeyForAutomaticLookahead(t.OPTION_IDX,E);return this.optionInternalLogic(d,E,g)},b.prototype.optionInternalLogic=function(d,E,g){var l=this,h=this.getLaFuncFromCache(g),p,C;if(d.DEF!==void 0){if(p=d.DEF,C=d.GATE,C!==void 0){var m=h;h=function(){return C.call(l)&&m.call(l)}}}else p=d;if(h.call(this)===!0)return p.call(this)},b.prototype.atLeastOneInternal=function(d,E){var g=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_IDX,d);return this.atLeastOneInternalLogic(d,E,g)},b.prototype.atLeastOneInternalLogic=function(d,E,g){var l=this,h=this.getLaFuncFromCache(g),p,C;if(E.DEF!==void 0){if(p=E.DEF,C=E.GATE,C!==void 0){var m=h;h=function(){return C.call(l)&&m.call(l)}}}else p=E;if(h.call(this)===!0)for(var y=this.doSingleRepetition(p);h.call(this)===!0&&y===!0;)y=this.doSingleRepetition(p);else throw this.raiseEarlyExitException(d,i.PROD_TYPE.REPETITION_MANDATORY,E.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[d,E],h,t.AT_LEAST_ONE_IDX,d,s.NextTerminalAfterAtLeastOneWalker)},b.prototype.atLeastOneSepFirstInternal=function(d,E){var g=this.getKeyForAutomaticLookahead(t.AT_LEAST_ONE_SEP_IDX,d);this.atLeastOneSepFirstInternalLogic(d,E,g)},b.prototype.atLeastOneSepFirstInternalLogic=function(d,E,g){var l=this,h=E.DEF,p=E.SEP,C=this.getLaFuncFromCache(g);if(C.call(this)===!0){h.call(this);for(var m=function(){return l.tokenMatcher(l.LA(1),p)};this.tokenMatcher(this.LA(1),p)===!0;)this.CONSUME(p),h.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[d,p,m,h,s.NextTerminalAfterAtLeastOneSepWalker],m,t.AT_LEAST_ONE_SEP_IDX,d,s.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(d,i.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,E.ERR_MSG)},b.prototype.manyInternal=function(d,E){var g=this.getKeyForAutomaticLookahead(t.MANY_IDX,d);return this.manyInternalLogic(d,E,g)},b.prototype.manyInternalLogic=function(d,E,g){var l=this,h=this.getLaFuncFromCache(g),p,C;if(E.DEF!==void 0){if(p=E.DEF,C=E.GATE,C!==void 0){var m=h;h=function(){return C.call(l)&&m.call(l)}}}else p=E;for(var y=!0;h.call(this)===!0&&y===!0;)y=this.doSingleRepetition(p);this.attemptInRepetitionRecovery(this.manyInternal,[d,E],h,t.MANY_IDX,d,s.NextTerminalAfterManyWalker,y)},b.prototype.manySepFirstInternal=function(d,E){var g=this.getKeyForAutomaticLookahead(t.MANY_SEP_IDX,d);this.manySepFirstInternalLogic(d,E,g)},b.prototype.manySepFirstInternalLogic=function(d,E,g){var l=this,h=E.DEF,p=E.SEP,C=this.getLaFuncFromCache(g);if(C.call(this)===!0){h.call(this);for(var m=function(){return l.tokenMatcher(l.LA(1),p)};this.tokenMatcher(this.LA(1),p)===!0;)this.CONSUME(p),h.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[d,p,m,h,s.NextTerminalAfterManySepWalker],m,t.MANY_SEP_IDX,d,s.NextTerminalAfterManySepWalker)}},b.prototype.repetitionSepSecondInternal=function(d,E,g,l,h){for(;g();)this.CONSUME(E),l.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[d,E,g,l,h],g,t.AT_LEAST_ONE_SEP_IDX,d,h)},b.prototype.doSingleRepetition=function(d){var E=this.getLexerPosition();d.call(this);var g=this.getLexerPosition();return g>E},b.prototype.orInternal=function(d,E){var g=this.getKeyForAutomaticLookahead(t.OR_IDX,E),l=e.isArray(d)?d:d.DEF,h=this.getLaFuncFromCache(g),p=h.call(this,l);if(p!==void 0){var C=l[p];return C.ALT.call(this)}this.raiseNoAltException(E,d.ERR_MSG)},b.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var d=this.LA(1),E=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:d,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new r.NotAllInputParsedException(E,d))}},b.prototype.subruleInternal=function(d,E,g){var l;try{var h=g!==void 0?g.ARGS:void 0;return l=d.call(this,E,h),this.cstPostNonTerminal(l,g!==void 0&&g.LABEL!==void 0?g.LABEL:d.ruleName),l}catch(p){this.subruleInternalError(p,g,d.ruleName)}},b.prototype.subruleInternalError=function(d,E,g){throw r.isRecognitionException(d)&&d.partialCstResult!==void 0&&(this.cstPostNonTerminal(d.partialCstResult,E!==void 0&&E.LABEL!==void 0?E.LABEL:g),delete d.partialCstResult),d},b.prototype.consumeInternal=function(d,E,g){var l;try{var h=this.LA(1);this.tokenMatcher(h,d)===!0?(this.consumeToken(),l=h):this.consumeInternalError(d,h,g)}catch(p){l=this.consumeInternalRecovery(d,E,p)}return this.cstPostTerminal(g!==void 0&&g.LABEL!==void 0?g.LABEL:d.name,l),l},b.prototype.consumeInternalError=function(d,E,g){var l,h=this.LA(0);throw g!==void 0&&g.ERR_MSG?l=g.ERR_MSG:l=this.errorMessageProvider.buildMismatchTokenMessage({expected:d,actual:E,previous:h,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new r.MismatchedTokenException(l,E,h))},b.prototype.consumeInternalRecovery=function(d,E,g){if(this.recoveryEnabled&&g.name==="MismatchedTokenException"&&!this.isBackTracking()){var l=this.getFollowsForInRuleRecovery(d,E);try{return this.tryInRuleRecovery(d,l)}catch(h){throw h.name===c.IN_RULE_RECOVERY_EXCEPTION?g:h}}else throw g},b.prototype.saveRecogState=function(){var d=this.errors,E=e.cloneArr(this.RULE_STACK);return{errors:d,lexerState:this.exportLexerState(),RULE_STACK:E,CST_STACK:this.CST_STACK}},b.prototype.reloadRecogState=function(d){this.errors=d.errors,this.importLexerState(d.lexerState),this.RULE_STACK=d.RULE_STACK},b.prototype.ruleInvocationStateUpdate=function(d,E,g){this.RULE_OCCURRENCE_STACK.push(g),this.RULE_STACK.push(d),this.cstInvocationStateUpdate(E,d)},b.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},b.prototype.getCurrRuleFullName=function(){var d=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[d]},b.prototype.shortRuleNameToFullName=function(d){return this.shortRuleNameToFull[d]},b.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),A.EOF)},b.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},b})();n.RecognizerEngine=u}),Fo=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ErrorHandler=void 0;var e=mt(),t=ke(),r=kt(),i=Je(),s=(function(){function o(){}return o.prototype.initErrorHandler=function(c){this._errors=[],this.errorMessageProvider=t.has(c,"errorMessageProvider")?c.errorMessageProvider:i.DEFAULT_PARSER_CONFIG.errorMessageProvider},o.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(o.prototype,"errors",{get:function(){return t.cloneArr(this._errors)},set:function(c){this._errors=c},enumerable:!1,configurable:!0}),o.prototype.raiseEarlyExitException=function(c,A,a){for(var f=this.getCurrRuleFullName(),u=this.getGAstProductions()[f],b=r.getLookaheadPathsForOptionalProd(c,u,A,this.maxLookahead),d=b[0],E=[],g=1;g<=this.maxLookahead;g++)E.push(this.LA(g));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:d,actual:E,previous:this.LA(0),customUserDescription:a,ruleName:f});throw this.SAVE_ERROR(new e.EarlyExitException(l,this.LA(1),this.LA(0)))},o.prototype.raiseNoAltException=function(c,A){for(var a=this.getCurrRuleFullName(),f=this.getGAstProductions()[a],u=r.getLookaheadPathsForOr(c,f,this.maxLookahead),b=[],d=1;d<=this.maxLookahead;d++)b.push(this.LA(d));var E=this.LA(0),g=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:u,actual:b,previous:E,customUserDescription:A,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new e.NoViableAltException(g,this.LA(1),E))},o})();n.ErrorHandler=s}),Mo=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ContentAssist=void 0;var e=vt(),t=ke(),r=(function(){function i(){}return i.prototype.initContentAssist=function(){},i.prototype.computeContentAssist=function(s,o){var c=this.gastProductionsCache[s];if(t.isUndefined(c))throw Error("Rule ->"+s+"<- does not exist in this grammar.");return e.nextPossibleTokensAfter([c],o,this.tokenMatcher,this.maxLookahead)},i.prototype.getNextPossibleTokenTypes=function(s){var o=t.first(s.ruleStack),c=this.getGAstProductions(),A=c[o],a=new e.NextAfterTokenWalker(A,s).startWalking();return a},i})();n.ContentAssist=r}),Po=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GastRecorder=void 0;var e=ke(),t=ze(),r=Rt(),i=Et(),s=st(),o=Je(),c=cn(),A={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(A);var a=!0,f=Math.pow(2,c.BITS_FOR_OCCURRENCE_IDX)-1,u=s.createToken({name:"RECORDING_PHASE_TOKEN",pattern:r.Lexer.NA});i.augmentTokenTypes([u]);var b=s.createTokenInstance(u,`This IToken indicates the Parser is in Recording Phase
|
|
177
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(b);var d={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
178
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},E=(function(){function C(){}return C.prototype.initGastRecorder=function(m){this.recordingProdStack=[],this.RECORDING_PHASE=!1},C.prototype.enableRecording=function(){var m=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var y=function(S){var U=S>0?S:"";m["CONSUME"+U]=function(w,M){return this.consumeInternalRecord(w,S,M)},m["SUBRULE"+U]=function(w,M){return this.subruleInternalRecord(w,S,M)},m["OPTION"+U]=function(w){return this.optionInternalRecord(w,S)},m["OR"+U]=function(w){return this.orInternalRecord(w,S)},m["MANY"+U]=function(w){this.manyInternalRecord(S,w)},m["MANY_SEP"+U]=function(w){this.manySepFirstInternalRecord(S,w)},m["AT_LEAST_ONE"+U]=function(w){this.atLeastOneInternalRecord(S,w)},m["AT_LEAST_ONE_SEP"+U]=function(w){this.atLeastOneSepFirstInternalRecord(S,w)}},v=0;v<10;v++)y(v);m.consume=function(S,U,w){return this.consumeInternalRecord(U,S,w)},m.subrule=function(S,U,w){return this.subruleInternalRecord(U,S,w)},m.option=function(S,U){return this.optionInternalRecord(U,S)},m.or=function(S,U){return this.orInternalRecord(U,S)},m.many=function(S,U){this.manyInternalRecord(S,U)},m.atLeastOne=function(S,U){this.atLeastOneInternalRecord(S,U)},m.ACTION=m.ACTION_RECORD,m.BACKTRACK=m.BACKTRACK_RECORD,m.LA=m.LA_RECORD})},C.prototype.disableRecording=function(){var m=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 m["CONSUME"+v],delete m["SUBRULE"+v],delete m["OPTION"+v],delete m["OR"+v],delete m["MANY"+v],delete m["MANY_SEP"+v],delete m["AT_LEAST_ONE"+v],delete m["AT_LEAST_ONE_SEP"+v]}delete m.consume,delete m.subrule,delete m.option,delete m.or,delete m.many,delete m.atLeastOne,delete m.ACTION,delete m.BACKTRACK,delete m.LA})},C.prototype.ACTION_RECORD=function(m){},C.prototype.BACKTRACK_RECORD=function(m,y){return function(){return!0}},C.prototype.LA_RECORD=function(m){return o.END_OF_FILE},C.prototype.topLevelRuleRecord=function(m,y){try{var v=new t.Rule({definition:[],name:m});return v.name=m,this.recordingProdStack.push(v),y.call(this),this.recordingProdStack.pop(),v}catch(S){if(S.KNOWN_RECORDER_ERROR!==!0)try{S.message=S.message+`
|
|
178
179
|
This error was thrown during the "grammar recording phase" For more info see:
|
|
179
|
-
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw
|
|
180
|
-
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw
|
|
181
|
-
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw
|
|
182
|
-
`+("Idx value must be a none negative value smaller than "+(f+1)));throw
|
|
180
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw S}throw S}},C.prototype.optionInternalRecord=function(m,y){return g.call(this,t.Option,m,y)},C.prototype.atLeastOneInternalRecord=function(m,y){g.call(this,t.RepetitionMandatory,y,m)},C.prototype.atLeastOneSepFirstInternalRecord=function(m,y){g.call(this,t.RepetitionMandatoryWithSeparator,y,m,a)},C.prototype.manyInternalRecord=function(m,y){g.call(this,t.Repetition,y,m)},C.prototype.manySepFirstInternalRecord=function(m,y){g.call(this,t.RepetitionWithSeparator,y,m,a)},C.prototype.orInternalRecord=function(m,y){return l.call(this,m,y)},C.prototype.subruleInternalRecord=function(m,y,v){if(p(y),!m||e.has(m,"ruleName")===!1){var S=new Error("<SUBRULE"+h(y)+"> argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(m)+">")+(`
|
|
181
|
+
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw S.KNOWN_RECORDER_ERROR=!0,S}var U=e.peek(this.recordingProdStack),w=m.ruleName,M=new t.NonTerminal({idx:y,nonTerminalName:w,referencedRule:void 0});return U.definition.push(M),this.outputCst?d:A},C.prototype.consumeInternalRecord=function(m,y,v){if(p(y),!i.hasShortKeyProperty(m)){var S=new Error("<CONSUME"+h(y)+"> argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(m)+">")+(`
|
|
182
|
+
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw S.KNOWN_RECORDER_ERROR=!0,S}var U=e.peek(this.recordingProdStack),w=new t.Terminal({idx:y,terminalType:m});return U.definition.push(w),b},C})();n.GastRecorder=E;function g(C,m,y,v){v===void 0&&(v=!1),p(y);var S=e.peek(this.recordingProdStack),U=e.isFunction(m)?m:m.DEF,w=new C({definition:[],idx:y});return v&&(w.separator=m.SEP),e.has(m,"MAX_LOOKAHEAD")&&(w.maxLookahead=m.MAX_LOOKAHEAD),this.recordingProdStack.push(w),U.call(this),S.definition.push(w),this.recordingProdStack.pop(),A}function l(C,m){var y=this;p(m);var v=e.peek(this.recordingProdStack),S=e.isArray(C)===!1,U=S===!1?C:C.DEF,w=new t.Alternation({definition:[],idx:m,ignoreAmbiguities:S&&C.IGNORE_AMBIGUITIES===!0});e.has(C,"MAX_LOOKAHEAD")&&(w.maxLookahead=C.MAX_LOOKAHEAD);var M=e.some(U,function(_){return e.isFunction(_.GATE)});return w.hasPredicates=M,v.definition.push(w),e.forEach(U,function(_){var k=new t.Alternative({definition:[]});w.definition.push(k),e.has(_,"IGNORE_AMBIGUITIES")?k.ignoreAmbiguities=_.IGNORE_AMBIGUITIES:e.has(_,"GATE")&&(k.ignoreAmbiguities=!0),y.recordingProdStack.push(k),_.ALT.call(y),y.recordingProdStack.pop()}),A}function h(C){return C===0?"":""+C}function p(C){if(C<0||C>f){var m=new Error("Invalid DSL Method idx value: <"+C+`>
|
|
183
|
+
`+("Idx value must be a none negative value smaller than "+(f+1)));throw m.KNOWN_RECORDER_ERROR=!0,m}}}),Go=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PerformanceTracer=void 0;var e=ke(),t=Je(),r=(function(){function i(){}return i.prototype.initPerformanceTracer=function(s){if(e.has(s,"traceInitPerf")){var o=s.traceInitPerf,c=typeof o=="number";this.traceInitMaxIdent=c?o:1/0,this.traceInitPerf=c?o>0:o}else this.traceInitMaxIdent=0,this.traceInitPerf=t.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},i.prototype.TRACE_INIT=function(s,o){if(this.traceInitPerf===!0){this.traceInitIndent++;var c=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(c+"--> <"+s+">");var A=e.timer(o),a=A.time,f=A.value,u=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(c+"<-- <"+s+"> time: "+a+"ms"),this.traceInitIndent--,f}else return o()},i})();n.PerformanceTracer=r}),Uo=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.applyMixins=void 0;function e(t,r){r.forEach(function(i){var s=i.prototype;Object.getOwnPropertyNames(s).forEach(function(o){if(o!=="constructor"){var c=Object.getOwnPropertyDescriptor(s,o);c&&(c.get||c.set)?Object.defineProperty(t.prototype,o,c):t.prototype[o]=i.prototype[o]}})})}n.applyMixins=e}),Je=Ce(n=>{var e=n&&n.__extends||(function(){var v=function(S,U){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,M){w.__proto__=M}||function(w,M){for(var _ in M)Object.prototype.hasOwnProperty.call(M,_)&&(w[_]=M[_])},v(S,U)};return function(S,U){if(typeof U!="function"&&U!==null)throw new TypeError("Class extends value "+String(U)+" is not a constructor or null");v(S,U);function w(){this.constructor=S}S.prototype=U===null?Object.create(U):(w.prototype=U.prototype,new w)}})();Object.defineProperty(n,"__esModule",{value:!0}),n.EmbeddedActionsParser=n.CstParser=n.Parser=n.EMPTY_ALT=n.ParserDefinitionErrorType=n.DEFAULT_RULE_CONFIG=n.DEFAULT_PARSER_CONFIG=n.END_OF_FILE=void 0;var t=ke(),r=wo(),i=st(),s=wt(),o=ko(),c=Mi(),A=So(),a=xo(),f=No(),u=Do(),b=Oo(),d=Fo(),E=Mo(),g=Po(),l=Go(),h=Uo();n.END_OF_FILE=i.createTokenInstance(i.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN),Object.freeze(n.END_OF_FILE),n.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:s.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),n.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"})(n.ParserDefinitionErrorType||(n.ParserDefinitionErrorType={}));function p(v){return v===void 0&&(v=void 0),function(){return v}}n.EMPTY_ALT=p;var C=(function(){function v(S,U){this.definitionErrors=[],this.selfAnalysisDone=!1;var w=this;if(w.initErrorHandler(U),w.initLexerAdapter(),w.initLooksAhead(U),w.initRecognizerEngine(S,U),w.initRecoverable(U),w.initTreeBuilder(U),w.initContentAssist(),w.initGastRecorder(U),w.initPerformanceTracer(U),t.has(U,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
183
184
|
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
184
185
|
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
185
|
-
For further details.`);this.skipValidations=t.has(
|
|
186
|
-
`+
|
|
186
|
+
For further details.`);this.skipValidations=t.has(U,"skipValidations")?U.skipValidations:n.DEFAULT_PARSER_CONFIG.skipValidations}return v.performSelfAnalysis=function(S){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},v.prototype.performSelfAnalysis=function(){var S=this;this.TRACE_INIT("performSelfAnalysis",function(){var U;S.selfAnalysisDone=!0;var w=S.className;S.TRACE_INIT("toFastProps",function(){t.toFastProperties(S)}),S.TRACE_INIT("Grammar Recording",function(){try{S.enableRecording(),t.forEach(S.definedRulesNames,function(_){var k=S[_],D=k.originalGrammarAction,L=void 0;S.TRACE_INIT(_+" Rule",function(){L=S.topLevelRuleRecord(_,D)}),S.gastProductionsCache[_]=L})}finally{S.disableRecording()}});var M=[];if(S.TRACE_INIT("Grammar Resolving",function(){M=o.resolveGrammar({rules:t.values(S.gastProductionsCache)}),S.definitionErrors=S.definitionErrors.concat(M)}),S.TRACE_INIT("Grammar Validations",function(){if(t.isEmpty(M)&&S.skipValidations===!1){var _=o.validateGrammar({rules:t.values(S.gastProductionsCache),maxLookahead:S.maxLookahead,tokenTypes:t.values(S.tokensMap),errMsgProvider:s.defaultGrammarValidatorErrorProvider,grammarName:w});S.definitionErrors=S.definitionErrors.concat(_)}}),t.isEmpty(S.definitionErrors)&&(S.recoveryEnabled&&S.TRACE_INIT("computeAllProdsFollows",function(){var _=r.computeAllProdsFollows(t.values(S.gastProductionsCache));S.resyncFollows=_}),S.TRACE_INIT("ComputeLookaheadFunctions",function(){S.preComputeLookaheadFunctions(t.values(S.gastProductionsCache))})),!v.DEFER_DEFINITION_ERRORS_HANDLING&&!t.isEmpty(S.definitionErrors))throw U=t.map(S.definitionErrors,function(_){return _.message}),new Error(`Parser Definition Errors detected:
|
|
187
|
+
`+U.join(`
|
|
187
188
|
-------------------------------
|
|
188
|
-
`))})},
|
|
189
|
+
`))})},v.DEFER_DEFINITION_ERRORS_HANDLING=!1,v})();n.Parser=C,h.applyMixins(C,[c.Recoverable,A.LooksAhead,a.TreeBuilder,f.LexerAdapter,b.RecognizerEngine,u.RecognizerApi,d.ErrorHandler,E.ContentAssist,g.GastRecorder,l.PerformanceTracer]);var m=(function(v){e(S,v);function S(U,w){w===void 0&&(w=n.DEFAULT_PARSER_CONFIG);var M=this,_=t.cloneObj(w);return _.outputCst=!0,M=v.call(this,U,_)||this,M}return S})(C);n.CstParser=m;var y=(function(v){e(S,v);function S(U,w){w===void 0&&(w=n.DEFAULT_PARSER_CONFIG);var M=this,_=t.cloneObj(w);return _.outputCst=!1,M=v.call(this,U,_)||this,M}return S})(C);n.EmbeddedActionsParser=y}),Ho=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSyntaxDiagramsCode=void 0;var e=_i();function t(r,i){var s=i===void 0?{}:i,o=s.resourceBase,c=o===void 0?"https://unpkg.com/chevrotain@"+e.VERSION+"/diagrams/":o,A=s.css,a=A===void 0?"https://unpkg.com/chevrotain@"+e.VERSION+"/diagrams/diagrams.css":A,f=`
|
|
189
190
|
<!-- This is a generated file -->
|
|
190
191
|
<!DOCTYPE html>
|
|
191
192
|
<meta charset="utf-8">
|
|
@@ -195,26 +196,26 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
|
|
|
195
196
|
}
|
|
196
197
|
</style>
|
|
197
198
|
|
|
198
|
-
`,
|
|
199
|
-
<link rel='stylesheet' href='`+
|
|
200
|
-
`,
|
|
201
|
-
<script src='`+
|
|
202
|
-
<script src='`+
|
|
203
|
-
<script src='`+
|
|
204
|
-
<script src='`+
|
|
205
|
-
`,
|
|
199
|
+
`,u=`
|
|
200
|
+
<link rel='stylesheet' href='`+a+`'>
|
|
201
|
+
`,b=`
|
|
202
|
+
<script src='`+c+`vendor/railroad-diagrams.js'><\/script>
|
|
203
|
+
<script src='`+c+`src/diagrams_builder.js'><\/script>
|
|
204
|
+
<script src='`+c+`src/diagrams_behavior.js'><\/script>
|
|
205
|
+
<script src='`+c+`src/main.js'><\/script>
|
|
206
|
+
`,d=`
|
|
206
207
|
<div id="diagrams" align="center"></div>
|
|
207
|
-
`,
|
|
208
|
+
`,E=`
|
|
208
209
|
<script>
|
|
209
|
-
window.serializedGrammar = `+JSON.stringify(
|
|
210
|
+
window.serializedGrammar = `+JSON.stringify(r,null," ")+`;
|
|
210
211
|
<\/script>
|
|
211
|
-
`,
|
|
212
|
+
`,g=`
|
|
212
213
|
<script>
|
|
213
214
|
var diagramsDiv = document.getElementById("diagrams");
|
|
214
215
|
main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);
|
|
215
216
|
<\/script>
|
|
216
|
-
`;return f+
|
|
217
|
+
`;return f+u+b+d+E+g}n.createSyntaxDiagramsCode=t}),jo=Ce(n=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Parser=n.createSyntaxDiagramsCode=n.clearCache=n.GAstVisitor=n.serializeProduction=n.serializeGrammar=n.Terminal=n.Rule=n.RepetitionWithSeparator=n.RepetitionMandatoryWithSeparator=n.RepetitionMandatory=n.Repetition=n.Option=n.NonTerminal=n.Alternative=n.Alternation=n.defaultLexerErrorProvider=n.NoViableAltException=n.NotAllInputParsedException=n.MismatchedTokenException=n.isRecognitionException=n.EarlyExitException=n.defaultParserErrorProvider=n.tokenName=n.tokenMatcher=n.tokenLabel=n.EOF=n.createTokenInstance=n.createToken=n.LexerDefinitionErrorType=n.Lexer=n.EMPTY_ALT=n.ParserDefinitionErrorType=n.EmbeddedActionsParser=n.CstParser=n.VERSION=void 0;var e=_i();Object.defineProperty(n,"VERSION",{enumerable:!0,get:function(){return e.VERSION}});var t=Je();Object.defineProperty(n,"CstParser",{enumerable:!0,get:function(){return t.CstParser}}),Object.defineProperty(n,"EmbeddedActionsParser",{enumerable:!0,get:function(){return t.EmbeddedActionsParser}}),Object.defineProperty(n,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return t.ParserDefinitionErrorType}}),Object.defineProperty(n,"EMPTY_ALT",{enumerable:!0,get:function(){return t.EMPTY_ALT}});var r=Rt();Object.defineProperty(n,"Lexer",{enumerable:!0,get:function(){return r.Lexer}}),Object.defineProperty(n,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return r.LexerDefinitionErrorType}});var i=st();Object.defineProperty(n,"createToken",{enumerable:!0,get:function(){return i.createToken}}),Object.defineProperty(n,"createTokenInstance",{enumerable:!0,get:function(){return i.createTokenInstance}}),Object.defineProperty(n,"EOF",{enumerable:!0,get:function(){return i.EOF}}),Object.defineProperty(n,"tokenLabel",{enumerable:!0,get:function(){return i.tokenLabel}}),Object.defineProperty(n,"tokenMatcher",{enumerable:!0,get:function(){return i.tokenMatcher}}),Object.defineProperty(n,"tokenName",{enumerable:!0,get:function(){return i.tokenName}});var s=wt();Object.defineProperty(n,"defaultParserErrorProvider",{enumerable:!0,get:function(){return s.defaultParserErrorProvider}});var o=mt();Object.defineProperty(n,"EarlyExitException",{enumerable:!0,get:function(){return o.EarlyExitException}}),Object.defineProperty(n,"isRecognitionException",{enumerable:!0,get:function(){return o.isRecognitionException}}),Object.defineProperty(n,"MismatchedTokenException",{enumerable:!0,get:function(){return o.MismatchedTokenException}}),Object.defineProperty(n,"NotAllInputParsedException",{enumerable:!0,get:function(){return o.NotAllInputParsedException}}),Object.defineProperty(n,"NoViableAltException",{enumerable:!0,get:function(){return o.NoViableAltException}});var c=Ni();Object.defineProperty(n,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return c.defaultLexerErrorProvider}});var A=ze();Object.defineProperty(n,"Alternation",{enumerable:!0,get:function(){return A.Alternation}}),Object.defineProperty(n,"Alternative",{enumerable:!0,get:function(){return A.Alternative}}),Object.defineProperty(n,"NonTerminal",{enumerable:!0,get:function(){return A.NonTerminal}}),Object.defineProperty(n,"Option",{enumerable:!0,get:function(){return A.Option}}),Object.defineProperty(n,"Repetition",{enumerable:!0,get:function(){return A.Repetition}}),Object.defineProperty(n,"RepetitionMandatory",{enumerable:!0,get:function(){return A.RepetitionMandatory}}),Object.defineProperty(n,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return A.RepetitionMandatoryWithSeparator}}),Object.defineProperty(n,"RepetitionWithSeparator",{enumerable:!0,get:function(){return A.RepetitionWithSeparator}}),Object.defineProperty(n,"Rule",{enumerable:!0,get:function(){return A.Rule}}),Object.defineProperty(n,"Terminal",{enumerable:!0,get:function(){return A.Terminal}});var a=ze();Object.defineProperty(n,"serializeGrammar",{enumerable:!0,get:function(){return a.serializeGrammar}}),Object.defineProperty(n,"serializeProduction",{enumerable:!0,get:function(){return a.serializeProduction}});var f=It();Object.defineProperty(n,"GAstVisitor",{enumerable:!0,get:function(){return f.GAstVisitor}});function u(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API.
|
|
217
218
|
It performs no action other than printing this message.
|
|
218
|
-
Please avoid using it as it will be completely removed in the future`)}n.clearCache=
|
|
219
|
-
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return T})();n.Parser=p});const at=Ei();class vi extends R.Loader{constructor(e){super(e)}load(e,t,i,r){const a=this,o=a.path===""?R.LoaderUtils.extractUrlBase(e):a.path,u=new R.FileLoader(a.manager);u.setPath(a.path),u.setRequestHeader(a.requestHeader),u.setWithCredentials(a.withCredentials),u.load(e,function(c){try{t(a.parse(c,o))}catch(s){r?r(s):console.error(s),a.manager.itemError(e)}},i,r)}parse(e,t){const i={};function r(b){const A=a(),_=new Ri(A.tokens),N=new _i(A.tokenVocabulary),L=o(N.getBaseCstVisitorConstructor()),w=_.lex(b);N.input=w.tokens;const D=N.vrml();if(N.errors.length>0)throw console.error(N.errors),Error("THREE.VRMLLoader2: Parsing errors detected.");return L.visit(D)}function a(){const b=at.createToken,A=b({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({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:A}),N=["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"],L=b({name:"Version",pattern:/#VRML.*/,longer_alt:_}),w=b({name:"NodeName",pattern:new RegExp(N.join("|")),longer_alt:_}),D=b({name:"DEF",pattern:/DEF/,longer_alt:_}),j=b({name:"USE",pattern:/USE/,longer_alt:_}),V=b({name:"ROUTE",pattern:/ROUTE/,longer_alt:_}),Z=b({name:"TO",pattern:/TO/,longer_alt:_}),re=b({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),ge=b({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),Oe=b({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),Fe=b({name:"TrueLiteral",pattern:/TRUE/}),Ie=b({name:"FalseLiteral",pattern:/FALSE/}),Ee=b({name:"NullLiteral",pattern:/NULL/}),Re=b({name:"LSquare",pattern:/\[/}),Ne=b({name:"RSquare",pattern:/]/}),Me=b({name:"LCurly",pattern:/{/}),Se=b({name:"RCurly",pattern:/}/}),De=b({name:"Comment",pattern:/#.*/,group:at.Lexer.SKIPPED}),Ge=[b({name:"WhiteSpace",pattern:/[ ,\s]/,group:at.Lexer.SKIPPED}),w,D,j,V,Z,Fe,Ie,Ee,L,_,A,re,ge,Oe,Re,Ne,Me,Se,De],ze={};for(let Le=0,ue=Ge.length;Le<ue;Le++){const he=Ge[Le];ze[he.name]=he}return{tokens:Ge,tokenVocabulary:ze}}function o(b){class A extends b{constructor(){super(),this.validateVisitor()}vrml(L){const w={version:this.visit(L.version),nodes:[],routes:[]};for(let D=0,j=L.node.length;D<j;D++){const V=L.node[D];w.nodes.push(this.visit(V))}if(L.route)for(let D=0,j=L.route.length;D<j;D++){const V=L.route[D];w.routes.push(this.visit(V))}return w}version(L){return L.Version[0].image}node(L){const w={name:L.NodeName[0].image,fields:[]};if(L.field)for(let D=0,j=L.field.length;D<j;D++){const V=L.field[D];w.fields.push(this.visit(V))}return L.def&&(w.DEF=this.visit(L.def[0])),w}field(L){const w={name:L.Identifier[0].image,type:null,values:null};let D;return L.singleFieldValue&&(D=this.visit(L.singleFieldValue[0])),L.multiFieldValue&&(D=this.visit(L.multiFieldValue[0])),w.type=D.type,w.values=D.values,w}def(L){return(L.Identifier||L.NodeName)[0].image}use(L){return{USE:(L.Identifier||L.NodeName)[0].image}}singleFieldValue(L){return _(this,L)}multiFieldValue(L){return _(this,L)}route(L){return{FROM:L.RouteIdentifier[0].image,TO:L.RouteIdentifier[1].image}}}function _(N,L){const w={type:null,values:[]};if(L.node){w.type="node";for(let D=0,j=L.node.length;D<j;D++){const V=L.node[D];w.values.push(N.visit(V))}}if(L.use){w.type="use";for(let D=0,j=L.use.length;D<j;D++){const V=L.use[D];w.values.push(N.visit(V))}}if(L.StringLiteral){w.type="string";for(let D=0,j=L.StringLiteral.length;D<j;D++){const V=L.StringLiteral[D];w.values.push(V.image.replace(/'|"/g,""))}}if(L.NumberLiteral){w.type="number";for(let D=0,j=L.NumberLiteral.length;D<j;D++){const V=L.NumberLiteral[D];w.values.push(parseFloat(V.image))}}if(L.HexLiteral){w.type="hex";for(let D=0,j=L.HexLiteral.length;D<j;D++){const V=L.HexLiteral[D];w.values.push(V.image)}}if(L.TrueLiteral){w.type="boolean";for(let D=0,j=L.TrueLiteral.length;D<j;D++)L.TrueLiteral[D].image==="TRUE"&&w.values.push(!0)}if(L.FalseLiteral){w.type="boolean";for(let D=0,j=L.FalseLiteral.length;D<j;D++)L.FalseLiteral[D].image==="FALSE"&&w.values.push(!1)}return L.NullLiteral&&(w.type="null",L.NullLiteral.forEach(function(){w.values.push(null)})),w}return new A}function u(b){const A=b.nodes,_=new R.Scene;for(let N=0,L=A.length;N<L;N++){const w=A[N];c(w)}for(let N=0,L=A.length;N<L;N++){const w=A[N],D=s(w);D instanceof R.Object3D&&_.add(D),w.name==="WorldInfo"&&(_.userData.worldInfo=D)}return _}function c(b){b.DEF&&(i[b.DEF]=b);const A=b.fields;for(let _=0,N=A.length;_<N;_++){const L=A[_];if(L.type==="node"){const w=L.values;for(let D=0,j=w.length;D<j;D++)c(w[D])}}}function s(b){return b.USE?Q(b.USE):(b.build!==void 0||(b.build=f(b)),b.build)}function f(b){const A=b.name;let _;switch(A){case"Anchor":case"Group":case"Transform":case"Collision":_=h(b);break;case"Background":_=g(b);break;case"Shape":_=p(b);break;case"Appearance":_=T(b);break;case"Material":_=m(b);break;case"ImageTexture":_=v(b);break;case"PixelTexture":_=y(b);break;case"TextureTransform":_=E(b);break;case"IndexedFaceSet":_=k(b);break;case"IndexedLineSet":_=H(b);break;case"PointSet":_=x(b);break;case"Box":_=B(b);break;case"Cone":_=P(b);break;case"Cylinder":_=O(b);break;case"Sphere":_=M(b);break;case"ElevationGrid":_=C(b);break;case"Extrusion":_=X(b);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":_=S(b);break;case"WorldInfo":_=I(b);break;case"Billboard":case"Inline":case"LOD":case"Switch":case"AudioClip":case"DirectionalLight":case"PointLight":case"Script":case"Sound":case"SpotLight":case"CylinderSensor":case"PlaneSensor":case"ProximitySensor":case"SphereSensor":case"TimeSensor":case"TouchSensor":case"VisibilitySensor":case"Text":case"FontStyle":case"MovieTexture":case"ColorInterpolator":case"CoordinateInterpolator":case"NormalInterpolator":case"OrientationInterpolator":case"PositionInterpolator":case"ScalarInterpolator":case"Fog":case"NavigationInfo":case"Viewpoint":break;default:console.warn("THREE.VRMLLoader2: Unknown node:",A);break}return _!==void 0&&b.DEF!==void 0&&_.hasOwnProperty("name")===!0&&(_.name=b.DEF),_}function h(b){const A=new R.Group,_=b.fields;for(let N=0,L=_.length;N<L;N++){const w=_[N],D=w.name,j=w.values;switch(D){case"bboxCenter":break;case"bboxSize":break;case"center":break;case"children":W(j,A);break;case"description":break;case"collide":break;case"parameter":break;case"rotation":const V=new R.Vector3(j[0],j[1],j[2]).normalize(),Z=j[3];A.quaternion.setFromAxisAngle(V,Z);break;case"scale":A.scale.set(j[0],j[1],j[2]);break;case"scaleOrientation":break;case"translation":A.position.set(j[0],j[1],j[2]);break;case"proxy":break;case"url":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",D);break}}return A}function g(b){const A=new R.Group;let _,N,L,w;const D=b.fields;for(let V=0,Z=D.length;V<Z;V++){const re=D[V],ge=re.name,Oe=re.values;switch(ge){case"groundAngle":_=Oe;break;case"groundColor":N=Oe;break;case"backUrl":break;case"bottomUrl":break;case"frontUrl":break;case"leftUrl":break;case"rightUrl":break;case"topUrl":break;case"skyAngle":L=Oe;break;case"skyColor":w=Oe;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",ge);break}}const j=1e4;if(w){const V=new R.SphereGeometry(j,32,16),Z=new R.MeshBasicMaterial({fog:!1,side:R.BackSide,depthWrite:!1,depthTest:!1});w.length>3?(z(V,j,L,F(w),!0),Z.vertexColors=!0):Z.color.setRGB(w[0],w[1],w[2],R.SRGBColorSpace);const re=new R.Mesh(V,Z);A.add(re)}if(N&&N.length>0){const V=new R.SphereGeometry(j,32,16,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),Z=new R.MeshBasicMaterial({fog:!1,side:R.BackSide,vertexColors:!0,depthWrite:!1,depthTest:!1});z(V,j,_,F(N),!1);const re=new R.Mesh(V,Z);A.add(re)}return A.renderOrder=-1/0,A}function p(b){const A=b.fields;let _=new R.MeshBasicMaterial({name:R.Loader.DEFAULT_MATERIAL_NAME,color:0}),N;for(let w=0,D=A.length;w<D;w++){const j=A[w],V=j.name,Z=j.values;switch(V){case"appearance":Z[0]!==null&&(_=s(Z[0]));break;case"geometry":Z[0]!==null&&(N=s(Z[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}let L;if(N&&N.attributes.position){const w=N._type;if(w==="points"){const D=new R.PointsMaterial({name:R.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:_.opacity,transparent:_.transparent});N.attributes.color!==void 0?D.vertexColors=!0:_.isMeshPhongMaterial&&D.color.copy(_.emissive),L=new R.Points(N,D)}else if(w==="line"){const D=new R.LineBasicMaterial({name:R.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:_.opacity,transparent:_.transparent});N.attributes.color!==void 0?D.vertexColors=!0:_.isMeshPhongMaterial&&D.color.copy(_.emissive),L=new R.LineSegments(N,D)}else N._solid!==void 0&&(_.side=N._solid?R.FrontSide:R.DoubleSide),N.attributes.color!==void 0&&(_.vertexColors=!0),L=new R.Mesh(N,_)}else L=new R.Object3D,L.visible=!1;return L}function T(b){let A=new R.MeshPhongMaterial,_;const N=b.fields;for(let L=0,w=N.length;L<w;L++){const D=N[L],j=D.name,V=D.values;switch(j){case"material":if(V[0]!==null){const re=s(V[0]);re.diffuseColor&&A.color.copy(re.diffuseColor),re.emissiveColor&&A.emissive.copy(re.emissiveColor),re.shininess&&(A.shininess=re.shininess),re.specularColor&&A.specular.copy(re.specularColor),re.transparency&&(A.opacity=1-re.transparency),re.transparency>0&&(A.transparent=!0)}else A=new R.MeshBasicMaterial({name:R.Loader.DEFAULT_MATERIAL_NAME,color:0});break;case"texture":const Z=V[0];Z!==null&&(Z.name==="ImageTexture"||Z.name==="PixelTexture"||Z.USE)&&(A.map=s(Z));break;case"textureTransform":V[0]!==null&&(_=s(V[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",j);break}}if(A.map){if(A.map.__type){switch(A.map.__type){case Xe.INTENSITY_ALPHA:A.opacity=1;break;case Xe.RGB:A.color.set(16777215);break;case Xe.RGBA:A.color.set(16777215),A.opacity=1;break}delete A.map.__type}_&&(A.map.center.copy(_.center),A.map.rotation=_.rotation,A.map.repeat.copy(_.scale),A.map.offset.copy(_.translation))}return A}function m(b){const A={},_=b.fields;for(let N=0,L=_.length;N<L;N++){const w=_[N],D=w.name,j=w.values;switch(D){case"ambientIntensity":break;case"diffuseColor":A.diffuseColor=new R.Color().setRGB(j[0],j[1],j[2],R.SRGBColorSpace);break;case"emissiveColor":A.emissiveColor=new R.Color().setRGB(j[0],j[1],j[2],R.SRGBColorSpace);break;case"shininess":A.shininess=j[0];break;case"specularColor":A.specularColor=new R.Color().setRGB(j[0],j[1],j[2],R.SRGBColorSpace);break;case"transparency":A.transparency=j[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",D);break}}return A}function l(b,A,_){let N;switch(A){case Xe.INTENSITY:N=parseInt(b),_.r=N,_.g=N,_.b=N,_.a=1;break;case Xe.INTENSITY_ALPHA:N=parseInt("0x"+b.substring(2,4)),_.r=N,_.g=N,_.b=N,_.a=parseInt("0x"+b.substring(4,6));break;case Xe.RGB:_.r=parseInt("0x"+b.substring(2,4)),_.g=parseInt("0x"+b.substring(4,6)),_.b=parseInt("0x"+b.substring(6,8)),_.a=1;break;case Xe.RGBA:_.r=parseInt("0x"+b.substring(2,4)),_.g=parseInt("0x"+b.substring(4,6)),_.b=parseInt("0x"+b.substring(6,8)),_.a=parseInt("0x"+b.substring(8,10));break}}function d(b){let A;switch(b){case 1:A=Xe.INTENSITY;break;case 2:A=Xe.INTENSITY_ALPHA;break;case 3:A=Xe.RGB;break;case 4:A=Xe.RGBA;break}return A}function y(b){let A,_=R.RepeatWrapping,N=R.RepeatWrapping;const L=b.fields;for(let w=0,D=L.length;w<D;w++){const j=L[w],V=j.name,Z=j.values;switch(V){case"image":const re=Z[0],ge=Z[1],Oe=Z[2],Fe=d(Oe),Ie=new Uint8Array(4*re*ge),Ee={r:0,g:0,b:0,a:0};for(let Re=3,Ne=0,Me=Z.length;Re<Me;Re++,Ne++){l(Z[Re],Fe,Ee);const Se=Ne*4;Ie[Se+0]=Ee.r,Ie[Se+1]=Ee.g,Ie[Se+2]=Ee.b,Ie[Se+3]=Ee.a}A=new R.DataTexture(Ie,re,ge),A.colorSpace=R.SRGBColorSpace,A.needsUpdate=!0,A.__type=Fe;break;case"repeatS":Z[0]===!1&&(_=R.ClampToEdgeWrapping);break;case"repeatT":Z[0]===!1&&(N=R.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}return A&&(A.wrapS=_,A.wrapT=N),A}function v(b){let A,_=R.RepeatWrapping,N=R.RepeatWrapping;const L=b.fields;for(let w=0,D=L.length;w<D;w++){const j=L[w],V=j.name,Z=j.values;switch(V){case"url":const re=Z[0];re&&(A=ee.load(re));break;case"repeatS":Z[0]===!1&&(_=R.ClampToEdgeWrapping);break;case"repeatT":Z[0]===!1&&(N=R.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}return A&&(A.wrapS=_,A.wrapT=N,A.colorSpace=R.SRGBColorSpace),A}function E(b){const A={center:new R.Vector2,rotation:new R.Vector2,scale:new R.Vector2,translation:new R.Vector2},_=b.fields;for(let N=0,L=_.length;N<L;N++){const w=_[N],D=w.name,j=w.values;switch(D){case"center":A.center.set(j[0],j[1]);break;case"rotation":A.rotation=j[0];break;case"scale":A.scale.set(j[0],j[1]);break;case"translation":A.translation.set(j[0],j[1]);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",D);break}}return A}function S(b){return b.fields[0].values}function I(b){const A={},_=b.fields;for(let N=0,L=_.length;N<L;N++){const w=_[N],D=w.name,j=w.values;switch(D){case"title":A.title=j[0];break;case"info":A.info=j;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",D);break}}return A}function k(b){let A,_,N,L,w=!0,D=!0,j=0,V,Z,re,ge,Oe=!0,Fe=!0;const Ie=b.fields;for(let Ce=0,Ge=Ie.length;Ce<Ge;Ce++){const ze=Ie[Ce],Le=ze.name,ue=ze.values;switch(Le){case"color":const he=ue[0];he!==null&&(A=s(he));break;case"coord":const oe=ue[0];oe!==null&&(_=s(oe));break;case"normal":const fe=ue[0];fe!==null&&(N=s(fe));break;case"texCoord":const me=ue[0];me!==null&&(L=s(me));break;case"ccw":w=ue[0];break;case"colorIndex":V=ue;break;case"colorPerVertex":Oe=ue[0];break;case"convex":break;case"coordIndex":Z=ue;break;case"creaseAngle":j=ue[0];break;case"normalIndex":re=ue;break;case"normalPerVertex":Fe=ue[0];break;case"solid":D=ue[0];break;case"texCoordIndex":ge=ue;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Le);break}}if(Z===void 0)return console.warn("THREE.VRMLLoader2: Missing coordIndex."),new R.BufferGeometry;const Ee=$(Z,w);let Re,Ne,Me;if(A){if(Oe===!0)if(V&&V.length>0){const Ce=$(V,w);Re=J(Ee,Ce,A,3)}else Re=ye(Ee,new R.Float32BufferAttribute(A,3));else if(V&&V.length>0){const Ce=ce(A,V),Ge=te(Ce,Z);Re=ie(Ee,Ge)}else{const Ce=te(A,Z);Re=ie(Ee,Ce)}Y(Re)}if(N)if(Fe===!0)if(re&&re.length>0){const Ce=$(re,w);Ne=J(Ee,Ce,N,3)}else Ne=ye(Ee,new R.Float32BufferAttribute(N,3));else if(re&&re.length>0){const Ce=ce(N,re),Ge=te(Ce,Z);Ne=ie(Ee,Ge)}else{const Ce=te(N,Z);Ne=ie(Ee,Ce)}else Ne=We(Ee,_,j);if(L)if(ge&&ge.length>0){const Ce=$(ge,w);Me=J(Ee,Ce,L,2)}else Me=ye(Ee,new R.Float32BufferAttribute(L,2));const Se=new R.BufferGeometry,De=ye(Ee,new R.Float32BufferAttribute(_,3));return Se.setAttribute("position",De),Se.setAttribute("normal",Ne),Re&&Se.setAttribute("color",Re),Me&&Se.setAttribute("uv",Me),Se._solid=D,Se._type="mesh",Se}function H(b){let A,_,N,L,w=!0;const D=b.fields;for(let ge=0,Oe=D.length;ge<Oe;ge++){const Fe=D[ge],Ie=Fe.name,Ee=Fe.values;switch(Ie){case"color":const Re=Ee[0];Re!==null&&(A=s(Re));break;case"coord":const Ne=Ee[0];Ne!==null&&(_=s(Ne));break;case"colorIndex":N=Ee;break;case"colorPerVertex":w=Ee[0];break;case"coordIndex":L=Ee;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Ie);break}}let j;const V=ae(L);if(A){if(w===!0)if(N.length>0){const ge=ae(N);j=J(V,ge,A,3)}else j=ye(V,new R.Float32BufferAttribute(A,3));else if(N.length>0){const ge=ce(A,N),Oe=le(ge,L);j=Te(V,Oe)}else{const ge=le(A,L);j=Te(V,ge)}Y(j)}const Z=new R.BufferGeometry,re=ye(V,new R.Float32BufferAttribute(_,3));return Z.setAttribute("position",re),j&&Z.setAttribute("color",j),Z._type="line",Z}function x(b){let A,_;const N=b.fields;for(let w=0,D=N.length;w<D;w++){const j=N[w],V=j.name,Z=j.values;switch(V){case"color":const re=Z[0];re!==null&&(A=s(re));break;case"coord":const ge=Z[0];ge!==null&&(_=s(ge));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}const L=new R.BufferGeometry;if(L.setAttribute("position",new R.Float32BufferAttribute(_,3)),A){const w=new R.Float32BufferAttribute(A,3);Y(w),L.setAttribute("color",w)}return L._type="points",L}function B(b){const A=new R.Vector3(2,2,2),_=b.fields;for(let L=0,w=_.length;L<w;L++){const D=_[L],j=D.name,V=D.values;j==="size"?(A.x=V[0],A.y=V[1],A.z=V[2]):console.warn("THREE.VRMLLoader2: Unknown field:",j)}return new R.BoxGeometry(A.x,A.y,A.z)}function P(b){let A=1,_=2,N=!1;const L=b.fields;for(let D=0,j=L.length;D<j;D++){const V=L[D],Z=V.name,re=V.values;switch(Z){case"bottom":N=!re[0];break;case"bottomRadius":A=re[0];break;case"height":_=re[0];break;case"side":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Z);break}}return new R.ConeGeometry(A,_,16,1,N)}function O(b){let A=1,_=2;const N=b.fields;for(let w=0,D=N.length;w<D;w++){const j=N[w],V=j.name,Z=j.values;switch(V){case"bottom":break;case"radius":A=Z[0];break;case"height":_=Z[0];break;case"side":break;case"top":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",V);break}}return new R.CylinderGeometry(A,A,_,16,1)}function M(b){let A=1;const _=b.fields;for(let L=0,w=_.length;L<w;L++){const D=_[L],j=D.name,V=D.values;j==="radius"?A=V[0]:console.warn("THREE.VRMLLoader2: Unknown field:",j)}return new R.SphereGeometry(A,16,16)}function C(b){let A,_,N,L,w=!0,D=!0,j=!0,V=!0,Z=0,re=2,ge=2,Oe=1,Fe=1;const Ie=b.fields;for(let ue=0,he=Ie.length;ue<he;ue++){const oe=Ie[ue],fe=oe.name,me=oe.values;switch(fe){case"color":const Pe=me[0];Pe!==null&&(A=s(Pe));break;case"normal":const Qe=me[0];Qe!==null&&(_=s(Qe));break;case"texCoord":const Ze=me[0];Ze!==null&&(N=s(Ze));break;case"height":L=me;break;case"ccw":V=me[0];break;case"colorPerVertex":w=me[0];break;case"creaseAngle":Z=me[0];break;case"normalPerVertex":D=me[0];break;case"solid":j=me[0];break;case"xDimension":re=me[0];break;case"xSpacing":Oe=me[0];break;case"zDimension":ge=me[0];break;case"zSpacing":Fe=me[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",fe);break}}const Ee=[],Re=[],Ne=[],Me=[];for(let ue=0;ue<ge;ue++)for(let he=0;he<re;he++){const oe=ue*re+he,fe=Oe*ue,me=L[oe],Pe=Fe*he;if(Ee.push(fe,me,Pe),A&&w===!0){const Qe=A[oe*3+0],Ze=A[oe*3+1],At=A[oe*3+2];Ne.push(Qe,Ze,At)}if(_&&D===!0){const Qe=_[oe*3+0],Ze=_[oe*3+1],At=_[oe*3+2];Re.push(Qe,Ze,At)}if(N){const Qe=N[oe*2+0],Ze=N[oe*2+1];Me.push(Qe,Ze)}else Me.push(ue/(re-1),he/(ge-1))}const Se=[];for(let ue=0;ue<re-1;ue++)for(let he=0;he<ge-1;he++){const oe=ue+he*re,fe=ue+(he+1)*re,me=ue+1+(he+1)*re,Pe=ue+1+he*re;V===!0?(Se.push(oe,me,fe),Se.push(me,oe,Pe)):(Se.push(oe,fe,me),Se.push(me,Pe,oe))}const De=ye(Se,new R.Float32BufferAttribute(Ee,3)),Ce=ye(Se,new R.Float32BufferAttribute(Me,2));let Ge,ze;if(A){if(w===!1){for(let ue=0;ue<re-1;ue++)for(let he=0;he<ge-1;he++){const oe=ue+he*(re-1),fe=A[oe*3+0],me=A[oe*3+1],Pe=A[oe*3+2];Ne.push(fe,me,Pe),Ne.push(fe,me,Pe),Ne.push(fe,me,Pe),Ne.push(fe,me,Pe),Ne.push(fe,me,Pe),Ne.push(fe,me,Pe)}Ge=new R.Float32BufferAttribute(Ne,3)}else Ge=ye(Se,new R.Float32BufferAttribute(Ne,3));Y(Ge)}if(_)if(D===!1){for(let ue=0;ue<re-1;ue++)for(let he=0;he<ge-1;he++){const oe=ue+he*(re-1),fe=_[oe*3+0],me=_[oe*3+1],Pe=_[oe*3+2];Re.push(fe,me,Pe),Re.push(fe,me,Pe),Re.push(fe,me,Pe),Re.push(fe,me,Pe),Re.push(fe,me,Pe),Re.push(fe,me,Pe)}ze=new R.Float32BufferAttribute(Re,3)}else ze=ye(Se,new R.Float32BufferAttribute(Re,3));else ze=We(Se,Ee,Z);const Le=new R.BufferGeometry;return Le.setAttribute("position",De),Le.setAttribute("normal",ze),Le.setAttribute("uv",Ce),Ge&&Le.setAttribute("color",Ge),Le._solid=j,Le._type="mesh",Le}function X(b){let A=[1,1,1,-1,-1,-1,-1,1,1,1],_=[0,0,0,0,1,0],N,L,w=!0,D=!0,j=0,V=!0,Z=!0;const re=b.fields;for(let Le=0,ue=re.length;Le<ue;Le++){const he=re[Le],oe=he.name,fe=he.values;switch(oe){case"beginCap":w=fe[0];break;case"ccw":D=fe[0];break;case"convex":break;case"creaseAngle":j=fe[0];break;case"crossSection":A=fe;break;case"endCap":V=fe[0];break;case"orientation":L=fe;break;case"scale":N=fe;break;case"solid":Z=fe[0];break;case"spine":_=fe;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",oe);break}}const ge=A[0]===A[A.length-2]&&A[1]===A[A.length-1],Oe=[],Fe=new R.Vector3,Ie=new R.Vector3,Ee=new R.Vector3,Re=new R.Vector3,Ne=new R.Quaternion;for(let Le=0,ue=0,he=0,oe=_.length;Le<oe;Le+=3,ue+=2,he+=4){Fe.fromArray(_,Le),Ie.x=N?N[ue+0]:1,Ie.y=1,Ie.z=N?N[ue+1]:1,Ee.x=L?L[he+0]:0,Ee.y=L?L[he+1]:0,Ee.z=L?L[he+2]:1;const fe=L?L[he+3]:0;for(let me=0,Pe=A.length;me<Pe;me+=2)Re.x=A[me+0],Re.y=0,Re.z=A[me+1],Re.multiply(Ie),Ne.setFromAxisAngle(Ee,fe),Re.applyQuaternion(Ne),Re.add(Fe),Oe.push(Re.x,Re.y,Re.z)}const Me=[],Se=_.length/3,De=A.length/2;for(let Le=0;Le<Se-1;Le++)for(let ue=0;ue<De-1;ue++){const he=ue+Le*De;let oe=ue+1+Le*De;const fe=ue+(Le+1)*De;let me=ue+1+(Le+1)*De;ue===De-2&&ge===!0&&(oe=Le*De,me=(Le+1)*De),D===!0?(Me.push(he,oe,fe),Me.push(fe,oe,me)):(Me.push(he,fe,oe),Me.push(fe,me,oe))}if(w===!0||V===!0){const Le=[];for(let oe=0,fe=A.length;oe<fe;oe+=2)Le.push(new R.Vector2(A[oe],A[oe+1]));const ue=R.ShapeUtils.triangulateShape(Le,[]),he=[];for(let oe=0,fe=ue.length;oe<fe;oe++){const me=ue[oe];he.push(me[0],me[1],me[2])}if(w===!0)for(let oe=0,fe=he.length;oe<fe;oe+=3)D===!0?Me.push(he[oe+0],he[oe+1],he[oe+2]):Me.push(he[oe+0],he[oe+2],he[oe+1]);if(V===!0){const oe=De*(Se-1);for(let fe=0,me=he.length;fe<me;fe+=3)D===!0?Me.push(oe+he[fe+0],oe+he[fe+2],oe+he[fe+1]):Me.push(oe+he[fe+0],oe+he[fe+1],oe+he[fe+2])}}const Ce=ye(Me,new R.Float32BufferAttribute(Oe,3)),Ge=We(Me,Oe,j),ze=new R.BufferGeometry;return ze.setAttribute("position",Ce),ze.setAttribute("normal",Ge),ze._solid=Z,ze._type="mesh",ze}function Q(b){const A=i[b],_=s(A);return _.isObject3D||_.isMaterial?_.clone():_}function W(b,A){for(let _=0,N=b.length;_<N;_++){const L=s(b[_]);L instanceof R.Object3D&&A.add(L)}}function $(b,A){const _=[];let N=0;for(let L=0,w=b.length;L<w;L++){const D=b[N],j=b[L+(A?1:2)],V=b[L+(A?2:1)];_.push(D,j,V),(b[L+3]===-1||L+3>=w)&&(L+=3,N=L+1)}return _}function te(b,A){const _=[];let N=0;for(let L=0,w=A.length;L<w;L++){const D=N*3,j=b[D],V=b[D+1],Z=b[D+2];_.push(j,V,Z),(A[L+3]===-1||L+3>=w)&&(L+=3,N++)}return _}function ce(b,A){const _=[];for(let N=0,L=A.length;N<L;N++){const D=A[N]*3,j=b[D],V=b[D+1],Z=b[D+2];_.push(j,V,Z)}return _}function ae(b){const A=[];for(let _=0,N=b.length;_<N;_++){const L=b[_],w=b[_+1];A.push(L,w),(b[_+2]===-1||_+2>=N)&&(_+=2)}return A}function le(b,A){const _=[];let N=0;for(let L=0,w=A.length;L<w;L++){const D=N*3,j=b[D],V=b[D+1],Z=b[D+2];_.push(j,V,Z),(A[L+2]===-1||L+2>=w)&&(L+=2,N++)}return _}const ne=new R.Vector3,pe=new R.Vector3,U=new R.Vector3,G=new R.Vector2,K=new R.Vector2,q=new R.Vector2;function J(b,A,_,N){const L=[];for(let w=0,D=b.length;w<D;w+=3){const j=A[w],V=A[w+1],Z=A[w+2];N===2?(G.fromArray(_,j*N),K.fromArray(_,V*N),q.fromArray(_,Z*N),L.push(G.x,G.y),L.push(K.x,K.y),L.push(q.x,q.y)):(ne.fromArray(_,j*N),pe.fromArray(_,V*N),U.fromArray(_,Z*N),L.push(ne.x,ne.y,ne.z),L.push(pe.x,pe.y,pe.z),L.push(U.x,U.y,U.z))}return new R.Float32BufferAttribute(L,N)}function ie(b,A){const _=[];for(let N=0,L=0,w=b.length;N<w;N+=3,L++)ne.fromArray(A,L*3),_.push(ne.x,ne.y,ne.z),_.push(ne.x,ne.y,ne.z),_.push(ne.x,ne.y,ne.z);return new R.Float32BufferAttribute(_,3)}function Te(b,A){const _=[];for(let N=0,L=0,w=b.length;N<w;N+=2,L++)ne.fromArray(A,L*3),_.push(ne.x,ne.y,ne.z),_.push(ne.x,ne.y,ne.z);return new R.Float32BufferAttribute(_,3)}function ye(b,A){const _=A.array,N=A.itemSize,L=new _.constructor(b.length*N);let w=0,D=0;for(let j=0,V=b.length;j<V;j++){w=b[j]*N;for(let Z=0;Z<N;Z++)L[D++]=_[w++]}return new R.Float32BufferAttribute(L,N)}const we=new R.Vector3,Be=new R.Vector3;function We(b,A,_){const N=[],L={};for(let D=0,j=b.length;D<j;D+=3){const V=b[D],Z=b[D+1],re=b[D+2],ge=new bi(V,Z,re);ne.fromArray(A,V*3),pe.fromArray(A,Z*3),U.fromArray(A,re*3),Be.subVectors(U,pe),we.subVectors(ne,pe),Be.cross(we),Be.normalize(),ge.normal.copy(Be),L[V]===void 0&&(L[V]=[]),L[Z]===void 0&&(L[Z]=[]),L[re]===void 0&&(L[re]=[]),L[V].push(ge.normal),L[Z].push(ge.normal),L[re].push(ge.normal),N.push(ge)}const w=[];for(let D=0,j=N.length;D<j;D++){const V=N[D],Z=Ue(L[V.a],V.normal,_),re=Ue(L[V.b],V.normal,_),ge=Ue(L[V.c],V.normal,_);ne.fromArray(A,V.a*3),pe.fromArray(A,V.b*3),U.fromArray(A,V.c*3),w.push(Z.x,Z.y,Z.z),w.push(re.x,re.y,re.z),w.push(ge.x,ge.y,ge.z)}return new R.Float32BufferAttribute(w,3)}function Ue(b,A,_){const N=new R.Vector3;if(_===0)N.copy(A);else for(let L=0,w=b.length;L<w;L++)b[L].angleTo(A)<_&&N.add(b[L]);return N.normalize()}function F(b){const A=[];for(let _=0,N=b.length;_<N;_+=3)A.push(new R.Color(b[_],b[_+1],b[_+2]));return A}function Y(b){const A=new R.Color;for(let _=0;_<b.count;_++)A.fromBufferAttribute(b,_),R.ColorManagement.colorSpaceToWorking(A,R.SRGBColorSpace),b.setXYZ(_,A.r,A.g,A.b)}function z(b,A,_,N,L){const w=[],D=L===!0?0:Math.PI;for(let Oe=0,Fe=N.length;Oe<Fe;Oe++){let Ie=Oe===0?0:_[Oe-1];Ie=L===!0?Ie:D-Ie;const Ee=new R.Vector3;Ee.setFromSphericalCoords(A,Ie,0),w.push(Ee)}const j=b.index,V=b.attributes.position,Z=new R.BufferAttribute(new Float32Array(b.attributes.position.count*3),3),re=new R.Vector3,ge=new R.Color;for(let Oe=0;Oe<j.count;Oe++){const Fe=j.getX(Oe);re.fromBufferAttribute(V,Fe);let Ie,Ee,Re=1;for(let Se=1;Se<w.length;Se++){Ie=Se-1,Ee=Se;const De=w[Ie],Ce=w[Ee];if(L===!0){if(re.y<=De.y&&re.y>Ce.y){Re=Math.abs(De.y-re.y)/Math.abs(De.y-Ce.y);break}}else if(re.y>=De.y&&re.y<Ce.y){Re=Math.abs(De.y-re.y)/Math.abs(De.y-Ce.y);break}}const Ne=N[Ie],Me=N[Ee];ge.copy(Ne).lerp(Me,Re),R.ColorManagement.colorSpaceToWorking(ge,R.SRGBColorSpace),Z.setXYZ(Fe,ge.r,ge.g,ge.b)}b.setAttribute("color",Z)}const ee=new R.TextureLoader(this.manager);if(ee.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),e.indexOf("#VRML V2.0")===-1)throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");const de=r(e);return u(de)}}class Ri{constructor(e){this.lexer=new at.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 Ai=at.CstParser;class _i extends Ai{constructor(e){super(e);const t=this,i=e.Version,r=e.LCurly,a=e.RCurly,o=e.LSquare,u=e.RSquare,c=e.Identifier,s=e.RouteIdentifier,f=e.StringLiteral,h=e.HexLiteral,g=e.NumberLiteral,p=e.TrueLiteral,T=e.FalseLiteral,m=e.NullLiteral,l=e.DEF,d=e.USE,y=e.ROUTE,v=e.TO,E=e.NodeName;t.RULE("vrml",function(){t.SUBRULE(t.version),t.AT_LEAST_ONE(function(){t.SUBRULE(t.node)}),t.MANY(function(){t.SUBRULE(t.route)})}),t.RULE("version",function(){t.CONSUME(i)}),t.RULE("node",function(){t.OPTION(function(){t.SUBRULE(t.def)}),t.CONSUME(E),t.CONSUME(r),t.MANY(function(){t.SUBRULE(t.field)}),t.CONSUME(a)}),t.RULE("field",function(){t.CONSUME(c),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(c)}},{ALT:function(){t.CONSUME(E)}}])}),t.RULE("use",function(){t.CONSUME(d),t.OR([{ALT:function(){t.CONSUME(c)}},{ALT:function(){t.CONSUME(E)}}])}),t.RULE("singleFieldValue",function(){t.AT_LEAST_ONE(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(f)}},{ALT:function(){t.CONSUME(h)}},{ALT:function(){t.CONSUME(g)}},{ALT:function(){t.CONSUME(p)}},{ALT:function(){t.CONSUME(T)}},{ALT:function(){t.CONSUME(m)}}])})}),t.RULE("multiFieldValue",function(){t.CONSUME(o),t.MANY(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(f)}},{ALT:function(){t.CONSUME(h)}},{ALT:function(){t.CONSUME(g)}},{ALT:function(){t.CONSUME(m)}}])}),t.CONSUME(u)}),t.RULE("route",function(){t.CONSUME(y),t.CONSUME(s),t.CONSUME(v),t.CONSUME2(s)}),this.performSelfAnalysis()}}class bi{constructor(e,t,i){this.a=e,this.b=t,this.c=i,this.normal=new R.Vector3}}const Xe={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};class Li extends R.Loader{constructor(e){super(e),this.animateBonePositions=!0,this.animateBoneRotations=!0,this.animateBoneScales=!0}load(e,t,i,r){const a=this,o=new R.FileLoader(a.manager);o.setPath(a.path),o.setRequestHeader(a.requestHeader),o.setWithCredentials(a.withCredentials),o.load(e,function(u){try{t(a.parse(u))}catch(c){r?r(c):console.error(c),a.manager.itemError(e)}},i,r)}parse(e){function t(p){u(p)!=="HIERARCHY"&&console.error("THREE.BVHLoader2: HIERARCHY expected.");const T=[],m=r(p,u(p),T);u(p)!=="MOTION"&&console.error("THREE.BVHLoader2: MOTION expected.");let l=u(p).split(/[\s]+/);const d=parseInt(l[1]);isNaN(d)&&console.error("THREE.BVHLoader2: Failed to read number of frames."),l=u(p).split(/[\s]+/);const y=parseFloat(l[2]);isNaN(y)&&console.error("THREE.BVHLoader2: Failed to read frame time.");for(let v=0;v<d;v++)l=u(p).split(/[\s]+/),i(l,v*y,m);return T}function i(p,T,m){if(m.type==="ENDSITE")return;const l={time:T,position:new R.Vector3,rotation:new R.Quaternion,scale:new R.Vector3(1,1,1)};m.frames.push(l);const d=new R.Quaternion,y=new R.Vector3(1,0,0),v=new R.Vector3(0,1,0),E=new R.Vector3(0,0,1);for(let S=0;S<m.channels.length;S++)switch(m.channels[S]){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(y,parseFloat(p.shift().trim())*Math.PI/180),l.rotation.multiply(d);break;case"Yrotation":d.setFromAxisAngle(v,parseFloat(p.shift().trim())*Math.PI/180),l.rotation.multiply(d);break;case"Zrotation":d.setFromAxisAngle(E,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 S=0;S<m.children.length;S++)i(p,T,m.children[S])}function r(p,T,m){const l={name:"",type:"",frames:[]};m.push(l);let d=T.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()),u(p)!=="{"&&console.error("THREE.BVHLoader2: Expected opening { after type & name"),d=u(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 y=new R.Vector3(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));if((isNaN(y.x)||isNaN(y.y)||isNaN(y.z))&&console.error("THREE.BVHLoader2: Invalid values of OFFSET."),l.offset=y,l.type!=="ENDSITE"){d=u(p).split(/[\s]+/),d[0]!=="CHANNELS"&&console.error("THREE.BVHLoader2: Expected CHANNELS definition.");const v=parseInt(d[1]);l.channels=d.splice(2,v),l.children=[]}for(;;){const v=u(p);if(v==="}")return l;l.children.push(r(p,v,m))}}function a(p,T){const m=new R.Bone;if(T.push(m),m.position.add(p.offset),m.name=p.name,p.type!=="ENDSITE")for(let l=0;l<p.children.length;l++)m.add(a(p.children[l],T));return m}function o(p){const T=[];for(let m=0;m<p.length;m++){const l=p[m];if(l.type==="ENDSITE")continue;const d=[],y=[],v=[],E=[];for(let S=0;S<l.frames.length;S++){const I=l.frames[S];d.push(I.time),y.push(I.position.x+l.offset.x),y.push(I.position.y+l.offset.y),y.push(I.position.z+l.offset.z),v.push(I.rotation.x),v.push(I.rotation.y),v.push(I.rotation.z),v.push(I.rotation.w),E.push(I.scale.x),E.push(I.scale.y),E.push(I.scale.z)}c.animateBonePositions&&T.push(new R.VectorKeyframeTrack(l.name+".position",d,y)),c.animateBoneRotations&&T.push(new R.QuaternionKeyframeTrack(l.name+".quaternion",d,v)),c.animateBoneScales&&T.push(new R.VectorKeyframeTrack(l.name+".scale",d,E))}return new R.AnimationClip("animation",-1,T)}function u(p){let T;for(;(T=p.shift().trim()).length===0;);return T}const c=this,s=e.split(/[\r\n]+/g),f=t(s),h=[];a(f[0],h);const g=o(f);return{skeleton:new R.Skeleton(h),clip:g}}}let pt;async function Si(n,e){return pt||(pt=new vi),pt.manager.setURLModifier(i=>(i.startsWith("./")&&(i=i.substring(2)),URL.createObjectURL(nr(n,i)))),await pt.loadAsync(e)}let Ot;async function Oi(n,e){Ot||(Ot=new Li);const t=Pt(n,e);return await Ot.parse(t)}function xi(n){const e=n.clip.clone(),t=n.skeleton.bones[0].clone(!0),i=[];t.traverse(a=>{a instanceof se.Bone&&i.push(a)});const r=new se.Skeleton(i);return r.calculateInverses(),{clip:e,skeleton:r}}class kt{isDummy=!0;skeleton=new se.Skeleton([new se.Bone]);clip=new se.AnimationClip("dummy")}class st extends je{bvhs={};vrmls={};ready;viewActions;currentAction;comment=null;constructor(e){super(),this.viewActions={},this.currentAction={actionRoot:new se.Object3D,boneRoot:new se.Bone},this.ready=this.asyncInit(e)}initObject(){return new se.Object3D}initMotion(){return new Ct(this)}async asyncInit(e){const t=await ln(e),i=new DOMParser,r=Pt(t,"CATALOG.XML"),a=i.parseFromString(r,"application/xml");if(a.querySelector("parsererror"))return console.error("Acerola3D.asyncInit(): CATALOG.XML parse error."),this;const o="http://acerola3d.sourceforge.jp/a3/catalog",u=a.getElementsByTagNameNS(o,"c");u[0]&&(this.comment=u[0].textContent);const c=a.getElementsByTagNameNS(o,"a"),s=[];for(const f of Array.from(c)){const h=f.getAttribute("an");if(h){const g=f.getAttribute("bvh");let p=null;if(g){const E=t.zipUrl+"!"+g;this.bvhs[E]?p=xi(this.bvhs[E]):(p=await Oi(t,g),this.bvhs[g]=p),p&&p.clip.tracks.forEach(S=>{S.setInterpolation(se.InterpolateDiscrete)})}else p=new kt;const T=f.getAttribute("scale"),m=T?Number(T):1,l=f.getAttribute("offset"),d=new Ae;if(l){const E=l.split(" ");d.set(Number(E[0]),Number(E[1]),Number(E[2]))}const y={},v=f.getElementsByTagNameNS(o,"p");for(const E of Array.from(v)){const S=E.getAttribute("name"),I=E.getAttribute("wrl");if(S&&I){let k;const H=t.zipUrl+"!"+I;this.vrmls[H]?(k=this.vrmls[H].clone(!0),y[S]=k):(k=await Si(t,I),this.vrmls[H]=k,y[S]=k)}}s.push({name:h,bvh:p,scale:m,offset:d,parts:y})}}return this.generateViewActionsFromActionSeeds(s),this.motion instanceof Ct&&this.motion.myInitialize(s),this}generateViewActionsFromActionSeeds(e){this.viewActions={};for(const t of e){const i=new se.Object3D;if(i.position.set(t.offset.x,t.offset.y,t.offset.z),i.scale.set(t.scale,t.scale,t.scale),t.bvh instanceof kt){for(const r of Object.values(t.parts))i.add(r);this.viewActions[t.name]={actionRoot:i,boneRoot:t.bvh.skeleton.bones[0].clone(!0)}}else{const r=t.bvh.skeleton.bones[0].clone(!0);i.add(r),In(r,t.parts),this.viewActions[t.name]={actionRoot:i,boneRoot:r}}i.traverse(r=>{r.userData.a3js={objectA3:this}})}}changeAction(e){this.object.remove(this.currentAction.actionRoot);const t=this.viewActions[e];this.object.add(t.actionRoot),this.currentAction=t}}function In(n,e){if(Hn(n)){const t=e[n.name];t&&n.add(t)}n.children&&n.children.forEach(t=>{In(t,e)})}class Ct extends tt{actionSeeds;motionActions;currentAction;isPaused;constructor(e){super(e),this.isPaused=!1,this.actionSeeds=[],this.motionActions={}}setObject(e){this.isPaused=!1,e instanceof st?(super.setObject(e),this.actionSeeds.length>0&&this.myInitialize([])):console.warn("Acerola3DMotion can set only Acerola3D object.")}myInitialize(e){if(!(this.objectA3 instanceof st))return;const t=[];for(const a of this.actionSeeds)t.push(a);for(const a of e)t.filter(o=>o.name===a.name).length===0&&t.push(a);this.objectA3.generateViewActionsFromActionSeeds(t),this.actionSeeds=t,this.motionActions={};for(const a of this.actionSeeds){if(a.bvh instanceof kt){this.motionActions[a.name]={bvh:a.bvh};break}const o=this.objectA3.viewActions[a.name].boneRoot,u=new se.AnimationMixer(o),c=u.clipAction(a.bvh.clip),s={bvh:a.bvh,mixer:u,clipAction:c};this.motionActions[a.name]=s}const i=this.actionSeeds[0].name;this.objectA3.changeAction(i);const r=this.motionActions[i];r.clipAction?.play(),this.currentAction=r}detachObject(e){if(!(this.objectA3 instanceof st))return;const t=this.actionSeeds[0].name;for(const i of this.actionSeeds){const r=this.motionActions[i.name];r.mixer?.stopAllAction();const a=this.objectA3.viewActions[i.name].boneRoot;a&&r.mixer?.uncacheRoot(a),delete this.motionActions[i.name]}this.objectA3.changeAction(t),super.detachObject(e)}update(e){super.update(e),this.currentAction&&!this.isPaused&&this.currentAction.mixer&&this.currentAction.mixer?.update(e)}controlMotion(e){if(!(this.objectA3 instanceof st))return;const t=this.motionActions[e];t&&(this.currentAction&&this.currentAction.clipAction?.stop(),this.objectA3.changeAction(e),t.clipAction?.play(),this.currentAction=t)}setPause(e){this.isPaused=e}setTime(e){this.currentAction?.mixer?.setTime(e)}}class Ii extends je{constructor(e){super(e)}initObject(e){return e}}class Ni extends je{constructor(...e){super(e)}initObject(e){const t=e.filter(c=>typeof c=="number"),i=e.filter(c=>typeof c=="string"),r=new se.BoxGeometry(...t),a=i.length>0?i[0]:"rgb(128,128,128)",o=new se.MeshStandardMaterial({color:a});return new se.Mesh(r,o)}}class wi extends je{constructor(...e){super(e)}initObject(e){const t=e.filter(c=>typeof c=="number"),i=e.filter(c=>typeof c=="string"),r=new se.SphereGeometry(...t),a=i.length>0?i[0]:"rgb(128,128,128)",o=new se.MeshStandardMaterial({color:a});return new se.Mesh(r,o)}}class ki extends je{constructor(e){super(e)}initObject(e){return new un(e)}}exports.Acerola3D=st;exports.Acerola3DMotion=Ct;exports.Box=Ni;exports.Camera=sn;exports.Canvas=fn;exports.ControllerBase=an;exports.GLTF=En;exports.GLTFMotion=vn;exports.GeneralCamera=ut;exports.HTML=ki;exports.Motion=tt;exports.ObjectA3=je;exports.OrbitController=cn;exports.Quat=ke;exports.RapierPhysicsEngine=lt;exports.Scene=on;exports.Sound=$e;exports.Sphere=wi;exports.Test=ur;exports.Text3D=gr;exports.ThreeJS=Ii;exports.Vec3=Ae;exports.ViewBase=Dt;exports.Window=dn;exports.asyncSleep=tr;exports.deepMerge=yt;exports.getQuatOfLookAt=ct;exports.initFont=yr;exports.initPhysics=$n;exports.initSound=sr;exports.vec3EulerToQuat=tn;
|
|
219
|
+
Please avoid using it as it will be completely removed in the future`)}n.clearCache=u;var b=Ho();Object.defineProperty(n,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return b.createSyntaxDiagramsCode}});var d=(function(){function E(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
|
|
220
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return E})();n.Parser=d});const dt=jo();class qo extends I.Loader{constructor(e){super(e)}load(e,t,r,i){const s=this,o=s.path===""?I.LoaderUtils.extractUrlBase(e):s.path,c=new I.FileLoader(s.manager);c.setPath(s.path),c.setRequestHeader(s.requestHeader),c.setWithCredentials(s.withCredentials),c.load(e,function(A){try{t(s.parse(A,o))}catch(a){i?i(a):console.error(a),s.manager.itemError(e)}},r,i)}parse(e,t){const r={};function i(R){const B=s(),T=new Ko(B.tokens),x=new Vo(B.tokenVocabulary),Q=o(x.getBaseCstVisitorConstructor()),N=T.lex(R);x.input=N.tokens;const O=x.vrml();if(x.errors.length>0)throw console.error(x.errors),Error("THREE.VRMLLoader2: Parsing errors detected.");return Q.visit(O)}function s(){const R=dt.createToken,B=R({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]*/}),T=R({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:B}),x=["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"],Q=R({name:"Version",pattern:/#VRML.*/,longer_alt:T}),N=R({name:"NodeName",pattern:new RegExp(x.join("|")),longer_alt:T}),O=R({name:"DEF",pattern:/DEF/,longer_alt:T}),G=R({name:"USE",pattern:/USE/,longer_alt:T}),K=R({name:"ROUTE",pattern:/ROUTE/,longer_alt:T}),$=R({name:"TO",pattern:/TO/,longer_alt:T}),oe=R({name:"StringLiteral",pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),Ee=R({name:"HexLiteral",pattern:/0[xX][0-9a-fA-F]+/}),ve=R({name:"NumberLiteral",pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),Fe=R({name:"TrueLiteral",pattern:/TRUE/}),Se=R({name:"FalseLiteral",pattern:/FALSE/}),be=R({name:"NullLiteral",pattern:/NULL/}),Be=R({name:"LSquare",pattern:/\[/}),Le=R({name:"RSquare",pattern:/]/}),Ne=R({name:"LCurly",pattern:/{/}),Qe=R({name:"RCurly",pattern:/}/}),Oe=R({name:"Comment",pattern:/#.*/,group:dt.Lexer.SKIPPED}),He=[R({name:"WhiteSpace",pattern:/[ ,\s]/,group:dt.Lexer.SKIPPED}),N,O,G,K,$,Fe,Se,be,Q,T,B,oe,Ee,ve,Be,Le,Ne,Qe,Oe],je={};for(let Re=0,ue=He.length;Re<ue;Re++){const he=He[Re];je[he.name]=he}return{tokens:He,tokenVocabulary:je}}function o(R){class B extends R{constructor(){super(),this.validateVisitor()}vrml(Q){const N={version:this.visit(Q.version),nodes:[],routes:[]};for(let O=0,G=Q.node.length;O<G;O++){const K=Q.node[O];N.nodes.push(this.visit(K))}if(Q.route)for(let O=0,G=Q.route.length;O<G;O++){const K=Q.route[O];N.routes.push(this.visit(K))}return N}version(Q){return Q.Version[0].image}node(Q){const N={name:Q.NodeName[0].image,fields:[]};if(Q.field)for(let O=0,G=Q.field.length;O<G;O++){const K=Q.field[O];N.fields.push(this.visit(K))}return Q.def&&(N.DEF=this.visit(Q.def[0])),N}field(Q){const N={name:Q.Identifier[0].image,type:null,values:null};let O;return Q.singleFieldValue&&(O=this.visit(Q.singleFieldValue[0])),Q.multiFieldValue&&(O=this.visit(Q.multiFieldValue[0])),N.type=O.type,N.values=O.values,N}def(Q){return(Q.Identifier||Q.NodeName)[0].image}use(Q){return{USE:(Q.Identifier||Q.NodeName)[0].image}}singleFieldValue(Q){return T(this,Q)}multiFieldValue(Q){return T(this,Q)}route(Q){return{FROM:Q.RouteIdentifier[0].image,TO:Q.RouteIdentifier[1].image}}}function T(x,Q){const N={type:null,values:[]};if(Q.node){N.type="node";for(let O=0,G=Q.node.length;O<G;O++){const K=Q.node[O];N.values.push(x.visit(K))}}if(Q.use){N.type="use";for(let O=0,G=Q.use.length;O<G;O++){const K=Q.use[O];N.values.push(x.visit(K))}}if(Q.StringLiteral){N.type="string";for(let O=0,G=Q.StringLiteral.length;O<G;O++){const K=Q.StringLiteral[O];N.values.push(K.image.replace(/'|"/g,""))}}if(Q.NumberLiteral){N.type="number";for(let O=0,G=Q.NumberLiteral.length;O<G;O++){const K=Q.NumberLiteral[O];N.values.push(parseFloat(K.image))}}if(Q.HexLiteral){N.type="hex";for(let O=0,G=Q.HexLiteral.length;O<G;O++){const K=Q.HexLiteral[O];N.values.push(K.image)}}if(Q.TrueLiteral){N.type="boolean";for(let O=0,G=Q.TrueLiteral.length;O<G;O++)Q.TrueLiteral[O].image==="TRUE"&&N.values.push(!0)}if(Q.FalseLiteral){N.type="boolean";for(let O=0,G=Q.FalseLiteral.length;O<G;O++)Q.FalseLiteral[O].image==="FALSE"&&N.values.push(!1)}return Q.NullLiteral&&(N.type="null",Q.NullLiteral.forEach(function(){N.values.push(null)})),N}return new B}function c(R){const B=R.nodes,T=new I.Scene;for(let x=0,Q=B.length;x<Q;x++){const N=B[x];A(N)}for(let x=0,Q=B.length;x<Q;x++){const N=B[x],O=a(N);O instanceof I.Object3D&&T.add(O),N.name==="WorldInfo"&&(T.userData.worldInfo=O)}return T}function A(R){R.DEF&&(r[R.DEF]=R);const B=R.fields;for(let T=0,x=B.length;T<x;T++){const Q=B[T];if(Q.type==="node"){const N=Q.values;for(let O=0,G=N.length;O<G;O++)A(N[O])}}}function a(R){return R.USE?W(R.USE):(R.build!==void 0||(R.build=f(R)),R.build)}function f(R){const B=R.name;let T;switch(B){case"Anchor":case"Group":case"Transform":case"Collision":T=u(R);break;case"Background":T=b(R);break;case"Shape":T=d(R);break;case"Appearance":T=E(R);break;case"Material":T=g(R);break;case"ImageTexture":T=C(R);break;case"PixelTexture":T=p(R);break;case"TextureTransform":T=m(R);break;case"IndexedFaceSet":T=S(R);break;case"IndexedLineSet":T=U(R);break;case"PointSet":T=w(R);break;case"Box":T=M(R);break;case"Cone":T=_(R);break;case"Cylinder":T=k(R);break;case"Sphere":T=D(R);break;case"ElevationGrid":T=L(R);break;case"Extrusion":T=V(R);break;case"Color":case"Coordinate":case"Normal":case"TextureCoordinate":T=y(R);break;case"WorldInfo":T=v(R);break;case"Billboard":case"Inline":case"LOD":case"Switch":case"AudioClip":case"DirectionalLight":case"PointLight":case"Script":case"Sound":case"SpotLight":case"CylinderSensor":case"PlaneSensor":case"ProximitySensor":case"SphereSensor":case"TimeSensor":case"TouchSensor":case"VisibilitySensor":case"Text":case"FontStyle":case"MovieTexture":case"ColorInterpolator":case"CoordinateInterpolator":case"NormalInterpolator":case"OrientationInterpolator":case"PositionInterpolator":case"ScalarInterpolator":case"Fog":case"NavigationInfo":case"Viewpoint":break;default:console.warn("THREE.VRMLLoader2: Unknown node:",B);break}return T!==void 0&&R.DEF!==void 0&&T.hasOwnProperty("name")===!0&&(T.name=R.DEF),T}function u(R){const B=new I.Group,T=R.fields;for(let x=0,Q=T.length;x<Q;x++){const N=T[x],O=N.name,G=N.values;switch(O){case"bboxCenter":break;case"bboxSize":break;case"center":break;case"children":j(G,B);break;case"description":break;case"collide":break;case"parameter":break;case"rotation":const K=new I.Vector3(G[0],G[1],G[2]).normalize(),$=G[3];B.quaternion.setFromAxisAngle(K,$);break;case"scale":B.scale.set(G[0],G[1],G[2]);break;case"scaleOrientation":break;case"translation":B.position.set(G[0],G[1],G[2]);break;case"proxy":break;case"url":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",O);break}}return B}function b(R){const B=new I.Group;let T,x,Q,N;const O=R.fields;for(let K=0,$=O.length;K<$;K++){const oe=O[K],Ee=oe.name,ve=oe.values;switch(Ee){case"groundAngle":T=ve;break;case"groundColor":x=ve;break;case"backUrl":break;case"bottomUrl":break;case"frontUrl":break;case"leftUrl":break;case"rightUrl":break;case"topUrl":break;case"skyAngle":Q=ve;break;case"skyColor":N=ve;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Ee);break}}const G=1e4;if(N){const K=new I.SphereGeometry(G,32,16),$=new I.MeshBasicMaterial({fog:!1,side:I.BackSide,depthWrite:!1,depthTest:!1});N.length>3?(q(K,G,Q,F(N),!0),$.vertexColors=!0):$.color.setRGB(N[0],N[1],N[2],I.SRGBColorSpace);const oe=new I.Mesh(K,$);B.add(oe)}if(x&&x.length>0){const K=new I.SphereGeometry(G,32,16,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),$=new I.MeshBasicMaterial({fog:!1,side:I.BackSide,vertexColors:!0,depthWrite:!1,depthTest:!1});q(K,G,T,F(x),!1);const oe=new I.Mesh(K,$);B.add(oe)}return B.renderOrder=-1/0,B}function d(R){const B=R.fields;let T=new I.MeshBasicMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:0}),x;for(let N=0,O=B.length;N<O;N++){const G=B[N],K=G.name,$=G.values;switch(K){case"appearance":$[0]!==null&&(T=a($[0]));break;case"geometry":$[0]!==null&&(x=a($[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",K);break}}let Q;if(x&&x.attributes.position){const N=x._type;if(N==="points"){const O=new I.PointsMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:T.opacity,transparent:T.transparent});x.attributes.color!==void 0?O.vertexColors=!0:T.isMeshPhongMaterial&&O.color.copy(T.emissive),Q=new I.Points(x,O)}else if(N==="line"){const O=new I.LineBasicMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:16777215,opacity:T.opacity,transparent:T.transparent});x.attributes.color!==void 0?O.vertexColors=!0:T.isMeshPhongMaterial&&O.color.copy(T.emissive),Q=new I.LineSegments(x,O)}else x._solid!==void 0&&(T.side=x._solid?I.FrontSide:I.DoubleSide),x.attributes.color!==void 0&&(T.vertexColors=!0),Q=new I.Mesh(x,T)}else Q=new I.Object3D,Q.visible=!1;return Q}function E(R){let B=new I.MeshPhongMaterial,T;const x=R.fields;for(let Q=0,N=x.length;Q<N;Q++){const O=x[Q],G=O.name,K=O.values;switch(G){case"material":if(K[0]!==null){const oe=a(K[0]);oe.diffuseColor&&B.color.copy(oe.diffuseColor),oe.emissiveColor&&B.emissive.copy(oe.emissiveColor),oe.shininess&&(B.shininess=oe.shininess),oe.specularColor&&B.specular.copy(oe.specularColor),oe.transparency&&(B.opacity=1-oe.transparency),oe.transparency>0&&(B.transparent=!0)}else B=new I.MeshBasicMaterial({name:I.Loader.DEFAULT_MATERIAL_NAME,color:0});break;case"texture":const $=K[0];$!==null&&($.name==="ImageTexture"||$.name==="PixelTexture"||$.USE)&&(B.map=a($));break;case"textureTransform":K[0]!==null&&(T=a(K[0]));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",G);break}}if(B.map){if(B.map.__type){switch(B.map.__type){case Xe.INTENSITY_ALPHA:B.opacity=1;break;case Xe.RGB:B.color.set(16777215);break;case Xe.RGBA:B.color.set(16777215),B.opacity=1;break}delete B.map.__type}T&&(B.map.center.copy(T.center),B.map.rotation=T.rotation,B.map.repeat.copy(T.scale),B.map.offset.copy(T.translation))}return B}function g(R){const B={},T=R.fields;for(let x=0,Q=T.length;x<Q;x++){const N=T[x],O=N.name,G=N.values;switch(O){case"ambientIntensity":break;case"diffuseColor":B.diffuseColor=new I.Color().setRGB(G[0],G[1],G[2],I.SRGBColorSpace);break;case"emissiveColor":B.emissiveColor=new I.Color().setRGB(G[0],G[1],G[2],I.SRGBColorSpace);break;case"shininess":B.shininess=G[0];break;case"specularColor":B.specularColor=new I.Color().setRGB(G[0],G[1],G[2],I.SRGBColorSpace);break;case"transparency":B.transparency=G[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",O);break}}return B}function l(R,B,T){let x;switch(B){case Xe.INTENSITY:x=parseInt(R),T.r=x,T.g=x,T.b=x,T.a=1;break;case Xe.INTENSITY_ALPHA:x=parseInt("0x"+R.substring(2,4)),T.r=x,T.g=x,T.b=x,T.a=parseInt("0x"+R.substring(4,6));break;case Xe.RGB:T.r=parseInt("0x"+R.substring(2,4)),T.g=parseInt("0x"+R.substring(4,6)),T.b=parseInt("0x"+R.substring(6,8)),T.a=1;break;case Xe.RGBA:T.r=parseInt("0x"+R.substring(2,4)),T.g=parseInt("0x"+R.substring(4,6)),T.b=parseInt("0x"+R.substring(6,8)),T.a=parseInt("0x"+R.substring(8,10));break}}function h(R){let B;switch(R){case 1:B=Xe.INTENSITY;break;case 2:B=Xe.INTENSITY_ALPHA;break;case 3:B=Xe.RGB;break;case 4:B=Xe.RGBA;break}return B}function p(R){let B,T=I.RepeatWrapping,x=I.RepeatWrapping;const Q=R.fields;for(let N=0,O=Q.length;N<O;N++){const G=Q[N],K=G.name,$=G.values;switch(K){case"image":const oe=$[0],Ee=$[1],ve=$[2],Fe=h(ve),Se=new Uint8Array(4*oe*Ee),be={r:0,g:0,b:0,a:0};for(let Be=3,Le=0,Ne=$.length;Be<Ne;Be++,Le++){l($[Be],Fe,be);const Qe=Le*4;Se[Qe+0]=be.r,Se[Qe+1]=be.g,Se[Qe+2]=be.b,Se[Qe+3]=be.a}B=new I.DataTexture(Se,oe,Ee),B.colorSpace=I.SRGBColorSpace,B.needsUpdate=!0,B.__type=Fe;break;case"repeatS":$[0]===!1&&(T=I.ClampToEdgeWrapping);break;case"repeatT":$[0]===!1&&(x=I.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",K);break}}return B&&(B.wrapS=T,B.wrapT=x),B}function C(R){let B,T=I.RepeatWrapping,x=I.RepeatWrapping;const Q=R.fields;for(let N=0,O=Q.length;N<O;N++){const G=Q[N],K=G.name,$=G.values;switch(K){case"url":const oe=$[0];oe&&(B=ne.load(oe));break;case"repeatS":$[0]===!1&&(T=I.ClampToEdgeWrapping);break;case"repeatT":$[0]===!1&&(x=I.ClampToEdgeWrapping);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",K);break}}return B&&(B.wrapS=T,B.wrapT=x,B.colorSpace=I.SRGBColorSpace),B}function m(R){const B={center:new I.Vector2,rotation:new I.Vector2,scale:new I.Vector2,translation:new I.Vector2},T=R.fields;for(let x=0,Q=T.length;x<Q;x++){const N=T[x],O=N.name,G=N.values;switch(O){case"center":B.center.set(G[0],G[1]);break;case"rotation":B.rotation=G[0];break;case"scale":B.scale.set(G[0],G[1]);break;case"translation":B.translation.set(G[0],G[1]);break;default:console.warn("THREE.VRMLLoader2: Unknown field:",O);break}}return B}function y(R){return R.fields[0].values}function v(R){const B={},T=R.fields;for(let x=0,Q=T.length;x<Q;x++){const N=T[x],O=N.name,G=N.values;switch(O){case"title":B.title=G[0];break;case"info":B.info=G;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",O);break}}return B}function S(R){let B,T,x,Q,N=!0,O=!0,G=0,K,$,oe,Ee,ve=!0,Fe=!0;const Se=R.fields;for(let xe=0,He=Se.length;xe<He;xe++){const je=Se[xe],Re=je.name,ue=je.values;switch(Re){case"color":const he=ue[0];he!==null&&(B=a(he));break;case"coord":const ce=ue[0];ce!==null&&(T=a(ce));break;case"normal":const fe=ue[0];fe!==null&&(x=a(fe));break;case"texCoord":const pe=ue[0];pe!==null&&(Q=a(pe));break;case"ccw":N=ue[0];break;case"colorIndex":K=ue;break;case"colorPerVertex":ve=ue[0];break;case"convex":break;case"coordIndex":$=ue;break;case"creaseAngle":G=ue[0];break;case"normalIndex":oe=ue;break;case"normalPerVertex":Fe=ue[0];break;case"solid":O=ue[0];break;case"texCoordIndex":Ee=ue;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Re);break}}if($===void 0)return console.warn("THREE.VRMLLoader2: Missing coordIndex."),new I.BufferGeometry;const be=J($,N);let Be,Le,Ne;if(B){if(ve===!0)if(K&&K.length>0){const xe=J(K,N);Be=te(be,xe,B,3)}else Be=ge(be,new I.Float32BufferAttribute(B,3));else if(K&&K.length>0){const xe=Ae(B,K),He=Z(xe,$);Be=ae(be,He)}else{const xe=Z(B,$);Be=ae(be,xe)}Y(Be)}if(x)if(Fe===!0)if(oe&&oe.length>0){const xe=J(oe,N);Le=te(be,xe,x,3)}else Le=ge(be,new I.Float32BufferAttribute(x,3));else if(oe&&oe.length>0){const xe=Ae(x,oe),He=Z(xe,$);Le=ae(be,He)}else{const xe=Z(x,$);Le=ae(be,xe)}else Le=Ve(be,T,G);if(Q)if(Ee&&Ee.length>0){const xe=J(Ee,N);Ne=te(be,xe,Q,2)}else Ne=ge(be,new I.Float32BufferAttribute(Q,2));const Qe=new I.BufferGeometry,Oe=ge(be,new I.Float32BufferAttribute(T,3));return Qe.setAttribute("position",Oe),Qe.setAttribute("normal",Le),Be&&Qe.setAttribute("color",Be),Ne&&Qe.setAttribute("uv",Ne),Qe._solid=O,Qe._type="mesh",Qe}function U(R){let B,T,x,Q,N=!0;const O=R.fields;for(let Ee=0,ve=O.length;Ee<ve;Ee++){const Fe=O[Ee],Se=Fe.name,be=Fe.values;switch(Se){case"color":const Be=be[0];Be!==null&&(B=a(Be));break;case"coord":const Le=be[0];Le!==null&&(T=a(Le));break;case"colorIndex":x=be;break;case"colorPerVertex":N=be[0];break;case"coordIndex":Q=be;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",Se);break}}let G;const K=ie(Q);if(B){if(N===!0)if(x.length>0){const Ee=ie(x);G=te(K,Ee,B,3)}else G=ge(K,new I.Float32BufferAttribute(B,3));else if(x.length>0){const Ee=Ae(B,x),ve=re(Ee,Q);G=me(K,ve)}else{const Ee=re(B,Q);G=me(K,Ee)}Y(G)}const $=new I.BufferGeometry,oe=ge(K,new I.Float32BufferAttribute(T,3));return $.setAttribute("position",oe),G&&$.setAttribute("color",G),$._type="line",$}function w(R){let B,T;const x=R.fields;for(let N=0,O=x.length;N<O;N++){const G=x[N],K=G.name,$=G.values;switch(K){case"color":const oe=$[0];oe!==null&&(B=a(oe));break;case"coord":const Ee=$[0];Ee!==null&&(T=a(Ee));break;default:console.warn("THREE.VRMLLoader2: Unknown field:",K);break}}const Q=new I.BufferGeometry;if(Q.setAttribute("position",new I.Float32BufferAttribute(T,3)),B){const N=new I.Float32BufferAttribute(B,3);Y(N),Q.setAttribute("color",N)}return Q._type="points",Q}function M(R){const B=new I.Vector3(2,2,2),T=R.fields;for(let Q=0,N=T.length;Q<N;Q++){const O=T[Q],G=O.name,K=O.values;G==="size"?(B.x=K[0],B.y=K[1],B.z=K[2]):console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new I.BoxGeometry(B.x,B.y,B.z)}function _(R){let B=1,T=2,x=!1;const Q=R.fields;for(let O=0,G=Q.length;O<G;O++){const K=Q[O],$=K.name,oe=K.values;switch($){case"bottom":x=!oe[0];break;case"bottomRadius":B=oe[0];break;case"height":T=oe[0];break;case"side":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",$);break}}return new I.ConeGeometry(B,T,16,1,x)}function k(R){let B=1,T=2;const x=R.fields;for(let N=0,O=x.length;N<O;N++){const G=x[N],K=G.name,$=G.values;switch(K){case"bottom":break;case"radius":B=$[0];break;case"height":T=$[0];break;case"side":break;case"top":break;default:console.warn("THREE.VRMLLoader2: Unknown field:",K);break}}return new I.CylinderGeometry(B,B,T,16,1)}function D(R){let B=1;const T=R.fields;for(let Q=0,N=T.length;Q<N;Q++){const O=T[Q],G=O.name,K=O.values;G==="radius"?B=K[0]:console.warn("THREE.VRMLLoader2: Unknown field:",G)}return new I.SphereGeometry(B,16,16)}function L(R){let B,T,x,Q,N=!0,O=!0,G=!0,K=!0,$=0,oe=2,Ee=2,ve=1,Fe=1;const Se=R.fields;for(let ue=0,he=Se.length;ue<he;ue++){const ce=Se[ue],fe=ce.name,pe=ce.values;switch(fe){case"color":const De=pe[0];De!==null&&(B=a(De));break;case"normal":const et=pe[0];et!==null&&(T=a(et));break;case"texCoord":const tt=pe[0];tt!==null&&(x=a(tt));break;case"height":Q=pe;break;case"ccw":K=pe[0];break;case"colorPerVertex":N=pe[0];break;case"creaseAngle":$=pe[0];break;case"normalPerVertex":O=pe[0];break;case"solid":G=pe[0];break;case"xDimension":oe=pe[0];break;case"xSpacing":ve=pe[0];break;case"zDimension":Ee=pe[0];break;case"zSpacing":Fe=pe[0];break;default:console.warn("THREE.VRMLLoader2: Unknown field:",fe);break}}const be=[],Be=[],Le=[],Ne=[];for(let ue=0;ue<Ee;ue++)for(let he=0;he<oe;he++){const ce=ue*oe+he,fe=ve*ue,pe=Q[ce],De=Fe*he;if(be.push(fe,pe,De),B&&N===!0){const et=B[ce*3+0],tt=B[ce*3+1],St=B[ce*3+2];Le.push(et,tt,St)}if(T&&O===!0){const et=T[ce*3+0],tt=T[ce*3+1],St=T[ce*3+2];Be.push(et,tt,St)}if(x){const et=x[ce*2+0],tt=x[ce*2+1];Ne.push(et,tt)}else Ne.push(ue/(oe-1),he/(Ee-1))}const Qe=[];for(let ue=0;ue<oe-1;ue++)for(let he=0;he<Ee-1;he++){const ce=ue+he*oe,fe=ue+(he+1)*oe,pe=ue+1+(he+1)*oe,De=ue+1+he*oe;K===!0?(Qe.push(ce,pe,fe),Qe.push(pe,ce,De)):(Qe.push(ce,fe,pe),Qe.push(pe,De,ce))}const Oe=ge(Qe,new I.Float32BufferAttribute(be,3)),xe=ge(Qe,new I.Float32BufferAttribute(Ne,2));let He,je;if(B){if(N===!1){for(let ue=0;ue<oe-1;ue++)for(let he=0;he<Ee-1;he++){const ce=ue+he*(oe-1),fe=B[ce*3+0],pe=B[ce*3+1],De=B[ce*3+2];Le.push(fe,pe,De),Le.push(fe,pe,De),Le.push(fe,pe,De),Le.push(fe,pe,De),Le.push(fe,pe,De),Le.push(fe,pe,De)}He=new I.Float32BufferAttribute(Le,3)}else He=ge(Qe,new I.Float32BufferAttribute(Le,3));Y(He)}if(T)if(O===!1){for(let ue=0;ue<oe-1;ue++)for(let he=0;he<Ee-1;he++){const ce=ue+he*(oe-1),fe=T[ce*3+0],pe=T[ce*3+1],De=T[ce*3+2];Be.push(fe,pe,De),Be.push(fe,pe,De),Be.push(fe,pe,De),Be.push(fe,pe,De),Be.push(fe,pe,De),Be.push(fe,pe,De)}je=new I.Float32BufferAttribute(Be,3)}else je=ge(Qe,new I.Float32BufferAttribute(Be,3));else je=Ve(Qe,be,$);const Re=new I.BufferGeometry;return Re.setAttribute("position",Oe),Re.setAttribute("normal",je),Re.setAttribute("uv",xe),He&&Re.setAttribute("color",He),Re._solid=G,Re._type="mesh",Re}function V(R){let B=[1,1,1,-1,-1,-1,-1,1,1,1],T=[0,0,0,0,1,0],x,Q,N=!0,O=!0,G=0,K=!0,$=!0;const oe=R.fields;for(let Re=0,ue=oe.length;Re<ue;Re++){const he=oe[Re],ce=he.name,fe=he.values;switch(ce){case"beginCap":N=fe[0];break;case"ccw":O=fe[0];break;case"convex":break;case"creaseAngle":G=fe[0];break;case"crossSection":B=fe;break;case"endCap":K=fe[0];break;case"orientation":Q=fe;break;case"scale":x=fe;break;case"solid":$=fe[0];break;case"spine":T=fe;break;default:console.warn("THREE.VRMLLoader2: Unknown field:",ce);break}}const Ee=B[0]===B[B.length-2]&&B[1]===B[B.length-1],ve=[],Fe=new I.Vector3,Se=new I.Vector3,be=new I.Vector3,Be=new I.Vector3,Le=new I.Quaternion;for(let Re=0,ue=0,he=0,ce=T.length;Re<ce;Re+=3,ue+=2,he+=4){Fe.fromArray(T,Re),Se.x=x?x[ue+0]:1,Se.y=1,Se.z=x?x[ue+1]:1,be.x=Q?Q[he+0]:0,be.y=Q?Q[he+1]:0,be.z=Q?Q[he+2]:1;const fe=Q?Q[he+3]:0;for(let pe=0,De=B.length;pe<De;pe+=2)Be.x=B[pe+0],Be.y=0,Be.z=B[pe+1],Be.multiply(Se),Le.setFromAxisAngle(be,fe),Be.applyQuaternion(Le),Be.add(Fe),ve.push(Be.x,Be.y,Be.z)}const Ne=[],Qe=T.length/3,Oe=B.length/2;for(let Re=0;Re<Qe-1;Re++)for(let ue=0;ue<Oe-1;ue++){const he=ue+Re*Oe;let ce=ue+1+Re*Oe;const fe=ue+(Re+1)*Oe;let pe=ue+1+(Re+1)*Oe;ue===Oe-2&&Ee===!0&&(ce=Re*Oe,pe=(Re+1)*Oe),O===!0?(Ne.push(he,ce,fe),Ne.push(fe,ce,pe)):(Ne.push(he,fe,ce),Ne.push(fe,pe,ce))}if(N===!0||K===!0){const Re=[];for(let ce=0,fe=B.length;ce<fe;ce+=2)Re.push(new I.Vector2(B[ce],B[ce+1]));const ue=I.ShapeUtils.triangulateShape(Re,[]),he=[];for(let ce=0,fe=ue.length;ce<fe;ce++){const pe=ue[ce];he.push(pe[0],pe[1],pe[2])}if(N===!0)for(let ce=0,fe=he.length;ce<fe;ce+=3)O===!0?Ne.push(he[ce+0],he[ce+1],he[ce+2]):Ne.push(he[ce+0],he[ce+2],he[ce+1]);if(K===!0){const ce=Oe*(Qe-1);for(let fe=0,pe=he.length;fe<pe;fe+=3)O===!0?Ne.push(ce+he[fe+0],ce+he[fe+2],ce+he[fe+1]):Ne.push(ce+he[fe+0],ce+he[fe+1],ce+he[fe+2])}}const xe=ge(Ne,new I.Float32BufferAttribute(ve,3)),He=Ve(Ne,ve,G),je=new I.BufferGeometry;return je.setAttribute("position",xe),je.setAttribute("normal",He),je._solid=$,je._type="mesh",je}function W(R){const B=r[R],T=a(B);return T.isObject3D||T.isMaterial?T.clone():T}function j(R,B){for(let T=0,x=R.length;T<x;T++){const Q=a(R[T]);Q instanceof I.Object3D&&B.add(Q)}}function J(R,B){const T=[];let x=0;for(let Q=0,N=R.length;Q<N;Q++){const O=R[x],G=R[Q+(B?1:2)],K=R[Q+(B?2:1)];T.push(O,G,K),(R[Q+3]===-1||Q+3>=N)&&(Q+=3,x=Q+1)}return T}function Z(R,B){const T=[];let x=0;for(let Q=0,N=B.length;Q<N;Q++){const O=x*3,G=R[O],K=R[O+1],$=R[O+2];T.push(G,K,$),(B[Q+3]===-1||Q+3>=N)&&(Q+=3,x++)}return T}function Ae(R,B){const T=[];for(let x=0,Q=B.length;x<Q;x++){const O=B[x]*3,G=R[O],K=R[O+1],$=R[O+2];T.push(G,K,$)}return T}function ie(R){const B=[];for(let T=0,x=R.length;T<x;T++){const Q=R[T],N=R[T+1];B.push(Q,N),(R[T+2]===-1||T+2>=x)&&(T+=2)}return B}function re(R,B){const T=[];let x=0;for(let Q=0,N=B.length;Q<N;Q++){const O=x*3,G=R[O],K=R[O+1],$=R[O+2];T.push(G,K,$),(B[Q+2]===-1||Q+2>=N)&&(Q+=2,x++)}return T}const ee=new I.Vector3,le=new I.Vector3,P=new I.Vector3,H=new I.Vector2,z=new I.Vector2,X=new I.Vector2;function te(R,B,T,x){const Q=[];for(let N=0,O=R.length;N<O;N+=3){const G=B[N],K=B[N+1],$=B[N+2];x===2?(H.fromArray(T,G*x),z.fromArray(T,K*x),X.fromArray(T,$*x),Q.push(H.x,H.y),Q.push(z.x,z.y),Q.push(X.x,X.y)):(ee.fromArray(T,G*x),le.fromArray(T,K*x),P.fromArray(T,$*x),Q.push(ee.x,ee.y,ee.z),Q.push(le.x,le.y,le.z),Q.push(P.x,P.y,P.z))}return new I.Float32BufferAttribute(Q,x)}function ae(R,B){const T=[];for(let x=0,Q=0,N=R.length;x<N;x+=3,Q++)ee.fromArray(B,Q*3),T.push(ee.x,ee.y,ee.z),T.push(ee.x,ee.y,ee.z),T.push(ee.x,ee.y,ee.z);return new I.Float32BufferAttribute(T,3)}function me(R,B){const T=[];for(let x=0,Q=0,N=R.length;x<N;x+=2,Q++)ee.fromArray(B,Q*3),T.push(ee.x,ee.y,ee.z),T.push(ee.x,ee.y,ee.z);return new I.Float32BufferAttribute(T,3)}function ge(R,B){const T=B.array,x=B.itemSize,Q=new T.constructor(R.length*x);let N=0,O=0;for(let G=0,K=R.length;G<K;G++){N=R[G]*x;for(let $=0;$<x;$++)Q[O++]=T[N++]}return new I.Float32BufferAttribute(Q,x)}const _e=new I.Vector3,Ge=new I.Vector3;function Ve(R,B,T){const x=[],Q={};for(let O=0,G=R.length;O<G;O+=3){const K=R[O],$=R[O+1],oe=R[O+2],Ee=new Yo(K,$,oe);ee.fromArray(B,K*3),le.fromArray(B,$*3),P.fromArray(B,oe*3),Ge.subVectors(P,le),_e.subVectors(ee,le),Ge.cross(_e),Ge.normalize(),Ee.normal.copy(Ge),Q[K]===void 0&&(Q[K]=[]),Q[$]===void 0&&(Q[$]=[]),Q[oe]===void 0&&(Q[oe]=[]),Q[K].push(Ee.normal),Q[$].push(Ee.normal),Q[oe].push(Ee.normal),x.push(Ee)}const N=[];for(let O=0,G=x.length;O<G;O++){const K=x[O],$=Pe(Q[K.a],K.normal,T),oe=Pe(Q[K.b],K.normal,T),Ee=Pe(Q[K.c],K.normal,T);ee.fromArray(B,K.a*3),le.fromArray(B,K.b*3),P.fromArray(B,K.c*3),N.push($.x,$.y,$.z),N.push(oe.x,oe.y,oe.z),N.push(Ee.x,Ee.y,Ee.z)}return new I.Float32BufferAttribute(N,3)}function Pe(R,B,T){const x=new I.Vector3;if(T===0)x.copy(B);else for(let Q=0,N=R.length;Q<N;Q++)R[Q].angleTo(B)<T&&x.add(R[Q]);return x.normalize()}function F(R){const B=[];for(let T=0,x=R.length;T<x;T+=3)B.push(new I.Color(R[T],R[T+1],R[T+2]));return B}function Y(R){const B=new I.Color;for(let T=0;T<R.count;T++)B.fromBufferAttribute(R,T),I.ColorManagement.colorSpaceToWorking(B,I.SRGBColorSpace),R.setXYZ(T,B.r,B.g,B.b)}function q(R,B,T,x,Q){const N=[],O=Q===!0?0:Math.PI;for(let ve=0,Fe=x.length;ve<Fe;ve++){let Se=ve===0?0:T[ve-1];Se=Q===!0?Se:O-Se;const be=new I.Vector3;be.setFromSphericalCoords(B,Se,0),N.push(be)}const G=R.index,K=R.attributes.position,$=new I.BufferAttribute(new Float32Array(R.attributes.position.count*3),3),oe=new I.Vector3,Ee=new I.Color;for(let ve=0;ve<G.count;ve++){const Fe=G.getX(ve);oe.fromBufferAttribute(K,Fe);let Se,be,Be=1;for(let Qe=1;Qe<N.length;Qe++){Se=Qe-1,be=Qe;const Oe=N[Se],xe=N[be];if(Q===!0){if(oe.y<=Oe.y&&oe.y>xe.y){Be=Math.abs(Oe.y-oe.y)/Math.abs(Oe.y-xe.y);break}}else if(oe.y>=Oe.y&&oe.y<xe.y){Be=Math.abs(Oe.y-oe.y)/Math.abs(Oe.y-xe.y);break}}const Le=x[Se],Ne=x[be];Ee.copy(Le).lerp(Ne,Be),I.ColorManagement.colorSpaceToWorking(Ee,I.SRGBColorSpace),$.setXYZ(Fe,Ee.r,Ee.g,Ee.b)}R.setAttribute("color",$)}const ne=new I.TextureLoader(this.manager);if(ne.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),e.indexOf("#VRML V2.0")===-1)throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");const de=i(e);return c(de)}}class Ko{constructor(e){this.lexer=new dt.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 zo=dt.CstParser;class Vo extends zo{constructor(e){super(e);const t=this,r=e.Version,i=e.LCurly,s=e.RCurly,o=e.LSquare,c=e.RSquare,A=e.Identifier,a=e.RouteIdentifier,f=e.StringLiteral,u=e.HexLiteral,b=e.NumberLiteral,d=e.TrueLiteral,E=e.FalseLiteral,g=e.NullLiteral,l=e.DEF,h=e.USE,p=e.ROUTE,C=e.TO,m=e.NodeName;t.RULE("vrml",function(){t.SUBRULE(t.version),t.AT_LEAST_ONE(function(){t.SUBRULE(t.node)}),t.MANY(function(){t.SUBRULE(t.route)})}),t.RULE("version",function(){t.CONSUME(r)}),t.RULE("node",function(){t.OPTION(function(){t.SUBRULE(t.def)}),t.CONSUME(m),t.CONSUME(i),t.MANY(function(){t.SUBRULE(t.field)}),t.CONSUME(s)}),t.RULE("field",function(){t.CONSUME(A),t.OR2([{ALT:function(){t.SUBRULE(t.singleFieldValue)}},{ALT:function(){t.SUBRULE(t.multiFieldValue)}}])}),t.RULE("def",function(){t.CONSUME(l),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(m)}}])}),t.RULE("use",function(){t.CONSUME(h),t.OR([{ALT:function(){t.CONSUME(A)}},{ALT:function(){t.CONSUME(m)}}])}),t.RULE("singleFieldValue",function(){t.AT_LEAST_ONE(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(f)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(b)}},{ALT:function(){t.CONSUME(d)}},{ALT:function(){t.CONSUME(E)}},{ALT:function(){t.CONSUME(g)}}])})}),t.RULE("multiFieldValue",function(){t.CONSUME(o),t.MANY(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(f)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(b)}},{ALT:function(){t.CONSUME(g)}}])}),t.CONSUME(c)}),t.RULE("route",function(){t.CONSUME(p),t.CONSUME(a),t.CONSUME(C),t.CONSUME2(a)}),this.performSelfAnalysis()}}class Yo{constructor(e,t,r){this.a=e,this.b=t,this.c=r,this.normal=new I.Vector3}}const Xe={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};class Wo extends I.Loader{constructor(e){super(e),this.animateBonePositions=!0,this.animateBoneRotations=!0,this.animateBoneScales=!0}load(e,t,r,i){const s=this,o=new I.FileLoader(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(c){try{t(s.parse(c))}catch(A){i?i(A):console.error(A),s.manager.itemError(e)}},r,i)}parse(e){function t(d){c(d)!=="HIERARCHY"&&console.error("THREE.BVHLoader2: HIERARCHY expected.");const E=[],g=i(d,c(d),E);c(d)!=="MOTION"&&console.error("THREE.BVHLoader2: MOTION expected.");let l=c(d).split(/[\s]+/);const h=parseInt(l[1]);isNaN(h)&&console.error("THREE.BVHLoader2: Failed to read number of frames."),l=c(d).split(/[\s]+/);const p=parseFloat(l[2]);isNaN(p)&&console.error("THREE.BVHLoader2: Failed to read frame time.");for(let C=0;C<h;C++)l=c(d).split(/[\s]+/),r(l,C*p,g);return E}function r(d,E,g){if(g.type==="ENDSITE")return;const l={time:E,position:new I.Vector3,rotation:new I.Quaternion,scale:new I.Vector3(1,1,1)};g.frames.push(l);const h=new I.Quaternion,p=new I.Vector3(1,0,0),C=new I.Vector3(0,1,0),m=new I.Vector3(0,0,1);for(let y=0;y<g.channels.length;y++)switch(g.channels[y]){case"Xposition":l.position.x=parseFloat(d.shift().trim());break;case"Yposition":l.position.y=parseFloat(d.shift().trim());break;case"Zposition":l.position.z=parseFloat(d.shift().trim());break;case"Xrotation":h.setFromAxisAngle(p,parseFloat(d.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Yrotation":h.setFromAxisAngle(C,parseFloat(d.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Zrotation":h.setFromAxisAngle(m,parseFloat(d.shift().trim())*Math.PI/180),l.rotation.multiply(h);break;case"Xscale":l.scale.x=parseFloat(d.shift().trim());break;case"Yscale":l.scale.y=parseFloat(d.shift().trim());break;case"Zscale":l.scale.z=parseFloat(d.shift().trim());break;default:console.warn("THREE.BVHLoader2: Invalid channel type.")}for(let y=0;y<g.children.length;y++)r(d,E,g.children[y])}function i(d,E,g){const l={name:"",type:"",frames:[]};g.push(l);let h=E.split(/[\s]+/);h[0].toUpperCase()==="END"&&h[1].toUpperCase()==="SITE"?(l.type="ENDSITE",l.name="ENDSITE"):(l.name=h[1],l.type=h[0].toUpperCase()),c(d)!=="{"&&console.error("THREE.BVHLoader2: Expected opening { after type & name"),h=c(d).split(/[\s]+/),h[0]!=="OFFSET"&&console.error("THREE.BVHLoader2: Expected OFFSET but got: "+h[0]),h.length!==4&&console.error("THREE.BVHLoader2: Invalid number of values for OFFSET.");const p=new I.Vector3(parseFloat(h[1]),parseFloat(h[2]),parseFloat(h[3]));if((isNaN(p.x)||isNaN(p.y)||isNaN(p.z))&&console.error("THREE.BVHLoader2: Invalid values of OFFSET."),l.offset=p,l.type!=="ENDSITE"){h=c(d).split(/[\s]+/),h[0]!=="CHANNELS"&&console.error("THREE.BVHLoader2: Expected CHANNELS definition.");const C=parseInt(h[1]);l.channels=h.splice(2,C),l.children=[]}for(;;){const C=c(d);if(C==="}")return l;l.children.push(i(d,C,g))}}function s(d,E){const g=new I.Bone;if(E.push(g),g.position.add(d.offset),g.name=d.name,d.type!=="ENDSITE")for(let l=0;l<d.children.length;l++)g.add(s(d.children[l],E));return g}function o(d){const E=[];for(let g=0;g<d.length;g++){const l=d[g];if(l.type==="ENDSITE")continue;const h=[],p=[],C=[],m=[];for(let y=0;y<l.frames.length;y++){const v=l.frames[y];h.push(v.time),p.push(v.position.x+l.offset.x),p.push(v.position.y+l.offset.y),p.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),m.push(v.scale.x),m.push(v.scale.y),m.push(v.scale.z)}A.animateBonePositions&&E.push(new I.VectorKeyframeTrack(l.name+".position",h,p)),A.animateBoneRotations&&E.push(new I.QuaternionKeyframeTrack(l.name+".quaternion",h,C)),A.animateBoneScales&&E.push(new I.VectorKeyframeTrack(l.name+".scale",h,m))}return new I.AnimationClip("animation",-1,E)}function c(d){let E;for(;(E=d.shift().trim()).length===0;);return E}const A=this,a=e.split(/[\r\n]+/g),f=t(a),u=[];s(f[0],u);const b=o(f);return{skeleton:new I.Skeleton(u),clip:b}}}let bt;async function Jo(n,e){return bt||(bt=new qo),bt.manager.setURLModifier(r=>(r.startsWith("./")&&(r=r.substring(2)),URL.createObjectURL(lr(n,r)))),await bt.loadAsync(e)}let Ut;async function Xo(n,e){Ut||(Ut=new Wo);const t=tn(n,e);return await Ut.parse(t)}function Zo(n){const e=n.clip.clone(),t=n.skeleton.bones[0].clone(!0),r=[];t.traverse(s=>{s instanceof se.Bone&&r.push(s)});const i=new se.Skeleton(r);return i.calculateInverses(),{clip:e,skeleton:i}}class $o{isDummy=!0;skeleton=new se.Skeleton([new se.Bone]);clip=new se.AnimationClip("dummy")}const Ht={},jt={};class Zt extends Me{ready;actions;comment=null;constructor(e){super(),this.actions={},this.ready=this.asyncInit(e)}initObject(){return new se.Object3D}async asyncInit(e){const t=await xn(e),r=new DOMParser,i=tn(t,"CATALOG.XML"),s=r.parseFromString(i,"application/xml");if(s.querySelector("parsererror"))return console.error("Acerola3D.asyncInit(): CATALOG.XML parse error."),this;const o="http://acerola3d.sourceforge.jp/a3/catalog",c=s.getElementsByTagNameNS(o,"c");c[0]&&(this.comment=c[0].textContent);const A=s.getElementsByTagNameNS(o,"a"),a={},f={};let u;for(const b of Array.from(A)){const d=b.getAttribute("an");if(d){u||(u=d);let E;const g=b.getAttribute("bvh");if(g){const U=t.zipUrl+"!"+g;Ht[U]||(Ht[U]=await Xo(t,g)),E=Zo(Ht[U]),E&&E.clip.tracks.forEach(w=>{w.setInterpolation(se.InterpolateDiscrete)})}else E=new $o;const l={};E.skeleton.bones.forEach(U=>{l[U.name]=U});const h=b.getAttribute("scale"),p=h?Number(h):1,C=b.getAttribute("offset"),m=new Ie;if(C){const U=C.split(" ");m.set(Number(U[0]),Number(U[1]),Number(U[2]))}const y={},v=b.getElementsByTagNameNS(o,"p");for(const U of Array.from(v)){const w=U.getAttribute("name"),M=U.getAttribute("wrl");if(w&&M){const _=t.zipUrl+"!"+M;jt[_]||(jt[_]=await Jo(t,M)),y[w]=jt[_].clone(!0)}}const S=new se.Object3D;S.add(E.skeleton.bones[0]),Gi(S,y),S.position.add(m),S.scale.set(p,p,p),S.traverse(U=>{U.userData.a3js={objectA3:this}}),a[d]={name:d,root:S,bones:l,skeleton:E.skeleton,bvh:E,scale:p,offset:m,parts:y},console.log(`actionName=${d}`),f[d]=new es(E.clip,d)}}return this.actions=a,this.setPoseMotions(f),u&&this.setState(u),this}addActionRoot(e){const t=this.actions[e];t&&(this.object.add(t.root),this.bones=t.bones,this.skeletons=[t.skeleton])}removeActionRoot(e){const t=this.actions[e];t&&(this.object.remove(t.root),this.bones={},this.skeletons=[])}}function Gi(n,e){if(tr(n)){const t=e[n.name];t&&n.add(t)}n.children&&n.children.forEach(t=>{Gi(t,e)})}class es extends rn{prepare3D(e){e instanceof Zt&&e.addActionRoot(this.name)}cleanup3D(e){e instanceof Zt&&e.removeActionRoot(this.name)}}class ts extends Me{constructor(e){super(e)}initObject(e){return e}}class ns extends Me{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),r=e.filter(A=>typeof A=="string"),i=new se.BoxGeometry(...t),s=r.length>0?r[0]:"rgb(128,128,128)",o=new se.MeshStandardMaterial({color:s});return new se.Mesh(i,o)}}class is extends Me{constructor(...e){super(e)}initObject(e){const t=e.filter(A=>typeof A=="number"),r=e.filter(A=>typeof A=="string"),i=new se.SphereGeometry(...t),s=r.length>0?r[0]:"rgb(128,128,128)",o=new se.MeshStandardMaterial({color:s});return new se.Mesh(i,o)}}class rs extends Me{constructor(e){super(e)}initObject(e){return new Mn(e)}}const os={offset:.01,auto:!0,height:1.5,radius:.3};class ss{objectA3;completeOption;controller;bodyDesc;body;colliderDesc;collider;preLocation;nextLocation;tmpVec3;constructor(e,t={}){if(this.completeOption={...os,...t},this.objectA3=e,this.preLocation=new Ie,this.nextLocation=new Ie,this.tmpVec3=new Ie,this.completeOption.auto){const r=new se.Box3().setFromObject(e.object),i=new se.Vector3;r.getSize(i),this.completeOption.radius=Math.max(i.x,i.z)/2,this.completeOption.height=i.y-this.completeOption.radius*2}this.bodyDesc=Ue.RigidBodyDesc.kinematicPositionBased(),this.colliderDesc=Ue.ColliderDesc.capsule(this.completeOption.height,this.completeOption.radius),this.bodyDesc.setTranslation(e.loc.x,e.loc.y,e.loc.z),this.preLocation.set(e.loc),this.bodyDesc.setRotation({x:e.quat.x,y:e.quat.y,z:e.quat.z,w:e.quat.w})}init(e){}addOneselfToPhysics(e){this.controller=e.world.createCharacterController(this.completeOption.offset),this.body=e.world.createRigidBody(this.bodyDesc),this.collider=e.world.createCollider(this.colliderDesc,this.body),this.collider&&ut.set(this.collider.handle,this.objectA3)}removeOneselfFromPhysics(e){this.body&&e.world.removeRigidBody(this.body),this.collider&&(e.world.removeCollider(this.collider,!1),ut.delete(this.collider.handle))}getTrans(e){return this.body?this.body.translation():this.bodyDesc.translation,e}setLocation(e){this.nextLocation.set(e)}setLocationNow(e){this.body?this.body.setNextKinematicTranslation(e):this.bodyDesc.setTranslation(e.x,e.y,e.z)}setQuat(e){this.body?this.body.setRotation(e,!1):this.bodyDesc.setRotation(e)}setQuatNow(e){this.body?this.body.setRotation(e,!1):this.bodyDesc.setRotation(e)}setScale(e){}setScaleNow(e){}isGrounded(){return this.controller?this.controller.computedGrounded():!1}update(e,t){if(!this.body||!this.controller||!this.collider)return t;this.tmpVec3.set(this.nextLocation),this.tmpVec3.sub(this.preLocation),this.controller.computeColliderMovement(this.collider,this.tmpVec3);const r=this.controller.computedMovement();this.tmpVec3.set(this.body.translation()),this.tmpVec3.add(r.x,r.y,r.z),this.body.setNextKinematicTranslation(this.tmpVec3);const i=this.body.translation();t.loc.set(i.x,i.y,i.z);const s=this.body.rotation();return t.quat.set(s.x,s.y,s.z,s.w),t}}exports.Acerola3D=Zt;exports.Box=ns;exports.Camera=Nn;exports.Canvas=ki;exports.CharactorRootMotion=ss;exports.ClipPoseMotion=rn;exports.ControllerBase=Dn;exports.GLTF=go;exports.GeneralCamera=gt;exports.HTML=rs;exports.ObjectA3=Me;exports.OrbitController=On;exports.Quat=we;exports.RapierPhysicsEngine=pt;exports.Scene=Ln;exports.Sound=rt;exports.Sphere=is;exports.Test=mo;exports.Text3D=Ro;exports.ThreeJS=ts;exports.Vec3=Ie;exports.Window=Si;exports.asyncSleep=cr;exports.deepMerge=Tt;exports.getQuatOfLookAt=lt;exports.initFont=To;exports.initPhysics=sr;exports.initSound=pr;exports.vec3EulerToQuat=en;
|
|
220
221
|
//# sourceMappingURL=a3js.cjs.js.map
|