x_ite
Version:
X_ITE X3D Browser, view and manipulate X3D, VRML, glTF and other 3D sources in HTML.
2 lines • 1.38 MB
JavaScript
/* X_ITE v12.2.3 */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.X3D=t():e.X3D=t()}(self,()=>(()=>{var t={254:(e,t,i)=>{"use strict";i.d(t,{A:()=>w});var n=i(3078),s=i(8899),r=i(6882),o=i(8415),a=i(7627),l=i(6707),h=i(7682);const c=Symbol(),u=Symbol(),d=Symbol(),p=Symbol(),g=Symbol(),f=Symbol(),m=Symbol(),A=Symbol();function _(e,t,i,s,r){n.A.call(this,e),this[c]=e,this[u]=t,this[d]=i,this[g]=s,this[f]=r,t instanceof a.A&&t.getInlineNode()._loadState.addInterest("reconnect",this),s instanceof a.A&&s.getInlineNode()._loadState.addInterest("reconnect",this),this.reconnect()}Object.assign(Object.setPrototypeOf(_.prototype,n.A.prototype),{getExecutionContext(){return this[c]},getRouteId(){return _.getRouteId(this[u],this[d],this[g],this[f])},getSourceNode(){return this[u]instanceof a.A?this[u].getExportedNode():this[u]},getSourceField(){return this[p]?this[p].getAccessType()===s.A.inputOutput?this[p].getName()+"_changed":this[p].getName():this[d]},getDestinationNode(){return this[g]instanceof a.A?this[g].getExportedNode():this[g]},getDestinationField(){return this[m]?this[m].getAccessType()===s.A.inputOutput?"set_"+this[m].getName():this[m].getName():this[f]},reconnect(){try{this.disconnect(),this.connect()}catch(e){(this[u]instanceof o.A||this[u].getInlineNode().checkLoadState()===s.A.COMPLETE_STATE)&&(this[g]instanceof o.A||this[g].getInlineNode().checkLoadState()===s.A.COMPLETE_STATE)&&console.warn(e)}},connect(){if(this[A])return;let e,t;try{const e=this[u]instanceof o.A?this[u]:this[u].getExportedNode();this[p]=e.getField(this[d])}catch(t){e=t}try{const e=this[g]instanceof o.A?this[g]:this[g].getExportedNode();this[m]=e.getField(this[f])}catch(e){t=e}if(!this[p]||!this[m])throw e??t;if(this[p].getType()!==this[m].getType())throw new Error(`Bad ROUTE statement: Source field type must match destination field type of fields named "${this[p].getName()}" and "${this[m].getName()}".`);if(!this[p].isOutput())throw new Error(`Bad ROUTE statement: Source field "${this[p].getName()}" must be an output.`);if(!this[m].isInput())throw new Error(`Bad ROUTE statement: Destination field "${this[m].getName()}" must be an input.`);this[p].addOutputRoute(this),this[m].addInputRoute(this),this[p].addFieldInterest(this[m])},disconnect(){this[p]?.removeOutputRoute(this),this[m]?.removeInputRoute(this),this[p]&&this[m]&&this[p].removeFieldInterest(this[m]),this[p]=null,this[m]=null},toVRMLStream(e){if(!e.ExistsRouteNode(this[u]))throw new Error("Source node does not exist in scene graph.");if(!e.ExistsRouteNode(this[g]))throw new Error("Destination node does not exist in scene graph.");const t=this[u]instanceof o.A?e.Name(this[u]):e.ImportedName(this[u]),i=this[g]instanceof o.A?e.Name(this[g]):e.ImportedName(this[g]);e.Indent(),e.string+="ROUTE",e.Space(),e.string+=t,e.string+=".",e.string+=this.getSourceField(),e.Space(),e.string+="TO",e.Space(),e.string+=i,e.string+=".",e.string+=this.getDestinationField()},toXMLStream(e){if(!e.ExistsRouteNode(this[u]))throw new Error("Source node does not exist in scene graph.");if(!e.ExistsRouteNode(this[g]))throw new Error("Destination node does not exist in scene graph.");const t=this[u]instanceof o.A?e.Name(this[u]):e.ImportedName(this[u]),i=this[g]instanceof o.A?e.Name(this[g]):e.ImportedName(this[g]);e.openTag("ROUTE"),e.attribute("fromNode",t),e.attribute("fromField",this.getSourceField()),e.attribute("toNode",i),e.attribute("toField",this.getDestinationField()),e.closeTag("ROUTE")},toJSONStream(e){if(!e.ExistsRouteNode(this[u]))throw new Error("Source node does not exist in scene graph.");if(!e.ExistsRouteNode(this[g]))throw new Error("Destination node does not exist in scene graph.");const t=this[u]instanceof o.A?e.Name(this[u]):e.ImportedName(this[u]),i=this[g]instanceof o.A?e.Name(this[g]):e.ImportedName(this[g]);e.TidyBreak(),e.Indent(),e.beginObject("ROUTE",!1,!0),e.stringProperty("@fromNode",t,!1),e.stringProperty("@fromField",this.getSourceField()),e.stringProperty("@toNode",i),e.stringProperty("@toField",this.getDestinationField()),e.endObject(),e.endObject()},dispose(){this[A]||(this[A]=!0,this.disconnect(),this[u]instanceof a.A&&this[u].getInlineNode()._loadState.removeInterest("reconnect",this),this[g]instanceof a.A&&this[g].getInlineNode()._loadState.removeInterest("reconnect",this),this[c].deleteRoute(this),n.A.prototype.dispose.call(this))}});for(const e of Object.keys(_.prototype))Object.defineProperty(_.prototype,e,{enumerable:!1});Object.defineProperties(_.prototype,{sourceNode:{get(){return r.A.get(this.getSourceNode())},enumerable:!0},sourceField:{get:_.prototype.getSourceField,enumerable:!0},destinationNode:{get(){return r.A.get(this.getDestinationNode())},enumerable:!0},destinationField:{get:_.prototype.getDestinationField,enumerable:!0}}),Object.defineProperties(_,{typeName:{value:"X3DRoute",enumerable:!0}}),Object.assign(_,{getRouteId(e,t,i,n){const r=e instanceof o.A?e.getField(t):h.try(()=>e.getExportedNode().getField(t)),a=i instanceof o.A?i.getField(n):h.try(()=>i.getExportedNode().getField(n));return r&&(t=r.getName(),r.getAccessType()===s.A.inputOutput&&(t+="_changed")),a&&(n=a.getName(),a.getAccessType()===s.A.inputOutput&&(n="set_"+n)),`${e.getId()}.${t}.${i.getId()}.${n}`}});const y=_,w=l.A.add("X3DRoute",y)},388:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var n=i(2639),s=i(6707);function r(e=n.A.ZERO,t=n.A.Z_AXIS){this.point=new n.A,this.direction=new n.A,this.set(e,t)}Object.assign(r.prototype,{copy(){const e=Object.create(r.prototype);return e.point=this.point.copy(),e.direction=this.direction.copy(),e},assign(e){return this.point.assign(e.point),this.direction.assign(e.direction),this},equals(e){return this.point.equals(e.point)&&this.direction.equals(e.direction)},set(e=n.A.ZERO,t=n.A.Z_AXIS){return this.point.assign(e),this.direction.assign(t),this},setPoints(e,t){return this.point.assign(e),this.direction.assign(t).subtract(e).normalize(),this},multMatrixLine(e){return e.multMatrixVec(this.point),e.multMatrixDir(this.direction).normalize(),this},multLineMatrix(e){return e.multVecMatrix(this.point),e.multDirMatrix(this.direction).normalize(),this},getClosestPointToPoint(e,t=new n.A){const i=t.assign(e).subtract(this.point).dot(this.direction);return t.assign(this.direction).multiply(i).add(this.point)},getClosestPointToLine:(()=>{const e=new n.A;return function(t,i){const{point:n,direction:s}=this,{point:r,direction:o}=t;let a=s.dot(o);return!(Math.abs(a)>=1)&&(e.assign(r).subtract(n),a=(e.dot(s)-a*e.dot(o))/(1-a*a),i.assign(s).multiply(a).add(n),!0)}})(),getPerpendicularVectorToPoint:(()=>{const e=new n.A;return function(t,i=new n.A){return i.assign(this.point).subtract(t),i.subtract(e.assign(this.direction).multiply(i.dot(this.direction)))}})(),getPerpendicularVectorToLine:(()=>{const e=new n.A,t=new n.A,i=new n.A,s=new n.A;return function(r,o=new n.A){const{point:a,direction:l}=this,{point:h,direction:c}=r,u=l.dot(c);if(Math.abs(u)>=1)return e.assign(h).subtract(a),t.assign(l).multiply(e.dot(l)/l.dot(l)),t.subtract(e);i.assign(a).subtract(h);const d=i.dot(l),p=i.dot(c),g=l.dot(c),f=g*g,m=(d-p*g)/(1-f),A=-(p-d*g)/(1-f);return s.assign(l).multiply(m),o.assign(c).multiply(A),o.subtract(s).add(i)}})(),intersectsTriangle:(()=>{const e=new n.A,t=new n.A;return function(i,n,s,r){const o=n.subtract(i),a=s.subtract(i);e.assign(this.direction).cross(a);const l=o.dot(e);if(0===l)return!1;const h=1/l;t.assign(this.point).subtract(i);const c=t.dot(e)*h;if(c<0||c>1)return!1;const u=t.cross(o),d=this.direction.dot(u)*h;return!(d<0||c+d>1)&&(r.u=1-c-d,r.v=c,r.t=d,!0)}})(),toString(){return`${this.point}, ${this.direction}`}}),Object.assign(r,{Points(e,t){const i=Object.create(r.prototype);return i.point=e.copy(),i.direction=t.copy().subtract(e).normalize(),i}});const o=r,a=s.A.add("Line3",o)},564:(e,t,i)=>{"use strict";i.d(t,{A:()=>At});var n=i(5702),s=i(8899),r=i(6707);function o(e,t,i){const s=t?"DoubleFormat":"FloatFormat";return a(function(e){n.A.call(this,arguments.length?+e:i)},e,{isDefaultValue(){return this.getValue()===i},set(e){n.A.prototype.set.call(this,+e)},toStream(e){const t=this.getUnit();e.string+=e[s](e.ToUnit(t,this.getValue()))},toJSONStreamValue(e){const t=this.getUnit();e.string+=e.Number(e[s](e.ToUnit(t,this.getValue())))}})}function a(e,t,i={}){Object.defineProperties(e,{type:{value:s.A[t],enumerable:!0},typeName:{value:t,enumerable:!0}}),Object.assign(Object.setPrototypeOf(e.prototype,n.A.prototype),{copy(){return new e(this.getValue())},valueOf:n.A.prototype.getValue,toStream(e){e.string+=String(this.getValue())},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){this.toJSONStreamValue(e)},toJSONStreamValue(e){this.toStream(e)}},i);for(const t of Object.keys(e.prototype))Object.defineProperty(e.prototype,t,{enumerable:!1});return e}const l={SFBool:(h="SFBool",a(function(e){n.A.call(this,!!e)},h,{isDefaultValue(){return!1===this.getValue()},set(e){n.A.prototype.set.call(this,!!e)},toStream(e){e.string+=this.getValue()?"TRUE":"FALSE"},toXMLStream(e){e.string+=this.getValue()?"true":"false"},toJSONStreamValue(e){e.string+=this.getValue()?"true":"false"}})),SFDouble:o("SFDouble",!0,0),SFFloat:o("SFFloat",!1,0),SFInt32:function(e){return a(function(e){n.A.call(this,0|e)},e,{isDefaultValue(){return 0===this.getValue()},set(e){n.A.prototype.set.call(this,0|e)}})}("SFInt32"),SFString:function(e){function t(e){n.A.call(this,arguments.length?String(e):"")}return a(t,e,{*[Symbol.iterator](){yield*this.getValue()},isDefaultValue(){return""===this.getValue()},set(e){n.A.prototype.set.call(this,String(e))},toStream(e){e.string+='"',e.string+=t.escape(this.getValue()),e.string+='"'},toXMLStream(e,t=!1){e.string+=t?e.EncodeSourceText(this.getValue()):e.EncodeString(this.getValue())},toJSONStreamValue(e){e.string+='"',e.string+=e.EncodeString(this.getValue()),e.string+='"'}}),Object.defineProperty(t.prototype,"length",{get(){return this.getValue().length}}),Object.assign(t,{unescape:e=>e.replace(/\\([\\"])/g,"$1"),escape:e=>e.replace(/([\\"])/g,"\\$1")}),t}("SFString"),SFTime:o("SFTime",!0,-1)};var h;const c=l,u=r.A.add("SFScalar",c);var d=i(567);function p(e,t,i){switch(arguments.length){case 0:n.A.call(this,new d.A);break;case 1:n.A.call(this,arguments[0]);break;case 3:n.A.call(this,new d.A(+e,+t,+i));break;default:throw new Error("Invalid arguments.")}}Object.assign(Object.setPrototypeOf(p.prototype,n.A.prototype),{*[Symbol.iterator](){yield*this.getValue()},copy(){return new p(this.getValue().copy())},equals(e){return this.getValue().equals(e.getValue())},isDefaultValue(){return this.getValue().equals(d.A.BLACK)},set(e){this.getValue().assign(e)},getHSV(){return this.getValue().getHSV([])},setHSV(e,t,i){this.getValue().setHSV(e,t,i),this.addEvent()},linearToSRGB(){return new p(this.getValue().linearToSRGB())},sRGBToLinear(){return new p(this.getValue().sRGBToLinear())},lerp:(()=>{const e=[],t=[],i=[];return function(n,s){const r=new p;return this.getValue().getHSV(e),n.getValue().getHSV(t),d.A.lerp(e,t,s,i),r.setHSV(i[0],i[1],i[2]),r}})(),toStream(e){const t=this.getValue(),i=t.length-1;for(let n=0;n<i;++n)e.string+=e.FloatFormat(t[n]),e.Space();e.string+=e.FloatFormat(t[i])},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){e.string+="[",e.TidySpace(),this.toJSONStreamValue(e),e.TidySpace(),e.string+="]"},toJSONStreamValue(e){const t=this.getValue(),i=t.length-1;for(let n=0;n<i;++n)e.string+=e.Number(e.FloatFormat(t[n])),e.string+=",",e.TidySpace();e.string+=e.Number(e.FloatFormat(t[i]))}});for(const e of Object.keys(p.prototype))Object.defineProperty(p.prototype,e,{enumerable:!1});const g={get(){return this.getValue().r},set(e){this.getValue().r=+e,this.addEvent()}},f={get(){return this.getValue().g},set(e){this.getValue().g=+e,this.addEvent()}},m={get(){return this.getValue().b},set(e){this.getValue().b=+e,this.addEvent()}};Object.defineProperties(p.prototype,{0:g,1:f,2:m,r:Object.assign({enumerable:!0},g),g:Object.assign({enumerable:!0},f),b:Object.assign({enumerable:!0},m)}),Object.defineProperties(p,{type:{value:s.A.SFColor,enumerable:!0},typeName:{value:"SFColor",enumerable:!0}});const A=p,_=r.A.add("SFColor",A);var y=i(9302);function w(e,t,i,s){switch(arguments.length){case 0:n.A.call(this,new y.A);break;case 1:n.A.call(this,arguments[0]);break;case 4:n.A.call(this,new y.A(+e,+t,+i,+s));break;default:throw new Error("Invalid arguments.")}}Object.assign(Object.setPrototypeOf(w.prototype,n.A.prototype),{*[Symbol.iterator](){yield*this.getValue()},copy(){return new w(this.getValue().copy())},equals:_.prototype.equals,isDefaultValue(){return this.getValue().equals(y.A.TRANSPARENT)},set:_.prototype.set,getHSVA(){return this.getValue().getHSVA([])},setHSVA(e,t,i,n){this.getValue().setHSVA(e,t,i,n),this.addEvent()},linearToSRGB(){return new w(this.getValue().linearToSRGB())},sRGBToLinear(){return new w(this.getValue().sRGBToLinear())},lerp:(()=>{const e=[],t=[],i=[];return function(n,s){const r=new w;return this.getValue().getHSVA(e),n.getValue().getHSVA(t),y.A.lerp(e,t,s,i),r.setHSVA(i[0],i[1],i[2],i[3]),r}})(),toStream:_.prototype.toStream,toVRMLStream:_.prototype.toVRMLStream,toXMLStream:_.prototype.toXMLStream,toJSONStream:_.prototype.toJSONStream,toJSONStreamValue:_.prototype.toJSONStreamValue});for(const e of Object.keys(w.prototype))Object.defineProperty(w.prototype,e,{enumerable:!1});const x={get(){return this.getValue().r},set(e){this.getValue().r=+e,this.addEvent()}},b={get(){return this.getValue().g},set(e){this.getValue().g=+e,this.addEvent()}},S={get(){return this.getValue().b},set(e){this.getValue().b=+e,this.addEvent()}},T={get(){return this.getValue().a},set(e){this.getValue().a=+e,this.addEvent()}};Object.defineProperties(w.prototype,{0:x,1:b,2:S,3:T,r:Object.assign({enumerable:!0},x),g:Object.assign({enumerable:!0},b),b:Object.assign({enumerable:!0},S),a:Object.assign({enumerable:!0},T)}),Object.defineProperties(w,{type:{value:s.A.SFColorRGBA,enumerable:!0},typeName:{value:"SFColorRGBA",enumerable:!0}});const v=w,O=r.A.add("SFColorRGBA",v);const E=function(e,t,i,r,o={}){const a=r?"DoubleFormat":"FloatFormat";Object.defineProperties(e,{type:{value:s.A[t],enumerable:!0},typeName:{value:t,enumerable:!0}}),Object.assign(Object.setPrototypeOf(e.prototype,n.A.prototype),{*[Symbol.iterator](){yield*this.getValue()},copy(){return new this.constructor(this.getValue().copy())},equals(e){return this.getValue().equals(e.getValue())},isDefaultValue(){return this.getValue().equals(i.IDENTITY)},set(e){this.getValue().assign(e)},setTransform:(()=>{const e=[];return function(t,i,n,s,r){e.push(t?.getValue(),i?.getValue(),n?.getValue(),s?.getValue(),r?.getValue());for(let t=e.length-1;t>-1&&!e[t];--t)e.pop();this.getValue().set(...e),e.length=0}})(),getTransform:(()=>{const e=[];return function(t,i,n,s,r){e.push(t?.getValue(),i?.getValue(),n?.getValue(),s?.getValue(),r?.getValue());for(let t=e.length-1;t>-1&&!e[t];--t)e.pop();this.getValue().get(...e),t?.addEvent(),i?.addEvent(),n?.addEvent(),s?.addEvent(),e.length=0}})(),determinant(){return this.getValue().determinant()},transpose(){return new this.constructor(this.getValue().copy().transpose())},inverse(){return new this.constructor(this.getValue().copy().inverse())},multLeft(e){return new this.constructor(this.getValue().copy().multLeft(e.getValue()))},multRight(e){return new this.constructor(this.getValue().copy().multRight(e.getValue()))},multVecMatrix(e){return new e.constructor(this.getValue().multVecMatrix(e.getValue().copy()))},multMatrixVec(e){return new e.constructor(this.getValue().multMatrixVec(e.getValue().copy()))},multDirMatrix(e){return new e.constructor(this.getValue().multDirMatrix(e.getValue().copy()))},multMatrixDir(e){return new e.constructor(this.getValue().multMatrixDir(e.getValue().copy()))},translate(e){return new this.constructor(this.getValue().copy().translate(e.getValue()))},rotate(e){return new this.constructor(this.getValue().copy().rotate(e.getValue()))},scale(e){return new this.constructor(this.getValue().copy().scale(e.getValue()))},toStream(e){const t=this.getValue(),i=t.length-1;for(let n=0;n<i;++n)e.string+=e[a](t[n]),e.Space();e.string+=e[a](t[i])},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){e.string+="[",e.TidySpace(),this.toJSONStreamValue(e),e.TidySpace(),e.string+="]"},toJSONStreamValue(e){const t=this.getValue(),i=t.length-1;for(let n=0;n<i;++n)e.string+=e.Number(e[a](t[n])),e.string+=",",e.TidySpace();e.string+=e.Number(e[a](t[i]))}},o);for(const t of Object.keys(e.prototype))Object.defineProperty(e.prototype,t,{enumerable:!1});function l(t){Object.defineProperty(e.prototype,t,{get(){return this.getValue()[t]},set(e){this.getValue()[t]=+e,this.addEvent()},enumerable:!0})}for(let e=0;e<i.prototype.length;++e)l(e);return e},N=r.A.add("SFMatrixPrototypeTemplate",E);var C=i(3012);function I(e,t){return N(function(e,t,i,s,r,o,a,l,h){switch(arguments.length){case 0:n.A.call(this,new C.A);break;case 1:n.A.call(this,arguments[0]);break;case 3:{const e=arguments[0],t=arguments[1],i=arguments[2];n.A.call(this,new C.A(e.x,e.y,e.z,t.x,t.y,t.z,i.x,i.y,i.z));break}case 9:n.A.call(this,new C.A(+e,+t,+i,+s,+r,+o,+a,+l,+h));break;default:throw new Error("Invalid arguments.")}},e,C.A,t,{setTransform:(()=>{const e=[];return function(t,i,n,s,r){e.push(t?.getValue(),i,n?.getValue(),s,r?.getValue());for(let t=e.length-1;t>-1&&!e[t];--t)e.pop();this.getValue().set(...e),e.length=0}})(),rotate(e){return new this.constructor(this.getValue().copy().rotate(e))},skewX(e){return new this.constructor(this.getValue().copy().skewX(e))},skewY(e){return new this.constructor(this.getValue().copy().skewY(e))}})}const F={SFMatrix3d:I("SFMatrix3d",!0),SFMatrix3f:I("SFMatrix3f",!1)},M=r.A.add("SFMatrix3",F);var R=i(1048);function P(e,t){return N(function(e,t,i,s,r,o,a,l,h,c,u,d,p,g,f,m){switch(arguments.length){case 0:n.A.call(this,new R.A);break;case 1:n.A.call(this,arguments[0]);break;case 4:{const e=arguments[0],t=arguments[1],i=arguments[2],s=arguments[3];n.A.call(this,new R.A(e.x,e.y,e.z,e.w,t.x,t.y,t.z,t.w,i.x,i.y,i.z,i.w,s.x,s.y,s.z,s.w));break}case 16:n.A.call(this,new R.A(+e,+t,+i,+s,+r,+o,+a,+l,+h,+c,+u,+d,+p,+g,+f,+m));break;default:throw new Error("Invalid arguments.")}},e,R.A,t)}const V={SFMatrix4d:P("SFMatrix4d",!0),SFMatrix4f:P("SFMatrix4f",!1),VrmlMatrix:P("VrmlMatrix",!1)},D=r.A.add("SFMatrix4",V);var L=i(1426);const B=function(e,t,i,r,o={}){const a=r?"DoubleFormat":"FloatFormat";Object.defineProperties(e,{type:{value:s.A[t],enumerable:!0},typeName:{value:t,enumerable:!0}}),Object.assign(Object.setPrototypeOf(e.prototype,n.A.prototype),{*[Symbol.iterator](){yield*this.getValue()},copy(){return new this.constructor(this.getValue().copy())},equals(e){return this.getValue().equals(e.getValue())},isDefaultValue(){return this.getValue().equals(i.ZERO)},set(e){this.getValue().assign(e)},abs(){return new this.constructor(this.getValue().copy().abs())},add(e){return new this.constructor(this.getValue().copy().add(e.getValue()))},clamp(e,t){return new this.constructor(this.getValue().copy().clamp(e.getValue(),t.getValue()))},distance(e){return this.getValue().distance(e.getValue())},divide(e){return new this.constructor(this.getValue().copy().divide(e))},divVec(e){return new this.constructor(this.getValue().copy().divVec(e.getValue()))},dot(e){return this.getValue().dot(e.getValue())},inverse(){return new this.constructor(this.getValue().copy().inverse())},length(){return this.getValue().norm()},lerp(e,t){return new this.constructor(this.getValue().copy().lerp(e,t))},max(e){return new this.constructor(this.getValue().copy().max(e.getValue()))},min(e){return new this.constructor(this.getValue().copy().min(e.getValue()))},multiply(e){return new this.constructor(this.getValue().copy().multiply(e))},multVec(e){return new this.constructor(this.getValue().copy().multVec(e.getValue()))},negate(){return new this.constructor(this.getValue().copy().negate())},normalize(e){return new this.constructor(this.getValue().copy().normalize())},subtract(e){return new this.constructor(this.getValue().copy().subtract(e.getValue()))},toStream(e){const t=this.getValue(),i=t.length-1,n=this.getUnit();for(let s=0;s<i;++s)e.string+=e[a](e.ToUnit(n,t[s])),e.Space();e.string+=e[a](e.ToUnit(n,t[i]))},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){e.string+="[",e.TidySpace(),this.toJSONStreamValue(e),e.TidySpace(),e.string+="]"},toJSONStreamValue(e){const t=this.getValue(),i=t.length-1,n=this.getUnit();for(let s=0;s<i;++s)e.string+=e.Number(e[a](e.ToUnit(n,t[s]))),e.string+=",",e.TidySpace();e.string+=e.Number(e[a](e.ToUnit(n,t[i])))}},o);for(const t of Object.keys(e.prototype))Object.defineProperty(e.prototype,t,{enumerable:!1});const l={get(){return this.getValue().x},set(e){this.getValue().x=+e,this.addEvent()}},h={get(){return this.getValue().y},set(e){this.getValue().y=+e,this.addEvent()}},c={get(){return this.getValue().z},set(e){this.getValue().z=+e,this.addEvent()}},u={get(){return this.getValue().w},set(e){this.getValue().w=+e,this.addEvent()}},d=[[0,l],[1,h],[2,c],[3,u]],p=[["x",Object.assign({enumerable:!0},l)],["y",Object.assign({enumerable:!0},h)],["z",Object.assign({enumerable:!0},c)],["w",Object.assign({enumerable:!0},u)]];return d.length=i.prototype.length,p.length=i.prototype.length,Object.defineProperties(e.prototype,Object.fromEntries(d.concat(p))),e},k=r.A.add("SFVecPrototypeTemplate",B);var j=i(2639);function U(e,t){return k(function(e,t,i){switch(arguments.length){case 0:n.A.call(this,new j.A);break;case 1:n.A.call(this,arguments[0]);break;case 3:n.A.call(this,new j.A(+e,+t,+i));break;default:throw new Error("Invalid arguments.")}},e,j.A,t,{cross(e){return new this.constructor(this.getValue().copy().cross(e.getValue()))}})}const X={SFVec3d:U("SFVec3d",!0),SFVec3f:U("SFVec3f",!1)},z=r.A.add("SFVec3",X);var G=i(1029),H=i(9595);const $=z.SFVec3d,Y=z.SFVec3f,q=M.SFMatrix3d,W=M.SFMatrix3f;function K(e,t,i,s){switch(arguments.length){case 0:n.A.call(this,new G.A);break;case 1:if(arguments[0]instanceof q||arguments[0]instanceof W){n.A.call(this,(new G.A).setMatrix(arguments[0].getValue()));break}n.A.call(this,arguments[0]);break;case 2:if(arguments[1]instanceof $||arguments[1]instanceof Y){n.A.call(this,new G.A(arguments[0].getValue(),arguments[1].getValue()));break}n.A.call(this,new G.A(arguments[0].getValue(),+arguments[1]));break;case 4:n.A.call(this,new G.A(+e,+t,+i,+s));break;default:throw new Error("Invalid arguments.")}}Object.assign(Object.setPrototypeOf(K.prototype,n.A.prototype),{*[Symbol.iterator](){yield*this.getValue()},copy(){return new K(this.getValue().copy())},equals(e){return this.getValue().equals(e.getValue())},isDefaultValue(){return this.getValue().equals(G.A.IDENTITY)},set(e){this.getValue().assign(e)},setAxis(e){this.getValue().setAxis(e.getValue()),this.addEvent()},getAxis(){return new Y(this.getValue().getAxis())},setMatrix(e){this.getValue().setMatrix(e.getValue()),this.addEvent()},getMatrix(){return new W(this.getValue().getMatrix())},setQuaternion:(()=>{const e=new H.A;return function(t,i,n,s){this.getValue().setQuaternion(e.set(t,i,n,s)),this.addEvent()}})(),getQuaternion:(()=>{const e=new H.A;return function(){return[...this.getValue().getQuaternion(e)]}})(),inverse(){return new K(this.getValue().copy().inverse())},multiply(e){return new K(this.getValue().copy().multRight(e.getValue()))},multVec(e){return new e.constructor(this.getValue().multVecRot(e.getValue().copy()))},slerp(e,t){return new K(this.getValue().copy().slerp(e.getValue(),t))},straighten(e){return new K(this.getValue().copy().straighten(e?.getValue()))},toStream(e){const{x:t,y:i,z:n,angle:s}=this.getValue();e.string+=e.DoubleFormat(t),e.Space(),e.string+=e.DoubleFormat(i),e.Space(),e.string+=e.DoubleFormat(n),e.Space(),e.string+=e.DoubleFormat(e.ToUnit("angle",s))},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){e.string+="[",e.TidySpace(),this.toJSONStreamValue(e),e.TidySpace(),e.string+="]"},toJSONStreamValue(e){const{x:t,y:i,z:n,angle:s}=this.getValue();e.string+=e.Number(e.DoubleFormat(t)),e.string+=",",e.TidySpace(),e.string+=e.Number(e.DoubleFormat(i)),e.string+=",",e.TidySpace(),e.string+=e.Number(e.DoubleFormat(n)),e.string+=",",e.TidySpace(),e.string+=e.Number(e.DoubleFormat(e.ToUnit("angle",s)))}});for(const e of Object.keys(K.prototype))Object.defineProperty(K.prototype,e,{enumerable:!1});const Z={get(){return this.getValue().x},set(e){this.getValue().x=+e,this.addEvent()}},Q={get(){return this.getValue().y},set(e){this.getValue().y=+e,this.addEvent()}},J={get(){return this.getValue().z},set(e){this.getValue().z=+e,this.addEvent()}},ee={get(){return this.getValue().angle},set(e){this.getValue().angle=+e,this.addEvent()}};Object.defineProperties(K.prototype,{0:Z,1:Q,2:J,3:ee,x:Object.assign({enumerable:!0},Z),y:Object.assign({enumerable:!0},Q),z:Object.assign({enumerable:!0},J),angle:Object.assign({enumerable:!0},ee)}),Object.defineProperties(K,{type:{value:s.A.SFRotation,enumerable:!0},typeName:{value:"SFRotation",enumerable:!0}});const te=K,ie=r.A.add("SFRotation",te);var ne=i(8024);function se(e,t){return k(function(e,t){switch(arguments.length){case 0:n.A.call(this,new ne.A);break;case 1:n.A.call(this,arguments[0]);break;case 2:n.A.call(this,new ne.A(+e,+t));break;default:throw new Error("Invalid arguments.")}},e,ne.A,t)}const re={SFVec2d:se("SFVec2d",!0),SFVec2f:se("SFVec2f",!1)},oe=r.A.add("SFVec2",re);var ae=i(3630);function le(e,t){return k(function(e,t,i,s){switch(arguments.length){case 0:n.A.call(this,new ae.A(0,0,0,1));break;case 1:n.A.call(this,arguments[0]);break;case 4:n.A.call(this,new ae.A(+e,+t,+i,+s));break;default:throw new Error("Invalid arguments.")}},e,ae.A,t,{isDefaultValue(){return this.getValue().equals(ae.A.W_AXIS)}})}const he={SFVec4d:le("SFVec4d",!0),SFVec4f:le("SFVec4f",!1)},ce=r.A.add("SFVec4",he);var ue=i(8155);const de=Symbol(),pe=Symbol(),ge=Symbol(),fe=Symbol(),me={get(e,t){const i=e[t];if(void 0!==i)return i;if("string"==typeof t){const i=e.getValue(),n=+t;return Number.isInteger(n)?(n>=i.length&&e.resize(n+1),i[n].valueOf()):e[t]}},set(e,t,i){if(t in e)return e[t]=i,!0;const n=e.getValue(),s=+t;return s>=n.length&&e.resize(s+1),n[s].setValue(i),!0},has:(e,t)=>Number.isInteger(+t)?t<e.getValue().length:t in e,ownKeys:e=>Object.keys(e.getValue()),getOwnPropertyDescriptor(e,t){if("string"!=typeof t)return;const i=+t;return Number.isInteger(i)&&i<e.getValue().length?Object.getOwnPropertyDescriptor(e.getValue(),t):void 0}};function Ae(e){const t=new Proxy(this,me);ue.A.call(this,[]),this[de]=this,this[pe]=t;for(const t of e)this.push(t);return t}Object.assign(Object.setPrototypeOf(Ae.prototype,ue.A.prototype),{[de]:null,[pe]:null,*[Symbol.iterator](){const e=this[de].getValue();for(const t of e)yield t.valueOf()},getTarget(){return this[de]},copy(){const e=this[de],t=e.create();return t.assign(e),t},equals(e){const t=this[de].getValue(),i=e.getValue(),n=t.length;if(t===i)return!0;if(n!==i.length)return!1;for(let e=0;e<n;++e)if(!t[e].equals(i[e]))return!1;return!0},isDefaultValue(){return 0===this.length},set(e){const t=this[de],i=t.getValue(),s=e.length;t.resize(s,void 0,!0);for(let t=0;t<s;++t)i[t].set(e[t]instanceof n.A?e[t].getValue():e[t])},setValue(e){const t=this[de];t.set(e instanceof Ae?e.getValue():e),t.addEvent()},unshift(...e){const t=this[de],i=t.getValue();for(let n=e.length-1;n>=0;--n){const s=new(t.getSingleType());s.setValue(e[n]),t.addChildObject(s),i.unshift(s)}return t.addEvent(),i.length},shift(){const e=this[de],t=e.getValue();if(t.length){const i=t.shift(),n=i.valueOf();return e.removeChildObject(i),e.addEvent(),n}},push(...e){const t=this[de],i=t.getValue();for(const n of e){const e=new(t.getSingleType());e.setValue(n),t.addChildObject(e),i.push(e)}return t.addEvent(),i.length},pop(){const e=this[de],t=e.getValue();if(t.length){const i=t.pop(),n=i.valueOf();return e.removeChildObject(i),e.addEvent(),n}},splice(e,t,...i){const n=this[de],s=n.getValue().length;if(0===arguments.length)return new n.constructor;arguments.length<2&&(t=s);const r=n[fe](e,t);return i.length&&n[ge](e,i),r},[ge](e,t){const i=this[de],n=[];for(const e of t){const t=new(i.getSingleType());t.setValue(e),i.addChildObject(t),n.push(t)}i.getValue().splice(e,0,...n),i.addEvent()},[fe](e,t){const i=this[de],n=i.getValue().splice(e,t),s=new i.constructor;for(const e of n)s.push(e),i.removeChildObject(e);return i.addEvent(),s},resize(e,t,i){const n=this[de],s=n.getValue(),r=s.length;if(e<0)throw new RangeError("Invalid array length");if(e<r){for(let t=e;t<r;++t)n.removeChildObject(s[t]);s.length=e,i||n.addEvent()}else if(e>r){for(let i=r;i<e;++i){const e=new(n.getSingleType());void 0!==t&&e.setValue(t),n.addChildObject(e),s.push(e)}i||n.addEvent()}},addChildObject(e){e.addParent(this[pe])},removeChildObject(e){e.dispose()},shrinkToFit(){return this.getValue()},concat(...e){const t=this.copy(),i=t[de];for(const t of e)for(const e of t)i.push(e);return t},reverse(){const e=this[de];return e.getValue().reverse(),e.addEvent(),e[pe]},sort(e){const t=this[de];return Array.prototype.sort.call(this,e),t.addEvent(),t[pe]},valueOf(){return this[pe]},toStream(e){const t=this[de].getValue(),i=t.length;switch(i){case 0:e.string+="[",e.TidySpace(),e.string+="]";break;case 1:t[0].toStream(e);break;default:{const n=i-1;e.string+="[",e.ListStart(),e.IncIndent();for(let i=0;i<n;++i)e.ListIndent(),t[i].toStream(e),e.Comma(),e.ListBreak();e.ListIndent(),t.at(-1).toStream(e),e.ListEnd(),e.DecIndent(),e.ListIndent(),e.string+="]";break}}},toVRMLStream(e){this.toStream(e)},toXMLStream(e){const t=this[de],i=t.length;if(i){const n=t.getValue(),s=i-1;for(let t=0;t<s;++t)n[t].toXMLStream(e),e.Comma(),e.TidySpace();n.at(-1).toXMLStream(e)}},toJSONStream(e){const t=this[de],i=t.length;if(i){const n=t.getValue(),s=i-1;e.string+="[",e.ListBreak(),e.IncIndent();for(let t=0;t<s;++t)e.ListIndent(),n[t].toJSONStreamValue(e),e.string+=",",e.ListBreak();e.ListIndent(),n.at(-1).toJSONStreamValue(e),e.ListBreak(),e.DecIndent(),e.ListIndent(),e.string+="]"}else e.string+="[",e.TidySpace(),e.string+="]"}});for(const e of Object.keys(Ae.prototype))Object.defineProperty(Ae.prototype,e,{enumerable:!1});Object.defineProperty(Ae.prototype,"length",{get(){return this[de].getValue().length},set(e){this[de].resize(e)}});const _e=Ae,ye=r.A.add("X3DObjectArrayField",_e);var we=i(4559);const xe=Symbol(),be=Symbol(),Se=Symbol(),Te=Symbol(),ve=Symbol(),Oe=Symbol(),Ee=Symbol(),Ne=Symbol(),Ce=Symbol(),Ie={get(e,t){const i=e[t];if(void 0!==i)return i;if("string"==typeof t){const i=+t;if(Number.isInteger(i)){const t=e.getComponents(),n=e.getValueType(),s=i<e[ve]?e.getValue():e.resize(i+1,e.getSingleValue());return 1===t?n(s[i]):e[Se][i]??(e[Se][i]=Me(e,i,t,n))}return e[t]}},set(e,t,i){if(t in e)return e[t]=i,!0;const n=e.getComponents();let s=+t,r=e.getValue();if(s>=e[ve]&&(r=e.resize(s+1,e.getSingleValue())),1===n){const t=e.getValueType();r[s]=t(i)}else{s*=n;for(let e=0;e<n;++e,++s)r[s]=i[e]}return e.addEvent(),!0},has:(e,t)=>Number.isInteger(+t)?t<e[ve]:t in e,ownKeys(e){const t=[];for(let i=0,n=e[ve];i<n;++i)t.push(String(i));return t},getOwnPropertyDescriptor(e,t){if("string"!=typeof t)return;const i=+t;return Number.isInteger(i)&&i<e[ve]?Object.getOwnPropertyDescriptor(e.getValue(),t):void 0}};function Fe(e){const t=new Proxy(this,Ie);ue.A.call(this,new(this.getArrayType())(16)),this[xe]=this,this[be]=t,this.getComponents()>1&&(this[Se]=[],this[Te]=[]);for(const t of e)this.push(t);return t}Object.assign(Object.setPrototypeOf(Fe.prototype,ue.A.prototype),{[xe]:null,[Te]:null,[ve]:0,*[Symbol.iterator](){const e=this[xe],t=e.getValue(),i=e.getComponents(),n=e.getValueType(),s=e[ve];if(1===i)for(let e=0;e<s;++e)yield n(t[e]);else{const t=e[Se];for(let r=0;r<s;++r)yield t[r]??(t[r]=Me(e,r,i,n))}},getTarget(){return this[xe]},copy(){const e=this[xe],t=e.getValue(),i=e.create();return i.set(t,e[ve]),i},equals(e){const t=this[xe],i=e[xe],n=t[ve];if(t===i)return!0;if(n!==i[ve])return!1;const s=t.getValue(),r=i.getValue(),o=n*t.getComponents();for(let e=0;e<o;++e)if(s[e]!==r[e])return!1;return!0},assign(e){const t=this[xe];t.set(e.getValue(),e.length),t.addEvent()},set(e,t){const i=this[xe],n=i.getComponents(),s=i[ve];let r=i.getValue(),o=void 0!==t?t*n:e.length;const a=o%n;a&&(o-=a,console.warn(`Array length must be multiple of components size, which is ${n}.`)),o/=n,r.length<e.length?(r=i[Ne](e.length),r.set(e),a&&r.fill(0,o*n,o*n+a)):(r.set(e),o<s&&r.fill(0,o*n,s*n)),i[ve]=o},isDefaultValue(){return 0===this[ve]},setValue(e){const t=this[xe];e instanceof t.constructor?t.assign(e):(t.set(e),t.addEvent())},unshift(...e){const t=this[xe],i=t.getComponents(),n=t[ve],s=e.length,r=t[Ne]((n+s)*i);if(r.copyWithin(s*i,0,n*i),1===i){const i=t.getValueType();for(let t=0;t<s;++t)r[t]=i(e[t])}else for(let t=0,n=0;n<s;++n){const s=e[n];for(let e=0;e<i;++e,++t)r[t]=s[e]}return t[ve]+=s,t.addEvent(),t[ve]},shift(){const e=this[xe],t=e[ve];if(t){const i=e.getValue(),n=e.getComponents(),s=e.getValueType(),r=t-1;let o;if(1===n)o=s(i[0]);else{const t=e[Te];for(let e=0;e<n;++e)t[e]=i[e];o=new s(...t)}return i.copyWithin(0,n,t*n),i.fill(0,n*r,t*n),e[ve]=r,e.addEvent(),o}},push(...e){const t=this[xe],i=t.getComponents(),n=t[ve],s=e.length,r=t[Ne]((n+s)*i);if(1===i){const i=t.getValueType();for(let t=0,o=n;t<s;++t,++o)r[o]=i(e[t])}else for(let t=n*i,o=0;o<s;++o){const n=e[o];for(let e=0;e<i;++e,++t)r[t]=n[e]}return t[ve]+=s,t.addEvent(),t[ve]},pop(){const e=this[xe],t=e[ve];if(t){const i=e.getValue(),n=e.getComponents(),s=e.getValueType(),r=t-1;let o;if(1===n)o=s(i[t-1]);else{const t=e[Te];for(let e=0,s=r*n;e<n;++e,++s)t[e]=i[s];o=new s(...t)}return i.fill(0,r*n,t*n),e[ve]=r,e.addEvent(),o}},splice(e,t,...i){const n=this[xe],s=n[ve];if(0===arguments.length)return new n.constructor;(e|=0)<0&&(e+=s),e=we.A.clamp(e,0,s),arguments.length<2&&(t=s),e+(t|=0)>s&&(t=s-e),t=Math.max(t,0);const r=n[Ee](e,e+t);return i.length&&n[Oe](e,i),n.addEvent(),r},[Oe](e,t){const i=this[xe],n=i.getComponents(),s=i[ve],r=t.length,o=i[Ne]((s+r)*n);if(e*=n,o.copyWithin(e+r*n,e,s*n),1===n){const n=i.getValueType();for(let i=0,s=e;i<r;++i,++s)o[s]=n(t[i])}else for(let i=0,s=e;i<r;++i){const e=t[i];for(let t=0;t<n;++t,++s)o[s]=e[t]}i[ve]+=r},[Ee](e,t){const i=this[xe],n=i.getValue(),s=i.getComponents(),r=t-e,o=i[ve],a=o-r,l=i[be].slice(e,t);return e*=s,t*=s,n.copyWithin(e,t,o*s),n.fill(0,a*s,o*s),i[ve]=a,s>1&&(i[Se].length=a),i.addEvent(),l},resize(e,t,i){const n=this[xe],s=n[ve],r=n.getComponents();if(e<0)throw new RangeError("Invalid array length");let o=n.getValue();return n[ve]=e,e<s?(o.fill(0,e*r,s*r),r>1&&(n[Se].length=e),i||n.addEvent()):e>s&&(o=n[Ne](e*r),void 0!==t&&this[Ce](t,s,e),i||n.addEvent()),o},[Ne](e){const t=this[xe],i=t.getValue();if(e<=i.length)return i;const n=we.A.nextPowerOfTwo(e),s=new(t.getArrayType())(n);return s.set(i),ue.A.prototype.set.call(t,s),s},shrinkToFit(){const e=this[xe],t=e.getValue(),i=e[ve]*e.getComponents();if(t.length===i)return t;const n=t.subarray(0,i);return ue.A.prototype.set.call(e,n),n},concat(...e){const t=this.copy(),i=t[xe],n=i.getComponents(),s=i[ve]+e.reduce((e,t)=>e+t.length,0),r=i[Ne](s*n);let o=i[ve]*n;for(const t of e)r.set(t.shrinkToFit(),o),o+=t.length*n;return i[ve]=s,t},flat(){const e=this[xe],t=e.shrinkToFit(),i=e.getComponents(),n=e.getValueType();return 1===i?Array.from(t,e=>n(e)):Array.from(t)},flatMap(...e){return this.map(...e).flat()},[Ce](e,t=0,i=this.length){const n=this[xe],s=n[ve],r=n.getValue(),o=n.getComponents();if(-s<=t&&t<0&&(t+=s),t<-s&&(t=0),!(t>=s||(-s<=i&&i<0&&(i+=s),i<-s&&(i=0),i>=s&&(i=s),t>=i))){if(1===o){const s=n.getValueType();r.fill(s(e),t*o,i*o)}else{const n=t*o,s=i*o;for(let t=n,i=0;i<o;++t,++i)r[t]=e[i];let a=n+o,l=o;for(;a<s;){const e=a+l>s?s-a:l;r.copyWithin(a,n,n+e),a+=l,l<<=1}}return n[be]}},fill(e,t=0,i=this.length){const n=this[xe];return this[Ce](e,t,i),n.addEvent(),n[be]},reverse(){const e=this[xe],t=e.getValue(),i=e.getComponents(),n=e[ve]*i,s=Math.floor(e[ve]/2)*i;if(1===i)for(let e=0;e<s;++e){const i=n-e-1,s=t[e];t[e]=t[i],t[i]=s}else for(let e=0;e<s;e+=i)for(let s=0;s<i;++s){const r=e+s,o=n-e-1-(i-s-1),a=t[r];t[r]=t[o],t[o]=a}return e.addEvent(),e[be]},sort(e){const t=this[xe],i=t.getValue(),n=t.getComponents(),s=t[ve];if(1===n){const n=t.getValueType(),r=e?(t,i)=>e(n(t),n(i)):we.A.cmp;t.set(i.subarray(0,s).sort(r))}else{const r=Array.from(t[be],e=>e.copy()).sort(e??((e,t)=>{for(let i=0;i<n;++i){if(e[i]<t[i])return-1;if(t[i]<e[i])return 1}return 0}));for(let e=0;e<s;++e){const t=r[e];for(let s=0,r=e*n;s<n;++s,++r)i[r]=t[s]}}return t.addEvent(),t[be]},valueOf(){return this[be]},toStream(e){const t=this[xe],i=t.getValue(),n=t[ve],s=t.getComponents(),r=new(t.getSingleType());switch(r.setUnit(t.getUnit()),n){case 0:e.string+="[",e.TidySpace(),e.string+="]";break;case 1:if(1===s)r.set(i[0]),r.toStream(e);else{for(let e=0,t=0;e<s;++e,++t)r[e]=i[t];r.toStream(e)}break;default:{const t=n-1;if(e.string+="[",e.ListStart(),e.IncIndent(),1===s){for(let n=0;n<t;++n)e.ListIndent(),r.set(i[n*s]),r.toStream(e),e.Comma(),e.ListBreak();e.ListIndent(),r.set(i[t*s]),r.toStream(e)}else{for(let n=0;n<t;++n){e.ListIndent();for(let e=0,t=n*s;e<s;++e,++t)r[e]=i[t];r.toStream(e),e.Comma(),e.ListBreak()}e.ListIndent();for(let e=0,n=t*s;e<s;++e,++n)r[e]=i[n];r.toStream(e)}e.ListEnd(),e.DecIndent(),e.ListIndent(),e.string+="]";break}}},toVRMLStream(e){this.toStream(e)},toXMLStream(e){const t=this[xe],i=t[ve];if(i){const n=t.getValue(),s=t.getComponents(),r=new(t.getSingleType()),o=i-1;if(r.setUnit(t.getUnit()),1===s){for(let t=0;t<o;++t)r.set(n[t*s]),r.toXMLStream(e),e.Comma(),e.TidySpace();r.set(n[o*s]),r.toXMLStream(e)}else{for(let t=0;t<o;++t){for(let e=0,i=t*s;e<s;++e,++i)r[e]=n[i];r.toXMLStream(e),e.Comma(),e.TidySpace()}for(let e=0,t=o*s;e<s;++e,++t)r[e]=n[t];r.toXMLStream(e)}}},toJSONStream(e){const t=this[xe],i=t.length;if(i){const n=t.getValue(),s=t.getComponents(),r=new(t.getSingleType()),o=i-1;if(r.setUnit(t.getUnit()),e.string+="[",e.ListBreak(),e.IncIndent(),1===s){for(let t=0;t<o;++t)e.ListIndent(),r.set(n[t*s]),r.toJSONStreamValue(e),e.string+=",",e.ListBreak();e.ListIndent(),r.set(n[o*s]),r.toJSONStreamValue(e)}else{for(let t=0;t<o;++t){e.ListIndent();for(let e=0,i=t*s;e<s;++e,++i)r[e]=n[i];r.toJSONStreamValue(e),e.string+=",",e.ListBreak()}e.ListIndent();for(let e=0,t=o*s;e<s;++e,++t)r[e]=n[t];r.toJSONStreamValue(e)}e.ListBreak(),e.DecIndent(),e.ListIndent(),e.string+="]"}else e.string+="[",e.TidySpace(),e.string+="]"},dispose(){ue.A.prototype.dispose.call(this[xe])}});for(const e of Object.keys(Fe.prototype))Object.defineProperty(Fe.prototype,e,{enumerable:!1});function Me(e,t,i,n){const s=new n,r=s.getValue(),o=t*i;return Object.defineProperties(s,{addEvent:{value:Pe.bind(e,o,i,r),configurable:!0},getValue:{value:Re.bind(e,o,i,r),configurable:!0}}),s}function Re(e,t,i){const n=this.getValue();for(let s=0;s<t;++s,++e)i[s]=n[e];return i}function Pe(e,t,i){const n=this.getValue();for(let s=0;s<t;++s,++e)n[e]=i[s];this.addEvent()}Object.defineProperty(Fe.prototype,"length",{get(){return this[ve]},set(e){const t=this[xe];t.resize(e,t.getSingleValue())}});const Ve=Fe,De=r.A.add("X3DTypedArrayField",Ve),{SFBool:Le,SFDouble:Be,SFFloat:ke,SFInt32:je,SFString:Ue,SFTime:Xe}=u,{SFMatrix3d:ze,SFMatrix3f:Ge}=M,{SFMatrix4d:He,SFMatrix4f:$e}=D,{SFVec2d:Ye,SFVec2f:qe}=oe,{SFVec3d:We,SFVec3f:Ke}=z,{SFVec4d:Ze,SFVec4f:Qe}=ce;function Je(...e){return ye.call(this,e)}Object.assign(Object.setPrototypeOf(Je.prototype,ye.prototype),{getSingleType:()=>L.A,copy(e){if(e){const t=new Je;for(const i of this.getValue())t.push(i.copy(e));return t}return ye.prototype.copy.call(this)},toStream(e){const t=this.getTarget().getValue(),i=t.length;switch(i){case 0:e.string+="[",e.TidySpace(),e.string+="]";break;case 1:t[0].toStream(e);break;default:e.string+="[",e.TidyBreak(),e.IncIndent();for(let n=0;n<i;++n)e.Indent(),t[n].toStream(e),e.TidyBreak();e.DecIndent(),e.Indent(),e.string+="]"}},toVRMLStream(e){const t=this.getTarget().getValue();switch(t.length){case 0:e.string+="[",e.TidySpace(),e.string+="]";break;case 1:t[0].toVRMLStream(e);break;default:e.string+="[",e.TidyBreak(),e.IncIndent();for(const i of t)e.Indent(),i.toVRMLStream(e),e.TidyBreak();e.DecIndent(),e.Indent(),e.string+="]"}},toXMLStream(e){const t=this.getTarget(),i=t.length;if(i){const n=t.getValue(),s=i-1;for(let t=0;t<s;++t){const i=n[t].getValue();i?i.toXMLStream(e):(e.openTag("NULL"),e.containerField(),e.closeTag("NULL")),e.TidyBreak()}const r=n.at(-1).getValue();r?r.toXMLStream(e):(e.openTag("NULL"),e.containerField(),e.closeTag("NULL"))}},toJSONStream(e){const t=this.getTarget(),i=t.length;if(i){const n=t.getValue(),s=i-1;e.string+="[",e.TidyBreak(),e.IncIndent();for(let t=0;t<s;++t)e.Indent(),n[t]?n[t].toJSONStreamValue(e):e.string+="null",e.string+=",",e.TidyBreak();e.Indent(),n.at(-1)?n.at(-1).toJSONStreamValue(e):e.string+="null",e.TidyBreak(),e.DecIndent(),e.Indent(),e.string+="]"}else e.string+="[",e.TidySpace(),e.string+="]"},dispose(){const e=this.getTarget();e.resize(0,void 0,!0),e.processInterests(),ye.prototype.dispose.call(e)}});for(const e of Object.keys(Je.prototype))Object.defineProperty(Je.prototype,e,{enumerable:!1});function et(...e){return ye.call(this,e)}Object.defineProperties(Je,{type:{value:s.A.MFNode,enumerable:!0},typeName:{value:"MFNode",enumerable:!0}}),Object.assign(Object.setPrototypeOf(et.prototype,ye.prototype),{getSingleType:()=>Ue,toXMLStream(e,t=!1){const i=this.getTarget(),n=i.length;if(n){const s=i.getValue();for(let i=0,r=n-1;i<r;++i)e.string+='"',s[i].toXMLStream(e,t),e.string+='"',e.Comma(),e.TidySpace();e.string+='"',s.at(-1).toXMLStream(e,t),e.string+='"'}}});for(const e of Object.keys(et.prototype))Object.defineProperty(et.prototype,e,{enumerable:!1});function tt(...e){return ye.call(this,e)}Object.defineProperties(et,{type:{value:s.A.MFString,enumerable:!0},typeName:{value:"MFString",enumerable:!0}}),Object.assign(Object.setPrototypeOf(tt.prototype,ye.prototype),{getSingleType:()=>ft});for(const e of Object.keys(tt.prototype))Object.defineProperty(tt.prototype,e,{enumerable:!1});function it(e,t,i,n,r,o){function a(...e){return De.call(this,e)}Object.assign(Object.setPrototypeOf(a.prototype,De.prototype),{getSingleValue:()=>o,getSingleType:()=>t,getValueType:()=>i,getArrayType:()=>n,getComponents:()=>r});for(const e of Object.keys(a.prototype))Object.defineProperty(a.prototype,e,{enumerable:!1});return Object.defineProperties(a,{type:{value:s.A[e],enumerable:!0},typeName:{value:e,enumerable:!0}}),a}Object.defineProperties(tt,{type:{value:s.A.MFImage,enumerable:!0},typeName:{value:"MFImage",enumerable:!0}});const nt=e=>e,st={MFBool:it("MFBool",Le,Boolean,Uint8Array,1),MFColor:it("MFColor",_,_,Float32Array,3),MFColorRGBA:it("MFColorRGBA",O,O,Float32Array,4),MFDouble:it("MFDouble",Be,nt,Float64Array,1),MFFloat:it("MFFloat",ke,nt,Float32Array,1),MFImage:tt,MFInt32:it("MFInt32",je,nt,Int32Array,1),MFMatrix3d:it("MFMatrix3d",ze,ze,Float64Array,9,C.A.IDENTITY),MFMatrix3f:it("MFMatrix3f",Ge,Ge,Float32Array,9,C.A.IDENTITY),MFMatrix4d:it("MFMatrix4d",He,He,Float64Array,16,R.A.IDENTITY),MFMatrix4f:it("MFMatrix4f",$e,$e,Float32Array,16,R.A.IDENTITY),MFNode:Je,MFRotation:it("MFRotation",ie,ie,Float64Array,4,G.A.IDENTITY),MFString:et,MFTime:it("MFTime",Xe,nt,Float64Array,1,-1),MFVec2d:it("MFVec2d",Ye,Ye,Float64Array,2),MFVec2f:it("MFVec2f",qe,qe,Float32Array,2),MFVec3d:it("MFVec3d",We,We,Float64Array,3),MFVec3f:it("MFVec3f",Ke,Ke,Float32Array,3),MFVec4d:it("MFVec4d",Ze,Ze,Float64Array,4,ae.A.W_AXIS),MFVec4f:it("MFVec4f",Qe,Qe,Float32Array,4,ae.A.W_AXIS)},rt=r.A.add("ArrayFields",st),ot=rt.MFInt32;function at(e,t,i,n){this.width=Math.max(0|e,0),this.height=Math.max(0|t,0),this.comp=we.A.clamp(0|i,0,4),this.array=new ot,this.array.setValue(n),this.array.length=this.width*this.height}Object.assign(at.prototype,{copy(){return new at(this.width,this.height,this.comp,this.array)},equals(e){return this.width===e.width&&this.height===e.height&&this.comp===e.comp&&this.array.equals(e.array)},assign(e){this.width=e.width,this.height=e.height,this.comp=e.comp,this.array.assign(e.array)},set(e,t,i,n){this.width=0|e,this.height=0|t,this.comp=0|i,this.array.assign(n)},setWidth(e){this.width=Math.max(0|e,0),this.array.length=this.width*this.height},getWidth(){return this.width},setHeight(e){this.height=Math.max(0|e,0),this.array.length=this.width*this.height},getHeight(){return this.height},setComp(e){this.comp=we.A.clamp(0|e,0,4)},getComp(){return this.comp},setArray(e){this.array.setValue(e),this.array.length=this.width*this.height},getArray(){return this.array}});const lt=Symbol();function ht(e,t,i,s){switch(arguments.length){case 0:n.A.call(this,new at(0,0,0,new ot));break;case 1:n.A.call(this,arguments[0]);break;case 3:n.A.call(this,new at(e,t,i,new ot));break;case 4:n.A.call(this,new at(e,t,i,s));break;default:throw new Error("Invalid arguments.")}this.getValue().getArray().addParent(this),this.addInterest(lt,this)}Object.assign(Object.setPrototypeOf(ht.prototype,n.A.prototype),{[lt](){this.getValue().getArray().length=this.width*this.height},*[Symbol.iterator](){yield this.width,yield this.height,yield this.comp,yield*this.array},copy(){return new ht(this.getValue().copy())},equals(e){return this.getValue().equals(e.getValue())},isDefaultValue(){return 0===this.width&&0===this.height&&0===this.comp},set(e){this.getValue().assign(e)},toStream(e){const t=this.width,i=this.height,n=new Uint32Array(this.array.getValue().buffer);e.string+=t,e.Space(),e.string+=i,e.Space(),e.string+=this.comp,e.AttribBreak(),e.IncIndent();for(let s=0;s<i;++s){e.ListIndent();const r=s*t;for(let i=0;i<t;++i)e.string+="0x",e.string+=n[i+r].toString(16),i!==t-1&&e.Space();s!==i-1&&e.AttribBreak()}e.DecIndent()},toVRMLStream(e){this.toStream(e)},toXMLStream(e){this.toStream(e)},toJSONStream(e){e.string+="[",e.ListBreak(),e.IncIndent(),e.ListIndent(),this.toJSONStreamValue(e),e.DecIndent(),e.ListBreak(),e.ListIndent(),e.string+="]"},toJSONStreamValue(e){const t=this.width,i=this.height,n=new Uint32Array(this.array.getValue().buffer),s=this.array.length;if(e.string+=t,e.string+=",",e.TidySpace(),e.string+=i,e.string+=",",e.TidySpace(),e.string+=this.comp,e.string+=",",t&&i){e.ListBreak(),e.IncIndent();for(let r=0;r<i;++r){e.ListIndent();const o=r*t;for(let i=0;i<t;++i)e.string+=n[i+o],i+o!==s-1&&(e.string+=","),i!==t-1&&e.TidySpace();r!==i-1&&e.ListBreak()}e.DecIndent()}}});for(const e of Object.keys(ht.prototype))Object.defineProperty(ht.prototype,e,{enumerable:!1});const ct={get(){return this.getValue().getWidth()},set(e){this.getValue().setWidth(e),this.addEvent()}},ut={get(){return this.getValue().getHeight()},set(e){this.getValue().setHeight(e),this.addEvent()}},dt={get(){return this.getValue().getComp()},set(e){this.getValue().setComp(e),this.addEvent()}},pt={get(){return this.getValue().getArray()},set(e){this.getValue().setArray(e),this.addEvent()}};Object.defineProperties(ht.prototype,{x:ct,y:ut,width:Object.assign({enumerable:!0},ct),height:Object.assign({enumerable:!0},ut),comp:Object.assign({enumerable:!0},dt),array:Object.assign({enumerable:!0},pt)}),Object.defineProperties(ht,{type:{value:s.A.SFImage,enumerable:!0},typeName:{value:"SFImage",enumerable:!0}});const gt=ht,ft=r.A.add("SFImage",gt),mt={SFColor:_,SFColorRGBA:O,SFImage:ft,SFNode:L.A,SFRotation:ie,...u,...M,...D,...oe,...z,...ce,...rt},At=r.A.add("Fields",mt)},567:(e,t,i)=>{"use strict";i.d(t,{A:()=>f});var n=i(4559),s=i(6707);const{interval:r,degrees:o}=n.A,a=Symbol.for("X_ITE.Color3.r"),l=Symbol.for("X_ITE.Color3.g"),h=Symbol.for("X_ITE.Color3.b");function c(e=0,t=e,i=t){this[a]=e,this[l]=t,this[h]=i}Object.assign(c.prototype,{*[Symbol.iterator](){yield this[a],yield this[l],yield this[h]},copy(){const e=Object.create(c.prototype);return e[a]=this[a],e[l]=this[l],e[h]=this[h],e},assign(e){return this[a]=e[a],this[l]=e[l],this[h]=e[h],this},set(e=0,t=e,i=t){return this[a]=e,this[l]=t,this[h]=i,this},equals(e){return this[a]===e[a]&&this[l]===e[l]&&this[h]===e[h]},getHSV(e=[]){let t,i,n;const s=this[a],r=this[l],o=this[h],c=Math.min(s,r,o),u=Math.max(s,r,o);n=u;const d=u-c;return 0!==u&&0!==d?(i=d/u,t=s===u?(r-o)/d:r===u?2+(o-s)/d:4+(s-r)/d,t*=Math.PI/3,t<0&&(t+=2*Math.PI)):i=t=0,e[0]=t,e[1]=i,e[2]=n,e},setHSV(e,t,i){if(t=Math.max(t,0),i=Math.max(i,0),0===t)this[a]=this[l]=this[h]=i;else{const n=o(r(e,0,2*Math.PI))/60,s=Math.floor(n),c=n-s,u=i*(1-t),d=i*(1-t*c),p=i*(1-t*(1-c));switch(s%6){case 0:this[a]=i,this[l]=p,this[h]=u;break;case 1:this[a]=d,this[l]=i,this[h]=u;break;case 2:this[a]=u,this[l]=i,this[h]=p;break;case 3:this[a]=u,this[l]=d,this[h]=i;break;case 4:this[a]=p,this[l]=u,this[h]=i;break;default:this[a]=i,this[l]=u,this[h]=d}}return this},linearToSRGB(e=new c){return e[a]=Math.pow(this[a],1/2.2),e[l]=Math.pow(this[l],1/2.2),e[h]=Math.pow(this[h],1/2.2),e},sRGBToLinear(e=new c){return e[a]=Math.pow(this[a],2.2),e[l]=Math.pow(this[l],2.2),e[h]=Math.pow(this[h],2.2),e},toString(){return this[a]+" "+this[l]+" "+this[h]}});for(const e of Object.keys(c.prototype))Object.defineProperty(c.prototype,e,{enumerable:!1});const u={get(){return this[a]},set(e){this[a]=e}},d={get(){return this[l]},set(e){this[l]=e}},p={get(){return this[h]},set(e){this[h]=e}};Object.defineProperties(c.prototype,{length:{value:3},0:u,1:d,2:p,r:Object.assign({enumerable:!0},u),g:Object.assign({enumerable:!0},d),b:Object.assign({enumerable:!0},p)}),Object.assign(c,{BLACK:Object.freeze(new c),WHITE:Object.freeze(new c(1)),HSV(e,t,i){const n=Object.create(this.prototype);return n.setHSV(e,t,i),n},lerp(e,t,i,n){let[s,r,o]=e,[a,l,h]=t;0===r&&(s=a),0===l&&(a=s);const c=Math.abs(a-s);if(c<=Math.PI)return n[0]=s+i*(a-s),n[1]=r+i*(l-r),n[2]=o+i*(h-o),n;const u=2*Math.PI,d=(u-c)*i;let p=s<a?s-d:s+d;return p<0?p+=u:p>u&&(p-=u),n[0]=p,n[1]=r+i*(l-r),n[2]=o