@ranchhandrobotics/babylon_ros 0.1.7
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/LICENSE +21 -0
- package/README.md +224 -0
- package/dist/ros.js +3 -0
- package/dist/ros.js.LICENSE.txt +1686 -0
- package/dist/ros.js.map +1 -0
- package/package.json +75 -0
package/dist/ros.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see ros.js.LICENSE.txt */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babylonjs")):"function"==typeof define&&define.amd?define(["babylonjs"],t):"object"==typeof exports?exports.babylon_ros=t(require("babylonjs")):e.babylon_ros=t(e._)}(this,(e=>(()=>{var t={471:function(e,t,i){var r;r=e=>(()=>{"use strict";var t={43:t=>{t.exports=e}},i={};function r(e){var n=i[e];if(void 0!==n)return n.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{DAEFileLoader:()=>Et,Register:()=>wt});var o,a=r(43);class s{constructor(e){this.log=e}isInstanceOf(e,t){return e._className.indexOf("|"+t+"|")>-1}}!function(e){e[e.Debug=1]="Debug",e[e.Trace=2]="Trace",e[e.Info=3]="Info",e[e.Warning=4]="Warning",e[e.Error=5]="Error",e[e.Exception=6]="Exception"}(o||(o={}));class l{constructor(){this.onmessage=void 0}write(e,t){this.onmessage&&this.onmessage(e,t)}}class c{constructor(){}write(e,t){console.log(function(e){switch(e){case o.Debug:return"DEBUG";case o.Trace:return"TRACE";case o.Info:return"INFO";case o.Warning:return"WARNING";case o.Error:return"ERROR";case o.Exception:return"EXCEPTION";default:return"OTHER"}}(t)+": "+e)}}class u{constructor(e,t){this.log=e,this.level=t}write(e,t){t>this.level&&this.log.write(e,t)}}class h{constructor(){this.url=""}getUrl(){throw new Error("not implemented")}resolve(e){throw new Error("not implemented")}}class d extends h{constructor(e){super(),this.url=e.trim().replace(/^#/,"")}getUrl(){return this.url}resolve(e){var t=e.ids[this.url];null!=t?this.target=t:e.log?.write("Could not find URL target with URL "+this.url,o.Warning)}}class _ extends h{constructor(e,t){super(),this.url=e,this.scope=t}getUrl(){return this.url}resolve(e){for(var t=this.scope,i=void 0;null==i&&t;)i=t.fxChildren[this.url],t=t.fxParent;i?this.target=i:e.log?.write("Could not find FX target with URL "+this.url,o.Warning)}}class f extends h{constructor(e,t){super(),this.url=e,this.parentId=t,this.sids=[],this.indices=[],this.dotSyntax=!1,this.arrSyntax=!1,this._parseUrl()}getUrl(){return this.url}_parseUrl(){var e=this.url.split("/");for(this.id=e.shift(),"."===this.id&&(this.id=this.parentId);e.length>1;)(t=e.shift())&&this.sids.push();if(e.length>0){var t,i=e[0],r=i.indexOf(".")>=0,n=i.indexOf("(")>=0;if(r)(t=(e=i.split(".")).shift())&&this.sids?.push(t),this.member=e.shift(),this.dotSyntax=!0;else if(n){var o,a=i.split("("),s=a.shift();s&&this.sids.push(s),this.indices=[];for(var l=0,c=a.length;l<c;l++)o=a[l],this.indices.push(parseInt(o.replace(/\)/,""),10));this.arrSyntax=!0}else this.sids.push(i)}}static findSidTarget(e,t,i,r){var n={result:void 0,warning:void 0};if(null==t)return n.result=void 0,n.warning="Could not resolve SID target "+i.join("/")+", missing root element",n;for(var o=t,a=void 0,s=0,l=i.length;s<l;s++){for(var c=i[s],u=[o];0!==u.length;){var h=u.shift();if(h){if(h.sid===c){a=h;break}var d=h.sidChildren;if(null!=d)for(var _=0,f=d.length;_<f;_++){var p=d[_];u.push(p)}}}if(!a)return n.result=void 0,n.warning="Could not resolve SID target "+i.join("/")+", missing SID part "+c,n;o=a}return n.result=a,n.warning="",n}resolve(e){var t;if(null!=this.id)if(null!=(t=e.ids[this.id])){var i=f.findSidTarget(this.url,t,this.sids,e);i.warning&&e.log?.write(i.warning,o.Warning),this.target=i.result}else e.log?.write("Could not resolve SID #"+this.url+", could not find root element "+this.id,o.Warning);else e.log?.write("Could not resolve SID #"+this.url+", link has no root ID",o.Warning)}}class p extends s{constructor(e){super(e),this.totalBytes=0,this.loadedBytes=0,this.ids={},this.links=[]}getAttributeNamed(e,t){return e.getAttributeNode(t)||void 0}getAttributeFromChildNodesNamed(e,t){e.forEach((e=>{var i=this.getAttributeNamed(e,t);if(i)return i}))}getTextContent(e){return e.textContent||e.firstChild.getNodeValue()+""}getFloatsContent(e){return this.strToFloats(this.getTextContent(e))}getFloatContent(e){return parseFloat(this.getTextContent(e))}getIntsContent(e){return this.strToInts(this.getTextContent(e))}getUintsContent(e){return this.strToUints(this.getTextContent(e))}getIntContent(e){return parseInt(this.getTextContent(e),10)}getBoolsContent(e){return this.strToBools(this.getTextContent(e))}getStringsContent(e){return this.strToStrings(this.getTextContent(e))}getAttributeAsFloat(e,t,i,r){var n=this.getAttributeFromChildNodesNamed(e.childNodes,t);return n?parseFloat(n.value):r?(this.log?.write("Element "+e.nodeName+" is missing required float attribute "+t+". Using default value "+i+".",o.Error),i):i}getAttributeAsInt(e,t,i,r){var n=this.getAttributeNamed(e,t);return n?parseInt(n.value,10):r?(this.log?.write("Element "+e.nodeName+" is missing required integer attribute "+t+". Using default value "+i+".",o.Error),i):i}getAttributeAsString(e,t,i,r){var n=this.getAttributeNamed(e,t);return n?n.value+"":r?(this.log?.write("Element "+e.nodeName+" is missing required string attribute "+t+". Using default value "+i+".",o.Error),i||""):i||""}createUrlLink(e){var t=new d(e);return this.links?.push(t),t}createSidLink(e,t){var i=new f(e,t);return this.links?.push(i),i}createFxLink(e,t){var i=new _(e,t);return this.links?.push(i),i}getAttributeAsUrlLink(e,t,i){var r=this.getAttributeNamed(e,t);return r?this.createUrlLink(r.value):i?void this.log?.write("Element "+e.nodeName+" is missing required URL link attribute "+t+".",o.Error):void 0}getAttributeAsSidLink(e,t,i,r){var n=this.getAttributeNamed(e,t);return n?this.createSidLink(n.value,i):r?void this.log?.write("Element "+e.nodeName+" is missing required SID link attribute "+t+".",o.Error):void 0}getAttributeAsFxLink(e,t,i,r){var n=this.getAttributeNamed(e,t);return n?this.createFxLink(n.value,i):r?void this.log?.write("Element "+e.nodeName+" is missing required FX link attribute "+t+".",o.Error):void 0}strToStrings(e){return e.length>0?e.trim().split(/\s+/):[]}strToFloats(e){for(var t=this.strToStrings(e),i=new Float32Array(t.length),r=t.length,n=0;n<r;++n)i[n]=parseFloat(t[n]);return i}strToInts(e){for(var t=this.strToStrings(e),i=new Int32Array(t.length),r=t.length,n=0;n<r;++n)i[n]=parseInt(t[n],10);return i}strToUints(e){for(var t=this.strToStrings(e),i=new Uint32Array(t.length),r=t.length,n=0;n<r;++n)i[n]=parseInt(t[n],10);return i}strToBools(e){for(var t=this.strToStrings(e),i=new Uint8Array(t.length),r=t.length,n=0;n<r;++n)i[n]="true"===t[n]||"1"===t[n]?1:0;return i}strToColor(e){var t=this.strToFloats(e);return 4===t.length?t:(this.log?.write("Skipped color element because it does not contain 4 numbers",o.Error),new Float32Array)}registerUrlTarget(e,t){var i=e.id;null!=i?null==this.ids[i]?this.ids[i]=e:this.log?.write("There is already an object with ID "+i+". IDs must be globally unique.",o.Error):t&&this.log?.write("Object has no ID, object was not registered as a URL target.",o.Error)}registerFxTarget(e,t){var i=e.sid;null!=i?null==t.fxChildren[i]?(e.fxParent=t,t.fxChildren[i]=e):this.log?.write("There is already an FX target with SID "+i+".",o.Error):this.log?.write("Cannot add a FX target: object has no SID.",o.Error)}registerSidTarget(e,t){t.sidChildren.push(e)}getNodePath(e){for(var t="<"+e.nodeName+">",i=1;null!=e.parentNode&&"COLLADA"!==(e=e.parentNode).nodeName.toUpperCase();){if(i>=10){t=".../"+t;break}t="<"+e.nodeName+">/"+t,i+=1}return t}reportUnexpectedChild(e){this.log?.write("Skipped unexpected element "+this.getNodePath(e)+".",o.Warning)}reportUnhandledChild(e){this.log?.write("Element "+this.getNodePath(e)+" is legal, but not handled by this loader.",o.Trace)}resolveAllLinks(){if(this.links)for(var e=this.links.length,t=0;t<e;++t)this.links[t].resolve(this)}}class m{constructor(){this.id="",this.sid="",this.name="",this.fxChildren={},this.sidChildren=[],this._className="|Element|"}static fromLink(e,t){return m._fromLink(e,"Element",t)}static _fromLink(e,t,i){return e&&e.target?i.isInstanceOf(e.target,t)?e.target:void i.log.write("Link with url "+e.url+" does not point to a "+t+", link target ignored",o.Error):void 0}}function g(e,t){for(var i=e.childNodes,r=i.length,n=0;n<r;n++){var o=i[n]||i.item(n);1===o.nodeType&&t(o)}}class v extends m{constructor(){super(),this.instance=void 0,this._className+="Scene|"}static parse(e,t){var i=new v;return g(e,(function(e){"instance_visual_scene"===e.nodeName?i.instance=t.getAttributeAsUrlLink(e,"url",!0):t.reportUnexpectedChild(e)})),i}}class b extends m{constructor(){super(),this._className+="Channel|"}static parse(e,t,i){var r=new b;return r.source=i.getAttributeAsUrlLink(e,"source",!0),r.target=i.getAttributeAsSidLink(e,"target",t.id,!0),g(e,(function(e){e.nodeName,i.reportUnexpectedChild(e)})),r}}class y extends m{constructor(){super(),this.semantic="",this.offset=0,this.set=0,this._className+="Input|"}static parse(e,t,i){var r=new y;return r.semantic=i.getAttributeAsString(e,"semantic",void 0,!0),r.source=i.getAttributeAsUrlLink(e,"source",!0),t&&(r.offset=i.getAttributeAsInt(e,"offset",0,!0),r.set=i.getAttributeAsInt(e,"set",0,!1)),r}}class x extends m{constructor(){super(),this._className+="Sampler|",this.outputs=[],this.inTangents=[],this.outTangents=[]}static fromLink(e,t){return m._fromLink(e,"Sampler",t)}static parse(e,t){var i=new x;return i.id=t.getAttributeAsString(e,"id",void 0,!1),t.registerUrlTarget(i,!1),g(e,(function(e){if("input"===e.nodeName){var r=y.parse(e,!1,t);x?.addInput(i,r,t)}else t.reportUnexpectedChild(e)})),i}static addInput(e,t,i){switch(t.semantic){case"INPUT":e.input=t;break;case"OUTPUT":e.outputs.push(t);break;case"INTERPOLATION":e.interpolation=t;break;case"IN_TANGENT":e.inTangents.push(t);break;case"OUT_TANGENT":e.outTangents.push(t);break;default:i.log.write("Unknown sampler input semantic "+t.semantic,o.Error)}}}class T extends m{constructor(){super(),this.count=0,this.stride=0,this.offset=0,this._className+="Source|",this.params={}}static fromLink(e,t){if(e)return m._fromLink(e,"Source",t)}static parse(e,t){var i=new T;return i.id=t.getAttributeAsString(e,"id",void 0,!0),i.name=t.getAttributeAsString(e,"name",void 0,!1),t.registerUrlTarget(i,!0),g(e,(function(e){switch(e.nodeName){case"bool_array":i.sourceId=t.getAttributeAsString(e,"id",void 0,!1),i.data=t.getBoolsContent(e);break;case"float_array":i.sourceId=t.getAttributeAsString(e,"id",void 0,!1),i.data=t.getFloatsContent(e);break;case"int_array":i.sourceId=t.getAttributeAsString(e,"id",void 0,!1),i.data=t.getIntsContent(e);break;case"IDREF_array":case"Name_array":i.sourceId=t.getAttributeAsString(e,"id",void 0,!1),i.data=t.getStringsContent(e);break;case"technique_common":T.parseSourceTechniqueCommon(e,i,t);break;case"technique":t.reportUnhandledChild(e);break;default:t.reportUnexpectedChild(e)}})),i}static parseSourceTechniqueCommon(e,t,i){g(e,(function(e){"accessor"===e.nodeName?T.parseAccessor(e,t,i):i.reportUnexpectedChild(e)}))}static parseAccessor(e,t,i){var r=i.getAttributeAsString(e,"source",void 0,!0);t.count=i.getAttributeAsInt(e,"count",0,!0)||0,t.stride=i.getAttributeAsInt(e,"stride",1,!1)||0,t.offset=i.getAttributeAsInt(e,"offset",0,!1)||0,r!=="#"+t.sourceId&&i.log.write("Source "+t.id+" uses a non-local data source, this is not supported",o.Error),g(e,(function(e){"param"===e.nodeName?T.parseAccessorParam(e,t,i):i.reportUnexpectedChild(e)}))}static parseAccessorParam(e,t,i){var r=i.getAttributeAsString(e,"name",void 0,!1),n=i.getAttributeAsString(e,"semantic",void 0,!1),a=i.getAttributeAsString(e,"type",void 0,!0);i.getAttributeAsString(e,"sid",void 0,!1),null!=r&&null!=a?t.params[r]=a:null!=n&&null!=a?t.params[n]=a:null!=a?t.params["unnamed param #"+Object.keys(t.params).length]=a:i.log.write("Accessor param for source "+t.id+" ignored due to missing type",o.Warning)}}class C extends m{constructor(){super(),this._className+="Animation|",this.children=[],this.sources=[],this.samplers=[],this.channels=[]}root(){return null!=this.parent?this.parent.root():this}static parse(e,t){var i=new C;return i.id=t.getAttributeAsString(e,"id",void 0,!1),i.name=t.getAttributeAsString(e,"name",void 0,!1),t.registerUrlTarget(i,!1),g(e,(function(e){switch(e.nodeName){case"animation":var r=C.parse(e,t);r.parent=i,i.children.push(r);break;case"source":i.sources.push(T.parse(e,t));break;case"sampler":i.samplers.push(x.parse(e,t));break;case"channel":i.channels.push(b.parse(e,i,t));break;default:t.reportUnexpectedChild(e)}})),i}}class S extends m{constructor(){super(...arguments),this.children=[]}static parse(e,t){var i=new S;return g(e,(function(e){switch(e.nodeName){case"animation":i.children.push(C.parse(e,t));break;case"extra":t.reportUnhandledChild(e);break;default:t.reportUnexpectedChild(e)}})),i}}class P extends m{constructor(){super(),this.unit=0,this.upAxis="",this._className+="Asset|"}static parse(e,t){var i=new P;return g(e,(function(e){switch(e.nodeName){case"unit":i.unit=t.getAttributeAsFloat(e,"meter",1,!1);break;case"up_axis":i.upAxis=t.getTextContent(e).toUpperCase().charAt(0);break;case"contributor":case"created":case"modified":case"revision":case"title":case"subject":case"keywords":t.reportUnhandledChild(e);break;default:t.reportUnexpectedChild(e)}})),i}}class E extends m{constructor(){super(),this.value=0,this._className+="CameraParam|"}static parse(e,t){var i=new E;return i.sid=t.getAttributeAsString(e,"sid",void 0,!1),i.name=e.nodeName,i.value=parseFloat(t.getTextContent(e)),i}}class w extends m{constructor(){super(),this.type="",this._className+="Camera|",this.params={}}static parse(e,t){var i=new w;return i.id=t.getAttributeAsString(e,"id",void 0,!0),i.name=t.getAttributeAsString(e,"name",void 0,!1),t.registerUrlTarget(i,!1),g(e,(function(e){switch(e.nodeName){case"asset":case"imager":case"extra":t.reportUnhandledChild(e);break;case"optics":w.parseOptics(e,i,t);break;default:t.reportUnexpectedChild(e)}})),i}static parseOptics(e,t,i){g(e,(function(e){switch(e.nodeName){case"technique_common":w.parseTechniqueCommon(e,t,i);break;case"technique":case"extra":i.reportUnhandledChild(e);break;default:i.reportUnexpectedChild(e)}}))}static parseTechniqueCommon(e,t,i){g(e,(function(e){switch(e.nodeName){case"orthographic":case"perspective":w.parseParams(e,t,i);break;default:i.reportUnexpectedChild(e)}}))}static parseParams(e,t,i){t.type=e.nodeName,g(e,(function(e){switch(e.nodeName){case"xmag":case"ymag":case"xfov":case"yfov":case"aspect_ratio":case"znear":case"zfar":var r=E.parse(e,i);i.registerSidTarget(r,t),t.params[r.name]=r;break;case"extra":i.reportUnhandledChild(e);break;default:i.reportUnexpectedChild(e)}}))}}class I extends m{constructor(){super(...arguments),this.children=[]}static parse(e,t){var i=new I;return g(e,(function(e){switch(e.nodeName){case"camera":i.children.push(w.parse(e,t));break;case"extra":t.reportUnhandledChild(e);break;default:t.reportUnexpectedChild(e)}})),i}}class M extends m{constructor(){super(),this._className+="Morph|"}static parse(e,t){var i=new M;return t.log.write("Morph controllers not implemented",o.Error),i}}class O extends m{constructor(){super(),this._className+="Joints|"}static parse(e,t){var i=new O,r=[];return g(e,(function(e){if("input"===e.nodeName){var n=y.parse(e,!1,t);O.addInput(i,n,t),r.push(n)}else t.reportUnexpectedChild(e)})),i}static addInput(e,t,i){switch(t.semantic){case"JOINT":e.joints=t;break;case"INV_BIND_MATRIX":e.invBindMatrices=t;break;default:i.log?.write("Unknown joints input semantic "+t.semantic,o.Error)}}}class A extends m{constructor(){super(),this.vcount=new Int32Array,this.v=new Int32Array,this.joints=void 0,this.weights=void 0,this.count=0,this._className+="VertexWeights|",this.inputs=[]}static parse(e,t){var i=new A;return i.count=t.getAttributeAsInt(e,"count",0,!0),g(e,(function(e){switch(e.nodeName){case"input":var r=y.parse(e,!0,t);A.addInput(i,r,t);break;case"vcount":i.vcount=t.getIntsContent(e);break;case"v":i.v=t.getIntsContent(e);break;default:t.reportUnexpectedChild(e)}})),i}static addInput(e,t,i){switch(t.semantic){case"JOINT":e.joints=t;break;case"WEIGHT":e.weights=t;break;default:i.log.write("Unknown vertex weights input semantic "+t.semantic,o.Error)}}}class R extends m{constructor(){super(),this.bindShapeMatrix=new Float32Array,this._className+="Skin|"}static parse(e,t){var i=new R;return i.source=t.getAttributeAsUrlLink(e,"source",!0),g(e,(function(e){switch(e.nodeName){case"bind_shape_matrix":i.bindShapeMatrix=t.getFloatsContent(e);break;case"source":i.sources?.push(T.parse(e,t));break;case"joints":i.joints=O.parse(e,t);break;case"vertex_weights":i.vertexWeights=A.parse(e,t);break;default:t.reportUnexpectedChild(e)}})),i}}class L extends m{constructor(){super(),this._className+="Controller|"}static fromLink(e,t){return m._fromLink(e,"Controller",t)}static parse(e,t){var i=new L;return i.id=t.getAttributeAsString(e,"id",void 0,!0),i.name=t.getAttributeAsString(e,"name",void 0,!1),t.registerUrlTarget(i,!0),g(e,(function(e){switch(e.nodeName){case"skin":null!=i.skin&&t.log.write("Controller "+i.id+" has multiple skins",o.Error),i.skin=R.parse(e,t);break;case"morph":null!=i.morph&&t.log.write("Controller "+i.id+" has multiple morphs",o.Error),i.morph=M.parse(e,t);break;default:t.reportUnexpectedChild(e)}})),i}}class B extends m{static parse(e,t){var i=new B;return g(e,(function(e){switch(e.nodeName){case"controller":i.children.push(L.parse(e,t));break;case"extra":t.reportUnhandledChild(e);break;default:t.reportUnexpectedChild(e)}})),i}}class F extends m{constructor(){super(),this.wrapS="",this.wrapT="",this.minFilter="",this.magFilter="",this.mipmapMaxLevel=0,this.mipmapBias=0,this._className+="EffectSampler|"}static fromLink(e,t){return m._fromLink(e,"EffectSampler",t)}static parse(e,t,i){var r=new F;return g(e,(function(e){switch(e.nodeName){case"source":r.surface=i.createFxLink(i.getTextContent(e),t);break;case"instance_image":r.image=i.getAttributeAsUrlLink(e,"url",!0);break;case"wrap_s":r.wrapS=i.getTextContent(e);break;case"wrap_t":r.wrapT=i.getTextContent(e);break;case"minfilter":r.minFilter=i.getTextContent(e);break;case"magfilter":r.magFilter=i.getTextContent(e);break;case"border_color":r.borderColor=i.getFloatsContent(e);break;case"mipmap_maxlevel":r.mipmapMaxLevel=i.getIntContent(e);break;case"mipmap_bias":r.mipmapBias=i.getFloatContent(e);break;default:i.reportUnexpectedChild(e)}})),r}}class D extends m{constructor(){super(),this.type="",this.format="",this.size=new Float32Array,this.viewportRatio=new Float32Array,this.mipLevels=0,this.mipmapGenerate=!1,this._className+="EffectSurface|"}static fromLink(e,t){return m._fromLink(e,"EffectSurface",t)}static parse(e,t,i){var r=new D;return r.type=i.getAttributeAsString(e,"type",void 0,!0),g(e,(function(e){switch(e.nodeName){case"init_from":r.initFrom=i.createUrlLink(i.getTextContent(e));break;case"format":r.format=i.getTextContent(e);break;case"size":r.size=i.getFloatsContent(e);break;case"viewport_ratio":r.viewportRatio=i.getFloatsContent(e);break;case"mip_levels":r.mipLevels=i.getIntContent(e);break;case"mipmap_generate":r.mipmapGenerate="true"===i.getTextContent(e).toLowerCase();break;default:i.reportUnexpectedChild(e)}})),r}}class N extends m{constructor(){super(),this._className+="EffectParam|"}static fromLink(e,t){return m._fromLink(e,"EffectParam",t)}static parse(e,t,i){var r=new N;return r.sid=i.getAttributeAsString(e,"sid",void 0,!1),i.registerFxTarget(r,t),g(e,(function(e){switch(e.nodeName){case"semantic":r.semantic=i.getTextContent(e);break;case"float":case"float2":case"float3":case"float4":r.floats=i.getFloatsContent(e);break;case"surface":r.surface=D.parse(e,r,i);break;case"sampler2D":r.sampler=F.parse(e,r,i);break;default:i.reportUnexpectedChild(e)}})),r}}class k extends m{constructor(){super(),this.texcoord="",this.opaque="",this.bumptype="",this._className+="ColorOrTexture|"}static parse(e,t,i){var r=new k;return r.opaque=i.getAttributeAsString(e,"opaque",void 0,!1),r.bumptype=i.getAttributeAsString(e,"bumptype",void 0,!1),g(e,(function(e){switch(e.nodeName){case"color":r.color=i.strToColor(i.getTextContent(e));break;case"texture":r.textureSampler=i.getAttributeAsFxLink(e,"texture",t,!0),r.texcoord=i.getAttributeAsString(e,"texcoord",void 0,!0);break;default:i.reportUnexpectedChild(e)}})),r}}class V extends m{constructor(){super(),this.shading="",this.shininess=0,this.transparency=0,this.reflectivity=0,this.index_of_refraction=0,this.double_sided=!1,this._className+="EffectTechnique|",this.params=[]}static fromLink(e,t){return m._fromLink(e,"EffectTechnique",t)}static parse(e,t,i){var r=new V;return r.sid=i.getAttributeAsString(e,"sid",void 0,!1),i.registerFxTarget(r,t),g(e,(function(e){switch(e.nodeName){case"blinn":case"phong":case"lambert":case"constant":r.shading=e.nodeName,V.parseParam(e,r,"COMMON",i);break;case"extra":V.parseExtra(e,r,i);break;default:i.reportUnexpectedChild(e)}})),r}static parseParam(e,t,i,r){g(e,(function(e){switch(e.nodeName){case"newparam":t.params?.push(N.parse(e,t,r));break;case"emission":t.emission=k.parse(e,t,r);break;case"ambient":t.ambient=k.parse(e,t,r);break;case"diffuse":t.diffuse=k.parse(e,t,r);break;case"specular":t.specular=k.parse(e,t,r);break;case"reflective":t.reflective=k.parse(e,t,r);break;case"transparent":t.transparent=k.parse(e,t,r);break;case"bump":t.bump=k.parse(e,t,r);break;case"shininess":t.shininess=r.getFloatContent(e.childNodes[1]||e.childNodes.item(0));break;case"reflectivity":t.reflectivity=r.getFloatContent(e.childNodes[1]||e.childNodes.item(0));break;case"transparency":t.transparency=r.getFloatContent(e.childNodes[1]||e.childNodes.item(0));break;case"index_of_refraction":t.index_of_refraction=r.getFloatContent(e.childNodes[1]||e.childNodes.item(0));break;case"double_sided":t.double_sided=r.getFloatContent(e)>0;break;default:"COMMON"===i&&r.reportUnexpectedChild(e)}}))}static parseExtra(e,t,i){null!=t?g(e,(function(e){if("technique"===e.nodeName){var r=i.getAttributeAsString(e,"profile",void 0,!0);V.parseParam(e,t,r,i)}else i.reportUnexpectedChild(e)})):i.log.write("Ignored element <extra>, because there is no <technique>.",o.Warning)}}class z extends m{constructor(){super(),this._className+="Effect|",this.params=[]}static fromLink(e,t){return m._fromLink(e,"Effect",t)}static parse(e,t){var i=new z;return i.id=t.getAttributeAsString(e,"id",void 0,!0),t.registerUrlTarget(i,!0),g(e,(function(e){switch(e.nodeName){case"profile_COMMON":z.parseProfileCommon(e,i,t);break;case"profile":t.log.write("Skipped non-common effect profile for effect "+i.id+".",o.Warning);break;case"extra":i.technique&&V.parseExtra(e,i.technique,t);break;default:t.reportUnexpectedChild(e)}})),i}static parseProfileCommon(e,t,i){g(e,(function(e){switch(e.nodeName){case"newparam":t.params.push(N.parse(e,t,i));break;case"technique":t.technique=V.parse(e,t,i);break;case"extra":t.technique&&V.parseExtra(e,t.technique,i);break;default:i.reportUnexpectedChild(e)}}))}}class G extends m{constructor(){super(...arguments),this.children=[]}static parse(e,t){var i=new G;return g(e,(function(e){switch(e.nodeName){case"effect":i.children.push(z.parse(e,t));break;case"extra":t.reportUnhandledChild(e);break;default:t.reportUnexpectedChild(e)}})),i}}class U extends m{constructor(){super(),this.type="",this.count=0,this.material="",this.inputs=[],this.indices=new Uint32Array,this.vcount=new Uint32Array,this._className+="Triangles|"}static parse(e,t){var i=new U;return i.name=t.getAttributeAsString(e,"name",void 0,!1),i.material=t.getAttributeAsString(e,"material",void 0,!1),i.count=t.getAttributeAsInt(e,"count",0,!0)||0,i.type=e.nodeName,g(e,(function(e){switch(e.nodeName){case"input":i.inputs.push(y.parse(e,!0,t));break;case"vcount":i.vcount=t.getUintsContent(e);break;case"p":i.indices=t.getUintsContent(e);break;default:t.reportUnexpectedChild(e)}})),i}}class H extends m{constructor(){super(),this._className+="Vertices|",this.inputs=[]}static fromLink(e,t){return m._fromLink(e,"Vertices",t)}static parse(e,t){var i=new H;return i.id=t.getAttributeAsString(e,"id","",!0),i.name=t.getAttributeAsString(e,"name","",!1),t.registerUrlTarget(i,!0),g(e,(function(e){"input"===e.nodeName?i.inputs.push(y.parse(e,!1,t)):t.reportUnexpectedChild(e)})),i}}class W extends m{constructor(){super(),this._className+="Geometry|",this.sources=[],this.vertices=[],this.triangles=[]}static fromLink(e,t){return m._fromLink(e,"Geometry",t)}static parse(e,t){var i=new W;return i.id=t.getAttributeAsString(e,"id",void 0,!0),i.name=t.getAttributeAsString(e,"name",void 0,!1),t.registerUrlTarget(i,!0),g(e,(function(e){switch(e.nodeName){case"mesh":W.parseMesh(e,i,t);break;case"convex_mesh":case"spline":t.log.write("Geometry type "+e.nodeName+" not supported.",o.Error);break;case"extra":W.parseGeometryExtra(e,i,t);break;default:t.reportUnexpectedChild(e)}})),i}static parseMesh(e,t,i){g(e,(function(e){switch(e.nodeName){case"source":t.sources.push(T.parse(e,i));break;case"vertices":t.vertices.push(H.parse(e,i));break;case"triangles":case"polylist":case"polygons":t.triangles.push(U.parse(e,i));break;case"lines":case"linestrips":case"trifans":case"tristrips":i.log.write("Geometry primitive type "+e.nodeName+" not supported.",o.Error);break;default:i.reportUnexpectedChild(e)}}))}static parseGeometryExtra(e,t,i){g(e,(function(e){if("technique"===e.nodeName){var r=i.getAttributeAsString(e,"profile",void 0,!0);W.parseGeometryExtraTechnique(e,t,r,i)}else i.reportUnexpectedChild(e)}))}static parseGeometryExtraTechnique(e,t,i,r){g(e,(function(e){e.nodeName,r.reportUnhandledChild(e)}))}}class Q extends m{constructor(){super(...arguments),this.children=[]}static parse(e,t){var i=new Q;return g(e,(function(e){switch(e.nodeName){case"geometry":i.children.push(W.parse(e,t));break;case"extra":t.reportUnhandledChild(e);break;default:t.reportUnexpectedChild(e)}})),i}}class j extends m{constructor(){super(),this._className+="Image|"}static fromLink(e,t){return m._fromLink(e,"Image",t)}static parse(e,t){var i=new j;return i.id=t.getAttributeAsString(e,"id",void 0,!0),t.registerUrlTarget(i,!0),g(e,(function(e){"init_from"===e.nodeName?i.initFrom=t.getTextContent(e):t.reportUnexpectedChild(e)})),i}}class X extends m{constructor(){super(...arguments),this.children=[]}static parse(e,t){var i=new X;return g(e,(function(e){switch(e.nodeName){case"image":i.children.push(j.parse(e,t));break;case"extra":t.reportUnhandledChild(e);break;default:t.reportUnexpectedChild(e)}})),i}}class Y extends m{constructor(){super(),this._className+="LightParam|"}static parse(e,t){var i=new Y;return i.sid=t.getAttributeAsString(e,"sid",void 0,!1),i.name=e.nodeName,i.value=t.getFloatContent(e),i}}class K extends m{constructor(){super(),this._className+="Light|",this.params={}}static parse(e,t){var i=new K;return i.id=t.getAttributeAsString(e,"id",void 0,!0),i.name=t.getAttributeAsString(e,"name",void 0,!1),t.registerUrlTarget(i,!1),g(e,(function(e){switch(e.nodeName){case"technique_common":K.parseTechniqueCommon(e,i,t);break;case"extra":t.reportUnhandledChild(e);break;default:t.reportUnexpectedChild(e)}})),i}static parseTechniqueCommon(e,t,i){g(e,(function(e){switch(e.nodeName){case"ambient":case"directional":case"point":case"spot":K.parseParams(e,t,"COMMON",i);break;default:i.reportUnexpectedChild(e)}}))}static parseParams(e,t,i,r){t.type=e.nodeName,g(e,(function(e){switch(e.nodeName){case"color":t.color=r.getFloatsContent(e);break;case"constant_attenuation":case"linear_attenuation":case"quadratic_attenuation":case"falloff_angle":case"falloff_exponent":var i=Y.parse(e,r);r.registerSidTarget(i,t),t.params[i.name]=i;break;default:r.reportUnexpectedChild(e)}}))}}class q extends m{constructor(){super(...arguments),this.children=[]}static parse(e,t){var i=new q;return g(e,(function(e){switch(e.nodeName){case"effect":i.children.push(K.parse(e,t));break;case"extra":t.reportUnhandledChild(e);break;default:t.reportUnexpectedChild(e)}})),i}}class Z extends m{constructor(){super(),this._className+="Material|"}static fromLink(e,t){return m._fromLink(e,"Material",t)}static parse(e,t){var i=new Z;return i.id=t.getAttributeAsString(e,"id",void 0,!0),i.name=t.getAttributeAsString(e,"name",void 0,!1),t.registerUrlTarget(i,!0),g(e,(function(e){"instance_effect"===e.nodeName?i.effect=t.getAttributeAsUrlLink(e,"url",!0):t.reportUnexpectedChild(e)})),i}}class J extends m{constructor(){super(...arguments),this.children=[]}static parse(e,t){var i=new J;return g(e,(function(e){switch(e.nodeName){case"material":i.children.push(Z.parse(e,t));break;case"extra":t.reportUnhandledChild(e);break;default:t.reportUnexpectedChild(e)}})),i}}class $ extends m{constructor(){super(),this._className+="InstanceCamera|"}static parse(e,t,i){var r=new $;return r.camera=i.getAttributeAsUrlLink(e,"url",!0),r.sid=i.getAttributeAsString(e,"sid",void 0,!1),r.name=i.getAttributeAsString(e,"name",void 0,!1),i.registerSidTarget(r,t),g(e,(function(e){"extra"===e.nodeName?i.reportUnhandledChild(e):i.reportUnexpectedChild(e)})),r}}class ee extends m{constructor(){super(),this.symbol="",this._className+="InstanceMaterial|",this.params={},this.vertexInputs={}}static parse(e,t,i){var r=new ee;return r.symbol=i.getAttributeAsString(e,"symbol",void 0,!1),r.material=i.getAttributeAsUrlLink(e,"target",!0),i.registerSidTarget(r,t),g(e,(function(e){switch(e.nodeName){case"bind_vertex_input":ee.parseBindVertexInput(e,r,i);break;case"bind":ee.parseBind(e,r,i);break;default:i.reportUnexpectedChild(e)}})),r}static parseBindVertexInput(e,t,i){var r=i.getAttributeAsString(e,"semantic",void 0,!0),n=i.getAttributeAsString(e,"input_semantic",void 0,!0),a=i.getAttributeAsInt(e,"input_set",0,!1);null!=r&&null!=n&&a?t.vertexInputs[r]={inputSemantic:n,inputSet:a}:i.log.write("Skipped a material vertex binding because of missing semantics.",o.Warning)}static parseBind(e,t,i){var r=i.getAttributeAsString(e,"semantic",void 0,!1),n=i.getAttributeAsSidLink(e,"target","",!0);null!=r&&n?t.params[r]={target:n}:i.log.write("Skipped a material uniform binding because of missing semantics.",o.Warning)}}class te{static parse(e,t,i){g(e,(function(e){"technique_common"===e.nodeName?te.parseTechniqueCommon(e,t,i):i.reportUnexpectedChild(e)}))}static parseTechniqueCommon(e,t,i){g(e,(function(e){"instance_material"===e.nodeName?t.materials.push(ee.parse(e,t,i)):i.reportUnexpectedChild(e)}))}}class ie extends m{constructor(){super(),this._className+="InstanceController|",this.skeletons=[],this.materials=[]}static parse(e,t,i){var r=new ie;return r.controller=i.getAttributeAsUrlLink(e,"url",!0),r.sid=i.getAttributeAsString(e,"sid",void 0,!1),r.name=i.getAttributeAsString(e,"name",void 0,!1),i.registerSidTarget(r,t),g(e,(function(e){switch(e.nodeName){case"skeleton":r.skeletons.push(i.createUrlLink(i.getTextContent(e)));break;case"bind_material":te.parse(e,r,i);break;default:i.reportUnexpectedChild(e)}})),r}}class re extends m{constructor(){super(),this._className+="InstanceGeometry|",this.materials=[]}static parse(e,t,i){var r=new re;return r.geometry=i.getAttributeAsUrlLink(e,"url",!0),r.sid=i.getAttributeAsString(e,"sid",void 0,!1),g(e,(function(e){"bind_material"===e.nodeName?te.parse(e,r,i):i.reportUnexpectedChild(e)})),r}}class ne extends m{constructor(){super(),this._className+="InstanceLight|"}static parse(e,t,i){var r=new ne;return r.light=i.getAttributeAsUrlLink(e,"url",!0),r.sid=i.getAttributeAsString(e,"sid",void 0,!1),r.name=i.getAttributeAsString(e,"name",void 0,!1),i.registerSidTarget(r,t),g(e,(function(e){"extra"===e.nodeName?i.reportUnhandledChild(e):i.reportUnexpectedChild(e)})),r}}class oe extends m{constructor(){super(),this._className+="NodeTransform|"}static parse(e,t,i){var r=new oe;r.sid=i.getAttributeAsString(e,"sid",void 0,!1),r.type=e.nodeName,i.registerSidTarget(r,t),r.data=i.getFloatsContent(e);var n=0;switch(r.type){case"matrix":n=16;break;case"rotate":n=4;break;case"translate":case"scale":n=3;break;case"skew":n=7;break;case"lookat":n=9;break;default:i.log.write("Unknown transformation type "+r.type+".",o.Error)}return r.data.length!==n&&i.log.write("Wrong number of elements for transformation type '"+r.type+"': expected "+n+", found "+r.data.length,o.Error),r}}class ae extends m{constructor(){super(),this._className+="VisualSceneNode|",this.type="",this.layer="",this.children=[],this.parent=void 0,this.transformations=[],this.geometries=[],this.controllers=[],this.lights=[],this.cameras=[]}static fromLink(e,t){return m._fromLink(e,"VisualSceneNode",t)}static registerParent(e,t,i){e.parent=t,i.registerSidTarget(e,t)}static parse(e,t){var i=new ae;return i.id=t.getAttributeAsString(e,"id",void 0,!1),i.sid=t.getAttributeAsString(e,"sid",void 0,!1),i.name=t.getAttributeAsString(e,"name",void 0,!1),i.type=t.getAttributeAsString(e,"type",void 0,!1),i.layer=t.getAttributeAsString(e,"layer",void 0,!1),t.registerUrlTarget(i,!1),g(e,(function(e){switch(e.nodeName){case"instance_geometry":i.geometries.push(re.parse(e,i,t));break;case"instance_controller":i.controllers.push(ie.parse(e,i,t));break;case"instance_light":i.lights.push(ne.parse(e,i,t));break;case"instance_camera":i.cameras.push($.parse(e,i,t));break;case"matrix":case"rotate":case"translate":case"scale":i.transformations.push(oe.parse(e,i,t));break;case"node":var r=ae.parse(e,t);ae.registerParent(r,i,t),i.children.push(r);break;case"extra":t.reportUnhandledChild(e);break;default:t.reportUnexpectedChild(e)}})),i}}class se extends m{constructor(){super(...arguments),this.children=[]}static parse(e,t){var i=new se;return g(e,(function(e){switch(e.nodeName){case"node":i.children.push(ae.parse(e,t));break;case"extra":t.reportUnhandledChild(e);break;default:t.reportUnexpectedChild(e)}})),i}}class le extends m{constructor(){super(),this._className+="VisualScene|",this.children=[]}static fromLink(e,t){return m._fromLink(e,"VisualScene",t)}static parse(e,t){var i=new le;return i.id=t.getAttributeAsString(e,"id","",!1),t.registerUrlTarget(i,!1),g(e,(function(e){if("node"===e.nodeName){var r=ae.parse(e,t);ae.registerParent(r,i,t),i.children.push(r)}else t.reportUnexpectedChild(e)})),i}}class ce extends m{constructor(){super(...arguments),this.children=[]}static parse(e,t){var i=new ce;return g(e,(function(e){switch(e.nodeName){case"visual_scene":i.children.push(le.parse(e,t));break;case"extra":t.reportUnhandledChild(e);break;default:t.reportUnexpectedChild(e)}})),i}}class ue{constructor(){this.libEffects=new G,this.libMaterials=new J,this.libGeometries=new Q,this.libControllers=new B,this.libLights=new q,this.libCameras=new I,this.libImages=new X,this.libVisualScenes=new ce,this.libAnimations=new S,this.libNodes=new se}static parse(e,t){var i=e.getElementsByTagName("COLLADA");return 0===i.length?(t.log?.write("Cannot parse document, no top level COLLADA element.",o.Error),new ue):i.length>1?(t.log?.write("Cannot parse document, more than one top level COLLADA element.",o.Error),new ue):ue.parseCOLLADA(i[0]||i.item(0),t)}static parseCOLLADA(e,t){var i=new ue;return g(e,(function(e){switch(e.nodeName){case"asset":i.asset=P.parse(e,t);break;case"scene":i.scene=v.parse(e,t);break;case"library_effects":i.libEffects=G.parse(e,t);break;case"library_materials":i.libMaterials=J.parse(e,t);break;case"library_geometries":i.libGeometries=Q.parse(e,t);break;case"library_images":i.libImages=X.parse(e,t);break;case"library_visual_scenes":i.libVisualScenes=ce.parse(e,t);break;case"library_controllers":i.libControllers=B.parse(e,t);break;case"library_animations":i.libAnimations=S.parse(e,t);break;case"library_lights":i.libLights=q.parse(e,t);break;case"library_cameras":i.libCameras=I.parse(e,t);break;case"library_nodes":i.libNodes=se.parse(e,t);break;default:t.reportUnexpectedChild(e)}})),i}}class he{constructor(){this.log=new c}_reportError(e,t){this.onFinished&&this.onFinished(e,void 0)}_reportSuccess(e,t,i){this.onFinished&&this.onFinished(e,t)}_reportProgress(e,t){this.onProgress&&this.onProgress(e,t.loadedBytes,t.totalBytes)}loadFromXML(e,t){var i=new p(this.log);return this._loadFromXML(e,t,i)}_loadFromXML(e,t,i){var r=void 0;try{r=ue.parse(t,i),i.resolveAllLinks()}catch(t){return i.log.write(t.message+"\n"+t.stack,o.Exception),i.log.write(t.message+"\n"+t.stack,o.Error),void this._reportError(e,i)}return this._reportSuccess(e,r,i),r}loadFromURL(e,t){var i=new p(this.log),r=this;if(null!=document&&null!=document.implementation&&null!=document.implementation.createDocument){var n=new XMLHttpRequest;"function"==typeof n.overrideMimeType&&n.overrideMimeType("text/xml"),n.onreadystatechange=function(){if(4===n.readyState){if(0===n.status||200===n.status)if(n.responseXML){var a=ue.parse(n.responseXML,i);r._reportSuccess(e,a,i)}else i.log.write("Empty or non-existing file "+t+".",o.Error),r._reportError(e,i)}else 3===n.readyState&&(i.totalBytes>0||(i.totalBytes=parseInt(n.getResponseHeader("Content-Length")||"0")),i.loadedBytes=n.responseText.length,r._reportProgress(e,i))},n.open("GET",t,!0),n.send(null)}else i.log.write("Don't know how to parse XML!",o.Error),r._reportError(e,i)}}class de{constructor(){this.chunks=[],this.skeleton=new pe,this.materials=[],this.animations=[]}}class _e{constructor(){this.name="",this.triangle_count=0,this.vertex_count=0,this.index_offset=0,this.material_index=0}}class fe{constructor(){this.diffuse="",this.specular="",this.normal=""}hash(){return"material|"+(this.diffuse||"")+"|"+(this.specular||"")+"|"+(this.normal||"")+"|"+(this.diffuseColor||"")+"|"+(this.specularColor||"|"+(this.emissiveColor||""))}}class pe{constructor(){this.bones=[]}}class me{constructor(){this.name="",this.parent=0,this.skinned=!1,this.pos=new a.Vector3,this.rot=new a.Quaternion,this.scl=new a.Vector3}}class ge{constructor(){this.name="",this.frames=0,this.fps=0,this.tracks=[]}}class ve{constructor(){this.bone=0}}class be{constructor(){}loadFloatData(e,t){return e?new Float32Array(t,e.byte_offset,e.count*e.stride):null}loadUint8Data(e,t){return e?new Uint8Array(t,e.byte_offset,e.count*e.stride):null}loadUint32Data(e,t){return e?new Uint32Array(t,e.byte_offset,e.count*e.stride):null}loadModelChunk(e,t){var i=new _e;return i.name=e.name,i.triangle_count=e.triangle_count,i.material_index=e.material,i.data_position=this.loadFloatData(e.position,t),i.data_normal=this.loadFloatData(e.normal,t),i.data_texcoord=this.loadFloatData(e.texcoord,t),i.data_boneweight=this.loadFloatData(e.boneweight,t),i.data_boneindex=this.loadUint8Data(e.boneindex,t),i.data_indices=this.loadUint32Data(e.indices,t),i.data_boneindex&&(i.data_boneindex=new Uint8Array(i.data_boneindex)),i}loadModel(e,t){var i=new de;return i.chunks=e.chunks.map((e=>this.loadModelChunk(e,t))),i.skeleton=this.loadSkeleton(e,t),i.animations=e.animations.map((e=>this.loadAnimation(e,t))),i.materials=e.materials.map((e=>this.loadMaterial(e,t))),i}loadBone(e,t){if(null==e)return null;var i=new me;return i.name=e.name,i.parent=e.parent,i.skinned=e.skinned,i.inv_bind_mat=new Float32Array(e.inv_bind_mat),i.matrix=new Float32Array(e.matrix),i.pos.set(e.pos[0],e.pos[1],e.pos[2]),i.rot.set(e.rot[0],e.rot[1],e.rot[2],e.rot[3]),i.scl.set(e.scl[0],e.scl[1],e.scl[2]),i}loadSkeleton(e,t){if(null==e.bones||0==e.bones.length)return null;var i=new pe;return i.bones=e.bones.map((e=>this.loadBone(e,t))),i}loadAnimationTrack(e,t){if(null==e)return null;var i=new ve;return i.bone=e.bone,i.pos=this.loadFloatData(e.pos,t),i.rot=this.loadFloatData(e.rot,t),i.scl=this.loadFloatData(e.scl,t),i}loadAnimation(e,t){if(null==e)return null;var i=new ge;return i.name=e.name,i.fps=e.fps,i.frames=e.frames,i.tracks=e.tracks.map((e=>this.loadAnimationTrack(e,t))),i}loadMaterial(e,t){var i=new fe;return i.diffuse=e.diffuse,i.specular=e.specular,i.normal=e.normal,i.diffuseColor=e.diffuseColor,i.specularColor=e.specularColor,i.emissiveColor=e.emissiveColor,i}}class ye{constructor(){this.materialCache={}}createGeometry(e,t){var i=new a.VertexData;if(e.data_position&&(i.positions=e.data_position),e.data_normal&&(i.normals=e.data_normal),e.data_texcoord&&(i.uvs=e.data_texcoord),e.data_boneindex,e.data_boneindex,e.data_indices){i.indices=e.data_indices;for(var r=0;r<i.indices.length;r+=3){var n=i.indices[r];i.indices[r]=i.indices[r+2],i.indices[r+2]=n}}return i}createTexture(e,t){return null==e||""==e?new a.Texture("",t):new a.Texture(e,t)}parseColor(e){var t=(e=e.trim()).split(" ");if(t.length>=3)throw new Error("Color ${rgba} does not have 3 values");return new a.Color3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))}createMaterial(e,t,i){var r=(t?"skinned-":"static-")+e.hash(),n=this.materialCache[r];if(n)return n;var o=new a.StandardMaterial(r,i);return o.backFaceCulling=!1,e.diffuse&&(o.diffuseTexture=this.createTexture(e.diffuse,i)),e.specular&&(o.specularTexture=this.createTexture(e.specular,i)),null!=e.diffuseColor&&4==e.diffuseColor.length&&(o.diffuseColor=new a.Color3(e.diffuseColor[0],e.diffuseColor[1],e.diffuseColor[2])),null!=e.emissiveColor&&4==e.emissiveColor.length&&(o.emissiveColor=new a.Color3(e.emissiveColor[0],e.emissiveColor[1],e.emissiveColor[2])),null!=e.specularColor&&4==e.specularColor.length?o.specularColor=new a.Color3(e.specularColor[0],e.specularColor[1],e.specularColor[2]):o.specularColor=new a.Color3(.5,.5,.5),this.materialCache[r]=o,o}createBabylonModel(e,t){var i=new Te,r=!!e.skeleton;let n=[];if(e.skeleton){for(var o=0;o<e.skeleton.bones.length;++o){var s=e.skeleton.bones[o];let i=a.Matrix.FromArray(s.matrix),r=new a.TransformNode(s.name,t);r.setPreTransformMatrix(i),n.push(r)}for(o=0;o<e.skeleton.bones.length;++o)(s=e.skeleton.bones[o]).parent>=0&&s.parent<n.length&&(n[o].parent=n[s.parent])}for(i.transformNodes=n,o=0;o<e.chunks.length;++o){var l=e.chunks[o],c=new xe;if(c.geometry=this.createGeometry(l,t),c.material=this.createMaterial(e.materials[l.material_index],r,t),i.chunks.push(c),c.geometry){var u=new a.Mesh(l.name,t);c.geometry.applyToMesh(u),u.material=c.material,i.meshes.push(u);var h=u.getVerticesData(a.VertexBuffer.NormalKind),d=u.getVerticesData(a.VertexBuffer.PositionKind);if(a.VertexData.ComputeNormals(d,u.getIndices(),h,{useRightHandedSystem:t.useRightHandedSystem}),u.updateVerticesData(a.VertexBuffer.NormalKind,h),u.convertToFlatShadedMesh(),u.sideOrientation=a.Material.CounterClockWiseSideOrientation,i.transformNodes){var _=l.data_boneindex;if(_)for(var f=_.length/4,p=0;p<f;++p){var m=_[4*p];m>=0&&m<i.transformNodes.length&&(u.parent=i.transformNodes[m])}}}}return i.animations=e.animations,i}}class xe{constructor(){this.geometry=void 0,this.material=void 0}}class Te{constructor(){this.meshes=[],this.chunks=[],this.transformNodes=void 0,this.animations=[]}}function Ce(e,t,i,r,n,o,a,s,l,c){for(var u=Math.min(n,c),h=t.length,d=r,_=l;d<h;){var f=t[d];d+=i;var p=a[_];_+=s;for(var m=0;m<u;++m)o[n*p+m]=e[c*f+m]}}function Se(e,t,i,r){if(!e)return null;if(e.stride>i?r.log.write("Source data for "+t+" contains too many dimensions, "+(e.stride-i)+" dimensions will be ignored",o.Warning):e.stride<i&&r.log.write("Source data for "+t+" does not contain enough dimensions, "+(i-e.stride)+" dimensions will be zero",o.Warning),e.offset,e.offset+e.count*e.stride>e.data.length)return r.log.write("Source for "+t+" tries to access too many elements, data ignored",o.Warning),null;if(!(e.data instanceof Float32Array))return r.log.write("Source for "+t+" does not contain floating point data, data ignored",o.Warning),null;for(var n=e.data,a=new Float32Array(e.count*i),s=e.offset,l=e.stride,c=i,u=0;u<e.count;++u)for(var h=0;h<i;++h)a[0+c*u+h]=n[s+l*u+h];return a}function Pe(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function Ee(e,t,i,r,n,o){if(t[o]<r){t[o]=r,e[o]=i;for(var a=o;a>n;--a)t[a]>t[a-1]&&(Pe(t,a,a-1),Pe(e,a,a-1))}}Te.identityMatrix=new a.Matrix;var we=new a.Matrix;function Ie(e){var t=we;t.copyFrom(Re(e));var i=function(e){var t=e.options.worldTransformScale.value;return new a.Vector3(t,t,t)}(e),r=a.Matrix.Scaling(i.x,i.y,i.z);return t.multiply(r)}var Me=new a.Matrix;new a.Vector3,new a.Vector3;var Oe,Ae=new a.Matrix;function Re(e){var t=e.options.worldTransformRotationAxis.value,i=e.options.worldTransformRotationAngle.value*Math.PI/180,r=Ae;switch(t){case"none":break;case"x":r=a.Matrix.RotationX(i);break;case"y":r=a.Matrix.RotationY(i);break;case"z":r=a.Matrix.RotationZ(i);break;default:e.log.write("Unknown rotation axis",o.Warning)}return r}function Le(e,t,i,r,n){for(var o=0;o<n;++o)i[r+o]=e[t+o]}function Be(e,t,i){let r=new Float32Array(16);for(var n=0;n<16;++n)r[n]=e[16*t+n];i.copyFrom(a.Matrix.FromArray(r).transpose())}function Fe(e,t,i,r,n){if(n<0||n>1)throw new Error("Invalid Bezier parameter: "+n);return e*(1-n)*(1-n)*(1-n)+3*t*n*(1-n)*(1-n)+3*i*n*n*(1-n)+r*n*n*n}function De(e,t,i,r,n){if(n<0||n>1)throw new Error("Invalid Hermite parameter: "+n);var o=n*n,a=o*n;return e*(2*a-3*o+1)+t*(a-2*o+n)+r*(-2*a+3*o)+i*(a-o)}function Ne(e,t,i,r){var n=0,o=1,a=t(n),s=t(o);if(e<=a)return n;if(e>=s)return o;for(var l=.5*(n+o),c=t(l),u=0;Math.abs(c-e)>i;){if(c<e)n=l;else{if(!(c>e))return l;o=l}if(c=t(l=.5*(n+o)),++u>r)throw new Error("Too many iterations")}return l}Math.PI;class ke{constructor(){this.target=null,this.interpolation=null,this.input=null,this.output=null,this.inTangent=null,this.outTangent=null,this.dataOffset=null,this.dataCount=null}findInputIndices(e,t){var i=this.input,r=e=>{var i=t.messageCount["findInputIndices-invalidTime"]||0;i<10?t.log.write(e,o.Warning):10==i&&t.log.write("Further warnings about invalid time suppressed.",o.Warning),t.messageCount["findInputIndices-invalidTime"]=i+1};if(1===i.length)return e!==i[0]&&r("Resampling input with only one keyframe: t="+e+", t_begin="+i[0]+", using first keyframe"),{i0:0,i1:0};if(e<i[0])return r("Invalid time for resampling: t="+e+", t_begin="+i[0]+", using first keyframe"),{i0:0,i1:1};if(e>i[i.length-1])return r("Invalid time for resampling: t="+e+", t_end="+i[i.length-1]+", using last keyframe"),{i0:i.length-2,i1:i.length-1};for(var n=0;n<i.length-1;++n){var a=i[n],s=i[n+1];if(a<=e&&e<=s)return{i0:n,i1:n+1}}return t.log.write("Keyframes for time "+e+"not found, using first keyframe",o.Warning),{i0:0,i1:1}}static createInputData(e,t,i,r){if(!e)return null;var n=T.fromLink(e.source,r);return n?i!=n.stride?(r.log.write("Animation channel has a nonstandard dimensionality for "+t+", data ignored",o.Warning),null):Se(n,t,i,r):(r.log.write("Animation channel has no "+t+" input data, data ignored",o.Warning),null)}static createInputDataFromArray(e,t,i,r){return e.length>0?(e.length>1&&r.log.write("Animation channel has more than one "+t+" input, using only the first one",o.Warning),ke.createInputData(e[0],t,i,r)):null}static create(e,t){var i=new ke,r=m.fromLink(e.target,t);if(!r)return t.log.write("Animation channel has an invalid target '"+e.target.url+"', animation ignored",o.Warning),null;var n=t.animationTargets.findConverter(r);if(!n)return t.log.write("Animation channel has no converter target '"+e.target.url+"', animation ignored",o.Warning),null;i.target=n;var a=x.fromLink(e.source,t);if(!a)return t.log.write("Animation channel has an invalid sampler '"+e.source.url+"', animation ignored",o.Warning),null;var s=n.getTargetDataRows(),l=n.getTargetDataColumns(),c=e.target;if(c.dotSyntax)switch(i.dataCount=1,c.member){case"X":case"R":case"U":case"S":i.dataOffset=0;break;case"Y":case"G":case"V":case"T":i.dataOffset=1;break;case"Z":case"B":case"P":i.dataOffset=2;break;case"W":case"Q":case"ANGLE":i.dataOffset=3;break;default:return t.log.write("Unknown semantic for '"+c.url+"', animation ignored",o.Warning),null}else if(e.target.arrSyntax)switch(i.dataCount=1,c.indices.length){case 1:i.dataOffset=c.indices[0];break;case 2:i.dataOffset=c.indices[0]*s+c.indices[1];break;default:return t.log.write("Invalid number of indices for '"+c.url+"', animation ignored",o.Warning),null}else i.dataOffset=0,i.dataCount=l*s;if(i.input=ke.createInputData(a.input,"input",1,t),i.output=ke.createInputDataFromArray(a.outputs,"output",i.dataCount,t),i.inTangent=ke.createInputDataFromArray(a.inTangents,"intangent",i.dataCount+1,t),i.outTangent=ke.createInputDataFromArray(a.outTangents,"outtangent",i.dataCount+1,t),!i.input)return t.log.write("Animation channel has no input data, animation ignored",o.Warning),null;if(!i.output)return t.log.write("Animation channel has no output data, animation ignored",o.Warning),null;var u=a.interpolation;if(!u)return t.log.write("Animation channel has no interpolation input, animation ignored",o.Warning),null;var h=T.fromLink(u.source,t);return h?(i.interpolation=function(e,t,i,r){if(!e)return[];if(e.stride>1?r.log.write("Source data for "+t+" contains too many dimensions, "+(e.stride-1)+" dimensions will be ignored",o.Warning):e.stride<1&&r.log.write("Source data for "+t+" does not contain enough dimensions, "+(1-e.stride)+" dimensions will be zero",o.Warning),e.offset,e.offset+e.count*e.stride>e.data.length)return r.log.write("Source for "+t+" tries to access too many elements, data ignored",o.Warning),[];if(!(e.data instanceof Array))return r.log.write("Source for "+t+" does not contain string data, data ignored",o.Warning),[];for(var n=e.data,a=new Array(1*e.count),s=e.offset,l=e.stride,c=0;c<e.count;++c)for(var u=0;u<1;++u)a[0+1*c+u]=n[s+l*c+u];return a}(h,"interpolation type",0,t),n.registerAnimation(i),i):(t.log.write("Animation channel has no interpolation source, animation ignored",o.Warning),null)}static interpolateLinear(e,t,i,r,n,o,a,s,l){for(var c=(e-t)/(i-t),u=0;u<o;++u){var h=s.output[r*o+u],d=s.output[n*o+u];l[a+u]=h+c*(d-h)}}static interpolateBezier(e,t,i,r,n,o,a,s,l){for(var c=s.outTangent[r*(o+1)],u=s.inTangent[n*(o+1)],h=Ne(e,(e=>Fe(t,c,u,i,e)),1e-4*Math.abs(i-t),100),d=(Math.abs(e-Fe(t,c,u,i,h)),0);d<o;++d){var _=s.output[r*o+d],f=s.output[n*o+d],p=s.outTangent[r*(o+1)+d+1],m=s.inTangent[n*(o+1)+d+1];l[a+d]=Fe(_,p,m,f,h)}}static interpolateHermite(e,t,i,r,n,o,a,s,l){for(var c=s.outTangent[r*(o+1)],u=s.inTangent[n*(o+1)],h=Ne(e,(e=>De(t,c,u,i,e)),1e-5*Math.abs(i-t),100),d=0;d<o;++d){var _=s.output[r*o+d],f=s.output[n*o+d];t=s.outTangent[r*(o+1)+d+1],i=s.inTangent[n*(o+1)+d+1],l[a+d]=De(_,t,i,f,h)}}static applyToData(e,t,i,r){if(e.input&&e.output){var n=e.findInputIndices(i,r),a=n.i0,s=n.i1,l=e.input[a],c=e.input[s],u=e.dataCount,h=e.dataOffset,d=e.interpolation[n.i0];switch(a===s&&(d="STEP"),d){case"STEP":for(var _=0;_<u;++_)t[h+_]=e.output[a*u+_];break;case"LINEAR":ke.interpolateLinear(i,l,c,a,s,u,h,e,t);break;case"BEZIER":null!==e.inTangent&&null!==e.outTangent?ke.interpolateBezier(i,l,c,a,s,u,h,e,t):ke.interpolateLinear(i,l,c,a,s,u,h,e,t);break;case"HERMITE":null!==e.inTangent&&null!==e.outTangent?ke.interpolateHermite(i,l,c,a,s,u,h,e,t):ke.interpolateLinear(i,l,c,a,s,u,h,e,t);break;case"CARDINAL":case"BSPLINE":for(r.log.write("Interpolation type "+d+" not supported, using STEP",o.Warning),_=0;_<u;++_)t[h+_]=e.input[a*u+_];break;default:for(r.log.write("Unknown interpolation type "+d+" at time "+i+", using STEP",o.Warning),_=0;_<u;++_)t[h+_]=e.input[a*u+_]}}}}class Ve{constructor(){this.beginTime=new ze,this.endTime=new ze,this.duration=new ze,this.keyframes=new ze,this.fps=new ze}addDataPoint(e,t,i){var r=t-e;if(this.beginTime.addDataPoint(e),this.endTime.addDataPoint(t),this.duration.addDataPoint(r),this.keyframes.addDataPoint(i),r>0){var n=(i-1)/r;this.fps.addDataPoint(n)}}}class ze{constructor(){this.data=[],this.sorted=!0}addDataPoint(e){this.data.push(e),this.sorted=!1}sort(){this.sorted||(this.sorted=!0,this.data=this.data.sort(((e,t)=>e-t)))}compute(e){return this.data.length>0?(this.sort(),e(this.data)):null}count(){return this.compute((e=>e.length))}min(){return this.compute((e=>e[0]))}max(){return this.compute((e=>e[e.length-1]))}median(){return this.compute((e=>{var t=(this.data.length-1)/2;return(this.data[Math.floor(t)]+this.data[Math.ceil(t)])/2}))}sum(){return this.compute((e=>e.reduce(((e,t)=>e+t),0)))}mean(){return this.compute((e=>this.sum()/this.count()))}}class Ge{constructor(){this.id=null,this.name=null,this.channels=[]}static create(e,t){var i=new Ge;return i.id=e.id,i.name=e.name,Ge.addChannelsToAnimation(e,i,t),i}static addChannelsToAnimation(e,t,i){for(var r=0;r<e.channels.length;++r){var n=ke.create(e.channels[r],i);t.channels.push(n)}for(r=0;r<e.children.length;++r){var o=e.children[r];Ge.addChannelsToAnimation(o,t,i)}}static getTimeStatistics(e,t,i,r,n){for(var o=0;o<e.channels.length;++o){var a=e.channels[o];if(a){var s=null!==t?t:-1/0;s=Math.min(Math.max(s,0),a.input.length-1);var l=null!==i?i:1/0;l=Math.min(Math.max(l,0),a.input.length-1);var c=a.input[s],u=a.input[l],h=l-s+1;r.addDataPoint(c,u,h)}}}}class Ue{constructor(){this.pos=new Float32Array,this.rot=new Float32Array,this.scl=new Float32Array,this.rel_pos=new Float32Array,this.rel_rot=new Float32Array,this.rel_scl=new Float32Array}}function He(e,t,i,r){r.log.write(e+": "+t.mean().toFixed(i)+" (min: "+t.min().toFixed(i)+", med: "+t.median().toFixed(i)+", max: "+t.max().toFixed(i)+")",o.Debug)}class We{constructor(){this.duration=0,this.keyframes=0,this.fps=0,this.original_fps=0,this.name="",this.tracks=[]}static create(e,t,i,r,n,s){var l=new We;l.name=t.name;var c=t.channels,u=new Ve;if(Ge.getTimeStatistics(t,i,r,u,s),He("Original Duration",u.duration,3,s),He("Original Time Start",u.beginTime,3,s),He("Original Time Stop",u.endTime,3,s),He("Original Keyframes",u.keyframes,3,s),He("Original FPS",u.fps,3,s),n||(n=u.fps.median()),!n||n<=0)return s.log.write("Could not determine FPS for animation, skipping animation",o.Warning),l;var h=u.beginTime.min(),d=u.endTime.max()-h,_=Math.max(Math.floor(n*d+1e-4)+1,2);s.options.truncateResampledAnimations.value?d=(_-1)/n:n=(_-1)/d;var f=1/n;if(s.log.write("Resampled duration: "+d.toFixed(3),o.Debug),s.log.write("Resampled keyframes: "+_.toFixed(3),o.Debug),s.log.write("Resampled FPS: "+n.toFixed(3),o.Debug),l.fps=+n.toFixed(3),l.keyframes=_,l.duration=d,l.original_fps=u.fps.median(),!(n>0))return s.log.write("Invalid FPS: "+n+", skipping animation",o.Warning),l;if(!(d>0))return s.log.write("Invalid duration: "+d+", skipping animation",o.Warning),l;if(!(_>0))return s.log.write("Invalid number of keyframes: "+_+", skipping animation",o.Warning),l;for(var p=0;p<e.bones.length;++p){var m=e.bones[p];(E=new Ue).pos=new Float32Array(3*_),E.rot=new Float32Array(4*_),E.scl=new Float32Array(3*_),E.rel_pos=new Float32Array(3*_),E.rel_rot=new Float32Array(4*_),E.rel_scl=new Float32Array(3*_),l.tracks.push(E)}var g=l.tracks;for(p=0;p<e.bones.length;++p)(m=e.bones[p]).node.resetAnimation();for(var v=new a.Vector3,b=new a.Quaternion,y=new a.Vector3,x=0;x<_;++x){for(var T=h+x*f,C=0;C<c.length;++C){var S=c[C];S&&S.target.applyAnimation(S,T,s)}for(var P=0;P<e.bones.length;++P){m=e.bones[P];var E=g[P];m.node.getLocalMatrix(s).decompose(y,b,v),null!==E.pos&&(E.pos[3*x+0]=v.x,E.pos[3*x+1]=v.y,E.pos[3*x+2]=v.z),null!==E.rot&&(E.rot[4*x+0]=b.x,E.rot[4*x+1]=b.y,E.rot[4*x+2]=b.z,E.rot[4*x+3]=b.w),null!==E.scl&&(E.scl[3*x+0]=y.x,E.scl[3*x+1]=y.y,E.scl[3*x+2]=y.z)}}for(p=0;p<e.bones.length;++p)(m=e.bones[p]).node.resetAnimation();var w=new a.Vector3,I=new a.Vector3,M=new a.Quaternion,O=new a.Quaternion,A=new a.Vector3,R=new a.Vector3;for(P=0;P<e.bones.length;++P){m=e.bones[P],E=g[P],m.node.getLocalMatrix(s).decompose(A,M,w),O=M.invert(),I=w.negate(),R.set(1/A.x,1/A.y,1/A.z);var L=0,B=0,F=0,D=0,N=0,k=0;for(x=0;x<_;++x)v.x=E.pos[3*x+0],v.y=E.pos[3*x+1],v.z=E.pos[3*x+2],v.addInPlace(I),L=v.length(),D=Math.max(D,L),b.x=E.rot[4*x+0],b.y=E.rot[4*x+1],b.z=E.rot[4*x+2],b.w=E.rot[4*x+3],b.multiply(O),B=2*Math.acos(Math.min(Math.max(b.w,-1),1)),N=Math.max(N,B),y.x=E.scl[3*x+0],y.y=E.scl[3*x+1],y.z=E.scl[3*x+2],y.multiplyInPlace(R),F=Math.max(Math.abs(1-y.x),Math.abs(1-y.y),Math.abs(1-y.z)),k=Math.max(k,F),E.rel_pos[3*x+0]=v.x,E.rel_pos[3*x+1]=v.y,E.rel_pos[3*x+2]=v.z,E.rel_scl[3*x+0]=y.x,E.rel_scl[3*x+1]=y.y,E.rel_scl[3*x+2]=y.z,E.rel_rot[4*x+0]=b.x,E.rel_rot[4*x+1]=b.y,E.rel_rot[4*x+2]=b.z,E.rel_rot[4*x+3]=b.w;!0===s.options.removeConstAnimationTracks.value&&(D<1e-4&&(E.pos=new Float32Array,E.rel_pos=new Float32Array),N<.05&&(E.rot=new Float32Array,E.rel_rot=new Float32Array),k<.5&&(E.scl=new Float32Array,E.rel_scl=new Float32Array))}return l}static createFromLabels(e,t,i,r,n){if(!e)return n.log.write("No skeleton present, no animation data generated.",o.Warning),[];for(var a=[],s=0;s<i.length;++s){var l=i[s],c=We.create(e,t,l.begin,l.end,l.fps||r,n);null!==c&&(c.name=l.name,a.push(c))}return a}}class Qe{constructor(){this.collada=[],this.converter=[]}register(e,t){this.collada.push(e),this.converter.push(t)}findConverter(e){for(var t=0;t<this.collada.length;++t)if(this.collada[t]===e)return this.converter[t];return null}findCollada(e){for(var t=0;t<this.collada.length;++t)if(this.converter[t]===e)return this.collada[t];return null}}class je extends s{constructor(e,t){super(e),this.log=e,this.options=t,this.materials=new Qe,this.textures=new Qe,this.nodes=new Qe,this.animationTargets=new Qe,this.messageCount={}}}class Xe{constructor(e){this.id=e.id,this.url=""}static createTexture(e,t){if(!e||!e.textureSampler)return null;var i=N.fromLink(e.textureSampler,t);if(!i)return t.log.write("Texture sampler not found, texture will be missing",o.Warning),null;var r=i.sampler;if(!r)return t.log.write("Texture sampler param has no sampler, texture will be missing",o.Warning),null;var n=null;if(null!=r.image){if(!(n=j.fromLink(r.image,t)))return t.log.write("Texture image not found, texture will be missing",o.Warning),null}else if(null!=r.surface){var a=N.fromLink(r.surface,t);if(!a)return t.log.write("Texture surface not found, texture will be missing",o.Warning),null;var s=a.surface;if(!s)return t.log.write("Texture surface param has no surface, texture will be missing",o.Warning),null;if(!(n=j.fromLink(s.initFrom,t)))return t.log.write("Texture image not found, texture will be missing",o.Warning),null}var l=t.textures.findConverter(n);return l||((l=new Xe(n)).url=n.initFrom,!0===t.options.removeTexturePath.value&&(l.url=l.url.replace(/^.*[\\\/]/,"")),t.textures.register(n,l),l)}}class Ye{constructor(){this.symbols={}}}class Ke{constructor(){this.name=null,this.diffuse=null,this.specular=null,this.normal=null,this.diffuseColor=null,this.specularColor=null,this.emissiveColor=null}static createDefaultMaterial(e){var t=e.materials.findConverter(null);return t||(t=new Ke,e.materials.register(void 0,t),t)}static createMaterial(e,t){var i=Z.fromLink(e.material,t);if(!i)return t.log.write("Material not found, material skipped.",o.Warning),Ke.createDefaultMaterial(t);var r=z.fromLink(i.effect,t);if(!r)return t.log.write("Material effect not found, using default material",o.Warning),Ke.createDefaultMaterial(t);var n=r.technique;if(!n)return t.log.write("Material effect not found, using default material",o.Warning),Ke.createDefaultMaterial(t);var a=t.materials.findConverter(i);return a||((a=new Ke).name=i.id,null!=n.diffuse&&null!=n.diffuse.color?a.diffuseColor=Array.prototype.slice.call(n.diffuse.color):a.diffuse=Xe.createTexture(n.diffuse,t),null!=n.specular&&null!=n.specular.color?a.specularColor=Array.prototype.slice.call(n.specular.color):a.specular=Xe.createTexture(n.specular,t),null!=n.emission&&null!=n.emission.color&&(a.emissiveColor=Array.prototype.slice.call(n.emission.color)),a.normal=Xe.createTexture(n.bump,t),t.materials.register(i,a),a)}static getMaterialMap(e,t){for(var i=new Ye,r=0;r<e.length;r++){var n=e[r],a=n.symbol;a?null==i.symbols[a]?i.symbols[a]=Ke.createMaterial(n,t):t.log.write("Material symbol "+a+" used multiple times",o.Error):t.log.write("Material instance has no symbol, material skipped.",o.Warning)}return i}}class qe{constructor(){this.min=new a.Vector3,this.max=new a.Vector3,this.reset()}reset(){this.min.set(1/0,1/0,1/0),this.max.set(-1/0,-1/0,-1/0)}fromPositions(e,t,i){this.reset();for(var r=0;r<i;++r){var n=e[3*(t+r)+0];this.min.x=Math.min(this.min.x,n),this.max.x=Math.max(this.max.x,n),n=e[3*(t+r)+1],this.min.y=Math.min(this.min.y,n),this.max.y=Math.max(this.max.y,n),n=e[3*(t+r)+2],this.min.z=Math.min(this.min.z,n),this.max.z=Math.max(this.max.z,n)}}extend(e){this.min.x=Math.min(this.min.x,e.x),this.max.x=Math.max(this.max.x,e.x),this.min.y=Math.min(this.min.y,e.y),this.max.y=Math.max(this.max.y,e.y),this.min.z=Math.min(this.min.z,e.z),this.max.z=Math.max(this.max.z,e.z)}extendBox(e){this.extend(e.max),this.extend(e.min)}}class Ze{constructor(){this.indices=new Uint32Array,this.position=new Float32Array,this.normal=new Float32Array,this.texcoord=new Float32Array,this.boneweight=new Float32Array,this.boneindex=new Uint8Array}}class Je{constructor(){this.indices=new Uint32Array,this.indexStride=0,this.indexOffset=0}}class $e{constructor(){this.name="",this.vertexCount=0,this.triangleCount=0,this.vertexBufferOffset=0,this.indexBufferOffset=0,this.data=new Ze,this.material=new Ke,this.boundingBox=new qe,this.bindShapeMatrix=new a.Matrix,this._colladaIndices=new Je}static createChunk(e,t,i){if(t?.inputs){for(var r,n,a,s=[],l=0;l<t.inputs.length;l++)switch((g=t.inputs[l]).semantic){case"VERTEX":r=g;break;case"NORMAL":n=g;break;case"COLOR":a=g;break;case"TEXCOORD":s.push(g);break;default:i.log.write("Unknown triangles input semantic "+g.semantic+" ignored",o.Warning)}if(r&&r.source){var c=H.fromLink(r.source,i);if(c){var u=T.fromLink(null!=n?n.source:void 0,i),h=T.fromLink(null!=a?a.source:void 0,i),d=s.map((e=>T.fromLink(null!=e?e.source:void 0,i))),_=null,f=null,p=null,m=[];for(l=0;l<c.inputs.length;l++){var g;switch((g=c.inputs[l]).semantic){case"POSITION":_=g;break;case"NORMAL":f=g;break;case"COLOR":p=g;break;case"TEXCOORD":m.push(g);break;default:i.log.write("Unknown vertices input semantic "+g.semantic+" ignored",o.Warning)}}if(_&&_.source){var v=T.fromLink(_.source,i);if(v){var b=T.fromLink(null!=f?f.source:void 0,i),y=T.fromLink(null!=p?p.source:void 0,i),x=m.map((e=>T.fromLink(null!=e?e.source:void 0,i))),C=Se(v,"vertex position",3,i),S=Se(b,"vertex normal",3,i),P=Se(u,"vertex normal (indexed)",3,i),E=(Se(y,"vertex color",4,i),Se(h,"vertex color (indexed)",4,i),x.map((e=>Se(e,"texture coordinate",2,i)))),w=d.map((e=>Se(e,"texture coordinate (indexed)",2,i)));if("triangles"!==t.type){var I=t.vcount;if(I){for(l=0;l<I.length;l++)if(3!==I[l])return void i.log.write("Geometry "+e.id+" has non-triangle polygons, geometry ignored.",o.Warning)}else i.log.write("Geometry "+e.id+" has polygons with an unknown number of vertices per polygon. Assuming all triangles.",o.Warning)}if(3===v.stride){var M=t.indices,O=t.count,A=M.length/t.count/3,R=function(e,t,i){for(var r=e.length/t,n=new Uint32Array(r),o=16777215,a=0;a<r;++a){for(var s=o,l=0;l<a;++l)if(e[l*t+i]===e[a*t+i]){s=l;break}n[a]=s}var c=new Uint32Array(r),u=0;for(a=0;a<r;++a)(s=n[a])===o?(c[a]=u,u++):c[a]=c[s];return c}(M,A,r.offset);if(R&&0!==R.length){var L=function(e){if(!e)return 0;for(var t=-1,i=e.length,r=0;r<i;++r)e[r]>t&&(t=e[r]);return t}(R)+1,B=R.length/3;if(B===O){var F=new Float32Array(3*L),D=r.offset;Ce(C,M,A,D,3,F,R,1,0,3);var N=new Float32Array(3*L),k=null!==n?n?.offset:null;null!==S?Ce(S,M,A,D,3,N,R,1,0,3):null!==P?Ce(P,M,A,k,3,N,R,1,0,3):i.log.write("Geometry "+e.id+" has no normal data, using zero vectors",o.Warning);var V=new Float32Array(2*L),z=s.length>0?s[0].offset:null;E.length>0?Ce(E[0],M,A,D,2,V,R,1,0,2):w.length>0?Ce(w[0],M,A,z,2,V,R,1,0,2):i.log.write("Geometry "+e.id+" has no texture coordinate data, using zero vectors",o.Warning);var G=new Ze;G.indices=R,G.position=F,G.normal=N,G.texcoord=V;var U=new Je;U.indices=M,U.indexStride=A,U.indexOffset=D;var W=new $e;return W.vertexCount=L,W.vertexBufferOffset=0,W.triangleCount=B,W.indexBufferOffset=0,W.data=G,W._colladaIndices=U,W}i.log.write("Geometry "+e.id+" has an inconsistent number of indices, geometry ignored",o.Error)}else i.log.write("Geometry "+e.id+" does not contain any indices, geometry ignored",o.Error)}else i.log.write("Geometry "+e.id+" vertex positions are not 3D vectors, geometry ignored",o.Warning)}else i.log.write("Geometry "+e.id+" has no vertex positions, geometry ignored",o.Warning)}}else i.log.write("Geometry "+e.id+" has no vertices, geometry ignored",o.Warning)}}}static computeBoundingBox(e,t){e.boundingBox.fromPositions(e.data.position,e.vertexBufferOffset,e.vertexCount)}static transformEachVector(e,t){let i=new a.Vector3;for(let r=0;r<e.length;r+=3)i.set(e[r],e[r+1],e[r+2]),a.Vector3.TransformCoordinates(i,t),e[r]=i.x,e[r+1]=i.y,e[r+2]=i.z}static transformChunk(e,t,i,r){var n=e.data.position;null!==n&&$e.transformEachVector(n,t);var o=e.data.normal;null!==o&&$e.transformEachVector(o,i)}static scaleChunk(e,t,i){var r=e.data.position;if(null!==r)for(var n=0;n<r.length;++n)r[n]=r[n]*t}static mergeChunkData(e,t){if(!(e.length<2)){for(var i=0,r=0,n=e.length>0,o=e.length>0,a=e.length>0,s=e.length>0,l=e.length>0,c=0;c<e.length;++c){var u=(f=e[c]).data;i+=f.vertexCount,r+=f.triangleCount,n=n&&null!==u.position,o=o&&null!==u.normal,a=a&&null!==u.texcoord,s=s&&null!==u.boneweight,l=l&&null!==u.boneindex}var h=new Ze;h.indices=new Uint32Array(3*r),n&&(h.position=new Float32Array(3*i)),o&&(h.normal=new Float32Array(3*i)),a&&(h.texcoord=new Float32Array(2*i)),l&&(h.boneindex=new Uint8Array(4*i)),s&&(h.boneweight=new Float32Array(4*i));var d=0,_=0;for(c=0;c<e.length;++c){u=(f=e[c]).data;for(var f,p=0;p<3*f.triangleCount;++p)h.indices[d+p]=u.indices[p+f.indexBufferOffset]+_;n&&Le(u.position,3*f.vertexBufferOffset,h.position,3*_,3*f.vertexCount),o&&Le(u.normal,3*f.vertexBufferOffset,h.normal,3*_,3*f.vertexCount),a&&Le(u.texcoord,2*f.vertexBufferOffset,h.texcoord,2*_,2*f.vertexCount),s&&Le(u.boneweight,4*f.vertexBufferOffset,h.boneweight,4*_,4*f.vertexCount),l&&Le(u.boneindex,4*f.vertexBufferOffset,h.boneindex,4*_,4*f.vertexCount),f.data=h,f.vertexBufferOffset=_,f.indexBufferOffset=d,_+=f.vertexCount,d+=3*f.triangleCount}}}}class et{constructor(e){this.invBindMatrix=a.Matrix.Identity(),this.node=e,this.name=e.name||"",this.attachedToSkin=!1}clone(){var e=new et(this.node);return e.name=this.name,e.parent=this.parent,e.invBindMatrix=this.invBindMatrix.clone(),e.attachedToSkin=this.attachedToSkin,e}depth(){return this.parent?this.parent.depth()+1:0}static create(e){return new et(e)}static findBoneNode(e,t,i){for(var r=void 0,n=[],a=0;a<t.length;a++){var s=t[a],l=e.split("/"),c=f.findSidTarget(e,s,l,i);if(null!=c.result){r=c.result;break}c.warning&&n.push(c.warning)}return r?i.isInstanceOf(r,"VisualSceneNode")?r:void i.log.write("Joint "+e+" does not point to a visual scene node, joint ignored",o.Warning):void i.log.write("Joint with SID "+e+" not found, joint ignored. Related warnings:\n"+n.join("\n"),o.Warning)}static sameInvBindMatrix(e,t,i){if(!e||!t)return!1;for(var r=0;r<16;++r){var n=e.invBindMatrix.asArray()[r],o=t.invBindMatrix.asArray()[r];if(Math.abs(n-o)>i)return!1}return!0}static safeToMerge(e,t){return!(e!==t&&(!e||!t||e.node!==t.node||e.attachedToSkin&&t.attachedToSkin&&!et.sameInvBindMatrix(e,t,1e-5)))}static mergeBone(e,t){if(et.safeToMerge(e,t))return e.attachedToSkin?e.clone():t.attachedToSkin?t.clone():e.clone()}}class tt{constructor(e){this.bones=e}static findBone(e,t){for(var i=0;i<e.length;++i)if(et.safeToMerge(e[i],t))return e[i];return null}static findParent(e,t){if(!t.parent)return null;for(var i=0;i<e.length;++i)if(e[i].node===t.parent.node)return e[i];return null}static checkConsistency(e,t){e.bones&&(e.bones.forEach(((t,i)=>{e.bones.forEach(((e,r)=>{if(i!==r&&et.safeToMerge(t,e))throw new Error("Duplicate bone")}))})),e.bones.forEach((e=>{if(e.parent&&!e.node.parent)throw new Error("Missing parent")})),e.bones.forEach((t=>{if(t.parent&&-1===e.bones.indexOf(t.parent))throw new Error("Invalid parent")})))}static createFromSkin(e,t,i,r,n){for(var a=[],s=0;s<e.length;s++){var l=e[s],c=et.findBoneNode(l,t,n);if(!c)return n.log.write("Joint "+l+" not found for skeleton, no bones created",o.Warning),new tt([]);var u=n.nodes.findConverter(c);if(!u)return n.log.write("Joint "+l+" not converted for skeleton, no bones created",o.Warning),new tt([]);var h=et.create(u);h.attachedToSkin=!0,Be(r,s,h.invBindMatrix),a.push(h)}var d=new tt(a);return d=tt.addBoneParents(d,n),tt.checkConsistency(d,n),d}static createFromNode(e,t){t.nodes.findCollada(e);var i=et.create(e);i.invBindMatrix=a.Matrix.Identity(),i.attachedToSkin=!0;var r=new tt([i]);return r=tt.addBoneParents(r,t),tt.checkConsistency(r,t),r}static replaceBone(e,t,i){var r=e.slice(0),n=r[t];return r[t]=i,r.forEach((e=>{e.parent===n&&(e.parent=i)})),r}static mergeBone(e,t){for(var i=0;i<e.length;++i)if(et.safeToMerge(e[i],t)){var r=et.mergeBone(e[i],t);return tt.replaceBone(e,i,r)}var n=e.slice(0),o=t.clone();return n.push(o),o.parent=tt.findParent(n,o),n}static mergeSkeletons(e,t,i){var r=[];e.bones.forEach((e=>{r=tt.mergeBone(r,e)})),t.bones.forEach((e=>{r=tt.mergeBone(r,e)}));var n=new tt(r);return tt.checkConsistency(n,i),n}static getSkeletonRootNodes(e,t){for(var i=[],r=0;r<e.length;r++){var n=e[r],a=ae.fromLink(n,t);a?i.push(a):t.log.write("Skeleton root node "+n.getUrl()+" not found, skeleton root ignored",o.Warning)}return 0===i.length&&(t.log.write("Controller has no skeleton, using the whole scene as the skeleton root",o.Warning),i=t.nodes.collada.filter((e=>t.isInstanceOf(e.parent,"VisualScene")))),i}static addBoneParents(e,t){for(var i=e.bones.slice(0),r=0;r<i.length;){var n=i[r];++r;for(var o=0;o<i.length;o++){var a=i[o];if(n.node.parent===a.node){n.parent=a;break}}n.node.parent&&!n.parent&&(n.parent=et.create(n.node.parent),i.push(n.parent))}var s=new tt(i);return tt.checkConsistency(s,t),s}static getBoneIndexMap(e,t){for(var i=new Uint32Array(e.bones.length),r=0;r<e.bones.length;++r){for(var n=e.bones[r],o=-1,a=0;a<t.bones.length;++a){var s=t.bones[a];if(et.safeToMerge(n,s)){o=a;break}}if(o<0){var l=n.name,c=t.bones.map((e=>e.name));throw new Error("Bone "+l+" not found in "+c)}i[r]=o}return i}static sortBones(e,t){var i=e.bones.slice(0);if((i=i.sort(((t,i)=>{var r=t.depth(),n=i.depth();return r!==n?r-n:t.parent!==i.parent&&null!==t.parent?e.bones.indexOf(t.parent)-e.bones.indexOf(i.parent):e.bones.indexOf(t)-e.bones.indexOf(i)}))).length!=e.bones.length||0==tt.bonesSorted(i))throw new Error("Error while sorting bones");var r=new tt(i);return tt.checkConsistency(r,t),r}static bonesSorted(e){var t=0;return e.forEach((i=>{null!==i.parent&&e.indexOf(i)<e.indexOf(i.parent)&&++t})),0===t}}class it{constructor(){this.name="",this.chunks=[],this.boundingBox=new qe}getSkeleton(){return this.skeleton}static createStatic(e,t,i){if(e&&e.geometry){var r=W.fromLink(e.geometry,i);if(r){var n=it.createGeometry(r,e.materials,i);return i.options.createSkeleton.value&&it.addSkeleton(n,t,i),n}i.log.write("Geometry instance has no geometry, mesh ignored",o.Warning)}}static createAnimated(e,t,i){if(e&&e.controller){var r=L.fromLink(e.controller,i);if(r)return null!==r.skin?it.createSkin(e,r,i):null!==r.morph?it.createMorph(e,r,i):void 0;i.log.write("Controller instance has no controller, mesh ignored",o.Warning)}}static createSkin(e,t,i){if(e&&e.controller)if(t=L.fromLink(e.controller,i)){var r=t.skin;if(r&&r.source){var n=W.fromLink(r.source,i);if(n){var s=it.createGeometry(n,e.materials,i);if(!i.options.createSkeleton.value)return i.log.write("Geometry "+s.name+" contains skinning data, but the creation of skeletons is disabled in the options. Using static geometry only.",o.Warning),s;var l=it.getSkeletonRootNodes(e.skeletons,i);if(0===l.length)return i.log.write("Controller still has no skeleton, using unskinned geometry",o.Warning),s;var c=r.joints;if(!c)return i.log.write("Skin has no joints element, using unskinned mesh",o.Warning),s;var u=c.joints;if(!u||!u.source)return i.log.write("Skin has no joints input, using unskinned mesh",o.Warning),s;var h=T.fromLink(u.source,i);if(!h)return i.log.write("Skin has no joints source, using unskinned mesh",o.Warning),s;var d=h.data,_=new a.Matrix;null!==r.bindShapeMatrix&&Be(r.bindShapeMatrix,0,_);var f=c?.invBindMatrices;if(!f||!f.source)return i.log.write("Skin has no inverse bind matrix input, using unskinned mesh",o.Warning),s;var p=T.fromLink(f.source,i);if(!p)return i.log.write("Skin has no inverse bind matrix source, using unskinned mesh",o.Warning),s;if(!p.data||!h.data||p.data.length!==16*h.data.length)return i.log.write("Skin has an inconsistent length of joint data sources, using unskinned mesh",o.Warning),s;if(!(p.data instanceof Float32Array))return i.log.write("Skin inverse bind matrices data does not contain floating point data, using unskinned mesh",o.Warning),s;var m=p.data,g=r.vertexWeights;if(!g)return i.log.write("Skin contains no bone weights element, using unskinned mesh",o.Warning),s;var v=g.weights;if(!v||!v.source)return i.log.write("Skin contains no bone weights input, using unskinned mesh",o.Warning),s;var b=T.fromLink(v.source,i);if(!b)return i.log.write("Skin has no bone weights source, using unskinned mesh",o.Warning),s;if(!(b.data instanceof Float32Array))return i.log.write("Bone weights data does not contain floating point data, using unskinned mesh",o.Warning),s;var y=b.data;if(r?.vertexWeights?.joints?.source?.url!==r?.joints?.joints?.source?.url)return i.log.write("Skin uses different data sources for joints in <joints> and <vertex_weights>, this is not supported. Using unskinned mesh.",o.Warning),s;var x=tt.createFromSkin(d,l,_,m,i);if(0===x.bones.length)return i.log.write("Skin contains no bones, using unskinned mesh",o.Warning),s;it.setSkeleton(s,x,i);for(var C=it.compactSkinningData(r,y,4,i),S=C.indices,P=C.weights,E=0;E<s.chunks.length;++E){var w=(M=s.chunks[E]).data,I=M._colladaIndices;w.boneindex=new Uint8Array(4*M.vertexCount),Ce(S,I.indices,I.indexStride,I.indexOffset,4,w.boneindex,w.indices,1,0,4),w.boneweight=new Float32Array(4*M.vertexCount),Ce(P,I.indices,I.indexStride,I.indexOffset,4,w.boneweight,w.indices,1,0,4)}for(E=0;E<s.chunks.length;++E){var M;(M=s.chunks[E]).bindShapeMatrix=new a.Matrix,M.bindShapeMatrix.copyFrom(_)}return!0===i.options.applyBindShape.value&&it.applyBindShapeMatrices(s,i),i.options.sortBones.value&&(x=tt.sortBones(x,i)),it.setSkeleton(s,x,i),s}i.log.write("Controller has no geometry, mesh ignored",o.Error)}else i.log.write("Controller has no skin, mesh ignored",o.Error)}else i.log.write("Controller instance has no controller, mesh ignored",o.Error)}static compactSkinningData(e,t,i,r){var n=e.vertexWeights?.v,a=e.vertexWeights?.vcount,s=a?.length||0,l=new Float32Array(s*i),c=new Uint8Array(s*i);if(!a||!n)return{weights:l,indices:c};for(var u=0,h=0,d=0,_=new Float32Array(32),f=0;f<s;++f){var p=a[f];p>i&&h++,_[Math.min(p,_.length-1)]++;for(var m=0;m<p;++m){var g=n[u],v=n[u+1];u+=2,Ee(c,l,g,t[v],f*i,f*i+i-1)}var b=0;for(m=0;m<i;++m)b+=l[f*i+m];if(b<1e-6||b>1e6)d++;else for(m=0;m<p;++m)l[f*i+m]/=b}return h>0&&r.log.write(h+" vertices are influenced by too many bones, some influences were ignored. Only "+i+" bones per vertex are supported.",o.Warning),d>0&&r.log.write(d+" vertices have zero or infinite total weight, skin will be broken.",o.Warning),{weights:l,indices:c}}static getSkeletonRootNodes(e,t){for(var i=[],r=0;r<e.length;r++){var n=e[r],a=ae.fromLink(n,t);a?i.push(a):t.log.write("Skeleton root node "+n.getUrl()+" not found, skeleton root ignored",o.Warning)}return 0===i.length&&(t.log.write("Controller has no skeleton, using the whole scene as the skeleton root",o.Warning),i=t.nodes.collada.filter((e=>t.isInstanceOf(e.parent,"VisualScene")))),i}static createMorph(e,t,i){i.log.write("Morph animated meshes not supported, mesh ignored",o.Warning)}static createGeometry(e,t,i){var r=Ke.getMaterialMap(t,i),n=new it;n.name=e.name||e.id||e.sid||"geometry";for(var a=e.triangles,s=0;s<a.length;s++){var l,c=a[s];null!==c.material?(l=r.symbols[c.material])||(i.log.write("Material symbol "+c.material+" has no bound material instance, using default material",o.Warning),l=Ke.createDefaultMaterial(i)):(i.log.write("Missing material index, using default material",o.Warning),l=Ke.createDefaultMaterial(i));var u=$e.createChunk(e,c,i);u&&(u.name=n.name,a.length>1&&(u.name+=" #"+s),u.material=l,n.chunks.push(u))}return n}static transformGeometry(e,t,i){var r=new a.Matrix;t.toNormalMatrix(r);for(var n=0;n<e.chunks.length;++n){var o=e.chunks[n];$e.transformChunk(o,t,r,i)}}static setupWorldTransform(e,t){e.skeleton&&e.skeleton?.bones.forEach((e=>{if(t.options.worldTransformBake&&(e.invBindMatrix=e.invBindMatrix.multiply(function(e){var t=Ie(e);return t.copyFrom(Re(e)),t.invert(),Me}(t))),t.options.worldTransformUnitScale){var i=a.Matrix.Invert(e.node.transformation_post);e.invBindMatrix=i.multiply(e.invBindMatrix)}}))}static scaleGeometry(e,t,i){for(var r=0;r<e.chunks.length;++r){var n=e.chunks[r];$e.scaleChunk(n,t,i)}e.skeleton&&e.skeleton.bones&&e.skeleton.bones.forEach((e=>{e.invBindMatrix[12]*=t,e.invBindMatrix[13]*=t,e.invBindMatrix[14]*=t}))}static applyBindShapeMatrices(e,t){for(var i=0;i<e.chunks.length;++i){var r=e.chunks[i],n=r.bindShapeMatrix;if(n){var o=new a.Matrix;n.toNormalMatrix(o),$e.transformChunk(r,n,o,t),r.bindShapeMatrix=a.Matrix.Identity()}}}static computeBoundingBox(e,t){e.boundingBox.reset();for(var i=0;i<e.chunks.length;++i){var r=e.chunks[i];$e.computeBoundingBox(r,t),e.boundingBox.extendBox(r.boundingBox)}}static addSkeleton(e,t,i){var r=tt.createFromNode(t,i);it.setSkeleton(e,r,i);for(var n=0;n<e.chunks.length;++n){var o=e.chunks[n],a=o.data;a.boneindex=new Uint8Array(4*o.vertexCount),a.boneweight=new Float32Array(4*o.vertexCount);for(var s=0;s<o.vertexCount;++s)a.boneindex[4*s+0]=0,a.boneindex[4*s+1]=0,a.boneindex[4*s+2]=0,a.boneindex[4*s+3]=0,a.boneweight[4*s+0]=1,a.boneweight[4*s+1]=0,a.boneweight[4*s+2]=0,a.boneweight[4*s+3]=0}i.options.sortBones.value&&(r=tt.sortBones(r,i)),it.setSkeleton(e,r,i)}static mergeGeometries(e,t){if(0!==e.length){if(1===e.length)return e[0];var i=new it;i.name="merged_geometry";var r=new tt([]);return e.forEach((e=>{null!==e.skeleton&&(r=tt.mergeSkeletons(r,e.skeleton,t))})),t.options.sortBones.value&&(r=tt.sortBones(r,t)),it.setSkeleton(i,r,t),e.forEach((e=>{it.setSkeleton(e,r,t)})),e.forEach((e=>{i.chunks=i.chunks.concat(e.chunks)})),e.forEach((e=>{e.chunks=[]})),i}t.log.write("No geometries to merge",o.Warning)}static setSkeleton(e,t,i){if(e.skeleton)for(var r=tt.getBoneIndexMap(e.skeleton,t),n=0;n<e.chunks.length;++n){var o=e.chunks[n].data.boneindex;if(o)for(var a=0;a<o.length;++a)o[a]=r[o[a]]}e.skeleton=t}}class rt{constructor(e,t,i){this.type="boolean",this.title=e,this.value=t,this.description=i}}class nt{constructor(e,t,i,r,n){this.type="number",this.title=e,this.value=t,this.min=i,this.max=r,this.description=n}}class ot{constructor(e,t,i,r){this.type="select",this.title=e,this.value=t,this.options=i,this.description=r}}class at{constructor(e,t,i){this.type="array",this.title=e,this.value=t,this.description=i}}class st{constructor(){this.singleAnimation=new rt("Single animation",!0,"Enabled: all animations are merged into a single animation (useful if each bone has a separate top level animation).<br/>Disabled: animations are not merged."),this.singleGeometry=new rt("Single geometry",!0,"Enabled: all geometries are merged into a single geometry. Only has an effect if 'enableExtractGeometry' is enabled.<br/>Disabled: geometries are not merged."),this.singleBufferPerGeometry=new rt("Single buffer",!1,"Enabled: all chunks within one geometry use one set of vertex buffers, each chunk occupying a different part of the buffer set.<br/>Disabled: each chunk has its own set of buffers."),this.enableAnimations=new rt("Animations",!0,"Enabled: animations are exported.<br/>Disabled: all animations are ignored."),this.enableExtractGeometry=new rt("Extract geometry",!0,"Enabled: extract all geometries from the scene and detach them from their scene graph nodes.<br/>Disabled: geometries remain attached to nodes."),this.enableResampledAnimations=new rt("Resampled animations",!0,"Enabled: generate resampled animations for all skeleton bones.<br/>Disabled: do not generate resampled animations."),this.useAnimationLabels=new rt("Animation labels",!1,"Enabled: animations labels are used to split the global animation into separete animations.<br/>Disabled: only one global animation is exported."),this.animationLabels=new at("Animation labels",[],"An array of animation labels ({name, begin, end, fps)} that describes how the global animation is split.<br/>Only has an effect if 'useAnimationLabels' is enabled."),this.animationFps=new nt("Animation samples per second",10,0,100,"Default FPS for resampled animations."),this.removeConstAnimationTracks=new rt("Remove static animations",!0,"Enabled: animation tracks are removed if they only contain the rest pose transformation for all times.<br/>Disabled: all animation tracks are exported."),this.applyBindShape=new rt("Apply bind shape",!0,"Enabled: the positions and normals of skin-animated meshes are pre-multiplied by the bind shape matrix.<br/>Disabled: the bind shape matrix needs to be manually exported and applied during rendering."),this.removeTexturePath=new rt("Remove texture path",!0,"Enabled: only the filename and extension of textures are kept and the remaining path is discarded.<br/>Disabled: original texture paths are kept."),this.sortBones=new rt("Sort bones",!0,"Enabled: bones are sorted so that child bones always appear after their parent bone in the list of bones.<br/>Disabled: bones appear in their original order."),this.worldTransform=new rt("World transform",!1,"Enabled: all objects (geometries, animations, skeletons) are transformed as specified by the corresponding world transform options.<br/>Disabled: the world transform options are ignored."),this.worldTransformBake=new rt("Bake world transform",!0,"Enabled: the world transformation is applied to skinned geometry.<br/>Disabled: the world transformation is applied to the bones."),this.worldTransformUnitScale=new rt("World transform no node scale",!0,"If enabled, the world scale will not add any scaling transformation to any nodes.The world scale will instead be distributed to the translation part of all local transformations."),this.worldTransformScale=new nt("World transform: scale",1,1e-6,1e6,"Scale factor. See the 'worldTransform' option."),this.worldTransformRotationAxis=new ot("World transform: rotation axis","none",["none","x","y","z"],"Rotation axis. See the 'worldTransform' option."),this.worldTransformRotationAngle=new nt("World transform: rotation angle",0,0,360,"Rotation angle (in degrees). See the 'worldTransform' option."),this.truncateResampledAnimations=new rt("Truncate resampled animations",!0,"Enabled: animation durations are truncated in order to keep the requested FPS.<br/>Disabled: requested FPS is slightly modified to keep the original duration."),this.createSkeleton=new rt("Generate skeleton",!0,"Enabled: a skeleton is generated and all geometry is attached to skeleton bones.<br/>Disabled: no skeleton is generated and all geometry is static.")}}!function(e){e[e.Translation=1]="Translation",e[e.Rotation=2]="Rotation",e[e.Scale=3]="Scale"}(Oe||(Oe={}));class lt{constructor(e,t,i){this.rows=t,this.colums=i,this.channels=[];var r=t*i;this.data=new Float32Array(r),this.original_data=new Float32Array(r);for(var n=0;n<r;++n)this.data[n]=e.data[n],this.original_data[n]=e.data[n]}getTargetDataRows(){return this.rows}getTargetDataColumns(){return this.colums}applyAnimation(e,t,i){ke?.applyToData(e,this.data,t,i),this.updateFromData()}registerAnimation(e){this.channels?.push(e)}isAnimated(){return!!this.channels&&this.channels.length>0}isAnimatedBy(e){if(null!==e&&this.channels){for(var t=0;t<this.channels.length;++t){var i=this.channels[t];if(-1!==e.channels.indexOf(i))return!0}return!1}return!!this.channels&&this.channels.length>0}resetAnimation(){for(var e=0;e<this.data.length;++e)this.data[e]=this.original_data[e];this.updateFromData()}applyTransformation(e){throw new Error("Not implemented")}updateFromData(){throw new Error("Not implemented")}hasTransformType(e){throw new Error("Not implemented")}}class ct extends lt{constructor(e){super(e,4,4),this.matrix=new a.Matrix,this.updateFromData()}updateFromData(){Be(this.data,0,this.matrix)}applyTransformation(e){e.copyFrom(e.multiply(this.matrix))}hasTransformType(e){return!0}}class ut extends lt{constructor(e){super(e,4,1),this.axis=new a.Vector3,this.axis=new a.Vector3,this.radians=0,this.updateFromData()}updateFromData(){this.axis.set(this.data[0],this.data[1],this.data[2]),this.radians=this.data[3]/180*Math.PI}applyTransformation(e){let t=a.Matrix.RotationAxis(this.axis,this.radians);e.copyFrom(e.multiply(t))}hasTransformType(e){return e===Oe.Rotation}}class ht extends lt{constructor(e){super(e,3,1),this.pos=new a.Vector3,this.updateFromData()}updateFromData(){this.pos.set(this.data[0],this.data[1],this.data[2])}applyTransformation(e){let t=a.Matrix.Translation(this.pos.x,this.pos.y,this.pos.z);e.copyFrom(e.multiply(t))}hasTransformType(e){return e===Oe.Translation}}class dt extends lt{constructor(e){super(e,3,1),this.scl=new a.Vector3,this.updateFromData()}updateFromData(){this.scl.set(this.data[0],this.data[1],this.data[2])}applyTransformation(e){let t=a.Matrix.Scaling(this.scl.x,this.scl.y,this.scl.z);e.copyFrom(e.multiply(t))}hasTransformType(e){return e===Oe.Scale}}class _t{constructor(){this.transformation_pre=new a.Matrix,this.transformation_post=new a.Matrix,this.matrix=new a.Matrix,this.worldMatrix=new a.Matrix,this.initialLocalMatrix=new a.Matrix,this.initialWorldMatrix=new a.Matrix,this.name="",this.children=[],this.geometries=[],this.transformations=[],this.transformation_pre=a.Matrix.Identity(),this.transformation_post=a.Matrix.Identity()}addTransform(e){var t=new oe;t.data=new Float32Array,e.copyToArray(t.data),t.type="matrix",t.name="virtual static transform";var i=new ct(t);this.transformations.unshift(i)}getWorldMatrix(e){return null!=this.parent?this.worldMatrix=this.parent.getWorldMatrix(e).multiply(this.getLocalMatrix(e)):this.worldMatrix.copyFrom(this.getLocalMatrix(e)),this.worldMatrix}getLocalMatrix(e){this.matrix.copyFrom(this.transformation_pre);for(var t=0;t<this.transformations.length;t++)this.transformations[t].applyTransformation(this.matrix);return this.matrix=this.matrix.multiply(this.transformation_post),this.matrix}containsSceneGraphItems(){return this.geometries.length>0}isAnimated(e){return this.isAnimatedBy(void 0,e)}isAnimatedBy(e,t){for(var i=0;i<this.transformations.length;i++)if(this.transformations[i].isAnimatedBy(e))return!0;return!(!t||!this.parent)&&this.parent.isAnimatedBy(e,t)}resetAnimation(){for(var e=0;e<this.transformations.length;e++)this.transformations[e].resetAnimation()}static pruneNodes(e,t){for(var i=0;i<e.length;++i){var r=e[i];_t.pruneNodes(r.children,t)}e=e.filter(((e,t,i)=>e.containsSceneGraphItems()||e.children.length>0))}static createNode(e,t,i){var r=new _t;r.parent=t,t&&t.children.push(r),i.nodes.register(e,r),r.name=e.name||e.id||e.sid||"Unnamed node";for(var n=0;n<e.transformations.length;++n){var a=e.transformations[n],s=null;switch(a.type){case"matrix":s=new ct(a);break;case"rotate":s=new ut(a);break;case"translate":s=new ht(a);break;case"scale":s=new dt(a);break;default:i.log.write("Transformation type "+a.type+" not supported, transform ignored",o.Warning)}null!==s&&(i.animationTargets.register(a,s),r.transformations.push(s))}for(_t.updateInitialMatrices(r,i),n=0;n<e.children.length;n++){var l=e.children[n];_t.createNode(l,r,i)}return r}static updateInitialMatrices(e,t){e.getLocalMatrix(t),e.initialLocalMatrix.copyFrom(e.matrix),e.getWorldMatrix(t),e.initialWorldMatrix.copyFrom(e.worldMatrix)}static createNodeData(e,t){for(var i=t.nodes.findCollada(e),r=0;r<i.geometries.length;r++){var n=i.geometries[r],a=it.createStatic(n,e,t);e.geometries.push(a)}for(r=0;r<i.controllers.length;r++){var s=i.controllers[r];a=it.createAnimated(s,e,t),e.geometries.push(a)}for(i.lights.length>0&&t.log.write("Node "+i.id+" contains lights, lights are ignored",o.Warning),i.cameras.length>0&&t.log.write("Node "+i.id+" contains cameras, cameras are ignored",o.Warning),r=0;r<e.children.length;r++){var l=e.children[r];_t.createNodeData(l,t)}}static forEachNode(e,t){for(var i=0;i<e.length;++i){var r=e[i];t(r),_t.forEachNode(r.children,t)}}static extractGeometries(e,t){var i=[];if(_t.forEachNode(e,(e=>{for(var t=0;t<e.geometries.length;++t)i.push({node:e,geometry:e.geometries[t]});e.geometries=[]})),0===i.length)return t.log.write("No geometry found in the scene, returning an empty geometry",o.Warning),(s=new it).name="empty_geometry",[s];var r=0,n=0;if(i.forEach((e=>{null!==e.geometry.getSkeleton()&&r++,e.node.isAnimated(!0)&&n++})),t.options.createSkeleton.value||(r>0&&t.log.write("Scene contains "+r+" skinned geometries, but skeleton creation is disabled. Static geometry was generated.",o.Warning),n>0&&t.log.write("Scene contains "+n+" static geometries attached to animated nodes, but skeleton creation is disabled. Static geometry was generated.",o.Warning),i.forEach((e=>{var i=e.node.getWorldMatrix(t);if(t.options.worldTransformUnitScale){var r=new a.Matrix;r=a.Matrix.Invert(e.node.transformation_post),i=i.multiply(r)}it.transformGeometry(e.geometry,i,t)}))),t.options.singleGeometry){var s,l=i.map((e=>e.geometry));return[s=it.mergeGeometries(l,t)]}return i.map((e=>e.geometry))}static setupWorldTransform(e,t){var i=function(e){var t=1/e.options.worldTransformScale.value;return new a.Vector3(t,t,t)}(t),r=Ie(t),n=t.options.worldTransformUnitScale.value;null==e.parent?e.transformation_pre.copyFrom(r):n&&(e.transformation_pre=a.Matrix.Invert(e.parent.transformation_post)),n&&(e.transformation_post=a.Matrix.Scaling(i.x,i.y,i.z)),_t.updateInitialMatrices(e,t);for(var o=0;o<e.children.length;++o)_t.setupWorldTransform(e.children[o],t)}}class ft{constructor(){this.nodes=[],this.animations=[],this.geometries=[],this.resampled_animations=[]}}class pt{constructor(){this.log=new c,this.options=new st}forEachGeometry(e,t){for(var i=0;i<e.geometries.length;++i)t(e.geometries[i]);_t.forEachNode(e.nodes,(e=>{for(var i=0;i<e.geometries.length;++i)t(e.geometries[i])}))}convert(e){var t=new je(this.log,this.options);if(!e)return t.log.write("No document to convert",o.Warning),null;var i=new ft;if(i.nodes=pt.createScene(e,t),t.options.worldTransform.value){for(var r=0;r<i.nodes.length;++r)_t.setupWorldTransform(i.nodes[r],t);if(this.forEachGeometry(i,(e=>{it.setupWorldTransform(e,t)})),t.options.worldTransformBake.value){var n=Ie(t);this.forEachGeometry(i,(e=>{null!==e.getSkeleton()&&it.transformGeometry(e,n,t)}))}}return!0===t.options.enableAnimations.value&&(i.animations=pt.createAnimations(e,t)),!0===t.options.enableExtractGeometry.value&&(i.geometries=_t.extractGeometries(i.nodes,t)),!0===t.options.singleBufferPerGeometry.value&&this.forEachGeometry(i,(e=>{$e.mergeChunkData(e.chunks,t)})),!0===t.options.enableResampledAnimations.value&&(i.resampled_animations=pt.createResampledAnimations(e,i,t)),_t.forEachNode(i.nodes,(e=>{this.forEachGeometry(i,(e=>{it.computeBoundingBox(e,t)}))})),i}static createScene(e,t){var i=[];if(!e.scene)return t.log.write("Collada document has no scene",o.Warning),i;var r=le.fromLink(e.scene.instance,t);if(!r)return t.log.write("Collada document has no scene",o.Warning),i;for(var n=0;n<r.children.length;++n){var a=r.children[n];i.push(_t.createNode(a,null,t))}for(n=0;n<i.length;++n){var s=i[n];_t.createNodeData(s,t)}return i}static createAnimations(e,t){for(var i=[],r=0;r<e.libAnimations.children.length;++r){var n=e.libAnimations.children[r];i.push(Ge.create(n,t))}if(!0===t.options.singleAnimation.value&&i.length>1){var o=new Ge;for(o.id="",o.name="animation",r=0;r<i.length;++r){var a=i[r];o.channels=o.channels.concat(a.channels),a.channels=[]}i=[o]}return i}static createResampledAnimations(e,t,i){var r=[];if(0===t.animations.length)return[];if(t.geometries.length>1)return i.log.write("Converted document contains multiple geometries, resampled animations are only generated for single geometries.",o.Warning),[];if(0===t.geometries.length)return i.log.write("Converted document does not contain any geometries, no resampled animations generated.",o.Warning),[];for(var n=t.geometries[0],a=+i.options.animationFps.value,s=0;s<t.animations.length;++s){var l=t.animations[s];if(!0===i.options.useAnimationLabels.value){var c=i.options.animationLabels.value,u=We.createFromLabels(n.getSkeleton(),l,c,a,i);r=r.concat(u)}else{var h=We.create(n.getSkeleton(),l,null,null,a,i);null!==h&&r.push(h)}}return r}}class mt extends s{constructor(e){super(e),this.log=e,this.chunks=[],this.chunk_data=[],this.bytes_written=0}registerChunk(e){this.chunks.push(e),e.byte_offset=this.bytes_written,this.bytes_written+=e.getBytesCount()}assembleData(){for(var e=new ArrayBuffer(this.bytes_written),t=new Uint8Array(e),i=0;i<this.chunks.length;++i)for(var r=this.chunks[i],n=r.getDataView(),o=n.length,a=r.byte_offset,s=0;s<o;++s)t[s+a]=n[s];return t}}class gt{static toJSON(e,t){return e?{name:e.name,diffuse:null!==e.diffuse?e.diffuse.url:"",specular:null!==e.specular?e.specular.url:"",normal:null!==e.normal?e.normal.url:"",diffuseColor:e.diffuseColor,specularColor:e.specularColor,emissiveColor:e.emissiveColor}:null}}class vt{constructor(){this.byte_offset=0,this.stride=0,this.count=0,this.bytes_per_element=0,this.data=null}getDataView(){return new Uint8Array(this.data.buffer,0,this.stride*this.count*this.bytes_per_element)}getBytesCount(){return this.data.length*this.bytes_per_element}static toJSON(e){return e&&e.type||(e.type=""),{type:e.type,byte_offset:e.byte_offset,stride:e.stride,count:e.count}}static create(e,t,i){var r=new vt;if(!e)return r;if(r.data=e,r.stride=t,r.count=e.length/t,e instanceof Float32Array)r.type="float",r.bytes_per_element=4;else if(e instanceof Float64Array)r.type="double",r.bytes_per_element=8;else if(e instanceof Uint8Array)r.type="uint8",r.bytes_per_element=1;else if(e instanceof Uint16Array)r.type="uint16",r.bytes_per_element=2;else if(e instanceof Uint32Array)r.type="uint32",r.bytes_per_element=4;else if(e instanceof Int8Array)r.type="int8",r.bytes_per_element=1;else if(e instanceof Int16Array)r.type="int16",r.bytes_per_element=2;else{if(!(e instanceof Int32Array))return i.log.write("Unknown data type, data chunk ignored",o.Warning),r;r.type="int32",r.bytes_per_element=4}return i.registerChunk(r),r}}class bt{static toJSON(e){return e?{min:[e.min[0],e.min[1],e.min[2]],max:[e.max[0],e.max[1],e.max[2]]}:{min:[0,0,0],max:[0,0,0]}}}class yt{static toJSON(e,t,i){var r=vt.create(e.data.indices,3,i),n=vt.create(e.data.position,3,i),o=vt.create(e.data.normal,3,i),a=vt.create(e.data.texcoord,2,i),s=vt.create(e.data.boneweight,4,i),l=vt.create(e.data.boneindex,4,i);return{name:e.name,material:t,vertex_count:e.vertexCount,triangle_count:e.triangleCount,indices:vt.toJSON(r),position:vt.toJSON(n),normal:vt.toJSON(o),texcoord:vt.toJSON(a),boneweight:vt.toJSON(s),boneindex:vt.toJSON(l),bounding_box:bt.toJSON(e.boundingBox)}}}class xt{static toJSON(e,t){if(e){var i=[];return e.bones.forEach((t=>{var r=t.node.initialLocalMatrix,n=new a.Vector3(0,0,0),o=new a.Quaternion(0,0,0,1),s=new a.Vector3(1,1,1);r.decompose(s,o,n);var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];t.invBindMatrix=a.Matrix.FromArray(l),i.push({name:t.name,parent:e.bones.indexOf(t.parent),skinned:t.attachedToSkin,inv_bind_mat:l,matrix:r.asArray(),pos:n.asArray(),rot:o.asArray(),scl:s.asArray()})})),i}}}class Tt{static toJSON(e,t,i){if(!e)return null;var r=vt.create(e.pos,3,i),n=vt.create(e.rot,4,i),o=vt.create(e.scl,3,i);return{bone:t,pos:vt.toJSON(r),rot:vt.toJSON(n),scl:vt.toJSON(o)}}}class Ct{static toJSON(e,t){return e?{name:e.name,frames:e.keyframes,fps:e.fps,tracks:e.tracks.map(((e,i)=>Tt.toJSON(e,i,t)))}:{name:"",frames:0,fps:0,tracks:void 0}}}class St{constructor(){this.json=null,this.data=null}}class Pt{constructor(){this.log=new c}export(e){var t=new mt(this.log);if(!e)return t.log.write("No document to convert",o.Warning),null;if(0===e.geometries.length)return t.log.write("Document contains no geometry, nothing exported",o.Warning),null;e.geometries.length>1&&t.log.write("Document contains multiple geometries, only the first geometry is exported",o.Warning);for(var i=[],r=[],n=e.geometries[0],a=[],s=0;s<n.chunks.length;++s){var l=n.chunks[s],c=i.indexOf(l.material);if(-1===c){var u=gt.toJSON(l.material,t);c=r.length,i.push(l.material),r.push(u)}a.push(yt.toJSON(l,c,t))}var h=new St,d={bounding_box:bt.toJSON(n.boundingBox)},_=xt.toJSON(n.getSkeleton(),t),f=e.resampled_animations.map((e=>Ct.toJSON(e,t)));return h.json={info:d,materials:r,chunks:a,bones:_,animations:f},h.data=t.assembleData(),h}}class Et{constructor(){this.name="dae",this.extensions=".dae",this._assetContainer=null}createPlugin(){return new Et}importMeshAsync(e,t,i,r){var n=new he,a=new l;a.onmessage=(e,t)=>{console.log(e)},n.log=new u(a,o.Debug);var s=(new DOMParser).parseFromString(i,"text/xml"),c=n.loadFromXML("id",s),h=(new pt).convert(c),d=(new Pt).export(h),_=(new be).loadModel(d.json,d.data.buffer),f=(new ye).createBabylonModel(_,t);const p={meshes:f.meshes,particleSystems:[],skeletons:[],animationGroups:[],transformNodes:f.transformNodes||[],geometries:[],lights:[],spriteManagers:[]};return Promise.resolve(p)}loadAsync(e,t,i){return this.importMeshAsync(void 0,e,t,i).then((()=>{}))}loadAssetContainerAsync(e,t,i){const r=new a.AssetContainer(e);return this._assetContainer=r,this.importMeshAsync(void 0,e,t,i).then((e=>(e.meshes.forEach((e=>{r.meshes.push(e)})),e.meshes.forEach((e=>{const t=e.material;t&&-1==r.materials.indexOf(t)&&(r.materials.push(t),t.getActiveTextures().forEach((e=>{-1==r.textures.indexOf(e)&&r.textures.push(e)})))})),this._assetContainer=null,r))).catch((e=>{throw this._assetContainer=null,e}))}}function wt(){a.SceneLoader&&a.SceneLoader.RegisterPlugin(new Et)}return n})(),e.exports=r(i(9859))},5695:function(e,t,i){var r;"undefined"!=typeof self?self:void 0!==i.g&&i.g,r=e=>(()=>{"use strict";var t={"../../../dev/gui/src/2D/adtInstrumentation.ts":(e,t,i)=>{i.r(t),i.d(t,{AdvancedDynamicTextureInstrumentation:()=>n});var r=i("babylonjs/Misc/perfCounter"),n=function(){function e(e){this.texture=e,this._captureRenderTime=!1,this._renderTime=new r.PerfCounter,this._captureLayoutTime=!1,this._layoutTime=new r.PerfCounter,this._onBeginRenderObserver=null,this._onEndRenderObserver=null,this._onBeginLayoutObserver=null,this._onEndLayoutObserver=null}return Object.defineProperty(e.prototype,"renderTimeCounter",{get:function(){return this._renderTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layoutTimeCounter",{get:function(){return this._layoutTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureRenderTime",{get:function(){return this._captureRenderTime},set:function(e){var t=this;e!==this._captureRenderTime&&(this._captureRenderTime=e,e?(this._onBeginRenderObserver=this.texture.onBeginRenderObservable.add((function(){t._renderTime.beginMonitoring()})),this._onEndRenderObserver=this.texture.onEndRenderObservable.add((function(){t._renderTime.endMonitoring(!0)}))):(this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver),this._onBeginRenderObserver=null,this.texture.onEndRenderObservable.remove(this._onEndRenderObserver),this._onEndRenderObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureLayoutTime",{get:function(){return this._captureLayoutTime},set:function(e){var t=this;e!==this._captureLayoutTime&&(this._captureLayoutTime=e,e?(this._onBeginLayoutObserver=this.texture.onBeginLayoutObservable.add((function(){t._layoutTime.beginMonitoring()})),this._onEndLayoutObserver=this.texture.onEndLayoutObservable.add((function(){t._layoutTime.endMonitoring(!0)}))):(this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver),this._onBeginLayoutObserver=null,this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver),this._onEndLayoutObserver=null))},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver),this._onBeginRenderObserver=null,this.texture.onEndRenderObservable.remove(this._onEndRenderObserver),this._onEndRenderObserver=null,this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver),this._onBeginLayoutObserver=null,this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver),this._onEndLayoutObserver=null,this.texture=null},e}()},"../../../dev/gui/src/2D/advancedDynamicTexture.ts":(e,t,i)=>{i.r(t),i.d(t,{AdvancedDynamicTexture:()=>c});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/2D/controls/container.ts"),a=i("../../../dev/gui/src/2D/controls/control.ts"),s=i("../../../dev/gui/src/2D/style.ts"),l=i("../../../dev/gui/src/2D/measure.ts"),c=function(e){function t(t,i,r,a,s,c,u){void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=!1),void 0===c&&(c=n.Texture.NEAREST_SAMPLINGMODE),void 0===u&&(u=!0);var h=e.call(this,t,{width:i,height:r},a,s,c,n.Constants.TEXTUREFORMAT_RGBA,u)||this;return h.onGuiReadyObservable=new n.Observable,h._isDirty=!1,h._rootContainer=new o.Container("root"),h._lastControlOver={},h._lastControlDown={},h._capturingControl={},h._linkedControls=new Array,h._isFullscreen=!1,h._fullscreenViewport=new n.Viewport(0,0,1,1),h._idealWidth=0,h._idealHeight=0,h._useSmallestIdeal=!1,h._renderAtIdealSize=!1,h._blockNextFocusCheck=!1,h._renderScale=1,h._cursorChanged=!1,h._defaultMousePointerId=0,h._rootChildrenHaveChanged=!1,h._capturedPointerIds=new Set,h._numLayoutCalls=0,h._numRenderCalls=0,h._clipboardData="",h.onClipboardObservable=new n.Observable,h.onControlPickedObservable=new n.Observable,h.onBeginLayoutObservable=new n.Observable,h.onEndLayoutObservable=new n.Observable,h.onBeginRenderObservable=new n.Observable,h.onEndRenderObservable=new n.Observable,h.premulAlpha=!1,h.applyYInversionOnUpdate=!0,h.disableTabNavigation=!1,h.skipBlockEvents=0,h.checkPointerEveryFrame=!1,h._useInvalidateRectOptimization=!0,h._invalidatedRectangle=null,h._clearMeasure=new l.Measure(0,0,0,0),h._focusProperties={index:0,total:-1},h._onClipboardCopy=function(e){var t=e,i=new n.ClipboardInfo(n.ClipboardEventTypes.COPY,t);h.onClipboardObservable.notifyObservers(i),t.preventDefault()},h._onClipboardCut=function(e){var t=e,i=new n.ClipboardInfo(n.ClipboardEventTypes.CUT,t);h.onClipboardObservable.notifyObservers(i),t.preventDefault()},h._onClipboardPaste=function(e){var t=e,i=new n.ClipboardInfo(n.ClipboardEventTypes.PASTE,t);h.onClipboardObservable.notifyObservers(i),t.preventDefault()},h.parseContent=h.parseSerializedObject,(a=h.getScene())&&h._texture?(h.applyYInversionOnUpdate=u,h._rootElement=a.getEngine().getInputElement(),h._renderObserver=a.onBeforeCameraRenderObservable.add((function(e){return h._checkUpdate(e)})),h._controlAddedObserver=h._rootContainer.onControlAddedObservable.add((function(e){e&&(h._rootChildrenHaveChanged=!0)})),h._controlRemovedObserver=h._rootContainer.onControlRemovedObservable.add((function(e){e&&(h._rootChildrenHaveChanged=!0)})),h._preKeyboardObserver=a.onPreKeyboardObservable.add((function(e){if(!h.disableTabNavigation&&e.type===n.KeyboardEventTypes.KEYDOWN&&"Tab"===e.event.code){var t=!e.event.shiftKey;return t&&h._focusProperties.index===h._focusProperties.total-1||!t&&0===h._focusProperties.index&&h._focusProperties.total>0?(h.focusedControl=null,h._focusProperties.index=0,void(h._focusProperties.total=-1)):(h._focusNextElement(t),void e.event.preventDefault())}h._focusedControl&&(e.type===n.KeyboardEventTypes.KEYDOWN&&h._focusedControl.processKeyboard(e.event),e.skipOnPointerObservable=!0)})),h._rootContainer._link(h),h.hasAlpha=!0,i&&r||(h._resizeObserver=a.getEngine().onResizeObservable.add((function(){return h._onResize()})),h._onResize()),h._texture.isReady=!0,h):h}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"numLayoutCalls",{get:function(){return this._numLayoutCalls},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"numRenderCalls",{get:function(){return this._numRenderCalls},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderScale",{get:function(){return this._renderScale},set:function(e){e!==this._renderScale&&(this._renderScale=e,this._onResize())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this.markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idealWidth",{get:function(){return this._idealWidth},set:function(e){this._idealWidth!==e&&(this._idealWidth=e,this.markAsDirty(),this._rootContainer._markAllAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idealHeight",{get:function(){return this._idealHeight},set:function(e){this._idealHeight!==e&&(this._idealHeight=e,this.markAsDirty(),this._rootContainer._markAllAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useSmallestIdeal",{get:function(){return this._useSmallestIdeal},set:function(e){this._useSmallestIdeal!==e&&(this._useSmallestIdeal=e,this.markAsDirty(),this._rootContainer._markAllAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderAtIdealSize",{get:function(){return this._renderAtIdealSize},set:function(e){this._renderAtIdealSize!==e&&(this._renderAtIdealSize=e,this._onResize())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idealRatio",{get:function(){var e=0,t=0;return this._idealWidth&&(e=this.getSize().width/this._idealWidth),this._idealHeight&&(t=this.getSize().height/this._idealHeight),this._useSmallestIdeal&&this._idealWidth&&this._idealHeight?window.innerWidth<window.innerHeight?e:t:this._idealWidth?e:this._idealHeight?t:1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layer",{get:function(){return this._layerToDispose},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rootContainer",{get:function(){return this._rootContainer},enumerable:!1,configurable:!0}),t.prototype.getChildren=function(){return[this._rootContainer]},t.prototype.getDescendants=function(e,t){return this._rootContainer.getDescendants(e,t)},t.prototype.getControlsByType=function(e){return this._rootContainer.getDescendants(!1,(function(t){return t.typeName===e}))},t.prototype.getControlByName=function(e){return this._getControlByKey("name",e)},t.prototype._getControlByKey=function(e,t){return this._rootContainer.getDescendants().find((function(i){return i[e]===t}))||null},Object.defineProperty(t.prototype,"focusedControl",{get:function(){return this._focusedControl},set:function(e){this._focusedControl!=e&&(this._focusedControl&&this._focusedControl.onBlur(),e&&e.onFocus(),this._focusedControl=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isForeground",{get:function(){return!this.layer||!this.layer.isBackground},set:function(e){this.layer&&this.layer.isBackground!==!e&&(this.layer.isBackground=!e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipboardData",{get:function(){return this._clipboardData},set:function(e){this._clipboardData=e},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"AdvancedDynamicTexture"},t.prototype.executeOnAllControls=function(e,t){t||(t=this._rootContainer),e(t);for(var i=0,r=t.children;i<r.length;i++){var n=r[i];n.children?this.executeOnAllControls(e,n):e(n)}},Object.defineProperty(t.prototype,"useInvalidateRectOptimization",{get:function(){return this._useInvalidateRectOptimization},set:function(e){this._useInvalidateRectOptimization=e},enumerable:!1,configurable:!0}),t.prototype.invalidateRect=function(e,t,i,r){if(this._useInvalidateRectOptimization)if(this._invalidatedRectangle){var n=Math.ceil(Math.max(this._invalidatedRectangle.left+this._invalidatedRectangle.width-1,i)),o=Math.ceil(Math.max(this._invalidatedRectangle.top+this._invalidatedRectangle.height-1,r));this._invalidatedRectangle.left=Math.floor(Math.min(this._invalidatedRectangle.left,e)),this._invalidatedRectangle.top=Math.floor(Math.min(this._invalidatedRectangle.top,t)),this._invalidatedRectangle.width=n-this._invalidatedRectangle.left+1,this._invalidatedRectangle.height=o-this._invalidatedRectangle.top+1}else this._invalidatedRectangle=new l.Measure(e,t,i-e+1,r-t+1)},t.prototype.markAsDirty=function(){this._isDirty=!0},t.prototype.createStyle=function(){return new s.Style(this)},t.prototype.addControl=function(e){return this._rootContainer.addControl(e),this},t.prototype.removeControl=function(e){return this._rootContainer.removeControl(e),this},t.prototype.moveToNonOverlappedPosition=function(e,i,r){var o;if(void 0===i&&(i=1),void 0===r&&(r=1),Array.isArray(e))o=e;else{var a=this.getDescendants(!0);o=void 0===e?a.filter((function(e){return void 0!==e.overlapGroup})):a.filter((function(t){return t.overlapGroup===e}))}o.forEach((function(e){var a,s=n.Vector2.Zero(),l=new n.Vector2(e.centerX,e.centerY);o.forEach((function(i){if(e!==i&&t._Overlaps(e,i)){var o=l.subtract(new n.Vector2(i.centerX,i.centerY)),a=o.length();a>0&&(s=s.add(o.normalize().scale(r/a)))}})),s.length()>0&&(s=s.normalize().scale(i*(null!==(a=e.overlapDeltaMultiplier)&&void 0!==a?a:1)),e.linkOffsetXInPixels+=s.x,e.linkOffsetYInPixels+=s.y)}))},t.prototype.dispose=function(){var t=this.getScene();t&&(this._rootElement=null,t.onBeforeCameraRenderObservable.remove(this._renderObserver),this._resizeObserver&&t.getEngine().onResizeObservable.remove(this._resizeObserver),this._prePointerObserver&&t.onPrePointerObservable.remove(this._prePointerObserver),this._sceneRenderObserver&&t.onBeforeRenderObservable.remove(this._sceneRenderObserver),this._pointerObserver&&t.onPointerObservable.remove(this._pointerObserver),this._preKeyboardObserver&&t.onPreKeyboardObservable.remove(this._preKeyboardObserver),this._canvasPointerOutObserver&&t.getEngine().onCanvasPointerOutObservable.remove(this._canvasPointerOutObserver),this._canvasBlurObserver&&t.getEngine().onCanvasBlurObservable.remove(this._canvasBlurObserver),this._controlAddedObserver&&this._rootContainer.onControlAddedObservable.remove(this._controlAddedObserver),this._controlRemovedObserver&&this._rootContainer.onControlRemovedObservable.remove(this._controlRemovedObserver),this._layerToDispose&&(this._layerToDispose.texture=null,this._layerToDispose.dispose(),this._layerToDispose=null),this._rootContainer.dispose(),this.onClipboardObservable.clear(),this.onControlPickedObservable.clear(),this.onBeginRenderObservable.clear(),this.onEndRenderObservable.clear(),this.onBeginLayoutObservable.clear(),this.onEndLayoutObservable.clear(),this.onGuiReadyObservable.clear(),e.prototype.dispose.call(this))},t.prototype._onResize=function(){var e=this.getScene();if(e){var t=e.getEngine(),i=this.getSize(),r=t.getRenderWidth()*this._renderScale,n=t.getRenderHeight()*this._renderScale;this._renderAtIdealSize&&(this._idealWidth?(n=n*this._idealWidth/r,r=this._idealWidth):this._idealHeight&&(r=r*this._idealHeight/n,n=this._idealHeight)),i.width===r&&i.height===n||(this.scaleTo(r,n),this.markAsDirty(),(this._idealWidth||this._idealHeight)&&this._rootContainer._markAllAsDirty()),this.invalidateRect(0,0,i.width-1,i.height-1)}},t.prototype._getGlobalViewport=function(){var e=this.getSize(),t=this._fullscreenViewport.toGlobal(e.width,e.height),i=Math.round(t.width*(1/this.rootContainer.scaleX)),r=Math.round(t.height*(1/this.rootContainer.scaleY));return t.x+=(t.width-i)/2,t.y+=(t.height-r)/2,t.width=i,t.height=r,t},t.prototype.getProjectedPosition=function(e,t){var i=this.getProjectedPositionWithZ(e,t);return new n.Vector2(i.x,i.y)},t.prototype.getProjectedPositionWithZ=function(e,t){var i=this.getScene();if(!i)return n.Vector3.Zero();var r=this._getGlobalViewport(),o=n.Vector3.Project(e,t,i.getTransformMatrix(),r);return new n.Vector3(o.x,o.y,o.z)},t.prototype._checkUpdate=function(e,i){if(!this._layerToDispose||e.layerMask&this._layerToDispose.layerMask){if(this._isFullscreen&&this._linkedControls.length){var r=this.getScene();if(!r)return;for(var o=this._getGlobalViewport(),a=function(e){if(!e.isVisible)return"continue";var t=e._linkedMesh;if(!t||t.isDisposed())return n.Tools.SetImmediate((function(){e.linkWithMesh(null)})),"continue";var i=t.getBoundingInfo?t.getBoundingInfo().boundingSphere.center:n.Vector3.ZeroReadOnly,a=n.Vector3.Project(i,t.getWorldMatrix(),r.getTransformMatrix(),o);if(a.z<0||a.z>1)return e.notRenderable=!0,"continue";e.notRenderable=!1,s.useInvalidateRectOptimization&&e.invalidateRect(),e._moveToProjectedPosition(a)},s=this,l=0,c=this._linkedControls;l<c.length;l++)a(c[l])}(this._isDirty||this._rootContainer.isDirty)&&(this._isDirty=!1,this._render(i),i||this.update(this.applyYInversionOnUpdate,this.premulAlpha,t.AllowGPUOptimizations))}},t.prototype._render=function(e){var t,i=this.getSize(),r=i.width,n=i.height,o=this.getContext();if(o.font="18px Arial",o.strokeStyle="white",this.onGuiReadyObservable.hasObservers()&&this._checkGuiIsReady(),this._rootChildrenHaveChanged){var a=null===(t=this.getScene())||void 0===t?void 0:t.activeCamera;a&&(this._rootChildrenHaveChanged=!1,this._checkUpdate(a,!0))}this.onBeginLayoutObservable.notifyObservers(this);var s=new l.Measure(0,0,r,n);this._numLayoutCalls=0,this._rootContainer._layout(s,o),this.onEndLayoutObservable.notifyObservers(this),this._isDirty=!1,e||(this._invalidatedRectangle?this._clearMeasure.copyFrom(this._invalidatedRectangle):this._clearMeasure.copyFromFloats(0,0,r,n),o.clearRect(this._clearMeasure.left,this._clearMeasure.top,this._clearMeasure.width,this._clearMeasure.height),this._background&&(o.save(),o.fillStyle=this._background,o.fillRect(this._clearMeasure.left,this._clearMeasure.top,this._clearMeasure.width,this._clearMeasure.height),o.restore()),this.onBeginRenderObservable.notifyObservers(this),this._numRenderCalls=0,this._rootContainer._render(o,this._invalidatedRectangle),this.onEndRenderObservable.notifyObservers(this),this._invalidatedRectangle=null)},t.prototype._changeCursor=function(e){this._rootElement&&(this._rootElement.style.cursor=e,this._cursorChanged=!0)},t.prototype._registerLastControlDown=function(e,t){this._lastControlDown[t]=e,this.onControlPickedObservable.notifyObservers(e)},t.prototype._doPicking=function(e,t,i,r,o,a,s,l){var c=this.getScene();if(c){var u=c.getEngine(),h=this.getSize();if(this._isFullscreen){var d=c.cameraToUseForPointers||c.activeCamera;if(!d)return;var _=d.viewport;e*=h.width/(u.getRenderWidth()*_.width),t*=h.height/(u.getRenderHeight()*_.height)}if(this._capturingControl[o])return this._capturingControl[o].isPointerBlocker&&(this._shouldBlockPointer=!0),void this._capturingControl[o]._processObservables(r,e,t,i,o,a);this._cursorChanged=!1,this._rootContainer._processPicking(e,t,i,r,o,a,s,l)||(c.doNotHandleCursors||this._changeCursor(""),r===n.PointerEventTypes.POINTERMOVE&&this._lastControlOver[o]&&(this._lastControlOver[o]._onPointerOut(this._lastControlOver[o],i),delete this._lastControlOver[o])),this._cursorChanged||c.doNotHandleCursors||this._changeCursor(""),this._manageFocus()}},t.prototype._cleanControlAfterRemovalFromList=function(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&e[i]===t&&delete e[i]},t.prototype._cleanControlAfterRemoval=function(e){this._cleanControlAfterRemovalFromList(this._lastControlDown,e),this._cleanControlAfterRemovalFromList(this._lastControlOver,e)},t.prototype.pick=function(e,t,i){void 0===i&&(i=null),this._isFullscreen&&this._scene&&this._translateToPicking(this._scene,new n.Viewport(0,0,0,0),i,e,t)},t.prototype._translateToPicking=function(e,t,i,r,o){void 0===r&&(r=e.pointerX),void 0===o&&(o=e.pointerY);var a=e.cameraToUseForPointers||e.activeCamera,s=e.getEngine(),l=e.cameraToUseForPointers;if(a)if(a.rigCameras.length){var c=new n.Viewport(0,0,1,1);a.rigCameras.forEach((function(i){i.viewport.toGlobalToRef(s.getRenderWidth(),s.getRenderHeight(),c);var n=r/s.getHardwareScalingLevel()-c.x,a=o/s.getHardwareScalingLevel()-(s.getRenderHeight()-c.y-c.height);n<0||a<0||r>c.width||o>c.height||(e.cameraToUseForPointers=i,t.x=c.x,t.y=c.y,t.width=c.width,t.height=c.height)}))}else a.viewport.toGlobalToRef(s.getRenderWidth(),s.getRenderHeight(),t);else t.x=0,t.y=0,t.width=s.getRenderWidth(),t.height=s.getRenderHeight();var u=r/s.getHardwareScalingLevel()-t.x,h=o/s.getHardwareScalingLevel()-(s.getRenderHeight()-t.y-t.height);if(this._shouldBlockPointer=!1,i){var d=i.event.pointerId||this._defaultMousePointerId;this._doPicking(u,h,i,i.type,d,i.event.button,i.event.deltaX,i.event.deltaY),(this._shouldBlockPointer&&!(i.type&this.skipBlockEvents)||this._capturingControl[d])&&(i.skipOnPointerObservable=!0)}else this._doPicking(u,h,null,n.PointerEventTypes.POINTERMOVE,this._defaultMousePointerId,0);e.cameraToUseForPointers=l},t.prototype.attach=function(){var e=this,t=this.getScene();if(t){var i=new n.Viewport(0,0,0,0);this._prePointerObserver=t.onPrePointerObservable.add((function(r){if((!t.isPointerCaptured(r.event.pointerId)||r.type!==n.PointerEventTypes.POINTERUP||e._capturedPointerIds.has(r.event.pointerId))&&(r.type===n.PointerEventTypes.POINTERMOVE||r.type===n.PointerEventTypes.POINTERUP||r.type===n.PointerEventTypes.POINTERDOWN||r.type===n.PointerEventTypes.POINTERWHEEL)){if(r.type===n.PointerEventTypes.POINTERMOVE){if(t.isPointerCaptured(r.event.pointerId))return;r.event.pointerId&&(e._defaultMousePointerId=r.event.pointerId)}e._translateToPicking(t,i,r)}})),this._attachPickingToSceneRender(t,(function(){return e._translateToPicking(t,i,null)}),!1),this._attachToOnPointerOut(t),this._attachToOnBlur(t)}},t.prototype._focusNextElement=function(e){void 0===e&&(e=!0);var t=[];if(this.executeOnAllControls((function(e){e.isFocusInvisible||!e.isVisible||e.tabIndex<0||t.push(e)})),0!==t.length){t.sort((function(e,t){return 0===e.tabIndex?1:0===t.tabIndex?-1:e.tabIndex-t.tabIndex})),this._focusProperties.total=t.length;var i=-1;this._focusedControl?(i=t.indexOf(this._focusedControl)+(e?1:-1))<0?i=t.length-1:i>=t.length&&(i=0):i=e?0:t.length-1,t[i].focus(),this._focusProperties.index=i}},t.prototype.registerClipboardEvents=function(){self.addEventListener("copy",this._onClipboardCopy,!1),self.addEventListener("cut",this._onClipboardCut,!1),self.addEventListener("paste",this._onClipboardPaste,!1)},t.prototype.unRegisterClipboardEvents=function(){self.removeEventListener("copy",this._onClipboardCopy),self.removeEventListener("cut",this._onClipboardCut),self.removeEventListener("paste",this._onClipboardPaste)},t.prototype._transformUvs=function(e){var t,i=this.getTextureMatrix();if(i.isIdentityAs3x2())t=e;else{var r=n.TmpVectors.Matrix[0];i.getRowToRef(0,n.TmpVectors.Vector4[0]),i.getRowToRef(1,n.TmpVectors.Vector4[1]),i.getRowToRef(2,n.TmpVectors.Vector4[2]);var o=n.TmpVectors.Vector4[0],a=n.TmpVectors.Vector4[1],s=n.TmpVectors.Vector4[2];r.setRowFromFloats(0,o.x,o.y,0,0),r.setRowFromFloats(1,a.x,a.y,0,0),r.setRowFromFloats(2,0,0,1,0),r.setRowFromFloats(3,s.x,s.y,0,1),t=n.TmpVectors.Vector2[0],n.Vector2.TransformToRef(e,r,t)}if((this.wrapU===n.Texture.WRAP_ADDRESSMODE||this.wrapU===n.Texture.MIRROR_ADDRESSMODE)&&t.x>1){var l=t.x-Math.trunc(t.x);this.wrapU===n.Texture.MIRROR_ADDRESSMODE&&Math.trunc(t.x)%2==1&&(l=1-l),t.x=l}if((this.wrapV===n.Texture.WRAP_ADDRESSMODE||this.wrapV===n.Texture.MIRROR_ADDRESSMODE)&&t.y>1){var c=t.y-Math.trunc(t.y);this.wrapV===n.Texture.MIRROR_ADDRESSMODE&&Math.trunc(t.x)%2==1&&(c=1-c),t.y=c}return t},t.prototype.attachToMesh=function(e,t){var i=this;void 0===t&&(t=!0);var r=this.getScene();r&&(this._pointerObserver&&r.onPointerObservable.remove(this._pointerObserver),this._pointerObserver=r.onPointerObservable.add((function(t){if(t.type===n.PointerEventTypes.POINTERMOVE||t.type===n.PointerEventTypes.POINTERUP||t.type===n.PointerEventTypes.POINTERDOWN||t.type===n.PointerEventTypes.POINTERWHEEL){t.type===n.PointerEventTypes.POINTERMOVE&&t.event.pointerId&&(i._defaultMousePointerId=t.event.pointerId);var r=t.event.pointerId||i._defaultMousePointerId;if(t.pickInfo&&t.pickInfo.hit&&t.pickInfo.pickedMesh===e){var o=t.pickInfo.getTextureCoordinates();if(o){o=i._transformUvs(o);var a=i.getSize();i._doPicking(o.x*a.width,(i.applyYInversionOnUpdate?1-o.y:o.y)*a.height,t,t.type,r,t.event.button,t.event.deltaX,t.event.deltaY)}}else if(t.type===n.PointerEventTypes.POINTERUP){if(i._lastControlDown[r]&&i._lastControlDown[r]._forcePointerUp(r),delete i._lastControlDown[r],i.focusedControl){var s=i.focusedControl.keepsFocusWith(),l=!0;if(s)for(var c=0,u=s;c<u.length;c++){var h=u[c];if(i!==h._host){var d=h._host;if(d._lastControlOver[r]&&d._lastControlOver[r].isAscendant(h)){l=!1;break}}}l&&(i.focusedControl=null)}}else t.type===n.PointerEventTypes.POINTERMOVE&&(i._lastControlOver[r]&&i._lastControlOver[r]._onPointerOut(i._lastControlOver[r],t,!0),delete i._lastControlOver[r])}})),e.enablePointerMoveEvents=t,this._attachPickingToSceneRender(r,(function(){var t=i._defaultMousePointerId,o=null==r?void 0:r.pick(r.pointerX,r.pointerY);if(o&&o.hit&&o.pickedMesh===e){var a=o.getTextureCoordinates();if(a){a=i._transformUvs(a);var s=i.getSize();i._doPicking(a.x*s.width,(i.applyYInversionOnUpdate?1-a.y:a.y)*s.height,null,n.PointerEventTypes.POINTERMOVE,t,0)}}else i._lastControlOver[t]&&i._lastControlOver[t]._onPointerOut(i._lastControlOver[t],null,!0),delete i._lastControlOver[t]}),!0),this._attachToOnPointerOut(r),this._attachToOnBlur(r))},t.prototype.moveFocusToControl=function(e){this.focusedControl=e,this._lastPickedControl=e,this._blockNextFocusCheck=!0},t.prototype._manageFocus=function(){if(this._blockNextFocusCheck)return this._blockNextFocusCheck=!1,void(this._lastPickedControl=this._focusedControl);if(this._focusedControl&&this._focusedControl!==this._lastPickedControl){if(this._lastPickedControl.isFocusInvisible)return;this.focusedControl=null}},t.prototype._attachPickingToSceneRender=function(e,t,i){var r=this;this._sceneRenderObserver=e.onBeforeRenderObservable.add((function(){r.checkPointerEveryFrame&&(r._linkedControls.length>0||i)&&t()}))},t.prototype._attachToOnPointerOut=function(e){var t=this;this._canvasPointerOutObserver=e.getEngine().onCanvasPointerOutObservable.add((function(e){t._lastControlOver[e.pointerId]&&t._lastControlOver[e.pointerId]._onPointerOut(t._lastControlOver[e.pointerId],null),delete t._lastControlOver[e.pointerId],t._lastControlDown[e.pointerId]&&t._lastControlDown[e.pointerId]!==t._capturingControl[e.pointerId]&&(t._lastControlDown[e.pointerId]._forcePointerUp(e.pointerId),delete t._lastControlDown[e.pointerId])}))},t.prototype._attachToOnBlur=function(e){var t=this;this._canvasBlurObserver=e.getEngine().onCanvasBlurObservable.add((function(){Object.entries(t._lastControlDown).forEach((function(e){e[1]._onCanvasBlur()})),t.focusedControl=null,t._lastControlDown={}}))},t.prototype.serializeContent=function(){var e=this.getSize(),t={root:{},width:e.width,height:e.height};return this._rootContainer.serialize(t.root),t},t.prototype.parseSerializedObject=function(e,t,i){if(this._rootContainer=a.Control.Parse(e.root,this,i),t){var r=e.width,n=e.height;"number"==typeof r&&"number"==typeof n&&r>=0&&n>=0?this.scaleTo(r,n):this.scaleTo(1920,1080)}},t.prototype.clone=function(e,i){var r=this.getScene();if(!r)return this;var n,o=this.getSize(),a=this.serializeContent();return(n=this._isFullscreen?t.CreateFullscreenUI(null!=e?e:"Clone of "+this.name):i?t.CreateForMesh(i,o.width,o.height):new t(null!=e?e:"Clone of "+this.name,o.width,o.height,r,!this.noMipmap,this.samplingMode)).parseSerializedObject(a),n},t.ParseFromSnippetAsync=function(e,i,n,o){return(0,r.__awaiter)(this,void 0,void 0,(function(){var a,s;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:return a=null!=n?n:t.CreateFullscreenUI("ADT from snippet"),"_BLANK"===e?[2,a]:[4,t._LoadURLContentAsync(t.SnippetUrl+"/"+e.replace(/#/g,"/"),!0)];case 1:return s=r.sent(),a.parseSerializedObject(s,i,o),[2,a]}}))}))},t.prototype.parseFromSnippetAsync=function(e,i,r){return t.ParseFromSnippetAsync(e,i,this,r)},t.ParseFromFileAsync=function(e,i,n,o){return(0,r.__awaiter)(this,void 0,void 0,(function(){var a,s;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:return a=null!=n?n:t.CreateFullscreenUI("ADT from URL"),[4,t._LoadURLContentAsync(e)];case 1:return s=r.sent(),a.parseSerializedObject(s,i,o),[2,a]}}))}))},t.prototype.parseFromURLAsync=function(e,i,r){return t.ParseFromFileAsync(e,i,this,r)},t._LoadURLContentAsync=function(e,t){return void 0===t&&(t=!1),""===e?Promise.reject("No URL provided"):new Promise((function(i,r){var o=new n.WebRequest;o.addEventListener("readystatechange",(function(){if(4==o.readyState)if(200==o.status){var e=void 0;if(t){var a=JSON.parse(JSON.parse(o.responseText).jsonPayload);e=a.encodedGui?new TextDecoder("utf-8").decode((0,n.DecodeBase64ToBinary)(a.encodedGui)):a.gui}else e=o.responseText;var s=JSON.parse(e);i(s)}else r("Unable to load")})),o.open("GET",e),o.send()}))},t._Overlaps=function(e,t){return!(e.centerX>t.centerX+t.widthInPixels||e.centerX+e.widthInPixels<t.centerX||e.centerY+e.heightInPixels<t.centerY||e.centerY>t.centerY+t.heightInPixels)},t.CreateForMesh=function(e,i,r,o,a,s,l,c){void 0===i&&(i=1024),void 0===r&&(r=1024),void 0===o&&(o=!0),void 0===a&&(a=!1),void 0===l&&(l=this._CreateMaterial),void 0===c&&(c=n.Texture.TRILINEAR_SAMPLINGMODE);var u=(0,n.RandomGUID)(),h=new t("AdvancedDynamicTexture for ".concat(e.name," [").concat(u,"]"),i,r,e.getScene(),!0,c,s);return l(e,u,h,a),h.attachToMesh(e,o),h},t._CreateMaterial=function(e,t,i,r){var o=(0,n.GetClass)("BABYLON.StandardMaterial");if(!o)throw"StandardMaterial needs to be imported before as it contains a side-effect required by your code.";var a=new o("AdvancedDynamicTextureMaterial for ".concat(e.name," [").concat(t,"]"),e.getScene());a.backFaceCulling=!1,a.diffuseColor=n.Color3.Black(),a.specularColor=n.Color3.Black(),r?(a.diffuseTexture=i,a.emissiveTexture=i,i.hasAlpha=!0):(a.emissiveTexture=i,a.opacityTexture=i),e.material=a},t.CreateForMeshTexture=function(e,i,r,o,a,s){void 0===i&&(i=1024),void 0===r&&(r=1024),void 0===o&&(o=!0),void 0===s&&(s=n.Texture.TRILINEAR_SAMPLINGMODE);var l=new t(e.name+" AdvancedDynamicTexture",i,r,e.getScene(),!0,s,a);return l.attachToMesh(e,o),l},t.CreateFullscreenUI=function(e,i,r,o,a){void 0===i&&(i=!0),void 0===r&&(r=null),void 0===o&&(o=n.Texture.BILINEAR_SAMPLINGMODE),void 0===a&&(a=!1);var s=new t(e,0,0,r,!1,o),l=s.getScene(),c=new n.Layer(e+"_layer",null,l,!i);if(c.texture=s,s._layerToDispose=c,s._isFullscreen=!0,a&&l){var u=1/l.getEngine().getHardwareScalingLevel();s._rootContainer.scaleX=u,s._rootContainer.scaleY=u}return s.attach(),s},t.prototype.scale=function(t){e.prototype.scale.call(this,t),this.markAsDirty()},t.prototype.scaleTo=function(t,i){e.prototype.scaleTo.call(this,t,i),this.markAsDirty()},t.prototype._checkGuiIsReady=function(){this.guiIsReady()&&(this.onGuiReadyObservable.notifyObservers(this),this.onGuiReadyObservable.clear())},t.prototype.guiIsReady=function(){return this._rootContainer.isReady()},t.SnippetUrl=n.Constants.SnippetUrl,t.AllowGPUOptimizations=!0,t}(n.DynamicTexture)},"../../../dev/gui/src/2D/controls/button.ts":(e,t,i)=>{i.r(t),i.d(t,{Button:()=>c});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/rectangle.ts"),o=i("../../../dev/gui/src/2D/controls/control.ts"),a=i("../../../dev/gui/src/2D/controls/textBlock.ts"),s=i("../../../dev/gui/src/2D/controls/image.ts"),l=i("babylonjs/Misc/perfCounter"),c=function(e){function t(t){var i=e.call(this,t)||this;i.name=t,i.thickness=1,i.isPointerBlocker=!0;var r=null;return i.pointerEnterAnimation=function(){r=i.alpha,i.alpha-=.1},i.pointerOutAnimation=function(){null!==r&&(i.alpha=r)},i.pointerDownAnimation=function(){i.scaleX-=.05,i.scaleY-=.05},i.pointerUpAnimation=function(){i.scaleX+=.05,i.scaleY+=.05},i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"image",{get:function(){return this._image},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textBlock",{get:function(){return this._textBlock},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Button"},t.prototype._processPicking=function(t,i,r,n,o,a,s,l){if(!this._isEnabled||!this.isHitTestVisible||!this.isVisible||this.notRenderable)return!1;if(!e.prototype.contains.call(this,t,i))return!1;if(this.delegatePickingToChildren){for(var c=!1,u=this._children.length-1;u>=0;u--){var h=this._children[u];if(h.isEnabled&&h.isHitTestVisible&&h.isVisible&&!h.notRenderable&&h.contains(t,i)){c=!0;break}}if(!c)return!1}return this._processObservables(n,t,i,r,o,a,s,l),!0},t.prototype._onPointerEnter=function(t,i){return!!e.prototype._onPointerEnter.call(this,t,i)&&(!this.isReadOnly&&this.pointerEnterAnimation&&this.pointerEnterAnimation(),!0)},t.prototype._onPointerOut=function(t,i,r){void 0===r&&(r=!1),!this.isReadOnly&&this.pointerOutAnimation&&this.pointerOutAnimation(),e.prototype._onPointerOut.call(this,t,i,r)},t.prototype._onPointerDown=function(t,i,r,n,o){return!!e.prototype._onPointerDown.call(this,t,i,r,n,o)&&(!this.isReadOnly&&this.pointerDownAnimation&&this.pointerDownAnimation(),!0)},t.prototype._getRectangleFill=function(e){return this.isEnabled?this._getBackgroundColor(e):this._disabledColor},t.prototype._onPointerUp=function(t,i,r,n,o,a){!this.isReadOnly&&this.pointerUpAnimation&&this.pointerUpAnimation(),e.prototype._onPointerUp.call(this,t,i,r,n,o,a)},t.prototype.serialize=function(t,i){e.prototype.serialize.call(this,t,i),(this.isSerializable||i)&&(this._textBlock&&(t.textBlockName=this._textBlock.name),this._image&&(t.imageName=this._image.name))},t.prototype._parseFromContent=function(t,i){e.prototype._parseFromContent.call(this,t,i),t.textBlockName&&(this._textBlock=this.getChildByName(t.textBlockName)),t.imageName&&(this._image=this.getChildByName(t.imageName))},t.CreateImageButton=function(e,t,i){var r=new this(e),n=new a.TextBlock(e+"_button",t);n.textWrapping=!0,n.textHorizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_CENTER,n.paddingLeft="20%",r.addControl(n);var l=new s.Image(e+"_icon",i);return l.width="20%",l.stretch=s.Image.STRETCH_UNIFORM,l.horizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_LEFT,r.addControl(l),r._image=l,r._textBlock=n,r},t.CreateImageOnlyButton=function(e,t){var i=new this(e),r=new s.Image(e+"_icon",t);return r.stretch=s.Image.STRETCH_FILL,r.horizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_LEFT,i.addControl(r),i._image=r,i},t.CreateSimpleButton=function(e,t){var i=new this(e),r=new a.TextBlock(e+"_button",t);return r.textWrapping=!0,r.textHorizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_CENTER,i.addControl(r),i._textBlock=r,i},t.CreateImageWithCenterTextButton=function(e,t,i){var r=new this(e),n=new s.Image(e+"_icon",i);n.stretch=s.Image.STRETCH_FILL,r.addControl(n);var l=new a.TextBlock(e+"_button",t);return l.textWrapping=!0,l.textHorizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_CENTER,r.addControl(l),r._image=n,r._textBlock=l,r},t}(n.Rectangle);(0,l.RegisterClass)("BABYLON.GUI.Button",c)},"../../../dev/gui/src/2D/controls/checkbox.ts":(e,t,i)=>{i.r(t),i.d(t,{Checkbox:()=>l});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/2D/controls/control.ts"),a=i("../../../dev/gui/src/2D/controls/stackPanel.ts"),s=i("../../../dev/gui/src/2D/controls/textBlock.ts"),l=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._isChecked=!1,i._background="black",i._checkSizeRatio=.8,i._thickness=1,i.onIsCheckedChangedObservable=new n.Observable,i.isPointerBlocker=!0,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness!==e&&(this._thickness=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checkSizeRatio",{get:function(){return this._checkSizeRatio},set:function(e){e=Math.max(Math.min(1,e),0),this._checkSizeRatio!==e&&(this._checkSizeRatio=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChecked",{get:function(){return this._isChecked},set:function(e){this._isChecked!==e&&(this._isChecked=e,this._markAsDirty(),this.onIsCheckedChangedObservable.notifyObservers(e))},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Checkbox"},t.prototype._draw=function(e){e.save(),this._applyStates(e);var t=this._currentMeasure.width-this._thickness,i=this._currentMeasure.height-this._thickness;if((this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),e.fillStyle=this._isEnabled?this._background:this._disabledColor,e.fillRect(this._currentMeasure.left+this._thickness/2,this._currentMeasure.top+this._thickness/2,t,i),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),this._isChecked){e.fillStyle=this._isEnabled?this.color?this.color:"#ffffff":this._disabledColorItem;var r=t*this._checkSizeRatio,n=i*this._checkSizeRatio;e.fillRect(this._currentMeasure.left+this._thickness/2+(t-r)/2,this._currentMeasure.top+this._thickness/2+(i-n)/2,r,n)}e.strokeStyle=this.color,e.lineWidth=this._thickness,e.strokeRect(this._currentMeasure.left+this._thickness/2,this._currentMeasure.top+this._thickness/2,t,i),e.restore()},t.prototype._onPointerDown=function(t,i,r,n,o){return!!e.prototype._onPointerDown.call(this,t,i,r,n,o)&&(this.isReadOnly||(this.isChecked=!this.isChecked),!0)},t.AddCheckBoxWithHeader=function(e,i){var r=new a.StackPanel;r.isVertical=!1,r.height="30px";var n=new t;n.width="20px",n.height="20px",n.isChecked=!0,n.color="green",n.onIsCheckedChangedObservable.add(i),r.addControl(n);var l=new s.TextBlock;return l.text=e,l.width="180px",l.paddingLeft="5px",l.textHorizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_LEFT,l.color="white",r.addControl(l),r},(0,r.__decorate)([(0,n.serialize)()],t.prototype,"thickness",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"checkSizeRatio",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"background",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"isChecked",null),t}(o.Control);(0,n.RegisterClass)("BABYLON.GUI.Checkbox",l)},"../../../dev/gui/src/2D/controls/colorpicker.ts":(e,t,i)=>{i.r(t),i.d(t,{ColorPicker:()=>h});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/2D/controls/control.ts"),a=i("../../../dev/gui/src/2D/controls/inputText.ts"),s=i("../../../dev/gui/src/2D/controls/rectangle.ts"),l=i("../../../dev/gui/src/2D/controls/button.ts"),c=i("../../../dev/gui/src/2D/controls/grid.ts"),u=i("../../../dev/gui/src/2D/controls/textBlock.ts"),h=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._value=n.Color3.Red(),i._tmpColor=new n.Color3,i._pointerStartedOnSquare=!1,i._pointerStartedOnWheel=!1,i._squareLeft=0,i._squareTop=0,i._squareSize=0,i._h=360,i._s=1,i._v=1,i._lastPointerDownId=-1,i.onValueChangedObservable=new n.Observable,i._pointerIsDown=!1,i.value=new n.Color3(.88,.1,.1),i.size="200px",i.isPointerBlocker=!0,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(e){this._value.equals(e)||(this._value.copyFrom(e),this._value.toHSVToRef(this._tmpColor),this._h=this._tmpColor.r,this._s=Math.max(this._tmpColor.g,1e-5),this._v=Math.max(this._tmpColor.b,1e-5),this._markAsDirty(),this._value.r<=t._Epsilon&&(this._value.r=0),this._value.g<=t._Epsilon&&(this._value.g=0),this._value.b<=t._Epsilon&&(this._value.b=0),this._value.r>=1-t._Epsilon&&(this._value.r=1),this._value.g>=1-t._Epsilon&&(this._value.g=1),this._value.b>=1-t._Epsilon&&(this._value.b=1),this.onValueChangedObservable.notifyObservers(this._value))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width.toString(this._host)},set:function(e){this._width.toString(this._host)!==e&&this._width.fromString(e)&&(0===this._width.getValue(this._host)&&(e="1px",this._width.fromString(e)),this._height.fromString(e),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height.toString(this._host)},set:function(e){this._height.toString(this._host)!==e&&this._height.fromString(e)&&(0===this._height.getValue(this._host)&&(e="1px",this._height.fromString(e)),this._width.fromString(e),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.width},set:function(e){this.width=e},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"ColorPicker"},t.prototype._preMeasure=function(e){e.width<e.height?this._currentMeasure.height=e.width:this._currentMeasure.width=e.height},t.prototype._updateSquareProps=function(){var e=.5*Math.min(this._currentMeasure.width,this._currentMeasure.height),t=2*(e-.2*e)/Math.sqrt(2),i=e-.5*t;this._squareLeft=this._currentMeasure.left+i,this._squareTop=this._currentMeasure.top+i,this._squareSize=t},t.prototype._drawGradientSquare=function(e,t,i,r,n,o){var a=o.createLinearGradient(t,i,r+t,i);a.addColorStop(0,"#fff"),a.addColorStop(1,"hsl("+e+", 100%, 50%)"),o.fillStyle=a,o.fillRect(t,i,r,n);var s=o.createLinearGradient(t,i,t,n+i);s.addColorStop(0,"rgba(0,0,0,0)"),s.addColorStop(1,"#000"),o.fillStyle=s,o.fillRect(t,i,r,n)},t.prototype._drawCircle=function(e,t,i,r){r.beginPath(),r.arc(e,t,i+1,0,2*Math.PI,!1),r.lineWidth=3,r.strokeStyle="#333333",r.stroke(),r.beginPath(),r.arc(e,t,i,0,2*Math.PI,!1),r.lineWidth=3,r.strokeStyle="#ffffff",r.stroke()},t.prototype._createColorWheelCanvas=function(e,t){var i=n.EngineStore.LastCreatedEngine;if(!i)throw new Error("Invalid engine. Unable to create a canvas.");for(var r=i.createCanvas(2*e,2*e),o=r.getContext("2d"),a=o.getImageData(0,0,2*e,2*e),s=a.data,l=this._tmpColor,c=e*e,u=e-t,h=u*u,d=-e;d<e;d++)for(var _=-e;_<e;_++){var f=d*d+_*_;if(!(f>c||f<h)){var p=Math.sqrt(f),m=Math.atan2(_,d);n.Color3.HSVtoRGBToRef(180*m/Math.PI+180,p/e,1,l);var g=4*(d+e+2*(_+e)*e);s[g]=255*l.r,s[g+1]=255*l.g,s[g+2]=255*l.b;var v,b;b=e<50?.2:e>150?.04:-.16*(e-50)/100+.2,v=(p-u)/(e-u),s[g+3]=v<b?v/b*255:v>1-b?255*(1-(v-(1-b))/b):255}}return o.putImageData(a,0,0),r},t.prototype._draw=function(e){e.save(),this._applyStates(e);var t=.5*Math.min(this._currentMeasure.width,this._currentMeasure.height),i=.2*t,r=this._currentMeasure.left,n=this._currentMeasure.top;this._colorWheelCanvas&&this._colorWheelCanvas.width==2*t||(this._colorWheelCanvas=this._createColorWheelCanvas(t,i)),this._updateSquareProps(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY,e.fillRect(this._squareLeft,this._squareTop,this._squareSize,this._squareSize)),e.drawImage(this._colorWheelCanvas,r,n),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),this._drawGradientSquare(this._h,this._squareLeft,this._squareTop,this._squareSize,this._squareSize,e);var o=this._squareLeft+this._squareSize*this._s,a=this._squareTop+this._squareSize*(1-this._v);this._drawCircle(o,a,.04*t,e);var s=t-.5*i;o=r+t+Math.cos((this._h-180)*Math.PI/180)*s,a=n+t+Math.sin((this._h-180)*Math.PI/180)*s,this._drawCircle(o,a,.35*i,e),e.restore()},t.prototype._updateValueFromPointer=function(e,i){if(this._pointerStartedOnWheel){var r=.5*Math.min(this._currentMeasure.width,this._currentMeasure.height),o=r+this._currentMeasure.left,a=r+this._currentMeasure.top;this._h=180*Math.atan2(i-a,e-o)/Math.PI+180}else this._pointerStartedOnSquare&&(this._updateSquareProps(),this._s=(e-this._squareLeft)/this._squareSize,this._v=1-(i-this._squareTop)/this._squareSize,this._s=Math.min(this._s,1),this._s=Math.max(this._s,t._Epsilon),this._v=Math.min(this._v,1),this._v=Math.max(this._v,t._Epsilon));n.Color3.HSVtoRGBToRef(this._h,this._s,this._v,this._tmpColor),this.value=this._tmpColor},t.prototype._isPointOnSquare=function(e,t){this._updateSquareProps();var i=this._squareLeft,r=this._squareTop,n=this._squareSize;return e>=i&&e<=i+n&&t>=r&&t<=r+n},t.prototype._isPointOnWheel=function(e,t){var i=.5*Math.min(this._currentMeasure.width,this._currentMeasure.height),r=i-.2*i,n=e-(i+this._currentMeasure.left),o=t-(i+this._currentMeasure.top),a=n*n+o*o;return a<=i*i&&a>=r*r},t.prototype._onPointerDown=function(t,i,r,n,o){if(!e.prototype._onPointerDown.call(this,t,i,r,n,o))return!1;if(this.isReadOnly)return!0;this._pointerIsDown=!0,this._pointerStartedOnSquare=!1,this._pointerStartedOnWheel=!1,this._invertTransformMatrix.transformCoordinates(i.x,i.y,this._transformedPosition);var a=this._transformedPosition.x,s=this._transformedPosition.y;return this._isPointOnSquare(a,s)?this._pointerStartedOnSquare=!0:this._isPointOnWheel(a,s)&&(this._pointerStartedOnWheel=!0),this._updateValueFromPointer(a,s),this._host._capturingControl[r]=this,this._lastPointerDownId=r,!0},t.prototype._onPointerMove=function(t,i,r,n){if(r==this._lastPointerDownId){if(!this.isReadOnly){this._invertTransformMatrix.transformCoordinates(i.x,i.y,this._transformedPosition);var o=this._transformedPosition.x,a=this._transformedPosition.y;this._pointerIsDown&&this._updateValueFromPointer(o,a)}e.prototype._onPointerMove.call(this,t,i,r,n)}},t.prototype._onPointerUp=function(t,i,r,n,o,a){this._pointerIsDown=!1,delete this._host._capturingControl[r],e.prototype._onPointerUp.call(this,t,i,r,n,o,a)},t.prototype._onCanvasBlur=function(){this._forcePointerUp(),e.prototype._onCanvasBlur.call(this)},t.ShowPickerDialogAsync=function(e,i){return new Promise((function(r){i.pickerWidth=i.pickerWidth||"640px",i.pickerHeight=i.pickerHeight||"400px",i.headerHeight=i.headerHeight||"35px",i.lastColor=i.lastColor||"#000000",i.swatchLimit=i.swatchLimit||20,i.numSwatchesPerLine=i.numSwatchesPerLine||10;var h,d,_,f,p,m,g,v=i.swatchLimit/i.numSwatchesPerLine,b=parseFloat(i.pickerWidth)/i.numSwatchesPerLine,y=Math.floor(.25*b),x=y*(i.numSwatchesPerLine+1),T=Math.floor((parseFloat(i.pickerWidth)-x)/i.numSwatchesPerLine),C=T*v+y*(v+1),S=(parseInt(i.pickerHeight)+C+Math.floor(.25*T)).toString()+"px",P="#c0c0c0",E="#535353",w="#414141",I="515151",M=n.Color3.FromHexString("#dddddd"),O=M.r+M.g+M.b,A=["R","G","B"],R="#454545",L="#f0f0f0",B=!1,F=new c.Grid;if(F.name="Dialog Container",F.width=i.pickerWidth,i.savedColors){F.height=S;var D=parseInt(i.pickerHeight)/parseInt(S);F.addRowDefinition(D,!1),F.addRowDefinition(1-D,!1)}else F.height=i.pickerHeight,F.addRowDefinition(1,!1);if(e.addControl(F),i.savedColors){(f=new c.Grid).name="Swatch Drawer",f.verticalAlignment=o.Control.VERTICAL_ALIGNMENT_TOP,f.background=E,f.width=i.pickerWidth;var N,k=i.savedColors.length/i.numSwatchesPerLine;N=0==k?0:k+1,f.height=(T*k+N*y).toString()+"px",f.top=Math.floor(.25*T).toString()+"px";for(var V=0;V<2*Math.ceil(i.savedColors.length/i.numSwatchesPerLine)+1;V++)V%2!=0?f.addRowDefinition(T,!0):f.addRowDefinition(y,!0);for(V=0;V<2*i.numSwatchesPerLine+1;V++)V%2!=0?f.addColumnDefinition(T,!0):f.addColumnDefinition(y,!0);F.addControl(f,1,0)}var z=new c.Grid;z.name="Picker Panel",z.height=i.pickerHeight;var G=parseInt(i.headerHeight)/parseInt(i.pickerHeight),U=[G,1-G];z.addRowDefinition(U[0],!1),z.addRowDefinition(U[1],!1),F.addControl(z,0,0);var H=new s.Rectangle;H.name="Dialogue Header Bar",H.background="#cccccc",H.thickness=0,z.addControl(H,0,0);var W=l.Button.CreateSimpleButton("closeButton","a");W.fontFamily="coreglyphs";var Q=n.Color3.FromHexString(H.background),j=new n.Color3(1-Q.r,1-Q.g,1-Q.b);W.color=j.toHexString(),W.fontSize=Math.floor(.6*parseInt(i.headerHeight)),W.textBlock.textVerticalAlignment=o.Control.VERTICAL_ALIGNMENT_CENTER,W.horizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_RIGHT,W.height=W.width=i.headerHeight,W.background=H.background,W.thickness=0,W.pointerDownAnimation=function(){},W.pointerUpAnimation=function(){W.background=H.background},W.pointerEnterAnimation=function(){W.color=H.background,W.background="red"},W.pointerOutAnimation=function(){W.color=j.toHexString(),W.background=H.background},W.onPointerClickObservable.add((function(){ze(ce.background)})),z.addControl(W,0,0);var X=new c.Grid;X.name="Dialogue Body",X.background=E;var Y=[.4375,.5625];X.addRowDefinition(1,!1),X.addColumnDefinition(Y[0],!1),X.addColumnDefinition(Y[1],!1),z.addControl(X,1,0);var K=new c.Grid;K.name="Picker Grid",K.addRowDefinition(.85,!1),K.addRowDefinition(.15,!1),X.addControl(K,0,0);var q=new t;q.name="GUI Color Picker",i.pickerHeight<i.pickerWidth?q.width=.89:q.height=.89,q.value=n.Color3.FromHexString(i.lastColor),q.horizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_CENTER,q.verticalAlignment=o.Control.VERTICAL_ALIGNMENT_CENTER,q.onPointerDownObservable.add((function(){g=q.name,m="",De(!1)})),q.onValueChangedObservable.add((function(e){g==q.name&&Re(e,q.name)})),K.addControl(q,0,0);var Z=new c.Grid;Z.name="Dialogue Right Half",Z.horizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_LEFT;var J=[.514,.486];Z.addRowDefinition(J[0],!1),Z.addRowDefinition(J[1],!1),X.addControl(Z,1,1);var $=new c.Grid;$.name="Swatches and Buttons";var ee=[.417,.583];$.addRowDefinition(1,!1),$.addColumnDefinition(ee[0],!1),$.addColumnDefinition(ee[1],!1),Z.addControl($,0,0);var te=new c.Grid;te.name="New and Current Swatches";var ie=[.04,.16,.64,.16];te.addRowDefinition(ie[0],!1),te.addRowDefinition(ie[1],!1),te.addRowDefinition(ie[2],!1),te.addRowDefinition(ie[3],!1),$.addControl(te,0,0);var re=new c.Grid;re.name="Active Swatches",re.width=.67,re.addRowDefinition(.5,!1),re.addRowDefinition(.5,!1),te.addControl(re,2,0);var ne,oe=Math.floor(parseInt(i.pickerWidth)*Y[1]*ee[0]*.11),ae=Math.floor(parseInt(i.pickerHeight)*U[1]*J[0]*ie[1]*.5);ne=i.pickerWidth>i.pickerHeight?ae:oe;var se=new u.TextBlock;se.text="new",se.name="New Color Label",se.color=P,se.fontSize=ne,te.addControl(se,1,0);var le=new s.Rectangle;le.name="New Color Swatch",le.background=i.lastColor,le.thickness=0,re.addControl(le,0,0);var ce=l.Button.CreateSimpleButton("currentSwatch","");ce.background=i.lastColor,ce.thickness=0,ce.onPointerClickObservable.add((function(){Re(n.Color3.FromHexString(ce.background),ce.name),De(!1)})),ce.pointerDownAnimation=function(){},ce.pointerUpAnimation=function(){},ce.pointerEnterAnimation=function(){},ce.pointerOutAnimation=function(){},re.addControl(ce,1,0);var ue=new s.Rectangle;ue.name="Swatch Outline",ue.width=.67,ue.thickness=2,ue.color="#404040",ue.isHitTestVisible=!1,te.addControl(ue,2,0);var he=new u.TextBlock;he.name="Current Color Label",he.text="current",he.color=P,he.fontSize=ne,te.addControl(he,3,0);var de=new c.Grid;de.name="Button Grid",de.height=.8;var _e=1/3;de.addRowDefinition(_e,!1),de.addRowDefinition(_e,!1),de.addRowDefinition(_e,!1),$.addControl(de,0,1);var fe=Math.floor(parseInt(i.pickerWidth)*Y[1]*ee[1]*.67).toString()+"px",pe=Math.floor(parseInt(i.pickerHeight)*U[1]*J[0]*(parseFloat(de.height.toString())/100)*_e*.7).toString()+"px";h=parseFloat(fe)>parseFloat(pe)?Math.floor(.45*parseFloat(pe)):Math.floor(.11*parseFloat(fe));var me=l.Button.CreateSimpleButton("butOK","OK");me.width=fe,me.height=pe,me.verticalAlignment=o.Control.VERTICAL_ALIGNMENT_CENTER,me.thickness=2,me.color=P,me.fontSize=h,me.background=E,me.onPointerEnterObservable.add((function(){me.background=w})),me.onPointerOutObservable.add((function(){me.background=E})),me.pointerDownAnimation=function(){me.background=I},me.pointerUpAnimation=function(){me.background=w},me.onPointerClickObservable.add((function(){De(!1),ze(le.background)})),de.addControl(me,0,0);var ge=l.Button.CreateSimpleButton("butCancel","Cancel");ge.width=fe,ge.height=pe,ge.verticalAlignment=o.Control.VERTICAL_ALIGNMENT_CENTER,ge.thickness=2,ge.color=P,ge.fontSize=h,ge.background=E,ge.onPointerEnterObservable.add((function(){ge.background=w})),ge.onPointerOutObservable.add((function(){ge.background=E})),ge.pointerDownAnimation=function(){ge.background=I},ge.pointerUpAnimation=function(){ge.background=w},ge.onPointerClickObservable.add((function(){De(!1),ze(ce.background)})),de.addControl(ge,1,0),i.savedColors&&((p=l.Button.CreateSimpleButton("butSave","Save")).width=fe,p.height=pe,p.verticalAlignment=o.Control.VERTICAL_ALIGNMENT_CENTER,p.thickness=2,p.fontSize=h,i.savedColors.length<i.swatchLimit?(p.color=P,p.background=E):Ve(p,!0),p.onPointerEnterObservable.add((function(){i.savedColors&&i.savedColors.length<i.swatchLimit&&(p.background=w)})),p.onPointerOutObservable.add((function(){i.savedColors&&i.savedColors.length<i.swatchLimit&&(p.background=E)})),p.pointerDownAnimation=function(){i.savedColors&&i.savedColors.length<i.swatchLimit&&(p.background=I)},p.pointerUpAnimation=function(){i.savedColors&&i.savedColors.length<i.swatchLimit&&(p.background=w)},p.onPointerClickObservable.add((function(){i.savedColors&&(0==i.savedColors.length&&ke(!0),i.savedColors.length<i.swatchLimit&&Ne(le.background,p),De(!1))})),i.savedColors.length>0&&ke(!0),de.addControl(p,2,0));var ve=new c.Grid;ve.name="Dialog Lower Right",ve.addRowDefinition(.02,!1),ve.addRowDefinition(.63,!1),ve.addRowDefinition(.21,!1),ve.addRowDefinition(.14,!1),Z.addControl(ve,1,0);var be=n.Color3.FromHexString(i.lastColor),ye=new c.Grid;for(ye.name="RGB Values",ye.width=.82,ye.verticalAlignment=o.Control.VERTICAL_ALIGNMENT_CENTER,ye.addRowDefinition(1/3,!1),ye.addRowDefinition(1/3,!1),ye.addRowDefinition(1/3,!1),ye.addColumnDefinition(.1,!1),ye.addColumnDefinition(.2,!1),ye.addColumnDefinition(.7,!1),ve.addControl(ye,1,0),V=0;V<A.length;V++){var xe=new u.TextBlock;xe.text=A[V],xe.color=P,xe.fontSize=h,ye.addControl(xe,V,0)}var Te=new a.InputText;Te.width=.83,Te.height=.72,Te.name="rIntField",Te.fontSize=h,Te.text=(255*be.r).toString(),Te.color=L,Te.background=R,Te.onFocusObservable.add((function(){g=Te.name,m=Te.text,De(!1)})),Te.onBlurObservable.add((function(){""==Te.text&&(Te.text="0"),Le(Te,"r"),g==Te.name&&(g="")})),Te.onTextChangedObservable.add((function(){g==Te.name&&Le(Te,"r")})),ye.addControl(Te,0,1);var Ce=new a.InputText;Ce.width=.83,Ce.height=.72,Ce.name="gIntField",Ce.fontSize=h,Ce.text=(255*be.g).toString(),Ce.color=L,Ce.background=R,Ce.onFocusObservable.add((function(){g=Ce.name,m=Ce.text,De(!1)})),Ce.onBlurObservable.add((function(){""==Ce.text&&(Ce.text="0"),Le(Ce,"g"),g==Ce.name&&(g="")})),Ce.onTextChangedObservable.add((function(){g==Ce.name&&Le(Ce,"g")})),ye.addControl(Ce,1,1);var Se=new a.InputText;Se.width=.83,Se.height=.72,Se.name="bIntField",Se.fontSize=h,Se.text=(255*be.b).toString(),Se.color=L,Se.background=R,Se.onFocusObservable.add((function(){g=Se.name,m=Se.text,De(!1)})),Se.onBlurObservable.add((function(){""==Se.text&&(Se.text="0"),Le(Se,"b"),g==Se.name&&(g="")})),Se.onTextChangedObservable.add((function(){g==Se.name&&Le(Se,"b")})),ye.addControl(Se,2,1);var Pe=new a.InputText;Pe.width=.95,Pe.height=.72,Pe.name="rDecField",Pe.fontSize=h,Pe.text=be.r.toString(),Pe.color=L,Pe.background=R,Pe.onFocusObservable.add((function(){g=Pe.name,m=Pe.text,De(!1)})),Pe.onBlurObservable.add((function(){0!=parseFloat(Pe.text)&&""!=Pe.text||(Pe.text="0",Be(Pe,"r")),g==Pe.name&&(g="")})),Pe.onTextChangedObservable.add((function(){g==Pe.name&&Be(Pe,"r")})),ye.addControl(Pe,0,2);var Ee=new a.InputText;Ee.width=.95,Ee.height=.72,Ee.name="gDecField",Ee.fontSize=h,Ee.text=be.g.toString(),Ee.color=L,Ee.background=R,Ee.onFocusObservable.add((function(){g=Ee.name,m=Ee.text,De(!1)})),Ee.onBlurObservable.add((function(){0!=parseFloat(Ee.text)&&""!=Ee.text||(Ee.text="0",Be(Ee,"g")),g==Ee.name&&(g="")})),Ee.onTextChangedObservable.add((function(){g==Ee.name&&Be(Ee,"g")})),ye.addControl(Ee,1,2);var we=new a.InputText;we.width=.95,we.height=.72,we.name="bDecField",we.fontSize=h,we.text=be.b.toString(),we.color=L,we.background=R,we.onFocusObservable.add((function(){g=we.name,m=we.text,De(!1)})),we.onBlurObservable.add((function(){0!=parseFloat(we.text)&&""!=we.text||(we.text="0",Be(we,"b")),g==we.name&&(g="")})),we.onTextChangedObservable.add((function(){g==we.name&&Be(we,"b")})),ye.addControl(we,2,2);var Ie=new c.Grid;Ie.name="Hex Value",Ie.width=.82,Ie.addRowDefinition(1,!1),Ie.addColumnDefinition(.1,!1),Ie.addColumnDefinition(.9,!1),ve.addControl(Ie,2,0);var Me=new u.TextBlock;Me.text="#",Me.color=P,Me.fontSize=h,Ie.addControl(Me,0,0);var Oe=new a.InputText;Oe.width=.96,Oe.height=.72,Oe.name="hexField",Oe.horizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_CENTER,Oe.fontSize=h;var Ae=i.lastColor.split("#");function Re(e,t){g=t;var i=e.toHexString();if(le.background=i,Te.name!=g&&(Te.text=Math.floor(255*e.r).toString()),Ce.name!=g&&(Ce.text=Math.floor(255*e.g).toString()),Se.name!=g&&(Se.text=Math.floor(255*e.b).toString()),Pe.name!=g&&(Pe.text=e.r.toString()),Ee.name!=g&&(Ee.text=e.g.toString()),we.name!=g&&(we.text=e.b.toString()),Oe.name!=g){var r=i.split("#");Oe.text=r[1]}q.name!=g&&(q.value=e)}function Le(e,t){var i=e.text;if(/[^0-9]/g.test(i))e.text=m;else if(""!=i&&(Math.floor(parseInt(i))<0?i="0":Math.floor(parseInt(i))>255?i="255":isNaN(parseInt(i))&&(i="0")),g==e.name&&(m=i),""!=i){i=parseInt(i).toString(),e.text=i;var r=n.Color3.FromHexString(le.background);g==e.name&&Re("r"==t?new n.Color3(parseInt(i)/255,r.g,r.b):"g"==t?new n.Color3(r.r,parseInt(i)/255,r.b):new n.Color3(r.r,r.g,parseInt(i)/255),e.name)}}function Be(e,t){var i=e.text;if(/[^0-9.]/g.test(i))e.text=m;else{""!=i&&"."!=i&&0!=parseFloat(i)&&(parseFloat(i)<0?i="0.0":parseFloat(i)>1?i="1.0":isNaN(parseFloat(i))&&(i="0.0")),g==e.name&&(m=i),""!=i&&"."!=i&&0!=parseFloat(i)?(i=parseFloat(i).toString(),e.text=i):i="0.0";var r=n.Color3.FromHexString(le.background);g==e.name&&Re("r"==t?new n.Color3(parseFloat(i),r.g,r.b):"g"==t?new n.Color3(r.r,parseFloat(i),r.b):new n.Color3(r.r,r.g,parseFloat(i)),e.name)}}function Fe(){if(i.savedColors&&i.savedColors[_]){var e;e=B?"b":"";var t=l.Button.CreateSimpleButton("Swatch_"+_,e);t.fontFamily="coreglyphs";var r=n.Color3.FromHexString(i.savedColors[_]),a=r.r+r.g+r.b;t.color=a>O?"#aaaaaa":"#ffffff",t.fontSize=Math.floor(.7*T),t.textBlock.verticalAlignment=o.Control.VERTICAL_ALIGNMENT_CENTER,t.height=t.width=T.toString()+"px",t.background=i.savedColors[_],t.thickness=2;var s=_;return t.pointerDownAnimation=function(){t.thickness=4},t.pointerUpAnimation=function(){t.thickness=3},t.pointerEnterAnimation=function(){t.thickness=3},t.pointerOutAnimation=function(){t.thickness=2},t.onPointerClickObservable.add((function(){var e;B?(e=s,i.savedColors&&i.savedColors.splice(e,1),i.savedColors&&0==i.savedColors.length&&(ke(!1),B=!1),Ne("",p)):i.savedColors&&Re(n.Color3.FromHexString(i.savedColors[s]),t.name)})),t}return null}function De(e){if(void 0!==e&&(B=e),B){for(var t=0;t<f.children.length;t++)f.children[t].textBlock.text="b";void 0!==d&&(d.textBlock.text="Done")}else{for(t=0;t<f.children.length;t++)f.children[t].textBlock.text="";void 0!==d&&(d.textBlock.text="Edit")}}function Ne(e,t){if(i.savedColors){""!=e&&i.savedColors.push(e),_=0,f.clearControls();var r,n=Math.ceil(i.savedColors.length/i.numSwatchesPerLine);if(r=0==n?0:n+1,f.rowCount!=n+r){for(var o=f.rowCount,a=0;a<o;a++)f.removeRowDefinition(0);for(a=0;a<n+r;a++)a%2?f.addRowDefinition(T,!0):f.addRowDefinition(y,!0)}f.height=(T*n+r*y).toString()+"px";for(var s=1,l=1;s<n+r;s+=2,l++){var c;c=i.savedColors.length>l*i.numSwatchesPerLine?i.numSwatchesPerLine:i.savedColors.length-(l-1)*i.numSwatchesPerLine;for(var u=Math.min(Math.max(c,0),i.numSwatchesPerLine),h=0,d=1;h<u;h++)if(!(h>i.numSwatchesPerLine)){var p=Fe();null!=p&&(f.addControl(p,s,d),d+=2,_++)}}i.savedColors.length>=i.swatchLimit?Ve(t,!0):Ve(t,!1)}}function ke(e){e?((d=l.Button.CreateSimpleButton("butEdit","Edit")).width=fe,d.height=pe,d.left=Math.floor(.1*parseInt(fe)).toString()+"px",d.top=(-1*parseFloat(d.left)).toString()+"px",d.verticalAlignment=o.Control.VERTICAL_ALIGNMENT_BOTTOM,d.horizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_LEFT,d.thickness=2,d.color=P,d.fontSize=h,d.background=E,d.onPointerEnterObservable.add((function(){d.background=w})),d.onPointerOutObservable.add((function(){d.background=E})),d.pointerDownAnimation=function(){d.background=I},d.pointerUpAnimation=function(){d.background=w},d.onPointerClickObservable.add((function(){B=!B,De()})),K.addControl(d,1,0)):K.removeControl(d)}function Ve(e,t){t?(e.color="#555555",e.background="#454545"):(e.color=P,e.background=E)}function ze(t){i.savedColors&&i.savedColors.length>0?r({savedColors:i.savedColors,pickedColor:t}):r({pickedColor:t}),e.removeControl(F)}Oe.text=Ae[1],Oe.color=L,Oe.background=R,Oe.onFocusObservable.add((function(){g=Oe.name,m=Oe.text,De(!1)})),Oe.onBlurObservable.add((function(){if(3==Oe.text.length){var e=Oe.text.split("");Oe.text=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]}""==Oe.text&&(Oe.text="000000",Re(n.Color3.FromHexString(Oe.text),"b")),g==Oe.name&&(g="")})),Oe.onTextChangedObservable.add((function(){var e=Oe.text,t=/[^0-9A-F]/i.test(e);if((Oe.text.length>6||t)&&g==Oe.name)Oe.text=m;else{if(Oe.text.length<6)for(var i=6-Oe.text.length,r=0;r<i;r++)e="0"+e;if(3==Oe.text.length){var o=Oe.text.split("");e=o[0]+o[0]+o[1]+o[1]+o[2]+o[2]}e="#"+e,g==Oe.name&&(m=Oe.text,Re(n.Color3.FromHexString(e),Oe.name))}})),Ie.addControl(Oe,0,1),i.savedColors&&i.savedColors.length>0&&Ne("",p)}))},t._Epsilon=1e-6,(0,r.__decorate)([(0,n.serialize)()],t.prototype,"value",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"width",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"height",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"size",null),t}(o.Control);(0,n.RegisterClass)("BABYLON.GUI.ColorPicker",h)},"../../../dev/gui/src/2D/controls/container.ts":(e,t,i)=>{i.r(t),i.d(t,{Container:()=>l});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/2D/controls/control.ts"),a=i("../../../dev/gui/src/2D/measure.ts"),s=i("../../../dev/gui/src/2D/math2D.ts"),l=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._children=new Array,i._measureForChildren=a.Measure.Empty(),i._background="",i._backgroundGradient=null,i._adaptWidthToChildren=!1,i._adaptHeightToChildren=!1,i._renderToIntermediateTexture=!1,i._intermediateTexture=null,i.delegatePickingToChildren=!1,i.logLayoutCycleErrors=!1,i.maxLayoutCycle=3,i.onControlAddedObservable=new n.Observable,i.onControlRemovedObservable=new n.Observable,i._inverseTransformMatrix=s.Matrix2D.Identity(),i._inverseMeasure=new a.Measure(0,0,0,0),i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"renderToIntermediateTexture",{get:function(){return this._renderToIntermediateTexture},set:function(e){this._renderToIntermediateTexture!==e&&(this._renderToIntermediateTexture=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"adaptHeightToChildren",{get:function(){return this._adaptHeightToChildren},set:function(e){this._adaptHeightToChildren!==e&&(this._adaptHeightToChildren=e,e&&(this.height="100%"),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"adaptWidthToChildren",{get:function(){return this._adaptWidthToChildren},set:function(e){this._adaptWidthToChildren!==e&&(this._adaptWidthToChildren=e,e&&(this.width="100%"),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundGradient",{get:function(){return this._backgroundGradient},set:function(e){this._backgroundGradient!==e&&(this._backgroundGradient=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._children},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReadOnly",{get:function(){return this._isReadOnly},set:function(e){this._isReadOnly=e;for(var t=0,i=this._children;t<i.length;t++)i[t].isReadOnly=e},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Container"},t.prototype._flagDescendantsAsMatrixDirty=function(){for(var e=0,t=this.children;e<t.length;e++){var i=t[e];i._isClipped=!1,i._markMatrixAsDirty()}},t.prototype.getChildByName=function(e){for(var t=0,i=this.children;t<i.length;t++){var r=i[t];if(r.name===e)return r}return null},t.prototype.getChildByType=function(e,t){for(var i=0,r=this.children;i<r.length;i++){var n=r[i];if(n.typeName===t)return n}return null},t.prototype.containsControl=function(e){return-1!==this.children.indexOf(e)},t.prototype.addControl=function(e){return e?(-1!==this._children.indexOf(e)||(e._link(this._host),e._markAllAsDirty(),this._reOrderControl(e),this._markAsDirty(),this.onControlAddedObservable.notifyObservers(e)),this):this},t.prototype.clearControls=function(){for(var e=0,t=this.children.slice();e<t.length;e++){var i=t[e];this.removeControl(i)}return this},t.prototype.removeControl=function(e){var t=this._children.indexOf(e);return-1!==t&&(this._children.splice(t,1),e.parent=null),e.linkWithMesh(null),this._host&&this._host._cleanControlAfterRemoval(e),this._markAsDirty(),this.onControlRemovedObservable.notifyObservers(e),this},t.prototype._reOrderControl=function(e){var t=e.linkedMesh;this.removeControl(e);for(var i=!1,r=0;r<this._children.length;r++)if(this._children[r].zIndex>e.zIndex){this._children.splice(r,0,e),i=!0;break}i||this._children.push(e),e.parent=this,t&&e.linkWithMesh(t),this._markAsDirty()},t.prototype._offsetLeft=function(t){e.prototype._offsetLeft.call(this,t);for(var i=0,r=this._children;i<r.length;i++)r[i]._offsetLeft(t)},t.prototype._offsetTop=function(t){e.prototype._offsetTop.call(this,t);for(var i=0,r=this._children;i<r.length;i++)r[i]._offsetTop(t)},t.prototype._markAllAsDirty=function(){e.prototype._markAllAsDirty.call(this);for(var t=0;t<this._children.length;t++)this._children[t]._markAllAsDirty()},t.prototype._getBackgroundColor=function(e){return this._backgroundGradient?this._backgroundGradient.getCanvasGradient(e):this._background},t.prototype._localDraw=function(e){(this._background||this._backgroundGradient)&&(e.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),e.fillStyle=this._getBackgroundColor(e),e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height),e.restore())},t.prototype._link=function(t){e.prototype._link.call(this,t);for(var i=0,r=this._children;i<r.length;i++)r[i]._link(t)},t.prototype._beforeLayout=function(){},t.prototype._processMeasures=function(t,i){!this._isDirty&&this._cachedParentMeasure.isEqualsTo(t)||(e.prototype._processMeasures.call(this,t,i),this._evaluateClippingState(t),this._renderToIntermediateTexture&&(this._intermediateTexture&&this._host.getScene()!=this._intermediateTexture.getScene()&&(this._intermediateTexture.dispose(),this._intermediateTexture=null),this._intermediateTexture?this._intermediateTexture.scaleTo(this._currentMeasure.width,this._currentMeasure.height):(this._intermediateTexture=new n.DynamicTexture("",{width:this._currentMeasure.width,height:this._currentMeasure.height},this._host.getScene(),!1,n.Texture.NEAREST_SAMPLINGMODE,n.Constants.TEXTUREFORMAT_RGBA,!1),this._intermediateTexture.hasAlpha=!0)))},t.prototype._layout=function(e,t){var i,r;if(!this.isDirty&&(!this.isVisible||this.notRenderable))return!1;this.host._numLayoutCalls++,this._isDirty&&this._currentMeasure.transformToRef(this._transformMatrix,this._prevCurrentMeasureTransformedIntoGlobalSpace);var o=0;t.save(),this._applyStates(t),this._beforeLayout();do{var a=-1,s=-1;if(this._rebuildLayout=!1,this._processMeasures(e,t),!this._isClipped){for(var l=0,c=this._children;l<c.length;l++){var u=c[l];u._tempParentMeasure.copyFrom(this._measureForChildren),u._layout(this._measureForChildren,t)&&u.isVisible&&!u.notRenderable&&(this.adaptWidthToChildren&&u._width.isPixel&&(a=Math.max(a,u._currentMeasure.width+u._paddingLeftInPixels+u._paddingRightInPixels)),this.adaptHeightToChildren&&u._height.isPixel&&(s=Math.max(s,u._currentMeasure.height+u._paddingTopInPixels+u._paddingBottomInPixels)))}this.adaptWidthToChildren&&a>=0&&(a+=this.paddingLeftInPixels+this.paddingRightInPixels,this.width!==a+"px"&&(null===(i=this.parent)||void 0===i||i._markAsDirty(),this.width=a+"px",this._width.ignoreAdaptiveScaling=!0,this._rebuildLayout=!0)),this.adaptHeightToChildren&&s>=0&&(s+=this.paddingTopInPixels+this.paddingBottomInPixels,this.height!==s+"px"&&(null===(r=this.parent)||void 0===r||r._markAsDirty(),this.height=s+"px",this._height.ignoreAdaptiveScaling=!0,this._rebuildLayout=!0)),this._postMeasure()}o++}while(this._rebuildLayout&&o<this.maxLayoutCycle);return o>=3&&this.logLayoutCycleErrors&&n.Logger.Error("Layout cycle detected in GUI (Container name=".concat(this.name,", uniqueId=").concat(this.uniqueId,")")),t.restore(),this._isDirty&&(this.invalidateRect(),this._isDirty=!1),!0},t.prototype._postMeasure=function(){},t.prototype._draw=function(e,t){var i=this._renderToIntermediateTexture&&this._intermediateTexture,r=i?this._intermediateTexture.getContext():e;i&&(r.save(),r.translate(-this._currentMeasure.left,-this._currentMeasure.top),t?(this._transformMatrix.invertToRef(this._inverseTransformMatrix),t.transformToRef(this._inverseTransformMatrix,this._inverseMeasure),r.clearRect(this._inverseMeasure.left,this._inverseMeasure.top,this._inverseMeasure.width,this._inverseMeasure.height)):r.clearRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),this._localDraw(r),e.save(),this.clipChildren&&this._clipForChildren(r);for(var n=0,o=this._children;n<o.length;n++){var a=o[n];t&&!a._intersectsRect(t)||a._render(r,t)}i&&(r.restore(),e.save(),e.globalAlpha=this.alpha,e.drawImage(r.canvas,this._currentMeasure.left,this._currentMeasure.top),e.restore()),e.restore()},t.prototype.getDescendantsToRef=function(e,t,i){if(void 0===t&&(t=!1),this.children)for(var r=0;r<this.children.length;r++){var n=this.children[r];i&&!i(n)||e.push(n),t||n.getDescendantsToRef(e,!1,i)}},t.prototype._processPicking=function(t,i,r,n,o,a,s,l){if(!this._isEnabled||!this.isVisible||this.notRenderable)return!1;var c=e.prototype.contains.call(this,t,i);if(!c&&this.clipChildren)return!1;if(this.delegatePickingToChildren){for(var u=!1,h=this._children.length-1;h>=0;h--)if((d=this._children[h]).isEnabled&&d.isHitTestVisible&&d.isVisible&&!d.notRenderable&&d.contains(t,i)){u=!0;break}if(!u)return!1}for(h=this._children.length-1;h>=0;h--){var d;if((d=this._children[h])._processPicking(t,i,r,n,o,a,s,l))return d.hoverCursor&&this._host._changeCursor(d.hoverCursor),!0}return!!c&&!!this.isHitTestVisible&&this._processObservables(n,t,i,r,o,a,s,l)},t.prototype._additionalProcessing=function(t,i){e.prototype._additionalProcessing.call(this,t,i),this._measureForChildren.copyFrom(this._currentMeasure)},t.prototype._getAdaptDimTo=function(e){return"width"===e?this.adaptWidthToChildren:this.adaptHeightToChildren},t.prototype.isDimensionFullyDefined=function(t){if(this._getAdaptDimTo(t)){for(var i=0,r=this.children;i<r.length;i++)if(!r[i].isDimensionFullyDefined(t))return!1;return!0}return e.prototype.isDimensionFullyDefined.call(this,t)},t.prototype.serialize=function(t,i,r){if(void 0===i&&(i=!1),void 0===r&&(r=!0),e.prototype.serialize.call(this,t,i,r),(this.isSerializable||i)&&(this.backgroundGradient&&(t.backgroundGradient={},this.backgroundGradient.serialize(t.backgroundGradient)),this.children.length)){t.children=[];for(var n=0,o=this.children;n<o.length;n++){var a=o[n];if(a.isSerializable||i){var s={};a.serialize(s,i,r),t.children.push(s)}}}},t.prototype.dispose=function(){var t;e.prototype.dispose.call(this);for(var i=this.children.length-1;i>=0;i--)this.children[i].dispose();null===(t=this._intermediateTexture)||void 0===t||t.dispose()},t.prototype._parseFromContent=function(t,i,r){var a;if(e.prototype._parseFromContent.call(this,t,i,r),this._link(i),t.backgroundGradient){var s=n.Tools.Instantiate("BABYLON.GUI."+t.backgroundGradient.className);this._backgroundGradient=new s,null===(a=this._backgroundGradient)||void 0===a||a.parse(t.backgroundGradient)}if(t.children)for(var l=0,c=t.children;l<c.length;l++){var u=c[l];this.addControl(o.Control.Parse(u,i,r))}},t.prototype.isReady=function(){for(var e=0,t=this.children;e<t.length;e++)if(!t[e].isReady())return!1;return!0},(0,r.__decorate)([(0,n.serialize)()],t.prototype,"delegatePickingToChildren",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"renderToIntermediateTexture",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"maxLayoutCycle",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"adaptHeightToChildren",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"adaptWidthToChildren",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"background",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"backgroundGradient",null),t}(o.Control);(0,n.RegisterClass)("BABYLON.GUI.Container",l)},"../../../dev/gui/src/2D/controls/control.ts":(e,t,i)=>{i.r(t),i.d(t,{Control:()=>l});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/2D/valueAndUnit.ts"),a=i("../../../dev/gui/src/2D/measure.ts"),s=i("../../../dev/gui/src/2D/math2D.ts"),l=function(){function e(t){this.name=t,this._alpha=1,this._alphaSet=!1,this._zIndex=0,this._currentMeasure=a.Measure.Empty(),this._tempPaddingMeasure=a.Measure.Empty(),this._fontFamily="",this._fontStyle="",this._fontWeight="",this._fontSize=new o.ValueAndUnit(18,o.ValueAndUnit.UNITMODE_PIXEL,!1),this._width=new o.ValueAndUnit(1,o.ValueAndUnit.UNITMODE_PERCENTAGE,!1),this._height=new o.ValueAndUnit(1,o.ValueAndUnit.UNITMODE_PERCENTAGE,!1),this._color="",this._style=null,this._horizontalAlignment=e.HORIZONTAL_ALIGNMENT_CENTER,this._verticalAlignment=e.VERTICAL_ALIGNMENT_CENTER,this._isDirty=!0,this._wasDirty=!1,this._tempParentMeasure=a.Measure.Empty(),this._prevCurrentMeasureTransformedIntoGlobalSpace=a.Measure.Empty(),this._cachedParentMeasure=a.Measure.Empty(),this._descendantsOnlyPadding=!1,this._paddingLeft=new o.ValueAndUnit(0),this._paddingRight=new o.ValueAndUnit(0),this._paddingTop=new o.ValueAndUnit(0),this._paddingBottom=new o.ValueAndUnit(0),this._left=new o.ValueAndUnit(0),this._top=new o.ValueAndUnit(0),this._scaleX=1,this._scaleY=1,this._rotation=0,this._transformCenterX=.5,this._transformCenterY=.5,this._transformMatrix=s.Matrix2D.Identity(),this._invertTransformMatrix=s.Matrix2D.Identity(),this._transformedPosition=n.Vector2.Zero(),this._isMatrixDirty=!0,this._isVisible=!0,this._isHighlighted=!1,this._highlightColor="#4affff",this._highlightLineWidth=2,this._fontSet=!1,this._dummyVector2=n.Vector2.Zero(),this._downCount=0,this._enterCount=-1,this._doNotRender=!1,this._downPointerIds={},this._evaluatedMeasure=new a.Measure(0,0,0,0),this._evaluatedParentMeasure=new a.Measure(0,0,0,0),this._isEnabled=!0,this._disabledColor="#9a9a9a",this._disabledColorItem="#6a6a6a",this._isReadOnly=!1,this._gradient=null,this._rebuildLayout=!1,this.onEnabledStateChangedObservable=new n.Observable,this._customData={},this._isClipped=!1,this._automaticSize=!1,this.metadata=null,this.isHitTestVisible=!0,this.isPointerBlocker=!1,this.isFocusInvisible=!1,this._clipChildren=!0,this._clipContent=!0,this.useBitmapCache=!1,this._shadowOffsetX=0,this._shadowOffsetY=0,this._shadowBlur=0,this._previousShadowBlur=0,this._shadowColor="black",this.hoverCursor="",this._linkOffsetX=new o.ValueAndUnit(0),this._linkOffsetY=new o.ValueAndUnit(0),this._accessibilityTag=null,this.onAccessibilityTagChangedObservable=new n.Observable,this.onWheelObservable=new n.Observable,this.onPointerMoveObservable=new n.Observable,this.onPointerOutObservable=new n.Observable,this.onPointerDownObservable=new n.Observable,this.onPointerUpObservable=new n.Observable,this.onPointerClickObservable=new n.Observable,this.onEnterPressedObservable=new n.Observable,this.onPointerEnterObservable=new n.Observable,this.onDirtyObservable=new n.Observable,this.onBeforeDrawObservable=new n.Observable,this.onAfterDrawObservable=new n.Observable,this.onDisposeObservable=new n.Observable,this.onIsVisibleChangedObservable=new n.Observable,this.isSerializable=!0,this._fixedRatio=0,this._fixedRatioMasterIsWidth=!0,this.animations=null,this._focusedColor=null,this.tabIndex=-1,this._isFocused=!1,this._unfocusedColor=null,this.onFocusObservable=new n.Observable,this.onBlurObservable=new n.Observable,this.onKeyboardEventProcessedObservable=new n.Observable,this._tmpMeasureA=new a.Measure(0,0,0,0)}return Object.defineProperty(e.prototype,"isReadOnly",{get:function(){return this._isReadOnly},set:function(e){this._isReadOnly=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transformedMeasure",{get:function(){return this._evaluatedMeasure},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clipChildren",{get:function(){return this._clipChildren},set:function(e){this._clipChildren=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clipContent",{get:function(){return this._clipContent},set:function(e){this._clipContent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowOffsetX",{get:function(){return this._shadowOffsetX},set:function(e){this._shadowOffsetX!==e&&(this._shadowOffsetX=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowOffsetY",{get:function(){return this._shadowOffsetY},set:function(e){this._shadowOffsetY!==e&&(this._shadowOffsetY=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowBlur",{get:function(){return this._shadowBlur},set:function(e){this._shadowBlur!==e&&(this._previousShadowBlur=this._shadowBlur,this._shadowBlur=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowColor",{get:function(){return this._shadowColor},set:function(e){this._shadowColor!==e&&(this._shadowColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typeName",{get:function(){return this._getTypeName()},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return this._getTypeName()},Object.defineProperty(e.prototype,"accessibilityTag",{get:function(){return this._accessibilityTag},set:function(e){this._accessibilityTag=e,this.onAccessibilityTagChangedObservable.notifyObservers(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"host",{get:function(){return this._host},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontOffset",{get:function(){return this._fontOffset},set:function(e){this._fontOffset=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},set:function(e){this._alpha!==e&&(this._alphaSet=!0,this._alpha=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightLineWidth",{get:function(){return this._highlightLineWidth},set:function(e){this._highlightLineWidth!==e&&(this._highlightLineWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isHighlighted",{get:function(){return this._isHighlighted},set:function(e){this._isHighlighted!==e&&(this._isHighlighted=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightColor",{get:function(){return this._highlightColor},set:function(e){this._highlightColor!==e&&(this._highlightColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleX",{get:function(){return this._scaleX},set:function(e){this._scaleX!==e&&(this._scaleX=e,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleY",{get:function(){return this._scaleY},set:function(e){this._scaleY!==e&&(this._scaleY=e,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transformCenterY",{get:function(){return this._transformCenterY},set:function(e){this._transformCenterY!==e&&(this._transformCenterY=e,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transformCenterX",{get:function(){return this._transformCenterX},set:function(e){this._transformCenterX!==e&&(this._transformCenterX=e,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"horizontalAlignment",{get:function(){return this._horizontalAlignment},set:function(e){this._horizontalAlignment!==e&&(this._horizontalAlignment=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticalAlignment",{get:function(){return this._verticalAlignment},set:function(e){this._verticalAlignment!==e&&(this._verticalAlignment=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fixedRatio",{get:function(){return this._fixedRatio},set:function(e){this._fixedRatio!==e&&(this._fixedRatio=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fixedRatioMasterIsWidth",{get:function(){return this._fixedRatioMasterIsWidth},set:function(e){this._fixedRatioMasterIsWidth!==e&&(this._fixedRatioMasterIsWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._width.toString(this._host)},set:function(e){this._fixedRatioMasterIsWidth=!0,this._width.toString(this._host)!==e&&this._width.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"widthInPixels",{get:function(){return this._width.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(e){isNaN(e)||(this._fixedRatioMasterIsWidth=!0,this.width=e+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height.toString(this._host)},set:function(e){this._fixedRatioMasterIsWidth=!1,this._height.toString(this._host)!==e&&this._height.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"heightInPixels",{get:function(){return this._height.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(e){isNaN(e)||(this._fixedRatioMasterIsWidth=!1,this.height=e+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(e){this._fontFamily!==e&&(this._fontFamily=e,this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(e){this._fontStyle!==e&&(this._fontStyle=e,this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(e){this._fontWeight!==e&&(this._fontWeight=e,this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this._style},set:function(e){var t=this;this._style&&(this._style.onChangedObservable.remove(this._styleObserver),this._styleObserver=null),this._style=e,this._style&&(this._styleObserver=this._style.onChangedObservable.add((function(){t._markAsDirty(),t._resetFontCache()}))),this._markAsDirty(),this._resetFontCache()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_isFontSizeInPercentage",{get:function(){return this._fontSize.isPercentage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSizeInPixels",{get:function(){var e=this._style?this._style._fontSize:this._fontSize;return e.isPixel?e.getValue(this._host):e.getValueInPixel(this._host,this._tempParentMeasure.height||this._cachedParentMeasure.height)},set:function(e){isNaN(e)||(this.fontSize=e+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this._fontSize.toString(this._host)},set:function(e){this._fontSize.toString(this._host)!==e&&this._fontSize.fromString(e)&&(this._markAsDirty(),this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(e){this._color!==e&&(this._color=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gradient",{get:function(){return this._gradient},set:function(e){this._gradient!==e&&(this._gradient=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zIndex",{get:function(){return this._zIndex},set:function(e){this.zIndex!==e&&(this._zIndex=e,this.parent&&this.parent._reOrderControl(this))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notRenderable",{get:function(){return this._doNotRender},set:function(e){this._doNotRender!==e&&(this._doNotRender=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this._isVisible},set:function(e){this._isVisible!==e&&(this._isVisible=e,this._markAsDirty(!0),this.onIsVisibleChangedObservable.notifyObservers(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDirty",{get:function(){return this._isDirty},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linkedMesh",{get:function(){return this._linkedMesh},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"descendantsOnlyPadding",{get:function(){return this._descendantsOnlyPadding},set:function(e){this._descendantsOnlyPadding!==e&&(this._descendantsOnlyPadding=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddingLeft",{get:function(){return this._paddingLeft.toString(this._host)},set:function(e){this._paddingLeft.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddingLeftInPixels",{get:function(){return this._paddingLeft.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(e){isNaN(e)||(this.paddingLeft=e+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_paddingLeftInPixels",{get:function(){return this._descendantsOnlyPadding?0:this.paddingLeftInPixels},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddingRight",{get:function(){return this._paddingRight.toString(this._host)},set:function(e){this._paddingRight.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddingRightInPixels",{get:function(){return this._paddingRight.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(e){isNaN(e)||(this.paddingRight=e+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_paddingRightInPixels",{get:function(){return this._descendantsOnlyPadding?0:this.paddingRightInPixels},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddingTop",{get:function(){return this._paddingTop.toString(this._host)},set:function(e){this._paddingTop.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddingTopInPixels",{get:function(){return this._paddingTop.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(e){isNaN(e)||(this.paddingTop=e+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_paddingTopInPixels",{get:function(){return this._descendantsOnlyPadding?0:this.paddingTopInPixels},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddingBottom",{get:function(){return this._paddingBottom.toString(this._host)},set:function(e){this._paddingBottom.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddingBottomInPixels",{get:function(){return this._paddingBottom.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(e){isNaN(e)||(this.paddingBottom=e+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_paddingBottomInPixels",{get:function(){return this._descendantsOnlyPadding?0:this.paddingBottomInPixels},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"left",{get:function(){return this._left.toString(this._host)},set:function(e){this._left.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftInPixels",{get:function(){return this._left.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(e){isNaN(e)||(this.left=e+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this._top.toString(this._host)},set:function(e){this._top.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topInPixels",{get:function(){return this._top.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(e){isNaN(e)||(this.top=e+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linkOffsetX",{get:function(){return this._linkOffsetX.toString(this._host)},set:function(e){this._linkOffsetX.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linkOffsetXInPixels",{get:function(){return this._linkOffsetX.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(e){isNaN(e)||(this.linkOffsetX=e+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linkOffsetY",{get:function(){return this._linkOffsetY.toString(this._host)},set:function(e){this._linkOffsetY.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linkOffsetYInPixels",{get:function(){return this._linkOffsetY.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(e){isNaN(e)||(this.linkOffsetY=e+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"centerX",{get:function(){return this._currentMeasure.left+this._currentMeasure.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"centerY",{get:function(){return this._currentMeasure.top+this._currentMeasure.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){var t=this;if(this._isEnabled!==e){this._isEnabled=e,this._markAsDirty();var i=function(e){if(e.host){for(var r in e.host._lastControlOver)e===t.host._lastControlOver[r]&&(e._onPointerOut(e,null,!0),delete e.host._lastControlOver[r]);void 0!==e.children&&e.children.forEach(i)}};i(this),this.onEnabledStateChangedObservable.notifyObservers(e)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disabledColor",{get:function(){return this._disabledColor},set:function(e){this._disabledColor!==e&&(this._disabledColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disabledColorItem",{get:function(){return this._disabledColorItem},set:function(e){this._disabledColorItem!==e&&(this._disabledColorItem=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"focusedColor",{get:function(){return this._focusedColor},set:function(e){this._focusedColor=e},enumerable:!1,configurable:!0}),e.prototype.onBlur=function(){this._isFocused&&(this._isFocused=!1,this.focusedColor&&null!=this._unfocusedColor&&(this.color=this._unfocusedColor),this.onBlurObservable.notifyObservers(this))},e.prototype.onFocus=function(){this._isFocused=!0,this.focusedColor&&(this._unfocusedColor=this.color,this.color=this.focusedColor),this.onFocusObservable.notifyObservers(this)},e.prototype.keepsFocusWith=function(){return null},e.prototype.focus=function(){this._host.moveFocusToControl(this)},e.prototype.blur=function(){this._host.focusedControl=null},e.prototype.processKeyboard=function(e){"Enter"===e.key&&this.onEnterPressedObservable.notifyObservers(this),this.onKeyboardEventProcessedObservable.notifyObservers(e,-1,this)},e.prototype._getTypeName=function(){return"Control"},e.prototype.getAscendantOfClass=function(e){return this.parent?this.parent.getClassName()===e?this.parent:this.parent.getAscendantOfClass(e):null},e.prototype.markAsDirty=function(e){void 0===e&&(e=!1),this._markAsDirty(e)},e.prototype.markAllAsDirty=function(){this._markAllAsDirty()},e.prototype._resetFontCache=function(){this._fontSet=!0,this._markAsDirty()},e.prototype.isAscendant=function(e){return!!this.parent&&(this.parent===e||this.parent.isAscendant(e))},e.prototype.getLocalCoordinates=function(e){var t=n.Vector2.Zero();return this.getLocalCoordinatesToRef(e,t),t},e.prototype.getLocalCoordinatesToRef=function(e,t){return t.x=e.x-this._currentMeasure.left,t.y=e.y-this._currentMeasure.top,this},e.prototype.getParentLocalCoordinates=function(e){var t=n.Vector2.Zero();return t.x=e.x-this._cachedParentMeasure.left,t.y=e.y-this._cachedParentMeasure.top,t},e.prototype.moveToVector3=function(t,i){if(this._host&&this.parent===this._host._rootContainer){this.horizontalAlignment=e.HORIZONTAL_ALIGNMENT_LEFT,this.verticalAlignment=e.VERTICAL_ALIGNMENT_TOP;var r=this._host._getGlobalViewport(),o=n.Vector3.Project(t,n.Matrix.IdentityReadOnly,i.getTransformMatrix(),r);this._moveToProjectedPosition(o),o.z<0||o.z>1?this.notRenderable=!0:this.notRenderable=!1}else n.Tools.Error("Cannot move a control to a vector3 if the control is not at root level")},e.prototype.getDescendantsToRef=function(e,t,i){void 0===t&&(t=!1)},e.prototype.getDescendants=function(e,t){var i=[];return this.getDescendantsToRef(i,e,t),i},e.prototype.linkWithMesh=function(t){if(!this._host||this.parent&&this.parent!==this._host._rootContainer)t&&n.Tools.Error("Cannot link a control to a mesh if the control is not at root level");else{var i=this._host._linkedControls.indexOf(this);if(-1!==i)return this._linkedMesh=t,void(t||this._host._linkedControls.splice(i,1));t&&(this.horizontalAlignment=e.HORIZONTAL_ALIGNMENT_LEFT,this.verticalAlignment=e.VERTICAL_ALIGNMENT_TOP,this._linkedMesh=t,this._host._linkedControls.push(this))}},e.prototype.setPadding=function(e,t,i,r){var n=e,o=null!=t?t:n,a=null!=i?i:n,s=null!=r?r:o;this.paddingTop=n,this.paddingRight=o,this.paddingBottom=a,this.paddingLeft=s},e.prototype.setPaddingInPixels=function(e,t,i,r){var n=e,o=null!=t?t:n,a=null!=i?i:n,s=null!=r?r:o;this.paddingTopInPixels=n,this.paddingRightInPixels=o,this.paddingBottomInPixels=a,this.paddingLeftInPixels=s},e.prototype._moveToProjectedPosition=function(e){var t,i=this._left.getValue(this._host),r=this._top.getValue(this._host),n=null===(t=this.parent)||void 0===t?void 0:t._currentMeasure;n&&this._processMeasures(n,this._host.getContext());var o=e.x+this._linkOffsetX.getValue(this._host)-this._currentMeasure.width/2,a=e.y+this._linkOffsetY.getValue(this._host)-this._currentMeasure.height/2,s=this._left.ignoreAdaptiveScaling&&this._top.ignoreAdaptiveScaling;s&&(Math.abs(o-i)<.5&&(o=i),Math.abs(a-r)<.5&&(a=r)),(s||i!==o||r!==a)&&(this.left=o+"px",this.top=a+"px",this._left.ignoreAdaptiveScaling=!0,this._top.ignoreAdaptiveScaling=!0,this._markAsDirty())},e.prototype._offsetLeft=function(e){this._isDirty=!0,this._currentMeasure.left+=e},e.prototype._offsetTop=function(e){this._isDirty=!0,this._currentMeasure.top+=e},e.prototype._markMatrixAsDirty=function(){this._isMatrixDirty=!0,this._flagDescendantsAsMatrixDirty()},e.prototype._flagDescendantsAsMatrixDirty=function(){},e.prototype._intersectsRect=function(e,t){return this._transform(t),!(this._evaluatedMeasure.left>=e.left+e.width||this._evaluatedMeasure.top>=e.top+e.height||this._evaluatedMeasure.left+this._evaluatedMeasure.width<=e.left||this._evaluatedMeasure.top+this._evaluatedMeasure.height<=e.top)},e.prototype._computeAdditionalOffsetX=function(){return 0},e.prototype._computeAdditionalOffsetY=function(){return 0},e.prototype.invalidateRect=function(){if(this._transform(),this.host&&this.host.useInvalidateRectOptimization){this._currentMeasure.transformToRef(this._transformMatrix,this._tmpMeasureA),a.Measure.CombineToRef(this._tmpMeasureA,this._prevCurrentMeasureTransformedIntoGlobalSpace,this._tmpMeasureA);var e=this.shadowOffsetX,t=this.shadowOffsetY,i=Math.max(this._previousShadowBlur,this.shadowBlur),r=Math.min(Math.min(e,0)-2*i,0),n=Math.max(Math.max(e,0)+2*i,0),o=Math.min(Math.min(t,0)-2*i,0),s=Math.max(Math.max(t,0)+2*i,0),l=this._computeAdditionalOffsetX(),c=this._computeAdditionalOffsetY();this.host.invalidateRect(Math.floor(this._tmpMeasureA.left+r-l),Math.floor(this._tmpMeasureA.top+o-c),Math.ceil(this._tmpMeasureA.left+this._tmpMeasureA.width+n+l),Math.ceil(this._tmpMeasureA.top+this._tmpMeasureA.height+s+c))}},e.prototype._markAsDirty=function(e){void 0===e&&(e=!1),(this._isVisible||e)&&(this._isDirty=!0,this._markMatrixAsDirty(),this._host&&this._host.markAsDirty())},e.prototype._markAllAsDirty=function(){this._markAsDirty(),this._font&&this._prepareFont()},e.prototype._link=function(e){this._host=e,this._host&&(this.uniqueId=this._host.getScene().getUniqueId())},e.prototype._transform=function(e){if(this._isMatrixDirty||1!==this._scaleX||1!==this._scaleY||0!==this._rotation){var t=this._currentMeasure.width*this._transformCenterX+this._currentMeasure.left,i=this._currentMeasure.height*this._transformCenterY+this._currentMeasure.top;e&&(e.translate(t,i),e.rotate(this._rotation),e.scale(this._scaleX,this._scaleY),e.translate(-t,-i)),(this._isMatrixDirty||this._cachedOffsetX!==t||this._cachedOffsetY!==i)&&(this._cachedOffsetX=t,this._cachedOffsetY=i,this._isMatrixDirty=!1,this._flagDescendantsAsMatrixDirty(),s.Matrix2D.ComposeToRef(-t,-i,this._rotation,this._scaleX,this._scaleY,this.parent?this.parent._transformMatrix:null,this._transformMatrix),this._transformMatrix.invertToRef(this._invertTransformMatrix),this._currentMeasure.transformToRef(this._transformMatrix,this._evaluatedMeasure))}},e.prototype._renderHighlight=function(e){this.isHighlighted&&(e.save(),e.strokeStyle=this._highlightColor,e.lineWidth=this._highlightLineWidth,this._renderHighlightSpecific(e),e.restore())},e.prototype._renderHighlightSpecific=function(e){e.strokeRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)},e.prototype._getColor=function(e){return this.gradient?this.gradient.getCanvasGradient(e):this.color},e.prototype._applyStates=function(t){this._isFontSizeInPercentage&&(this._fontSet=!0),this._host&&this._host.useSmallestIdeal&&!this._font&&(this._fontSet=!0),this._fontSet&&(this._prepareFont(),this._fontSet=!1),this._font&&(t.font=this._font),(this._color||this.gradient)&&(t.fillStyle=this._getColor(t)),e.AllowAlphaInheritance?t.globalAlpha*=this._alpha:this._alphaSet&&(t.globalAlpha=this.parent&&!this.parent.renderToIntermediateTexture?this.parent.alpha*this._alpha:this._alpha)},e.prototype._layout=function(e,t){if(!this.isDirty&&(!this.isVisible||this.notRenderable))return!1;if(this._isDirty||!this._cachedParentMeasure.isEqualsTo(e)){this.host._numLayoutCalls++,this._currentMeasure.addAndTransformToRef(this._transformMatrix,0|-this._paddingLeftInPixels,0|-this._paddingTopInPixels,0|this._paddingRightInPixels,0|this._paddingBottomInPixels,this._prevCurrentMeasureTransformedIntoGlobalSpace),t.save(),this._applyStates(t);var i=0;do{this._rebuildLayout=!1,this._processMeasures(e,t),i++}while(this._rebuildLayout&&i<3);i>=3&&n.Logger.Error("Layout cycle detected in GUI (Control name=".concat(this.name,", uniqueId=").concat(this.uniqueId,")")),t.restore(),this.invalidateRect(),this._evaluateClippingState(e)}return this._wasDirty=this._isDirty,this._isDirty=!1,!0},e.prototype._processMeasures=function(e,t){this._tempPaddingMeasure.copyFrom(e),this.parent&&this.parent.descendantsOnlyPadding&&(this._tempPaddingMeasure.left+=this.parent.paddingLeftInPixels,this._tempPaddingMeasure.top+=this.parent.paddingTopInPixels,this._tempPaddingMeasure.width-=this.parent.paddingLeftInPixels+this.parent.paddingRightInPixels,this._tempPaddingMeasure.height-=this.parent.paddingTopInPixels+this.parent.paddingBottomInPixels),this._currentMeasure.copyFrom(this._tempPaddingMeasure),this._preMeasure(this._tempPaddingMeasure,t),this._measure(),this._postMeasure(this._tempPaddingMeasure,t),this._computeAlignment(this._tempPaddingMeasure,t),this._currentMeasure.left=0|this._currentMeasure.left,this._currentMeasure.top=0|this._currentMeasure.top,this._currentMeasure.width=0|this._currentMeasure.width,this._currentMeasure.height=0|this._currentMeasure.height,this._additionalProcessing(this._tempPaddingMeasure,t),this._cachedParentMeasure.copyFrom(this._tempPaddingMeasure),this._currentMeasure.transformToRef(this._transformMatrix,this._evaluatedMeasure),this.onDirtyObservable.hasObservers()&&this.onDirtyObservable.notifyObservers(this)},e.prototype._evaluateClippingState=function(e){if(this._transform(),this._currentMeasure.transformToRef(this._transformMatrix,this._evaluatedMeasure),this.parent&&this.parent.clipChildren){if(e.transformToRef(this.parent._transformMatrix,this._evaluatedParentMeasure),this._evaluatedMeasure.left>this._evaluatedParentMeasure.left+this._evaluatedParentMeasure.width)return void(this._isClipped=!0);if(this._evaluatedMeasure.left+this._evaluatedMeasure.width<this._evaluatedParentMeasure.left)return void(this._isClipped=!0);if(this._evaluatedMeasure.top>this._evaluatedParentMeasure.top+this._evaluatedParentMeasure.height)return void(this._isClipped=!0);if(this._evaluatedMeasure.top+this._evaluatedMeasure.height<this._evaluatedParentMeasure.top)return void(this._isClipped=!0)}this._isClipped=!1},e.prototype._measure=function(){this._width.isPixel?this._currentMeasure.width=this._width.getValue(this._host):this._currentMeasure.width*=this._width.getValue(this._host),this._height.isPixel?this._currentMeasure.height=this._height.getValue(this._host):this._currentMeasure.height*=this._height.getValue(this._host),0!==this._fixedRatio&&(this._fixedRatioMasterIsWidth?this._currentMeasure.height=this._currentMeasure.width*this._fixedRatio:this._currentMeasure.width=this._currentMeasure.height*this._fixedRatio)},e.prototype._computeAlignment=function(t,i){var r=this._currentMeasure.width,n=this._currentMeasure.height,o=t.width,a=t.height,s=0,l=0;switch(this.horizontalAlignment){case e.HORIZONTAL_ALIGNMENT_LEFT:s=0;break;case e.HORIZONTAL_ALIGNMENT_RIGHT:s=o-r;break;case e.HORIZONTAL_ALIGNMENT_CENTER:s=(o-r)/2}switch(this.verticalAlignment){case e.VERTICAL_ALIGNMENT_TOP:l=0;break;case e.VERTICAL_ALIGNMENT_BOTTOM:l=a-n;break;case e.VERTICAL_ALIGNMENT_CENTER:l=(a-n)/2}this.descendantsOnlyPadding||(this._paddingLeft.isPixel?(this._currentMeasure.left+=this._paddingLeft.getValue(this._host),this._currentMeasure.width-=this._paddingLeft.getValue(this._host)):(this._currentMeasure.left+=o*this._paddingLeft.getValue(this._host),this._currentMeasure.width-=o*this._paddingLeft.getValue(this._host)),this._paddingRight.isPixel?this._currentMeasure.width-=this._paddingRight.getValue(this._host):this._currentMeasure.width-=o*this._paddingRight.getValue(this._host),this._paddingTop.isPixel?(this._currentMeasure.top+=this._paddingTop.getValue(this._host),this._currentMeasure.height-=this._paddingTop.getValue(this._host)):(this._currentMeasure.top+=a*this._paddingTop.getValue(this._host),this._currentMeasure.height-=a*this._paddingTop.getValue(this._host)),this._paddingBottom.isPixel?this._currentMeasure.height-=this._paddingBottom.getValue(this._host):this._currentMeasure.height-=a*this._paddingBottom.getValue(this._host)),this._left.isPixel?this._currentMeasure.left+=this._left.getValue(this._host):this._currentMeasure.left+=o*this._left.getValue(this._host),this._top.isPixel?this._currentMeasure.top+=this._top.getValue(this._host):this._currentMeasure.top+=a*this._top.getValue(this._host),this._currentMeasure.left+=s,this._currentMeasure.top+=l},e.prototype._preMeasure=function(e,t){},e.prototype._postMeasure=function(e,t){},e.prototype._additionalProcessing=function(e,t){},e.prototype._clipForChildren=function(e){},e.prototype._clip=function(t,i){if(t.beginPath(),e._ClipMeasure.copyFrom(this._currentMeasure),i){i.transformToRef(this._invertTransformMatrix,this._tmpMeasureA);var r=new a.Measure(0,0,0,0);r.left=Math.max(this._tmpMeasureA.left,this._currentMeasure.left),r.top=Math.max(this._tmpMeasureA.top,this._currentMeasure.top),r.width=Math.min(this._tmpMeasureA.left+this._tmpMeasureA.width,this._currentMeasure.left+this._currentMeasure.width)-r.left,r.height=Math.min(this._tmpMeasureA.top+this._tmpMeasureA.height,this._currentMeasure.top+this._currentMeasure.height)-r.top,e._ClipMeasure.copyFrom(r)}if(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY){var n=this.shadowOffsetX,o=this.shadowOffsetY,s=this.shadowBlur,l=Math.min(Math.min(n,0)-2*s,0),c=Math.max(Math.max(n,0)+2*s,0),u=Math.min(Math.min(o,0)-2*s,0),h=Math.max(Math.max(o,0)+2*s,0);t.rect(e._ClipMeasure.left+l,e._ClipMeasure.top+u,e._ClipMeasure.width+c-l,e._ClipMeasure.height+h-u)}else t.rect(e._ClipMeasure.left,e._ClipMeasure.top,e._ClipMeasure.width,e._ClipMeasure.height);t.clip()},e.prototype._render=function(e,t){return!this.isVisible||this.notRenderable||this._isClipped?(this._isDirty=!1,!1):(this.host._numRenderCalls++,e.save(),this._applyStates(e),this._transform(e),this.clipContent&&this._clip(e,t),this.onBeforeDrawObservable.hasObservers()&&this.onBeforeDrawObservable.notifyObservers(this),this.useBitmapCache&&!this._wasDirty&&this._cacheData?e.putImageData(this._cacheData,this._currentMeasure.left,this._currentMeasure.top):this._draw(e,t),this.useBitmapCache&&this._wasDirty&&(this._cacheData=e.getImageData(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),this._renderHighlight(e),this.onAfterDrawObservable.hasObservers()&&this.onAfterDrawObservable.notifyObservers(this),e.restore(),!0)},e.prototype._draw=function(e,t){},e.prototype.contains=function(e,t){return this._invertTransformMatrix.transformCoordinates(e,t,this._transformedPosition),e=this._transformedPosition.x,t=this._transformedPosition.y,!(e<this._currentMeasure.left||e>this._currentMeasure.left+this._currentMeasure.width||t<this._currentMeasure.top||t>this._currentMeasure.top+this._currentMeasure.height||(this.isPointerBlocker&&(this._host._shouldBlockPointer=!0),0))},e.prototype._processPicking=function(e,t,i,r,n,o,a,s){return!(!this._isEnabled||!this.isHitTestVisible||!this.isVisible||this._doNotRender||!this.contains(e,t)||(this._processObservables(r,e,t,i,n,o,a,s),0))},e.prototype._onPointerMove=function(e,t,i,r){this.onPointerMoveObservable.notifyObservers(t,-1,e,this,r)&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerMove(e,t,i,r)},e.prototype._onPointerEnter=function(e,t){return!(!this._isEnabled||this._enterCount>0||(-1===this._enterCount&&(this._enterCount=0),this._enterCount++,this.onPointerEnterObservable.notifyObservers(this,-1,e,this,t)&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerEnter(e,t),0))},e.prototype._onPointerOut=function(e,t,i){if(void 0===i&&(i=!1),i||this._isEnabled){this._enterCount=0;var r=!0;e.isAscendant(this)||(r=this.onPointerOutObservable.notifyObservers(this,-1,e,this,t)),r&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerOut(e,t,i)}},e.prototype._onPointerDown=function(e,t,i,r,n){return this._onPointerEnter(this,n),-1!==this.tabIndex&&(this.host.focusedControl=this),0===this._downCount&&(this._downCount++,this._downPointerIds[i]=!0,this.onPointerDownObservable.notifyObservers(new s.Vector2WithInfo(t,r),-1,e,this,n)&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerDown(e,t,i,r,n),n&&this.uniqueId!==this._host.rootContainer.uniqueId&&this._host._capturedPointerIds.add(n.event.pointerId),!0)},e.prototype._onPointerUp=function(e,t,i,r,n,o){if(this._isEnabled){this._downCount=0,delete this._downPointerIds[i];var a=n;n&&(this._enterCount>0||-1===this._enterCount)&&(a=this.onPointerClickObservable.notifyObservers(new s.Vector2WithInfo(t,r),-1,e,this,o)),this.onPointerUpObservable.notifyObservers(new s.Vector2WithInfo(t,r),-1,e,this,o)&&null!=this.parent&&!this.isPointerBlocker&&this.parent._onPointerUp(e,t,i,r,a,o),o&&this.uniqueId!==this._host.rootContainer.uniqueId&&this._host._capturedPointerIds.delete(o.event.pointerId)}},e.prototype._forcePointerUp=function(e){if(void 0===e&&(e=null),null!==e)this._onPointerUp(this,n.Vector2.Zero(),e,0,!0);else for(var t in this._downPointerIds)this._onPointerUp(this,n.Vector2.Zero(),+t,0,!0)},e.prototype._onWheelScroll=function(e,t){this._isEnabled&&this.onWheelObservable.notifyObservers(new n.Vector2(e,t))&&null!=this.parent&&this.parent._onWheelScroll(e,t)},e.prototype._onCanvasBlur=function(){},e.prototype._processObservables=function(e,t,i,r,o,a,s,l){if(!this._isEnabled)return!1;if(this._dummyVector2.copyFromFloats(t,i),e===n.PointerEventTypes.POINTERMOVE){this._onPointerMove(this,this._dummyVector2,o,r);var c=this._host._lastControlOver[o];return c&&c!==this&&c._onPointerOut(this,r),c!==this&&this._onPointerEnter(this,r),this._host._lastControlOver[o]=this,!0}return e===n.PointerEventTypes.POINTERDOWN?(this._onPointerDown(this,this._dummyVector2,o,a,r),this._host._registerLastControlDown(this,o),this._host._lastPickedControl=this,!0):e===n.PointerEventTypes.POINTERUP?(this._host._lastControlDown[o]&&this._host._lastControlDown[o]._onPointerUp(this,this._dummyVector2,o,a,!0,r),delete this._host._lastControlDown[o],!0):!(e!==n.PointerEventTypes.POINTERWHEEL||!this._host._lastControlOver[o]||(this._host._lastControlOver[o]._onWheelScroll(s,l),0))},e.prototype._getStyleProperty=function(e,t){var i,r=null!==(i=this._style&&this._style[e])&&void 0!==i?i:this[e];return!r&&this.parent?this.parent._getStyleProperty(e,t):this.parent?r:t},e.prototype._prepareFont=function(){var t,i;(this._font||this._fontSet)&&(this._font=this._getStyleProperty("fontStyle","")+" "+this._getStyleProperty("fontWeight","")+" "+this.fontSizeInPixels+"px "+this._getStyleProperty("fontFamily","Arial"),this._fontOffset=e._GetFontOffset(this._font,null===(i=null===(t=this._host)||void 0===t?void 0:t.getScene())||void 0===i?void 0:i.getEngine()),this.getDescendants().forEach((function(e){return e._markAllAsDirty()})))},e.prototype.isDimensionFullyDefined=function(e){return this.getDimension(e).isPixel},e.prototype.getDimension=function(e){return"width"===e?this._width:this._height},e.prototype.clone=function(e){var t={};this.serialize(t,!0);var i=new(n.Tools.Instantiate("BABYLON.GUI."+t.className));return i.parse(t,e),i},e.prototype.parse=function(e,t,i){var r=this;return this._urlRewriter=i,n.SerializationHelper.Parse((function(){return r}),e,null),this.name=e.name,this._parseFromContent(e,null!=t?t:this._host),this},e.prototype.serialize=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!0),(this.isSerializable||t)&&(n.SerializationHelper.Serialize(this,e),e.name=this.name,e.className=this.getClassName(),i&&this._prepareFont(),this._fontFamily&&(e.fontFamily=this._fontFamily),this.fontSize&&(e.fontSize=this.fontSize),this.fontWeight&&(e.fontWeight=this.fontWeight),this.fontStyle&&(e.fontStyle=this.fontStyle),this._gradient&&(e.gradient={},this._gradient.serialize(e.gradient)),n.SerializationHelper.AppendSerializedAnimations(this,e))},e.prototype._parseFromContent=function(e,t,i){var r,o;if(e.fontFamily&&(this.fontFamily=e.fontFamily),e.fontSize&&(this.fontSize=e.fontSize),e.fontWeight&&(this.fontWeight=e.fontWeight),e.fontStyle&&(this.fontStyle=e.fontStyle),e.gradient){var a=n.Tools.Instantiate("BABYLON.GUI."+e.gradient.className);this._gradient=new a,null===(r=this._gradient)||void 0===r||r.parse(e.gradient)}if(e.animations){this.animations=[];for(var s=0;s<e.animations.length;s++){var l=e.animations[s],c=(0,n.GetClass)("BABYLON.Animation");c&&this.animations.push(c.Parse(l))}e.autoAnimate&&this._host&&this._host.getScene()&&this._host.getScene().beginAnimation(this,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1)}this.fixedRatioMasterIsWidth=null!==(o=e.fixedRatioMasterIsWidth)&&void 0!==o?o:this.fixedRatioMasterIsWidth},e.prototype.dispose=function(){this.onDirtyObservable.clear(),this.onBeforeDrawObservable.clear(),this.onAfterDrawObservable.clear(),this.onPointerDownObservable.clear(),this.onPointerEnterObservable.clear(),this.onPointerMoveObservable.clear(),this.onPointerOutObservable.clear(),this.onPointerUpObservable.clear(),this.onPointerClickObservable.clear(),this.onWheelObservable.clear(),this.onBlurObservable.clear(),this.onFocusObservable.clear(),this.onKeyboardEventProcessedObservable.clear(),this._styleObserver&&this._style&&(this._style.onChangedObservable.remove(this._styleObserver),this._styleObserver=null),this.parent&&(this.parent.removeControl(this),this.parent=null),this._host&&this._host._linkedControls.indexOf(this)>-1&&this.linkWithMesh(null),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()},Object.defineProperty(e,"HORIZONTAL_ALIGNMENT_LEFT",{get:function(){return e._HORIZONTAL_ALIGNMENT_LEFT},enumerable:!1,configurable:!0}),Object.defineProperty(e,"HORIZONTAL_ALIGNMENT_RIGHT",{get:function(){return e._HORIZONTAL_ALIGNMENT_RIGHT},enumerable:!1,configurable:!0}),Object.defineProperty(e,"HORIZONTAL_ALIGNMENT_CENTER",{get:function(){return e._HORIZONTAL_ALIGNMENT_CENTER},enumerable:!1,configurable:!0}),Object.defineProperty(e,"VERTICAL_ALIGNMENT_TOP",{get:function(){return e._VERTICAL_ALIGNMENT_TOP},enumerable:!1,configurable:!0}),Object.defineProperty(e,"VERTICAL_ALIGNMENT_BOTTOM",{get:function(){return e._VERTICAL_ALIGNMENT_BOTTOM},enumerable:!1,configurable:!0}),Object.defineProperty(e,"VERTICAL_ALIGNMENT_CENTER",{get:function(){return e._VERTICAL_ALIGNMENT_CENTER},enumerable:!1,configurable:!0}),e._GetFontOffset=function(t,i){if(e._FontHeightSizes[t])return e._FontHeightSizes[t];var r=i||n.EngineStore.LastCreatedEngine;if(!r)throw new Error("Invalid engine. Unable to create a canvas.");var o=r.getFontOffset(t);return e._FontHeightSizes[t]=o,o},e.Parse=function(e,t,i){var r=n.Tools.Instantiate("BABYLON.GUI."+e.className),o=n.SerializationHelper.Parse((function(){var e=new r;return e._urlRewriter=i,e}),e,null);return o.name=e.name,o._parseFromContent(e,t,i),o},e.drawEllipse=function(e,t,i,r,n,o){o.translate(e,t),o.scale(i,r),o.beginPath(),o.arc(0,0,1,0,2*Math.PI*n,n<0),n>=1&&o.closePath(),o.scale(1/i,1/r),o.translate(-e,-t)},e.prototype.isReady=function(){return!0},e.AllowAlphaInheritance=!1,e._ClipMeasure=new a.Measure(0,0,0,0),e._HORIZONTAL_ALIGNMENT_LEFT=0,e._HORIZONTAL_ALIGNMENT_RIGHT=1,e._HORIZONTAL_ALIGNMENT_CENTER=2,e._VERTICAL_ALIGNMENT_TOP=0,e._VERTICAL_ALIGNMENT_BOTTOM=1,e._VERTICAL_ALIGNMENT_CENTER=2,e._FontHeightSizes={},e.AddHeader=function(){},(0,r.__decorate)([(0,n.serialize)()],e.prototype,"metadata",void 0),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"isHitTestVisible",void 0),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"isPointerBlocker",void 0),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"isFocusInvisible",void 0),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"clipChildren",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"clipContent",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"useBitmapCache",void 0),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"shadowOffsetX",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"shadowOffsetY",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"shadowBlur",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"shadowColor",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"hoverCursor",void 0),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"fontOffset",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"alpha",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"isSerializable",void 0),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"scaleX",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"scaleY",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"rotation",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"transformCenterY",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"transformCenterX",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"horizontalAlignment",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"verticalAlignment",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"fixedRatio",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"fixedRatioMasterIsWidth",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"width",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"height",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"style",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"color",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"gradient",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"zIndex",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"notRenderable",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"isVisible",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"descendantsOnlyPadding",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"paddingLeft",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"paddingRight",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"paddingTop",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"paddingBottom",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"left",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"top",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"linkOffsetX",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"linkOffsetY",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"isEnabled",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"disabledColor",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"disabledColorItem",null),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"overlapGroup",void 0),(0,r.__decorate)([(0,n.serialize)()],e.prototype,"overlapDeltaMultiplier",void 0),e}();(0,n.RegisterClass)("BABYLON.GUI.Control",l)},"../../../dev/gui/src/2D/controls/displayGrid.ts":(e,t,i)=>{i.r(t),i.d(t,{DisplayGrid:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/control.ts"),o=i("babylonjs/Misc/perfCounter"),a=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._cellWidth=20,i._cellHeight=20,i._minorLineTickness=1,i._minorLineColor="DarkGray",i._majorLineTickness=2,i._majorLineColor="White",i._majorLineFrequency=5,i._background="Black",i._displayMajorLines=!0,i._displayMinorLines=!0,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"displayMinorLines",{get:function(){return this._displayMinorLines},set:function(e){this._displayMinorLines!==e&&(this._displayMinorLines=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayMajorLines",{get:function(){return this._displayMajorLines},set:function(e){this._displayMajorLines!==e&&(this._displayMajorLines=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellWidth",{get:function(){return this._cellWidth},set:function(e){this._cellWidth=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellHeight",{get:function(){return this._cellHeight},set:function(e){this._cellHeight=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minorLineTickness",{get:function(){return this._minorLineTickness},set:function(e){this._minorLineTickness=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minorLineColor",{get:function(){return this._minorLineColor},set:function(e){this._minorLineColor=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"majorLineTickness",{get:function(){return this._majorLineTickness},set:function(e){this._majorLineTickness=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"majorLineColor",{get:function(){return this._majorLineColor},set:function(e){this._majorLineColor=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"majorLineFrequency",{get:function(){return this._majorLineFrequency},set:function(e){this._majorLineFrequency=e,this._markAsDirty()},enumerable:!1,configurable:!0}),t.prototype._draw=function(e){if(e.save(),this._applyStates(e),this._isEnabled){this._background&&(e.fillStyle=this._background,e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height));var t=this._currentMeasure.width/this._cellWidth,i=this._currentMeasure.height/this._cellHeight,r=this._currentMeasure.left+this._currentMeasure.width/2,n=this._currentMeasure.top+this._currentMeasure.height/2;if(this._displayMinorLines){e.strokeStyle=this._minorLineColor,e.lineWidth=this._minorLineTickness;for(var o=-t/2+1;o<t/2;o++){var a=r+o*this.cellWidth;e.beginPath(),e.moveTo(a,this._currentMeasure.top),e.lineTo(a,this._currentMeasure.top+this._currentMeasure.height),e.stroke()}for(var s=-i/2+1;s<i/2;s++){var l=n+s*this.cellHeight;e.beginPath(),e.moveTo(this._currentMeasure.left,l),e.lineTo(this._currentMeasure.left+this._currentMeasure.width,l),e.stroke()}}if(this._displayMajorLines){for(e.strokeStyle=this._majorLineColor,e.lineWidth=this._majorLineTickness,o=-t/2+this._majorLineFrequency;o<t/2;o+=this._majorLineFrequency)a=r+o*this.cellWidth,e.beginPath(),e.moveTo(a,this._currentMeasure.top),e.lineTo(a,this._currentMeasure.top+this._currentMeasure.height),e.stroke();for(s=-i/2+this._majorLineFrequency;s<i/2;s+=this._majorLineFrequency)l=n+s*this.cellHeight,e.moveTo(this._currentMeasure.left,l),e.lineTo(this._currentMeasure.left+this._currentMeasure.width,l),e.closePath(),e.stroke()}}e.restore()},t.prototype._getTypeName=function(){return"DisplayGrid"},(0,r.__decorate)([(0,o.serialize)()],t.prototype,"displayMinorLines",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"displayMajorLines",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"background",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"cellWidth",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"cellHeight",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"minorLineTickness",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"minorLineColor",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"majorLineTickness",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"majorLineColor",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"majorLineFrequency",null),t}(n.Control);(0,o.RegisterClass)("BABYLON.GUI.DisplayGrid",a)},"../../../dev/gui/src/2D/controls/ellipse.ts":(e,t,i)=>{i.r(t),i.d(t,{Ellipse:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/container.ts"),o=i("../../../dev/gui/src/2D/controls/control.ts"),a=i("babylonjs/Misc/perfCounter"),s=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._thickness=1,i._arc=1,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness!==e&&(this._thickness=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"arc",{get:function(){return this._arc},set:function(e){this._arc!==e&&(this._arc=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Ellipse"},t.prototype._localDraw=function(e){e.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),o.Control.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2-this._thickness/2,this._currentMeasure.height/2-this._thickness/2,this._arc,e),(this._backgroundGradient||this._background)&&(e.fillStyle=this._getBackgroundColor(e),e.fill()),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),this._thickness&&(this.color&&(e.strokeStyle=this.color),e.lineWidth=this._thickness,e.stroke()),e.restore()},t.prototype._additionalProcessing=function(t,i){e.prototype._additionalProcessing.call(this,t,i),this._measureForChildren.width-=2*this._thickness,this._measureForChildren.height-=2*this._thickness,this._measureForChildren.left+=this._thickness,this._measureForChildren.top+=this._thickness},t.prototype._clipForChildren=function(e){o.Control.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2,this._currentMeasure.height/2,this._arc,e),e.clip()},t.prototype._renderHighlightSpecific=function(e){o.Control.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2-this._highlightLineWidth/2,this._currentMeasure.height/2-this._highlightLineWidth/2,this._arc,e),e.stroke()},(0,r.__decorate)([(0,a.serialize)()],t.prototype,"thickness",null),(0,r.__decorate)([(0,a.serialize)()],t.prototype,"arc",null),t}(n.Container);(0,a.RegisterClass)("BABYLON.GUI.Ellipse",s)},"../../../dev/gui/src/2D/controls/focusableButton.ts":(e,t,i)=>{i.r(t),i.d(t,{FocusableButton:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/button.ts"),o=i("babylonjs/Misc/perfCounter"),a=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._unfocusedColor=i.color,i}return(0,r.__extends)(t,e),t.prototype._onPointerDown=function(t,i,r,n,o){return this.isReadOnly||this.focus(),e.prototype._onPointerDown.call(this,t,i,r,n,o)},t}(n.Button);(0,o.RegisterClass)("BABYLON.GUI.FocusableButton",a)},"../../../dev/gui/src/2D/controls/focusableControl.ts":(e,t,i)=>{i.r(t)},"../../../dev/gui/src/2D/controls/gradient/BaseGradient.ts":(e,t,i)=>{i.r(t),i.d(t,{BaseGradient:()=>r});var r=function(){function e(){this._colorStops=[],this._gradientDirty=!0}return e.prototype._addColorStopsToCanvasGradient=function(){for(var e=0,t=this._colorStops;e<t.length;e++){var i=t[e];this._canvasGradient.addColorStop(i.offset,i.color)}},e.prototype.getCanvasGradient=function(e){return(this._gradientDirty||this._context!==e)&&(this._context=e,this._canvasGradient=this._createCanvasGradient(e),this._addColorStopsToCanvasGradient(),this._gradientDirty=!1),this._canvasGradient},e.prototype.addColorStop=function(e,t){this._colorStops.push({offset:e,color:t}),this._gradientDirty=!0},e.prototype.removeColorStop=function(e){this._colorStops=this._colorStops.filter((function(t){return t.offset!==e})),this._gradientDirty=!0},e.prototype.clearColorStops=function(){this._colorStops=[],this._gradientDirty=!0},Object.defineProperty(e.prototype,"colorStops",{get:function(){return this._colorStops},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"BaseGradient"},e.prototype.serialize=function(e){e.colorStops=this._colorStops,e.className=this.getClassName()},e.prototype.parse=function(e){this._colorStops=e.colorStops},e}()},"../../../dev/gui/src/2D/controls/gradient/LinearGradient.ts":(e,t,i)=>{i.r(t),i.d(t,{LinearGradient:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/gradient/BaseGradient.ts"),o=i("babylonjs/Misc/perfCounter"),a=function(e){function t(t,i,r,n){var o=e.call(this)||this;return o._x0=null!=t?t:0,o._y0=null!=i?i:0,o._x1=null!=r?r:0,o._y1=null!=n?n:0,o}return(0,r.__extends)(t,e),t.prototype._createCanvasGradient=function(e){return e.createLinearGradient(this._x0,this._y0,this._x1,this._y1)},Object.defineProperty(t.prototype,"x0",{get:function(){return this._x0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x1",{get:function(){return this._x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y0",{get:function(){return this._y0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y1",{get:function(){return this._y1},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"LinearGradient"},t.prototype.serialize=function(t){e.prototype.serialize.call(this,t),t.x0=this._x0,t.y0=this._y0,t.x1=this._x1,t.y1=this._y1},t.prototype.parse=function(t){e.prototype.parse.call(this,t),this._x0=t.x0,this._y0=t.y0,this._x1=t.x1,this._y1=t.y1},t}(n.BaseGradient);(0,o.RegisterClass)("BABYLON.GUI.LinearGradient",a)},"../../../dev/gui/src/2D/controls/gradient/RadialGradient.ts":(e,t,i)=>{i.r(t),i.d(t,{RadialGradient:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/gradient/BaseGradient.ts"),o=i("babylonjs/Misc/perfCounter"),a=function(e){function t(t,i,r,n,o,a){var s=e.call(this)||this;return s._x0=null!=t?t:0,s._y0=null!=i?i:0,s._r0=null!=r?r:0,s._x1=null!=n?n:0,s._y1=null!=o?o:0,s._r1=null!=a?a:0,s}return(0,r.__extends)(t,e),t.prototype._createCanvasGradient=function(e){return e.createRadialGradient(this._x0,this._y0,this._r0,this._x1,this._y1,this._r1)},Object.defineProperty(t.prototype,"x0",{get:function(){return this._x0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x1",{get:function(){return this._x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y0",{get:function(){return this._y0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y1",{get:function(){return this._y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"r0",{get:function(){return this._r0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"r1",{get:function(){return this._r1},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"RadialGradient"},t.prototype.serialize=function(t){e.prototype.serialize.call(this,t),t.x0=this._x0,t.y0=this._y0,t.r0=this._r0,t.x1=this._x1,t.y1=this._y1,t.r1=this._r1},t.prototype.parse=function(t){e.prototype.parse.call(this,t),this._x0=t.x0,this._y0=t.y0,this._r0=t.r0,this._x1=t.x1,this._y1=t.y1,this._r1=t.r1},t}(n.BaseGradient);(0,o.RegisterClass)("BABYLON.GUI.RadialGradient",a)},"../../../dev/gui/src/2D/controls/grid.ts":(e,t,i)=>{i.r(t),i.d(t,{Grid:()=>l});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/container.ts"),o=i("../../../dev/gui/src/2D/valueAndUnit.ts"),a=i("../../../dev/gui/src/2D/controls/control.ts"),s=i("babylonjs/Misc/perfCounter"),l=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._rowDefinitions=new Array,i._rowDefinitionObservers=[],i._columnDefinitions=new Array,i._columnDefinitionObservers=[],i._cells={},i._childControls=new Array,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"clipContent",{get:function(){return this._clipContent},set:function(e){for(var t in this._clipContent=e,this._cells)this._cells[t].clipContent=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipChildren",{get:function(){return this._clipChildren},set:function(e){for(var t in this._clipChildren=e,this._cells)this._cells[t].clipChildren=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"columnCount",{get:function(){return this._columnDefinitions.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rowCount",{get:function(){return this._rowDefinitions.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._childControls},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cells",{get:function(){return this._cells},enumerable:!1,configurable:!0}),t.prototype.getRowDefinition=function(e){return e<0||e>=this._rowDefinitions.length?null:this._rowDefinitions[e]},t.prototype.getColumnDefinition=function(e){return e<0||e>=this._columnDefinitions.length?null:this._columnDefinitions[e]},t.prototype.addRowDefinition=function(e,t){var i=this;return void 0===t&&(t=!1),this._rowDefinitions.push(new o.ValueAndUnit(e,t?o.ValueAndUnit.UNITMODE_PIXEL:o.ValueAndUnit.UNITMODE_PERCENTAGE)),this._rowDefinitionObservers.push(this._rowDefinitions[this.rowCount-1].onChangedObservable.add((function(){return i._markAsDirty()}))),this._markAsDirty(),this},t.prototype.addColumnDefinition=function(e,t){var i=this;return void 0===t&&(t=!1),this._columnDefinitions.push(new o.ValueAndUnit(e,t?o.ValueAndUnit.UNITMODE_PIXEL:o.ValueAndUnit.UNITMODE_PERCENTAGE)),this._columnDefinitionObservers.push(this._columnDefinitions[this.columnCount-1].onChangedObservable.add((function(){return i._markAsDirty()}))),this._markAsDirty(),this},t.prototype.setRowDefinition=function(e,t,i){var r=this;if(void 0===i&&(i=!1),e<0||e>=this._rowDefinitions.length)return this;var n=this._rowDefinitions[e];return n&&n.isPixel===i&&n.value===t||(this._rowDefinitions[e].onChangedObservable.remove(this._rowDefinitionObservers[e]),this._rowDefinitions[e]=new o.ValueAndUnit(t,i?o.ValueAndUnit.UNITMODE_PIXEL:o.ValueAndUnit.UNITMODE_PERCENTAGE),this._rowDefinitionObservers[e]=this._rowDefinitions[e].onChangedObservable.add((function(){return r._markAsDirty()})),this._markAsDirty()),this},t.prototype.setColumnDefinition=function(e,t,i){var r=this;if(void 0===i&&(i=!1),e<0||e>=this._columnDefinitions.length)return this;var n=this._columnDefinitions[e];return n&&n.isPixel===i&&n.value===t||(this._columnDefinitions[e].onChangedObservable.remove(this._columnDefinitionObservers[e]),this._columnDefinitions[e]=new o.ValueAndUnit(t,i?o.ValueAndUnit.UNITMODE_PIXEL:o.ValueAndUnit.UNITMODE_PERCENTAGE),this._columnDefinitionObservers[e]=this._columnDefinitions[e].onChangedObservable.add((function(){return r._markAsDirty()})),this._markAsDirty()),this},t.prototype.getChildrenAt=function(e,t){var i=this._cells["".concat(e,":").concat(t)];return i?i.children:null},t.prototype.getChildCellInfo=function(e){return e._tag},t.prototype._removeCell=function(t,i){if(t){e.prototype.removeControl.call(this,t);for(var r=0,n=t.children;r<n.length;r++){var o=n[r],a=this._childControls.indexOf(o);-1!==a&&this._childControls.splice(a,1)}delete this._cells[i]}},t.prototype._offsetCell=function(e,t){if(this._cells[t]){this._cells[e]=this._cells[t];for(var i=0,r=this._cells[e].children;i<r.length;i++)r[i]._tag=e;delete this._cells[t]}},t.prototype.removeColumnDefinition=function(e){if(e<0||e>=this._columnDefinitions.length)return this;for(var t=0;t<this._rowDefinitions.length;t++){var i="".concat(t,":").concat(e),r=this._cells[i];this._removeCell(r,i)}for(t=0;t<this._rowDefinitions.length;t++)for(var n=e+1;n<this._columnDefinitions.length;n++){var o="".concat(t,":").concat(n-1);i="".concat(t,":").concat(n),this._offsetCell(o,i)}return this._columnDefinitions[e].onChangedObservable.remove(this._columnDefinitionObservers[e]),this._columnDefinitions.splice(e,1),this._columnDefinitionObservers.splice(e,1),this._markAsDirty(),this},t.prototype.removeRowDefinition=function(e){if(e<0||e>=this._rowDefinitions.length)return this;for(var t=0;t<this._columnDefinitions.length;t++){var i="".concat(e,":").concat(t),r=this._cells[i];this._removeCell(r,i)}for(t=0;t<this._columnDefinitions.length;t++)for(var n=e+1;n<this._rowDefinitions.length;n++){var o="".concat(n-1,":").concat(t);i="".concat(n,":").concat(t),this._offsetCell(o,i)}return this._rowDefinitions[e].onChangedObservable.remove(this._rowDefinitionObservers[e]),this._rowDefinitions.splice(e,1),this._rowDefinitionObservers.splice(e,1),this._markAsDirty(),this},t.prototype.addControl=function(t,i,r){if(void 0===i&&(i=0),void 0===r&&(r=0),0===this._rowDefinitions.length&&this.addRowDefinition(1,!1),0===this._columnDefinitions.length&&this.addColumnDefinition(1,!1),-1!==this._childControls.indexOf(t))return s.Tools.Warn("Control (Name:".concat(t.name,", UniqueId:").concat(t.uniqueId,") is already associated with this grid. You must remove it before reattaching it")),this;var o=Math.min(i,this._rowDefinitions.length-1),l=Math.min(r,this._columnDefinitions.length-1),c="".concat(o,":").concat(l),u=this._cells[c];return u||(u=new n.Container(c),this._cells[c]=u,u.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,u.verticalAlignment=a.Control.VERTICAL_ALIGNMENT_TOP,u.clipContent=this.clipContent,u.clipChildren=this.clipChildren,e.prototype.addControl.call(this,u)),u.addControl(t),this._childControls.push(t),t._tag=c,t.parent=this,this._markAsDirty(),this},t.prototype.removeControl=function(e){var t=this._childControls.indexOf(e);-1!==t&&this._childControls.splice(t,1);var i=this._cells[e._tag];return i&&(i.removeControl(e),e._tag=null),this._markAsDirty(),this},t.prototype._getTypeName=function(){return"Grid"},t.prototype._getGridDefinitions=function(e){for(var t=[],i=[],r=[],n=[],o=this._currentMeasure.width,a=0,s=this._currentMeasure.height,l=0,c=0,u=0,h=this._rowDefinitions;u<h.length;u++)(m=h[u]).isPixel?(s-=p=m.getValue(this._host),i[c]=p):l+=m.value,c++;var d=0;c=0;for(var _=0,f=this._rowDefinitions;_<f.length;_++){var p,m=f[_];n.push(d),m.isPixel?d+=m.getValue(this._host):(d+=p=Math.round(m.value/l*s),i[c]=p),c++}c=0;for(var g=0,v=this._columnDefinitions;g<v.length;g++)(C=v[g]).isPixel?(o-=T=C.getValue(this._host),t[c]=T):a+=C.value,c++;var b=0;c=0;for(var y=0,x=this._columnDefinitions;y<x.length;y++){var T,C=x[y];r.push(b),C.isPixel?b+=C.getValue(this._host):(b+=T=Math.round(C.value/a*o),t[c]=T),c++}e(r,n,t,i)},t.prototype._additionalProcessing=function(t,i){var r=this;this._getGridDefinitions((function(e,t,i,n){for(var o in r._cells)if(Object.prototype.hasOwnProperty.call(r._cells,o)){var a=o.split(":"),s=parseInt(a[0]),l=parseInt(a[1]),c=r._cells[o];c.leftInPixels=e[l],c.topInPixels=t[s],c.widthInPixels=i[l],c.heightInPixels=n[s],c._left.ignoreAdaptiveScaling=!0,c._top.ignoreAdaptiveScaling=!0,c._width.ignoreAdaptiveScaling=!0,c._height.ignoreAdaptiveScaling=!0}})),e.prototype._additionalProcessing.call(this,t,i)},t.prototype._flagDescendantsAsMatrixDirty=function(){for(var e in this._cells)Object.prototype.hasOwnProperty.call(this._cells,e)&&this._cells[e]._markMatrixAsDirty()},t.prototype._renderHighlightSpecific=function(t){var i=this;e.prototype._renderHighlightSpecific.call(this,t),this._getGridDefinitions((function(e,r,n,o){for(var a=0;a<e.length;a++){var s=i._currentMeasure.left+e[a]+n[a];t.beginPath(),t.moveTo(s,i._currentMeasure.top),t.lineTo(s,i._currentMeasure.top+i._currentMeasure.height),t.stroke()}for(a=0;a<r.length;a++){var l=i._currentMeasure.top+r[a]+o[a];t.beginPath(),t.moveTo(i._currentMeasure.left,l),t.lineTo(i._currentMeasure.left+i._currentMeasure.width,l),t.stroke()}})),t.restore()},t.prototype.dispose=function(){e.prototype.dispose.call(this);for(var t=0,i=this._childControls;t<i.length;t++)i[t].dispose();for(var r=0;r<this._rowDefinitions.length;r++)this._rowDefinitions[r].onChangedObservable.remove(this._rowDefinitionObservers[r]);for(r=0;r<this._columnDefinitions.length;r++)this._columnDefinitions[r].onChangedObservable.remove(this._columnDefinitionObservers[r]);this._rowDefinitionObservers.length=0,this._rowDefinitions.length=0,this._columnDefinitionObservers.length=0,this._columnDefinitions.length=0,this._cells={},this._childControls.length=0},t.prototype.serialize=function(t,i){if(e.prototype.serialize.call(this,t,i),this.isSerializable||i){t.columnCount=this.columnCount,t.rowCount=this.rowCount,t.columns=[],t.rows=[],t.tags=[];for(var r=0;r<this.columnCount;++r){var n=this.getColumnDefinition(r),o={value:null==n?void 0:n.getValue(this.host),unit:null==n?void 0:n.unit};t.columns.push(o)}for(r=0;r<this.rowCount;++r){var a=this.getRowDefinition(r);o={value:null==a?void 0:a.getValue(this.host),unit:null==a?void 0:a.unit},t.rows.push(o)}this.children.forEach((function(e){t.tags.push(e._tag)}))}},t.prototype._parseFromContent=function(t,i){e.prototype._parseFromContent.call(this,t,i);var r=[];this.children.forEach((function(e){r.push(e)})),this.removeRowDefinition(0),this.removeColumnDefinition(0);for(var n=0;n<t.columnCount;++n){var o=t.columns[n].value,a=t.columns[n].unit;this.addColumnDefinition(o,1===a)}for(n=0;n<t.rowCount;++n){var s=t.rows[n].value;a=t.rows[n].unit,this.addRowDefinition(s,1===a)}for(n=0;n<r.length;++n){var l=t.tags[n],c=parseInt(l.substring(0,l.search(":")));isNaN(c)&&(c=0);var u=parseInt(l.substring(l.search(":")+1));isNaN(u)&&(u=0),this.addControl(r[n],c,u)}},(0,r.__decorate)([(0,s.serialize)()],t.prototype,"clipContent",null),t}(n.Container);(0,s.RegisterClass)("BABYLON.GUI.Grid",l)},"../../../dev/gui/src/2D/controls/image.ts":(e,t,i)=>{i.r(t),i.d(t,{Image:()=>o});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=function(e){function t(i,r){void 0===r&&(r=null);var o=e.call(this,i)||this;return o.name=i,o._workingCanvas=null,o._loaded=!1,o._stretch=t.STRETCH_FILL,o._source=null,o._autoScale=!1,o._sourceLeft=0,o._sourceTop=0,o._sourceWidth=0,o._sourceHeight=0,o._svgAttributesComputationCompleted=!1,o._isSVG=!1,o._cellWidth=0,o._cellHeight=0,o._cellId=-1,o._populateNinePatchSlicesFromImage=!1,o._imageDataCache={data:null,key:""},o.onImageLoadedObservable=new n.Observable,o.onSVGAttributesComputedObservable=new n.Observable,o.source=r,o}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"isLoaded",{get:function(){return this._loaded},enumerable:!1,configurable:!0}),t.prototype.isReady=function(){return this.isLoaded},Object.defineProperty(t.prototype,"detectPointerOnOpaqueOnly",{get:function(){return this._detectPointerOnOpaqueOnly},set:function(e){this._detectPointerOnOpaqueOnly!==e&&(this._detectPointerOnOpaqueOnly=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sliceLeft",{get:function(){return this._sliceLeft},set:function(e){this._sliceLeft!==e&&(this._sliceLeft=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sliceRight",{get:function(){return this._sliceRight},set:function(e){this._sliceRight!==e&&(this._sliceRight=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sliceTop",{get:function(){return this._sliceTop},set:function(e){this._sliceTop!==e&&(this._sliceTop=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sliceBottom",{get:function(){return this._sliceBottom},set:function(e){this._sliceBottom!==e&&(this._sliceBottom=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sourceLeft",{get:function(){return this._sourceLeft},set:function(e){this._sourceLeft!==e&&(this._sourceLeft=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sourceTop",{get:function(){return this._sourceTop},set:function(e){this._sourceTop!==e&&(this._sourceTop=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sourceWidth",{get:function(){return this._sourceWidth},set:function(e){this._sourceWidth!==e&&(this._sourceWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sourceHeight",{get:function(){return this._sourceHeight},set:function(e){this._sourceHeight!==e&&(this._sourceHeight=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageWidth",{get:function(){return this._imageWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageHeight",{get:function(){return this._imageHeight},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"populateNinePatchSlicesFromImage",{get:function(){return this._populateNinePatchSlicesFromImage},set:function(e){this._populateNinePatchSlicesFromImage!==e&&(this._populateNinePatchSlicesFromImage=e,this._populateNinePatchSlicesFromImage&&this._loaded&&this._extractNinePatchSliceDataFromImage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSVG",{get:function(){return this._isSVG},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"svgAttributesComputationCompleted",{get:function(){return this._svgAttributesComputationCompleted},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoScale",{get:function(){return this._autoScale},set:function(e){this._autoScale!==e&&(this._autoScale=e,e&&this._loaded&&this.synchronizeSizeWithContent())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stretch",{get:function(){return this._stretch},set:function(e){this._stretch!==e&&(this._stretch=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._rotate90=function(e,i){var r,o;void 0===i&&(i=!1);var a=this._domImage.width,s=this._domImage.height,l=(null===(o=null===(r=this._host)||void 0===r?void 0:r.getScene())||void 0===o?void 0:o.getEngine())||n.EngineStore.LastCreatedEngine;if(!l)throw new Error("Invalid engine. Unable to create a canvas.");var c=l.createCanvas(s,a),u=c.getContext("2d");u.translate(c.width/2,c.height/2),u.rotate(e*Math.PI/2),u.drawImage(this._domImage,0,0,a,s,-a/2,-s/2,a,s);var h=c.toDataURL("image/jpg"),d=new t(this.name+"rotated",h);return i&&(d._stretch=this._stretch,d._autoScale=this._autoScale,d._cellId=this._cellId,d._cellWidth=e%1?this._cellHeight:this._cellWidth,d._cellHeight=e%1?this._cellWidth:this._cellHeight),this._handleRotationForSVGImage(this,d,e),this._imageDataCache.data=null,d},t.prototype._handleRotationForSVGImage=function(e,t,i){var r=this;e._isSVG&&(e._svgAttributesComputationCompleted?(this._rotate90SourceProperties(e,t,i),this._markAsDirty()):e.onSVGAttributesComputedObservable.addOnce((function(){r._rotate90SourceProperties(e,t,i),r._markAsDirty()})))},t.prototype._rotate90SourceProperties=function(e,t,i){var r,n,o=e.sourceLeft,a=e.sourceTop,s=e.domImage.width,l=e.domImage.height,c=o,u=a,h=e.sourceWidth,d=e.sourceHeight;if(0!=i){var _=i<0?-1:1;i%=4;for(var f=0;f<Math.abs(i);++f)c=-(a-l/2)*_+l/2,u=(o-s/2)*_+s/2,h=(r=[d,h])[0],d=r[1],i<0?u-=d:c-=h,o=c,a=u,s=(n=[l,s])[0],l=n[1]}t.sourceLeft=c,t.sourceTop=u,t.sourceWidth=h,t.sourceHeight=d},t.prototype._extractNinePatchSliceDataFromImage=function(){var e,t,i=this._domImage.width,r=this._domImage.height;if(!this._workingCanvas){var o=(null===(t=null===(e=this._host)||void 0===e?void 0:e.getScene())||void 0===t?void 0:t.getEngine())||n.EngineStore.LastCreatedEngine;if(!o)throw new Error("Invalid engine. Unable to create a canvas.");this._workingCanvas=o.createCanvas(i,r)}var a=this._workingCanvas.getContext("2d");a.drawImage(this._domImage,0,0,i,r);var s=a.getImageData(0,0,i,r);this._sliceLeft=-1,this._sliceRight=-1;for(var l=0;l<i;l++)if((u=s.data[4*l+3])>127&&-1===this._sliceLeft)this._sliceLeft=l;else if(u<127&&this._sliceLeft>-1){this._sliceRight=l;break}this._sliceTop=-1,this._sliceBottom=-1;for(var c=0;c<r;c++){var u;if((u=s.data[c*i*4+3])>127&&-1===this._sliceTop)this._sliceTop=c;else if(u<127&&this._sliceTop>-1){this._sliceBottom=c;break}}},Object.defineProperty(t.prototype,"domImage",{get:function(){return this._domImage},set:function(e){var t=this;this._domImage=e,this._loaded=!1,this._imageDataCache.data=null,this._domImage.width?this._onImageLoaded():this._domImage.onload=function(){t._onImageLoaded()}},enumerable:!1,configurable:!0}),t.prototype._onImageLoaded=function(){this._imageDataCache.data=null,this._imageWidth=this._domImage.width,this._imageHeight=this._domImage.height,this._loaded=!0,this._populateNinePatchSlicesFromImage&&this._extractNinePatchSliceDataFromImage(),this._autoScale&&this.synchronizeSizeWithContent(),this.onImageLoadedObservable.notifyObservers(this),this._markAsDirty()},Object.defineProperty(t.prototype,"source",{get:function(){return this._source},set:function(e){var i,r,o,a,s,l=this;if(this._urlRewriter&&e&&(e=this._urlRewriter(e)),this._source!==e){this._removeCacheUsage(this._source),this._loaded=!1,this._source=e,this._imageDataCache.data=null,e&&(e=this._svgCheck(e));var c=(null===(r=null===(i=this._host)||void 0===i?void 0:i.getScene())||void 0===r?void 0:r.getEngine())||n.EngineStore.LastCreatedEngine;if(!c)throw new Error("Invalid engine. Unable to create a canvas.");if(e&&t.SourceImgCache.has(e)){var u=t.SourceImgCache.get(e);return this._domImage=u.img,u.timesUsed+=1,void(u.loaded?this._onImageLoaded():u.waitingForLoadCallback.push(this._onImageLoaded.bind(this)))}this._domImage=c.createCanvasImage();var h=this._domImage,d=!1;h.style&&(null===(o=this._source)||void 0===o?void 0:o.endsWith(".svg"))&&(h.style.visibility="hidden",h.style.position="absolute",h.style.top="0",null===(s=null===(a=c.getRenderingCanvas())||void 0===a?void 0:a.parentNode)||void 0===s||s.appendChild(h),d=!0),e&&t.SourceImgCache.set(e,{img:this._domImage,timesUsed:1,loaded:!1,waitingForLoadCallback:[this._onImageLoaded.bind(this)]}),this._domImage.onload=function(){if(e){var i=t.SourceImgCache.get(e);if(i){i.loaded=!0;for(var r=0,n=i.waitingForLoadCallback;r<n.length;r++)(0,n[r])();return i.waitingForLoadCallback.length=0,void(d&&h.remove())}}l._onImageLoaded(),d&&h.remove()},e&&(n.Tools.SetCorsBehavior(e,this._domImage),n.Tools.SetReferrerPolicyBehavior(this.referrerPolicy,this._domImage),this._domImage.src=e)}},enumerable:!1,configurable:!0}),t.ResetImageCache=function(){t.SourceImgCache.clear()},t.prototype._removeCacheUsage=function(e){var i=e&&t.SourceImgCache.get(e);if(i){i.timesUsed-=1;var r=i.img;r.parentNode&&r.parentNode.removeChild(r),0===i.timesUsed&&t.SourceImgCache.delete(e)}},t.prototype._svgCheck=function(e){var t=this;if(window.SVGSVGElement&&-1!==e.search(/(\.svg|\.svg?[?|#].*)$/gi)&&e.indexOf("#")===e.lastIndexOf("#")){this._isSVG=!0;var i=e.split("#")[0],r=e.split("#")[1],n=document.body.querySelector('object[data="'+i+'"]');if(n){var o=n.contentDocument;if(o&&o.documentElement){var a=o.documentElement.getAttribute("viewBox"),s=Number(o.documentElement.getAttribute("width")),l=Number(o.documentElement.getAttribute("height"));if(o.getElementById(r)&&a&&s&&l)return this._getSVGAttribs(n,r),e}n.addEventListener("load",(function(){t._getSVGAttribs(n,r)}))}else{var c=document.createElement("object");c.data=i,c.type="image/svg+xml",c.width="0%",c.height="0%",document.body.appendChild(c),c.onload=function(){var e=document.body.querySelector('object[data="'+i+'"]');e&&t._getSVGAttribs(e,r)}}return i}return e},t.prototype._getSVGAttribs=function(e,t){var i=e.contentDocument;if(i&&i.documentElement){var r=i.documentElement.getAttribute("viewBox"),n=Number(i.documentElement.getAttribute("width")),o=Number(i.documentElement.getAttribute("height")),a=i.getElementById(t);if(r&&n&&o&&a){var s=Number(r.split(" ")[2]),l=Number(r.split(" ")[3]),c=a.getBBox(),u=1,h=1,d=0,_=0,f=a.transform.baseVal.consolidate().matrix;a.transform&&a.transform.baseVal.consolidate()&&(u=f.a,h=f.d,d=f.e,_=f.f),this.sourceLeft=(u*c.x+d)*n/s,this.sourceTop=(h*c.y+_)*o/l,this.sourceWidth=c.width*u*(n/s),this.sourceHeight=c.height*h*(o/l),this._svgAttributesComputationCompleted=!0,this.onSVGAttributesComputedObservable.notifyObservers(this)}}},Object.defineProperty(t.prototype,"cellWidth",{get:function(){return this._cellWidth},set:function(e){this._cellWidth!==e&&(this._cellWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellHeight",{get:function(){return this._cellHeight},set:function(e){this._cellHeight!==e&&(this._cellHeight=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellId",{get:function(){return this._cellId},set:function(e){this._cellId!==e&&(this._cellId=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype.contains=function(t,i){if(!e.prototype.contains.call(this,t,i))return!1;if(!this._detectPointerOnOpaqueOnly||!this._workingCanvas)return!0;var r=0|this._currentMeasure.width,n=0|this._currentMeasure.height,o=r+"_"+n,a=this._imageDataCache.data;if(!a||this._imageDataCache.key!==o){var s=this._workingCanvas.getContext("2d");this._imageDataCache.data=a=s.getImageData(0,0,r,n).data,this._imageDataCache.key=o}return a[4*((t=t-this._currentMeasure.left|0)+(i=i-this._currentMeasure.top|0)*r)+3]>0},t.prototype._getTypeName=function(){return"Image"},t.prototype.synchronizeSizeWithContent=function(){this._loaded&&(this.width=this._domImage.width+"px",this.height=this._domImage.height+"px")},t.prototype._processMeasures=function(i,r){if(this._loaded)switch(this._stretch){case t.STRETCH_NONE:case t.STRETCH_FILL:case t.STRETCH_UNIFORM:case t.STRETCH_NINE_PATCH:break;case t.STRETCH_EXTEND:this._autoScale&&this.synchronizeSizeWithContent(),this.parent&&this.parent.parent&&(this.parent.adaptWidthToChildren=!0,this.parent.adaptHeightToChildren=!0)}e.prototype._processMeasures.call(this,i,r)},t.prototype._prepareWorkingCanvasForOpaqueDetection=function(){var e,t;if(this._detectPointerOnOpaqueOnly){var i=this._currentMeasure.width,r=this._currentMeasure.height;if(!this._workingCanvas){var o=(null===(t=null===(e=this._host)||void 0===e?void 0:e.getScene())||void 0===t?void 0:t.getEngine())||n.EngineStore.LastCreatedEngine;if(!o)throw new Error("Invalid engine. Unable to create a canvas.");this._workingCanvas=o.createCanvas(i,r)}this._workingCanvas.getContext("2d").clearRect(0,0,i,r)}},t.prototype._drawImage=function(e,t,i,r,n,o,a,s,l){if(e.drawImage(this._domImage,t,i,r,n,o,a,s,l),this._detectPointerOnOpaqueOnly){var c=e.getTransform(),u=this._workingCanvas.getContext("2d");u.save();var h=o-this._currentMeasure.left,d=a-this._currentMeasure.top;u.setTransform(c.a,c.b,c.c,c.d,(h+s)/2,(d+l)/2),u.translate(-(h+s)/2,-(d+l)/2),u.drawImage(this._domImage,t,i,r,n,h,d,s,l),u.restore()}},t.prototype._draw=function(e){var i,r,n,o;if(e.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),-1==this.cellId)i=this._sourceLeft,r=this._sourceTop,n=this._sourceWidth?this._sourceWidth:this._imageWidth,o=this._sourceHeight?this._sourceHeight:this._imageHeight;else{var a=this._domImage.naturalWidth/this.cellWidth,s=this.cellId/a|0,l=this.cellId%a;i=this.cellWidth*l,r=this.cellHeight*s,n=this.cellWidth,o=this.cellHeight}if(this._prepareWorkingCanvasForOpaqueDetection(),this._applyStates(e),this._loaded)switch(this._stretch){case t.STRETCH_NONE:case t.STRETCH_FILL:this._drawImage(e,i,r,n,o,this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height);break;case t.STRETCH_UNIFORM:var c=this._currentMeasure.width/n,u=this._currentMeasure.height/o,h=Math.min(c,u),d=(this._currentMeasure.width-n*h)/2,_=(this._currentMeasure.height-o*h)/2;this._drawImage(e,i,r,n,o,this._currentMeasure.left+d,this._currentMeasure.top+_,n*h,o*h);break;case t.STRETCH_EXTEND:this._drawImage(e,i,r,n,o,this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height);break;case t.STRETCH_NINE_PATCH:this._renderNinePatch(e,i,r,n,o)}e.restore()},t.prototype._renderNinePatch=function(e,t,i,r,n){var o=this.host.idealWidth?this._width.getValue(this.host)/this.host.idealWidth:this.host.idealHeight?this._height.getValue(this.host)/this.host.idealHeight:1,a=this._sliceLeft,s=this._sliceTop,l=n-this._sliceBottom,c=r-this._sliceRight,u=this._sliceRight-this._sliceLeft,h=this._sliceBottom-this._sliceTop,d=Math.round(a*o),_=Math.round(s*o),f=Math.round(l*o),p=Math.round(c*o),m=Math.round(this._currentMeasure.width)-p-d+2,g=Math.round(this._currentMeasure.height)-f-_+2,v=Math.round(this._currentMeasure.left)+d-1,b=Math.round(this._currentMeasure.top)+_-1,y=Math.round(this._currentMeasure.left+this._currentMeasure.width)-p,x=Math.round(this._currentMeasure.top+this._currentMeasure.height)-f;this._drawImage(e,t,i,a,s,this._currentMeasure.left,this._currentMeasure.top,d,_),this._drawImage(e,t+this._sliceLeft,i,u,s,v+1,this._currentMeasure.top,m-2,_),this._drawImage(e,t+this._sliceRight,i,c,s,y,this._currentMeasure.top,p,_),this._drawImage(e,t,i+this._sliceTop,a,h,this._currentMeasure.left,b+1,d,g-2),this._drawImage(e,t+this._sliceLeft,i+this._sliceTop,u,h,v+1,b+1,m-2,g-2),this._drawImage(e,t+this._sliceRight,i+this._sliceTop,c,h,y,b+1,p,g-2),this._drawImage(e,t,i+this._sliceBottom,a,l,this._currentMeasure.left,x,d,f),this._drawImage(e,t+this.sliceLeft,i+this._sliceBottom,u,l,v+1,x,m-2,f),this._drawImage(e,t+this._sliceRight,i+this._sliceBottom,c,l,y,x,p,f)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onImageLoadedObservable.clear(),this.onSVGAttributesComputedObservable.clear(),this._removeCacheUsage(this._source)},t.SourceImgCache=new Map,t.STRETCH_NONE=0,t.STRETCH_FILL=1,t.STRETCH_UNIFORM=2,t.STRETCH_EXTEND=3,t.STRETCH_NINE_PATCH=4,(0,r.__decorate)([(0,n.serialize)()],t.prototype,"detectPointerOnOpaqueOnly",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sliceLeft",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sliceRight",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sliceTop",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sliceBottom",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sourceLeft",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sourceTop",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sourceWidth",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sourceHeight",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"populateNinePatchSlicesFromImage",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"autoScale",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"stretch",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"source",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"cellWidth",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"cellHeight",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"cellId",null),t}(i("../../../dev/gui/src/2D/controls/control.ts").Control);(0,n.RegisterClass)("BABYLON.GUI.Image",o)},"../../../dev/gui/src/2D/controls/index.ts":(e,t,i)=>{i.r(t),i.d(t,{BaseGradient:()=>L.BaseGradient,BaseSlider:()=>w.BaseSlider,Button:()=>r.Button,Checkbox:()=>n.Checkbox,CheckboxGroup:()=>b.CheckboxGroup,ColorPicker:()=>o.ColorPicker,Container:()=>a.Container,Control:()=>s.Control,DisplayGrid:()=>E.DisplayGrid,Ellipse:()=>l.Ellipse,FocusableButton:()=>c.FocusableButton,Grid:()=>u.Grid,Image:()=>h.Image,ImageBasedSlider:()=>M.ImageBasedSlider,ImageScrollBar:()=>A.ImageScrollBar,InputPassword:()=>f.InputPassword,InputText:()=>d.InputText,InputTextArea:()=>_.InputTextArea,KeyPropertySet:()=>S.KeyPropertySet,Line:()=>p.Line,LinearGradient:()=>B.LinearGradient,MultiLine:()=>m.MultiLine,RadialGradient:()=>F.RadialGradient,RadioButton:()=>g.RadioButton,RadioGroup:()=>b.RadioGroup,Rectangle:()=>P.Rectangle,ScrollBar:()=>O.ScrollBar,ScrollViewer:()=>y.ScrollViewer,SelectionPanel:()=>b.SelectionPanel,SelectorGroup:()=>b.SelectorGroup,Slider:()=>I.Slider,SliderGroup:()=>b.SliderGroup,StackPanel:()=>v.StackPanel,TextBlock:()=>x.TextBlock,TextWrapper:()=>T.TextWrapper,TextWrapping:()=>x.TextWrapping,ToggleButton:()=>C.ToggleButton,VirtualKeyboard:()=>S.VirtualKeyboard,name:()=>R.name});var r=i("../../../dev/gui/src/2D/controls/button.ts"),n=i("../../../dev/gui/src/2D/controls/checkbox.ts"),o=i("../../../dev/gui/src/2D/controls/colorpicker.ts"),a=i("../../../dev/gui/src/2D/controls/container.ts"),s=i("../../../dev/gui/src/2D/controls/control.ts"),l=i("../../../dev/gui/src/2D/controls/ellipse.ts"),c=i("../../../dev/gui/src/2D/controls/focusableButton.ts"),u=(i("../../../dev/gui/src/2D/controls/focusableControl.ts"),i("../../../dev/gui/src/2D/controls/grid.ts")),h=i("../../../dev/gui/src/2D/controls/image.ts"),d=i("../../../dev/gui/src/2D/controls/inputText.ts"),_=i("../../../dev/gui/src/2D/controls/inputTextArea.ts"),f=i("../../../dev/gui/src/2D/controls/inputPassword.ts"),p=i("../../../dev/gui/src/2D/controls/line.ts"),m=i("../../../dev/gui/src/2D/controls/multiLine.ts"),g=i("../../../dev/gui/src/2D/controls/radioButton.ts"),v=i("../../../dev/gui/src/2D/controls/stackPanel.ts"),b=i("../../../dev/gui/src/2D/controls/selector.ts"),y=i("../../../dev/gui/src/2D/controls/scrollViewers/scrollViewer.ts"),x=i("../../../dev/gui/src/2D/controls/textBlock.ts"),T=i("../../../dev/gui/src/2D/controls/textWrapper.ts"),C=i("../../../dev/gui/src/2D/controls/toggleButton.ts"),S=i("../../../dev/gui/src/2D/controls/virtualKeyboard.ts"),P=i("../../../dev/gui/src/2D/controls/rectangle.ts"),E=i("../../../dev/gui/src/2D/controls/displayGrid.ts"),w=i("../../../dev/gui/src/2D/controls/sliders/baseSlider.ts"),I=i("../../../dev/gui/src/2D/controls/sliders/slider.ts"),M=i("../../../dev/gui/src/2D/controls/sliders/imageBasedSlider.ts"),O=i("../../../dev/gui/src/2D/controls/sliders/scrollBar.ts"),A=i("../../../dev/gui/src/2D/controls/sliders/imageScrollBar.ts"),R=i("../../../dev/gui/src/2D/controls/statics.ts"),L=i("../../../dev/gui/src/2D/controls/gradient/BaseGradient.ts"),B=i("../../../dev/gui/src/2D/controls/gradient/LinearGradient.ts"),F=i("../../../dev/gui/src/2D/controls/gradient/RadialGradient.ts")},"../../../dev/gui/src/2D/controls/inputPassword.ts":(e,t,i)=>{i.r(t),i.d(t,{InputPassword:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/inputText.ts"),o=i("babylonjs/Misc/perfCounter"),a=i("../../../dev/gui/src/2D/controls/textWrapper.ts"),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.__extends)(t,e),t.prototype._getTypeName=function(){return"InputPassword"},t.prototype._beforeRenderText=function(e){for(var t=new a.TextWrapper,i="",r=0;r<e.length;r++)i+="•";return t.text=i,t},t}(n.InputText);(0,o.RegisterClass)("BABYLON.GUI.InputPassword",s)},"../../../dev/gui/src/2D/controls/inputText.ts":(e,t,i)=>{i.r(t),i.d(t,{InputText:()=>l});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/2D/controls/control.ts"),a=i("../../../dev/gui/src/2D/valueAndUnit.ts"),s=i("../../../dev/gui/src/2D/controls/textWrapper.ts"),l=function(e){function t(t,i){void 0===i&&(i="");var r=e.call(this,t)||this;return r.name=t,r._placeholderText="",r._background="#222222",r._focusedBackground="#000000",r._placeholderColor="gray",r._thickness=1,r._margin=new a.ValueAndUnit(10,a.ValueAndUnit.UNITMODE_PIXEL),r._autoStretchWidth=!0,r._maxWidth=new a.ValueAndUnit(1,a.ValueAndUnit.UNITMODE_PERCENTAGE,!1),r._blinkIsEven=!1,r._cursorOffset=0,r._deadKey=!1,r._addKey=!0,r._currentKey="",r._isTextHighlightOn=!1,r._textHighlightColor="#d5e0ff",r._highligherOpacity=.4,r._highlightedText="",r._startHighlightIndex=0,r._endHighlightIndex=0,r._cursorIndex=-1,r._outlineWidth=0,r._outlineColor="white",r._onFocusSelectAll=!1,r._isPointerDown=!1,r.promptMessage="Please enter text:",r.disableMobilePrompt=!1,r.onTextChangedObservable=new n.Observable,r.onBeforeKeyAddObservable=new n.Observable,r.onTextHighlightObservable=new n.Observable,r.onTextCopyObservable=new n.Observable,r.onTextCutObservable=new n.Observable,r.onTextPasteObservable=new n.Observable,r.text=i,r.isPointerBlocker=!0,r._focusedColor="white",r}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"outlineWidth",{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outlineColor",{get:function(){return this._outlineColor},set:function(e){this._outlineColor!==e&&(this._outlineColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){return this._maxWidth.toString(this._host)},set:function(e){this._maxWidth.toString(this._host)!==e&&this._maxWidth.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxWidthInPixels",{get:function(){return this._maxWidth.getValueInPixel(this._host,this._cachedParentMeasure.width)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"highligherOpacity",{get:function(){return this._highligherOpacity},set:function(e){this._highligherOpacity!==e&&(this._highligherOpacity=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusSelectAll",{get:function(){return this._onFocusSelectAll},set:function(e){this._onFocusSelectAll!==e&&(this._onFocusSelectAll=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textHighlightColor",{get:function(){return this._textHighlightColor},set:function(e){this._textHighlightColor!==e&&(this._textHighlightColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"margin",{get:function(){return this._margin.toString(this._host)},set:function(e){this._margin.toString(this._host)!==e&&this._margin.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"marginInPixels",{get:function(){return this._margin.getValueInPixel(this._host,this._cachedParentMeasure.width)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoStretchWidth",{get:function(){return this._autoStretchWidth},set:function(e){this._autoStretchWidth!==e&&(this._autoStretchWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness!==e&&(this._thickness=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"focusedBackground",{get:function(){return this._focusedBackground},set:function(e){this._focusedBackground!==e&&(this._focusedBackground=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"focusedColor",{set:function(e){this._focusedColor!==e&&(this._focusedColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"placeholderColor",{get:function(){return this._placeholderColor},set:function(e){this._placeholderColor!==e&&(this._placeholderColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"placeholderText",{get:function(){return this._placeholderText},set:function(e){this._placeholderText!==e&&(this._placeholderText=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deadKey",{get:function(){return this._deadKey},set:function(e){this._deadKey=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"highlightedText",{get:function(){return this._highlightedText},set:function(e){this._highlightedText!==e&&(this._highlightedText=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"addKey",{get:function(){return this._addKey},set:function(e){this._addKey=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentKey",{get:function(){return this._currentKey},set:function(e){this._currentKey=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._textWrapper.text},set:function(e){var t=e.toString();this._textWrapper||(this._textWrapper=new s.TextWrapper),this._textWrapper.text!==t&&(this._textWrapper.text=t,this._textHasChanged())},enumerable:!1,configurable:!0}),t.prototype._textHasChanged=function(){this._markAsDirty(),this.onTextChangedObservable.notifyObservers(this)},t.prototype._applyStates=function(t){e.prototype._applyStates.call(this,t),this.outlineWidth&&(t.lineWidth=this.outlineWidth,t.strokeStyle=this.outlineColor)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width.toString(this._host)},set:function(e){(this._width.toString(this._host)!==e||this._autoStretchWidth)&&(this._width.fromString(e)&&this._markAsDirty(),this.autoStretchWidth=!1)},enumerable:!1,configurable:!0}),t.prototype.onBlur=function(){this._isFocused=!1,this._scrollLeft=null,this._cursorOffset=0,clearTimeout(this._blinkTimeout),this._markAsDirty(),this.onBlurObservable.notifyObservers(this),this._host.unRegisterClipboardEvents(),this._onClipboardObserver&&this._host.onClipboardObservable.remove(this._onClipboardObserver);var e=this._host.getScene();this._onPointerDblTapObserver&&e&&e.onPointerObservable.remove(this._onPointerDblTapObserver)},t.prototype.onFocus=function(){var e=this;if(this._isEnabled){if(this._scrollLeft=null,this._isFocused=!0,this._blinkIsEven=!1,this._cursorOffset=0,this._markAsDirty(),this.onFocusObservable.notifyObservers(this),"touch"===this._focusedBy&&!this.disableMobilePrompt){var t=prompt(this.promptMessage);return null!==t&&(this.text=t),void(this._host.focusedControl=null)}this._host.registerClipboardEvents(),this._onClipboardObserver=this._host.onClipboardObservable.add((function(t){switch(t.type){case n.ClipboardEventTypes.COPY:e._onCopyText(t.event),e.onTextCopyObservable.notifyObservers(e);break;case n.ClipboardEventTypes.CUT:e._onCutText(t.event),e.onTextCutObservable.notifyObservers(e);break;case n.ClipboardEventTypes.PASTE:e._onPasteText(t.event),e.onTextPasteObservable.notifyObservers(e);break;default:return}}));var i=this._host.getScene();i&&(this._onPointerDblTapObserver=i.onPointerObservable.add((function(t){e._isFocused&&t.type===n.PointerEventTypes.POINTERDOUBLETAP&&e._processDblClick(t)}))),this._onFocusSelectAll&&this._selectAllText()}},t.prototype._getTypeName=function(){return"InputText"},t.prototype.keepsFocusWith=function(){return this._connectedVirtualKeyboard?[this._connectedVirtualKeyboard]:null},t.prototype.processKey=function(e,t,i){var r;if(!this.isReadOnly&&(!i||!i.ctrlKey&&!i.metaKey||67!==e&&86!==e&&88!==e)){if(i&&(i.ctrlKey||i.metaKey)&&65===e)return this._selectAllText(),void i.preventDefault();switch(e){case 32:t=" ";break;case 191:i&&i.preventDefault();break;case 8:if(this._textWrapper.text&&this._textWrapper.length>0){if(this.isTextHighlightOn)return this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex),this._textHasChanged(),this.isTextHighlightOn=!1,this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,this._blinkIsEven=!1,void(i&&i.preventDefault());0===this._cursorOffset?this.text=this._textWrapper.substr(0,this._textWrapper.length-1):(n=this._textWrapper.length-this._cursorOffset)>0&&(this._textWrapper.removePart(n-1,n),this._textHasChanged())}return void(i&&i.preventDefault());case 46:if(this.isTextHighlightOn)return this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex),this._textHasChanged(),this.isTextHighlightOn=!1,this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,void(i&&i.preventDefault());if(this._textWrapper.text&&this._textWrapper.length>0&&this._cursorOffset>0){var n=this._textWrapper.length-this._cursorOffset;this._textWrapper.removePart(n,n+1),this._textHasChanged(),this._cursorOffset--}return void(i&&i.preventDefault());case 13:return this._host.focusedControl=null,void(this.isTextHighlightOn=!1);case 35:return this._cursorOffset=0,this._blinkIsEven=!1,this.isTextHighlightOn=!1,void this._markAsDirty();case 36:return this._cursorOffset=this._textWrapper.length,this._blinkIsEven=!1,this.isTextHighlightOn=!1,void this._markAsDirty();case 37:if(this._cursorOffset++,this._cursorOffset>this._textWrapper.length&&(this._cursorOffset=this._textWrapper.length),i&&i.shiftKey){if(this._blinkIsEven=!1,i.ctrlKey||i.metaKey){if(!this.isTextHighlightOn){if(this._textWrapper.length===this._cursorOffset)return;this._endHighlightIndex=this._textWrapper.length-this._cursorOffset+1}return this._startHighlightIndex=0,this._cursorIndex=this._textWrapper.length-this._endHighlightIndex,this._cursorOffset=this._textWrapper.length,this.isTextHighlightOn=!0,void this._markAsDirty()}return this.isTextHighlightOn?-1===this._cursorIndex&&(this._cursorIndex=this._textWrapper.length-this._endHighlightIndex,this._cursorOffset=0===this._startHighlightIndex?this._textWrapper.length:this._textWrapper.length-this._startHighlightIndex+1):(this.isTextHighlightOn=!0,this._cursorIndex=this._cursorOffset>=this._textWrapper.length?this._textWrapper.length:this._cursorOffset-1),this._cursorIndex<this._cursorOffset?(this._endHighlightIndex=this._textWrapper.length-this._cursorIndex,this._startHighlightIndex=this._textWrapper.length-this._cursorOffset):this._cursorIndex>this._cursorOffset?(this._endHighlightIndex=this._textWrapper.length-this._cursorOffset,this._startHighlightIndex=this._textWrapper.length-this._cursorIndex):this.isTextHighlightOn=!1,void this._markAsDirty()}return this.isTextHighlightOn&&(this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,this.isTextHighlightOn=!1),i&&(i.ctrlKey||i.metaKey)&&(this._cursorOffset=this._textWrapper.length,i.preventDefault()),this._blinkIsEven=!1,this.isTextHighlightOn=!1,this._cursorIndex=-1,void this._markAsDirty();case 39:if(this._cursorOffset--,this._cursorOffset<0&&(this._cursorOffset=0),i&&i.shiftKey){if(this._blinkIsEven=!1,i.ctrlKey||i.metaKey){if(!this.isTextHighlightOn){if(0===this._cursorOffset)return;this._startHighlightIndex=this._textWrapper.length-this._cursorOffset-1}return this._endHighlightIndex=this._textWrapper.length,this.isTextHighlightOn=!0,this._cursorIndex=this._textWrapper.length-this._startHighlightIndex,this._cursorOffset=0,void this._markAsDirty()}return this.isTextHighlightOn?-1===this._cursorIndex&&(this._cursorIndex=this._textWrapper.length-this._startHighlightIndex,this._cursorOffset=this._textWrapper.length===this._endHighlightIndex?0:this._textWrapper.length-this._endHighlightIndex-1):(this.isTextHighlightOn=!0,this._cursorIndex=this._cursorOffset<=0?0:this._cursorOffset+1),this._cursorIndex<this._cursorOffset?(this._endHighlightIndex=this._textWrapper.length-this._cursorIndex,this._startHighlightIndex=this._textWrapper.length-this._cursorOffset):this._cursorIndex>this._cursorOffset?(this._endHighlightIndex=this._textWrapper.length-this._cursorOffset,this._startHighlightIndex=this._textWrapper.length-this._cursorIndex):this.isTextHighlightOn=!1,void this._markAsDirty()}return this.isTextHighlightOn&&(this._cursorOffset=this._textWrapper.length-this._endHighlightIndex,this.isTextHighlightOn=!1),i&&(i.ctrlKey||i.metaKey)&&(this._cursorOffset=0,i.preventDefault()),this._blinkIsEven=!1,this.isTextHighlightOn=!1,this._cursorIndex=-1,void this._markAsDirty()}if(32===e&&(t=null!==(r=null==i?void 0:i.key)&&void 0!==r?r:" "),this._deadKey="Dead"===t,t&&(-1===e||32===e||34===e||39===e||e>47&&e<64||e>64&&e<91||e>159&&e<193||e>218&&e<223||e>95&&e<112)&&(this._currentKey=t,this.onBeforeKeyAddObservable.notifyObservers(this),t=this._currentKey,this._addKey&&!this._deadKey))if(this.isTextHighlightOn)this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex,t),this._textHasChanged(),this._cursorOffset=this._textWrapper.length-(this._startHighlightIndex+1),this.isTextHighlightOn=!1,this._blinkIsEven=!1,this._markAsDirty();else if(0===this._cursorOffset)this.text+=this._deadKey&&(null==i?void 0:i.key)?i.key:t;else{var o=this._textWrapper.length-this._cursorOffset;this._textWrapper.removePart(o,o,t),this._textHasChanged()}}},t.prototype._updateValueFromCursorIndex=function(e){if(this._blinkIsEven=!1,-1===this._cursorIndex)this._cursorIndex=e;else if(this._cursorIndex<this._cursorOffset)this._endHighlightIndex=this._textWrapper.length-this._cursorIndex,this._startHighlightIndex=this._textWrapper.length-this._cursorOffset;else{if(!(this._cursorIndex>this._cursorOffset))return this.isTextHighlightOn=!1,void this._markAsDirty();this._endHighlightIndex=this._textWrapper.length-this._cursorOffset,this._startHighlightIndex=this._textWrapper.length-this._cursorIndex}this.isTextHighlightOn=!0,this._markAsDirty()},t.prototype._processDblClick=function(e){var t,i;this._startHighlightIndex=this._textWrapper.length-this._cursorOffset,this._endHighlightIndex=this._startHighlightIndex;do{i=this._endHighlightIndex<this._textWrapper.length&&this._textWrapper.isWord(this._endHighlightIndex)?++this._endHighlightIndex:0,t=this._startHighlightIndex>0&&this._textWrapper.isWord(this._startHighlightIndex-1)?--this._startHighlightIndex:0}while(t||i);this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,this.isTextHighlightOn=!0,this._clickedCoordinate=null,this._blinkIsEven=!0,this._cursorIndex=-1,this._markAsDirty()},t.prototype._selectAllText=function(){this._blinkIsEven=!0,this.isTextHighlightOn=!0,this._startHighlightIndex=0,this._endHighlightIndex=this._textWrapper.length,this._cursorOffset=this._textWrapper.length,this._cursorIndex=-1,this._markAsDirty()},t.prototype.processKeyboard=function(t){this.processKey(t.keyCode,t.key,t),e.prototype.processKeyboard.call(this,t)},t.prototype._onCopyText=function(e){this.isTextHighlightOn=!1;try{e.clipboardData&&e.clipboardData.setData("text/plain",this._highlightedText)}catch(e){}this._host.clipboardData=this._highlightedText},t.prototype._onCutText=function(e){if(this._highlightedText){this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex),this._textHasChanged(),this.isTextHighlightOn=!1,this._cursorOffset=this._textWrapper.length-this._startHighlightIndex;try{e.clipboardData&&e.clipboardData.setData("text/plain",this._highlightedText)}catch(e){}this._host.clipboardData=this._highlightedText,this._highlightedText=""}},t.prototype._onPasteText=function(e){var t;t=e.clipboardData&&-1!==e.clipboardData.types.indexOf("text/plain")?e.clipboardData.getData("text/plain"):this._host.clipboardData;var i=this._textWrapper.length-this._cursorOffset;this._textWrapper.removePart(i,i,t),this._textHasChanged()},t.prototype._draw=function(e){var t,i=this;e.save(),this._applyStates(e),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),this._isFocused?this._focusedBackground&&(e.fillStyle=this._isEnabled?this._focusedBackground:this._disabledColor,e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)):this._background&&(e.fillStyle=this._isEnabled?this._background:this._disabledColor,e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),this._fontOffset&&!this._wasDirty||(this._fontOffset=o.Control._GetFontOffset(e.font,null===(t=this._host.getScene())||void 0===t?void 0:t.getEngine()));var r=this._currentMeasure.left+this._margin.getValueInPixel(this._host,this._tempParentMeasure.width);this.color&&(e.fillStyle=this.color);var n=this._beforeRenderText(this._textWrapper);this._isFocused||this._textWrapper.text||!this._placeholderText||((n=new s.TextWrapper).text=this._placeholderText,this._placeholderColor&&(e.fillStyle=this._placeholderColor)),this._textWidth=e.measureText(n.text).width;var a=2*this._margin.getValueInPixel(this._host,this._tempParentMeasure.width);this._autoStretchWidth&&(this.width=Math.min(this._maxWidth.getValueInPixel(this._host,this._tempParentMeasure.width),this._textWidth+a)+"px",this._autoStretchWidth=!0);var l=this._fontOffset.ascent+(this._currentMeasure.height-this._fontOffset.height)/2,c=this._width.getValueInPixel(this._host,this._tempParentMeasure.width)-a;if(e.save(),e.beginPath(),e.rect(r,this._currentMeasure.top+(this._currentMeasure.height-this._fontOffset.height)/2,c+2,this._currentMeasure.height),e.clip(),this._isFocused&&this._textWidth>c){var u=r-this._textWidth+c;this._scrollLeft||(this._scrollLeft=u)}else this._scrollLeft=r;if(this.outlineWidth&&e.strokeText(n.text,this._scrollLeft,this._currentMeasure.top+l),e.fillText(n.text,this._scrollLeft,this._currentMeasure.top+l),this._isFocused){if(this._clickedCoordinate){var h=this._scrollLeft+this._textWidth-this._clickedCoordinate,d=0;this._cursorOffset=0;var _=0;do{this._cursorOffset&&(_=Math.abs(h-d)),this._cursorOffset++,d=e.measureText(n.substr(n.length-this._cursorOffset,this._cursorOffset)).width}while(d<h&&n.length>=this._cursorOffset);Math.abs(h-d)>_&&this._cursorOffset--,this._blinkIsEven=!1,this._clickedCoordinate=null}if(!this._blinkIsEven){var f=n.substr(n.length-this._cursorOffset),p=e.measureText(f).width,m=this._scrollLeft+this._textWidth-p;m<r?(this._scrollLeft+=r-m,m=r,this._markAsDirty()):m>r+c&&(this._scrollLeft+=r+c-m,m=r+c,this._markAsDirty()),this.isTextHighlightOn||e.fillRect(m,this._currentMeasure.top+(this._currentMeasure.height-this._fontOffset.height)/2,2,this._fontOffset.height)}if(clearTimeout(this._blinkTimeout),this._blinkTimeout=setTimeout((function(){i._blinkIsEven=!i._blinkIsEven,i._markAsDirty()}),500),this.isTextHighlightOn){clearTimeout(this._blinkTimeout);var g=e.measureText(n.substring(this._startHighlightIndex)).width,v=this._scrollLeft+this._textWidth-g;this._highlightedText=n.substring(this._startHighlightIndex,this._endHighlightIndex);var b=e.measureText(n.substring(this._startHighlightIndex,this._endHighlightIndex)).width;v<r&&((b-=r-v)||(b=e.measureText(n.charAt(n.length-this._cursorOffset)).width),v=r),e.globalAlpha=this._highligherOpacity,e.fillStyle=this._textHighlightColor,e.fillRect(v,this._currentMeasure.top+(this._currentMeasure.height-this._fontOffset.height)/2,b,this._fontOffset.height),e.globalAlpha=1}}e.restore(),this._thickness&&(this._isFocused?this.focusedColor&&(e.strokeStyle=this.focusedColor):this.color&&(e.strokeStyle=this.color),e.lineWidth=this._thickness,e.strokeRect(this._currentMeasure.left+this._thickness/2,this._currentMeasure.top+this._thickness/2,this._currentMeasure.width-this._thickness,this._currentMeasure.height-this._thickness)),e.restore()},t.prototype._onPointerDown=function(t,i,r,n,o){return!(!e.prototype._onPointerDown.call(this,t,i,r,n,o)||!this.isReadOnly&&(this._clickedCoordinate=i.x,this.isTextHighlightOn=!1,this._highlightedText="",this._cursorIndex=-1,this._isPointerDown=!0,this._host._capturingControl[r]=this,this._focusedBy=o.event.pointerType,this._host.focusedControl===this?(clearTimeout(this._blinkTimeout),this._markAsDirty(),0):!this._isEnabled||(this._host.focusedControl=this,0)))},t.prototype._onPointerMove=function(t,i,r,n){this._host.focusedControl===this&&this._isPointerDown&&!this.isReadOnly&&(this._clickedCoordinate=i.x,this._markAsDirty(),this._updateValueFromCursorIndex(this._cursorOffset)),e.prototype._onPointerMove.call(this,t,i,r,n)},t.prototype._onPointerUp=function(t,i,r,n,o){this._isPointerDown=!1,delete this._host._capturingControl[r],e.prototype._onPointerUp.call(this,t,i,r,n,o)},t.prototype._beforeRenderText=function(e){return e},Object.defineProperty(t.prototype,"isTextHighlightOn",{get:function(){return this._isTextHighlightOn},set:function(e){this._isTextHighlightOn!==e&&(e&&this.onTextHighlightObservable.notifyObservers(this),this._isTextHighlightOn=e)},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onBlurObservable.clear(),this.onFocusObservable.clear(),this.onTextChangedObservable.clear(),this.onTextCopyObservable.clear(),this.onTextCutObservable.clear(),this.onTextPasteObservable.clear(),this.onTextHighlightObservable.clear(),this.onKeyboardEventProcessedObservable.clear()},(0,r.__decorate)([(0,n.serialize)()],t.prototype,"promptMessage",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"disableMobilePrompt",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"maxWidth",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"highligherOpacity",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"onFocusSelectAll",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"textHighlightColor",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"margin",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"autoStretchWidth",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"thickness",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"focusedBackground",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"background",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"placeholderColor",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"placeholderText",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"deadKey",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"text",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"width",null),t}(o.Control);(0,n.RegisterClass)("BABYLON.GUI.InputText",l)},"../../../dev/gui/src/2D/controls/inputTextArea.ts":(e,t,i)=>{i.r(t),i.d(t,{InputTextArea:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/2D/controls/control.ts"),a=i("../../../dev/gui/src/2D/valueAndUnit.ts"),s=function(e){function t(t,i){void 0===i&&(i="");var r=e.call(this,t)||this;return r.name=t,r._textHorizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_LEFT,r._textVerticalAlignment=o.Control.VERTICAL_ALIGNMENT_TOP,r._prevText=r.text,r._lineSpacing=new a.ValueAndUnit(0),r._maxHeight=new a.ValueAndUnit(1,a.ValueAndUnit.UNITMODE_PERCENTAGE,!1),r.onLinesReadyObservable=new n.Observable,r.text=i,r.isPointerBlocker=!0,r.onLinesReadyObservable.add((function(){return r._updateCursorPosition()})),r._highlightCursorInfo={initialStartIndex:-1,initialRelativeStartIndex:-1,initialLineIndex:-1},r._cursorInfo={globalStartIndex:0,globalEndIndex:0,relativeEndIndex:0,relativeStartIndex:0,currentLineIndex:0},r}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"autoStretchHeight",{get:function(){return this._autoStretchHeight},set:function(e){this._autoStretchHeight!==e&&(this._autoStretchHeight=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{set:function(e){this.fixedRatioMasterIsWidth=!1,this._height.toString(this._host)!==e&&(this._height.fromString(e)&&this._markAsDirty(),this._autoStretchHeight=!1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){return this._maxHeight.toString(this._host)},set:function(e){this._maxHeight.toString(this._host)!==e&&this._maxHeight.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxHeightInPixels",{get:function(){return this._maxHeight.getValueInPixel(this._host,this._cachedParentMeasure.height)},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"InputTextArea"},t.prototype.processKeyboard=function(e){this.isReadOnly||(this.alternativeProcessKey(e.code,e.key,e),this.onKeyboardEventProcessedObservable.notifyObservers(e))},t.prototype.alternativeProcessKey=function(e,t,i){if(!i||!i.ctrlKey&&!i.metaKey||"c"!==t&&"v"!==t&&"x"!==t){switch(e){case"Period":i&&i.shiftKey&&i.preventDefault();break;case"Backspace":!this._isTextHighlightOn&&this._cursorInfo.globalStartIndex>0&&(this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._cursorInfo.globalStartIndex--),this._prevText=this._textWrapper.text,this._textWrapper.removePart(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex),this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,i&&i.preventDefault(),this._blinkIsEven=!1,this._isTextHighlightOn=!1,this._textHasChanged();break;case"Delete":!this._isTextHighlightOn&&this._cursorInfo.globalEndIndex<this.text.length&&(this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex+1),this._prevText=this._textWrapper.text,this._textWrapper.removePart(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex),this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,i&&i.preventDefault(),this._blinkIsEven=!1,this._isTextHighlightOn=!1,this._textHasChanged();break;case"NumpadEnter":case"Enter":return this._prevText=this._textWrapper.text,this._textWrapper.removePart(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex,"\n"),this._cursorInfo.globalStartIndex++,this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._blinkIsEven=!1,this._isTextHighlightOn=!1,void this._textHasChanged();case"End":return this._cursorInfo.globalStartIndex=this.text.length,this._blinkIsEven=!1,this._isTextHighlightOn=!1,void this._markAsDirty();case"Home":return this._cursorInfo.globalStartIndex=0,this._blinkIsEven=!1,this._isTextHighlightOn=!1,void this._markAsDirty();case"ArrowLeft":return this._markAsDirty(),i&&i.shiftKey?((i.ctrlKey||i.metaKey)&&(this._cursorInfo.globalStartIndex-=this._cursorInfo.relativeStartIndex,this._cursorInfo.globalEndIndex=this._highlightCursorInfo.initialStartIndex),this._isTextHighlightOn?this._cursorInfo.globalEndIndex>this._highlightCursorInfo.initialStartIndex?this._cursorInfo.globalEndIndex--:this._cursorInfo.globalStartIndex--:(this._highlightCursorInfo.initialLineIndex=this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialStartIndex=this._cursorInfo.globalStartIndex,this._highlightCursorInfo.initialRelativeStartIndex=this._cursorInfo.relativeStartIndex,this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._cursorInfo.globalStartIndex--,this._isTextHighlightOn=!0),this._blinkIsEven=!0,void i.preventDefault()):(this._isTextHighlightOn?this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex:i&&(i.ctrlKey||i.metaKey)?(this._cursorInfo.globalStartIndex-=this._cursorInfo.relativeStartIndex,i.preventDefault()):this._cursorInfo.globalStartIndex>0&&this._cursorInfo.globalStartIndex--,this._blinkIsEven=!1,void(this._isTextHighlightOn=!1));case"ArrowRight":if(this._markAsDirty(),i&&i.shiftKey){if(i.ctrlKey||i.metaKey){var r=this._lines[this._cursorInfo.currentLineIndex].text.length-this._cursorInfo.relativeEndIndex-1;this._cursorInfo.globalEndIndex+=r,this._cursorInfo.globalStartIndex=this._highlightCursorInfo.initialStartIndex}return this._isTextHighlightOn?this._cursorInfo.globalStartIndex<this._highlightCursorInfo.initialStartIndex?this._cursorInfo.globalStartIndex++:this._cursorInfo.globalEndIndex++:(this._highlightCursorInfo.initialLineIndex=this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialStartIndex=this._cursorInfo.globalStartIndex,this._highlightCursorInfo.initialRelativeStartIndex=this._cursorInfo.relativeStartIndex,this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex++,this._isTextHighlightOn=!0),this._blinkIsEven=!0,void i.preventDefault()}return this._isTextHighlightOn?this._cursorInfo.globalStartIndex=this._cursorInfo.globalEndIndex:i&&(i.ctrlKey||i.metaKey)?(r=this._lines[this._cursorInfo.currentLineIndex].text.length-this._cursorInfo.relativeEndIndex,this._cursorInfo.globalStartIndex+=r):this._cursorInfo.globalStartIndex<this.text.length&&this._cursorInfo.globalStartIndex++,this._blinkIsEven=!1,void(this._isTextHighlightOn=!1);case"ArrowUp":if(this._blinkIsEven=!1,i&&(i.shiftKey?(this._isTextHighlightOn||(this._highlightCursorInfo.initialLineIndex=this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialStartIndex=this._cursorInfo.globalStartIndex,this._highlightCursorInfo.initialRelativeStartIndex=this._cursorInfo.relativeStartIndex),this._isTextHighlightOn=!0,this._blinkIsEven=!0):this._isTextHighlightOn=!1,i.preventDefault()),0===this._cursorInfo.currentLineIndex)this._cursorInfo.globalStartIndex=0;else{var n=this._lines[this._cursorInfo.currentLineIndex],o=this._lines[this._cursorInfo.currentLineIndex-1],a=0,s=0;!this._isTextHighlightOn||this._cursorInfo.currentLineIndex<this._highlightCursorInfo.initialLineIndex?(a=this._cursorInfo.globalStartIndex,s=this._cursorInfo.relativeStartIndex):(a=this._cursorInfo.globalEndIndex,s=this._cursorInfo.relativeEndIndex);var l=n.text.substr(0,s),c=this._contextForBreakLines.measureText(l).width,u=0,h=0;a-=s,a-=o.text.length+o.lineEnding.length;for(var d=0;u<c&&d<o.text.length;)a++,d++,h=Math.abs(c-u),u=this._contextForBreakLines.measureText(o.text.substr(0,d)).width;Math.abs(c-u)>h&&d>0&&a--,this._isTextHighlightOn?this._cursorInfo.currentLineIndex<=this._highlightCursorInfo.initialLineIndex?(this._cursorInfo.globalStartIndex=a,this._cursorInfo.globalEndIndex=this._highlightCursorInfo.initialStartIndex,this._cursorInfo.relativeEndIndex=this._highlightCursorInfo.initialRelativeStartIndex):this._cursorInfo.globalEndIndex=a:this._cursorInfo.globalStartIndex=a}return void this._markAsDirty();case"ArrowDown":if(this._blinkIsEven=!1,i&&(i.shiftKey?(this._isTextHighlightOn||(this._highlightCursorInfo.initialLineIndex=this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialStartIndex=this._cursorInfo.globalStartIndex,this._highlightCursorInfo.initialRelativeStartIndex=this._cursorInfo.relativeStartIndex),this._isTextHighlightOn=!0,this._blinkIsEven=!0):this._isTextHighlightOn=!1,i.preventDefault()),this._cursorInfo.currentLineIndex===this._lines.length-1)this._cursorInfo.globalStartIndex=this.text.length;else{n=this._lines[this._cursorInfo.currentLineIndex];var _=this._lines[this._cursorInfo.currentLineIndex+1];a=0,s=0,!this._isTextHighlightOn||this._cursorInfo.currentLineIndex<this._highlightCursorInfo.initialLineIndex?(a=this._cursorInfo.globalStartIndex,s=this._cursorInfo.relativeStartIndex):(a=this._cursorInfo.globalEndIndex,s=this._cursorInfo.relativeEndIndex),l=n.text.substr(0,s),c=this._contextForBreakLines.measureText(l).width;var f=0;h=0,a+=n.text.length-s+n.lineEnding.length;for(var p=0;f<c&&p<_.text.length;)a++,p++,h=Math.abs(c-f),f=this._contextForBreakLines.measureText(_.text.substr(0,p)).width;Math.abs(c-f)>h&&p>0&&a--,this._isTextHighlightOn?this._cursorInfo.currentLineIndex<this._highlightCursorInfo.initialLineIndex?(this._cursorInfo.globalStartIndex=a,this._cursorInfo.globalStartIndex>this._cursorInfo.globalEndIndex&&(this._cursorInfo.globalEndIndex+=this._cursorInfo.globalStartIndex,this._cursorInfo.globalStartIndex=this._cursorInfo.globalEndIndex-this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex-=this._cursorInfo.globalStartIndex)):(this._cursorInfo.globalEndIndex=a,this._cursorInfo.globalStartIndex=this._highlightCursorInfo.initialStartIndex):this._cursorInfo.globalStartIndex=a}return void this._markAsDirty()}if("a"===t&&i&&(i.ctrlKey||i.metaKey))return this._selectAllText(),void i.preventDefault();1===(null==t?void 0:t.length)&&(null==i||i.preventDefault(),this._currentKey=t,this.onBeforeKeyAddObservable.notifyObservers(this),t=this._currentKey,this._addKey&&(this._isTextHighlightOn=!1,this._blinkIsEven=!1,this._prevText=this._textWrapper.text,this._textWrapper.removePart(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex,t),this._cursorInfo.globalStartIndex+=t.length,this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._textHasChanged()))}},t.prototype._parseLineWordWrap=function(e,t,i){void 0===e&&(e="");for(var r=[],n=e.split(" "),o=0,a=function(a){var s=a>0?e+" "+n[a]:n[0],l=i.measureText(s).width;if(l>t){a>0&&(o=i.measureText(e).width,r.push({text:e,width:o,lineEnding:" "})),e=n[a];var c="";e.split("").map((function(e){i.measureText(c+e).width>t&&(r.push({text:c,width:i.measureText(c).width,lineEnding:""}),c=""),c+=e})),e=c,o=i.measureText(e).width}else o=l,e=s},s=0;s<n.length;s++)a(s);return r.push({text:e,width:o,lineEnding:" "}),r},t.prototype._breakLines=function(e,t){var i=[],r=(this.text||this.placeholderText).split("\n");if(this.clipContent)for(var n=0,o=r;n<o.length;n++){var a=o[n];i.push.apply(i,this._parseLineWordWrap(a,e,t))}else for(var s=0,l=r;s<l.length;s++)a=l[s],i.push(this._parseLine(a,t));return i[i.length-1].lineEnding="\n",i},t.prototype._parseLine=function(e,t){return void 0===e&&(e=""),{text:e,width:t.measureText(e).width,lineEnding:" "}},t.prototype._preMeasure=function(e,t){var i;this._fontOffset&&!this._wasDirty||(this._fontOffset=o.Control._GetFontOffset(t.font,null===(i=this._host.getScene())||void 0===i?void 0:i.getEngine()));var r=this._beforeRenderText(this._textWrapper).text;!this.text&&this._placeholderText&&(r=this._placeholderText),this._textWidth=t.measureText(r).width;var n=2*this._margin.getValueInPixel(this._host,e.width);if(this._autoStretchWidth){var a=r.split("\n").reduce((function(e,i){return t.measureText(i).width>t.measureText(e).width?i:e}),""),s=t.measureText(a).width;this.width=Math.min(this._maxWidth.getValueInPixel(this._host,e.width),s+n)+"px",this.autoStretchWidth=!0}if(this._availableWidth=this._width.getValueInPixel(this._host,e.width)-n,this._lines=this._breakLines(this._availableWidth,t),this._contextForBreakLines=t,this._autoStretchHeight){var l=this._lines.length*this._fontOffset.height+2*this._margin.getValueInPixel(this._host,e.height);this.height=Math.min(this._maxHeight.getValueInPixel(this._host,e.height),l)+"px",this._autoStretchHeight=!0}if(this._availableHeight=this._height.getValueInPixel(this._host,e.height)-n,this._isFocused){this._cursorInfo.currentLineIndex=0;for(var c=this._lines[this._cursorInfo.currentLineIndex].text.length+this._lines[this._cursorInfo.currentLineIndex].lineEnding.length,u=0;u+c<=this._cursorInfo.globalStartIndex;)u+=c,this._cursorInfo.currentLineIndex<this._lines.length-1&&(this._cursorInfo.currentLineIndex++,c=this._lines[this._cursorInfo.currentLineIndex].text.length+this._lines[this._cursorInfo.currentLineIndex].lineEnding.length)}},t.prototype._textHasChanged=function(){!this._prevText&&this._textWrapper.text&&this.placeholderText&&(this._cursorInfo.currentLineIndex=0,this._cursorInfo.globalStartIndex=1,this._cursorInfo.globalEndIndex=1,this._cursorInfo.relativeStartIndex=1,this._cursorInfo.relativeEndIndex=1),e.prototype._textHasChanged.call(this)},t.prototype._computeScroll=function(){if(this._clipTextLeft=this._currentMeasure.left+this._margin.getValueInPixel(this._host,this._cachedParentMeasure.width),this._clipTextTop=this._currentMeasure.top+this._margin.getValueInPixel(this._host,this._cachedParentMeasure.height),this._isFocused&&this._lines[this._cursorInfo.currentLineIndex].width>this._availableWidth){var e=this._clipTextLeft-this._lines[this._cursorInfo.currentLineIndex].width+this._availableWidth;this._scrollLeft||(this._scrollLeft=e)}else this._scrollLeft=this._clipTextLeft;if(this._isFocused){var t=(this._cursorInfo.currentLineIndex+1)*this._fontOffset.height,i=this._clipTextTop-t;this._scrollTop||(this._scrollTop=i)}else this._scrollTop=this._clipTextTop},t.prototype._additionalProcessing=function(){this.highlightedText="",this.onLinesReadyObservable.notifyObservers(this)},t.prototype._drawText=function(e,t,i,r){var n=this._currentMeasure.width,a=this._scrollLeft;switch(this._textHorizontalAlignment){case o.Control.HORIZONTAL_ALIGNMENT_LEFT:a+=0;break;case o.Control.HORIZONTAL_ALIGNMENT_RIGHT:a+=n-t;break;case o.Control.HORIZONTAL_ALIGNMENT_CENTER:a+=(n-t)/2}(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(r.shadowColor=this.shadowColor,r.shadowBlur=this.shadowBlur,r.shadowOffsetX=this.shadowOffsetX,r.shadowOffsetY=this.shadowOffsetY),this.outlineWidth&&r.strokeText(e,this._currentMeasure.left+a,i),r.fillText(e,a,i)},t.prototype._onCopyText=function(e){this._isTextHighlightOn=!1;try{e.clipboardData&&e.clipboardData.setData("text/plain",this._highlightedText)}catch(e){}this._host.clipboardData=this._highlightedText},t.prototype._onCutText=function(e){if(this._highlightedText){try{e.clipboardData&&e.clipboardData.setData("text/plain",this._highlightedText)}catch(e){}this._host.clipboardData=this._highlightedText,this._prevText=this._textWrapper.text,this._textWrapper.removePart(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex),this._textHasChanged()}},t.prototype._onPasteText=function(t){var i;i=t.clipboardData&&-1!==t.clipboardData.types.indexOf("text/plain")?t.clipboardData.getData("text/plain"):this._host.clipboardData,this._isTextHighlightOn=!1,this._prevText=this._textWrapper.text,this._textWrapper.removePart(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex,i);var r=i.length-(this._cursorInfo.globalEndIndex-this._cursorInfo.globalStartIndex);this._cursorInfo.globalStartIndex+=r,this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._clickedCoordinateX=null,this._clickedCoordinateY=null,e.prototype._textHasChanged.call(this)},t.prototype._draw=function(e){var t,i;this._computeScroll(),this._scrollLeft=null!==(t=this._scrollLeft)&&void 0!==t?t:0,this._scrollTop=null!==(i=this._scrollTop)&&void 0!==i?i:0,e.save(),this._applyStates(e),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),this._isFocused?this._focusedBackground&&(e.fillStyle=this._isEnabled?this._focusedBackground:this._disabledColor,e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)):this._background&&(e.fillStyle=this._isEnabled?this._background:this._disabledColor,e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),this.color&&(e.fillStyle=this.color);var r=this._currentMeasure.height,n=this._currentMeasure.width,a=0;switch(this._textVerticalAlignment){case o.Control.VERTICAL_ALIGNMENT_TOP:a=this._fontOffset.ascent;break;case o.Control.VERTICAL_ALIGNMENT_BOTTOM:a=r-this._fontOffset.height*(this._lines.length-1)-this._fontOffset.descent;break;case o.Control.VERTICAL_ALIGNMENT_CENTER:a=this._fontOffset.ascent+(r-this._fontOffset.height*this._lines.length)/2}e.save(),e.beginPath(),e.fillStyle=this.fontStyle,!this._textWrapper.text&&this.placeholderText&&(e.fillStyle=this._placeholderColor),e.rect(this._clipTextLeft,this._clipTextTop,this._availableWidth+2,this._availableHeight+2),e.clip(),a+=this._scrollTop;for(var s=0;s<this._lines.length;s++){var l=this._lines[s];0!==s&&0!==this._lineSpacing.internalValue&&(this._lineSpacing.isPixel?a+=this._lineSpacing.getValue(this._host):a+=this._lineSpacing.getValue(this._host)*this._height.getValueInPixel(this._host,this._cachedParentMeasure.height)),this._drawText(l.text,l.width,a,e),a+=this._fontOffset.height}if(e.restore(),this._isFocused){if(!this._blinkIsEven||this._isTextHighlightOn){var c=this._scrollLeft+e.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0,this._cursorInfo.relativeStartIndex)).width;c<this._clipTextLeft?(this._scrollLeft+=this._clipTextLeft-c,c=this._clipTextLeft,this._markAsDirty()):c>this._clipTextLeft+this._availableWidth&&(this._scrollLeft+=this._clipTextLeft+this._availableWidth-c,c=this._clipTextLeft+this._availableWidth,this._markAsDirty());var u=this._scrollTop+this._cursorInfo.currentLineIndex*this._fontOffset.height;u<this._clipTextTop?(this._scrollTop+=this._clipTextTop-u,u=this._clipTextTop,this._markAsDirty()):u+this._fontOffset.height>this._clipTextTop+this._availableHeight&&this._availableHeight>this._fontOffset.height&&(this._scrollTop+=this._clipTextTop+this._availableHeight-u-this._fontOffset.height,u=this._clipTextTop+this._availableHeight-this._fontOffset.height,this._markAsDirty()),this._isTextHighlightOn||e.fillRect(c,u,2,this._fontOffset.height)}if(this._resetBlinking(),this._isTextHighlightOn){clearTimeout(this._blinkTimeout),this._highlightedText=this.text.substring(this._cursorInfo.globalStartIndex,this._cursorInfo.globalEndIndex),e.globalAlpha=this._highligherOpacity,e.fillStyle=this._textHighlightColor;var h=Math.min(this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialLineIndex),d=Math.max(this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialLineIndex),_=this._scrollTop+h*this._fontOffset.height;for(s=h;s<=d;s++){l=this._lines[s];var f=this._scrollLeft;switch(this._textHorizontalAlignment){case o.Control.HORIZONTAL_ALIGNMENT_LEFT:f+=0;break;case o.Control.HORIZONTAL_ALIGNMENT_RIGHT:f+=n-l.width;break;case o.Control.HORIZONTAL_ALIGNMENT_CENTER:f+=(n-l.width)/2}var p=s===h?this._cursorInfo.relativeStartIndex:0,m=s===d?this._cursorInfo.relativeEndIndex:l.text.length,g=e.measureText(l.text.substr(0,p)).width,v=l.text.substring(p,m),b=e.measureText(v).width;e.fillRect(f+g,_,b,this._fontOffset.height),_+=this._fontOffset.height}this._cursorInfo.globalEndIndex===this._cursorInfo.globalStartIndex&&this._resetBlinking()}}e.restore(),this._thickness&&(this._isFocused?this.focusedColor&&(e.strokeStyle=this.focusedColor):this.color&&(e.strokeStyle=this.color),e.lineWidth=this._thickness,e.strokeRect(this._currentMeasure.left+this._thickness/2,this._currentMeasure.top+this._thickness/2,this._currentMeasure.width-this._thickness,this._currentMeasure.height-this._thickness))},t.prototype._resetBlinking=function(){var e=this;clearTimeout(this._blinkTimeout),this._blinkTimeout=setTimeout((function(){e._blinkIsEven=!e._blinkIsEven,e._markAsDirty()}),500)},t.prototype._onPointerDown=function(t,i,r,n,o){return!(!e.prototype._onPointerDown.call(this,t,i,r,n,o)||!this.isReadOnly&&(this._clickedCoordinateX=i.x,this._clickedCoordinateY=i.y,this._isTextHighlightOn=!1,this._highlightedText="",this._isPointerDown=!0,this._host._capturingControl[r]=this,this._host.focusedControl===this?(clearTimeout(this._blinkTimeout),this._markAsDirty(),0):!this._isEnabled||(this._host.focusedControl=this,0)))},t.prototype._onPointerMove=function(t,i,r,n){0===n.event.movementX&&0===n.event.movementY||(this._host.focusedControl===this&&this._isPointerDown&&!this.isReadOnly&&(this._clickedCoordinateX=i.x,this._clickedCoordinateY=i.y,this._isTextHighlightOn||(this._highlightCursorInfo.initialLineIndex=this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialStartIndex=this._cursorInfo.globalStartIndex,this._highlightCursorInfo.initialRelativeStartIndex=this._cursorInfo.relativeStartIndex,this._isTextHighlightOn=!0),this._markAsDirty()),e.prototype._onPointerMove.call(this,t,i,r,n))},t.prototype._updateCursorPosition=function(){var e;if(this._isFocused)if(!this._textWrapper.text&&this.placeholderText)this._cursorInfo.currentLineIndex=0,this._cursorInfo.globalStartIndex=0,this._cursorInfo.globalEndIndex=0,this._cursorInfo.relativeStartIndex=0,this._cursorInfo.relativeEndIndex=0;else if(this._clickedCoordinateX&&this._clickedCoordinateY){this._isTextHighlightOn||(this._cursorInfo={globalStartIndex:0,globalEndIndex:0,relativeStartIndex:0,relativeEndIndex:0,currentLineIndex:0});var t=0,i=0,r=this._clickedCoordinateY-this._scrollTop,n=Math.floor(r/this._fontOffset.height);this._cursorInfo.currentLineIndex=Math.min(Math.max(n,0),this._lines.length-1);for(var o=0,a=this._clickedCoordinateX-(null!==(e=this._scrollLeft)&&void 0!==e?e:0),s=0,l=0;l<this._cursorInfo.currentLineIndex;l++){var c=this._lines[l];t+=c.text.length+c.lineEnding.length}for(;o<a&&this._lines[this._cursorInfo.currentLineIndex].text.length>i;)i++,s=Math.abs(a-o),o=this._contextForBreakLines.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0,i)).width;Math.abs(a-o)>s&&i>0&&i--,t+=i,this._isTextHighlightOn?t<this._highlightCursorInfo.initialStartIndex?(this._cursorInfo.globalStartIndex=t,this._cursorInfo.relativeStartIndex=i,this._cursorInfo.globalEndIndex=this._highlightCursorInfo.initialStartIndex,this._cursorInfo.relativeEndIndex=this._highlightCursorInfo.initialRelativeStartIndex):(this._cursorInfo.globalStartIndex=this._highlightCursorInfo.initialStartIndex,this._cursorInfo.relativeStartIndex=this._highlightCursorInfo.initialRelativeStartIndex,this._cursorInfo.globalEndIndex=t,this._cursorInfo.relativeEndIndex=i):(this._cursorInfo.globalStartIndex=t,this._cursorInfo.relativeStartIndex=i,this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex,this._cursorInfo.relativeEndIndex=this._cursorInfo.relativeStartIndex),this._blinkIsEven=this._isTextHighlightOn,this._clickedCoordinateX=null,this._clickedCoordinateY=null}else{this._cursorInfo.relativeStartIndex=0,this._cursorInfo.currentLineIndex=0;for(var u=this._lines[this._cursorInfo.currentLineIndex].text.length+this._lines[this._cursorInfo.currentLineIndex].lineEnding.length,h=0;h+u<=this._cursorInfo.globalStartIndex;)h+=u,this._cursorInfo.currentLineIndex<this._lines.length-1&&(this._cursorInfo.currentLineIndex++,u=this._lines[this._cursorInfo.currentLineIndex].text.length+this._lines[this._cursorInfo.currentLineIndex].lineEnding.length);if(this._cursorInfo.relativeStartIndex=this._cursorInfo.globalStartIndex-h,this._isTextHighlightOn){if(-1!==this._highlightCursorInfo.initialStartIndex&&this._cursorInfo.globalStartIndex>=this._highlightCursorInfo.initialStartIndex){for(;h+u<=this._cursorInfo.globalEndIndex;)h+=u,this._cursorInfo.currentLineIndex<this._lines.length-1&&(this._cursorInfo.currentLineIndex++,u=this._lines[this._cursorInfo.currentLineIndex].text.length+this._lines[this._cursorInfo.currentLineIndex].lineEnding.length);this._cursorInfo.relativeEndIndex=this._cursorInfo.globalEndIndex-h}}else this._cursorInfo.relativeEndIndex=this._cursorInfo.relativeStartIndex,this._cursorInfo.globalEndIndex=this._cursorInfo.globalStartIndex}},t.prototype._updateValueFromCursorIndex=function(e){},t.prototype._processDblClick=function(e){var t,i;do{t=this._cursorInfo.globalStartIndex>0&&this._textWrapper.isWord(this._cursorInfo.globalStartIndex-1)?--this._cursorInfo.globalStartIndex:0,i=this._cursorInfo.globalEndIndex<this._textWrapper.length&&this._textWrapper.isWord(this._cursorInfo.globalEndIndex)?++this._cursorInfo.globalEndIndex:0}while(t||i);this._highlightCursorInfo.initialLineIndex=this._cursorInfo.currentLineIndex,this._highlightCursorInfo.initialStartIndex=this._cursorInfo.globalStartIndex,this.onTextHighlightObservable.notifyObservers(this),this._isTextHighlightOn=!0,this._blinkIsEven=!0,this._markAsDirty()},t.prototype._selectAllText=function(){this._isTextHighlightOn=!0,this._blinkIsEven=!0,this._highlightCursorInfo={initialStartIndex:0,initialRelativeStartIndex:0,initialLineIndex:0},this._cursorInfo={globalStartIndex:0,globalEndIndex:this._textWrapper.length,relativeEndIndex:this._lines[this._lines.length-1].text.length,relativeStartIndex:0,currentLineIndex:this._lines.length-1},this._markAsDirty()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onLinesReadyObservable.clear()},(0,r.__decorate)([(0,n.serialize)()],t.prototype,"autoStretchHeight",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"maxHeight",null),t}(i("../../../dev/gui/src/2D/controls/inputText.ts").InputText);(0,n.RegisterClass)("BABYLON.GUI.InputTextArea",s)},"../../../dev/gui/src/2D/controls/line.ts":(e,t,i)=>{i.r(t),i.d(t,{Line:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/2D/controls/control.ts"),a=i("../../../dev/gui/src/2D/valueAndUnit.ts"),s=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._lineWidth=1,i._x1=new a.ValueAndUnit(0),i._y1=new a.ValueAndUnit(0),i._x2=new a.ValueAndUnit(0),i._y2=new a.ValueAndUnit(0),i._dash=new Array,i._automaticSize=!0,i.isHitTestVisible=!1,i._horizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_LEFT,i._verticalAlignment=o.Control.VERTICAL_ALIGNMENT_TOP,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"dash",{get:function(){return this._dash},set:function(e){this._dash!==e&&(this._dash=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectedControl",{get:function(){return this._connectedControl},set:function(e){var t=this;this._connectedControl!==e&&(this._connectedControlDirtyObserver&&this._connectedControl&&(this._connectedControl.onDirtyObservable.remove(this._connectedControlDirtyObserver),this._connectedControlDirtyObserver=null),e&&(this._connectedControlDirtyObserver=e.onDirtyObservable.add((function(){return t._markAsDirty()}))),this._connectedControl=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x1",{get:function(){return this._x1.toString(this._host)},set:function(e){this._x1.toString(this._host)!==e&&this._x1.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y1",{get:function(){return this._y1.toString(this._host)},set:function(e){this._y1.toString(this._host)!==e&&this._y1.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x2",{get:function(){return this._x2.toString(this._host)},set:function(e){this._x2.toString(this._host)!==e&&this._x2.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y2",{get:function(){return this._y2.toString(this._host)},set:function(e){this._y2.toString(this._host)!==e&&this._y2.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineWidth",{get:function(){return this._lineWidth},set:function(e){this._lineWidth!==e&&(this._lineWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalAlignment",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalAlignment",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_effectiveX2",{get:function(){return(this._connectedControl?this._connectedControl.centerX:0)+this._x2.getValue(this._host)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_effectiveY2",{get:function(){return(this._connectedControl?this._connectedControl.centerY:0)+this._y2.getValue(this._host)},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Line"},t.prototype._draw=function(e){e.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),this._applyStates(e),e.strokeStyle=this._getColor(e),e.lineWidth=this._lineWidth,e.setLineDash(this._dash),e.beginPath(),e.moveTo(this._cachedParentMeasure.left+this._x1.getValue(this._host),this._cachedParentMeasure.top+this._y1.getValue(this._host)),e.lineTo(this._cachedParentMeasure.left+this._effectiveX2,this._cachedParentMeasure.top+this._effectiveY2),e.stroke(),e.restore()},t.prototype._measure=function(){this._currentMeasure.width=Math.abs(this._x1.getValue(this._host)-this._effectiveX2)+this._lineWidth,this._currentMeasure.height=Math.abs(this._y1.getValue(this._host)-this._effectiveY2)+this._lineWidth},t.prototype._computeAlignment=function(e){this._currentMeasure.left=e.left+Math.min(this._x1.getValue(this._host),this._effectiveX2)-this._lineWidth/2,this._currentMeasure.top=e.top+Math.min(this._y1.getValue(this._host),this._effectiveY2)-this._lineWidth/2},t.prototype.moveToVector3=function(e,t,i){if(void 0===i&&(i=!1),this._host&&this.parent===this._host._rootContainer){var r=this._host._getGlobalViewport(),o=n.Vector3.Project(e,n.Matrix.IdentityReadOnly,t.getTransformMatrix(),r);this._moveToProjectedPosition(o,i),o.z<0||o.z>1?this.notRenderable=!0:this.notRenderable=!1}else n.Tools.Error("Cannot move a control to a vector3 if the control is not at root level")},t.prototype._moveToProjectedPosition=function(e,t){void 0===t&&(t=!1);var i=e.x+this._linkOffsetX.getValue(this._host)+"px",r=e.y+this._linkOffsetY.getValue(this._host)+"px";t?(this.x2=i,this.y2=r,this._x2.ignoreAdaptiveScaling=!0,this._y2.ignoreAdaptiveScaling=!0):(this.x1=i,this.y1=r,this._x1.ignoreAdaptiveScaling=!0,this._y1.ignoreAdaptiveScaling=!0)},(0,r.__decorate)([(0,n.serialize)()],t.prototype,"dash",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"x1",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"y1",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"x2",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"y2",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"lineWidth",null),t}(o.Control);(0,n.RegisterClass)("BABYLON.GUI.Line",s)},"../../../dev/gui/src/2D/controls/multiLine.ts":(e,t,i)=>{i.r(t),i.d(t,{MultiLine:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/2D/controls/control.ts"),a=i("../../../dev/gui/src/2D/multiLinePoint.ts"),s=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._lineWidth=1,i.onPointUpdate=function(){i._markAsDirty()},i._automaticSize=!0,i.isHitTestVisible=!1,i._horizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_LEFT,i._verticalAlignment=o.Control.VERTICAL_ALIGNMENT_TOP,i._dash=[],i._points=[],i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"dash",{get:function(){return this._dash},set:function(e){this._dash!==e&&(this._dash=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype.getAt=function(e){return this._points[e]||(this._points[e]=new a.MultiLinePoint(this)),this._points[e]},t.prototype.add=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return t.map((function(t){return e.push(t)}))},t.prototype.push=function(e){var t=this.getAt(this._points.length);return null==e||(e instanceof n.AbstractMesh?t.mesh=e:e instanceof o.Control?t.control=e:null!=e.x&&null!=e.y&&(t.x=e.x,t.y=e.y)),t},t.prototype.remove=function(e){var t;if(e instanceof a.MultiLinePoint){if(-1===(t=this._points.indexOf(e)))return}else t=e;var i=this._points[t];i&&(i.dispose(),this._points.splice(t,1))},t.prototype.reset=function(){for(;this._points.length>0;)this.remove(this._points.length-1)},t.prototype.resetLinks=function(){this._points.forEach((function(e){null!=e&&e.resetLinks()}))},Object.defineProperty(t.prototype,"lineWidth",{get:function(){return this._lineWidth},set:function(e){this._lineWidth!==e&&(this._lineWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalAlignment",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalAlignment",{set:function(e){},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"MultiLine"},t.prototype._draw=function(e){e.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),this._applyStates(e),e.strokeStyle=this.color,e.lineWidth=this._lineWidth,e.setLineDash(this._dash),e.beginPath();var t,i=!0;this._points.forEach((function(r){r&&(i?(e.moveTo(r._point.x,r._point.y),i=!1):r._point.z<1&&t.z<1?e.lineTo(r._point.x,r._point.y):e.moveTo(r._point.x,r._point.y),t=r._point)})),e.stroke(),e.restore()},t.prototype._additionalProcessing=function(){var e=this;this._minX=null,this._minY=null,this._maxX=null,this._maxY=null,this._points.forEach((function(t){t&&(t.translate(),(null==e._minX||t._point.x<e._minX)&&(e._minX=t._point.x),(null==e._minY||t._point.y<e._minY)&&(e._minY=t._point.y),(null==e._maxX||t._point.x>e._maxX)&&(e._maxX=t._point.x),(null==e._maxY||t._point.y>e._maxY)&&(e._maxY=t._point.y))})),null==this._minX&&(this._minX=0),null==this._minY&&(this._minY=0),null==this._maxX&&(this._maxX=0),null==this._maxY&&(this._maxY=0)},t.prototype._measure=function(){null!=this._minX&&null!=this._maxX&&null!=this._minY&&null!=this._maxY&&(this._currentMeasure.width=Math.abs(this._maxX-this._minX)+this._lineWidth,this._currentMeasure.height=Math.abs(this._maxY-this._minY)+this._lineWidth)},t.prototype._computeAlignment=function(){null!=this._minX&&null!=this._minY&&(this._currentMeasure.left=this._minX-this._lineWidth/2,this._currentMeasure.top=this._minY-this._lineWidth/2)},t.prototype.dispose=function(){this.reset(),e.prototype.dispose.call(this)},(0,r.__decorate)([(0,n.serialize)()],t.prototype,"dash",null),t}(o.Control);(0,n.RegisterClass)("BABYLON.GUI.MultiLine",s)},"../../../dev/gui/src/2D/controls/radioButton.ts":(e,t,i)=>{i.r(t),i.d(t,{RadioButton:()=>l});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/2D/controls/control.ts"),a=i("../../../dev/gui/src/2D/controls/stackPanel.ts"),s=i("../../../dev/gui/src/2D/controls/textBlock.ts"),l=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._isChecked=!1,i._background="black",i._checkSizeRatio=.8,i._thickness=1,i.group="",i.onIsCheckedChangedObservable=new n.Observable,i.isPointerBlocker=!0,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness!==e&&(this._thickness=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checkSizeRatio",{get:function(){return this._checkSizeRatio},set:function(e){e=Math.max(Math.min(1,e),0),this._checkSizeRatio!==e&&(this._checkSizeRatio=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChecked",{get:function(){return this._isChecked},set:function(e){var t=this;this._isChecked!==e&&(this._isChecked=e,this._markAsDirty(),this.onIsCheckedChangedObservable.notifyObservers(e),this._isChecked&&this._host&&this._host.executeOnAllControls((function(e){if(e!==t&&void 0!==e.group){var i=e;i.group===t.group&&(i.isChecked=!1)}})))},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"RadioButton"},t.prototype._draw=function(e){e.save(),this._applyStates(e);var t=this._currentMeasure.width-this._thickness,i=this._currentMeasure.height-this._thickness;if((this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),o.Control.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2-this._thickness/2,this._currentMeasure.height/2-this._thickness/2,1,e),e.fillStyle=this._isEnabled?this._background:this._disabledColor,e.fill(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),e.strokeStyle=this.color,e.lineWidth=this._thickness,e.stroke(),this._isChecked){e.fillStyle=this._isEnabled?this.color:this._disabledColor;var r=t*this._checkSizeRatio,n=i*this._checkSizeRatio;o.Control.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,r/2-this._thickness/2,n/2-this._thickness/2,1,e),e.fill()}e.restore()},t.prototype._onPointerDown=function(t,i,r,n,o){return!!e.prototype._onPointerDown.call(this,t,i,r,n,o)&&(this.isReadOnly||this.isChecked||(this.isChecked=!0),!0)},t.AddRadioButtonWithHeader=function(e,i,r,n){var l=new a.StackPanel;l.isVertical=!1,l.height="30px";var c=new t;c.width="20px",c.height="20px",c.isChecked=r,c.color="green",c.group=i,c.onIsCheckedChangedObservable.add((function(e){return n(c,e)})),l.addControl(c);var u=new s.TextBlock;return u.text=e,u.width="180px",u.paddingLeft="5px",u.textHorizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_LEFT,u.color="white",l.addControl(u),l},(0,r.__decorate)([(0,n.serialize)()],t.prototype,"thickness",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"group",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"checkSizeRatio",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"background",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"isChecked",null),t}(o.Control);(0,n.RegisterClass)("BABYLON.GUI.RadioButton",l)},"../../../dev/gui/src/2D/controls/rectangle.ts":(e,t,i)=>{i.r(t),i.d(t,{Rectangle:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/container.ts"),o=i("babylonjs/Misc/perfCounter"),a=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._thickness=1,i._cornerRadius=[0,0,0,0],i._cachedRadius=[0,0,0,0],i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness!==e&&(this._thickness=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cornerRadius",{get:function(){return this._cornerRadius[0]},set:function(e){e<0&&(e=0),this._cornerRadius[0]===e&&this._cornerRadius[1]===e&&this._cornerRadius[2]===e&&this._cornerRadius[3]===e||(this._cornerRadius[0]=this._cornerRadius[1]=this._cornerRadius[2]=this._cornerRadius[3]=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cornerRadiusX",{get:function(){return this._cornerRadius[0]},set:function(e){this._cornerRadius[0]!==e&&(this._cornerRadius[0]=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cornerRadiusY",{get:function(){return this._cornerRadius[1]},set:function(e){this._cornerRadius[1]!==e&&(this._cornerRadius[1]=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cornerRadiusZ",{get:function(){return this._cornerRadius[2]},set:function(e){this._cornerRadius[2]!==e&&(this._cornerRadius[2]=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cornerRadiusW",{get:function(){return this._cornerRadius[3]},set:function(e){this._cornerRadius[3]!==e&&(this._cornerRadius[3]=e)},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Rectangle"},t.prototype._computeAdditionalOffsetX=function(){var e=0;return 0===this._cornerRadius[0]&&0===this._cornerRadius[1]&&0===this._cornerRadius[2]&&0===this._cornerRadius[3]||(e+=1),this.thickness&&(e+=this.thickness/2),e},t.prototype._computeAdditionalOffsetY=function(){var e=0;return 0===this._cornerRadius[0]&&0===this._cornerRadius[1]&&0===this._cornerRadius[2]&&0===this._cornerRadius[3]||(e+=1),this.thickness&&(e+=this.thickness/2),e},t.prototype._getRectangleFill=function(e){return this._getBackgroundColor(e)},t.prototype._localDraw=function(e){e.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),(this._background||this._backgroundGradient)&&(e.fillStyle=this._getRectangleFill(e),0!==this._cornerRadius[0]||0!==this._cornerRadius[1]||0!==this._cornerRadius[2]||0!==this._cornerRadius[3]?(this._drawRoundedRect(e,this._thickness/2),e.fill()):e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),this._thickness&&((this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),(this.color||this.gradient)&&(e.strokeStyle=this.gradient?this.gradient.getCanvasGradient(e):this.color),e.lineWidth=this._thickness,0!==this._cornerRadius[0]||0!==this._cornerRadius[1]||0!==this._cornerRadius[2]||0!==this._cornerRadius[3]?(this._drawRoundedRect(e,this._thickness/2),e.stroke()):e.strokeRect(this._currentMeasure.left+this._thickness/2,this._currentMeasure.top+this._thickness/2,this._currentMeasure.width-this._thickness,this._currentMeasure.height-this._thickness)),e.restore()},t.prototype._additionalProcessing=function(t,i){e.prototype._additionalProcessing.call(this,t,i),this._measureForChildren.width-=2*this._thickness,this._measureForChildren.height-=2*this._thickness,this._measureForChildren.left+=this._thickness,this._measureForChildren.top+=this._thickness},t.prototype._drawRoundedRect=function(e,t){void 0===t&&(t=0);for(var i=this._currentMeasure.left+t,r=this._currentMeasure.top+t,n=this._currentMeasure.width-2*t,o=this._currentMeasure.height-2*t,a=0;a<this._cornerRadius.length;a++)this._cachedRadius[a]=Math.abs(Math.min(o/2,Math.min(n/2,this._cornerRadius[a])));e.beginPath(),e.moveTo(i+this._cachedRadius[0],r),e.lineTo(i+n-this._cachedRadius[1],r),e.arc(i+n-this._cachedRadius[1],r+this._cachedRadius[1],this._cachedRadius[1],3*Math.PI/2,2*Math.PI),e.lineTo(i+n,r+o-this._cachedRadius[2]),e.arc(i+n-this._cachedRadius[2],r+o-this._cachedRadius[2],this._cachedRadius[2],0,Math.PI/2),e.lineTo(i+this._cachedRadius[3],r+o),e.arc(i+this._cachedRadius[3],r+o-this._cachedRadius[3],this._cachedRadius[3],Math.PI/2,Math.PI),e.lineTo(i,r+this._cachedRadius[0]),e.arc(i+this._cachedRadius[0],r+this._cachedRadius[0],this._cachedRadius[0],Math.PI,3*Math.PI/2),e.closePath()},t.prototype._clipForChildren=function(e){0===this._cornerRadius[0]&&0===this._cornerRadius[1]&&0===this._cornerRadius[2]&&0===this._cornerRadius[3]||(this._drawRoundedRect(e,this._thickness),e.clip())},(0,r.__decorate)([(0,o.serialize)()],t.prototype,"thickness",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"cornerRadius",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"cornerRadiusX",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"cornerRadiusY",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"cornerRadiusZ",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"cornerRadiusW",null),t}(n.Container);(0,o.RegisterClass)("BABYLON.GUI.Rectangle",a)},"../../../dev/gui/src/2D/controls/scrollViewers/scrollViewer.ts":(e,t,i)=>{i.r(t),i.d(t,{ScrollViewer:()=>h});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/rectangle.ts"),o=i("../../../dev/gui/src/2D/controls/grid.ts"),a=i("../../../dev/gui/src/2D/controls/control.ts"),s=i("../../../dev/gui/src/2D/controls/scrollViewers/scrollViewerWindow.ts"),l=i("../../../dev/gui/src/2D/controls/sliders/scrollBar.ts"),c=i("../../../dev/gui/src/2D/controls/sliders/imageScrollBar.ts"),u=i("babylonjs/Misc/perfCounter"),h=function(e){function t(t,i){var r=e.call(this,t)||this;return r._barSize=20,r._pointerIsOver=!1,r._wheelPrecision=.05,r._thumbLength=.5,r._thumbHeight=1,r._barImageHeight=1,r._horizontalBarImageHeight=1,r._verticalBarImageHeight=1,r._oldWindowContentsWidth=0,r._oldWindowContentsHeight=0,r._forceHorizontalBar=!1,r._forceVerticalBar=!1,r._useImageBar=i||!1,r.onDirtyObservable.add((function(){r._horizontalBarSpace.color=r.color,r._verticalBarSpace.color=r.color,r._dragSpace.color=r.color})),r.onPointerEnterObservable.add((function(){r._pointerIsOver=!0})),r.onPointerOutObservable.add((function(){r._pointerIsOver=!1})),r._grid=new o.Grid,r._useImageBar?(r._horizontalBar=new c.ImageScrollBar,r._verticalBar=new c.ImageScrollBar):(r._horizontalBar=new l.ScrollBar,r._verticalBar=new l.ScrollBar),r._window=new s._ScrollViewerWindow("scrollViewer_window"),r._window.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,r._window.verticalAlignment=a.Control.VERTICAL_ALIGNMENT_TOP,r._grid.addColumnDefinition(1),r._grid.addColumnDefinition(0,!0),r._grid.addRowDefinition(1),r._grid.addRowDefinition(0,!0),e.prototype.addControl.call(r,r._grid),r._grid.addControl(r._window,0,0),r._verticalBarSpace=new n.Rectangle,r._verticalBarSpace.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,r._verticalBarSpace.verticalAlignment=a.Control.VERTICAL_ALIGNMENT_TOP,r._verticalBarSpace.thickness=1,r._grid.addControl(r._verticalBarSpace,0,1),r._addBar(r._verticalBar,r._verticalBarSpace,!0,Math.PI),r._horizontalBarSpace=new n.Rectangle,r._horizontalBarSpace.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,r._horizontalBarSpace.verticalAlignment=a.Control.VERTICAL_ALIGNMENT_TOP,r._horizontalBarSpace.thickness=1,r._grid.addControl(r._horizontalBarSpace,1,0),r._addBar(r._horizontalBar,r._horizontalBarSpace,!1,0),r._dragSpace=new n.Rectangle,r._dragSpace.thickness=1,r._grid.addControl(r._dragSpace,1,1),r._grid.clipChildren=!1,r._useImageBar||(r.barColor="grey",r.barBackground="transparent"),r}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"horizontalBar",{get:function(){return this._horizontalBar},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalBar",{get:function(){return this._verticalBar},enumerable:!1,configurable:!0}),t.prototype.addControl=function(e){return e?(this._window.addControl(e),this):this},t.prototype.removeControl=function(e){return this._window.removeControl(e),this},Object.defineProperty(t.prototype,"children",{get:function(){return this._window.children},enumerable:!1,configurable:!0}),t.prototype._flagDescendantsAsMatrixDirty=function(){for(var e=0,t=this._children;e<t.length;e++)t[e]._markMatrixAsDirty()},Object.defineProperty(t.prototype,"freezeControls",{get:function(){return this._window.freezeControls},set:function(e){this._window.freezeControls=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucketWidth",{get:function(){return this._window.bucketWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucketHeight",{get:function(){return this._window.bucketHeight},enumerable:!1,configurable:!0}),t.prototype.setBucketSizes=function(e,t){this._window.setBucketSizes(e,t)},Object.defineProperty(t.prototype,"forceHorizontalBar",{get:function(){return this._forceHorizontalBar},set:function(e){this._grid.setRowDefinition(1,e?this._barSize:0,!0),this._horizontalBar.isVisible=e,this._forceHorizontalBar=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"forceVerticalBar",{get:function(){return this._forceVerticalBar},set:function(e){this._grid.setColumnDefinition(1,e?this._barSize:0,!0),this._verticalBar.isVisible=e,this._forceVerticalBar=e},enumerable:!1,configurable:!0}),t.prototype.resetWindow=function(){this._window.width="100%",this._window.height="100%"},t.prototype._getTypeName=function(){return"ScrollViewer"},t.prototype._buildClientSizes=function(){var e=this.host.idealRatio;this._window.parentClientWidth=this._currentMeasure.width-(this._verticalBar.isVisible||this.forceVerticalBar?this._barSize*e:0)-2*this.thickness,this._window.parentClientHeight=this._currentMeasure.height-(this._horizontalBar.isVisible||this.forceHorizontalBar?this._barSize*e:0)-2*this.thickness,this._clientWidth=this._window.parentClientWidth,this._clientHeight=this._window.parentClientHeight},t.prototype._additionalProcessing=function(t,i){e.prototype._additionalProcessing.call(this,t,i),this._buildClientSizes()},t.prototype._postMeasure=function(){e.prototype._postMeasure.call(this),this._updateScroller(),this._setWindowPosition(!1)},Object.defineProperty(t.prototype,"wheelPrecision",{get:function(){return this._wheelPrecision},set:function(e){this._wheelPrecision!==e&&(e<0&&(e=0),e>1&&(e=1),this._wheelPrecision=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scrollBackground",{get:function(){return this._horizontalBarSpace.background},set:function(e){this._horizontalBarSpace.background!==e&&(this._horizontalBarSpace.background=e,this._verticalBarSpace.background=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barColor",{get:function(){return this._barColor},set:function(e){this._barColor!==e&&(this._barColor=e,this._horizontalBar.color=e,this._verticalBar.color=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbImage",{get:function(){return this._barImage},set:function(e){if(this._barImage!==e){this._barImage=e;var t=this._horizontalBar,i=this._verticalBar;t.thumbImage=e,i.thumbImage=e}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalThumbImage",{get:function(){return this._horizontalBarImage},set:function(e){this._horizontalBarImage!==e&&(this._horizontalBarImage=e,this._horizontalBar.thumbImage=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalThumbImage",{get:function(){return this._verticalBarImage},set:function(e){this._verticalBarImage!==e&&(this._verticalBarImage=e,this._verticalBar.thumbImage=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barSize",{get:function(){return this._barSize},set:function(e){this._barSize!==e&&(this._barSize=e,this._markAsDirty(),this._horizontalBar.isVisible&&this._grid.setRowDefinition(1,this._barSize,!0),this._verticalBar.isVisible&&this._grid.setColumnDefinition(1,this._barSize,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbLength",{get:function(){return this._thumbLength},set:function(e){if(this._thumbLength!==e){e<=0&&(e=.1),e>1&&(e=1),this._thumbLength=e;var t=this._horizontalBar,i=this._verticalBar;t.thumbLength=e,i.thumbLength=e,this._markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbHeight",{get:function(){return this._thumbHeight},set:function(e){if(this._thumbHeight!==e){e<=0&&(e=.1),e>1&&(e=1),this._thumbHeight=e;var t=this._horizontalBar,i=this._verticalBar;t.thumbHeight=e,i.thumbHeight=e,this._markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barImageHeight",{get:function(){return this._barImageHeight},set:function(e){if(this._barImageHeight!==e){e<=0&&(e=.1),e>1&&(e=1),this._barImageHeight=e;var t=this._horizontalBar,i=this._verticalBar;t.barImageHeight=e,i.barImageHeight=e,this._markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalBarImageHeight",{get:function(){return this._horizontalBarImageHeight},set:function(e){this._horizontalBarImageHeight!==e&&(e<=0&&(e=.1),e>1&&(e=1),this._horizontalBarImageHeight=e,this._horizontalBar.barImageHeight=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalBarImageHeight",{get:function(){return this._verticalBarImageHeight},set:function(e){this._verticalBarImageHeight!==e&&(e<=0&&(e=.1),e>1&&(e=1),this._verticalBarImageHeight=e,this._verticalBar.barImageHeight=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barBackground",{get:function(){return this._barBackground},set:function(e){if(this._barBackground!==e){this._barBackground=e;var t=this._horizontalBar,i=this._verticalBar;t.background=e,i.background=e,this._dragSpace.background=e}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barImage",{get:function(){return this._barBackgroundImage},set:function(e){this._barBackgroundImage=e;var t=this._horizontalBar,i=this._verticalBar;t.backgroundImage=e,i.backgroundImage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalBarImage",{get:function(){return this._horizontalBarBackgroundImage},set:function(e){this._horizontalBarBackgroundImage=e,this._horizontalBar.backgroundImage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalBarImage",{get:function(){return this._verticalBarBackgroundImage},set:function(e){this._verticalBarBackgroundImage=e,this._verticalBar.backgroundImage=e},enumerable:!1,configurable:!0}),t.prototype._setWindowPosition=function(e){void 0===e&&(e=!0);var t=this.host.idealRatio,i=this._window._currentMeasure.width,r=this._window._currentMeasure.height;if(e||this._oldWindowContentsWidth!==i||this._oldWindowContentsHeight!==r){this._oldWindowContentsWidth=i,this._oldWindowContentsHeight=r;var n=this._clientWidth-i,o=this._clientHeight-r,a=this._horizontalBar.value/t*n+"px",s=this._verticalBar.value/t*o+"px";a!==this._window.left&&(this._window.left=a,this.freezeControls||(this._rebuildLayout=!0)),s!==this._window.top&&(this._window.top=s,this.freezeControls||(this._rebuildLayout=!0))}},t.prototype._updateScroller=function(){var e=this._window._currentMeasure.width,t=this._window._currentMeasure.height;this._horizontalBar.isVisible&&e<=this._clientWidth&&!this.forceHorizontalBar?(this._grid.setRowDefinition(1,0,!0),this._horizontalBar.isVisible=!1,this._horizontalBar.value=0,this._rebuildLayout=!0):!this._horizontalBar.isVisible&&(e>this._clientWidth||this.forceHorizontalBar)&&(this._grid.setRowDefinition(1,this._barSize,!0),this._horizontalBar.isVisible=!0,this._rebuildLayout=!0),this._verticalBar.isVisible&&t<=this._clientHeight&&!this.forceVerticalBar?(this._grid.setColumnDefinition(1,0,!0),this._verticalBar.isVisible=!1,this._verticalBar.value=0,this._rebuildLayout=!0):!this._verticalBar.isVisible&&(t>this._clientHeight||this.forceVerticalBar)&&(this._grid.setColumnDefinition(1,this._barSize,!0),this._verticalBar.isVisible=!0,this._rebuildLayout=!0),this._buildClientSizes();var i=this.host.idealRatio;this._horizontalBar.thumbWidth=.9*this._thumbLength*(this._clientWidth/i)+"px",this._verticalBar.thumbWidth=.9*this._thumbLength*(this._clientHeight/i)+"px"},t.prototype._link=function(t){e.prototype._link.call(this,t),this._attachWheel()},t.prototype._addBar=function(e,t,i,r){var n=this;e.paddingLeft=0,e.width="100%",e.height="100%",e.barOffset=0,e.value=0,e.maximum=1,e.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_CENTER,e.verticalAlignment=a.Control.VERTICAL_ALIGNMENT_CENTER,e.isVertical=i,e.rotation=r,e.isVisible=!1,t.addControl(e),e.onValueChangedObservable.add((function(){n._setWindowPosition()}))},t.prototype._attachWheel=function(){var e=this;this._host&&!this._onWheelObserver&&(this._onWheelObserver=this.onWheelObservable.add((function(t){e._pointerIsOver&&!e.isReadOnly&&(1==e._verticalBar.isVisible&&(t.y<0&&e._verticalBar.value>0?e._verticalBar.value-=e._wheelPrecision:t.y>0&&e._verticalBar.value<e._verticalBar.maximum&&(e._verticalBar.value+=e._wheelPrecision)),1==e._horizontalBar.isVisible&&(t.x<0&&e._horizontalBar.value<e._horizontalBar.maximum?e._horizontalBar.value+=e._wheelPrecision:t.x>0&&e._horizontalBar.value>0&&(e._horizontalBar.value-=e._wheelPrecision)))})))},t.prototype._renderHighlightSpecific=function(t){this.isHighlighted&&(e.prototype._renderHighlightSpecific.call(this,t),this._grid._renderHighlightSpecific(t),t.restore())},t.prototype.dispose=function(){this.onWheelObservable.remove(this._onWheelObserver),this._onWheelObserver=null,e.prototype.dispose.call(this)},(0,r.__decorate)([(0,u.serialize)()],t.prototype,"wheelPrecision",null),(0,r.__decorate)([(0,u.serialize)()],t.prototype,"scrollBackground",null),(0,r.__decorate)([(0,u.serialize)()],t.prototype,"barColor",null),(0,r.__decorate)([(0,u.serialize)()],t.prototype,"barSize",null),(0,r.__decorate)([(0,u.serialize)()],t.prototype,"barBackground",null),t}(n.Rectangle);(0,u.RegisterClass)("BABYLON.GUI.ScrollViewer",h)},"../../../dev/gui/src/2D/controls/scrollViewers/scrollViewerWindow.ts":(e,t,i)=>{i.r(t),i.d(t,{_ScrollViewerWindow:()=>l});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/measure.ts"),o=i("../../../dev/gui/src/2D/controls/container.ts"),a=i("../../../dev/gui/src/2D/valueAndUnit.ts"),s=i("../../../dev/gui/src/2D/controls/control.ts"),l=function(e){function t(t){var i=e.call(this,t)||this;return i._freezeControls=!1,i._bucketWidth=0,i._bucketHeight=0,i._buckets={},i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"freezeControls",{get:function(){return this._freezeControls},set:function(e){if(this._freezeControls!==e){e||this._restoreMeasures(),this._freezeControls=!1;var t=this.host.getSize(),i=t.width,r=t.height,o=this.host.getContext(),a=new n.Measure(0,0,i,r);this.host._numLayoutCalls=0,this.host._rootContainer._layout(a,o),e&&(this._updateMeasures(),this._useBuckets()&&this._makeBuckets()),this._freezeControls=e,this.host.markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucketWidth",{get:function(){return this._bucketWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucketHeight",{get:function(){return this._bucketHeight},enumerable:!1,configurable:!0}),t.prototype.setBucketSizes=function(e,t){this._bucketWidth=e,this._bucketHeight=t,this._useBuckets()?this._freezeControls&&this._makeBuckets():this._buckets={}},t.prototype._useBuckets=function(){return this._bucketWidth>0&&this._bucketHeight>0},t.prototype._makeBuckets=function(){this._buckets={},this._bucketLen=Math.ceil(this.widthInPixels/this._bucketWidth),this._dispatchInBuckets(this._children),this._oldLeft=null,this._oldTop=null},t.prototype._dispatchInBuckets=function(e){for(var t=0;t<e.length;++t){for(var i=e[t],r=Math.max(0,Math.floor((i._customData._origLeft-this._customData.origLeft)/this._bucketWidth)),n=Math.floor((i._customData._origLeft-this._customData.origLeft+i._currentMeasure.width-1)/this._bucketWidth),a=Math.floor((i._customData._origTop-this._customData.origTop+i._currentMeasure.height-1)/this._bucketHeight),s=Math.max(0,Math.floor((i._customData._origTop-this._customData.origTop)/this._bucketHeight));s<=a;){for(var l=r;l<=n;++l){var c=s*this._bucketLen+l,u=this._buckets[c];u||(u=[],this._buckets[c]=u),u.push(i)}s++}i instanceof o.Container&&i._children.length>0&&this._dispatchInBuckets(i._children)}},t.prototype._updateMeasures=function(){var e=0|this.leftInPixels,t=0|this.topInPixels;this._measureForChildren.left-=e,this._measureForChildren.top-=t,this._currentMeasure.left-=e,this._currentMeasure.top-=t,this._customData.origLeftForChildren=this._measureForChildren.left,this._customData.origTopForChildren=this._measureForChildren.top,this._customData.origLeft=this._currentMeasure.left,this._customData.origTop=this._currentMeasure.top,this._updateChildrenMeasures(this._children,e,t)},t.prototype._updateChildrenMeasures=function(e,t,i){for(var r=0;r<e.length;++r){var n=e[r];n._currentMeasure.left-=t,n._currentMeasure.top-=i,n._customData._origLeft=n._currentMeasure.left,n._customData._origTop=n._currentMeasure.top,n instanceof o.Container&&n._children.length>0&&this._updateChildrenMeasures(n._children,t,i)}},t.prototype._restoreMeasures=function(){var e=0|this.leftInPixels,t=0|this.topInPixels;this._measureForChildren.left=this._customData.origLeftForChildren+e,this._measureForChildren.top=this._customData.origTopForChildren+t,this._currentMeasure.left=this._customData.origLeft+e,this._currentMeasure.top=this._customData.origTop+t},t.prototype._getTypeName=function(){return"ScrollViewerWindow"},t.prototype._additionalProcessing=function(t,i){e.prototype._additionalProcessing.call(this,t,i),this._parentMeasure=t,this._measureForChildren.left=this._currentMeasure.left,this._measureForChildren.top=this._currentMeasure.top,this._measureForChildren.width=t.width,this._measureForChildren.height=t.height},t.prototype._layout=function(t,i){return this._freezeControls?(this.invalidateRect(),!1):e.prototype._layout.call(this,t,i)},t.prototype._scrollChildren=function(e,t,i){for(var r=0;r<e.length;++r){var n=e[r];n._currentMeasure.left=n._customData._origLeft+t,n._currentMeasure.top=n._customData._origTop+i,n._isClipped=!1,n instanceof o.Container&&n._children.length>0&&this._scrollChildren(n._children,t,i)}},t.prototype._scrollChildrenWithBuckets=function(e,t,i,r){for(var n=Math.max(0,Math.floor(-e/this._bucketWidth)),o=Math.floor((-e+this._parentMeasure.width-1)/this._bucketWidth),a=Math.floor((-t+this._parentMeasure.height-1)/this._bucketHeight),s=Math.max(0,Math.floor(-t/this._bucketHeight));s<=a;){for(var l=n;l<=o;++l){var c=s*this._bucketLen+l,u=this._buckets[c];if(u)for(var h=0;h<u.length;++h){var d=u[h];d._currentMeasure.left=d._customData._origLeft+i,d._currentMeasure.top=d._customData._origTop+r,d._isClipped=!1}}s++}},t.prototype._draw=function(t,i){if(this._freezeControls){this._localDraw(t),this.clipChildren&&this._clipForChildren(t);var r=0|this.leftInPixels,n=0|this.topInPixels;this._useBuckets()&&null!==this._oldLeft&&null!==this._oldTop?(this._scrollChildrenWithBuckets(this._oldLeft,this._oldTop,r,n),this._scrollChildrenWithBuckets(r,n,r,n)):this._scrollChildren(this._children,r,n),this._oldLeft=r,this._oldTop=n;for(var o=0,a=this._children;o<a.length;o++){var s=a[o];s._intersectsRect(this._parentMeasure)&&s._render(t,this._parentMeasure)}}else e.prototype._draw.call(this,t,i)},t.prototype._postMeasure=function(){if(this._freezeControls)e.prototype._postMeasure.call(this);else{for(var t=this.parentClientWidth,i=this.parentClientHeight,r=0,n=this.children;r<n.length;r++){var o=n[r];o.isVisible&&!o.notRenderable&&(o.horizontalAlignment===s.Control.HORIZONTAL_ALIGNMENT_CENTER&&o._offsetLeft(this._currentMeasure.left-o._currentMeasure.left),o.verticalAlignment===s.Control.VERTICAL_ALIGNMENT_CENTER&&o._offsetTop(this._currentMeasure.top-o._currentMeasure.top),t=Math.max(t,o._currentMeasure.left-this._currentMeasure.left+o._currentMeasure.width+o.paddingRightInPixels),i=Math.max(i,o._currentMeasure.top-this._currentMeasure.top+o._currentMeasure.height+o.paddingBottomInPixels))}this._currentMeasure.width!==t&&(this._width.updateInPlace(t,a.ValueAndUnit.UNITMODE_PIXEL),this._currentMeasure.width=t,this._rebuildLayout=!0,this._isDirty=!0),this._currentMeasure.height!==i&&(this._height.updateInPlace(i,a.ValueAndUnit.UNITMODE_PIXEL),this._currentMeasure.height=i,this._rebuildLayout=!0,this._isDirty=!0),e.prototype._postMeasure.call(this)}},t}(o.Container)},"../../../dev/gui/src/2D/controls/selector.ts":(e,t,i)=>{i.r(t),i.d(t,{CheckboxGroup:()=>_,RadioGroup:()=>f,SelectionPanel:()=>m,SelectorGroup:()=>d,SliderGroup:()=>p});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/rectangle.ts"),o=i("../../../dev/gui/src/2D/controls/stackPanel.ts"),a=i("../../../dev/gui/src/2D/controls/control.ts"),s=i("../../../dev/gui/src/2D/controls/textBlock.ts"),l=i("../../../dev/gui/src/2D/controls/checkbox.ts"),c=i("../../../dev/gui/src/2D/controls/radioButton.ts"),u=i("../../../dev/gui/src/2D/controls/sliders/slider.ts"),h=i("../../../dev/gui/src/2D/controls/container.ts"),d=function(){function e(e){this.name=e,this._groupPanel=new o.StackPanel,this._selectors=new Array,this._groupPanel.verticalAlignment=a.Control.VERTICAL_ALIGNMENT_TOP,this._groupPanel.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,this._groupHeader=this._addGroupHeader(e)}return Object.defineProperty(e.prototype,"groupPanel",{get:function(){return this._groupPanel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectors",{get:function(){return this._selectors},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"header",{get:function(){return this._groupHeader.text},set:function(e){"label"!==this._groupHeader.text&&(this._groupHeader.text=e)},enumerable:!1,configurable:!0}),e.prototype._addGroupHeader=function(e){var t=new s.TextBlock("groupHead",e);return t.width=.9,t.height="30px",t.textWrapping=!0,t.color="black",t.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,t.textHorizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,t.left="2px",this._groupPanel.addControl(t),t},e.prototype._getSelector=function(e){if(!(e<0||e>=this._selectors.length))return this._selectors[e]},e.prototype.removeSelector=function(e){e<0||e>=this._selectors.length||(this._groupPanel.removeControl(this._selectors[e]),this._selectors.splice(e,1))},e}(),_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.__extends)(t,e),t.prototype.addCheckbox=function(e,t,i){void 0===t&&(t=function(e){}),void 0===i&&(i=!1),i=i||!1;var r=new l.Checkbox;r.width="20px",r.height="20px",r.color="#364249",r.background="#CCCCCC",r.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,r.onIsCheckedChangedObservable.add((function(e){t(e)}));var n=a.Control.AddHeader(r,e,"200px",{isHorizontal:!0,controlFirst:!0});n.height="30px",n.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,n.left="4px",this.groupPanel.addControl(n),this.selectors.push(n),r.isChecked=i,this.groupPanel.parent&&this.groupPanel.parent.parent&&(r.color=this.groupPanel.parent.parent.buttonColor,r.background=this.groupPanel.parent.parent.buttonBackground)},t.prototype._setSelectorLabel=function(e,t){this.selectors[e].children[1].text=t},t.prototype._setSelectorLabelColor=function(e,t){this.selectors[e].children[1].color=t},t.prototype._setSelectorButtonColor=function(e,t){this.selectors[e].children[0].color=t},t.prototype._setSelectorButtonBackground=function(e,t){this.selectors[e].children[0].background=t},t}(d),f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._selectNb=0,t}return(0,r.__extends)(t,e),t.prototype.addRadio=function(e,t,i){void 0===t&&(t=function(e){}),void 0===i&&(i=!1);var r=this._selectNb++,n=new c.RadioButton;n.name=e,n.width="20px",n.height="20px",n.color="#364249",n.background="#CCCCCC",n.group=this.name,n.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,n.onIsCheckedChangedObservable.add((function(e){e&&t(r)}));var o=a.Control.AddHeader(n,e,"200px",{isHorizontal:!0,controlFirst:!0});o.height="30px",o.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,o.left="4px",this.groupPanel.addControl(o),this.selectors.push(o),n.isChecked=i,this.groupPanel.parent&&this.groupPanel.parent.parent&&(n.color=this.groupPanel.parent.parent.buttonColor,n.background=this.groupPanel.parent.parent.buttonBackground)},t.prototype._setSelectorLabel=function(e,t){this.selectors[e].children[1].text=t},t.prototype._setSelectorLabelColor=function(e,t){this.selectors[e].children[1].color=t},t.prototype._setSelectorButtonColor=function(e,t){this.selectors[e].children[0].color=t},t.prototype._setSelectorButtonBackground=function(e,t){this.selectors[e].children[0].background=t},t}(d),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.__extends)(t,e),t.prototype.addSlider=function(e,t,i,r,n,o,s){void 0===t&&(t=function(e){}),void 0===i&&(i="Units"),void 0===r&&(r=0),void 0===n&&(n=0),void 0===o&&(o=0),void 0===s&&(s=function(e){return 0|e});var l=new u.Slider;l.name=i,l.value=o,l.minimum=r,l.maximum=n,l.width=.9,l.height="20px",l.color="#364249",l.background="#CCCCCC",l.borderColor="black",l.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,l.left="4px",l.paddingBottom="4px",l.onValueChangedObservable.add((function(e){l.parent.children[0].text=l.parent.children[0].name+": "+s(e)+" "+l.name,t(e)}));var c=a.Control.AddHeader(l,e+": "+s(o)+" "+i,"30px",{isHorizontal:!1,controlFirst:!1});c.height="60px",c.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,c.left="4px",c.children[0].name=e,this.groupPanel.addControl(c),this.selectors.push(c),this.groupPanel.parent&&this.groupPanel.parent.parent&&(l.color=this.groupPanel.parent.parent.buttonColor,l.background=this.groupPanel.parent.parent.buttonBackground)},t.prototype._setSelectorLabel=function(e,t){this.selectors[e].children[0].name=t,this.selectors[e].children[0].text=t+": "+this.selectors[e].children[1].value+" "+this.selectors[e].children[1].name},t.prototype._setSelectorLabelColor=function(e,t){this.selectors[e].children[0].color=t},t.prototype._setSelectorButtonColor=function(e,t){this.selectors[e].children[1].color=t},t.prototype._setSelectorButtonBackground=function(e,t){this.selectors[e].children[1].background=t},t}(d),m=function(e){function t(t,i){void 0===i&&(i=[]);var r=e.call(this,t)||this;if(r.name=t,r.groups=i,r._buttonColor="#364249",r._buttonBackground="#CCCCCC",r._headerColor="black",r._barColor="white",r._barHeight="2px",r._spacerHeight="20px",r._bars=new Array,r._groups=i,r.thickness=2,r._panel=new o.StackPanel,r._panel.verticalAlignment=a.Control.VERTICAL_ALIGNMENT_TOP,r._panel.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,r._panel.top=5,r._panel.left=5,r._panel.width=.95,i.length>0){for(var n=0;n<i.length-1;n++)r._panel.addControl(i[n].groupPanel),r._addSpacer();r._panel.addControl(i[i.length-1].groupPanel)}return r.addControl(r._panel),r}return(0,r.__extends)(t,e),t.prototype._getTypeName=function(){return"SelectionPanel"},Object.defineProperty(t.prototype,"panel",{get:function(){return this._panel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"headerColor",{get:function(){return this._headerColor},set:function(e){this._headerColor!==e&&(this._headerColor=e,this._setHeaderColor())},enumerable:!1,configurable:!0}),t.prototype._setHeaderColor=function(){for(var e=0;e<this._groups.length;e++)this._groups[e].groupPanel.children[0].color=this._headerColor},Object.defineProperty(t.prototype,"buttonColor",{get:function(){return this._buttonColor},set:function(e){this._buttonColor!==e&&(this._buttonColor=e,this._setbuttonColor())},enumerable:!1,configurable:!0}),t.prototype._setbuttonColor=function(){for(var e=0;e<this._groups.length;e++)for(var t=0;t<this._groups[e].selectors.length;t++)this._groups[e]._setSelectorButtonColor(t,this._buttonColor)},Object.defineProperty(t.prototype,"labelColor",{get:function(){return this._labelColor},set:function(e){this._labelColor!==e&&(this._labelColor=e,this._setLabelColor())},enumerable:!1,configurable:!0}),t.prototype._setLabelColor=function(){for(var e=0;e<this._groups.length;e++)for(var t=0;t<this._groups[e].selectors.length;t++)this._groups[e]._setSelectorLabelColor(t,this._labelColor)},Object.defineProperty(t.prototype,"buttonBackground",{get:function(){return this._buttonBackground},set:function(e){this._buttonBackground!==e&&(this._buttonBackground=e,this._setButtonBackground())},enumerable:!1,configurable:!0}),t.prototype._setButtonBackground=function(){for(var e=0;e<this._groups.length;e++)for(var t=0;t<this._groups[e].selectors.length;t++)this._groups[e]._setSelectorButtonBackground(t,this._buttonBackground)},Object.defineProperty(t.prototype,"barColor",{get:function(){return this._barColor},set:function(e){this._barColor!==e&&(this._barColor=e,this._setBarColor())},enumerable:!1,configurable:!0}),t.prototype._setBarColor=function(){for(var e=0;e<this._bars.length;e++)this._bars[e].children[0].background=this._barColor},Object.defineProperty(t.prototype,"barHeight",{get:function(){return this._barHeight},set:function(e){this._barHeight!==e&&(this._barHeight=e,this._setBarHeight())},enumerable:!1,configurable:!0}),t.prototype._setBarHeight=function(){for(var e=0;e<this._bars.length;e++)this._bars[e].children[0].height=this._barHeight},Object.defineProperty(t.prototype,"spacerHeight",{get:function(){return this._spacerHeight},set:function(e){this._spacerHeight!==e&&(this._spacerHeight=e,this._setSpacerHeight())},enumerable:!1,configurable:!0}),t.prototype._setSpacerHeight=function(){for(var e=0;e<this._bars.length;e++)this._bars[e].height=this._spacerHeight},t.prototype._addSpacer=function(){var e=new h.Container;e.width=1,e.height=this._spacerHeight,e.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT;var t=new n.Rectangle;t.width=1,t.height=this._barHeight,t.horizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,t.verticalAlignment=a.Control.VERTICAL_ALIGNMENT_CENTER,t.background=this._barColor,t.color="transparent",e.addControl(t),this._panel.addControl(e),this._bars.push(e)},t.prototype.addGroup=function(e){this._groups.length>0&&this._addSpacer(),this._panel.addControl(e.groupPanel),this._groups.push(e),e.groupPanel.children[0].color=this._headerColor;for(var t=0;t<e.selectors.length;t++)e._setSelectorButtonColor(t,this._buttonColor),e._setSelectorButtonBackground(t,this._buttonBackground)},t.prototype.removeGroup=function(e){if(!(e<0||e>=this._groups.length)){var t=this._groups[e];this._panel.removeControl(t.groupPanel),this._groups.splice(e,1),e<this._bars.length&&(this._panel.removeControl(this._bars[e]),this._bars.splice(e,1))}},t.prototype.setHeaderName=function(e,t){t<0||t>=this._groups.length||(this._groups[t].groupPanel.children[0].text=e)},t.prototype.relabel=function(e,t,i){if(!(t<0||t>=this._groups.length)){var r=this._groups[t];i<0||i>=r.selectors.length||r._setSelectorLabel(i,e)}},t.prototype.removeFromGroupSelector=function(e,t){if(!(e<0||e>=this._groups.length)){var i=this._groups[e];t<0||t>=i.selectors.length||i.removeSelector(t)}},t.prototype.addToGroupCheckbox=function(e,t,i,r){void 0===i&&(i=function(){}),void 0===r&&(r=!1),e<0||e>=this._groups.length||this._groups[e].addCheckbox(t,i,r)},t.prototype.addToGroupRadio=function(e,t,i,r){void 0===i&&(i=function(){}),void 0===r&&(r=!1),e<0||e>=this._groups.length||this._groups[e].addRadio(t,i,r)},t.prototype.addToGroupSlider=function(e,t,i,r,n,o,a,s){void 0===i&&(i=function(){}),void 0===r&&(r="Units"),void 0===n&&(n=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===s&&(s=function(e){return 0|e}),e<0||e>=this._groups.length||this._groups[e].addSlider(t,i,r,n,o,a,s)},t}(n.Rectangle)},"../../../dev/gui/src/2D/controls/sliders/baseSlider.ts":(e,t,i)=>{i.r(t),i.d(t,{BaseSlider:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/2D/controls/control.ts"),a=i("../../../dev/gui/src/2D/valueAndUnit.ts"),s=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._thumbWidth=new a.ValueAndUnit(20,a.ValueAndUnit.UNITMODE_PIXEL,!1),i._minimum=0,i._maximum=100,i._value=50,i._isVertical=!1,i._barOffset=new a.ValueAndUnit(5,a.ValueAndUnit.UNITMODE_PIXEL,!1),i._isThumbClamped=!1,i._displayThumb=!0,i._step=0,i._lastPointerDownId=-1,i._effectiveBarOffset=0,i.onValueChangedObservable=new n.Observable,i._pointerIsDown=!1,i.isPointerBlocker=!0,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"displayThumb",{get:function(){return this._displayThumb},set:function(e){this._displayThumb!==e&&(this._displayThumb=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"step",{get:function(){return this._step},set:function(e){this._step!==e&&(this._step=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barOffset",{get:function(){return this._barOffset.toString(this._host)},set:function(e){this._barOffset.toString(this._host)!==e&&this._barOffset.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barOffsetInPixels",{get:function(){return this._barOffset.getValueInPixel(this._host,this._cachedParentMeasure.width)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbWidth",{get:function(){return this._thumbWidth.toString(this._host)},set:function(e){this._thumbWidth.toString(this._host)!==e&&this._thumbWidth.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbWidthInPixels",{get:function(){return this._thumbWidth.getValueInPixel(this._host,this._cachedParentMeasure.width)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minimum",{get:function(){return this._minimum},set:function(e){this._minimum!==e&&(this._minimum=e,this._markAsDirty(),this.value=Math.max(Math.min(this.value,this._maximum),this._minimum))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maximum",{get:function(){return this._maximum},set:function(e){this._maximum!==e&&(this._maximum=e,this._markAsDirty(),this.value=Math.max(Math.min(this.value,this._maximum),this._minimum))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(e){e=Math.max(Math.min(e,this._maximum),this._minimum),this._value!==e&&(this._value=e,this._markAsDirty(),this.onValueChangedObservable.notifyObservers(this._value))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isVertical",{get:function(){return this._isVertical},set:function(e){this._isVertical!==e&&(this._isVertical=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isThumbClamped",{get:function(){return this._isThumbClamped},set:function(e){this._isThumbClamped!==e&&(this._isThumbClamped=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"BaseSlider"},t.prototype._getThumbPosition=function(){return this.isVertical?(this.maximum-this.value)/(this.maximum-this.minimum)*this._backgroundBoxLength:(this.value-this.minimum)/(this.maximum-this.minimum)*this._backgroundBoxLength},t.prototype._getThumbThickness=function(e){var t=0;switch(e){case"circle":t=this._thumbWidth.isPixel?Math.max(this._thumbWidth.getValue(this._host),this._backgroundBoxThickness):this._backgroundBoxThickness*this._thumbWidth.getValue(this._host);break;case"rectangle":t=this._thumbWidth.isPixel?Math.min(this._thumbWidth.getValue(this._host),this._backgroundBoxThickness):this._backgroundBoxThickness*this._thumbWidth.getValue(this._host)}return t},t.prototype._prepareRenderingData=function(e){this._effectiveBarOffset=0,this._renderLeft=this._currentMeasure.left,this._renderTop=this._currentMeasure.top,this._renderWidth=this._currentMeasure.width,this._renderHeight=this._currentMeasure.height,this._backgroundBoxLength=Math.max(this._currentMeasure.width,this._currentMeasure.height),this._backgroundBoxThickness=Math.min(this._currentMeasure.width,this._currentMeasure.height),this._effectiveThumbThickness=this._getThumbThickness(e),this.displayThumb&&(this._backgroundBoxLength-=this._effectiveThumbThickness),this.isVertical&&this._currentMeasure.height<this._currentMeasure.width?n.Logger.Error("Height should be greater than width"):(this._barOffset.isPixel?this._effectiveBarOffset=Math.min(this._barOffset.getValue(this._host),this._backgroundBoxThickness):this._effectiveBarOffset=this._backgroundBoxThickness*this._barOffset.getValue(this._host),this._backgroundBoxThickness-=2*this._effectiveBarOffset,this.isVertical?(this._renderLeft+=this._effectiveBarOffset,!this.isThumbClamped&&this.displayThumb&&(this._renderTop+=this._effectiveThumbThickness/2),this._renderHeight=this._backgroundBoxLength,this._renderWidth=this._backgroundBoxThickness):(this._renderTop+=this._effectiveBarOffset,!this.isThumbClamped&&this.displayThumb&&(this._renderLeft+=this._effectiveThumbThickness/2),this._renderHeight=this._backgroundBoxThickness,this._renderWidth=this._backgroundBoxLength))},t.prototype._updateValueFromPointer=function(e,t){var i;0!=this.rotation&&(this._invertTransformMatrix.transformCoordinates(e,t,this._transformedPosition),e=this._transformedPosition.x,t=this._transformedPosition.y),i=this._isVertical?this._minimum+(1-(t-this._currentMeasure.top)/this._currentMeasure.height)*(this._maximum-this._minimum):this._minimum+(e-this._currentMeasure.left)/this._currentMeasure.width*(this._maximum-this._minimum),this.value=this._step?Math.round(i/this._step)*this._step:i},t.prototype._onPointerDown=function(t,i,r,n,o){return!!e.prototype._onPointerDown.call(this,t,i,r,n,o)&&(this.isReadOnly||(this._pointerIsDown=!0,this._updateValueFromPointer(i.x,i.y),this._host._capturingControl[r]=this,this._lastPointerDownId=r),!0)},t.prototype._onPointerMove=function(t,i,r,n){r==this._lastPointerDownId&&(this._pointerIsDown&&!this.isReadOnly&&this._updateValueFromPointer(i.x,i.y),e.prototype._onPointerMove.call(this,t,i,r,n))},t.prototype._onPointerUp=function(t,i,r,n,o){this._pointerIsDown=!1,delete this._host._capturingControl[r],e.prototype._onPointerUp.call(this,t,i,r,n,o)},t.prototype._onCanvasBlur=function(){this._forcePointerUp(),e.prototype._onCanvasBlur.call(this)},(0,r.__decorate)([(0,n.serialize)()],t.prototype,"displayThumb",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"step",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"barOffset",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"thumbWidth",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"minimum",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"maximum",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"value",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"isVertical",null),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"isThumbClamped",null),t}(o.Control)},"../../../dev/gui/src/2D/controls/sliders/imageBasedSlider.ts":(e,t,i)=>{i.r(t),i.d(t,{ImageBasedSlider:()=>l});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/sliders/baseSlider.ts"),o=i("../../../dev/gui/src/2D/measure.ts"),a=i("../../../dev/gui/src/2D/controls/image.ts"),s=i("babylonjs/Misc/perfCounter"),l=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._tempMeasure=new o.Measure(0,0,0,0),i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"displayThumb",{get:function(){return this._displayThumb&&null!=this.thumbImage},set:function(e){this._displayThumb!==e&&(this._displayThumb=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundImage",{get:function(){return this._backgroundImage},set:function(e){var t=this;this._backgroundImage!==e&&(this._backgroundImage=e,e&&!e.isLoaded&&e.onImageLoadedObservable.addOnce((function(){return t._markAsDirty()})),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"valueBarImage",{get:function(){return this._valueBarImage},set:function(e){var t=this;this._valueBarImage!==e&&(this._valueBarImage=e,e&&!e.isLoaded&&e.onImageLoadedObservable.addOnce((function(){return t._markAsDirty()})),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbImage",{get:function(){return this._thumbImage},set:function(e){var t=this;this._thumbImage!==e&&(this._thumbImage=e,e&&!e.isLoaded&&e.onImageLoadedObservable.addOnce((function(){return t._markAsDirty()})),this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"ImageBasedSlider"},t.prototype._draw=function(e){e.save(),this._applyStates(e),this._prepareRenderingData("rectangle");var t=this._getThumbPosition(),i=this._renderLeft,r=this._renderTop,n=this._renderWidth,o=this._renderHeight;this._backgroundImage&&(this._tempMeasure.copyFromFloats(i,r,n,o),this.isThumbClamped&&this.displayThumb&&(this.isVertical?this._tempMeasure.height+=this._effectiveThumbThickness:this._tempMeasure.width+=this._effectiveThumbThickness),this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure),this._backgroundImage._draw(e)),this._valueBarImage&&(this.isVertical?this.isThumbClamped&&this.displayThumb?this._tempMeasure.copyFromFloats(i,r+t,n,o-t+this._effectiveThumbThickness):this._tempMeasure.copyFromFloats(i,r+t,n,o-t):this.isThumbClamped&&this.displayThumb?this._tempMeasure.copyFromFloats(i,r,t+this._effectiveThumbThickness/2,o):this._tempMeasure.copyFromFloats(i,r,t,o),this._valueBarImage._currentMeasure.copyFrom(this._tempMeasure),this._valueBarImage._draw(e)),this.displayThumb&&(this.isVertical?this._tempMeasure.copyFromFloats(i-this._effectiveBarOffset,this._currentMeasure.top+t,this._currentMeasure.width,this._effectiveThumbThickness):this._tempMeasure.copyFromFloats(this._currentMeasure.left+t,this._currentMeasure.top,this._effectiveThumbThickness,this._currentMeasure.height),this._thumbImage._currentMeasure.copyFrom(this._tempMeasure),this._thumbImage._draw(e)),e.restore()},t.prototype.serialize=function(t){e.prototype.serialize.call(this,t);var i={},r={},n={};this.backgroundImage.serialize(i),this.thumbImage.serialize(r),this.valueBarImage.serialize(n),t.backgroundImage=i,t.thumbImage=r,t.valueBarImage=n},t.prototype._parseFromContent=function(t,i){e.prototype._parseFromContent.call(this,t,i),this.backgroundImage=a.Image.Parse(t.backgroundImage,i),this.thumbImage=a.Image.Parse(t.thumbImage,i),this.valueBarImage=a.Image.Parse(t.valueBarImage,i)},(0,r.__decorate)([(0,s.serialize)()],t.prototype,"displayThumb",null),t}(n.BaseSlider);(0,s.RegisterClass)("BABYLON.GUI.ImageBasedSlider",l)},"../../../dev/gui/src/2D/controls/sliders/imageScrollBar.ts":(e,t,i)=>{i.r(t),i.d(t,{ImageScrollBar:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/sliders/baseSlider.ts"),o=i("../../../dev/gui/src/2D/measure.ts"),a=i("babylonjs/Misc/perfCounter"),s=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._thumbLength=.5,i._thumbHeight=1,i._barImageHeight=1,i._tempMeasure=new o.Measure(0,0,0,0),i._invertScrollDirection=!1,i.num90RotationInVerticalMode=1,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"invertScrollDirection",{get:function(){return this._invertScrollDirection},set:function(e){this._invertScrollDirection=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundImage",{get:function(){return this._backgroundBaseImage},set:function(e){var t=this;this._backgroundBaseImage!==e&&(this._backgroundBaseImage=e,this.isVertical&&0!==this.num90RotationInVerticalMode?e.isLoaded?(this._backgroundImage=e._rotate90(this.num90RotationInVerticalMode,!0),this._markAsDirty()):e.onImageLoadedObservable.addOnce((function(){var i=e._rotate90(t.num90RotationInVerticalMode,!0);t._backgroundImage=i,i.isLoaded||i.onImageLoadedObservable.addOnce((function(){t._markAsDirty()})),t._markAsDirty()})):(this._backgroundImage=e,e&&!e.isLoaded&&e.onImageLoadedObservable.addOnce((function(){t._markAsDirty()})),this._markAsDirty()))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbImage",{get:function(){return this._thumbBaseImage},set:function(e){var t=this;this._thumbBaseImage!==e&&(this._thumbBaseImage=e,this.isVertical&&0!==this.num90RotationInVerticalMode?e.isLoaded?(this._thumbImage=e._rotate90(-this.num90RotationInVerticalMode,!0),this._markAsDirty()):e.onImageLoadedObservable.addOnce((function(){var i=e._rotate90(-t.num90RotationInVerticalMode,!0);t._thumbImage=i,i.isLoaded||i.onImageLoadedObservable.addOnce((function(){t._markAsDirty()})),t._markAsDirty()})):(this._thumbImage=e,e&&!e.isLoaded&&e.onImageLoadedObservable.addOnce((function(){t._markAsDirty()})),this._markAsDirty()))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbLength",{get:function(){return this._thumbLength},set:function(e){this._thumbLength!==e&&(this._thumbLength=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbHeight",{get:function(){return this._thumbHeight},set:function(e){this._thumbLength!==e&&(this._thumbHeight=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barImageHeight",{get:function(){return this._barImageHeight},set:function(e){this._barImageHeight!==e&&(this._barImageHeight=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"ImageScrollBar"},t.prototype._getThumbThickness=function(){return this._thumbWidth.isPixel?this._thumbWidth.getValue(this._host):this._backgroundBoxThickness*this._thumbWidth.getValue(this._host)},t.prototype._draw=function(e){e.save(),this._applyStates(e),this._prepareRenderingData("rectangle");var t=this._getThumbPosition(),i=this._renderLeft,r=this._renderTop,n=this._renderWidth,o=this._renderHeight;this._backgroundImage&&(this._tempMeasure.copyFromFloats(i,r,n,o),this.isVertical?(this._tempMeasure.copyFromFloats(i+n*(1-this._barImageHeight)*.5,this._currentMeasure.top,n*this._barImageHeight,o),this._tempMeasure.height+=this._effectiveThumbThickness,this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure)):(this._tempMeasure.copyFromFloats(this._currentMeasure.left,r+o*(1-this._barImageHeight)*.5,n,o*this._barImageHeight),this._tempMeasure.width+=this._effectiveThumbThickness,this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure)),this._backgroundImage._draw(e)),this.isVertical?this._tempMeasure.copyFromFloats(i-this._effectiveBarOffset+this._currentMeasure.width*(1-this._thumbHeight)*.5,this._currentMeasure.top+t,this._currentMeasure.width*this._thumbHeight,this._effectiveThumbThickness):this._tempMeasure.copyFromFloats(this._currentMeasure.left+t,this._currentMeasure.top+this._currentMeasure.height*(1-this._thumbHeight)*.5,this._effectiveThumbThickness,this._currentMeasure.height*this._thumbHeight),this._thumbImage&&(this._thumbImage._currentMeasure.copyFrom(this._tempMeasure),this._thumbImage._draw(e)),e.restore()},t.prototype._updateValueFromPointer=function(e,t){0!=this.rotation&&(this._invertTransformMatrix.transformCoordinates(e,t,this._transformedPosition),e=this._transformedPosition.x,t=this._transformedPosition.y);var i=this._invertScrollDirection?-1:1;this._first&&(this._first=!1,this._originX=e,this._originY=t,(e<this._tempMeasure.left||e>this._tempMeasure.left+this._tempMeasure.width||t<this._tempMeasure.top||t>this._tempMeasure.top+this._tempMeasure.height)&&(this.isVertical?this.value=this.minimum+(1-(t-this._currentMeasure.top)/this._currentMeasure.height)*(this.maximum-this.minimum):this.value=this.minimum+(e-this._currentMeasure.left)/this._currentMeasure.width*(this.maximum-this.minimum)));var r;r=this.isVertical?-(t-this._originY)/(this._currentMeasure.height-this._effectiveThumbThickness):(e-this._originX)/(this._currentMeasure.width-this._effectiveThumbThickness),this.value+=i*r*(this.maximum-this.minimum),this._originX=e,this._originY=t},t.prototype._onPointerDown=function(t,i,r,n,o){return this._first=!0,e.prototype._onPointerDown.call(this,t,i,r,n,o)},(0,r.__decorate)([(0,a.serialize)()],t.prototype,"num90RotationInVerticalMode",void 0),(0,r.__decorate)([(0,a.serialize)()],t.prototype,"invertScrollDirection",null),t}(n.BaseSlider)},"../../../dev/gui/src/2D/controls/sliders/scrollBar.ts":(e,t,i)=>{i.r(t),i.d(t,{ScrollBar:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/sliders/baseSlider.ts"),o=i("../../../dev/gui/src/2D/measure.ts"),a=i("babylonjs/Misc/perfCounter"),s=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._background="black",i._borderColor="white",i._tempMeasure=new o.Measure(0,0,0,0),i._invertScrollDirection=!1,i._backgroundGradient=null,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"borderColor",{get:function(){return this._borderColor},set:function(e){this._borderColor!==e&&(this._borderColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundGradient",{get:function(){return this._backgroundGradient},set:function(e){this._backgroundGradient!==e&&(this._backgroundGradient=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"invertScrollDirection",{get:function(){return this._invertScrollDirection},set:function(e){this._invertScrollDirection=e},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Scrollbar"},t.prototype._getThumbThickness=function(){return this._thumbWidth.isPixel?this._thumbWidth.getValue(this._host):this._backgroundBoxThickness*this._thumbWidth.getValue(this._host)},t.prototype._getBackgroundColor=function(e){return this._backgroundGradient?this._backgroundGradient.getCanvasGradient(e):this._background},t.prototype._draw=function(e){e.save(),this._applyStates(e),this._prepareRenderingData("rectangle");var t=this._renderLeft,i=this._getThumbPosition();e.fillStyle=this._getBackgroundColor(e),e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height),e.fillStyle=this._getColor(e),this.isVertical?(this._tempMeasure.left=t-this._effectiveBarOffset,this._tempMeasure.top=this._currentMeasure.top+i,this._tempMeasure.width=this._currentMeasure.width,this._tempMeasure.height=this._effectiveThumbThickness):(this._tempMeasure.left=this._currentMeasure.left+i,this._tempMeasure.top=this._currentMeasure.top,this._tempMeasure.width=this._effectiveThumbThickness,this._tempMeasure.height=this._currentMeasure.height),e.fillRect(this._tempMeasure.left,this._tempMeasure.top,this._tempMeasure.width,this._tempMeasure.height),e.restore()},t.prototype._updateValueFromPointer=function(e,t){0!=this.rotation&&(this._invertTransformMatrix.transformCoordinates(e,t,this._transformedPosition),e=this._transformedPosition.x,t=this._transformedPosition.y);var i=this._invertScrollDirection?-1:1;this._first&&(this._first=!1,this._originX=e,this._originY=t,(e<this._tempMeasure.left||e>this._tempMeasure.left+this._tempMeasure.width||t<this._tempMeasure.top||t>this._tempMeasure.top+this._tempMeasure.height)&&(this.isVertical?this.value=this.minimum+(1-(t-this._currentMeasure.top)/this._currentMeasure.height)*(this.maximum-this.minimum):this.value=this.minimum+(e-this._currentMeasure.left)/this._currentMeasure.width*(this.maximum-this.minimum)));var r;r=this.isVertical?-(t-this._originY)/(this._currentMeasure.height-this._effectiveThumbThickness):(e-this._originX)/(this._currentMeasure.width-this._effectiveThumbThickness),this.value+=i*r*(this.maximum-this.minimum),this._originX=e,this._originY=t},t.prototype._onPointerDown=function(t,i,r,n,o){return this._first=!0,e.prototype._onPointerDown.call(this,t,i,r,n,o)},t.prototype.serialize=function(t){e.prototype.serialize.call(this,t),this.backgroundGradient&&(t.backgroundGradient={},this.backgroundGradient.serialize(t.backgroundGradient))},t.prototype._parseFromContent=function(t,i){if(e.prototype._parseFromContent.call(this,t,i),t.backgroundGradient){var r=a.Tools.Instantiate("BABYLON.GUI."+t.backgroundGradient.className);this.backgroundGradient=new r,this.backgroundGradient.parse(t.backgroundGradient)}},(0,r.__decorate)([(0,a.serialize)()],t.prototype,"borderColor",null),(0,r.__decorate)([(0,a.serialize)()],t.prototype,"background",null),(0,r.__decorate)([(0,a.serialize)()],t.prototype,"invertScrollDirection",null),t}(n.BaseSlider);(0,a.RegisterClass)("BABYLON.GUI.Scrollbar",s)},"../../../dev/gui/src/2D/controls/sliders/slider.ts":(e,t,i)=>{i.r(t),i.d(t,{Slider:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/sliders/baseSlider.ts"),o=i("babylonjs/Misc/perfCounter"),a=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._background="black",i._borderColor="white",i._thumbColor="",i._isThumbCircle=!1,i._displayValueBar=!0,i._backgroundGradient=null,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"displayValueBar",{get:function(){return this._displayValueBar},set:function(e){this._displayValueBar!==e&&(this._displayValueBar=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"borderColor",{get:function(){return this._borderColor},set:function(e){this._borderColor!==e&&(this._borderColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundGradient",{get:function(){return this._backgroundGradient},set:function(e){this._backgroundGradient!==e&&(this._backgroundGradient=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbColor",{get:function(){return this._thumbColor},set:function(e){this._thumbColor!==e&&(this._thumbColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isThumbCircle",{get:function(){return this._isThumbCircle},set:function(e){this._isThumbCircle!==e&&(this._isThumbCircle=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Slider"},t.prototype._getBackgroundColor=function(e){return this._backgroundGradient?this._backgroundGradient.getCanvasGradient(e):this._background},t.prototype._draw=function(e){e.save(),this._applyStates(e),this._prepareRenderingData(this.isThumbCircle?"circle":"rectangle");var t=this._renderLeft,i=this._renderTop,r=this._renderWidth,n=this._renderHeight,o=0;this.isThumbClamped&&this.isThumbCircle?(this.isVertical?i+=this._effectiveThumbThickness/2:t+=this._effectiveThumbThickness/2,o=this._backgroundBoxThickness/2):o=(this._effectiveThumbThickness-this._effectiveBarOffset)/2,(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY);var a=this._getThumbPosition();e.fillStyle=this._getBackgroundColor(e),this.isVertical?this.isThumbClamped?this.isThumbCircle?(e.beginPath(),e.arc(t+this._backgroundBoxThickness/2,i,o,Math.PI,2*Math.PI),e.fill(),e.fillRect(t,i,r,n)):e.fillRect(t,i,r,n+this._effectiveThumbThickness):e.fillRect(t,i,r,n):this.isThumbClamped?this.isThumbCircle?(e.beginPath(),e.arc(t+this._backgroundBoxLength,i+this._backgroundBoxThickness/2,o,0,2*Math.PI),e.fill(),e.fillRect(t,i,r,n)):e.fillRect(t,i,r+this._effectiveThumbThickness,n):e.fillRect(t,i,r,n),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),e.fillStyle=this._getColor(e),this._displayValueBar&&(this.isVertical?this.isThumbClamped?this.isThumbCircle?(e.beginPath(),e.arc(t+this._backgroundBoxThickness/2,i+this._backgroundBoxLength,o,0,2*Math.PI),e.fill(),e.fillRect(t,i+a,r,n-a)):e.fillRect(t,i+a,r,n-a+this._effectiveThumbThickness):e.fillRect(t,i+a,r,n-a):this.isThumbClamped&&this.isThumbCircle?(e.beginPath(),e.arc(t,i+this._backgroundBoxThickness/2,o,0,2*Math.PI),e.fill(),e.fillRect(t,i,a,n)):e.fillRect(t,i,a,n)),e.fillStyle=this._thumbColor||this._getColor(e),this.displayThumb&&((this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),this._isThumbCircle?(e.beginPath(),this.isVertical?e.arc(t+this._backgroundBoxThickness/2,i+a,o,0,2*Math.PI):e.arc(t+a,i+this._backgroundBoxThickness/2,o,0,2*Math.PI),e.fill(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),e.strokeStyle=this._borderColor,e.stroke()):(this.isVertical?e.fillRect(t-this._effectiveBarOffset,this._currentMeasure.top+a,this._currentMeasure.width,this._effectiveThumbThickness):e.fillRect(this._currentMeasure.left+a,this._currentMeasure.top,this._effectiveThumbThickness,this._currentMeasure.height),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),e.strokeStyle=this._borderColor,this.isVertical?e.strokeRect(t-this._effectiveBarOffset,this._currentMeasure.top+a,this._currentMeasure.width,this._effectiveThumbThickness):e.strokeRect(this._currentMeasure.left+a,this._currentMeasure.top,this._effectiveThumbThickness,this._currentMeasure.height))),e.restore()},t.prototype.serialize=function(t){e.prototype.serialize.call(this,t),this.backgroundGradient&&(t.backgroundGradient={},this.backgroundGradient.serialize(t.backgroundGradient))},t.prototype._parseFromContent=function(t,i){if(e.prototype._parseFromContent.call(this,t,i),t.backgroundGradient){var r=o.Tools.Instantiate("BABYLON.GUI."+t.backgroundGradient.className);this.backgroundGradient=new r,this.backgroundGradient.parse(t.backgroundGradient)}},(0,r.__decorate)([(0,o.serialize)()],t.prototype,"displayValueBar",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"borderColor",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"background",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"thumbColor",null),(0,r.__decorate)([(0,o.serialize)()],t.prototype,"isThumbCircle",null),t}(n.BaseSlider);(0,o.RegisterClass)("BABYLON.GUI.Slider",a)},"../../../dev/gui/src/2D/controls/stackPanel.ts":(e,t,i)=>{i.r(t),i.d(t,{StackPanel:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/controls/container.ts"),o=i("../../../dev/gui/src/2D/controls/control.ts"),a=i("babylonjs/Misc/perfCounter"),s=function(e){function t(t){var i=e.call(this,t)||this;return i.name=t,i._isVertical=!0,i._manualWidth=!1,i._manualHeight=!1,i._doNotTrackManualChanges=!1,i._spacing=0,i.ignoreLayoutWarnings=!1,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"isVertical",{get:function(){return this._isVertical},set:function(e){this._isVertical!==e&&(this._isVertical=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"spacing",{get:function(){return this._spacing},set:function(e){this._spacing!==e&&(this._spacing=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width.toString(this._host)},set:function(e){this._doNotTrackManualChanges||(this._manualWidth=!0),this._width.toString(this._host)!==e&&this._width.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height.toString(this._host)},set:function(e){this._doNotTrackManualChanges||(this._manualHeight=!0),this._height.toString(this._host)!==e&&this._height.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"StackPanel"},t.prototype._preMeasure=function(t,i){for(var r=0,n=this._children;r<n.length;r++){var a=n[r];this._isVertical?a.verticalAlignment=o.Control.VERTICAL_ALIGNMENT_TOP:a.horizontalAlignment=o.Control.HORIZONTAL_ALIGNMENT_LEFT}e.prototype._preMeasure.call(this,t,i)},t.prototype._additionalProcessing=function(t,i){e.prototype._additionalProcessing.call(this,t,i),this._measureForChildren.copyFrom(t),this._measureForChildren.left=this._currentMeasure.left,this._measureForChildren.top=this._currentMeasure.top,this.isVertical&&!this._manualWidth||(this._measureForChildren.width=this._currentMeasure.width),(this.isVertical||this._manualHeight)&&(this._measureForChildren.height=this._currentMeasure.height)},t.prototype._postMeasure=function(){for(var t=0,i=0,r=this._children.length,n=0;n<r;n++){var o=this._children[n];o.isVisible&&!o.notRenderable&&(this._isVertical?(o.top!==i+"px"&&(o.top=i+"px",this._rebuildLayout=!0,o._top.ignoreAdaptiveScaling=!0),this.ignoreLayoutWarnings||o.isDimensionFullyDefined("height")?i+=o._currentMeasure.height+o._paddingTopInPixels+o._paddingBottomInPixels+(n<r-1?this._spacing:0):a.Logger.Warn("Control (Name:".concat(o.name,", UniqueId:").concat(o.uniqueId,") is using height in percentage mode inside a vertical StackPanel"),1)):(o.left!==t+"px"&&(o.left=t+"px",this._rebuildLayout=!0,o._left.ignoreAdaptiveScaling=!0),this.ignoreLayoutWarnings||o.isDimensionFullyDefined("width")?t+=o._currentMeasure.width+o._paddingLeftInPixels+o._paddingRightInPixels+(n<r-1?this._spacing:0):a.Logger.Warn("Control (Name:".concat(o.name,", UniqueId:").concat(o.uniqueId,") is using width in percentage mode inside a horizontal StackPanel"),1)))}t+=this._paddingLeftInPixels+this._paddingRightInPixels,i+=this._paddingTopInPixels+this._paddingBottomInPixels,this._doNotTrackManualChanges=!0;var s=!1,l=!1;if((!this._manualHeight||this.adaptHeightToChildren)&&this._isVertical){var c=this.height;this.height=i+"px",l=c!==this.height||!this._height.ignoreAdaptiveScaling}if((!this._manualWidth||this.adaptWidthToChildren)&&!this._isVertical){var u=this.width;this.width=t+"px",s=u!==this.width||!this._width.ignoreAdaptiveScaling}l&&(this._height.ignoreAdaptiveScaling=!0),s&&(this._width.ignoreAdaptiveScaling=!0),this._doNotTrackManualChanges=!1,(s||l)&&(this._rebuildLayout=!0),e.prototype._postMeasure.call(this)},t.prototype._getManualDim=function(e){return"width"===e?this._manualWidth:this._manualHeight},t.prototype.isDimensionFullyDefined=function(e){if("height"===e?this.isVertical:!this.isVertical&&!this._getManualDim(e)){for(var t=0,i=this._children;t<i.length;t++)if(!i[t].isDimensionFullyDefined(e))return!1;return!0}return this.getDimension(e).isPixel||this._getAdaptDimTo(e)},t.prototype.serialize=function(t,i){e.prototype.serialize.call(this,t,i),(this.isSerializable||i)&&(t.manualWidth=this._manualWidth,t.manualHeight=this._manualHeight)},t.prototype._parseFromContent=function(t,i){this._manualWidth=t.manualWidth,this._manualHeight=t.manualHeight,e.prototype._parseFromContent.call(this,t,i)},(0,r.__decorate)([(0,a.serialize)()],t.prototype,"ignoreLayoutWarnings",void 0),(0,r.__decorate)([(0,a.serialize)()],t.prototype,"isVertical",null),(0,r.__decorate)([(0,a.serialize)()],t.prototype,"spacing",null),(0,r.__decorate)([(0,a.serialize)()],t.prototype,"width",null),(0,r.__decorate)([(0,a.serialize)()],t.prototype,"height",null),t}(n.Container);(0,a.RegisterClass)("BABYLON.GUI.StackPanel",s)},"../../../dev/gui/src/2D/controls/statics.ts":(e,t,i)=>{i.r(t),i.d(t,{name:()=>a});var r=i("../../../dev/gui/src/2D/controls/control.ts"),n=i("../../../dev/gui/src/2D/controls/stackPanel.ts"),o=i("../../../dev/gui/src/2D/controls/textBlock.ts"),a="Statics";r.Control.AddHeader=function(e,t,i,a){var s=new n.StackPanel("panel"),l=!a||a.isHorizontal,c=!a||a.controlFirst;s.isVertical=!l;var u=new o.TextBlock("header");return u.text=t,u.textHorizontalAlignment=r.Control.HORIZONTAL_ALIGNMENT_LEFT,l?u.width=i:u.height=i,c?(s.addControl(e),s.addControl(u),u.paddingLeft="5px"):(s.addControl(u),s.addControl(e),u.paddingRight="5px"),u.shadowBlur=e.shadowBlur,u.shadowColor=e.shadowColor,u.shadowOffsetX=e.shadowOffsetX,u.shadowOffsetY=e.shadowOffsetY,s}},"../../../dev/gui/src/2D/controls/textBlock.ts":(e,t,i)=>{i.r(t),i.d(t,{TextBlock:()=>l,TextWrapping:()=>r});var r,n=i("../../../../node_modules/tslib/tslib.es6.mjs"),o=i("babylonjs/Misc/perfCounter"),a=i("../../../dev/gui/src/2D/valueAndUnit.ts"),s=i("../../../dev/gui/src/2D/controls/control.ts");!function(e){e[e.Clip=0]="Clip",e[e.WordWrap=1]="WordWrap",e[e.Ellipsis=2]="Ellipsis",e[e.WordWrapEllipsis=3]="WordWrapEllipsis",e[e.HTML=4]="HTML"}(r||(r={}));var l=function(e){function t(t,i){void 0===i&&(i="");var r=e.call(this,t)||this;return r.name=t,r._text="",r._textWrapping=0,r._textHorizontalAlignment=s.Control.HORIZONTAL_ALIGNMENT_CENTER,r._textVerticalAlignment=s.Control.VERTICAL_ALIGNMENT_CENTER,r._resizeToFit=!1,r._lineSpacing=new a.ValueAndUnit(0),r._outlineWidth=0,r._outlineColor="white",r._underline=!1,r._lineThrough=!1,r._wordDivider=" ",r._forceResizeWidth=!1,r._applyOutlineToUnderline=!1,r.onTextChangedObservable=new o.Observable,r.onLinesReadyObservable=new o.Observable,r.reuseHTMLForWordWrapping=!1,r._linesTemp=[],r._htmlElement=null,r.text=i,r}return(0,n.__extends)(t,e),Object.defineProperty(t.prototype,"lines",{get:function(){return this._lines},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resizeToFit",{get:function(){return this._resizeToFit},set:function(e){this._resizeToFit!==e&&(this._resizeToFit=e,this._resizeToFit&&(this._width.ignoreAdaptiveScaling=!0,this._height.ignoreAdaptiveScaling=!0),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textWrapping",{get:function(){return this._textWrapping},set:function(e){this._textWrapping!==e&&(this._textWrapping=+e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e+"",this._markAsDirty(),this.onTextChangedObservable.notifyObservers(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textHorizontalAlignment",{get:function(){return this._textHorizontalAlignment},set:function(e){this._textHorizontalAlignment!==e&&(this._textHorizontalAlignment=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textVerticalAlignment",{get:function(){return this._textVerticalAlignment},set:function(e){this._textVerticalAlignment!==e&&(this._textVerticalAlignment=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineSpacing",{get:function(){return this._lineSpacing.toString(this._host)},set:function(e){this._lineSpacing.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outlineWidth",{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underline",{get:function(){return this._underline},set:function(e){this._underline!==e&&(this._underline=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineThrough",{get:function(){return this._lineThrough},set:function(e){this._lineThrough!==e&&(this._lineThrough=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"applyOutlineToUnderline",{get:function(){return this._applyOutlineToUnderline},set:function(e){this._applyOutlineToUnderline!==e&&(this._applyOutlineToUnderline=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outlineColor",{get:function(){return this._outlineColor},set:function(e){this._outlineColor!==e&&(this._outlineColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordDivider",{get:function(){return this._wordDivider},set:function(e){this._wordDivider!==e&&(this._wordDivider=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"forceResizeWidth",{get:function(){return this._forceResizeWidth},set:function(e){this._forceResizeWidth!==e&&(this._forceResizeWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"TextBlock"},t.prototype._processMeasures=function(t,i){var r;this._fontOffset&&!this.isDirty||(this._fontOffset=s.Control._GetFontOffset(i.font,null===(r=this._host.getScene())||void 0===r?void 0:r.getEngine())),e.prototype._processMeasures.call(this,t,i),this._lines=this._breakLines(this._currentMeasure.width,this._currentMeasure.height,i),this.onLinesReadyObservable.notifyObservers(this);for(var n=0,o=0;o<this._lines.length;o++){var l=this._lines[o];l.width>n&&(n=l.width)}if(this._resizeToFit){if(0===this._textWrapping||this._forceResizeWidth){var c=Math.ceil(this._paddingLeftInPixels)+Math.ceil(this._paddingRightInPixels)+Math.ceil(n);c!==this._width.getValueInPixel(this._host,this._tempParentMeasure.width)&&(this._width.updateInPlace(c,a.ValueAndUnit.UNITMODE_PIXEL),this._rebuildLayout=!0)}var u=this._paddingTopInPixels+this._paddingBottomInPixels+this._fontOffset.height*this._lines.length|0;if(this._lines.length>0&&0!==this._lineSpacing.internalValue){var h;h=this._lineSpacing.isPixel?this._lineSpacing.getValue(this._host):this._lineSpacing.getValue(this._host)*this._height.getValueInPixel(this._host,this._cachedParentMeasure.height),u+=(this._lines.length-1)*h}u!==this._height.internalValue&&(this._height.updateInPlace(u,a.ValueAndUnit.UNITMODE_PIXEL),this._rebuildLayout=!0)}},t.prototype._drawText=function(e,t,i,r){var n=this._currentMeasure.width,o=0;switch(this._textHorizontalAlignment){case s.Control.HORIZONTAL_ALIGNMENT_LEFT:o=0;break;case s.Control.HORIZONTAL_ALIGNMENT_RIGHT:o=n-t;break;case s.Control.HORIZONTAL_ALIGNMENT_CENTER:o=(n-t)/2}(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(r.shadowColor=this.shadowColor,r.shadowBlur=this.shadowBlur,r.shadowOffsetX=this.shadowOffsetX,r.shadowOffsetY=this.shadowOffsetY),this.outlineWidth&&r.strokeText(e,this._currentMeasure.left+o,i),r.fillText(e,this._currentMeasure.left+o,i),this._underline&&this._drawLine(this._currentMeasure.left+o,i+3,this._currentMeasure.left+o+t,i+3,r),this._lineThrough&&this._drawLine(this._currentMeasure.left+o,i-this.fontSizeInPixels/3,this._currentMeasure.left+o+t,i-this.fontSizeInPixels/3,r)},t.prototype._drawLine=function(e,t,i,r,n){if(n.beginPath(),n.lineWidth=Math.round(.05*this.fontSizeInPixels),n.moveTo(e,t),n.lineTo(i,r),this.outlineWidth&&this.applyOutlineToUnderline)n.stroke(),n.fill();else{var o=n.strokeStyle;n.strokeStyle=n.fillStyle,n.stroke(),n.strokeStyle=o}n.closePath()},t.prototype._draw=function(e){e.save(),this._applyStates(e),this._renderLines(e),e.restore()},t.prototype._applyStates=function(t){e.prototype._applyStates.call(this,t),this.outlineWidth&&(t.lineWidth=this.outlineWidth,t.strokeStyle=this.outlineColor,t.lineJoin="miter",t.miterLimit=2)},t.prototype._breakLines=function(e,t,i){var r,n;this._linesTemp.length=0;var o=4===this._textWrapping?this._parseHTMLText(e,t,i):this.text.split("\n");switch(this._textWrapping){case 1:for(var a=0,s=o;a<s.length;a++){var l=s[a];(r=this._linesTemp).push.apply(r,this._parseLineWordWrap(l,e,i))}break;case 2:for(var c=0,u=o;c<u.length;c++)l=u[c],this._linesTemp.push(this._parseLineEllipsis(l,e,i));break;case 3:for(var h=0,d=o;h<d.length;h++)l=d[h],(n=this._linesTemp).push.apply(n,this._parseLineWordWrapEllipsis(l,e,t,i));break;default:for(var _=0,f=o;_<f.length;_++)l=f[_],this._linesTemp.push(this._parseLine(l,i))}return this._linesTemp},t.prototype._parseHTMLText=function(e,t,i){var r,n=[];this._htmlElement||(this._htmlElement=document.createElement("div"),document.body.appendChild(this._htmlElement));var o=this._htmlElement;o.textContent=this.text,o.style.font=i.font,o.style.position="absolute",o.style.visibility="hidden",o.style.top="-1000px",o.style.left="-1000px",null===(r=this.adjustWordWrappingHTMLElement)||void 0===r||r.call(this,o),o.style.width=e+"px",o.style.height=t+"px";var a=o.textContent;if(!a)return n;for(var s=o.childNodes[0],l=document.createRange(),c=0,u=0,h=a;u<h.length;u++){var d=h[u];l.setStart(s,0),l.setEnd(s,c+1);var _=l.getClientRects().length-1;n[_]=(n[_]||"")+d,c++}return this.reuseHTMLForWordWrapping||(o.remove(),this._htmlElement=null),n},t.prototype._parseLine=function(e,t){return void 0===e&&(e=""),{text:e,width:this._getTextMetricsWidth(t.measureText(e))}},t.prototype._getCharsToRemove=function(e,t,i){var r=e>t?e-t:0,n=e/i;return Math.max(Math.floor(r/n),1)},t.prototype._parseLineEllipsis=function(e,t,i){void 0===e&&(e="");var r=this._getTextMetricsWidth(i.measureText(e)),n=this._getCharsToRemove(r,t,e.length),o=Array.from&&Array.from(e);if(o)for(;o.length&&r>t;)o.splice(o.length-n,n),e="".concat(o.join(""),"…"),r=this._getTextMetricsWidth(i.measureText(e)),n=this._getCharsToRemove(r,t,e.length);else{for(;e.length>2&&r>t;)e=e.slice(0,-n),r=this._getTextMetricsWidth(i.measureText(e+"…")),n=this._getCharsToRemove(r,t,e.length);e+="…"}return{text:e,width:r}},t.prototype._getTextMetricsWidth=function(e){return void 0!==e.actualBoundingBoxLeft?Math.abs(e.actualBoundingBoxLeft)+Math.abs(e.actualBoundingBoxRight):e.width},t.prototype._parseLineWordWrap=function(e,t,i){void 0===e&&(e="");for(var r=[],n=this.wordSplittingFunction?this.wordSplittingFunction(e):e.split(this._wordDivider),o=this._getTextMetricsWidth(i.measureText(e)),a=0;a<n.length;a++){var s=a>0?e+this._wordDivider+n[a]:n[0],l=this._getTextMetricsWidth(i.measureText(s));l>t&&a>0?(r.push({text:e,width:o}),e=n[a],o=this._getTextMetricsWidth(i.measureText(e))):(o=l,e=s)}return r.push({text:e,width:o}),r},t.prototype._parseLineWordWrapEllipsis=function(e,t,i,r){void 0===e&&(e="");for(var n=this._parseLineWordWrap(e,t,r),o=1;o<=n.length;o++)if(this._computeHeightForLinesOf(o)>i&&o>1){var a=n[o-2],s=n[o-1];n[o-2]=this._parseLineEllipsis(a.text+this._wordDivider+s.text,t,r);for(var l=n.length-o+1,c=0;c<l;c++)n.pop();return n}return n},t.prototype._renderLines=function(e){if(this._fontOffset&&this._lines){var t=this._currentMeasure.height,i=0;switch(this._textVerticalAlignment){case s.Control.VERTICAL_ALIGNMENT_TOP:i=this._fontOffset.ascent;break;case s.Control.VERTICAL_ALIGNMENT_BOTTOM:i=t-this._fontOffset.height*(this._lines.length-1)-this._fontOffset.descent;break;case s.Control.VERTICAL_ALIGNMENT_CENTER:i=this._fontOffset.ascent+(t-this._fontOffset.height*this._lines.length)/2}i+=this._currentMeasure.top;for(var r=0;r<this._lines.length;r++){var n=this._lines[r];0!==r&&0!==this._lineSpacing.internalValue&&(this._lineSpacing.isPixel?i+=this._lineSpacing.getValue(this._host):i+=this._lineSpacing.getValue(this._host)*this._height.getValueInPixel(this._host,this._cachedParentMeasure.height)),this._drawText(n.text,n.width,i,e),i+=this._fontOffset.height}}},t.prototype._computeHeightForLinesOf=function(e){var t=this._paddingTopInPixels+this._paddingBottomInPixels+this._fontOffset.height*e;return e>0&&0!==this._lineSpacing.internalValue&&(t+=(e-1)*(this._lineSpacing.isPixel?this._lineSpacing.getValue(this._host):this._lineSpacing.getValue(this._host)*this._height.getValueInPixel(this._host,this._cachedParentMeasure.height))),t},t.prototype.isDimensionFullyDefined=function(t){return!!this.resizeToFit||e.prototype.isDimensionFullyDefined.call(this,t)},t.prototype.computeExpectedHeight=function(){var e,t;if(this.text&&this.widthInPixels){var i=null===(e=o.EngineStore.LastCreatedEngine)||void 0===e?void 0:e.createCanvas(0,0).getContext("2d");if(i){this._applyStates(i),this._fontOffset||(this._fontOffset=s.Control._GetFontOffset(i.font,null===(t=this._host.getScene())||void 0===t?void 0:t.getEngine()));var r=this._lines?this._lines:this._breakLines(this.widthInPixels-this._paddingLeftInPixels-this._paddingRightInPixels,this.heightInPixels-this._paddingTopInPixels-this._paddingBottomInPixels,i);return this._computeHeightForLinesOf(r.length)}}return 0},t.prototype.dispose=function(){var t;e.prototype.dispose.call(this),this.onTextChangedObservable.clear(),null===(t=this._htmlElement)||void 0===t||t.remove(),this._htmlElement=null},(0,n.__decorate)([(0,o.serialize)()],t.prototype,"resizeToFit",null),(0,n.__decorate)([(0,o.serialize)()],t.prototype,"textWrapping",null),(0,n.__decorate)([(0,o.serialize)()],t.prototype,"text",null),(0,n.__decorate)([(0,o.serialize)()],t.prototype,"textHorizontalAlignment",null),(0,n.__decorate)([(0,o.serialize)()],t.prototype,"textVerticalAlignment",null),(0,n.__decorate)([(0,o.serialize)()],t.prototype,"lineSpacing",null),(0,n.__decorate)([(0,o.serialize)()],t.prototype,"outlineWidth",null),(0,n.__decorate)([(0,o.serialize)()],t.prototype,"underline",null),(0,n.__decorate)([(0,o.serialize)()],t.prototype,"lineThrough",null),(0,n.__decorate)([(0,o.serialize)()],t.prototype,"applyOutlineToUnderline",null),(0,n.__decorate)([(0,o.serialize)()],t.prototype,"outlineColor",null),(0,n.__decorate)([(0,o.serialize)()],t.prototype,"wordDivider",null),(0,n.__decorate)([(0,o.serialize)()],t.prototype,"forceResizeWidth",null),t}(s.Control);(0,o.RegisterClass)("BABYLON.GUI.TextBlock",l)},"../../../dev/gui/src/2D/controls/textWrapper.ts":(e,t,i)=>{i.r(t),i.d(t,{TextWrapper:()=>n});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=function(){function e(){}return Object.defineProperty(e.prototype,"text",{get:function(){return this._characters?this._characters.join(""):this._text},set:function(e){this._text=e,this._characters=Array.from&&Array.from(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._characters?this._characters.length:this._text.length},enumerable:!1,configurable:!0}),e.prototype.removePart=function(e,t,i){var n;if(this._text=this._text.slice(0,e)+(i||"")+this._text.slice(t),this._characters){var o=i?Array.from(i):[];(n=this._characters).splice.apply(n,(0,r.__spreadArray)([e,t-e],o,!1))}},e.prototype.charAt=function(e){return this._characters?this._characters[e]:this._text.charAt(e)},e.prototype.substr=function(e,t){if(this._characters){e=isNaN(e)?0:e>=0?Math.min(e,this._characters.length):this._characters.length+Math.max(e,-this._characters.length),void 0===t?t=this._characters.length-e:(isNaN(t)||t<0)&&(t=0);for(var i=[];--t>=0;)i[t]=this._characters[e+t];return i.join("")}return this._text.substr(e,t)},e.prototype.substring=function(e,t){if(this._characters){isNaN(e)?e=0:e>this._characters.length?e=this._characters.length:e<0&&(e=0),void 0===t?t=this._characters.length:isNaN(t)?t=0:t>this._characters.length?t=this._characters.length:t<0&&(t=0);for(var i=[],r=0;e<t;)i[r++]=this._characters[e++];return i.join("")}return this._text.substring(e,t)},e.prototype.isWord=function(e){var t=/\w/g;return this._characters?-1!==this._characters[e].search(t):-1!==this._text.search(t)},e}()},"../../../dev/gui/src/2D/controls/toggleButton.ts":(e,t,i)=>{i.r(t),i.d(t,{ToggleButton:()=>o});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=function(e){function t(t,i){var r=e.call(this,t)||this;r.name=t,r.onIsActiveChangedObservable=new n.Observable,r.delegatePickingToChildren=!1,r._isActive=!1,r.group=null!=i?i:"",r.thickness=0,r.isPointerBlocker=!0;var o=null;return r.toActiveAnimation=function(){r.thickness=1},r.toInactiveAnimation=function(){r.thickness=0},r.pointerEnterActiveAnimation=function(){o=r.alpha,r.alpha-=.1},r.pointerOutActiveAnimation=function(){null!==o&&(r.alpha=o)},r.pointerDownActiveAnimation=function(){r.scaleX-=.05,r.scaleY-=.05},r.pointerUpActiveAnimation=function(){r.scaleX+=.05,r.scaleY+=.05},r.pointerEnterInactiveAnimation=function(){o=r.alpha,r.alpha-=.1},r.pointerOutInactiveAnimation=function(){null!==o&&(r.alpha=o)},r.pointerDownInactiveAnimation=function(){r.scaleX-=.05,r.scaleY-=.05},r.pointerUpInactiveAnimation=function(){r.scaleX+=.05,r.scaleY+=.05},r}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"group",{get:function(){return this._group},set:function(e){this._group!==e&&(this._group=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActive",{get:function(){return this._isActive},set:function(e){var t,i,r=this;this._isActive!==e&&(this._isActive=e,this._isActive?null===(t=this.toActiveAnimation)||void 0===t||t.call(this):null===(i=this.toInactiveAnimation)||void 0===i||i.call(this),this._markAsDirty(),this.onIsActiveChangedObservable.notifyObservers(e),this._isActive&&this._host&&this._group&&this._host.executeOnAllControls((function(e){if("ToggleButton"===e.typeName){if(e===r)return;var t=e;t.group===r.group&&(t.isActive=!1)}})))},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"ToggleButton"},t.prototype._processPicking=function(t,i,r,n,o,a,s,l){if(!this._isEnabled||!this.isHitTestVisible||!this.isVisible||this.notRenderable)return!1;if(!e.prototype.contains.call(this,t,i))return!1;if(this.delegatePickingToChildren){for(var c=!1,u=this._children.length-1;u>=0;u--){var h=this._children[u];if(h.isEnabled&&h.isHitTestVisible&&h.isVisible&&!h.notRenderable&&h.contains(t,i)){c=!0;break}}if(!c)return!1}return this._processObservables(n,t,i,r,o,a,s,l),!0},t.prototype._onPointerEnter=function(t,i){return!!e.prototype._onPointerEnter.call(this,t,i)&&(this.isReadOnly||(this._isActive?this.pointerEnterActiveAnimation&&this.pointerEnterActiveAnimation():this.pointerEnterInactiveAnimation&&this.pointerEnterInactiveAnimation()),!0)},t.prototype._onPointerOut=function(t,i,r){void 0===r&&(r=!1),this.isReadOnly||(this._isActive?this.pointerOutActiveAnimation&&this.pointerOutActiveAnimation():this.pointerOutInactiveAnimation&&this.pointerOutInactiveAnimation()),e.prototype._onPointerOut.call(this,t,i,r)},t.prototype._onPointerDown=function(t,i,r,n,o){return!!e.prototype._onPointerDown.call(this,t,i,r,n,o)&&(this.isReadOnly||(this._isActive?this.pointerDownActiveAnimation&&this.pointerDownActiveAnimation():this.pointerDownInactiveAnimation&&this.pointerDownInactiveAnimation()),!0)},t.prototype._onPointerUp=function(t,i,r,n,o,a){this.isReadOnly||(this._isActive?this.pointerUpActiveAnimation&&this.pointerUpActiveAnimation():this.pointerUpInactiveAnimation&&this.pointerUpInactiveAnimation()),e.prototype._onPointerUp.call(this,t,i,r,n,o,a)},t}(i("../../../dev/gui/src/2D/controls/rectangle.ts").Rectangle);(0,n.RegisterClass)("BABYLON.GUI.ToggleButton",o)},"../../../dev/gui/src/2D/controls/virtualKeyboard.ts":(e,t,i)=>{i.r(t),i.d(t,{KeyPropertySet:()=>l,VirtualKeyboard:()=>c});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/2D/controls/stackPanel.ts"),a=i("../../../dev/gui/src/2D/controls/button.ts"),s=i("../../../dev/gui/src/2D/controls/inputTextArea.ts"),l=function(){},c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onKeyPressObservable=new n.Observable,t.defaultButtonWidth="40px",t.defaultButtonHeight="40px",t.defaultButtonPaddingLeft="2px",t.defaultButtonPaddingRight="2px",t.defaultButtonPaddingTop="2px",t.defaultButtonPaddingBottom="2px",t.defaultButtonColor="#DDD",t.defaultButtonBackground="#070707",t.shiftButtonColor="#7799FF",t.selectedShiftThickness=1,t.shiftState=0,t._currentlyConnectedInputText=null,t._connectedInputTexts=[],t._onKeyPressObserver=null,t}return(0,r.__extends)(t,e),t.prototype._getTypeName=function(){return"VirtualKeyboard"},t.prototype._createKey=function(e,t){var i=this,r=a.Button.CreateSimpleButton(e,e);return r.width=t&&t.width?t.width:this.defaultButtonWidth,r.height=t&&t.height?t.height:this.defaultButtonHeight,r.color=t&&t.color?t.color:this.defaultButtonColor,r.background=t&&t.background?t.background:this.defaultButtonBackground,r.paddingLeft=t&&t.paddingLeft?t.paddingLeft:this.defaultButtonPaddingLeft,r.paddingRight=t&&t.paddingRight?t.paddingRight:this.defaultButtonPaddingRight,r.paddingTop=t&&t.paddingTop?t.paddingTop:this.defaultButtonPaddingTop,r.paddingBottom=t&&t.paddingBottom?t.paddingBottom:this.defaultButtonPaddingBottom,r.thickness=0,r.isFocusInvisible=!0,r.shadowColor=this.shadowColor,r.shadowBlur=this.shadowBlur,r.shadowOffsetX=this.shadowOffsetX,r.shadowOffsetY=this.shadowOffsetY,r.onPointerUpObservable.add((function(){i.onKeyPressObservable.notifyObservers(e)})),r},t.prototype.addKeysRow=function(e,t){var i=new o.StackPanel;i.isVertical=!1,i.isFocusInvisible=!0;for(var r=null,n=0;n<e.length;n++){var a=null;t&&t.length===e.length&&(a=t[n]);var s=this._createKey(e[n],a);(!r||s.heightInPixels>r.heightInPixels)&&(r=s),i.addControl(s)}i.height=r?r.height:this.defaultButtonHeight,this.addControl(i)},t.prototype.applyShiftState=function(e){if(this.children)for(var t=0;t<this.children.length;t++){var i=this.children[t];if(i&&i.children)for(var r=i,n=0;n<r.children.length;n++){var o=r.children[n];if(o&&o.children[0]){var a=o.children[0];"⇧"===a.text&&(o.color=e?this.shiftButtonColor:this.defaultButtonColor,o.thickness=e>1?this.selectedShiftThickness:0),a.text=e>0?a.text.toUpperCase():a.text.toLowerCase()}}}},Object.defineProperty(t.prototype,"connectedInputText",{get:function(){return this._currentlyConnectedInputText},enumerable:!1,configurable:!0}),t.prototype.connect=function(e){var t=this;if(!this._connectedInputTexts.some((function(t){return t.input===e}))){null===this._onKeyPressObserver&&(this._onKeyPressObserver=this.onKeyPressObservable.add((function(e){if(t._currentlyConnectedInputText){switch(t._currentlyConnectedInputText._host.focusedControl=t._currentlyConnectedInputText,e){case"⇧":return t.shiftState++,t.shiftState>2&&(t.shiftState=0),void t.applyShiftState(t.shiftState);case"←":return void(t._currentlyConnectedInputText instanceof s.InputTextArea?t._currentlyConnectedInputText.alternativeProcessKey("Backspace"):t._currentlyConnectedInputText.processKey(8));case"↵":return void(t._currentlyConnectedInputText instanceof s.InputTextArea?t._currentlyConnectedInputText.alternativeProcessKey("Enter"):t._currentlyConnectedInputText.processKey(13))}t._currentlyConnectedInputText instanceof s.InputTextArea?t._currentlyConnectedInputText.alternativeProcessKey("",t.shiftState?e.toUpperCase():e):t._currentlyConnectedInputText.processKey(-1,t.shiftState?e.toUpperCase():e),1===t.shiftState&&(t.shiftState=0,t.applyShiftState(t.shiftState))}}))),this.isVisible=!1,this._currentlyConnectedInputText=e,e._connectedVirtualKeyboard=this;var i=e.onFocusObservable.add((function(){t._currentlyConnectedInputText=e,e._connectedVirtualKeyboard=t,t.isVisible=!0})),r=e.onBlurObservable.add((function(){e._connectedVirtualKeyboard=null,t._currentlyConnectedInputText=null,t.isVisible=!1}));this._connectedInputTexts.push({input:e,onBlurObserver:r,onFocusObserver:i})}},t.prototype.disconnect=function(e){var t=this;if(e){var i=this._connectedInputTexts.filter((function(t){return t.input===e}));1===i.length&&(this._removeConnectedInputObservables(i[0]),this._connectedInputTexts=this._connectedInputTexts.filter((function(t){return t.input!==e})),this._currentlyConnectedInputText===e&&(this._currentlyConnectedInputText=null))}else this._connectedInputTexts.forEach((function(e){t._removeConnectedInputObservables(e)})),this._connectedInputTexts.length=0;0===this._connectedInputTexts.length&&(this._currentlyConnectedInputText=null,this.onKeyPressObservable.remove(this._onKeyPressObserver),this._onKeyPressObserver=null)},t.prototype._removeConnectedInputObservables=function(e){e.input._connectedVirtualKeyboard=null,e.input.onFocusObservable.remove(e.onFocusObserver),e.input.onBlurObservable.remove(e.onBlurObserver)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.disconnect()},t.CreateDefaultLayout=function(e){var i=new t(e);return i.addKeysRow(["1","2","3","4","5","6","7","8","9","0","←"]),i.addKeysRow(["q","w","e","r","t","y","u","i","o","p"]),i.addKeysRow(["a","s","d","f","g","h","j","k","l",";","'","↵"]),i.addKeysRow(["⇧","z","x","c","v","b","n","m",",",".","/"]),i.addKeysRow([" "],[{width:"200px"}]),i},t.prototype._parseFromContent=function(t,i){var r=this;e.prototype._parseFromContent.call(this,t,i);for(var n=0,o=this.children;n<o.length;n++){var a=o[n];if("StackPanel"===a.getClassName())for(var s=function(e){"Button"===e.getClassName()&&e.name&&e.onPointerUpObservable.add((function(){r.onKeyPressObservable.notifyObservers(e.name)}))},l=0,c=a.children;l<c.length;l++)s(c[l])}},t}(o.StackPanel);(0,n.RegisterClass)("BABYLON.GUI.VirtualKeyboard",c)},"../../../dev/gui/src/2D/index.ts":(e,t,i)=>{i.r(t),i.d(t,{AdvancedDynamicTexture:()=>n.AdvancedDynamicTexture,AdvancedDynamicTextureInstrumentation:()=>o.AdvancedDynamicTextureInstrumentation,BaseGradient:()=>r.BaseGradient,BaseSlider:()=>r.BaseSlider,Button:()=>r.Button,Checkbox:()=>r.Checkbox,CheckboxGroup:()=>r.CheckboxGroup,ColorPicker:()=>r.ColorPicker,Container:()=>r.Container,Control:()=>r.Control,DisplayGrid:()=>r.DisplayGrid,Ellipse:()=>r.Ellipse,FocusableButton:()=>r.FocusableButton,Grid:()=>r.Grid,Image:()=>r.Image,ImageBasedSlider:()=>r.ImageBasedSlider,ImageScrollBar:()=>r.ImageScrollBar,InputPassword:()=>r.InputPassword,InputText:()=>r.InputText,InputTextArea:()=>r.InputTextArea,KeyPropertySet:()=>r.KeyPropertySet,Line:()=>r.Line,LinearGradient:()=>r.LinearGradient,MathTools:()=>a.MathTools,Matrix2D:()=>a.Matrix2D,Measure:()=>s.Measure,MultiLine:()=>r.MultiLine,MultiLinePoint:()=>l.MultiLinePoint,RadialGradient:()=>r.RadialGradient,RadioButton:()=>r.RadioButton,RadioGroup:()=>r.RadioGroup,Rectangle:()=>r.Rectangle,ScrollBar:()=>r.ScrollBar,ScrollViewer:()=>r.ScrollViewer,SelectionPanel:()=>r.SelectionPanel,SelectorGroup:()=>r.SelectorGroup,Slider:()=>r.Slider,SliderGroup:()=>r.SliderGroup,StackPanel:()=>r.StackPanel,Style:()=>c.Style,TextBlock:()=>r.TextBlock,TextWrapper:()=>r.TextWrapper,TextWrapping:()=>r.TextWrapping,ToggleButton:()=>r.ToggleButton,ValueAndUnit:()=>u.ValueAndUnit,Vector2WithInfo:()=>a.Vector2WithInfo,VirtualKeyboard:()=>r.VirtualKeyboard,XmlLoader:()=>h.XmlLoader,name:()=>r.name});var r=i("../../../dev/gui/src/2D/controls/index.ts"),n=i("../../../dev/gui/src/2D/advancedDynamicTexture.ts"),o=i("../../../dev/gui/src/2D/adtInstrumentation.ts"),a=i("../../../dev/gui/src/2D/math2D.ts"),s=i("../../../dev/gui/src/2D/measure.ts"),l=i("../../../dev/gui/src/2D/multiLinePoint.ts"),c=i("../../../dev/gui/src/2D/style.ts"),u=i("../../../dev/gui/src/2D/valueAndUnit.ts"),h=i("../../../dev/gui/src/2D/xmlLoader.ts")},"../../../dev/gui/src/2D/math2D.ts":(e,t,i)=>{i.r(t),i.d(t,{MathTools:()=>s,Matrix2D:()=>a,Vector2WithInfo:()=>o});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=function(e){function t(t,i){void 0===i&&(i=0);var r=e.call(this,t.x,t.y)||this;return r.buttonIndex=i,r}return(0,r.__extends)(t,e),t}(n.Vector2),a=function(){function e(e,t,i,r,n,o){this.m=new Float32Array(6),this.fromValues(e,t,i,r,n,o)}return e.prototype.fromValues=function(e,t,i,r,n,o){return this.m[0]=e,this.m[1]=t,this.m[2]=i,this.m[3]=r,this.m[4]=n,this.m[5]=o,this},e.prototype.determinant=function(){return this.m[0]*this.m[3]-this.m[1]*this.m[2]},e.prototype.invertToRef=function(e){var t=this.m[0],i=this.m[1],r=this.m[2],o=this.m[3],a=this.m[4],s=this.m[5],l=this.determinant();if(l<n.Epsilon*n.Epsilon)return e.m[0]=0,e.m[1]=0,e.m[2]=0,e.m[3]=0,e.m[4]=0,e.m[5]=0,this;var c=1/l,u=r*s-o*a,h=i*a-t*s;return e.m[0]=o*c,e.m[1]=-i*c,e.m[2]=-r*c,e.m[3]=t*c,e.m[4]=u*c,e.m[5]=h*c,this},e.prototype.multiplyToRef=function(e,t){var i=this.m[0],r=this.m[1],n=this.m[2],o=this.m[3],a=this.m[4],s=this.m[5],l=e.m[0],c=e.m[1],u=e.m[2],h=e.m[3],d=e.m[4],_=e.m[5];return t.m[0]=i*l+r*u,t.m[1]=i*c+r*h,t.m[2]=n*l+o*u,t.m[3]=n*c+o*h,t.m[4]=a*l+s*u+d,t.m[5]=a*c+s*h+_,this},e.prototype.transformCoordinates=function(e,t,i){return i.x=e*this.m[0]+t*this.m[2]+this.m[4],i.y=e*this.m[1]+t*this.m[3]+this.m[5],this},e.Identity=function(){return new e(1,0,0,1,0,0)},e.IdentityToRef=function(e){e.m[0]=1,e.m[1]=0,e.m[2]=0,e.m[3]=1,e.m[4]=0,e.m[5]=0},e.TranslationToRef=function(e,t,i){i.fromValues(1,0,0,1,e,t)},e.ScalingToRef=function(e,t,i){i.fromValues(e,0,0,t,0,0)},e.RotationToRef=function(e,t){var i=Math.sin(e),r=Math.cos(e);t.fromValues(r,i,-i,r,0,0)},e.ComposeToRef=function(t,i,r,n,o,a,s){e.TranslationToRef(t,i,e._TempPreTranslationMatrix),e.ScalingToRef(n,o,e._TempScalingMatrix),e.RotationToRef(r,e._TempRotationMatrix),e.TranslationToRef(-t,-i,e._TempPostTranslationMatrix),e._TempPreTranslationMatrix.multiplyToRef(e._TempScalingMatrix,e._TempCompose0),e._TempCompose0.multiplyToRef(e._TempRotationMatrix,e._TempCompose1),a?(e._TempCompose1.multiplyToRef(e._TempPostTranslationMatrix,e._TempCompose2),e._TempCompose2.multiplyToRef(a,s)):e._TempCompose1.multiplyToRef(e._TempPostTranslationMatrix,s)},e._TempPreTranslationMatrix=e.Identity(),e._TempPostTranslationMatrix=e.Identity(),e._TempRotationMatrix=e.Identity(),e._TempScalingMatrix=e.Identity(),e._TempCompose0=e.Identity(),e._TempCompose1=e.Identity(),e._TempCompose2=e.Identity(),e}(),s=function(){function e(){}return e.Round=function(t,i){return void 0===i&&(i=e.DefaultRoundingPrecision),Math.round(t*i)/i},e.DefaultRoundingPrecision=100,e}()},"../../../dev/gui/src/2D/measure.ts":(e,t,i)=>{i.r(t),i.d(t,{Measure:()=>l});var r=i("babylonjs/Misc/perfCounter"),n=[new r.Vector2(0,0),new r.Vector2(0,0),new r.Vector2(0,0),new r.Vector2(0,0)],o=[new r.Vector2(0,0),new r.Vector2(0,0),new r.Vector2(0,0),new r.Vector2(0,0)],a=new r.Vector2(0,0),s=new r.Vector2(0,0),l=function(){function e(e,t,i,r){this.left=e,this.top=t,this.width=i,this.height=r}return e.prototype.copyFrom=function(e){this.left=e.left,this.top=e.top,this.width=e.width,this.height=e.height},e.prototype.copyFromFloats=function(e,t,i,r){this.left=e,this.top=t,this.width=i,this.height=r},e.CombineToRef=function(e,t,i){var r=Math.min(e.left,t.left),n=Math.min(e.top,t.top),o=Math.max(e.left+e.width,t.left+t.width),a=Math.max(e.top+e.height,t.top+t.height);i.left=r,i.top=n,i.width=o-r,i.height=a-n},e.prototype.addAndTransformToRef=function(e,t,i,r,l,c){var u=this.left+t,h=this.top+i,d=this.width+r,_=this.height+l;n[0].copyFromFloats(u,h),n[1].copyFromFloats(u+d,h),n[2].copyFromFloats(u+d,h+_),n[3].copyFromFloats(u,h+_),a.copyFromFloats(Number.MAX_VALUE,Number.MAX_VALUE),s.copyFromFloats(0,0);for(var f=0;f<4;f++)e.transformCoordinates(n[f].x,n[f].y,o[f]),a.x=Math.floor(Math.min(a.x,o[f].x)),a.y=Math.floor(Math.min(a.y,o[f].y)),s.x=Math.ceil(Math.max(s.x,o[f].x)),s.y=Math.ceil(Math.max(s.y,o[f].y));c.left=a.x,c.top=a.y,c.width=s.x-a.x,c.height=s.y-a.y},e.prototype.transformToRef=function(e,t){this.addAndTransformToRef(e,0,0,0,0,t)},e.prototype.isEqualsTo=function(e){return this.left===e.left&&this.top===e.top&&this.width===e.width&&this.height===e.height},e.Empty=function(){return new e(0,0,0,0)},e}()},"../../../dev/gui/src/2D/multiLinePoint.ts":(e,t,i)=>{i.r(t),i.d(t,{MultiLinePoint:()=>o});var r=i("babylonjs/Misc/perfCounter"),n=i("../../../dev/gui/src/2D/valueAndUnit.ts"),o=function(){function e(e){this._multiLine=e,this._x=new n.ValueAndUnit(0),this._y=new n.ValueAndUnit(0),this._point=new r.Vector3(0,0,0)}return Object.defineProperty(e.prototype,"x",{get:function(){return this._x.toString(this._multiLine._host)},set:function(e){this._x.toString(this._multiLine._host)!==e&&this._x.fromString(e)&&this._multiLine._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y.toString(this._multiLine._host)},set:function(e){this._y.toString(this._multiLine._host)!==e&&this._y.fromString(e)&&this._multiLine._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this._control},set:function(e){this._control!==e&&(this._control&&this._controlObserver&&(this._control.onDirtyObservable.remove(this._controlObserver),this._controlObserver=null),this._control=e,this._control&&(this._controlObserver=this._control.onDirtyObservable.add(this._multiLine.onPointUpdate)),this._multiLine._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mesh",{get:function(){return this._mesh},set:function(e){this._mesh!==e&&(this._mesh&&this._meshObserver&&this._mesh.getScene().onAfterCameraRenderObservable.remove(this._meshObserver),this._mesh=e,this._mesh&&(this._meshObserver=this._mesh.getScene().onAfterCameraRenderObservable.add(this._multiLine.onPointUpdate)),this._multiLine._markAsDirty())},enumerable:!1,configurable:!0}),e.prototype.resetLinks=function(){this.control=null,this.mesh=null},e.prototype.translate=function(){return this._point=this._translatePoint(),this._point},e.prototype._translatePoint=function(){if(null!=this._mesh)return this._multiLine._host.getProjectedPositionWithZ(this._mesh.getBoundingInfo().boundingSphere.center,this._mesh.getWorldMatrix());if(null!=this._control)return new r.Vector3(this._control.centerX,this._control.centerY,1-r.Epsilon);var e=this._multiLine._host,t=this._x.getValueInPixel(e,Number(e._canvas.width)),i=this._y.getValueInPixel(e,Number(e._canvas.height));return new r.Vector3(t,i,1-r.Epsilon)},e.prototype.dispose=function(){this.resetLinks()},e}()},"../../../dev/gui/src/2D/style.ts":(e,t,i)=>{i.r(t),i.d(t,{Style:()=>o});var r=i("babylonjs/Misc/perfCounter"),n=i("../../../dev/gui/src/2D/valueAndUnit.ts"),o=function(){function e(e){this._fontFamily="Arial",this._fontStyle="",this._fontWeight="",this._fontSize=new n.ValueAndUnit(18,n.ValueAndUnit.UNITMODE_PIXEL,!1),this.onChangedObservable=new r.Observable,this._host=e}return Object.defineProperty(e.prototype,"fontSize",{get:function(){return this._fontSize.toString(this._host)},set:function(e){this._fontSize.toString(this._host)!==e&&this._fontSize.fromString(e)&&this.onChangedObservable.notifyObservers(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(e){this._fontFamily!==e&&(this._fontFamily=e,this.onChangedObservable.notifyObservers(this))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(e){this._fontStyle!==e&&(this._fontStyle=e,this.onChangedObservable.notifyObservers(this))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(e){this._fontWeight!==e&&(this._fontWeight=e,this.onChangedObservable.notifyObservers(this))},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this.onChangedObservable.clear()},e}()},"../../../dev/gui/src/2D/valueAndUnit.ts":(e,t,i)=>{i.r(t),i.d(t,{ValueAndUnit:()=>n});var r=i("babylonjs/Misc/perfCounter"),n=function(){function e(t,i,n){void 0===i&&(i=e.UNITMODE_PIXEL),void 0===n&&(n=!0),this.negativeValueAllowed=n,this._value=1,this._unit=e.UNITMODE_PIXEL,this.ignoreAdaptiveScaling=!1,this.onChangedObservable=new r.Observable,this._value=t,this._unit=i,this._originalUnit=i}return Object.defineProperty(e.prototype,"isPercentage",{get:function(){return this._unit===e.UNITMODE_PERCENTAGE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPixel",{get:function(){return this._unit===e.UNITMODE_PIXEL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"internalValue",{get:function(){return this._value},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){e!==this._value&&(this._value=e,this.onChangedObservable.notifyObservers())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unit",{get:function(){return this._unit},set:function(e){e!==this._unit&&(this._unit=e,this.onChangedObservable.notifyObservers())},enumerable:!1,configurable:!0}),e.prototype.getValueInPixel=function(e,t){return this.isPixel?this.getValue(e):this.getValue(e)*t},e.prototype.updateInPlace=function(t,i){return void 0===i&&(i=e.UNITMODE_PIXEL),this.value===t&&this.unit===i||(this._value=t,this._unit=i,this.onChangedObservable.notifyObservers()),this},e.prototype.getValue=function(t){if(t&&!this.ignoreAdaptiveScaling&&this.unit!==e.UNITMODE_PERCENTAGE){var i=0,r=0;if(t.idealWidth&&(i=Math.ceil(this._value*t.getSize().width/t.idealWidth)),t.idealHeight&&(r=Math.ceil(this._value*t.getSize().height/t.idealHeight)),t.useSmallestIdeal&&t.idealWidth&&t.idealHeight)return window.innerWidth<window.innerHeight?i:r;if(t.idealWidth)return i;if(t.idealHeight)return r}return this._value},e.prototype.toString=function(t,i){switch(this._unit){case e.UNITMODE_PERCENTAGE:var r=100*this.getValue(t);return(i?r.toFixed(i):r)+"%";case e.UNITMODE_PIXEL:var n=this.getValue(t);return(i?n.toFixed(i):n)+"px"}return this._unit.toString()},e.prototype.fromString=function(t){var i=e._Regex.exec(t.toString());if(!i||0===i.length)return!1;var r=parseFloat(i[1]),n=this._originalUnit;if(this.negativeValueAllowed||r<0&&(r=0),4===i.length)switch(i[3]){case"px":n=e.UNITMODE_PIXEL;break;case"%":n=e.UNITMODE_PERCENTAGE,r/=100}return(r!==this._value||n!==this._unit)&&(this._value=r,this._unit=n,this.onChangedObservable.notifyObservers(),!0)},Object.defineProperty(e,"UNITMODE_PERCENTAGE",{get:function(){return e._UNITMODE_PERCENTAGE},enumerable:!1,configurable:!0}),Object.defineProperty(e,"UNITMODE_PIXEL",{get:function(){return e._UNITMODE_PIXEL},enumerable:!1,configurable:!0}),e._Regex=/(^-?\d*(\.\d+)?)(%|px)?/,e._UNITMODE_PERCENTAGE=0,e._UNITMODE_PIXEL=1,e}()},"../../../dev/gui/src/2D/xmlLoader.ts":(e,t,i)=>{i.r(t),i.d(t,{XmlLoader:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o="XmlLoader Exception : XML file is malformed or corrupted.",a=function(){function e(e){void 0===e&&(e=null),this._nodes={},this._nodeTypes={element:1,attribute:2,text:3},this._isLoaded=!1,this._objectAttributes={textHorizontalAlignment:1,textVerticalAlignment:2,horizontalAlignment:3,verticalAlignment:4,stretch:5},e&&(this._parentClass=e)}return e.prototype._getChainElement=function(e){var t=window;this._parentClass&&(t=this._parentClass);var i=e;i=i.split(".");for(var r=0;r<i.length;r++)t=t[i[r]];return t},e.prototype._getClassAttribute=function(e){var t=e.split(".");return(0,n.GetClass)("BABYLON.GUI."+t[0])[t[1]]},e.prototype._createGuiElement=function(e,t,i){void 0===i&&(i=!0);try{var r=new((0,n.GetClass)("BABYLON.GUI."+e.nodeName));t&&i&&t.addControl(r);for(var o=0;o<e.attributes.length;o++)if(!e.attributes[o].name.toLowerCase().includes("datasource"))if(e.attributes[o].name.toLowerCase().includes("observable")){var a=this._getChainElement(e.attributes[o].value);r[e.attributes[o].name].add(a)}else if("linkWithMesh"==e.attributes[o].name)this._parentClass?r.linkWithMesh(this._parentClass[e.attributes[o].value]):r.linkWithMesh(window[e.attributes[o].value]);else if(e.attributes[o].value.match(/{{.*}}/)){var s=e.attributes[o].value.match(/{{(.*)}}/);a=e.attributes[o].value.replace(/{{.*}}/,"".concat(this._getChainElement(s[1]))),r[e.attributes[o].name]=a}else this._objectAttributes[e.attributes[o].name]?r[e.attributes[o].name]=this._getClassAttribute(e.attributes[o].value):"true"==e.attributes[o].value||"false"==e.attributes[o].value?r[e.attributes[o].name]="true"==e.attributes[o].value:r[e.attributes[o].name]=isNaN(Number(e.attributes[o].value))?e.attributes[o].value:Number(e.attributes[o].value);if(!e.attributes.getNamedItem("id"))return this._nodes[e.nodeName+Object.keys(this._nodes).length+"_gen"]=r,r;var l=e.attributes.getNamedItem("id").value;if(l.startsWith("{{")&&l.endsWith("}}")&&(l=this._getChainElement(l.substring(2,l.length-2))),this._nodes[l])throw"XmlLoader Exception : Duplicate ID, every element should have an unique ID attribute";return this._nodes[l]=r,r}catch(t){throw"XmlLoader Exception : Error parsing Control "+e.nodeName+","+t+"."}},e.prototype._parseGrid=function(e,t,i){for(var r,n,o,a,s,l=e.children,c=!1,u=-1,h=-1,d=0,_=0;_<l.length;_++)if(l[_].nodeType==this._nodeTypes.element){if("Row"!=l[_].nodeName)throw"XmlLoader Exception : Expecting Row node, received "+l[_].nodeName;if(u+=1,o=l[_].children,!l[_].attributes.getNamedItem("height"))throw"XmlLoader Exception : Height must be defined for grid rows";n=Number(l[_].attributes.getNamedItem("height").nodeValue),c=!!l[_].attributes.getNamedItem("isPixel")&&JSON.parse(l[_].attributes.getNamedItem("isPixel").nodeValue),t.addRowDefinition(n,c);for(var f=0;f<o.length;f++)if(o[f].nodeType==this._nodeTypes.element){if("Column"!=o[f].nodeName)throw"XmlLoader Exception : Expecting Column node, received "+o[f].nodeName;if(h+=1,u>0&&h>d)throw"XmlLoader Exception : In the Grid element, the number of columns is defined in the first row, do not add more columns in the subsequent rows.";if(0==u){if(!o[f].attributes.getNamedItem("width"))throw"XmlLoader Exception : Width must be defined for all the grid columns in the first row";r=Number(o[f].attributes.getNamedItem("width").nodeValue),c=!!o[f].attributes.getNamedItem("isPixel")&&JSON.parse(o[f].attributes.getNamedItem("isPixel").nodeValue),t.addColumnDefinition(r,c)}a=o[f].children;for(var p=0;p<a.length;p++)a[p].nodeType==this._nodeTypes.element&&(s=this._createGuiElement(a[p],t,!1),t.addControl(s,u,h),a[p].firstChild&&this._parseXml(a[p].firstChild,s))}0==u&&(d=h),h=-1}e.nextSibling&&this._parseXml(e.nextSibling,i)},e.prototype._parseElement=function(e,t,i){e.firstChild&&this._parseXml(e.firstChild,t),e.nextSibling&&this._parseXml(e.nextSibling,i)},e.prototype._prepareSourceElement=function(e,t,i,r,n){this._parentClass?this._parentClass[i]=r[n]:window[i]=r[n],e.firstChild&&this._parseXml(e.firstChild,t,!0)},e.prototype._parseElementsFromSource=function(e,t,i){var r=e.attributes.getNamedItem("dataSource").value;if(!r.includes(" in "))throw"XmlLoader Exception : Malformed XML, Data Source must include an in";var n=!0,o=r.split(" in ");if(o.length<2)throw"XmlLoader Exception : Malformed XML, Data Source must have an iterator and a source";var a=o[1];if(a.startsWith("{")&&a.endsWith("}")&&(n=!1),(!n||a.startsWith("[")&&a.endsWith("]"))&&(a=a.substring(1,a.length-1)),a=this._parentClass?this._parentClass[a]:window[a],n)for(var s=0;s<a.length;s++)this._prepareSourceElement(e,t,o[0],a,s);else for(var s in a)this._prepareSourceElement(e,t,o[0],a,s);e.nextSibling&&this._parseXml(e.nextSibling,i)},e.prototype._parseXml=function(e,t,i){if(void 0===i&&(i=!1),e.nodeType==this._nodeTypes.element){i&&e.setAttribute("id",t.id+(t._children.length+1));var r=this._createGuiElement(e,t);this._rootNode||(this._rootNode=r),"Grid"==e.nodeName?this._parseGrid(e,r,t):e.attributes.getNamedItem("dataSource")?this._parseElementsFromSource(e,r,t):this._parseElement(e,r,t)}else e.nextSibling&&this._parseXml(e.nextSibling,t,i)},e.prototype.isLoaded=function(){return this._isLoaded},e.prototype.getNodeById=function(e){return this._nodes[e]},e.prototype.getNodes=function(){return this._nodes},e.prototype.dispose=function(){this._rootNode&&(this._rootNode.dispose(),this._rootNode=null,this._nodes={})},e.prototype.loadLayout=function(e,t,i,r){var n=this;void 0===i&&(i=null),void 0===r&&(r=null);var a=new XMLHttpRequest;a.onload=function(){if(4===a.readyState&&200===a.status){if(!a.responseXML){if(r)return void r(o);throw o}var e=a.responseXML.documentElement;n._parseXml(e.firstChild,t),n._isLoaded=!0,i&&i()}},a.onerror=function(){r&&r("an error occurred during loading the layout")},a.open("GET",e,!0),a.send()},e.prototype.loadLayoutAsync=function(e,t){return(0,r.__awaiter)(this,void 0,void 0,(function(){var i=this;return(0,r.__generator)(this,(function(r){return[2,new Promise((function(r,n){i.loadLayout(e,t,r,n)}))]}))}))},e}()},"../../../dev/gui/src/3D/behaviors/defaultBehavior.ts":(e,t,i)=>{i.r(t),i.d(t,{DefaultBehavior:()=>n});var r=i("babylonjs/Misc/perfCounter"),n=function(){function e(){this.followBehaviorEnabled=!1,this.sixDofDragBehaviorEnabled=!0,this.surfaceMagnetismBehaviorEnabled=!0,this._followBehavior=new r.FollowBehavior,this._sixDofDragBehavior=new r.SixDofDragBehavior,this._surfaceMagnetismBehavior=new r.SurfaceMagnetismBehavior}return Object.defineProperty(e.prototype,"name",{get:function(){return"Default"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"followBehavior",{get:function(){return this._followBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sixDofDragBehavior",{get:function(){return this._sixDofDragBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"surfaceMagnetismBehavior",{get:function(){return this._surfaceMagnetismBehavior},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(e,t,i){this._scene=e.getScene(),this.attachedNode=e,this._addObservables(),this._followBehavior.attach(e),this._sixDofDragBehavior.attach(e),this._sixDofDragBehavior.draggableMeshes=t||null,this._sixDofDragBehavior.faceCameraOnDragStart=!0,this._surfaceMagnetismBehavior.attach(e,this._scene),i&&(this._surfaceMagnetismBehavior.meshes=i),this._surfaceMagnetismBehavior.enabled=!1},e.prototype.detach=function(){this.attachedNode=null,this._removeObservables(),this._followBehavior.detach(),this._sixDofDragBehavior.detach(),this._surfaceMagnetismBehavior.detach()},e.prototype._addObservables=function(){var e=this;this._onBeforeRenderObserver=this._scene.onBeforeRenderObservable.add((function(){e._followBehavior._enabled=!e._sixDofDragBehavior.isMoving&&e.followBehaviorEnabled})),this._onDragObserver=this._sixDofDragBehavior.onDragObservable.add((function(t){e._sixDofDragBehavior.disableMovement=e._surfaceMagnetismBehavior.findAndUpdateTarget(t.pickInfo)}))},e.prototype._removeObservables=function(){this._scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._sixDofDragBehavior.onDragObservable.remove(this._onDragObserver)},e}()},"../../../dev/gui/src/3D/controls/MRTK3/touchHolographicButton.ts":(e,t,i)=>{i.r(t),i.d(t,{TouchHolographicButton:()=>m});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/advancedDynamicTexture.ts"),o=i("babylonjs/Misc/perfCounter"),a=i("../../../dev/gui/src/2D/controls/control.ts"),s=i("../../../dev/gui/src/2D/controls/grid.ts"),l=i("../../../dev/gui/src/2D/controls/image.ts"),c=i("../../../dev/gui/src/3D/materials/mrdl/mrdlBackglowMaterial.ts"),u=i("../../../dev/gui/src/3D/materials/mrdl/mrdlBackplateMaterial.ts"),h=i("../../../dev/gui/src/3D/materials/mrdl/mrdlFrontplateMaterial.ts"),d=i("../../../dev/gui/src/3D/materials/mrdl/mrdlInnerquadMaterial.ts"),_=i("../../../dev/gui/src/2D/controls/rectangle.ts"),f=i("../../../dev/gui/src/2D/controls/stackPanel.ts"),p=i("../../../dev/gui/src/2D/controls/textBlock.ts"),m=function(e){function t(t,i){void 0===i&&(i=!0);var r=e.call(this,t)||this;return r.width=1,r.height=1,r.radius=.14,r.textSizeInPixels=18,r.imageSizeInPixels=40,r.plateMaterialColor=new o.Color3(.4,.4,.4),r.frontPlateDepth=.2,r.backPlateDepth=.04,r.backGlowOffset=.1,r.flatPlaneDepth=.001,r.innerQuadRadius=r.radius-.04,r.innerQuadColor=new o.Color4(0,0,0,0),r.innerQuadToggledColor=new o.Color4(.5197843,.6485234,.9607843,.6),r.innerQuadHoverColor=new o.Color4(1,1,1,.05),r.innerQuadToggledHoverColor=new o.Color4(.5197843,.6485234,.9607843,1),r._isBackplateVisible=!0,r._shareMaterials=!0,r._shareMaterials=i,r.pointerEnterAnimation=function(){r._frontPlate&&r._textPlate&&!r.isToggleButton&&r._performEnterExitAnimation(1),r.isToggleButton&&r._innerQuadMaterial&&(r.isToggled?r._innerQuadMaterial.color=r.innerQuadToggledHoverColor:r._innerQuadMaterial.color=r.innerQuadHoverColor)},r.pointerOutAnimation=function(){r._frontPlate&&r._textPlate&&!r.isToggleButton&&r._performEnterExitAnimation(-.8),r.isToggleButton&&r._innerQuadMaterial&&r._onToggle(r.isToggled)},r.pointerDownAnimation=function(){},r.pointerUpAnimation=function(){},r._pointerClickObserver=r.onPointerClickObservable.add((function(){r._frontPlate&&r._backGlow&&!r.isActiveNearInteraction&&r._performClickAnimation(),r.isToggleButton&&r._innerQuadMaterial&&r._onToggle(r.isToggled)})),r._pointerEnterObserver=r.onPointerEnterObservable.add((function(){r.pointerEnterAnimation()})),r._pointerOutObserver=r.onPointerOutObservable.add((function(){r.pointerOutAnimation()})),r._toggleObserver=r.onToggleObservable.add((function(e){r._innerQuadMaterial.color=e?r.innerQuadToggledColor:r.innerQuadColor})),r}return(0,r.__extends)(t,e),t.prototype._disposeTooltip=function(){this._tooltipFade=null,this._tooltipTextBlock&&this._tooltipTextBlock.dispose(),this._tooltipTexture&&this._tooltipTexture.dispose(),this._tooltipMesh&&this._tooltipMesh.dispose(),this.onPointerEnterObservable.remove(this._tooltipHoverObserver),this.onPointerOutObservable.remove(this._tooltipOutObserver)},Object.defineProperty(t.prototype,"renderingGroupId",{get:function(){return this._backPlate.renderingGroupId},set:function(e){this._backPlate.renderingGroupId=e,this._textPlate.renderingGroupId=e,this._frontPlate.renderingGroupId=e,this._backGlow.renderingGroupId=e,this._innerQuad.renderingGroupId=e,this._tooltipMesh&&(this._tooltipMesh.renderingGroupId=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mesh",{get:function(){return this._backPlate},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tooltipText",{get:function(){var e;return(null===(e=this._tooltipTextBlock)||void 0===e?void 0:e.text)||null},set:function(e){var t=this;if(e){if(!this._tooltipFade){var i=this._backPlate._scene.useRightHandedSystem;this._tooltipMesh=(0,o.CreatePlane)("",{size:1},this._backPlate._scene),this._tooltipMesh.position=o.Vector3.Down().scale(.7).add(o.Vector3.Forward(i).scale(-.15)),this._tooltipMesh.isPickable=!1,this._tooltipMesh.parent=this._frontPlateCollisionMesh,this._tooltipTexture=n.AdvancedDynamicTexture.CreateForMesh(this._tooltipMesh);var r=new _.Rectangle;r.height=.25,r.width=.8,r.cornerRadius=25,r.color="#ffffff",r.thickness=20,r.background="#060668",this._tooltipTexture.addControl(r),this._tooltipTextBlock=new p.TextBlock,this._tooltipTextBlock.color="white",this._tooltipTextBlock.fontSize=100,this._tooltipTexture.addControl(this._tooltipTextBlock),this._tooltipFade=new o.FadeInOutBehavior,this._tooltipFade.delay=500,this._tooltipMesh.addBehavior(this._tooltipFade),this._tooltipHoverObserver=this.onPointerEnterObservable.add((function(){t._tooltipFade&&t._tooltipFade.fadeIn(!0)})),this._tooltipOutObserver=this.onPointerOutObservable.add((function(){t._tooltipFade&&t._tooltipFade.fadeIn(!1)}))}this._tooltipTextBlock&&(this._tooltipTextBlock.text=e)}else this._disposeTooltip()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subtext",{get:function(){return this._subtext},set:function(e){this._subtext!==e&&(this._subtext=e,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageUrl",{get:function(){return this._imageUrl},set:function(e){this._imageUrl!==e&&(this._imageUrl=e,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backMaterial",{get:function(){return this._backMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frontMaterial",{get:function(){return this._frontMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backGlowMaterial",{get:function(){return this._backGlowMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"innerQuadMaterial",{get:function(){return this._innerQuadMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plateMaterial",{get:function(){return this._plateMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shareMaterials",{get:function(){return this._shareMaterials},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isBackplateVisible",{set:function(e){this.mesh&&this._backMaterial&&(e&&!this._isBackplateVisible?this._backPlate.visibility=1:!e&&this._isBackplateVisible&&(this._backPlate.visibility=0)),this._isBackplateVisible=e},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"TouchHolographicButton"},t.prototype._rebuildContent=function(){var e;e=this._getAspectRatio()<=1?this._alignContentVertically():this._alignContentHorizontally(),this.content=e},t.prototype._getAspectRatio=function(){return this.width/this.height},t.prototype._alignContentVertically=function(){var e=new f.StackPanel;if(e.isVertical=!0,(0,o.IsDocumentAvailable)()&&document.createElement&&this._imageUrl){var t=new l.Image;t.source=this._imageUrl,t.heightInPixels=180,t.widthInPixels=100,t.paddingTopInPixels=40,t.paddingBottomInPixels=40,e.addControl(t)}if(this._text){var i=new p.TextBlock;i.text=this._text,i.color="white",i.heightInPixels=30,i.fontSize=24,e.addControl(i)}return e},t.prototype._alignContentHorizontally=function(){var e=240,t=15,i=new _.Rectangle;i.widthInPixels=e,i.heightInPixels=e,i.color="transparent",i.setPaddingInPixels(t,t,t,t),e-=30;var r=new f.StackPanel;if(r.isVertical=!1,r.scaleY=this._getAspectRatio(),(0,o.IsDocumentAvailable)()&&document.createElement&&this._imageUrl){var n=new _.Rectangle("".concat(this.name,"_image"));n.widthInPixels=this.imageSizeInPixels,n.heightInPixels=this.imageSizeInPixels,n.color="transparent",e-=this.imageSizeInPixels;var c=new l.Image;c.source=this._imageUrl,n.addControl(c),r.addControl(n)}if(this._text){var u=new p.TextBlock("".concat(this.name,"_text"));if(u.text=this._text,u.color="white",u.fontSize=this.textSizeInPixels,u.widthInPixels=e,this._imageUrl&&(u.textHorizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,u.paddingLeftInPixels=t),this._subtext){var h=new s.Grid;h.addColumnDefinition(1),h.addRowDefinition(.5),h.addRowDefinition(.5),h.widthInPixels=e,h.heightInPixels=45;var d=new p.TextBlock("".concat(this.name,"_subtext"));d.text=this._subtext,d.color="#EEEEEEAB",d.fontSize=.75*this.textSizeInPixels,d.fontWeight="600",this._imageUrl&&(d.textHorizontalAlignment=a.Control.HORIZONTAL_ALIGNMENT_LEFT,d.paddingLeftInPixels=t),h.addControl(u,0),h.addControl(d,1),r.addControl(h)}else r.addControl(u)}return i.addControl(r),i},t.prototype._createNode=function(t){var i;this.name=null!==(i=this.name)&&void 0!==i?i:"TouchHolographicButton";var r=this._createBackPlate(t),n=this._createFrontPlate(t),a=this._createInnerQuad(t),s=this._createBackGlow(t);this._frontPlateCollisionMesh=n,this._textPlate=e.prototype._createNode.call(this,t),this._textPlate.name="".concat(this.name,"_textPlate"),this._textPlate.isPickable=!1,this._textPlate.scaling.x=this.width,this._textPlate.parent=n,this._backPlate=r,this._backPlate.position=o.Vector3.Forward(t.useRightHandedSystem).scale(this.backPlateDepth/2),this._backPlate.isPickable=!1,this._backPlate.addChild(n),this._backPlate.addChild(a),s&&this._backPlate.addChild(s);var l=new o.TransformNode("".concat(this.name,"_root"),t);return this._backPlate.setParent(l),this.collisionMesh=n,this.collidableFrontDirection=this._backPlate.forward.negate(),l},t.prototype._createBackPlate=function(e){var i=this,r=(0,o.CreateBox)("".concat(this.name,"_backPlate"),{},e);return r.isPickable=!1,r.visibility=0,r.scaling.z=.2,o.SceneLoader.ImportMeshAsync(void 0,t.MRTK_ASSET_BASE_URL,t.BACKPLATE_MODEL_FILENAME,e).then((function(e){var t=e.meshes[1];t.visibility=0,i._isBackplateVisible&&(t.visibility=1,t.name="".concat(i.name,"_backPlate"),t.isPickable=!1,t.scaling.x=i.width,t.scaling.y=i.height,t.parent=r),i._backMaterial&&(t.material=i._backMaterial),i._backPlate=t})),r},t.prototype._createFrontPlate=function(e){var i=this,r=(0,o.CreateBox)("".concat(this.name,"_frontPlate"),{width:this.width,height:this.height,depth:this.frontPlateDepth},e);return r.isPickable=!0,r.isNearPickable=!0,r.visibility=0,r.position=o.Vector3.Forward(e.useRightHandedSystem).scale((this.backPlateDepth-this.frontPlateDepth)/2),o.SceneLoader.ImportMeshAsync(void 0,t.MRTK_ASSET_BASE_URL,t.FRONTPLATE_MODEL_FILENAME,e).then((function(t){var n=(0,o.CreateBox)("".concat(i.name,"_collisionPlate"),{width:i.width,height:i.height},e);n.isPickable=!1,n.scaling.z=i.frontPlateDepth,n.visibility=0,n.parent=r,i._collisionPlate=n;var a=t.meshes[1];a.name="".concat(i.name,"_frontPlate"),a.isPickable=!1,a.scaling.x=i.width-i.backGlowOffset,a.scaling.y=i.height-i.backGlowOffset,a.position=o.Vector3.Forward(e.useRightHandedSystem).scale(-.5),a.parent=n,i.isToggleButton&&(a.visibility=0),i._frontMaterial&&(a.material=i._frontMaterial),i._textPlate.scaling.x=1,i._textPlate.parent=a,i._frontPlate=a})),r},t.prototype._createInnerQuad=function(e){var i=this,r=(0,o.CreateBox)("".concat(this.name,"_innerQuad"),{},e);return r.isPickable=!1,r.visibility=0,r.scaling.z=this.flatPlaneDepth,r.position.z+=this.backPlateDepth/2-this.flatPlaneDepth,o.SceneLoader.ImportMeshAsync(void 0,t.MRTK_ASSET_BASE_URL,t.INNERQUAD_MODEL_FILENAME,e).then((function(e){var t=e.meshes[1];t.name="".concat(i.name,"_innerQuad"),t.isPickable=!1,t.scaling.x=i.width-i.backGlowOffset,t.scaling.y=i.height-i.backGlowOffset,t.parent=r,i._innerQuadMaterial&&(t.material=i._innerQuadMaterial),i._innerQuad=t})),r},t.prototype._createBackGlow=function(e){var i=this;if(!this.isToggleButton){var r=(0,o.CreateBox)("".concat(this.name,"_backGlow"),{},e);return r.isPickable=!1,r.visibility=0,r.scaling.z=this.flatPlaneDepth,r.position.z+=this.backPlateDepth/2-2*this.flatPlaneDepth,o.SceneLoader.ImportMeshAsync(void 0,t.MRTK_ASSET_BASE_URL,t.BACKGLOW_MODEL_FILENAME,e).then((function(e){var t=e.meshes[1];t.name="".concat(i.name,"_backGlow"),t.isPickable=!1,t.scaling.x=i.width-i.backGlowOffset,t.scaling.y=i.height-i.backGlowOffset,t.parent=r,i._backGlowMaterial&&(t.material=i._backGlowMaterial),i._backGlow=t})),r}},t.prototype._applyFacade=function(e){this._plateMaterial.emissiveTexture=e,this._plateMaterial.opacityTexture=e,this._plateMaterial.diffuseColor=this.plateMaterialColor},t.prototype._performClickAnimation=function(){for(var e=new o.AnimationGroup("Click Animation Group"),t=0,i=[{name:"backGlowMotion",mesh:this._backGlow,property:"material.motion",keys:[{frame:0,values:[0,0,0]},{frame:20,values:[1,.0144,.0144]},{frame:40,values:[.0027713229489760476,0,0]},{frame:45,values:[.0027713229489760476]}]},{name:"_collisionPlateZSlide",mesh:this._collisionPlate,property:"position.z",keys:[{frame:0,values:[0,0,0]},{frame:20,values:[o.Vector3.Forward(this._collisionPlate._scene.useRightHandedSystem).scale(this.frontPlateDepth/2).z,0,0]},{frame:40,values:[0,.005403332496794331]},{frame:45,values:[0]}]},{name:"_collisionPlateZScale",mesh:this._collisionPlate,property:"scaling.z",keys:[{frame:0,values:[this.frontPlateDepth,0,0]},{frame:20,values:[this.backPlateDepth,0,0]},{frame:40,values:[this.frontPlateDepth,.0054]},{frame:45,values:[this.frontPlateDepth]}]}];t<i.length;t++){for(var r=i[t],n=new o.Animation(r.name,r.property,60,o.Animation.ANIMATIONTYPE_FLOAT,o.Animation.ANIMATIONLOOPMODE_CYCLE),a=[],s=0,l=r.keys;s<l.length;s++){var c=l[s];a.push({frame:c.frame,value:c.values[0],inTangent:c.values[1],outTangent:c.values[2],interpolation:c.values[3]})}n.setKeys(a),r.mesh&&e.addTargetedAnimation(n,r.mesh)}e.normalize(0,45),e.speedRatio=1,e.play()},t.prototype._performEnterExitAnimation=function(e){for(var t=new o.AnimationGroup("Enter Exit Animation Group"),i=0,r=[{name:"frontPlateFadeOut",mesh:this._frontPlate,property:"material.fadeOut",keys:[{frame:0,values:[0,0,.025045314830017686,0]},{frame:40,values:[1.00205599570012,.025045314830017686,0,0]}]},{name:"textPlateZSlide",mesh:this._textPlate,property:"position.z",keys:[{frame:0,values:[0,0,0]},{frame:40,values:[o.Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-.15).z,0,0]}]}];i<r.length;i++){for(var n=r[i],a=new o.Animation(n.name,n.property,60,o.Animation.ANIMATIONTYPE_FLOAT,o.Animation.ANIMATIONLOOPMODE_CYCLE),s=[],l=0,c=n.keys;l<c.length;l++){var u=c[l];s.push({frame:u.frame,value:u.values[0],inTangent:u.values[1],outTangent:u.values[2],interpolation:u.values[3]})}a.setKeys(s),n.mesh&&t.addTargetedAnimation(a,n.mesh)}t.normalize(0,45),t.speedRatio=e,t.play()},t.prototype._createBackMaterial=function(e){var t;this._backMaterial=null!==(t=this._backMaterial)&&void 0!==t?t:new u.MRDLBackplateMaterial(this.name+"backPlateMaterial",e.getScene()),this._backMaterial.absoluteSizes=!0,this._backMaterial.radius=this.radius,this._backMaterial.lineWidth=.02},t.prototype._createFrontMaterial=function(e){var t;this._frontMaterial=null!==(t=this._frontMaterial)&&void 0!==t?t:new h.MRDLFrontplateMaterial(this.name+"Front Material",e.getScene()),this.frontMaterial.radius=this.innerQuadRadius,this.frontMaterial.fadeOut=0},t.prototype._createBackGlowMaterial=function(e){var t,i=this.radius+.04;this._backGlowMaterial=null!==(t=this._backGlowMaterial)&&void 0!==t?t:new c.MRDLBackglowMaterial(this.name+"Back Glow Material",e.getScene()),this._backGlowMaterial.bevelRadius=i,this._backGlowMaterial.lineWidth=i,this._backGlowMaterial.motion=0},t.prototype._createInnerQuadMaterial=function(e){var t;this._innerQuadMaterial=null!==(t=this._innerQuadMaterial)&&void 0!==t?t:new d.MRDLInnerquadMaterial("inner_quad",e.getScene()),this._innerQuadMaterial.radius=this.innerQuadRadius,this.isToggleButton&&(this._innerQuadMaterial.color=this.innerQuadColor)},t.prototype._createPlateMaterial=function(e){var t;this._plateMaterial=null!==(t=this._plateMaterial)&&void 0!==t?t:new o.StandardMaterial(this.name+"Plate Material",e.getScene()),this._plateMaterial.specularColor=o.Color3.Black()},t.prototype._onToggle=function(t){e.prototype._onToggle.call(this,t)},t.prototype._affectMaterial=function(e){this._shareMaterials?(this._host._touchSharedMaterials.mrdlBackplateMaterial?this._backMaterial=this._host._touchSharedMaterials.mrdlBackplateMaterial:(this._createBackMaterial(e),this._host._touchSharedMaterials.mrdlBackplateMaterial=this._backMaterial),this._host._touchSharedMaterials.mrdlFrontplateMaterial?this._frontMaterial=this._host._touchSharedMaterials.mrdlFrontplateMaterial:(this._createFrontMaterial(e),this._host._touchSharedMaterials.mrdlFrontplateMaterial=this._frontMaterial),this._host._touchSharedMaterials.mrdlBackglowMaterial?this._backGlowMaterial=this._host._touchSharedMaterials.mrdlBackglowMaterial:(this._createBackGlowMaterial(e),this._host._touchSharedMaterials.mrdlBackglowMaterial=this._backGlowMaterial),this._host._touchSharedMaterials.mrdlInnerQuadMaterial?this._innerQuadMaterial=this._host._touchSharedMaterials.mrdlInnerQuadMaterial:(this._createInnerQuadMaterial(e),this._host._touchSharedMaterials.mrdlInnerQuadMaterial=this._innerQuadMaterial)):(this._createBackMaterial(e),this._createFrontMaterial(e),this._createBackGlowMaterial(e),this._createInnerQuadMaterial(e)),this._createPlateMaterial(e),this._backPlate.material=this._backMaterial,this._textPlate.material=this._plateMaterial,this._isBackplateVisible||(this._backPlate.visibility=0),this._frontPlate&&(this._frontPlate.material=this._frontMaterial),this._backGlow&&(this._backGlow.material=this._backGlowMaterial),this._innerQuad&&(this._innerQuad.material=this._innerQuadMaterial),this._rebuildContent()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._disposeTooltip(),this.onPointerClickObservable.remove(this._pointerClickObserver),this.onPointerEnterObservable.remove(this._pointerEnterObserver),this.onPointerOutObservable.remove(this._pointerOutObserver),this.onToggleObservable.remove(this._toggleObserver),this.shareMaterials||(this._backMaterial.dispose(),this._frontMaterial.dispose(),this._plateMaterial.dispose(),this._backGlowMaterial.dispose(),this._innerQuadMaterial.dispose(),this._pickedPointObserver&&(this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver),this._pickedPointObserver=null))},t.MRTK_ASSET_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",t.FRONTPLATE_MODEL_FILENAME="mrtk-fluent-frontplate.glb",t.BACKPLATE_MODEL_FILENAME="mrtk-fluent-backplate.glb",t.BACKGLOW_MODEL_FILENAME="mrtk-fluent-button.glb",t.INNERQUAD_MODEL_FILENAME="SlateProximity.glb",t}(i("../../../dev/gui/src/3D/controls/touchButton3D.ts").TouchButton3D)},"../../../dev/gui/src/3D/controls/abstractButton3D.ts":(e,t,i)=>{i.r(t),i.d(t,{AbstractButton3D:()=>o});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=function(e){function t(t){return e.call(this,t)||this}return(0,r.__extends)(t,e),t.prototype._getTypeName=function(){return"AbstractButton3D"},t.prototype._createNode=function(e){return new n.TransformNode("button"+this.name,e)},t}(i("../../../dev/gui/src/3D/controls/contentDisplay3D.ts").ContentDisplay3D)},"../../../dev/gui/src/3D/controls/button3D.ts":(e,t,i)=>{i.r(t),i.d(t,{Button3D:()=>o});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=function(e){function t(t,i){var o=e.call(this,t)||this;return o._options=(0,r.__assign)({width:1,height:1,depth:.08},i),o.pointerEnterAnimation=function(){o.mesh&&(o._currentMaterial.emissiveColor=n.Color3.Red())},o.pointerOutAnimation=function(){o._currentMaterial.emissiveColor=n.Color3.Black()},o.pointerDownAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(.95)},o.pointerUpAnimation=function(){o.mesh&&o.mesh.scaling.scaleInPlace(1/.95)},o}return(0,r.__extends)(t,e),t.prototype._applyFacade=function(e){this._currentMaterial.emissiveTexture=e},t.prototype._getTypeName=function(){return"Button3D"},t.prototype._createNode=function(e){for(var t=new Array(6),i=0;i<6;i++)t[i]=new n.Vector4(0,0,0,0);e.useRightHandedSystem?t[0].copyFromFloats(1,0,0,1):t[1].copyFromFloats(0,0,1,1);var r=(0,n.CreateBox)(this.name+"_rootMesh",{width:this._options.width,height:this._options.height,depth:this._options.depth,faceUV:t,wrap:!0},e);return this._contentScaleRatioY=this._contentScaleRatio*this._options.width/this._options.height,this._setFacadeTextureScaling(),r},t.prototype._affectMaterial=function(e){var t=new n.StandardMaterial(this.name+"Material",e.getScene());t.specularColor=n.Color3.Black(),e.material=t,this._currentMaterial=t,this._resetContent()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._disposeFacadeTexture(),this._currentMaterial&&this._currentMaterial.dispose()},t}(i("../../../dev/gui/src/3D/controls/abstractButton3D.ts").AbstractButton3D)},"../../../dev/gui/src/3D/controls/container3D.ts":(e,t,i)=>{i.r(t),i.d(t,{Container3D:()=>o});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=function(e){function t(t){var i=e.call(this,t)||this;return i._blockLayout=!1,i._children=new Array,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this._children},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blockLayout",{get:function(){return this._blockLayout},set:function(e){this._blockLayout!==e&&(this._blockLayout=e,this._blockLayout||this._arrangeChildren())},enumerable:!1,configurable:!0}),t.prototype.updateLayout=function(){return this._arrangeChildren(),this},t.prototype.containsControl=function(e){return-1!==this._children.indexOf(e)},t.prototype.addControl=function(e){return-1!==this._children.indexOf(e)||(e.parent=this,e._host=this._host,this._children.push(e),this._host.utilityLayer&&(e._prepareNode(this._host.utilityLayer.utilityLayerScene),e.node&&(e.node.parent=this.node),this.blockLayout||this._arrangeChildren())),this},t.prototype._arrangeChildren=function(){},t.prototype._createNode=function(e){return new n.TransformNode("ContainerNode",e)},t.prototype.removeControl=function(e){var t=this._children.indexOf(e);return-1!==t&&(this._children.splice(t,1),e.parent=null,e._disposeNode()),this},t.prototype._getTypeName=function(){return"Container3D"},t.prototype.dispose=function(){for(var t=0,i=this._children;t<i.length;t++)i[t].dispose();this._children.length=0,e.prototype.dispose.call(this)},t.UNSET_ORIENTATION=0,t.FACEORIGIN_ORIENTATION=1,t.FACEORIGINREVERSED_ORIENTATION=2,t.FACEFORWARD_ORIENTATION=3,t.FACEFORWARDREVERSED_ORIENTATION=4,t}(i("../../../dev/gui/src/3D/controls/control3D.ts").Control3D)},"../../../dev/gui/src/3D/controls/contentDisplay3D.ts":(e,t,i)=>{i.r(t),i.d(t,{ContentDisplay3D:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/2D/advancedDynamicTexture.ts"),o=i("../../../dev/gui/src/3D/controls/control3D.ts"),a=i("babylonjs/Misc/perfCounter"),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._contentResolution=512,t._contentScaleRatio=2,t}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"content",{get:function(){return this._content},set:function(e){this._content=e,e&&this._host&&this._host.utilityLayer&&(this._facadeTexture?this._facadeTexture.rootContainer.clearControls():(this._facadeTexture=new n.AdvancedDynamicTexture("Facade",this._contentResolution,this._contentResolution,this._host.utilityLayer.utilityLayerScene,!0,a.Texture.TRILINEAR_SAMPLINGMODE),this._setFacadeTextureScaling(),this._facadeTexture.premulAlpha=!0),this._facadeTexture.addControl(e),this._applyFacade(this._facadeTexture))},enumerable:!1,configurable:!0}),t.prototype._setFacadeTextureScaling=function(){var e;this._facadeTexture&&(this._facadeTexture.rootContainer.scaleX=this._contentScaleRatio,this._facadeTexture.rootContainer.scaleY=null!==(e=this._contentScaleRatioY)&&void 0!==e?e:this._contentScaleRatio)},Object.defineProperty(t.prototype,"contentResolution",{get:function(){return this._contentResolution},set:function(e){this._contentResolution!==e&&(this._contentResolution=e,this._resetContent())},enumerable:!1,configurable:!0}),t.prototype._disposeFacadeTexture=function(){this._facadeTexture&&(this._facadeTexture.dispose(),this._facadeTexture=null)},t.prototype._resetContent=function(){this._disposeFacadeTexture(),this.content=this._content},t.prototype._applyFacade=function(e){},t}(o.Control3D)},"../../../dev/gui/src/3D/controls/control3D.ts":(e,t,i)=>{i.r(t),i.d(t,{Control3D:()=>o});var r=i("babylonjs/Misc/perfCounter"),n=i("../../../dev/gui/src/3D/vector3WithInfo.ts"),o=function(){function e(e){this.name=e,this._downCount=0,this._enterCount=-1,this._downPointerIds={},this._isVisible=!0,this._isScaledByManager=!1,this.onPointerMoveObservable=new r.Observable,this.onPointerOutObservable=new r.Observable,this.onPointerDownObservable=new r.Observable,this.onPointerUpObservable=new r.Observable,this.onPointerClickObservable=new r.Observable,this.onPointerEnterObservable=new r.Observable,this._behaviors=new Array}return Object.defineProperty(e.prototype,"position",{get:function(){return this._node?this._node.position:r.Vector3.Zero()},set:function(e){this._node&&(this._node.position=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaling",{get:function(){return this._node?this._node.scaling:new r.Vector3(1,1,1)},set:function(e){this._node&&(this._isScaledByManager=!1,this._node.scaling=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"behaviors",{get:function(){return this._behaviors},enumerable:!1,configurable:!0}),e.prototype.addBehavior=function(e){var t=this;if(-1!==this._behaviors.indexOf(e))return this;e.init();var i=this._host.scene;return i.isLoading?i.onDataLoadedObservable.addOnce((function(){e.attach(t)})):e.attach(this),this._behaviors.push(e),this},e.prototype.removeBehavior=function(e){var t=this._behaviors.indexOf(e);return-1===t||(this._behaviors[t].detach(),this._behaviors.splice(t,1)),this},e.prototype.getBehaviorByName=function(e){for(var t=0,i=this._behaviors;t<i.length;t++){var r=i[t];if(r.name===e)return r}return null},Object.defineProperty(e.prototype,"isVisible",{get:function(){return this._isVisible},set:function(e){if(this._isVisible!==e){this._isVisible=e;var t=this.mesh;t&&t.setEnabled(e)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typeName",{get:function(){return this._getTypeName()},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return this._getTypeName()},e.prototype._getTypeName=function(){return"Control3D"},Object.defineProperty(e.prototype,"node",{get:function(){return this._node},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mesh",{get:function(){return this._node instanceof r.AbstractMesh?this._node:null},enumerable:!1,configurable:!0}),e.prototype.linkToTransformNode=function(e){return this._node&&(this._node.parent=e),this},e.prototype._prepareNode=function(e){if(!this._node){if(this._node=this._createNode(e),!this.node)return;this._injectGUI3DReservedDataStore(this.node).control=this;var t=this.mesh;t&&(t.isPickable=!0,this._affectMaterial(t))}},e.prototype._injectGUI3DReservedDataStore=function(e){var t,i;return e.reservedDataStore=null!==(t=e.reservedDataStore)&&void 0!==t?t:{},e.reservedDataStore.GUI3D=null!==(i=e.reservedDataStore.GUI3D)&&void 0!==i?i:{},e.reservedDataStore.GUI3D},e.prototype._createNode=function(e){return null},e.prototype._affectMaterial=function(e){e.material=null},e.prototype._isTouchButton3D=function(e){return void 0!==e._generatePointerEventType},e.prototype._onPointerMove=function(e,t){this.onPointerMoveObservable.notifyObservers(t,-1,e,this)},e.prototype._onPointerEnter=function(e){return-1===this._enterCount&&(this._enterCount=0),this._enterCount++,!(this._enterCount>1||(this.onPointerEnterObservable.notifyObservers(this,-1,e,this),this.pointerEnterAnimation&&this.pointerEnterAnimation(),0))},e.prototype._onPointerOut=function(e){this._enterCount--,this._enterCount>0||(this._enterCount=0,this.onPointerOutObservable.notifyObservers(this,-1,e,this),this.pointerOutAnimation&&this.pointerOutAnimation())},e.prototype._onPointerDown=function(e,t,i,r){return this._downCount++,this._downPointerIds[i]=this._downPointerIds[i]+1||1,1===this._downCount&&(this.onPointerDownObservable.notifyObservers(new n.Vector3WithInfo(t,r),-1,e,this),this.pointerDownAnimation&&this.pointerDownAnimation(),!0)},e.prototype._onPointerUp=function(e,t,i,r,o){this._downCount--,this._downPointerIds[i]--,this._downPointerIds[i]<=0&&delete this._downPointerIds[i],this._downCount<0?this._downCount=0:0==this._downCount&&(o&&(this._enterCount>0||-1===this._enterCount)&&this.onPointerClickObservable.notifyObservers(new n.Vector3WithInfo(t,r),-1,e,this),this.onPointerUpObservable.notifyObservers(new n.Vector3WithInfo(t,r),-1,e,this),this.pointerUpAnimation&&this.pointerUpAnimation())},e.prototype.forcePointerUp=function(e){if(void 0===e&&(e=null),null!==e)this._onPointerUp(this,r.Vector3.Zero(),e,0,!0);else{for(var t in this._downPointerIds)this._onPointerUp(this,r.Vector3.Zero(),+t,0,!0);this._downCount>0&&(this._downCount=1,this._onPointerUp(this,r.Vector3.Zero(),0,0,!0))}},e.prototype._processObservables=function(e,t,i,n,o){if(this._isTouchButton3D(this)&&i&&(e=this._generatePointerEventType(e,i,this._downCount)),e===r.PointerEventTypes.POINTERMOVE){this._onPointerMove(this,t);var a=this._host._lastControlOver[n];return a&&a!==this&&a._onPointerOut(this),a!==this&&this._onPointerEnter(this),this._host._lastControlOver[n]=this,!0}return e===r.PointerEventTypes.POINTERDOWN?(this._onPointerDown(this,t,n,o),this._host._lastControlDown[n]=this,this._host._lastPickedControl=this,!0):(e===r.PointerEventTypes.POINTERUP||e===r.PointerEventTypes.POINTERDOUBLETAP)&&(this._host._lastControlDown[n]&&this._host._lastControlDown[n]._onPointerUp(this,t,n,o,!0),delete this._host._lastControlDown[n],!0)},e.prototype._disposeNode=function(){this._node&&(this._node.dispose(),this._node=null)},e.prototype.dispose=function(){this.onPointerDownObservable.clear(),this.onPointerEnterObservable.clear(),this.onPointerMoveObservable.clear(),this.onPointerOutObservable.clear(),this.onPointerUpObservable.clear(),this.onPointerClickObservable.clear(),this._disposeNode();for(var e=0,t=this._behaviors;e<t.length;e++)t[e].detach()},e}()},"../../../dev/gui/src/3D/controls/cylinderPanel.ts":(e,t,i)=>{i.r(t),i.d(t,{CylinderPanel:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/3D/controls/volumeBasedPanel.ts"),a=i("../../../dev/gui/src/3D/controls/container3D.ts"),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._radius=5,t}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"radius",{get:function(){return this._radius},set:function(e){var t=this;this._radius!==e&&(this._radius=e,n.Tools.SetImmediate((function(){t._arrangeChildren()})))},enumerable:!1,configurable:!0}),t.prototype._mapGridNode=function(e,t){var i=e.mesh;if(i){var r=this._cylindricalMapping(t);switch(e.position=r,this.orientation){case a.Container3D.FACEORIGIN_ORIENTATION:i.lookAt(new n.Vector3(2*r.x,r.y,2*r.z));break;case a.Container3D.FACEORIGINREVERSED_ORIENTATION:i.lookAt(new n.Vector3(-r.x,r.y,-r.z));break;case a.Container3D.FACEFORWARD_ORIENTATION:break;case a.Container3D.FACEFORWARDREVERSED_ORIENTATION:i.rotate(n.Axis.Y,Math.PI,0)}}},t.prototype._cylindricalMapping=function(e){var t=new n.Vector3(0,e.y,this._radius),i=e.x/this._radius;return n.Matrix.RotationYawPitchRollToRef(i,0,0,n.TmpVectors.Matrix[0]),n.Vector3.TransformNormal(t,n.TmpVectors.Matrix[0])},t}(o.VolumeBasedPanel)},"../../../dev/gui/src/3D/controls/handMenu.ts":(e,t,i)=>{i.r(t),i.d(t,{HandMenu:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/3D/controls/touchHolographicMenu.ts"),o=i("babylonjs/Misc/perfCounter"),a=function(e){function t(t,i){var r=e.call(this,i)||this;return r._handConstraintBehavior=new o.HandConstraintBehavior,r._handConstraintBehavior.linkToXRExperience(t),r.backPlateMargin=.15,r.rows=3,r}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"handConstraintBehavior",{get:function(){return this._handConstraintBehavior},enumerable:!1,configurable:!0}),t.prototype._createNode=function(t){var i=e.prototype._createNode.call(this,t);return this._handConstraintBehavior.attach(i),i},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._handConstraintBehavior.detach()},t}(n.TouchHolographicMenu)},"../../../dev/gui/src/3D/controls/holographicBackplate.ts":(e,t,i)=>{i.r(t),i.d(t,{HolographicBackplate:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/3D/materials/fluentBackplate/fluentBackplateMaterial.ts"),a=function(e){function t(t,i){void 0===i&&(i=!0);var r=e.call(this,t)||this;return r._shareMaterials=i,r}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"renderingGroupId",{get:function(){return this._model.renderingGroupId},set:function(e){this._model.renderingGroupId=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this._material},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shareMaterials",{get:function(){return this._shareMaterials},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"HolographicBackplate"},t.prototype._createNode=function(e){var i,r=this,o=(0,n.CreateBox)((null!==(i=this.name)&&void 0!==i?i:"HolographicBackplate")+"_CollisionMesh",{width:1,height:1,depth:1},e);return o.isPickable=!0,o.visibility=0,n.SceneLoader.ImportMeshAsync(void 0,t.MODEL_BASE_URL,t.MODEL_FILENAME,e).then((function(e){var t=e.meshes[1];t.name="".concat(r.name,"_frontPlate"),t.isPickable=!1,t.parent=o,r._material&&(t.material=r._material),r._model=t})),o},t.prototype._createMaterial=function(e){this._material=new o.FluentBackplateMaterial(this.name+" Material",e.getScene())},t.prototype._affectMaterial=function(e){this._shareMaterials?this._host._touchSharedMaterials.fluentBackplateMaterial?this._material=this._host._touchSharedMaterials.fluentBackplateMaterial:(this._createMaterial(e),this._host._touchSharedMaterials.fluentBackplateMaterial=this._material):this._createMaterial(e)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.shareMaterials||this._material.dispose(),this._model.dispose()},t.MODEL_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",t.MODEL_FILENAME="mrtk-fluent-backplate.glb",t}(i("../../../dev/gui/src/3D/controls/control3D.ts").Control3D)},"../../../dev/gui/src/3D/controls/holographicButton.ts":(e,t,i)=>{i.r(t),i.d(t,{HolographicButton:()=>h});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/3D/controls/button3D.ts"),o=i("babylonjs/Misc/perfCounter"),a=i("../../../dev/gui/src/3D/materials/fluent/fluentMaterial.ts"),s=i("../../../dev/gui/src/2D/controls/stackPanel.ts"),l=i("../../../dev/gui/src/2D/controls/image.ts"),c=i("../../../dev/gui/src/2D/controls/textBlock.ts"),u=i("../../../dev/gui/src/2D/advancedDynamicTexture.ts"),h=function(e){function t(t,i){void 0===i&&(i=!0);var r=e.call(this,t)||this;return r._shareMaterials=!0,r._shareMaterials=i,r.pointerEnterAnimation=function(){r.mesh&&r._frontPlate.setEnabled(!0)},r.pointerOutAnimation=function(){r.mesh&&r._frontPlate.setEnabled(!1)},r}return(0,r.__extends)(t,e),t.prototype._disposeTooltip=function(){this._tooltipFade=null,this._tooltipTextBlock&&this._tooltipTextBlock.dispose(),this._tooltipTexture&&this._tooltipTexture.dispose(),this._tooltipMesh&&this._tooltipMesh.dispose(),this.onPointerEnterObservable.remove(this._tooltipHoverObserver),this.onPointerOutObservable.remove(this._tooltipOutObserver)},Object.defineProperty(t.prototype,"renderingGroupId",{get:function(){return this._backPlate.renderingGroupId},set:function(e){this._backPlate.renderingGroupId=e,this._textPlate.renderingGroupId=e,this._frontPlate.renderingGroupId=e,this._tooltipMesh&&(this._tooltipMesh.renderingGroupId=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tooltipText",{get:function(){return this._tooltipTextBlock?this._tooltipTextBlock.text:null},set:function(e){var t=this;if(e){if(!this._tooltipFade){var i=this._backPlate._scene.useRightHandedSystem;this._tooltipMesh=(0,o.CreatePlane)("",{size:1},this._backPlate._scene);var r=(0,o.CreatePlane)("",{size:1,sideOrientation:o.Mesh.DOUBLESIDE},this._backPlate._scene),n=new o.StandardMaterial("",this._backPlate._scene);n.diffuseColor=o.Color3.FromHexString("#212121"),r.material=n,r.isPickable=!1,this._tooltipMesh.addChild(r),r.position=o.Vector3.Forward(i).scale(.05),this._tooltipMesh.scaling.y=1/3,this._tooltipMesh.position=o.Vector3.Up().scale(.7).add(o.Vector3.Forward(i).scale(-.15)),this._tooltipMesh.isPickable=!1,this._tooltipMesh.parent=this._backPlate,this._tooltipTexture=u.AdvancedDynamicTexture.CreateForMesh(this._tooltipMesh),this._tooltipTextBlock=new c.TextBlock,this._tooltipTextBlock.scaleY=3,this._tooltipTextBlock.color="white",this._tooltipTextBlock.fontSize=130,this._tooltipTexture.addControl(this._tooltipTextBlock),this._tooltipFade=new o.FadeInOutBehavior,this._tooltipFade.delay=500,this._tooltipMesh.addBehavior(this._tooltipFade),this._tooltipHoverObserver=this.onPointerEnterObservable.add((function(){t._tooltipFade&&t._tooltipFade.fadeIn(!0)})),this._tooltipOutObserver=this.onPointerOutObservable.add((function(){t._tooltipFade&&t._tooltipFade.fadeIn(!1)}))}this._tooltipTextBlock&&(this._tooltipTextBlock.text=e)}else this._disposeTooltip()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageUrl",{get:function(){return this._imageUrl},set:function(e){this._imageUrl!==e&&(this._imageUrl=e,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backMaterial",{get:function(){return this._backMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frontMaterial",{get:function(){return this._frontMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plateMaterial",{get:function(){return this._plateMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shareMaterials",{get:function(){return this._shareMaterials},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"HolographicButton"},t.prototype._rebuildContent=function(){this._disposeFacadeTexture();var e=new s.StackPanel;if(e.isVertical=!0,(0,o.IsDocumentAvailable)()&&document.createElement&&this._imageUrl){var t=new l.Image;t.source=this._imageUrl,t.paddingTop="40px",t.height="180px",t.width="100px",t.paddingBottom="40px",e.addControl(t)}if(this._text){var i=new c.TextBlock;i.text=this._text,i.color="white",i.height="30px",i.fontSize=24,e.addControl(i)}this._frontPlate&&(this.content=e)},t.prototype._createNode=function(t){return this._backPlate=(0,o.CreateBox)(this.name+"BackMesh",{width:1,height:1,depth:.08},t),this._frontPlate=(0,o.CreateBox)(this.name+"FrontMesh",{width:1,height:1,depth:.08},t),this._frontPlate.parent=this._backPlate,this._frontPlate.position=o.Vector3.Forward(t.useRightHandedSystem).scale(-.08),this._frontPlate.isPickable=!1,this._frontPlate.setEnabled(!1),this._textPlate=e.prototype._createNode.call(this,t),this._textPlate.parent=this._backPlate,this._textPlate.position=o.Vector3.Forward(t.useRightHandedSystem).scale(-.08),this._textPlate.isPickable=!1,this._backPlate},t.prototype._applyFacade=function(e){this._plateMaterial.emissiveTexture=e,this._plateMaterial.opacityTexture=e},t.prototype._createBackMaterial=function(e){var t=this;this._backMaterial=new a.FluentMaterial(this.name+"Back Material",e.getScene()),this._backMaterial.renderHoverLight=!0,this._pickedPointObserver=this._host.onPickedPointChangedObservable.add((function(e){e?(t._backMaterial.hoverPosition=e,t._backMaterial.hoverColor.a=1):t._backMaterial.hoverColor.a=0}))},t.prototype._createFrontMaterial=function(e){this._frontMaterial=new a.FluentMaterial(this.name+"Front Material",e.getScene()),this._frontMaterial.innerGlowColorIntensity=0,this._frontMaterial.alpha=.5,this._frontMaterial.renderBorders=!0},t.prototype._createPlateMaterial=function(e){this._plateMaterial=new o.StandardMaterial(this.name+"Plate Material",e.getScene()),this._plateMaterial.specularColor=o.Color3.Black()},t.prototype._affectMaterial=function(e){this._shareMaterials?(this._host._sharedMaterials.backFluentMaterial?this._backMaterial=this._host._sharedMaterials.backFluentMaterial:(this._createBackMaterial(e),this._host._sharedMaterials.backFluentMaterial=this._backMaterial),this._host._sharedMaterials.frontFluentMaterial?this._frontMaterial=this._host._sharedMaterials.frontFluentMaterial:(this._createFrontMaterial(e),this._host._sharedMaterials.frontFluentMaterial=this._frontMaterial)):(this._createBackMaterial(e),this._createFrontMaterial(e)),this._createPlateMaterial(e),this._backPlate.material=this._backMaterial,this._frontPlate.material=this._frontMaterial,this._textPlate.material=this._plateMaterial,this._rebuildContent()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._disposeTooltip(),this.shareMaterials||(this._backMaterial.dispose(),this._frontMaterial.dispose(),this._plateMaterial.dispose(),this._pickedPointObserver&&(this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver),this._pickedPointObserver=null))},t}(n.Button3D)},"../../../dev/gui/src/3D/controls/holographicSlate.ts":(e,t,i)=>{i.r(t),i.d(t,{HolographicSlate:()=>f});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/3D/controls/contentDisplay3D.ts"),o=i("../../../dev/gui/src/3D/controls/touchHolographicButton.ts"),a=i("../../../dev/gui/src/2D/advancedDynamicTexture.ts"),s=i("../../../dev/gui/src/2D/controls/control.ts"),l=i("../../../dev/gui/src/2D/controls/textBlock.ts"),c=i("../../../dev/gui/src/3D/behaviors/defaultBehavior.ts"),u=i("../../../dev/gui/src/3D/gizmos/slateGizmo.ts"),h=i("../../../dev/gui/src/3D/materials/fluent/fluentMaterial.ts"),d=i("../../../dev/gui/src/3D/materials/fluentBackplate/fluentBackplateMaterial.ts"),_=i("babylonjs/Misc/perfCounter"),f=function(e){function t(t){var i=e.call(this,t)||this;return i.titleBarMargin=.005,i.origin=new _.Vector3(0,0,0),i._dimensions=new _.Vector2(21.875,12.5),i._titleBarHeight=.625,i._titleText="",i._contentScaleRatio=1,i.minDimensions=new _.Vector2(15.625,6.25),i.defaultDimensions=i._dimensions.clone(),i._followButton=new o.TouchHolographicButton("followButton"+i.name),i._followButton.isToggleButton=!0,i._closeButton=new o.TouchHolographicButton("closeButton"+i.name),i._contentViewport=new _.Viewport(0,0,1,1),i._contentDragBehavior=new _.PointerDragBehavior({dragPlaneNormal:new _.Vector3(0,0,-1)}),i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"defaultBehavior",{get:function(){return this._defaultBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dimensions",{get:function(){return this._dimensions},set:function(e){var t=1;if(e.x<this.minDimensions.x||e.y<this.minDimensions.y){var i=e.x/e.y;t=this.minDimensions.x/this.minDimensions.y>i?this.minDimensions.x/e.x:this.minDimensions.y/e.y}this._dimensions.copyFrom(e).scaleInPlace(t),this._updatePivot(),this._positionElements()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"titleBarHeight",{get:function(){return this._titleBarHeight},set:function(e){this._titleBarHeight=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderingGroupId",{get:function(){return this._titleBar.renderingGroupId},set:function(e){this._titleBar.renderingGroupId=e,this._titleBarTitle.renderingGroupId=e,this._contentPlate.renderingGroupId=e,this._backPlate.renderingGroupId=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this._titleText},set:function(e){this._titleText=e,this._titleTextComponent&&(this._titleTextComponent.text=e)},enumerable:!1,configurable:!0}),t.prototype._applyFacade=function(e){this._contentMaterial.albedoTexture=e,this._resetContentPositionAndZoom(),this._applyContentViewport(),e.attachToMesh(this._contentPlate,!0)},t.prototype._addControl=function(e){e._host=this._host,this._host.utilityLayer&&e._prepareNode(this._host.utilityLayer.utilityLayerScene)},t.prototype._getTypeName=function(){return"HolographicSlate"},t.prototype._positionElements=function(){var e=this._followButton,i=this._closeButton,r=this._titleBar,n=this._titleBarTitle,o=this._contentPlate,a=this._backPlate;if(e&&i&&r){i.scaling.setAll(this.titleBarHeight),e.scaling.setAll(this.titleBarHeight),i.position.copyFromFloats(this.dimensions.x-this.titleBarHeight/2,-this.titleBarHeight/2,0).addInPlace(this.origin),e.position.copyFromFloats(this.dimensions.x-3*this.titleBarHeight/2,-this.titleBarHeight/2,0).addInPlace(this.origin);var s=this.dimensions.y-this.titleBarHeight-this.titleBarMargin,l=o.getScene().useRightHandedSystem;r.scaling.set(this.dimensions.x,this.titleBarHeight,_.Epsilon),n.scaling.set(this.dimensions.x-2*this.titleBarHeight,this.titleBarHeight,_.Epsilon),o.scaling.copyFromFloats(this.dimensions.x,s,_.Epsilon),a.scaling.copyFromFloats(this.dimensions.x,s,_.Epsilon),r.position.copyFromFloats(this.dimensions.x/2,-this.titleBarHeight/2,0).addInPlace(this.origin),n.position.copyFromFloats(this.dimensions.x/2-this.titleBarHeight,-this.titleBarHeight/2,l?_.Epsilon:-_.Epsilon).addInPlace(this.origin),o.position.copyFromFloats(this.dimensions.x/2,-(this.titleBarHeight+this.titleBarMargin+s/2),0).addInPlace(this.origin),a.position.copyFromFloats(this.dimensions.x/2,-(this.titleBarHeight+this.titleBarMargin+s/2),l?-_.Epsilon:_.Epsilon).addInPlace(this.origin),this._titleTextComponent.host.scaleTo(t._DEFAULT_TEXT_RESOLUTION_Y*n.scaling.x/n.scaling.y,t._DEFAULT_TEXT_RESOLUTION_Y);var c=this.dimensions.x/s;this._contentViewport.width=this._contentScaleRatio,this._contentViewport.height=this._contentScaleRatio/c,this._applyContentViewport(),this._gizmo&&this._gizmo.updateBoundingBox()}},t.prototype._applyContentViewport=function(){var e;if((null===(e=this._contentPlate)||void 0===e?void 0:e.material)&&this._contentPlate.material.albedoTexture){var t=this._contentPlate.material.albedoTexture;t.uScale=this._contentScaleRatio,t.vScale=this._contentScaleRatio/this._contentViewport.width*this._contentViewport.height,t.uOffset=this._contentViewport.x,t.vOffset=this._contentViewport.y}},t.prototype._resetContentPositionAndZoom=function(){this._contentViewport.x=0,this._contentViewport.y=1-this._contentViewport.height/this._contentViewport.width,this._contentScaleRatio=1},t.prototype._updatePivot=function(){if(this.mesh){var e=new _.Vector3(.5*this.dimensions.x,.5*-this.dimensions.y,_.Epsilon);e.addInPlace(this.origin),e.z=0;var t=new _.Vector3(0,0,0);_.Vector3.TransformCoordinatesToRef(t,this.mesh.computeWorldMatrix(!0),t),this.mesh.setPivotPoint(e);var i=new _.Vector3(0,0,0);_.Vector3.TransformCoordinatesToRef(i,this.mesh.computeWorldMatrix(!0),i),this.mesh.position.addInPlace(t).subtractInPlace(i)}},t.prototype._createNode=function(e){var i=this,r=new _.Mesh("slate_"+this.name,e);this._titleBar=(0,_.CreateBox)("titleBar_"+this.name,{size:1},e),this._titleBarTitle=(0,_.CreatePlane)("titleText_"+this.name,{size:1},e),this._titleBarTitle.parent=r,this._titleBarTitle.isPickable=!1;var n=a.AdvancedDynamicTexture.CreateForMesh(this._titleBarTitle);if(this._titleTextComponent=new l.TextBlock("titleText_"+this.name,this._titleText),this._titleTextComponent.textWrapping=2,this._titleTextComponent.textHorizontalAlignment=s.Control.HORIZONTAL_ALIGNMENT_LEFT,this._titleTextComponent.color="white",this._titleTextComponent.fontSize=t._DEFAULT_TEXT_RESOLUTION_Y/2,this._titleTextComponent.paddingLeft=t._DEFAULT_TEXT_RESOLUTION_Y/4,n.addControl(this._titleTextComponent),e.useRightHandedSystem){var o=new _.Vector4(0,0,1,1);this._contentPlate=(0,_.CreatePlane)("contentPlate_"+this.name,{size:1,sideOrientation:_.VertexData.BACKSIDE,frontUVs:o},e),this._backPlate=(0,_.CreatePlane)("backPlate_"+this.name,{size:1,sideOrientation:_.VertexData.FRONTSIDE},e)}else o=new _.Vector4(0,0,1,1),this._contentPlate=(0,_.CreatePlane)("contentPlate_"+this.name,{size:1,sideOrientation:_.VertexData.FRONTSIDE,frontUVs:o},e),this._backPlate=(0,_.CreatePlane)("backPlate_"+this.name,{size:1,sideOrientation:_.VertexData.BACKSIDE},e);this._titleBar.parent=r,this._titleBar.isNearGrabbable=!0,this._contentPlate.parent=r,this._backPlate.parent=r,this._attachContentPlateBehavior(),this._addControl(this._followButton),this._addControl(this._closeButton);var c=this._followButton,u=this._closeButton;return c.node.parent=r,u.node.parent=r,this._positionElements(),this._followButton.imageUrl=t.ASSETS_BASE_URL+t.FOLLOW_ICON_FILENAME,this._closeButton.imageUrl=t.ASSETS_BASE_URL+t.CLOSE_ICON_FILENAME,this._followButton.isBackplateVisible=!1,this._closeButton.isBackplateVisible=!1,this._followButton.onToggleObservable.add((function(e){i._defaultBehavior.followBehaviorEnabled=e,i._defaultBehavior.followBehaviorEnabled&&i._defaultBehavior.followBehavior.recenter()})),this._closeButton.onPointerClickObservable.add((function(){i.dispose()})),r.rotationQuaternion=_.Quaternion.Identity(),r.isVisible=!1,r},t.prototype._attachContentPlateBehavior=function(){var e=this;this._contentDragBehavior.attach(this._contentPlate),this._contentDragBehavior.moveAttached=!1,this._contentDragBehavior.useObjectOrientationForDragging=!0,this._contentDragBehavior.updateDragPlane=!1;var t,i,r=new _.Vector3,n=new _.Vector3,o=new _.Vector3,a=new _.Vector3,s=new _.Vector2;this._contentDragBehavior.onDragStartObservable.add((function(s){e.node&&(t=e._contentViewport.clone(),i=e.node.computeWorldMatrix(!0),r.copyFrom(s.dragPlanePoint),n.set(e.dimensions.x,e.dimensions.y,_.Epsilon),n.y-=e.titleBarHeight+e.titleBarMargin,_.Vector3.TransformNormalToRef(n,i,n),o.copyFromFloats(0,1,0),_.Vector3.TransformNormalToRef(o,i,o),a.copyFromFloats(1,0,0),_.Vector3.TransformNormalToRef(a,i,a),o.normalize(),o.scaleInPlace(1/_.Vector3.Dot(o,n)),a.normalize(),a.scaleInPlace(1/_.Vector3.Dot(a,n)))}));var l=new _.Vector3;this._contentDragBehavior.onDragObservable.add((function(i){l.copyFrom(i.dragPlanePoint),l.subtractInPlace(r),s.copyFromFloats(_.Vector3.Dot(l,a),_.Vector3.Dot(l,o)),e._contentViewport.x=_.Scalar.Clamp(t.x-l.x,0,1-e._contentViewport.width*e._contentScaleRatio),e._contentViewport.y=_.Scalar.Clamp(t.y-l.y,0,1-e._contentViewport.height*e._contentScaleRatio),e._applyContentViewport()}))},t.prototype._affectMaterial=function(e){this._titleBarMaterial=new d.FluentBackplateMaterial("".concat(this.name," plateMaterial"),e.getScene()),this._contentMaterial=new h.FluentMaterial("".concat(this.name," contentMaterial"),e.getScene()),this._contentMaterial.renderBorders=!0,this._backMaterial=new d.FluentBackplateMaterial("".concat(this.name," backPlate"),e.getScene()),this._backMaterial.lineWidth=_.Epsilon,this._backMaterial.radius=.005,this._backMaterial.backFaceCulling=!0,this._titleBar.material=this._titleBarMaterial,this._contentPlate.material=this._contentMaterial,this._backPlate.material=this._backMaterial,this._resetContent(),this._applyContentViewport()},t.prototype._prepareNode=function(t){var i=this;e.prototype._prepareNode.call(this,t),this._gizmo=new u.SlateGizmo(this._host.utilityLayer),this._gizmo.attachedSlate=this,this._defaultBehavior=new c.DefaultBehavior,this._defaultBehavior.attach(this.node,[this._titleBar]),this._defaultBehavior.sixDofDragBehavior.onDragStartObservable.add((function(){i._followButton.isToggled=!1})),this._positionChangedObserver=this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.add((function(){i._gizmo.updateBoundingBox()})),this._updatePivot(),this.resetDefaultAspectAndPose(!1)},t.prototype.resetDefaultAspectAndPose=function(e){if(void 0===e&&(e=!0),this._host&&this._host.utilityLayer&&this.node){var t=this._host.utilityLayer.utilityLayerScene,i=t.activeCamera;if(i){var r=i.getWorldMatrix(),n=_.Vector3.TransformNormal(_.Vector3.Backward(t.useRightHandedSystem),r);this.origin.setAll(0),this._gizmo.updateBoundingBox();var o=this.node.getAbsolutePivotPoint();this.node.position.copyFrom(i.position).subtractInPlace(n).subtractInPlace(o),this.node.rotationQuaternion=_.Quaternion.FromLookDirectionLH(n,new _.Vector3(0,1,0)),e&&(this.dimensions=this.defaultDimensions)}}},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._titleBarMaterial.dispose(),this._contentMaterial.dispose(),this._titleBar.dispose(),this._titleBarTitle.dispose(),this._contentPlate.dispose(),this._backPlate.dispose(),this._followButton.dispose(),this._closeButton.dispose(),this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver),this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.remove(this._positionChangedObserver),this._defaultBehavior.detach(),this._gizmo.dispose(),this._contentDragBehavior.detach()},t.ASSETS_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",t.CLOSE_ICON_FILENAME="IconClose.png",t.FOLLOW_ICON_FILENAME="IconFollowMe.png",t._DEFAULT_TEXT_RESOLUTION_Y=102.4,t}(n.ContentDisplay3D)},"../../../dev/gui/src/3D/controls/index.ts":(e,t,i)=>{i.r(t),i.d(t,{AbstractButton3D:()=>r.AbstractButton3D,Button3D:()=>n.Button3D,Container3D:()=>o.Container3D,Control3D:()=>a.Control3D,CylinderPanel:()=>s.CylinderPanel,HandMenu:()=>l.HandMenu,HolographicBackplate:()=>c.HolographicBackplate,HolographicButton:()=>u.HolographicButton,HolographicSlate:()=>h.HolographicSlate,MeshButton3D:()=>d.MeshButton3D,NearMenu:()=>_.NearMenu,PlanePanel:()=>f.PlanePanel,ScatterPanel:()=>p.ScatterPanel,Slider3D:()=>m.Slider3D,SpherePanel:()=>g.SpherePanel,StackPanel3D:()=>v.StackPanel3D,TouchButton3D:()=>b.TouchButton3D,TouchHolographicButton:()=>x.TouchHolographicButton,TouchHolographicButtonV3:()=>S.TouchHolographicButton,TouchHolographicMenu:()=>T.TouchHolographicMenu,TouchMeshButton3D:()=>y.TouchMeshButton3D,VolumeBasedPanel:()=>C.VolumeBasedPanel});var r=i("../../../dev/gui/src/3D/controls/abstractButton3D.ts"),n=i("../../../dev/gui/src/3D/controls/button3D.ts"),o=i("../../../dev/gui/src/3D/controls/container3D.ts"),a=i("../../../dev/gui/src/3D/controls/control3D.ts"),s=i("../../../dev/gui/src/3D/controls/cylinderPanel.ts"),l=i("../../../dev/gui/src/3D/controls/handMenu.ts"),c=i("../../../dev/gui/src/3D/controls/holographicBackplate.ts"),u=i("../../../dev/gui/src/3D/controls/holographicButton.ts"),h=i("../../../dev/gui/src/3D/controls/holographicSlate.ts"),d=i("../../../dev/gui/src/3D/controls/meshButton3D.ts"),_=i("../../../dev/gui/src/3D/controls/nearMenu.ts"),f=i("../../../dev/gui/src/3D/controls/planePanel.ts"),p=i("../../../dev/gui/src/3D/controls/scatterPanel.ts"),m=i("../../../dev/gui/src/3D/controls/slider3D.ts"),g=i("../../../dev/gui/src/3D/controls/spherePanel.ts"),v=i("../../../dev/gui/src/3D/controls/stackPanel3D.ts"),b=i("../../../dev/gui/src/3D/controls/touchButton3D.ts"),y=i("../../../dev/gui/src/3D/controls/touchMeshButton3D.ts"),x=i("../../../dev/gui/src/3D/controls/touchHolographicButton.ts"),T=i("../../../dev/gui/src/3D/controls/touchHolographicMenu.ts"),C=i("../../../dev/gui/src/3D/controls/volumeBasedPanel.ts"),S=i("../../../dev/gui/src/3D/controls/MRTK3/touchHolographicButton.ts")},"../../../dev/gui/src/3D/controls/meshButton3D.ts":(e,t,i)=>{i.r(t),i.d(t,{MeshButton3D:()=>n});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=function(e){function t(t,i){var r=e.call(this,i)||this;return r._currentMesh=t,r.pointerEnterAnimation=function(){r.mesh&&r.mesh.scaling.scaleInPlace(1.1)},r.pointerOutAnimation=function(){r.mesh&&r.mesh.scaling.scaleInPlace(1/1.1)},r.pointerDownAnimation=function(){r.mesh&&r.mesh.scaling.scaleInPlace(.95)},r.pointerUpAnimation=function(){r.mesh&&r.mesh.scaling.scaleInPlace(1/.95)},r}return(0,r.__extends)(t,e),t.prototype._getTypeName=function(){return"MeshButton3D"},t.prototype._createNode=function(e){var t=this;return this._currentMesh.getChildMeshes().forEach((function(e){t._injectGUI3DReservedDataStore(e).control=t})),this._currentMesh},t.prototype._affectMaterial=function(e){},t}(i("../../../dev/gui/src/3D/controls/button3D.ts").Button3D)},"../../../dev/gui/src/3D/controls/nearMenu.ts":(e,t,i)=>{i.r(t),i.d(t,{NearMenu:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/3D/controls/touchHolographicButton.ts"),o=i("../../../dev/gui/src/3D/behaviors/defaultBehavior.ts"),a=i("../../../dev/gui/src/3D/controls/touchHolographicMenu.ts"),s=function(e){function t(t){var i=e.call(this,t)||this;return i._isPinned=!1,i._defaultBehavior=new o.DefaultBehavior,i._dragObserver=i._defaultBehavior.sixDofDragBehavior.onDragObservable.add((function(){i.isPinned=!0})),i.backPlateMargin=1,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"defaultBehavior",{get:function(){return this._defaultBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPinned",{get:function(){return this._isPinned},set:function(e){this._pinButton.isToggled===e?(this._isPinned=e,this._defaultBehavior.followBehaviorEnabled=!e):this._pinButton.isToggled=e},enumerable:!1,configurable:!0}),t.prototype._createPinButton=function(e){var i=this,r=new n.TouchHolographicButton("pin"+this.name,!1);return r.imageUrl=t._ASSETS_BASE_URL+t._PIN_ICON_FILENAME,r.parent=this,r._host=this._host,r.isToggleButton=!0,r.onToggleObservable.add((function(e){i.isPinned=e})),this._host.utilityLayer&&(r._prepareNode(this._host.utilityLayer.utilityLayerScene),r.scaling.scaleInPlace(a.TouchHolographicMenu.MENU_BUTTON_SCALE),r.node&&(r.node.parent=e)),r},t.prototype._createNode=function(t){var i=e.prototype._createNode.call(this,t);return this._pinButton=this._createPinButton(i),this.isPinned=!1,this._defaultBehavior.attach(i,[this._backPlate]),this._defaultBehavior.followBehavior.ignoreCameraPitchAndRoll=!0,this._defaultBehavior.followBehavior.pitchOffset=-15,this._defaultBehavior.followBehavior.minimumDistance=.3,this._defaultBehavior.followBehavior.defaultDistance=.4,this._defaultBehavior.followBehavior.maximumDistance=.6,this._backPlate.isNearGrabbable=!0,i.isVisible=!1,i},t.prototype._finalProcessing=function(){e.prototype._finalProcessing.call(this),this._pinButton.position.copyFromFloats((this._backPlate.scaling.x+a.TouchHolographicMenu.MENU_BUTTON_SCALE)/2,this._backPlate.scaling.y/2,0)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._defaultBehavior.sixDofDragBehavior.onDragObservable.remove(this._dragObserver),this._defaultBehavior.detach()},t._ASSETS_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",t._PIN_ICON_FILENAME="IconPin.png",t}(a.TouchHolographicMenu)},"../../../dev/gui/src/3D/controls/planePanel.ts":(e,t,i)=>{i.r(t),i.d(t,{PlanePanel:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/3D/controls/container3D.ts"),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.__extends)(t,e),t.prototype._mapGridNode=function(e,t){var i=e.mesh;if(i){e.position=t.clone();var r=n.TmpVectors.Vector3[0];switch(r.copyFrom(t),this.orientation){case o.Container3D.FACEORIGIN_ORIENTATION:case o.Container3D.FACEFORWARD_ORIENTATION:r.addInPlace(new n.Vector3(0,0,1)),i.lookAt(r);break;case o.Container3D.FACEFORWARDREVERSED_ORIENTATION:case o.Container3D.FACEORIGINREVERSED_ORIENTATION:r.addInPlace(new n.Vector3(0,0,-1)),i.lookAt(r)}}},t}(i("../../../dev/gui/src/3D/controls/volumeBasedPanel.ts").VolumeBasedPanel)},"../../../dev/gui/src/3D/controls/scatterPanel.ts":(e,t,i)=>{i.r(t),i.d(t,{ScatterPanel:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/3D/controls/volumeBasedPanel.ts"),a=i("../../../dev/gui/src/3D/controls/container3D.ts"),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._iteration=100,t}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"iteration",{get:function(){return this._iteration},set:function(e){var t=this;this._iteration!==e&&(this._iteration=e,n.Tools.SetImmediate((function(){t._arrangeChildren()})))},enumerable:!1,configurable:!0}),t.prototype._mapGridNode=function(e,t){var i=e.mesh,r=this._scatterMapping(t);if(i){switch(this.orientation){case a.Container3D.FACEORIGIN_ORIENTATION:case a.Container3D.FACEFORWARD_ORIENTATION:i.lookAt(new n.Vector3(0,0,1));break;case a.Container3D.FACEFORWARDREVERSED_ORIENTATION:case a.Container3D.FACEORIGINREVERSED_ORIENTATION:i.lookAt(new n.Vector3(0,0,-1))}e.position=r}},t.prototype._scatterMapping=function(e){return e.x=(1-2*Math.random())*this._cellWidth,e.y=(1-2*Math.random())*this._cellHeight,e},t.prototype._finalProcessing=function(){for(var e=[],t=0,i=this._children;t<i.length;t++){var r=i[t];r.mesh&&e.push(r.mesh)}for(var o=0;o<this._iteration;o++){e.sort((function(e,t){var i=e.position.lengthSquared(),r=t.position.lengthSquared();return i<r?1:i>r?-1:0}));for(var a=Math.pow(this.margin,2),s=Math.max(this._cellWidth,this._cellHeight),l=n.TmpVectors.Vector2[0],c=n.TmpVectors.Vector3[0],u=0;u<e.length-1;u++)for(var h=u+1;h<e.length;h++)if(u!=h){e[h].position.subtractToRef(e[u].position,c),l.x=c.x,l.y=c.y;var d=s,_=l.lengthSquared()-a;(_-=Math.min(_,a))<Math.pow(d,2)&&(l.normalize(),c.scaleInPlace(.5*(d-Math.sqrt(_))),e[h].position.addInPlace(c),e[u].position.subtractInPlace(c))}}},t}(o.VolumeBasedPanel)},"../../../dev/gui/src/3D/controls/slider3D.ts":(e,t,i)=>{i.r(t),i.d(t,{Slider3D:()=>c});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/3D/controls/control3D.ts"),a=i("../../../dev/gui/src/3D/materials/mrdl/mrdlSliderBarMaterial.ts"),s=i("../../../dev/gui/src/3D/materials/mrdl/mrdlSliderThumbMaterial.ts"),l=i("../../../dev/gui/src/3D/materials/mrdl/mrdlBackplateMaterial.ts"),c=function(e){function t(t,i){var r=e.call(this,t)||this;return r.onValueChangedObservable=new n.Observable,r._sliderBackplateVisible=i||!1,r._minimum=0,r._maximum=100,r._step=0,r._value=50,r}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"mesh",{get:function(){return this.node?this._sliderThumb:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minimum",{get:function(){return this._minimum},set:function(e){this._minimum!==e&&(this._minimum=Math.max(e,0),this._value=Math.max(Math.min(this._value,this._maximum),this._minimum))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maximum",{get:function(){return this._maximum},set:function(e){this._maximum!==e&&(this._maximum=Math.max(e,this._minimum),this._value=Math.max(Math.min(this._value,this._maximum),this._minimum))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"step",{get:function(){return this._step},set:function(e){this._step!==e&&(this._step=Math.max(Math.min(e,this._maximum-this._minimum),0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(e){this._value!==e&&(this._value=Math.max(Math.min(e,this._maximum),this._minimum),this._sliderThumb&&(this._sliderThumb.position.x=this._convertToPosition(this.value)),this.onValueChangedObservable.notifyObservers(this._value))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"start",{get:function(){return this.node?this._sliderBar.position.x-this._sliderBar.scaling.x/2:-.5},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.node?this._sliderBar.position.x+this._sliderBar.scaling.x/2:.5},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sliderBarMaterial",{get:function(){return this._sliderBarMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sliderThumbMaterial",{get:function(){return this._sliderThumbMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sliderBackplateMaterial",{get:function(){return this._sliderBackplateMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sliderBar",{get:function(){return this._sliderBar},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sliderThumb",{get:function(){return this._sliderThumb},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sliderBackplate",{get:function(){return this._sliderBackplate},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{set:function(e){var t;this._isVisible!==e&&(this._isVisible=e,null===(t=this.node)||void 0===t||t.setEnabled(e))},enumerable:!1,configurable:!0}),t.prototype._createNode=function(e){var i=this,r=(0,n.CreateBox)("".concat(this.name,"_sliderbackplate"),{width:1,height:1,depth:1},e);return r.isPickable=!1,r.visibility=0,r.scaling=new n.Vector3(1,.5,.8),n.SceneLoader.ImportMeshAsync(void 0,t.MODEL_BASE_URL,t.MODEL_FILENAME,e).then((function(e){e.meshes.forEach((function(e){e.isPickable=!1}));var t=e.meshes[1],o=e.meshes[1].clone("".concat(i.name,"_sliderbar"),r),a=e.meshes[1].clone("".concat(i.name,"_sliderthumb"),r);t.visibility=0,i._sliderBackplateVisible&&(t.visibility=1,t.name="".concat(i.name,"_sliderbackplate"),t.scaling.x=1,t.scaling.z=.2,t.parent=r,i._sliderBackplateMaterial&&(t.material=i._sliderBackplateMaterial),i._sliderBackplate=t),o&&(o.parent=r,o.position.z=-.1,o.scaling=new n.Vector3(.8,.04,.3),i._sliderBarMaterial&&(o.material=i._sliderBarMaterial),i._sliderBar=o),a&&(a.parent=r,a.isPickable=!0,a.position.z=-.115,a.scaling=new n.Vector3(.025,.3,.6),a.position.x=i._convertToPosition(i.value),a.addBehavior(i._createBehavior()),i._sliderThumbMaterial&&(a.material=i._sliderThumbMaterial),i._sliderThumb=a),i._injectGUI3DReservedDataStore(r).control=i,r.getChildMeshes().forEach((function(e){i._injectGUI3DReservedDataStore(e).control=i}))})),this._affectMaterial(r),r},t.prototype._affectMaterial=function(e){var t,i,r;this._sliderBackplateMaterial=null!==(t=this._sliderBackplateMaterial)&&void 0!==t?t:new l.MRDLBackplateMaterial("".concat(this.name,"_sliderbackplate_material"),e.getScene()),this._sliderBarMaterial=null!==(i=this._sliderBarMaterial)&&void 0!==i?i:new a.MRDLSliderBarMaterial("".concat(this.name,"_sliderbar_material"),e.getScene()),this._sliderThumbMaterial=null!==(r=this._sliderThumbMaterial)&&void 0!==r?r:new s.MRDLSliderThumbMaterial("".concat(this.name,"_sliderthumb_material"),e.getScene())},t.prototype._createBehavior=function(){var e=this,t=new n.PointerDragBehavior({dragAxis:n.Vector3.Right()});return t.moveAttached=!1,t.onDragStartObservable.add((function(){e._draggedPosition=e._sliderThumb.position.x})),t.onDragObservable.add((function(t){e._draggedPosition+=t.dragDistance/e.scaling.x,e.value=e._convertToValue(e._draggedPosition)})),t},t.prototype._convertToPosition=function(e){var t=(e-this.minimum)/(this.maximum-this.minimum)*(this.end-this.start)+this.start;return Math.min(Math.max(t,this.start),this.end)},t.prototype._convertToValue=function(e){var t=(e-this.start)/(this.end-this.start)*(this.maximum-this.minimum);return t=this.step?Math.round(t/this.step)*this.step:t,Math.max(Math.min(this.minimum+t,this._maximum),this._minimum)},t.prototype.dispose=function(){var t,i,r,n,o,a;e.prototype.dispose.call(this),null===(t=this._sliderBar)||void 0===t||t.dispose(),null===(i=this._sliderThumb)||void 0===i||i.dispose(),null===(r=this._sliderBarMaterial)||void 0===r||r.dispose(),null===(n=this._sliderThumbMaterial)||void 0===n||n.dispose(),null===(o=this._sliderBackplate)||void 0===o||o.dispose(),null===(a=this._sliderBackplateMaterial)||void 0===a||a.dispose()},t.MODEL_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",t.MODEL_FILENAME="mrtk-fluent-backplate.glb",t}(o.Control3D)},"../../../dev/gui/src/3D/controls/spherePanel.ts":(e,t,i)=>{i.r(t),i.d(t,{SpherePanel:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/3D/controls/volumeBasedPanel.ts"),a=i("../../../dev/gui/src/3D/controls/container3D.ts"),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._radius=5,t}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"radius",{get:function(){return this._radius},set:function(e){var t=this;this._radius!==e&&(this._radius=e,n.Tools.SetImmediate((function(){t._arrangeChildren()})))},enumerable:!1,configurable:!0}),t.prototype._mapGridNode=function(e,t){var i=e.mesh;if(i){var r=this._sphericalMapping(t);switch(e.position=r,this.orientation){case a.Container3D.FACEORIGIN_ORIENTATION:i.lookAt(new n.Vector3(2*r.x,2*r.y,2*r.z));break;case a.Container3D.FACEORIGINREVERSED_ORIENTATION:i.lookAt(new n.Vector3(-r.x,-r.y,-r.z));break;case a.Container3D.FACEFORWARD_ORIENTATION:break;case a.Container3D.FACEFORWARDREVERSED_ORIENTATION:i.rotate(n.Axis.Y,Math.PI,0)}}},t.prototype._sphericalMapping=function(e){var t=new n.Vector3(0,0,this._radius),i=e.y/this._radius,r=-e.x/this._radius;return n.Matrix.RotationYawPitchRollToRef(r,i,0,n.TmpVectors.Matrix[0]),n.Vector3.TransformNormal(t,n.TmpVectors.Matrix[0])},t}(o.VolumeBasedPanel)},"../../../dev/gui/src/3D/controls/stackPanel3D.ts":(e,t,i)=>{i.r(t),i.d(t,{StackPanel3D:()=>o});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=function(e){function t(t){void 0===t&&(t=!1);var i=e.call(this)||this;return i._isVertical=!1,i.margin=.1,i._isVertical=t,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"isVertical",{get:function(){return this._isVertical},set:function(e){var t=this;this._isVertical!==e&&(this._isVertical=e,n.Tools.SetImmediate((function(){t._arrangeChildren()})))},enumerable:!1,configurable:!0}),t.prototype._arrangeChildren=function(){for(var e,t=0,i=0,r=0,o=[],a=n.Matrix.Invert(this.node.computeWorldMatrix(!0)),s=0,l=this._children;s<l.length;s++)if((f=l[s]).mesh){r++,f.mesh.computeWorldMatrix(!0),f.mesh.getWorldMatrix().multiplyToRef(a,n.TmpVectors.Matrix[0]);var c=f.mesh.getBoundingInfo().boundingBox,u=n.Vector3.TransformNormal(c.extendSize,n.TmpVectors.Matrix[0]);o.push(u),this._isVertical?i+=u.y:t+=u.x}this._isVertical?i+=(r-1)*this.margin/2:t+=(r-1)*this.margin/2,e=this._isVertical?-i:-t;for(var h=0,d=0,_=this._children;d<_.length;d++){var f;(f=_[d]).mesh&&(r--,u=o[h++],this._isVertical?(f.position.y=e+u.y,f.position.x=0,e+=2*u.y):(f.position.x=e+u.x,f.position.y=0,e+=2*u.x),e+=r>0?this.margin:0)}},t}(i("../../../dev/gui/src/3D/controls/container3D.ts").Container3D)},"../../../dev/gui/src/3D/controls/touchButton3D.ts":(e,t,i)=>{i.r(t),i.d(t,{TouchButton3D:()=>o});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=function(e){function t(t,i){var r=e.call(this,t)||this;return r._isNearPressed=!1,r._interactionSurfaceHeight=0,r._isToggleButton=!1,r._toggleState=!1,r._toggleButtonCallback=function(){r._onToggle(!r._toggleState)},r.onToggleObservable=new n.Observable,r.collidableFrontDirection=n.Vector3.Zero(),i&&(r.collisionMesh=i),r}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"isActiveNearInteraction",{get:function(){return this._isNearPressed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"collidableFrontDirection",{get:function(){if(this._collisionMesh){var e=n.TmpVectors.Vector3[0];return n.Vector3.TransformNormalToRef(this._collidableFrontDirection,this._collisionMesh.getWorldMatrix(),e),e.normalize()}return this._collidableFrontDirection},set:function(e){if(this._collidableFrontDirection=e.normalize(),this._collisionMesh){var t=n.TmpVectors.Matrix[0];t.copyFrom(this._collisionMesh.getWorldMatrix()),t.invert(),n.Vector3.TransformNormalToRef(this._collidableFrontDirection,t,this._collidableFrontDirection),this._collidableFrontDirection.normalize()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"collisionMesh",{set:function(e){var t,i=this;this._collisionMesh&&(this._collisionMesh.isNearPickable=!1,(null===(t=this._collisionMesh.reservedDataStore)||void 0===t?void 0:t.GUI3D)&&(this._collisionMesh.reservedDataStore.GUI3D={}),this._collisionMesh.getChildMeshes().forEach((function(e){var t;e.isNearPickable=!1,(null===(t=e.reservedDataStore)||void 0===t?void 0:t.GUI3D)&&(e.reservedDataStore.GUI3D={})}))),this._collisionMesh=e,this._injectGUI3DReservedDataStore(this._collisionMesh).control=this,this._collisionMesh.isNearPickable=!0,this._collisionMesh.getChildMeshes().forEach((function(e){i._injectGUI3DReservedDataStore(e).control=i,e.isNearPickable=!0})),this.collidableFrontDirection=e.forward},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isToggleButton",{get:function(){return this._isToggleButton},set:function(e){e!==this._isToggleButton&&(this._isToggleButton=e,e?this.onPointerUpObservable.add(this._toggleButtonCallback):(this.onPointerUpObservable.removeCallback(this._toggleButtonCallback),this._toggleState&&this._onToggle(!1)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isToggled",{get:function(){return this._toggleState},set:function(e){this._isToggleButton&&this._toggleState!==e&&this._onToggle(e)},enumerable:!1,configurable:!0}),t.prototype._onToggle=function(e){this._toggleState=e,this.onToggleObservable.notifyObservers(e)},t.prototype._isInteractionInFrontOfButton=function(e){return this._getInteractionHeight(e,this._collisionMesh.getAbsolutePosition())>0},t.prototype.getPressDepth=function(e){if(!this._isNearPressed)return 0;var t=this._getInteractionHeight(e,this._collisionMesh.getAbsolutePosition());return this._interactionSurfaceHeight-t},t.prototype._getInteractionHeight=function(e,t){var i=this.collidableFrontDirection;if(0===i.length())return n.Vector3.Distance(e,t);var r=n.Vector3.Dot(t,i);return n.Vector3.Dot(e,i)-r},t.prototype._generatePointerEventType=function(e,t,i){if(e===n.PointerEventTypes.POINTERDOWN||e===n.PointerEventTypes.POINTERMOVE){if(!this._isInteractionInFrontOfButton(t))return n.PointerEventTypes.POINTERMOVE;this._isNearPressed=!0,this._interactionSurfaceHeight=this._getInteractionHeight(t,this._collisionMesh.getAbsolutePosition())}if(e===n.PointerEventTypes.POINTERUP){if(0==i)return n.PointerEventTypes.POINTERMOVE;this._isNearPressed=!1}return e},t.prototype._getTypeName=function(){return"TouchButton3D"},t.prototype._createNode=function(t){return e.prototype._createNode.call(this,t)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onPointerUpObservable.removeCallback(this._toggleButtonCallback),this.onToggleObservable.clear(),this._collisionMesh&&this._collisionMesh.dispose()},t}(i("../../../dev/gui/src/3D/controls/button3D.ts").Button3D)},"../../../dev/gui/src/3D/controls/touchHolographicButton.ts":(e,t,i)=>{i.r(t),i.d(t,{TouchHolographicButton:()=>h});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/3D/materials/fluent/fluentMaterial.ts"),a=i("../../../dev/gui/src/3D/materials/fluentButton/fluentButtonMaterial.ts"),s=i("../../../dev/gui/src/2D/controls/stackPanel.ts"),l=i("../../../dev/gui/src/2D/controls/image.ts"),c=i("../../../dev/gui/src/2D/controls/textBlock.ts"),u=i("../../../dev/gui/src/2D/advancedDynamicTexture.ts"),h=function(e){function t(t,i){void 0===i&&(i=!0);var r=e.call(this,t)||this;return r._shareMaterials=!0,r._isBackplateVisible=!0,r._frontPlateDepth=.5,r._backPlateDepth=.04,r._backplateColor=new n.Color3(.08,.15,.55),r._backplateToggledColor=new n.Color3(.25,.4,.95),r._shareMaterials=i,r.pointerEnterAnimation=function(){r._frontMaterial.leftBlobEnable=!0,r._frontMaterial.rightBlobEnable=!0},r.pointerOutAnimation=function(){r._frontMaterial.leftBlobEnable=!1,r._frontMaterial.rightBlobEnable=!1},r.pointerDownAnimation=function(){r._frontPlate&&!r.isActiveNearInteraction&&(r._frontPlate.scaling.z=.2*r._frontPlateDepth,r._frontPlate.position=n.Vector3.Forward(r._frontPlate._scene.useRightHandedSystem).scale((r._frontPlateDepth-.2*r._frontPlateDepth)/2),r._textPlate.position=n.Vector3.Forward(r._textPlate._scene.useRightHandedSystem).scale(-(r._backPlateDepth+.2*r._frontPlateDepth)/2))},r.pointerUpAnimation=function(){r._frontPlate&&(r._frontPlate.scaling.z=r._frontPlateDepth,r._frontPlate.position=n.Vector3.Forward(r._frontPlate._scene.useRightHandedSystem).scale((r._frontPlateDepth-r._frontPlateDepth)/2),r._textPlate.position=n.Vector3.Forward(r._textPlate._scene.useRightHandedSystem).scale(-(r._backPlateDepth+r._frontPlateDepth)/2))},r.onPointerMoveObservable.add((function(e){if(r._frontPlate&&r.isActiveNearInteraction){var t=n.Vector3.Zero();if(r._backPlate.getWorldMatrix().decompose(t,void 0,void 0)){var i=r._getInteractionHeight(e,r._backPlate.getAbsolutePosition())/t.z;i=n.Scalar.Clamp(i-r._backPlateDepth/2,.2*r._frontPlateDepth,r._frontPlateDepth),r._frontPlate.scaling.z=i,r._frontPlate.position=n.Vector3.Forward(r._frontPlate._scene.useRightHandedSystem).scale((r._frontPlateDepth-i)/2),r._textPlate.position=n.Vector3.Forward(r._textPlate._scene.useRightHandedSystem).scale(-(r._backPlateDepth+i)/2)}}})),r._pointerHoverObserver=r.onPointerMoveObservable.add((function(e){r._frontMaterial.globalLeftIndexTipPosition=e})),r}return(0,r.__extends)(t,e),t.prototype._disposeTooltip=function(){this._tooltipFade=null,this._tooltipTextBlock&&this._tooltipTextBlock.dispose(),this._tooltipTexture&&this._tooltipTexture.dispose(),this._tooltipMesh&&this._tooltipMesh.dispose(),this.onPointerEnterObservable.remove(this._tooltipHoverObserver),this.onPointerOutObservable.remove(this._tooltipOutObserver)},Object.defineProperty(t.prototype,"renderingGroupId",{get:function(){return this._backPlate.renderingGroupId},set:function(e){this._backPlate.renderingGroupId=e,this._textPlate.renderingGroupId=e,this._frontPlate.renderingGroupId=e,this._tooltipMesh&&(this._tooltipMesh.renderingGroupId=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mesh",{get:function(){return this._backPlate},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tooltipText",{get:function(){return this._tooltipTextBlock?this._tooltipTextBlock.text:null},set:function(e){var t=this;if(e){if(!this._tooltipFade){var i=this._backPlate._scene.useRightHandedSystem;this._tooltipMesh=(0,n.CreatePlane)("",{size:1},this._backPlate._scene);var r=(0,n.CreatePlane)("",{size:1,sideOrientation:n.Mesh.DOUBLESIDE},this._backPlate._scene),o=new n.StandardMaterial("",this._backPlate._scene);o.diffuseColor=n.Color3.FromHexString("#212121"),r.material=o,r.isPickable=!1,this._tooltipMesh.addChild(r),r.position=n.Vector3.Forward(i).scale(.05),this._tooltipMesh.scaling.y=1/3,this._tooltipMesh.position=n.Vector3.Up().scale(.7).add(n.Vector3.Forward(i).scale(-.15)),this._tooltipMesh.isPickable=!1,this._tooltipMesh.parent=this._backPlate,this._tooltipTexture=u.AdvancedDynamicTexture.CreateForMesh(this._tooltipMesh),this._tooltipTextBlock=new c.TextBlock,this._tooltipTextBlock.scaleY=3,this._tooltipTextBlock.color="white",this._tooltipTextBlock.fontSize=130,this._tooltipTexture.addControl(this._tooltipTextBlock),this._tooltipFade=new n.FadeInOutBehavior,this._tooltipFade.delay=500,this._tooltipMesh.addBehavior(this._tooltipFade),this._tooltipHoverObserver=this.onPointerEnterObservable.add((function(){t._tooltipFade&&t._tooltipFade.fadeIn(!0)})),this._tooltipOutObserver=this.onPointerOutObservable.add((function(){t._tooltipFade&&t._tooltipFade.fadeIn(!1)}))}this._tooltipTextBlock&&(this._tooltipTextBlock.text=e)}else this._disposeTooltip()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageUrl",{get:function(){return this._imageUrl},set:function(e){this._imageUrl!==e&&(this._imageUrl=e,this._rebuildContent())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backMaterial",{get:function(){return this._backMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frontMaterial",{get:function(){return this._frontMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plateMaterial",{get:function(){return this._plateMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shareMaterials",{get:function(){return this._shareMaterials},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isBackplateVisible",{set:function(e){this.mesh&&this._backMaterial&&(e&&!this._isBackplateVisible?this._backPlate.visibility=1:!e&&this._isBackplateVisible&&(this._backPlate.visibility=0)),this._isBackplateVisible=e},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"TouchHolographicButton"},t.prototype._rebuildContent=function(){this._disposeFacadeTexture();var e=new s.StackPanel;if(e.isVertical=!0,(0,n.IsDocumentAvailable)()&&document.createElement&&this._imageUrl){var t=new l.Image;t.source=this._imageUrl,t.paddingTop="40px",t.height="180px",t.width="100px",t.paddingBottom="40px",e.addControl(t)}if(this._text){var i=new c.TextBlock;i.text=this._text,i.color="white",i.height="30px",i.fontSize=24,e.addControl(i)}this.content=e},t.prototype._createNode=function(i){var r,o=this;this.name=null!==(r=this.name)&&void 0!==r?r:"TouchHolographicButton";var a=(0,n.CreateBox)("".concat(this.name,"_collisionMesh"),{width:1,height:1,depth:this._frontPlateDepth},i);a.isPickable=!0,a.isNearPickable=!0,a.visibility=0,a.position=n.Vector3.Forward(i.useRightHandedSystem).scale(-this._frontPlateDepth/2),n.SceneLoader.ImportMeshAsync(void 0,t.MODEL_BASE_URL,t.MODEL_FILENAME,i).then((function(e){var t=(0,n.CreateBox)("${this.name}_alphaMesh",{width:1,height:1,depth:1},i);t.isPickable=!1,t.material=new n.StandardMaterial("${this.name}_alphaMesh_material",i),t.material.alpha=.15;var r=e.meshes[1];r.name="".concat(o.name,"_frontPlate"),r.isPickable=!1,r.scaling.z=o._frontPlateDepth,t.parent=r,r.parent=a,o._frontMaterial&&(r.material=o._frontMaterial),o._frontPlate=r})),this._backPlate=(0,n.CreateBox)("".concat(this.name,"_backPlate"),{width:1,height:1,depth:this._backPlateDepth},i),this._backPlate.position=n.Vector3.Forward(i.useRightHandedSystem).scale(this._backPlateDepth/2),this._backPlate.isPickable=!1,this._textPlate=e.prototype._createNode.call(this,i),this._textPlate.name="".concat(this.name,"_textPlate"),this._textPlate.isPickable=!1,this._textPlate.position=n.Vector3.Forward(i.useRightHandedSystem).scale(-this._frontPlateDepth/2),this._backPlate.addChild(a),this._backPlate.addChild(this._textPlate);var s=new n.TransformNode("{this.name}_root",i);return this._backPlate.setParent(s),this.collisionMesh=a,this.collidableFrontDirection=this._backPlate.forward.negate(),s},t.prototype._applyFacade=function(e){this._plateMaterial.emissiveTexture=e,this._plateMaterial.opacityTexture=e,this._plateMaterial.diffuseColor=new n.Color3(.4,.4,.4)},t.prototype._createBackMaterial=function(e){this._backMaterial=new o.FluentMaterial(this.name+"backPlateMaterial",e.getScene()),this._backMaterial.albedoColor=this._backplateColor,this._backMaterial.renderBorders=!0,this._backMaterial.renderHoverLight=!1},t.prototype._createFrontMaterial=function(e){this._frontMaterial=new a.FluentButtonMaterial(this.name+"Front Material",e.getScene())},t.prototype._createPlateMaterial=function(e){this._plateMaterial=new n.StandardMaterial(this.name+"Plate Material",e.getScene()),this._plateMaterial.specularColor=n.Color3.Black()},t.prototype._onToggle=function(t){this._backMaterial&&(this._backMaterial.albedoColor=t?this._backplateToggledColor:this._backplateColor),e.prototype._onToggle.call(this,t)},t.prototype._affectMaterial=function(e){this._shareMaterials?(this._host._touchSharedMaterials.backFluentMaterial?this._backMaterial=this._host._touchSharedMaterials.backFluentMaterial:(this._createBackMaterial(e),this._host._touchSharedMaterials.backFluentMaterial=this._backMaterial),this._host._touchSharedMaterials.frontFluentMaterial?this._frontMaterial=this._host._touchSharedMaterials.frontFluentMaterial:(this._createFrontMaterial(e),this._host._touchSharedMaterials.frontFluentMaterial=this._frontMaterial)):(this._createBackMaterial(e),this._createFrontMaterial(e)),this._createPlateMaterial(e),this._backPlate.material=this._backMaterial,this._textPlate.material=this._plateMaterial,this._isBackplateVisible||(this._backPlate.visibility=0),this._frontPlate&&(this._frontPlate.material=this._frontMaterial),this._rebuildContent()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._disposeTooltip(),this.onPointerMoveObservable.remove(this._pointerHoverObserver),this.shareMaterials||(this._backMaterial.dispose(),this._frontMaterial.dispose(),this._plateMaterial.dispose(),this._pickedPointObserver&&(this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver),this._pickedPointObserver=null))},t.MODEL_BASE_URL="https://assets.babylonjs.com/meshes/MRTK/",t.MODEL_FILENAME="mrtk-fluent-button.glb",t}(i("../../../dev/gui/src/3D/controls/touchButton3D.ts").TouchButton3D)},"../../../dev/gui/src/3D/controls/touchHolographicMenu.ts":(e,t,i)=>{i.r(t),i.d(t,{TouchHolographicMenu:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/gui/src/3D/controls/volumeBasedPanel.ts"),o=i("babylonjs/Misc/perfCounter"),a=i("../../../dev/gui/src/3D/materials/fluent/fluentMaterial.ts"),s=function(e){function t(t){var i=e.call(this,t)||this;return i._backPlateMargin=1.25,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"backPlateMargin",{get:function(){return this._backPlateMargin},set:function(e){var t=this;this._backPlateMargin=e,this._children.length>=1&&(this.children.forEach((function(e){t._updateCurrentMinMax(e.position)})),this._updateMargins())},enumerable:!1,configurable:!0}),t.prototype._createNode=function(e){var t=new o.Mesh("menu_".concat(this.name),e);return this._backPlate=(0,o.CreateBox)("backPlate"+this.name,{size:1},e),this._backPlate.parent=t,t},t.prototype._affectMaterial=function(e){var t=this;this._backPlateMaterial=new a.FluentMaterial(this.name+"backPlateMaterial",e.getScene()),this._backPlateMaterial.albedoColor=new o.Color3(.08,.15,.55),this._backPlateMaterial.renderBorders=!0,this._backPlateMaterial.renderHoverLight=!0,this._pickedPointObserver=this._host.onPickedPointChangedObservable.add((function(e){e?(t._backPlateMaterial.hoverPosition=e,t._backPlateMaterial.hoverColor.a=1):t._backPlateMaterial.hoverColor.a=0})),this._backPlate.material=this._backPlateMaterial},t.prototype._mapGridNode=function(e,t){e.mesh&&(e.position=t.clone(),this._updateCurrentMinMax(t))},t.prototype._finalProcessing=function(){this._updateMargins()},t.prototype._updateCurrentMinMax=function(e){this._currentMin||(this._currentMin=e.clone(),this._currentMax=e.clone()),this._currentMin.minimizeInPlace(e),this._currentMax.maximizeInPlace(e)},t.prototype._updateMargins=function(){if(this._children.length>0){this._currentMin.addInPlaceFromFloats(-this._cellWidth/2,-this._cellHeight/2,0),this._currentMax.addInPlaceFromFloats(this._cellWidth/2,this._cellHeight/2,0);var e=this._currentMax.subtract(this._currentMin);this._backPlate.scaling.x=e.x+this._cellWidth*this.backPlateMargin,this._backPlate.scaling.y=e.y+this._cellHeight*this.backPlateMargin,this._backPlate.scaling.z=.001;for(var t=0;t<this._children.length;t++)this._children[t].position.subtractInPlace(this._currentMin).subtractInPlace(e.scale(.5)),this._children[t].position.z-=.01}this._currentMin=null,this._currentMax=null},t.prototype.addButton=function(i){var r=this.blockLayout;return r||(this.blockLayout=!0),e.prototype.addControl.call(this,i),i.isBackplateVisible=!1,i.scaling.scaleInPlace(t.MENU_BUTTON_SCALE),r||(this.blockLayout=!1),this},t.prototype.addControl=function(e){return o.Logger.Warn("TouchHolographicMenu can only contain buttons. Please use the method `addButton` instead."),this},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver)},t.MENU_BUTTON_SCALE=1,t}(n.VolumeBasedPanel)},"../../../dev/gui/src/3D/controls/touchMeshButton3D.ts":(e,t,i)=>{i.r(t),i.d(t,{TouchMeshButton3D:()=>n});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=function(e){function t(t,i){var r=e.call(this,i,t)||this;return r._currentMesh=t,r.pointerEnterAnimation=function(){r.mesh&&r.mesh.scaling.scaleInPlace(1.1)},r.pointerOutAnimation=function(){r.mesh&&r.mesh.scaling.scaleInPlace(1/1.1)},r.pointerDownAnimation=function(){r.mesh&&r.mesh.scaling.scaleInPlace(.95)},r.pointerUpAnimation=function(){r.mesh&&r.mesh.scaling.scaleInPlace(1/.95)},r}return(0,r.__extends)(t,e),t.prototype._getTypeName=function(){return"TouchMeshButton3D"},t.prototype._createNode=function(){var e=this;return this._currentMesh.getChildMeshes().forEach((function(t){e._injectGUI3DReservedDataStore(t).control=e})),this._currentMesh},t.prototype._affectMaterial=function(e){},t}(i("../../../dev/gui/src/3D/controls/touchButton3D.ts").TouchButton3D)},"../../../dev/gui/src/3D/controls/volumeBasedPanel.ts":(e,t,i)=>{i.r(t),i.d(t,{VolumeBasedPanel:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/3D/controls/container3D.ts"),a=function(e){function t(t){var i=e.call(this,t)||this;return i._columns=10,i._rows=0,i._rowThenColum=!0,i._orientation=o.Container3D.FACEORIGIN_ORIENTATION,i.margin=0,i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"orientation",{get:function(){return this._orientation},set:function(e){var t=this;this._orientation!==e&&(this._orientation=e,n.Tools.SetImmediate((function(){t._arrangeChildren()})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"columns",{get:function(){return this._columns},set:function(e){var t=this;this._columns!==e&&(this._columns=e,this._rowThenColum=!0,n.Tools.SetImmediate((function(){t._arrangeChildren()})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rows",{get:function(){return this._rows},set:function(e){var t=this;this._rows!==e&&(this._rows=e,this._rowThenColum=!1,n.Tools.SetImmediate((function(){t._arrangeChildren()})))},enumerable:!1,configurable:!0}),t.prototype._arrangeChildren=function(){this._cellWidth=0,this._cellHeight=0;for(var e=0,t=0,i=0,r=n.Matrix.Invert(this.node.computeWorldMatrix(!0)),o=0,a=this._children;o<a.length;o++)if((v=a[o]).mesh){i++,v.mesh.computeWorldMatrix(!0);var s=v.mesh.getHierarchyBoundingVectors(),l=n.TmpVectors.Vector3[0],c=n.TmpVectors.Vector3[1];s.max.subtractToRef(s.min,c),c.scaleInPlace(.5),n.Vector3.TransformNormalToRef(c,r,l),this._cellWidth=Math.max(this._cellWidth,2*l.x),this._cellHeight=Math.max(this._cellHeight,2*l.y)}this._cellWidth+=2*this.margin,this._cellHeight+=2*this.margin,this._rowThenColum?(t=this._columns,e=Math.ceil(i/this._columns)):(e=this._rows,t=Math.ceil(i/this._rows));var u=.5*t*this._cellWidth,h=.5*e*this._cellHeight,d=[],_=0;if(this._rowThenColum)for(var f=0;f<e;f++)for(var p=0;p<t&&(d.push(new n.Vector3(p*this._cellWidth-u+this._cellWidth/2,f*this._cellHeight-h+this._cellHeight/2,0)),!(++_>i));p++);else for(p=0;p<t;p++)for(f=0;f<e&&(d.push(new n.Vector3(p*this._cellWidth-u+this._cellWidth/2,f*this._cellHeight-h+this._cellHeight/2,0)),!(++_>i));f++);_=0;for(var m=0,g=this._children;m<g.length;m++){var v;(v=g[m]).mesh&&(this._mapGridNode(v,d[_]),_++)}this._finalProcessing()},t.prototype._finalProcessing=function(){},t}(o.Container3D)},"../../../dev/gui/src/3D/gizmos/gizmoHandle.ts":(e,t,i)=>{i.r(t),i.d(t,{CornerHandle:()=>c,GizmoHandle:()=>s,HandleState:()=>r,SideHandle:()=>l});var r,n=i("../../../../node_modules/tslib/tslib.es6.mjs"),o=i("babylonjs/Misc/perfCounter"),a=i("../../../dev/gui/src/3D/materials/handle/handleMaterial.ts");!function(e){e[e.IDLE=0]="IDLE",e[e.HOVER=1]="HOVER",e[e.DRAG=2]="DRAG"}(r||(r={}));var s=function(){function e(e,t){this._state=0,this._materials=[],this._scene=t,this._gizmo=e,this.node=this.createNode(),this.node.reservedDataStore={handle:this}}return Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gizmo",{get:function(){return this._gizmo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hover",{set:function(e){e?this._state|=1:this._state&=-2,this._updateMaterial()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drag",{set:function(e){e?this._state|=2:this._state&=-3,this._updateMaterial()},enumerable:!1,configurable:!0}),e.prototype._createMaterial=function(e){var t=new a.HandleMaterial("handle",this._scene);return e&&(t._positionOffset=e),t},e.prototype._updateMaterial=function(){for(var e=this._state,t=0,i=this._materials;t<i.length;t++)(s=i[t]).hover=!1,s.drag=!1;if(2&e)for(var r=0,n=this._materials;r<n.length;r++)(s=n[r]).drag=!0;else if(1&e)for(var o=0,a=this._materials;o<a.length;o++){var s;(s=a[o]).hover=!0}},e.prototype.setDragBehavior=function(e,t,i){var r=new o.BaseSixDofDragBehavior;this._dragBehavior=r,this._dragStartObserver=r.onDragStartObservable.add(e),this._draggingObserver=r.onDragObservable.add(t),this._dragEndObserver=r.onDragEndObservable.add(i),this._dragBehavior.attach(this.node)},e.prototype.dispose=function(){this._dragBehavior.onDragStartObservable.remove(this._dragStartObserver),this._dragBehavior.onDragObservable.remove(this._draggingObserver),this._dragBehavior.onDragEndObservable.remove(this._dragEndObserver),this._dragBehavior.detach();for(var e=0,t=this._materials;e<t.length;e++)t[e].dispose();this.node.dispose()},e}(),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,n.__extends)(t,e),t.prototype.createNode=function(){var e=(0,o.CreateBox)("sideVert",{width:1,height:10,depth:.1},this._scene),t=new o.TransformNode("side",this._scene);e.parent=t;var i=this._createMaterial();return e.material=i,e.isNearGrabbable=!0,this._materials.push(i),t},t}(s),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,n.__extends)(t,e),t.prototype.createNode=function(){var e=(0,o.CreateBox)("angleHor",{width:3,height:1,depth:.1},this._scene),t=(0,o.CreateBox)("angleVert",{width:1,height:3,depth:.1},this._scene),i=new o.TransformNode("angle",this._scene);return e.parent=i,t.parent=i,e.material=this._createMaterial(new o.Vector3(1,0,0)),t.material=this._createMaterial(new o.Vector3(0,1,0)),t.isNearGrabbable=!0,e.isNearGrabbable=!0,this._materials.push(e.material),this._materials.push(t.material),i},t}(s)},"../../../dev/gui/src/3D/gizmos/index.ts":(e,t,i)=>{i.r(t),i.d(t,{CornerHandle:()=>n.CornerHandle,GizmoHandle:()=>n.GizmoHandle,HandleState:()=>n.HandleState,SideHandle:()=>n.SideHandle,SlateGizmo:()=>r.SlateGizmo});var r=i("../../../dev/gui/src/3D/gizmos/slateGizmo.ts"),n=i("../../../dev/gui/src/3D/gizmos/gizmoHandle.ts")},"../../../dev/gui/src/3D/gizmos/slateGizmo.ts":(e,t,i)=>{i.r(t),i.d(t,{SlateGizmo:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=i("../../../dev/gui/src/3D/gizmos/gizmoHandle.ts"),a=function(e){function t(t){var i=e.call(this,t)||this;return i._boundingDimensions=new n.Vector3(0,0,0),i._renderObserver=null,i._tmpQuaternion=new n.Quaternion,i._tmpVector=new n.Vector3(0,0,0),i._corners=[],i._sides=[],i._boundingBoxGizmo={min:new n.Vector3,max:new n.Vector3},i._margin=.35,i._handleSize=.075,i._attachedSlate=null,i._existingSlateScale=new n.Vector3,i.fixedScreenSize=!1,i.fixedScreenSizeDistanceFactor=10,i._createNode(),i.updateScale=!1,i._renderObserver=i.gizmoLayer.originalScene.onBeforeRenderObservable.add((function(){i.attachedMesh&&!i._existingSlateScale.equals(i.attachedMesh.scaling)&&i.updateBoundingBox()})),i}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"attachedSlate",{get:function(){return this._attachedSlate},set:function(e){var t=this;e?(this.attachedMesh=e.mesh,this.updateBoundingBox(),this._pickedPointObserver=e._host.onPickingObservable.add((function(e){if(!t._handleHovered||e&&e.parent===t._handleHovered.node||(t._handleHovered.hover=!1,t._handleHovered=null),e&&e.parent&&e.parent.reservedDataStore&&e.parent.reservedDataStore.handle){var i=e.parent.reservedDataStore.handle;i.gizmo===t&&(t._handleHovered=i,t._handleHovered.hover=!0)}}))):this._attachedSlate&&this._attachedSlate._host.onPickingObservable.remove(this._pickedPointObserver),this._attachedSlate=e},enumerable:!1,configurable:!0}),t.prototype._createNode=function(){var e=this;this._handlesParent=new n.TransformNode("handlesParent",this.gizmoLayer.utilityLayerScene),this._handlesParent.rotationQuaternion=n.Quaternion.Identity();for(var t=[{dimensions:new n.Vector3(-1,-1,0),origin:new n.Vector3(1,0,0)},{dimensions:new n.Vector3(1,-1,0),origin:new n.Vector3(0,0,0)},{dimensions:new n.Vector3(1,1,0),origin:new n.Vector3(0,1,0)},{dimensions:new n.Vector3(-1,1,0),origin:new n.Vector3(1,1,0)}],i=0;i<4;i++){var r=new o.CornerHandle(this,this.gizmoLayer.utilityLayerScene);this._corners.push(r),r.node.rotation.z=Math.PI/2*i,r.node.parent=this._handlesParent,this._assignDragBehaviorCorners(r,(function(t,i,r,n){return e._moveHandle(t,i,r,n,!0)}),t[i])}for(i=0;i<4;i++){var a=new o.SideHandle(this,this.gizmoLayer.utilityLayerScene);this._sides.push(a),a.node.rotation.z=Math.PI/2*i,a.node.parent=this._handlesParent,this._assignDragBehaviorSides(a,i%2==0?new n.Vector3(0,1,0):new n.Vector3(1,0,0))}this._handlesParent.parent=this._rootMesh},t.prototype._keepAspectRatio=function(e,t,i){void 0===i&&(i=!1);var r=n.TmpVectors.Vector3[0];r.copyFromFloats(t,1,0).normalize(),i&&(r.y*=-1);var o=n.Vector3.Dot(e,r);e.copyFrom(r).scaleInPlace(o)},t.prototype._clampDimensions=function(e,t,i,r){void 0===r&&(r=!1);var o=n.TmpVectors.Vector3[0];o.copyFrom(e).multiplyInPlace(i);var a=n.TmpVectors.Vector3[1];if(a.copyFromFloats(Math.max(this._attachedSlate.minDimensions.x,o.x+t.x),Math.max(this._attachedSlate.minDimensions.y,o.y+t.y),0),r){var s=t.x/t.y;a.x=Math.max(a.x,a.y*s),a.y=Math.max(a.y,a.x/s)}o.copyFrom(a).subtractInPlace(t),e.x=Math.sign(e.x)*Math.abs(o.x),e.y=Math.sign(e.y)*Math.abs(o.y)},t.prototype._moveHandle=function(e,t,i,r,o){if(this._attachedSlate){if(o){var a=t.x/t.y;this._keepAspectRatio(i,a,r.dimensions.x*r.dimensions.y<0)}this._clampDimensions(i,t,r.dimensions,o);var s=n.TmpVectors.Vector3[0],l=n.TmpVectors.Vector3[1];s.copyFrom(i).multiplyInPlace(r.origin),l.copyFrom(i).multiplyInPlace(r.dimensions),this._attachedSlate.origin.copyFrom(e).addInPlace(s),this._attachedSlate.dimensions.set(t.x+l.x,t.y+l.y)}},t.prototype._assignDragBehaviorCorners=function(e,t,i){var r=this,o=new n.Vector3,a=new n.Vector3,s=new n.Vector3,l=new n.Matrix,c=new n.Vector3;e.setDragBehavior((function(e){r.attachedSlate&&r.attachedMesh&&(o.set(r.attachedSlate.dimensions.x,r.attachedSlate.dimensions.y,n.Epsilon),a.copyFrom(r.attachedSlate.origin),s.copyFrom(e.position),l.copyFrom(r.attachedMesh.computeWorldMatrix(!0)),l.invert(),r.attachedSlate._followButton.isToggled=!1,n.Vector3.TransformNormalToRef(n.Vector3.Forward(),r.attachedMesh.getWorldMatrix(),c),c.normalize(),r._handleHovered&&(r._handleDragged=r._handleHovered,r._handleDragged.drag=!0))}),(function(e){r.attachedSlate&&r.attachedMesh&&(function(e,t,i,r){e.subtractToRef(i,n.TmpVectors.Vector3[0]);var o=n.Vector3.Dot(n.TmpVectors.Vector3[0],t);n.TmpVectors.Vector3[1].copyFrom(t).scaleInPlace(o),n.TmpVectors.Vector3[0].subtractInPlace(n.TmpVectors.Vector3[1]),n.TmpVectors.Vector3[0].addToRef(i,r)}(e.position,c,s,r._tmpVector),r._tmpVector.subtractInPlace(s),n.Vector3.TransformNormalToRef(r._tmpVector,l,r._tmpVector),t(a,o,r._tmpVector,i),r.attachedSlate._positionElements(),r.updateBoundingBox())}),(function(){r.attachedSlate&&r.attachedNode&&(r.attachedSlate._updatePivot(),r._handleDragged&&(r._handleDragged.drag=!1,r._handleDragged=null))}))},t.prototype._assignDragBehaviorSides=function(e,t){var i=this,r=new n.Quaternion,o=new n.Vector3,a=new n.Vector3,s=new n.Vector3,l=new n.Vector3;e.setDragBehavior((function(e){i.attachedSlate&&i.attachedMesh&&(r.copyFrom(i.attachedMesh.rotationQuaternion),o.copyFrom(e.position),s.copyFrom(i.attachedMesh.getAbsolutePivotPoint()),a.copyFrom(o).subtractInPlace(s).normalize(),i.attachedSlate._followButton.isToggled=!1,n.Vector3.TransformNormalToRef(t,i.attachedMesh.getWorldMatrix(),l),l.normalize(),i._handleHovered&&(i._handleDragged=i._handleHovered,i._handleDragged.drag=!0))}),(function(e){if(i.attachedSlate&&i.attachedMesh){i._tmpVector.copyFrom(e.position),i._tmpVector.subtractInPlace(s),i._tmpVector.normalize();var o=-n.Vector3.GetAngleBetweenVectorsOnPlane(i._tmpVector,a,l);n.Quaternion.RotationAxisToRef(t,o,i._tmpQuaternion),r.multiplyToRef(i._tmpQuaternion,i.attachedMesh.rotationQuaternion)}}),(function(){i.attachedSlate&&i.attachedNode&&(i.attachedSlate._updatePivot(),i._handleDragged&&(i._handleDragged.drag=!1,i._handleDragged=null))}))},t.prototype._attachedNodeChanged=function(e){e&&this.updateBoundingBox()},t.prototype.updateBoundingBox=function(){if(this.attachedMesh){n.PivotTools._RemoveAndStorePivotPoint(this.attachedMesh);var e=this.attachedMesh.parent;this.attachedMesh.setParent(null),this._update(),this.attachedMesh.rotationQuaternion||(this.attachedMesh.rotationQuaternion=n.Quaternion.RotationYawPitchRoll(this.attachedMesh.rotation.y,this.attachedMesh.rotation.x,this.attachedMesh.rotation.z)),this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion),this._tmpVector.copyFrom(this.attachedMesh.position),this.attachedMesh.rotationQuaternion.set(0,0,0,1),this.attachedMesh.position.set(0,0,0);var t=this.attachedMesh.getHierarchyBoundingVectors();t.max.subtractToRef(t.min,this._boundingDimensions),this._boundingBoxGizmo.min=t.min,this._boundingBoxGizmo.max=t.max,this._updateHandlesPosition(),this._updateHandlesScaling(),this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion),this.attachedMesh.position.copyFrom(this._tmpVector),n.PivotTools._RestorePivotPoint(this.attachedMesh),this.attachedMesh.setParent(e),this.attachedMesh.computeWorldMatrix(!0),this._existingSlateScale.copyFrom(this.attachedMesh.scaling)}},t.prototype._updateHandlesPosition=function(){var e=this._boundingBoxGizmo.min.clone(),t=this._boundingBoxGizmo.max.clone(),i=this._corners[0].node.scaling.length();e.x-=this._margin*i,e.y-=this._margin*i,t.x+=this._margin*i,t.y+=this._margin*i;var r=e.add(t).scaleInPlace(.5);this._corners[0].node.position.copyFromFloats(e.x,e.y,0),this._corners[1].node.position.copyFromFloats(t.x,e.y,0),this._corners[2].node.position.copyFromFloats(t.x,t.y,0),this._corners[3].node.position.copyFromFloats(e.x,t.y,0),this._sides[0].node.position.copyFromFloats(e.x,r.y,0),this._sides[1].node.position.copyFromFloats(r.x,e.y,0),this._sides[2].node.position.copyFromFloats(t.x,r.y,0),this._sides[3].node.position.copyFromFloats(r.x,t.y,0)},t.prototype._updateHandlesScaling=function(){if(this._attachedSlate&&this._attachedSlate.mesh){for(var e=this._attachedSlate.mesh.scaling.x*this._attachedSlate.dimensions.x,t=this._attachedSlate.mesh.scaling.y*this._attachedSlate.dimensions.y,i=Math.min(e,t)*this._handleSize,r=0;r<this._corners.length;r++)this._corners[r].node.scaling.setAll(i);for(r=0;r<this._sides.length;r++)this._sides[r].node.scaling.setAll(i)}},t.prototype._update=function(){if(e.prototype._update.call(this),this.gizmoLayer.utilityLayerScene.activeCamera&&this._attachedSlate&&this._attachedSlate.mesh){if(this.fixedScreenSize){this._attachedSlate.mesh.absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position,this._tmpVector);for(var t=this._handleSize*this._tmpVector.length()/this.fixedScreenSizeDistanceFactor,i=0;i<this._corners.length;i++)this._corners[i].node.scaling.set(t,t,t);for(i=0;i<this._sides.length;i++)this._sides[i].node.scaling.set(t,t,t)}this._updateHandlesPosition()}},t.prototype.dispose=function(){this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver),e.prototype.dispose.call(this);for(var t=0,i=this._corners;t<i.length;t++)i[t].dispose();for(var r=0,n=this._sides;r<n.length;r++)n[r].dispose()},t}(n.Gizmo)},"../../../dev/gui/src/3D/gui3DManager.ts":(e,t,i)=>{i.r(t),i.d(t,{GUI3DManager:()=>o});var r=i("babylonjs/Misc/perfCounter"),n=i("../../../dev/gui/src/3D/controls/container3D.ts"),o=function(){function e(e){var t=this;this._customControlScaling=1,this._lastControlOver={},this._lastControlDown={},this.onPickedPointChangedObservable=new r.Observable,this.onPickingObservable=new r.Observable,this._sharedMaterials={},this._touchSharedMaterials={},this._scene=e||r.EngineStore.LastCreatedScene,this._sceneDisposeObserver=this._scene.onDisposeObservable.add((function(){t._sceneDisposeObserver=null,t._utilityLayer=null,t.dispose()})),this._utilityLayer=r.UtilityLayerRenderer._CreateDefaultUtilityLayerFromScene(this._scene),this._utilityLayer.onlyCheckPointerDownEvents=!1,this._utilityLayer.pickUtilitySceneFirst=!1,this._utilityLayer.mainSceneTrackerPredicate=function(e){var t,i,r;return e&&(null===(r=null===(i=null===(t=e.reservedDataStore)||void 0===t?void 0:t.GUI3D)||void 0===i?void 0:i.control)||void 0===r?void 0:r._node)},this._rootContainer=new n.Container3D("RootContainer"),this._rootContainer._host=this;var i=this._utilityLayer.utilityLayerScene;this._pointerOutObserver=this._utilityLayer.onPointerOutObservable.add((function(e){t._handlePointerOut(e,!0)})),this._pointerObserver=i.onPointerObservable.add((function(e){t._doPicking(e)})),this._utilityLayer.utilityLayerScene.autoClear=!1,this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil=!1,new r.HemisphericLight("hemi",r.Vector3.Up(),this._utilityLayer.utilityLayerScene)}return Object.defineProperty(e.prototype,"scene",{get:function(){return this._scene},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"utilityLayer",{get:function(){return this._utilityLayer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controlScaling",{get:function(){return this._customControlScaling},set:function(e){if(this._customControlScaling!==e&&e>0){var t=e/this._customControlScaling;this._customControlScaling=e,this._rootContainer.children.forEach((function(i){i.scaling.scaleInPlace(t),1!==e&&(i._isScaledByManager=!0)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useRealisticScaling",{get:function(){return this.controlScaling===e.MRTK_REALISTIC_SCALING},set:function(t){this.controlScaling=t?e.MRTK_REALISTIC_SCALING:1},enumerable:!1,configurable:!0}),e.prototype._handlePointerOut=function(e,t){var i=this._lastControlOver[e];i&&(i._onPointerOut(i),delete this._lastControlOver[e]),t&&this._lastControlDown[e]&&(this._lastControlDown[e].forcePointerUp(),delete this._lastControlDown[e]),this.onPickedPointChangedObservable.notifyObservers(null)},e.prototype._doPicking=function(e){var t,i,n;if(!this._utilityLayer||!this._utilityLayer.shouldRender||!this._utilityLayer.utilityLayerScene.activeCamera)return!1;var o=e.event,a=o.pointerId||0,s=o.button,l=e.pickInfo;if(l&&this.onPickingObservable.notifyObservers(l.pickedMesh),!l||!l.hit)return this._handlePointerOut(a,e.type===r.PointerEventTypes.POINTERUP),!1;l.pickedPoint&&this.onPickedPointChangedObservable.notifyObservers(l.pickedPoint);var c=null===(i=null===(t=l.pickedMesh.reservedDataStore)||void 0===t?void 0:t.GUI3D)||void 0===i?void 0:i.control;return c&&!c._processObservables(e.type,l.pickedPoint,(null===(n=l.originMesh)||void 0===n?void 0:n.position)||null,a,s)&&e.type===r.PointerEventTypes.POINTERMOVE&&(this._lastControlOver[a]&&this._lastControlOver[a]._onPointerOut(this._lastControlOver[a]),delete this._lastControlOver[a]),e.type===r.PointerEventTypes.POINTERUP&&(this._lastControlDown[o.pointerId]&&(this._lastControlDown[o.pointerId].forcePointerUp(),delete this._lastControlDown[o.pointerId]),("touch"===o.pointerType||"xr"===o.pointerType&&this._scene.getEngine().hostInformation.isMobile)&&this._handlePointerOut(a,!1)),!0},Object.defineProperty(e.prototype,"rootContainer",{get:function(){return this._rootContainer},enumerable:!1,configurable:!0}),e.prototype.containsControl=function(e){return this._rootContainer.containsControl(e)},e.prototype.addControl=function(e){return this._rootContainer.addControl(e),1!==this._customControlScaling&&(e.scaling.scaleInPlace(this._customControlScaling),e._isScaledByManager=!0),this},e.prototype.removeControl=function(e){return this._rootContainer.removeControl(e),e._isScaledByManager&&(e.scaling.scaleInPlace(1/this._customControlScaling),e._isScaledByManager=!1),this},e.prototype.dispose=function(){for(var e in this._rootContainer.dispose(),this._sharedMaterials)Object.prototype.hasOwnProperty.call(this._sharedMaterials,e)&&this._sharedMaterials[e].dispose();for(var e in this._sharedMaterials={},this._touchSharedMaterials)Object.prototype.hasOwnProperty.call(this._touchSharedMaterials,e)&&this._touchSharedMaterials[e].dispose();this._touchSharedMaterials={},this._pointerOutObserver&&this._utilityLayer&&(this._utilityLayer.onPointerOutObservable.remove(this._pointerOutObserver),this._pointerOutObserver=null),this.onPickedPointChangedObservable.clear(),this.onPickingObservable.clear();var t=this._utilityLayer?this._utilityLayer.utilityLayerScene:null;t&&this._pointerObserver&&(t.onPointerObservable.remove(this._pointerObserver),this._pointerObserver=null),this._scene&&this._sceneDisposeObserver&&(this._scene.onDisposeObservable.remove(this._sceneDisposeObserver),this._sceneDisposeObserver=null),this._utilityLayer&&this._utilityLayer.dispose()},e.MRTK_REALISTIC_SCALING=.032,e}()},"../../../dev/gui/src/3D/index.ts":(e,t,i)=>{i.r(t),i.d(t,{AbstractButton3D:()=>r.AbstractButton3D,Button3D:()=>r.Button3D,Container3D:()=>r.Container3D,Control3D:()=>r.Control3D,CornerHandle:()=>o.CornerHandle,CylinderPanel:()=>r.CylinderPanel,FluentBackplateMaterial:()=>n.FluentBackplateMaterial,FluentButtonMaterial:()=>n.FluentButtonMaterial,FluentMaterial:()=>n.FluentMaterial,FluentMaterialDefines:()=>n.FluentMaterialDefines,GUI3DManager:()=>a.GUI3DManager,GizmoHandle:()=>o.GizmoHandle,HandMenu:()=>r.HandMenu,HandleMaterial:()=>n.HandleMaterial,HandleState:()=>o.HandleState,HolographicBackplate:()=>r.HolographicBackplate,HolographicButton:()=>r.HolographicButton,HolographicSlate:()=>r.HolographicSlate,MRDLBackplateMaterial:()=>n.MRDLBackplateMaterial,MRDLSliderBarMaterial:()=>n.MRDLSliderBarMaterial,MRDLSliderThumbMaterial:()=>n.MRDLSliderThumbMaterial,MeshButton3D:()=>r.MeshButton3D,NearMenu:()=>r.NearMenu,PlanePanel:()=>r.PlanePanel,ScatterPanel:()=>r.ScatterPanel,SideHandle:()=>o.SideHandle,SlateGizmo:()=>o.SlateGizmo,Slider3D:()=>r.Slider3D,SpherePanel:()=>r.SpherePanel,StackPanel3D:()=>r.StackPanel3D,TouchButton3D:()=>r.TouchButton3D,TouchHolographicButton:()=>r.TouchHolographicButton,TouchHolographicButtonV3:()=>r.TouchHolographicButtonV3,TouchHolographicMenu:()=>r.TouchHolographicMenu,TouchMeshButton3D:()=>r.TouchMeshButton3D,Vector3WithInfo:()=>s.Vector3WithInfo,VolumeBasedPanel:()=>r.VolumeBasedPanel});var r=i("../../../dev/gui/src/3D/controls/index.ts"),n=i("../../../dev/gui/src/3D/materials/index.ts"),o=i("../../../dev/gui/src/3D/gizmos/index.ts"),a=i("../../../dev/gui/src/3D/gui3DManager.ts"),s=i("../../../dev/gui/src/3D/vector3WithInfo.ts")},"../../../dev/gui/src/3D/materials/fluent/fluentMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{FluentMaterial:()=>a,FluentMaterialDefines:()=>o});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=(i("../../../dev/gui/src/3D/materials/fluent/shaders/fluent.vertex.ts"),i("../../../dev/gui/src/3D/materials/fluent/shaders/fluent.fragment.ts"),function(e){function t(){var t=e.call(this)||this;return t.INNERGLOW=!1,t.BORDER=!1,t.HOVERLIGHT=!1,t.TEXTURE=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.innerGlowColorIntensity=.5,r.innerGlowColor=new n.Color3(1,1,1),r.albedoColor=new n.Color3(.3,.35,.4),r.renderBorders=!1,r.borderWidth=.5,r.edgeSmoothingValue=.02,r.borderMinValue=.1,r.renderHoverLight=!1,r.hoverRadius=.01,r.hoverColor=new n.Color4(.3,.3,.3,1),r.hoverPosition=n.Vector3.Zero(),r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return 1!==this.alpha},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t){var i=t._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;t.materialDefines||(t.materialDefines=new o);var r=this.getScene(),a=t.materialDefines;if(!this.checkReadyOnEveryCall&&t.effect&&a._renderId===r.getRenderId())return!0;if(a._areTexturesDirty)if(a.INNERGLOW=this.innerGlowColorIntensity>0,a.BORDER=this.renderBorders,a.HOVERLIGHT=this.renderHoverLight,this._albedoTexture){if(!this._albedoTexture.isReadyOrNotBlocking())return!1;a.TEXTURE=!0}else a.TEXTURE=!1;var s=r.getEngine();if(a.isDirty){a.markAsProcessed(),r.resetCachedMaterial();var l=[n.VertexBuffer.PositionKind];l.push(n.VertexBuffer.NormalKind),l.push(n.VertexBuffer.UVKind);var c=["world","viewProjection","innerGlowColor","albedoColor","borderWidth","edgeSmoothingValue","scaleFactor","borderMinValue","hoverColor","hoverPosition","hoverRadius","textureMatrix"],u=["albedoSampler"],h=[];(0,n.PrepareUniformsAndSamplersList)({uniformsNames:c,uniformBuffersNames:h,samplers:u,defines:a,maxSimultaneousLights:4});var d=a.toString();t.setEffect(r.getEngine().createEffect("fluent",{attributes:l,uniformsNames:c,uniformBuffersNames:h,samplers:u,defines:d,fallbacks:null,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},s),a,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(a._renderId=r.getRenderId(),i._wasPreviouslyReady=!0,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;if(a){if(this._activeEffect=a,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),this._mustRebind(r,a,i)&&(this._activeEffect.setColor4("albedoColor",this.albedoColor,this.alpha),o.INNERGLOW&&this._activeEffect.setColor4("innerGlowColor",this.innerGlowColor,this.innerGlowColorIntensity),o.BORDER&&(this._activeEffect.setFloat("borderWidth",this.borderWidth),this._activeEffect.setFloat("edgeSmoothingValue",this.edgeSmoothingValue),this._activeEffect.setFloat("borderMinValue",this.borderMinValue),t.getBoundingInfo().boundingBox.extendSize.multiplyToRef(t.scaling,n.TmpVectors.Vector3[0]),this._activeEffect.setVector3("scaleFactor",n.TmpVectors.Vector3[0])),o.HOVERLIGHT&&(this._activeEffect.setDirectColor4("hoverColor",this.hoverColor),this._activeEffect.setFloat("hoverRadius",this.hoverRadius),this._activeEffect.setVector3("hoverPosition",this.hoverPosition)),o.TEXTURE&&this._albedoTexture)){this._activeEffect.setTexture("albedoSampler",this._albedoTexture);var s=this._albedoTexture.getTextureMatrix();this._activeEffect.setMatrix("textureMatrix",s)}this._afterBind(t,this._activeEffect,i)}}},t.prototype.getActiveTextures=function(){return e.prototype.getActiveTextures.call(this)},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.GUI.FluentMaterial",t},t.prototype.getClassName=function(){return"FluentMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},(0,r.__decorate)([(0,n.serialize)(),(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"innerGlowColorIntensity",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"innerGlowColor",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"albedoColor",void 0),(0,r.__decorate)([(0,n.serialize)(),(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"renderBorders",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"borderWidth",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"edgeSmoothingValue",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"borderMinValue",void 0),(0,r.__decorate)([(0,n.serialize)(),(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"renderHoverLight",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"hoverRadius",void 0),(0,r.__decorate)([(0,n.serializeAsColor4)()],t.prototype,"hoverColor",void 0),(0,r.__decorate)([(0,n.serializeAsVector3)()],t.prototype,"hoverPosition",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("albedoTexture")],t.prototype,"_albedoTexture",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"albedoTexture",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.GUI.FluentMaterial",a)},"../../../dev/gui/src/3D/materials/fluent/index.ts":(e,t,i)=>{i.r(t),i.d(t,{FluentMaterial:()=>r.FluentMaterial,FluentMaterialDefines:()=>r.FluentMaterialDefines});var r=i("../../../dev/gui/src/3D/materials/fluent/fluentMaterial.ts")},"../../../dev/gui/src/3D/materials/fluent/shaders/fluent.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{fluentPixelShader:()=>o});var r="fluentPixelShader",n="precision highp float;varying vec2 vUV;uniform vec4 albedoColor;\n#ifdef INNERGLOW\nuniform vec4 innerGlowColor;\n#endif\n#ifdef BORDER\nvarying vec2 scaleInfo;uniform float edgeSmoothingValue;uniform float borderMinValue;\n#endif\n#ifdef HOVERLIGHT\nvarying vec3 worldPosition;uniform vec3 hoverPosition;uniform vec4 hoverColor;uniform float hoverRadius;\n#endif\n#ifdef TEXTURE\nuniform sampler2D albedoSampler;uniform mat4 textureMatrix;vec2 finalUV;\n#endif\nvoid main(void) {vec3 albedo=albedoColor.rgb;float alpha=albedoColor.a;\n#ifdef TEXTURE\nfinalUV=vec2(textureMatrix*vec4(vUV,1.0,0.0));albedo=texture2D(albedoSampler,finalUV).rgb;\n#endif\n#ifdef HOVERLIGHT\nfloat pointToHover=(1.0-clamp(length(hoverPosition-worldPosition)/hoverRadius,0.,1.))*hoverColor.a;albedo=clamp(albedo+hoverColor.rgb*pointToHover,0.,1.);\n#else\nfloat pointToHover=1.0;\n#endif\n#ifdef BORDER \nfloat borderPower=10.0;float inverseBorderPower=1.0/borderPower;vec3 borderColor=albedo*borderPower;vec2 distanceToEdge;distanceToEdge.x=abs(vUV.x-0.5)*2.0;distanceToEdge.y=abs(vUV.y-0.5)*2.0;float borderValue=max(smoothstep(scaleInfo.x-edgeSmoothingValue,scaleInfo.x+edgeSmoothingValue,distanceToEdge.x),\nsmoothstep(scaleInfo.y-edgeSmoothingValue,scaleInfo.y+edgeSmoothingValue,distanceToEdge.y));borderColor=borderColor*borderValue*max(borderMinValue*inverseBorderPower,pointToHover); \nalbedo+=borderColor;alpha=max(alpha,borderValue);\n#endif\n#ifdef INNERGLOW\nvec2 uvGlow=(vUV-vec2(0.5,0.5))*(innerGlowColor.a*2.0);uvGlow=uvGlow*uvGlow;uvGlow=uvGlow*uvGlow;albedo+=mix(vec3(0.0,0.0,0.0),innerGlowColor.rgb,uvGlow.x+uvGlow.y); \n#endif\ngl_FragColor=vec4(albedo,alpha);}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/fluent/shaders/fluent.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{fluentVertexShader:()=>o});var r="fluentVertexShader",n="precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;uniform mat4 world;uniform mat4 viewProjection;varying vec2 vUV;\n#ifdef BORDER\nvarying vec2 scaleInfo;uniform float borderWidth;uniform vec3 scaleFactor;\n#endif\n#ifdef HOVERLIGHT\nvarying vec3 worldPosition;\n#endif\nvoid main(void) {vUV=uv;\n#ifdef BORDER\nvec3 scale=scaleFactor;float minScale=min(min(scale.x,scale.y),scale.z);float maxScale=max(max(scale.x,scale.y),scale.z);float minOverMiddleScale=minScale/(scale.x+scale.y+scale.z-minScale-maxScale);float areaYZ=scale.y*scale.z;float areaXZ=scale.x*scale.z;float areaXY=scale.x*scale.y;float scaledBorderWidth=borderWidth; \nif (abs(normal.x)==1.0) \n{scale.x=scale.y;scale.y=scale.z;if (areaYZ>areaXZ && areaYZ>areaXY)\n{scaledBorderWidth*=minOverMiddleScale;}}\nelse if (abs(normal.y)==1.0) \n{scale.x=scale.z;if (areaXZ>areaXY && areaXZ>areaYZ)\n{scaledBorderWidth*=minOverMiddleScale;}}\nelse \n{if (areaXY>areaYZ && areaXY>areaXZ)\n{scaledBorderWidth*=minOverMiddleScale;}}\nfloat scaleRatio=min(scale.x,scale.y)/max(scale.x,scale.y);if (scale.x>scale.y)\n{scaleInfo.x=1.0-(scaledBorderWidth*scaleRatio);scaleInfo.y=1.0-scaledBorderWidth;}\nelse\n{scaleInfo.x=1.0-scaledBorderWidth;scaleInfo.y=1.0-(scaledBorderWidth*scaleRatio);} \n#endif \nvec4 worldPos=world*vec4(position,1.0);\n#ifdef HOVERLIGHT\nworldPosition=worldPos.xyz;\n#endif\ngl_Position=viewProjection*worldPos;}\n";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/fluentBackplate/fluentBackplateMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{FluentBackplateMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=(i("../../../dev/gui/src/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.ts"),i("../../../dev/gui/src/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.BLOB_ENABLE=!0,t.BLOB_ENABLE_2=!0,t.SMOOTH_EDGES=!0,t.IRIDESCENT_MAP_ENABLE=!0,t._needNormals=!0,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(i,r){var o=e.call(this,i,r)||this;return o.radius=.03,o.lineWidth=.01,o.absoluteSizes=!1,o._filterWidth=1,o.baseColor=new n.Color4(.0392157,.0666667,.207843,1),o.lineColor=new n.Color4(.14902,.133333,.384314,1),o.blobIntensity=.98,o.blobFarSize=.04,o.blobNearDistance=0,o.blobFarDistance=.08,o.blobFadeLength=.08,o.blobNearSize=.22,o.blobPulse=0,o.blobFade=0,o.blobNearSize2=.22,o.blobPulse2=0,o.blobFade2=0,o._rate=.135,o.highlightColor=new n.Color4(.98,.98,.98,1),o.highlightWidth=.25,o._highlightTransform=new n.Vector4(1,1,0,0),o._highlight=1,o.iridescenceIntensity=0,o.iridescenceEdgeIntensity=1,o._angle=-45,o.fadeOut=1,o._reflected=!0,o._frequency=1,o._verticalOffset=0,o.globalLeftIndexTipPosition=n.Vector3.Zero(),o._globalLeftIndexTipPosition4=n.Vector4.Zero(),o.globalRightIndexTipPosition=n.Vector3.Zero(),o._globalRightIndexTipPosition4=n.Vector4.Zero(),o.alphaMode=n.Constants.ALPHA_DISABLE,o.backFaceCulling=!1,o._blobTexture=new n.Texture(t.BLOB_TEXTURE_URL,o.getScene(),!0,!1,n.Texture.NEAREST_SAMPLINGMODE),o._iridescentMap=new n.Texture(t.IM_TEXTURE_URL,o.getScene(),!0,!1,n.Texture.NEAREST_SAMPLINGMODE),o}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return!1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t){var i=t._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;t.materialDefines||(t.materialDefines=new o);var r=t.materialDefines,a=this.getScene();if(this._isReadyForSubMesh(t))return!0;var s=a.getEngine();if((0,n.PrepareDefinesForAttributes)(e,r,!1,!1),r.isDirty){r.markAsProcessed(),a.resetCachedMaterial();var l=new n.EffectFallbacks;r.FOG&&l.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(r,l),r.IMAGEPROCESSINGPOSTPROCESS=a.imageProcessingConfiguration.applyByPostProcess;var c=[n.VertexBuffer.PositionKind];r.NORMAL&&c.push(n.VertexBuffer.NormalKind),r.UV1&&c.push(n.VertexBuffer.UVKind),r.UV2&&c.push(n.VertexBuffer.UV2Kind),r.VERTEXCOLOR&&c.push(n.VertexBuffer.ColorKind),r.TANGENT&&c.push(n.VertexBuffer.TangentKind),(0,n.PrepareAttributesForInstances)(c,r);var u=r.toString(),h=["world","viewProjection","cameraPosition","_Radius_","_Line_Width_","_Absolute_Sizes_","_Filter_Width_","_Base_Color_","_Line_Color_","_Radius_Top_Left_","_Radius_Top_Right_","_Radius_Bottom_Left_","_Radius_Bottom_Right_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Pulse_","_Blob_Fade_","_Blob_Texture_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Rate_","_Highlight_Color_","_Highlight_Width_","_Highlight_Transform_","_Highlight_","_Iridescence_Intensity_","_Iridescence_Edge_Intensity_","_Angle_","_Fade_Out_","_Reflected_","_Frequency_","_Vertical_Offset_","_Iridescent_Map_","_Use_Global_Left_Index_","_Use_Global_Right_Index_","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position"],d=["_Blob_Texture_","_Iridescent_Map_"],_=[];(0,n.PrepareUniformsAndSamplersList)({uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:r,maxSimultaneousLights:4}),t.setEffect(a.getEngine().createEffect("fluentBackplate",{attributes:c,uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:u,fallbacks:l,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},s),r,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(r._renderId=a.getRenderId(),i._wasPreviouslyReady=!0,0))},t.prototype.bindForSubMesh=function(e,t,i){var r,o;if(i.materialDefines){var a=i.effect;a&&(this._activeEffect=a,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",null!==(o=null===(r=this.getScene().activeCamera)||void 0===r?void 0:r.position)&&void 0!==o?o:n.Vector3.ZeroReadOnly),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Line_Width_",this.lineWidth),this._activeEffect.setFloat("_Absolute_Sizes_",this.absoluteSizes?1:0),this._activeEffect.setFloat("_Filter_Width_",this._filterWidth),this._activeEffect.setDirectColor4("_Base_Color_",this.baseColor),this._activeEffect.setDirectColor4("_Line_Color_",this.lineColor),this._activeEffect.setFloat("_Radius_Top_Left_",1),this._activeEffect.setFloat("_Radius_Top_Right_",1),this._activeEffect.setFloat("_Radius_Bottom_Left_",1),this._activeEffect.setFloat("_Radius_Bottom_Right_",1),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.blobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Pulse_",this.blobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.blobFade),this._activeEffect.setTexture("_Blob_Texture_",this._blobTexture),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.blobNearSize2),this._activeEffect.setFloat("_Blob_Pulse_2_",this.blobPulse2),this._activeEffect.setFloat("_Blob_Fade_2_",this.blobFade2),this._activeEffect.setFloat("_Rate_",this._rate),this._activeEffect.setDirectColor4("_Highlight_Color_",this.highlightColor),this._activeEffect.setFloat("_Highlight_Width_",this.highlightWidth),this._activeEffect.setVector4("_Highlight_Transform_",this._highlightTransform),this._activeEffect.setFloat("_Highlight_",this._highlight),this._activeEffect.setFloat("_Iridescence_Intensity_",this.iridescenceIntensity),this._activeEffect.setFloat("_Iridescence_Edge_Intensity_",this.iridescenceEdgeIntensity),this._activeEffect.setFloat("_Angle_",this._angle),this._activeEffect.setFloat("_Fade_Out_",this.fadeOut),this._activeEffect.setFloat("_Reflected_",this._reflected?1:0),this._activeEffect.setFloat("_Frequency_",this._frequency),this._activeEffect.setFloat("_Vertical_Offset_",this._verticalOffset),this._activeEffect.setTexture("_Iridescent_Map_",this._iridescentMap),this._activeEffect.setFloat("_Use_Global_Left_Index_",1),this._activeEffect.setFloat("_Use_Global_Right_Index_",1),this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x,this.globalLeftIndexTipPosition.y,this.globalLeftIndexTipPosition.z,1),this._activeEffect.setVector4("Global_Left_Index_Tip_Position",this._globalLeftIndexTipPosition4),this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x,this.globalRightIndexTipPosition.y,this.globalRightIndexTipPosition.z,1),this._activeEffect.setVector4("Global_Right_Index_Tip_Position",this._globalRightIndexTipPosition4),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){return[]},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),this._blobTexture.dispose(),this._iridescentMap.dispose()},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.FluentBackplateMaterial",t},t.prototype.getClassName=function(){return"FluentBackplateMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},t.BLOB_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-blob.png",t.IM_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-iridescence.png",(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radius",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"lineWidth",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"absoluteSizes",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"baseColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"lineColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFarSize",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobNearDistance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFarDistance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFadeLength",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobNearSize",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPulse",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFade",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobNearSize2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPulse2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFade2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"highlightColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"highlightWidth",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"iridescenceIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"iridescenceEdgeIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"fadeOut",void 0),(0,r.__decorate)([(0,n.serializeAsVector3)()],t.prototype,"globalLeftIndexTipPosition",void 0),(0,r.__decorate)([(0,n.serializeAsVector3)()],t.prototype,"globalRightIndexTipPosition",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.GUI.FluentBackplateMaterial",a)},"../../../dev/gui/src/3D/materials/fluentBackplate/index.ts":(e,t,i)=>{i.r(t),i.d(t,{FluentBackplateMaterial:()=>r.FluentBackplateMaterial});var r=i("../../../dev/gui/src/3D/materials/fluentBackplate/fluentBackplateMaterial.ts")},"../../../dev/gui/src/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{fluentBackplatePixelShader:()=>o});var r="fluentBackplatePixelShader",n="uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform float _Angle_;uniform float _Fade_Out_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform sampler2D _Iridescent_Map_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;void Round_Rect_Fragment_B31(\nfloat Radius,\nfloat Line_Width,\nvec4 Line_Color,\nfloat Filter_Width,\nvec2 UV,\nfloat Line_Visibility,\nvec4 Rect_Parms,\nvec4 Fill_Color,\nout vec4 Color)\n{float d=length(max(abs(UV)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);float g=min(Rect_Parms.z,Rect_Parms.w);float dgrad=max(fwidth(g)*Filter_Width,0.00001);float Inside_Rect=clamp(g/dgrad,0.0,1.0);float inner=clamp((d+dx*0.5-max(Radius-Line_Width,d-dx*0.5))/dx,0.0,1.0);Color=clamp(mix(Fill_Color,Line_Color,inner),0.0,1.0)*Inside_Rect;}\nvoid Blob_Fragment_B71(\nsampler2D Blob_Texture,\nvec4 Blob_Info1,\nvec4 Blob_Info2,\nout vec4 Blob_Color)\n{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k1<k2 ? vec3(k1,Blob_Info1.z,Blob_Info1.w) : vec3(k2,Blob_Info2.z,Blob_Info2.w);Blob_Color=closer.z*texture(Blob_Texture,vec2(vec2(sqrt(closer.x),closer.y).x,1.0-vec2(sqrt(closer.x),closer.y).y))*clamp(1.0-closer.x,0.0,1.0);}\nvoid Line_Fragment_B48(\nvec4 Base_Color,\nvec4 Highlight_Color,\nfloat Highlight_Width,\nvec3 Line_Vertex,\nfloat Highlight,\nout vec4 Line_Color)\n{float k2=1.0-clamp(abs(Line_Vertex.y/Highlight_Width),0.0,1.0);Line_Color=mix(Base_Color,Highlight_Color,Highlight*k2);}\nvoid Scale_RGB_B54(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}\nvoid Conditional_Float_B38(\nbool Which,\nfloat If_True,\nfloat If_False,\nout float Result)\n{Result=Which ? If_True : If_False;}\nvoid main()\n{float R_Q72;float G_Q72;float B_Q72;float A_Q72;R_Q72=vColor.r; G_Q72=vColor.g; B_Q72=vColor.b; A_Q72=vColor.a;vec4 Blob_Color_Q71;\n#if BLOB_ENABLE\nfloat k1=dot(vExtra2.xy,vExtra2.xy);float k2=dot(vExtra3.xy,vExtra3.xy);vec3 closer=k1<k2 ? vec3(k1,vExtra2.z,vExtra2.w) : vec3(k2,vExtra3.z,vExtra3.w);Blob_Color_Q71=closer.z*texture(_Blob_Texture_,vec2(vec2(sqrt(closer.x),closer.y).x,1.0-vec2(sqrt(closer.x),closer.y).y))*clamp(1.0-closer.x,0.0,1.0);\n#else\nBlob_Color_Q71=vec4(0,0,0,0);\n#endif\nvec4 Line_Color_Q48;Line_Fragment_B48(_Line_Color_,_Highlight_Color_,_Highlight_Width_,vTangent,_Highlight_,Line_Color_Q48);float X_Q67;float Y_Q67;X_Q67=vUV.x;Y_Q67=vUV.y;vec3 Incident_Q66=normalize(vPosition-cameraPosition);vec3 Reflected_Q60=reflect(Incident_Q66,vBinormal);float Product_Q63=Y_Q67*_Vertical_Offset_;float Dot_Q68=dot(Incident_Q66, Reflected_Q60);float Dot_Q57=dot(vNormal, Incident_Q66);float Result_Q38;Conditional_Float_B38(_Reflected_,Dot_Q68,Dot_Q57,Result_Q38);float Product_Q64=Result_Q38*_Frequency_;float Sum_Q69=Product_Q64+1.0;float Product_Q70=Sum_Q69*0.5;float Sum_Q62=Product_Q63+Product_Q70;float FractF_Q59=fract(Sum_Q62);vec2 Vec2_Q65=vec2(FractF_Q59,0.5);vec4 Color_Q58;\n#if IRIDESCENT_MAP_ENABLE\nColor_Q58=texture(_Iridescent_Map_,Vec2_Q65);\n#else\nColor_Q58=vec4(0,0,0,0);\n#endif\nvec4 Result_Q54;Scale_RGB_B54(Color_Q58,_Iridescence_Edge_Intensity_,Result_Q54);vec4 Result_Q55;Scale_RGB_B54(Color_Q58,_Iridescence_Intensity_,Result_Q55);vec4 Base_And_Iridescent_Q53;Base_And_Iridescent_Q53=Line_Color_Q48+vec4(Result_Q54.rgb,0.0);vec4 Base_And_Iridescent_Q56;Base_And_Iridescent_Q56=_Base_Color_+vec4(Result_Q55.rgb,0.0);vec4 Result_Q52=Base_And_Iridescent_Q53; Result_Q52.a=1.0;vec4 Result_Q35=Blob_Color_Q71+(1.0-Blob_Color_Q71.a)*Base_And_Iridescent_Q56;vec4 Color_Q31;Round_Rect_Fragment_B31(R_Q72,G_Q72,Result_Q52,_Filter_Width_,vUV,1.0,vExtra1,Result_Q35,Color_Q31);vec4 Result_Q47=_Fade_Out_*Color_Q31;vec4 Out_Color=Result_Q47;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{fluentBackplateVertexShader:()=>o});var r="fluentBackplateVertexShader",n="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;\n#ifdef TANGENT\nattribute vec3 tangent;\n#else\nconst vec3 tangent=vec3(0.);\n#endif\nuniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform float _Angle_;uniform float _Fade_Out_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform sampler2D _Iridescent_Map_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Object_To_World_Pos_B115(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}\nvoid PickDir_B140(\nfloat Degrees,\nvec3 DirX,\nvec3 DirY,\nout vec3 Dir)\n{float a=Degrees*3.14159/180.0;Dir=cos(a)*DirX+sin(a)*DirY;}\nvoid Round_Rect_Vertex_B139(\nvec2 UV,\nfloat Radius,\nfloat Margin,\nfloat Anisotropy,\nfloat Gradient1,\nfloat Gradient2,\nout vec2 Rect_UV,\nout vec4 Rect_Parms,\nout vec2 Scale_XY,\nout vec2 Line_UV)\n{Scale_XY=vec2(Anisotropy,1.0);Line_UV=(UV-vec2(0.5,0.5));Rect_UV=Line_UV*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius)-vec2(Margin,Margin);Rect_Parms.z=Gradient1; \nRect_Parms.w=Gradient2;}\nvoid Line_Vertex_B135(\nvec2 Scale_XY,\nvec2 UV,\nfloat Time,\nfloat Rate,\nvec4 Highlight_Transform,\nout vec3 Line_Vertex)\n{float angle2=(Rate*Time)*2.0*3.1416;float sinAngle2=sin(angle2);float cosAngle2=cos(angle2);vec2 xformUV=UV*Highlight_Transform.xy+Highlight_Transform.zw;Line_Vertex.x=0.0;Line_Vertex.y=cosAngle2*xformUV.x-sinAngle2*xformUV.y;Line_Vertex.z=0.0; }\nvoid Blob_Vertex_B180(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nfloat Blob_Fade_Length,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nout vec4 Blob_Info)\n{vec3 blob=Blob_Position;vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);}\nvoid Move_Verts_B129(\nfloat Anisotropy,\nvec3 P,\nfloat Radius,\nout vec3 New_P,\nout vec2 New_UV,\nout float Radial_Gradient,\nout vec3 Radial_Dir)\n{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);New_UV=center+r2*(UV-2.0*center+0.5);New_P=vec3(New_UV-0.5,P.z);Radial_Gradient=1.0-length(delta)*2.0;Radial_Dir=vec3(delta*r2,0.0);}\nvoid Object_To_World_Dir_B132(\nvec3 Dir_Object,\nout vec3 Binormal_World,\nout vec3 Binormal_World_N,\nout float Binormal_Length)\n{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;}\nvoid RelativeOrAbsoluteDetail_B147(\nfloat Nominal_Radius,\nfloat Nominal_LineWidth,\nbool Absolute_Measurements,\nfloat Height,\nout float Radius,\nout float Line_Width)\n{float scale=Absolute_Measurements ? 1.0/Height : 1.0;Radius=Nominal_Radius*scale;Line_Width=Nominal_LineWidth*scale;}\nvoid Edge_AA_Vertex_B130(\nvec3 Position_World,\nvec3 Position_Object,\nvec3 Normal_Object,\nvec3 Eye,\nfloat Radial_Gradient,\nvec3 Radial_Dir,\nvec3 Tangent,\nout float Gradient1,\nout float Gradient2)\n{vec3 I=(Eye-Position_World);vec3 T=(world* vec4(Tangent,0.0)).xyz;float g=(dot(T,I)<0.0) ? 0.0 : 1.0;if (Normal_Object.z==0.0) { \nGradient1=Position_Object.z>0.0 ? g : 1.0;Gradient2=Position_Object.z>0.0 ? 1.0 : g;} else {Gradient1=g+(1.0-g)*(Radial_Gradient);Gradient2=1.0;}}\nvoid Pick_Radius_B144(\nfloat Radius,\nfloat Radius_Top_Left,\nfloat Radius_Top_Right,\nfloat Radius_Bottom_Left,\nfloat Radius_Bottom_Right,\nvec3 Position,\nout float Result)\n{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}\nvoid main()\n{vec3 Nrm_World_Q128;Nrm_World_Q128=normalize((world*vec4(normal,0.0)).xyz);vec3 Tangent_World_Q131;vec3 Tangent_World_N_Q131;float Tangent_Length_Q131;Tangent_World_Q131=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q131=length(Tangent_World_Q131);Tangent_World_N_Q131=Tangent_World_Q131/Tangent_Length_Q131;vec3 Binormal_World_Q132;vec3 Binormal_World_N_Q132;float Binormal_Length_Q132;Object_To_World_Dir_B132(vec3(0,1,0),Binormal_World_Q132,Binormal_World_N_Q132,Binormal_Length_Q132);float Anisotropy_Q133=Tangent_Length_Q131/Binormal_Length_Q132;vec3 Result_Q177;Result_Q177=mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(_Use_Global_Left_Index_));vec3 Result_Q178;Result_Q178=mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(_Use_Global_Right_Index_));float Result_Q144;Pick_Radius_B144(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q144);vec3 Dir_Q140;PickDir_B140(_Angle_,Tangent_World_N_Q131,Binormal_World_N_Q132,Dir_Q140);float Radius_Q147;float Line_Width_Q147;RelativeOrAbsoluteDetail_B147(Result_Q144,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q132,Radius_Q147,Line_Width_Q147);vec4 Out_Color_Q145=vec4(Radius_Q147,Line_Width_Q147,0,1);vec3 New_P_Q129;vec2 New_UV_Q129;float Radial_Gradient_Q129;vec3 Radial_Dir_Q129;Move_Verts_B129(Anisotropy_Q133,position,Radius_Q147,New_P_Q129,New_UV_Q129,Radial_Gradient_Q129,Radial_Dir_Q129);vec3 Pos_World_Q115;Object_To_World_Pos_B115(New_P_Q129,Pos_World_Q115);vec4 Blob_Info_Q180;\n#if BLOB_ENABLE\nBlob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q177,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q180);\n#else\nBlob_Info_Q180=vec4(0,0,0,0);\n#endif\nvec4 Blob_Info_Q181;\n#if BLOB_ENABLE_2\nBlob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q178,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q181);\n#else\nBlob_Info_Q181=vec4(0,0,0,0);\n#endif\nfloat Gradient1_Q130;float Gradient2_Q130;\n#if SMOOTH_EDGES\nEdge_AA_Vertex_B130(Pos_World_Q115,position,normal,cameraPosition,Radial_Gradient_Q129,Radial_Dir_Q129,tangent,Gradient1_Q130,Gradient2_Q130);\n#else\nGradient1_Q130=1.0;Gradient2_Q130=1.0;\n#endif\nvec2 Rect_UV_Q139;vec4 Rect_Parms_Q139;vec2 Scale_XY_Q139;vec2 Line_UV_Q139;Round_Rect_Vertex_B139(New_UV_Q129,Radius_Q147,0.0,Anisotropy_Q133,Gradient1_Q130,Gradient2_Q130,Rect_UV_Q139,Rect_Parms_Q139,Scale_XY_Q139,Line_UV_Q139);vec3 Line_Vertex_Q135;Line_Vertex_B135(Scale_XY_Q139,Line_UV_Q139,0.0,_Rate_,_Highlight_Transform_,Line_Vertex_Q135);vec3 Position=Pos_World_Q115;vec3 Normal=Dir_Q140;vec2 UV=Rect_UV_Q139;vec3 Tangent=Line_Vertex_Q135;vec3 Binormal=Nrm_World_Q128;vec4 Color=Out_Color_Q145;vec4 Extra1=Rect_Parms_Q139;vec4 Extra2=Blob_Info_Q180;vec4 Extra3=Blob_Info_Q181;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/fluentButton/fluentButtonMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{FluentButtonMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=(i("../../../dev/gui/src/3D/materials/fluentButton/shaders/fluentButton.fragment.ts"),i("../../../dev/gui/src/3D/materials/fluentButton/shaders/fluentButton.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.RELATIVE_WIDTH=!0,t.ENABLE_FADE=!0,t._needNormals=!0,t._needUVs=!0,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(i,r){var o=e.call(this,i,r)||this;return o.edgeWidth=.04,o.edgeColor=new n.Color4(.592157,.592157,.592157,1),o.proximityMaxIntensity=.45,o.proximityFarDistance=.16,o.proximityNearRadius=1.5,o.proximityAnisotropy=1,o.selectionFuzz=.5,o.selected=0,o.selectionFade=0,o.selectionFadeSize=.3,o.selectedDistance=.08,o.selectedFadeLength=.08,o.blobIntensity=.5,o.blobFarSize=.05,o.blobNearDistance=0,o.blobFarDistance=.08,o.blobFadeLength=.08,o.leftBlobEnable=!0,o.leftBlobNearSize=.025,o.leftBlobPulse=0,o.leftBlobFade=1,o.leftBlobInnerFade=.01,o.rightBlobEnable=!0,o.rightBlobNearSize=.025,o.rightBlobPulse=0,o.rightBlobFade=1,o.rightBlobInnerFade=.01,o.activeFaceDir=new n.Vector3(0,0,-1),o.activeFaceUp=new n.Vector3(0,1,0),o.enableFade=!0,o.fadeWidth=1.5,o.smoothActiveFace=!0,o.showFrame=!1,o.useBlobTexture=!0,o.globalLeftIndexTipPosition=n.Vector3.Zero(),o.globalRightIndexTipPosition=n.Vector3.Zero(),o.alphaMode=n.Constants.ALPHA_ADD,o.disableDepthWrite=!0,o.backFaceCulling=!1,o._blobTexture=new n.Texture(t.BLOB_TEXTURE_URL,o.getScene(),!0,!1,n.Texture.NEAREST_SAMPLINGMODE),o}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return!0},t.prototype.needAlphaTesting=function(){return!0},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t){var i=t._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;t.materialDefines||(t.materialDefines=new o);var r=t.materialDefines,a=this.getScene();if(this._isReadyForSubMesh(t))return!0;var s=a.getEngine();if((0,n.PrepareDefinesForAttributes)(e,r,!0,!1),r.isDirty){r.markAsProcessed(),a.resetCachedMaterial();var l=new n.EffectFallbacks;r.FOG&&l.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(r,l),r.IMAGEPROCESSINGPOSTPROCESS=a.imageProcessingConfiguration.applyByPostProcess;var c=[n.VertexBuffer.PositionKind];r.NORMAL&&c.push(n.VertexBuffer.NormalKind),r.UV1&&c.push(n.VertexBuffer.UVKind),r.UV2&&c.push(n.VertexBuffer.UV2Kind),r.VERTEXCOLOR&&c.push(n.VertexBuffer.ColorKind),r.TANGENT&&c.push(n.VertexBuffer.TangentKind),(0,n.PrepareAttributesForInstances)(c,r);var u=r.toString(),h=["world","viewProjection","cameraPosition","_Edge_Width_","_Edge_Color_","_Relative_Width_","_Proximity_Max_Intensity_","_Proximity_Far_Distance_","_Proximity_Near_Radius_","_Proximity_Anisotropy_","_Selection_Fuzz_","_Selected_","_Selection_Fade_","_Selection_Fade_Size_","_Selected_Distance_","_Selected_Fade_Length_","_Blob_Enable_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Inner_Fade_","_Blob_Pulse_","_Blob_Fade_","_Blob_Texture_","_Blob_Enable_2_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Inner_Fade_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Active_Face_Dir_","_Active_Face_Up_","_Enable_Fade_","_Fade_Width_","_Smooth_Active_Face_","_Show_Frame_","_Use_Blob_Texture_","Use_Global_Left_Index","Use_Global_Right_Index","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position","Global_Left_Thumb_Tip_Position","Global_Right_Thumb_Tip_Position","Global_Left_Index_Tip_Proximity","Global_Right_Index_Tip_Proximity"],d=["_Blob_Texture_"],_=[];(0,n.PrepareUniformsAndSamplersList)({uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:r,maxSimultaneousLights:4}),t.setEffect(a.getEngine().createEffect("fluentButton",{attributes:c,uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:u,fallbacks:l,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},s),r,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(r._renderId=a.getRenderId(),i._wasPreviouslyReady=!0,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene();if(i.materialDefines){var o=i.effect;o&&(this._activeEffect=o,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",r.activeCamera.position),this._activeEffect.setTexture("_Blob_Texture_",this._blobTexture),this._activeEffect.setFloat("_Edge_Width_",this.edgeWidth),this._activeEffect.setColor4("_Edge_Color_",new n.Color3(this.edgeColor.r,this.edgeColor.g,this.edgeColor.b),this.edgeColor.a),this._activeEffect.setFloat("_Proximity_Max_Intensity_",this.proximityMaxIntensity),this._activeEffect.setFloat("_Proximity_Far_Distance_",this.proximityFarDistance),this._activeEffect.setFloat("_Proximity_Near_Radius_",this.proximityNearRadius),this._activeEffect.setFloat("_Proximity_Anisotropy_",this.proximityAnisotropy),this._activeEffect.setFloat("_Selection_Fuzz_",this.selectionFuzz),this._activeEffect.setFloat("_Selected_",this.selected),this._activeEffect.setFloat("_Selection_Fade_",this.selectionFade),this._activeEffect.setFloat("_Selection_Fade_Size_",this.selectionFadeSize),this._activeEffect.setFloat("_Selected_Distance_",this.selectedDistance),this._activeEffect.setFloat("_Selected_Fade_Length_",this.selectedFadeLength),this._activeEffect.setFloat("_Blob_Enable_",this.leftBlobEnable?1:0),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.leftBlobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Inner_Fade_",this.leftBlobInnerFade),this._activeEffect.setFloat("_Blob_Pulse_",this.leftBlobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.leftBlobFade),this._activeEffect.setFloat("_Blob_Enable_2_",this.rightBlobEnable?1:0),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.rightBlobNearSize),this._activeEffect.setFloat("_Blob_Inner_Fade_2_",this.rightBlobInnerFade),this._activeEffect.setFloat("_Blob_Pulse_2_",this.rightBlobPulse),this._activeEffect.setFloat("_Blob_Fade_2_",this.rightBlobFade),this._activeEffect.setVector3("_Active_Face_Dir_",this.activeFaceDir),this._activeEffect.setVector3("_Active_Face_Up_",this.activeFaceUp),this._activeEffect.setFloat("_Fade_Width_",this.fadeWidth),this._activeEffect.setFloat("_Smooth_Active_Face_",this.smoothActiveFace?1:0),this._activeEffect.setFloat("_Show_Frame_",this.showFrame?1:0),this._activeEffect.setFloat("_Use_Blob_Texture_",this.useBlobTexture?1:0),this._activeEffect.setFloat("Use_Global_Left_Index",1),this._activeEffect.setFloat("Use_Global_Right_Index",1),this._activeEffect.setVector4("Global_Left_Index_Tip_Position",new n.Vector4(this.globalLeftIndexTipPosition.x,this.globalLeftIndexTipPosition.y,this.globalLeftIndexTipPosition.z,1)),this._activeEffect.setVector4("Global_Right_Index_Tip_Position",new n.Vector4(this.globalRightIndexTipPosition.x,this.globalRightIndexTipPosition.y,this.globalRightIndexTipPosition.z,1)),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){return[]},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.FluentButtonMaterial",t},t.prototype.getClassName=function(){return"FluentButtonMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},t.BLOB_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-button-blob.png",(0,r.__decorate)([(0,n.serialize)()],t.prototype,"edgeWidth",void 0),(0,r.__decorate)([(0,n.serializeAsColor4)()],t.prototype,"edgeColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"proximityMaxIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"proximityFarDistance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"proximityNearRadius",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"proximityAnisotropy",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"selectionFuzz",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"selected",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"selectionFade",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"selectionFadeSize",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"selectedDistance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"selectedFadeLength",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFarSize",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobNearDistance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFarDistance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFadeLength",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"leftBlobEnable",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"leftBlobNearSize",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"leftBlobPulse",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"leftBlobFade",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"leftBlobInnerFade",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rightBlobEnable",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rightBlobNearSize",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rightBlobPulse",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rightBlobFade",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rightBlobInnerFade",void 0),(0,r.__decorate)([(0,n.serializeAsVector3)()],t.prototype,"activeFaceDir",void 0),(0,r.__decorate)([(0,n.serializeAsVector3)()],t.prototype,"activeFaceUp",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"enableFade",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"fadeWidth",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"smoothActiveFace",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"showFrame",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"useBlobTexture",void 0),(0,r.__decorate)([(0,n.serializeAsVector3)()],t.prototype,"globalLeftIndexTipPosition",void 0),(0,r.__decorate)([(0,n.serializeAsVector3)()],t.prototype,"globalRightIndexTipPosition",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.GUI.FluentButtonMaterial",a)},"../../../dev/gui/src/3D/materials/fluentButton/index.ts":(e,t,i)=>{i.r(t),i.d(t,{FluentButtonMaterial:()=>r.FluentButtonMaterial});var r=i("../../../dev/gui/src/3D/materials/fluentButton/fluentButtonMaterial.ts")},"../../../dev/gui/src/3D/materials/fluentButton/shaders/fluentButton.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{fluentButtonPixelShader:()=>o});var r="fluentButtonPixelShader",n="uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;uniform float _Edge_Width_;uniform vec4 _Edge_Color_;uniform bool _Relative_Width_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Active_Face_Dir_;uniform vec3 _Active_Face_Up_;uniform bool Enable_Fade;uniform float _Fade_Width_;uniform bool _Smooth_Active_Face_;uniform bool _Show_Frame_;uniform bool _Use_Blob_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Holo_Edge_Fragment_B35(\nvec4 Edges,\nfloat Edge_Width,\nout float NotEdge)\n{vec2 c=vec2(min(Edges.r,Edges.g),min(Edges.b,Edges.a));vec2 df=fwidth(c)*Edge_Width;vec2 g=clamp(c/df,0.0,1.0);NotEdge=g.x*g.y;}\nvoid Blob_Fragment_B39(\nvec2 UV,\nvec3 Blob_Info,\nsampler2D Blob_Texture,\nout vec4 Blob_Color)\n{float k=dot(UV,UV);Blob_Color=Blob_Info.y*texture(Blob_Texture,vec2(vec2(sqrt(k),Blob_Info.x).x,1.0-vec2(sqrt(k),Blob_Info.x).y))*(1.0-clamp(k,0.0,1.0));}\nvec2 FilterStep(vec2 Edge,vec2 X)\n{vec2 dX=max(fwidth(X),vec2(0.00001,0.00001));return clamp( (X+dX-max(Edge,X-dX))/(dX*2.0),0.0,1.0);}\nvoid Wireframe_Fragment_B59(\nvec3 Widths,\nvec2 UV,\nfloat Proximity,\nvec4 Edge_Color,\nout vec4 Wireframe)\n{vec2 c=min(UV,vec2(1.0,1.0)-UV);vec2 g=FilterStep(Widths.xy*0.5,c); \nWireframe=(1.0-min(g.x,g.y))*Proximity*Edge_Color;}\nvoid Proximity_B53(\nvec3 Proximity_Center,\nvec3 Proximity_Center_2,\nfloat Proximity_Max_Intensity,\nfloat Proximity_Near_Radius,\nvec3 Position,\nvec3 Show_Selection,\nvec4 Extra1,\nfloat Dist_To_Face,\nfloat Intensity,\nout float Proximity)\n{vec2 delta1=Extra1.xy;vec2 delta2=Extra1.zw;float d2=sqrt(min(dot(delta1,delta1),dot(delta2,delta2))+Dist_To_Face*Dist_To_Face);Proximity=Intensity*Proximity_Max_Intensity*(1.0-clamp(d2/Proximity_Near_Radius,0.0,1.0))*(1.0-Show_Selection.x)+Show_Selection.x;}\nvoid To_XYZ_B46(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}\nvoid main()\n{float NotEdge_Q35;\n#if ENABLE_FADE\nHolo_Edge_Fragment_B35(vColor,_Fade_Width_,NotEdge_Q35);\n#else\nNotEdge_Q35=1.0;\n#endif\nvec4 Blob_Color_Q39;float k=dot(vUV,vUV);vec2 blobTextureCoord=vec2(vec2(sqrt(k),vTangent.x).x,1.0-vec2(sqrt(k),vTangent.x).y);vec4 blobColor=mix(vec4(1.0,1.0,1.0,1.0)*step(1.0-vTangent.x,clamp(sqrt(k)+0.1,0.0,1.0)),texture(_Blob_Texture_,blobTextureCoord),float(_Use_Blob_Texture_));Blob_Color_Q39=vTangent.y*blobColor*(1.0-clamp(k,0.0,1.0));float Is_Quad_Q24;Is_Quad_Q24=vNormal.z;vec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));vec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));float X_Q46;float Y_Q46;float Z_Q46;To_XYZ_B46(vBinormal,X_Q46,Y_Q46,Z_Q46);float Proximity_Q53;Proximity_B53(Blob_Position_Q41,Blob_Position_Q42,_Proximity_Max_Intensity_,_Proximity_Near_Radius_,vPosition,vBinormal,vExtra1,Y_Q46,Z_Q46,Proximity_Q53);vec4 Wireframe_Q59;Wireframe_Fragment_B59(vNormal,vUV,Proximity_Q53,_Edge_Color_,Wireframe_Q59);vec4 Wire_Or_Blob_Q23=mix(Wireframe_Q59,Blob_Color_Q39,Is_Quad_Q24);vec4 Result_Q22;Result_Q22=mix(Wire_Or_Blob_Q23,vec4(0.3,0.3,0.3,0.3),float(_Show_Frame_));vec4 Final_Color_Q37=NotEdge_Q35*Result_Q22;vec4 Out_Color=Final_Color_Q37;float Clip_Threshold=0.0;bool To_sRGB=false;gl_FragColor=Out_Color;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/fluentButton/shaders/fluentButton.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{fluentButtonVertexShader:()=>o});var r="fluentButtonVertexShader",n="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform float _Edge_Width_;uniform vec4 _Edge_Color_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Active_Face_Dir_;uniform vec3 _Active_Face_Up_;uniform bool _Enable_Fade_;uniform float _Fade_Width_;uniform bool _Smooth_Active_Face_;uniform bool _Show_Frame_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;void Blob_Vertex_B47(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nvec4 Vx_Color,\nvec2 UV,\nvec3 Face_Center,\nvec2 Face_Size,\nvec2 In_UV,\nfloat Blob_Fade_Length,\nfloat Selection_Fade,\nfloat Selection_Fade_Size,\nfloat Inner_Fade,\nvec3 Active_Face_Center,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nfloat Blob_Enabled,\nout vec3 Out_Position,\nout vec2 Out_UV,\nout vec3 Blob_Info)\n{float blobSize,fadeIn;vec3 Hit_Position;Blob_Info=vec3(0.0,0.0,0.0);float Hit_Distance=dot(Blob_Position-Face_Center,Normal);Hit_Position=Blob_Position-Hit_Distance*Normal;float absD=abs(Hit_Distance);float lerpVal=clamp((absD-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);fadeIn=1.0-clamp((absD-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float innerFade=1.0-clamp(-Hit_Distance/Inner_Fade,0.0,1.0);float farClip=clamp(1.0-step(Blob_Far_Distance+Blob_Fade_Length,absD),0.0,1.0);float size=mix(Blob_Near_Size,Blob_Far_Size,lerpVal)*farClip;blobSize=mix(size,Selection_Fade_Size,Selection_Fade)*innerFade*Blob_Enabled;Blob_Info.x=lerpVal*0.5+0.5;Blob_Info.y=fadeIn*Intensity*(1.0-Selection_Fade)*Blob_Fade;Blob_Info.x*=(1.0-Blob_Pulse);vec3 delta=Hit_Position-Face_Center;vec2 blobCenterXY=vec2(dot(delta,Tangent),dot(delta,Bitangent));vec2 quadUVin=2.0*UV-1.0; \nvec2 blobXY=blobCenterXY+quadUVin*blobSize;vec2 blobClipped=clamp(blobXY,-Face_Size*0.5,Face_Size*0.5);vec2 blobUV=(blobClipped-blobCenterXY)/max(blobSize,0.0001)*2.0;vec3 blobCorner=Face_Center+blobClipped.x*Tangent+blobClipped.y*Bitangent;Out_Position=mix(Position,blobCorner,Vx_Color.rrr);Out_UV=mix(In_UV,blobUV,Vx_Color.rr);}\nvec2 ProjectProximity(\nvec3 blobPosition,\nvec3 position,\nvec3 center,\nvec3 dir,\nvec3 xdir,\nvec3 ydir,\nout float vdistance\n)\n{vec3 delta=blobPosition-position;vec2 xy=vec2(dot(delta,xdir),dot(delta,ydir));vdistance=abs(dot(delta,dir));return xy;}\nvoid Proximity_Vertex_B66(\nvec3 Blob_Position,\nvec3 Blob_Position_2,\nvec3 Active_Face_Center,\nvec3 Active_Face_Dir,\nvec3 Position,\nfloat Proximity_Far_Distance,\nfloat Relative_Scale,\nfloat Proximity_Anisotropy,\nvec3 Up,\nout vec4 Extra1,\nout float Distance_To_Face,\nout float Intensity)\n{vec3 Active_Face_Dir_X=normalize(cross(Active_Face_Dir,Up));vec3 Active_Face_Dir_Y=cross(Active_Face_Dir,Active_Face_Dir_X);float distz1,distz2;Extra1.xy=ProjectProximity(Blob_Position,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz1)/Relative_Scale;Extra1.zw=ProjectProximity(Blob_Position_2,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz2)/Relative_Scale;Distance_To_Face=dot(Active_Face_Dir,Position-Active_Face_Center);Intensity=1.0-clamp(min(distz1,distz2)/Proximity_Far_Distance,0.0,1.0);}\nvoid Holo_Edge_Vertex_B44(\nvec3 Incident,\nvec3 Normal,\nvec2 UV,\nvec3 Tangent,\nvec3 Bitangent,\nbool Smooth_Active_Face,\nfloat Active,\nout vec4 Holo_Edges)\n{float NdotI=dot(Incident,Normal);vec2 flip=(UV-vec2(0.5,0.5));float udot=dot(Incident,Tangent)*flip.x*NdotI;float uval=1.0-float(udot>0.0);float vdot=-dot(Incident,Bitangent)*flip.y*NdotI;float vval=1.0-float(vdot>0.0);float Smooth_And_Active=step(1.0,float(Smooth_Active_Face && Active>0.0));uval=mix(uval,max(1.0,uval),Smooth_And_Active); \nvval=mix(vval,max(1.0,vval),Smooth_And_Active);Holo_Edges=vec4(1.0,1.0,1.0,1.0)-vec4(uval*UV.x,uval*(1.0-UV.x),vval*UV.y,vval*(1.0-UV.y));}\nvoid Object_To_World_Pos_B13(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}\nvoid Choose_Blob_B38(\nvec4 Vx_Color,\nvec3 Position1,\nvec3 Position2,\nbool Blob_Enable_1,\nbool Blob_Enable_2,\nfloat Near_Size_1,\nfloat Near_Size_2,\nfloat Blob_Inner_Fade_1,\nfloat Blob_Inner_Fade_2,\nfloat Blob_Pulse_1,\nfloat Blob_Pulse_2,\nfloat Blob_Fade_1,\nfloat Blob_Fade_2,\nout vec3 Position,\nout float Near_Size,\nout float Inner_Fade,\nout float Blob_Enable,\nout float Fade,\nout float Pulse)\n{Position=Position1*(1.0-Vx_Color.g)+Vx_Color.g*Position2;float b1=float(Blob_Enable_1);float b2=float(Blob_Enable_2);Blob_Enable=b1+(b2-b1)*Vx_Color.g;Pulse=Blob_Pulse_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Pulse_2;Fade=Blob_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Fade_2;Near_Size=Near_Size_1*(1.0-Vx_Color.g)+Vx_Color.g*Near_Size_2;Inner_Fade=Blob_Inner_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Inner_Fade_2;}\nvoid Wireframe_Vertex_B51(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nfloat Edge_Width,\nvec2 Face_Size,\nout vec3 Wire_Vx_Pos,\nout vec2 UV,\nout vec2 Widths)\n{Widths.xy=Edge_Width/Face_Size;float x=dot(Position,Tangent);float y=dot(Position,Bitangent);float dx=0.5-abs(x);float newx=(0.5-dx*Widths.x*2.0)*sign(x);float dy=0.5-abs(y);float newy=(0.5-dy*Widths.y*2.0)*sign(y);Wire_Vx_Pos=Normal*0.5+newx*Tangent+newy*Bitangent;UV.x=dot(Wire_Vx_Pos,Tangent)+0.5;UV.y=dot(Wire_Vx_Pos,Bitangent)+0.5;}\nvec2 ramp2(vec2 start,vec2 end,vec2 x)\n{return clamp((x-start)/(end-start),vec2(0.0,0.0),vec2(1.0,1.0));}\nfloat computeSelection(\nvec3 blobPosition,\nvec3 normal,\nvec3 tangent,\nvec3 bitangent,\nvec3 faceCenter,\nvec2 faceSize,\nfloat selectionFuzz,\nfloat farDistance,\nfloat fadeLength\n)\n{vec3 delta=blobPosition-faceCenter;float absD=abs(dot(delta,normal));float fadeIn=1.0-clamp((absD-farDistance)/fadeLength,0.0,1.0);vec2 blobCenterXY=vec2(dot(delta,tangent),dot(delta,bitangent));vec2 innerFace=faceSize*(1.0-selectionFuzz)*0.5;vec2 selectPulse=ramp2(-faceSize*0.5,-innerFace,blobCenterXY)-ramp2(innerFace,faceSize*0.5,blobCenterXY);return selectPulse.x*selectPulse.y*fadeIn;}\nvoid Selection_Vertex_B48(\nvec3 Blob_Position,\nvec3 Blob_Position_2,\nvec3 Face_Center,\nvec2 Face_Size,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nfloat Selection_Fuzz,\nfloat Selected,\nfloat Far_Distance,\nfloat Fade_Length,\nvec3 Active_Face_Dir,\nout float Show_Selection)\n{float select1=computeSelection(Blob_Position,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float select2=computeSelection(Blob_Position_2,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float Active=max(0.0,dot(Active_Face_Dir,Normal));Show_Selection=mix(max(select1,select2),1.0,Selected)*Active;}\nvoid Proximity_Visibility_B54(\nfloat Selection,\nvec3 Proximity_Center,\nvec3 Proximity_Center_2,\nfloat Input_Width,\nfloat Proximity_Far_Distance,\nfloat Proximity_Radius,\nvec3 Active_Face_Center,\nvec3 Active_Face_Dir,\nout float Width)\n{vec3 boxEdges=(world*vec4(vec3(0.5,0.5,0.5),0.0)).xyz;float boxMaxSize=length(boxEdges);float d1=dot(Proximity_Center-Active_Face_Center,Active_Face_Dir);vec3 blob1=Proximity_Center-d1*Active_Face_Dir;float d2=dot(Proximity_Center_2-Active_Face_Center,Active_Face_Dir);vec3 blob2=Proximity_Center_2-d2*Active_Face_Dir;vec3 delta1=blob1-Active_Face_Center;vec3 delta2=blob2-Active_Face_Center;float dist1=dot(delta1,delta1);float dist2=dot(delta2,delta2);float nearestProxDist=sqrt(min(dist1,dist2));Width=Input_Width*(1.0-step(boxMaxSize+Proximity_Radius,nearestProxDist))*(1.0-step(Proximity_Far_Distance,min(d1,d2))*(1.0-step(0.0001,Selection)));}\nvoid Object_To_World_Dir_B67(\nvec3 Dir_Object,\nout vec3 Dir_World)\n{Dir_World=(world*vec4(Dir_Object,0.0)).xyz;}\nvoid main()\n{vec3 Active_Face_Center_Q49;Active_Face_Center_Q49=(world*vec4(_Active_Face_Dir_*0.5,1.0)).xyz;vec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));vec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));vec3 Active_Face_Dir_Q64=normalize((world*vec4(_Active_Face_Dir_,0.0)).xyz);float Relative_Scale_Q57;\n#if RELATIVE_WIDTH\nRelative_Scale_Q57=length((world*vec4(vec3(0,1,0),0.0)).xyz);\n#else\nRelative_Scale_Q57=1.0;\n#endif\nvec3 Tangent_World_Q30;Tangent_World_Q30=(world*vec4(tangent,0.0)).xyz;vec3 Binormal_World_Q31;Binormal_World_Q31=(world*vec4((cross(normal,tangent)),0.0)).xyz;vec3 Normal_World_Q60;Normal_World_Q60=(world*vec4(normal,0.0)).xyz;vec3 Result_Q18=0.5*normal;vec3 Dir_World_Q67;Object_To_World_Dir_B67(_Active_Face_Up_,Dir_World_Q67);float Product_Q56=_Edge_Width_*Relative_Scale_Q57;vec3 Normal_World_N_Q29=normalize(Normal_World_Q60);vec3 Tangent_World_N_Q28=normalize(Tangent_World_Q30);vec3 Binormal_World_N_Q32=normalize(Binormal_World_Q31);vec3 Position_Q38;float Near_Size_Q38;float Inner_Fade_Q38;float Blob_Enable_Q38;float Fade_Q38;float Pulse_Q38;Choose_Blob_B38(color,Blob_Position_Q41,Blob_Position_Q42,_Blob_Enable_,_Blob_Enable_2_,_Blob_Near_Size_,_Blob_Near_Size_2_,_Blob_Inner_Fade_,_Blob_Inner_Fade_2_,_Blob_Pulse_,_Blob_Pulse_2_,_Blob_Fade_,_Blob_Fade_2_,Position_Q38,Near_Size_Q38,Inner_Fade_Q38,Blob_Enable_Q38,Fade_Q38,Pulse_Q38);vec3 Face_Center_Q33;Face_Center_Q33=(world*vec4(Result_Q18,1.0)).xyz;vec2 Face_Size_Q50=vec2(length(Tangent_World_Q30),length(Binormal_World_Q31));float Show_Selection_Q48;Selection_Vertex_B48(Blob_Position_Q41,Blob_Position_Q42,Face_Center_Q33,Face_Size_Q50,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,_Selection_Fuzz_,_Selected_,_Selected_Distance_,_Selected_Fade_Length_,Active_Face_Dir_Q64,Show_Selection_Q48);vec3 Normalized_Q72=normalize(Dir_World_Q67);float Active_Q34=max(0.0,dot(Active_Face_Dir_Q64,Normal_World_N_Q29));float Width_Q54;Proximity_Visibility_B54(Show_Selection_Q48,Blob_Position_Q41,Blob_Position_Q42,Product_Q56,_Proximity_Far_Distance_,_Proximity_Near_Radius_,Active_Face_Center_Q49,Active_Face_Dir_Q64,Width_Q54);vec3 Wire_Vx_Pos_Q51;vec2 UV_Q51;vec2 Widths_Q51;Wireframe_Vertex_B51(position,normal,tangent,(cross(normal,tangent)),Width_Q54,Face_Size_Q50,Wire_Vx_Pos_Q51,UV_Q51,Widths_Q51);vec3 Vec3_Q27=vec3(Widths_Q51.x,Widths_Q51.y,color.r);vec3 Pos_World_Q13;Object_To_World_Pos_B13(Wire_Vx_Pos_Q51,Pos_World_Q13);vec3 Incident_Q36=normalize(Pos_World_Q13-cameraPosition);vec3 Out_Position_Q47;vec2 Out_UV_Q47;vec3 Blob_Info_Q47;Blob_Vertex_B47(Pos_World_Q13,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,Position_Q38,_Blob_Intensity_,Near_Size_Q38,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,color,uv,Face_Center_Q33,Face_Size_Q50,UV_Q51,_Blob_Fade_Length_,_Selection_Fade_,_Selection_Fade_Size_,Inner_Fade_Q38,Active_Face_Center_Q49,Pulse_Q38,Fade_Q38,Blob_Enable_Q38,Out_Position_Q47,Out_UV_Q47,Blob_Info_Q47);vec4 Extra1_Q66;float Distance_To_Face_Q66;float Intensity_Q66;Proximity_Vertex_B66(Blob_Position_Q41,Blob_Position_Q42,Active_Face_Center_Q49,Active_Face_Dir_Q64,Pos_World_Q13,_Proximity_Far_Distance_,Relative_Scale_Q57,_Proximity_Anisotropy_,Normalized_Q72,Extra1_Q66,Distance_To_Face_Q66,Intensity_Q66);vec4 Holo_Edges_Q44;Holo_Edge_Vertex_B44(Incident_Q36,Normal_World_N_Q29,uv,Tangent_World_Q30,Binormal_World_Q31,_Smooth_Active_Face_,Active_Q34,Holo_Edges_Q44);vec3 Vec3_Q19=vec3(Show_Selection_Q48,Distance_To_Face_Q66,Intensity_Q66);vec3 Position=Out_Position_Q47;vec2 UV=Out_UV_Q47;vec3 Tangent=Blob_Info_Q47;vec3 Binormal=Vec3_Q19;vec3 Normal=Vec3_Q27;vec4 Extra1=Extra1_Q66;vec4 Color=Holo_Edges_Q44;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/handle/handleMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{HandleMaterial:()=>o});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=(i("../../../dev/gui/src/3D/materials/handle/shaders/handle.vertex.ts"),i("../../../dev/gui/src/3D/materials/handle/shaders/handle.fragment.ts"),function(e){function t(t,i){var r=e.call(this,t,i,"handle",{attributes:["position"],uniforms:["worldViewProjection","color","scale","positionOffset"],needAlphaBlending:!1,needAlphaTesting:!1})||this;return r._hover=!1,r._drag=!1,r._color=new n.Color3,r._scale=1,r._lastTick=-1,r.animationLength=100,r.hoverColor=new n.Color3(0,.467,.84),r.baseColor=new n.Color3(1,1,1),r.hoverScale=.75,r.baseScale=.35,r.dragScale=.55,r._positionOffset=n.Vector3.Zero(),r._updateInterpolationTarget(),r._lastTick=Date.now(),r._onBeforeRender=r.getScene().onBeforeRenderObservable.add((function(){var e=Date.now(),t=e-r._lastTick,i=r._targetScale-r._scale,o=n.TmpColors.Color3[0].copyFrom(r._targetColor).subtractToRef(r._color,n.TmpColors.Color3[0]);r._scale=r._scale+i*t/r.animationLength,o.scaleToRef(t/r.animationLength,o),r._color.addToRef(o,r._color),r.setColor3("color",r._color),r.setFloat("scale",r._scale),r.setVector3("positionOffset",r._positionOffset),r._lastTick=e})),r}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"hover",{get:function(){return this._hover},set:function(e){this._hover=e,this._updateInterpolationTarget()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drag",{get:function(){return this._drag},set:function(e){this._drag=e,this._updateInterpolationTarget()},enumerable:!1,configurable:!0}),t.prototype._updateInterpolationTarget=function(){this.drag?(this._targetColor=this.hoverColor,this._targetScale=this.dragScale):this.hover?(this._targetColor=this.hoverColor,this._targetScale=this.hoverScale):(this._targetColor=this.baseColor,this._targetScale=this.baseScale)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.getScene().onBeforeRenderObservable.remove(this._onBeforeRender)},t}(n.ShaderMaterial))},"../../../dev/gui/src/3D/materials/handle/index.ts":(e,t,i)=>{i.r(t),i.d(t,{HandleMaterial:()=>r.HandleMaterial});var r=i("../../../dev/gui/src/3D/materials/handle/handleMaterial.ts")},"../../../dev/gui/src/3D/materials/handle/shaders/handle.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{handlePixelShader:()=>o});var r="handlePixelShader",n="uniform vec3 color;void main(void) {gl_FragColor=vec4(color,1.0);}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/handle/shaders/handle.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{handleVertexShader:()=>o});var r="handleVertexShader",n="precision highp float;attribute vec3 position;uniform vec3 positionOffset;uniform mat4 worldViewProjection;uniform float scale;void main(void) {vec4 vPos=vec4((vec3(position)+positionOffset)*scale,1.0);gl_Position=worldViewProjection*vPos;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/index.ts":(e,t,i)=>{i.r(t),i.d(t,{FluentBackplateMaterial:()=>o.FluentBackplateMaterial,FluentButtonMaterial:()=>n.FluentButtonMaterial,FluentMaterial:()=>r.FluentMaterial,FluentMaterialDefines:()=>r.FluentMaterialDefines,HandleMaterial:()=>a.HandleMaterial,MRDLBackplateMaterial:()=>s.MRDLBackplateMaterial,MRDLSliderBarMaterial:()=>s.MRDLSliderBarMaterial,MRDLSliderThumbMaterial:()=>s.MRDLSliderThumbMaterial});var r=i("../../../dev/gui/src/3D/materials/fluent/index.ts"),n=i("../../../dev/gui/src/3D/materials/fluentButton/index.ts"),o=i("../../../dev/gui/src/3D/materials/fluentBackplate/index.ts"),a=i("../../../dev/gui/src/3D/materials/handle/index.ts"),s=i("../../../dev/gui/src/3D/materials/mrdl/index.ts")},"../../../dev/gui/src/3D/materials/mrdl/index.ts":(e,t,i)=>{i.r(t),i.d(t,{MRDLBackplateMaterial:()=>o.MRDLBackplateMaterial,MRDLSliderBarMaterial:()=>r.MRDLSliderBarMaterial,MRDLSliderThumbMaterial:()=>n.MRDLSliderThumbMaterial});var r=i("../../../dev/gui/src/3D/materials/mrdl/mrdlSliderBarMaterial.ts"),n=i("../../../dev/gui/src/3D/materials/mrdl/mrdlSliderThumbMaterial.ts"),o=i("../../../dev/gui/src/3D/materials/mrdl/mrdlBackplateMaterial.ts")},"../../../dev/gui/src/3D/materials/mrdl/mrdlBackglowMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{MRDLBackglowMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=(i("../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlBackglow.fragment.ts"),i("../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlBackglow.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t._needNormals=!0,t._needUVs=!0,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.bevelRadius=.16,r.lineWidth=.16,r.absoluteSizes=!1,r.tuningMotion=0,r.motion=1,r.maxIntensity=.7,r.intensityFadeInExponent=2,r.outerFuzzStart=.04,r.outerFuzzEnd=.04,r.color=new n.Color4(.682353,.698039,1,1),r.innerColor=new n.Color4(.356863,.392157,.796078,1),r.blendExponent=1.5,r.falloff=2,r.bias=.5,r.alphaMode=n.Constants.ALPHA_ADD,r.disableDepthWrite=!0,r.backFaceCulling=!1,r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return!0},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t){var i=t._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;t.materialDefines||(t.materialDefines=new o);var r=t.materialDefines,a=this.getScene();if(this._isReadyForSubMesh(t))return!0;var s=a.getEngine();if((0,n.PrepareDefinesForAttributes)(e,r,!1,!1),r.isDirty){r.markAsProcessed(),a.resetCachedMaterial();var l=new n.EffectFallbacks;r.FOG&&l.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(r,l),r.IMAGEPROCESSINGPOSTPROCESS=a.imageProcessingConfiguration.applyByPostProcess;var c=[n.VertexBuffer.PositionKind];r.NORMAL&&c.push(n.VertexBuffer.NormalKind),r.UV1&&c.push(n.VertexBuffer.UVKind),r.UV2&&c.push(n.VertexBuffer.UV2Kind),r.VERTEXCOLOR&&c.push(n.VertexBuffer.ColorKind),r.TANGENT&&c.push(n.VertexBuffer.TangentKind),(0,n.PrepareAttributesForInstances)(c,r);var u=r.toString(),h=["world","worldView","worldViewProjection","view","projection","viewProjection","cameraPosition","_Bevel_Radius_","_Line_Width_","_Absolute_Sizes_","_Tuning_Motion_","_Motion_","_Max_Intensity_","_Intensity_Fade_In_Exponent_","_Outer_Fuzz_Start_","_Outer_Fuzz_End_","_Color_","_Inner_Color_","_Blend_Exponent_","_Falloff_","_Bias_"],d=[],_=[];(0,n.PrepareUniformsAndSamplersList)({uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:r,maxSimultaneousLights:4}),t.setEffect(a.getEngine().createEffect("mrdlBackglow",{attributes:c,uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:u,fallbacks:l,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},s),r)}return!(!t.effect||!t.effect.isReady()||(r._renderId=a.getRenderId(),i._wasPreviouslyReady=!0,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene();if(i.materialDefines){var n=i.effect;n&&(this._activeEffect=n,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",r.activeCamera.position),this._activeEffect.setFloat("_Bevel_Radius_",this.bevelRadius),this._activeEffect.setFloat("_Line_Width_",this.lineWidth),this._activeEffect.setFloat("_Absolute_Sizes_",this.absoluteSizes?1:0),this._activeEffect.setFloat("_Tuning_Motion_",this.tuningMotion),this._activeEffect.setFloat("_Motion_",this.motion),this._activeEffect.setFloat("_Max_Intensity_",this.maxIntensity),this._activeEffect.setFloat("_Intensity_Fade_In_Exponent_",this.intensityFadeInExponent),this._activeEffect.setFloat("_Outer_Fuzz_Start_",this.outerFuzzStart),this._activeEffect.setFloat("_Outer_Fuzz_End_",this.outerFuzzEnd),this._activeEffect.setDirectColor4("_Color_",this.color),this._activeEffect.setDirectColor4("_Inner_Color_",this.innerColor),this._activeEffect.setFloat("_Blend_Exponent_",this.blendExponent),this._activeEffect.setFloat("_Falloff_",this.falloff),this._activeEffect.setFloat("_Bias_",this.bias),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){return[]},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var e=n.SerializationHelper.Serialize(this);return e.customType="BABYLON.MRDLBackglowMaterial",e},t.prototype.getClassName=function(){return"MRDLBackglowMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bevelRadius",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"lineWidth",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"absoluteSizes",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"tuningMotion",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"motion",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"maxIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"intensityFadeInExponent",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"outerFuzzStart",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"outerFuzzEnd",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"color",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"innerColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blendExponent",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"falloff",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bias",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.GUI.MRDLBackglowMaterial",a)},"../../../dev/gui/src/3D/materials/mrdl/mrdlBackplateMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{MRDLBackplateMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=(i("../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlBackplate.fragment.ts"),i("../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlBackplate.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.IRIDESCENCE_ENABLE=!0,t.SMOOTH_EDGES=!0,t._needNormals=!0,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(i,r){var o=e.call(this,i,r)||this;return o.radius=.3,o.lineWidth=.003,o.absoluteSizes=!1,o._filterWidth=1,o.baseColor=new n.Color4(0,0,0,1),o.lineColor=new n.Color4(.2,.262745,.4,1),o.radiusTopLeft=1,o.radiusTopRight=1,o.radiusBottomLeft=1,o.radiusBottomRight=1,o._rate=0,o.highlightColor=new n.Color4(.239216,.435294,.827451,1),o.highlightWidth=0,o._highlightTransform=new n.Vector4(1,1,0,0),o._highlight=1,o.iridescenceIntensity=.45,o.iridescenceEdgeIntensity=1,o.iridescenceTint=new n.Color4(1,1,1,1),o._angle=-45,o.fadeOut=1,o._reflected=!0,o._frequency=1,o._verticalOffset=0,o.gradientColor=new n.Color4(.74902,.74902,.74902,1),o.topLeftGradientColor=new n.Color4(.00784314,.294118,.580392,1),o.topRightGradientColor=new n.Color4(.305882,0,1,1),o.bottomLeftGradientColor=new n.Color4(.133333,.258824,.992157,1),o.bottomRightGradientColor=new n.Color4(.176471,.176471,.619608,1),o.edgeWidth=.5,o.edgePower=1,o.edgeLineGradientBlend=.5,o.alphaMode=n.Constants.ALPHA_DISABLE,o.backFaceCulling=!1,o._iridescentMapTexture=new n.Texture(t.IRIDESCENT_MAP_TEXTURE_URL,o.getScene(),!0,!1,n.Texture.NEAREST_SAMPLINGMODE),o}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return!1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t){var i=t._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;t.materialDefines||(t.materialDefines=new o);var r=t.materialDefines,a=this.getScene();if(this._isReadyForSubMesh(t))return!0;var s=a.getEngine();if((0,n.PrepareDefinesForAttributes)(e,r,!1,!1),r.isDirty){r.markAsProcessed(),a.resetCachedMaterial();var l=new n.EffectFallbacks;r.FOG&&l.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(r,l),r.IMAGEPROCESSINGPOSTPROCESS=a.imageProcessingConfiguration.applyByPostProcess;var c=[n.VertexBuffer.PositionKind];r.NORMAL&&c.push(n.VertexBuffer.NormalKind),r.UV1&&c.push(n.VertexBuffer.UVKind),r.UV2&&c.push(n.VertexBuffer.UV2Kind),r.VERTEXCOLOR&&c.push(n.VertexBuffer.ColorKind),r.TANGENT&&c.push(n.VertexBuffer.TangentKind),(0,n.PrepareAttributesForInstances)(c,r);var u=r.toString(),h=["world","viewProjection","cameraPosition","_Radius_","_Line_Width_","_Absolute_Sizes_","_Filter_Width_","_Base_Color_","_Line_Color_","_Radius_Top_Left_","_Radius_Top_Right_","_Radius_Bottom_Left_","_Radius_Bottom_Right_","_Rate_","_Highlight_Color_","_Highlight_Width_","_Highlight_Transform_","_Highlight_","_Iridescence_Intensity_","_Iridescence_Edge_Intensity_","_Iridescence_Tint_","_Iridescent_Map_","_Angle_","_Reflected_","_Frequency_","_Vertical_Offset_","_Gradient_Color_","_Top_Left_","_Top_Right_","_Bottom_Left_","_Bottom_Right_","_Edge_Width_","_Edge_Power_","_Line_Gradient_Blend_","_Fade_Out_"],d=["_Iridescent_Map_"],_=[];(0,n.PrepareUniformsAndSamplersList)({uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:r,maxSimultaneousLights:4}),t.setEffect(a.getEngine().createEffect("mrdlBackplate",{attributes:c,uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:u,fallbacks:l,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},s),r)}return!(!t.effect||!t.effect.isReady()||(r._renderId=a.getRenderId(),i._wasPreviouslyReady=!0,0))},t.prototype.bindForSubMesh=function(e,t,i){if(i.materialDefines){var r=i.effect;r&&(this._activeEffect=r,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",this.getScene().activeCamera.position),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Line_Width_",this.lineWidth),this._activeEffect.setFloat("_Absolute_Sizes_",this.absoluteSizes?1:0),this._activeEffect.setFloat("_Filter_Width_",this._filterWidth),this._activeEffect.setDirectColor4("_Base_Color_",this.baseColor),this._activeEffect.setDirectColor4("_Line_Color_",this.lineColor),this._activeEffect.setFloat("_Radius_Top_Left_",this.radiusTopLeft),this._activeEffect.setFloat("_Radius_Top_Right_",this.radiusTopRight),this._activeEffect.setFloat("_Radius_Bottom_Left_",this.radiusBottomLeft),this._activeEffect.setFloat("_Radius_Bottom_Right_",this.radiusBottomRight),this._activeEffect.setFloat("_Rate_",this._rate),this._activeEffect.setDirectColor4("_Highlight_Color_",this.highlightColor),this._activeEffect.setFloat("_Highlight_Width_",this.highlightWidth),this._activeEffect.setVector4("_Highlight_Transform_",this._highlightTransform),this._activeEffect.setFloat("_Highlight_",this._highlight),this._activeEffect.setFloat("_Iridescence_Intensity_",this.iridescenceIntensity),this._activeEffect.setFloat("_Iridescence_Edge_Intensity_",this.iridescenceEdgeIntensity),this._activeEffect.setDirectColor4("_Iridescence_Tint_",this.iridescenceTint),this._activeEffect.setTexture("_Iridescent_Map_",this._iridescentMapTexture),this._activeEffect.setFloat("_Angle_",this._angle),this._activeEffect.setFloat("_Reflected_",this._reflected?1:0),this._activeEffect.setFloat("_Frequency_",this._frequency),this._activeEffect.setFloat("_Vertical_Offset_",this._verticalOffset),this._activeEffect.setDirectColor4("_Gradient_Color_",this.gradientColor),this._activeEffect.setDirectColor4("_Top_Left_",this.topLeftGradientColor),this._activeEffect.setDirectColor4("_Top_Right_",this.topRightGradientColor),this._activeEffect.setDirectColor4("_Bottom_Left_",this.bottomLeftGradientColor),this._activeEffect.setDirectColor4("_Bottom_Right_",this.bottomRightGradientColor),this._activeEffect.setFloat("_Edge_Width_",this.edgeWidth),this._activeEffect.setFloat("_Edge_Power_",this.edgePower),this._activeEffect.setFloat("_Line_Gradient_Blend_",this.edgeLineGradientBlend),this._activeEffect.setFloat("_Fade_Out_",this.fadeOut),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){return[]},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.MRDLBackplateMaterial",t},t.prototype.getClassName=function(){return"MRDLBackplateMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},t.IRIDESCENT_MAP_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-backplate-iridescence.png",(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radius",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"lineWidth",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"absoluteSizes",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"baseColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"lineColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radiusTopLeft",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radiusTopRight",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radiusBottomLeft",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radiusBottomRight",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"highlightColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"highlightWidth",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"iridescenceIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"iridescenceEdgeIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"iridescenceTint",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"fadeOut",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"gradientColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"topLeftGradientColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"topRightGradientColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bottomLeftGradientColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bottomRightGradientColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"edgeWidth",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"edgePower",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"edgeLineGradientBlend",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.GUI.MRDLBackplateMaterial",a)},"../../../dev/gui/src/3D/materials/mrdl/mrdlFrontplateMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{MRDLFrontplateMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=(i("../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlFrontplate.fragment.ts"),i("../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlFrontplate.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.SMOOTH_EDGES=!0,t._needNormals=!0,t._needUVs=!0,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(i,r){var o=e.call(this,i,r)||this;return o.radius=.12,o.lineWidth=.01,o.relativeToHeight=!1,o._filterWidth=1,o.edgeColor=new n.Color4(.53,.53,.53,1),o.blobEnable=!0,o.blobPosition=new n.Vector3(100,100,100),o.blobIntensity=.5,o.blobNearSize=.032,o.blobFarSize=.048,o.blobNearDistance=.008,o.blobFarDistance=.064,o.blobFadeLength=.04,o.blobInnerFade=.01,o.blobPulse=0,o.blobFade=1,o.blobPulseMaxSize=.05,o.blobEnable2=!0,o.blobPosition2=new n.Vector3(10,10.1,-.6),o.blobNearSize2=.008,o.blobInnerFade2=.1,o.blobPulse2=0,o.blobFade2=1,o.gazeIntensity=.8,o.gazeFocus=0,o.selectionFuzz=.5,o.selected=1,o.selectionFade=.2,o.selectionFadeSize=0,o.selectedDistance=.08,o.selectedFadeLength=.08,o.proximityMaxIntensity=.45,o.proximityFarDistance=.16,o.proximityNearRadius=.016,o.proximityAnisotropy=1,o.useGlobalLeftIndex=!0,o.useGlobalRightIndex=!0,o.fadeOut=1,o.alphaMode=n.Constants.ALPHA_ADD,o.disableDepthWrite=!0,o.backFaceCulling=!1,o._blobTexture=new n.Texture(t.BLOB_TEXTURE_URL,r,!0,!1,n.Texture.NEAREST_SAMPLINGMODE),o}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return!0},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t){var i=t._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;t.materialDefines||(t.materialDefines=new o);var r=t.materialDefines,a=this.getScene();if(this._isReadyForSubMesh(t))return!0;var s=a.getEngine();if((0,n.PrepareDefinesForAttributes)(e,r,!1,!1),r.isDirty){r.markAsProcessed(),a.resetCachedMaterial();var l=new n.EffectFallbacks;r.FOG&&l.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(r,l),r.IMAGEPROCESSINGPOSTPROCESS=a.imageProcessingConfiguration.applyByPostProcess;var c=[n.VertexBuffer.PositionKind];r.NORMAL&&c.push(n.VertexBuffer.NormalKind),r.UV1&&c.push(n.VertexBuffer.UVKind),r.UV2&&c.push(n.VertexBuffer.UV2Kind),r.VERTEXCOLOR&&c.push(n.VertexBuffer.ColorKind),r.TANGENT&&c.push(n.VertexBuffer.TangentKind),(0,n.PrepareAttributesForInstances)(c,r);var u=r.toString(),h=["world","worldView","worldViewProjection","view","projection","viewProjection","cameraPosition","_Radius_","_Line_Width_","_Relative_To_Height_","_Filter_Width_","_Edge_Color_","_Fade_Out_","_Smooth_Edges_","_Blob_Enable_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Inner_Fade_","_Blob_Pulse_","_Blob_Fade_","_Blob_Pulse_Max_Size_","_Blob_Enable_2_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Inner_Fade_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Gaze_Intensity_","_Gaze_Focus_","_Blob_Texture_","_Selection_Fuzz_","_Selected_","_Selection_Fade_","_Selection_Fade_Size_","_Selected_Distance_","_Selected_Fade_Length_","_Proximity_Max_Intensity_","_Proximity_Far_Distance_","_Proximity_Near_Radius_","_Proximity_Anisotropy_","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position","_Use_Global_Left_Index_","_Use_Global_Right_Index_"],d=[],_=[];(0,n.PrepareUniformsAndSamplersList)({uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:r,maxSimultaneousLights:4}),t.setEffect(a.getEngine().createEffect("mrdlFrontplate",{attributes:c,uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:u,fallbacks:l,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},s),r)}return!(!t.effect||!t.effect.isReady()||(r._renderId=a.getRenderId(),i._wasPreviouslyReady=!0,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene();if(i.materialDefines){var n=i.effect;n&&(this._activeEffect=n,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",r.activeCamera.position),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Line_Width_",this.lineWidth),this._activeEffect.setFloat("_Relative_To_Height_",this.relativeToHeight?1:0),this._activeEffect.setFloat("_Filter_Width_",this._filterWidth),this._activeEffect.setDirectColor4("_Edge_Color_",this.edgeColor),this._activeEffect.setFloat("_Fade_Out_",this.fadeOut),this._activeEffect.setFloat("_Blob_Enable_",this.blobEnable?1:0),this._activeEffect.setVector3("_Blob_Position_",this.blobPosition),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.blobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Inner_Fade_",this.blobInnerFade),this._activeEffect.setFloat("_Blob_Pulse_",this.blobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.blobFade),this._activeEffect.setFloat("_Blob_Pulse_Max_Size_",this.blobPulseMaxSize),this._activeEffect.setFloat("_Blob_Enable_2_",this.blobEnable2?1:0),this._activeEffect.setVector3("_Blob_Position_2_",this.blobPosition2),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.blobNearSize2),this._activeEffect.setFloat("_Blob_Inner_Fade_2_",this.blobInnerFade2),this._activeEffect.setFloat("_Blob_Pulse_2_",this.blobPulse2),this._activeEffect.setFloat("_Blob_Fade_2_",this.blobFade2),this._activeEffect.setFloat("_Gaze_Intensity_",this.gazeIntensity),this._activeEffect.setFloat("_Gaze_Focus_",this.gazeFocus),this._activeEffect.setTexture("_Blob_Texture_",this._blobTexture),this._activeEffect.setFloat("_Selection_Fuzz_",this.selectionFuzz),this._activeEffect.setFloat("_Selected_",this.selected),this._activeEffect.setFloat("_Selection_Fade_",this.selectionFade),this._activeEffect.setFloat("_Selection_Fade_Size_",this.selectionFadeSize),this._activeEffect.setFloat("_Selected_Distance_",this.selectedDistance),this._activeEffect.setFloat("_Selected_Fade_Length_",this.selectedFadeLength),this._activeEffect.setFloat("_Proximity_Max_Intensity_",this.proximityMaxIntensity),this._activeEffect.setFloat("_Proximity_Far_Distance_",this.proximityFarDistance),this._activeEffect.setFloat("_Proximity_Near_Radius_",this.proximityNearRadius),this._activeEffect.setFloat("_Proximity_Anisotropy_",this.proximityAnisotropy),this._activeEffect.setFloat("_Use_Global_Left_Index_",this.useGlobalLeftIndex?1:0),this._activeEffect.setFloat("_Use_Global_Right_Index_",this.useGlobalRightIndex?1:0),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){return[]},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var e=n.SerializationHelper.Serialize(this);return e.customType="BABYLON.MRDLFrontplateMaterial",e},t.prototype.getClassName=function(){return"MRDLFrontplateMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},t.BLOB_TEXTURE_URL="",(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radius",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"lineWidth",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"relativeToHeight",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"edgeColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobEnable",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPosition",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobNearSize",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFarSize",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobNearDistance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFarDistance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFadeLength",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobInnerFade",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPulse",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFade",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPulseMaxSize",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobEnable2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPosition2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobNearSize2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobInnerFade2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPulse2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFade2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"gazeIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"gazeFocus",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"selectionFuzz",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"selected",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"selectionFade",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"selectionFadeSize",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"selectedDistance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"selectedFadeLength",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"proximityMaxIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"proximityFarDistance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"proximityNearRadius",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"proximityAnisotropy",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"useGlobalLeftIndex",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"useGlobalRightIndex",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.GUI.MRDLFrontplateMaterial",a)},"../../../dev/gui/src/3D/materials/mrdl/mrdlInnerquadMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{MRDLInnerquadMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=(i("../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlInnerquad.fragment.ts"),i("../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlInnerquad.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t._needNormals=!0,t._needUVs=!0,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.color=new n.Color4(1,1,1,.05),r.radius=.12,r.fixedRadius=!0,r._filterWidth=1,r.glowFraction=0,r.glowMax=.5,r.glowFalloff=2,r.alphaMode=n.Constants.ALPHA_COMBINE,r.backFaceCulling=!1,r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return!0},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t){var i=t._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;t.materialDefines||(t.materialDefines=new o);var r=t.materialDefines,a=this.getScene();if(this._isReadyForSubMesh(t))return!0;var s=a.getEngine();if((0,n.PrepareDefinesForAttributes)(e,r,!0,!1),r.isDirty){r.markAsProcessed(),a.resetCachedMaterial();var l=new n.EffectFallbacks;r.FOG&&l.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(r,l),r.IMAGEPROCESSINGPOSTPROCESS=a.imageProcessingConfiguration.applyByPostProcess;var c=[n.VertexBuffer.PositionKind];r.NORMAL&&c.push(n.VertexBuffer.NormalKind),r.UV1&&c.push(n.VertexBuffer.UVKind),r.UV2&&c.push(n.VertexBuffer.UV2Kind),r.VERTEXCOLOR&&c.push(n.VertexBuffer.ColorKind),r.TANGENT&&c.push(n.VertexBuffer.TangentKind),(0,n.PrepareAttributesForInstances)(c,r);var u=r.toString(),h=["world","worldView","worldViewProjection","view","projection","viewProjection","cameraPosition","_Color_","_Radius_","_Fixed_Radius_","_Filter_Width_","_Glow_Fraction_","_Glow_Max_","_Glow_Falloff_"],d=[],_=[];(0,n.PrepareUniformsAndSamplersList)({uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:r,maxSimultaneousLights:4}),t.setEffect(a.getEngine().createEffect("mrdlInnerquad",{attributes:c,uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:u,fallbacks:l,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},s),r)}return!(!t.effect||!t.effect.isReady()||(r._renderId=a.getRenderId(),i._wasPreviouslyReady=!0,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene();if(i.materialDefines){var n=i.effect;n&&(this._activeEffect=n,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",r.activeCamera.position),this._activeEffect.setDirectColor4("_Color_",this.color),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Fixed_Radius_",this.fixedRadius?1:0),this._activeEffect.setFloat("_Filter_Width_",this._filterWidth),this._activeEffect.setFloat("_Glow_Fraction_",this.glowFraction),this._activeEffect.setFloat("_Glow_Max_",this.glowMax),this._activeEffect.setFloat("_Glow_Falloff_",this.glowFalloff),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){return[]},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var e=n.SerializationHelper.Serialize(this);return e.customType="BABYLON.MRDLInnerquadMaterial",e},t.prototype.getClassName=function(){return"MRDLInnerquadMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},(0,r.__decorate)([(0,n.serialize)()],t.prototype,"color",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radius",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"fixedRadius",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"glowFraction",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"glowMax",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"glowFalloff",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.GUI.MRDLInnerquadMaterial",a)},"../../../dev/gui/src/3D/materials/mrdl/mrdlSliderBarMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{MRDLSliderBarMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=(i("../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.ts"),i("../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.SKY_ENABLED=!0,t.BLOB_ENABLE_2=!0,t.IRIDESCENCE_ENABLED=!0,t._needNormals=!0,t._needUVs=!0,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(i,r){var o=e.call(this,i,r)||this;return o.radius=.6,o.bevelFront=.6,o.bevelFrontStretch=.077,o.bevelBack=0,o.bevelBackStretch=0,o.radiusTopLeft=1,o.radiusTopRight=1,o.radiusBottomLeft=1,o.radiusBottomRight=1,o.bulgeEnabled=!1,o.bulgeHeight=-.323,o.bulgeRadius=.73,o.sunIntensity=1.102,o.sunTheta=.76,o.sunPhi=.526,o.indirectDiffuse=.658,o.albedo=new n.Color4(.0117647,.505882,.996078,1),o.specular=0,o.shininess=10,o.sharpness=0,o.subsurface=0,o.leftGradientColor=new n.Color4(.0117647,.505882,.996078,1),o.rightGradientColor=new n.Color4(.0117647,.505882,.996078,1),o.reflection=.749,o.frontReflect=0,o.edgeReflect=.09,o.power=8.13,o.skyColor=new n.Color4(.0117647,.964706,.996078,1),o.horizonColor=new n.Color4(.0117647,.333333,.996078,1),o.groundColor=new n.Color4(0,.254902,.996078,1),o.horizonPower=1,o.width=.02,o.fuzz=.5,o.minFuzz=.001,o.clipFade=.01,o.hueShift=0,o.saturationShift=0,o.valueShift=0,o.blobPosition=new n.Vector3(0,0,.1),o.blobIntensity=.5,o.blobNearSize=.01,o.blobFarSize=.03,o.blobNearDistance=0,o.blobFarDistance=.08,o.blobFadeLength=.576,o.blobPulse=0,o.blobFade=1,o.blobPosition2=new n.Vector3(.2,0,.1),o.blobNearSize2=.01,o.blobPulse2=0,o.blobFade2=1,o.blobTexture=new n.Texture("",o.getScene()),o.leftIndexPosition=new n.Vector3(0,0,1),o.rightIndexPosition=new n.Vector3(-1,-1,-1),o.leftIndexMiddlePosition=new n.Vector3(0,0,0),o.rightIndexMiddlePosition=new n.Vector3(0,0,0),o.decalScaleXY=new n.Vector2(1.5,1.5),o.decalFrontOnly=!0,o.rimIntensity=.287,o.rimHueShift=0,o.rimSaturationShift=0,o.rimValueShift=-1,o.iridescenceIntensity=0,o.useGlobalLeftIndex=1,o.useGlobalRightIndex=1,o.globalLeftIndexTipProximity=0,o.globalRightIndexTipProximity=0,o.globalLeftIndexTipPosition=new n.Vector4(.5,0,-.55,1),o.globaRightIndexTipPosition=new n.Vector4(0,0,0,1),o.globalLeftThumbTipPosition=new n.Vector4(.5,0,-.55,1),o.globalRightThumbTipPosition=new n.Vector4(0,0,0,1),o.globalLeftIndexMiddlePosition=new n.Vector4(.5,0,-.55,1),o.globalRightIndexMiddlePosition=new n.Vector4(0,0,0,1),o.alphaMode=n.Constants.ALPHA_DISABLE,o.backFaceCulling=!1,o._blueGradientTexture=new n.Texture(t.BLUE_GRADIENT_TEXTURE_URL,o.getScene(),!0,!1,n.Texture.NEAREST_SAMPLINGMODE),o._decalTexture=new n.Texture("",o.getScene()),o._reflectionMapTexture=new n.Texture("",o.getScene()),o._indirectEnvTexture=new n.Texture("",o.getScene()),o}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return!1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t){var i=t._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;t.materialDefines||(t.materialDefines=new o);var r=t.materialDefines,a=this.getScene();if(this._isReadyForSubMesh(t))return!0;var s=a.getEngine();if((0,n.PrepareDefinesForAttributes)(e,r,!1,!1),r.isDirty){r.markAsProcessed(),a.resetCachedMaterial();var l=new n.EffectFallbacks;r.FOG&&l.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(r,l),r.IMAGEPROCESSINGPOSTPROCESS=a.imageProcessingConfiguration.applyByPostProcess;var c=[n.VertexBuffer.PositionKind];r.NORMAL&&c.push(n.VertexBuffer.NormalKind),r.UV1&&c.push(n.VertexBuffer.UVKind),r.UV2&&c.push(n.VertexBuffer.UV2Kind),r.VERTEXCOLOR&&c.push(n.VertexBuffer.ColorKind),r.TANGENT&&c.push(n.VertexBuffer.TangentKind),(0,n.PrepareAttributesForInstances)(c,r);var u=r.toString(),h=["world","viewProjection","cameraPosition","_Radius_","_Bevel_Front_","_Bevel_Front_Stretch_","_Bevel_Back_","_Bevel_Back_Stretch_","_Radius_Top_Left_","_Radius_Top_Right_","_Radius_Bottom_Left_","_Radius_Bottom_Right_","_Bulge_Enabled_","_Bulge_Height_","_Bulge_Radius_","_Sun_Intensity_","_Sun_Theta_","_Sun_Phi_","_Indirect_Diffuse_","_Albedo_","_Specular_","_Shininess_","_Sharpness_","_Subsurface_","_Left_Color_","_Right_Color_","_Reflection_","_Front_Reflect_","_Edge_Reflect_","_Power_","_Sky_Color_","_Horizon_Color_","_Ground_Color_","_Horizon_Power_","_Reflection_Map_","_Indirect_Environment_","_Width_","_Fuzz_","_Min_Fuzz_","_Clip_Fade_","_Hue_Shift_","_Saturation_Shift_","_Value_Shift_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Pulse_","_Blob_Fade_","_Blob_Texture_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Left_Index_Pos_","_Right_Index_Pos_","_Left_Index_Middle_Pos_","_Right_Index_Middle_Pos_","_Decal_","_Decal_Scale_XY_","_Decal_Front_Only_","_Rim_Intensity_","_Rim_Texture_","_Rim_Hue_Shift_","_Rim_Saturation_Shift_","_Rim_Value_Shift_","_Iridescence_Intensity_","_Iridescence_Texture_","Use_Global_Left_Index","Use_Global_Right_Index","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position","Global_Left_Thumb_Tip_Position","Global_Right_Thumb_Tip_Position","Global_Left_Index_Middle_Position;","Global_Right_Index_Middle_Position","Global_Left_Index_Tip_Proximity","Global_Right_Index_Tip_Proximity"],d=["_Rim_Texture_","_Iridescence_Texture_"],_=[];(0,n.PrepareUniformsAndSamplersList)({uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:r,maxSimultaneousLights:4}),t.setEffect(a.getEngine().createEffect("mrdlSliderBar",{attributes:c,uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:u,fallbacks:l,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},s),r,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(r._renderId=a.getRenderId(),i._wasPreviouslyReady=!0,0))},t.prototype.bindForSubMesh=function(e,t,i){if(i.materialDefines){var r=i.effect;r&&(this._activeEffect=r,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",this.getScene().activeCamera.position),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Bevel_Front_",this.bevelFront),this._activeEffect.setFloat("_Bevel_Front_Stretch_",this.bevelFrontStretch),this._activeEffect.setFloat("_Bevel_Back_",this.bevelBack),this._activeEffect.setFloat("_Bevel_Back_Stretch_",this.bevelBackStretch),this._activeEffect.setFloat("_Radius_Top_Left_",this.radiusTopLeft),this._activeEffect.setFloat("_Radius_Top_Right_",this.radiusTopRight),this._activeEffect.setFloat("_Radius_Bottom_Left_",this.radiusBottomLeft),this._activeEffect.setFloat("_Radius_Bottom_Right_",this.radiusBottomRight),this._activeEffect.setFloat("_Bulge_Enabled_",this.bulgeEnabled?1:0),this._activeEffect.setFloat("_Bulge_Height_",this.bulgeHeight),this._activeEffect.setFloat("_Bulge_Radius_",this.bulgeRadius),this._activeEffect.setFloat("_Sun_Intensity_",this.sunIntensity),this._activeEffect.setFloat("_Sun_Theta_",this.sunTheta),this._activeEffect.setFloat("_Sun_Phi_",this.sunPhi),this._activeEffect.setFloat("_Indirect_Diffuse_",this.indirectDiffuse),this._activeEffect.setDirectColor4("_Albedo_",this.albedo),this._activeEffect.setFloat("_Specular_",this.specular),this._activeEffect.setFloat("_Shininess_",this.shininess),this._activeEffect.setFloat("_Sharpness_",this.sharpness),this._activeEffect.setFloat("_Subsurface_",this.subsurface),this._activeEffect.setDirectColor4("_Left_Color_",this.leftGradientColor),this._activeEffect.setDirectColor4("_Right_Color_",this.rightGradientColor),this._activeEffect.setFloat("_Reflection_",this.reflection),this._activeEffect.setFloat("_Front_Reflect_",this.frontReflect),this._activeEffect.setFloat("_Edge_Reflect_",this.edgeReflect),this._activeEffect.setFloat("_Power_",this.power),this._activeEffect.setDirectColor4("_Sky_Color_",this.skyColor),this._activeEffect.setDirectColor4("_Horizon_Color_",this.horizonColor),this._activeEffect.setDirectColor4("_Ground_Color_",this.groundColor),this._activeEffect.setFloat("_Horizon_Power_",this.horizonPower),this._activeEffect.setTexture("_Reflection_Map_",this._reflectionMapTexture),this._activeEffect.setTexture("_Indirect_Environment_",this._indirectEnvTexture),this._activeEffect.setFloat("_Width_",this.width),this._activeEffect.setFloat("_Fuzz_",this.fuzz),this._activeEffect.setFloat("_Min_Fuzz_",this.minFuzz),this._activeEffect.setFloat("_Clip_Fade_",this.clipFade),this._activeEffect.setFloat("_Hue_Shift_",this.hueShift),this._activeEffect.setFloat("_Saturation_Shift_",this.saturationShift),this._activeEffect.setFloat("_Value_Shift_",this.valueShift),this._activeEffect.setVector3("_Blob_Position_",this.blobPosition),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.blobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Pulse_",this.blobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.blobFade),this._activeEffect.setTexture("_Blob_Texture_",this.blobTexture),this._activeEffect.setVector3("_Blob_Position_2_",this.blobPosition2),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.blobNearSize2),this._activeEffect.setFloat("_Blob_Pulse_2_",this.blobPulse2),this._activeEffect.setFloat("_Blob_Fade_2_",this.blobFade2),this._activeEffect.setVector3("_Left_Index_Pos_",this.leftIndexPosition),this._activeEffect.setVector3("_Right_Index_Pos_",this.rightIndexPosition),this._activeEffect.setVector3("_Left_Index_Middle_Pos_",this.leftIndexMiddlePosition),this._activeEffect.setVector3("_Right_Index_Middle_Pos_",this.rightIndexMiddlePosition),this._activeEffect.setTexture("_Decal_",this._decalTexture),this._activeEffect.setVector2("_Decal_Scale_XY_",this.decalScaleXY),this._activeEffect.setFloat("_Decal_Front_Only_",this.decalFrontOnly?1:0),this._activeEffect.setFloat("_Rim_Intensity_",this.rimIntensity),this._activeEffect.setTexture("_Rim_Texture_",this._blueGradientTexture),this._activeEffect.setFloat("_Rim_Hue_Shift_",this.rimHueShift),this._activeEffect.setFloat("_Rim_Saturation_Shift_",this.rimSaturationShift),this._activeEffect.setFloat("_Rim_Value_Shift_",this.rimValueShift),this._activeEffect.setFloat("_Iridescence_Intensity_",this.iridescenceIntensity),this._activeEffect.setTexture("_Iridescence_Texture_",this._blueGradientTexture),this._activeEffect.setFloat("Use_Global_Left_Index",this.useGlobalLeftIndex),this._activeEffect.setFloat("Use_Global_Right_Index",this.useGlobalRightIndex),this._activeEffect.setVector4("Global_Left_Index_Tip_Position",this.globalLeftIndexTipPosition),this._activeEffect.setVector4("Global_Right_Index_Tip_Position",this.globaRightIndexTipPosition),this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position",this.globalLeftThumbTipPosition),this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position",this.globalRightThumbTipPosition),this._activeEffect.setVector4("Global_Left_Index_Middle_Position",this.globalLeftIndexMiddlePosition),this._activeEffect.setVector4("Global_Right_Index_Middle_Position",this.globalRightIndexMiddlePosition),this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity",this.globalLeftIndexTipProximity),this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity",this.globalRightIndexTipProximity),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){return[]},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),this._reflectionMapTexture.dispose(),this._indirectEnvTexture.dispose(),this._blueGradientTexture.dispose(),this._decalTexture.dispose()},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.MRDLSliderBarMaterial",t},t.prototype.getClassName=function(){return"MRDLSliderBarMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},t.BLUE_GRADIENT_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png",(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radius",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bevelFront",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bevelFrontStretch",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bevelBack",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bevelBackStretch",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radiusTopLeft",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radiusTopRight",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radiusBottomLeft",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radiusBottomRight",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bulgeEnabled",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bulgeHeight",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bulgeRadius",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sunIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sunTheta",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sunPhi",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"indirectDiffuse",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"albedo",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"specular",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"shininess",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sharpness",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"subsurface",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"leftGradientColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rightGradientColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"reflection",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"frontReflect",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"edgeReflect",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"power",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"skyColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"horizonColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"groundColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"horizonPower",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"width",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"fuzz",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"minFuzz",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"clipFade",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"hueShift",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"saturationShift",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"valueShift",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPosition",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobNearSize",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFarSize",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobNearDistance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFarDistance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFadeLength",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPulse",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFade",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPosition2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobNearSize2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPulse2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFade2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobTexture",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"leftIndexPosition",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rightIndexPosition",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"leftIndexMiddlePosition",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rightIndexMiddlePosition",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"decalScaleXY",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"decalFrontOnly",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rimIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rimHueShift",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rimSaturationShift",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rimValueShift",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"iridescenceIntensity",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.GUI.MRDLSliderBarMaterial",a)},"../../../dev/gui/src/3D/materials/mrdl/mrdlSliderThumbMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{MRDLSliderThumbMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/perfCounter"),o=(i("../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.ts"),i("../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.SKY_ENABLED=!0,t.BLOB_ENABLE_2=!0,t.IRIDESCENCE_ENABLED=!0,t._needNormals=!0,t._needUVs=!0,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(i,r){var o=e.call(this,i,r)||this;return o.radius=.157,o.bevelFront=.065,o.bevelFrontStretch=.077,o.bevelBack=.031,o.bevelBackStretch=0,o.radiusTopLeft=1,o.radiusTopRight=1,o.radiusBottomLeft=1,o.radiusBottomRight=1,o.bulgeEnabled=!1,o.bulgeHeight=-.323,o.bulgeRadius=.73,o.sunIntensity=2,o.sunTheta=.937,o.sunPhi=.555,o.indirectDiffuse=1,o.albedo=new n.Color4(.0117647,.505882,.996078,1),o.specular=0,o.shininess=10,o.sharpness=0,o.subsurface=.31,o.leftGradientColor=new n.Color4(.0117647,.505882,.996078,1),o.rightGradientColor=new n.Color4(.0117647,.505882,.996078,1),o.reflection=.749,o.frontReflect=0,o.edgeReflect=.09,o.power=8.1,o.skyColor=new n.Color4(.0117647,.960784,.996078,1),o.horizonColor=new n.Color4(.0117647,.333333,.996078,1),o.groundColor=new n.Color4(0,.254902,.996078,1),o.horizonPower=1,o.width=.02,o.fuzz=.5,o.minFuzz=.001,o.clipFade=.01,o.hueShift=0,o.saturationShift=0,o.valueShift=0,o.blobPosition=new n.Vector3(0,0,.1),o.blobIntensity=.5,o.blobNearSize=.01,o.blobFarSize=.03,o.blobNearDistance=0,o.blobFarDistance=.08,o.blobFadeLength=.576,o.blobPulse=0,o.blobFade=1,o.blobPosition2=new n.Vector3(.2,0,.1),o.blobNearSize2=.01,o.blobPulse2=0,o.blobFade2=1,o.blobTexture=new n.Texture("",o.getScene()),o.leftIndexPosition=new n.Vector3(0,0,1),o.rightIndexPosition=new n.Vector3(-1,-1,-1),o.leftIndexMiddlePosition=new n.Vector3(0,0,0),o.rightIndexMiddlePosition=new n.Vector3(0,0,0),o.decalScaleXY=new n.Vector2(1.5,1.5),o.decalFrontOnly=!0,o.rimIntensity=.287,o.rimHueShift=0,o.rimSaturationShift=0,o.rimValueShift=-1,o.iridescenceIntensity=0,o.useGlobalLeftIndex=1,o.useGlobalRightIndex=1,o.globalLeftIndexTipProximity=0,o.globalRightIndexTipProximity=0,o.globalLeftIndexTipPosition=new n.Vector4(.5,0,-.55,1),o.globaRightIndexTipPosition=new n.Vector4(0,0,0,1),o.globalLeftThumbTipPosition=new n.Vector4(.5,0,-.55,1),o.globalRightThumbTipPosition=new n.Vector4(0,0,0,1),o.globalLeftIndexMiddlePosition=new n.Vector4(.5,0,-.55,1),o.globalRightIndexMiddlePosition=new n.Vector4(0,0,0,1),o.alphaMode=n.Constants.ALPHA_DISABLE,o.backFaceCulling=!1,o._blueGradientTexture=new n.Texture(t.BLUE_GRADIENT_TEXTURE_URL,r,!0,!1,n.Texture.NEAREST_SAMPLINGMODE),o._decalTexture=new n.Texture("",o.getScene()),o._reflectionMapTexture=new n.Texture("",o.getScene()),o._indirectEnvTexture=new n.Texture("",o.getScene()),o}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return!1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t){var i=t._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;t.materialDefines||(t.materialDefines=new o);var r=t.materialDefines,a=this.getScene();if(this._isReadyForSubMesh(t))return!0;var s=a.getEngine();if((0,n.PrepareDefinesForAttributes)(e,r,!1,!1),r.isDirty){r.markAsProcessed(),a.resetCachedMaterial();var l=new n.EffectFallbacks;r.FOG&&l.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(r,l),r.IMAGEPROCESSINGPOSTPROCESS=a.imageProcessingConfiguration.applyByPostProcess;var c=[n.VertexBuffer.PositionKind];r.NORMAL&&c.push(n.VertexBuffer.NormalKind),r.UV1&&c.push(n.VertexBuffer.UVKind),r.UV2&&c.push(n.VertexBuffer.UV2Kind),r.VERTEXCOLOR&&c.push(n.VertexBuffer.ColorKind),r.TANGENT&&c.push(n.VertexBuffer.TangentKind),(0,n.PrepareAttributesForInstances)(c,r);var u=r.toString(),h=["world","viewProjection","cameraPosition","_Radius_","_Bevel_Front_","_Bevel_Front_Stretch_","_Bevel_Back_","_Bevel_Back_Stretch_","_Radius_Top_Left_","_Radius_Top_Right_","_Radius_Bottom_Left_","_Radius_Bottom_Right_","_Bulge_Enabled_","_Bulge_Height_","_Bulge_Radius_","_Sun_Intensity_","_Sun_Theta_","_Sun_Phi_","_Indirect_Diffuse_","_Albedo_","_Specular_","_Shininess_","_Sharpness_","_Subsurface_","_Left_Color_","_Right_Color_","_Reflection_","_Front_Reflect_","_Edge_Reflect_","_Power_","_Sky_Color_","_Horizon_Color_","_Ground_Color_","_Horizon_Power_","_Reflection_Map_","_Indirect_Environment_","_Width_","_Fuzz_","_Min_Fuzz_","_Clip_Fade_","_Hue_Shift_","_Saturation_Shift_","_Value_Shift_","_Blob_Position_","_Blob_Intensity_","_Blob_Near_Size_","_Blob_Far_Size_","_Blob_Near_Distance_","_Blob_Far_Distance_","_Blob_Fade_Length_","_Blob_Pulse_","_Blob_Fade_","_Blob_Texture_","_Blob_Position_2_","_Blob_Near_Size_2_","_Blob_Pulse_2_","_Blob_Fade_2_","_Left_Index_Pos_","_Right_Index_Pos_","_Left_Index_Middle_Pos_","_Right_Index_Middle_Pos_","_Decal_","_Decal_Scale_XY_","_Decal_Front_Only_","_Rim_Intensity_","_Rim_Texture_","_Rim_Hue_Shift_","_Rim_Saturation_Shift_","_Rim_Value_Shift_","_Iridescence_Intensity_","_Iridescence_Texture_","Use_Global_Left_Index","Use_Global_Right_Index","Global_Left_Index_Tip_Position","Global_Right_Index_Tip_Position","Global_Left_Thumb_Tip_Position","Global_Right_Thumb_Tip_Position","Global_Left_Index_Middle_Position;","Global_Right_Index_Middle_Position","Global_Left_Index_Tip_Proximity","Global_Right_Index_Tip_Proximity"],d=["_Rim_Texture_","_Iridescence_Texture_"],_=[];(0,n.PrepareUniformsAndSamplersList)({uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:r,maxSimultaneousLights:4}),t.setEffect(a.getEngine().createEffect("mrdlSliderThumb",{attributes:c,uniformsNames:h,uniformBuffersNames:_,samplers:d,defines:u,fallbacks:l,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},s),r)}return!(!t.effect||!t.effect.isReady()||(r._renderId=a.getRenderId(),i._wasPreviouslyReady=!0,0))},t.prototype.bindForSubMesh=function(e,t,i){if(i.materialDefines){var r=i.effect;r&&(this._activeEffect=r,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),this._activeEffect.setVector3("cameraPosition",this.getScene().activeCamera.position),this._activeEffect.setFloat("_Radius_",this.radius),this._activeEffect.setFloat("_Bevel_Front_",this.bevelFront),this._activeEffect.setFloat("_Bevel_Front_Stretch_",this.bevelFrontStretch),this._activeEffect.setFloat("_Bevel_Back_",this.bevelBack),this._activeEffect.setFloat("_Bevel_Back_Stretch_",this.bevelBackStretch),this._activeEffect.setFloat("_Radius_Top_Left_",this.radiusTopLeft),this._activeEffect.setFloat("_Radius_Top_Right_",this.radiusTopRight),this._activeEffect.setFloat("_Radius_Bottom_Left_",this.radiusBottomLeft),this._activeEffect.setFloat("_Radius_Bottom_Right_",this.radiusBottomRight),this._activeEffect.setFloat("_Bulge_Enabled_",this.bulgeEnabled?1:0),this._activeEffect.setFloat("_Bulge_Height_",this.bulgeHeight),this._activeEffect.setFloat("_Bulge_Radius_",this.bulgeRadius),this._activeEffect.setFloat("_Sun_Intensity_",this.sunIntensity),this._activeEffect.setFloat("_Sun_Theta_",this.sunTheta),this._activeEffect.setFloat("_Sun_Phi_",this.sunPhi),this._activeEffect.setFloat("_Indirect_Diffuse_",this.indirectDiffuse),this._activeEffect.setDirectColor4("_Albedo_",this.albedo),this._activeEffect.setFloat("_Specular_",this.specular),this._activeEffect.setFloat("_Shininess_",this.shininess),this._activeEffect.setFloat("_Sharpness_",this.sharpness),this._activeEffect.setFloat("_Subsurface_",this.subsurface),this._activeEffect.setDirectColor4("_Left_Color_",this.leftGradientColor),this._activeEffect.setDirectColor4("_Right_Color_",this.rightGradientColor),this._activeEffect.setFloat("_Reflection_",this.reflection),this._activeEffect.setFloat("_Front_Reflect_",this.frontReflect),this._activeEffect.setFloat("_Edge_Reflect_",this.edgeReflect),this._activeEffect.setFloat("_Power_",this.power),this._activeEffect.setDirectColor4("_Sky_Color_",this.skyColor),this._activeEffect.setDirectColor4("_Horizon_Color_",this.horizonColor),this._activeEffect.setDirectColor4("_Ground_Color_",this.groundColor),this._activeEffect.setFloat("_Horizon_Power_",this.horizonPower),this._activeEffect.setTexture("_Reflection_Map_",this._reflectionMapTexture),this._activeEffect.setTexture("_Indirect_Environment_",this._indirectEnvTexture),this._activeEffect.setFloat("_Width_",this.width),this._activeEffect.setFloat("_Fuzz_",this.fuzz),this._activeEffect.setFloat("_Min_Fuzz_",this.minFuzz),this._activeEffect.setFloat("_Clip_Fade_",this.clipFade),this._activeEffect.setFloat("_Hue_Shift_",this.hueShift),this._activeEffect.setFloat("_Saturation_Shift_",this.saturationShift),this._activeEffect.setFloat("_Value_Shift_",this.valueShift),this._activeEffect.setVector3("_Blob_Position_",this.blobPosition),this._activeEffect.setFloat("_Blob_Intensity_",this.blobIntensity),this._activeEffect.setFloat("_Blob_Near_Size_",this.blobNearSize),this._activeEffect.setFloat("_Blob_Far_Size_",this.blobFarSize),this._activeEffect.setFloat("_Blob_Near_Distance_",this.blobNearDistance),this._activeEffect.setFloat("_Blob_Far_Distance_",this.blobFarDistance),this._activeEffect.setFloat("_Blob_Fade_Length_",this.blobFadeLength),this._activeEffect.setFloat("_Blob_Pulse_",this.blobPulse),this._activeEffect.setFloat("_Blob_Fade_",this.blobFade),this._activeEffect.setTexture("_Blob_Texture_",this.blobTexture),this._activeEffect.setVector3("_Blob_Position_2_",this.blobPosition2),this._activeEffect.setFloat("_Blob_Near_Size_2_",this.blobNearSize2),this._activeEffect.setFloat("_Blob_Pulse_2_",this.blobPulse2),this._activeEffect.setFloat("_Blob_Fade_2_",this.blobFade2),this._activeEffect.setVector3("_Left_Index_Pos_",this.leftIndexPosition),this._activeEffect.setVector3("_Right_Index_Pos_",this.rightIndexPosition),this._activeEffect.setVector3("_Left_Index_Middle_Pos_",this.leftIndexMiddlePosition),this._activeEffect.setVector3("_Right_Index_Middle_Pos_",this.rightIndexMiddlePosition),this._activeEffect.setTexture("_Decal_",this._decalTexture),this._activeEffect.setVector2("_Decal_Scale_XY_",this.decalScaleXY),this._activeEffect.setFloat("_Decal_Front_Only_",this.decalFrontOnly?1:0),this._activeEffect.setFloat("_Rim_Intensity_",this.rimIntensity),this._activeEffect.setTexture("_Rim_Texture_",this._blueGradientTexture),this._activeEffect.setFloat("_Rim_Hue_Shift_",this.rimHueShift),this._activeEffect.setFloat("_Rim_Saturation_Shift_",this.rimSaturationShift),this._activeEffect.setFloat("_Rim_Value_Shift_",this.rimValueShift),this._activeEffect.setFloat("_Iridescence_Intensity_",this.iridescenceIntensity),this._activeEffect.setTexture("_Iridescence_Texture_",this._blueGradientTexture),this._activeEffect.setFloat("Use_Global_Left_Index",this.useGlobalLeftIndex),this._activeEffect.setFloat("Use_Global_Right_Index",this.useGlobalRightIndex),this._activeEffect.setVector4("Global_Left_Index_Tip_Position",this.globalLeftIndexTipPosition),this._activeEffect.setVector4("Global_Right_Index_Tip_Position",this.globaRightIndexTipPosition),this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position",this.globalLeftThumbTipPosition),this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position",this.globalRightThumbTipPosition),this._activeEffect.setVector4("Global_Left_Index_Middle_Position",this.globalLeftIndexMiddlePosition),this._activeEffect.setVector4("Global_Right_Index_Middle_Position",this.globalRightIndexMiddlePosition),this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity",this.globalLeftIndexTipProximity),this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity",this.globalRightIndexTipProximity),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){return[]},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),this._reflectionMapTexture.dispose(),this._indirectEnvTexture.dispose(),this._blueGradientTexture.dispose(),this._decalTexture.dispose()},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.MRDLSliderThumbMaterial",t},t.prototype.getClassName=function(){return"MRDLSliderThumbMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},t.BLUE_GRADIENT_TEXTURE_URL="https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png",(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radius",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bevelFront",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bevelFrontStretch",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bevelBack",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bevelBackStretch",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radiusTopLeft",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radiusTopRight",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radiusBottomLeft",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"radiusBottomRight",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bulgeEnabled",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bulgeHeight",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bulgeRadius",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sunIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sunTheta",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sunPhi",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"indirectDiffuse",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"albedo",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"specular",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"shininess",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"sharpness",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"subsurface",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"leftGradientColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rightGradientColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"reflection",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"frontReflect",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"edgeReflect",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"power",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"skyColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"horizonColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"groundColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"horizonPower",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"width",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"fuzz",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"minFuzz",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"clipFade",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"hueShift",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"saturationShift",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"valueShift",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPosition",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobNearSize",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFarSize",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobNearDistance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFarDistance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFadeLength",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPulse",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFade",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPosition2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobNearSize2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobPulse2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobFade2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"blobTexture",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"leftIndexPosition",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rightIndexPosition",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"leftIndexMiddlePosition",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rightIndexMiddlePosition",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"decalScaleXY",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"decalFrontOnly",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rimIntensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rimHueShift",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rimSaturationShift",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rimValueShift",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"iridescenceIntensity",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.GUI.MRDLSliderThumbMaterial",a)},"../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlBackglow.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{mrdlBackglowPixelShader:()=>o});var r="mrdlBackglowPixelShader",n="uniform vec3 cameraPosition;varying vec3 vNormal;varying vec2 vUV;uniform float _Bevel_Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Tuning_Motion_;uniform float _Motion_;uniform float _Max_Intensity_;uniform float _Intensity_Fade_In_Exponent_;uniform float _Outer_Fuzz_Start_;uniform float _Outer_Fuzz_End_;uniform vec4 _Color_;uniform vec4 _Inner_Color_;uniform float _Blend_Exponent_;uniform float _Falloff_;uniform float _Bias_;float BiasFunc(float b,float v) {return pow(v,log(clamp(b,0.001,0.999))/log(0.5));}\nvoid Fuzzy_Round_Rect_B33(\nfloat Size_X,\nfloat Size_Y,\nfloat Radius_X,\nfloat Radius_Y,\nfloat Line_Width,\nvec2 UV,\nfloat Outer_Fuzz,\nfloat Max_Outer_Fuzz,\nout float Rect_Distance,\nout float Inner_Distance)\n{vec2 halfSize=vec2(Size_X,Size_Y)*0.5;vec2 r=max(min(vec2(Radius_X,Radius_Y),halfSize),vec2(0.001,0.001));float radius=min(r.x,r.y)-Max_Outer_Fuzz;vec2 v=abs(UV);vec2 nearestp=min(v,halfSize-r);float d=distance(nearestp,v);Inner_Distance=clamp(1.0-(radius-d)/Line_Width,0.0,1.0);Rect_Distance=clamp(1.0-(d-radius)/Outer_Fuzz,0.0,1.0)*Inner_Distance;}\nvoid main()\n{float X_Q42;float Y_Q42;X_Q42=vNormal.x;Y_Q42=vNormal.y;float MaxAB_Q24=max(_Tuning_Motion_,_Motion_);float Sqrt_F_Q27=sqrt(MaxAB_Q24);float Power_Q43=pow(MaxAB_Q24,_Intensity_Fade_In_Exponent_);float Value_At_T_Q26=mix(_Outer_Fuzz_Start_,_Outer_Fuzz_End_,Sqrt_F_Q27);float Product_Q23=_Max_Intensity_*Power_Q43;float Rect_Distance_Q33;float Inner_Distance_Q33;Fuzzy_Round_Rect_B33(X_Q42,Y_Q42,_Bevel_Radius_,_Bevel_Radius_,_Line_Width_,vUV,Value_At_T_Q26,_Outer_Fuzz_Start_,Rect_Distance_Q33,Inner_Distance_Q33);float Power_Q44=pow(Inner_Distance_Q33,_Blend_Exponent_);float Result_Q45=pow(BiasFunc(_Bias_,Rect_Distance_Q33),_Falloff_);vec4 Color_At_T_Q25=mix(_Inner_Color_,_Color_,Power_Q44);float Product_Q22=Result_Q45*Product_Q23;vec4 Result_Q28=Product_Q22*Color_At_T_Q25;vec4 Out_Color=Result_Q28;float Clip_Threshold=0.0;gl_FragColor=Out_Color;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlBackglow.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{mrdlBackglowVertexShader:()=>o});var r="mrdlBackglowVertexShader",n="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;uniform float _Bevel_Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Tuning_Motion_;uniform float _Motion_;uniform float _Max_Intensity_;uniform float _Intensity_Fade_In_Exponent_;uniform float _Outer_Fuzz_Start_;uniform float _Outer_Fuzz_End_;uniform vec4 _Color_;uniform vec4 _Inner_Color_;uniform float _Blend_Exponent_;uniform float _Falloff_;uniform float _Bias_;varying vec3 vNormal;varying vec2 vUV;void main()\n{vec3 Dir_World_Q41=(world*vec4(tangent,0.0)).xyz;vec3 Dir_World_Q40=(world*vec4((cross(normal,tangent)),0.0)).xyz;float MaxAB_Q24=max(_Tuning_Motion_,_Motion_);float Length_Q16=length(Dir_World_Q41);float Length_Q17=length(Dir_World_Q40);bool Greater_Than_Q37=MaxAB_Q24>0.0;vec3 Sizes_Q35;vec2 XY_Q35;Sizes_Q35=(_Absolute_Sizes_ ? vec3(Length_Q16,Length_Q17,0) : vec3(Length_Q16/Length_Q17,1,0));XY_Q35=(uv-vec2(0.5,0.5))*Sizes_Q35.xy;vec3 Result_Q38=Greater_Than_Q37 ? position : vec3(0,0,0);vec3 Pos_World_Q39=(world*vec4(Result_Q38,1.0)).xyz;vec3 Position=Pos_World_Q39;vec3 Normal=Sizes_Q35;vec2 UV=XY_Q35;vec3 Tangent=vec3(0,0,0);vec3 Binormal=vec3(0,0,0);vec4 Color=vec4(1,1,1,1);gl_Position=viewProjection*vec4(Position,1);vNormal=Normal;vUV=UV;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlBackplate.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{mrdlBackplatePixelShader:()=>o});var r="mrdlBackplatePixelShader",n="uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vExtra1;varying vec4 vExtra2;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform vec4 _Iridescence_Tint_;uniform sampler2D _Iridescent_Map_;uniform float _Angle_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform vec4 _Gradient_Color_;uniform vec4 _Top_Left_;uniform vec4 _Top_Right_;uniform vec4 _Bottom_Left_;uniform vec4 _Bottom_Right_;uniform float _Edge_Width_;uniform float _Edge_Power_;uniform float _Line_Gradient_Blend_;uniform float _Fade_Out_;void FastLinearTosRGB_B353(\nvec4 Linear,\nout vec4 sRGB)\n{sRGB.rgb=sqrt(clamp(Linear.rgb,0.0,1.0));sRGB.a=Linear.a;}\nvoid Round_Rect_Fragment_B332(\nfloat Radius,\nfloat Line_Width,\nvec4 Line_Color,\nfloat Filter_Width,\nvec2 UV,\nfloat Line_Visibility,\nvec4 Rect_Parms,\nvec4 Fill_Color,\nout vec4 Color)\n{float d=length(max(abs(UV)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);float g=min(Rect_Parms.z,Rect_Parms.w);float dgrad=max(fwidth(g)*Filter_Width,0.00001);float Inside_Rect=clamp(g/dgrad,0.0,1.0);float inner=clamp((d+dx*0.5-max(Radius-Line_Width,d-dx*0.5))/dx,0.0,1.0);Color=clamp(mix(Fill_Color,Line_Color,inner),0.0,1.0)*Inside_Rect;}\nvoid Iridescence_B343(\nvec3 Position,\nvec3 Normal,\nvec2 UV,\nvec3 Axis,\nvec3 Eye,\nvec4 Tint,\nsampler2D Texture,\nbool Reflected,\nfloat Frequency,\nfloat Vertical_Offset,\nout vec4 Color)\n{vec3 i=normalize(Position-Eye);vec3 r=reflect(i,Normal);float idota=dot(i,Axis);float idotr=dot(i,r);float x=Reflected ? idotr : idota;vec2 xy;xy.x=fract((x*Frequency+1.0)*0.5+UV.y*Vertical_Offset);xy.y=0.5;Color=texture(Texture,xy);Color.rgb*=Tint.rgb;}\nvoid Scale_RGB_B346(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}\nvoid Scale_RGB_B344(\nfloat Scalar,\nvec4 Color,\nout vec4 Result)\n{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}\nvoid Line_Fragment_B362(\nvec4 Base_Color,\nvec4 Highlight_Color,\nfloat Highlight_Width,\nvec3 Line_Vertex,\nfloat Highlight,\nout vec4 Line_Color)\n{float k2=1.0-clamp(abs(Line_Vertex.y/Highlight_Width),0.0,1.0);Line_Color=mix(Base_Color,Highlight_Color,Highlight*k2);}\nvoid Edge_B356(\nvec4 RectParms,\nfloat Radius,\nfloat Line_Width,\nvec2 UV,\nfloat Edge_Width,\nfloat Edge_Power,\nout float Result)\n{float d=length(max(abs(UV)-RectParms.xy,0.0));float edge=1.0-clamp((1.0-d/(Radius-Line_Width))/Edge_Width,0.0,1.0);Result=pow(edge,Edge_Power);}\nvoid Gradient_B355(\nvec4 Gradient_Color,\nvec4 Top_Left,\nvec4 Top_Right,\nvec4 Bottom_Left,\nvec4 Bottom_Right,\nvec2 UV,\nout vec4 Result)\n{vec3 top=Top_Left.rgb+(Top_Right.rgb-Top_Left.rgb)*UV.x;vec3 bottom=Bottom_Left.rgb+(Bottom_Right.rgb-Bottom_Left.rgb)*UV.x;Result.rgb=Gradient_Color.rgb*(bottom+(top-bottom)*UV.y);Result.a=1.0;}\nvoid main()\n{float X_Q338;float Y_Q338;float Z_Q338;float W_Q338;X_Q338=vExtra2.x;Y_Q338=vExtra2.y;Z_Q338=vExtra2.z;W_Q338=vExtra2.w;vec4 Color_Q343;\n#if IRIDESCENCE_ENABLE\nIridescence_B343(vPosition,vNormal,vUV,vBinormal,cameraPosition,_Iridescence_Tint_,_Iridescent_Map_,_Reflected_,_Frequency_,_Vertical_Offset_,Color_Q343);\n#else\nColor_Q343=vec4(0,0,0,0);\n#endif\nvec4 Result_Q344;Scale_RGB_B344(_Iridescence_Intensity_,Color_Q343,Result_Q344);vec4 Line_Color_Q362;Line_Fragment_B362(_Line_Color_,_Highlight_Color_,_Highlight_Width_,vTangent,_Highlight_,Line_Color_Q362);float Result_Q356;\n#if EDGE_ONLY\nEdge_B356(vExtra1,Z_Q338,W_Q338,vUV,_Edge_Width_,_Edge_Power_,Result_Q356);\n#else\nResult_Q356=1.0;\n#endif\nvec2 Vec2_Q339=vec2(X_Q338,Y_Q338);vec4 Result_Q355;Gradient_B355(_Gradient_Color_,_Top_Left_,_Top_Right_,_Bottom_Left_,_Bottom_Right_,Vec2_Q339,Result_Q355);vec4 Linear_Q348;Linear_Q348.rgb=clamp(Result_Q355.rgb*Result_Q355.rgb,0.0,1.0);Linear_Q348.a=Result_Q355.a;vec4 Result_Q346;Scale_RGB_B346(Linear_Q348,Result_Q356,Result_Q346);vec4 Sum_Q345=Result_Q346+Result_Q344;vec4 Color_At_T_Q347=mix(Line_Color_Q362,Result_Q346,_Line_Gradient_Blend_);vec4 Base_And_Iridescent_Q350;Base_And_Iridescent_Q350=_Base_Color_+vec4(Sum_Q345.rgb,0.0);vec4 Sum_Q349=Color_At_T_Q347+_Iridescence_Edge_Intensity_*Color_Q343;vec4 Result_Q351=Sum_Q349; Result_Q351.a=1.0;vec4 Color_Q332;Round_Rect_Fragment_B332(Z_Q338,W_Q338,Result_Q351,_Filter_Width_,vUV,1.0,vExtra1,Base_And_Iridescent_Q350,Color_Q332);vec4 Result_Q354=_Fade_Out_*Color_Q332;vec4 sRGB_Q353;FastLinearTosRGB_B353(Result_Q354,sRGB_Q353);vec4 Out_Color=sRGB_Q353;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlBackplate.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{mrdlBackplateVertexShader:()=>o});var r="mrdlBackplateVertexShader",n="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec3 tangent;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform vec4 _Iridescence_Tint_;uniform sampler2D _Iridescent_Map_;uniform float _Angle_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform vec4 _Gradient_Color_;uniform vec4 _Top_Left_;uniform vec4 _Top_Right_;uniform vec4 _Bottom_Left_;uniform vec4 _Bottom_Right_;uniform float _Edge_Width_;uniform float _Edge_Power_;uniform float _Line_Gradient_Blend_;uniform float _Fade_Out_;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vExtra1;varying vec4 vExtra2;void Object_To_World_Pos_B314(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}\nvoid Round_Rect_Vertex_B357(\nvec2 UV,\nfloat Radius,\nfloat Margin,\nfloat Anisotropy,\nfloat Gradient1,\nfloat Gradient2,\nvec3 Normal,\nvec4 Color_Scale_Translate,\nout vec2 Rect_UV,\nout vec4 Rect_Parms,\nout vec2 Scale_XY,\nout vec2 Line_UV,\nout vec2 Color_UV_Info)\n{Scale_XY=vec2(Anisotropy,1.0);Line_UV=(UV-vec2(0.5,0.5));Rect_UV=Line_UV*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius)-vec2(Margin,Margin);Rect_Parms.z=Gradient1; \nRect_Parms.w=Gradient2;Color_UV_Info=(Line_UV+vec2(0.5,0.5))*Color_Scale_Translate.xy+Color_Scale_Translate.zw;}\nvoid Line_Vertex_B333(\nvec2 Scale_XY,\nvec2 UV,\nfloat Time,\nfloat Rate,\nvec4 Highlight_Transform,\nout vec3 Line_Vertex)\n{float angle2=(Rate*Time)*2.0*3.1416;float sinAngle2=sin(angle2);float cosAngle2=cos(angle2);vec2 xformUV=UV*Highlight_Transform.xy+Highlight_Transform.zw;Line_Vertex.x=0.0;Line_Vertex.y=cosAngle2*xformUV.x-sinAngle2*xformUV.y;Line_Vertex.z=0.0; }\nvoid PickDir_B334(\nfloat Degrees,\nvec3 DirX,\nvec3 DirY,\nout vec3 Dir)\n{float a=Degrees*3.14159/180.0;Dir=cos(a)*DirX+sin(a)*DirY;}\nvoid Move_Verts_B327(\nfloat Anisotropy,\nvec3 P,\nfloat Radius,\nout vec3 New_P,\nout vec2 New_UV,\nout float Radial_Gradient,\nout vec3 Radial_Dir)\n{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);New_UV=center+r2*(UV-2.0*center+0.5);New_P=vec3(New_UV-0.5,P.z);Radial_Gradient=1.0-length(delta)*2.0;Radial_Dir=vec3(delta*r2,0.0);}\nvoid Pick_Radius_B336(\nfloat Radius,\nfloat Radius_Top_Left,\nfloat Radius_Top_Right,\nfloat Radius_Bottom_Left,\nfloat Radius_Bottom_Right,\nvec3 Position,\nout float Result)\n{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}\nvoid Edge_AA_Vertex_B328(\nvec3 Position_World,\nvec3 Position_Object,\nvec3 Normal_Object,\nvec3 Eye,\nfloat Radial_Gradient,\nvec3 Radial_Dir,\nvec3 Tangent,\nout float Gradient1,\nout float Gradient2)\n{vec3 I=(Eye-Position_World);vec3 T=(vec4(Tangent,0.0)).xyz;float g=(dot(T,I)<0.0) ? 0.0 : 1.0;if (Normal_Object.z==0.0) { \nGradient1=Position_Object.z>0.0 ? g : 1.0;Gradient2=Position_Object.z>0.0 ? 1.0 : g;} else {Gradient1=g+(1.0-g)*(Radial_Gradient);Gradient2=1.0;}}\nvoid Object_To_World_Dir_B330(\nvec3 Dir_Object,\nout vec3 Binormal_World,\nout vec3 Binormal_World_N,\nout float Binormal_Length)\n{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;}\nvoid RelativeOrAbsoluteDetail_B341(\nfloat Nominal_Radius,\nfloat Nominal_LineWidth,\nbool Absolute_Measurements,\nfloat Height,\nout float Radius,\nout float Line_Width)\n{float scale=Absolute_Measurements ? 1.0/Height : 1.0;Radius=Nominal_Radius*scale;Line_Width=Nominal_LineWidth*scale;}\nvoid main()\n{vec3 Nrm_World_Q326;Nrm_World_Q326=normalize((world*vec4(normal,0.0)).xyz);vec3 Tangent_World_Q329;vec3 Tangent_World_N_Q329;float Tangent_Length_Q329;Tangent_World_Q329=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q329=length(Tangent_World_Q329);Tangent_World_N_Q329=Tangent_World_Q329/Tangent_Length_Q329;vec3 Binormal_World_Q330;vec3 Binormal_World_N_Q330;float Binormal_Length_Q330;Object_To_World_Dir_B330(vec3(0,1,0),Binormal_World_Q330,Binormal_World_N_Q330,Binormal_Length_Q330);float Radius_Q341;float Line_Width_Q341;RelativeOrAbsoluteDetail_B341(_Radius_,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q330,Radius_Q341,Line_Width_Q341);vec3 Dir_Q334;PickDir_B334(_Angle_,Tangent_World_N_Q329,Binormal_World_N_Q330,Dir_Q334);float Result_Q336;Pick_Radius_B336(Radius_Q341,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q336);float Anisotropy_Q331=Tangent_Length_Q329/Binormal_Length_Q330;vec4 Out_Color_Q337=vec4(Result_Q336,Line_Width_Q341,0,1);vec3 New_P_Q327;vec2 New_UV_Q327;float Radial_Gradient_Q327;vec3 Radial_Dir_Q327;Move_Verts_B327(Anisotropy_Q331,position,Result_Q336,New_P_Q327,New_UV_Q327,Radial_Gradient_Q327,Radial_Dir_Q327);vec3 Pos_World_Q314;Object_To_World_Pos_B314(New_P_Q327,Pos_World_Q314);float Gradient1_Q328;float Gradient2_Q328;\n#if SMOOTH_EDGES\nEdge_AA_Vertex_B328(Pos_World_Q314,position,normal,cameraPosition,Radial_Gradient_Q327,Radial_Dir_Q327,tangent,Gradient1_Q328,Gradient2_Q328);\n#else\nGradient1_Q328=1.0;Gradient2_Q328=1.0;\n#endif\nvec2 Rect_UV_Q357;vec4 Rect_Parms_Q357;vec2 Scale_XY_Q357;vec2 Line_UV_Q357;vec2 Color_UV_Info_Q357;Round_Rect_Vertex_B357(New_UV_Q327,Result_Q336,0.0,Anisotropy_Q331,Gradient1_Q328,Gradient2_Q328,normal,vec4(1,1,0,0),Rect_UV_Q357,Rect_Parms_Q357,Scale_XY_Q357,Line_UV_Q357,Color_UV_Info_Q357);vec3 Line_Vertex_Q333;Line_Vertex_B333(Scale_XY_Q357,Line_UV_Q357,(20.0),_Rate_,_Highlight_Transform_,Line_Vertex_Q333);float X_Q359;float Y_Q359;X_Q359=Color_UV_Info_Q357.x;Y_Q359=Color_UV_Info_Q357.y;vec4 Vec4_Q358=vec4(X_Q359,Y_Q359,Result_Q336,Line_Width_Q341);vec3 Position=Pos_World_Q314;vec3 Normal=Nrm_World_Q326;vec2 UV=Rect_UV_Q357;vec3 Tangent=Line_Vertex_Q333;vec3 Binormal=Dir_Q334;vec4 Color=Out_Color_Q337;vec4 Extra1=Rect_Parms_Q357;vec4 Extra2=Vec4_Q358;vec4 Extra3=vec4(0,0,0,0);gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vExtra1=Extra1;vExtra2=Extra2;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlFrontplate.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{mrdlFrontplatePixelShader:()=>o});var r="mrdlFrontplatePixelShader",n="uniform vec3 cameraPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Relative_To_Height_;uniform float _Filter_Width_;uniform vec4 _Edge_Color_;uniform float _Fade_Out_;uniform bool _Smooth_Edges_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform float _Blob_Pulse_Max_Size_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Gaze_Intensity_;uniform float _Gaze_Focus_;uniform sampler2D _Blob_Texture_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;void Scale_Color_B54(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{Result=Scalar*Color;}\nvoid Scale_RGB_B50(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}\nvoid Proximity_Fragment_B51(\nfloat Proximity_Max_Intensity,\nfloat Proximity_Near_Radius,\nvec4 Deltas,\nfloat Show_Selection,\nfloat Distance_Fade1,\nfloat Distance_Fade2,\nfloat Strength,\nout float Proximity)\n{float proximity1=(1.0-clamp(length(Deltas.xy)/Proximity_Near_Radius,0.0,1.0))*Distance_Fade1;float proximity2=(1.0-clamp(length(Deltas.zw)/Proximity_Near_Radius,0.0,1.0))*Distance_Fade2;Proximity=Strength*(Proximity_Max_Intensity*max(proximity1,proximity2) *(1.0-Show_Selection)+Show_Selection);}\nvoid Blob_Fragment_B56(\nvec2 UV,\nvec3 Blob_Info,\nsampler2D Blob_Texture,\nout vec4 Blob_Color)\n{float k=dot(UV,UV);Blob_Color=Blob_Info.y*texture(Blob_Texture,vec2(vec2(sqrt(k),Blob_Info.x).x,1.0-vec2(sqrt(k),Blob_Info.x).y))*(1.0-clamp(k,0.0,1.0));}\nvoid Round_Rect_Fragment_B61(\nfloat Radius,\nvec4 Line_Color,\nfloat Filter_Width,\nfloat Line_Visibility,\nvec4 Fill_Color,\nbool Smooth_Edges,\nvec4 Rect_Parms,\nout float Inside_Rect)\n{float d=length(max(abs(Rect_Parms.zw)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);Inside_Rect=Smooth_Edges ? clamp((Radius-d)/dx,0.0,1.0) : 1.0-step(Radius,d);}\nvoid main()\n{float Is_Quad_Q53;Is_Quad_Q53=vNormal.z;vec4 Blob_Color_Q56;Blob_Fragment_B56(vUV,vTangent,_Blob_Texture_,Blob_Color_Q56);float X_Q52;float Y_Q52;float Z_Q52;float W_Q52;X_Q52=vExtra3.x;Y_Q52=vExtra3.y;Z_Q52=vExtra3.z;W_Q52=vExtra3.w;float Proximity_Q51;Proximity_Fragment_B51(_Proximity_Max_Intensity_,_Proximity_Near_Radius_,vExtra2,X_Q52,Y_Q52,Z_Q52,1.0,Proximity_Q51);float Inside_Rect_Q61;Round_Rect_Fragment_B61(W_Q52,vec4(1,1,1,1),_Filter_Width_,1.0,vec4(0,0,0,0),_Smooth_Edges_,vExtra1,Inside_Rect_Q61);vec4 Result_Q50;Scale_RGB_B50(_Edge_Color_,Proximity_Q51,Result_Q50);vec4 Result_Q47=Inside_Rect_Q61*Blob_Color_Q56;vec4 Color_At_T_Q48=mix(Result_Q50,Result_Q47,Is_Quad_Q53);vec4 Result_Q54;Scale_Color_B54(Color_At_T_Q48,_Fade_Out_,Result_Q54);vec4 Out_Color=Result_Q54;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlFrontplate.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{mrdlFrontplateVertexShader:()=>o});var r="mrdlFrontplateVertexShader",n="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Relative_To_Height_;uniform float _Filter_Width_;uniform vec4 _Edge_Color_;uniform float _Fade_Out_;uniform bool _Smooth_Edges_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform float _Blob_Pulse_Max_Size_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Gaze_Intensity_;uniform float _Gaze_Focus_;uniform sampler2D _Blob_Texture_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Blob_Vertex_B40(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nvec4 Vx_Color,\nvec2 UV,\nvec3 Face_Center,\nvec2 Face_Size,\nvec2 In_UV,\nfloat Blob_Fade_Length,\nfloat Selection_Fade,\nfloat Selection_Fade_Size,\nfloat Inner_Fade,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nfloat Blob_Enabled,\nfloat DistanceOffset,\nout vec3 Out_Position,\nout vec2 Out_UV,\nout vec3 Blob_Info,\nout vec2 Blob_Relative_UV)\n{float blobSize,fadeIn;vec3 Hit_Position;Blob_Info=vec3(0.0,0.0,0.0);float Hit_Distance=dot(Blob_Position-Face_Center,Normal)+DistanceOffset*Blob_Far_Distance;Hit_Position=Blob_Position-Hit_Distance*Normal;float absD=abs(Hit_Distance);float lerpVal=clamp((absD-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);fadeIn=1.0-clamp((absD-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float innerFade=1.0-clamp(-Hit_Distance/Inner_Fade,0.0,1.0);float farClip=clamp(1.0-step(Blob_Far_Distance+Blob_Fade_Length,absD),0.0,1.0);float size=mix(Blob_Near_Size,Blob_Far_Size,lerpVal)*farClip;blobSize=mix(size,Selection_Fade_Size,Selection_Fade)*innerFade*Blob_Enabled;Blob_Info.x=lerpVal*0.5+0.5;Blob_Info.y=fadeIn*Intensity*(1.0-Selection_Fade)*Blob_Fade;Blob_Info.x*=(1.0-Blob_Pulse);vec3 delta=Hit_Position-Face_Center;vec2 blobCenterXY=vec2(dot(delta,Tangent),dot(delta,Bitangent));vec2 quadUVin=2.0*UV-1.0; \nvec2 blobXY=blobCenterXY+quadUVin*blobSize;vec2 blobClipped=clamp(blobXY,-Face_Size*0.5,Face_Size*0.5);vec2 blobUV=(blobClipped-blobCenterXY)/max(blobSize,0.0001)*2.0;vec3 blobCorner=Face_Center+blobClipped.x*Tangent+blobClipped.y*Bitangent;Out_Position=mix(Position,blobCorner,Vx_Color.rrr);Out_UV=mix(In_UV,blobUV,Vx_Color.rr);Blob_Relative_UV=blobClipped/Face_Size.y;}\nvoid Round_Rect_Vertex_B36(\nvec2 UV,\nvec3 Tangent,\nvec3 Binormal,\nfloat Radius,\nfloat Anisotropy,\nvec2 Blob_Center_UV,\nout vec2 Rect_UV,\nout vec2 Scale_XY,\nout vec4 Rect_Parms)\n{Scale_XY=vec2(Anisotropy,1.0);Rect_UV=(UV-vec2(0.5,0.5))*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius);Rect_Parms.zw=Blob_Center_UV;}\nvec2 ProjectProximity(\nvec3 blobPosition,\nvec3 position,\nvec3 center,\nvec3 dir,\nvec3 xdir,\nvec3 ydir,\nout float vdistance\n)\n{vec3 delta=blobPosition-position;vec2 xy=vec2(dot(delta,xdir),dot(delta,ydir));vdistance=abs(dot(delta,dir));return xy;}\nvoid Proximity_Vertex_B33(\nvec3 Blob_Position,\nvec3 Blob_Position_2,\nvec3 Face_Center,\nvec3 Position,\nfloat Proximity_Far_Distance,\nfloat Relative_Scale,\nfloat Proximity_Anisotropy,\nvec3 Normal,\nvec3 Tangent,\nvec3 Binormal,\nout vec4 Extra,\nout float Distance_To_Face,\nout float Distance_Fade1,\nout float Distance_Fade2)\n{float distz1,distz2;Extra.xy=ProjectProximity(Blob_Position,Position,Face_Center,Normal,Tangent*Proximity_Anisotropy,Binormal,distz1)/Relative_Scale;Extra.zw=ProjectProximity(Blob_Position_2,Position,Face_Center,Normal,Tangent*Proximity_Anisotropy,Binormal,distz2)/Relative_Scale;Distance_To_Face=dot(Normal,Position-Face_Center);Distance_Fade1=1.0-clamp(distz1/Proximity_Far_Distance,0.0,1.0);Distance_Fade2=1.0-clamp(distz2/Proximity_Far_Distance,0.0,1.0);}\nvoid Object_To_World_Pos_B12(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}\nvoid Choose_Blob_B27(\nvec4 Vx_Color,\nvec3 Position1,\nvec3 Position2,\nbool Blob_Enable_1,\nbool Blob_Enable_2,\nfloat Near_Size_1,\nfloat Near_Size_2,\nfloat Blob_Inner_Fade_1,\nfloat Blob_Inner_Fade_2,\nfloat Blob_Pulse_1,\nfloat Blob_Pulse_2,\nfloat Blob_Fade_1,\nfloat Blob_Fade_2,\nout vec3 Position,\nout float Near_Size,\nout float Inner_Fade,\nout float Blob_Enable,\nout float Fade,\nout float Pulse)\n{Position=Position1*(1.0-Vx_Color.g)+Vx_Color.g*Position2;float b1=Blob_Enable_1 ? 1.0 : 0.0;float b2=Blob_Enable_2 ? 1.0 : 0.0;Blob_Enable=b1+(b2-b1)*Vx_Color.g;Pulse=Blob_Pulse_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Pulse_2;Fade=Blob_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Fade_2;Near_Size=Near_Size_1*(1.0-Vx_Color.g)+Vx_Color.g*Near_Size_2;Inner_Fade=Blob_Inner_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Inner_Fade_2;}\nvoid Move_Verts_B32(\nvec2 UV,\nfloat Radius,\nfloat Anisotropy,\nfloat Line_Width,\nfloat Visible,\nout vec3 New_P,\nout vec2 New_UV)\n{vec2 xy=2.0*UV-vec2(0.5,0.5);vec2 center=clamp(xy,0.0,1.0);vec2 delta=2.0*(xy-center);float deltaLength=length(delta);vec2 aniso=vec2(1.0/Anisotropy,1.0);center=(center-vec2(0.5,0.5))*(1.0-2.0*Radius*aniso);New_UV=vec2((2.0-2.0*deltaLength)*Visible,0.0);float deltaRadius= (Radius-Line_Width*New_UV.x);New_P.xy=(center+deltaRadius/deltaLength *aniso*delta);New_P.z=0.0;}\nvoid Object_To_World_Dir_B14(\nvec3 Dir_Object,\nout vec3 Binormal_World)\n{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;}\nvoid Proximity_Visibility_B55(\nfloat Selection,\nvec3 Proximity_Center,\nvec3 Proximity_Center_2,\nfloat Proximity_Far_Distance,\nfloat Proximity_Radius,\nvec3 Face_Center,\nvec3 Normal,\nvec2 Face_Size,\nfloat Gaze,\nout float Width)\n{float boxMaxSize=length(Face_Size)*0.5;float d1=dot(Proximity_Center-Face_Center,Normal);vec3 blob1=Proximity_Center-d1*Normal;float d2=dot(Proximity_Center_2-Face_Center,Normal);vec3 blob2=Proximity_Center_2-d2*Normal;vec3 delta1=blob1-Face_Center;vec3 delta2=blob2-Face_Center;float dist1=dot(delta1,delta1);float dist2=dot(delta2,delta2);float nearestProxDist=sqrt(min(dist1,dist2));Width=(1.0-step(boxMaxSize+Proximity_Radius,nearestProxDist))*(1.0-step(Proximity_Far_Distance,min(d1,d2))*(1.0-step(0.0001,Selection)));Width=max(Gaze,Width);}\nvec2 ramp2(vec2 start,vec2 end,vec2 x)\n{return clamp((x-start)/(end-start),vec2(0.0,0.0),vec2(1.0,1.0));}\nfloat computeSelection(\nvec3 blobPosition,\nvec3 normal,\nvec3 tangent,\nvec3 bitangent,\nvec3 faceCenter,\nvec2 faceSize,\nfloat selectionFuzz,\nfloat farDistance,\nfloat fadeLength\n)\n{vec3 delta=blobPosition-faceCenter;float absD=abs(dot(delta,normal));float fadeIn=1.0-clamp((absD-farDistance)/fadeLength,0.0,1.0);vec2 blobCenterXY=vec2(dot(delta,tangent),dot(delta,bitangent));vec2 innerFace=faceSize*(1.0-selectionFuzz)*0.5;vec2 selectPulse=ramp2(-faceSize*0.5,-innerFace,blobCenterXY)-ramp2(innerFace,faceSize*0.5,blobCenterXY);return selectPulse.x*selectPulse.y*fadeIn;}\nvoid Selection_Vertex_B31(\nvec3 Blob_Position,\nvec3 Blob_Position_2,\nvec3 Face_Center,\nvec2 Face_Size,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nfloat Selection_Fuzz,\nfloat Selected,\nfloat Far_Distance,\nfloat Fade_Length,\nvec3 Active_Face_Dir,\nout float Show_Selection)\n{float select1=computeSelection(Blob_Position,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float select2=computeSelection(Blob_Position_2,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);Show_Selection=mix(max(select1,select2),1.0,Selected);}\nvoid main()\n{vec3 Vec3_Q29=vec3(vec2(0,0).x,vec2(0,0).y,color.r);vec3 Nrm_World_Q24;Nrm_World_Q24=normalize((world*vec4(normal,0.0)).xyz);vec3 Face_Center_Q30;Face_Center_Q30=(world*vec4(vec3(0,0,0),1.0)).xyz;vec3 Tangent_World_Q13;Tangent_World_Q13=(world*vec4(tangent,0.0)).xyz;vec3 Result_Q42;Result_Q42=_Use_Global_Left_Index_ ? Global_Left_Index_Tip_Position.xyz : _Blob_Position_;vec3 Result_Q43;Result_Q43=_Use_Global_Right_Index_ ? Global_Right_Index_Tip_Position.xyz : _Blob_Position_2_;float Value_At_T_Q58=mix(_Blob_Near_Size_,_Blob_Pulse_Max_Size_,_Blob_Pulse_);float Value_At_T_Q59=mix(_Blob_Near_Size_2_,_Blob_Pulse_Max_Size_,_Blob_Pulse_2_);vec3 Cross_Q70=cross(normal,tangent);float Product_Q45=_Gaze_Intensity_*_Gaze_Focus_;float Step_Q46=step(0.0001,Product_Q45);vec3 Tangent_World_N_Q15=normalize(Tangent_World_Q13);vec3 Position_Q27;float Near_Size_Q27;float Inner_Fade_Q27;float Blob_Enable_Q27;float Fade_Q27;float Pulse_Q27;Choose_Blob_B27(color,Result_Q42,Result_Q43,_Blob_Enable_,_Blob_Enable_2_,Value_At_T_Q58,Value_At_T_Q59,_Blob_Inner_Fade_,_Blob_Inner_Fade_2_,_Blob_Pulse_,_Blob_Pulse_2_,_Blob_Fade_,_Blob_Fade_2_,Position_Q27,Near_Size_Q27,Inner_Fade_Q27,Blob_Enable_Q27,Fade_Q27,Pulse_Q27);vec3 Binormal_World_Q14;Object_To_World_Dir_B14(Cross_Q70,Binormal_World_Q14);float Anisotropy_Q21=length(Tangent_World_Q13)/length(Binormal_World_Q14);vec3 Binormal_World_N_Q16=normalize(Binormal_World_Q14);vec2 Face_Size_Q35;float ScaleY_Q35;Face_Size_Q35=vec2(length(Tangent_World_Q13),length(Binormal_World_Q14));ScaleY_Q35=Face_Size_Q35.y;float Out_Radius_Q38;float Out_Line_Width_Q38;Out_Radius_Q38=_Relative_To_Height_ ? _Radius_ : _Radius_/ScaleY_Q35;Out_Line_Width_Q38=_Relative_To_Height_ ? _Line_Width_ : _Line_Width_/ScaleY_Q35;float Show_Selection_Q31;Selection_Vertex_B31(Result_Q42,Result_Q43,Face_Center_Q30,Face_Size_Q35,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,_Selection_Fuzz_,_Selected_,_Selected_Distance_,_Selected_Fade_Length_,vec3(0,0,-1),Show_Selection_Q31);float MaxAB_Q41=max(Show_Selection_Q31,Product_Q45);float Width_Q55;Proximity_Visibility_B55(Show_Selection_Q31,Result_Q42,Result_Q43,_Proximity_Far_Distance_,_Proximity_Near_Radius_,Face_Center_Q30,Nrm_World_Q24,Face_Size_Q35,Step_Q46,Width_Q55);vec3 New_P_Q32;vec2 New_UV_Q32;Move_Verts_B32(uv,Out_Radius_Q38,Anisotropy_Q21,Out_Line_Width_Q38,Width_Q55,New_P_Q32,New_UV_Q32);vec3 Pos_World_Q12;Object_To_World_Pos_B12(New_P_Q32,Pos_World_Q12);vec3 Out_Position_Q40;vec2 Out_UV_Q40;vec3 Blob_Info_Q40;vec2 Blob_Relative_UV_Q40;Blob_Vertex_B40(Pos_World_Q12,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,Position_Q27,_Blob_Intensity_,Near_Size_Q27,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,color,uv,Face_Center_Q30,Face_Size_Q35,New_UV_Q32,_Blob_Fade_Length_,_Selection_Fade_,_Selection_Fade_Size_,Inner_Fade_Q27,Pulse_Q27,Fade_Q27,Blob_Enable_Q27,0.0,Out_Position_Q40,Out_UV_Q40,Blob_Info_Q40,Blob_Relative_UV_Q40);vec2 Rect_UV_Q36;vec2 Scale_XY_Q36;vec4 Rect_Parms_Q36;Round_Rect_Vertex_B36(New_UV_Q32,Tangent_World_Q13,Binormal_World_Q14,Out_Radius_Q38,Anisotropy_Q21,Blob_Relative_UV_Q40,Rect_UV_Q36,Scale_XY_Q36,Rect_Parms_Q36);vec4 Extra_Q33;float Distance_To_Face_Q33;float Distance_Fade1_Q33;float Distance_Fade2_Q33;Proximity_Vertex_B33(Result_Q42,Result_Q43,Face_Center_Q30,Pos_World_Q12,_Proximity_Far_Distance_,1.0,_Proximity_Anisotropy_,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,Extra_Q33,Distance_To_Face_Q33,Distance_Fade1_Q33,Distance_Fade2_Q33);vec4 Vec4_Q37=vec4(MaxAB_Q41,Distance_Fade1_Q33,Distance_Fade2_Q33,Out_Radius_Q38);vec3 Position=Out_Position_Q40;vec3 Normal=Vec3_Q29;vec2 UV=Out_UV_Q40;vec3 Tangent=Blob_Info_Q40;vec3 Binormal=vec3(0,0,0);vec4 Color=vec4(1,1,1,1);vec4 Extra1=Rect_Parms_Q36;vec4 Extra2=Extra_Q33;vec4 Extra3=Vec4_Q37;gl_Position=viewProjection*vec4(Position,1);vNormal=Normal;vUV=UV;vTangent=Tangent;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlInnerquad.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{mrdlInnerquadPixelShader:()=>o});var r="mrdlInnerquadPixelShader",n="uniform vec3 cameraPosition;varying vec2 vUV;varying vec3 vTangent;uniform vec4 _Color_;uniform float _Radius_;uniform bool _Fixed_Radius_;uniform float _Filter_Width_;uniform float _Glow_Fraction_;uniform float _Glow_Max_;uniform float _Glow_Falloff_;float FilterStep_Bid194(float edge,float x,float filterWidth)\n{float dx=max(1.0E-5,fwidth(x)*filterWidth);return max((x+dx*0.5-max(edge,x-dx*0.5))/dx,0.0);}\nvoid Round_Rect_B194(\nfloat Size_X,\nfloat Size_Y,\nfloat Radius,\nvec4 Rect_Color,\nfloat Filter_Width,\nvec2 UV,\nfloat Glow_Fraction,\nfloat Glow_Max,\nfloat Glow_Falloff,\nout vec4 Color)\n{vec2 halfSize=vec2(Size_X,Size_Y)*0.5;vec2 r=max(min(vec2(Radius,Radius),halfSize),vec2(0.01,0.01));vec2 v=abs(UV);vec2 nearestp=min(v,halfSize-r);vec2 delta=(v-nearestp)/max(vec2(0.01,0.01),r);float Distance=length(delta);float insideRect=1.0-FilterStep_Bid194(1.0-Glow_Fraction,Distance,Filter_Width);float glow=clamp((1.0-Distance)/Glow_Fraction,0.0,1.0);glow=pow(glow,Glow_Falloff);Color=Rect_Color*max(insideRect,glow*Glow_Max);}\nvoid main()\n{float X_Q192;float Y_Q192;float Z_Q192;X_Q192=vTangent.x;Y_Q192=vTangent.y;Z_Q192=vTangent.z;vec4 Color_Q194;Round_Rect_B194(X_Q192,1.0,Y_Q192,_Color_,_Filter_Width_,vUV,_Glow_Fraction_,_Glow_Max_,_Glow_Falloff_,Color_Q194);vec4 Out_Color=Color_Q194;float Clip_Threshold=0.0;gl_FragColor=Out_Color;}\n";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlInnerquad.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{mrdlInnerquadVertexShader:()=>o});var r="mrdlInnerquadVertexShader",n="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform vec4 _Color_;uniform float _Radius_;uniform bool _Fixed_Radius_;uniform float _Filter_Width_;uniform float _Glow_Fraction_;uniform float _Glow_Max_;uniform float _Glow_Falloff_;varying vec2 vUV;varying vec3 vTangent;void main()\n{vec3 Pos_World_Q189;Pos_World_Q189=(world*vec4(position,1.0)).xyz;vec3 Dir_World_Q190;Dir_World_Q190=(world*vec4(tangent,0.0)).xyz;vec3 Dir_World_Q191;Dir_World_Q191=(world*vec4((cross(normal,tangent)),0.0)).xyz;float Length_Q180=length(Dir_World_Q190);float Length_Q181=length(Dir_World_Q191);float Quotient_Q184=Length_Q180/Length_Q181;float Quotient_Q195=_Radius_/Length_Q181;vec2 Result_Q193;Result_Q193=vec2((uv.x-0.5)*Length_Q180/Length_Q181,(uv.y-0.5));float Result_Q198=_Fixed_Radius_ ? Quotient_Q195 : _Radius_;vec3 Vec3_Q183=vec3(Quotient_Q184,Result_Q198,0);vec3 Position=Pos_World_Q189;vec3 Normal=vec3(0,0,0);vec2 UV=Result_Q193;vec3 Tangent=Vec3_Q183;vec3 Binormal=vec3(0,0,0);vec4 Color=color;gl_Position=viewProjection*vec4(Position,1);vUV=UV;vTangent=Tangent;}\n";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{mrdlSliderBarPixelShader:()=>o});var r="mrdlSliderBarPixelShader",n="uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform vec4 Global_Left_Index_Middle_Position;uniform vec4 Global_Right_Index_Middle_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Blob_Fragment_B30(\nsampler2D Blob_Texture,\nvec4 Blob_Info1,\nvec4 Blob_Info2,\nout vec4 Blob_Color)\n{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k1<k2 ? vec3(k1,Blob_Info1.z,Blob_Info1.w) : vec3(k2,Blob_Info2.z,Blob_Info2.w);Blob_Color=closer.z*texture(Blob_Texture,vec2(vec2(sqrt(closer.x),closer.y).x,1.0-vec2(sqrt(closer.x),closer.y).y))*clamp(1.0-closer.x,0.0,1.0);}\nvoid FastLinearTosRGB_B42(\nvec4 Linear,\nout vec4 sRGB)\n{sRGB.rgb=sqrt(clamp(Linear.rgb,0.0,1.0));sRGB.a=Linear.a;}\nvoid Scale_RGB_B59(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}\nvoid Fragment_Main_B121(\nfloat Sun_Intensity,\nfloat Sun_Theta,\nfloat Sun_Phi,\nvec3 Normal,\nvec4 Albedo,\nfloat Fresnel_Reflect,\nfloat Shininess,\nvec3 Incident,\nvec4 Horizon_Color,\nvec4 Sky_Color,\nvec4 Ground_Color,\nfloat Indirect_Diffuse,\nfloat Specular,\nfloat Horizon_Power,\nfloat Reflection,\nvec4 Reflection_Sample,\nvec4 Indirect_Sample,\nfloat Sharpness,\nfloat SSS,\nfloat Subsurface,\nvec4 Translucence,\nvec4 Rim_Light,\nvec4 Iridescence,\nout vec4 Result)\n{float theta=Sun_Theta*2.0*3.14159;float phi=Sun_Phi*3.14159;vec3 lightDir= vec3(cos(phi)*cos(theta),sin(phi),cos(phi)*sin(theta));float NdotL=max(dot(lightDir,Normal),0.0);vec3 R=reflect(Incident,Normal);float RdotL=max(0.0,dot(R,lightDir));float specular=pow(RdotL,Shininess);specular=mix(specular,smoothstep(0.495*Sharpness,1.0-0.495*Sharpness,specular),Sharpness);vec4 gi=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);Result=((Sun_Intensity*NdotL+Indirect_Sample*Indirect_Diffuse+Translucence)*(1.0+SSS*Subsurface))*Albedo*(1.0-Fresnel_Reflect)+(Sun_Intensity*specular*Specular+Fresnel_Reflect*Reflection*Reflection_Sample)+Fresnel_Reflect*Rim_Light+Iridescence;}\nvoid Bulge_B79(\nbool Enabled,\nvec3 Normal,\nvec3 Tangent,\nfloat Bulge_Height,\nvec4 UV,\nfloat Bulge_Radius,\nvec3 ButtonN,\nout vec3 New_Normal)\n{vec2 xy=clamp(UV.xy*2.0,vec2(-1,-1),vec2(1,1));vec3 B=(cross(Normal,Tangent));float k=-clamp(1.0-length(xy)/Bulge_Radius,0.0,1.0)*Bulge_Height;k=sin(k*3.14159*0.5);k*=smoothstep(0.9998,0.9999,abs(dot(ButtonN,Normal)));New_Normal=Normal*sqrt(1.0-k*k)+(xy.x*Tangent+xy.y*B)*k;New_Normal=Enabled ? New_Normal : Normal;}\nvoid SSS_B77(\nvec3 ButtonN,\nvec3 Normal,\nvec3 Incident,\nout float Result)\n{float NdotI=abs(dot(Normal,Incident));float BdotI=abs(dot(ButtonN,Incident));Result=(abs(NdotI-BdotI)); }\nvoid FingerOcclusion_B67(\nfloat Width,\nfloat DistToCenter,\nfloat Fuzz,\nfloat Min_Fuzz,\nvec3 Position,\nvec3 Forward,\nvec3 Nearest,\nfloat Fade_Out,\nout float NotInShadow)\n{float d=dot((Nearest-Position),Forward);float sh=smoothstep(Width*0.5,Width*0.5+Fuzz*max(d,0.0)+Min_Fuzz,DistToCenter);NotInShadow=1.0-(1.0-sh)*smoothstep(-Fade_Out,0.0,d);}\nvoid FingerOcclusion_B68(\nfloat Width,\nfloat DistToCenter,\nfloat Fuzz,\nfloat Min_Fuzz,\nvec3 Position,\nvec3 Forward,\nvec3 Nearest,\nfloat Fade_Out,\nout float NotInShadow)\n{float d=dot((Nearest-Position),Forward);float sh=smoothstep(Width*0.5,Width*0.5+Fuzz*max(d,0.0)+Min_Fuzz,DistToCenter);NotInShadow=1.0-(1.0-sh)*smoothstep(-Fade_Out,0.0,d);}\nvoid Scale_Color_B91(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{Result=Scalar*Color;}\nvoid From_HSV_B73(\nfloat Hue,\nfloat Saturation,\nfloat Value,\nfloat Alpha,\nout vec4 Color)\n{vec4 K=vec4(1.0,2.0/3.0,1.0/3.0,3.0);vec3 p=abs(fract(vec3(Hue,Hue,Hue)+K.xyz)*6.0-K.www);Color.rgb=Value*mix(K.xxx,clamp(p-K.xxx,0.0,1.0),Saturation);Color.a=Alpha;}\nvoid Fast_Fresnel_B122(\nfloat Front_Reflect,\nfloat Edge_Reflect,\nfloat Power,\nvec3 Normal,\nvec3 Incident,\nout float Transmit,\nout float Reflect)\n{float d=max(-dot(Incident,Normal),0.0);Reflect=Front_Reflect+(Edge_Reflect-Front_Reflect)*pow(.01-d,Power);Transmit=1.0-Reflect;}\nvoid Mapped_Environment_B51(\nsampler2D Reflected_Environment,\nsampler2D Indirect_Environment,\nvec3 Dir,\nout vec4 Reflected_Color,\nout vec4 Indirect_Diffuse)\n{Reflected_Color=texture(Reflected_Environment,vec2(atan(Dir.z,Dir.x)/3.14159*0.5,asin(Dir.y)/3.14159+0.5));Indirect_Diffuse=texture(Indirect_Environment,vec2(atan(Dir.z,Dir.x)/3.14159*0.5,asin(Dir.y)/3.14159+0.5));}\nvec4 SampleEnv_Bid50(vec3 D,vec4 S,vec4 H,vec4 G,float exponent)\n{float k=pow(abs(D.y),exponent);vec4 C;if (D.y>0.0) {C=mix(H,S,k);} else {C=mix(H,G,k); }\nreturn C;}\nvoid Sky_Environment_B50(\nvec3 Normal,\nvec3 Reflected,\nvec4 Sky_Color,\nvec4 Horizon_Color,\nvec4 Ground_Color,\nfloat Horizon_Power,\nout vec4 Reflected_Color,\nout vec4 Indirect_Color)\n{Reflected_Color=SampleEnv_Bid50(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);Indirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);}\nvoid Min_Segment_Distance_B65(\nvec3 P0,\nvec3 P1,\nvec3 Q0,\nvec3 Q1,\nout vec3 NearP,\nout vec3 NearQ,\nout float Distance)\n{vec3 u=P1-P0;vec3 v=Q1-Q0;vec3 w=P0-Q0;float a=dot(u,u);float b=dot(u,v);float c=dot(v,v);float d=dot(u,w);float e=dot(v,w);float D=a*c-b*b;float sD=D;float tD=D;float sc,sN,tc,tN;if (D<0.00001) {sN=0.0;sD=1.0;tN=e;tD=c;} else {sN=(b*e-c*d);tN=(a*e-b*d);if (sN<0.0) {sN=0.0;tN=e;tD=c;} else if (sN>sD) {sN=sD;tN=e+b;tD=c;}}\nif (tN<0.0) {tN=0.0;if (-d<0.0) {sN=0.0;} else if (-d>a) {sN=sD;} else {sN=-d;sD=a;}} else if (tN>tD) {tN=tD;if ((-d+b)<0.0) {sN=0.0;} else if ((-d+b)>a) {sN=sD;} else {sN=(-d+b);sD=a;}}\nsc=abs(sN)<0.000001 ? 0.0 : sN/sD;tc=abs(tN)<0.000001 ? 0.0 : tN/tD;NearP=P0+sc*u;NearQ=Q0+tc*v;Distance=distance(NearP,NearQ);}\nvoid To_XYZ_B74(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}\nvoid Finger_Positions_B64(\nvec3 Left_Index_Pos,\nvec3 Right_Index_Pos,\nvec3 Left_Index_Middle_Pos,\nvec3 Right_Index_Middle_Pos,\nout vec3 Left_Index,\nout vec3 Right_Index,\nout vec3 Left_Index_Middle,\nout vec3 Right_Index_Middle)\n{Left_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);Right_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);Left_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);Right_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);}\nvoid VaryHSV_B108(\nvec3 HSV_In,\nfloat Hue_Shift,\nfloat Saturation_Shift,\nfloat Value_Shift,\nout vec3 HSV_Out)\n{HSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));}\nvoid Remap_Range_B114(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}\nvoid To_HSV_B75(\nvec4 Color,\nout float Hue,\nout float Saturation,\nout float Value,\nout float Alpha,\nout vec3 HSV)\n{vec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4 p=Color.g<Color.b ? vec4(Color.bg,K.wz) : vec4(Color.gb,K.xy);vec4 q=Color.r<p.x ? vec4(p.xyw,Color.r) : vec4(Color.r,p.yzx);float d=q.x-min(q.w,q.y);float e=1.0e-10;Hue=abs(q.z+(q.w-q.y)/(6.0*d+e));Saturation=d/(q.x+e);Value=q.x;Alpha=Color.a;HSV=vec3(Hue,Saturation,Value);}\nvoid Code_B110(\nfloat X,\nout float Result)\n{Result=(acos(X)/3.14159-0.5)*2.0;}\nvoid Rim_Light_B132(\nvec3 Front,\nvec3 Normal,\nvec3 Incident,\nfloat Rim_Intensity,\nsampler2D Texture,\nout vec4 Result)\n{vec3 R=reflect(Incident,Normal);float RdotF=dot(R,Front);float RdotL=sqrt(1.0-RdotF*RdotF);vec2 UV=vec2(R.y*0.5+0.5,0.5);vec4 Color=texture(Texture,UV);Result=Color;}\nvoid main()\n{vec4 Blob_Color_Q30;\n#if BLOB_ENABLE\nBlob_Fragment_B30(_Blob_Texture_,vExtra2,vExtra3,Blob_Color_Q30);\n#else\nBlob_Color_Q30=vec4(0,0,0,0);\n#endif\nvec3 Incident_Q39=normalize(vPosition-cameraPosition);vec3 Normalized_Q38=normalize(vNormal);vec3 Normalized_Q71=normalize(vTangent);vec4 Color_Q83;\n#if DECAL_ENABLE\nColor_Q83=texture(_Decal_,vUV);\n#else\nColor_Q83=vec4(0,0,0,0);\n#endif\nfloat X_Q90;float Y_Q90;float Z_Q90;float W_Q90;X_Q90=vExtra1.x;Y_Q90=vExtra1.y;Z_Q90=vExtra1.z;W_Q90=vExtra1.w;vec4 Linear_Q43;Linear_Q43.rgb=clamp(_Sky_Color_.rgb*_Sky_Color_.rgb,0.0,1.0);Linear_Q43.a=_Sky_Color_.a;vec4 Linear_Q44;Linear_Q44.rgb=clamp(_Horizon_Color_.rgb*_Horizon_Color_.rgb,0.0,1.0);Linear_Q44.a=_Horizon_Color_.a;vec4 Linear_Q45;Linear_Q45.rgb=clamp(_Ground_Color_.rgb*_Ground_Color_.rgb,0.0,1.0);Linear_Q45.a=_Ground_Color_.a;vec3 Left_Index_Q64;vec3 Right_Index_Q64;vec3 Left_Index_Middle_Q64;vec3 Right_Index_Middle_Q64;Finger_Positions_B64(_Left_Index_Pos_,_Right_Index_Pos_,_Left_Index_Middle_Pos_,_Right_Index_Middle_Pos_,Left_Index_Q64,Right_Index_Q64,Left_Index_Middle_Q64,Right_Index_Middle_Q64);vec4 Linear_Q46;Linear_Q46.rgb=clamp(_Albedo_.rgb*_Albedo_.rgb,0.0,1.0);Linear_Q46.a=_Albedo_.a;vec3 Normalized_Q107=normalize(vBinormal);vec3 Incident_Q70=normalize(vPosition-cameraPosition);vec3 New_Normal_Q79;Bulge_B79(_Bulge_Enabled_,Normalized_Q38,Normalized_Q71,_Bulge_Height_,vColor,_Bulge_Radius_,vBinormal,New_Normal_Q79);float Result_Q77;SSS_B77(vBinormal,New_Normal_Q79,Incident_Q39,Result_Q77);vec4 Result_Q91;Scale_Color_B91(Color_Q83,X_Q90,Result_Q91);float Transmit_Q122;float Reflect_Q122;Fast_Fresnel_B122(_Front_Reflect_,_Edge_Reflect_,_Power_,New_Normal_Q79,Incident_Q39,Transmit_Q122,Reflect_Q122);float Product_Q125=Y_Q90*Y_Q90;vec3 NearP_Q65;vec3 NearQ_Q65;float Distance_Q65;Min_Segment_Distance_B65(Left_Index_Q64,Left_Index_Middle_Q64,vPosition,cameraPosition,NearP_Q65,NearQ_Q65,Distance_Q65);vec3 NearP_Q63;vec3 NearQ_Q63;float Distance_Q63;Min_Segment_Distance_B65(Right_Index_Q64,Right_Index_Middle_Q64,vPosition,cameraPosition,NearP_Q63,NearQ_Q63,Distance_Q63);vec3 Reflected_Q47=reflect(Incident_Q39,New_Normal_Q79);vec4 Product_Q103=Linear_Q46*vec4(1,1,1,1);vec4 Result_Q132;Rim_Light_B132(Normalized_Q107,Normalized_Q38,Incident_Q70,_Rim_Intensity_,_Rim_Texture_,Result_Q132);float Dot_Q72=dot(Incident_Q70, Normalized_Q71);float MaxAB_Q123=max(Reflect_Q122,Product_Q125);float NotInShadow_Q67;\n#if OCCLUSION_ENABLED\nFingerOcclusion_B67(_Width_,Distance_Q65,_Fuzz_,_Min_Fuzz_,vPosition,vBinormal,NearP_Q65,_Clip_Fade_,NotInShadow_Q67);\n#else\nNotInShadow_Q67=1.0;\n#endif\nfloat NotInShadow_Q68;\n#if OCCLUSION_ENABLED\nFingerOcclusion_B68(_Width_,Distance_Q63,_Fuzz_,_Min_Fuzz_,vPosition,vBinormal,NearP_Q63,_Clip_Fade_,NotInShadow_Q68);\n#else\nNotInShadow_Q68=1.0;\n#endif\nvec4 Reflected_Color_Q51;vec4 Indirect_Diffuse_Q51;\n#if ENV_ENABLE\nMapped_Environment_B51(_Reflection_Map_,_Indirect_Environment_,Reflected_Q47,Reflected_Color_Q51,Indirect_Diffuse_Q51);\n#else\nReflected_Color_Q51=vec4(0,0,0,1);Indirect_Diffuse_Q51=vec4(0,0,0,1);\n#endif\nvec4 Reflected_Color_Q50;vec4 Indirect_Color_Q50;\n#if SKY_ENABLED\nSky_Environment_B50(New_Normal_Q79,Reflected_Q47,Linear_Q43,Linear_Q44,Linear_Q45,_Horizon_Power_,Reflected_Color_Q50,Indirect_Color_Q50);\n#else\nReflected_Color_Q50=vec4(0,0,0,1);Indirect_Color_Q50=vec4(0,0,0,1);\n#endif\nfloat Hue_Q75;float Saturation_Q75;float Value_Q75;float Alpha_Q75;vec3 HSV_Q75;To_HSV_B75(Product_Q103,Hue_Q75,Saturation_Q75,Value_Q75,Alpha_Q75,HSV_Q75);float Hue_Q127;float Saturation_Q127;float Value_Q127;float Alpha_Q127;vec3 HSV_Q127;To_HSV_B75(Result_Q132,Hue_Q127,Saturation_Q127,Value_Q127,Alpha_Q127,HSV_Q127);float Result_Q110;Code_B110(Dot_Q72,Result_Q110);float AbsA_Q76=abs(Result_Q110);float MinAB_Q58=min(NotInShadow_Q67,NotInShadow_Q68);vec4 Sum_Q48=Reflected_Color_Q51+Reflected_Color_Q50;vec4 Sum_Q49=Indirect_Diffuse_Q51+Indirect_Color_Q50;vec3 HSV_Out_Q126;VaryHSV_B108(HSV_Q127,_Rim_Hue_Shift_,_Rim_Saturation_Shift_,_Rim_Value_Shift_,HSV_Out_Q126);float Out_Q114;Remap_Range_B114(-1.0,1.0,0.0,1.0,Result_Q110,Out_Q114);float Product_Q106;Product_Q106=AbsA_Q76*_Hue_Shift_;float X_Q128;float Y_Q128;float Z_Q128;To_XYZ_B74(HSV_Out_Q126,X_Q128,Y_Q128,Z_Q128);vec2 Vec2_Q112=vec2(Out_Q114,0.5);vec3 HSV_Out_Q108;VaryHSV_B108(HSV_Q75,Product_Q106,_Saturation_Shift_,_Value_Shift_,HSV_Out_Q108);vec4 Color_Q129;From_HSV_B73(X_Q128,Y_Q128,Z_Q128,0.0,Color_Q129);vec4 Color_Q111;\n#if IRIDESCENCE_ENABLED\nColor_Q111=texture(_Iridescence_Texture_,Vec2_Q112);\n#else\nColor_Q111=vec4(0,0,0,0);\n#endif\nfloat X_Q74;float Y_Q74;float Z_Q74;To_XYZ_B74(HSV_Out_Q108,X_Q74,Y_Q74,Z_Q74);vec4 Result_Q131=_Rim_Intensity_*Color_Q129;vec4 Result_Q113=_Iridescence_Intensity_*Color_Q111;vec4 Color_Q73;From_HSV_B73(X_Q74,Y_Q74,Z_Q74,0.0,Color_Q73);vec4 Result_Q84=Result_Q91+(1.0-Result_Q91.a)*Color_Q73;vec4 Result_Q121;Fragment_Main_B121(_Sun_Intensity_,_Sun_Theta_,_Sun_Phi_,New_Normal_Q79,Result_Q84,MaxAB_Q123,_Shininess_,Incident_Q39,_Horizon_Color_,_Sky_Color_,_Ground_Color_,_Indirect_Diffuse_,_Specular_,_Horizon_Power_,_Reflection_,Sum_Q48,Sum_Q49,_Sharpness_,Result_Q77,_Subsurface_,vec4(0,0,0,0),Result_Q131,Result_Q113,Result_Q121);vec4 Result_Q59;Scale_RGB_B59(Result_Q121,MinAB_Q58,Result_Q59);vec4 sRGB_Q42;FastLinearTosRGB_B42(Result_Q59,sRGB_Q42);vec4 Result_Q31=Blob_Color_Q30+(1.0-Blob_Color_Q30.a)*sRGB_Q42;vec4 Result_Q40=Result_Q31; Result_Q40.a=1.0;vec4 Out_Color=Result_Q40;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{mrdlSliderBarVertexShader:()=>o});var r="mrdlSliderBarVertexShader",n="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;\n#ifdef TANGENT\nattribute vec3 tangent;\n#else\nconst vec3 tangent=vec3(0.);\n#endif\nuniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Object_To_World_Pos_B12(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}\nvoid Object_To_World_Normal_B32(\nvec3 Nrm_Object,\nout vec3 Nrm_World)\n{Nrm_World=(vec4(Nrm_Object,0.0)).xyz;}\nvoid Blob_Vertex_B23(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nfloat Blob_Fade_Length,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nout vec4 Blob_Info)\n{vec3 blob= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);}\nvoid Blob_Vertex_B24(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nfloat Blob_Fade_Length,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nout vec4 Blob_Info)\n{vec3 blob= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);}\nvoid Move_Verts_B130(\nfloat Anisotropy,\nvec3 P,\nfloat Radius,\nfloat Bevel,\nvec3 Normal_Object,\nfloat ScaleZ,\nfloat Stretch,\nout vec3 New_P,\nout vec2 New_UV,\nout float Radial_Gradient,\nout vec3 Radial_Dir,\nout vec3 New_Normal)\n{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;float deltad=(length(delta)*2.0);float f=(Bevel+(Radius-Bevel)*Stretch)/Radius;float innerd=clamp(deltad*2.0,0.0,1.0);float outerd=clamp(deltad*2.0-1.0,0.0,1.0);float bevelAngle=outerd*3.14159*0.5;float sinb=sin(bevelAngle);float cosb=cos(bevelAngle);float beveld=(1.0-f)*innerd+f*sinb;float br=outerd;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);float dir=P.z<0.0001 ? 1.0 : -1.0;New_UV=center+r2*((0.5-center)+normalize(delta+vec2(0.0,0.000001))*beveld*0.5);New_P=vec3(New_UV-0.5,P.z+dir*(1.0-cosb)*Bevel*ScaleZ);Radial_Gradient=clamp((deltad-0.5)*2.0,0.0,1.0);Radial_Dir=vec3(delta*r2,0.0);vec3 beveledNormal=cosb*Normal_Object+sinb*vec3(delta.x,delta.y,0.0);New_Normal=Normal_Object.z==0.0 ? Normal_Object : beveledNormal;}\nvoid Object_To_World_Dir_B60(\nvec3 Dir_Object,\nout vec3 Normal_World,\nout vec3 Normal_World_N,\nout float Normal_Length)\n{Normal_World=(world*vec4(Dir_Object,0.0)).xyz;Normal_Length=length(Normal_World);Normal_World_N=Normal_World/Normal_Length;}\nvoid To_XYZ_B78(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}\nvoid Conditional_Float_B93(\nbool Which,\nfloat If_True,\nfloat If_False,\nout float Result)\n{Result=Which ? If_True : If_False;}\nvoid Object_To_World_Dir_B28(\nvec3 Dir_Object,\nout vec3 Binormal_World,\nout vec3 Binormal_World_N,\nout float Binormal_Length)\n{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;}\nvoid Pick_Radius_B69(\nfloat Radius,\nfloat Radius_Top_Left,\nfloat Radius_Top_Right,\nfloat Radius_Bottom_Left,\nfloat Radius_Bottom_Right,\nvec3 Position,\nout float Result)\n{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}\nvoid Conditional_Float_B36(\nbool Which,\nfloat If_True,\nfloat If_False,\nout float Result)\n{Result=Which ? If_True : If_False;}\nvoid Greater_Than_B37(\nfloat Left,\nfloat Right,\nout bool Not_Greater_Than,\nout bool Greater_Than)\n{Greater_Than=Left>Right;Not_Greater_Than=!Greater_Than;}\nvoid Remap_Range_B105(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}\nvoid main()\n{vec2 XY_Q85;XY_Q85=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);vec3 Tangent_World_Q27;vec3 Tangent_World_N_Q27;float Tangent_Length_Q27;Tangent_World_Q27=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q27=length(Tangent_World_Q27);Tangent_World_N_Q27=Tangent_World_Q27/Tangent_Length_Q27;vec3 Normal_World_Q60;vec3 Normal_World_N_Q60;float Normal_Length_Q60;Object_To_World_Dir_B60(vec3(0,0,1),Normal_World_Q60,Normal_World_N_Q60,Normal_Length_Q60);float X_Q78;float Y_Q78;float Z_Q78;To_XYZ_B78(position,X_Q78,Y_Q78,Z_Q78);vec3 Nrm_World_Q26;Nrm_World_Q26=normalize((world*vec4(normal,0.0)).xyz);vec3 Binormal_World_Q28;vec3 Binormal_World_N_Q28;float Binormal_Length_Q28;Object_To_World_Dir_B28(vec3(0,1,0),Binormal_World_Q28,Binormal_World_N_Q28,Binormal_Length_Q28);float Anisotropy_Q29=Tangent_Length_Q27/Binormal_Length_Q28;float Result_Q69;Pick_Radius_B69(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q69);float Anisotropy_Q53=Binormal_Length_Q28/Normal_Length_Q60;bool Not_Greater_Than_Q37;bool Greater_Than_Q37;Greater_Than_B37(Z_Q78,0.0,Not_Greater_Than_Q37,Greater_Than_Q37);vec4 Linear_Q101;Linear_Q101.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);Linear_Q101.a=_Left_Color_.a;vec4 Linear_Q102;Linear_Q102.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);Linear_Q102.a=_Right_Color_.a;vec3 Difference_Q61=vec3(0,0,0)-Normal_World_N_Q60;vec4 Out_Color_Q34=vec4(X_Q78,Y_Q78,Z_Q78,1);float Result_Q36;Conditional_Float_B36(Greater_Than_Q37,_Bevel_Back_,_Bevel_Front_,Result_Q36);float Result_Q94;Conditional_Float_B36(Greater_Than_Q37,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q94);vec3 New_P_Q130;vec2 New_UV_Q130;float Radial_Gradient_Q130;vec3 Radial_Dir_Q130;vec3 New_Normal_Q130;Move_Verts_B130(Anisotropy_Q29,position,Result_Q69,Result_Q36,normal,Anisotropy_Q53,Result_Q94,New_P_Q130,New_UV_Q130,Radial_Gradient_Q130,Radial_Dir_Q130,New_Normal_Q130);float X_Q98;float Y_Q98;X_Q98=New_UV_Q130.x;Y_Q98=New_UV_Q130.y;vec3 Pos_World_Q12;Object_To_World_Pos_B12(New_P_Q130,Pos_World_Q12);vec3 Nrm_World_Q32;Object_To_World_Normal_B32(New_Normal_Q130,Nrm_World_Q32);vec4 Blob_Info_Q23;\n#if BLOB_ENABLE\nBlob_Vertex_B23(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q23);\n#else\nBlob_Info_Q23=vec4(0,0,0,0);\n#endif\nvec4 Blob_Info_Q24;\n#if BLOB_ENABLE_2\nBlob_Vertex_B24(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q24);\n#else\nBlob_Info_Q24=vec4(0,0,0,0);\n#endif\nfloat Out_Q105;Remap_Range_B105(0.0,1.0,0.0,1.0,X_Q98,Out_Q105);float X_Q86;float Y_Q86;float Z_Q86;To_XYZ_B78(Nrm_World_Q32,X_Q86,Y_Q86,Z_Q86);vec4 Color_At_T_Q97=mix(Linear_Q101,Linear_Q102,Out_Q105);float Minus_F_Q87=-Z_Q86;float R_Q99;float G_Q99;float B_Q99;float A_Q99;R_Q99=Color_At_T_Q97.r; G_Q99=Color_At_T_Q97.g; B_Q99=Color_At_T_Q97.b; A_Q99=Color_At_T_Q97.a;float ClampF_Q88=clamp(0.0,Minus_F_Q87,1.0);float Result_Q93;Conditional_Float_B93(_Decal_Front_Only_,ClampF_Q88,1.0,Result_Q93);vec4 Vec4_Q89=vec4(Result_Q93,Radial_Gradient_Q130,G_Q99,B_Q99);vec3 Position=Pos_World_Q12;vec3 Normal=Nrm_World_Q32;vec2 UV=XY_Q85;vec3 Tangent=Tangent_World_N_Q27;vec3 Binormal=Difference_Q61;vec4 Color=Out_Color_Q34;vec4 Extra1=Vec4_Q89;vec4 Extra2=Blob_Info_Q23;vec4 Extra3=Blob_Info_Q24;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{mrdlSliderThumbPixelShader:()=>o});var r="mrdlSliderThumbPixelShader",n="uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform vec4 Global_Left_Index_Middle_Position;uniform vec4 Global_Right_Index_Middle_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Blob_Fragment_B180(\nsampler2D Blob_Texture,\nvec4 Blob_Info1,\nvec4 Blob_Info2,\nout vec4 Blob_Color)\n{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k1<k2 ? vec3(k1,Blob_Info1.z,Blob_Info1.w) : vec3(k2,Blob_Info2.z,Blob_Info2.w);Blob_Color=closer.z*texture(Blob_Texture,vec2(vec2(sqrt(closer.x),closer.y).x,1.0-vec2(sqrt(closer.x),closer.y).y))*clamp(1.0-closer.x,0.0,1.0);}\nvoid FastLinearTosRGB_B192(\nvec4 Linear,\nout vec4 sRGB)\n{sRGB.rgb=sqrt(clamp(Linear.rgb,0.0,1.0));sRGB.a=Linear.a;}\nvoid Scale_RGB_B209(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{Result=vec4(Scalar,Scalar,Scalar,1)*Color;}\nvoid Fragment_Main_B271(\nfloat Sun_Intensity,\nfloat Sun_Theta,\nfloat Sun_Phi,\nvec3 Normal,\nvec4 Albedo,\nfloat Fresnel_Reflect,\nfloat Shininess,\nvec3 Incident,\nvec4 Horizon_Color,\nvec4 Sky_Color,\nvec4 Ground_Color,\nfloat Indirect_Diffuse,\nfloat Specular,\nfloat Horizon_Power,\nfloat Reflection,\nvec4 Reflection_Sample,\nvec4 Indirect_Sample,\nfloat Sharpness,\nfloat SSS,\nfloat Subsurface,\nvec4 Translucence,\nvec4 Rim_Light,\nvec4 Iridescence,\nout vec4 Result)\n{float theta=Sun_Theta*2.0*3.14159;float phi=Sun_Phi*3.14159;vec3 lightDir= vec3(cos(phi)*cos(theta),sin(phi),cos(phi)*sin(theta));float NdotL=max(dot(lightDir,Normal),0.0);vec3 R=reflect(Incident,Normal);float RdotL=max(0.0,dot(R,lightDir));float specular=pow(RdotL,Shininess);specular=mix(specular,smoothstep(0.495*Sharpness,1.0-0.495*Sharpness,specular),Sharpness);vec4 gi=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);Result=((Sun_Intensity*NdotL+Indirect_Sample*Indirect_Diffuse+Translucence)*(1.0+SSS*Subsurface))*Albedo*(1.0-Fresnel_Reflect)+(Sun_Intensity*specular*Specular+Fresnel_Reflect*Reflection*Reflection_Sample)+Fresnel_Reflect*Rim_Light+Iridescence;}\nvoid Bulge_B229(\nbool Enabled,\nvec3 Normal,\nvec3 Tangent,\nfloat Bulge_Height,\nvec4 UV,\nfloat Bulge_Radius,\nvec3 ButtonN,\nout vec3 New_Normal)\n{vec2 xy=clamp(UV.xy*2.0,vec2(-1,-1),vec2(1,1));vec3 B=(cross(Normal,Tangent));float k=-clamp(1.0-length(xy)/Bulge_Radius,0.0,1.0)*Bulge_Height;k=sin(k*3.14159*0.5);k*=smoothstep(0.9998,0.9999,abs(dot(ButtonN,Normal)));New_Normal=Normal*sqrt(1.0-k*k)+(xy.x*Tangent+xy.y*B)*k;New_Normal=Enabled ? New_Normal : Normal;}\nvoid SSS_B227(\nvec3 ButtonN,\nvec3 Normal,\nvec3 Incident,\nout float Result)\n{float NdotI=abs(dot(Normal,Incident));float BdotI=abs(dot(ButtonN,Incident));Result=(abs(NdotI-BdotI)); }\nvoid FingerOcclusion_B217(\nfloat Width,\nfloat DistToCenter,\nfloat Fuzz,\nfloat Min_Fuzz,\nvec3 Position,\nvec3 Forward,\nvec3 Nearest,\nfloat Fade_Out,\nout float NotInShadow)\n{float d=dot((Nearest-Position),Forward);float sh=smoothstep(Width*0.5,Width*0.5+Fuzz*max(d,0.0)+Min_Fuzz,DistToCenter);NotInShadow=1.0-(1.0-sh)*smoothstep(-Fade_Out,0.0,d);}\nvoid FingerOcclusion_B218(\nfloat Width,\nfloat DistToCenter,\nfloat Fuzz,\nfloat Min_Fuzz,\nvec3 Position,\nvec3 Forward,\nvec3 Nearest,\nfloat Fade_Out,\nout float NotInShadow)\n{float d=dot((Nearest-Position),Forward);float sh=smoothstep(Width*0.5,Width*0.5+Fuzz*max(d,0.0)+Min_Fuzz,DistToCenter);NotInShadow=1.0-(1.0-sh)*smoothstep(-Fade_Out,0.0,d);}\nvoid Scale_Color_B241(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{Result=Scalar*Color;}\nvoid From_HSV_B223(\nfloat Hue,\nfloat Saturation,\nfloat Value,\nfloat Alpha,\nout vec4 Color)\n{vec4 K=vec4(1.0,2.0/3.0,1.0/3.0,3.0);vec3 p=abs(fract(vec3(Hue,Hue,Hue)+K.xyz)*6.0-K.www);Color.rgb=Value*mix(K.xxx,clamp(p-K.xxx,0.0,1.0),Saturation);Color.a=Alpha;}\nvoid Fast_Fresnel_B272(\nfloat Front_Reflect,\nfloat Edge_Reflect,\nfloat Power,\nvec3 Normal,\nvec3 Incident,\nout float Transmit,\nout float Reflect)\n{float d=max(-dot(Incident,Normal),0.0);Reflect=Front_Reflect+(Edge_Reflect-Front_Reflect)*pow(1.0-d,Power);Transmit=1.0-Reflect;}\nvoid Mapped_Environment_B201(\nsampler2D Reflected_Environment,\nsampler2D Indirect_Environment,\nvec3 Dir,\nout vec4 Reflected_Color,\nout vec4 Indirect_Diffuse)\n{Reflected_Color=texture(Reflected_Environment,vec2(atan(Dir.z,Dir.x)/3.14159*0.5,asin(Dir.y)/3.14159+0.5));Indirect_Diffuse=texture(Indirect_Environment,vec2(atan(Dir.z,Dir.x)/3.14159*0.5,asin(Dir.y)/3.14159+0.5));}\nvec4 SampleEnv_Bid200(vec3 D,vec4 S,vec4 H,vec4 G,float exponent)\n{float k=pow(abs(D.y),exponent);vec4 C;if (D.y>0.0) {C=mix(H,S,k);} else {C=mix(H,G,k); }\nreturn C;}\nvoid Sky_Environment_B200(\nvec3 Normal,\nvec3 Reflected,\nvec4 Sky_Color,\nvec4 Horizon_Color,\nvec4 Ground_Color,\nfloat Horizon_Power,\nout vec4 Reflected_Color,\nout vec4 Indirect_Color)\n{Reflected_Color=SampleEnv_Bid200(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);Indirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);}\nvoid Min_Segment_Distance_B215(\nvec3 P0,\nvec3 P1,\nvec3 Q0,\nvec3 Q1,\nout vec3 NearP,\nout vec3 NearQ,\nout float Distance)\n{vec3 u=P1-P0;vec3 v=Q1-Q0;vec3 w=P0-Q0;float a=dot(u,u);float b=dot(u,v);float c=dot(v,v);float d=dot(u,w);float e=dot(v,w);float D=a*c-b*b;float sD=D;float tD=D;float sc,sN,tc,tN;if (D<0.00001) {sN=0.0;sD=1.0;tN=e;tD=c;} else {sN=(b*e-c*d);tN=(a*e-b*d);if (sN<0.0) {sN=0.0;tN=e;tD=c;} else if (sN>sD) {sN=sD;tN=e+b;tD=c;}}\nif (tN<0.0) {tN=0.0;if (-d<0.0) {sN=0.0;} else if (-d>a) {sN=sD;} else {sN=-d;sD=a;}} else if (tN>tD) {tN=tD;if ((-d+b)<0.0) {sN=0.0;} else if ((-d+b)>a) {sN=sD;} else {sN=(-d+b);sD=a;}}\nsc=abs(sN)<0.000001 ? 0.0 : sN/sD;tc=abs(tN)<0.000001 ? 0.0 : tN/tD;NearP=P0+sc*u;NearQ=Q0+tc*v;Distance=distance(NearP,NearQ);}\nvoid To_XYZ_B224(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}\nvoid Finger_Positions_B214(\nvec3 Left_Index_Pos,\nvec3 Right_Index_Pos,\nvec3 Left_Index_Middle_Pos,\nvec3 Right_Index_Middle_Pos,\nout vec3 Left_Index,\nout vec3 Right_Index,\nout vec3 Left_Index_Middle,\nout vec3 Right_Index_Middle)\n{Left_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);Right_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);Left_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);Right_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);}\nvoid VaryHSV_B258(\nvec3 HSV_In,\nfloat Hue_Shift,\nfloat Saturation_Shift,\nfloat Value_Shift,\nout vec3 HSV_Out)\n{HSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));}\nvoid Remap_Range_B264(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}\nvoid To_HSV_B225(\nvec4 Color,\nout float Hue,\nout float Saturation,\nout float Value,\nout float Alpha,\nout vec3 HSV)\n{vec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4 p=Color.g<Color.b ? vec4(Color.bg,K.wz) : vec4(Color.gb,K.xy);vec4 q=Color.r<p.x ? vec4(p.xyw,Color.r) : vec4(Color.r,p.yzx);float d=q.x-min(q.w,q.y);float e=1.0e-10;Hue=abs(q.z+(q.w-q.y)/(6.0*d+e));Saturation=d/(q.x+e);Value=q.x;Alpha=Color.a;HSV=vec3(Hue,Saturation,Value);}\nvoid Code_B260(\nfloat X,\nout float Result)\n{Result=(acos(X)/3.14159-0.5)*2.0;}\nvoid Rim_Light_B282(\nvec3 Front,\nvec3 Normal,\nvec3 Incident,\nfloat Rim_Intensity,\nsampler2D Texture,\nout vec4 Result)\n{vec3 R=reflect(Incident,Normal);float RdotF=dot(R,Front);float RdotL=sqrt(1.0-RdotF*RdotF);vec2 UV=vec2(R.y*0.5+0.5,0.5);vec4 Color=texture(Texture,UV);Result=Color;}\nvoid main()\n{vec4 Blob_Color_Q180;\n#if BLOB_ENABLE\nBlob_Fragment_B180(_Blob_Texture_,vExtra2,vExtra3,Blob_Color_Q180);\n#else\nBlob_Color_Q180=vec4(0,0,0,0);\n#endif\nvec3 Incident_Q189=normalize(vPosition-cameraPosition);vec3 Normalized_Q188=normalize(vNormal);vec3 Normalized_Q221=normalize(vTangent);vec4 Color_Q233;\n#if DECAL_ENABLE\nColor_Q233=texture(_Decal_,vUV);\n#else\nColor_Q233=vec4(0,0,0,0);\n#endif\nfloat X_Q240;float Y_Q240;float Z_Q240;float W_Q240;X_Q240=vExtra1.x;Y_Q240=vExtra1.y;Z_Q240=vExtra1.z;W_Q240=vExtra1.w;vec4 Linear_Q193;Linear_Q193.rgb=clamp(_Sky_Color_.rgb*_Sky_Color_.rgb,0.0,1.0);Linear_Q193.a=_Sky_Color_.a;vec4 Linear_Q194;Linear_Q194.rgb=clamp(_Horizon_Color_.rgb*_Horizon_Color_.rgb,0.0,1.0);Linear_Q194.a=_Horizon_Color_.a;vec4 Linear_Q195;Linear_Q195.rgb=clamp(_Ground_Color_.rgb*_Ground_Color_.rgb,0.0,1.0);Linear_Q195.a=_Ground_Color_.a;vec3 Left_Index_Q214;vec3 Right_Index_Q214;vec3 Left_Index_Middle_Q214;vec3 Right_Index_Middle_Q214;Finger_Positions_B214(_Left_Index_Pos_,_Right_Index_Pos_,_Left_Index_Middle_Pos_,_Right_Index_Middle_Pos_,Left_Index_Q214,Right_Index_Q214,Left_Index_Middle_Q214,Right_Index_Middle_Q214);vec4 Linear_Q196;Linear_Q196.rgb=clamp(_Albedo_.rgb*_Albedo_.rgb,0.0,1.0);Linear_Q196.a=_Albedo_.a;vec3 Normalized_Q257=normalize(vBinormal);vec3 Incident_Q220=normalize(vPosition-cameraPosition);vec3 New_Normal_Q229;Bulge_B229(_Bulge_Enabled_,Normalized_Q188,Normalized_Q221,_Bulge_Height_,vColor,_Bulge_Radius_,vBinormal,New_Normal_Q229);float Result_Q227;SSS_B227(vBinormal,New_Normal_Q229,Incident_Q189,Result_Q227);vec4 Result_Q241;Scale_Color_B241(Color_Q233,X_Q240,Result_Q241);float Transmit_Q272;float Reflect_Q272;Fast_Fresnel_B272(_Front_Reflect_,_Edge_Reflect_,_Power_,New_Normal_Q229,Incident_Q189,Transmit_Q272,Reflect_Q272);float Product_Q275=Y_Q240*Y_Q240;vec3 NearP_Q215;vec3 NearQ_Q215;float Distance_Q215;Min_Segment_Distance_B215(Left_Index_Q214,Left_Index_Middle_Q214,vPosition,cameraPosition,NearP_Q215,NearQ_Q215,Distance_Q215);vec3 NearP_Q213;vec3 NearQ_Q213;float Distance_Q213;Min_Segment_Distance_B215(Right_Index_Q214,Right_Index_Middle_Q214,vPosition,cameraPosition,NearP_Q213,NearQ_Q213,Distance_Q213);vec3 Reflected_Q197=reflect(Incident_Q189,New_Normal_Q229);vec4 Product_Q253=Linear_Q196*vec4(1,1,1,1);vec4 Result_Q282;Rim_Light_B282(Normalized_Q257,Normalized_Q188,Incident_Q220,_Rim_Intensity_,_Rim_Texture_,Result_Q282);float Dot_Q222=dot(Incident_Q220, Normalized_Q221);float MaxAB_Q273=max(Reflect_Q272,Product_Q275);float NotInShadow_Q217;\n#if OCCLUSION_ENABLED\nFingerOcclusion_B217(_Width_,Distance_Q215,_Fuzz_,_Min_Fuzz_,vPosition,vBinormal,NearP_Q215,_Clip_Fade_,NotInShadow_Q217);\n#else\nNotInShadow_Q217=1.0;\n#endif\nfloat NotInShadow_Q218;\n#if OCCLUSION_ENABLED\nFingerOcclusion_B218(_Width_,Distance_Q213,_Fuzz_,_Min_Fuzz_,vPosition,vBinormal,NearP_Q213,_Clip_Fade_,NotInShadow_Q218);\n#else\nNotInShadow_Q218=1.0;\n#endif\nvec4 Reflected_Color_Q201;vec4 Indirect_Diffuse_Q201;\n#if ENV_ENABLE\nMapped_Environment_B201(_Reflection_Map_,_Indirect_Environment_,Reflected_Q197,Reflected_Color_Q201,Indirect_Diffuse_Q201);\n#else\nReflected_Color_Q201=vec4(0,0,0,1);Indirect_Diffuse_Q201=vec4(0,0,0,1);\n#endif\nvec4 Reflected_Color_Q200;vec4 Indirect_Color_Q200;\n#if SKY_ENABLED\nSky_Environment_B200(New_Normal_Q229,Reflected_Q197,Linear_Q193,Linear_Q194,Linear_Q195,_Horizon_Power_,Reflected_Color_Q200,Indirect_Color_Q200);\n#else\nReflected_Color_Q200=vec4(0,0,0,1);Indirect_Color_Q200=vec4(0,0,0,1);\n#endif\nfloat Hue_Q225;float Saturation_Q225;float Value_Q225;float Alpha_Q225;vec3 HSV_Q225;To_HSV_B225(Product_Q253,Hue_Q225,Saturation_Q225,Value_Q225,Alpha_Q225,HSV_Q225);float Hue_Q277;float Saturation_Q277;float Value_Q277;float Alpha_Q277;vec3 HSV_Q277;To_HSV_B225(Result_Q282,Hue_Q277,Saturation_Q277,Value_Q277,Alpha_Q277,HSV_Q277);float Result_Q260;Code_B260(Dot_Q222,Result_Q260);float AbsA_Q226=abs(Result_Q260);float MinAB_Q208=min(NotInShadow_Q217,NotInShadow_Q218);vec4 Sum_Q198=Reflected_Color_Q201+Reflected_Color_Q200;vec4 Sum_Q199=Indirect_Diffuse_Q201+Indirect_Color_Q200;vec3 HSV_Out_Q276;VaryHSV_B258(HSV_Q277,_Rim_Hue_Shift_,_Rim_Saturation_Shift_,_Rim_Value_Shift_,HSV_Out_Q276);float Out_Q264;Remap_Range_B264(-1.0,1.0,0.0,1.0,Result_Q260,Out_Q264);float Product_Q256;Product_Q256=AbsA_Q226*_Hue_Shift_;float X_Q278;float Y_Q278;float Z_Q278;To_XYZ_B224(HSV_Out_Q276,X_Q278,Y_Q278,Z_Q278);vec2 Vec2_Q262=vec2(Out_Q264,0.5);vec3 HSV_Out_Q258;VaryHSV_B258(HSV_Q225,Product_Q256,_Saturation_Shift_,_Value_Shift_,HSV_Out_Q258);vec4 Color_Q279;From_HSV_B223(X_Q278,Y_Q278,Z_Q278,0.0,Color_Q279);vec4 Color_Q261;\n#if IRIDESCENCE_ENABLED\nColor_Q261=texture(_Iridescence_Texture_,Vec2_Q262);\n#else\nColor_Q261=vec4(0,0,0,0);\n#endif\nfloat X_Q224;float Y_Q224;float Z_Q224;To_XYZ_B224(HSV_Out_Q258,X_Q224,Y_Q224,Z_Q224);vec4 Result_Q281=_Rim_Intensity_*Color_Q279;vec4 Result_Q263=_Iridescence_Intensity_*Color_Q261;vec4 Color_Q223;From_HSV_B223(X_Q224,Y_Q224,Z_Q224,0.0,Color_Q223);vec4 Result_Q234=Result_Q241+(1.0-Result_Q241.a)*Color_Q223;vec4 Result_Q271;Fragment_Main_B271(_Sun_Intensity_,_Sun_Theta_,_Sun_Phi_,New_Normal_Q229,Result_Q234,MaxAB_Q273,_Shininess_,Incident_Q189,_Horizon_Color_,_Sky_Color_,_Ground_Color_,_Indirect_Diffuse_,_Specular_,_Horizon_Power_,_Reflection_,Sum_Q198,Sum_Q199,_Sharpness_,Result_Q227,_Subsurface_,vec4(0,0,0,0),Result_Q281,Result_Q263,Result_Q271);vec4 Result_Q209;Scale_RGB_B209(Result_Q271,MinAB_Q208,Result_Q209);vec4 sRGB_Q192;FastLinearTosRGB_B192(Result_Q209,sRGB_Q192);vec4 Result_Q181=Blob_Color_Q180+(1.0-Blob_Color_Q180.a)*sRGB_Q192;vec4 Result_Q190=Result_Q181; Result_Q190.a=1.0;vec4 Out_Color=Result_Q190;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{mrdlSliderThumbVertexShader:()=>o});var r="mrdlSliderThumbVertexShader",n="uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;\n#ifdef TANGENT\nattribute vec3 tangent;\n#else\nconst vec3 tangent=vec3(0.);\n#endif\nuniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Object_To_World_Pos_B162(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;}\nvoid Object_To_World_Normal_B182(\nvec3 Nrm_Object,\nout vec3 Nrm_World)\n{Nrm_World=(vec4(Nrm_Object,0.0)).xyz;}\nvoid Blob_Vertex_B173(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nfloat Blob_Fade_Length,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nout vec4 Blob_Info)\n{vec3 blob= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);}\nvoid Blob_Vertex_B174(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nfloat Blob_Fade_Length,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nout vec4 Blob_Info)\n{vec3 blob= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);}\nvoid Move_Verts_B280(\nfloat Anisotropy,\nvec3 P,\nfloat Radius,\nfloat Bevel,\nvec3 Normal_Object,\nfloat ScaleZ,\nfloat Stretch,\nout vec3 New_P,\nout vec2 New_UV,\nout float Radial_Gradient,\nout vec3 Radial_Dir,\nout vec3 New_Normal)\n{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;float deltad=(length(delta)*2.0);float f=(Bevel+(Radius-Bevel)*Stretch)/Radius;float innerd=clamp(deltad*2.0,0.0,1.0);float outerd=clamp(deltad*2.0-1.0,0.0,1.0);float bevelAngle=outerd*3.14159*0.5;float sinb=sin(bevelAngle);float cosb=cos(bevelAngle);float beveld=(1.0-f)*innerd+f*sinb;float br=outerd;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);float dir=P.z<0.0001 ? 1.0 : -1.0;New_UV=center+r2*((0.5-center)+normalize(delta+vec2(0.0,0.000001))*beveld*0.5);New_P=vec3(New_UV-0.5,P.z+dir*(1.0-cosb)*Bevel*ScaleZ);Radial_Gradient=clamp((deltad-0.5)*2.0,0.0,1.0);Radial_Dir=vec3(delta*r2,0.0);vec3 beveledNormal=cosb*Normal_Object+sinb*vec3(delta.x,delta.y,0.0);New_Normal=Normal_Object.z==0.0 ? Normal_Object : beveledNormal;}\nvoid Object_To_World_Dir_B210(\nvec3 Dir_Object,\nout vec3 Normal_World,\nout vec3 Normal_World_N,\nout float Normal_Length)\n{Normal_World=(world*vec4(Dir_Object,0.0)).xyz;Normal_Length=length(Normal_World);Normal_World_N=Normal_World/Normal_Length;}\nvoid To_XYZ_B228(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;}\nvoid Conditional_Float_B243(\nbool Which,\nfloat If_True,\nfloat If_False,\nout float Result)\n{Result=Which ? If_True : If_False;}\nvoid Object_To_World_Dir_B178(\nvec3 Dir_Object,\nout vec3 Binormal_World,\nout vec3 Binormal_World_N,\nout float Binormal_Length)\n{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;}\nvoid Pick_Radius_B219(\nfloat Radius,\nfloat Radius_Top_Left,\nfloat Radius_Top_Right,\nfloat Radius_Bottom_Left,\nfloat Radius_Bottom_Right,\nvec3 Position,\nout float Result)\n{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;}\nvoid Conditional_Float_B186(\nbool Which,\nfloat If_True,\nfloat If_False,\nout float Result)\n{Result=Which ? If_True : If_False;}\nvoid Greater_Than_B187(\nfloat Left,\nfloat Right,\nout bool Not_Greater_Than,\nout bool Greater_Than)\n{Greater_Than=Left>Right;Not_Greater_Than=!Greater_Than;}\nvoid Remap_Range_B255(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));}\nvoid main()\n{vec2 XY_Q235;XY_Q235=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);vec3 Tangent_World_Q177;vec3 Tangent_World_N_Q177;float Tangent_Length_Q177;Tangent_World_Q177=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q177=length(Tangent_World_Q177);Tangent_World_N_Q177=Tangent_World_Q177/Tangent_Length_Q177;vec3 Normal_World_Q210;vec3 Normal_World_N_Q210;float Normal_Length_Q210;Object_To_World_Dir_B210(vec3(0,0,1),Normal_World_Q210,Normal_World_N_Q210,Normal_Length_Q210);float X_Q228;float Y_Q228;float Z_Q228;To_XYZ_B228(position,X_Q228,Y_Q228,Z_Q228);vec3 Nrm_World_Q176;Nrm_World_Q176=normalize((world*vec4(normal,0.0)).xyz);vec3 Binormal_World_Q178;vec3 Binormal_World_N_Q178;float Binormal_Length_Q178;Object_To_World_Dir_B178(vec3(0,1,0),Binormal_World_Q178,Binormal_World_N_Q178,Binormal_Length_Q178);float Anisotropy_Q179=Tangent_Length_Q177/Binormal_Length_Q178;float Result_Q219;Pick_Radius_B219(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q219);float Anisotropy_Q203=Binormal_Length_Q178/Normal_Length_Q210;bool Not_Greater_Than_Q187;bool Greater_Than_Q187;Greater_Than_B187(Z_Q228,0.0,Not_Greater_Than_Q187,Greater_Than_Q187);vec4 Linear_Q251;Linear_Q251.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);Linear_Q251.a=_Left_Color_.a;vec4 Linear_Q252;Linear_Q252.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);Linear_Q252.a=_Right_Color_.a;vec3 Difference_Q211=vec3(0,0,0)-Normal_World_N_Q210;vec4 Out_Color_Q184=vec4(X_Q228,Y_Q228,Z_Q228,1);float Result_Q186;Conditional_Float_B186(Greater_Than_Q187,_Bevel_Back_,_Bevel_Front_,Result_Q186);float Result_Q244;Conditional_Float_B186(Greater_Than_Q187,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q244);vec3 New_P_Q280;vec2 New_UV_Q280;float Radial_Gradient_Q280;vec3 Radial_Dir_Q280;vec3 New_Normal_Q280;Move_Verts_B280(Anisotropy_Q179,position,Result_Q219,Result_Q186,normal,Anisotropy_Q203,Result_Q244,New_P_Q280,New_UV_Q280,Radial_Gradient_Q280,Radial_Dir_Q280,New_Normal_Q280);float X_Q248;float Y_Q248;X_Q248=New_UV_Q280.x;Y_Q248=New_UV_Q280.y;vec3 Pos_World_Q162;Object_To_World_Pos_B162(New_P_Q280,Pos_World_Q162);vec3 Nrm_World_Q182;Object_To_World_Normal_B182(New_Normal_Q280,Nrm_World_Q182);vec4 Blob_Info_Q173;\n#if BLOB_ENABLE\nBlob_Vertex_B173(Pos_World_Q162,Nrm_World_Q176,Tangent_World_N_Q177,Binormal_World_N_Q178,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q173);\n#else\nBlob_Info_Q173=vec4(0,0,0,0);\n#endif\nvec4 Blob_Info_Q174;\n#if BLOB_ENABLE_2\nBlob_Vertex_B174(Pos_World_Q162,Nrm_World_Q176,Tangent_World_N_Q177,Binormal_World_N_Q178,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q174);\n#else\nBlob_Info_Q174=vec4(0,0,0,0);\n#endif\nfloat Out_Q255;Remap_Range_B255(0.0,1.0,0.0,1.0,X_Q248,Out_Q255);float X_Q236;float Y_Q236;float Z_Q236;To_XYZ_B228(Nrm_World_Q182,X_Q236,Y_Q236,Z_Q236);vec4 Color_At_T_Q247=mix(Linear_Q251,Linear_Q252,Out_Q255);float Minus_F_Q237=-Z_Q236;float R_Q249;float G_Q249;float B_Q249;float A_Q249;R_Q249=Color_At_T_Q247.r; G_Q249=Color_At_T_Q247.g; B_Q249=Color_At_T_Q247.b; A_Q249=Color_At_T_Q247.a;float ClampF_Q238=clamp(0.0,Minus_F_Q237,1.0);float Result_Q243;Conditional_Float_B243(_Decal_Front_Only_,ClampF_Q238,1.0,Result_Q243);vec4 Vec4_Q239=vec4(Result_Q243,Radial_Gradient_Q280,G_Q249,B_Q249);vec3 Position=Pos_World_Q162;vec3 Normal=Nrm_World_Q182;vec2 UV=XY_Q235;vec3 Tangent=Tangent_World_N_Q177;vec3 Binormal=Difference_Q211;vec4 Color=Out_Color_Q184;vec4 Extra1=Vec4_Q239;vec4 Extra2=Blob_Info_Q173;vec4 Extra3=Blob_Info_Q174;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}";i("babylonjs/Misc/perfCounter").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/gui/src/3D/vector3WithInfo.ts":(e,t,i)=>{i.r(t),i.d(t,{Vector3WithInfo:()=>n});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=function(e){function t(t,i){void 0===i&&(i=0);var r=e.call(this,t.x,t.y,t.z)||this;return r.buttonIndex=i,r}return(0,r.__extends)(t,e),t}(i("babylonjs/Misc/perfCounter").Vector3)},"../../../dev/gui/src/index.ts":(e,t,i)=>{i.r(t),i.d(t,{AbstractButton3D:()=>n.AbstractButton3D,AdvancedDynamicTexture:()=>r.AdvancedDynamicTexture,AdvancedDynamicTextureInstrumentation:()=>r.AdvancedDynamicTextureInstrumentation,BaseGradient:()=>r.BaseGradient,BaseSlider:()=>r.BaseSlider,Button:()=>r.Button,Button3D:()=>n.Button3D,Checkbox:()=>r.Checkbox,CheckboxGroup:()=>r.CheckboxGroup,ColorPicker:()=>r.ColorPicker,Container:()=>r.Container,Container3D:()=>n.Container3D,Control:()=>r.Control,Control3D:()=>n.Control3D,CornerHandle:()=>n.CornerHandle,CylinderPanel:()=>n.CylinderPanel,DisplayGrid:()=>r.DisplayGrid,Ellipse:()=>r.Ellipse,FluentBackplateMaterial:()=>n.FluentBackplateMaterial,FluentButtonMaterial:()=>n.FluentButtonMaterial,FluentMaterial:()=>n.FluentMaterial,FluentMaterialDefines:()=>n.FluentMaterialDefines,FocusableButton:()=>r.FocusableButton,GUI3DManager:()=>n.GUI3DManager,GizmoHandle:()=>n.GizmoHandle,Grid:()=>r.Grid,HandMenu:()=>n.HandMenu,HandleMaterial:()=>n.HandleMaterial,HandleState:()=>n.HandleState,HolographicBackplate:()=>n.HolographicBackplate,HolographicButton:()=>n.HolographicButton,HolographicSlate:()=>n.HolographicSlate,Image:()=>r.Image,ImageBasedSlider:()=>r.ImageBasedSlider,ImageScrollBar:()=>r.ImageScrollBar,InputPassword:()=>r.InputPassword,InputText:()=>r.InputText,InputTextArea:()=>r.InputTextArea,KeyPropertySet:()=>r.KeyPropertySet,Line:()=>r.Line,LinearGradient:()=>r.LinearGradient,MRDLBackplateMaterial:()=>n.MRDLBackplateMaterial,MRDLSliderBarMaterial:()=>n.MRDLSliderBarMaterial,MRDLSliderThumbMaterial:()=>n.MRDLSliderThumbMaterial,MathTools:()=>r.MathTools,Matrix2D:()=>r.Matrix2D,Measure:()=>r.Measure,MeshButton3D:()=>n.MeshButton3D,MultiLine:()=>r.MultiLine,MultiLinePoint:()=>r.MultiLinePoint,NearMenu:()=>n.NearMenu,PlanePanel:()=>n.PlanePanel,RadialGradient:()=>r.RadialGradient,RadioButton:()=>r.RadioButton,RadioGroup:()=>r.RadioGroup,Rectangle:()=>r.Rectangle,ScatterPanel:()=>n.ScatterPanel,ScrollBar:()=>r.ScrollBar,ScrollViewer:()=>r.ScrollViewer,SelectionPanel:()=>r.SelectionPanel,SelectorGroup:()=>r.SelectorGroup,SideHandle:()=>n.SideHandle,SlateGizmo:()=>n.SlateGizmo,Slider:()=>r.Slider,Slider3D:()=>n.Slider3D,SliderGroup:()=>r.SliderGroup,SpherePanel:()=>n.SpherePanel,StackPanel:()=>r.StackPanel,StackPanel3D:()=>n.StackPanel3D,Style:()=>r.Style,TextBlock:()=>r.TextBlock,TextWrapper:()=>r.TextWrapper,TextWrapping:()=>r.TextWrapping,ToggleButton:()=>r.ToggleButton,TouchButton3D:()=>n.TouchButton3D,TouchHolographicButton:()=>n.TouchHolographicButton,TouchHolographicButtonV3:()=>n.TouchHolographicButtonV3,TouchHolographicMenu:()=>n.TouchHolographicMenu,TouchMeshButton3D:()=>n.TouchMeshButton3D,ValueAndUnit:()=>r.ValueAndUnit,Vector2WithInfo:()=>r.Vector2WithInfo,Vector3WithInfo:()=>n.Vector3WithInfo,VirtualKeyboard:()=>r.VirtualKeyboard,VolumeBasedPanel:()=>n.VolumeBasedPanel,XmlLoader:()=>r.XmlLoader,name:()=>r.name});var r=i("../../../dev/gui/src/2D/index.ts"),n=i("../../../dev/gui/src/3D/index.ts")},"../../../lts/gui/src/legacy/legacy.ts":(e,t,i)=>{i.r(t),i.d(t,{AbstractButton3D:()=>r.AbstractButton3D,AdvancedDynamicTexture:()=>r.AdvancedDynamicTexture,AdvancedDynamicTextureInstrumentation:()=>r.AdvancedDynamicTextureInstrumentation,BaseGradient:()=>r.BaseGradient,BaseSlider:()=>r.BaseSlider,Button:()=>r.Button,Button3D:()=>r.Button3D,Checkbox:()=>r.Checkbox,CheckboxGroup:()=>r.CheckboxGroup,ColorPicker:()=>r.ColorPicker,Container:()=>r.Container,Container3D:()=>r.Container3D,Control:()=>r.Control,Control3D:()=>r.Control3D,CornerHandle:()=>r.CornerHandle,CylinderPanel:()=>r.CylinderPanel,DisplayGrid:()=>r.DisplayGrid,Ellipse:()=>r.Ellipse,FluentBackplateMaterial:()=>r.FluentBackplateMaterial,FluentButtonMaterial:()=>r.FluentButtonMaterial,FluentMaterial:()=>r.FluentMaterial,FluentMaterialDefines:()=>r.FluentMaterialDefines,FocusableButton:()=>r.FocusableButton,GUI3DManager:()=>r.GUI3DManager,GizmoHandle:()=>r.GizmoHandle,Grid:()=>r.Grid,HandMenu:()=>r.HandMenu,HandleMaterial:()=>r.HandleMaterial,HandleState:()=>r.HandleState,HolographicBackplate:()=>r.HolographicBackplate,HolographicButton:()=>r.HolographicButton,HolographicSlate:()=>r.HolographicSlate,Image:()=>r.Image,ImageBasedSlider:()=>r.ImageBasedSlider,ImageScrollBar:()=>r.ImageScrollBar,InputPassword:()=>r.InputPassword,InputText:()=>r.InputText,InputTextArea:()=>r.InputTextArea,KeyPropertySet:()=>r.KeyPropertySet,Line:()=>r.Line,LinearGradient:()=>r.LinearGradient,MRDLBackplateMaterial:()=>r.MRDLBackplateMaterial,MRDLSliderBarMaterial:()=>r.MRDLSliderBarMaterial,MRDLSliderThumbMaterial:()=>r.MRDLSliderThumbMaterial,MathTools:()=>r.MathTools,Matrix2D:()=>r.Matrix2D,Measure:()=>r.Measure,MeshButton3D:()=>r.MeshButton3D,MultiLine:()=>r.MultiLine,MultiLinePoint:()=>r.MultiLinePoint,NearMenu:()=>r.NearMenu,PlanePanel:()=>r.PlanePanel,RadialGradient:()=>r.RadialGradient,RadioButton:()=>r.RadioButton,RadioGroup:()=>r.RadioGroup,Rectangle:()=>r.Rectangle,ScatterPanel:()=>r.ScatterPanel,ScrollBar:()=>r.ScrollBar,ScrollViewer:()=>r.ScrollViewer,SelectionPanel:()=>r.SelectionPanel,SelectorGroup:()=>r.SelectorGroup,SideHandle:()=>r.SideHandle,SlateGizmo:()=>r.SlateGizmo,Slider:()=>r.Slider,Slider3D:()=>r.Slider3D,SliderGroup:()=>r.SliderGroup,SpherePanel:()=>r.SpherePanel,StackPanel:()=>r.StackPanel,StackPanel3D:()=>r.StackPanel3D,Style:()=>r.Style,TextBlock:()=>r.TextBlock,TextWrapper:()=>r.TextWrapper,TextWrapping:()=>r.TextWrapping,ToggleButton:()=>r.ToggleButton,TouchButton3D:()=>r.TouchButton3D,TouchHolographicButton:()=>r.TouchHolographicButton,TouchHolographicButtonV3:()=>r.TouchHolographicButtonV3,TouchHolographicMenu:()=>r.TouchHolographicMenu,TouchMeshButton3D:()=>r.TouchMeshButton3D,ValueAndUnit:()=>r.ValueAndUnit,Vector2WithInfo:()=>r.Vector2WithInfo,Vector3WithInfo:()=>r.Vector3WithInfo,VirtualKeyboard:()=>r.VirtualKeyboard,VolumeBasedPanel:()=>r.VolumeBasedPanel,XmlLoader:()=>r.XmlLoader,name:()=>r.name});var r=i("../../../dev/gui/src/index.ts"),n=void 0!==i.g?i.g:"undefined"!=typeof window?window:void 0;void 0!==n&&(n.BABYLON=n.BABYLON||{},n.BABYLON.GUI||(n.BABYLON.GUI=r))},"babylonjs/Misc/perfCounter":t=>{t.exports=e},"../../../../node_modules/tslib/tslib.es6.mjs":(e,t,i)=>{i.r(t),i.d(t,{__addDisposableResource:()=>B,__assign:()=>o,__asyncDelegator:()=>P,__asyncGenerator:()=>S,__asyncValues:()=>E,__await:()=>C,__awaiter:()=>f,__classPrivateFieldGet:()=>A,__classPrivateFieldIn:()=>L,__classPrivateFieldSet:()=>R,__createBinding:()=>m,__decorate:()=>s,__disposeResources:()=>D,__esDecorate:()=>c,__exportStar:()=>g,__extends:()=>n,__generator:()=>p,__importDefault:()=>O,__importStar:()=>M,__makeTemplateObject:()=>w,__metadata:()=>_,__param:()=>l,__propKey:()=>h,__read:()=>b,__rest:()=>a,__runInitializers:()=>u,__setFunctionName:()=>d,__spread:()=>y,__spreadArray:()=>T,__spreadArrays:()=>x,__values:()=>v,default:()=>N});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},r(e,t)};function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var o=function(){return o=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)};function a(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i}function s(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a}function l(e,t){return function(i,r){t(i,r,e)}}function c(e,t,i,r,n,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,_=i.length-1;_>=0;_--){var f={};for(var p in r)f[p]="access"===p?{}:r[p];for(var p in r.access)f.access[p]=r.access[p];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var m=(0,i[_])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=a(m.get))&&(h.get=s),(s=a(m.set))&&(h.set=s),(s=a(m.init))&&n.unshift(s)}else(s=a(m))&&("field"===l?n.unshift(s):h[c]=s)}u&&Object.defineProperty(u,r.name,h),d=!0}function u(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0}function h(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}function _(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,i,r){return new(i||(i=Promise))((function(n,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function p(e,t){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var m=Object.create?function(e,t,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(t,i);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,r,n)}:function(e,t,i,r){void 0===r&&(r=i),e[r]=t[i]};function g(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||m(t,e,i)}function v(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}function x(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var r=Array(e),n=0;for(t=0;t<i;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,n++)r[n]=o[a];return r}function T(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}function C(e){return this instanceof C?(this.v=e,this):new C(e)}function S(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,n=i.apply(e,t||[]),o=[];return r={},a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,c)}})),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){n[e]&&(r[e]=function(t){return new Promise((function(i,r){o.push([e,t,i,r])>1||s(e,t)}))},t&&(r[e]=t(r[e])))}function s(e,t){try{(i=n[e](t)).value instanceof C?Promise.resolve(i.value.v).then(l,c):u(o[0][2],i)}catch(e){u(o[0][3],e)}var i}function l(e){s("next",e)}function c(e){s("throw",e)}function u(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function P(e){var t,i;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,n){t[r]=e[r]?function(t){return(i=!i)?{value:C(e[r](t)),done:!1}:n?n(t):t}:n}}function E(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=v(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(i){t[i]=e[i]&&function(t){return new Promise((function(r,n){!function(e,t,i,r){Promise.resolve(r).then((function(t){e({value:t,done:i})}),t)}(r,n,(t=e[i](t)).done,t.value)}))}}}function w(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var I=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function M(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&m(t,e,i);return I(t,e),t}function O(e){return e&&e.__esModule?e:{default:e}}function A(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}function R(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i}function L(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function B(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r,n;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],i&&(n=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");n&&(r=function(){try{n.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:i})}else i&&e.stack.push({async:!0});return t}var F="function"==typeof SuppressedError?SuppressedError:function(e,t,i){var r=new Error(i);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function D(e){function t(t){e.error=e.hasError?new F(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function i(){for(;e.stack.length;){var r=e.stack.pop();try{var n=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(n).then(i,(function(e){return t(e),i()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}const N={__extends:n,__assign:o,__rest:a,__decorate:s,__param:l,__metadata:_,__awaiter:f,__generator:p,__createBinding:m,__exportStar:g,__values:v,__read:b,__spread:y,__spreadArrays:x,__spreadArray:T,__await:C,__asyncGenerator:S,__asyncDelegator:P,__asyncValues:E,__makeTemplateObject:w,__importStar:M,__importDefault:O,__classPrivateFieldGet:A,__classPrivateFieldSet:R,__classPrivateFieldIn:L,__addDisposableResource:B,__disposeResources:D}}},i={};function r(e){var n=i[e];if(void 0!==n)return n.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{default:()=>a,gui:()=>o});var o=r("../../../lts/gui/src/legacy/legacy.ts");const a=o;return n.default})(),e.exports=r(i(9859))},3988:function(e,t,i){var r;"undefined"!=typeof self?self:void 0!==i.g&&i.g,r=e=>(()=>{"use strict";var t={"../../../dev/loaders/src/OBJ/index.ts":(e,t,i)=>{i.r(t),i.d(t,{MTLFileLoader:()=>r.MTLFileLoader,OBJFileLoader:()=>o.OBJFileLoader,SolidParser:()=>n.SolidParser});var r=i("../../../dev/loaders/src/OBJ/mtlFileLoader.ts"),n=(i("../../../dev/loaders/src/OBJ/objLoadingOptions.ts"),i("../../../dev/loaders/src/OBJ/solidParser.ts")),o=i("../../../dev/loaders/src/OBJ/objFileLoader.ts")},"../../../dev/loaders/src/OBJ/mtlFileLoader.ts":(e,t,i)=>{i.r(t),i.d(t,{MTLFileLoader:()=>n});var r=i("babylonjs/Misc/observable"),n=function(){function e(){this.materials=[]}return e.prototype.parseMTL=function(t,i,n,o){if(!(i instanceof ArrayBuffer)){for(var a,s=i.split("\n"),l=/\s+/,c=null,u=0;u<s.length;u++){var h=s[u].trim();if(0!==h.length&&"#"!==h.charAt(0)){var d=h.indexOf(" "),_=d>=0?h.substring(0,d):h;_=_.toLowerCase();var f=d>=0?h.substring(d+1).trim():"";if("newmtl"===_)c&&this.materials.push(c),t._blockEntityCollection=!!o,(c=new r.StandardMaterial(f,t))._parentContainer=o,t._blockEntityCollection=!1;else if("kd"===_&&c)a=f.split(l,3).map(parseFloat),c.diffuseColor=r.Color3.FromArray(a);else if("ka"===_&&c)a=f.split(l,3).map(parseFloat),c.ambientColor=r.Color3.FromArray(a);else if("ks"===_&&c)a=f.split(l,3).map(parseFloat),c.specularColor=r.Color3.FromArray(a);else if("ke"===_&&c)a=f.split(l,3).map(parseFloat),c.emissiveColor=r.Color3.FromArray(a);else if("ns"===_&&c)c.specularPower=parseFloat(f);else if("d"===_&&c)c.alpha=parseFloat(f);else if("map_ka"===_&&c)c.ambientTexture=e._GetTexture(n,f,t);else if("map_kd"===_&&c)c.diffuseTexture=e._GetTexture(n,f,t);else if("map_ks"===_&&c)c.specularTexture=e._GetTexture(n,f,t);else if("map_ns"===_);else if("map_bump"===_&&c){var p=f.split(l),m=p.indexOf("-bm"),g=null;m>=0&&(g=p[m+1],p.splice(m,2)),c.bumpTexture=e._GetTexture(n,p.join(" "),t),c.bumpTexture&&null!==g&&(c.bumpTexture.level=parseFloat(g))}else"map_d"===_&&c&&(c.opacityTexture=e._GetTexture(n,f,t))}}c&&this.materials.push(c)}},e._GetTexture=function(t,i,n){if(!i)return null;var o=t;if("file:"===t){var a=i.lastIndexOf("\\");-1===a&&(a=i.lastIndexOf("/")),o+=a>-1?i.substr(a+1):i}else o+=i;return new r.Texture(o,n,!1,e.INVERT_TEXTURE_Y)},e.INVERT_TEXTURE_Y=!0,e}()},"../../../dev/loaders/src/OBJ/objFileLoader.ts":(e,t,i)=>{i.r(t),i.d(t,{OBJFileLoader:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/OBJ/mtlFileLoader.ts"),o=i("../../../dev/loaders/src/OBJ/solidParser.ts"),a=function(){function e(t){this.name="obj",this.extensions=".obj",this._assetContainer=null,this._loadingOptions=t||e._DefaultLoadingOptions}return Object.defineProperty(e,"INVERT_TEXTURE_Y",{get:function(){return n.MTLFileLoader.INVERT_TEXTURE_Y},set:function(e){n.MTLFileLoader.INVERT_TEXTURE_Y=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"_DefaultLoadingOptions",{get:function(){return{computeNormals:e.COMPUTE_NORMALS,optimizeNormals:e.OPTIMIZE_NORMALS,importVertexColors:e.IMPORT_VERTEX_COLORS,invertY:e.INVERT_Y,invertTextureY:e.INVERT_TEXTURE_Y,UVScaling:e.UV_SCALING,materialLoadingFailsSilently:e.MATERIAL_LOADING_FAILS_SILENTLY,optimizeWithUV:e.OPTIMIZE_WITH_UV,skipMaterials:e.SKIP_MATERIALS,useLegacyBehavior:e.USE_LEGACY_BEHAVIOR}},enumerable:!1,configurable:!0}),e.prototype._loadMTL=function(e,t,i,n){var o=t+e;r.Tools.LoadFile(o,i,void 0,void 0,!1,(function(e,t){n(o,t)}))},e.prototype.createPlugin=function(){return new e(e._DefaultLoadingOptions)},e.prototype.canDirectLoad=function(){return!1},e.prototype.importMeshAsync=function(e,t,i,r){return this._parseSolid(e,t,i,r).then((function(e){return{meshes:e,particleSystems:[],skeletons:[],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]}}))},e.prototype.loadAsync=function(e,t,i){return this.importMeshAsync(null,e,t,i).then((function(){}))},e.prototype.loadAssetContainerAsync=function(e,t,i){var n=this,o=new r.AssetContainer(e);return this._assetContainer=o,this.importMeshAsync(null,e,t,i).then((function(e){return e.meshes.forEach((function(e){return o.meshes.push(e)})),e.meshes.forEach((function(e){var t=e.material;t&&-1==o.materials.indexOf(t)&&(o.materials.push(t),t.getActiveTextures().forEach((function(e){-1==o.textures.indexOf(e)&&o.textures.push(e)})))})),n._assetContainer=null,o})).catch((function(e){throw n._assetContainer=null,e}))},e.prototype._parseSolid=function(e,t,i,a){var s=this,l="",c=new n.MTLFileLoader,u=[],h=[];new o.SolidParser(u,h,this._loadingOptions).parse(e,i,t,this._assetContainer,(function(e){l=e}));var d=[];return""===l||this._loadingOptions.skipMaterials||d.push(new Promise((function(e,i){s._loadMTL(l,a,(function(n){try{c.parseMTL(t,n,a,s._assetContainer);for(var o=0;o<c.materials.length;o++){for(var d=0,_=[],f=void 0;(f=u.indexOf(c.materials[o].name,d))>-1;)_.push(f),d=f+1;if(-1===f&&0===_.length)c.materials[o].dispose();else for(var p=0;p<_.length;p++){var m=h[_[p]],g=c.materials[o];m.material=g,m.getTotalIndices()||(g.pointsCloud=!0)}}e()}catch(t){r.Tools.Warn("Error processing MTL file: '".concat(l,"'")),s._loadingOptions.materialLoadingFailsSilently?e():i(t)}}),(function(t,n){r.Tools.Warn("Error downloading MTL file: '".concat(l,"'")),s._loadingOptions.materialLoadingFailsSilently?e():i(n)}))}))),Promise.all(d).then((function(){var e=function(e){var t,i;return Boolean(null!==(i=null===(t=e._internalMetadata)||void 0===t?void 0:t._isLine)&&void 0!==i&&i)};return h.forEach((function(i){var n,o;if(e(i)){var a=null!==(n=i.material)&&void 0!==n?n:new r.StandardMaterial(i.name+"_line",t);a.getBindedMeshes().filter((function(t){return!e(t)})).length>0&&(a=null!==(o=a.clone(a.name+"_line"))&&void 0!==o?o:a),a.wireframe=!0,i.material=a,i._internalMetadata&&(i._internalMetadata._isLine=void 0)}})),h}))},e.OPTIMIZE_WITH_UV=!0,e.INVERT_Y=!1,e.IMPORT_VERTEX_COLORS=!1,e.COMPUTE_NORMALS=!1,e.OPTIMIZE_NORMALS=!1,e.UV_SCALING=new r.Vector2(1,1),e.SKIP_MATERIALS=!1,e.MATERIAL_LOADING_FAILS_SILENTLY=!0,e.USE_LEGACY_BEHAVIOR=!1,e}();r.SceneLoader&&r.SceneLoader.RegisterPlugin(new a)},"../../../dev/loaders/src/OBJ/objLoadingOptions.ts":(e,t,i)=>{i.r(t)},"../../../dev/loaders/src/OBJ/solidParser.ts":(e,t,i)=>{i.r(t),i.d(t,{SolidParser:()=>n});var r=i("babylonjs/Misc/observable"),n=function(){function e(e,t,i){this._positions=[],this._normals=[],this._uvs=[],this._colors=[],this._meshesFromObj=[],this._indicesForBabylon=[],this._wrappedPositionForBabylon=[],this._wrappedUvsForBabylon=[],this._wrappedColorsForBabylon=[],this._wrappedNormalsForBabylon=[],this._tuplePosNorm=[],this._curPositionInIndices=0,this._hasMeshes=!1,this._unwrappedPositionsForBabylon=[],this._unwrappedColorsForBabylon=[],this._unwrappedNormalsForBabylon=[],this._unwrappedUVForBabylon=[],this._triangles=[],this._materialNameFromObj="",this._objMeshName="",this._increment=1,this._isFirstMaterial=!0,this._grayColor=new r.Color4(.5,.5,.5,1),this._hasLineData=!1,this._materialToUse=e,this._babylonMeshesArray=t,this._loadingOptions=i}return e.prototype._isInArray=function(e,t){e[t[0]]||(e[t[0]]={normals:[],idx:[]});var i=e[t[0]].normals.indexOf(t[1]);return-1===i?-1:e[t[0]].idx[i]},e.prototype._isInArrayUV=function(e,t){e[t[0]]||(e[t[0]]={normals:[],idx:[],uv:[]});var i=e[t[0]].normals.indexOf(t[1]);return 1!=i&&t[2]===e[t[0]].uv[i]?e[t[0]].idx[i]:-1},e.prototype._setData=function(e,t,i,r,n,o,a){var s;-1===(s=this._loadingOptions.optimizeWithUV?this._isInArrayUV(this._tuplePosNorm,[e,i,t]):this._isInArray(this._tuplePosNorm,[e,i]))?(this._indicesForBabylon.push(this._wrappedPositionForBabylon.length),this._wrappedPositionForBabylon.push(r),this._wrappedUvsForBabylon.push(n),this._wrappedNormalsForBabylon.push(o),void 0!==a&&this._wrappedColorsForBabylon.push(a),this._tuplePosNorm[e].normals.push(i),this._tuplePosNorm[e].idx.push(this._curPositionInIndices++),this._loadingOptions.optimizeWithUV&&this._tuplePosNorm[e].uv.push(t)):this._indicesForBabylon.push(s)},e.prototype._unwrapData=function(){for(var e=0;e<this._wrappedPositionForBabylon.length;e++)this._unwrappedPositionsForBabylon.push(this._wrappedPositionForBabylon[e].x*this._handednessSign,this._wrappedPositionForBabylon[e].y,this._wrappedPositionForBabylon[e].z),this._unwrappedNormalsForBabylon.push(this._wrappedNormalsForBabylon[e].x*this._handednessSign,this._wrappedNormalsForBabylon[e].y,this._wrappedNormalsForBabylon[e].z),this._unwrappedUVForBabylon.push(this._wrappedUvsForBabylon[e].x,this._wrappedUvsForBabylon[e].y),this._loadingOptions.importVertexColors&&this._unwrappedColorsForBabylon.push(this._wrappedColorsForBabylon[e].r,this._wrappedColorsForBabylon[e].g,this._wrappedColorsForBabylon[e].b,this._wrappedColorsForBabylon[e].a);this._wrappedPositionForBabylon.length=0,this._wrappedNormalsForBabylon.length=0,this._wrappedUvsForBabylon.length=0,this._wrappedColorsForBabylon.length=0,this._tuplePosNorm.length=0,this._curPositionInIndices=0},e.prototype._getTriangles=function(e,t){for(var i=t;i<e.length-1;i++)this._pushTriangle(e,i)},e.prototype._setDataForCurrentFaceWithPattern1=function(e,t){this._getTriangles(e,t);for(var i=0;i<this._triangles.length;i++){var n=parseInt(this._triangles[i])-1;this._setData(n,0,0,this._positions[n],r.Vector2.Zero(),r.Vector3.Up(),this._loadingOptions.importVertexColors?this._colors[n]:void 0)}this._triangles.length=0},e.prototype._setDataForCurrentFaceWithPattern2=function(e,t){this._getTriangles(e,t);for(var i=0;i<this._triangles.length;i++){var n=this._triangles[i].split("/"),o=parseInt(n[0])-1,a=parseInt(n[1])-1;this._setData(o,a,0,this._positions[o],this._uvs[a],r.Vector3.Up(),this._loadingOptions.importVertexColors?this._colors[o]:void 0)}this._triangles.length=0},e.prototype._setDataForCurrentFaceWithPattern3=function(e,t){this._getTriangles(e,t);for(var i=0;i<this._triangles.length;i++){var r=this._triangles[i].split("/"),n=parseInt(r[0])-1,o=parseInt(r[1])-1,a=parseInt(r[2])-1;this._setData(n,o,a,this._positions[n],this._uvs[o],this._normals[a])}this._triangles.length=0},e.prototype._setDataForCurrentFaceWithPattern4=function(e,t){this._getTriangles(e,t);for(var i=0;i<this._triangles.length;i++){var n=this._triangles[i].split("//"),o=parseInt(n[0])-1,a=parseInt(n[1])-1;this._setData(o,1,a,this._positions[o],r.Vector2.Zero(),this._normals[a],this._loadingOptions.importVertexColors?this._colors[o]:void 0)}this._triangles.length=0},e.prototype._setDataForCurrentFaceWithPattern5=function(e,t){this._getTriangles(e,t);for(var i=0;i<this._triangles.length;i++){var r=this._triangles[i].split("/"),n=this._positions.length+parseInt(r[0]),o=this._uvs.length+parseInt(r[1]),a=this._normals.length+parseInt(r[2]);this._setData(n,o,a,this._positions[n],this._uvs[o],this._normals[a],this._loadingOptions.importVertexColors?this._colors[n]:void 0)}this._triangles.length=0},e.prototype._addPreviousObjMesh=function(){this._meshesFromObj.length>0&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._unwrapData(),this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._handledMesh.indices=this._indicesForBabylon.slice(),this._handledMesh.positions=this._unwrappedPositionsForBabylon.slice(),this._handledMesh.normals=this._unwrappedNormalsForBabylon.slice(),this._handledMesh.uvs=this._unwrappedUVForBabylon.slice(),this._handledMesh.hasLines=this._hasLineData,this._loadingOptions.importVertexColors&&(this._handledMesh.colors=this._unwrappedColorsForBabylon.slice()),this._indicesForBabylon.length=0,this._unwrappedPositionsForBabylon.length=0,this._unwrappedColorsForBabylon.length=0,this._unwrappedNormalsForBabylon.length=0,this._unwrappedUVForBabylon.length=0,this._hasLineData=!1)},e.prototype._optimizeNormals=function(e){var t=e.getVerticesData(r.VertexBuffer.PositionKind),i=e.getVerticesData(r.VertexBuffer.NormalKind),n={};if(t&&i){for(var o=0;o<t.length/3;o++)(l=n[s=t[3*o+0]+"_"+t[3*o+1]+"_"+t[3*o+2]])||(l=[],n[s]=l),l.push(o);var a=new r.Vector3;for(var s in n){var l;if(!((l=n[s]).length<2)){var c=l[0];for(o=1;o<l.length;++o){var u=l[o];i[3*c+0]+=i[3*u+0],i[3*c+1]+=i[3*u+1],i[3*c+2]+=i[3*u+2]}for(a.copyFromFloats(i[3*c+0],i[3*c+1],i[3*c+2]),a.normalize(),o=0;o<l.length;++o)i[3*(u=l[o])+0]=a.x,i[3*u+1]=a.y,i[3*u+2]=a.z}}e.setVerticesData(r.VertexBuffer.NormalKind,i)}},e.prototype.parse=function(t,i,n,o,a){var s,l,c=this;this._loadingOptions.useLegacyBehavior?(this._pushTriangle=function(e,t){return c._triangles.push(e[0],e[t],e[t+1])},this._handednessSign=1):n.useRightHandedSystem?(this._pushTriangle=function(e,t){return c._triangles.push(e[0],e[t+1],e[t])},this._handednessSign=1):(this._pushTriangle=function(e,t){return c._triangles.push(e[0],e[t],e[t+1])},this._handednessSign=-1);for(var u=i.split("\n"),h=0;h<u.length;h++){var d=u[h].trim().replace(/\s\s/g," "),_=void 0;if(0!==d.length&&"#"!==d.charAt(0))if(e.VertexPattern.test(d)){if(_=d.match(/[^ ]+/g),this._positions.push(new r.Vector3(parseFloat(_[1]),parseFloat(_[2]),parseFloat(_[3]))),this._loadingOptions.importVertexColors)if(_.length>=7){var f=parseFloat(_[4]),p=parseFloat(_[5]),m=parseFloat(_[6]);this._colors.push(new r.Color4(f>1?f/255:f,p>1?p/255:p,m>1?m/255:m,7===_.length||void 0===_[7]?1:parseFloat(_[7])))}else this._colors.push(this._grayColor)}else if(null!==(_=e.NormalPattern.exec(d)))this._normals.push(new r.Vector3(parseFloat(_[1]),parseFloat(_[2]),parseFloat(_[3])));else if(null!==(_=e.UVPattern.exec(d)))this._uvs.push(new r.Vector2(parseFloat(_[1])*this._loadingOptions.UVScaling.x,parseFloat(_[2])*this._loadingOptions.UVScaling.y));else if(null!==(_=e.FacePattern3.exec(d)))this._setDataForCurrentFaceWithPattern3(_[1].trim().split(" "),1);else if(null!==(_=e.FacePattern4.exec(d)))this._setDataForCurrentFaceWithPattern4(_[1].trim().split(" "),1);else if(null!==(_=e.FacePattern5.exec(d)))this._setDataForCurrentFaceWithPattern5(_[1].trim().split(" "),1);else if(null!==(_=e.FacePattern2.exec(d)))this._setDataForCurrentFaceWithPattern2(_[1].trim().split(" "),1);else if(null!==(_=e.FacePattern1.exec(d)))this._setDataForCurrentFaceWithPattern1(_[1].trim().split(" "),1);else if(null!==(_=e.LinePattern1.exec(d)))this._setDataForCurrentFaceWithPattern1(_[1].trim().split(" "),0),this._hasLineData=!0;else if(null!==(_=e.LinePattern2.exec(d)))this._setDataForCurrentFaceWithPattern2(_[1].trim().split(" "),0),this._hasLineData=!0;else if(null!==(_=e.LinePattern3.exec(d)))this._setDataForCurrentFaceWithPattern3(_[1].trim().split(" "),0),this._hasLineData=!0;else if(e.GroupDescriptor.test(d)||e.ObjectDescriptor.test(d)){var g={name:d.substring(2).trim(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:e.ObjectDescriptor.test(d)};this._addPreviousObjMesh(),this._meshesFromObj.push(g),this._hasMeshes=!0,this._isFirstMaterial=!0,this._increment=1}else e.UseMtlDescriptor.test(d)?(this._materialNameFromObj=d.substring(7).trim(),this._isFirstMaterial&&this._hasMeshes||(this._addPreviousObjMesh(),g={name:(this._objMeshName||"mesh")+"_mm"+this._increment.toString(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:!1},this._increment++,this._meshesFromObj.push(g),this._hasMeshes=!0),this._hasMeshes&&this._isFirstMaterial&&(this._meshesFromObj[this._meshesFromObj.length-1].materialName=this._materialNameFromObj,this._isFirstMaterial=!1)):e.MtlLibGroupDescriptor.test(d)?a(d.substring(7).trim()):e.SmoothDescriptor.test(d)||r.Logger.Log("Unhandled expression at line : "+d)}if(this._hasMeshes&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData(),this._handledMesh.indices=this._indicesForBabylon,this._handledMesh.positions=this._unwrappedPositionsForBabylon,this._handledMesh.normals=this._unwrappedNormalsForBabylon,this._handledMesh.uvs=this._unwrappedUVForBabylon,this._handledMesh.hasLines=this._hasLineData,this._loadingOptions.importVertexColors&&(this._handledMesh.colors=this._unwrappedColorsForBabylon)),!this._hasMeshes){var v=null;if(this._indicesForBabylon.length)this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData();else{for(var b=0,y=this._positions;b<y.length;b++){var x=y[b];this._unwrappedPositionsForBabylon.push(x.x,x.y,x.z)}if(this._normals.length)for(var T=0,C=this._normals;T<C.length;T++){var S=C[T];this._unwrappedNormalsForBabylon.push(S.x,S.y,S.z)}if(this._uvs.length)for(var P=0,E=this._uvs;P<E.length;P++){var w=E[P];this._unwrappedUVForBabylon.push(w.x,w.y)}if(this._colors.length)for(var I=0,M=this._colors;I<M.length;I++){var O=M[I];this._unwrappedColorsForBabylon.push(O.r,O.g,O.b,O.a)}this._materialNameFromObj||((v=new r.StandardMaterial(r.Geometry.RandomId(),n)).pointsCloud=!0,this._materialNameFromObj=v.name,this._normals.length||(v.disableLighting=!0,v.emissiveColor=r.Color3.White()))}this._meshesFromObj.push({name:r.Geometry.RandomId(),indices:this._indicesForBabylon,positions:this._unwrappedPositionsForBabylon,colors:this._unwrappedColorsForBabylon,normals:this._unwrappedNormalsForBabylon,uvs:this._unwrappedUVForBabylon,materialName:this._materialNameFromObj,directMaterial:v,isObject:!0})}for(var A=0;A<this._meshesFromObj.length;A++){if(t&&this._meshesFromObj[A].name)if(t instanceof Array){if(-1===t.indexOf(this._meshesFromObj[A].name))continue}else if(this._meshesFromObj[A].name!==t)continue;this._handledMesh=this._meshesFromObj[A],n._blockEntityCollection=!!o;var R=new r.Mesh(this._meshesFromObj[A].name,n);if(R._parentContainer=o,n._blockEntityCollection=!1,this._handledMesh._babylonMesh=R,!this._handledMesh.isObject)for(var L=A-1;L>=0;--L)if(this._meshesFromObj[L].isObject&&this._meshesFromObj[L]._babylonMesh){R.parent=this._meshesFromObj[L]._babylonMesh;break}if(this._materialToUse.push(this._meshesFromObj[A].materialName),this._handledMesh.hasLines&&(null!==(s=R._internalMetadata)&&void 0!==s||(R._internalMetadata={}),R._internalMetadata._isLine=!0),0!==(null===(l=this._handledMesh.positions)||void 0===l?void 0:l.length)){var B=new r.VertexData;if(B.uvs=this._handledMesh.uvs,B.indices=this._handledMesh.indices,B.positions=this._handledMesh.positions,this._loadingOptions.computeNormals){var F=new Array;r.VertexData.ComputeNormals(this._handledMesh.positions,this._handledMesh.indices,F),B.normals=F}else B.normals=this._handledMesh.normals;this._loadingOptions.importVertexColors&&(B.colors=this._handledMesh.colors),B.applyToMesh(R),this._loadingOptions.invertY&&(R.scaling.y*=-1),this._loadingOptions.optimizeNormals&&this._optimizeNormals(R),this._babylonMeshesArray.push(R),this._handledMesh.directMaterial&&(R.material=this._handledMesh.directMaterial)}else this._babylonMeshesArray.push(R)}},e.ObjectDescriptor=/^o/,e.GroupDescriptor=/^g/,e.MtlLibGroupDescriptor=/^mtllib /,e.UseMtlDescriptor=/^usemtl /,e.SmoothDescriptor=/^s /,e.VertexPattern=/^v(\s+[\d|.|+|\-|e|E]+){3,7}/,e.NormalPattern=/^vn(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/,e.UVPattern=/^vt(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/,e.FacePattern1=/^f\s+(([\d]{1,}[\s]?){3,})+/,e.FacePattern2=/^f\s+((([\d]{1,}\/[\d]{1,}[\s]?){3,})+)/,e.FacePattern3=/^f\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){3,})+)/,e.FacePattern4=/^f\s+((([\d]{1,}\/\/[\d]{1,}[\s]?){3,})+)/,e.FacePattern5=/^f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/,e.LinePattern1=/^l\s+(([\d]{1,}[\s]?){2,})+/,e.LinePattern2=/^l\s+((([\d]{1,}\/[\d]{1,}[\s]?){2,})+)/,e.LinePattern3=/^l\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){2,})+)/,e}()},"../../../dev/loaders/src/SPLAT/index.ts":(e,t,i)=>{i.r(t),i.d(t,{SPLATFileLoader:()=>r.SPLATFileLoader});var r=i("../../../dev/loaders/src/SPLAT/splatFileLoader.ts")},"../../../dev/loaders/src/SPLAT/splatFileLoader.ts":(e,t,i)=>{i.r(t),i.d(t,{SPLATFileLoader:()=>o});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/observable"),o=function(){function e(){this.name="splat",this.extensions={".splat":{isBinary:!0},".ply":{isBinary:!0}}}return e.prototype.createPlugin=function(){return new e},e.prototype.canDirectLoad=function(){return!1},e.prototype.importMeshAsync=function(e,t,i,o,a,s){return(0,r.__awaiter)(this,void 0,void 0,(function(){var e;return(0,r.__generator)(this,(function(i){switch(i.label){case 0:return[4,(e=new n.GaussianSplattingMesh("GaussianSplatting",null,t)).loadFileAsync(o+(null!=s?s:""))];case 1:return i.sent(),[2,{meshes:[e],particleSystems:[],skeletons:[],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]}]}}))}))},e.prototype.loadAsync=function(e,t,i){return new n.GaussianSplattingMesh("GaussianSplatting",null,e).loadDataAsync(n.GaussianSplattingMesh.ConvertPLYToSplat(t))},e.prototype.loadAssetContainerAsync=function(e,t,i){throw new Error("loadAssetContainerAsync not implemented for Gaussian Splatting loading")},e}();n.SceneLoader&&n.SceneLoader.RegisterPlugin(new o)},"../../../dev/loaders/src/STL/index.ts":(e,t,i)=>{i.r(t),i.d(t,{STLFileLoader:()=>r.STLFileLoader});var r=i("../../../dev/loaders/src/STL/stlFileLoader.ts")},"../../../dev/loaders/src/STL/stlFileLoader.ts":(e,t,i)=>{i.r(t),i.d(t,{STLFileLoader:()=>n});var r=i("babylonjs/Misc/observable"),n=function(){function e(){this.solidPattern=/solid (\S*)([\S\s]*?)endsolid[ ]*(\S*)/g,this.facetsPattern=/facet([\s\S]*?)endfacet/g,this.normalPattern=/normal[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g,this.vertexPattern=/vertex[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g,this.name="stl",this.extensions={".stl":{isBinary:!0}}}return e.prototype.importMesh=function(e,t,i,n,o){var a;if("string"!=typeof i){if(this._isBinary(i)){var s=new r.Mesh("stlmesh",t);return this._parseBinary(s,i),o&&o.push(s),!0}i=(new TextDecoder).decode(new Uint8Array(i))}for(;a=this.solidPattern.exec(i);){var l=a[1],c=a[3];if(c&&l!=c)return r.Tools.Error("Error in STL, solid name != endsolid name"),!1;if(e&&l)if(e instanceof Array){if(!e.indexOf(l))continue}else if(l!==e)continue;l=l||"stlmesh",s=new r.Mesh(l,t),this._parseASCII(s,a[2]),o&&o.push(s)}return!0},e.prototype.load=function(e,t,i){return this.importMesh(null,e,t,i,null)},e.prototype.loadAssetContainer=function(e,t,i){var n=new r.AssetContainer(e);return e._blockEntityCollection=!0,this.importMesh(null,e,t,i,n.meshes),e._blockEntityCollection=!1,n},e.prototype._isBinary=function(e){var t=new DataView(e);if(t.byteLength<=80)return!1;if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;for(var i=[115,111,108,105,100],r=0;r<5;r++)if(t.getUint8(r)!==i[r])return!0;return!1},e.prototype._parseBinary=function(t,i){for(var n=new DataView(i),o=n.getUint32(80,!0),a=0,s=new Float32Array(3*o*3),l=new Float32Array(3*o*3),c=new Uint32Array(3*o),u=0,h=0;h<o;h++){for(var d=84+50*h,_=n.getFloat32(d,!0),f=n.getFloat32(d+4,!0),p=n.getFloat32(d+8,!0),m=1;m<=3;m++){var g=d+12*m;s[a]=n.getFloat32(g,!0),l[a]=_,e.DO_NOT_ALTER_FILE_COORDINATES?(s[a+1]=n.getFloat32(g+4,!0),s[a+2]=n.getFloat32(g+8,!0),l[a+1]=f,l[a+2]=p):(s[a+2]=n.getFloat32(g+4,!0),s[a+1]=n.getFloat32(g+8,!0),l[a+2]=f,l[a+1]=p),a+=3}e.DO_NOT_ALTER_FILE_COORDINATES?(c[u]=u,c[u+1]=u+2,c[u+2]=u+1,u+=3):(c[u]=u++,c[u]=u++,c[u]=u++)}t.setVerticesData(r.VertexBuffer.PositionKind,s),t.setVerticesData(r.VertexBuffer.NormalKind,l),t.setIndices(c),t.computeWorldMatrix(!0)},e.prototype._parseASCII=function(t,i){for(var n,o=[],a=[],s=[],l=0;n=this.facetsPattern.exec(i);){var c=n[1],u=this.normalPattern.exec(c);if(this.normalPattern.lastIndex=0,u){for(var h=[Number(u[1]),Number(u[5]),Number(u[3])],d=void 0;d=this.vertexPattern.exec(c);)e.DO_NOT_ALTER_FILE_COORDINATES?(o.push(Number(d[1]),Number(d[3]),Number(d[5])),a.push(h[0],h[2],h[1])):(o.push(Number(d[1]),Number(d[5]),Number(d[3])),a.push(h[0],h[1],h[2]));e.DO_NOT_ALTER_FILE_COORDINATES?(s.push(l,l+2,l+1),l+=3):s.push(l++,l++,l++),this.vertexPattern.lastIndex=0}}this.facetsPattern.lastIndex=0,t.setVerticesData(r.VertexBuffer.PositionKind,o),t.setVerticesData(r.VertexBuffer.NormalKind,a),t.setIndices(s),t.computeWorldMatrix(!0)},e.DO_NOT_ALTER_FILE_COORDINATES=!1,e}();r.SceneLoader&&r.SceneLoader.RegisterPlugin(new n)},"../../../dev/loaders/src/glTF/1.0/glTFBinaryExtension.ts":(e,t,i)=>{i.r(t),i.d(t,{GLTFBinaryExtension:()=>s});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/loaders/src/glTF/1.0/glTFLoader.ts"),o=i("../../../dev/loaders/src/glTF/1.0/glTFLoaderUtils.ts"),a=i("../../../dev/loaders/src/glTF/1.0/glTFLoaderInterfaces.ts"),s=function(e){function t(){return e.call(this,"KHR_binary_glTF")||this}return(0,r.__extends)(t,e),t.prototype.loadRuntimeAsync=function(e,t,i,r){var o=t.json.extensionsUsed;return!(!o||-1===o.indexOf(this.name)||!t.bin||(this._bin=t.bin,r(n.GLTFLoaderBase.CreateRuntime(t.json,e,i)),0))},t.prototype.loadBufferAsync=function(e,t,i,r){return-1!==e.extensionsUsed.indexOf(this.name)&&"binary_glTF"===t&&(this._bin.readAsync(0,this._bin.byteLength).then(i,(function(e){return r(e.message)})),!0)},t.prototype.loadTextureBufferAsync=function(e,t,i){var r=e.textures[t],n=e.images[r.source];if(!n.extensions||!(this.name in n.extensions))return!1;var s=n.extensions[this.name],l=e.bufferViews[s.bufferView];return i(o.GLTFUtils.GetBufferFromBufferView(e,l,0,l.byteLength,a.EComponentType.UNSIGNED_BYTE)),!0},t.prototype.loadShaderStringAsync=function(e,t,i){var r=e.shaders[t];if(!r.extensions||!(this.name in r.extensions))return!1;var n=r.extensions[this.name],s=e.bufferViews[n.bufferView],l=o.GLTFUtils.GetBufferFromBufferView(e,s,0,s.byteLength,a.EComponentType.UNSIGNED_BYTE);return setTimeout((function(){var e=o.GLTFUtils.DecodeBufferToText(l);i(e)})),!0},t}(n.GLTFLoaderExtension);n.GLTFLoader.RegisterExtension(new s)},"../../../dev/loaders/src/glTF/1.0/glTFLoader.ts":(e,t,i)=>{i.r(t),i.d(t,{GLTFLoader:()=>M,GLTFLoaderBase:()=>I,GLTFLoaderExtension:()=>O});var r,n=i("../../../dev/loaders/src/glTF/1.0/glTFLoaderInterfaces.ts"),o=i("babylonjs/Misc/observable"),a=i("../../../dev/loaders/src/glTF/1.0/glTFLoaderUtils.ts"),s=i("../../../dev/loaders/src/glTF/glTFFileLoader.ts");!function(e){e[e.IDENTIFIER=1]="IDENTIFIER",e[e.UNKNOWN=2]="UNKNOWN",e[e.END_OF_INPUT=3]="END_OF_INPUT"}(r||(r={}));var l=function(){function e(e){this._pos=0,this.currentToken=r.UNKNOWN,this.currentIdentifier="",this.currentString="",this.isLetterOrDigitPattern=/^[a-zA-Z0-9]+$/,this._toParse=e,this._maxPos=e.length}return e.prototype.getNextToken=function(){if(this.isEnd())return r.END_OF_INPUT;if(this.currentString=this.read(),this.currentToken=r.UNKNOWN,"_"===this.currentString||this.isLetterOrDigitPattern.test(this.currentString))for(this.currentToken=r.IDENTIFIER,this.currentIdentifier=this.currentString;!this.isEnd()&&(this.isLetterOrDigitPattern.test(this.currentString=this.peek())||"_"===this.currentString);)this.currentIdentifier+=this.currentString,this.forward();return this.currentToken},e.prototype.peek=function(){return this._toParse[this._pos]},e.prototype.read=function(){return this._toParse[this._pos++]},e.prototype.forward=function(){this._pos++},e.prototype.isEnd=function(){return this._pos>=this._maxPos},e}(),c=["MODEL","VIEW","PROJECTION","MODELVIEW","MODELVIEWPROJECTION","JOINTMATRIX"],u=["world","view","projection","worldView","worldViewProjection","mBones"],h=["translation","rotation","scale"],d=["position","rotationQuaternion","scaling"],_=function(e,t,i){for(var r in e){var n=e[r];i[t][r]=n}},f=function(e){if(e)for(var t=0;t<e.length/2;t++)e[2*t+1]=1-e[2*t+1]},p=function(e){if("NORMAL"===e.semantic)return"normal";if("POSITION"===e.semantic)return"position";if("JOINT"===e.semantic)return"matricesIndices";if("WEIGHT"===e.semantic)return"matricesWeights";if("COLOR"===e.semantic)return"color";if(e.semantic&&-1!==e.semantic.indexOf("TEXCOORD_")){var t=Number(e.semantic.split("_")[1]);return"uv"+(0===t?"":t+1)}return null},m=function(e){var t=null;if(e.translation||e.rotation||e.scale){var i=o.Vector3.FromArray(e.scale||[1,1,1]),r=o.Quaternion.FromArray(e.rotation||[0,0,0,1]),n=o.Vector3.FromArray(e.translation||[0,0,0]);t=o.Matrix.Compose(i,r,n)}else t=o.Matrix.FromArray(e.matrix);return t},g=function(e,t,i,r){for(var n=0;n<r.bones.length;n++)if(r.bones[n].name===i)return r.bones[n];var a=e.nodes;for(var s in a){var l=a[s];if(l.jointName){var c=l.children;for(n=0;n<c.length;n++){var u=e.nodes[c[n]];if(u.jointName&&u.jointName===i){var h=m(l),d=new o.Bone(l.name||"",r,g(e,t,l.jointName,r),h);return d.id=s,d}}}}return null},v=function(e,t){for(var i=0;i<e.length;i++)for(var r=e[i],n=0;n<r.node.children.length;n++)if(r.node.children[n]===t)return r.bone;return null},b=function(e,t){var i=e.nodes,r=i[t];if(r)return{node:r,id:t};for(var n in i)if((r=i[n]).jointName===t)return{node:r,id:n};return null},y=function(e,t){for(var i=0;i<e.jointNames.length;i++)if(e.jointNames[i]===t)return!0;return!1},x=function(e,t,i,r,n){if(n||(e.scene._blockEntityCollection=!!e.assetContainer,(n=new o.Mesh(t.name||"",e.scene))._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,n.id=r),!t.babylonNode)return n;for(var l,c=[],u=null,h=[],d=[],_=[],p=[],m=0;m<i.length;m++){var g=i[m];if(R=e.meshes[g])for(var v=0;v<R.primitives.length;v++){var b=new o.VertexData,y=R.primitives[v];y.mode;var x=y.attributes,T=null,C=null;for(var S in x)if(T=e.accessors[x[S]],C=a.GLTFUtils.GetBufferFromAccessor(e,T),"NORMAL"===S)b.normals=new Float32Array(C.length),b.normals.set(C);else if("POSITION"===S){if(s.GLTFFileLoader.HomogeneousCoordinates){b.positions=new Float32Array(C.length-C.length/4);for(var P=0;P<C.length;P+=4)b.positions[P]=C[P],b.positions[P+1]=C[P+1],b.positions[P+2]=C[P+2]}else b.positions=new Float32Array(C.length),b.positions.set(C);d.push(b.positions.length)}else if(-1!==S.indexOf("TEXCOORD_")){var E=Number(S.split("_")[1]),w=o.VertexBuffer.UVKind+(0===E?"":E+1),I=new Float32Array(C.length);I.set(C),f(I),b.set(I,w)}else"JOINT"===S?(b.matricesIndices=new Float32Array(C.length),b.matricesIndices.set(C)):"WEIGHT"===S?(b.matricesWeights=new Float32Array(C.length),b.matricesWeights.set(C)):"COLOR"===S&&(b.colors=new Float32Array(C.length),b.colors.set(C));if(T=e.accessors[y.indices])C=a.GLTFUtils.GetBufferFromAccessor(e,T),b.indices=new Int32Array(C.length),b.indices.set(C),p.push(b.indices.length);else{var M=[];for(P=0;P<b.positions.length/3;P++)M.push(P);b.indices=new Int32Array(M),p.push(b.indices.length)}u?u.merge(b):u=b;var O=e.scene.getMaterialById(y.material);c.push(null===O?a.GLTFUtils.GetDefaultMaterial(e.scene):O),h.push(0===h.length?0:h[h.length-1]+d[d.length-2]),_.push(0===_.length?0:_[_.length-1]+p[p.length-2])}}e.scene._blockEntityCollection=!!e.assetContainer,c.length>1?(l=new o.MultiMaterial("multimat"+r,e.scene)).subMaterials=c:l=new o.StandardMaterial("multimat"+r,e.scene),1===c.length&&(l=c[0]),l._parentContainer=e.assetContainer,n.material||(n.material=l),new o.Geometry(r,e.scene,u,!1,n),n.computeWorldMatrix(!0),e.scene._blockEntityCollection=!1,n.subMeshes=[];var A=0;for(m=0;m<i.length;m++){var R;if(g=i[m],R=e.meshes[g])for(v=0;v<R.primitives.length;v++)R.primitives[v].mode,o.SubMesh.AddToMesh(A,h[A],d[A],_[A],p[A],n,n,!0),A++}return n},T=function(e,t,i,r){e.position&&(e.position=t),(e.rotationQuaternion||e.rotation)&&(e.rotationQuaternion=i),e.scaling&&(e.scaling=r)},C=function(e,t,i){var r=null;if(e.importOnlyMeshes&&(t.skin||t.meshes)&&e.importMeshesNames&&e.importMeshesNames.length>0&&-1===e.importMeshesNames.indexOf(t.name||""))return null;if(t.skin){if(t.meshes){var n=e.skins[t.skin];(a=x(e,t,t.meshes,i,t.babylonNode)).skeleton=e.scene.getLastSkeletonById(t.skin),null===a.skeleton&&(a.skeleton=function(e,t,i,r){if(r||(r=new o.Skeleton(t.name||"","",e.scene)),!t.babylonSkeleton)return r;var n=[],a=[];!function(e,t,i,r){for(var n in e.nodes){var a=e.nodes[n],s=n;if(a.jointName&&!y(i,a.jointName)){var l=m(a),c=new o.Bone(a.name||"",t,null,l);c.id=s,r.push({bone:c,node:a,id:s})}}for(var u=0;u<r.length;u++)for(var h=r[u],d=h.node.children,_=0;_<d.length;_++){for(var f=null,p=0;p<r.length;p++)if(r[p].id===d[_]){f=r[p];break}f&&(f.bone._parent=h.bone,h.bone.children.push(f.bone))}}(e,r,t,n),r.bones=[];for(var s=0;s<t.jointNames.length;s++)if(P=b(e,t.jointNames[s])){var l=P.node;if(l){var c=P.id,u=e.scene.getBoneById(c);if(u)r.bones.push(u);else{for(var h=!1,d=null,_=0;_<s;_++){var f=b(e,t.jointNames[_]);if(f){var p=f.node;if(p){var x=p.children;if(x){h=!1;for(var T=0;T<x.length;T++)if(x[T]===c){d=g(e,t,t.jointNames[_],r),h=!0;break}if(h)break}}else o.Tools.Warn("Joint named "+t.jointNames[_]+" does not exist when looking for parent")}}var C=m(l);!d&&n.length>0&&(d=v(n,c))&&-1===a.indexOf(d)&&a.push(d),new o.Bone(l.jointName||"",r,d,C).id=c}}else o.Tools.Warn("Joint named "+t.jointNames[s]+" does not exist")}var S=r.bones;for(r.bones=[],s=0;s<t.jointNames.length;s++){var P;if(P=b(e,t.jointNames[s]))for(_=0;_<S.length;_++)if(S[_].id===P.id){r.bones.push(S[_]);break}}for(r.prepare(),s=0;s<a.length;s++)r.bones.push(a[s]);return r}(e,n,0,n.babylonSkeleton),n.babylonSkeleton||(n.babylonSkeleton=a.skeleton)),r=a}}else if(t.meshes){var a;r=a=x(e,t,t.mesh?[t.mesh]:t.meshes,i,t.babylonNode)}else if(!t.light||t.babylonNode||e.importOnlyMeshes){if(t.camera&&!t.babylonNode&&!e.importOnlyMeshes){var s=e.cameras[t.camera];if(s){if(e.scene._blockEntityCollection=!!e.assetContainer,"orthographic"===s.type){var l=new o.FreeCamera(t.camera,o.Vector3.Zero(),e.scene,!1);l.name=t.name||"",l.mode=o.Camera.ORTHOGRAPHIC_CAMERA,l.attachControl(),r=l,l._parentContainer=e.assetContainer}else if("perspective"===s.type){var c=s[s.type],u=new o.FreeCamera(t.camera,o.Vector3.Zero(),e.scene,!1);u.name=t.name||"",u.attachControl(),c.aspectRatio||(c.aspectRatio=e.scene.getEngine().getRenderWidth()/e.scene.getEngine().getRenderHeight()),c.znear&&c.zfar&&(u.maxZ=c.zfar,u.minZ=c.znear),r=u,u._parentContainer=e.assetContainer}e.scene._blockEntityCollection=!1}}}else{var h=e.lights[t.light];if(h)if("ambient"===h.type){var d=h[h.type],_=new o.HemisphericLight(t.light,o.Vector3.Zero(),e.scene);_.name=t.name||"",d.color&&(_.diffuse=o.Color3.FromArray(d.color)),r=_}else if("directional"===h.type){var f=h[h.type],p=new o.DirectionalLight(t.light,o.Vector3.Zero(),e.scene);p.name=t.name||"",f.color&&(p.diffuse=o.Color3.FromArray(f.color)),r=p}else if("point"===h.type){var C=h[h.type],S=new o.PointLight(t.light,o.Vector3.Zero(),e.scene);S.name=t.name||"",C.color&&(S.diffuse=o.Color3.FromArray(C.color)),r=S}else if("spot"===h.type){var P=h[h.type],E=new o.SpotLight(t.light,o.Vector3.Zero(),o.Vector3.Zero(),0,0,e.scene);E.name=t.name||"",P.color&&(E.diffuse=o.Color3.FromArray(P.color)),P.fallOfAngle&&(E.angle=P.fallOfAngle),P.fallOffExponent&&(E.exponent=P.fallOffExponent),r=E}}if(!t.jointName){if(t.babylonNode)return t.babylonNode;if(null===r){e.scene._blockEntityCollection=!!e.assetContainer;var w=new o.Mesh(t.name||"",e.scene);w._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,t.babylonNode=w,r=w}}if(null!==r){if(t.matrix&&r instanceof o.Mesh)!function(e,t){if(t.matrix){var i=new o.Vector3(0,0,0),r=new o.Quaternion,n=new o.Vector3(0,0,0);o.Matrix.FromArray(t.matrix).decompose(n,r,i),T(e,i,r,n)}else t.translation&&t.rotation&&t.scale&&T(e,o.Vector3.FromArray(t.translation),o.Quaternion.FromArray(t.rotation),o.Vector3.FromArray(t.scale));e.computeWorldMatrix(!0)}(r,t);else{var I=t.translation||[0,0,0],M=t.rotation||[0,0,0,1],O=t.scale||[1,1,1];T(r,o.Vector3.FromArray(I),o.Quaternion.FromArray(M),o.Vector3.FromArray(O))}r.updateCache(!0),t.babylonNode=r}return r},S=function(e,t,i,r){void 0===r&&(r=!1);var n=e.nodes[t],o=null;if(r=!(e.importOnlyMeshes&&!r&&e.importMeshesNames)||-1!==e.importMeshesNames.indexOf(n.name||"")||0===e.importMeshesNames.length,!n.jointName&&r&&null!==(o=C(e,n,t))&&(o.id=t,o.parent=i),n.children)for(var a=0;a<n.children.length;a++)S(e,n.children[a],o,r)},P=function(e){var t=e.currentScene;if(t)for(var i=0;i<t.nodes.length;i++)S(e,t.nodes[i],null);else for(var r in e.scenes)for(t=e.scenes[r],i=0;i<t.nodes.length;i++)S(e,t.nodes[i],null);for(function(e){for(var t in e.animations){var i=e.animations[t];if(i.channels&&i.samplers)for(var r=null,n=0;n<i.channels.length;n++){var s=i.channels[n],l=i.samplers[s.sampler];if(l){var c=null,u=null;i.parameters?(c=i.parameters[l.input],u=i.parameters[l.output]):(c=l.input,u=l.output);var _=a.GLTFUtils.GetBufferFromAccessor(e,e.accessors[c]),f=a.GLTFUtils.GetBufferFromAccessor(e,e.accessors[u]),p=s.target.id,m=e.scene.getNodeById(p);if(null===m&&(m=e.scene.getNodeByName(p)),null!==m){var g=m instanceof o.Bone,v=s.target.path,b=h.indexOf(v);-1!==b&&(v=d[b]);var y=o.Animation.ANIMATIONTYPE_MATRIX;g||("rotationQuaternion"===v?(y=o.Animation.ANIMATIONTYPE_QUATERNION,m.rotationQuaternion=new o.Quaternion):y=o.Animation.ANIMATIONTYPE_VECTOR3);var x=null,T=[],C=0,S=!1;g&&r&&r.getKeys().length===_.length&&(x=r,S=!0),S||(e.scene._blockEntityCollection=!!e.assetContainer,x=new o.Animation(t,g?"_matrix":v,1,y,o.Animation.ANIMATIONLOOPMODE_CYCLE),e.scene._blockEntityCollection=!1);for(var P=0;P<_.length;P++){var E=null;if("rotationQuaternion"===v?(E=o.Quaternion.FromArray([f[C],f[C+1],f[C+2],f[C+3]]),C+=4):(E=o.Vector3.FromArray([f[C],f[C+1],f[C+2]]),C+=3),g){var w=m,I=o.Vector3.Zero(),M=new o.Quaternion,O=o.Vector3.Zero(),A=w.getBaseMatrix();S&&r&&(A=r.getKeys()[P].value),A.decompose(O,M,I),"position"===v?I=E:"rotationQuaternion"===v?M=E:O=E,E=o.Matrix.Compose(O,M,I)}S?r&&(r.getKeys()[P].value=E):T.push({frame:_[P],value:E})}!S&&x&&(x.setKeys(T),m.animations.push(x)),r=x,e.scene.stopAnimation(m),e.scene.beginAnimation(m,0,_[_.length-1],!0,1)}else o.Tools.Warn("Creating animation named "+t+". But cannot find node named "+p+" to attach to")}}}}(e),i=0;i<e.scene.skeletons.length;i++){var n=e.scene.skeletons[i];e.scene.beginAnimation(n,0,Number.MAX_VALUE,!0,1)}},E=function(e,t,i){for(var r in t.uniforms){var n=t.uniforms[r],o=t.parameters[n];if(e.currentIdentifier===r&&o.semantic&&!o.source&&!o.node){var a=c.indexOf(o.semantic);if(-1!==a)return delete i[r],u[a]}}return e.currentIdentifier},w=function(e){for(var t in e.materials)O.LoadMaterialAsync(e,t,(function(){}),(function(){}))},I=function(){function e(){}return e.CreateRuntime=function(e,t,i){var r={extensions:{},accessors:{},buffers:{},bufferViews:{},meshes:{},lights:{},cameras:{},nodes:{},images:{},textures:{},shaders:{},programs:{},samplers:{},techniques:{},materials:{},animations:{},skins:{},extensionsUsed:[],scenes:{},buffersCount:0,shaderscount:0,scene:t,rootUrl:i,loadedBufferCount:0,loadedBufferViews:{},loadedShaderCount:0,importOnlyMeshes:!1,dummyNodes:[],assetContainer:null};return e.extensions&&_(e.extensions,"extensions",r),e.extensionsUsed&&_(e.extensionsUsed,"extensionsUsed",r),e.buffers&&function(e,t){for(var i in e){var r=e[i];t.buffers[i]=r,t.buffersCount++}}(e.buffers,r),e.bufferViews&&_(e.bufferViews,"bufferViews",r),e.accessors&&_(e.accessors,"accessors",r),e.meshes&&_(e.meshes,"meshes",r),e.lights&&_(e.lights,"lights",r),e.cameras&&_(e.cameras,"cameras",r),e.nodes&&_(e.nodes,"nodes",r),e.images&&_(e.images,"images",r),e.textures&&_(e.textures,"textures",r),e.shaders&&function(e,t){for(var i in e){var r=e[i];t.shaders[i]=r,t.shaderscount++}}(e.shaders,r),e.programs&&_(e.programs,"programs",r),e.samplers&&_(e.samplers,"samplers",r),e.techniques&&_(e.techniques,"techniques",r),e.materials&&_(e.materials,"materials",r),e.animations&&_(e.animations,"animations",r),e.skins&&_(e.skins,"skins",r),e.scenes&&(r.scenes=e.scenes),e.scene&&e.scenes&&(r.currentScene=e.scenes[e.scene]),r},e.LoadBufferAsync=function(e,t,i,r,n){var a=e.buffers[t];o.Tools.IsBase64(a.uri)?setTimeout((function(){return i(new Uint8Array(o.Tools.DecodeBase64(a.uri)))})):o.Tools.LoadFile(e.rootUrl+a.uri,(function(e){return i(new Uint8Array(e))}),n,void 0,!0,(function(e){e&&r(e.status+" "+e.statusText)}))},e.LoadTextureBufferAsync=function(e,t,i,r){var n=e.textures[t];if(n&&n.source)if(n.babylonTexture)i(null);else{var a=e.images[n.source];o.Tools.IsBase64(a.uri)?setTimeout((function(){return i(new Uint8Array(o.Tools.DecodeBase64(a.uri)))})):o.Tools.LoadFile(e.rootUrl+a.uri,(function(e){return i(new Uint8Array(e))}),void 0,void 0,!0,(function(e){e&&r(e.status+" "+e.statusText)}))}else r("")},e.CreateTextureAsync=function(e,t,i,r){var s=e.textures[t];if(s.babylonTexture)r(s.babylonTexture);else{var l=e.samplers[s.sampler],c=l.minFilter===n.ETextureFilterType.NEAREST_MIPMAP_NEAREST||l.minFilter===n.ETextureFilterType.NEAREST_MIPMAP_LINEAR||l.minFilter===n.ETextureFilterType.LINEAR_MIPMAP_NEAREST||l.minFilter===n.ETextureFilterType.LINEAR_MIPMAP_LINEAR,u=o.Texture.BILINEAR_SAMPLINGMODE,h=null==i?new Blob:new Blob([i]),d=URL.createObjectURL(h),_=function(){return URL.revokeObjectURL(d)},f=new o.Texture(d,e.scene,!c,!0,u,_,_);void 0!==l.wrapS&&(f.wrapU=a.GLTFUtils.GetWrapMode(l.wrapS)),void 0!==l.wrapT&&(f.wrapV=a.GLTFUtils.GetWrapMode(l.wrapT)),f.name=t,s.babylonTexture=f,r(f)}},e.LoadShaderStringAsync=function(e,t,i,r){var n=e.shaders[t];if(o.Tools.IsBase64(n.uri)){var a=atob(n.uri.split(",")[1]);i&&i(a)}else o.Tools.LoadFile(e.rootUrl+n.uri,i,void 0,void 0,!1,(function(e){e&&r&&r(e.status+" "+e.statusText)}))},e.LoadMaterialAsync=function(e,t,i,s){var h=e.materials[t];if(h.technique){var d=e.techniques[h.technique];if(!d){e.scene._blockEntityCollection=!!e.assetContainer;var _=new o.StandardMaterial(t,e.scene);return _._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,_.diffuseColor=new o.Color3(.5,.5,.5),_.sideOrientation=o.Material.CounterClockWiseSideOrientation,void i(_)}var f=e.programs[d.program],m=d.states,g=o.Effect.ShadersStore[f.vertexShader+"VertexShader"],v=o.Effect.ShadersStore[f.fragmentShader+"PixelShader"],b="",y="",x=new l(g),T=new l(v),C={},S=[],P=[],w=[];for(var I in d.uniforms){var M=d.uniforms[I],A=d.parameters[M];if(C[I]=A,!A.semantic||A.node||A.source)A.type===n.EParameterType.SAMPLER_2D?w.push(I):S.push(I);else{var R=c.indexOf(A.semantic);-1!==R?(S.push(u[R]),delete C[I]):S.push(I)}}for(var L in d.attributes){var B=d.attributes[L];if((N=d.parameters[B]).semantic){var F=p(N);F&&P.push(F)}}for(;!x.isEnd()&&x.getNextToken();)if(x.currentToken===r.IDENTIFIER){var D=!1;for(var L in d.attributes){B=d.attributes[L];var N=d.parameters[B];if(x.currentIdentifier===L&&N.semantic){b+=p(N),D=!0;break}}D||(b+=E(x,d,C))}else b+=x.currentString;for(;!T.isEnd()&&T.getNextToken();)T.currentToken===r.IDENTIFIER?y+=E(T,d,C):y+=T.currentString;var k={vertex:f.vertexShader+t,fragment:f.fragmentShader+t},V={attributes:P,uniforms:S,samplers:w,needAlphaBlending:m&&m.enable&&-1!==m.enable.indexOf(3042)};o.Effect.ShadersStore[f.vertexShader+t+"VertexShader"]=b,o.Effect.ShadersStore[f.fragmentShader+t+"PixelShader"]=y;var z=new o.ShaderMaterial(t,e.scene,k,V);if(z.onError=function(e,t,i){return function(r,n){t.dispose(!0),i("Cannot compile program named "+e.name+". Error: "+n+". Default material will be applied")}}(f,z,s),z.onCompiled=function(e,t,i,r,o,s){return function(l){!function(e,t,i,r,o){var s=r.values||i.parameters,l=i.uniforms,c=function(i){var c=o[i],u=c.type,h=s[l[i]];if(void 0===h&&(h=c.value),!h)return"continue";var d=function(e){return function(i){c.value&&e&&(t.setTexture(e,i),delete o[e])}};u===n.EParameterType.SAMPLER_2D?O.LoadTextureAsync(e,r.values?h:c.value,d(i),(function(){return d(null)})):c.value&&a.GLTFUtils.SetUniform(t,i,r.values?h:c.value,u)&&delete o[i]};for(var u in o)c(u)}(e,t,i,r,o),t.onBind=function(l){!function(e,t,i,r,o,s,l){var c=s.values||o.parameters;for(var u in i){var h=i[u],d=h.type;if(d===n.EParameterType.FLOAT_MAT2||d===n.EParameterType.FLOAT_MAT3||d===n.EParameterType.FLOAT_MAT4)if(!h.semantic||h.source||h.node){if(h.semantic&&(h.source||h.node)){var _=t.scene.getNodeByName(h.source||h.node||"");if(null===_&&(_=t.scene.getNodeById(h.source||h.node||"")),null===_)continue;a.GLTFUtils.SetMatrix(t.scene,_,h,u,r.getEffect())}}else a.GLTFUtils.SetMatrix(t.scene,e,h,u,r.getEffect());else{var f=c[o.uniforms[u]];if(!f)continue;if(d===n.EParameterType.SAMPLER_2D){var p=t.textures[s.values?f:h.value].babylonTexture;if(null==p)continue;r.getEffect().setTexture(u,p)}else a.GLTFUtils.SetUniform(r.getEffect(),u,f,d)}}l(r)}(l,e,o,t,i,r,s)}}}(e,z,d,h,C,i),z.sideOrientation=o.Material.CounterClockWiseSideOrientation,m&&m.functions){var G=m.functions;G.cullFace&&G.cullFace[0]!==n.ECullingType.BACK&&(z.backFaceCulling=!1);var U=G.blendFuncSeparate;U&&(U[0]===n.EBlendingFunction.SRC_ALPHA&&U[1]===n.EBlendingFunction.ONE_MINUS_SRC_ALPHA&&U[2]===n.EBlendingFunction.ONE&&U[3]===n.EBlendingFunction.ONE?z.alphaMode=o.Constants.ALPHA_COMBINE:U[0]===n.EBlendingFunction.ONE&&U[1]===n.EBlendingFunction.ONE&&U[2]===n.EBlendingFunction.ZERO&&U[3]===n.EBlendingFunction.ONE?z.alphaMode=o.Constants.ALPHA_ONEONE:U[0]===n.EBlendingFunction.SRC_ALPHA&&U[1]===n.EBlendingFunction.ONE&&U[2]===n.EBlendingFunction.ZERO&&U[3]===n.EBlendingFunction.ONE?z.alphaMode=o.Constants.ALPHA_ADD:U[0]===n.EBlendingFunction.ZERO&&U[1]===n.EBlendingFunction.ONE_MINUS_SRC_COLOR&&U[2]===n.EBlendingFunction.ONE&&U[3]===n.EBlendingFunction.ONE?z.alphaMode=o.Constants.ALPHA_SUBTRACT:U[0]===n.EBlendingFunction.DST_COLOR&&U[1]===n.EBlendingFunction.ZERO&&U[2]===n.EBlendingFunction.ONE&&U[3]===n.EBlendingFunction.ONE?z.alphaMode=o.Constants.ALPHA_MULTIPLY:U[0]===n.EBlendingFunction.SRC_ALPHA&&U[1]===n.EBlendingFunction.ONE_MINUS_SRC_COLOR&&U[2]===n.EBlendingFunction.ONE&&U[3]===n.EBlendingFunction.ONE&&(z.alphaMode=o.Constants.ALPHA_MAXIMIZED))}}else s&&s("No technique found.")},e}(),M=function(){function e(){}return e.RegisterExtension=function(t){e.Extensions[t.name]?o.Tools.Error('Tool with the same name "'+t.name+'" already exists'):e.Extensions[t.name]=t},e.prototype.dispose=function(){},e.prototype._importMeshAsync=function(e,t,i,r,n,a,l,c){var u=this;return t.useRightHandedSystem=!0,O.LoadRuntimeAsync(t,i,r,(function(t){t.assetContainer=n,t.importOnlyMeshes=!0,""===e?t.importMeshesNames=[]:"string"==typeof e?t.importMeshesNames=[e]:!e||e instanceof Array?(t.importMeshesNames=[],o.Tools.Warn("Argument meshesNames must be of type string or string[]")):t.importMeshesNames=[e],u._createNodes(t);var i=[],r=[];for(var l in t.nodes){var c=t.nodes[l];c.babylonNode instanceof o.AbstractMesh&&i.push(c.babylonNode)}for(var h in t.skins){var d=t.skins[h];d.babylonSkeleton instanceof o.Skeleton&&r.push(d.babylonSkeleton)}u._loadBuffersAsync(t,(function(){u._loadShadersAsync(t,(function(){w(t),P(t),!s.GLTFFileLoader.IncrementalLoading&&a&&a(i,r)}))})),s.GLTFFileLoader.IncrementalLoading&&a&&a(i,r)}),c),!0},e.prototype.importMeshAsync=function(e,t,i,r,n,o){var a=this;return new Promise((function(s,l){a._importMeshAsync(e,t,r,n,i,(function(e,t){s({meshes:e,particleSystems:[],skeletons:t,animationGroups:[],lights:[],transformNodes:[],geometries:[],spriteManagers:[]})}),o,(function(e){l(new Error(e))}))}))},e.prototype._loadAsync=function(e,t,i,r,n,o){var a=this;e.useRightHandedSystem=!0,O.LoadRuntimeAsync(e,t,i,(function(e){O.LoadRuntimeExtensionsAsync(e,(function(){a._createNodes(e),a._loadBuffersAsync(e,(function(){a._loadShadersAsync(e,(function(){w(e),P(e),s.GLTFFileLoader.IncrementalLoading||r()}))})),s.GLTFFileLoader.IncrementalLoading&&r()}),o)}),o)},e.prototype.loadAsync=function(e,t,i,r){var n=this;return new Promise((function(o,a){n._loadAsync(e,t,i,(function(){o()}),r,(function(e){a(new Error(e))}))}))},e.prototype._loadShadersAsync=function(e,t){var i=!1,r=function(i,r){O.LoadShaderStringAsync(e,i,(function(a){a instanceof ArrayBuffer||(e.loadedShaderCount++,a&&(o.Effect.ShadersStore[i+(r.type===n.EShaderType.VERTEX?"VertexShader":"PixelShader")]=a),e.loadedShaderCount===e.shaderscount&&t())}),(function(){o.Tools.Error("Error when loading shader program named "+i+" located at "+r.uri)}))};for(var a in e.shaders){i=!0;var s=e.shaders[a];s?r.bind(this,a,s)():o.Tools.Error("No shader named: "+a)}i||t()},e.prototype._loadBuffersAsync=function(e,t){var i=!1,r=function(i,r){O.LoadBufferAsync(e,i,(function(n){e.loadedBufferCount++,n&&(n.byteLength!=e.buffers[i].byteLength&&o.Tools.Error("Buffer named "+i+" is length "+n.byteLength+". Expected: "+r.byteLength),e.loadedBufferViews[i]=n),e.loadedBufferCount===e.buffersCount&&t()}),(function(){o.Tools.Error("Error when loading buffer named "+i+" located at "+r.uri)}))};for(var n in e.buffers){i=!0;var a=e.buffers[n];a?r.bind(this,n,a)():o.Tools.Error("No buffer named: "+n)}i||t()},e.prototype._createNodes=function(e){var t=e.currentScene;if(t)for(var i=0;i<t.nodes.length;i++)S(e,t.nodes[i],null);else for(var r in e.scenes)for(t=e.scenes[r],i=0;i<t.nodes.length;i++)S(e,t.nodes[i],null)},e.Extensions={},e}(),O=function(){function e(e){this._name=e}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),e.prototype.loadRuntimeAsync=function(e,t,i,r,n){return!1},e.prototype.loadRuntimeExtensionsAsync=function(e,t,i){return!1},e.prototype.loadBufferAsync=function(e,t,i,r,n){return!1},e.prototype.loadTextureBufferAsync=function(e,t,i,r){return!1},e.prototype.createTextureAsync=function(e,t,i,r,n){return!1},e.prototype.loadShaderStringAsync=function(e,t,i,r){return!1},e.prototype.loadMaterialAsync=function(e,t,i,r){return!1},e.LoadRuntimeAsync=function(t,i,r,n,o){e._ApplyExtensions((function(e){return e.loadRuntimeAsync(t,i,r,n,o)}),(function(){setTimeout((function(){n&&n(I.CreateRuntime(i.json,t,r))}))}))},e.LoadRuntimeExtensionsAsync=function(t,i,r){e._ApplyExtensions((function(e){return e.loadRuntimeExtensionsAsync(t,i,r)}),(function(){setTimeout((function(){i()}))}))},e.LoadBufferAsync=function(t,i,r,n,o){e._ApplyExtensions((function(e){return e.loadBufferAsync(t,i,r,n,o)}),(function(){I.LoadBufferAsync(t,i,r,n,o)}))},e.LoadTextureAsync=function(t,i,r,n){e._LoadTextureBufferAsync(t,i,(function(o){o&&e._CreateTextureAsync(t,i,o,r,n)}),n)},e.LoadShaderStringAsync=function(t,i,r,n){e._ApplyExtensions((function(e){return e.loadShaderStringAsync(t,i,r,n)}),(function(){I.LoadShaderStringAsync(t,i,r,n)}))},e.LoadMaterialAsync=function(t,i,r,n){e._ApplyExtensions((function(e){return e.loadMaterialAsync(t,i,r,n)}),(function(){I.LoadMaterialAsync(t,i,r,n)}))},e._LoadTextureBufferAsync=function(t,i,r,n){e._ApplyExtensions((function(e){return e.loadTextureBufferAsync(t,i,r,n)}),(function(){I.LoadTextureBufferAsync(t,i,r,n)}))},e._CreateTextureAsync=function(t,i,r,n,o){e._ApplyExtensions((function(e){return e.createTextureAsync(t,i,r,n,o)}),(function(){I.CreateTextureAsync(t,i,r,n)}))},e._ApplyExtensions=function(e,t){for(var i in M.Extensions)if(e(M.Extensions[i]))return;t()},e}();s.GLTFFileLoader._CreateGLTF1Loader=function(){return new M}},"../../../dev/loaders/src/glTF/1.0/glTFLoaderInterfaces.ts":(e,t,i)=>{var r,n,o,a,s,l,c,u;i.r(t),i.d(t,{EBlendingFunction:()=>u,EComponentType:()=>r,ECullingType:()=>c,EParameterType:()=>o,EShaderType:()=>n,ETextureFilterType:()=>s,ETextureFormat:()=>l,ETextureWrapMode:()=>a}),function(e){e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.FLOAT=5126]="FLOAT"}(r||(r={})),function(e){e[e.FRAGMENT=35632]="FRAGMENT",e[e.VERTEX=35633]="VERTEX"}(n||(n={})),function(e){e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D"}(o||(o={})),function(e){e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.REPEAT=10497]="REPEAT"}(a||(a={})),function(e){e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9728]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(s||(s={})),function(e){e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA"}(l||(l={})),function(e){e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(c||(c={})),function(e){e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE"}(u||(u={}))},"../../../dev/loaders/src/glTF/1.0/glTFLoaderUtils.ts":(e,t,i)=>{i.r(t),i.d(t,{GLTFUtils:()=>o});var r=i("../../../dev/loaders/src/glTF/1.0/glTFLoaderInterfaces.ts"),n=i("babylonjs/Misc/observable"),o=function(){function e(){}return e.SetMatrix=function(e,t,i,o,a){var s=null;if("MODEL"===i.semantic?s=t.getWorldMatrix():"PROJECTION"===i.semantic?s=e.getProjectionMatrix():"VIEW"===i.semantic?s=e.getViewMatrix():"MODELVIEWINVERSETRANSPOSE"===i.semantic?s=n.Matrix.Transpose(t.getWorldMatrix().multiply(e.getViewMatrix()).invert()):"MODELVIEW"===i.semantic?s=t.getWorldMatrix().multiply(e.getViewMatrix()):"MODELVIEWPROJECTION"===i.semantic?s=t.getWorldMatrix().multiply(e.getTransformMatrix()):"MODELINVERSE"===i.semantic?s=t.getWorldMatrix().invert():"VIEWINVERSE"===i.semantic?s=e.getViewMatrix().invert():"PROJECTIONINVERSE"===i.semantic?s=e.getProjectionMatrix().invert():"MODELVIEWINVERSE"===i.semantic?s=t.getWorldMatrix().multiply(e.getViewMatrix()).invert():"MODELVIEWPROJECTIONINVERSE"===i.semantic?s=t.getWorldMatrix().multiply(e.getTransformMatrix()).invert():"MODELINVERSETRANSPOSE"===i.semantic&&(s=n.Matrix.Transpose(t.getWorldMatrix().invert())),s)switch(i.type){case r.EParameterType.FLOAT_MAT2:a.setMatrix2x2(o,n.Matrix.GetAsMatrix2x2(s));break;case r.EParameterType.FLOAT_MAT3:a.setMatrix3x3(o,n.Matrix.GetAsMatrix3x3(s));break;case r.EParameterType.FLOAT_MAT4:a.setMatrix(o,s)}},e.SetUniform=function(e,t,i,o){switch(o){case r.EParameterType.FLOAT:return e.setFloat(t,i),!0;case r.EParameterType.FLOAT_VEC2:return e.setVector2(t,n.Vector2.FromArray(i)),!0;case r.EParameterType.FLOAT_VEC3:return e.setVector3(t,n.Vector3.FromArray(i)),!0;case r.EParameterType.FLOAT_VEC4:return e.setVector4(t,n.Vector4.FromArray(i)),!0;default:return!1}},e.GetWrapMode=function(e){switch(e){case r.ETextureWrapMode.CLAMP_TO_EDGE:return n.Texture.CLAMP_ADDRESSMODE;case r.ETextureWrapMode.MIRRORED_REPEAT:return n.Texture.MIRROR_ADDRESSMODE;case r.ETextureWrapMode.REPEAT:default:return n.Texture.WRAP_ADDRESSMODE}},e.GetByteStrideFromType=function(e){switch(e.type){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}},e.GetTextureFilterMode=function(e){switch(e){case r.ETextureFilterType.LINEAR:case r.ETextureFilterType.LINEAR_MIPMAP_NEAREST:case r.ETextureFilterType.LINEAR_MIPMAP_LINEAR:return n.Texture.TRILINEAR_SAMPLINGMODE;case r.ETextureFilterType.NEAREST:case r.ETextureFilterType.NEAREST_MIPMAP_NEAREST:return n.Texture.NEAREST_SAMPLINGMODE;default:return n.Texture.BILINEAR_SAMPLINGMODE}},e.GetBufferFromBufferView=function(e,t,i,n,o){i=t.byteOffset+i;var a=e.loadedBufferViews[t.buffer];if(i+n>a.byteLength)throw new Error("Buffer access is out of range");var s=a.buffer;switch(i+=a.byteOffset,o){case r.EComponentType.BYTE:return new Int8Array(s,i,n);case r.EComponentType.UNSIGNED_BYTE:return new Uint8Array(s,i,n);case r.EComponentType.SHORT:return new Int16Array(s,i,n);case r.EComponentType.UNSIGNED_SHORT:return new Uint16Array(s,i,n);default:return new Float32Array(s,i,n)}},e.GetBufferFromAccessor=function(t,i){var r=t.bufferViews[i.bufferView],n=i.count*e.GetByteStrideFromType(i);return e.GetBufferFromBufferView(t,r,i.byteOffset,n,i.componentType)},e.DecodeBufferToText=function(e){for(var t="",i=e.byteLength,r=0;r<i;++r)t+=String.fromCharCode(e[r]);return t},e.GetDefaultMaterial=function(t){if(!e._DefaultMaterial){n.Effect.ShadersStore.GLTFDefaultMaterialVertexShader=["precision highp float;","","uniform mat4 worldView;","uniform mat4 projection;","","attribute vec3 position;","","void main(void)","{"," gl_Position = projection * worldView * vec4(position, 1.0);","}"].join("\n"),n.Effect.ShadersStore.GLTFDefaultMaterialPixelShader=["precision highp float;","","uniform vec4 u_emission;","","void main(void)","{"," gl_FragColor = u_emission;","}"].join("\n");var i={attributes:["position"],uniforms:["worldView","projection","u_emission"],samplers:new Array,needAlphaBlending:!1};e._DefaultMaterial=new n.ShaderMaterial("GLTFDefaultMaterial",t,{vertex:"GLTFDefaultMaterial",fragment:"GLTFDefaultMaterial"},i),e._DefaultMaterial.setColor4("u_emission",new n.Color4(.5,.5,.5,1))}return e._DefaultMaterial},e._DefaultMaterial=null,e}()},"../../../dev/loaders/src/glTF/1.0/glTFMaterialsCommonExtension.ts":(e,t,i)=>{i.r(t),i.d(t,{GLTFMaterialsCommonExtension:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/loaders/src/glTF/1.0/glTFLoader.ts"),o=i("babylonjs/Misc/observable"),a=function(e){function t(){return e.call(this,"KHR_materials_common")||this}return(0,r.__extends)(t,e),t.prototype.loadRuntimeExtensionsAsync=function(e){if(!e.extensions)return!1;var t=e.extensions[this.name];if(!t)return!1;var i=t.lights;if(i)for(var r in i){var n=i[r];switch(n.type){case"ambient":var a=new o.HemisphericLight(n.name,new o.Vector3(0,1,0),e.scene),s=n.ambient;s&&(a.diffuse=o.Color3.FromArray(s.color||[1,1,1]));break;case"point":var l=new o.PointLight(n.name,new o.Vector3(10,10,10),e.scene),c=n.point;c&&(l.diffuse=o.Color3.FromArray(c.color||[1,1,1]));break;case"directional":var u=new o.DirectionalLight(n.name,new o.Vector3(0,-1,0),e.scene),h=n.directional;h&&(u.diffuse=o.Color3.FromArray(h.color||[1,1,1]));break;case"spot":var d=n.spot;d&&(new o.SpotLight(n.name,new o.Vector3(0,10,0),new o.Vector3(0,-1,0),d.fallOffAngle||Math.PI,d.fallOffExponent||0,e.scene).diffuse=o.Color3.FromArray(d.color||[1,1,1]));break;default:o.Tools.Warn('GLTF Material Common extension: light type "'+n.type+"” not supported")}}return!1},t.prototype.loadMaterialAsync=function(e,t,i,r){var n=e.materials[t];if(!n||!n.extensions)return!1;var a=n.extensions[this.name];if(!a)return!1;var s=new o.StandardMaterial(t,e.scene);return s.sideOrientation=o.Material.CounterClockWiseSideOrientation,"CONSTANT"===a.technique&&(s.disableLighting=!0),s.backFaceCulling=void 0!==a.doubleSided&&!a.doubleSided,s.alpha=void 0===a.values.transparency?1:a.values.transparency,s.specularPower=void 0===a.values.shininess?0:a.values.shininess,"string"==typeof a.values.ambient?this._loadTexture(e,a.values.ambient,s,"ambientTexture",r):s.ambientColor=o.Color3.FromArray(a.values.ambient||[0,0,0]),"string"==typeof a.values.diffuse?this._loadTexture(e,a.values.diffuse,s,"diffuseTexture",r):s.diffuseColor=o.Color3.FromArray(a.values.diffuse||[0,0,0]),"string"==typeof a.values.emission?this._loadTexture(e,a.values.emission,s,"emissiveTexture",r):s.emissiveColor=o.Color3.FromArray(a.values.emission||[0,0,0]),"string"==typeof a.values.specular?this._loadTexture(e,a.values.specular,s,"specularTexture",r):s.specularColor=o.Color3.FromArray(a.values.specular||[0,0,0]),!0},t.prototype._loadTexture=function(e,t,i,r,o){n.GLTFLoaderBase.LoadTextureBufferAsync(e,t,(function(o){n.GLTFLoaderBase.CreateTextureAsync(e,t,o,(function(e){return i[r]=e}))}),o)},t}(n.GLTFLoaderExtension);n.GLTFLoader.RegisterExtension(new a)},"../../../dev/loaders/src/glTF/1.0/index.ts":(e,t,i)=>{i.r(t),i.d(t,{EBlendingFunction:()=>o.EBlendingFunction,EComponentType:()=>o.EComponentType,ECullingType:()=>o.ECullingType,EParameterType:()=>o.EParameterType,EShaderType:()=>o.EShaderType,ETextureFilterType:()=>o.ETextureFilterType,ETextureFormat:()=>o.ETextureFormat,ETextureWrapMode:()=>o.ETextureWrapMode,GLTFBinaryExtension:()=>r.GLTFBinaryExtension,GLTFLoader:()=>n.GLTFLoader,GLTFLoaderBase:()=>n.GLTFLoaderBase,GLTFLoaderExtension:()=>n.GLTFLoaderExtension,GLTFMaterialsCommonExtension:()=>s.GLTFMaterialsCommonExtension,GLTFUtils:()=>a.GLTFUtils});var r=i("../../../dev/loaders/src/glTF/1.0/glTFBinaryExtension.ts"),n=i("../../../dev/loaders/src/glTF/1.0/glTFLoader.ts"),o=i("../../../dev/loaders/src/glTF/1.0/glTFLoaderInterfaces.ts"),a=i("../../../dev/loaders/src/glTF/1.0/glTFLoaderUtils.ts"),s=i("../../../dev/loaders/src/glTF/1.0/glTFMaterialsCommonExtension.ts")},"../../../dev/loaders/src/glTF/2.0/Extensions/EXT_lights_image_based.ts":(e,t,i)=>{i.r(t),i.d(t,{EXT_lights_image_based:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="EXT_lights_image_based",a=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null,delete this._lights},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._lights=t.lights}},e.prototype.loadSceneAsync=function(e,t){var i=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(r,o){i._loader._allMaterialsDirtyRequired=!0;var a=new Array;a.push(i._loader.loadSceneAsync(e,t)),i._loader.logOpen("".concat(r));var s=n.ArrayItem.Get("".concat(r,"/light"),i._lights,o.light);return a.push(i._loadLightAsync("/extensions/".concat(i.name,"/lights/").concat(o.light),s).then((function(e){i._loader.babylonScene.environmentTexture=e}))),i._loader.logClose(),Promise.all(a).then((function(){}))}))},e.prototype._loadLightAsync=function(e,t){var i=this;if(!t._loaded){var o=new Array;this._loader.logOpen("".concat(e));for(var a=new Array(t.specularImages.length),s=function(i){var r=t.specularImages[i];a[i]=new Array(r.length);for(var s=function(t){var s="".concat(e,"/specularImages/").concat(i,"/").concat(t);l._loader.logOpen("".concat(s));var c=r[t],u=n.ArrayItem.Get(s,l._loader.gltf.images,c);o.push(l._loader.loadImageAsync("/images/".concat(c),u).then((function(e){a[i][t]=e}))),l._loader.logClose()},c=0;c<r.length;c++)s(c)},l=this,c=0;c<t.specularImages.length;c++)s(c);this._loader.logClose(),t._loaded=Promise.all(o).then((function(){var n=new r.RawCubeTexture(i._loader.babylonScene,null,t.specularImageSize);if(n.name=t.name||"environment",t._babylonTexture=n,null!=t.intensity&&(n.level=t.intensity),t.rotation){var o=r.Quaternion.FromArray(t.rotation);i._loader.babylonScene.useRightHandedSystem||(o=r.Quaternion.Inverse(o)),r.Matrix.FromQuaternionToRef(o,n.getReflectionTextureMatrix())}if(!t.irradianceCoefficients)throw new Error("".concat(e,": Irradiance coefficients are missing"));var s=r.SphericalHarmonics.FromArray(t.irradianceCoefficients);s.scaleInPlace(t.intensity),s.convertIrradianceToLambertianRadiance();var l=r.SphericalPolynomial.FromHarmonics(s),c=(a.length-1)/r.Scalar.Log2(t.specularImageSize);return n.updateRGBDAsync(a,l,c)}))}return t._loaded.then((function(){return t._babylonTexture}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.ts":(e,t,i)=>{i.r(t),i.d(t,{EXT_mesh_gpu_instancing:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="EXT_mesh_gpu_instancing",a=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadNodeAsync=function(e,t,i){var o=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,a){o._loader._disableInstancedMesh++;var s=o._loader.loadNodeAsync("/nodes/".concat(t.index),t,i);if(o._loader._disableInstancedMesh--,!t._primitiveBabylonMeshes)return s;var l=new Array,c=0,u=function(t){if(null!=a.attributes[t]){var i=n.ArrayItem.Get("".concat(e,"/attributes/").concat(t),o._loader.gltf.accessors,a.attributes[t]);if(l.push(o._loader._loadFloatAccessorAsync("/accessors/".concat(i.bufferView),i)),0===c)c=i.count;else if(c!==i.count)throw new Error("".concat(e,"/attributes: Instance buffer accessors do not have the same count."))}else l.push(Promise.resolve(null))};return u("TRANSLATION"),u("ROTATION"),u("SCALE"),s.then((function(e){return Promise.all(l).then((function(i){var n=i[0],o=i[1],a=i[2],s=new Float32Array(16*c);r.TmpVectors.Vector3[0].copyFromFloats(0,0,0),r.TmpVectors.Quaternion[0].copyFromFloats(0,0,0,1),r.TmpVectors.Vector3[1].copyFromFloats(1,1,1);for(var l=0;l<c;++l)n&&r.Vector3.FromArrayToRef(n,3*l,r.TmpVectors.Vector3[0]),o&&r.Quaternion.FromArrayToRef(o,4*l,r.TmpVectors.Quaternion[0]),a&&r.Vector3.FromArrayToRef(a,3*l,r.TmpVectors.Vector3[1]),r.Matrix.ComposeToRef(r.TmpVectors.Vector3[1],r.TmpVectors.Quaternion[0],r.TmpVectors.Vector3[0],r.TmpVectors.Matrix[0]),r.TmpVectors.Matrix[0].copyToArray(s,16*l);for(var u=0,h=t._primitiveBabylonMeshes;u<h.length;u++)h[u].thinInstanceSetBuffer("matrix",s,16,!0);return e}))}))}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/EXT_meshopt_compression.ts":(e,t,i)=>{i.r(t),i.d(t,{EXT_meshopt_compression:()=>a});var r=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),n=i("babylonjs/Misc/observable"),o="EXT_meshopt_compression",a=function(){function e(e){this.name=o,this.enabled=e.isExtensionUsed(o),this._loader=e}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadBufferViewAsync=function(e,t){var i=this;return r.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,a){var s=t;if(s._meshOptData)return s._meshOptData;var l=r.ArrayItem.Get("".concat(e,"/buffer"),i._loader.gltf.buffers,a.buffer);return s._meshOptData=i._loader.loadBufferAsync("/buffers/".concat(l.index),l,a.byteOffset||0,a.byteLength).then((function(e){return n.MeshoptCompression.Default.decodeGltfBufferAsync(e,a.count,a.byteStride,a.mode,a.filter)})),s._meshOptData}))},e}();r.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/EXT_texture_avif.ts":(e,t,i)=>{i.r(t),i.d(t,{EXT_texture_avif:()=>o});var r=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),n="EXT_texture_avif",o=function(){function e(e){this.name=n,this._loader=e,this.enabled=e.isExtensionUsed(n)}return e.prototype.dispose=function(){this._loader=null},e.prototype._loadTextureAsync=function(e,t,i){var n=this;return r.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,a){var s=null==t.sampler?r.GLTFLoader.DefaultSampler:r.ArrayItem.Get("".concat(e,"/sampler"),n._loader.gltf.samplers,t.sampler),l=r.ArrayItem.Get("".concat(o,"/source"),n._loader.gltf.images,a.source);return n._loader._createTextureAsync(e,s,l,(function(e){i(e)}),void 0,!t._textureInfo.nonColorData)}))},e}();r.GLTFLoader.RegisterExtension(n,(function(e){return new o(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/EXT_texture_webp.ts":(e,t,i)=>{i.r(t),i.d(t,{EXT_texture_webp:()=>o});var r=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),n="EXT_texture_webp",o=function(){function e(e){this.name=n,this._loader=e,this.enabled=e.isExtensionUsed(n)}return e.prototype.dispose=function(){this._loader=null},e.prototype._loadTextureAsync=function(e,t,i){var n=this;return r.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,a){var s=null==t.sampler?r.GLTFLoader.DefaultSampler:r.ArrayItem.Get("".concat(e,"/sampler"),n._loader.gltf.samplers,t.sampler),l=r.ArrayItem.Get("".concat(o,"/source"),n._loader.gltf.images,a.source);return n._loader._createTextureAsync(e,s,l,(function(e){i(e)}),void 0,!t._textureInfo.nonColorData)}))},e}();r.GLTFLoader.RegisterExtension(n,(function(e){return new o(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/ExtrasAsMetadata.ts":(e,t,i)=>{i.r(t),i.d(t,{ExtrasAsMetadata:()=>o});var r=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),n="ExtrasAsMetadata",o=function(){function e(e){this.name=n,this.enabled=!0,this._loader=e}return e.prototype._assignExtras=function(e,t){if(t.extras&&Object.keys(t.extras).length>0){var i=e.metadata=e.metadata||{};(i.gltf=i.gltf||{}).extras=t.extras}},e.prototype.dispose=function(){this._loader=null},e.prototype.loadNodeAsync=function(e,t,i){var r=this;return this._loader.loadNodeAsync(e,t,(function(e){r._assignExtras(e,t),i(e)}))},e.prototype.loadCameraAsync=function(e,t,i){var r=this;return this._loader.loadCameraAsync(e,t,(function(e){r._assignExtras(e,t),i(e)}))},e.prototype.createMaterial=function(e,t,i){var r=this._loader.createMaterial(e,t,i);return this._assignExtras(r,t),r},e}();r.GLTFLoader.RegisterExtension(n,(function(e){return new o(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_animation_pointer.data.ts":(e,t,i)=>{i.r(t),i.d(t,{animationPointerTree:()=>g});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/observable"),o=i("../../../dev/loaders/src/glTF/2.0/glTFLoaderAnimation.ts");function a(e,t,i,r){return n.Color3.FromArray(t,i).scale(r)}function s(e,t,i,r){return t[i]*r}function l(e,t,i,r){return-t[i]*r}function c(e,t,i,r){return t[i+1]*r}function u(e,t,i,r){return t[i]*r*2}function h(e){return{scale:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".uScale"),s,(function(){return 2})),new _(n.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".vScale"),c,(function(){return 2}))],offset:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".uOffset"),s,(function(){return 2})),new _(n.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".vOffset"),c,(function(){return 2}))],rotation:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".wAng"),l,(function(){return 1}))]}}var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.__extends)(t,e),t.prototype.buildAnimations=function(e,t,i,r,n){n(e._babylonCamera,this._buildAnimation(t,i,r))},t}(o.AnimationPropertyInfo),_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.__extends)(t,e),t.prototype.buildAnimations=function(e,t,i,r,n){for(var o in e._data)n(e._data[o].babylonMaterial,this._buildAnimation(t,i,r))},t}(o.AnimationPropertyInfo),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.__extends)(t,e),t.prototype.buildAnimations=function(e,t,i,r,n){n(e._babylonLight,this._buildAnimation(t,i,r))},t}(o.AnimationPropertyInfo),p={__array__:(0,r.__assign)({__target__:!0},o.nodeAnimationData)},m={__array__:{__target__:!0,orthographic:{xmag:[new d(n.Animation.ANIMATIONTYPE_FLOAT,"orthoLeft",l,(function(){return 1})),new d(n.Animation.ANIMATIONTYPE_FLOAT,"orthoRight",c,(function(){return 1}))],ymag:[new d(n.Animation.ANIMATIONTYPE_FLOAT,"orthoBottom",l,(function(){return 1})),new d(n.Animation.ANIMATIONTYPE_FLOAT,"orthoTop",c,(function(){return 1}))],zfar:[new d(n.Animation.ANIMATIONTYPE_FLOAT,"maxZ",s,(function(){return 1}))],znear:[new d(n.Animation.ANIMATIONTYPE_FLOAT,"minZ",s,(function(){return 1}))]},perspective:{yfov:[new d(n.Animation.ANIMATIONTYPE_FLOAT,"fov",s,(function(){return 1}))],zfar:[new d(n.Animation.ANIMATIONTYPE_FLOAT,"maxZ",s,(function(){return 1}))],znear:[new d(n.Animation.ANIMATIONTYPE_FLOAT,"minZ",s,(function(){return 1}))]}}},g={nodes:p,materials:{__array__:{__target__:!0,pbrMetallicRoughness:{baseColorFactor:[new _(n.Animation.ANIMATIONTYPE_COLOR3,"albedoColor",a,(function(){return 4})),new _(n.Animation.ANIMATIONTYPE_FLOAT,"alpha",(function(e,t,i,r){return t[i+3]*r}),(function(){return 4}))],metallicFactor:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"metallic",s,(function(){return 1}))],roughnessFactor:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"roughness",s,(function(){return 1}))],baseColorTexture:{extensions:{KHR_texture_transform:h("albedoTexture")}},metallicRoughnessTexture:{extensions:{KHR_texture_transform:h("metallicTexture")}}},emissiveFactor:[new _(n.Animation.ANIMATIONTYPE_COLOR3,"emissiveColor",a,(function(){return 3}))],normalTexture:{scale:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"bumpTexture.level",s,(function(){return 1}))],extensions:{KHR_texture_transform:h("bumpTexture")}},occlusionTexture:{strength:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"ambientTextureStrength",s,(function(){return 1}))],extensions:{KHR_texture_transform:h("ambientTexture")}},emissiveTexture:{extensions:{KHR_texture_transform:h("emissiveTexture")}},extensions:{KHR_materials_anisotropy:{anisotropyStrength:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"anisotropy.intensity",s,(function(){return 1}))],anisotropyRotation:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"anisotropy.angle",s,(function(){return 1}))],anisotropyTexture:{extensions:{KHR_texture_transform:h("anisotropy.texture")}}},KHR_materials_clearcoat:{clearcoatFactor:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"clearCoat.intensity",s,(function(){return 1}))],clearcoatRoughnessFactor:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"clearCoat.roughness",s,(function(){return 1}))],clearcoatTexture:{extensions:{KHR_texture_transform:h("clearCoat.texture")}},clearcoatNormalTexture:{scale:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"clearCoat.bumpTexture.level",s,(function(){return 1}))],extensions:{KHR_texture_transform:h("clearCoat.bumpTexture")}},clearcoatRoughnessTexture:{extensions:{KHR_texture_transform:h("clearCoat.textureRoughness")}}},KHR_materials_dispersion:{dispersion:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"subSurface.dispersion",s,(function(){return 1}))]},KHR_materials_emissive_strength:{emissiveStrength:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"emissiveIntensity",s,(function(){return 1}))]},KHR_materials_ior:{ior:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"indexOfRefraction",s,(function(){return 1}))]},KHR_materials_iridescence:{iridescenceFactor:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"iridescence.intensity",s,(function(){return 1}))],iridescenceIor:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"iridescence.indexOfRefraction",s,(function(){return 1}))],iridescenceThicknessMinimum:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"iridescence.minimumThickness",s,(function(){return 1}))],iridescenceThicknessMaximum:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"iridescence.maximumThickness",s,(function(){return 1}))],iridescenceTexture:{extensions:{KHR_texture_transform:h("iridescence.texture")}},iridescenceThicknessTexture:{extensions:{KHR_texture_transform:h("iridescence.thicknessTexture")}}},KHR_materials_sheen:{sheenColorFactor:[new _(n.Animation.ANIMATIONTYPE_COLOR3,"sheen.color",a,(function(){return 3}))],sheenRoughnessFactor:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"sheen.roughness",s,(function(){return 1}))],sheenColorTexture:{extensions:{KHR_texture_transform:h("sheen.texture")}},sheenRoughnessTexture:{extensions:{KHR_texture_transform:h("sheen.textureRoughness")}}},KHR_materials_specular:{specularFactor:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"metallicF0Factor",s,(function(){return 1}))],specularColorFactor:[new _(n.Animation.ANIMATIONTYPE_COLOR3,"metallicReflectanceColor",a,(function(){return 3}))],specularTexture:{extensions:{KHR_texture_transform:h("metallicReflectanceTexture")}},specularColorTexture:{extensions:{KHR_texture_transform:h("reflectanceTexture")}}},KHR_materials_transmission:{transmissionFactor:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"subSurface.refractionIntensity",s,(function(){return 1}))],transmissionTexture:{extensions:{KHR_texture_transform:h("subSurface.refractionIntensityTexture")}}},KHR_materials_volume:{attenuationColor:[new _(n.Animation.ANIMATIONTYPE_COLOR3,"subSurface.tintColor",a,(function(){return 3}))],attenuationDistance:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"subSurface.tintColorAtDistance",s,(function(){return 1}))],thicknessFactor:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"subSurface.maximumThickness",s,(function(){return 1}))],thicknessTexture:{extensions:{KHR_texture_transform:h("subSurface.thicknessTexture")}}},KHR_materials_diffuse_transmission:{diffuseTransmissionFactor:[new _(n.Animation.ANIMATIONTYPE_FLOAT,"subSurface.translucencyIntensity",s,(function(){return 1}))],diffuseTransmissionTexture:{extensions:{KHR_texture_transform:h("subSurface.translucencyIntensityTexture")}},diffuseTransmissionColorFactor:[new _(n.Animation.ANIMATIONTYPE_COLOR3,"subSurface.translucencyColor",a,(function(){return 3}))],diffuseTransmissionColorTexture:{extensions:{KHR_texture_transform:h("subSurface.translucencyColorTexture")}}}}}},cameras:m,extensions:{KHR_lights_punctual:{lights:{__array__:{__target__:!0,color:[new f(n.Animation.ANIMATIONTYPE_COLOR3,"diffuse",a,(function(){return 3}))],intensity:[new f(n.Animation.ANIMATIONTYPE_FLOAT,"intensity",s,(function(){return 1}))],range:[new f(n.Animation.ANIMATIONTYPE_FLOAT,"range",s,(function(){return 1}))],spot:{innerConeAngle:[new f(n.Animation.ANIMATIONTYPE_FLOAT,"innerAngle",u,(function(){return 1}))],outerConeAngle:[new f(n.Animation.ANIMATIONTYPE_FLOAT,"angle",u,(function(){return 1}))]}}}}}}},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_animation_pointer.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_animation_pointer:()=>u});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o=i("babylonjs/Misc/observable"),a=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_animation_pointer.data.ts"),s=i("../../../dev/loaders/src/glTF/2.0/Extensions/gltfPathToObjectConverter.ts"),l="KHR_animation_pointer",c=function(e){function t(t){return e.call(this,t,a.animationPointerTree)||this}return(0,r.__extends)(t,e),t}(s.GLTFPathToObjectConverter),u=function(){function e(e){this.name=l,this._loader=e,this._pathToObjectConverter=new c(this._loader.gltf)}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._loader.isExtensionUsed(l)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._loader=null,delete this._pathToObjectConverter},e.prototype._loadAnimationChannelAsync=function(e,t,i,r,n){var a,s=null===(a=r.target.extensions)||void 0===a?void 0:a.KHR_animation_pointer;if(!s||!this._pathToObjectConverter)return null;"pointer"!==r.target.path&&o.Logger.Warn("".concat(e,"/target/path: Value (").concat(r.target.path,") must be (").concat("pointer",") when using the ").concat(this.name," extension")),null!=r.target.node&&o.Logger.Warn("".concat(e,"/target/node: Value (").concat(r.target.node,") must not be present when using the ").concat(this.name," extension"));var l="".concat(e,"/extensions/").concat(this.name),c=s.pointer;if(!c)throw new Error("".concat(l,": Pointer is missing"));try{var u=this._pathToObjectConverter.convert(c);return this._loader._loadAnimationChannelFromTargetInfoAsync(e,t,i,r,u,n)}catch(e){return o.Logger.Warn("".concat(l,"/pointer: Invalid pointer (").concat(c,") skipped")),null}},e}();n.GLTFLoader.RegisterExtension(l,(function(e){return new u(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_draco_mesh_compression.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_draco_mesh_compression:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_draco_mesh_compression",a=function(){function e(e){this.name=o,this.useNormalizedFlagFromAccessor=!0,this._loader=e,this.enabled=r.DracoCompression.DecoderAvailable&&this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this.dracoCompression,this._loader=null},e.prototype._loadVertexDataAsync=function(e,t,i){var o=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(a,s){if(null!=t.mode&&4!==t.mode&&5!==t.mode)throw new Error("".concat(e,": Unsupported mode ").concat(t.mode));var l={},c={},u=function(e,r){var a=s.attributes[e];if(null!=a&&(i._delayInfo=i._delayInfo||[],-1===i._delayInfo.indexOf(r)&&i._delayInfo.push(r),l[r]=a,o.useNormalizedFlagFromAccessor)){var u=n.ArrayItem.TryGet(o._loader.gltf.accessors,t.attributes[e]);u&&(c[r]=u.normalized||!1)}};u("POSITION",r.VertexBuffer.PositionKind),u("NORMAL",r.VertexBuffer.NormalKind),u("TANGENT",r.VertexBuffer.TangentKind),u("TEXCOORD_0",r.VertexBuffer.UVKind),u("TEXCOORD_1",r.VertexBuffer.UV2Kind),u("TEXCOORD_2",r.VertexBuffer.UV3Kind),u("TEXCOORD_3",r.VertexBuffer.UV4Kind),u("TEXCOORD_4",r.VertexBuffer.UV5Kind),u("TEXCOORD_5",r.VertexBuffer.UV6Kind),u("JOINTS_0",r.VertexBuffer.MatricesIndicesKind),u("WEIGHTS_0",r.VertexBuffer.MatricesWeightsKind),u("COLOR_0",r.VertexBuffer.ColorKind);var h=n.ArrayItem.Get(a,o._loader.gltf.bufferViews,s.bufferView);return h._dracoBabylonGeometry||(h._dracoBabylonGeometry=o._loader.loadBufferViewAsync("/bufferViews/".concat(h.index),h).then((function(t){return(o.dracoCompression||r.DracoCompression.Default)._decodeMeshToGeometryForGltfAsync(i.name,o._loader.babylonScene,t,l,c).catch((function(t){throw new Error("".concat(e,": ").concat(t.message))}))}))),h._dracoBabylonGeometry}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_interactivity.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_interactivity:()=>l});var r=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),n=i("babylonjs/Misc/observable"),o=i("../../../dev/loaders/src/glTF/2.0/Extensions/interactivityFunctions.ts"),a=i("../../../dev/loaders/src/glTF/2.0/Extensions/interactivityPathToObjectConverter.ts"),s="KHR_interactivity",l=function(){function e(e){this._loader=e,this.name=s,this.enabled=this._loader.isExtensionUsed(s),this._pathConverter=new a.InteractivityPathToObjectConverter(this._loader.gltf)}return e.prototype.dispose=function(){this._loader=null,delete this._pathConverter},e.prototype.onReady=function(){var e;if(this._loader.babylonScene&&this._pathConverter){var t=this._loader.babylonScene,i=null===(e=this._loader.gltf.extensions)||void 0===e?void 0:e.KHR_interactivity,r=(0,o.convertGLTFToSerializedFlowGraph)(i),a=new n.FlowGraphCoordinator({scene:t});n.FlowGraph.Parse(r,{coordinator:a,pathConverter:this._pathConverter}),a.start()}},e}();r.GLTFLoader.RegisterExtension(s,(function(e){return new l(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_lights_punctual.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_lights:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_lights_punctual",a=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null,delete this._lights},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._lights=t.lights,n.ArrayItem.Assign(this._lights)}},e.prototype.loadNodeAsync=function(e,t,i){var o=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(a,s){return o._loader._allMaterialsDirtyRequired=!0,o._loader.loadNodeAsync(e,t,(function(e){var t,l=n.ArrayItem.Get(a,o._lights,s.light),c=l.name||e.name;switch(o._loader.babylonScene._blockEntityCollection=!!o._loader._assetContainer,l.type){case"directional":var u=new r.DirectionalLight(c,r.Vector3.Backward(),o._loader.babylonScene);u.position.setAll(0),t=u;break;case"point":t=new r.PointLight(c,r.Vector3.Zero(),o._loader.babylonScene);break;case"spot":var h=new r.SpotLight(c,r.Vector3.Zero(),r.Vector3.Backward(),0,1,o._loader.babylonScene);h.angle=2*(l.spot&&l.spot.outerConeAngle||Math.PI/4),h.innerAngle=2*(l.spot&&l.spot.innerConeAngle||0),t=h;break;default:throw o._loader.babylonScene._blockEntityCollection=!1,new Error("".concat(a,": Invalid light type (").concat(l.type,")"))}t._parentContainer=o._loader._assetContainer,o._loader.babylonScene._blockEntityCollection=!1,l._babylonLight=t,t.falloffType=r.Light.FALLOFF_GLTF,t.diffuse=l.color?r.Color3.FromArray(l.color):r.Color3.White(),t.intensity=null==l.intensity?1:l.intensity,t.range=null==l.range?Number.MAX_VALUE:l.range,t.parent=e,o._loader._babylonLights.push(t),n.GLTFLoader.AddPointerMetadata(t,a),i(e)}))}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_anisotropy.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_materials_anisotropy:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_materials_anisotropy",a=function(){function e(e){this.name=o,this.order=195,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var r=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){var a=new Array;return a.push(r._loader.loadMaterialPropertiesAsync(e,t,i)),a.push(r._loadIridescencePropertiesAsync(n,o,i)),Promise.all(a).then((function(){}))}))},e.prototype._loadIridescencePropertiesAsync=function(e,t,i){var n,o;if(!(i instanceof r.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));var a=new Array;return i.anisotropy.isEnabled=!0,i.anisotropy.intensity=null!==(n=t.anisotropyStrength)&&void 0!==n?n:0,i.anisotropy.angle=null!==(o=t.anisotropyRotation)&&void 0!==o?o:0,t.anisotropyTexture&&a.push(this._loader.loadTextureInfoAsync("".concat(e,"/anisotropyTexture"),t.anisotropyTexture,(function(e){e.name="".concat(i.name," (Anisotropy Intensity)"),i.anisotropy.texture=e}))),Promise.all(a).then((function(){}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_clearcoat.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_materials_clearcoat:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_materials_clearcoat",a=function(){function e(e){this.name=o,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var r=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){var a=new Array;return a.push(r._loader.loadMaterialPropertiesAsync(e,t,i)),a.push(r._loadClearCoatPropertiesAsync(n,o,i)),Promise.all(a).then((function(){}))}))},e.prototype._loadClearCoatPropertiesAsync=function(e,t,i){if(!(i instanceof r.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));var n=new Array;return i.clearCoat.isEnabled=!0,i.clearCoat.useRoughnessFromMainTexture=!1,i.clearCoat.remapF0OnInterfaceChange=!1,null!=t.clearcoatFactor?i.clearCoat.intensity=t.clearcoatFactor:i.clearCoat.intensity=0,t.clearcoatTexture&&n.push(this._loader.loadTextureInfoAsync("".concat(e,"/clearcoatTexture"),t.clearcoatTexture,(function(e){e.name="".concat(i.name," (ClearCoat Intensity)"),i.clearCoat.texture=e}))),null!=t.clearcoatRoughnessFactor?i.clearCoat.roughness=t.clearcoatRoughnessFactor:i.clearCoat.roughness=0,t.clearcoatRoughnessTexture&&(t.clearcoatRoughnessTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync("".concat(e,"/clearcoatRoughnessTexture"),t.clearcoatRoughnessTexture,(function(e){e.name="".concat(i.name," (ClearCoat Roughness)"),i.clearCoat.textureRoughness=e})))),t.clearcoatNormalTexture&&(t.clearcoatNormalTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync("".concat(e,"/clearcoatNormalTexture"),t.clearcoatNormalTexture,(function(e){e.name="".concat(i.name," (ClearCoat Normal)"),i.clearCoat.bumpTexture=e}))),i.invertNormalMapX=!i.getScene().useRightHandedSystem,i.invertNormalMapY=i.getScene().useRightHandedSystem,null!=t.clearcoatNormalTexture.scale&&(i.clearCoat.bumpTexture.level=t.clearcoatNormalTexture.scale)),Promise.all(n).then((function(){}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_materials_diffuse_transmission:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_materials_diffuse_transmission",a=function(){function e(e){this.name=o,this.order=174,this._loader=e,this.enabled=this._loader.isExtensionUsed(o),this.enabled&&(e.parent.transparencyAsCoverage=!0)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var r=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){var a=new Array;return a.push(r._loader.loadMaterialBasePropertiesAsync(e,t,i)),a.push(r._loader.loadMaterialPropertiesAsync(e,t,i)),a.push(r._loadTranslucentPropertiesAsync(n,t,i,o)),Promise.all(a).then((function(){}))}))},e.prototype._loadTranslucentPropertiesAsync=function(e,t,i,n){if(!(i instanceof r.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));var o=i;if(o.subSurface.isTranslucencyEnabled=!0,o.subSurface.volumeIndexOfRefraction=1,o.subSurface.minimumThickness=0,o.subSurface.maximumThickness=0,o.subSurface.useAlbedoToTintTranslucency=!1,void 0===n.diffuseTransmissionFactor)return o.subSurface.translucencyIntensity=0,o.subSurface.isTranslucencyEnabled=!1,Promise.resolve();o.subSurface.translucencyIntensity=n.diffuseTransmissionFactor;var a=new Array;return o.subSurface.useGltfStyleTextures=!0,n.diffuseTransmissionTexture&&(n.diffuseTransmissionTexture.nonColorData=!0,a.push(this._loader.loadTextureInfoAsync("".concat(e,"/diffuseTransmissionTexture"),n.diffuseTransmissionTexture).then((function(e){o.subSurface.translucencyIntensityTexture=e})))),void 0!==n.diffuseTransmissionColorFactor?o.subSurface.translucencyColor=r.Color3.FromArray(n.diffuseTransmissionColorFactor):o.subSurface.translucencyColor=r.Color3.White(),n.diffuseTransmissionColorTexture&&a.push(this._loader.loadTextureInfoAsync("".concat(e,"/diffuseTransmissionColorTexture"),n.diffuseTransmissionColorTexture).then((function(e){o.subSurface.translucencyColorTexture=e}))),Promise.all(a).then((function(){}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_dispersion.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_materials_dispersion:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_materials_dispersion",a=function(){function e(e){this.name=o,this.order=174,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var r=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){var a=new Array;return a.push(r._loader.loadMaterialBasePropertiesAsync(e,t,i)),a.push(r._loader.loadMaterialPropertiesAsync(e,t,i)),a.push(r._loadDispersionPropertiesAsync(n,t,i,o)),Promise.all(a).then((function(){}))}))},e.prototype._loadDispersionPropertiesAsync=function(e,t,i,n){if(!(i instanceof r.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));return i.subSurface.isRefractionEnabled&&n.dispersion?(i.subSurface.isDispersionEnabled=!0,i.subSurface.dispersion=n.dispersion,Promise.resolve()):Promise.resolve()},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_emissive_strength.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_materials_emissive_strength:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_materials_emissive_strength",a=function(){function e(e){this.name=o,this.order=170,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var r=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){return r._loader.loadMaterialPropertiesAsync(e,t,i).then((function(){r._loadEmissiveProperties(n,o,i)}))}))},e.prototype._loadEmissiveProperties=function(e,t,i){if(!(i instanceof r.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));void 0!==t.emissiveStrength&&(i.emissiveIntensity=t.emissiveStrength)},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_ior.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_materials_ior:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_materials_ior",a=function(){function e(e){this.name=o,this.order=180,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var r=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){var a=new Array;return a.push(r._loader.loadMaterialPropertiesAsync(e,t,i)),a.push(r._loadIorPropertiesAsync(n,o,i)),Promise.all(a).then((function(){}))}))},e.prototype._loadIorPropertiesAsync=function(t,i,n){if(!(n instanceof r.PBRMaterial))throw new Error("".concat(t,": Material type not supported"));return void 0!==i.ior?n.indexOfRefraction=i.ior:n.indexOfRefraction=e._DEFAULT_IOR,Promise.resolve()},e._DEFAULT_IOR=1.5,e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_iridescence.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_materials_iridescence:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_materials_iridescence",a=function(){function e(e){this.name=o,this.order=195,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var r=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){var a=new Array;return a.push(r._loader.loadMaterialPropertiesAsync(e,t,i)),a.push(r._loadIridescencePropertiesAsync(n,o,i)),Promise.all(a).then((function(){}))}))},e.prototype._loadIridescencePropertiesAsync=function(e,t,i){var n,o,a,s,l;if(!(i instanceof r.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));var c=new Array;return i.iridescence.isEnabled=!0,i.iridescence.intensity=null!==(n=t.iridescenceFactor)&&void 0!==n?n:0,i.iridescence.indexOfRefraction=null!==(a=null!==(o=t.iridescenceIor)&&void 0!==o?o:t.iridescenceIOR)&&void 0!==a?a:1.3,i.iridescence.minimumThickness=null!==(s=t.iridescenceThicknessMinimum)&&void 0!==s?s:100,i.iridescence.maximumThickness=null!==(l=t.iridescenceThicknessMaximum)&&void 0!==l?l:400,t.iridescenceTexture&&c.push(this._loader.loadTextureInfoAsync("".concat(e,"/iridescenceTexture"),t.iridescenceTexture,(function(e){e.name="".concat(i.name," (Iridescence Intensity)"),i.iridescence.texture=e}))),t.iridescenceThicknessTexture&&c.push(this._loader.loadTextureInfoAsync("".concat(e,"/iridescenceThicknessTexture"),t.iridescenceThicknessTexture,(function(e){e.name="".concat(i.name," (Iridescence Thickness)"),i.iridescence.thicknessTexture=e}))),Promise.all(c).then((function(){}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_materials_pbrSpecularGlossiness:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_materials_pbrSpecularGlossiness",a=function(){function e(e){this.name=o,this.order=200,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var r=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){var a=new Array;return a.push(r._loader.loadMaterialBasePropertiesAsync(e,t,i)),a.push(r._loadSpecularGlossinessPropertiesAsync(n,o,i)),r._loader.loadMaterialAlphaProperties(e,t,i),Promise.all(a).then((function(){}))}))},e.prototype._loadSpecularGlossinessPropertiesAsync=function(e,t,i){if(!(i instanceof r.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));var n=new Array;return i.metallic=null,i.roughness=null,t.diffuseFactor?(i.albedoColor=r.Color3.FromArray(t.diffuseFactor),i.alpha=t.diffuseFactor[3]):i.albedoColor=r.Color3.White(),i.reflectivityColor=t.specularFactor?r.Color3.FromArray(t.specularFactor):r.Color3.White(),i.microSurface=null==t.glossinessFactor?1:t.glossinessFactor,t.diffuseTexture&&n.push(this._loader.loadTextureInfoAsync("".concat(e,"/diffuseTexture"),t.diffuseTexture,(function(e){e.name="".concat(i.name," (Diffuse)"),i.albedoTexture=e}))),t.specularGlossinessTexture&&(n.push(this._loader.loadTextureInfoAsync("".concat(e,"/specularGlossinessTexture"),t.specularGlossinessTexture,(function(e){e.name="".concat(i.name," (Specular Glossiness)"),i.reflectivityTexture=e,i.reflectivityTexture.hasAlpha=!0}))),i.useMicroSurfaceFromReflectivityMapAlpha=!0),Promise.all(n).then((function(){}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_sheen.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_materials_sheen:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_materials_sheen",a=function(){function e(e){this.name=o,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var r=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){var a=new Array;return a.push(r._loader.loadMaterialPropertiesAsync(e,t,i)),a.push(r._loadSheenPropertiesAsync(n,o,i)),Promise.all(a).then((function(){}))}))},e.prototype._loadSheenPropertiesAsync=function(e,t,i){if(!(i instanceof r.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));var n=new Array;return i.sheen.isEnabled=!0,i.sheen.intensity=1,null!=t.sheenColorFactor?i.sheen.color=r.Color3.FromArray(t.sheenColorFactor):i.sheen.color=r.Color3.Black(),t.sheenColorTexture&&n.push(this._loader.loadTextureInfoAsync("".concat(e,"/sheenColorTexture"),t.sheenColorTexture,(function(e){e.name="".concat(i.name," (Sheen Color)"),i.sheen.texture=e}))),void 0!==t.sheenRoughnessFactor?i.sheen.roughness=t.sheenRoughnessFactor:i.sheen.roughness=0,t.sheenRoughnessTexture&&(t.sheenRoughnessTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync("".concat(e,"/sheenRoughnessTexture"),t.sheenRoughnessTexture,(function(e){e.name="".concat(i.name," (Sheen Roughness)"),i.sheen.textureRoughness=e})))),i.sheen.albedoScaling=!0,i.sheen.useRoughnessFromMainTexture=!1,Promise.all(n).then((function(){}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_specular.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_materials_specular:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_materials_specular",a=function(){function e(e){this.name=o,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var r=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){var a=new Array;return a.push(r._loader.loadMaterialPropertiesAsync(e,t,i)),a.push(r._loadSpecularPropertiesAsync(n,o,i)),Promise.all(a).then((function(){}))}))},e.prototype._loadSpecularPropertiesAsync=function(e,t,i){if(!(i instanceof r.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));var n=new Array;return void 0!==t.specularFactor&&(i.metallicF0Factor=t.specularFactor),void 0!==t.specularColorFactor&&(i.metallicReflectanceColor=r.Color3.FromArray(t.specularColorFactor)),t.specularTexture&&(t.specularTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync("".concat(e,"/specularTexture"),t.specularTexture,(function(e){e.name="".concat(i.name," (Specular F0 Strength)"),i.metallicReflectanceTexture=e,i.useOnlyMetallicFromMetallicReflectanceTexture=!0})))),t.specularColorTexture&&n.push(this._loader.loadTextureInfoAsync("".concat(e,"/specularColorTexture"),t.specularColorTexture,(function(e){e.name="".concat(i.name," (Specular F0 Color)"),i.reflectanceTexture=e}))),Promise.all(n).then((function(){}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_transmission.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_materials_transmission:()=>l});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/observable"),o=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),a=function(){function e(t,i){var o=this;this._opaqueRenderTarget=null,this._opaqueMeshesCache=[],this._transparentMeshesCache=[],this._materialObservers={},this._options=(0,r.__assign)((0,r.__assign)({},e._GetDefaultOptions()),t),this._scene=i,this._scene._transmissionHelper=this,this.onErrorObservable=new n.Observable,this._scene.onDisposeObservable.addOnce((function(){o.dispose()})),this._parseScene(),this._setupRenderTargets()}return e._GetDefaultOptions=function(){return{renderSize:1024,samples:4,lodGenerationScale:1,lodGenerationOffset:-4,renderTargetTextureType:n.Constants.TEXTURETYPE_HALF_FLOAT,generateMipmaps:!0}},e.prototype.updateOptions=function(e){var t=this;if(Object.keys(e).filter((function(i){return t._options[i]!==e[i]})).length){var i=(0,r.__assign)((0,r.__assign)({},this._options),e),n=this._options;this._options=i,i.renderSize===n.renderSize&&i.renderTargetTextureType===n.renderTargetTextureType&&i.generateMipmaps===n.generateMipmaps&&this._opaqueRenderTarget?(this._opaqueRenderTarget.samples=i.samples,this._opaqueRenderTarget.lodGenerationScale=i.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=i.lodGenerationOffset):this._setupRenderTargets()}},e.prototype.getOpaqueTarget=function(){return this._opaqueRenderTarget},e.prototype._shouldRenderAsTransmission=function(e){return!!e&&!!(e instanceof n.PBRMaterial&&e.subSurface.isRefractionEnabled)},e.prototype._addMesh=function(e){var t=this;this._materialObservers[e.uniqueId]=e.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this)),n.Tools.SetImmediate((function(){t._shouldRenderAsTransmission(e.material)?(e.material.refractionTexture=t._opaqueRenderTarget,-1===t._transparentMeshesCache.indexOf(e)&&t._transparentMeshesCache.push(e)):-1===t._opaqueMeshesCache.indexOf(e)&&t._opaqueMeshesCache.push(e)}))},e.prototype._removeMesh=function(e){e.onMaterialChangedObservable.remove(this._materialObservers[e.uniqueId]),delete this._materialObservers[e.uniqueId];var t=this._transparentMeshesCache.indexOf(e);-1!==t&&this._transparentMeshesCache.splice(t,1),-1!==(t=this._opaqueMeshesCache.indexOf(e))&&this._opaqueMeshesCache.splice(t,1)},e.prototype._parseScene=function(){this._scene.meshes.forEach(this._addMesh.bind(this)),this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)),this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this))},e.prototype._onMeshMaterialChanged=function(e){var t=this._transparentMeshesCache.indexOf(e),i=this._opaqueMeshesCache.indexOf(e);this._shouldRenderAsTransmission(e.material)?(e.material instanceof n.PBRMaterial&&(e.material.subSurface.refractionTexture=this._opaqueRenderTarget),-1!==i?(this._opaqueMeshesCache.splice(i,1),this._transparentMeshesCache.push(e)):-1===t&&this._transparentMeshesCache.push(e)):-1!==t?(this._transparentMeshesCache.splice(t,1),this._opaqueMeshesCache.push(e)):-1===i&&this._opaqueMeshesCache.push(e)},e.prototype._isRenderTargetValid=function(){var e;return null!==(null===(e=this._opaqueRenderTarget)||void 0===e?void 0:e.getInternalTexture())},e.prototype._setupRenderTargets=function(){var e,t,i,r,o=this;this._opaqueRenderTarget&&this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=new n.RenderTargetTexture("opaqueSceneTexture",this._options.renderSize,this._scene,this._options.generateMipmaps,void 0,this._options.renderTargetTextureType),this._opaqueRenderTarget.ignoreCameraViewport=!0,this._opaqueRenderTarget.renderList=this._opaqueMeshesCache,this._opaqueRenderTarget.clearColor=null!==(t=null===(e=this._options.clearColor)||void 0===e?void 0:e.clone())&&void 0!==t?t:this._scene.clearColor.clone(),this._opaqueRenderTarget.gammaSpace=!1,this._opaqueRenderTarget.lodGenerationScale=this._options.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=this._options.lodGenerationOffset,this._opaqueRenderTarget.samples=this._options.samples,this._opaqueRenderTarget.renderSprites=!0,this._opaqueRenderTarget.renderParticles=!0,this._opaqueRenderTarget.onBeforeBindObservable.add((function(e){r=o._scene.environmentIntensity,o._scene.environmentIntensity=1,i=o._scene.imageProcessingConfiguration.applyByPostProcess,o._options.clearColor?e.clearColor.copyFrom(o._options.clearColor):o._scene.clearColor.toLinearSpaceToRef(e.clearColor,o._scene.getEngine().useExactSrgbConversions),o._scene.imageProcessingConfiguration._applyByPostProcess=!0})),this._opaqueRenderTarget.onAfterUnbindObservable.add((function(){o._scene.environmentIntensity=r,o._scene.imageProcessingConfiguration._applyByPostProcess=i})),this._transparentMeshesCache.forEach((function(e){o._shouldRenderAsTransmission(e.material)&&(e.material.refractionTexture=o._opaqueRenderTarget)}))},e.prototype.dispose=function(){this._scene._transmissionHelper=void 0,this._opaqueRenderTarget&&(this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=null),this._transparentMeshesCache=[],this._opaqueMeshesCache=[]},e}(),s="KHR_materials_transmission",l=function(){function e(e){this.name=s,this.order=175,this._loader=e,this.enabled=this._loader.isExtensionUsed(s),this.enabled&&(e.parent.transparencyAsCoverage=!0)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var r=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){var a=new Array;return a.push(r._loader.loadMaterialBasePropertiesAsync(e,t,i)),a.push(r._loader.loadMaterialPropertiesAsync(e,t,i)),a.push(r._loadTransparentPropertiesAsync(n,t,i,o)),Promise.all(a).then((function(){}))}))},e.prototype._loadTransparentPropertiesAsync=function(e,t,i,r){var o,s;if(!(i instanceof n.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));var l=i;if(l.subSurface.isRefractionEnabled=!0,l.subSurface.volumeIndexOfRefraction=1,l.subSurface.useAlbedoToTintRefraction=!0,void 0===r.transmissionFactor)return l.subSurface.refractionIntensity=0,l.subSurface.isRefractionEnabled=!1,Promise.resolve();l.subSurface.refractionIntensity=r.transmissionFactor;var c=l.getScene();return l.subSurface.refractionIntensity&&!c._transmissionHelper?new a({},l.getScene()):l.subSurface.refractionIntensity&&!(null===(o=c._transmissionHelper)||void 0===o?void 0:o._isRenderTargetValid())&&(null===(s=c._transmissionHelper)||void 0===s||s._setupRenderTargets()),l.subSurface.minimumThickness=0,l.subSurface.maximumThickness=0,r.transmissionTexture?(r.transmissionTexture.nonColorData=!0,this._loader.loadTextureInfoAsync("".concat(e,"/transmissionTexture"),r.transmissionTexture,void 0).then((function(e){l.subSurface.refractionIntensityTexture=e,l.subSurface.useGltfStyleTextures=!0}))):Promise.resolve()},e}();o.GLTFLoader.RegisterExtension(s,(function(e){return new l(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_unlit.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_materials_unlit:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_materials_unlit",a=function(){function e(e){this.name=o,this.order=210,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var r=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(){return r._loadUnlitPropertiesAsync(e,t,i)}))},e.prototype._loadUnlitPropertiesAsync=function(e,t,i){if(!(i instanceof r.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));var n=new Array;i.unlit=!0;var o=t.pbrMetallicRoughness;return o&&(o.baseColorFactor?(i.albedoColor=r.Color3.FromArray(o.baseColorFactor),i.alpha=o.baseColorFactor[3]):i.albedoColor=r.Color3.White(),o.baseColorTexture&&n.push(this._loader.loadTextureInfoAsync("".concat(e,"/baseColorTexture"),o.baseColorTexture,(function(e){e.name="".concat(i.name," (Base Color)"),i.albedoTexture=e})))),t.doubleSided&&(i.backFaceCulling=!1,i.twoSidedLighting=!0),this._loader.loadMaterialAlphaProperties(e,t,i),Promise.all(n).then((function(){}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_variants.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_materials_variants:()=>a});var r=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),n=i("babylonjs/Misc/observable"),o="KHR_materials_variants",a=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.GetAvailableVariants=function(e){var t=this._GetExtensionMetadata(e);return t?Object.keys(t.variants):[]},e.prototype.getAvailableVariants=function(t){return e.GetAvailableVariants(t)},e.SelectVariant=function(e,t){var i=this._GetExtensionMetadata(e);if(!i)throw new Error("Cannot select variant on a glTF mesh that does not have the ".concat(o," extension"));var r=function(e){var t=i.variants[e];if(t)for(var r=0,n=t;r<n.length;r++){var o=n[r];o.mesh.material=o.material}};if(t instanceof Array)for(var n=0,a=t;n<a.length;n++)r(a[n]);else r(t);i.lastSelected=t},e.prototype.selectVariant=function(t,i){e.SelectVariant(t,i)},e.Reset=function(e){var t=this._GetExtensionMetadata(e);if(!t)throw new Error("Cannot reset on a glTF mesh that does not have the ".concat(o," extension"));for(var i=0,r=t.original;i<r.length;i++){var n=r[i];n.mesh.material=n.material}t.lastSelected=null},e.prototype.reset=function(t){e.Reset(t)},e.GetLastSelectedVariant=function(e){var t=this._GetExtensionMetadata(e);if(!t)throw new Error("Cannot get the last selected variant on a glTF mesh that does not have the ".concat(o," extension"));return t.lastSelected},e.prototype.getLastSelectedVariant=function(t){return e.GetLastSelectedVariant(t)},e._GetExtensionMetadata=function(e){var t,i;return(null===(i=null===(t=null==e?void 0:e._internalMetadata)||void 0===t?void 0:t.gltf)||void 0===i?void 0:i[o])||null},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._variants=t.variants}},e.prototype._loadMeshPrimitiveAsync=function(t,i,a,s,l,c){var u=this;return r.GLTFLoader.LoadExtensionAsync(t,l,this.name,(function(h,d){var _=new Array;return _.push(u._loader._loadMeshPrimitiveAsync(t,i,a,s,l,(function(i){if(c(i),i instanceof n.Mesh){var a=r.GLTFLoader._GetDrawMode(t,l.mode),s=u._loader.rootBabylonMesh,f=s?s._internalMetadata=s._internalMetadata||{}:{},p=f.gltf=f.gltf||{},m=p[o]=p[o]||{lastSelected:null,original:[],variants:{}};m.original.push({mesh:i,material:i.material});for(var g=function(t){var n=d.mappings[t],l=r.ArrayItem.Get("".concat(h,"/mappings/").concat(t,"/material"),u._loader.gltf.materials,n.material);_.push(u._loader._loadMaterialAsync("#/materials/".concat(n.material),l,i,a,(function(t){for(var a=function(a){var l=n.variants[a],c=r.ArrayItem.Get("/extensions/".concat(o,"/variants/").concat(l),u._variants,l);m.variants[c.name]=m.variants[c.name]||[],m.variants[c.name].push({mesh:i,material:t}),i.onClonedObservable.add((function(t){var r=t,n=null,a=r;do{if(!(a=a.parent))return;n=e._GetExtensionMetadata(a)}while(null===n);if(s&&n===e._GetExtensionMetadata(s)){for(var l in a._internalMetadata={},s._internalMetadata)a._internalMetadata[l]=s._internalMetadata[l];for(var l in a._internalMetadata.gltf=[],s._internalMetadata.gltf)a._internalMetadata.gltf[l]=s._internalMetadata.gltf[l];a._internalMetadata.gltf[o]={lastSelected:null,original:[],variants:{}};for(var u=0,h=n.original;u<h.length;u++){var d=h[u];a._internalMetadata.gltf[o].original.push({mesh:d.mesh,material:d.material})}for(var l in n.variants)if(Object.prototype.hasOwnProperty.call(n.variants,l)){a._internalMetadata.gltf[o].variants[l]=[];for(var _=0,f=n.variants[l];_<f.length;_++){var p=f[_];a._internalMetadata.gltf[o].variants[l].push({mesh:p.mesh,material:p.material})}}n=a._internalMetadata.gltf[o]}for(var m=0,g=n.original;m<g.length;m++)(y=g[m]).mesh===i&&(y.mesh=r);for(var v=0,b=n.variants[c.name];v<b.length;v++){var y;(y=b[v]).mesh===i&&(y.mesh=r)}}))},l=0;l<n.variants.length;++l)a(l)})))},v=0;v<d.mappings.length;++v)g(v)}}))),Promise.all(_).then((function(e){return e[0]}))}))},e}();r.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_volume.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_materials_volume:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_materials_volume",a=function(){function e(e){this.name=o,this.order=173,this._loader=e,this.enabled=this._loader.isExtensionUsed(o),this.enabled&&this._loader._disableInstancedMesh++}return e.prototype.dispose=function(){this.enabled&&this._loader._disableInstancedMesh--,this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var r=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){var a=new Array;return a.push(r._loader.loadMaterialBasePropertiesAsync(e,t,i)),a.push(r._loader.loadMaterialPropertiesAsync(e,t,i)),a.push(r._loadVolumePropertiesAsync(n,t,i,o)),Promise.all(a).then((function(){}))}))},e.prototype._loadVolumePropertiesAsync=function(e,t,i,n){if(!(i instanceof r.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));if(!i.subSurface.isRefractionEnabled&&!i.subSurface.isTranslucencyEnabled||!n.thicknessFactor)return Promise.resolve();i.subSurface.volumeIndexOfRefraction=i.indexOfRefraction;var o=void 0!==n.attenuationDistance?n.attenuationDistance:Number.MAX_VALUE;return i.subSurface.tintColorAtDistance=o,void 0!==n.attenuationColor&&3==n.attenuationColor.length&&i.subSurface.tintColor.copyFromFloats(n.attenuationColor[0],n.attenuationColor[1],n.attenuationColor[2]),i.subSurface.minimumThickness=0,i.subSurface.maximumThickness=n.thicknessFactor,i.subSurface.useThicknessAsDepth=!0,n.thicknessTexture?(n.thicknessTexture.nonColorData=!0,this._loader.loadTextureInfoAsync("".concat(e,"/thicknessTexture"),n.thicknessTexture).then((function(e){i.subSurface.thicknessTexture=e,i.subSurface.useGltfStyleTextures=!0}))):Promise.resolve()},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_mesh_quantization.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_mesh_quantization:()=>o});var r=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),n="KHR_mesh_quantization",o=function(){function e(e){this.name=n,this.enabled=e.isExtensionUsed(n)}return e.prototype.dispose=function(){},e}();r.GLTFLoader.RegisterExtension(n,(function(e){return new o(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_texture_basisu.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_texture_basisu:()=>o});var r=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),n="KHR_texture_basisu",o=function(){function e(e){this.name=n,this._loader=e,this.enabled=e.isExtensionUsed(n)}return e.prototype.dispose=function(){this._loader=null},e.prototype._loadTextureAsync=function(e,t,i){var n=this;return r.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,a){var s=null==t.sampler?r.GLTFLoader.DefaultSampler:r.ArrayItem.Get("".concat(e,"/sampler"),n._loader.gltf.samplers,t.sampler),l=r.ArrayItem.Get("".concat(o,"/source"),n._loader.gltf.images,a.source);return n._loader._createTextureAsync(e,s,l,(function(e){i(e)}),t._textureInfo.nonColorData?{useRGBAIfASTCBC7NotAvailableWhenUASTC:!0}:void 0,!t._textureInfo.nonColorData)}))},e}();r.GLTFLoader.RegisterExtension(n,(function(e){return new o(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_texture_transform.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_texture_transform:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="KHR_texture_transform",a=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadTextureInfoAsync=function(e,t,i){var o=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,a){return o._loader.loadTextureInfoAsync(e,t,(function(e){if(!(e instanceof r.Texture))throw new Error("".concat(n,": Texture type not supported"));a.offset&&(e.uOffset=a.offset[0],e.vOffset=a.offset[1]),e.uRotationCenter=0,e.vRotationCenter=0,a.rotation&&(e.wAng=-a.rotation),a.scale&&(e.uScale=a.scale[0],e.vScale=a.scale[1]),null!=a.texCoord&&(e.coordinatesIndex=a.texCoord),i(e)}))}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/KHR_xmp_json_ld.ts":(e,t,i)=>{i.r(t),i.d(t,{KHR_xmp_json_ld:()=>o});var r=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),n="KHR_xmp_json_ld",o=function(){function e(e){this.name=n,this.order=100,this._loader=e,this.enabled=this._loader.isExtensionUsed(n)}return e.prototype.dispose=function(){this._loader=null},e.prototype.onLoading=function(){var e,t,i;if(null!==this._loader.rootBabylonMesh){var r=null===(e=this._loader.gltf.extensions)||void 0===e?void 0:e.KHR_xmp_json_ld,n=null===(i=null===(t=this._loader.gltf.asset)||void 0===t?void 0:t.extensions)||void 0===i?void 0:i.KHR_xmp_json_ld;if(r&&n){var o=+n.packet;r.packets&&o<r.packets.length&&(this._loader.rootBabylonMesh.metadata=this._loader.rootBabylonMesh.metadata||{},this._loader.rootBabylonMesh.metadata.xmp=r.packets[o])}}},e}();r.GLTFLoader.RegisterExtension(n,(function(e){return new o(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/MSFT_audio_emitter.ts":(e,t,i)=>{i.r(t),i.d(t,{MSFT_audio_emitter:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="MSFT_audio_emitter",a=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null,this._clips=null,this._emitters=null},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._clips=t.clips,this._emitters=t.emitters,n.ArrayItem.Assign(this._clips),n.ArrayItem.Assign(this._emitters)}},e.prototype.loadSceneAsync=function(e,t){var i=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(r,o){var a=new Array;a.push(i._loader.loadSceneAsync(e,t));for(var s=0,l=o.emitters;s<l.length;s++){var c=l[s],u=n.ArrayItem.Get("".concat(r,"/emitters"),i._emitters,c);if(null!=u.refDistance||null!=u.maxDistance||null!=u.rolloffFactor||null!=u.distanceModel||null!=u.innerAngle||null!=u.outerAngle)throw new Error("".concat(r,": Direction or Distance properties are not allowed on emitters attached to a scene"));a.push(i._loadEmitterAsync("".concat(r,"/emitters/").concat(u.index),u))}return Promise.all(a).then((function(){}))}))},e.prototype.loadNodeAsync=function(e,t,i){var o=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,a){var s=new Array;return o._loader.loadNodeAsync(e,t,(function(t){for(var l=function(i){var a=n.ArrayItem.Get("".concat(e,"/emitters"),o._emitters,i);s.push(o._loadEmitterAsync("".concat(e,"/emitters/").concat(a.index),a).then((function(){for(var e=0,i=a._babylonSounds;e<i.length;e++){var n=i[e];n.attachToMesh(t),null==a.innerAngle&&null==a.outerAngle||(n.setLocalDirectionToMesh(r.Vector3.Forward()),n.setDirectionalCone(2*r.Tools.ToDegrees(null==a.innerAngle?Math.PI:a.innerAngle),2*r.Tools.ToDegrees(null==a.outerAngle?Math.PI:a.outerAngle),0))}})))},c=0,u=a.emitters;c<u.length;c++)l(u[c]);i(t)})).then((function(e){return Promise.all(s).then((function(){return e}))}))}))},e.prototype.loadAnimationAsync=function(e,t){var i=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(r,o){return i._loader.loadAnimationAsync(e,t).then((function(a){var s=new Array;n.ArrayItem.Assign(o.events);for(var l=0,c=o.events;l<c.length;l++){var u=c[l];s.push(i._loadAnimationEventAsync("".concat(r,"/events/").concat(u.index),e,t,u,a))}return Promise.all(s).then((function(){return a}))}))}))},e.prototype._loadClipAsync=function(e,t){if(t._objectURL)return t._objectURL;var i;if(t.uri)i=this._loader.loadUriAsync(e,t,t.uri);else{var r=n.ArrayItem.Get("".concat(e,"/bufferView"),this._loader.gltf.bufferViews,t.bufferView);i=this._loader.loadBufferViewAsync("/bufferViews/".concat(r.index),r)}return t._objectURL=i.then((function(e){return URL.createObjectURL(new Blob([e],{type:t.mimeType}))})),t._objectURL},e.prototype._loadEmitterAsync=function(e,t){var i=this;if(t._babylonSounds=t._babylonSounds||[],!t._babylonData){for(var o=new Array,a=t.name||"emitter".concat(t.index),s={loop:!1,autoplay:!1,volume:null==t.volume?1:t.volume},l=function(e){var l="/extensions/".concat(c.name,"/clips"),u=n.ArrayItem.Get(l,c._clips,t.clips[e].clip);o.push(c._loadClipAsync("".concat(l,"/").concat(t.clips[e].clip),u).then((function(n){var o=t._babylonSounds[e]=new r.Sound(a,n,i._loader.babylonScene,null,s);o.refDistance=t.refDistance||1,o.maxDistance=t.maxDistance||256,o.rolloffFactor=t.rolloffFactor||1,o.distanceModel=t.distanceModel||"exponential"})))},c=this,u=0;u<t.clips.length;u++)l(u);var h=Promise.all(o).then((function(){var e=t.clips.map((function(e){return e.weight||1})),i=new r.WeightedSound(t.loop||!1,t._babylonSounds,e);t.innerAngle&&(i.directionalConeInnerAngle=2*r.Tools.ToDegrees(t.innerAngle)),t.outerAngle&&(i.directionalConeOuterAngle=2*r.Tools.ToDegrees(t.outerAngle)),t.volume&&(i.volume=t.volume),t._babylonData.sound=i}));t._babylonData={loaded:h}}return t._babylonData.loaded},e.prototype._getEventAction=function(e,t,i,r,n){switch(i){case"play":return function(e){var i=(n||0)+(e-r);t.play(i)};case"stop":return function(){t.stop()};case"pause":return function(){t.pause()};default:throw new Error("".concat(e,": Unsupported action ").concat(i))}},e.prototype._loadAnimationEventAsync=function(e,t,i,o,a){var s=this;if(0==a.targetedAnimations.length)return Promise.resolve();var l=a.targetedAnimations[0],c=o.emitter,u=n.ArrayItem.Get("/extensions/".concat(this.name,"/emitters"),this._emitters,c);return this._loadEmitterAsync(e,u).then((function(){var t=u._babylonData.sound;if(t){var i=new r.AnimationEvent(o.time,s._getEventAction(e,t,o.action,o.time,o.startOffset));l.animation.addEvent(i),a.onAnimationGroupEndObservable.add((function(){t.stop()})),a.onAnimationGroupPauseObservable.add((function(){t.pause()}))}}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/MSFT_lod.ts":(e,t,i)=>{i.r(t),i.d(t,{MSFT_lod:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="MSFT_lod",a=function(){function e(e){this.name=o,this.order=100,this.maxLODsToLoad=10,this.onNodeLODsLoadedObservable=new r.Observable,this.onMaterialLODsLoadedObservable=new r.Observable,this._bufferLODs=new Array,this._nodeIndexLOD=null,this._nodeSignalLODs=new Array,this._nodePromiseLODs=new Array,this._nodeBufferLODs=new Array,this._materialIndexLOD=null,this._materialSignalLODs=new Array,this._materialPromiseLODs=new Array,this._materialBufferLODs=new Array,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null,this._nodeIndexLOD=null,this._nodeSignalLODs.length=0,this._nodePromiseLODs.length=0,this._nodeBufferLODs.length=0,this._materialIndexLOD=null,this._materialSignalLODs.length=0,this._materialPromiseLODs.length=0,this._materialBufferLODs.length=0,this.onMaterialLODsLoadedObservable.clear(),this.onNodeLODsLoadedObservable.clear()},e.prototype.onReady=function(){for(var e=this,t=function(t){var r=Promise.all(i._nodePromiseLODs[t]).then((function(){0!==t&&(e._loader.endPerformanceCounter("Node LOD ".concat(t)),e._loader.log("Loaded node LOD ".concat(t))),e.onNodeLODsLoadedObservable.notifyObservers(t),t!==e._nodePromiseLODs.length-1&&(e._loader.startPerformanceCounter("Node LOD ".concat(t+1)),e._loadBufferLOD(e._nodeBufferLODs,t+1),e._nodeSignalLODs[t]&&e._nodeSignalLODs[t].resolve())}));i._loader._completePromises.push(r)},i=this,r=0;r<this._nodePromiseLODs.length;r++)t(r);var n=function(t){var i=Promise.all(o._materialPromiseLODs[t]).then((function(){0!==t&&(e._loader.endPerformanceCounter("Material LOD ".concat(t)),e._loader.log("Loaded material LOD ".concat(t))),e.onMaterialLODsLoadedObservable.notifyObservers(t),t!==e._materialPromiseLODs.length-1&&(e._loader.startPerformanceCounter("Material LOD ".concat(t+1)),e._loadBufferLOD(e._materialBufferLODs,t+1),e._materialSignalLODs[t]&&e._materialSignalLODs[t].resolve())}));o._loader._completePromises.push(i)},o=this;for(r=0;r<this._materialPromiseLODs.length;r++)n(r)},e.prototype.loadSceneAsync=function(e,t){var i=this._loader.loadSceneAsync(e,t);return this._loadBufferLOD(this._bufferLODs,0),i},e.prototype.loadNodeAsync=function(e,t,i){var o=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,n){var a,s=o._getLODs(e,t,o._loader.gltf.nodes,n.ids);o._loader.logOpen("".concat(e));for(var l=function(e){var t=s[e];0!==e&&(o._nodeIndexLOD=e,o._nodeSignalLODs[e]=o._nodeSignalLODs[e]||new r.Deferred);var n=o._loader.loadNodeAsync("/nodes/".concat(t.index),t,(function(e){i(e),e.setEnabled(!1)})).then((function(t){if(0!==e){var i=s[e-1];i._babylonTransformNode&&(o._disposeTransformNode(i._babylonTransformNode),delete i._babylonTransformNode)}return t.setEnabled(!0),t}));o._nodePromiseLODs[e]=o._nodePromiseLODs[e]||[],0===e?a=n:(o._nodeIndexLOD=null,o._nodePromiseLODs[e].push(n))},c=0;c<s.length;c++)l(c);return o._loader.logClose(),a}))},e.prototype._loadMaterialAsync=function(e,t,i,r,o){var a=this;return this._nodeIndexLOD?null:n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,n){var s,l=a._getLODs(e,t,a._loader.gltf.materials,n.ids);a._loader.logOpen("".concat(e));for(var c=function(e){var t=l[e];0!==e&&(a._materialIndexLOD=e);var n=a._loader._loadMaterialAsync("/materials/".concat(t.index),t,i,r,(function(t){0===e&&o(t)})).then((function(t){if(0!==e){o(t);var i=l[e-1]._data;i[r]&&(a._disposeMaterials([i[r].babylonMaterial]),delete i[r])}return t}));a._materialPromiseLODs[e]=a._materialPromiseLODs[e]||[],0===e?s=n:(a._materialIndexLOD=null,a._materialPromiseLODs[e].push(n))},u=0;u<l.length;u++)c(u);return a._loader.logClose(),s}))},e.prototype._loadUriAsync=function(e,t,i){var n=this;if(null!==this._nodeIndexLOD){this._loader.log("deferred");var o=this._nodeIndexLOD-1;return this._nodeSignalLODs[o]=this._nodeSignalLODs[o]||new r.Deferred,this._nodeSignalLODs[this._nodeIndexLOD-1].promise.then((function(){return n._loader.loadUriAsync(e,t,i)}))}return null!==this._materialIndexLOD?(this._loader.log("deferred"),o=this._materialIndexLOD-1,this._materialSignalLODs[o]=this._materialSignalLODs[o]||new r.Deferred,this._materialSignalLODs[o].promise.then((function(){return n._loader.loadUriAsync(e,t,i)}))):null},e.prototype.loadBufferAsync=function(e,t,i,n){if(this._loader.parent.useRangeRequests&&!t.uri){if(!this._loader.bin)throw new Error("".concat(e,": Uri is missing or the binary glTF is missing its binary chunk"));var o=function(e,t){var o=i,a=o+n-1,s=e[t];return s?(s.start=Math.min(s.start,o),s.end=Math.max(s.end,a)):(s={start:o,end:a,loaded:new r.Deferred},e[t]=s),s.loaded.promise.then((function(e){return new Uint8Array(e.buffer,e.byteOffset+i-s.start,n)}))};return this._loader.log("deferred"),null!==this._nodeIndexLOD?o(this._nodeBufferLODs,this._nodeIndexLOD):null!==this._materialIndexLOD?o(this._materialBufferLODs,this._materialIndexLOD):o(this._bufferLODs,0)}return null},e.prototype._loadBufferLOD=function(e,t){var i=e[t];i&&(this._loader.log("Loading buffer range [".concat(i.start,"-").concat(i.end,"]")),this._loader.bin.readAsync(i.start,i.end-i.start+1).then((function(e){i.loaded.resolve(e)}),(function(e){i.loaded.reject(e)})))},e.prototype._getLODs=function(e,t,i,r){if(this.maxLODsToLoad<=0)throw new Error("maxLODsToLoad must be greater than zero");for(var o=[],a=r.length-1;a>=0;a--)if(o.push(n.ArrayItem.Get("".concat(e,"/ids/").concat(r[a]),i,r[a])),o.length===this.maxLODsToLoad)return o;return o.push(t),o},e.prototype._disposeTransformNode=function(e){var t=this,i=[],r=e.material;r&&i.push(r);for(var n=0,o=e.getChildMeshes();n<o.length;n++){var a=o[n];a.material&&i.push(a.material)}e.dispose();var s=i.filter((function(e){return t._loader.babylonScene.meshes.every((function(t){return t.material!=e}))}));this._disposeMaterials(s)},e.prototype._disposeMaterials=function(e){for(var t={},i=0,r=e;i<r.length;i++){for(var n=0,o=(u=r[i]).getActiveTextures();n<o.length;n++){var a=o[n];t[a.uniqueId]=a}u.dispose()}for(var s in t)for(var l=0,c=this._loader.babylonScene.materials;l<c.length;l++){var u;(u=c[l]).hasTexture(t[s])&&delete t[s]}for(var s in t)t[s].dispose()},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/MSFT_minecraftMesh.ts":(e,t,i)=>{i.r(t),i.d(t,{MSFT_minecraftMesh:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="MSFT_minecraftMesh",a=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var o=this;return n.GLTFLoader.LoadExtraAsync(e,t,this.name,(function(n,a){if(a){if(!(i instanceof r.PBRMaterial))throw new Error("".concat(n,": Material type not supported"));var s=o._loader.loadMaterialPropertiesAsync(e,t,i);return i.needAlphaBlending()&&(i.forceDepthWrite=!0,i.separateCullingPass=!0),i.backFaceCulling=i.forceDepthWrite,i.twoSidedLighting=!0,s}return null}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/MSFT_sRGBFactors.ts":(e,t,i)=>{i.r(t),i.d(t,{MSFT_sRGBFactors:()=>a});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),o="MSFT_sRGBFactors",a=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var o=this;return n.GLTFLoader.LoadExtraAsync(e,t,this.name,(function(n,a){if(a){if(!(i instanceof r.PBRMaterial))throw new Error("".concat(n,": Material type not supported"));var s=o._loader.loadMaterialPropertiesAsync(e,t,i),l=i.getScene().getEngine().useExactSrgbConversions;return i.albedoTexture||i.albedoColor.toLinearSpaceToRef(i.albedoColor,l),i.reflectivityTexture||i.reflectivityColor.toLinearSpaceToRef(i.reflectivityColor,l),s}return null}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new a(e)}))},"../../../dev/loaders/src/glTF/2.0/Extensions/gltfPathToObjectConverter.ts":(e,t,i)=>{i.r(t),i.d(t,{GLTFPathToObjectConverter:()=>r});var r=function(){function e(e,t){this._gltf=e,this._infoTree=t}return e.prototype.convert=function(e){var t=this._gltf,i=this._infoTree,r=void 0;if(!e.startsWith("/"))throw new Error("Path must start with a /");var n=e.split("/");n.shift();for(var o=0,a=n;o<a.length;o++){var s=a[o];if(i.__array__)i=i.__array__;else if(!(i=i[s]))throw new Error("Path ".concat(e," is invalid"));if(void 0===t)throw new Error("Path ".concat(e," is invalid"));t=t[s],i.__target__&&(r=t)}return{object:r,info:i}},e}()},"../../../dev/loaders/src/glTF/2.0/Extensions/index.ts":(e,t,i)=>{i.r(t),i.d(t,{EXT_lights_image_based:()=>r.EXT_lights_image_based,EXT_mesh_gpu_instancing:()=>n.EXT_mesh_gpu_instancing,EXT_meshopt_compression:()=>o.EXT_meshopt_compression,EXT_texture_avif:()=>s.EXT_texture_avif,EXT_texture_webp:()=>a.EXT_texture_webp,ExtrasAsMetadata:()=>B.ExtrasAsMetadata,KHR_animation_pointer:()=>I.KHR_animation_pointer,KHR_draco_mesh_compression:()=>l.KHR_draco_mesh_compression,KHR_interactivity:()=>L.KHR_interactivity,KHR_lights:()=>c.KHR_lights,KHR_materials_anisotropy:()=>f.KHR_materials_anisotropy,KHR_materials_clearcoat:()=>d.KHR_materials_clearcoat,KHR_materials_diffuse_transmission:()=>x.KHR_materials_diffuse_transmission,KHR_materials_dispersion:()=>C.KHR_materials_dispersion,KHR_materials_emissive_strength:()=>p.KHR_materials_emissive_strength,KHR_materials_ior:()=>v.KHR_materials_ior,KHR_materials_iridescence:()=>_.KHR_materials_iridescence,KHR_materials_pbrSpecularGlossiness:()=>u.KHR_materials_pbrSpecularGlossiness,KHR_materials_sheen:()=>m.KHR_materials_sheen,KHR_materials_specular:()=>g.KHR_materials_specular,KHR_materials_transmission:()=>y.KHR_materials_transmission,KHR_materials_unlit:()=>h.KHR_materials_unlit,KHR_materials_variants:()=>b.KHR_materials_variants,KHR_materials_volume:()=>T.KHR_materials_volume,KHR_mesh_quantization:()=>S.KHR_mesh_quantization,KHR_texture_basisu:()=>P.KHR_texture_basisu,KHR_texture_transform:()=>E.KHR_texture_transform,KHR_xmp_json_ld:()=>w.KHR_xmp_json_ld,MSFT_audio_emitter:()=>M.MSFT_audio_emitter,MSFT_lod:()=>O.MSFT_lod,MSFT_minecraftMesh:()=>A.MSFT_minecraftMesh,MSFT_sRGBFactors:()=>R.MSFT_sRGBFactors});var r=i("../../../dev/loaders/src/glTF/2.0/Extensions/EXT_lights_image_based.ts"),n=i("../../../dev/loaders/src/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.ts"),o=i("../../../dev/loaders/src/glTF/2.0/Extensions/EXT_meshopt_compression.ts"),a=i("../../../dev/loaders/src/glTF/2.0/Extensions/EXT_texture_webp.ts"),s=i("../../../dev/loaders/src/glTF/2.0/Extensions/EXT_texture_avif.ts"),l=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_draco_mesh_compression.ts"),c=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_lights_punctual.ts"),u=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.ts"),h=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_unlit.ts"),d=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_clearcoat.ts"),_=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_iridescence.ts"),f=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_anisotropy.ts"),p=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_emissive_strength.ts"),m=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_sheen.ts"),g=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_specular.ts"),v=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_ior.ts"),b=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_variants.ts"),y=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_transmission.ts"),x=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.ts"),T=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_volume.ts"),C=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_materials_dispersion.ts"),S=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_mesh_quantization.ts"),P=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_texture_basisu.ts"),E=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_texture_transform.ts"),w=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_xmp_json_ld.ts"),I=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_animation_pointer.ts"),M=i("../../../dev/loaders/src/glTF/2.0/Extensions/MSFT_audio_emitter.ts"),O=i("../../../dev/loaders/src/glTF/2.0/Extensions/MSFT_lod.ts"),A=i("../../../dev/loaders/src/glTF/2.0/Extensions/MSFT_minecraftMesh.ts"),R=i("../../../dev/loaders/src/glTF/2.0/Extensions/MSFT_sRGBFactors.ts"),L=i("../../../dev/loaders/src/glTF/2.0/Extensions/KHR_interactivity.ts"),B=i("../../../dev/loaders/src/glTF/2.0/Extensions/ExtrasAsMetadata.ts")},"../../../dev/loaders/src/glTF/2.0/Extensions/interactivityFunctions.ts":(e,t,i)=>{i.r(t),i.d(t,{convertGLTFToSerializedFlowGraph:()=>s});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/2.0/Extensions/interactivityUtils.ts");function o(e,t,i){if(void 0!==e.type){var r=t.types&&t.types[e.type];if(!r)throw new Error("".concat(i,": Unknown type: ").concat(e.type));var o=r.signature;if(!o)throw new Error("".concat(i,": Type ").concat(e.type," has no signature"));var a=n.gltfTypeToBabylonType[o];return{value:e.value,className:a}}return e.value}function a(e,t,i){var r=n.gltfToFlowGraphTypeMap[t.type];if(!r)throw new Error("/extensions/KHR_interactivity/nodes/".concat(e,": Unknown block type: ").concat(t.type));var a=e.toString(),s=function(e,t,i){for(var r,n={},a=0,s=null!==(r=e.configuration)&&void 0!==r?r:[];a<s.length;a++){var l=s[a];if("customEvent"===l.id){var c=t.customEvents&&t.customEvents[l.value];if(!c)throw new Error("/extensions/KHR_interactivity/nodes/".concat(i,": Unknown custom event: ").concat(l.value));n.eventId=c.id,n.eventData=c.values.map((function(e){return e.id}))}else if("variable"===l.id){var u=t.variables&&t.variables[l.value];if(!u)throw new Error("/extensions/KHR_interactivity/nodes/".concat(i,": Unknown variable: ").concat(l.value));n.variableName=u.id}else if("path"===l.id){var h=l.value;n.path=h}else n[l.id]=o(l,t,"/extensions/KHR_interactivity/nodes/".concat(i))}return n}(t,i,a);return{className:r,config:s,uniqueId:a,metadata:t.metadata,dataInputs:[],dataOutputs:[],signalInputs:[],signalOutputs:[]}}function s(e){for(var t,i,n,s={uniqueId:(0,r.RandomGUID)(),_userVariables:{},_connectionValues:{}},l=[s],c=[],u=0;u<e.nodes.length;u++){var h=e.nodes[u],d=a(u,h,e);c.push(d)}for(u=0;u<e.nodes.length;u++){h=e.nodes[u];for(var _=c[u],f=function(e){var t=e.id,i={uniqueId:(0,r.RandomGUID)(),name:t,_connectionType:1,connectedPointIds:[]};_.signalOutputs.push(i);var n=e.node,o=e.socket,a=c[n];if(!a)throw new Error("/extensions/KHR_interactivity/nodes/".concat(u,": Could not find node with id ").concat(n," that connects its input with with node ").concat(u,"'s output ").concat(t));var s=a.signalInputs.find((function(e){return e.name===o}));s||(s={uniqueId:(0,r.RandomGUID)(),name:o,_connectionType:0,connectedPointIds:[]},a.signalInputs.push(s)),s.connectedPointIds.push(i.uniqueId),i.connectedPointIds.push(s.uniqueId)},p=0,m=null!==(t=h.flows)&&void 0!==t?t:[];p<m.length;p++)f(m[p]);for(var g=function(t){var i=t.id,n={uniqueId:(0,r.RandomGUID)(),name:i,_connectionType:0,connectedPointIds:[]};if(_.dataInputs.push(n),void 0!==t.value){var a=o(t,e,"/extensions/KHR_interactivity/nodes/".concat(u));s._connectionValues[n.uniqueId]=a}else{if(void 0===t.node||void 0===t.socket)throw new Error("/extensions/KHR_interactivity/nodes/".concat(u,": Invalid socket ").concat(i," in node ").concat(u));var l=t.node,h=t.socket,d=c[l];if(!d)throw new Error("/extensions/KHR_interactivity/nodes/".concat(u,": Could not find node with id ").concat(l," that connects its output with node").concat(u,"'s input ").concat(i));var f=d.dataOutputs.find((function(e){return e.name===h}));f||(f={uniqueId:(0,r.RandomGUID)(),name:h,_connectionType:1,connectedPointIds:[]},d.dataOutputs.push(f)),n.connectedPointIds.push(f.uniqueId),f.connectedPointIds.push(n.uniqueId)}},v=0,b=null!==(i=h.values)&&void 0!==i?i:[];v<b.length;v++)g(b[v])}var y=null!==(n=e.variables)&&void 0!==n?n:[];for(u=0;u<y.length;u++){var x=y[u],T=x.id;s._userVariables[T]=o(x,e,"/extensions/KHR_interactivity/variables/".concat(u))}return{allBlocks:c,executionContexts:l}}},"../../../dev/loaders/src/glTF/2.0/Extensions/interactivityPathToObjectConverter.ts":(e,t,i)=>{i.r(t),i.d(t,{InteractivityPathToObjectConverter:()=>n});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=function(e){function t(t){return e.call(this,t,o)||this}return(0,r.__extends)(t,e),t}(i("../../../dev/loaders/src/glTF/2.0/Extensions/gltfPathToObjectConverter.ts").GLTFPathToObjectConverter),o={nodes:{__array__:{__target__:!0,translation:{type:"Vector3",get:function(e){return e._babylonTransformNode.position},set:function(e,t){t._babylonTransformNode.position=e},getObject:function(e){return e._babylonTransformNode}}}}}},"../../../dev/loaders/src/glTF/2.0/Extensions/interactivityUtils.ts":(e,t,i)=>{i.r(t),i.d(t,{gltfToFlowGraphTypeMap:()=>n,gltfTypeToBabylonType:()=>o});var r=i("babylonjs/Misc/observable"),n={"lifecycle/onStart":r.FlowGraphSceneReadyEventBlock.ClassName,"lifecycle/onTick":r.FlowGraphSceneTickEventBlock.ClassName,log:r.FlowGraphConsoleLogBlock.ClassName,"flow/delay":r.FlowGraphTimerBlock.ClassName,"customEvent/send":r.FlowGraphSendCustomEventBlock.ClassName,"customEvent/receive":r.FlowGraphReceiveCustomEventBlock.ClassName,"flow/sequence":r.FlowGraphSequenceBlock.ClassName,"world/get":r.FlowGraphGetPropertyBlock.ClassName,"world/set":r.FlowGraphSetPropertyBlock.ClassName,"flow/doN":r.FlowGraphDoNBlock.ClassName,"variable/get":r.FlowGraphGetVariableBlock.ClassName,"variable/set":r.FlowGraphSetVariableBlock.ClassName,"flow/whileLoop":r.FlowGraphWhileLoopBlock.ClassName,"math/random":r.FlowGraphRandomBlock.ClassName,"math/e":r.FlowGraphEBlock.ClassName,"math/pi":r.FlowGraphPiBlock.ClassName,"math/inf":r.FlowGraphInfBlock.ClassName,"math/nan":r.FlowGraphNaNBlock.ClassName,"math/abs":r.FlowGraphAbsBlock.ClassName,"math/sign":r.FlowGraphSignBlock.ClassName,"math/trunc":r.FlowGraphTruncBlock.ClassName,"math/floor":r.FlowGraphFloorBlock.ClassName,"math/ceil":r.FlowGraphCeilBlock.ClassName,"math/fract":r.FlowGraphFractBlock.ClassName,"math/neg":r.FlowGraphNegBlock.ClassName,"math/add":r.FlowGraphAddBlock.ClassName,"math/sub":r.FlowGraphSubtractBlock.ClassName,"math/mul":r.FlowGraphMultiplyBlock.ClassName,"math/div":r.FlowGraphDivideBlock.ClassName,"math/rem":r.FlowGraphRemainderBlock.ClassName,"math/min":r.FlowGraphMinBlock.ClassName,"math/max":r.FlowGraphMaxBlock.ClassName,"math/clamp":r.FlowGraphClampBlock.ClassName,"math/saturate":r.FlowGraphSaturateBlock.ClassName,"math/mix":r.FlowGraphInterpolateBlock.ClassName,"math/eq":r.FlowGraphEqBlock.ClassName,"math/lt":r.FlowGraphLessThanBlock.ClassName,"math/le":r.FlowGraphLessThanOrEqualBlock.ClassName,"math/gt":r.FlowGraphGreaterThanBlock.ClassName,"math/ge":r.FlowGraphGreaterThanOrEqualBlock.ClassName,"math/isnan":r.FlowGraphIsNanBlock.ClassName,"math/isinf":r.FlowGraphIsInfBlock.ClassName,"math/rad":r.FlowGraphDegToRadBlock.ClassName,"math/deg":r.FlowGraphRadToDegBlock.ClassName,"math/sin":r.FlowGraphSinBlock.ClassName,"math/cos":r.FlowGraphCosBlock.ClassName,"math/tan":r.FlowGraphTanBlock.ClassName,"math/asin":r.FlowGraphAsinBlock.ClassName,"math/acos":r.FlowGraphAcosBlock.ClassName,"math/atan":r.FlowGraphAtanBlock.ClassName,"math/atan2":r.FlowGraphAtan2Block.ClassName,"math/sinh":r.FlowGraphSinhBlock.ClassName,"math/cosh":r.FlowGraphCoshBlock.ClassName,"math/tanh":r.FlowGraphTanhBlock.ClassName,"math/asinh":r.FlowGraphAsinhBlock.ClassName,"math/acosh":r.FlowGraphAcoshBlock.ClassName,"math/atanh":r.FlowGraphAtanhBlock.ClassName,"math/exp":r.FlowGraphExpBlock.ClassName,"math/log":r.FlowGraphLogBlock.ClassName,"math/log2":r.FlowGraphLog2Block.ClassName,"math/log10":r.FlowGraphLog10Block.ClassName,"math/sqrt":r.FlowGraphSqrtBlock.ClassName,"math/cbrt":r.FlowGraphCubeRootBlock.ClassName,"math/pow":r.FlowGraphPowBlock.ClassName,"math/length":r.FlowGraphLengthBlock.ClassName,"math/normalize":r.FlowGraphNormalizeBlock.ClassName,"math/dot":r.FlowGraphDotBlock.ClassName,"math/cross":r.FlowGraphCrossBlock.ClassName,"math/rotate2d":r.FlowGraphRotate2DBlock.ClassName,"math/rotate3d":r.FlowGraphRotate3DBlock.ClassName,"math/transpose":r.FlowGraphTransposeBlock.ClassName,"math/determinant":r.FlowGraphDeterminantBlock.ClassName,"math/inverse":r.FlowGraphInvertMatrixBlock.ClassName,"math/matmul":r.FlowGraphMatMulBlock.ClassName,"math/not":r.FlowGraphBitwiseNotBlock.ClassName,"math/and":r.FlowGraphBitwiseAndBlock.ClassName,"math/or":r.FlowGraphBitwiseOrBlock.ClassName,"math/xor":r.FlowGraphBitwiseXorBlock.ClassName,"math/asr":r.FlowGraphBitwiseRightShiftBlock.ClassName,"math/lsl":r.FlowGraphBitwiseLeftShiftBlock.ClassName,"math/clz":r.FlowGraphCountLeadingZerosBlock.ClassName,"math/ctz":r.FlowGraphCountTrailingZerosBlock.ClassName,"math/popcnt":r.FlowGraphCountOneBitsBlock.ClassName},o={float2:"Vector2",float3:"Vector3",float4:"Vector4",float4x4:"Matrix",int:"FlowGraphInteger"}},"../../../dev/loaders/src/glTF/2.0/glTFLoader.ts":(e,t,i)=>{i.r(t),i.d(t,{ArrayItem:()=>s,GLTFLoader:()=>l});var r=i("babylonjs/Misc/observable"),n=i("../../../dev/loaders/src/glTF/glTFFileLoader.ts"),o=i("../../../dev/loaders/src/glTF/2.0/glTFLoaderAnimation.ts");function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=function(e){return e&&"object"==typeof e};return e.reduce((function(e,t){return Object.keys(t).forEach((function(r){var n=e[r],o=t[r];Array.isArray(n)&&Array.isArray(o)?e[r]=n.concat.apply(n,o):i(n)&&i(o)?e[r]=a(n,o):e[r]=o})),e}),{})}var s=function(){function e(){}return e.Get=function(e,t,i){if(!t||null==i||!t[i])throw new Error("".concat(e,": Failed to find index (").concat(i,")"));return t[i]},e.TryGet=function(e,t){return e&&null!=t&&e[t]?e[t]:null},e.Assign=function(e){if(e)for(var t=0;t<e.length;t++)e[t].index=t},e}(),l=function(){function e(e){this._completePromises=new Array,this._assetContainer=null,this._babylonLights=[],this._disableInstancedMesh=0,this._allMaterialsDirtyRequired=!1,this._extensions=new Array,this._disposed=!1,this._rootUrl=null,this._fileName=null,this._uniqueRootUrl=null,this._bin=null,this._rootBabylonMesh=null,this._defaultBabylonMaterialData={},this._postSceneLoadActions=new Array,this._parent=e}return e.RegisterExtension=function(t,i){e.UnregisterExtension(t)&&r.Logger.Warn("Extension with the name '".concat(t,"' already exists")),e._RegisteredExtensions[t]={factory:i}},e.UnregisterExtension=function(t){return!!e._RegisteredExtensions[t]&&(delete e._RegisteredExtensions[t],!0)},Object.defineProperty(e.prototype,"gltf",{get:function(){if(!this._gltf)throw new Error("glTF JSON is not available");return this._gltf},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bin",{get:function(){return this._bin},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"babylonScene",{get:function(){if(!this._babylonScene)throw new Error("Scene is not available");return this._babylonScene},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rootBabylonMesh",{get:function(){return this._rootBabylonMesh},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rootUrl",{get:function(){return this._rootUrl},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._disposed||(this._disposed=!0,this._completePromises.length=0,this._extensions.forEach((function(e){return e.dispose&&e.dispose()})),this._extensions.length=0,this._gltf=null,this._bin=null,this._babylonScene=null,this._rootBabylonMesh=null,this._defaultBabylonMaterialData={},this._postSceneLoadActions.length=0,this._parent.dispose())},e.prototype.importMeshAsync=function(e,t,i,r,n,o,a){var s=this;return void 0===a&&(a=""),Promise.resolve().then((function(){s._babylonScene=t,s._assetContainer=i,s._loadData(r);var o=null;if(e){var l={};if(s._gltf.nodes)for(var c=0,u=s._gltf.nodes;c<u.length;c++){var h=u[c];h.name&&(l[h.name]=h.index)}o=(e instanceof Array?e:[e]).map((function(e){var t=l[e];if(void 0===t)throw new Error("Failed to find node '".concat(e,"'"));return t}))}return s._loadAsync(n,a,o,(function(){return{meshes:s._getMeshes(),particleSystems:[],skeletons:s._getSkeletons(),animationGroups:s._getAnimationGroups(),lights:s._babylonLights,transformNodes:s._getTransformNodes(),geometries:s._getGeometries(),spriteManagers:[]}}))}))},e.prototype.loadAsync=function(e,t,i,r,n){var o=this;return void 0===n&&(n=""),Promise.resolve().then((function(){return o._babylonScene=e,o._loadData(t),o._loadAsync(i,n,null,(function(){}))}))},e.prototype._loadAsync=function(e,t,i,o){var a=this;return Promise.resolve().then((function(){a._rootUrl=e,a._uniqueRootUrl=!e.startsWith("file:")&&t?e:"".concat(e).concat(Date.now(),"/"),a._fileName=t,a._allMaterialsDirtyRequired=!1,a._loadExtensions(),a._checkExtensions();var l="".concat(n.GLTFLoaderState[n.GLTFLoaderState.LOADING]," => ").concat(n.GLTFLoaderState[n.GLTFLoaderState.READY]),c="".concat(n.GLTFLoaderState[n.GLTFLoaderState.LOADING]," => ").concat(n.GLTFLoaderState[n.GLTFLoaderState.COMPLETE]);a._parent._startPerformanceCounter(l),a._parent._startPerformanceCounter(c),a._parent._setState(n.GLTFLoaderState.LOADING),a._extensionsOnLoading();var u=new Array,h=a._babylonScene.blockMaterialDirtyMechanism;if(a._babylonScene.blockMaterialDirtyMechanism=!0,!a.parent.loadOnlyMaterials)if(i)u.push(a.loadSceneAsync("/nodes",{nodes:i,index:-1}));else if(null!=a._gltf.scene||a._gltf.scenes&&a._gltf.scenes[0]){var d=s.Get("/scene",a._gltf.scenes,a._gltf.scene||0);u.push(a.loadSceneAsync("/scenes/".concat(d.index),d))}if(!a.parent.skipMaterials&&a.parent.loadAllMaterials&&a._gltf.materials)for(var _=0;_<a._gltf.materials.length;++_){var f=a._gltf.materials[_],p="/materials/"+_,m=r.Material.TriangleFillMode;u.push(a._loadMaterialAsync(p,f,null,m,(function(){})))}return a._allMaterialsDirtyRequired?a._babylonScene.blockMaterialDirtyMechanism=h:a._babylonScene._forceBlockMaterialDirtyMechanism(h),a._parent.compileMaterials&&u.push(a._compileMaterialsAsync()),a._parent.compileShadowGenerators&&u.push(a._compileShadowGeneratorsAsync()),Promise.all(u).then((function(){return a._rootBabylonMesh&&a._rootBabylonMesh!==a._parent.customRootNode&&a._rootBabylonMesh.setEnabled(!0),a._extensionsOnReady(),a._parent._setState(n.GLTFLoaderState.READY),a._startAnimations(),o()})).then((function(e){return a._parent._endPerformanceCounter(l),r.Tools.SetImmediate((function(){a._disposed||Promise.all(a._completePromises).then((function(){a._parent._endPerformanceCounter(c),a._parent._setState(n.GLTFLoaderState.COMPLETE),a._parent.onCompleteObservable.notifyObservers(void 0),a._parent.onCompleteObservable.clear(),a.dispose()}),(function(e){a._parent.onErrorObservable.notifyObservers(e),a._parent.onErrorObservable.clear(),a.dispose()}))})),e}))})).catch((function(e){throw a._disposed||(a._parent.onErrorObservable.notifyObservers(e),a._parent.onErrorObservable.clear(),a.dispose()),e}))},e.prototype._loadData=function(e){if(this._gltf=e.json,this._setupData(),e.bin){var t=this._gltf.buffers;if(t&&t[0]&&!t[0].uri){var i=t[0];(i.byteLength<e.bin.byteLength-3||i.byteLength>e.bin.byteLength)&&r.Logger.Warn("Binary buffer length (".concat(i.byteLength,") from JSON does not match chunk length (").concat(e.bin.byteLength,")")),this._bin=e.bin}else r.Logger.Warn("Unexpected BIN chunk")}},e.prototype._setupData=function(){if(s.Assign(this._gltf.accessors),s.Assign(this._gltf.animations),s.Assign(this._gltf.buffers),s.Assign(this._gltf.bufferViews),s.Assign(this._gltf.cameras),s.Assign(this._gltf.images),s.Assign(this._gltf.materials),s.Assign(this._gltf.meshes),s.Assign(this._gltf.nodes),s.Assign(this._gltf.samplers),s.Assign(this._gltf.scenes),s.Assign(this._gltf.skins),s.Assign(this._gltf.textures),this._gltf.nodes){for(var e={},t=0,i=this._gltf.nodes;t<i.length;t++)if((c=i[t]).children)for(var r=0,n=c.children;r<n.length;r++)e[n[r]]=c.index;for(var o=this._createRootNode(),a=0,l=this._gltf.nodes;a<l.length;a++){var c,u=e[(c=l[a]).index];c.parent=void 0===u?o:this._gltf.nodes[u]}}},e.prototype._loadExtensions=function(){for(var t in e._RegisteredExtensions){var i=e._RegisteredExtensions[t].factory(this);i.name!==t&&r.Logger.Warn("The name of the glTF loader extension instance does not match the registered name: ".concat(i.name," !== ").concat(t)),this._extensions.push(i),this._parent.onExtensionLoadedObservable.notifyObservers(i)}this._extensions.sort((function(e,t){return(e.order||Number.MAX_VALUE)-(t.order||Number.MAX_VALUE)})),this._parent.onExtensionLoadedObservable.clear()},e.prototype._checkExtensions=function(){if(this._gltf.extensionsRequired)for(var e=function(e){if(!t._extensions.some((function(t){return t.name===e&&t.enabled})))throw new Error("Required extension ".concat(e," is not available"))},t=this,i=0,r=this._gltf.extensionsRequired;i<r.length;i++)e(r[i])},e.prototype._createRootNode=function(){if(void 0!==this._parent.customRootNode)return this._rootBabylonMesh=this._parent.customRootNode,{_babylonTransformNode:null===this._rootBabylonMesh?void 0:this._rootBabylonMesh,index:-1};this._babylonScene._blockEntityCollection=!!this._assetContainer;var t=new r.Mesh("__root__",this._babylonScene);this._rootBabylonMesh=t,this._rootBabylonMesh._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,this._rootBabylonMesh.setEnabled(!1);var i={_babylonTransformNode:this._rootBabylonMesh,index:-1};switch(this._parent.coordinateSystemMode){case n.GLTFLoaderCoordinateSystemMode.AUTO:this._babylonScene.useRightHandedSystem||(i.rotation=[0,1,0,0],i.scale=[1,1,-1],e._LoadTransform(i,this._rootBabylonMesh));break;case n.GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED:this._babylonScene.useRightHandedSystem=!0;break;default:throw new Error("Invalid coordinate system mode (".concat(this._parent.coordinateSystemMode,")"))}return this._parent.onMeshLoadedObservable.notifyObservers(t),i},e.prototype.loadSceneAsync=function(e,t){var i=this,r=this._extensionsLoadSceneAsync(e,t);if(r)return r;var n=new Array;if(this.logOpen("".concat(e," ").concat(t.name||"")),t.nodes)for(var o=0,a=t.nodes;o<a.length;o++){var l=a[o],c=s.Get("".concat(e,"/nodes/").concat(l),this._gltf.nodes,l);n.push(this.loadNodeAsync("/nodes/".concat(c.index),c,(function(e){e.parent=i._rootBabylonMesh})))}for(var u=0,h=this._postSceneLoadActions;u<h.length;u++)(0,h[u])();return n.push(this._loadAnimationsAsync()),this.logClose(),Promise.all(n).then((function(){}))},e.prototype._forEachPrimitive=function(e,t){if(e._primitiveBabylonMeshes)for(var i=0,r=e._primitiveBabylonMeshes;i<r.length;i++)t(r[i])},e.prototype._getGeometries=function(){var e=[],t=this._gltf.nodes;if(t)for(var i=0,r=t;i<r.length;i++){var n=r[i];this._forEachPrimitive(n,(function(t){var i=t.geometry;i&&-1===e.indexOf(i)&&e.push(i)}))}return e},e.prototype._getMeshes=function(){var e=[];this._rootBabylonMesh instanceof r.AbstractMesh&&e.push(this._rootBabylonMesh);var t=this._gltf.nodes;if(t)for(var i=0,n=t;i<n.length;i++){var o=n[i];this._forEachPrimitive(o,(function(t){e.push(t)}))}return e},e.prototype._getTransformNodes=function(){var e=[],t=this._gltf.nodes;if(t)for(var i=0,r=t;i<r.length;i++){var n=r[i];n._babylonTransformNode&&"TransformNode"===n._babylonTransformNode.getClassName()&&e.push(n._babylonTransformNode),n._babylonTransformNodeForSkin&&e.push(n._babylonTransformNodeForSkin)}return e},e.prototype._getSkeletons=function(){var e=[],t=this._gltf.skins;if(t)for(var i=0,r=t;i<r.length;i++){var n=r[i];n._data&&e.push(n._data.babylonSkeleton)}return e},e.prototype._getAnimationGroups=function(){var e=[],t=this._gltf.animations;if(t)for(var i=0,r=t;i<r.length;i++){var n=r[i];n._babylonAnimationGroup&&e.push(n._babylonAnimationGroup)}return e},e.prototype._startAnimations=function(){switch(this._parent.animationStartMode){case n.GLTFLoaderAnimationStartMode.NONE:break;case n.GLTFLoaderAnimationStartMode.FIRST:0!==(e=this._getAnimationGroups()).length&&e[0].start(!0);break;case n.GLTFLoaderAnimationStartMode.ALL:for(var e,t=0,i=e=this._getAnimationGroups();t<i.length;t++)i[t].start(!0);break;default:return void r.Logger.Error("Invalid animation start mode (".concat(this._parent.animationStartMode,")"))}},e.prototype.loadNodeAsync=function(t,i,n){var o=this;void 0===n&&(n=function(){});var l=this._extensionsLoadNodeAsync(t,i,n);if(l)return l;if(i._babylonTransformNode)throw new Error("".concat(t,": Invalid recursive node hierarchy"));var c=new Array;this.logOpen("".concat(t," ").concat(i.name||""));var u=function(r){if(e.AddPointerMetadata(r,t),e._LoadTransform(i,r),null!=i.camera){var a=s.Get("".concat(t,"/camera"),o._gltf.cameras,i.camera);c.push(o.loadCameraAsync("/cameras/".concat(a.index),a,(function(e){e.parent=r})))}if(i.children)for(var l=0,u=i.children;l<u.length;l++){var h=u[l],d=s.Get("".concat(t,"/children/").concat(h),o._gltf.nodes,h);c.push(o.loadNodeAsync("/nodes/".concat(d.index),d,(function(e){e.parent=r})))}n(r)};if(null==i.mesh||null!=i.skin){var h=i.name||"node".concat(i.index);this._babylonScene._blockEntityCollection=!!this._assetContainer;var d=new r.TransformNode(h,this._babylonScene);d._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,null==i.mesh?i._babylonTransformNode=d:i._babylonTransformNodeForSkin=d,u(d)}if(null!=i.mesh)if(null==i.skin){var _=s.Get("".concat(t,"/mesh"),this._gltf.meshes,i.mesh);c.push(this._loadMeshAsync("/meshes/".concat(_.index),i,_,u))}else _=s.Get("".concat(t,"/mesh"),this._gltf.meshes,i.mesh),c.push(this._loadMeshAsync("/meshes/".concat(_.index),i,_,(function(e){var r=i._babylonTransformNodeForSkin;e.metadata=a(r.metadata,e.metadata||{});var n=s.Get("".concat(t,"/skin"),o._gltf.skins,i.skin);c.push(o._loadSkinAsync("/skins/".concat(n.index),i,n,(function(t){o._forEachPrimitive(i,(function(e){e.skeleton=t})),o._postSceneLoadActions.push((function(){if(null!=n.skeleton){var t=s.Get("/skins/".concat(n.index,"/skeleton"),o._gltf.nodes,n.skeleton).parent;i.index===t.index?e.parent=r.parent:e.parent=t._babylonTransformNode}else e.parent=o._rootBabylonMesh;o._parent.onSkinLoadedObservable.notifyObservers({node:r,skinnedNode:e})}))})))})));return this.logClose(),Promise.all(c).then((function(){return o._forEachPrimitive(i,(function(e){e.geometry&&e.geometry.useBoundingInfoFromGeometry?e._updateBoundingInfo():e.refreshBoundingInfo(!0,!0)})),i._babylonTransformNode}))},e.prototype._loadMeshAsync=function(e,t,i,n){var o=i.primitives;if(!o||!o.length)throw new Error("".concat(e,": Primitives are missing"));null==o[0].index&&s.Assign(o);var a=new Array;this.logOpen("".concat(e," ").concat(i.name||""));var l=t.name||"node".concat(t.index);if(1===o.length){var c=i.primitives[0];a.push(this._loadMeshPrimitiveAsync("".concat(e,"/primitives/").concat(c.index),l,t,i,c,(function(e){t._babylonTransformNode=e,t._primitiveBabylonMeshes=[e]})))}else{this._babylonScene._blockEntityCollection=!!this._assetContainer,t._babylonTransformNode=new r.TransformNode(l,this._babylonScene),t._babylonTransformNode._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t._primitiveBabylonMeshes=[];for(var u=0,h=o;u<h.length;u++)c=h[u],a.push(this._loadMeshPrimitiveAsync("".concat(e,"/primitives/").concat(c.index),"".concat(l,"_primitive").concat(c.index),t,i,c,(function(e){e.parent=t._babylonTransformNode,t._primitiveBabylonMeshes.push(e)})))}return n(t._babylonTransformNode),this.logClose(),Promise.all(a).then((function(){return t._babylonTransformNode}))},e.prototype._loadMeshPrimitiveAsync=function(t,i,n,o,a,l){var c=this,u=this._extensionsLoadMeshPrimitiveAsync(t,i,n,o,a,l);if(u)return u;this.logOpen("".concat(t));var h,d,_=0===this._disableInstancedMesh&&this._parent.createInstances&&null==n.skin&&!o.primitives[0].targets;if(_&&a._instanceData)this._babylonScene._blockEntityCollection=!!this._assetContainer,(h=a._instanceData.babylonSourceMesh.createInstance(i))._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,d=a._instanceData.promise;else{var f=new Array;this._babylonScene._blockEntityCollection=!!this._assetContainer;var p=new r.Mesh(i,this._babylonScene);p._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,p.sideOrientation=this._babylonScene.useRightHandedSystem?r.Material.CounterClockWiseSideOrientation:r.Material.ClockWiseSideOrientation,this._createMorphTargets(t,n,o,a,p),f.push(this._loadVertexDataAsync(t,a,p).then((function(e){return c._loadMorphTargetsAsync(t,a,p,e).then((function(){c._disposed||(c._babylonScene._blockEntityCollection=!!c._assetContainer,e.applyToMesh(p),e._parentContainer=c._assetContainer,c._babylonScene._blockEntityCollection=!1)}))})));var m=e._GetDrawMode(t,a.mode);if(null==a.material){var g=this._defaultBabylonMaterialData[m];g||(g=this._createDefaultMaterial("__GLTFLoader._default",m),this._parent.onMaterialLoadedObservable.notifyObservers(g),this._defaultBabylonMaterialData[m]=g),p.material=g}else if(!this.parent.skipMaterials){var v=s.Get("".concat(t,"/material"),this._gltf.materials,a.material);f.push(this._loadMaterialAsync("/materials/".concat(v.index),v,p,m,(function(e){p.material=e})))}d=Promise.all(f),_&&(a._instanceData={babylonSourceMesh:p,promise:d}),h=p}return e.AddPointerMetadata(h,t),this._parent.onMeshLoadedObservable.notifyObservers(h),l(h),this.logClose(),d.then((function(){return h}))},e.prototype._loadVertexDataAsync=function(e,t,i){var n=this,o=this._extensionsLoadVertexDataAsync(e,t,i);if(o)return o;var a=t.attributes;if(!a)throw new Error("".concat(e,": Attributes are missing"));var l=new Array,c=new r.Geometry(i.name,this._babylonScene);if(null==t.indices)i.isUnIndexed=!0;else{var u=s.Get("".concat(e,"/indices"),this._gltf.accessors,t.indices);l.push(this._loadIndicesAccessorAsync("/accessors/".concat(u.index),u).then((function(e){c.setIndices(e)})))}var h=function(t,o,u){if(null!=a[t]){i._delayInfo=i._delayInfo||[],-1===i._delayInfo.indexOf(o)&&i._delayInfo.push(o);var h=s.Get("".concat(e,"/attributes/").concat(t),n._gltf.accessors,a[t]);l.push(n._loadVertexAccessorAsync("/accessors/".concat(h.index),h,o).then((function(e){var t,o;if(e.getKind()===r.VertexBuffer.PositionKind&&!n.parent.alwaysComputeBoundingBox&&!i.skeleton&&h.min&&h.max){var a=(t=r.TmpVectors.Vector3[0]).copyFromFloats.apply(t,h.min),s=(o=r.TmpVectors.Vector3[1]).copyFromFloats.apply(o,h.max);if(h.normalized&&5126!==h.componentType){var l=1;switch(h.componentType){case 5120:l=127;break;case 5121:l=255;break;case 5122:l=32767;break;case 5123:l=65535}var u=1/l;a.scaleInPlace(u),s.scaleInPlace(u)}c._boundingInfo=new r.BoundingInfo(a,s),c.useBoundingInfoFromGeometry=!0}c.setVerticesBuffer(e,h.count)}))),o==r.VertexBuffer.MatricesIndicesExtraKind&&(i.numBoneInfluencers=8),u&&u(h)}};return h("POSITION",r.VertexBuffer.PositionKind),h("NORMAL",r.VertexBuffer.NormalKind),h("TANGENT",r.VertexBuffer.TangentKind),h("TEXCOORD_0",r.VertexBuffer.UVKind),h("TEXCOORD_1",r.VertexBuffer.UV2Kind),h("TEXCOORD_2",r.VertexBuffer.UV3Kind),h("TEXCOORD_3",r.VertexBuffer.UV4Kind),h("TEXCOORD_4",r.VertexBuffer.UV5Kind),h("TEXCOORD_5",r.VertexBuffer.UV6Kind),h("JOINTS_0",r.VertexBuffer.MatricesIndicesKind),h("WEIGHTS_0",r.VertexBuffer.MatricesWeightsKind),h("JOINTS_1",r.VertexBuffer.MatricesIndicesExtraKind),h("WEIGHTS_1",r.VertexBuffer.MatricesWeightsExtraKind),h("COLOR_0",r.VertexBuffer.ColorKind,(function(e){"VEC4"===e.type&&(i.hasVertexAlpha=!0)})),Promise.all(l).then((function(){return c}))},e.prototype._createMorphTargets=function(e,t,i,n,o){if(n.targets){if(null==t._numMorphTargets)t._numMorphTargets=n.targets.length;else if(n.targets.length!==t._numMorphTargets)throw new Error("".concat(e,": Primitives do not have the same number of targets"));var a=i.extras?i.extras.targetNames:null;this._babylonScene._blockEntityCollection=!!this._assetContainer,o.morphTargetManager=new r.MorphTargetManager(this._babylonScene),o.morphTargetManager._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,o.morphTargetManager.areUpdatesFrozen=!0;for(var s=0;s<n.targets.length;s++){var l=t.weights?t.weights[s]:i.weights?i.weights[s]:0,c=a?a[s]:"morphTarget".concat(s);o.morphTargetManager.addTarget(new r.MorphTarget(c,l,o.getScene()))}}},e.prototype._loadMorphTargetsAsync=function(e,t,i,r){if(!t.targets)return Promise.resolve();for(var n=new Array,o=i.morphTargetManager,a=0;a<o.numTargets;a++){var s=o.getTarget(a);n.push(this._loadMorphTargetVertexDataAsync("".concat(e,"/targets/").concat(a),r,t.targets[a],s))}return Promise.all(n).then((function(){o.areUpdatesFrozen=!1}))},e.prototype._loadMorphTargetVertexDataAsync=function(e,t,i,n){var o=this,a=new Array,l=function(r,n,l){if(null!=i[r]){var c=t.getVertexBuffer(n);if(c){var u=s.Get("".concat(e,"/").concat(r),o._gltf.accessors,i[r]);a.push(o._loadFloatAccessorAsync("/accessors/".concat(u.index),u).then((function(e){l(c,e)})))}}};return l("POSITION",r.VertexBuffer.PositionKind,(function(e,t){var i=new Float32Array(t.length);e.forEach(t.length,(function(e,r){i[r]=t[r]+e})),n.setPositions(i)})),l("NORMAL",r.VertexBuffer.NormalKind,(function(e,t){var i=new Float32Array(t.length);e.forEach(i.length,(function(e,r){i[r]=t[r]+e})),n.setNormals(i)})),l("TANGENT",r.VertexBuffer.TangentKind,(function(e,t){var i=new Float32Array(t.length/3*4),r=0;e.forEach(t.length/3*4,(function(e,n){(n+1)%4!=0&&(i[r]=t[r]+e,r++)})),n.setTangents(i)})),Promise.all(a).then((function(){}))},e._LoadTransform=function(e,t){if(null==e.skin){var i=r.Vector3.Zero(),n=r.Quaternion.Identity(),o=r.Vector3.One();e.matrix?r.Matrix.FromArray(e.matrix).decompose(o,n,i):(e.translation&&(i=r.Vector3.FromArray(e.translation)),e.rotation&&(n=r.Quaternion.FromArray(e.rotation)),e.scale&&(o=r.Vector3.FromArray(e.scale))),t.position=i,t.rotationQuaternion=n,t.scaling=o}},e.prototype._loadSkinAsync=function(e,t,i,n){var o=this,a=this._extensionsLoadSkinAsync(e,t,i);if(a)return a;if(i._data)return n(i._data.babylonSkeleton),i._data.promise;var s="skeleton".concat(i.index);this._babylonScene._blockEntityCollection=!!this._assetContainer;var l=new r.Skeleton(i.name||s,s,this._babylonScene);l._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,this._loadBones(e,i,l);var c=this._loadSkinInverseBindMatricesDataAsync(e,i).then((function(e){o._updateBoneMatrices(l,e)}));return i._data={babylonSkeleton:l,promise:c},n(l),c},e.prototype._loadBones=function(e,t,i){if(null==t.skeleton||this._parent.alwaysComputeSkeletonRootNode){var n=this._findSkeletonRootNode("".concat(e,"/joints"),t.joints);if(n)if(void 0===t.skeleton)t.skeleton=n.index;else{var o=s.Get("".concat(e,"/skeleton"),this._gltf.nodes,t.skeleton);o===n||function(e,t){for(;t.parent;t=t.parent)if(t.parent===e)return!0;return!1}(o,n)||(r.Logger.Warn("".concat(e,"/skeleton: Overriding with nearest common ancestor as skeleton node is not a common root")),t.skeleton=n.index)}else r.Logger.Warn("".concat(e,": Failed to find common root"))}for(var a={},l=0,c=t.joints;l<c.length;l++){var u=c[l],h=s.Get("".concat(e,"/joints/").concat(u),this._gltf.nodes,u);this._loadBone(h,t,i,a)}},e.prototype._findSkeletonRootNode=function(e,t){if(0===t.length)return null;for(var i={},r=0,n=t;r<n.length;r++){for(var o=n[r],a=[],l=s.Get("".concat(e,"/").concat(o),this._gltf.nodes,o);-1!==l.index;)a.unshift(l),l=l.parent;i[o]=a}for(var c=null,u=0;;++u){if(u>=(a=i[t[0]]).length)return c;l=a[u];for(var h=1;h<t.length;++h)if(u>=(a=i[t[h]]).length||l!==a[u])return c;c=l}},e.prototype._loadBone=function(e,t,i,n){var o=n[e.index];if(o)return o;var a=null;e.index!==t.skeleton&&(e.parent&&-1!==e.parent.index?a=this._loadBone(e.parent,t,i,n):void 0!==t.skeleton&&r.Logger.Warn("/skins/".concat(t.index,"/skeleton: Skeleton node is not a common root")));var s=t.joints.indexOf(e.index);return o=new r.Bone(e.name||"joint".concat(e.index),i,a,this._getNodeMatrix(e),null,null,s),n[e.index]=o,this._postSceneLoadActions.push((function(){o.linkTransformNode(e._babylonTransformNode)})),o},e.prototype._loadSkinInverseBindMatricesDataAsync=function(e,t){if(null==t.inverseBindMatrices)return Promise.resolve(null);var i=s.Get("".concat(e,"/inverseBindMatrices"),this._gltf.accessors,t.inverseBindMatrices);return this._loadFloatAccessorAsync("/accessors/".concat(i.index),i)},e.prototype._updateBoneMatrices=function(e,t){for(var i=0,n=e.bones;i<n.length;i++){var o=n[i],a=r.Matrix.Identity(),s=o._index;t&&-1!==s&&(r.Matrix.FromArrayToRef(t,16*s,a),a.invertToRef(a));var l=o.getParent();l&&a.multiplyToRef(l.getAbsoluteInverseBindMatrix(),a),o.updateMatrix(a,!1,!1),o._updateAbsoluteBindMatrices(void 0,!1)}},e.prototype._getNodeMatrix=function(e){return e.matrix?r.Matrix.FromArray(e.matrix):r.Matrix.Compose(e.scale?r.Vector3.FromArray(e.scale):r.Vector3.One(),e.rotation?r.Quaternion.FromArray(e.rotation):r.Quaternion.Identity(),e.translation?r.Vector3.FromArray(e.translation):r.Vector3.Zero())},e.prototype.loadCameraAsync=function(t,i,n){void 0===n&&(n=function(){});var o=this._extensionsLoadCameraAsync(t,i,n);if(o)return o;var a=new Array;this.logOpen("".concat(t," ").concat(i.name||"")),this._babylonScene._blockEntityCollection=!!this._assetContainer;var s=new r.FreeCamera(i.name||"camera".concat(i.index),r.Vector3.Zero(),this._babylonScene,!1);switch(s._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,s.ignoreParentScaling=!0,i._babylonCamera=s,s.rotation.set(0,Math.PI,0),i.type){case"perspective":var l=i.perspective;if(!l)throw new Error("".concat(t,": Camera perspective properties are missing"));s.fov=l.yfov,s.minZ=l.znear,s.maxZ=l.zfar||0;break;case"orthographic":if(!i.orthographic)throw new Error("".concat(t,": Camera orthographic properties are missing"));s.mode=r.Camera.ORTHOGRAPHIC_CAMERA,s.orthoLeft=-i.orthographic.xmag,s.orthoRight=i.orthographic.xmag,s.orthoBottom=-i.orthographic.ymag,s.orthoTop=i.orthographic.ymag,s.minZ=i.orthographic.znear,s.maxZ=i.orthographic.zfar;break;default:throw new Error("".concat(t,": Invalid camera type (").concat(i.type,")"))}return e.AddPointerMetadata(s,t),this._parent.onCameraLoadedObservable.notifyObservers(s),n(s),this.logClose(),Promise.all(a).then((function(){return s}))},e.prototype._loadAnimationsAsync=function(){var e=this._gltf.animations;if(!e)return Promise.resolve();for(var t=new Array,i=0;i<e.length;i++){var r=e[i];t.push(this.loadAnimationAsync("/animations/".concat(r.index),r).then((function(e){0===e.targetedAnimations.length&&e.dispose()})))}return Promise.all(t).then((function(){}))},e.prototype.loadAnimationAsync=function(e,t){var i=this._extensionsLoadAnimationAsync(e,t);if(i)return i;this._babylonScene._blockEntityCollection=!!this._assetContainer;var n=new r.AnimationGroup(t.name||"animation".concat(t.index),this._babylonScene);n._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t._babylonAnimationGroup=n;var o=new Array;s.Assign(t.channels),s.Assign(t.samplers);for(var a=0,l=t.channels;a<l.length;a++){var c=l[a];o.push(this._loadAnimationChannelAsync("".concat(e,"/channels/").concat(c.index),e,t,c,(function(e,t){e.animations=e.animations||[],e.animations.push(t),n.addTargetedAnimation(t,e)})))}return Promise.all(o).then((function(){return n.normalize(0),n}))},e.prototype._loadAnimationChannelAsync=function(e,t,i,r,n){var a=this._extensionsLoadAnimationChannelAsync(e,t,i,r,n);if(a)return a;if(null==r.target.node)return Promise.resolve();var l,c=s.Get("".concat(e,"/target/node"),this._gltf.nodes,r.target.node);if("weights"===r.target.path&&!c._numMorphTargets||"weights"!==r.target.path&&!c._babylonTransformNode)return Promise.resolve();switch(r.target.path){case"translation":l=o.nodeAnimationData.translation;break;case"rotation":l=o.nodeAnimationData.rotation;break;case"scale":l=o.nodeAnimationData.scale;break;case"weights":l=o.nodeAnimationData.weights;break;default:throw new Error("".concat(e,"/target/path: Invalid value (").concat(r.target.path,")"))}var u={object:c,info:l};return this._loadAnimationChannelFromTargetInfoAsync(e,t,i,r,u,n)},e.prototype._loadAnimationChannelFromTargetInfoAsync=function(e,t,i,r,n,o){var a=this.parent.targetFps,l=1/a,c=s.Get("".concat(e,"/sampler"),i.samplers,r.sampler);return this._loadAnimationSamplerAsync("".concat(t,"/samplers/").concat(r.sampler),c).then((function(e){for(var t=0,s=n.object,c=0,u=n.info;c<u.length;c++){var h=u[c],d=h.getStride(s),_=e.input,f=e.output,p=new Array(_.length),m=0;switch(e.interpolation){case"STEP":for(var g=0;g<_.length;g++){var v=h.getValue(s,f,m,1);m+=d,p[g]={frame:_[g]*a,value:v,interpolation:1}}break;case"CUBICSPLINE":for(g=0;g<_.length;g++){var b=h.getValue(s,f,m,l);m+=d,v=h.getValue(s,f,m,1),m+=d;var y=h.getValue(s,f,m,l);m+=d,p[g]={frame:_[g]*a,inTangent:b,value:v,outTangent:y}}break;case"LINEAR":for(g=0;g<_.length;g++)v=h.getValue(s,f,m,1),m+=d,p[g]={frame:_[g]*a,value:v}}if(m>0){var x="".concat(i.name||"animation".concat(i.index),"_channel").concat(r.index,"_").concat(t);h.buildAnimations(s,x,a,p,(function(e,i){++t,o(e,i)}))}}}))},e.prototype._loadAnimationSamplerAsync=function(e,t){if(t._data)return t._data;var i=t.interpolation||"LINEAR";switch(i){case"STEP":case"LINEAR":case"CUBICSPLINE":break;default:throw new Error("".concat(e,"/interpolation: Invalid value (").concat(t.interpolation,")"))}var r=s.Get("".concat(e,"/input"),this._gltf.accessors,t.input),n=s.Get("".concat(e,"/output"),this._gltf.accessors,t.output);return t._data=Promise.all([this._loadFloatAccessorAsync("/accessors/".concat(r.index),r),this._loadFloatAccessorAsync("/accessors/".concat(n.index),n)]).then((function(e){var t=e[0],r=e[1];return{input:t,interpolation:i,output:r}})),t._data},e.prototype.loadBufferAsync=function(e,t,i,r){var n=this._extensionsLoadBufferAsync(e,t,i,r);if(n)return n;if(!t._data)if(t.uri)t._data=this.loadUriAsync("".concat(e,"/uri"),t,t.uri);else{if(!this._bin)throw new Error("".concat(e,": Uri is missing or the binary glTF is missing its binary chunk"));t._data=this._bin.readAsync(0,t.byteLength)}return t._data.then((function(t){try{return new Uint8Array(t.buffer,t.byteOffset+i,r)}catch(t){throw new Error("".concat(e,": ").concat(t.message))}}))},e.prototype.loadBufferViewAsync=function(e,t){var i=this._extensionsLoadBufferViewAsync(e,t);if(i)return i;if(t._data)return t._data;var r=s.Get("".concat(e,"/buffer"),this._gltf.buffers,t.buffer);return t._data=this.loadBufferAsync("/buffers/".concat(r.index),r,t.byteOffset||0,t.byteLength),t._data},e.prototype._loadAccessorAsync=function(t,i,n){var o=this;if(i._data)return i._data;var a=e._GetNumComponents(t,i.type),l=a*r.VertexBuffer.GetTypeByteLength(i.componentType),c=a*i.count;if(null==i.bufferView)i._data=Promise.resolve(new n(c));else{var u=s.Get("".concat(t,"/bufferView"),this._gltf.bufferViews,i.bufferView);i._data=this.loadBufferViewAsync("/bufferViews/".concat(u.index),u).then((function(o){if(5126!==i.componentType||i.normalized||u.byteStride&&u.byteStride!==l){var s=new n(c);return r.VertexBuffer.ForEach(o,i.byteOffset||0,u.byteStride||l,a,i.componentType,s.length,i.normalized||!1,(function(e,t){s[t]=e})),s}return e._GetTypedArray(t,i.componentType,o,i.byteOffset,c)}))}if(i.sparse){var h=i.sparse;i._data=i._data.then((function(c){var u=c,d=s.Get("".concat(t,"/sparse/indices/bufferView"),o._gltf.bufferViews,h.indices.bufferView),_=s.Get("".concat(t,"/sparse/values/bufferView"),o._gltf.bufferViews,h.values.bufferView);return Promise.all([o.loadBufferViewAsync("/bufferViews/".concat(d.index),d),o.loadBufferViewAsync("/bufferViews/".concat(_.index),_)]).then((function(o){var s,c=o[0],d=o[1],_=e._GetTypedArray("".concat(t,"/sparse/indices"),h.indices.componentType,c,h.indices.byteOffset,h.count),f=a*h.count;if(5126!==i.componentType||i.normalized){var p=e._GetTypedArray("".concat(t,"/sparse/values"),i.componentType,d,h.values.byteOffset,f);s=new n(f),r.VertexBuffer.ForEach(p,0,l,a,i.componentType,s.length,i.normalized||!1,(function(e,t){s[t]=e}))}else s=e._GetTypedArray("".concat(t,"/sparse/values"),i.componentType,d,h.values.byteOffset,f);for(var m=0,g=0;g<_.length;g++)for(var v=_[g]*a,b=0;b<a;b++)u[v++]=s[m++];return u}))}))}return i._data},e.prototype._loadFloatAccessorAsync=function(e,t){return this._loadAccessorAsync(e,t,Float32Array)},e.prototype._loadIndicesAccessorAsync=function(t,i){if("SCALAR"!==i.type)throw new Error("".concat(t,"/type: Invalid value ").concat(i.type));if(5121!==i.componentType&&5123!==i.componentType&&5125!==i.componentType)throw new Error("".concat(t,"/componentType: Invalid value ").concat(i.componentType));if(i._data)return i._data;if(i.sparse){var r=e._GetTypedArrayConstructor("".concat(t,"/componentType"),i.componentType);i._data=this._loadAccessorAsync(t,i,r)}else{var n=s.Get("".concat(t,"/bufferView"),this._gltf.bufferViews,i.bufferView);i._data=this.loadBufferViewAsync("/bufferViews/".concat(n.index),n).then((function(r){return e._GetTypedArray(t,i.componentType,r,i.byteOffset,i.count)}))}return i._data},e.prototype._loadVertexBufferViewAsync=function(e){if(e._babylonBuffer)return e._babylonBuffer;var t=this._babylonScene.getEngine();return e._babylonBuffer=this.loadBufferViewAsync("/bufferViews/".concat(e.index),e).then((function(e){return new r.Buffer(t,e,!1)})),e._babylonBuffer},e.prototype._loadVertexAccessorAsync=function(t,i,n){var o;if(null===(o=i._babylonVertexBuffer)||void 0===o?void 0:o[n])return i._babylonVertexBuffer[n];i._babylonVertexBuffer||(i._babylonVertexBuffer={});var a=this._babylonScene.getEngine();if(i.sparse||null==i.bufferView)i._babylonVertexBuffer[n]=this._loadFloatAccessorAsync(t,i).then((function(e){return new r.VertexBuffer(a,e,n,!1)}));else{var l=s.Get("".concat(t,"/bufferView"),this._gltf.bufferViews,i.bufferView);i._babylonVertexBuffer[n]=this._loadVertexBufferViewAsync(l).then((function(o){var s=e._GetNumComponents(t,i.type);return new r.VertexBuffer(a,o,n,!1,void 0,l.byteStride,void 0,i.byteOffset,s,i.componentType,i.normalized,!0,void 0,!0)}))}return i._babylonVertexBuffer[n]},e.prototype._loadMaterialMetallicRoughnessPropertiesAsync=function(e,t,i){if(!(i instanceof r.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));var n=new Array;return t&&(t.baseColorFactor?(i.albedoColor=r.Color3.FromArray(t.baseColorFactor),i.alpha=t.baseColorFactor[3]):i.albedoColor=r.Color3.White(),i.metallic=null==t.metallicFactor?1:t.metallicFactor,i.roughness=null==t.roughnessFactor?1:t.roughnessFactor,t.baseColorTexture&&n.push(this.loadTextureInfoAsync("".concat(e,"/baseColorTexture"),t.baseColorTexture,(function(e){e.name="".concat(i.name," (Base Color)"),i.albedoTexture=e}))),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync("".concat(e,"/metallicRoughnessTexture"),t.metallicRoughnessTexture,(function(e){e.name="".concat(i.name," (Metallic Roughness)"),i.metallicTexture=e}))),i.useMetallnessFromMetallicTextureBlue=!0,i.useRoughnessFromMetallicTextureGreen=!0,i.useRoughnessFromMetallicTextureAlpha=!1)),Promise.all(n).then((function(){}))},e.prototype._loadMaterialAsync=function(t,i,r,n,o){void 0===o&&(o=function(){});var a=this._extensionsLoadMaterialAsync(t,i,r,n,o);if(a)return a;i._data=i._data||{};var s=i._data[n];if(!s){this.logOpen("".concat(t," ").concat(i.name||""));var l=this.createMaterial(t,i,n);s={babylonMaterial:l,babylonMeshes:[],promise:this.loadMaterialPropertiesAsync(t,i,l)},i._data[n]=s,e.AddPointerMetadata(l,t),this._parent.onMaterialLoadedObservable.notifyObservers(l),this.logClose()}return r&&(s.babylonMeshes.push(r),r.onDisposeObservable.addOnce((function(){var e=s.babylonMeshes.indexOf(r);-1!==e&&s.babylonMeshes.splice(e,1)}))),o(s.babylonMaterial),s.promise.then((function(){return s.babylonMaterial}))},e.prototype._createDefaultMaterial=function(e,t){this._babylonScene._blockEntityCollection=!!this._assetContainer;var i=new r.PBRMaterial(e,this._babylonScene);return i._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,i.fillMode=t,i.enableSpecularAntiAliasing=!0,i.useRadianceOverAlpha=!this._parent.transparencyAsCoverage,i.useSpecularOverAlpha=!this._parent.transparencyAsCoverage,i.transparencyMode=r.PBRMaterial.PBRMATERIAL_OPAQUE,i.metallic=1,i.roughness=1,i},e.prototype.createMaterial=function(e,t,i){var r=this._extensionsCreateMaterial(e,t,i);if(r)return r;var n=t.name||"material".concat(t.index);return this._createDefaultMaterial(n,i)},e.prototype.loadMaterialPropertiesAsync=function(e,t,i){var r=this._extensionsLoadMaterialPropertiesAsync(e,t,i);if(r)return r;var n=new Array;return n.push(this.loadMaterialBasePropertiesAsync(e,t,i)),t.pbrMetallicRoughness&&n.push(this._loadMaterialMetallicRoughnessPropertiesAsync("".concat(e,"/pbrMetallicRoughness"),t.pbrMetallicRoughness,i)),this.loadMaterialAlphaProperties(e,t,i),Promise.all(n).then((function(){}))},e.prototype.loadMaterialBasePropertiesAsync=function(e,t,i){if(!(i instanceof r.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));var n=new Array;return i.emissiveColor=t.emissiveFactor?r.Color3.FromArray(t.emissiveFactor):new r.Color3(0,0,0),t.doubleSided&&(i.backFaceCulling=!1,i.twoSidedLighting=!0),t.normalTexture&&(t.normalTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync("".concat(e,"/normalTexture"),t.normalTexture,(function(e){e.name="".concat(i.name," (Normal)"),i.bumpTexture=e}))),i.invertNormalMapX=!this._babylonScene.useRightHandedSystem,i.invertNormalMapY=this._babylonScene.useRightHandedSystem,null!=t.normalTexture.scale&&i.bumpTexture&&(i.bumpTexture.level=t.normalTexture.scale),i.forceIrradianceInFragment=!0),t.occlusionTexture&&(t.occlusionTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync("".concat(e,"/occlusionTexture"),t.occlusionTexture,(function(e){e.name="".concat(i.name," (Occlusion)"),i.ambientTexture=e}))),i.useAmbientInGrayScale=!0,null!=t.occlusionTexture.strength&&(i.ambientTextureStrength=t.occlusionTexture.strength)),t.emissiveTexture&&n.push(this.loadTextureInfoAsync("".concat(e,"/emissiveTexture"),t.emissiveTexture,(function(e){e.name="".concat(i.name," (Emissive)"),i.emissiveTexture=e}))),Promise.all(n).then((function(){}))},e.prototype.loadMaterialAlphaProperties=function(e,t,i){if(!(i instanceof r.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));switch(t.alphaMode||"OPAQUE"){case"OPAQUE":i.transparencyMode=r.PBRMaterial.PBRMATERIAL_OPAQUE,i.alpha=1;break;case"MASK":i.transparencyMode=r.PBRMaterial.PBRMATERIAL_ALPHATEST,i.alphaCutOff=null==t.alphaCutoff?.5:t.alphaCutoff,i.albedoTexture&&(i.albedoTexture.hasAlpha=!0);break;case"BLEND":i.transparencyMode=r.PBRMaterial.PBRMATERIAL_ALPHABLEND,i.albedoTexture&&(i.albedoTexture.hasAlpha=!0,i.useAlphaFromAlbedoTexture=!0);break;default:throw new Error("".concat(e,"/alphaMode: Invalid value (").concat(t.alphaMode,")"))}},e.prototype.loadTextureInfoAsync=function(t,i,r){var n=this;void 0===r&&(r=function(){});var o=this._extensionsLoadTextureInfoAsync(t,i,r);if(o)return o;if(this.logOpen("".concat(t)),i.texCoord>=6)throw new Error("".concat(t,"/texCoord: Invalid value (").concat(i.texCoord,")"));var a=s.Get("".concat(t,"/index"),this._gltf.textures,i.index);a._textureInfo=i;var l=this._loadTextureAsync("/textures/".concat(i.index),a,(function(o){o.coordinatesIndex=i.texCoord||0,e.AddPointerMetadata(o,t),n._parent.onTextureLoadedObservable.notifyObservers(o),r(o)}));return this.logClose(),l},e.prototype._loadTextureAsync=function(t,i,r){void 0===r&&(r=function(){});var n=this._extensionsLoadTextureAsync(t,i,r);if(n)return n;this.logOpen("".concat(t," ").concat(i.name||""));var o=null==i.sampler?e.DefaultSampler:s.Get("".concat(t,"/sampler"),this._gltf.samplers,i.sampler),a=s.Get("".concat(t,"/source"),this._gltf.images,i.source),l=this._createTextureAsync(t,o,a,r,void 0,!i._textureInfo.nonColorData);return this.logClose(),l},e.prototype._createTextureAsync=function(e,t,i,n,o,a){var s=this;void 0===n&&(n=function(){});var l=this._loadSampler("/samplers/".concat(t.index),t),c=new Array,u=new r.Deferred;this._babylonScene._blockEntityCollection=!!this._assetContainer;var h={noMipmap:l.noMipMaps,invertY:!1,samplingMode:l.samplingMode,onLoad:function(){s._disposed||u.resolve()},onError:function(t,i){s._disposed||u.reject(new Error("".concat(e,": ").concat(i&&i.message?i.message:t||"Failed to load texture")))},mimeType:i.mimeType,loaderOptions:o,useSRGBBuffer:!!a&&this._parent.useSRGBBuffers},d=new r.Texture(null,this._babylonScene,h);return d._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,c.push(u.promise),c.push(this.loadImageAsync("/images/".concat(i.index),i).then((function(e){var t=i.uri||"".concat(s._fileName,"#image").concat(i.index),r="data:".concat(s._uniqueRootUrl).concat(t);d.updateURL(r,e)}))),d.wrapU=l.wrapU,d.wrapV=l.wrapV,n(d),Promise.all(c).then((function(){return d}))},e.prototype._loadSampler=function(t,i){return i._data||(i._data={noMipMaps:9728===i.minFilter||9729===i.minFilter,samplingMode:e._GetTextureSamplingMode(t,i),wrapU:e._GetTextureWrapMode("".concat(t,"/wrapS"),i.wrapS),wrapV:e._GetTextureWrapMode("".concat(t,"/wrapT"),i.wrapT)}),i._data},e.prototype.loadImageAsync=function(e,t){if(!t._data){if(this.logOpen("".concat(e," ").concat(t.name||"")),t.uri)t._data=this.loadUriAsync("".concat(e,"/uri"),t,t.uri);else{var i=s.Get("".concat(e,"/bufferView"),this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync("/bufferViews/".concat(i.index),i)}this.logClose()}return t._data},e.prototype.loadUriAsync=function(t,i,n){var o=this,a=this._extensionsLoadUriAsync(t,i,n);if(a)return a;if(!e._ValidateUri(n))throw new Error("".concat(t,": '").concat(n,"' is invalid"));if((0,r.IsBase64DataUrl)(n)){var s=new Uint8Array((0,r.DecodeBase64UrlToBinary)(n));return this.log("".concat(t,": Decoded ").concat(n.substr(0,64),"... (").concat(s.length," bytes)")),Promise.resolve(s)}return this.log("".concat(t,": Loading ").concat(n)),this._parent.preprocessUrlAsync(this._rootUrl+n).then((function(e){return new Promise((function(i,a){o._parent._loadFile(o._babylonScene,e,(function(e){o._disposed||(o.log("".concat(t,": Loaded ").concat(n," (").concat(e.byteLength," bytes)")),i(new Uint8Array(e)))}),!0,(function(e){a(new r.LoadFileError("".concat(t,": Failed to load '").concat(n,"'").concat(e?": "+e.status+" "+e.statusText:""),e))}))}))}))},e.AddPointerMetadata=function(e,t){e.metadata=e.metadata||{};var i=e._internalMetadata=e._internalMetadata||{},r=i.gltf=i.gltf||{};(r.pointers=r.pointers||[]).push(t)},e._GetTextureWrapMode=function(e,t){switch(t=null==t?10497:t){case 33071:return r.Texture.CLAMP_ADDRESSMODE;case 33648:return r.Texture.MIRROR_ADDRESSMODE;case 10497:return r.Texture.WRAP_ADDRESSMODE;default:return r.Logger.Warn("".concat(e,": Invalid value (").concat(t,")")),r.Texture.WRAP_ADDRESSMODE}},e._GetTextureSamplingMode=function(e,t){var i=null==t.magFilter?9729:t.magFilter,n=null==t.minFilter?9987:t.minFilter;if(9729===i)switch(n){case 9728:return r.Texture.LINEAR_NEAREST;case 9729:return r.Texture.LINEAR_LINEAR;case 9984:return r.Texture.LINEAR_NEAREST_MIPNEAREST;case 9985:return r.Texture.LINEAR_LINEAR_MIPNEAREST;case 9986:return r.Texture.LINEAR_NEAREST_MIPLINEAR;case 9987:return r.Texture.LINEAR_LINEAR_MIPLINEAR;default:return r.Logger.Warn("".concat(e,"/minFilter: Invalid value (").concat(n,")")),r.Texture.LINEAR_LINEAR_MIPLINEAR}else switch(9728!==i&&r.Logger.Warn("".concat(e,"/magFilter: Invalid value (").concat(i,")")),n){case 9728:return r.Texture.NEAREST_NEAREST;case 9729:return r.Texture.NEAREST_LINEAR;case 9984:return r.Texture.NEAREST_NEAREST_MIPNEAREST;case 9985:return r.Texture.NEAREST_LINEAR_MIPNEAREST;case 9986:return r.Texture.NEAREST_NEAREST_MIPLINEAR;case 9987:return r.Texture.NEAREST_LINEAR_MIPLINEAR;default:return r.Logger.Warn("".concat(e,"/minFilter: Invalid value (").concat(n,")")),r.Texture.NEAREST_NEAREST_MIPNEAREST}},e._GetTypedArrayConstructor=function(e,t){switch(t){case 5120:return Int8Array;case 5121:return Uint8Array;case 5122:return Int16Array;case 5123:return Uint16Array;case 5125:return Uint32Array;case 5126:return Float32Array;default:throw new Error("".concat(e,": Invalid component type ").concat(t))}},e._GetTypedArray=function(t,i,n,o,a){var s=n.buffer;o=n.byteOffset+(o||0);var l=e._GetTypedArrayConstructor("".concat(t,"/componentType"),i),c=r.VertexBuffer.GetTypeByteLength(i);return o%c!=0?(r.Logger.Warn("".concat(t,": Copying buffer as byte offset (").concat(o,") is not a multiple of component type byte length (").concat(c,")")),new l(s.slice(o,o+a*c),0)):new l(s,o,a)},e._GetNumComponents=function(e,t){switch(t){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}throw new Error("".concat(e,": Invalid type (").concat(t,")"))},e._ValidateUri=function(e){return r.Tools.IsBase64(e)||-1===e.indexOf("..")},e._GetDrawMode=function(e,t){switch(null==t&&(t=4),t){case 0:return r.Material.PointListDrawMode;case 1:return r.Material.LineListDrawMode;case 2:return r.Material.LineLoopDrawMode;case 3:return r.Material.LineStripDrawMode;case 4:return r.Material.TriangleFillMode;case 5:return r.Material.TriangleStripDrawMode;case 6:return r.Material.TriangleFanDrawMode}throw new Error("".concat(e,": Invalid mesh primitive mode (").concat(t,")"))},e.prototype._compileMaterialsAsync=function(){var e=this;this._parent._startPerformanceCounter("Compile materials");var t=new Array;if(this._gltf.materials)for(var i=0,r=this._gltf.materials;i<r.length;i++){var n=r[i];if(n._data)for(var o in n._data)for(var a=n._data[o],s=0,l=a.babylonMeshes;s<l.length;s++){var c=l[s];c.computeWorldMatrix(!0);var u=a.babylonMaterial;t.push(u.forceCompilationAsync(c)),t.push(u.forceCompilationAsync(c,{useInstances:!0})),this._parent.useClipPlane&&(t.push(u.forceCompilationAsync(c,{clipPlane:!0})),t.push(u.forceCompilationAsync(c,{clipPlane:!0,useInstances:!0})))}}return Promise.all(t).then((function(){e._parent._endPerformanceCounter("Compile materials")}))},e.prototype._compileShadowGeneratorsAsync=function(){var e=this;this._parent._startPerformanceCounter("Compile shadow generators");for(var t=new Array,i=0,r=this._babylonScene.lights;i<r.length;i++){var n=r[i].getShadowGenerator();n&&t.push(n.forceCompilationAsync())}return Promise.all(t).then((function(){e._parent._endPerformanceCounter("Compile shadow generators")}))},e.prototype._forEachExtensions=function(e){for(var t=0,i=this._extensions;t<i.length;t++){var r=i[t];r.enabled&&e(r)}},e.prototype._applyExtensions=function(e,t,i){for(var r=0,n=this._extensions;r<n.length;r++){var o=n[r];if(o.enabled){var a="".concat(o.name,".").concat(t),s=e;s._activeLoaderExtensionFunctions=s._activeLoaderExtensionFunctions||{};var l=s._activeLoaderExtensionFunctions;if(!l[a]){l[a]=!0;try{var c=i(o);if(c)return c}finally{delete l[a]}}}}return null},e.prototype._extensionsOnLoading=function(){this._forEachExtensions((function(e){return e.onLoading&&e.onLoading()}))},e.prototype._extensionsOnReady=function(){this._forEachExtensions((function(e){return e.onReady&&e.onReady()}))},e.prototype._extensionsLoadSceneAsync=function(e,t){return this._applyExtensions(t,"loadScene",(function(i){return i.loadSceneAsync&&i.loadSceneAsync(e,t)}))},e.prototype._extensionsLoadNodeAsync=function(e,t,i){return this._applyExtensions(t,"loadNode",(function(r){return r.loadNodeAsync&&r.loadNodeAsync(e,t,i)}))},e.prototype._extensionsLoadCameraAsync=function(e,t,i){return this._applyExtensions(t,"loadCamera",(function(r){return r.loadCameraAsync&&r.loadCameraAsync(e,t,i)}))},e.prototype._extensionsLoadVertexDataAsync=function(e,t,i){return this._applyExtensions(t,"loadVertexData",(function(r){return r._loadVertexDataAsync&&r._loadVertexDataAsync(e,t,i)}))},e.prototype._extensionsLoadMeshPrimitiveAsync=function(e,t,i,r,n,o){return this._applyExtensions(n,"loadMeshPrimitive",(function(a){return a._loadMeshPrimitiveAsync&&a._loadMeshPrimitiveAsync(e,t,i,r,n,o)}))},e.prototype._extensionsLoadMaterialAsync=function(e,t,i,r,n){return this._applyExtensions(t,"loadMaterial",(function(o){return o._loadMaterialAsync&&o._loadMaterialAsync(e,t,i,r,n)}))},e.prototype._extensionsCreateMaterial=function(e,t,i){return this._applyExtensions(t,"createMaterial",(function(r){return r.createMaterial&&r.createMaterial(e,t,i)}))},e.prototype._extensionsLoadMaterialPropertiesAsync=function(e,t,i){return this._applyExtensions(t,"loadMaterialProperties",(function(r){return r.loadMaterialPropertiesAsync&&r.loadMaterialPropertiesAsync(e,t,i)}))},e.prototype._extensionsLoadTextureInfoAsync=function(e,t,i){return this._applyExtensions(t,"loadTextureInfo",(function(r){return r.loadTextureInfoAsync&&r.loadTextureInfoAsync(e,t,i)}))},e.prototype._extensionsLoadTextureAsync=function(e,t,i){return this._applyExtensions(t,"loadTexture",(function(r){return r._loadTextureAsync&&r._loadTextureAsync(e,t,i)}))},e.prototype._extensionsLoadAnimationAsync=function(e,t){return this._applyExtensions(t,"loadAnimation",(function(i){return i.loadAnimationAsync&&i.loadAnimationAsync(e,t)}))},e.prototype._extensionsLoadAnimationChannelAsync=function(e,t,i,r,n){return this._applyExtensions(i,"loadAnimationChannel",(function(o){return o._loadAnimationChannelAsync&&o._loadAnimationChannelAsync(e,t,i,r,n)}))},e.prototype._extensionsLoadSkinAsync=function(e,t,i){return this._applyExtensions(i,"loadSkin",(function(r){return r._loadSkinAsync&&r._loadSkinAsync(e,t,i)}))},e.prototype._extensionsLoadUriAsync=function(e,t,i){return this._applyExtensions(t,"loadUri",(function(r){return r._loadUriAsync&&r._loadUriAsync(e,t,i)}))},e.prototype._extensionsLoadBufferViewAsync=function(e,t){return this._applyExtensions(t,"loadBufferView",(function(i){return i.loadBufferViewAsync&&i.loadBufferViewAsync(e,t)}))},e.prototype._extensionsLoadBufferAsync=function(e,t,i,r){return this._applyExtensions(t,"loadBuffer",(function(n){return n.loadBufferAsync&&n.loadBufferAsync(e,t,i,r)}))},e.LoadExtensionAsync=function(e,t,i,r){if(!t.extensions)return null;var n=t.extensions[i];return n?r("".concat(e,"/extensions/").concat(i),n):null},e.LoadExtraAsync=function(e,t,i,r){if(!t.extras)return null;var n=t.extras[i];return n?r("".concat(e,"/extras/").concat(i),n):null},e.prototype.isExtensionUsed=function(e){return!!this._gltf.extensionsUsed&&-1!==this._gltf.extensionsUsed.indexOf(e)},e.prototype.logOpen=function(e){this._parent._logOpen(e)},e.prototype.logClose=function(){this._parent._logClose()},e.prototype.log=function(e){this._parent._log(e)},e.prototype.startPerformanceCounter=function(e){this._parent._startPerformanceCounter(e)},e.prototype.endPerformanceCounter=function(e){this._parent._endPerformanceCounter(e)},e._RegisteredExtensions={},e.DefaultSampler={index:-1},e}();n.GLTFFileLoader._CreateGLTF2Loader=function(e){return new l(e)}},"../../../dev/loaders/src/glTF/2.0/glTFLoaderAnimation.ts":(e,t,i)=>{i.r(t),i.d(t,{AnimationPropertyInfo:()=>l,TransformNodeAnimationPropertyInfo:()=>c,WeightAnimationPropertyInfo:()=>u,getQuaternion:()=>a,getVector3:()=>o,getWeights:()=>s,nodeAnimationData:()=>h});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Misc/observable");function o(e,t,i,r){return n.Vector3.FromArray(t,i).scaleInPlace(r)}function a(e,t,i,r){return n.Quaternion.FromArray(t,i).scaleInPlace(r)}function s(e,t,i,r){for(var n=new Array(e._numMorphTargets),o=0;o<n.length;o++)n[o]=t[i++]*r;return n}var l=function(){function e(e,t,i,r){this.type=e,this.name=t,this.getValue=i,this.getStride=r}return e.prototype._buildAnimation=function(e,t,i){var r=new n.Animation(e,this.name,t,this.type);return r.setKeys(i),r},e}(),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.__extends)(t,e),t.prototype.buildAnimations=function(e,t,i,r,n){n(e._babylonTransformNode,this._buildAnimation(t,i,r))},t}(l),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.__extends)(t,e),t.prototype.buildAnimations=function(e,t,i,r,o){if(e._numMorphTargets)for(var a=function(a){var l=new n.Animation("".concat(t,"_").concat(a),s.name,i,s.type);if(l.setKeys(r.map((function(e){return{frame:e.frame,inTangent:e.inTangent?e.inTangent[a]:void 0,value:e.value[a],outTangent:e.outTangent?e.outTangent[a]:void 0,interpolation:e.interpolation}}))),e._primitiveBabylonMeshes)for(var c=0,u=e._primitiveBabylonMeshes;c<u.length;c++){var h=u[c];if(h.morphTargetManager){var d=h.morphTargetManager.getTarget(a),_=l.clone();d.animations.push(_),o(d,_)}}},s=this,l=0;l<e._numMorphTargets;l++)a(l)},t}(l),h={translation:[new c(n.Animation.ANIMATIONTYPE_VECTOR3,"position",o,(function(){return 3}))],rotation:[new c(n.Animation.ANIMATIONTYPE_QUATERNION,"rotationQuaternion",a,(function(){return 4}))],scale:[new c(n.Animation.ANIMATIONTYPE_VECTOR3,"scaling",o,(function(){return 3}))],weights:[new u(n.Animation.ANIMATIONTYPE_FLOAT,"influence",s,(function(e){return e._numMorphTargets}))]}},"../../../dev/loaders/src/glTF/2.0/glTFLoaderExtension.ts":(e,t,i)=>{i.r(t)},"../../../dev/loaders/src/glTF/2.0/glTFLoaderInterfaces.ts":(e,t,i)=>{i.r(t)},"../../../dev/loaders/src/glTF/2.0/index.ts":(e,t,i)=>{i.r(t),i.d(t,{ArrayItem:()=>r.ArrayItem,EXT_lights_image_based:()=>n.EXT_lights_image_based,EXT_mesh_gpu_instancing:()=>n.EXT_mesh_gpu_instancing,EXT_meshopt_compression:()=>n.EXT_meshopt_compression,EXT_texture_avif:()=>n.EXT_texture_avif,EXT_texture_webp:()=>n.EXT_texture_webp,ExtrasAsMetadata:()=>n.ExtrasAsMetadata,GLTFLoader:()=>r.GLTFLoader,KHR_animation_pointer:()=>n.KHR_animation_pointer,KHR_draco_mesh_compression:()=>n.KHR_draco_mesh_compression,KHR_interactivity:()=>n.KHR_interactivity,KHR_lights:()=>n.KHR_lights,KHR_materials_anisotropy:()=>n.KHR_materials_anisotropy,KHR_materials_clearcoat:()=>n.KHR_materials_clearcoat,KHR_materials_diffuse_transmission:()=>n.KHR_materials_diffuse_transmission,KHR_materials_dispersion:()=>n.KHR_materials_dispersion,KHR_materials_emissive_strength:()=>n.KHR_materials_emissive_strength,KHR_materials_ior:()=>n.KHR_materials_ior,KHR_materials_iridescence:()=>n.KHR_materials_iridescence,KHR_materials_pbrSpecularGlossiness:()=>n.KHR_materials_pbrSpecularGlossiness,KHR_materials_sheen:()=>n.KHR_materials_sheen,KHR_materials_specular:()=>n.KHR_materials_specular,KHR_materials_transmission:()=>n.KHR_materials_transmission,KHR_materials_unlit:()=>n.KHR_materials_unlit,KHR_materials_variants:()=>n.KHR_materials_variants,KHR_materials_volume:()=>n.KHR_materials_volume,KHR_mesh_quantization:()=>n.KHR_mesh_quantization,KHR_texture_basisu:()=>n.KHR_texture_basisu,KHR_texture_transform:()=>n.KHR_texture_transform,KHR_xmp_json_ld:()=>n.KHR_xmp_json_ld,MSFT_audio_emitter:()=>n.MSFT_audio_emitter,MSFT_lod:()=>n.MSFT_lod,MSFT_minecraftMesh:()=>n.MSFT_minecraftMesh,MSFT_sRGBFactors:()=>n.MSFT_sRGBFactors});var r=i("../../../dev/loaders/src/glTF/2.0/glTFLoader.ts"),n=(i("../../../dev/loaders/src/glTF/2.0/glTFLoaderExtension.ts"),i("../../../dev/loaders/src/glTF/2.0/glTFLoaderInterfaces.ts"),i("../../../dev/loaders/src/glTF/2.0/Extensions/index.ts"))},"../../../dev/loaders/src/glTF/glTFFileLoader.ts":(e,t,i)=>{i.r(t),i.d(t,{GLTFFileLoader:()=>c,GLTFLoaderAnimationStartMode:()=>n,GLTFLoaderCoordinateSystemMode:()=>r,GLTFLoaderState:()=>o});var r,n,o,a=i("babylonjs/Misc/observable"),s=i("../../../dev/loaders/src/glTF/glTFValidation.ts");function l(e,t,i){try{return Promise.resolve(new Uint8Array(e,t,i))}catch(e){return Promise.reject(e)}}!function(e){e[e.AUTO=0]="AUTO",e[e.FORCE_RIGHT_HANDED=1]="FORCE_RIGHT_HANDED"}(r||(r={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.ALL=2]="ALL"}(n||(n={})),function(e){e[e.LOADING=0]="LOADING",e[e.READY=1]="READY",e[e.COMPLETE=2]="COMPLETE"}(o||(o={}));var c=function(){function e(){this.onParsedObservable=new a.Observable,this.coordinateSystemMode=r.AUTO,this.animationStartMode=n.FIRST,this.compileMaterials=!1,this.useClipPlane=!1,this.compileShadowGenerators=!1,this.transparencyAsCoverage=!1,this.useRangeRequests=!1,this.createInstances=!0,this.alwaysComputeBoundingBox=!1,this.loadAllMaterials=!1,this.loadOnlyMaterials=!1,this.skipMaterials=!1,this.useSRGBBuffers=!0,this.targetFps=60,this.alwaysComputeSkeletonRootNode=!1,this.preprocessUrlAsync=function(e){return Promise.resolve(e)},this.onMeshLoadedObservable=new a.Observable,this.onSkinLoadedObservable=new a.Observable,this.onTextureLoadedObservable=new a.Observable,this.onMaterialLoadedObservable=new a.Observable,this.onCameraLoadedObservable=new a.Observable,this.onCompleteObservable=new a.Observable,this.onErrorObservable=new a.Observable,this.onDisposeObservable=new a.Observable,this.onExtensionLoadedObservable=new a.Observable,this.validate=!1,this.onValidatedObservable=new a.Observable,this._loader=null,this._state=null,this._requests=new Array,this.name="gltf",this.extensions={".gltf":{isBinary:!1},".glb":{isBinary:!0}},this.onLoaderStateChangedObservable=new a.Observable,this._logIndentLevel=0,this._loggingEnabled=!1,this._log=this._logDisabled,this._capturePerformanceCounters=!1,this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled}return Object.defineProperty(e.prototype,"onParsed",{set:function(e){this._onParsedObserver&&this.onParsedObservable.remove(this._onParsedObserver),this._onParsedObserver=this.onParsedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMeshLoaded",{set:function(e){this._onMeshLoadedObserver&&this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver),this._onMeshLoadedObserver=this.onMeshLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTextureLoaded",{set:function(e){this._onTextureLoadedObserver&&this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver),this._onTextureLoadedObserver=this.onTextureLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMaterialLoaded",{set:function(e){this._onMaterialLoadedObserver&&this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver),this._onMaterialLoadedObserver=this.onMaterialLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onCameraLoaded",{set:function(e){this._onCameraLoadedObserver&&this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver),this._onCameraLoadedObserver=this.onCameraLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{set:function(e){this._onCompleteObserver&&this.onCompleteObservable.remove(this._onCompleteObserver),this._onCompleteObserver=this.onCompleteObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{set:function(e){this._onErrorObserver&&this.onErrorObservable.remove(this._onErrorObserver),this._onErrorObserver=this.onErrorObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onExtensionLoaded",{set:function(e){this._onExtensionLoadedObserver&&this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver),this._onExtensionLoadedObserver=this.onExtensionLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loggingEnabled",{get:function(){return this._loggingEnabled},set:function(e){this._loggingEnabled!==e&&(this._loggingEnabled=e,this._loggingEnabled?this._log=this._logEnabled:this._log=this._logDisabled)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"capturePerformanceCounters",{get:function(){return this._capturePerformanceCounters},set:function(e){this._capturePerformanceCounters!==e&&(this._capturePerformanceCounters=e,this._capturePerformanceCounters?(this._startPerformanceCounter=this._startPerformanceCounterEnabled,this._endPerformanceCounter=this._endPerformanceCounterEnabled):(this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onValidated",{set:function(e){this._onValidatedObserver&&this.onValidatedObservable.remove(this._onValidatedObserver),this._onValidatedObserver=this.onValidatedObservable.add(e)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._loader&&(this._loader.dispose(),this._loader=null);for(var e=0,t=this._requests;e<t.length;e++)t[e].abort();this._requests.length=0,delete this._progressCallback,this.preprocessUrlAsync=function(e){return Promise.resolve(e)},this.onMeshLoadedObservable.clear(),this.onSkinLoadedObservable.clear(),this.onTextureLoadedObservable.clear(),this.onMaterialLoadedObservable.clear(),this.onCameraLoadedObservable.clear(),this.onCompleteObservable.clear(),this.onExtensionLoadedObservable.clear(),this.onDisposeObservable.notifyObservers(void 0),this.onDisposeObservable.clear()},e.prototype.loadFile=function(e,t,i,r,n,o,s,c){var u=this;if(ArrayBuffer.isView(t))return this._loadBinary(e,t,i,r,s,c),null;this._progressCallback=n;var h=t.name||a.Tools.GetFilename(t);if(o){if(this.useRangeRequests){this.validate&&a.Logger.Warn("glTF validation is not supported when range requests are enabled");var d={abort:function(){},onCompleteObservable:new a.Observable},_={readAsync:function(i,r){return new Promise((function(n,o){u._loadFile(e,t,(function(e){n(new Uint8Array(e))}),!0,(function(e){o(e)}),(function(e){e.setRequestHeader("Range","bytes=".concat(i,"-").concat(i+r-1))}))}))},byteLength:0};return this._unpackBinaryAsync(new a.DataReader(_)).then((function(e){d.onCompleteObservable.notifyObservers(d),r(e)}),s?function(e){return s(void 0,e)}:void 0),d}return this._loadFile(e,t,(function(t){u._validate(e,new Uint8Array(t,0,t.byteLength),i,h),u._unpackBinaryAsync(new a.DataReader({readAsync:function(e,i){return l(t,e,i)},byteLength:t.byteLength})).then((function(e){r(e)}),s?function(e){return s(void 0,e)}:void 0)}),!0,s)}return this._loadFile(e,t,(function(t){try{u._validate(e,t,i,h),r({json:u._parseJson(t)})}catch(e){s&&s()}}),!1,s)},e.prototype._loadBinary=function(e,t,i,r,n,o){this._validate(e,new Uint8Array(t.buffer,t.byteOffset,t.byteLength),i,o),this._unpackBinaryAsync(new a.DataReader({readAsync:function(e,i){return function(e,t,i){try{if(t<0||t>=e.byteLength)throw new RangeError("Offset is out of range.");if(t+i>e.byteLength)throw new RangeError("Length is out of range.");return Promise.resolve(new Uint8Array(e.buffer,e.byteOffset+t,i))}catch(e){return Promise.reject(e)}}(t,e,i)},byteLength:t.byteLength})).then((function(e){r(e)}),n?function(e){return n(void 0,e)}:void 0)},e.prototype.importMeshAsync=function(e,t,i,r,n,o){var a=this;return Promise.resolve().then((function(){return a.onParsedObservable.notifyObservers(i),a.onParsedObservable.clear(),a._log("Loading ".concat(o||"")),a._loader=a._getLoader(i),a._loader.importMeshAsync(e,t,null,i,r,n,o)}))},e.prototype.loadAsync=function(e,t,i,r,n){var o=this;return Promise.resolve().then((function(){return o.onParsedObservable.notifyObservers(t),o.onParsedObservable.clear(),o._log("Loading ".concat(n||"")),o._loader=o._getLoader(t),o._loader.loadAsync(e,t,i,r,n)}))},e.prototype.loadAssetContainerAsync=function(e,t,i,r,n){var o=this;return Promise.resolve().then((function(){o.onParsedObservable.notifyObservers(t),o.onParsedObservable.clear(),o._log("Loading ".concat(n||"")),o._loader=o._getLoader(t);var s=new a.AssetContainer(e),l=[];o.onMaterialLoadedObservable.add((function(e){l.push(e)}));var c=[];o.onTextureLoadedObservable.add((function(e){c.push(e)}));var u=[];o.onCameraLoadedObservable.add((function(e){u.push(e)}));var h=[];return o.onMeshLoadedObservable.add((function(e){e.morphTargetManager&&h.push(e.morphTargetManager)})),o._loader.importMeshAsync(null,e,s,t,i,r,n).then((function(e){return Array.prototype.push.apply(s.geometries,e.geometries),Array.prototype.push.apply(s.meshes,e.meshes),Array.prototype.push.apply(s.particleSystems,e.particleSystems),Array.prototype.push.apply(s.skeletons,e.skeletons),Array.prototype.push.apply(s.animationGroups,e.animationGroups),Array.prototype.push.apply(s.materials,l),Array.prototype.push.apply(s.textures,c),Array.prototype.push.apply(s.lights,e.lights),Array.prototype.push.apply(s.transformNodes,e.transformNodes),Array.prototype.push.apply(s.cameras,u),Array.prototype.push.apply(s.morphTargetManagers,h),s}))}))},e.prototype.canDirectLoad=function(t){return-1!==t.indexOf("asset")&&-1!==t.indexOf("version")||t.startsWith("data:base64,"+e._MagicBase64Encoded)||t.startsWith("data:;base64,"+e._MagicBase64Encoded)||t.startsWith("data:application/octet-stream;base64,"+e._MagicBase64Encoded)||t.startsWith("data:model/gltf-binary;base64,"+e._MagicBase64Encoded)},e.prototype.directLoad=function(t,i){if(i.startsWith("base64,"+e._MagicBase64Encoded)||i.startsWith(";base64,"+e._MagicBase64Encoded)||i.startsWith("application/octet-stream;base64,"+e._MagicBase64Encoded)||i.startsWith("model/gltf-binary;base64,"+e._MagicBase64Encoded)){var r=(0,a.DecodeBase64UrlToBinary)(i);return this._validate(t,new Uint8Array(r,0,r.byteLength)),this._unpackBinaryAsync(new a.DataReader({readAsync:function(e,t){return l(r,e,t)},byteLength:r.byteLength}))}return this._validate(t,i),Promise.resolve({json:this._parseJson(i)})},e.prototype.createPlugin=function(){return new e},Object.defineProperty(e.prototype,"loaderState",{get:function(){return this._state},enumerable:!1,configurable:!0}),e.prototype.whenCompleteAsync=function(){var e=this;return new Promise((function(t,i){e.onCompleteObservable.addOnce((function(){t()})),e.onErrorObservable.addOnce((function(e){i(e)}))}))},e.prototype._setState=function(e){this._state!==e&&(this._state=e,this.onLoaderStateChangedObservable.notifyObservers(this._state),this._log(o[this._state]))},e.prototype._loadFile=function(e,t,i,r,n,o){var a=this,s=e._loadFile(t,i,(function(e){a._onProgress(e,s)}),!0,r,n,o);return s.onCompleteObservable.add((function(){s._lengthComputable=!0,s._total=s._loaded})),this._requests.push(s),s},e.prototype._onProgress=function(e,t){if(this._progressCallback){t._lengthComputable=e.lengthComputable,t._loaded=e.loaded,t._total=e.total;for(var i=!0,r=0,n=0,o=0,a=this._requests;o<a.length;o++){var s=a[o];if(void 0===s._lengthComputable||void 0===s._loaded||void 0===s._total)return;i=i&&s._lengthComputable,r+=s._loaded,n+=s._total}this._progressCallback({lengthComputable:i,loaded:r,total:i?n:0})}},e.prototype._validate=function(e,t,i,r){var n=this;void 0===i&&(i=""),void 0===r&&(r=""),this.validate&&(this._startPerformanceCounter("Validate JSON"),s.GLTFValidation.ValidateAsync(t,i,r,(function(t){return n.preprocessUrlAsync(i+t).then((function(t){return e._loadFileAsync(t,void 0,!0,!0).then((function(e){return new Uint8Array(e,0,e.byteLength)}))}))})).then((function(e){n._endPerformanceCounter("Validate JSON"),n.onValidatedObservable.notifyObservers(e),n.onValidatedObservable.clear()}),(function(e){n._endPerformanceCounter("Validate JSON"),a.Tools.Warn("Failed to validate: ".concat(e.message)),n.onValidatedObservable.clear()})))},e.prototype._getLoader=function(t){var i=t.json.asset||{};this._log("Asset version: ".concat(i.version)),i.minVersion&&this._log("Asset minimum version: ".concat(i.minVersion)),i.generator&&this._log("Asset generator: ".concat(i.generator));var r=e._parseVersion(i.version);if(!r)throw new Error("Invalid version: "+i.version);if(void 0!==i.minVersion){var n=e._parseVersion(i.minVersion);if(!n)throw new Error("Invalid minimum version: "+i.minVersion);if(e._compareVersion(n,{major:2,minor:0})>0)throw new Error("Incompatible minimum version: "+i.minVersion)}var o={1:e._CreateGLTF1Loader,2:e._CreateGLTF2Loader}[r.major];if(!o)throw new Error("Unsupported version: "+i.version);return o(this)},e.prototype._parseJson=function(e){this._startPerformanceCounter("Parse JSON"),this._log("JSON length: ".concat(e.length));var t=JSON.parse(e);return this._endPerformanceCounter("Parse JSON"),t},e.prototype._unpackBinaryAsync=function(e){var t=this;return this._startPerformanceCounter("Unpack Binary"),e.loadAsync(20).then((function(){var i=e.readUint32();if(1179937895!==i)throw new a.RuntimeError("Unexpected magic: "+i,a.ErrorCodes.GLTFLoaderUnexpectedMagicError);var r=e.readUint32();t.loggingEnabled&&t._log("Binary version: ".concat(r));var n,o=e.readUint32();switch(t.useRangeRequests||o===e.buffer.byteLength||a.Logger.Warn("Length in header does not match actual data length: ".concat(o," != ").concat(e.buffer.byteLength)),r){case 1:n=t._unpackBinaryV1Async(e,o);break;case 2:n=t._unpackBinaryV2Async(e,o);break;default:throw new Error("Unsupported version: "+r)}return t._endPerformanceCounter("Unpack Binary"),n}))},e.prototype._unpackBinaryV1Async=function(e,t){var i=e.readUint32(),r=e.readUint32();if(0!==r)throw new Error("Unexpected content format: ".concat(r));var n=t-e.byteOffset,o={json:this._parseJson(e.readString(i)),bin:null};if(0!==n){var a=e.byteOffset;o.bin={readAsync:function(t,i){return e.buffer.readAsync(a+t,i)},byteLength:n}}return Promise.resolve(o)},e.prototype._unpackBinaryV2Async=function(e,t){var i=this,r=1313821514,n=e.readUint32();if(e.readUint32()!==r)throw new Error("First chunk format is not JSON");return e.byteOffset+n===t?e.loadAsync(n).then((function(){return{json:i._parseJson(e.readString(n)),bin:null}})):e.loadAsync(n+8).then((function(){var o={json:i._parseJson(e.readString(n)),bin:null},a=function(){var i=e.readUint32();switch(e.readUint32()){case r:throw new Error("Unexpected JSON chunk");case 5130562:var n=e.byteOffset;o.bin={readAsync:function(t,i){return e.buffer.readAsync(n+t,i)},byteLength:i},e.skipBytes(i);break;default:e.skipBytes(i)}return e.byteOffset!==t?e.loadAsync(8).then(a):Promise.resolve(o)};return a()}))},e._parseVersion=function(e){if("1.0"===e||"1.0.1"===e)return{major:1,minor:0};var t=(e+"").match(/^(\d+)\.(\d+)/);return t?{major:parseInt(t[1]),minor:parseInt(t[2])}:null},e._compareVersion=function(e,t){return e.major>t.major?1:e.major<t.major?-1:e.minor>t.minor?1:e.minor<t.minor?-1:0},e.prototype._logOpen=function(e){this._log(e),this._logIndentLevel++},e.prototype._logClose=function(){--this._logIndentLevel},e.prototype._logEnabled=function(t){var i=e._logSpaces.substr(0,2*this._logIndentLevel);a.Logger.Log("".concat(i).concat(t))},e.prototype._logDisabled=function(e){},e.prototype._startPerformanceCounterEnabled=function(e){a.Tools.StartPerformanceCounter(e)},e.prototype._startPerformanceCounterDisabled=function(e){},e.prototype._endPerformanceCounterEnabled=function(e){a.Tools.EndPerformanceCounter(e)},e.prototype._endPerformanceCounterDisabled=function(e){},e.IncrementalLoading=!0,e.HomogeneousCoordinates=!1,e._MagicBase64Encoded="Z2xURg",e._logSpaces=" ",e}();a.SceneLoader&&a.SceneLoader.RegisterPlugin(new c)},"../../../dev/loaders/src/glTF/glTFValidation.ts":(e,t,i)=>{i.r(t),i.d(t,{GLTFValidation:()=>a});var r=i("babylonjs/Misc/observable");function n(e,t,i,r){var n={externalResourceFunction:r};return i&&(n.uri="file:"===t?i:t+i),ArrayBuffer.isView(e)?GLTFValidator.validateBytes(e,n):GLTFValidator.validateString(e,n)}function o(){var e=[];onmessage=function(t){var i=t.data;switch(i.id){case"init":importScripts(i.url);break;case"validate":n(i.data,i.rootUrl,i.fileName,(function(t){return new Promise((function(i,r){var n=e.length;e.push({resolve:i,reject:r}),postMessage({id:"getExternalResource",index:n,uri:t})}))})).then((function(e){postMessage({id:"validate.resolve",value:e})}),(function(e){postMessage({id:"validate.reject",reason:e})}));break;case"getExternalResource.resolve":e[i.index].resolve(i.value);break;case"getExternalResource.reject":e[i.index].reject(i.reason)}}}var a=function(){function e(){}return e.ValidateAsync=function(e,t,i,a){var s=this;return"function"==typeof Worker?new Promise((function(l,c){var u="".concat(n,"(").concat(o,")()"),h=URL.createObjectURL(new Blob([u],{type:"application/javascript"})),d=new Worker(h),_=function(e){d.removeEventListener("error",_),d.removeEventListener("message",f),c(e)},f=function(e){var t=e.data;switch(t.id){case"getExternalResource":a(t.uri).then((function(e){d.postMessage({id:"getExternalResource.resolve",index:t.index,value:e},[e.buffer])}),(function(e){d.postMessage({id:"getExternalResource.reject",index:t.index,reason:e})}));break;case"validate.resolve":d.removeEventListener("error",_),d.removeEventListener("message",f),l(t.value),d.terminate();break;case"validate.reject":d.removeEventListener("error",_),d.removeEventListener("message",f),c(t.reason),d.terminate()}};if(d.addEventListener("error",_),d.addEventListener("message",f),d.postMessage({id:"init",url:r.Tools.GetBabylonScriptURL(s.Configuration.url)}),ArrayBuffer.isView(e)){var p=e.slice();d.postMessage({id:"validate",data:p,rootUrl:t,fileName:i},[p.buffer])}else d.postMessage({id:"validate",data:e,rootUrl:t,fileName:i})})):(this._LoadScriptPromise||(this._LoadScriptPromise=r.Tools.LoadBabylonScriptAsync(this.Configuration.url)),this._LoadScriptPromise.then((function(){return n(e,t,i,a)})))},e.Configuration={url:"".concat(r.Tools._DefaultCdnUrl,"/gltf_validator.js")},e}()},"../../../dev/loaders/src/glTF/index.ts":(e,t,i)=>{i.r(t),i.d(t,{GLTF1:()=>o,GLTF2:()=>a,GLTFFileLoader:()=>r.GLTFFileLoader,GLTFLoaderAnimationStartMode:()=>r.GLTFLoaderAnimationStartMode,GLTFLoaderCoordinateSystemMode:()=>r.GLTFLoaderCoordinateSystemMode,GLTFLoaderState:()=>r.GLTFLoaderState,GLTFValidation:()=>n.GLTFValidation});var r=i("../../../dev/loaders/src/glTF/glTFFileLoader.ts"),n=i("../../../dev/loaders/src/glTF/glTFValidation.ts"),o=i("../../../dev/loaders/src/glTF/1.0/index.ts"),a=i("../../../dev/loaders/src/glTF/2.0/index.ts")},"../../../dev/loaders/src/index.ts":(e,t,i)=>{i.r(t),i.d(t,{GLTF1:()=>r.GLTF1,GLTF2:()=>r.GLTF2,GLTFFileLoader:()=>r.GLTFFileLoader,GLTFLoaderAnimationStartMode:()=>r.GLTFLoaderAnimationStartMode,GLTFLoaderCoordinateSystemMode:()=>r.GLTFLoaderCoordinateSystemMode,GLTFLoaderState:()=>r.GLTFLoaderState,GLTFValidation:()=>r.GLTFValidation,MTLFileLoader:()=>n.MTLFileLoader,OBJFileLoader:()=>n.OBJFileLoader,SPLATFileLoader:()=>a.SPLATFileLoader,STLFileLoader:()=>o.STLFileLoader,SolidParser:()=>n.SolidParser});var r=i("../../../dev/loaders/src/glTF/index.ts"),n=i("../../../dev/loaders/src/OBJ/index.ts"),o=i("../../../dev/loaders/src/STL/index.ts"),a=i("../../../dev/loaders/src/SPLAT/index.ts")},"../../../lts/loaders/src/legacy/legacy-glTF.ts":(e,t,i)=>{i.r(t),i.d(t,{GLTFFileLoader:()=>r.GLTFFileLoader,GLTFLoaderAnimationStartMode:()=>r.GLTFLoaderAnimationStartMode,GLTFLoaderCoordinateSystemMode:()=>r.GLTFLoaderCoordinateSystemMode,GLTFLoaderState:()=>r.GLTFLoaderState,GLTFValidation:()=>n.GLTFValidation});var r=i("../../../dev/loaders/src/glTF/glTFFileLoader.ts"),n=i("../../../dev/loaders/src/glTF/glTFValidation.ts"),o=void 0!==i.g?i.g:"undefined"!=typeof window?window:void 0;if(void 0!==o){for(var a in o.BABYLON=o.BABYLON||{},r)o.BABYLON[a]=r[a];for(var a in n)o.BABYLON[a]=n[a]}},"../../../lts/loaders/src/legacy/legacy-glTF1.ts":(e,t,i)=>{i.r(t),i.d(t,{GLTF1:()=>r});var r=i("../../../dev/loaders/src/glTF/1.0/index.ts"),n=void 0!==i.g?i.g:"undefined"!=typeof window?window:void 0;if(void 0!==n)for(var o in n.BABYLON=n.BABYLON||{},n.BABYLON.GLTF1=n.BABYLON.GLTF1||{},r)n.BABYLON.GLTF1[o]=r[o]},"../../../lts/loaders/src/legacy/legacy-glTF2.ts":(e,t,i)=>{i.r(t),i.d(t,{GLTF2:()=>o});var r=i("../../../dev/loaders/src/glTF/2.0/Extensions/index.ts"),n=i("../../../dev/loaders/src/glTF/2.0/glTFLoaderInterfaces.ts"),o=i("../../../dev/loaders/src/glTF/2.0/index.ts"),a=void 0!==i.g?i.g:"undefined"!=typeof window?window:void 0;if(void 0!==a){a.BABYLON=a.BABYLON||{};var s=a.BABYLON;s.GLTF2=s.GLTF2||{},s.GLTF2.Loader=s.GLTF2.Loader||{},s.GLTF2.Loader.Extensions=s.GLTF2.Loader.Extensions||{};var l=[];for(var c in r)s.GLTF2.Loader.Extensions[c]=r[c],l.push(c);for(var c in n)s.GLTF2.Loader[c]=n[c],l.push(c);for(var c in o)l.indexOf(c)>-1||(s.GLTF2[c]=o[c])}},"../../../lts/loaders/src/legacy/legacy-objFileLoader.ts":(e,t,i)=>{i.r(t),i.d(t,{MTLFileLoader:()=>r.MTLFileLoader,OBJFileLoader:()=>r.OBJFileLoader,SolidParser:()=>r.SolidParser});var r=i("../../../dev/loaders/src/OBJ/index.ts"),n=void 0!==i.g?i.g:"undefined"!=typeof window?window:void 0;if(void 0!==n)for(var o in r)n.BABYLON[o]||(n.BABYLON[o]=r[o])},"../../../lts/loaders/src/legacy/legacy-stlFileLoader.ts":(e,t,i)=>{i.r(t),i.d(t,{STLFileLoader:()=>r.STLFileLoader});var r=i("../../../dev/loaders/src/STL/index.ts"),n=void 0!==i.g?i.g:"undefined"!=typeof window?window:void 0;if(void 0!==n)for(var o in r)n.BABYLON[o]||(n.BABYLON[o]=r[o])},"../../../lts/loaders/src/legacy/legacy.ts":(e,t,i)=>{i.r(t),i.d(t,{GLTF1:()=>r.GLTF1,GLTF2:()=>r.GLTF2,GLTFFileLoader:()=>r.GLTFFileLoader,GLTFLoaderAnimationStartMode:()=>r.GLTFLoaderAnimationStartMode,GLTFLoaderCoordinateSystemMode:()=>r.GLTFLoaderCoordinateSystemMode,GLTFLoaderState:()=>r.GLTFLoaderState,GLTFValidation:()=>r.GLTFValidation,MTLFileLoader:()=>r.MTLFileLoader,OBJFileLoader:()=>r.OBJFileLoader,SPLATFileLoader:()=>r.SPLATFileLoader,STLFileLoader:()=>r.STLFileLoader,SolidParser:()=>r.SolidParser});var r=i("../../../dev/loaders/src/index.ts");i("../../../lts/loaders/src/legacy/legacy-glTF.ts"),i("../../../lts/loaders/src/legacy/legacy-glTF1.ts"),i("../../../lts/loaders/src/legacy/legacy-glTF2.ts"),i("../../../lts/loaders/src/legacy/legacy-objFileLoader.ts"),i("../../../lts/loaders/src/legacy/legacy-stlFileLoader.ts")},"babylonjs/Misc/observable":t=>{t.exports=e},"../../../../node_modules/tslib/tslib.es6.mjs":(e,t,i)=>{i.r(t),i.d(t,{__addDisposableResource:()=>B,__assign:()=>o,__asyncDelegator:()=>P,__asyncGenerator:()=>S,__asyncValues:()=>E,__await:()=>C,__awaiter:()=>f,__classPrivateFieldGet:()=>A,__classPrivateFieldIn:()=>L,__classPrivateFieldSet:()=>R,__createBinding:()=>m,__decorate:()=>s,__disposeResources:()=>D,__esDecorate:()=>c,__exportStar:()=>g,__extends:()=>n,__generator:()=>p,__importDefault:()=>O,__importStar:()=>M,__makeTemplateObject:()=>w,__metadata:()=>_,__param:()=>l,__propKey:()=>h,__read:()=>b,__rest:()=>a,__runInitializers:()=>u,__setFunctionName:()=>d,__spread:()=>y,__spreadArray:()=>T,__spreadArrays:()=>x,__values:()=>v,default:()=>N});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},r(e,t)};function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var o=function(){return o=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)};function a(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i}function s(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a}function l(e,t){return function(i,r){t(i,r,e)}}function c(e,t,i,r,n,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,_=i.length-1;_>=0;_--){var f={};for(var p in r)f[p]="access"===p?{}:r[p];for(var p in r.access)f.access[p]=r.access[p];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var m=(0,i[_])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=a(m.get))&&(h.get=s),(s=a(m.set))&&(h.set=s),(s=a(m.init))&&n.unshift(s)}else(s=a(m))&&("field"===l?n.unshift(s):h[c]=s)}u&&Object.defineProperty(u,r.name,h),d=!0}function u(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0}function h(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}function _(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,i,r){return new(i||(i=Promise))((function(n,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function p(e,t){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var m=Object.create?function(e,t,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(t,i);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,r,n)}:function(e,t,i,r){void 0===r&&(r=i),e[r]=t[i]};function g(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||m(t,e,i)}function v(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}function x(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var r=Array(e),n=0;for(t=0;t<i;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,n++)r[n]=o[a];return r}function T(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}function C(e){return this instanceof C?(this.v=e,this):new C(e)}function S(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,n=i.apply(e,t||[]),o=[];return r={},a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,c)}})),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){n[e]&&(r[e]=function(t){return new Promise((function(i,r){o.push([e,t,i,r])>1||s(e,t)}))},t&&(r[e]=t(r[e])))}function s(e,t){try{(i=n[e](t)).value instanceof C?Promise.resolve(i.value.v).then(l,c):u(o[0][2],i)}catch(e){u(o[0][3],e)}var i}function l(e){s("next",e)}function c(e){s("throw",e)}function u(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function P(e){var t,i;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,n){t[r]=e[r]?function(t){return(i=!i)?{value:C(e[r](t)),done:!1}:n?n(t):t}:n}}function E(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=v(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(i){t[i]=e[i]&&function(t){return new Promise((function(r,n){!function(e,t,i,r){Promise.resolve(r).then((function(t){e({value:t,done:i})}),t)}(r,n,(t=e[i](t)).done,t.value)}))}}}function w(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var I=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function M(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&m(t,e,i);return I(t,e),t}function O(e){return e&&e.__esModule?e:{default:e}}function A(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}function R(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i}function L(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function B(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r,n;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],i&&(n=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");n&&(r=function(){try{n.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:i})}else i&&e.stack.push({async:!0});return t}var F="function"==typeof SuppressedError?SuppressedError:function(e,t,i){var r=new Error(i);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function D(e){function t(t){e.error=e.hasError?new F(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function i(){for(;e.stack.length;){var r=e.stack.pop();try{var n=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(n).then(i,(function(e){return t(e),i()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}const N={__extends:n,__assign:o,__rest:a,__decorate:s,__param:l,__metadata:_,__awaiter:f,__generator:p,__createBinding:m,__exportStar:g,__values:v,__read:b,__spread:y,__spreadArrays:x,__spreadArray:T,__await:C,__asyncGenerator:S,__asyncDelegator:P,__asyncValues:E,__makeTemplateObject:w,__importStar:M,__importDefault:O,__classPrivateFieldGet:A,__classPrivateFieldSet:R,__classPrivateFieldIn:L,__addDisposableResource:B,__disposeResources:D}}},i={};function r(e){var n=i[e];if(void 0!==n)return n.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{default:()=>a,loaders:()=>o});var o=r("../../../lts/loaders/src/legacy/legacy.ts");const a=o;return n.default})(),e.exports=r(i(9859))},4216:function(e,t,i){var r;"undefined"!=typeof self?self:void 0!==i.g&&i.g,r=e=>(()=>{"use strict";var t={"../../../dev/materials/src/cell/cell.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{cellPixelShader:()=>o});var r="cellPixelShader",n="precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvec3 computeCustomDiffuseLighting(lightingInfo info,vec3 diffuseBase,float shadow)\n{diffuseBase=info.diffuse*shadow;\n#ifdef CELLBASIC\nfloat level=1.0;if (info.ndl<0.5)\nlevel=0.5;diffuseBase.rgb*vec3(level,level,level);\n#else\nfloat ToonThresholds[4];ToonThresholds[0]=0.95;ToonThresholds[1]=0.5;ToonThresholds[2]=0.2;ToonThresholds[3]=0.03;float ToonBrightnessLevels[5];ToonBrightnessLevels[0]=1.0;ToonBrightnessLevels[1]=0.8;ToonBrightnessLevels[2]=0.6;ToonBrightnessLevels[3]=0.35;ToonBrightnessLevels[4]=0.2;if (info.ndl>ToonThresholds[0])\n{diffuseBase.rgb*=ToonBrightnessLevels[0];}\nelse if (info.ndl>ToonThresholds[1])\n{diffuseBase.rgb*=ToonBrightnessLevels[1];}\nelse if (info.ndl>ToonThresholds[2])\n{diffuseBase.rgb*=ToonBrightnessLevels[2];}\nelse if (info.ndl>ToonThresholds[3])\n{diffuseBase.rgb*=ToonBrightnessLevels[3];}\nelse\n{diffuseBase.rgb*=ToonBrightnessLevels[4];}\n#endif\nreturn max(diffuseBase,vec3(0.2));}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nlightingInfo info;vec3 diffuseBase=vec3(0.,0.,0.);float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif \n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/cell/cell.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{cellVertexShader:()=>o});var r="cellVertexShader",n="precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/cell/cellMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{CellMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=(i("../../../dev/materials/src/cell/cell.fragment.ts"),i("../../../dev/materials/src/cell/cell.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.DIFFUSE=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.ALPHATEST=!1,t.POINTSIZE=!1,t.FOG=!1,t.NORMAL=!1,t.UV1=!1,t.UV2=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.INSTANCES=!1,t.INSTANCESCOLOR=!1,t.NDOTL=!0,t.CUSTOMUSERLIGHTING=!0,t.CELLBASIC=!0,t.DEPTHPREPASS=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.LOGARITHMICDEPTH=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.diffuseColor=new n.Color3(1,1,1),r._computeHighLevel=!1,r._disableLighting=!1,r._maxSimultaneousLights=4,r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return this.alpha<1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t,i){var r=t._drawWrapper;if(this.isFrozen&&r.effect&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new o);var a=t.materialDefines,s=this.getScene();if(this._isReadyForSubMesh(t))return!0;var l=s.getEngine();if(a._areTexturesDirty&&(a._needUVs=!1,s.texturesEnabled&&this._diffuseTexture&&n.MaterialFlags.DiffuseTextureEnabled)){if(!this._diffuseTexture.isReady())return!1;a._needUVs=!0,a.DIFFUSE=!0}if(a.CELLBASIC=!this.computeHighLevel,(0,n.PrepareDefinesForMisc)(e,s,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),a),a._needNormals=(0,n.PrepareDefinesForLights)(s,e,a,!1,this._maxSimultaneousLights,this._disableLighting),(0,n.PrepareDefinesForFrameBoundValues)(s,l,this,a,!!i),(0,n.PrepareDefinesForAttributes)(e,a,!0,!0),a.isDirty){a.markAsProcessed(),s.resetCachedMaterial();var c=new n.EffectFallbacks;a.FOG&&c.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(a,c,this.maxSimultaneousLights),a.NUM_BONE_INFLUENCERS>0&&c.addCPUSkinningFallback(0,e),a.IMAGEPROCESSINGPOSTPROCESS=s.imageProcessingConfiguration.applyByPostProcess;var u=[n.VertexBuffer.PositionKind];a.NORMAL&&u.push(n.VertexBuffer.NormalKind),a.UV1&&u.push(n.VertexBuffer.UVKind),a.UV2&&u.push(n.VertexBuffer.UV2Kind),a.VERTEXCOLOR&&u.push(n.VertexBuffer.ColorKind),(0,n.PrepareAttributesForBones)(u,e,a,c),(0,n.PrepareAttributesForInstances)(u,a);var h=a.toString(),d=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vFogInfos","vFogColor","pointSize","vDiffuseInfos","mBones","diffuseMatrix","logarithmicDepthConstant"],_=["diffuseSampler"],f=[];(0,n.addClipPlaneUniforms)(d),(0,n.PrepareUniformsAndSamplersList)({uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:a,maxSimultaneousLights:this.maxSimultaneousLights}),t.setEffect(s.getEngine().createEffect("cell",{attributes:u,uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:h,fallbacks:c,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this.maxSimultaneousLights-1}},l),a,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(a._renderId=s.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;a&&(this._activeEffect=a,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),(0,n.BindBonesParameters)(t,this._activeEffect),this._mustRebind(r,a,i)&&(this._diffuseTexture&&n.MaterialFlags.DiffuseTextureEnabled&&(this._activeEffect.setTexture("diffuseSampler",this._diffuseTexture),this._activeEffect.setFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),this._activeEffect.setMatrix("diffuseMatrix",this._diffuseTexture.getTextureMatrix())),(0,n.bindClipPlane)(this._activeEffect,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,n.BindLogDepth)(o,a,r),r.bindEyePosition(a)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*t.visibility),r.lightsEnabled&&!this.disableLighting&&(0,n.BindLights)(r,t,this._activeEffect,o,this._maxSimultaneousLights),r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),(0,n.BindFogParameters)(r,t,this._activeEffect),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){var e=[];return this._diffuseTexture&&this._diffuseTexture.animations&&this._diffuseTexture.animations.length>0&&e.push(this._diffuseTexture),e},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._diffuseTexture&&t.push(this._diffuseTexture),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this._diffuseTexture===t},t.prototype.dispose=function(t){this._diffuseTexture&&this._diffuseTexture.dispose(),e.prototype.dispose.call(this,t)},t.prototype.getClassName=function(){return"CellMaterial"},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.CellMaterial",t},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture")],t.prototype,"_diffuseTexture",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)("diffuse")],t.prototype,"diffuseColor",void 0),(0,r.__decorate)([(0,n.serialize)("computeHighLevel")],t.prototype,"_computeHighLevel",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"computeHighLevel",void 0),(0,r.__decorate)([(0,n.serialize)("disableLighting")],t.prototype,"_disableLighting",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),(0,r.__decorate)([(0,n.serialize)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.CellMaterial",a)},"../../../dev/materials/src/cell/index.ts":(e,t,i)=>{i.r(t),i.d(t,{CellMaterial:()=>r.CellMaterial});var r=i("../../../dev/materials/src/cell/cellMaterial.ts")},"../../../dev/materials/src/custom/customMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{CustomMaterial:()=>s,CustomShaderStructure:()=>o,ShaderSpecialParts:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=function(){},a=function(){},s=function(e){function t(i,r){var o=e.call(this,i,r)||this;return o.CustomParts=new a,o.customShaderNameResolve=o.Builder,o.FragmentShader=n.Effect.ShadersStore.defaultPixelShader,o.VertexShader=n.Effect.ShadersStore.defaultVertexShader,t.ShaderIndexer++,o._createdShaderName="custom_"+t.ShaderIndexer,o}return(0,r.__extends)(t,e),t.prototype.AttachAfterBind=function(e,t){if(this._newUniformInstances)for(var i in this._newUniformInstances)"vec2"==(r=i.toString().split("-"))[0]?t.setVector2(r[1],this._newUniformInstances[i]):"vec3"==r[0]?this._newUniformInstances[i]instanceof n.Color3?t.setColor3(r[1],this._newUniformInstances[i]):t.setVector3(r[1],this._newUniformInstances[i]):"vec4"==r[0]?(this._newUniformInstances[i]instanceof n.Color4?t.setDirectColor4(r[1],this._newUniformInstances[i]):t.setVector4(r[1],this._newUniformInstances[i]),t.setVector4(r[1],this._newUniformInstances[i])):"mat4"==r[0]?t.setMatrix(r[1],this._newUniformInstances[i]):"float"==r[0]&&t.setFloat(r[1],this._newUniformInstances[i]);if(this._newSamplerInstances)for(var i in this._newSamplerInstances){var r;"sampler2D"==(r=i.toString().split("-"))[0]&&this._newSamplerInstances[i].isReady&&this._newSamplerInstances[i].isReady()&&t.setTexture(r[1],this._newSamplerInstances[i])}},t.prototype.ReviewUniform=function(e,t){if("uniform"==e&&this._newUniforms)for(var i=0;i<this._newUniforms.length;i++)-1==this._customUniform[i].indexOf("sampler")&&t.push(this._newUniforms[i].replace(/\[\d*\]/g,""));if("sampler"==e&&this._newUniforms)for(i=0;i<this._newUniforms.length;i++)-1!=this._customUniform[i].indexOf("sampler")&&t.push(this._newUniforms[i].replace(/\[\d*\]/g,""));return t},t.prototype.Builder=function(e,t,i,r,o,a){a&&this._customAttributes&&this._customAttributes.length>0&&a.push.apply(a,this._customAttributes),this.ReviewUniform("uniform",t),this.ReviewUniform("sampler",r);var s=this._createdShaderName;return n.Effect.ShadersStore[s+"VertexShader"]&&n.Effect.ShadersStore[s+"PixelShader"]||(n.Effect.ShadersStore[s+"VertexShader"]=this._injectCustomCode(this.VertexShader,"vertex"),n.Effect.ShadersStore[s+"PixelShader"]=this._injectCustomCode(this.FragmentShader,"fragment")),s},t.prototype._injectCustomCode=function(e,t){var i=this._getCustomCode(t);for(var r in i){var n=i[r];if(n&&n.length>0){var o="#define "+r;e=e.replace(o,"\n"+n+"\n"+o)}}return e},t.prototype._getCustomCode=function(e){var t,i;return"vertex"===e?{CUSTOM_VERTEX_BEGIN:this.CustomParts.Vertex_Begin,CUSTOM_VERTEX_DEFINITIONS:((null===(t=this._customUniform)||void 0===t?void 0:t.join("\n"))||"")+(this.CustomParts.Vertex_Definitions||""),CUSTOM_VERTEX_MAIN_BEGIN:this.CustomParts.Vertex_MainBegin,CUSTOM_VERTEX_UPDATE_POSITION:this.CustomParts.Vertex_Before_PositionUpdated,CUSTOM_VERTEX_UPDATE_NORMAL:this.CustomParts.Vertex_Before_NormalUpdated,CUSTOM_VERTEX_MAIN_END:this.CustomParts.Vertex_MainEnd,CUSTOM_VERTEX_UPDATE_WORLDPOS:this.CustomParts.Vertex_After_WorldPosComputed}:{CUSTOM_FRAGMENT_BEGIN:this.CustomParts.Fragment_Begin,CUSTOM_FRAGMENT_DEFINITIONS:((null===(i=this._customUniform)||void 0===i?void 0:i.join("\n"))||"")+(this.CustomParts.Fragment_Definitions||""),CUSTOM_FRAGMENT_MAIN_BEGIN:this.CustomParts.Fragment_MainBegin,CUSTOM_FRAGMENT_UPDATE_DIFFUSE:this.CustomParts.Fragment_Custom_Diffuse,CUSTOM_FRAGMENT_UPDATE_ALPHA:this.CustomParts.Fragment_Custom_Alpha,CUSTOM_FRAGMENT_BEFORE_LIGHTS:this.CustomParts.Fragment_Before_Lights,CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR:this.CustomParts.Fragment_Before_FragColor,CUSTOM_FRAGMENT_MAIN_END:this.CustomParts.Fragment_MainEnd,CUSTOM_FRAGMENT_BEFORE_FOG:this.CustomParts.Fragment_Before_Fog}},t.prototype._afterBind=function(t,i,r){if(void 0===i&&(i=null),i){this.AttachAfterBind(t,i);try{e.prototype._afterBind.call(this,t,i,r)}catch(e){}}},t.prototype.AddUniform=function(e,t,i){return this._customUniform||(this._customUniform=new Array,this._newUniforms=new Array,this._newSamplerInstances={},this._newUniformInstances={}),i&&(-1!=t.indexOf("sampler")?this._newSamplerInstances[t+"-"+e]=i:this._newUniformInstances[t+"-"+e]=i),this._customUniform.push("uniform "+t+" "+e+";"),this._newUniforms.push(e),this},t.prototype.AddAttribute=function(e){return this._customAttributes||(this._customAttributes=[]),this._customAttributes.push(e),this},t.prototype.Fragment_Begin=function(e){return this.CustomParts.Fragment_Begin=e,this},t.prototype.Fragment_Definitions=function(e){return this.CustomParts.Fragment_Definitions=e,this},t.prototype.Fragment_MainBegin=function(e){return this.CustomParts.Fragment_MainBegin=e,this},t.prototype.Fragment_MainEnd=function(e){return this.CustomParts.Fragment_MainEnd=e,this},t.prototype.Fragment_Custom_Diffuse=function(e){return this.CustomParts.Fragment_Custom_Diffuse=e.replace("result","diffuseColor"),this},t.prototype.Fragment_Custom_Alpha=function(e){return this.CustomParts.Fragment_Custom_Alpha=e.replace("result","alpha"),this},t.prototype.Fragment_Before_Lights=function(e){return this.CustomParts.Fragment_Before_Lights=e,this},t.prototype.Fragment_Before_Fog=function(e){return this.CustomParts.Fragment_Before_Fog=e,this},t.prototype.Fragment_Before_FragColor=function(e){return this.CustomParts.Fragment_Before_FragColor=e.replace("result","color"),this},t.prototype.Vertex_Begin=function(e){return this.CustomParts.Vertex_Begin=e,this},t.prototype.Vertex_Definitions=function(e){return this.CustomParts.Vertex_Definitions=e,this},t.prototype.Vertex_MainBegin=function(e){return this.CustomParts.Vertex_MainBegin=e,this},t.prototype.Vertex_Before_PositionUpdated=function(e){return this.CustomParts.Vertex_Before_PositionUpdated=e.replace("result","positionUpdated"),this},t.prototype.Vertex_Before_NormalUpdated=function(e){return this.CustomParts.Vertex_Before_NormalUpdated=e.replace("result","normalUpdated"),this},t.prototype.Vertex_After_WorldPosComputed=function(e){return this.CustomParts.Vertex_After_WorldPosComputed=e,this},t.prototype.Vertex_MainEnd=function(e){return this.CustomParts.Vertex_MainEnd=e,this},t.ShaderIndexer=1,t}(n.StandardMaterial);(0,n.RegisterClass)("BABYLON.CustomMaterial",s)},"../../../dev/materials/src/custom/index.ts":(e,t,i)=>{i.r(t),i.d(t,{CustomMaterial:()=>r.CustomMaterial,CustomShaderStructure:()=>r.CustomShaderStructure,PBRCustomMaterial:()=>n.PBRCustomMaterial,ShaderAlbedoParts:()=>n.ShaderAlbedoParts,ShaderAlebdoParts:()=>n.ShaderAlebdoParts,ShaderSpecialParts:()=>r.ShaderSpecialParts});var r=i("../../../dev/materials/src/custom/customMaterial.ts"),n=i("../../../dev/materials/src/custom/pbrCustomMaterial.ts")},"../../../dev/materials/src/custom/pbrCustomMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{PBRCustomMaterial:()=>s,ShaderAlbedoParts:()=>o,ShaderAlebdoParts:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=function(){},a=o,s=function(e){function t(i,r){var a=e.call(this,i,r)||this;return a.CustomParts=new o,a.customShaderNameResolve=a.Builder,a.FragmentShader=n.Effect.ShadersStore.pbrPixelShader,a.VertexShader=n.Effect.ShadersStore.pbrVertexShader,a.FragmentShader=a.FragmentShader.replace(/#include<pbrBlockAlbedoOpacity>/g,n.Effect.IncludesShadersStore.pbrBlockAlbedoOpacity),a.FragmentShader=a.FragmentShader.replace(/#include<pbrBlockReflectivity>/g,n.Effect.IncludesShadersStore.pbrBlockReflectivity),a.FragmentShader=a.FragmentShader.replace(/#include<pbrBlockFinalColorComposition>/g,n.Effect.IncludesShadersStore.pbrBlockFinalColorComposition),t.ShaderIndexer++,a._createdShaderName="custompbr_"+t.ShaderIndexer,a}return(0,r.__extends)(t,e),t.prototype.AttachAfterBind=function(e,t){if(this._newUniformInstances)for(var i in this._newUniformInstances)"vec2"==(r=i.toString().split("-"))[0]?t.setVector2(r[1],this._newUniformInstances[i]):"vec3"==r[0]?this._newUniformInstances[i]instanceof n.Color3?t.setColor3(r[1],this._newUniformInstances[i]):t.setVector3(r[1],this._newUniformInstances[i]):"vec4"==r[0]?(this._newUniformInstances[i]instanceof n.Color4?t.setDirectColor4(r[1],this._newUniformInstances[i]):t.setVector4(r[1],this._newUniformInstances[i]),t.setVector4(r[1],this._newUniformInstances[i])):"mat4"==r[0]?t.setMatrix(r[1],this._newUniformInstances[i]):"float"==r[0]&&t.setFloat(r[1],this._newUniformInstances[i]);if(this._newSamplerInstances)for(var i in this._newSamplerInstances){var r;"sampler2D"==(r=i.toString().split("-"))[0]&&this._newSamplerInstances[i].isReady&&this._newSamplerInstances[i].isReady()&&t.setTexture(r[1],this._newSamplerInstances[i])}},t.prototype.ReviewUniform=function(e,t){if("uniform"==e&&this._newUniforms)for(var i=0;i<this._newUniforms.length;i++)-1==this._customUniform[i].indexOf("sampler")&&t.push(this._newUniforms[i].replace(/\[\d*\]/g,""));if("sampler"==e&&this._newUniforms)for(i=0;i<this._newUniforms.length;i++)-1!=this._customUniform[i].indexOf("sampler")&&t.push(this._newUniforms[i].replace(/\[\d*\]/g,""));return t},t.prototype.Builder=function(e,t,i,r,o,a,s){if(s){var l=s.processFinalCode;s.processFinalCode=function(e,t){if("vertex"===e)return l?l(e,t):t;var i=new n.ShaderCodeInliner(t);return i.inlineToken="#define pbr_inline",i.processCode(),l?l(e,i.code):i.code}}a&&this._customAttributes&&this._customAttributes.length>0&&a.push.apply(a,this._customAttributes),this.ReviewUniform("uniform",t),this.ReviewUniform("sampler",r);var c=this._createdShaderName;return n.Effect.ShadersStore[c+"VertexShader"]&&n.Effect.ShadersStore[c+"PixelShader"]||(n.Effect.ShadersStore[c+"VertexShader"]=this._injectCustomCode(this.VertexShader,"vertex"),n.Effect.ShadersStore[c+"PixelShader"]=this._injectCustomCode(this.FragmentShader,"fragment")),c},t.prototype._injectCustomCode=function(e,t){var i=this._getCustomCode(t);for(var r in i){var n=i[r];if(n&&n.length>0){var o="#define "+r;e=e.replace(o,"\n"+n+"\n"+o)}}return e},t.prototype._getCustomCode=function(e){var t,i;return"vertex"===e?{CUSTOM_VERTEX_BEGIN:this.CustomParts.Vertex_Begin,CUSTOM_VERTEX_DEFINITIONS:((null===(t=this._customUniform)||void 0===t?void 0:t.join("\n"))||"")+(this.CustomParts.Vertex_Definitions||""),CUSTOM_VERTEX_MAIN_BEGIN:this.CustomParts.Vertex_MainBegin,CUSTOM_VERTEX_UPDATE_POSITION:this.CustomParts.Vertex_Before_PositionUpdated,CUSTOM_VERTEX_UPDATE_NORMAL:this.CustomParts.Vertex_Before_NormalUpdated,CUSTOM_VERTEX_MAIN_END:this.CustomParts.Vertex_MainEnd,CUSTOM_VERTEX_UPDATE_WORLDPOS:this.CustomParts.Vertex_After_WorldPosComputed}:{CUSTOM_FRAGMENT_BEGIN:this.CustomParts.Fragment_Begin,CUSTOM_FRAGMENT_MAIN_BEGIN:this.CustomParts.Fragment_MainBegin,CUSTOM_FRAGMENT_DEFINITIONS:((null===(i=this._customUniform)||void 0===i?void 0:i.join("\n"))||"")+(this.CustomParts.Fragment_Definitions||""),CUSTOM_FRAGMENT_UPDATE_ALBEDO:this.CustomParts.Fragment_Custom_Albedo,CUSTOM_FRAGMENT_UPDATE_ALPHA:this.CustomParts.Fragment_Custom_Alpha,CUSTOM_FRAGMENT_BEFORE_LIGHTS:this.CustomParts.Fragment_Before_Lights,CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS:this.CustomParts.Fragment_Custom_MetallicRoughness,CUSTOM_FRAGMENT_UPDATE_MICROSURFACE:this.CustomParts.Fragment_Custom_MicroSurface,CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION:this.CustomParts.Fragment_Before_FinalColorComposition,CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR:this.CustomParts.Fragment_Before_FragColor,CUSTOM_FRAGMENT_MAIN_END:this.CustomParts.Fragment_MainEnd,CUSTOM_FRAGMENT_BEFORE_FOG:this.CustomParts.Fragment_Before_Fog}},t.prototype._afterBind=function(t,i,r){if(void 0===i&&(i=null),i){this.AttachAfterBind(t,i);try{e.prototype._afterBind.call(this,t,i,r)}catch(e){}}},t.prototype.AddUniform=function(e,t,i){return this._customUniform||(this._customUniform=new Array,this._newUniforms=new Array,this._newSamplerInstances={},this._newUniformInstances={}),i&&(-1!=t.indexOf("sampler")?this._newSamplerInstances[t+"-"+e]=i:this._newUniformInstances[t+"-"+e]=i),this._customUniform.push("uniform "+t+" "+e+";"),this._newUniforms.push(e),this},t.prototype.AddAttribute=function(e){return this._customAttributes||(this._customAttributes=[]),this._customAttributes.push(e),this},t.prototype.Fragment_Begin=function(e){return this.CustomParts.Fragment_Begin=e,this},t.prototype.Fragment_Definitions=function(e){return this.CustomParts.Fragment_Definitions=e,this},t.prototype.Fragment_MainBegin=function(e){return this.CustomParts.Fragment_MainBegin=e,this},t.prototype.Fragment_Custom_Albedo=function(e){return this.CustomParts.Fragment_Custom_Albedo=e.replace("result","surfaceAlbedo"),this},t.prototype.Fragment_Custom_Alpha=function(e){return this.CustomParts.Fragment_Custom_Alpha=e.replace("result","alpha"),this},t.prototype.Fragment_Before_Lights=function(e){return this.CustomParts.Fragment_Before_Lights=e,this},t.prototype.Fragment_Custom_MetallicRoughness=function(e){return this.CustomParts.Fragment_Custom_MetallicRoughness=e,this},t.prototype.Fragment_Custom_MicroSurface=function(e){return this.CustomParts.Fragment_Custom_MicroSurface=e,this},t.prototype.Fragment_Before_Fog=function(e){return this.CustomParts.Fragment_Before_Fog=e,this},t.prototype.Fragment_Before_FinalColorComposition=function(e){return this.CustomParts.Fragment_Before_FinalColorComposition=e,this},t.prototype.Fragment_Before_FragColor=function(e){return this.CustomParts.Fragment_Before_FragColor=e.replace("result","color"),this},t.prototype.Fragment_MainEnd=function(e){return this.CustomParts.Fragment_MainEnd=e,this},t.prototype.Vertex_Begin=function(e){return this.CustomParts.Vertex_Begin=e,this},t.prototype.Vertex_Definitions=function(e){return this.CustomParts.Vertex_Definitions=e,this},t.prototype.Vertex_MainBegin=function(e){return this.CustomParts.Vertex_MainBegin=e,this},t.prototype.Vertex_Before_PositionUpdated=function(e){return this.CustomParts.Vertex_Before_PositionUpdated=e.replace("result","positionUpdated"),this},t.prototype.Vertex_Before_NormalUpdated=function(e){return this.CustomParts.Vertex_Before_NormalUpdated=e.replace("result","normalUpdated"),this},t.prototype.Vertex_After_WorldPosComputed=function(e){return this.CustomParts.Vertex_After_WorldPosComputed=e,this},t.prototype.Vertex_MainEnd=function(e){return this.CustomParts.Vertex_MainEnd=e,this},t.ShaderIndexer=1,t}(n.PBRMaterial);(0,n.RegisterClass)("BABYLON.PBRCustomMaterial",s)},"../../../dev/materials/src/fire/fire.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{firePixelShader:()=>o});var r="firePixelShader",n="precision highp float;uniform vec4 vEyePosition;varying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\nuniform sampler2D distortionSampler;uniform sampler2D opacitySampler;\n#ifdef DIFFUSE\nvarying vec2 vDistortionCoords1;varying vec2 vDistortionCoords2;varying vec2 vDistortionCoords3;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvec4 bx2(vec4 x)\n{return vec4(2.0)*x-vec4(1.0);}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);float alpha=1.0;\n#ifdef DIFFUSE\nconst float distortionAmount0 =0.092;const float distortionAmount1 =0.092;const float distortionAmount2 =0.092;vec2 heightAttenuation=vec2(0.3,0.39);vec4 noise0=texture2D(distortionSampler,vDistortionCoords1);vec4 noise1=texture2D(distortionSampler,vDistortionCoords2);vec4 noise2=texture2D(distortionSampler,vDistortionCoords3);vec4 noiseSum=bx2(noise0)*distortionAmount0+bx2(noise1)*distortionAmount1+bx2(noise2)*distortionAmount2;vec4 perturbedBaseCoords=vec4(vDiffuseUV,0.0,1.0)+noiseSum*(vDiffuseUV.y*heightAttenuation.x+heightAttenuation.y);vec4 opacityColor=texture2D(opacitySampler,perturbedBaseCoords.xy);\n#ifdef ALPHATEST\nif (opacityColor.r<0.1)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor=texture2D(diffuseSampler,perturbedBaseCoords.xy)*2.0;baseColor*=opacityColor;baseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(1.0,1.0,1.0);\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec4 color=vec4(baseColor.rgb,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/fire/fire.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{fireVertexShader:()=>o});var r="fireVertexShader",n="precision highp float;attribute vec3 position;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\nuniform float time;uniform float speed;\n#ifdef DIFFUSE\nvarying vec2 vDistortionCoords1;varying vec2 vDistortionCoords2;varying vec2 vDistortionCoords3;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef DIFFUSE\nvDiffuseUV=uv;vDiffuseUV.y-=0.2;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#ifdef DIFFUSE\nvec3 layerSpeed=vec3(-0.2,-0.52,-0.1)*speed;vDistortionCoords1.x=uv.x;vDistortionCoords1.y=uv.y+layerSpeed.x*time/1000.0;vDistortionCoords2.x=uv.x;vDistortionCoords2.y=uv.y+layerSpeed.y*time/1000.0;vDistortionCoords3.x=uv.x;vDistortionCoords3.y=uv.y+layerSpeed.z*time/1000.0;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/fire/fireMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{FireMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=(i("../../../dev/materials/src/fire/fire.fragment.ts"),i("../../../dev/materials/src/fire/fire.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.DIFFUSE=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.POINTSIZE=!1,t.FOG=!1,t.UV1=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.BonesPerMesh=0,t.NUM_BONE_INFLUENCERS=0,t.INSTANCES=!1,t.INSTANCESCOLOR=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.LOGARITHMICDEPTH=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.diffuseColor=new n.Color3(1,1,1),r.speed=1,r._scaledDiffuse=new n.Color3,r._lastTime=0,r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return!1},t.prototype.needAlphaTesting=function(){return!0},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t,i){var r=t._drawWrapper;if(this.isFrozen&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new o);var a=t.materialDefines,s=this.getScene();if(this._isReadyForSubMesh(t))return!0;var l=s.getEngine();if(a._areTexturesDirty&&(a._needUVs=!1,this._diffuseTexture&&n.MaterialFlags.DiffuseTextureEnabled)){if(!this._diffuseTexture.isReady())return!1;a._needUVs=!0,a.DIFFUSE=!0}if(a.ALPHATEST=!!this._opacityTexture,a._areMiscDirty&&(a.POINTSIZE=this.pointsCloud||s.forcePointsCloud,a.FOG=s.fogEnabled&&e.applyFog&&s.fogMode!==n.Scene.FOGMODE_NONE&&this.fogEnabled,a.LOGARITHMICDEPTH=this._useLogarithmicDepth),(0,n.PrepareDefinesForFrameBoundValues)(s,l,this,a,!!i),(0,n.PrepareDefinesForAttributes)(e,a,!1,!0),a.isDirty){a.markAsProcessed(),s.resetCachedMaterial();var c=new n.EffectFallbacks;a.FOG&&c.addFallback(1,"FOG"),a.NUM_BONE_INFLUENCERS>0&&c.addCPUSkinningFallback(0,e),a.IMAGEPROCESSINGPOSTPROCESS=s.imageProcessingConfiguration.applyByPostProcess;var u=[n.VertexBuffer.PositionKind];a.UV1&&u.push(n.VertexBuffer.UVKind),a.VERTEXCOLOR&&u.push(n.VertexBuffer.ColorKind),(0,n.PrepareAttributesForBones)(u,e,a,c),(0,n.PrepareAttributesForInstances)(u,a);var h=["world","view","viewProjection","vEyePosition","vFogInfos","vFogColor","pointSize","vDiffuseInfos","mBones","diffuseMatrix","logarithmicDepthConstant","time","speed"];(0,n.addClipPlaneUniforms)(h);var d=a.toString();t.setEffect(s.getEngine().createEffect("fire",{attributes:u,uniformsNames:h,uniformBuffersNames:[],samplers:["diffuseSampler","distortionSampler","opacitySampler"],defines:d,fallbacks:c,onCompiled:this.onCompiled,onError:this.onError,indexParameters:null,maxSimultaneousLights:4,transformFeedbackVaryings:null},l),a,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(a._renderId=s.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;a&&(this._activeEffect=a,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),(0,n.BindBonesParameters)(t,this._activeEffect),this._mustRebind(r,a,i)&&(this._diffuseTexture&&n.MaterialFlags.DiffuseTextureEnabled&&(this._activeEffect.setTexture("diffuseSampler",this._diffuseTexture),this._activeEffect.setFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),this._activeEffect.setMatrix("diffuseMatrix",this._diffuseTexture.getTextureMatrix()),this._activeEffect.setTexture("distortionSampler",this._distortionTexture),this._activeEffect.setTexture("opacitySampler",this._opacityTexture)),(0,n.bindClipPlane)(this._activeEffect,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,n.BindLogDepth)(o,a,r),r.bindEyePosition(a)),this._activeEffect.setColor4("vDiffuseColor",this._scaledDiffuse,this.alpha*t.visibility),r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),(0,n.BindFogParameters)(r,t,this._activeEffect),this._lastTime+=r.getEngine().getDeltaTime(),this._activeEffect.setFloat("time",this._lastTime),this._activeEffect.setFloat("speed",this.speed),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){var e=[];return this._diffuseTexture&&this._diffuseTexture.animations&&this._diffuseTexture.animations.length>0&&e.push(this._diffuseTexture),this._distortionTexture&&this._distortionTexture.animations&&this._distortionTexture.animations.length>0&&e.push(this._distortionTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),e},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._diffuseTexture&&t.push(this._diffuseTexture),this._distortionTexture&&t.push(this._distortionTexture),this._opacityTexture&&t.push(this._opacityTexture),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this._diffuseTexture===t||this._distortionTexture===t||this._opacityTexture===t},t.prototype.getClassName=function(){return"FireMaterial"},t.prototype.dispose=function(t){this._diffuseTexture&&this._diffuseTexture.dispose(),this._distortionTexture&&this._distortionTexture.dispose(),e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.FireMaterial",t.diffuseColor=this.diffuseColor.asArray(),t.speed=this.speed,this._diffuseTexture&&(t._diffuseTexture=this._diffuseTexture.serialize()),this._distortionTexture&&(t._distortionTexture=this._distortionTexture.serialize()),this._opacityTexture&&(t._opacityTexture=this._opacityTexture.serialize()),t},t.Parse=function(e,i,r){var o=new t(e.name,i);return o.diffuseColor=n.Color3.FromArray(e.diffuseColor),o.speed=e.speed,o.alpha=e.alpha,o.id=e.id,n.Tags.AddTagsTo(o,e.tags),o.backFaceCulling=e.backFaceCulling,o.wireframe=e.wireframe,e._diffuseTexture&&(o._diffuseTexture=n.Texture.Parse(e._diffuseTexture,i,r)),e._distortionTexture&&(o._distortionTexture=n.Texture.Parse(e._distortionTexture,i,r)),e._opacityTexture&&(o._opacityTexture=n.Texture.Parse(e._opacityTexture,i,r)),o},(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture")],t.prototype,"_diffuseTexture",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("distortionTexture")],t.prototype,"_distortionTexture",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"distortionTexture",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("opacityTexture")],t.prototype,"_opacityTexture",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"opacityTexture",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)("diffuse")],t.prototype,"diffuseColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"speed",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.FireMaterial",a)},"../../../dev/materials/src/fire/index.ts":(e,t,i)=>{i.r(t),i.d(t,{FireMaterial:()=>r.FireMaterial});var r=i("../../../dev/materials/src/fire/fireMaterial.ts")},"../../../dev/materials/src/fur/fur.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{furPixelShader:()=>o});var r="furPixelShader",n="precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;uniform vec4 furColor;uniform float furLength;varying vec3 vPositionW;varying float vfur_length;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef HIGHLEVEL\nuniform float furOffset;uniform float furOcclusion;uniform sampler2D furTexture;varying vec2 vFurUV;\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<fogFragmentDeclaration>\n#include<clipPlaneFragmentDeclaration>\nfloat Rand(vec3 rv) {float x=dot(rv,vec3(12.9898,78.233,24.65487));return fract(sin(x)*43758.5453);}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=furColor;vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor*=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef HIGHLEVEL\nvec4 furTextureColor=texture2D(furTexture,vec2(vFurUV.x,vFurUV.y));if (furTextureColor.a<=0.0 || furTextureColor.g<furOffset) {discard;}\nfloat occlusion=mix(0.0,furTextureColor.b*1.2,furOffset);baseColor=vec4(baseColor.xyz*max(occlusion,furOcclusion),1.1-furOffset);\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase.rgb*baseColor.rgb,0.0,1.0);\n#ifdef HIGHLEVEL\nvec4 color=vec4(finalDiffuse,alpha);\n#else\nfloat r=vfur_length/furLength*0.5;vec4 color=vec4(finalDiffuse*(0.5+r),alpha);\n#endif\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/fur/fur.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{furVertexShader:()=>o});var r="furVertexShader",n="precision highp float;attribute vec3 position;attribute vec3 normal;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\nuniform float furLength;uniform float furAngle;\n#ifdef HIGHLEVEL\nuniform float furOffset;uniform vec3 furGravity;uniform float furTime;uniform float furSpacing;uniform float furDensity;\n#endif\n#ifdef HEIGHTMAP\nuniform sampler2D heightTexture;\n#endif\n#ifdef HIGHLEVEL\nvarying vec2 vFurUV;\n#endif\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\nvarying float vfur_length;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nfloat Rand(vec3 rv) {float x=dot(rv,vec3(12.9898,78.233,24.65487));return fract(sin(x)*43758.5453);}\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nfloat r=Rand(position);\n#ifdef HEIGHTMAP\n#if __VERSION__>100\nvfur_length=furLength*texture(heightTexture,uv).x;\n#else\nvfur_length=furLength*texture2D(heightTexture,uv).r;\n#endif\n#else \nvfur_length=(furLength*r);\n#endif\nvec3 tangent1=vec3(normal.y,-normal.x,0);vec3 tangent2=vec3(-normal.z,0,normal.x);r=Rand(tangent1*r);float J=(2.0+4.0*r);r=Rand(tangent2*r);float K=(2.0+2.0*r);tangent1=tangent1*J+tangent2*K;tangent1=normalize(tangent1);vec3 newPosition=position+normal*vfur_length*cos(furAngle)+tangent1*vfur_length*sin(furAngle);\n#ifdef HIGHLEVEL\nvec3 forceDirection=vec3(0.0,0.0,0.0);forceDirection.x=sin(furTime+position.x*0.05)*0.2;forceDirection.y=cos(furTime*0.7+position.y*0.04)*0.2;forceDirection.z=sin(furTime*0.7+position.z*0.04)*0.2;vec3 displacement=vec3(0.0,0.0,0.0);displacement=furGravity+forceDirection;float displacementFactor=pow(furOffset,3.0);vec3 aNormal=normal;aNormal.xyz+=displacement*displacementFactor;newPosition=vec3(newPosition.x,newPosition.y,newPosition.z)+(normalize(aNormal)*furOffset*furSpacing);\n#endif\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\ngl_Position=viewProjection*finalWorld*vec4(newPosition,1.0);vec4 worldPos=finalWorld*vec4(newPosition,1.0);vPositionW=vec3(worldPos);\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#ifdef HIGHLEVEL\nvFurUV=vDiffuseUV*furDensity;\n#endif\n#else\n#ifdef HIGHLEVEL\nvFurUV=uv*furDensity;\n#endif\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/fur/furMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{FurMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=(i("../../../dev/materials/src/fur/fur.fragment.ts"),i("../../../dev/materials/src/fur/fur.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.DIFFUSE=!1,t.HEIGHTMAP=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.POINTSIZE=!1,t.FOG=!1,t.NORMAL=!1,t.UV1=!1,t.UV2=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.INSTANCES=!1,t.INSTANCESCOLOR=!1,t.HIGHLEVEL=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.LOGARITHMICDEPTH=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.diffuseColor=new n.Color3(1,1,1),r.furLength=1,r.furAngle=0,r.furColor=new n.Color3(.44,.21,.02),r.furOffset=0,r.furSpacing=12,r.furGravity=new n.Vector3(0,0,0),r.furSpeed=100,r.furDensity=20,r.furOcclusion=0,r._disableLighting=!1,r._maxSimultaneousLights=4,r.highLevelFur=!0,r._furTime=0,r}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"furTime",{get:function(){return this._furTime},set:function(e){this._furTime=e},enumerable:!1,configurable:!0}),t.prototype.needAlphaBlending=function(){return this.alpha<1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.updateFur=function(){for(var e=1;e<this._meshes.length;e++){var t=this._meshes[e].material;t.furLength=this.furLength,t.furAngle=this.furAngle,t.furGravity=this.furGravity,t.furSpacing=this.furSpacing,t.furSpeed=this.furSpeed,t.furColor=this.furColor,t.diffuseTexture=this.diffuseTexture,t.furTexture=this.furTexture,t.highLevelFur=this.highLevelFur,t.furTime=this.furTime,t.furDensity=this.furDensity}},t.prototype.isReadyForSubMesh=function(e,t,i){var r=t._drawWrapper;if(this.isFrozen&&r.effect&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new o);var a=t.materialDefines,s=this.getScene();if(this._isReadyForSubMesh(t))return!0;var l=s.getEngine();if(a._areTexturesDirty&&s.texturesEnabled){if(this.diffuseTexture&&n.MaterialFlags.DiffuseTextureEnabled){if(!this.diffuseTexture.isReady())return!1;a._needUVs=!0,a.DIFFUSE=!0}if(this.heightTexture&&l.getCaps().maxVertexTextureImageUnits){if(!this.heightTexture.isReady())return!1;a._needUVs=!0,a.HEIGHTMAP=!0}}if(this.highLevelFur!==a.HIGHLEVEL&&(a.HIGHLEVEL=!0,a.markAsUnprocessed()),(0,n.PrepareDefinesForMisc)(e,s,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),a),a._needNormals=(0,n.PrepareDefinesForLights)(s,e,a,!1,this._maxSimultaneousLights,this._disableLighting),(0,n.PrepareDefinesForFrameBoundValues)(s,l,this,a,!!i),(0,n.PrepareDefinesForAttributes)(e,a,!0,!0),a.isDirty){a.markAsProcessed(),s.resetCachedMaterial();var c=new n.EffectFallbacks;a.FOG&&c.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(a,c,this.maxSimultaneousLights),a.NUM_BONE_INFLUENCERS>0&&c.addCPUSkinningFallback(0,e),a.IMAGEPROCESSINGPOSTPROCESS=s.imageProcessingConfiguration.applyByPostProcess;var u=[n.VertexBuffer.PositionKind];a.NORMAL&&u.push(n.VertexBuffer.NormalKind),a.UV1&&u.push(n.VertexBuffer.UVKind),a.UV2&&u.push(n.VertexBuffer.UV2Kind),a.VERTEXCOLOR&&u.push(n.VertexBuffer.ColorKind),(0,n.PrepareAttributesForBones)(u,e,a,c),(0,n.PrepareAttributesForInstances)(u,a);var h=a.toString(),d=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vFogInfos","vFogColor","pointSize","vDiffuseInfos","mBones","diffuseMatrix","logarithmicDepthConstant","furLength","furAngle","furColor","furOffset","furGravity","furTime","furSpacing","furDensity","furOcclusion"];(0,n.addClipPlaneUniforms)(d);var _=["diffuseSampler","heightTexture","furTexture"],f=[];(0,n.PrepareUniformsAndSamplersList)({uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:a,maxSimultaneousLights:this.maxSimultaneousLights}),t.setEffect(s.getEngine().createEffect("fur",{attributes:u,uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:h,fallbacks:c,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this.maxSimultaneousLights}},l),a,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(a._renderId=s.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;a&&(this._activeEffect=a,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),(0,n.BindBonesParameters)(t,this._activeEffect),this._mustRebind(r,a,i)&&(this._diffuseTexture&&n.MaterialFlags.DiffuseTextureEnabled&&(this._activeEffect.setTexture("diffuseSampler",this._diffuseTexture),this._activeEffect.setFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),this._activeEffect.setMatrix("diffuseMatrix",this._diffuseTexture.getTextureMatrix())),this._heightTexture&&this._activeEffect.setTexture("heightTexture",this._heightTexture),(0,n.bindClipPlane)(this._activeEffect,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,n.BindLogDepth)(o,a,r),r.bindEyePosition(a)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*t.visibility),r.lightsEnabled&&!this.disableLighting&&(0,n.BindLights)(r,t,this._activeEffect,o,this.maxSimultaneousLights),r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),(0,n.BindFogParameters)(r,t,this._activeEffect),this._activeEffect.setFloat("furLength",this.furLength),this._activeEffect.setFloat("furAngle",this.furAngle),this._activeEffect.setColor4("furColor",this.furColor,1),this.highLevelFur&&(this._activeEffect.setVector3("furGravity",this.furGravity),this._activeEffect.setFloat("furOffset",this.furOffset),this._activeEffect.setFloat("furSpacing",this.furSpacing),this._activeEffect.setFloat("furDensity",this.furDensity),this._activeEffect.setFloat("furOcclusion",this.furOcclusion),this._furTime+=this.getScene().getEngine().getDeltaTime()/this.furSpeed,this._activeEffect.setFloat("furTime",this._furTime),this._activeEffect.setTexture("furTexture",this.furTexture)),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){var e=[];return this.diffuseTexture&&this.diffuseTexture.animations&&this.diffuseTexture.animations.length>0&&e.push(this.diffuseTexture),this.heightTexture&&this.heightTexture.animations&&this.heightTexture.animations.length>0&&e.push(this.heightTexture),e},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._diffuseTexture&&t.push(this._diffuseTexture),this._heightTexture&&t.push(this._heightTexture),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this.diffuseTexture===t||this._heightTexture===t},t.prototype.dispose=function(t){if(this.diffuseTexture&&this.diffuseTexture.dispose(),this._meshes)for(var i=1;i<this._meshes.length;i++){var r=this._meshes[i].material;r&&r.dispose(t),this._meshes[i].dispose()}e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.FurMaterial",this._meshes&&(t.sourceMeshName=this._meshes[0].name,t.quality=this._meshes.length),t},t.prototype.getClassName=function(){return"FurMaterial"},t.Parse=function(e,i,r){var o=n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r);return e.sourceMeshName&&o.highLevelFur&&i.executeWhenReady((function(){var r=i.getMeshByName(e.sourceMeshName);if(r){var n=t.GenerateTexture("Fur Texture",i);o.furTexture=n,t.FurifyMesh(r,e.quality)}})),o},t.GenerateTexture=function(e,t){for(var i=new n.DynamicTexture("FurTexture "+e,256,t,!0),r=i.getContext(),o=0;o<2e4;++o)r.fillStyle="rgba(255, "+Math.floor(255*Math.random())+", "+Math.floor(255*Math.random())+", 1)",r.fillRect(Math.random()*i.getSize().width,Math.random()*i.getSize().height,2,2);return i.update(!1),i.wrapU=n.Texture.WRAP_ADDRESSMODE,i.wrapV=n.Texture.WRAP_ADDRESSMODE,i},t.FurifyMesh=function(e,i){var r,o=[e],a=e.material;if(!(a instanceof t))throw"The material of the source mesh must be a Fur Material";for(r=1;r<i;r++){var s=new t(a.name+r,e.getScene());e.getScene().materials.pop(),n.Tags.EnableFor(s),n.Tags.AddTagsTo(s,"furShellMaterial"),s.furLength=a.furLength,s.furAngle=a.furAngle,s.furGravity=a.furGravity,s.furSpacing=a.furSpacing,s.furSpeed=a.furSpeed,s.furColor=a.furColor,s.diffuseTexture=a.diffuseTexture,s.furOffset=r/i,s.furTexture=a.furTexture,s.highLevelFur=a.highLevelFur,s.furTime=a.furTime,s.furDensity=a.furDensity;var l=e.clone(e.name+r);l.material=s,l.skeleton=e.skeleton,l.position=n.Vector3.Zero(),o.push(l)}for(r=1;r<o.length;r++)o[r].parent=e;return e.material._meshes=o,o},(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture")],t.prototype,"_diffuseTexture",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("heightTexture")],t.prototype,"_heightTexture",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"heightTexture",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"diffuseColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"furLength",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"furAngle",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"furColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"furOffset",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"furSpacing",void 0),(0,r.__decorate)([(0,n.serializeAsVector3)()],t.prototype,"furGravity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"furSpeed",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"furDensity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"furOcclusion",void 0),(0,r.__decorate)([(0,n.serialize)("disableLighting")],t.prototype,"_disableLighting",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),(0,r.__decorate)([(0,n.serialize)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"highLevelFur",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"furTime",null),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.FurMaterial",a)},"../../../dev/materials/src/fur/index.ts":(e,t,i)=>{i.r(t),i.d(t,{FurMaterial:()=>r.FurMaterial});var r=i("../../../dev/materials/src/fur/furMaterial.ts")},"../../../dev/materials/src/gradient/gradient.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{gradientPixelShader:()=>o});var r="gradientPixelShader",n="precision highp float;uniform vec4 vEyePosition;uniform vec4 topColor;uniform vec4 bottomColor;uniform float offset;uniform float scale;uniform float smoothness;varying vec3 vPositionW;varying vec3 vPosition;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0]\n#include<__decl__lightFragment>[1]\n#include<__decl__lightFragment>[2]\n#include<__decl__lightFragment>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);float h=vPosition.y*scale+offset;float mysmoothness=clamp(smoothness,0.01,max(smoothness,10.));vec4 baseColor=mix(bottomColor,topColor,max(pow(max(h,0.0),mysmoothness),0.0));vec3 diffuseColor=baseColor.rgb;float alpha=baseColor.a;\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef EMISSIVE\nvec3 diffuseBase=baseColor.rgb;\n#else\nvec3 diffuseBase=vec3(0.,0.,0.);\n#endif\nlightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/gradient/gradient.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{gradientVertexShader:()=>o});var r="gradientVertexShader",n="precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;varying vec3 vPosition;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);vPosition=position;\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/gradient/gradientMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{GradientMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=(i("../../../dev/materials/src/gradient/gradient.fragment.ts"),i("../../../dev/materials/src/gradient/gradient.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.EMISSIVE=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.POINTSIZE=!1,t.FOG=!1,t.NORMAL=!1,t.UV1=!1,t.UV2=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.INSTANCES=!1,t.INSTANCESCOLOR=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.LOGARITHMICDEPTH=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r._maxSimultaneousLights=4,r.topColor=new n.Color3(1,0,0),r.topColorAlpha=1,r.bottomColor=new n.Color3(0,0,1),r.bottomColorAlpha=1,r.offset=0,r.scale=1,r.smoothness=1,r._disableLighting=!1,r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return this.alpha<1||this.topColorAlpha<1||this.bottomColorAlpha<1},t.prototype.needAlphaTesting=function(){return!0},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t,i){var r=t._drawWrapper;if(this.isFrozen&&r.effect&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new o);var a=t.materialDefines,s=this.getScene();if(this._isReadyForSubMesh(t))return!0;var l=s.getEngine();if((0,n.PrepareDefinesForFrameBoundValues)(s,l,this,a,!!i),(0,n.PrepareDefinesForMisc)(e,s,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),a),a._needNormals=(0,n.PrepareDefinesForLights)(s,e,a,!1,this._maxSimultaneousLights,this._disableLighting),a.EMISSIVE=this._disableLighting,(0,n.PrepareDefinesForAttributes)(e,a,!1,!0),a.isDirty){a.markAsProcessed(),s.resetCachedMaterial();var c=new n.EffectFallbacks;a.FOG&&c.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(a,c),a.NUM_BONE_INFLUENCERS>0&&c.addCPUSkinningFallback(0,e),a.IMAGEPROCESSINGPOSTPROCESS=s.imageProcessingConfiguration.applyByPostProcess;var u=[n.VertexBuffer.PositionKind];a.NORMAL&&u.push(n.VertexBuffer.NormalKind),a.UV1&&u.push(n.VertexBuffer.UVKind),a.UV2&&u.push(n.VertexBuffer.UV2Kind),a.VERTEXCOLOR&&u.push(n.VertexBuffer.ColorKind),(0,n.PrepareAttributesForBones)(u,e,a,c),(0,n.PrepareAttributesForInstances)(u,a);var h=a.toString(),d=["world","view","viewProjection","vEyePosition","vLightsType","vFogInfos","vFogColor","pointSize","mBones","logarithmicDepthConstant","topColor","bottomColor","offset","smoothness","scale"];(0,n.addClipPlaneUniforms)(d);var _=[],f=[];(0,n.PrepareUniformsAndSamplersList)({uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:a,maxSimultaneousLights:4}),t.setEffect(s.getEngine().createEffect("gradient",{attributes:u,uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:h,fallbacks:c,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},l),a,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(a._renderId=s.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;a&&(this._activeEffect=a,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),(0,n.BindBonesParameters)(t,a),this._mustRebind(r,a,i)&&((0,n.bindClipPlane)(a,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,n.BindLogDepth)(o,a,r),r.bindEyePosition(a)),r.lightsEnabled&&!this.disableLighting&&(0,n.BindLights)(r,t,this._activeEffect,o,this.maxSimultaneousLights),r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),(0,n.BindFogParameters)(r,t,this._activeEffect),this._activeEffect.setColor4("topColor",this.topColor,this.topColorAlpha),this._activeEffect.setColor4("bottomColor",this.bottomColor,this.bottomColorAlpha),this._activeEffect.setFloat("offset",this.offset),this._activeEffect.setFloat("scale",this.scale),this._activeEffect.setFloat("smoothness",this.smoothness),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){return[]},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.GradientMaterial",t},t.prototype.getClassName=function(){return"GradientMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},(0,r.__decorate)([(0,n.serialize)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"topColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"topColorAlpha",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"bottomColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bottomColorAlpha",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"offset",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"scale",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"smoothness",void 0),(0,r.__decorate)([(0,n.serialize)("disableLighting")],t.prototype,"_disableLighting",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.GradientMaterial",a)},"../../../dev/materials/src/gradient/index.ts":(e,t,i)=>{i.r(t),i.d(t,{GradientMaterial:()=>r.GradientMaterial});var r=i("../../../dev/materials/src/gradient/gradientMaterial.ts")},"../../../dev/materials/src/grid/grid.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{gridPixelShader:()=>o});var r="gridPixelShader",n="#extension GL_OES_standard_derivatives : enable\n#define SQRT2 1.41421356\n#define PI 3.14159\nprecision highp float;uniform float visibility;uniform vec3 mainColor;uniform vec3 lineColor;uniform vec4 gridControl;uniform vec3 gridOffset;varying vec3 vPosition;varying vec3 vNormal;\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef OPACITY\nvarying vec2 vOpacityUV;uniform sampler2D opacitySampler;uniform vec2 vOpacityInfos;\n#endif\nfloat getDynamicVisibility(float position) {float majorGridFrequency=gridControl.y;if (floor(position+0.5)==floor(position/majorGridFrequency+0.5)*majorGridFrequency)\n{return 1.0;}\nreturn gridControl.z;}\nfloat getAnisotropicAttenuation(float differentialLength) {const float maxNumberOfLines=10.0;return clamp(1.0/(differentialLength+1.0)-1.0/maxNumberOfLines,0.0,1.0);}\nfloat isPointOnLine(float position,float differentialLength) {float fractionPartOfPosition=position-floor(position+0.5); \nfractionPartOfPosition/=differentialLength; \n#ifdef ANTIALIAS\nfractionPartOfPosition=clamp(fractionPartOfPosition,-1.,1.);float result=0.5+0.5*cos(fractionPartOfPosition*PI); \nreturn result;\n#else\nreturn abs(fractionPartOfPosition)<SQRT2/4. ? 1. : 0.;\n#endif\n}\nfloat contributionOnAxis(float position) {float differentialLength=length(vec2(dFdx(position),dFdy(position)));differentialLength*=SQRT2; \nfloat result=isPointOnLine(position,differentialLength);float dynamicVisibility=getDynamicVisibility(position);result*=dynamicVisibility;float anisotropicAttenuation=getAnisotropicAttenuation(differentialLength);result*=anisotropicAttenuation;return result;}\nfloat normalImpactOnAxis(float x) {float normalImpact=clamp(1.0-3.0*abs(x*x*x),0.0,1.0);return normalImpact;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nfloat gridRatio=gridControl.x;vec3 gridPos=(vPosition+gridOffset.xyz)/gridRatio;float x=contributionOnAxis(gridPos.x);float y=contributionOnAxis(gridPos.y);float z=contributionOnAxis(gridPos.z);vec3 normal=normalize(vNormal);x*=normalImpactOnAxis(normal.x);y*=normalImpactOnAxis(normal.y);z*=normalImpactOnAxis(normal.z);\n#ifdef MAX_LINE\nfloat grid=clamp(max(max(x,y),z),0.,1.);\n#else\nfloat grid=clamp(x+y+z,0.,1.);\n#endif\nvec3 color=mix(mainColor,lineColor,grid);\n#ifdef FOG\n#include<fogFragment>\n#endif\nfloat opacity=1.0;\n#ifdef TRANSPARENT\nopacity=clamp(grid,0.08,gridControl.w*grid);\n#endif\n#ifdef OPACITY\nopacity*=texture2D(opacitySampler,vOpacityUV).a;\n#endif\ngl_FragColor=vec4(color.rgb,opacity*visibility);\n#ifdef TRANSPARENT\n#ifdef PREMULTIPLYALPHA\ngl_FragColor.rgb*=opacity;\n#endif\n#else\n#endif\n#include<logDepthFragment>\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/grid/grid.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{gridVertexShader:()=>o});var r="gridVertexShader",n="precision highp float;attribute vec3 position;attribute vec3 normal;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#include<instancesDeclaration>\nuniform mat4 projection;uniform mat4 view;varying vec3 vPosition;varying vec3 vNormal;\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#ifdef OPACITY\nvarying vec2 vOpacityUV;uniform mat4 opacityMatrix;uniform vec2 vOpacityInfos;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\n#include<fogVertex>\nvec4 cameraSpacePosition=view*worldPos;gl_Position=projection*cameraSpacePosition;\n#ifdef OPACITY\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\nif (vOpacityInfos.x==0.)\n{vOpacityUV=vec2(opacityMatrix*vec4(uv,1.0,0.0));}\nelse\n{vOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));}\n#endif \n#include<logDepthVertex>\nvPosition=position;vNormal=normal;\n#define CUSTOM_VERTEX_MAIN_END\n}";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/grid/gridMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{GridMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=(i("../../../dev/materials/src/grid/grid.fragment.ts"),i("../../../dev/materials/src/grid/grid.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.OPACITY=!1,t.ANTIALIAS=!1,t.TRANSPARENT=!1,t.FOG=!1,t.PREMULTIPLYALPHA=!1,t.MAX_LINE=!1,t.UV1=!1,t.UV2=!1,t.INSTANCES=!1,t.THIN_INSTANCES=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.LOGARITHMICDEPTH=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.mainColor=n.Color3.Black(),r.lineColor=n.Color3.Teal(),r.gridRatio=1,r.gridOffset=n.Vector3.Zero(),r.majorUnitFrequency=10,r.minorUnitVisibility=.33,r.opacity=1,r.antialias=!0,r.preMultiplyAlpha=!1,r.useMaxLine=!1,r._gridControl=new n.Vector4(r.gridRatio,r.majorUnitFrequency,r.minorUnitVisibility,r.opacity),r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return this.opacity<1||this._opacityTexture&&this._opacityTexture.isReady()},t.prototype.needAlphaBlendingForMesh=function(e){return e.visibility<1||this.needAlphaBlending()},t.prototype.isReadyForSubMesh=function(e,t,i){var r=t._drawWrapper;if(this.isFrozen&&r.effect&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new o);var a=t.materialDefines,s=this.getScene();if(this._isReadyForSubMesh(t))return!0;if(a.TRANSPARENT!==this.opacity<1&&(a.TRANSPARENT=!a.TRANSPARENT,a.markAsUnprocessed()),a.PREMULTIPLYALPHA!=this.preMultiplyAlpha&&(a.PREMULTIPLYALPHA=!a.PREMULTIPLYALPHA,a.markAsUnprocessed()),a.MAX_LINE!==this.useMaxLine&&(a.MAX_LINE=!a.MAX_LINE,a.markAsUnprocessed()),a.ANTIALIAS!==this.antialias&&(a.ANTIALIAS=!a.ANTIALIAS,a.markAsUnprocessed()),a._areTexturesDirty&&(a._needUVs=!1,s.texturesEnabled&&this._opacityTexture&&n.MaterialFlags.OpacityTextureEnabled)){if(!this._opacityTexture.isReady())return!1;a._needUVs=!0,a.OPACITY=!0}if((0,n.PrepareDefinesForMisc)(e,s,this._useLogarithmicDepth,!1,this.fogEnabled,!1,a),(0,n.PrepareDefinesForFrameBoundValues)(s,s.getEngine(),this,a,!!i),a.isDirty){a.markAsProcessed(),s.resetCachedMaterial(),(0,n.PrepareDefinesForAttributes)(e,a,!1,!1);var l=[n.VertexBuffer.PositionKind,n.VertexBuffer.NormalKind];a.UV1&&l.push(n.VertexBuffer.UVKind),a.UV2&&l.push(n.VertexBuffer.UV2Kind),a.IMAGEPROCESSINGPOSTPROCESS=s.imageProcessingConfiguration.applyByPostProcess,(0,n.PrepareAttributesForInstances)(l,a);var c=a.toString();t.setEffect(s.getEngine().createEffect("grid",l,["projection","mainColor","lineColor","gridControl","gridOffset","vFogInfos","vFogColor","world","view","opacityMatrix","vOpacityInfos","visibility","logarithmicDepthConstant"],["opacitySampler"],c,void 0,this.onCompiled,this.onError),a,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(a._renderId=s.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;a&&(this._activeEffect=a,this._activeEffect.setFloat("visibility",t.visibility),o.INSTANCES&&!o.THIN_INSTANCE||this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("view",r.getViewMatrix()),this._activeEffect.setMatrix("projection",r.getProjectionMatrix()),this._mustRebind(r,a,i)&&(this._activeEffect.setColor3("mainColor",this.mainColor),this._activeEffect.setColor3("lineColor",this.lineColor),this._activeEffect.setVector3("gridOffset",this.gridOffset),this._gridControl.x=this.gridRatio,this._gridControl.y=Math.round(this.majorUnitFrequency),this._gridControl.z=this.minorUnitVisibility,this._gridControl.w=this.opacity,this._activeEffect.setVector4("gridControl",this._gridControl),this._opacityTexture&&n.MaterialFlags.OpacityTextureEnabled&&(this._activeEffect.setTexture("opacitySampler",this._opacityTexture),this._activeEffect.setFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),this._activeEffect.setMatrix("opacityMatrix",this._opacityTexture.getTextureMatrix())),this._useLogarithmicDepth&&(0,n.BindLogDepth)(o,a,r)),(0,n.BindFogParameters)(r,t,this._activeEffect),this._afterBind(t,this._activeEffect,i))}},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.GridMaterial",t},t.prototype.getClassName=function(){return"GridMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"mainColor",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"lineColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"gridRatio",void 0),(0,r.__decorate)([(0,n.serializeAsVector3)()],t.prototype,"gridOffset",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"majorUnitFrequency",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"minorUnitVisibility",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"opacity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"antialias",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"preMultiplyAlpha",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"useMaxLine",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("opacityTexture")],t.prototype,"_opacityTexture",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"opacityTexture",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.GridMaterial",a)},"../../../dev/materials/src/grid/index.ts":(e,t,i)=>{i.r(t),i.d(t,{GridMaterial:()=>r.GridMaterial});var r=i("../../../dev/materials/src/grid/gridMaterial.ts")},"../../../dev/materials/src/index.ts":(e,t,i)=>{i.r(t),i.d(t,{CellMaterial:()=>r.CellMaterial,CustomMaterial:()=>n.CustomMaterial,CustomShaderStructure:()=>n.CustomShaderStructure,FireMaterial:()=>o.FireMaterial,FurMaterial:()=>a.FurMaterial,GradientMaterial:()=>s.GradientMaterial,GridMaterial:()=>l.GridMaterial,LavaMaterial:()=>c.LavaMaterial,MixMaterial:()=>u.MixMaterial,NormalMaterial:()=>h.NormalMaterial,PBRCustomMaterial:()=>n.PBRCustomMaterial,ShaderAlbedoParts:()=>n.ShaderAlbedoParts,ShaderAlebdoParts:()=>n.ShaderAlebdoParts,ShaderSpecialParts:()=>n.ShaderSpecialParts,ShadowOnlyMaterial:()=>d.ShadowOnlyMaterial,SimpleMaterial:()=>_.SimpleMaterial,SkyMaterial:()=>f.SkyMaterial,TerrainMaterial:()=>p.TerrainMaterial,TriPlanarMaterial:()=>m.TriPlanarMaterial,WaterMaterial:()=>g.WaterMaterial});var r=i("../../../dev/materials/src/cell/index.ts"),n=i("../../../dev/materials/src/custom/index.ts"),o=i("../../../dev/materials/src/fire/index.ts"),a=i("../../../dev/materials/src/fur/index.ts"),s=i("../../../dev/materials/src/gradient/index.ts"),l=i("../../../dev/materials/src/grid/index.ts"),c=i("../../../dev/materials/src/lava/index.ts"),u=i("../../../dev/materials/src/mix/index.ts"),h=i("../../../dev/materials/src/normal/index.ts"),d=i("../../../dev/materials/src/shadowOnly/index.ts"),_=i("../../../dev/materials/src/simple/index.ts"),f=i("../../../dev/materials/src/sky/index.ts"),p=i("../../../dev/materials/src/terrain/index.ts"),m=i("../../../dev/materials/src/triPlanar/index.ts"),g=i("../../../dev/materials/src/water/index.ts")},"../../../dev/materials/src/lava/index.ts":(e,t,i)=>{i.r(t),i.d(t,{LavaMaterial:()=>r.LavaMaterial});var r=i("../../../dev/materials/src/lava/lavaMaterial.ts")},"../../../dev/materials/src/lava/lava.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{lavaPixelShader:()=>o});var r="lavaPixelShader",n="precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;uniform float time;uniform float speed;uniform float movingSpeed;uniform vec3 fogColor;uniform sampler2D noiseTexture;uniform float fogDensity;varying float noise;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0]\n#include<__decl__lightFragment>[1]\n#include<__decl__lightFragment>[2]\n#include<__decl__lightFragment>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nfloat random( vec3 scale,float seed ){return fract( sin( dot( gl_FragCoord.xyz+seed,scale ) )*43758.5453+seed ) ;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nvec4 noiseTex=texture2D( noiseTexture,vDiffuseUV );vec2 T1=vDiffuseUV+vec2( 1.5,-1.5 )*time *0.02;vec2 T2=vDiffuseUV+vec2( -0.5,2.0 )*time*0.01*speed;T1.x+=noiseTex.x*2.0;T1.y+=noiseTex.y*2.0;T2.x-=noiseTex.y*0.2+time*0.001*movingSpeed;T2.y+=noiseTex.z*0.2+time*0.002*movingSpeed;float p=texture2D( noiseTexture,T1*3.0 ).a;vec4 lavaColor=texture2D( diffuseSampler,T2*4.0);vec4 temp=lavaColor*( vec4( p,p,p,p )*2. )+( lavaColor*lavaColor-0.1 );baseColor=temp;float depth=gl_FragCoord.z*4.0;const float LOG2=1.442695;float fogFactor=exp2(-fogDensity*fogDensity*depth*depth*LOG2 );fogFactor=1.0-clamp( fogFactor,0.0,1.0 );baseColor=mix( baseColor,vec4( fogColor,baseColor.w ),fogFactor );diffuseColor=baseColor.rgb;\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef UNLIT\nvec3 diffuseBase=vec3(1.,1.,1.);\n#else\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0]\n#include<lightFragment>[1]\n#include<lightFragment>[2]\n#include<lightFragment>[3]\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/lava/lava.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{lavaVertexShader:()=>o});var r="lavaVertexShader",n="precision highp float;uniform float time;uniform float lowFrequencySpeed;varying float noise;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n/* NOISE FUNCTIONS */\nvec3 mod289(vec3 x)\n{return x-floor(x*(1.0/289.0))*289.0;}\nvec4 mod289(vec4 x)\n{return x-floor(x*(1.0/289.0))*289.0;}\nvec4 permute(vec4 x)\n{return mod289(((x*34.0)+1.0)*x);}\nvec4 taylorInvSqrt(vec4 r)\n{return 1.79284291400159-0.85373472095314*r;}\nvec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}\nfloat pnoise(vec3 P,vec3 rep)\n{vec3 Pi0=mod(floor(P),rep); \nvec3 Pi1=mod(Pi0+vec3(1.0),rep); \nPi0=mod289(Pi0);Pi1=mod289(Pi1);vec3 Pf0=fract(P); \nvec3 Pf1=Pf0-vec3(1.0); \nvec4 ix=vec4(Pi0.x,Pi1.x,Pi0.x,Pi1.x);vec4 iy=vec4(Pi0.yy,Pi1.yy);vec4 iz0=Pi0.zzzz;vec4 iz1=Pi1.zzzz;vec4 ixy=permute(permute(ix)+iy);vec4 ixy0=permute(ixy+iz0);vec4 ixy1=permute(ixy+iz1);vec4 gx0=ixy0*(1.0/7.0);vec4 gy0=fract(floor(gx0)*(1.0/7.0))-0.5;gx0=fract(gx0);vec4 gz0=vec4(0.5)-abs(gx0)-abs(gy0);vec4 sz0=step(gz0,vec4(0.0));gx0-=sz0*(step(0.0,gx0)-0.5);gy0-=sz0*(step(0.0,gy0)-0.5);vec4 gx1=ixy1*(1.0/7.0);vec4 gy1=fract(floor(gx1)*(1.0/7.0))-0.5;gx1=fract(gx1);vec4 gz1=vec4(0.5)-abs(gx1)-abs(gy1);vec4 sz1=step(gz1,vec4(0.0));gx1-=sz1*(step(0.0,gx1)-0.5);gy1-=sz1*(step(0.0,gy1)-0.5);vec3 g000=vec3(gx0.x,gy0.x,gz0.x);vec3 g100=vec3(gx0.y,gy0.y,gz0.y);vec3 g010=vec3(gx0.z,gy0.z,gz0.z);vec3 g110=vec3(gx0.w,gy0.w,gz0.w);vec3 g001=vec3(gx1.x,gy1.x,gz1.x);vec3 g101=vec3(gx1.y,gy1.y,gz1.y);vec3 g011=vec3(gx1.z,gy1.z,gz1.z);vec3 g111=vec3(gx1.w,gy1.w,gz1.w);vec4 norm0=taylorInvSqrt(vec4(dot(g000,g000),dot(g010,g010),dot(g100,g100),dot(g110,g110)));g000*=norm0.x;g010*=norm0.y;g100*=norm0.z;g110*=norm0.w;vec4 norm1=taylorInvSqrt(vec4(dot(g001,g001),dot(g011,g011),dot(g101,g101),dot(g111,g111)));g001*=norm1.x;g011*=norm1.y;g101*=norm1.z;g111*=norm1.w;float n000=dot(g000,Pf0);float n100=dot(g100,vec3(Pf1.x,Pf0.yz));float n010=dot(g010,vec3(Pf0.x,Pf1.y,Pf0.z));float n110=dot(g110,vec3(Pf1.xy,Pf0.z));float n001=dot(g001,vec3(Pf0.xy,Pf1.z));float n101=dot(g101,vec3(Pf1.x,Pf0.y,Pf1.z));float n011=dot(g011,vec3(Pf0.x,Pf1.yz));float n111=dot(g111,Pf1);vec3 fade_xyz=fade(Pf0);vec4 n_z=mix(vec4(n000,n100,n010,n110),vec4(n001,n101,n011,n111),fade_xyz.z);vec2 n_yz=mix(n_z.xy,n_z.zw,fade_xyz.y);float n_xyz=mix(n_yz.x,n_yz.y,fade_xyz.x);return 2.2*n_xyz;}\n/* END FUNCTION */\nfloat turbulence( vec3 p ) {float w=100.0;float t=-.5;for (float f=1.0 ; f<=10.0 ; f++ ){float power=pow( 2.0,f );t+=abs( pnoise( vec3( power*p ),vec3( 10.0,10.0,10.0 ) )/power );}\nreturn t;}\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\n#ifdef NORMAL\nnoise=10.0* -.10*turbulence( .5*normal+time*1.15 );float b=lowFrequencySpeed*5.0*pnoise( 0.05*position +vec3(time*1.025),vec3( 100.0 ) );float displacement=- 1.5*noise+b;vec3 newPosition=position+normal*displacement;gl_Position=viewProjection*finalWorld*vec4( newPosition,1.0 );vec4 worldPos=finalWorld*vec4(newPosition,1.0);vPositionW=vec3(worldPos);vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#include<logDepthVertex>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/lava/lavaMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{LavaMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=(i("../../../dev/materials/src/lava/lava.fragment.ts"),i("../../../dev/materials/src/lava/lava.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.DIFFUSE=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.POINTSIZE=!1,t.FOG=!1,t.LIGHT0=!1,t.LIGHT1=!1,t.LIGHT2=!1,t.LIGHT3=!1,t.SPOTLIGHT0=!1,t.SPOTLIGHT1=!1,t.SPOTLIGHT2=!1,t.SPOTLIGHT3=!1,t.HEMILIGHT0=!1,t.HEMILIGHT1=!1,t.HEMILIGHT2=!1,t.HEMILIGHT3=!1,t.DIRLIGHT0=!1,t.DIRLIGHT1=!1,t.DIRLIGHT2=!1,t.DIRLIGHT3=!1,t.POINTLIGHT0=!1,t.POINTLIGHT1=!1,t.POINTLIGHT2=!1,t.POINTLIGHT3=!1,t.SHADOW0=!1,t.SHADOW1=!1,t.SHADOW2=!1,t.SHADOW3=!1,t.SHADOWS=!1,t.SHADOWESM0=!1,t.SHADOWESM1=!1,t.SHADOWESM2=!1,t.SHADOWESM3=!1,t.SHADOWPOISSON0=!1,t.SHADOWPOISSON1=!1,t.SHADOWPOISSON2=!1,t.SHADOWPOISSON3=!1,t.SHADOWPCF0=!1,t.SHADOWPCF1=!1,t.SHADOWPCF2=!1,t.SHADOWPCF3=!1,t.SHADOWPCSS0=!1,t.SHADOWPCSS1=!1,t.SHADOWPCSS2=!1,t.SHADOWPCSS3=!1,t.NORMAL=!1,t.UV1=!1,t.UV2=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.INSTANCES=!1,t.INSTANCESCOLOR=!1,t.UNLIT=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.LOGARITHMICDEPTH=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.speed=1,r.movingSpeed=1,r.lowFrequencySpeed=1,r.fogDensity=.15,r._lastTime=0,r.diffuseColor=new n.Color3(1,1,1),r._disableLighting=!1,r._unlit=!1,r._maxSimultaneousLights=4,r._scaledDiffuse=new n.Color3,r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return this.alpha<1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t,i){var r=t._drawWrapper;if(this.isFrozen&&r.effect&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new o);var a=t.materialDefines,s=this.getScene();if(this._isReadyForSubMesh(t))return!0;var l=s.getEngine();if(a._areTexturesDirty&&(a._needUVs=!1,s.texturesEnabled&&this._diffuseTexture&&n.MaterialFlags.DiffuseTextureEnabled)){if(!this._diffuseTexture.isReady())return!1;a._needUVs=!0,a.DIFFUSE=!0}if((0,n.PrepareDefinesForMisc)(e,s,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),a),a._needNormals=!0,(0,n.PrepareDefinesForLights)(s,e,a,!1,this._maxSimultaneousLights,this._disableLighting),(0,n.PrepareDefinesForFrameBoundValues)(s,l,this,a,!!i),(0,n.PrepareDefinesForAttributes)(e,a,!0,!0),a.isDirty){a.markAsProcessed(),s.resetCachedMaterial();var c=new n.EffectFallbacks;a.FOG&&c.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(a,c),a.NUM_BONE_INFLUENCERS>0&&c.addCPUSkinningFallback(0,e),a.IMAGEPROCESSINGPOSTPROCESS=s.imageProcessingConfiguration.applyByPostProcess;var u=[n.VertexBuffer.PositionKind];a.NORMAL&&u.push(n.VertexBuffer.NormalKind),a.UV1&&u.push(n.VertexBuffer.UVKind),a.UV2&&u.push(n.VertexBuffer.UV2Kind),a.VERTEXCOLOR&&u.push(n.VertexBuffer.ColorKind),(0,n.PrepareAttributesForBones)(u,e,a,c),(0,n.PrepareAttributesForInstances)(u,a);var h=a.toString(),d=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vFogInfos","vFogColor","pointSize","vDiffuseInfos","mBones","diffuseMatrix","logarithmicDepthConstant","time","speed","movingSpeed","fogColor","fogDensity","lowFrequencySpeed"];(0,n.addClipPlaneUniforms)(d);var _=["diffuseSampler","noiseTexture"],f=[];(0,n.PrepareUniformsAndSamplersList)({uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:a,maxSimultaneousLights:this.maxSimultaneousLights}),t.setEffect(s.getEngine().createEffect("lava",{attributes:u,uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:h,fallbacks:c,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this.maxSimultaneousLights}},l),a,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(a._renderId=s.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;a&&(this._activeEffect=a,o.UNLIT=this._unlit,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),(0,n.BindBonesParameters)(t,this._activeEffect),this._mustRebind(r,a,i)&&(this.diffuseTexture&&n.MaterialFlags.DiffuseTextureEnabled&&(this._activeEffect.setTexture("diffuseSampler",this.diffuseTexture),this._activeEffect.setFloat2("vDiffuseInfos",this.diffuseTexture.coordinatesIndex,this.diffuseTexture.level),this._activeEffect.setMatrix("diffuseMatrix",this.diffuseTexture.getTextureMatrix())),this.noiseTexture&&this._activeEffect.setTexture("noiseTexture",this.noiseTexture),(0,n.bindClipPlane)(a,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,n.BindLogDepth)(o,a,r),r.bindEyePosition(a)),this._activeEffect.setColor4("vDiffuseColor",this._scaledDiffuse,this.alpha*t.visibility),r.lightsEnabled&&!this.disableLighting&&(0,n.BindLights)(r,t,this._activeEffect,o),r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),(0,n.BindFogParameters)(r,t,this._activeEffect),this._lastTime+=r.getEngine().getDeltaTime(),this._activeEffect.setFloat("time",this._lastTime*this.speed/1e3),this.fogColor||(this.fogColor=n.Color3.Black()),this._activeEffect.setColor3("fogColor",this.fogColor),this._activeEffect.setFloat("fogDensity",this.fogDensity),this._activeEffect.setFloat("lowFrequencySpeed",this.lowFrequencySpeed),this._activeEffect.setFloat("movingSpeed",this.movingSpeed),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){var e=[];return this.diffuseTexture&&this.diffuseTexture.animations&&this.diffuseTexture.animations.length>0&&e.push(this.diffuseTexture),this.noiseTexture&&this.noiseTexture.animations&&this.noiseTexture.animations.length>0&&e.push(this.noiseTexture),e},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._diffuseTexture&&t.push(this._diffuseTexture),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this.diffuseTexture===t},t.prototype.dispose=function(t){this.diffuseTexture&&this.diffuseTexture.dispose(),this.noiseTexture&&this.noiseTexture.dispose(),e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.LavaMaterial",t},t.prototype.getClassName=function(){return"LavaMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture")],t.prototype,"_diffuseTexture",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)()],t.prototype,"noiseTexture",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"fogColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"speed",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"movingSpeed",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"lowFrequencySpeed",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"fogDensity",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"diffuseColor",void 0),(0,r.__decorate)([(0,n.serialize)("disableLighting")],t.prototype,"_disableLighting",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),(0,r.__decorate)([(0,n.serialize)("unlit")],t.prototype,"_unlit",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"unlit",void 0),(0,r.__decorate)([(0,n.serialize)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.LavaMaterial",a)},"../../../dev/materials/src/mix/index.ts":(e,t,i)=>{i.r(t),i.d(t,{MixMaterial:()=>r.MixMaterial});var r=i("../../../dev/materials/src/mix/mixMaterial.ts")},"../../../dev/materials/src/mix/mix.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{mixPixelShader:()=>o});var r="mixPixelShader",n="precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform sampler2D mixMap1Sampler;uniform vec2 vTextureInfos;\n#ifdef MIXMAP2\nuniform sampler2D mixMap2Sampler;\n#endif\nuniform sampler2D diffuse1Sampler;uniform sampler2D diffuse2Sampler;uniform sampler2D diffuse3Sampler;uniform sampler2D diffuse4Sampler;uniform vec2 diffuse1Infos;uniform vec2 diffuse2Infos;uniform vec2 diffuse3Infos;uniform vec2 diffuse4Infos;\n#ifdef MIXMAP2\nuniform sampler2D diffuse5Sampler;uniform sampler2D diffuse6Sampler;uniform sampler2D diffuse7Sampler;uniform sampler2D diffuse8Sampler;uniform vec2 diffuse5Infos;uniform vec2 diffuse6Infos;uniform vec2 diffuse7Infos;uniform vec2 diffuse8Infos;\n#endif\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 finalMixColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;\n#ifdef MIXMAP2\nvec4 mixColor2=vec4(1.,1.,1.,1.);\n#endif\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\nfloat alpha=vDiffuseColor.a;\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nvec4 mixColor=texture2D(mixMap1Sampler,vTextureUV);\n#include<depthPrePass>\nmixColor.rgb*=vTextureInfos.y;vec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);vec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);vec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);vec4 diffuse4Color=texture2D(diffuse4Sampler,vTextureUV*diffuse4Infos);diffuse1Color.rgb*=mixColor.r;diffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,mixColor.g);diffuse3Color.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,mixColor.b);finalMixColor.rgb=mix(diffuse3Color.rgb,diffuse4Color.rgb,1.0-mixColor.a);\n#ifdef MIXMAP2\nmixColor=texture2D(mixMap2Sampler,vTextureUV);mixColor.rgb*=vTextureInfos.y;vec4 diffuse5Color=texture2D(diffuse5Sampler,vTextureUV*diffuse5Infos);vec4 diffuse6Color=texture2D(diffuse6Sampler,vTextureUV*diffuse6Infos);vec4 diffuse7Color=texture2D(diffuse7Sampler,vTextureUV*diffuse7Infos);vec4 diffuse8Color=texture2D(diffuse8Sampler,vTextureUV*diffuse8Infos);diffuse5Color.rgb=mix(finalMixColor.rgb,diffuse5Color.rgb,mixColor.r);diffuse6Color.rgb=mix(diffuse5Color.rgb,diffuse6Color.rgb,mixColor.g);diffuse7Color.rgb=mix(diffuse6Color.rgb,diffuse7Color.rgb,mixColor.b);finalMixColor.rgb=mix(diffuse7Color.rgb,diffuse8Color.rgb,1.0-mixColor.a);\n#endif\n#endif\n#ifdef VERTEXCOLOR\nfinalMixColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor*finalMixColor.rgb,0.0,1.0);vec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/mix/mix.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{mixVertexShader:()=>o});var r="mixVertexShader",n="precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform mat4 textureMatrix;uniform vec2 vTextureInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vTextureInfos.x==0.)\n{vTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));}\nelse\n{vTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/mix/mixMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{MixMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=(i("../../../dev/materials/src/mix/mix.fragment.ts"),i("../../../dev/materials/src/mix/mix.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.DIFFUSE=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.POINTSIZE=!1,t.FOG=!1,t.SPECULARTERM=!1,t.NORMAL=!1,t.UV1=!1,t.UV2=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.INSTANCES=!1,t.INSTANCESCOLOR=!1,t.MIXMAP2=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.LOGARITHMICDEPTH=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.diffuseColor=new n.Color3(1,1,1),r.specularColor=new n.Color3(0,0,0),r.specularPower=64,r._disableLighting=!1,r._maxSimultaneousLights=4,r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return this.alpha<1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t,i){var r=t._drawWrapper;if(this.isFrozen&&r.effect&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new o);var a=t.materialDefines,s=this.getScene();if(this._isReadyForSubMesh(t))return!0;var l=s.getEngine();if(s.texturesEnabled){if(!this._mixTexture1||!this._mixTexture1.isReady())return!1;if(a._needUVs=!0,n.MaterialFlags.DiffuseTextureEnabled){if(!this._diffuseTexture1||!this._diffuseTexture1.isReady())return!1;if(a.DIFFUSE=!0,!this._diffuseTexture2||!this._diffuseTexture2.isReady())return!1;if(!this._diffuseTexture3||!this._diffuseTexture3.isReady())return!1;if(!this._diffuseTexture4||!this._diffuseTexture4.isReady())return!1;if(this._mixTexture2){if(!this._mixTexture2.isReady())return!1;if(a.MIXMAP2=!0,!this._diffuseTexture5||!this._diffuseTexture5.isReady())return!1;if(!this._diffuseTexture6||!this._diffuseTexture6.isReady())return!1;if(!this._diffuseTexture7||!this._diffuseTexture7.isReady())return!1;if(!this._diffuseTexture8||!this._diffuseTexture8.isReady())return!1}}}if((0,n.PrepareDefinesForMisc)(e,s,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),a),a._needNormals=(0,n.PrepareDefinesForLights)(s,e,a,!1,this._maxSimultaneousLights,this._disableLighting),(0,n.PrepareDefinesForFrameBoundValues)(s,l,this,a,!!i),(0,n.PrepareDefinesForAttributes)(e,a,!0,!0),a.isDirty){a.markAsProcessed(),s.resetCachedMaterial();var c=new n.EffectFallbacks;a.FOG&&c.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(a,c,this.maxSimultaneousLights),a.NUM_BONE_INFLUENCERS>0&&c.addCPUSkinningFallback(0,e),a.IMAGEPROCESSINGPOSTPROCESS=s.imageProcessingConfiguration.applyByPostProcess;var u=[n.VertexBuffer.PositionKind];a.NORMAL&&u.push(n.VertexBuffer.NormalKind),a.UV1&&u.push(n.VertexBuffer.UVKind),a.UV2&&u.push(n.VertexBuffer.UV2Kind),a.VERTEXCOLOR&&u.push(n.VertexBuffer.ColorKind),(0,n.PrepareAttributesForBones)(u,e,a,c),(0,n.PrepareAttributesForInstances)(u,a);var h=a.toString(),d=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vSpecularColor","vFogInfos","vFogColor","pointSize","vTextureInfos","mBones","textureMatrix","logarithmicDepthConstant","diffuse1Infos","diffuse2Infos","diffuse3Infos","diffuse4Infos","diffuse5Infos","diffuse6Infos","diffuse7Infos","diffuse8Infos"],_=["mixMap1Sampler","mixMap2Sampler","diffuse1Sampler","diffuse2Sampler","diffuse3Sampler","diffuse4Sampler","diffuse5Sampler","diffuse6Sampler","diffuse7Sampler","diffuse8Sampler"],f=[];(0,n.addClipPlaneUniforms)(d),(0,n.PrepareUniformsAndSamplersList)({uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:a,maxSimultaneousLights:this.maxSimultaneousLights}),t.setEffect(s.getEngine().createEffect("mix",{attributes:u,uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:h,fallbacks:c,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this.maxSimultaneousLights}},l),a,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(a._renderId=s.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;a&&(this._activeEffect=a,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),(0,n.BindBonesParameters)(t,this._activeEffect),this._mustRebind(r,a,i)&&(this._mixTexture1&&(this._activeEffect.setTexture("mixMap1Sampler",this._mixTexture1),this._activeEffect.setFloat2("vTextureInfos",this._mixTexture1.coordinatesIndex,this._mixTexture1.level),this._activeEffect.setMatrix("textureMatrix",this._mixTexture1.getTextureMatrix()),n.MaterialFlags.DiffuseTextureEnabled&&(this._diffuseTexture1&&(this._activeEffect.setTexture("diffuse1Sampler",this._diffuseTexture1),this._activeEffect.setFloat2("diffuse1Infos",this._diffuseTexture1.uScale,this._diffuseTexture1.vScale)),this._diffuseTexture2&&(this._activeEffect.setTexture("diffuse2Sampler",this._diffuseTexture2),this._activeEffect.setFloat2("diffuse2Infos",this._diffuseTexture2.uScale,this._diffuseTexture2.vScale)),this._diffuseTexture3&&(this._activeEffect.setTexture("diffuse3Sampler",this._diffuseTexture3),this._activeEffect.setFloat2("diffuse3Infos",this._diffuseTexture3.uScale,this._diffuseTexture3.vScale)),this._diffuseTexture4&&(this._activeEffect.setTexture("diffuse4Sampler",this._diffuseTexture4),this._activeEffect.setFloat2("diffuse4Infos",this._diffuseTexture4.uScale,this._diffuseTexture4.vScale)))),this._mixTexture2&&(this._activeEffect.setTexture("mixMap2Sampler",this._mixTexture2),n.MaterialFlags.DiffuseTextureEnabled&&(this._diffuseTexture5&&(this._activeEffect.setTexture("diffuse5Sampler",this._diffuseTexture5),this._activeEffect.setFloat2("diffuse5Infos",this._diffuseTexture5.uScale,this._diffuseTexture5.vScale)),this._diffuseTexture6&&(this._activeEffect.setTexture("diffuse6Sampler",this._diffuseTexture6),this._activeEffect.setFloat2("diffuse6Infos",this._diffuseTexture6.uScale,this._diffuseTexture6.vScale)),this._diffuseTexture7&&(this._activeEffect.setTexture("diffuse7Sampler",this._diffuseTexture7),this._activeEffect.setFloat2("diffuse7Infos",this._diffuseTexture7.uScale,this._diffuseTexture7.vScale)),this._diffuseTexture8&&(this._activeEffect.setTexture("diffuse8Sampler",this._diffuseTexture8),this._activeEffect.setFloat2("diffuse8Infos",this._diffuseTexture8.uScale,this._diffuseTexture8.vScale)))),(0,n.bindClipPlane)(a,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,n.BindLogDepth)(o,a,r),r.bindEyePosition(a)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*t.visibility),o.SPECULARTERM&&this._activeEffect.setColor4("vSpecularColor",this.specularColor,this.specularPower),r.lightsEnabled&&!this.disableLighting&&(0,n.BindLights)(r,t,this._activeEffect,o,this.maxSimultaneousLights),r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),(0,n.BindFogParameters)(r,t,this._activeEffect),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){var e=[];return this._mixTexture1&&this._mixTexture1.animations&&this._mixTexture1.animations.length>0&&e.push(this._mixTexture1),this._mixTexture2&&this._mixTexture2.animations&&this._mixTexture2.animations.length>0&&e.push(this._mixTexture2),e},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._mixTexture1&&t.push(this._mixTexture1),this._diffuseTexture1&&t.push(this._diffuseTexture1),this._diffuseTexture2&&t.push(this._diffuseTexture2),this._diffuseTexture3&&t.push(this._diffuseTexture3),this._diffuseTexture4&&t.push(this._diffuseTexture4),this._mixTexture2&&t.push(this._mixTexture2),this._diffuseTexture5&&t.push(this._diffuseTexture5),this._diffuseTexture6&&t.push(this._diffuseTexture6),this._diffuseTexture7&&t.push(this._diffuseTexture7),this._diffuseTexture8&&t.push(this._diffuseTexture8),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this._mixTexture1===t||this._diffuseTexture1===t||this._diffuseTexture2===t||this._diffuseTexture3===t||this._diffuseTexture4===t||this._mixTexture2===t||this._diffuseTexture5===t||this._diffuseTexture6===t||this._diffuseTexture7===t||this._diffuseTexture8===t},t.prototype.dispose=function(t){this._mixTexture1&&this._mixTexture1.dispose(),e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.MixMaterial",t},t.prototype.getClassName=function(){return"MixMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},(0,r.__decorate)([(0,n.serializeAsTexture)("mixTexture1")],t.prototype,"_mixTexture1",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"mixTexture1",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("mixTexture2")],t.prototype,"_mixTexture2",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"mixTexture2",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture1")],t.prototype,"_diffuseTexture1",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture1",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture2")],t.prototype,"_diffuseTexture2",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture2",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture3")],t.prototype,"_diffuseTexture3",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture3",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture4")],t.prototype,"_diffuseTexture4",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture4",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture1")],t.prototype,"_diffuseTexture5",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture5",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture2")],t.prototype,"_diffuseTexture6",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture6",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture3")],t.prototype,"_diffuseTexture7",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture7",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture4")],t.prototype,"_diffuseTexture8",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture8",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"diffuseColor",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"specularColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"specularPower",void 0),(0,r.__decorate)([(0,n.serialize)("disableLighting")],t.prototype,"_disableLighting",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),(0,r.__decorate)([(0,n.serialize)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.MixMaterial",a)},"../../../dev/materials/src/normal/index.ts":(e,t,i)=>{i.r(t),i.d(t,{NormalMaterial:()=>r.NormalMaterial});var r=i("../../../dev/materials/src/normal/normalMaterial.ts")},"../../../dev/materials/src/normal/normal.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{normalPixelShader:()=>o});var r="normalPixelShader",n="precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef LIGHTING\n#include<helperFunctions>\n#include<__decl__lightFragment>[0]\n#include<__decl__lightFragment>[1]\n#include<__decl__lightFragment>[2]\n#include<__decl__lightFragment>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#endif\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef NORMAL\nbaseColor=mix(baseColor,vec4(vNormalW,1.0),0.5);\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef LIGHTING\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0]\n#include<lightFragment>[1]\n#include<lightFragment>[2]\n#include<lightFragment>[3]\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;\n#else\nvec3 finalDiffuse= baseColor.rgb;\n#endif\nvec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/normal/normal.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{normalVertexShader:()=>o});var r="normalVertexShader",n="precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/normal/normalMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{NormalMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=(i("../../../dev/materials/src/normal/normal.fragment.ts"),i("../../../dev/materials/src/normal/normal.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.DIFFUSE=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.POINTSIZE=!1,t.FOG=!1,t.LIGHT0=!1,t.LIGHT1=!1,t.LIGHT2=!1,t.LIGHT3=!1,t.SPOTLIGHT0=!1,t.SPOTLIGHT1=!1,t.SPOTLIGHT2=!1,t.SPOTLIGHT3=!1,t.HEMILIGHT0=!1,t.HEMILIGHT1=!1,t.HEMILIGHT2=!1,t.HEMILIGHT3=!1,t.DIRLIGHT0=!1,t.DIRLIGHT1=!1,t.DIRLIGHT2=!1,t.DIRLIGHT3=!1,t.POINTLIGHT0=!1,t.POINTLIGHT1=!1,t.POINTLIGHT2=!1,t.POINTLIGHT3=!1,t.SHADOW0=!1,t.SHADOW1=!1,t.SHADOW2=!1,t.SHADOW3=!1,t.SHADOWS=!1,t.SHADOWESM0=!1,t.SHADOWESM1=!1,t.SHADOWESM2=!1,t.SHADOWESM3=!1,t.SHADOWPOISSON0=!1,t.SHADOWPOISSON1=!1,t.SHADOWPOISSON2=!1,t.SHADOWPOISSON3=!1,t.SHADOWPCF0=!1,t.SHADOWPCF1=!1,t.SHADOWPCF2=!1,t.SHADOWPCF3=!1,t.SHADOWPCSS0=!1,t.SHADOWPCSS1=!1,t.SHADOWPCSS2=!1,t.SHADOWPCSS3=!1,t.NORMAL=!1,t.UV1=!1,t.UV2=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.INSTANCES=!1,t.LIGHTING=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.LOGARITHMICDEPTH=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.diffuseColor=new n.Color3(1,1,1),r._disableLighting=!1,r._maxSimultaneousLights=4,r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return this.alpha<1},t.prototype.needAlphaBlendingForMesh=function(e){return this.needAlphaBlending()||e.visibility<1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t,i){var r=t._drawWrapper;if(this.isFrozen&&r.effect&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new o);var a=t.materialDefines,s=this.getScene();if(this._isReadyForSubMesh(t))return!0;var l=s.getEngine();if(a._areTexturesDirty&&(a._needUVs=!1,s.texturesEnabled&&this._diffuseTexture&&n.MaterialFlags.DiffuseTextureEnabled)){if(!this._diffuseTexture.isReady())return!1;a._needUVs=!0,a.DIFFUSE=!0}if((0,n.PrepareDefinesForMisc)(e,s,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),a),a._needNormals=!0,(0,n.PrepareDefinesForLights)(s,e,a,!1,this._maxSimultaneousLights,this._disableLighting),(0,n.PrepareDefinesForFrameBoundValues)(s,l,this,a,!!i),a.LIGHTING=!this._disableLighting,(0,n.PrepareDefinesForAttributes)(e,a,!0,!0),a.isDirty){a.markAsProcessed(),s.resetCachedMaterial();var c=new n.EffectFallbacks;a.FOG&&c.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(a,c),a.NUM_BONE_INFLUENCERS>0&&c.addCPUSkinningFallback(0,e),a.IMAGEPROCESSINGPOSTPROCESS=s.imageProcessingConfiguration.applyByPostProcess;var u=[n.VertexBuffer.PositionKind];a.NORMAL&&u.push(n.VertexBuffer.NormalKind),a.UV1&&u.push(n.VertexBuffer.UVKind),a.UV2&&u.push(n.VertexBuffer.UV2Kind),(0,n.PrepareAttributesForBones)(u,e,a,c),(0,n.PrepareAttributesForInstances)(u,a);var h=a.toString(),d=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vFogInfos","vFogColor","pointSize","vDiffuseInfos","mBones","diffuseMatrix","logarithmicDepthConstant"],_=["diffuseSampler"],f=[];(0,n.addClipPlaneUniforms)(d),(0,n.PrepareUniformsAndSamplersList)({uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:a,maxSimultaneousLights:4}),t.setEffect(s.getEngine().createEffect("normal",{attributes:u,uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:h,fallbacks:c,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:4}},l),a,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(a._renderId=s.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;a&&(this._activeEffect=a,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),(0,n.BindBonesParameters)(t,this._activeEffect),this._mustRebind(r,a,i)&&(this.diffuseTexture&&n.MaterialFlags.DiffuseTextureEnabled&&(this._activeEffect.setTexture("diffuseSampler",this.diffuseTexture),this._activeEffect.setFloat2("vDiffuseInfos",this.diffuseTexture.coordinatesIndex,this.diffuseTexture.level),this._activeEffect.setMatrix("diffuseMatrix",this.diffuseTexture.getTextureMatrix())),(0,n.bindClipPlane)(a,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,n.BindLogDepth)(o,a,r),r.bindEyePosition(a)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*t.visibility),r.lightsEnabled&&!this.disableLighting&&(0,n.BindLights)(r,t,this._activeEffect,o),r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),(0,n.BindFogParameters)(r,t,this._activeEffect),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){var e=[];return this.diffuseTexture&&this.diffuseTexture.animations&&this.diffuseTexture.animations.length>0&&e.push(this.diffuseTexture),e},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._diffuseTexture&&t.push(this._diffuseTexture),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this.diffuseTexture===t},t.prototype.dispose=function(t){this.diffuseTexture&&this.diffuseTexture.dispose(),e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.NormalMaterial",t},t.prototype.getClassName=function(){return"NormalMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture")],t.prototype,"_diffuseTexture",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"diffuseColor",void 0),(0,r.__decorate)([(0,n.serialize)("disableLighting")],t.prototype,"_disableLighting",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),(0,r.__decorate)([(0,n.serialize)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.NormalMaterial",a)},"../../../dev/materials/src/shadowOnly/index.ts":(e,t,i)=>{i.r(t),i.d(t,{ShadowOnlyMaterial:()=>r.ShadowOnlyMaterial});var r=i("../../../dev/materials/src/shadowOnly/shadowOnlyMaterial.ts")},"../../../dev/materials/src/shadowOnly/shadowOnly.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{shadowOnlyPixelShader:()=>o});var r="shadowOnlyPixelShader",n="precision highp float;uniform vec4 vEyePosition;uniform float alpha;uniform vec3 shadowColor;varying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0..1]\nvec4 color=vec4(shadowColor,(1.0-clamp(shadow,0.,1.))*alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/shadowOnly/shadowOnly.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{shadowOnlyVertexShader:()=>o});var r="shadowOnlyVertexShader",n="precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/shadowOnly/shadowOnlyMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{ShadowOnlyMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=(i("../../../dev/materials/src/shadowOnly/shadowOnly.fragment.ts"),i("../../../dev/materials/src/shadowOnly/shadowOnly.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.POINTSIZE=!1,t.FOG=!1,t.NORMAL=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.INSTANCES=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.LOGARITHMICDEPTH=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r._needAlphaBlending=!0,r.shadowColor=n.Color3.Black(),r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return this._needAlphaBlending},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},Object.defineProperty(t.prototype,"activeLight",{get:function(){return this._activeLight},set:function(e){this._activeLight=e},enumerable:!1,configurable:!0}),t.prototype._getFirstShadowLightForMesh=function(e){for(var t=0,i=e.lightSources;t<i.length;t++){var r=i[t];if(r.shadowEnabled)return r}return null},t.prototype.isReadyForSubMesh=function(e,t,i){var r,a=t._drawWrapper;if(this.isFrozen&&a.effect&&a._wasPreviouslyReady&&a._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new o);var s=t.materialDefines,l=this.getScene();if(this._isReadyForSubMesh(t))return!0;var c=l.getEngine();if(this._activeLight)for(var u=0,h=e.lightSources;u<h.length;u++){var d=h[u];if(d.shadowEnabled){if(this._activeLight===d)break;var _=e.lightSources.indexOf(this._activeLight);-1!==_&&(e.lightSources.splice(_,1),e.lightSources.splice(0,0,this._activeLight));break}}(0,n.PrepareDefinesForFrameBoundValues)(l,c,this,s,!!i),(0,n.PrepareDefinesForMisc)(e,l,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),s),s._needNormals=(0,n.PrepareDefinesForLights)(l,e,s,!1,1);var f=null===(r=this._getFirstShadowLightForMesh(e))||void 0===r?void 0:r.getShadowGenerator();if(this._needAlphaBlending=!0,f&&f.getClassName&&"CascadedShadowGenerator"===f.getClassName()){var p=f;this._needAlphaBlending=!p.autoCalcDepthBounds}if((0,n.PrepareDefinesForAttributes)(e,s,!1,!0),s.isDirty){s.markAsProcessed(),l.resetCachedMaterial();var m=new n.EffectFallbacks;s.FOG&&m.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(s,m,1),s.NUM_BONE_INFLUENCERS>0&&m.addCPUSkinningFallback(0,e),s.IMAGEPROCESSINGPOSTPROCESS=l.imageProcessingConfiguration.applyByPostProcess;var g=[n.VertexBuffer.PositionKind];s.NORMAL&&g.push(n.VertexBuffer.NormalKind),(0,n.PrepareAttributesForBones)(g,e,s,m),(0,n.PrepareAttributesForInstances)(g,s);var v=s.toString(),b=["world","view","viewProjection","vEyePosition","vLightsType","vFogInfos","vFogColor","pointSize","alpha","shadowColor","mBones","logarithmicDepthConstant"],y=[],x=[];(0,n.addClipPlaneUniforms)(b),(0,n.PrepareUniformsAndSamplersList)({uniformsNames:b,uniformBuffersNames:x,samplers:y,defines:s,maxSimultaneousLights:1}),t.setEffect(l.getEngine().createEffect("shadowOnly",{attributes:g,uniformsNames:b,uniformBuffersNames:x,samplers:y,defines:v,fallbacks:m,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:1}},c),s,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(s._renderId=l.getRenderId(),a._wasPreviouslyReady=!0,a._wasPreviouslyUsingInstances=!!i,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;if(a){if(this._activeEffect=a,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),(0,n.BindBonesParameters)(t,this._activeEffect),this._mustRebind(r,a,i)&&((0,n.bindClipPlane)(a,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._activeEffect.setFloat("alpha",this.alpha),this._activeEffect.setColor3("shadowColor",this.shadowColor),this._useLogarithmicDepth&&(0,n.BindLogDepth)(o,a,r),r.bindEyePosition(a)),r.lightsEnabled){(0,n.BindLights)(r,t,this._activeEffect,o,1);var s=this._getFirstShadowLightForMesh(t);s&&(s._renderId=-1)}(r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE||o.SHADOWCSM0)&&this._activeEffect.setMatrix("view",r.getViewMatrix()),(0,n.BindFogParameters)(r,t,this._activeEffect),this._afterBind(t,this._activeEffect,i)}}},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.ShadowOnlyMaterial",t},t.prototype.getClassName=function(){return"ShadowOnlyMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.ShadowOnlyMaterial",a)},"../../../dev/materials/src/simple/index.ts":(e,t,i)=>{i.r(t),i.d(t,{SimpleMaterial:()=>r.SimpleMaterial});var r=i("../../../dev/materials/src/simple/simpleMaterial.ts")},"../../../dev/materials/src/simple/simple.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{simplePixelShader:()=>o});var r="simplePixelShader",n="precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif \n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/simple/simple.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{simpleVertexShader:()=>o});var r="simpleVertexShader",n="precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/simple/simpleMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{SimpleMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=(i("../../../dev/materials/src/simple/simple.fragment.ts"),i("../../../dev/materials/src/simple/simple.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.DIFFUSE=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.POINTSIZE=!1,t.FOG=!1,t.NORMAL=!1,t.UV1=!1,t.UV2=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.INSTANCES=!1,t.INSTANCESCOLOR=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.LOGARITHMICDEPTH=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.diffuseColor=new n.Color3(1,1,1),r._disableLighting=!1,r._maxSimultaneousLights=4,r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return this.alpha<1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t,i){var r=t._drawWrapper;if(this.isFrozen&&r.effect&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new o);var a=t.materialDefines,s=this.getScene();if(this._isReadyForSubMesh(t))return!0;var l=s.getEngine();if(a._areTexturesDirty&&(a._needUVs=!1,s.texturesEnabled&&this._diffuseTexture&&n.MaterialFlags.DiffuseTextureEnabled)){if(!this._diffuseTexture.isReady())return!1;a._needUVs=!0,a.DIFFUSE=!0}if((0,n.PrepareDefinesForMisc)(e,s,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),a),a._needNormals=(0,n.PrepareDefinesForLights)(s,e,a,!1,this._maxSimultaneousLights,this._disableLighting),(0,n.PrepareDefinesForFrameBoundValues)(s,l,this,a,!!i),(0,n.PrepareDefinesForAttributes)(e,a,!0,!0),a.isDirty){a.markAsProcessed(),s.resetCachedMaterial();var c=new n.EffectFallbacks;a.FOG&&c.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(a,c,this.maxSimultaneousLights),a.NUM_BONE_INFLUENCERS>0&&c.addCPUSkinningFallback(0,e),a.IMAGEPROCESSINGPOSTPROCESS=s.imageProcessingConfiguration.applyByPostProcess;var u=[n.VertexBuffer.PositionKind];a.NORMAL&&u.push(n.VertexBuffer.NormalKind),a.UV1&&u.push(n.VertexBuffer.UVKind),a.UV2&&u.push(n.VertexBuffer.UV2Kind),a.VERTEXCOLOR&&u.push(n.VertexBuffer.ColorKind),(0,n.PrepareAttributesForBones)(u,e,a,c),(0,n.PrepareAttributesForInstances)(u,a);var h=a.toString(),d=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vFogInfos","vFogColor","pointSize","vDiffuseInfos","mBones","diffuseMatrix","logarithmicDepthConstant"],_=["diffuseSampler"],f=[];(0,n.addClipPlaneUniforms)(d),(0,n.PrepareUniformsAndSamplersList)({uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:a,maxSimultaneousLights:this.maxSimultaneousLights}),t.setEffect(s.getEngine().createEffect("simple",{attributes:u,uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:h,fallbacks:c,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights-1}},l),a,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(a._renderId=s.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;a&&(this._activeEffect=a,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),(0,n.BindBonesParameters)(t,this._activeEffect),this._mustRebind(r,a,i)&&(this._diffuseTexture&&n.MaterialFlags.DiffuseTextureEnabled&&(this._activeEffect.setTexture("diffuseSampler",this._diffuseTexture),this._activeEffect.setFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),this._activeEffect.setMatrix("diffuseMatrix",this._diffuseTexture.getTextureMatrix())),(0,n.bindClipPlane)(a,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,n.BindLogDepth)(o,a,r),r.bindEyePosition(a)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*t.visibility),r.lightsEnabled&&!this.disableLighting&&(0,n.BindLights)(r,t,this._activeEffect,o,this.maxSimultaneousLights),r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),(0,n.BindFogParameters)(r,t,this._activeEffect),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){var e=[];return this._diffuseTexture&&this._diffuseTexture.animations&&this._diffuseTexture.animations.length>0&&e.push(this._diffuseTexture),e},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._diffuseTexture&&t.push(this._diffuseTexture),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this.diffuseTexture===t},t.prototype.dispose=function(t){this._diffuseTexture&&this._diffuseTexture.dispose(),e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.SimpleMaterial",t},t.prototype.getClassName=function(){return"SimpleMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture")],t.prototype,"_diffuseTexture",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)("diffuse")],t.prototype,"diffuseColor",void 0),(0,r.__decorate)([(0,n.serialize)("disableLighting")],t.prototype,"_disableLighting",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),(0,r.__decorate)([(0,n.serialize)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.SimpleMaterial",a)},"../../../dev/materials/src/sky/index.ts":(e,t,i)=>{i.r(t),i.d(t,{SkyMaterial:()=>r.SkyMaterial});var r=i("../../../dev/materials/src/sky/skyMaterial.ts")},"../../../dev/materials/src/sky/sky.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{skyPixelShader:()=>o});var r="skyPixelShader",n="precision highp float;varying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneFragmentDeclaration>\nuniform vec3 cameraPosition;uniform vec3 cameraOffset;uniform vec3 up;uniform float luminance;uniform float turbidity;uniform float rayleigh;uniform float mieCoefficient;uniform float mieDirectionalG;uniform vec3 sunPosition;\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nconst float e=2.71828182845904523536028747135266249775724709369995957;const float pi=3.141592653589793238462643383279502884197169;const float n=1.0003;const float N=2.545E25;const float pn=0.035;const vec3 lambda=vec3(680E-9,550E-9,450E-9);const vec3 K=vec3(0.686,0.678,0.666);const float v=4.0;const float rayleighZenithLength=8.4E3;const float mieZenithLength=1.25E3;const float EE=1000.0;const float sunAngularDiameterCos=0.999956676946448443553574619906976478926848692873900859324;const float cutoffAngle=pi/1.95;const float steepness=1.5;vec3 totalRayleigh(vec3 lambda)\n{return (8.0*pow(pi,3.0)*pow(pow(n,2.0)-1.0,2.0)*(6.0+3.0*pn))/(3.0*N*pow(lambda,vec3(4.0))*(6.0-7.0*pn));}\nvec3 simplifiedRayleigh()\n{return 0.0005/vec3(94,40,18);}\nfloat rayleighPhase(float cosTheta)\n{ \nreturn (3.0/(16.0*pi))*(1.0+pow(cosTheta,2.0));}\nvec3 totalMie(vec3 lambda,vec3 K,float T)\n{float c=(0.2*T )*10E-18;return 0.434*c*pi*pow((2.0*pi)/lambda,vec3(v-2.0))*K;}\nfloat hgPhase(float cosTheta,float g)\n{return (1.0/(4.0*pi))*((1.0-pow(g,2.0))/pow(1.0-2.0*g*cosTheta+pow(g,2.0),1.5));}\nfloat sunIntensity(float zenithAngleCos)\n{return EE*max(0.0,1.0-exp((-(cutoffAngle-acos(zenithAngleCos))/steepness)));}\nfloat A=0.15;float B=0.50;float C=0.10;float D=0.20;float EEE=0.02;float F=0.30;float W=1000.0;vec3 Uncharted2Tonemap(vec3 x)\n{return ((x*(A*x+C*B)+D*EEE)/(x*(A*x+B)+D*F))-EEE/F;}\n#if DITHER\n#include<helperFunctions>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n/**\n*--------------------------------------------------------------------------------------------------\n* Sky Color\n*--------------------------------------------------------------------------------------------------\n*/\nfloat sunfade=1.0-clamp(1.0-exp((sunPosition.y/450000.0)),0.0,1.0);float rayleighCoefficient=rayleigh-(1.0*(1.0-sunfade));vec3 sunDirection=normalize(sunPosition);float sunE=sunIntensity(dot(sunDirection,up));vec3 betaR=simplifiedRayleigh()*rayleighCoefficient;vec3 betaM=totalMie(lambda,K,turbidity)*mieCoefficient;float zenithAngle=acos(max(0.0,dot(up,normalize(vPositionW-cameraPosition+cameraOffset))));float sR=rayleighZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));float sM=mieZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));vec3 Fex=exp(-(betaR*sR+betaM*sM));float cosTheta=dot(normalize(vPositionW-cameraPosition),sunDirection);float rPhase=rayleighPhase(cosTheta*0.5+0.5);vec3 betaRTheta=betaR*rPhase;float mPhase=hgPhase(cosTheta,mieDirectionalG);vec3 betaMTheta=betaM*mPhase;vec3 Lin=pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*(1.0-Fex),vec3(1.5));Lin*=mix(vec3(1.0),pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up,sunDirection),5.0),0.0,1.0));vec3 direction=normalize(vPositionW-cameraPosition);float theta=acos(direction.y);float phi=atan(direction.z,direction.x);vec2 uv=vec2(phi,theta)/vec2(2.0*pi,pi)+vec2(0.5,0.0);vec3 L0=vec3(0.1)*Fex;float sundisk=smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);L0+=(sunE*19000.0*Fex)*sundisk;vec3 whiteScale=1.0/Uncharted2Tonemap(vec3(W));vec3 texColor=(Lin+L0);texColor*=0.04 ;texColor+=vec3(0.0,0.001,0.0025)*0.3;float g_fMaxLuminance=1.0;float fLumScaled=0.1/luminance; \nfloat fLumCompressed=(fLumScaled*(1.0+(fLumScaled/(g_fMaxLuminance*g_fMaxLuminance))))/(1.0+fLumScaled); \nfloat ExposureBias=fLumCompressed;vec3 curr=Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);vec3 retColor=curr*whiteScale;/**\n*--------------------------------------------------------------------------------------------------\n* Sky Color\n*--------------------------------------------------------------------------------------------------\n*/\nfloat alpha=1.0;\n#ifdef VERTEXCOLOR\nretColor.rgb*=vColor.rgb;\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#if DITHER\nretColor.rgb+=dither(gl_FragCoord.xy,0.5);\n#endif\nvec4 color=clamp(vec4(retColor.rgb,alpha),0.0,1.0);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/sky/sky.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{skyVertexShader:()=>o});var r="skyVertexShader",n="precision highp float;attribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\nuniform mat4 world;uniform mat4 view;uniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\ngl_Position=viewProjection*world*vec4(position,1.0);vec4 worldPos=world*vec4(position,1.0);vPositionW=vec3(worldPos);\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/sky/skyMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{SkyMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=(i("../../../dev/materials/src/sky/sky.fragment.ts"),i("../../../dev/materials/src/sky/sky.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.POINTSIZE=!1,t.FOG=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.DITHER=!1,t.LOGARITHMICDEPTH=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.luminance=1,r.turbidity=10,r.rayleigh=2,r.mieCoefficient=.005,r.mieDirectionalG=.8,r.distance=500,r.inclination=.49,r.azimuth=.25,r.sunPosition=new n.Vector3(0,100,0),r.useSunPosition=!1,r.cameraOffset=n.Vector3.Zero(),r.up=n.Vector3.Up(),r.dithering=!1,r._cameraPosition=n.Vector3.Zero(),r._skyOrientation=new n.Quaternion,r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return this.alpha<1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t){var i=t._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;t.materialDefines||(t.materialDefines=new o);var r=t.materialDefines,a=this.getScene();if(this._isReadyForSubMesh(t))return!0;if((0,n.PrepareDefinesForMisc)(e,a,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,!1,r),(0,n.PrepareDefinesForAttributes)(e,r,!0,!1),r.IMAGEPROCESSINGPOSTPROCESS!==a.imageProcessingConfiguration.applyByPostProcess&&r.markAsMiscDirty(),r.DITHER!==this.dithering&&r.markAsMiscDirty(),r.isDirty){r.markAsProcessed(),a.resetCachedMaterial();var s=new n.EffectFallbacks;r.FOG&&s.addFallback(1,"FOG"),r.IMAGEPROCESSINGPOSTPROCESS=a.imageProcessingConfiguration.applyByPostProcess,r.DITHER=this.dithering;var l=[n.VertexBuffer.PositionKind];r.VERTEXCOLOR&&l.push(n.VertexBuffer.ColorKind);var c=["world","viewProjection","view","vFogInfos","vFogColor","logarithmicDepthConstant","pointSize","luminance","turbidity","rayleigh","mieCoefficient","mieDirectionalG","sunPosition","cameraPosition","cameraOffset","up"];(0,n.addClipPlaneUniforms)(c);var u=r.toString();t.setEffect(a.getEngine().createEffect("sky",l,c,[],u,s,this.onCompiled,this.onError),r,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(r._renderId=a.getRenderId(),i._wasPreviouslyReady=!0,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;if(a){this._activeEffect=a,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),this._mustRebind(r,a,i)&&((0,n.bindClipPlane)(a,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,n.BindLogDepth)(o,a,r)),r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),(0,n.BindFogParameters)(r,t,this._activeEffect);var s=r.activeCamera;if(s){var l=s.getWorldMatrix();this._cameraPosition.x=l.m[12],this._cameraPosition.y=l.m[13],this._cameraPosition.z=l.m[14],this._activeEffect.setVector3("cameraPosition",this._cameraPosition)}if(this._activeEffect.setVector3("cameraOffset",this.cameraOffset),this._activeEffect.setVector3("up",this.up),this.luminance>0&&this._activeEffect.setFloat("luminance",this.luminance),this._activeEffect.setFloat("turbidity",this.turbidity),this._activeEffect.setFloat("rayleigh",this.rayleigh),this._activeEffect.setFloat("mieCoefficient",this.mieCoefficient),this._activeEffect.setFloat("mieDirectionalG",this.mieDirectionalG),!this.useSunPosition){var c=Math.PI*(this.inclination-.5),u=2*Math.PI*(this.azimuth-.5);this.sunPosition.x=this.distance*Math.cos(u)*Math.cos(c),this.sunPosition.y=this.distance*Math.sin(-c),this.sunPosition.z=this.distance*Math.sin(u)*Math.cos(c),n.Quaternion.FromUnitVectorsToRef(n.Vector3.UpReadOnly,this.up,this._skyOrientation),this.sunPosition.rotateByQuaternionToRef(this._skyOrientation,this.sunPosition)}this._activeEffect.setVector3("sunPosition",this.sunPosition),this._afterBind(t,this._activeEffect,i)}}},t.prototype.getAnimatables=function(){return[]},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.SkyMaterial",t},t.prototype.getClassName=function(){return"SkyMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},(0,r.__decorate)([(0,n.serialize)()],t.prototype,"luminance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"turbidity",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"rayleigh",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"mieCoefficient",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"mieDirectionalG",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"distance",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"inclination",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"azimuth",void 0),(0,r.__decorate)([(0,n.serializeAsVector3)()],t.prototype,"sunPosition",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"useSunPosition",void 0),(0,r.__decorate)([(0,n.serializeAsVector3)()],t.prototype,"cameraOffset",void 0),(0,r.__decorate)([(0,n.serializeAsVector3)()],t.prototype,"up",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"dithering",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.SkyMaterial",a)},"../../../dev/materials/src/terrain/index.ts":(e,t,i)=>{i.r(t),i.d(t,{TerrainMaterial:()=>r.TerrainMaterial});var r=i("../../../dev/materials/src/terrain/terrainMaterial.ts")},"../../../dev/materials/src/terrain/terrain.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{terrainPixelShader:()=>o});var r="terrainPixelShader",n="precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform sampler2D textureSampler;uniform vec2 vTextureInfos;uniform sampler2D diffuse1Sampler;uniform sampler2D diffuse2Sampler;uniform sampler2D diffuse3Sampler;uniform vec2 diffuse1Infos;uniform vec2 diffuse2Infos;uniform vec2 diffuse3Infos;\n#endif\n#ifdef BUMP\nuniform sampler2D bump1Sampler;uniform sampler2D bump2Sampler;uniform sampler2D bump3Sampler;\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef BUMP\n#extension GL_OES_standard_derivatives : enable\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{vec3 dp1=dFdx(p);vec3 dp2=dFdy(p);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 binormal=dp2perp*duv1.y+dp1perp*duv2.y;float invmax=inversesqrt(max(dot(tangent,tangent),dot(binormal,binormal)));return mat3(tangent*invmax,binormal*invmax,normal);}\nvec3 perturbNormal(vec3 viewDir,vec3 mixColor)\n{vec3 bump1Color=texture2D(bump1Sampler,vTextureUV*diffuse1Infos).xyz;vec3 bump2Color=texture2D(bump2Sampler,vTextureUV*diffuse2Infos).xyz;vec3 bump3Color=texture2D(bump3Sampler,vTextureUV*diffuse3Infos).xyz;bump1Color.rgb*=mixColor.r;bump2Color.rgb=mix(bump1Color.rgb,bump2Color.rgb,mixColor.g);vec3 map=mix(bump2Color.rgb,bump3Color.rgb,mixColor.b);map=map*255./127.-128./127.;mat3 TBN=cotangent_frame(vNormalW*vTextureInfos.y,-viewDir,vTextureUV);return normalize(TBN*map);}\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\nfloat alpha=vDiffuseColor.a;\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(textureSampler,vTextureUV);\n#if defined(BUMP) && defined(DIFFUSE)\nnormalW=perturbNormal(viewDirectionW,baseColor.rgb);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vTextureInfos.y;vec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);vec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);vec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);diffuse1Color.rgb*=baseColor.r;diffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,baseColor.g);baseColor.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,baseColor.b);\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor*baseColor.rgb,0.0,1.0);vec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/terrain/terrain.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{terrainVertexShader:()=>o});var r="terrainVertexShader",n="precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform mat4 textureMatrix;uniform vec2 vTextureInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vTextureInfos.x==0.)\n{vTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));}\nelse\n{vTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/terrain/terrainMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{TerrainMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=(i("../../../dev/materials/src/terrain/terrain.fragment.ts"),i("../../../dev/materials/src/terrain/terrain.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.DIFFUSE=!1,t.BUMP=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.POINTSIZE=!1,t.FOG=!1,t.SPECULARTERM=!1,t.NORMAL=!1,t.UV1=!1,t.UV2=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.INSTANCES=!1,t.INSTANCESCOLOR=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.LOGARITHMICDEPTH=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.diffuseColor=new n.Color3(1,1,1),r.specularColor=new n.Color3(0,0,0),r.specularPower=64,r._disableLighting=!1,r._maxSimultaneousLights=4,r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return this.alpha<1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t,i){var r=t._drawWrapper;if(this.isFrozen&&r.effect&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new o);var a=t.materialDefines,s=this.getScene();if(this._isReadyForSubMesh(t))return!0;var l=s.getEngine();if(s.texturesEnabled){if(!this.mixTexture||!this.mixTexture.isReady())return!1;if(a._needUVs=!0,n.MaterialFlags.DiffuseTextureEnabled){if(!this.diffuseTexture1||!this.diffuseTexture1.isReady())return!1;if(!this.diffuseTexture2||!this.diffuseTexture2.isReady())return!1;if(!this.diffuseTexture3||!this.diffuseTexture3.isReady())return!1;a.DIFFUSE=!0}if(this.bumpTexture1&&this.bumpTexture2&&this.bumpTexture3&&n.MaterialFlags.BumpTextureEnabled){if(!this.bumpTexture1.isReady())return!1;if(!this.bumpTexture2.isReady())return!1;if(!this.bumpTexture3.isReady())return!1;a._needNormals=!0,a.BUMP=!0}}if((0,n.PrepareDefinesForMisc)(e,s,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),a),a._needNormals=(0,n.PrepareDefinesForLights)(s,e,a,!1,this._maxSimultaneousLights,this._disableLighting),(0,n.PrepareDefinesForFrameBoundValues)(s,l,this,a,!!i),(0,n.PrepareDefinesForAttributes)(e,a,!0,!0),a.isDirty){a.markAsProcessed(),s.resetCachedMaterial();var c=new n.EffectFallbacks;a.FOG&&c.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(a,c,this.maxSimultaneousLights),a.NUM_BONE_INFLUENCERS>0&&c.addCPUSkinningFallback(0,e),a.IMAGEPROCESSINGPOSTPROCESS=s.imageProcessingConfiguration.applyByPostProcess;var u=[n.VertexBuffer.PositionKind];a.NORMAL&&u.push(n.VertexBuffer.NormalKind),a.UV1&&u.push(n.VertexBuffer.UVKind),a.UV2&&u.push(n.VertexBuffer.UV2Kind),a.VERTEXCOLOR&&u.push(n.VertexBuffer.ColorKind),(0,n.PrepareAttributesForBones)(u,e,a,c),(0,n.PrepareAttributesForInstances)(u,a);var h=a.toString(),d=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vSpecularColor","vFogInfos","vFogColor","pointSize","vTextureInfos","mBones","textureMatrix","diffuse1Infos","diffuse2Infos","diffuse3Infos"],_=["textureSampler","diffuse1Sampler","diffuse2Sampler","diffuse3Sampler","bump1Sampler","bump2Sampler","bump3Sampler","logarithmicDepthConstant"],f=[];(0,n.addClipPlaneUniforms)(d),(0,n.PrepareUniformsAndSamplersList)({uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:a,maxSimultaneousLights:this.maxSimultaneousLights}),t.setEffect(s.getEngine().createEffect("terrain",{attributes:u,uniformsNames:d,uniformBuffersNames:f,samplers:_,defines:h,fallbacks:c,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this.maxSimultaneousLights}},l),a,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(a._renderId=s.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;a&&(this._activeEffect=a,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),(0,n.BindBonesParameters)(t,this._activeEffect),this._mustRebind(r,a,i)&&(this.mixTexture&&(this._activeEffect.setTexture("textureSampler",this._mixTexture),this._activeEffect.setFloat2("vTextureInfos",this._mixTexture.coordinatesIndex,this._mixTexture.level),this._activeEffect.setMatrix("textureMatrix",this._mixTexture.getTextureMatrix()),n.MaterialFlags.DiffuseTextureEnabled&&(this._diffuseTexture1&&(this._activeEffect.setTexture("diffuse1Sampler",this._diffuseTexture1),this._activeEffect.setFloat2("diffuse1Infos",this._diffuseTexture1.uScale,this._diffuseTexture1.vScale)),this._diffuseTexture2&&(this._activeEffect.setTexture("diffuse2Sampler",this._diffuseTexture2),this._activeEffect.setFloat2("diffuse2Infos",this._diffuseTexture2.uScale,this._diffuseTexture2.vScale)),this._diffuseTexture3&&(this._activeEffect.setTexture("diffuse3Sampler",this._diffuseTexture3),this._activeEffect.setFloat2("diffuse3Infos",this._diffuseTexture3.uScale,this._diffuseTexture3.vScale))),n.MaterialFlags.BumpTextureEnabled&&r.getEngine().getCaps().standardDerivatives&&(this._bumpTexture1&&this._activeEffect.setTexture("bump1Sampler",this._bumpTexture1),this._bumpTexture2&&this._activeEffect.setTexture("bump2Sampler",this._bumpTexture2),this._bumpTexture3&&this._activeEffect.setTexture("bump3Sampler",this._bumpTexture3))),(0,n.bindClipPlane)(a,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,n.BindLogDepth)(o,a,r),r.bindEyePosition(a)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*t.visibility),o.SPECULARTERM&&this._activeEffect.setColor4("vSpecularColor",this.specularColor,this.specularPower),r.lightsEnabled&&!this.disableLighting&&(0,n.BindLights)(r,t,this._activeEffect,o,this.maxSimultaneousLights),r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),(0,n.BindFogParameters)(r,t,this._activeEffect),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){var e=[];return this.mixTexture&&this.mixTexture.animations&&this.mixTexture.animations.length>0&&e.push(this.mixTexture),e},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._mixTexture&&t.push(this._mixTexture),this._diffuseTexture1&&t.push(this._diffuseTexture1),this._diffuseTexture2&&t.push(this._diffuseTexture2),this._diffuseTexture3&&t.push(this._diffuseTexture3),this._bumpTexture1&&t.push(this._bumpTexture1),this._bumpTexture2&&t.push(this._bumpTexture2),this._bumpTexture3&&t.push(this._bumpTexture3),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this._mixTexture===t||this._diffuseTexture1===t||this._diffuseTexture2===t||this._diffuseTexture3===t||this._bumpTexture1===t||this._bumpTexture2===t||this._bumpTexture3===t},t.prototype.dispose=function(t){this.mixTexture&&this.mixTexture.dispose(),e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.TerrainMaterial",t},t.prototype.getClassName=function(){return"TerrainMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},(0,r.__decorate)([(0,n.serializeAsTexture)("mixTexture")],t.prototype,"_mixTexture",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"mixTexture",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture1")],t.prototype,"_diffuseTexture1",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture1",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture2")],t.prototype,"_diffuseTexture2",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture2",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexture3")],t.prototype,"_diffuseTexture3",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture3",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("bumpTexture1")],t.prototype,"_bumpTexture1",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture1",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("bumpTexture2")],t.prototype,"_bumpTexture2",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture2",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("bumpTexture3")],t.prototype,"_bumpTexture3",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture3",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"diffuseColor",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"specularColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"specularPower",void 0),(0,r.__decorate)([(0,n.serialize)("disableLighting")],t.prototype,"_disableLighting",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),(0,r.__decorate)([(0,n.serialize)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.TerrainMaterial",a)},"../../../dev/materials/src/triPlanar/index.ts":(e,t,i)=>{i.r(t),i.d(t,{TriPlanarMaterial:()=>r.TriPlanarMaterial});var r=i("../../../dev/materials/src/triPlanar/triPlanarMaterial.ts")},"../../../dev/materials/src/triPlanar/triPlanarMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{TriPlanarMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=(i("../../../dev/materials/src/triPlanar/triplanar.fragment.ts"),i("../../../dev/materials/src/triPlanar/triplanar.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.DIFFUSEX=!1,t.DIFFUSEY=!1,t.DIFFUSEZ=!1,t.BUMPX=!1,t.BUMPY=!1,t.BUMPZ=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.POINTSIZE=!1,t.FOG=!1,t.SPECULARTERM=!1,t.NORMAL=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.INSTANCES=!1,t.INSTANCESCOLOR=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.NONUNIFORMSCALING=!1,t.LOGARITHMICDEPTH=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.tileSize=1,r.diffuseColor=new n.Color3(1,1,1),r.specularColor=new n.Color3(.2,.2,.2),r.specularPower=64,r._disableLighting=!1,r._maxSimultaneousLights=4,r}return(0,r.__extends)(t,e),t.prototype.needAlphaBlending=function(){return this.alpha<1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t,i){var r=t._drawWrapper;if(this.isFrozen&&r.effect&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new o);var a=t.materialDefines,s=this.getScene();if(this._isReadyForSubMesh(t))return!0;var l=s.getEngine();if(a._areTexturesDirty&&s.texturesEnabled){if(n.MaterialFlags.DiffuseTextureEnabled)for(var c=[this.diffuseTextureX,this.diffuseTextureY,this.diffuseTextureZ],u=["DIFFUSEX","DIFFUSEY","DIFFUSEZ"],h=0;h<c.length;h++)if(c[h]){if(!c[h].isReady())return!1;a[u[h]]=!0}if(n.MaterialFlags.BumpTextureEnabled)for(c=[this.normalTextureX,this.normalTextureY,this.normalTextureZ],u=["BUMPX","BUMPY","BUMPZ"],h=0;h<c.length;h++)if(c[h]){if(!c[h].isReady())return!1;a[u[h]]=!0}}if((0,n.PrepareDefinesForMisc)(e,s,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),a),a._needNormals=(0,n.PrepareDefinesForLights)(s,e,a,!1,this._maxSimultaneousLights,this._disableLighting),(0,n.PrepareDefinesForFrameBoundValues)(s,l,this,a,!!i),(0,n.PrepareDefinesForAttributes)(e,a,!0,!0),a.isDirty){a.markAsProcessed(),s.resetCachedMaterial();var d=new n.EffectFallbacks;a.FOG&&d.addFallback(1,"FOG"),(0,n.HandleFallbacksForShadows)(a,d,this.maxSimultaneousLights),a.NUM_BONE_INFLUENCERS>0&&d.addCPUSkinningFallback(0,e),a.IMAGEPROCESSINGPOSTPROCESS=s.imageProcessingConfiguration.applyByPostProcess;var _=[n.VertexBuffer.PositionKind];a.NORMAL&&_.push(n.VertexBuffer.NormalKind),a.VERTEXCOLOR&&_.push(n.VertexBuffer.ColorKind),(0,n.PrepareAttributesForBones)(_,e,a,d),(0,n.PrepareAttributesForInstances)(_,a);var f=a.toString(),p=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vSpecularColor","vFogInfos","vFogColor","pointSize","mBones","tileSize"],m=["diffuseSamplerX","diffuseSamplerY","diffuseSamplerZ","normalSamplerX","normalSamplerY","normalSamplerZ","logarithmicDepthConstant"],g=[];(0,n.addClipPlaneUniforms)(p),(0,n.PrepareUniformsAndSamplersList)({uniformsNames:p,uniformBuffersNames:g,samplers:m,defines:a,maxSimultaneousLights:this.maxSimultaneousLights}),t.setEffect(s.getEngine().createEffect("triplanar",{attributes:_,uniformsNames:p,uniformBuffersNames:g,samplers:m,defines:f,fallbacks:d,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this.maxSimultaneousLights}},l),a,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(a._renderId=s.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;a&&(this._activeEffect=a,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),(0,n.BindBonesParameters)(t,this._activeEffect),this._activeEffect.setFloat("tileSize",this.tileSize),this._mustRebind(r,a,i)&&(this.diffuseTextureX&&this._activeEffect.setTexture("diffuseSamplerX",this.diffuseTextureX),this.diffuseTextureY&&this._activeEffect.setTexture("diffuseSamplerY",this.diffuseTextureY),this.diffuseTextureZ&&this._activeEffect.setTexture("diffuseSamplerZ",this.diffuseTextureZ),this.normalTextureX&&this._activeEffect.setTexture("normalSamplerX",this.normalTextureX),this.normalTextureY&&this._activeEffect.setTexture("normalSamplerY",this.normalTextureY),this.normalTextureZ&&this._activeEffect.setTexture("normalSamplerZ",this.normalTextureZ),(0,n.bindClipPlane)(a,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,n.BindLogDepth)(o,a,r),r.bindEyePosition(a)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*t.visibility),o.SPECULARTERM&&this._activeEffect.setColor4("vSpecularColor",this.specularColor,this.specularPower),r.lightsEnabled&&!this.disableLighting&&(0,n.BindLights)(r,t,this._activeEffect,o,this.maxSimultaneousLights),r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),(0,n.BindFogParameters)(r,t,this._activeEffect),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){var e=[];return this.mixTexture&&this.mixTexture.animations&&this.mixTexture.animations.length>0&&e.push(this.mixTexture),e},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._diffuseTextureX&&t.push(this._diffuseTextureX),this._diffuseTextureY&&t.push(this._diffuseTextureY),this._diffuseTextureZ&&t.push(this._diffuseTextureZ),this._normalTextureX&&t.push(this._normalTextureX),this._normalTextureY&&t.push(this._normalTextureY),this._normalTextureZ&&t.push(this._normalTextureZ),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this._diffuseTextureX===t||this._diffuseTextureY===t||this._diffuseTextureZ===t||this._normalTextureX===t||this._normalTextureY===t||this._normalTextureZ===t},t.prototype.dispose=function(t){this.mixTexture&&this.mixTexture.dispose(),e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.TriPlanarMaterial",t},t.prototype.getClassName=function(){return"TriPlanarMaterial"},t.Parse=function(e,i,r){return n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r)},(0,r.__decorate)([(0,n.serializeAsTexture)()],t.prototype,"mixTexture",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTextureX")],t.prototype,"_diffuseTextureX",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTextureX",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTexturY")],t.prototype,"_diffuseTextureY",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTextureY",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("diffuseTextureZ")],t.prototype,"_diffuseTextureZ",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTextureZ",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("normalTextureX")],t.prototype,"_normalTextureX",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"normalTextureX",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("normalTextureY")],t.prototype,"_normalTextureY",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"normalTextureY",void 0),(0,r.__decorate)([(0,n.serializeAsTexture)("normalTextureZ")],t.prototype,"_normalTextureZ",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"normalTextureZ",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"tileSize",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"diffuseColor",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"specularColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"specularPower",void 0),(0,r.__decorate)([(0,n.serialize)("disableLighting")],t.prototype,"_disableLighting",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),(0,r.__decorate)([(0,n.serialize)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.TriPlanarMaterial",a)},"../../../dev/materials/src/triPlanar/triplanar.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{triplanarPixelShader:()=>o});var r="triplanarPixelShader",n="precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSEX\nvarying vec2 vTextureUVX;uniform sampler2D diffuseSamplerX;\n#ifdef BUMPX\nuniform sampler2D normalSamplerX;\n#endif\n#endif\n#ifdef DIFFUSEY\nvarying vec2 vTextureUVY;uniform sampler2D diffuseSamplerY;\n#ifdef BUMPY\nuniform sampler2D normalSamplerY;\n#endif\n#endif\n#ifdef DIFFUSEZ\nvarying vec2 vTextureUVZ;uniform sampler2D diffuseSamplerZ;\n#ifdef BUMPZ\nuniform sampler2D normalSamplerZ;\n#endif\n#endif\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(0.,0.,0.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef NORMAL\nvec3 normalW=tangentSpace[2];\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nvec4 baseNormal=vec4(0.0,0.0,0.0,1.0);normalW*=normalW;\n#ifdef DIFFUSEX\nbaseColor+=texture2D(diffuseSamplerX,vTextureUVX)*normalW.x;\n#ifdef BUMPX\nbaseNormal+=texture2D(normalSamplerX,vTextureUVX)*normalW.x;\n#endif\n#endif\n#ifdef DIFFUSEY\nbaseColor+=texture2D(diffuseSamplerY,vTextureUVY)*normalW.y;\n#ifdef BUMPY\nbaseNormal+=texture2D(normalSamplerY,vTextureUVY)*normalW.y;\n#endif\n#endif\n#ifdef DIFFUSEZ\nbaseColor+=texture2D(diffuseSamplerZ,vTextureUVZ)*normalW.z;\n#ifdef BUMPZ\nbaseNormal+=texture2D(normalSamplerZ,vTextureUVZ)*normalW.z;\n#endif\n#endif\n#ifdef NORMAL\nnormalW=normalize((2.0*baseNormal.xyz-1.0)*tangentSpace);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/triPlanar/triplanar.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{triplanarVertexShader:()=>o});var r="triplanarVertexShader",n="precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSEX\nvarying vec2 vTextureUVX;\n#endif\n#ifdef DIFFUSEY\nvarying vec2 vTextureUVY;\n#endif\n#ifdef DIFFUSEZ\nvarying vec2 vTextureUVZ;\n#endif\nuniform float tileSize;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void)\n{\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef DIFFUSEX\nvTextureUVX=worldPos.zy/tileSize;\n#endif\n#ifdef DIFFUSEY\nvTextureUVY=worldPos.xz/tileSize;\n#endif\n#ifdef DIFFUSEZ\nvTextureUVZ=worldPos.xy/tileSize;\n#endif\n#ifdef NORMAL\nvec3 xtan=vec3(0,0,1);vec3 xbin=vec3(0,1,0);vec3 ytan=vec3(1,0,0);vec3 ybin=vec3(0,0,1);vec3 ztan=vec3(1,0,0);vec3 zbin=vec3(0,1,0);vec3 normalizedNormal=normalize(normal);normalizedNormal*=normalizedNormal;vec3 worldBinormal=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);vec3 worldTangent=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);mat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nworldTangent=normalize((normalWorld*worldTangent).xyz);worldBinormal=normalize((normalWorld*worldBinormal).xyz);vec3 worldNormal=normalize((normalWorld*normalize(normal)).xyz);tangentSpace[0]=worldTangent;tangentSpace[1]=worldBinormal;tangentSpace[2]=worldNormal;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/water/index.ts":(e,t,i)=>{i.r(t),i.d(t,{WaterMaterial:()=>r.WaterMaterial});var r=i("../../../dev/materials/src/water/waterMaterial.ts")},"../../../dev/materials/src/water/water.fragment.ts":(e,t,i)=>{i.r(t),i.d(t,{waterPixelShader:()=>o});var r="waterPixelShader",n="#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nprecision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef BUMP\nvarying vec2 vNormalUV;\n#ifdef BUMPSUPERIMPOSE\nvarying vec2 vNormalUV2;\n#endif\nuniform sampler2D normalSampler;uniform vec2 vNormalInfos;\n#endif\nuniform sampler2D refractionSampler;uniform sampler2D reflectionSampler;const float LOG2=1.442695;uniform vec3 cameraPosition;uniform vec4 waterColor;uniform float colorBlendFactor;uniform vec4 waterColor2;uniform float colorBlendFactor2;uniform float bumpHeight;uniform float time;varying vec3 vRefractionMapTexCoord;varying vec3 vReflectionMapTexCoord;\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef BUMP\n#ifdef BUMPSUPERIMPOSE\nbaseColor=0.6*texture2D(normalSampler,vNormalUV)+0.4*texture2D(normalSampler,vec2(vNormalUV2.x,vNormalUV2.y));\n#else\nbaseColor=texture2D(normalSampler,vNormalUV);\n#endif\nvec3 bumpColor=baseColor.rgb;\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\nbaseColor.rgb*=vNormalInfos.y;\n#else\nvec3 bumpColor=vec3(1.0);\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec2 perturbation=bumpHeight*(baseColor.rg-0.5);\n#ifdef BUMPAFFECTSREFLECTION\nvec3 normalW=normalize(vNormalW+vec3(perturbation.x*8.0,0.0,perturbation.y*8.0));if (normalW.y<0.0) {normalW.y=-normalW.y;}\n#else\nvec3 normalW=normalize(vNormalW);\n#endif\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);vec2 perturbation=bumpHeight*(vec2(1.0,1.0)-0.5);\n#endif\n#ifdef FRESNELSEPARATE\n#ifdef REFLECTION\nvec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation*0.5,0.0,1.0);vec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor.rgb=toGammaSpace(refractiveColor.rgb);\n#endif\nvec2 projectedReflectionTexCoords=clamp(vec2(\nvReflectionMapTexCoord.x/vReflectionMapTexCoord.z+perturbation.x*0.3,\nvReflectionMapTexCoord.y/vReflectionMapTexCoord.z+perturbation.y\n),0.0,1.0);vec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb);\n#endif\nvec3 upVector=vec3(0.0,1.0,0.0);float fresnelTerm=clamp(abs(pow(dot(viewDirectionW,upVector),3.0)),0.05,0.65);float IfresnelTerm=1.0-fresnelTerm;refractiveColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*refractiveColor;reflectiveColor=IfresnelTerm*colorBlendFactor2*waterColor+(1.0-colorBlendFactor2*IfresnelTerm)*reflectiveColor;vec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*IfresnelTerm;baseColor=combinedColor;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\nvec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0);\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#else \n#ifdef REFLECTION\nvec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation,0.0,1.0);vec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor.rgb=toGammaSpace(refractiveColor.rgb);\n#endif\nvec2 projectedReflectionTexCoords=clamp(vReflectionMapTexCoord.xy/vReflectionMapTexCoord.z+perturbation,0.0,1.0);vec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb);\n#endif\nvec3 upVector=vec3(0.0,1.0,0.0);float fresnelTerm=max(dot(viewDirectionW,upVector),0.0);vec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*(1.0-fresnelTerm);baseColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*combinedColor;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\nvec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0);\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#endif\nvec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\n#elif defined(IMAGEPROCESSING)\ncolor.rgb=toLinearSpace(color.rgb);color=applyImageProcessing(color);\n#endif\ngl_FragColor=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/water/water.vertex.ts":(e,t,i)=>{i.r(t),i.d(t,{waterVertexShader:()=>o});var r="waterVertexShader",n="precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef BUMP\nvarying vec2 vNormalUV;\n#ifdef BUMPSUPERIMPOSE\nvarying vec2 vNormalUV2;\n#endif\nuniform mat4 normalMatrix;uniform vec2 vNormalInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<logDepthDeclaration>\nuniform mat4 reflectionViewProjection;uniform vec2 windDirection;uniform float waveLength;uniform float time;uniform float windForce;uniform float waveHeight;uniform float waveSpeed;uniform float waveCount;varying vec3 vRefractionMapTexCoord;varying vec3 vReflectionMapTexCoord;\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef BUMP\nif (vNormalInfos.x==0.)\n{vNormalUV=vec2(normalMatrix*vec4((uv*1.0)/waveLength+time*windForce*windDirection,1.0,0.0));\n#ifdef BUMPSUPERIMPOSE\nvNormalUV2=vec2(normalMatrix*vec4((uv*0.721)/waveLength+time*1.2*windForce*windDirection,1.0,0.0));\n#endif\n}\nelse\n{vNormalUV=vec2(normalMatrix*vec4((uv2*1.0)/waveLength+time*windForce*windDirection ,1.0,0.0));\n#ifdef BUMPSUPERIMPOSE\nvNormalUV2=vec2(normalMatrix*vec4((uv2*0.721)/waveLength+time*1.2*windForce*windDirection ,1.0,0.0));\n#endif\n}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\nfloat finalWaveCount=1.0/(waveCount*0.5);\n#ifdef USE_WORLD_COORDINATES\nvec3 p=worldPos.xyz;\n#else\nvec3 p=position;\n#endif\nfloat newY=(sin(((p.x/finalWaveCount)+time*waveSpeed))*waveHeight*windDirection.x*5.0)\n+ (cos(((p.z/finalWaveCount)+ time*waveSpeed))*waveHeight*windDirection.y*5.0);p.y+=abs(newY);\n#ifdef USE_WORLD_COORDINATES\ngl_Position=viewProjection*vec4(p,1.0);\n#else\ngl_Position=viewProjection*finalWorld*vec4(p,1.0);\n#endif\n#ifdef REFLECTION\nvRefractionMapTexCoord.x=0.5*(gl_Position.w+gl_Position.x);vRefractionMapTexCoord.y=0.5*(gl_Position.w+gl_Position.y);vRefractionMapTexCoord.z=gl_Position.w;worldPos=reflectionViewProjection*finalWorld*vec4(position,1.0);vReflectionMapTexCoord.x=0.5*(worldPos.w+worldPos.x);vReflectionMapTexCoord.y=0.5*(worldPos.w+worldPos.y);vReflectionMapTexCoord.z=worldPos.w;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";i("babylonjs/Materials/effect").ShaderStore.ShadersStore[r]=n;var o={name:r,shader:n}},"../../../dev/materials/src/water/waterMaterial.ts":(e,t,i)=>{i.r(t),i.d(t,{WaterMaterial:()=>a});var r=i("../../../../node_modules/tslib/tslib.es6.mjs"),n=i("babylonjs/Materials/effect"),o=(i("../../../dev/materials/src/water/water.fragment.ts"),i("../../../dev/materials/src/water/water.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.BUMP=!1,t.REFLECTION=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.POINTSIZE=!1,t.FOG=!1,t.NORMAL=!1,t.UV1=!1,t.UV2=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.INSTANCES=!1,t.INSTANCESCOLOR=!1,t.SPECULARTERM=!1,t.LOGARITHMICDEPTH=!1,t.USE_REVERSE_DEPTHBUFFER=!1,t.FRESNELSEPARATE=!1,t.BUMPSUPERIMPOSE=!1,t.BUMPAFFECTSREFLECTION=!1,t.USE_WORLD_COORDINATES=!1,t.IMAGEPROCESSING=!1,t.VIGNETTE=!1,t.VIGNETTEBLENDMODEMULTIPLY=!1,t.VIGNETTEBLENDMODEOPAQUE=!1,t.TONEMAPPING=0,t.CONTRAST=!1,t.EXPOSURE=!1,t.COLORCURVES=!1,t.COLORGRADING=!1,t.COLORGRADING3D=!1,t.SAMPLER3DGREENDEPTH=!1,t.SAMPLER3DBGRMAP=!1,t.DITHER=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.rebuild(),t}return(0,r.__extends)(t,e),t}(n.MaterialDefines)),a=function(e){function t(t,i,r){void 0===r&&(r=new n.Vector2(512,512));var o=e.call(this,t,i)||this;return o.renderTargetSize=r,o.diffuseColor=new n.Color3(1,1,1),o.specularColor=new n.Color3(0,0,0),o.specularPower=64,o._disableLighting=!1,o._maxSimultaneousLights=4,o.windForce=6,o.windDirection=new n.Vector2(0,1),o.waveHeight=.4,o.bumpHeight=.4,o._bumpSuperimpose=!1,o._fresnelSeparate=!1,o._bumpAffectsReflection=!1,o.waterColor=new n.Color3(.1,.1,.6),o.colorBlendFactor=.2,o.waterColor2=new n.Color3(.1,.1,.6),o.colorBlendFactor2=.2,o.waveLength=.1,o.waveSpeed=1,o.waveCount=20,o.disableClipPlane=!1,o._useWorldCoordinatesForWaveDeformation=!1,o._renderTargets=new n.SmartArray(16),o._mesh=null,o._reflectionTransform=n.Matrix.Zero(),o._lastTime=0,o._lastDeltaTime=0,o._createRenderTargets(o.getScene(),r),o.getRenderTargetTextures=function(){return o._renderTargets.reset(),o._renderTargets.push(o._reflectionRTT),o._renderTargets.push(o._refractionRTT),o._renderTargets},o._imageProcessingConfiguration=o.getScene().imageProcessingConfiguration,o._imageProcessingConfiguration&&(o._imageProcessingObserver=o._imageProcessingConfiguration.onUpdateParameters.add((function(){o._markAllSubMeshesAsImageProcessingDirty()}))),o}return(0,r.__extends)(t,e),Object.defineProperty(t.prototype,"hasRenderTargetTextures",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refractionTexture",{get:function(){return this._refractionRTT},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflectionTexture",{get:function(){return this._reflectionRTT},enumerable:!1,configurable:!0}),t.prototype.addToRenderList=function(e){this._refractionRTT&&this._refractionRTT.renderList&&this._refractionRTT.renderList.push(e),this._reflectionRTT&&this._reflectionRTT.renderList&&this._reflectionRTT.renderList.push(e)},t.prototype.removeFromRenderList=function(e){var t;this._refractionRTT&&this._refractionRTT.renderList&&-1!==(t=this._refractionRTT.renderList.indexOf(e))&&this._refractionRTT.renderList.splice(t,1),this._reflectionRTT&&this._reflectionRTT.renderList&&-1!==(t=this._reflectionRTT.renderList.indexOf(e))&&this._reflectionRTT.renderList.splice(t,1)},t.prototype.enableRenderTargets=function(e){var t=e?1:0;this._refractionRTT&&(this._refractionRTT.refreshRate=t),this._reflectionRTT&&(this._reflectionRTT.refreshRate=t)},t.prototype.getRenderList=function(){return this._refractionRTT?this._refractionRTT.renderList:[]},Object.defineProperty(t.prototype,"renderTargetsEnabled",{get:function(){return!(this._refractionRTT&&0===this._refractionRTT.refreshRate)},enumerable:!1,configurable:!0}),t.prototype.needAlphaBlending=function(){return this.alpha<1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t,i){var r=t._drawWrapper;if(this.isFrozen&&r.effect&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new o);var a=t.materialDefines,s=this.getScene();if(this._isReadyForSubMesh(t))return!0;var l=s.getEngine();if(a._areTexturesDirty&&(a._needUVs=!1,s.texturesEnabled)){if(this.bumpTexture&&n.MaterialFlags.BumpTextureEnabled){if(!this.bumpTexture.isReady())return!1;a._needUVs=!0,a.BUMP=!0}n.MaterialFlags.ReflectionTextureEnabled&&(a.REFLECTION=!0)}if((0,n.PrepareDefinesForFrameBoundValues)(s,l,this,a,!!i),(0,n.PrepareDefinesForMisc)(e,s,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),a),a._areMiscDirty&&(a.FRESNELSEPARATE=this._fresnelSeparate,a.BUMPSUPERIMPOSE=this._bumpSuperimpose,a.BUMPAFFECTSREFLECTION=this._bumpAffectsReflection,a.USE_WORLD_COORDINATES=this._useWorldCoordinatesForWaveDeformation),a._needNormals=(0,n.PrepareDefinesForLights)(s,e,a,!0,this._maxSimultaneousLights,this._disableLighting),a._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(a),a.IS_REFLECTION_LINEAR=null!=this.reflectionTexture&&!this.reflectionTexture.gammaSpace,a.IS_REFRACTION_LINEAR=null!=this.refractionTexture&&!this.refractionTexture.gammaSpace}if((0,n.PrepareDefinesForAttributes)(e,a,!0,!0),this._mesh=e,this._waitingRenderList){for(var c=0;c<this._waitingRenderList.length;c++)this.addToRenderList(s.getNodeById(this._waitingRenderList[c]));this._waitingRenderList=null}if(a.isDirty){a.markAsProcessed(),s.resetCachedMaterial();var u=new n.EffectFallbacks;a.FOG&&u.addFallback(1,"FOG"),a.LOGARITHMICDEPTH&&u.addFallback(0,"LOGARITHMICDEPTH"),(0,n.HandleFallbacksForShadows)(a,u,this.maxSimultaneousLights),a.NUM_BONE_INFLUENCERS>0&&u.addCPUSkinningFallback(0,e);var h=[n.VertexBuffer.PositionKind];a.NORMAL&&h.push(n.VertexBuffer.NormalKind),a.UV1&&h.push(n.VertexBuffer.UVKind),a.UV2&&h.push(n.VertexBuffer.UV2Kind),a.VERTEXCOLOR&&h.push(n.VertexBuffer.ColorKind),(0,n.PrepareAttributesForBones)(h,e,a,u),(0,n.PrepareAttributesForInstances)(h,a);var d=a.toString(),_=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vSpecularColor","vFogInfos","vFogColor","pointSize","vNormalInfos","mBones","normalMatrix","logarithmicDepthConstant","reflectionViewProjection","windDirection","waveLength","time","windForce","cameraPosition","bumpHeight","waveHeight","waterColor","waterColor2","colorBlendFactor","colorBlendFactor2","waveSpeed","waveCount"],f=["normalSampler","refractionSampler","reflectionSampler"],p=[];n.ImageProcessingConfiguration&&(n.ImageProcessingConfiguration.PrepareUniforms(_,a),n.ImageProcessingConfiguration.PrepareSamplers(f,a)),(0,n.addClipPlaneUniforms)(_),(0,n.PrepareUniformsAndSamplersList)({uniformsNames:_,uniformBuffersNames:p,samplers:f,defines:a,maxSimultaneousLights:this.maxSimultaneousLights}),t.setEffect(s.getEngine().createEffect("water",{attributes:h,uniformsNames:_,uniformBuffersNames:p,samplers:f,defines:d,fallbacks:u,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights}},l),a,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(a._renderId=s.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),o=i.materialDefines;if(o){var a=i.effect;if(a&&this._mesh){this._activeEffect=a,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),(0,n.BindBonesParameters)(t,this._activeEffect),this._mustRebind(r,a,i)&&(this.bumpTexture&&n.MaterialFlags.BumpTextureEnabled&&(this._activeEffect.setTexture("normalSampler",this.bumpTexture),this._activeEffect.setFloat2("vNormalInfos",this.bumpTexture.coordinatesIndex,this.bumpTexture.level),this._activeEffect.setMatrix("normalMatrix",this.bumpTexture.getTextureMatrix())),(0,n.bindClipPlane)(a,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,n.BindLogDepth)(o,a,r),r.bindEyePosition(a)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*t.visibility),o.SPECULARTERM&&this._activeEffect.setColor4("vSpecularColor",this.specularColor,this.specularPower),r.lightsEnabled&&!this.disableLighting&&(0,n.BindLights)(r,t,this._activeEffect,o,this.maxSimultaneousLights),r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),(0,n.BindFogParameters)(r,t,this._activeEffect),(0,n.BindLogDepth)(o,this._activeEffect,r),n.MaterialFlags.ReflectionTextureEnabled&&(this._activeEffect.setTexture("refractionSampler",this._refractionRTT),this._activeEffect.setTexture("reflectionSampler",this._reflectionRTT));var s=this._reflectionTransform.multiply(r.getProjectionMatrix()),l=r.getEngine().getDeltaTime();l!==this._lastDeltaTime&&(this._lastDeltaTime=l,this._lastTime+=this._lastDeltaTime),this._activeEffect.setMatrix("reflectionViewProjection",s),this._activeEffect.setVector2("windDirection",this.windDirection),this._activeEffect.setFloat("waveLength",this.waveLength),this._activeEffect.setFloat("time",this._lastTime/1e5),this._activeEffect.setFloat("windForce",this.windForce),this._activeEffect.setFloat("waveHeight",this.waveHeight),this._activeEffect.setFloat("bumpHeight",this.bumpHeight),this._activeEffect.setColor4("waterColor",this.waterColor,1),this._activeEffect.setFloat("colorBlendFactor",this.colorBlendFactor),this._activeEffect.setColor4("waterColor2",this.waterColor2,1),this._activeEffect.setFloat("colorBlendFactor2",this.colorBlendFactor2),this._activeEffect.setFloat("waveSpeed",this.waveSpeed),this._activeEffect.setFloat("waveCount",this.waveCount),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect),this._afterBind(t,this._activeEffect,i)}}},t.prototype._createRenderTargets=function(e,t){var i=this;this._refractionRTT=new n.RenderTargetTexture(name+"_refraction",{width:t.x,height:t.y},e,!1,!0),this._refractionRTT.wrapU=n.Constants.TEXTURE_MIRROR_ADDRESSMODE,this._refractionRTT.wrapV=n.Constants.TEXTURE_MIRROR_ADDRESSMODE,this._refractionRTT.ignoreCameraViewport=!0;var r,o=!1;this._refractionRTT.onBeforeRenderObservable.add((function(){o=e.getBoundingBoxRenderer().enabled,e.getBoundingBoxRenderer().enabled=!1})),this._refractionRTT.onAfterRenderObservable.add((function(){e.getBoundingBoxRenderer().enabled=o})),this._reflectionRTT=new n.RenderTargetTexture(name+"_reflection",{width:t.x,height:t.y},e,!1,!0),this._reflectionRTT.wrapU=n.Constants.TEXTURE_MIRROR_ADDRESSMODE,this._reflectionRTT.wrapV=n.Constants.TEXTURE_MIRROR_ADDRESSMODE,this._reflectionRTT.ignoreCameraViewport=!0;var a,s=null,l=n.Matrix.Zero();this._refractionRTT.onBeforeRender=function(){if(i._mesh&&(r=i._mesh.isVisible,i._mesh.isVisible=!1),!i.disableClipPlane){s=e.clipPlane;var t=i._mesh?i._mesh.absolutePosition.y:0;e.clipPlane=n.Plane.FromPositionAndNormal(new n.Vector3(0,t+.05,0),new n.Vector3(0,1,0))}},this._refractionRTT.onAfterRender=function(){i._mesh&&(i._mesh.isVisible=r),i.disableClipPlane||(e.clipPlane=s)},this._reflectionRTT.onBeforeRender=function(){if(i._mesh&&(r=i._mesh.isVisible,i._mesh.isVisible=!1),!i.disableClipPlane){s=e.clipPlane;var t=i._mesh?i._mesh.absolutePosition.y:0;e.clipPlane=n.Plane.FromPositionAndNormal(new n.Vector3(0,t-.05,0),new n.Vector3(0,-1,0)),n.Matrix.ReflectionToRef(e.clipPlane,l)}a=e.getViewMatrix(),l.multiplyToRef(a,i._reflectionTransform),e.setTransformMatrix(i._reflectionTransform,e.getProjectionMatrix()),e._mirroredCameraPosition=n.Vector3.TransformCoordinates(e.activeCamera.position,l)},this._reflectionRTT.onAfterRender=function(){i._mesh&&(i._mesh.isVisible=r),e.clipPlane=s,e.setTransformMatrix(a,e.getProjectionMatrix()),e._mirroredCameraPosition=null}},t.prototype.getAnimatables=function(){var e=[];return this.bumpTexture&&this.bumpTexture.animations&&this.bumpTexture.animations.length>0&&e.push(this.bumpTexture),this._reflectionRTT&&this._reflectionRTT.animations&&this._reflectionRTT.animations.length>0&&e.push(this._reflectionRTT),this._refractionRTT&&this._refractionRTT.animations&&this._refractionRTT.animations.length>0&&e.push(this._refractionRTT),e},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._bumpTexture&&t.push(this._bumpTexture),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this._bumpTexture===t},t.prototype.dispose=function(t){this.bumpTexture&&this.bumpTexture.dispose();var i=this.getScene().customRenderTargets.indexOf(this._refractionRTT);-1!=i&&this.getScene().customRenderTargets.splice(i,1),i=-1,-1!=(i=this.getScene().customRenderTargets.indexOf(this._reflectionRTT))&&this.getScene().customRenderTargets.splice(i,1),this._reflectionRTT&&this._reflectionRTT.dispose(),this._refractionRTT&&this._refractionRTT.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return n.SerializationHelper.Clone((function(){return new t(e,i.getScene())}),this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);if(t.customType="BABYLON.WaterMaterial",t.renderList=[],this._refractionRTT&&this._refractionRTT.renderList)for(var i=0;i<this._refractionRTT.renderList.length;i++)t.renderList.push(this._refractionRTT.renderList[i].id);return t},t.prototype.getClassName=function(){return"WaterMaterial"},t.Parse=function(e,i,r){var o=n.SerializationHelper.Parse((function(){return new t(e.name,i)}),e,i,r);return o._waitingRenderList=e.renderList,o},t.CreateDefaultMesh=function(e,t){return(0,n.CreateGround)(e,{width:512,height:512,subdivisions:32,updatable:!1},t)},(0,r.__decorate)([(0,n.serializeAsTexture)("bumpTexture")],t.prototype,"_bumpTexture",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"diffuseColor",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"specularColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"specularPower",void 0),(0,r.__decorate)([(0,n.serialize)("disableLighting")],t.prototype,"_disableLighting",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),(0,r.__decorate)([(0,n.serialize)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"windForce",void 0),(0,r.__decorate)([(0,n.serializeAsVector2)()],t.prototype,"windDirection",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"waveHeight",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"bumpHeight",void 0),(0,r.__decorate)([(0,n.serialize)("bumpSuperimpose")],t.prototype,"_bumpSuperimpose",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsMiscDirty")],t.prototype,"bumpSuperimpose",void 0),(0,r.__decorate)([(0,n.serialize)("fresnelSeparate")],t.prototype,"_fresnelSeparate",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsMiscDirty")],t.prototype,"fresnelSeparate",void 0),(0,r.__decorate)([(0,n.serialize)("bumpAffectsReflection")],t.prototype,"_bumpAffectsReflection",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsMiscDirty")],t.prototype,"bumpAffectsReflection",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"waterColor",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"colorBlendFactor",void 0),(0,r.__decorate)([(0,n.serializeAsColor3)()],t.prototype,"waterColor2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"colorBlendFactor2",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"waveLength",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"waveSpeed",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"waveCount",void 0),(0,r.__decorate)([(0,n.serialize)()],t.prototype,"disableClipPlane",void 0),(0,r.__decorate)([(0,n.serialize)("useWorldCoordinatesForWaveDeformation")],t.prototype,"_useWorldCoordinatesForWaveDeformation",void 0),(0,r.__decorate)([(0,n.expandToProperty)("_markAllSubMeshesAsMiscDirty")],t.prototype,"useWorldCoordinatesForWaveDeformation",void 0),t}(n.PushMaterial);(0,n.RegisterClass)("BABYLON.WaterMaterial",a)},"../../../lts/materials/src/legacy/legacy.ts":(e,t,i)=>{i.r(t),i.d(t,{CellMaterial:()=>r.CellMaterial,CustomMaterial:()=>r.CustomMaterial,CustomShaderStructure:()=>r.CustomShaderStructure,FireMaterial:()=>r.FireMaterial,FurMaterial:()=>r.FurMaterial,GradientMaterial:()=>r.GradientMaterial,GridMaterial:()=>r.GridMaterial,LavaMaterial:()=>r.LavaMaterial,MixMaterial:()=>r.MixMaterial,NormalMaterial:()=>r.NormalMaterial,PBRCustomMaterial:()=>r.PBRCustomMaterial,ShaderAlbedoParts:()=>r.ShaderAlbedoParts,ShaderAlebdoParts:()=>r.ShaderAlebdoParts,ShaderSpecialParts:()=>r.ShaderSpecialParts,ShadowOnlyMaterial:()=>r.ShadowOnlyMaterial,SimpleMaterial:()=>r.SimpleMaterial,SkyMaterial:()=>r.SkyMaterial,TerrainMaterial:()=>r.TerrainMaterial,TriPlanarMaterial:()=>r.TriPlanarMaterial,WaterMaterial:()=>r.WaterMaterial});var r=i("../../../dev/materials/src/index.ts"),n=void 0!==i.g?i.g:"undefined"!=typeof window?window:void 0;if(void 0!==n)for(var o in n.BABYLON=n.BABYLON||{},r)n.BABYLON[o]=r[o]},"babylonjs/Materials/effect":t=>{t.exports=e},"../../../../node_modules/tslib/tslib.es6.mjs":(e,t,i)=>{i.r(t),i.d(t,{__addDisposableResource:()=>B,__assign:()=>o,__asyncDelegator:()=>P,__asyncGenerator:()=>S,__asyncValues:()=>E,__await:()=>C,__awaiter:()=>f,__classPrivateFieldGet:()=>A,__classPrivateFieldIn:()=>L,__classPrivateFieldSet:()=>R,__createBinding:()=>m,__decorate:()=>s,__disposeResources:()=>D,__esDecorate:()=>c,__exportStar:()=>g,__extends:()=>n,__generator:()=>p,__importDefault:()=>O,__importStar:()=>M,__makeTemplateObject:()=>w,__metadata:()=>_,__param:()=>l,__propKey:()=>h,__read:()=>b,__rest:()=>a,__runInitializers:()=>u,__setFunctionName:()=>d,__spread:()=>y,__spreadArray:()=>T,__spreadArrays:()=>x,__values:()=>v,default:()=>N});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},r(e,t)};function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var o=function(){return o=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)};function a(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i}function s(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a}function l(e,t){return function(i,r){t(i,r,e)}}function c(e,t,i,r,n,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,_=i.length-1;_>=0;_--){var f={};for(var p in r)f[p]="access"===p?{}:r[p];for(var p in r.access)f.access[p]=r.access[p];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var m=(0,i[_])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=a(m.get))&&(h.get=s),(s=a(m.set))&&(h.set=s),(s=a(m.init))&&n.unshift(s)}else(s=a(m))&&("field"===l?n.unshift(s):h[c]=s)}u&&Object.defineProperty(u,r.name,h),d=!0}function u(e,t,i){for(var r=arguments.length>2,n=0;n<t.length;n++)i=r?t[n].call(e,i):t[n].call(e);return r?i:void 0}function h(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}function _(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,i,r){return new(i||(i=Promise))((function(n,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function p(e,t){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var m=Object.create?function(e,t,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(t,i);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,r,n)}:function(e,t,i,r){void 0===r&&(r=i),e[r]=t[i]};function g(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||m(t,e,i)}function v(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}function x(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var r=Array(e),n=0;for(t=0;t<i;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,n++)r[n]=o[a];return r}function T(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}function C(e){return this instanceof C?(this.v=e,this):new C(e)}function S(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,n=i.apply(e,t||[]),o=[];return r={},a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,c)}})),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){n[e]&&(r[e]=function(t){return new Promise((function(i,r){o.push([e,t,i,r])>1||s(e,t)}))},t&&(r[e]=t(r[e])))}function s(e,t){try{(i=n[e](t)).value instanceof C?Promise.resolve(i.value.v).then(l,c):u(o[0][2],i)}catch(e){u(o[0][3],e)}var i}function l(e){s("next",e)}function c(e){s("throw",e)}function u(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function P(e){var t,i;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,n){t[r]=e[r]?function(t){return(i=!i)?{value:C(e[r](t)),done:!1}:n?n(t):t}:n}}function E(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=v(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(i){t[i]=e[i]&&function(t){return new Promise((function(r,n){!function(e,t,i,r){Promise.resolve(r).then((function(t){e({value:t,done:i})}),t)}(r,n,(t=e[i](t)).done,t.value)}))}}}function w(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var I=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function M(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&m(t,e,i);return I(t,e),t}function O(e){return e&&e.__esModule?e:{default:e}}function A(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}function R(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i}function L(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function B(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r,n;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],i&&(n=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");n&&(r=function(){try{n.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:i})}else i&&e.stack.push({async:!0});return t}var F="function"==typeof SuppressedError?SuppressedError:function(e,t,i){var r=new Error(i);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function D(e){function t(t){e.error=e.hasError?new F(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function i(){for(;e.stack.length;){var r=e.stack.pop();try{var n=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(n).then(i,(function(e){return t(e),i()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}const N={__extends:n,__assign:o,__rest:a,__decorate:s,__param:l,__metadata:_,__awaiter:f,__generator:p,__createBinding:m,__exportStar:g,__values:v,__read:b,__spread:y,__spreadArrays:x,__spreadArray:T,__await:C,__asyncGenerator:S,__asyncDelegator:P,__asyncValues:E,__makeTemplateObject:w,__importStar:M,__importDefault:O,__classPrivateFieldGet:A,__classPrivateFieldSet:R,__classPrivateFieldIn:L,__addDisposableResource:B,__disposeResources:D}}},i={};function r(e){var n=i[e];if(void 0!==n)return n.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{default:()=>a,materials:()=>o});var o=r("../../../lts/materials/src/legacy/legacy.ts");const a=o;return n.default})(),e.exports=r(i(9859))},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),i=t[0],r=t[1];return 3*(i+r)/4-r},t.toByteArray=function(e){var t,i,o=s(e),a=o[0],l=o[1],c=new n(function(e,t,i){return 3*(t+i)/4-i}(0,a,l)),u=0,h=l>0?a-4:a;for(i=0;i<h;i+=4)t=r[e.charCodeAt(i)]<<18|r[e.charCodeAt(i+1)]<<12|r[e.charCodeAt(i+2)]<<6|r[e.charCodeAt(i+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,c[u++]=255&t),1===l&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,n=r%3,o=[],a=16383,s=0,c=r-n;s<c;s+=a)o.push(l(e,s,s+a>c?c:s+a));return 1===n?(t=e[r-1],o.push(i[t>>2]+i[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],o.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"=")),o.join("")};for(var i=[],r=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)i[a]=o[a],r[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function l(e,t,r){for(var n,o,a=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(i[(o=n)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},8287:(e,t,i)=>{"use strict";const r=i(7526),n=i(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,i){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return c(e,t,i)}function c(e,t,i){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const i=0|p(e,t);let r=s(i);const n=r.write(e,t);return n!==i&&(r=r.slice(0,n)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return _(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return _(e,t,i);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return _(e,t,i);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,i);const n=function(e){if(l.isBuffer(e)){const t=0|f(e.length),i=s(t);return 0===i.length||e.copy(i,0,0,t),i}return void 0!==e.length?"number"!=typeof e.length||q(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return u(e),s(e<0?0:0|f(e))}function d(e){const t=e.length<0?0:0|f(e.length),i=s(t);for(let r=0;r<t;r+=1)i[r]=255&e[r];return i}function _(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i),Object.setPrototypeOf(r,l.prototype),r}function f(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const i=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===i)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return X(e).length;default:if(n)return r?-1:j(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,i){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,i);case"utf8":case"utf-8":return E(this,t,i);case"ascii":return I(this,t,i);case"latin1":case"binary":return M(this,t,i);case"base64":return P(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,i){const r=e[t];e[t]=e[i],e[i]=r}function v(e,t,i,r,n){if(0===e.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),q(i=+i)&&(i=n?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(n)return-1;i=e.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:b(e,t,i,r,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):b(e,[t],i,r,n);throw new TypeError("val must be string, number or Buffer")}function b(e,t,i,r,n){let o,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,i/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){let r=-1;for(o=i;o<s;o++)if(c(e,o)===c(t,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===l)return r*a}else-1!==r&&(o-=o-r),r=-1}else for(i+l>s&&(i=s-l),o=i;o>=0;o--){let i=!0;for(let r=0;r<l;r++)if(c(e,o+r)!==c(t,r)){i=!1;break}if(i)return o}return-1}function y(e,t,i,r){i=Number(i)||0;const n=e.length-i;r?(r=Number(r))>n&&(r=n):r=n;const o=t.length;let a;for(r>o/2&&(r=o/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(q(r))return a;e[i+a]=r}return a}function x(e,t,i,r){return Y(j(t,e.length-i),e,i,r)}function T(e,t,i,r){return Y(function(e){const t=[];for(let i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,r)}function C(e,t,i,r){return Y(X(t),e,i,r)}function S(e,t,i,r){return Y(function(e,t){let i,r,n;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)i=e.charCodeAt(a),r=i>>8,n=i%256,o.push(n),o.push(r);return o}(t,e.length-i),e,i,r)}function P(e,t,i){return 0===t&&i===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,i))}function E(e,t,i){i=Math.min(e.length,i);const r=[];let n=t;for(;n<i;){const t=e[n];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(n+a<=i){let i,r,s,l;switch(a){case 1:t<128&&(o=t);break;case 2:i=e[n+1],128==(192&i)&&(l=(31&t)<<6|63&i,l>127&&(o=l));break;case 3:i=e[n+1],r=e[n+2],128==(192&i)&&128==(192&r)&&(l=(15&t)<<12|(63&i)<<6|63&r,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:i=e[n+1],r=e[n+2],s=e[n+3],128==(192&i)&&128==(192&r)&&128==(192&s)&&(l=(15&t)<<18|(63&i)<<12|(63&r)<<6|63&s,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),n+=a}return function(e){const t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);let i="",r=0;for(;r<t;)i+=String.fromCharCode.apply(String,e.slice(r,r+=w));return i}(r)}t.kMaxLength=a,l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,i){return c(e,t,i)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,i){return function(e,t,i){return u(e),e<=0?s(e):void 0!==t?"string"==typeof i?s(e).fill(t,i):s(e).fill(t):s(e)}(e,t,i)},l.allocUnsafe=function(e){return h(e)},l.allocUnsafeSlow=function(e){return h(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(K(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let i=e.length,r=t.length;for(let n=0,o=Math.min(i,r);n<o;++n)if(e[n]!==t[n]){i=e[n],r=t[n];break}return i<r?-1:r<i?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;const r=l.allocUnsafe(t);let n=0;for(i=0;i<e.length;++i){let t=e[i];if(K(t,Uint8Array))n+t.length>r.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(r,n)):Uint8Array.prototype.set.call(r,t,n);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,n)}n+=t.length}return r},l.byteLength=p,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):m.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const i=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,i,r,n){if(K(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||i>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=i)return 0;if(r>=n)return-1;if(t>=i)return 1;if(this===e)return 0;let o=(n>>>=0)-(r>>>=0),a=(i>>>=0)-(t>>>=0);const s=Math.min(o,a),c=this.slice(r,n),u=e.slice(t,i);for(let e=0;e<s;++e)if(c[e]!==u[e]){o=c[e],a=u[e];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},l.prototype.indexOf=function(e,t,i){return v(this,e,t,i,!0)},l.prototype.lastIndexOf=function(e,t,i){return v(this,e,t,i,!1)},l.prototype.write=function(e,t,i,r){if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(i)?(i>>>=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}const n=this.length-t;if((void 0===i||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return y(this,e,t,i);case"utf8":case"utf-8":return x(this,e,t,i);case"ascii":case"latin1":case"binary":return T(this,e,t,i);case"base64":return C(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,i);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const w=4096;function I(e,t,i){let r="";i=Math.min(e.length,i);for(let n=t;n<i;++n)r+=String.fromCharCode(127&e[n]);return r}function M(e,t,i){let r="";i=Math.min(e.length,i);for(let n=t;n<i;++n)r+=String.fromCharCode(e[n]);return r}function O(e,t,i){const r=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>r)&&(i=r);let n="";for(let r=t;r<i;++r)n+=Z[e[r]];return n}function A(e,t,i){const r=e.slice(t,i);let n="";for(let e=0;e<r.length-1;e+=2)n+=String.fromCharCode(r[e]+256*r[e+1]);return n}function R(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,i,r,n,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(i+r>e.length)throw new RangeError("Index out of range")}function B(e,t,i,r,n){U(t,r,n,e,i,7);let o=Number(t&BigInt(4294967295));e[i++]=o,o>>=8,e[i++]=o,o>>=8,e[i++]=o,o>>=8,e[i++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i++]=a,a>>=8,e[i++]=a,a>>=8,e[i++]=a,a>>=8,e[i++]=a,i}function F(e,t,i,r,n){U(t,r,n,e,i,7);let o=Number(t&BigInt(4294967295));e[i+7]=o,o>>=8,e[i+6]=o,o>>=8,e[i+5]=o,o>>=8,e[i+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i+3]=a,a>>=8,e[i+2]=a,a>>=8,e[i+1]=a,a>>=8,e[i]=a,i+8}function D(e,t,i,r,n,o){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function N(e,t,i,r,o){return t=+t,i>>>=0,o||D(e,0,i,4),n.write(e,t,i,r,23,4),i+4}function k(e,t,i,r,o){return t=+t,i>>>=0,o||D(e,0,i,8),n.write(e,t,i,r,52,8),i+8}l.prototype.slice=function(e,t){const i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||R(e,t,this.length);let r=this[e],n=1,o=0;for(;++o<t&&(n*=256);)r+=this[e+o]*n;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||R(e,t,this.length);let r=this[e+--t],n=1;for(;t>0&&(n*=256);)r+=this[e+--t]*n;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=J((function(e){H(e>>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||W(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+i*2**24;return BigInt(r)+(BigInt(n)<<BigInt(32))})),l.prototype.readBigUInt64BE=J((function(e){H(e>>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||W(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+i;return(BigInt(r)<<BigInt(32))+BigInt(n)})),l.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||R(e,t,this.length);let r=this[e],n=1,o=0;for(;++o<t&&(n*=256);)r+=this[e+o]*n;return n*=128,r>=n&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||R(e,t,this.length);let r=t,n=1,o=this[e+--r];for(;r>0&&(n*=256);)o+=this[e+--r]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);const i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);const i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=J((function(e){H(e>>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||W(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(i<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),l.prototype.readBigInt64BE=J((function(e){H(e>>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||W(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+i)})),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,i,r){e=+e,t>>>=0,i>>>=0,r||L(this,e,t,i,Math.pow(2,8*i)-1,0);let n=1,o=0;for(this[t]=255&e;++o<i&&(n*=256);)this[t+o]=e/n&255;return t+i},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,i,r){e=+e,t>>>=0,i>>>=0,r||L(this,e,t,i,Math.pow(2,8*i)-1,0);let n=i-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+i},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=J((function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=J((function(e,t=0){return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,i,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*i-1);L(this,e,t,i,r-1,-r)}let n=0,o=1,a=0;for(this[t]=255&e;++n<i&&(o*=256);)e<0&&0===a&&0!==this[t+n-1]&&(a=1),this[t+n]=(e/o|0)-a&255;return t+i},l.prototype.writeIntBE=function(e,t,i,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*i-1);L(this,e,t,i,r-1,-r)}let n=i-1,o=1,a=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===a&&0!==this[t+n+1]&&(a=1),this[t+n]=(e/o|0)-a&255;return t+i},l.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=J((function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=J((function(e,t=0){return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,i){return N(this,e,t,!0,i)},l.prototype.writeFloatBE=function(e,t,i){return N(this,e,t,!1,i)},l.prototype.writeDoubleLE=function(e,t,i){return k(this,e,t,!0,i)},l.prototype.writeDoubleBE=function(e,t,i){return k(this,e,t,!1,i)},l.prototype.copy=function(e,t,i,r){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<i&&(r=i),r===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-i&&(r=e.length-t+i);const n=r-i;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,i,r):Uint8Array.prototype.set.call(e,this.subarray(i,r),t),n},l.prototype.fill=function(e,t,i,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;let n;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(n=t;n<i;++n)this[n]=e;else{const o=l.isBuffer(e)?e:l.from(e,r),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<i-t;++n)this[n+t]=o[n%a]}return this};const V={};function z(e,t,i){V[e]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function G(e){let t="",i=e.length;const r="-"===e[0]?1:0;for(;i>=r+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}function U(e,t,i,r,n,o){if(e>i||e<t){const r="bigint"==typeof t?"n":"";let n;throw n=o>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${i}${r}`,new V.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,i){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+i]||W(t,e.length-(i+1))}(r,n,o)}function H(e,t){if("number"!=typeof e)throw new V.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,i){if(Math.floor(e)!==e)throw H(e,i),new V.ERR_OUT_OF_RANGE(i||"offset","an integer",e);if(t<0)throw new V.ERR_BUFFER_OUT_OF_BOUNDS;throw new V.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${t}`,e)}z("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),z("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),z("ERR_OUT_OF_RANGE",(function(e,t,i){let r=`The value of "${e}" is out of range.`,n=i;return Number.isInteger(i)&&Math.abs(i)>2**32?n=G(String(i)):"bigint"==typeof i&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=G(n)),n+="n"),r+=` It must be ${t}. Received ${n}`,r}),RangeError);const Q=/[^+/0-9A-Za-z-_]/g;function j(e,t){let i;t=t||1/0;const r=e.length;let n=null;const o=[];for(let a=0;a<r;++a){if(i=e.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}n=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function X(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,i,r){let n;for(n=0;n<r&&!(n+i>=t.length||n>=e.length);++n)t[n+i]=e[n];return n}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function q(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let i=0;i<16;++i){const r=16*i;for(let n=0;n<16;++n)t[r+n]=e[i]+e[n]}return t}();function J(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},7007:e=>{"use strict";var t,i="object"==typeof Reflect?Reflect:null,r=i&&"function"==typeof i.apply?i.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};t=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(i,r){function n(i){e.removeListener(t,o),r(i)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",n),i([].slice.call(arguments))}p(e,t,o,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&p(e,"error",t,{once:!0})}(e,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,i,r){var n,o,a,c;if(s(i),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),o=e._events),a=o[t]),void 0===a)a=o[t]=i,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),(n=l(e))>0&&a.length>n&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,i){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},n=u.bind(r);return n.listener=i,r.wrapFn=n,n}function d(e,t,i){var r=e._events;if(void 0===r)return[];var n=r[t];return void 0===n?[]:"function"==typeof n?i?[n.listener||n]:[n]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(n):f(n,n.length)}function _(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function f(e,t){for(var i=new Array(t),r=0;r<t;++r)i[r]=e[r];return i}function p(e,t,i,r){if("function"==typeof e.on)r.once?e.once(t,i):e.on(t,i);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function n(o){r.once&&e.removeEventListener(t,n),i(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n="error"===e,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else{var c=l.length,u=f(l,c);for(i=0;i<c;++i)r(u[i],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,h(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,h(this,e,t)),this},o.prototype.removeListener=function(e,t){var i,r,n,o,a;if(s(t),void 0===(r=this._events))return this;if(void 0===(i=r[e]))return this;if(i===t||i.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(n=-1,o=i.length-1;o>=0;o--)if(i[o]===t||i[o].listener===t){a=i[o].listener,n=o;break}if(n<0)return this;0===n?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,n),1===i.length&&(r[e]=i[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,i,r;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var n,o=Object.keys(i);for(r=0;r<o.length;++r)"removeListener"!==(n=o[r])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):_.call(e,t)},o.prototype.listenerCount=_,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},251:(e,t)=>{t.read=function(e,t,i,r,n){var o,a,s=8*n-r-1,l=(1<<s)-1,c=l>>1,u=-7,h=i?n-1:0,d=i?-1:1,_=e[t+h];for(h+=d,o=_&(1<<-u)-1,_>>=-u,u+=s;u>0;o=256*o+e[t+h],h+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(_?-1:1);a+=Math.pow(2,r),o-=c}return(_?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,i,r,n,o){var a,s,l,c=8*o-n-1,u=(1<<c)-1,h=u>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,_=r?0:o-1,f=r?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(t*l-1)*Math.pow(2,n),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;e[i+_]=255&s,_+=f,s/=256,n-=8);for(a=a<<n|s,c+=n;c>0;e[i+_]=255&a,_+=f,a/=256,c-=8);e[i+_-f]|=128*p}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}},6048:e=>{"use strict";var t={};function i(e,i,r){r||(r=Error);var n=function(e){var t,r;function n(t,r,n){return e.call(this,function(e,t,r){return"string"==typeof i?i:i(e,t,r)}(t,r,n))||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(r);n.prototype.name=r.name,n.prototype.code=e,t[e]=n}function r(e,t){if(Array.isArray(e)){var i=e.length;return e=e.map((function(e){return String(e)})),i>2?"one of ".concat(t," ").concat(e.slice(0,i-1).join(", "),", or ")+e[i-1]:2===i?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,i){var n,o,a,s,l;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,i){return(void 0===i||i>e.length)&&(i=e.length),e.substring(i-9,i)===t}(e," argument"))a="The ".concat(e," ").concat(n," ").concat(r(t,"type"));else{var c=("number"!=typeof l&&(l=0),l+1>(s=e).length||-1===s.indexOf(".",l)?"argument":"property");a='The "'.concat(e,'" ').concat(c," ").concat(n," ").concat(r(t,"type"))}return a+". Received type ".concat(typeof i)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},5382:(e,t,i)=>{"use strict";var r=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};e.exports=c;var n=i(5412),o=i(6708);i(6698)(c,n);for(var a=r(o.prototype),s=0;s<a.length;s++){var l=a[s];c.prototype[l]||(c.prototype[l]=o.prototype[l])}function c(e){if(!(this instanceof c))return new c(e);n.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",u)))}function u(){this._writableState.ended||process.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},3600:(e,t,i)=>{"use strict";e.exports=n;var r=i(4610);function n(e){if(!(this instanceof n))return new n(e);r.call(this,e)}i(6698)(n,r),n.prototype._transform=function(e,t,i){i(null,e)}},5412:(e,t,i)=>{"use strict";var r;e.exports=S,S.ReadableState=C,i(7007).EventEmitter;var n,o=function(e,t){return e.listeners(t).length},a=i(345),s=i(8287).Buffer,l=(void 0!==i.g?i.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},c=i(9838);n=c&&c.debuglog?c.debuglog("stream"):function(){};var u,h,d,_=i(2726),f=i(5896),p=i(5291).getHighWaterMark,m=i(6048).F,g=m.ERR_INVALID_ARG_TYPE,v=m.ERR_STREAM_PUSH_AFTER_EOF,b=m.ERR_METHOD_NOT_IMPLEMENTED,y=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;i(6698)(S,a);var x=f.errorOrDestroy,T=["error","close","destroy","pause","resume"];function C(e,t,n){r=r||i(5382),e=e||{},"boolean"!=typeof n&&(n=t instanceof r),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=p(this,e,"readableHighWaterMark",n),this.buffer=new _,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=i(3141).I),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function S(e){if(r=r||i(5382),!(this instanceof S))return new S(e);var t=this instanceof r;this._readableState=new C(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function P(e,t,i,r,o){n("readableAddChunk",t);var a,c=e._readableState;if(null===t)c.reading=!1,function(e,t){if(n("onEofChunk"),!t.ended){if(t.decoder){var i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,t.sync?M(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,O(e)))}}(e,c);else if(o||(a=function(e,t){var i,r;return r=t,s.isBuffer(r)||r instanceof l||"string"==typeof t||void 0===t||e.objectMode||(i=new g("chunk",["string","Buffer","Uint8Array"],t)),i}(c,t)),a)x(e,a);else if(c.objectMode||t&&t.length>0)if("string"==typeof t||c.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),r)c.endEmitted?x(e,new y):E(e,c,t,!0);else if(c.ended)x(e,new v);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!i?(t=c.decoder.write(t),c.objectMode||0!==t.length?E(e,c,t,!1):A(e,c)):E(e,c,t,!1)}else r||(c.reading=!1,A(e,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function E(e,t,i,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",i)):(t.length+=t.objectMode?1:i.length,r?t.buffer.unshift(i):t.buffer.push(i),t.needReadable&&M(e)),A(e,t)}Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),S.prototype.destroy=f.destroy,S.prototype._undestroy=f.undestroy,S.prototype._destroy=function(e,t){t(e)},S.prototype.push=function(e,t){var i,r=this._readableState;return r.objectMode?i=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=s.from(e,t),t=""),i=!0),P(this,e,t,!1,i)},S.prototype.unshift=function(e){return P(this,e,null,!0,!1)},S.prototype.isPaused=function(){return!1===this._readableState.flowing},S.prototype.setEncoding=function(e){u||(u=i(3141).I);var t=new u(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var w=1073741824;function I(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=w?e=w:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function M(e){var t=e._readableState;n("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(n("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(O,e))}function O(e){var t=e._readableState;n("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function A(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var i=t.length;if(n("maybeReadMore read 0"),e.read(0),i===t.length)break}t.readingMore=!1}function L(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function B(e){n("readable nexttick read 0"),e.read(0)}function F(e,t){n("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(n("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?i=t.buffer.shift():!e||e>=t.length?(i=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):i=t.buffer.consume(e,t.decoder),i);var i}function k(e){var t=e._readableState;n("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(V,t,e))}function V(e,t){if(n("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var i=t._writableState;(!i||i.autoDestroy&&i.finished)&&t.destroy()}}function z(e,t){for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1}S.prototype.read=function(e){n("read",e),e=parseInt(e,10);var t=this._readableState,i=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return n("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?k(this):M(this),null;if(0===(e=I(e,t))&&t.ended)return 0===t.length&&k(this),null;var r,o=t.needReadable;return n("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&n("length less than watermark",o=!0),t.ended||t.reading?n("reading or ended",o=!1):o&&(n("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=I(i,t))),null===(r=e>0?N(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&k(this)),null!==r&&this.emit("data",r),r},S.prototype._read=function(e){x(this,new b("_read()"))},S.prototype.pipe=function(e,t){var i=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,n("pipe count=%d opts=%j",r.pipesCount,t);var a=t&&!1===t.end||e===process.stdout||e===process.stderr?f:s;function s(){n("onend"),e.end()}r.endEmitted?process.nextTick(a):i.once("end",a),e.on("unpipe",(function t(o,a){n("onunpipe"),o===i&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,n("cleanup"),e.removeListener("close",d),e.removeListener("finish",_),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",t),i.removeListener("end",s),i.removeListener("end",f),i.removeListener("data",u),c=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}));var l=function(e){return function(){var t=e._readableState;n("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,D(e))}}(i);e.on("drain",l);var c=!1;function u(t){n("ondata");var o=e.write(t);n("dest.write",o),!1===o&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==z(r.pipes,e))&&!c&&(n("false write response, pause",r.awaitDrain),r.awaitDrain++),i.pause())}function h(t){n("onerror",t),f(),e.removeListener("error",h),0===o(e,"error")&&x(e,t)}function d(){e.removeListener("finish",_),f()}function _(){n("onfinish"),e.removeListener("close",d),f()}function f(){n("unpipe"),i.unpipe(e)}return i.on("data",u),function(e,t,i){if("function"==typeof e.prependListener)return e.prependListener(t,i);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]:e.on(t,i)}(e,"error",h),e.once("close",d),e.once("finish",_),e.emit("pipe",i),r.flowing||(n("pipe resume"),i.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,i={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,i)),this;if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=z(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,i)),this},S.prototype.on=function(e,t){var i=a.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,n("on readable",r.length,r.reading),r.length?M(this):r.reading||process.nextTick(B,this))),i},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var i=a.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(L,this),i},S.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(L,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(n("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(F,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,i=this._readableState,r=!1;for(var o in e.on("end",(function(){if(n("wrapped end"),i.decoder&&!i.ended){var e=i.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){n("wrapped data"),i.decoder&&(o=i.decoder.write(o)),i.objectMode&&null==o||(i.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<T.length;a++)e.on(T[a],this.emit.bind(this,T[a]));return this._read=function(t){n("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(S.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=i(2955)),h(this)}),Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(S.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(S.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),S._fromList=N,Object.defineProperty(S.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(S.from=function(e,t){return void 0===d&&(d=i(5157)),d(S,e,t)})},4610:(e,t,i)=>{"use strict";e.exports=u;var r=i(6048).F,n=r.ERR_METHOD_NOT_IMPLEMENTED,o=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,l=i(5382);function c(e,t){var i=this._transformState;i.transforming=!1;var r=i.writecb;if(null===r)return this.emit("error",new o);i.writechunk=null,i.writecb=null,null!=t&&this.push(t),r(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);l.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",h)}function h(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(t,i){d(e,t,i)}))}function d(e,t,i){if(t)return e.emit("error",t);if(null!=i&&e.push(i),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}i(6698)(u,l),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},u.prototype._transform=function(e,t,i){i(new n("_transform()"))},u.prototype._write=function(e,t,i){var r=this._transformState;if(r.writecb=i,r.writechunk=e,r.writeencoding=t,!r.transforming){var n=this._readableState;(r.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},u.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},u.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,(function(e){t(e)}))}},6708:(e,t,i)=>{"use strict";function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var i=e.entry;for(e.entry=null;i;){var r=i.callback;t.pendingcb--,r(undefined),i=i.next}t.corkedRequestsFree.next=e}(t,e)}}var n;e.exports=S,S.WritableState=C;var o,a={deprecate:i(4643)},s=i(345),l=i(8287).Buffer,c=(void 0!==i.g?i.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=i(5896),h=i(5291).getHighWaterMark,d=i(6048).F,_=d.ERR_INVALID_ARG_TYPE,f=d.ERR_METHOD_NOT_IMPLEMENTED,p=d.ERR_MULTIPLE_CALLBACK,m=d.ERR_STREAM_CANNOT_PIPE,g=d.ERR_STREAM_DESTROYED,v=d.ERR_STREAM_NULL_VALUES,b=d.ERR_STREAM_WRITE_AFTER_END,y=d.ERR_UNKNOWN_ENCODING,x=u.errorOrDestroy;function T(){}function C(e,t,o){n=n||i(5382),e=e||{},"boolean"!=typeof o&&(o=t instanceof n),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var i=e._writableState,r=i.sync,n=i.writecb;if("function"!=typeof n)throw new p;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(i),t)!function(e,t,i,r,n){--t.pendingcb,i?(process.nextTick(n,r),process.nextTick(O,e,t),e._writableState.errorEmitted=!0,x(e,r)):(n(r),e._writableState.errorEmitted=!0,x(e,r),O(e,t))}(e,i,r,t,n);else{var o=I(i)||e.destroyed;o||i.corked||i.bufferProcessing||!i.bufferedRequest||w(e,i),r?process.nextTick(E,e,i,o,n):E(e,i,o,n)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function S(e){var t=this instanceof(n=n||i(5382));if(!t&&!o.call(S,this))return new S(e);this._writableState=new C(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),s.call(this)}function P(e,t,i,r,n,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):i?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function E(e,t,i,r){i||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),O(e,t)}function w(e,t){t.bufferProcessing=!0;var i=t.bufferedRequest;if(e._writev&&i&&i.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.corkedRequestsFree;a.entry=i;for(var s=0,l=!0;i;)o[s]=i,i.isBuf||(l=!1),i=i.next,s+=1;o.allBuffers=l,P(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;i;){var c=i.chunk,u=i.encoding,h=i.callback;if(P(e,t,!1,t.objectMode?1:c.length,c,u,h),i=i.next,t.bufferedRequestCount--,t.writing)break}null===i&&(t.lastBufferedRequest=null)}t.bufferedRequest=i,t.bufferProcessing=!1}function I(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function M(e,t){e._final((function(i){t.pendingcb--,i&&x(e,i),t.prefinished=!0,e.emit("prefinish"),O(e,t)}))}function O(e,t){var i=I(t);if(i&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(M,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return i}i(6698)(S,s),C.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(C.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return!!o.call(this,e)||this===S&&e&&e._writableState instanceof C}})):o=function(e){return e instanceof this},S.prototype.pipe=function(){x(this,new m)},S.prototype.write=function(e,t,i){var r,n=this._writableState,o=!1,a=!n.objectMode&&(r=e,l.isBuffer(r)||r instanceof c);return a&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(i=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof i&&(i=T),n.ending?function(e,t){var i=new b;x(e,i),process.nextTick(t,i)}(this,i):(a||function(e,t,i,r){var n;return null===i?n=new v:"string"==typeof i||t.objectMode||(n=new _("chunk",["string","Buffer"],i)),!n||(x(e,n),process.nextTick(r,n),!1)}(this,n,e,i))&&(n.pendingcb++,o=function(e,t,i,r,n,o){if(!i){var a=function(e,t,i){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,i)),t}(t,r,n);r!==a&&(i=!0,n="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:n,isBuf:i,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else P(e,t,!1,s,r,n,o);return c}(this,n,a,e,t,i)),o},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||w(this,e))},S.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new y(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,i){i(new f("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,i){var r=this._writableState;return"function"==typeof e?(i=e,e=null,t=null):"function"==typeof t&&(i=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,i){t.ending=!0,O(e,t),i&&(t.finished?process.nextTick(i):e.once("finish",i)),t.ended=!0,e.writable=!1}(this,r,i),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=u.destroy,S.prototype._undestroy=u.undestroy,S.prototype._destroy=function(e,t){t(e)}},2955:(e,t,i)=>{"use strict";var r;function n(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var o=i(6238),a=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function _(e,t){return{value:e,done:t}}function f(e){var t=e[a];if(null!==t){var i=e[d].read();null!==i&&(e[u]=null,e[a]=null,e[s]=null,t(_(i,!1)))}}function p(e){process.nextTick(f,e)}var m=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((n(r={get stream(){return this[d]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(_(void 0,!0));if(this[d].destroyed)return new Promise((function(t,i){process.nextTick((function(){e[l]?i(e[l]):t(_(void 0,!0))}))}));var i,r=this[u];if(r)i=new Promise(function(e,t){return function(i,r){e.then((function(){t[c]?i(_(void 0,!0)):t[h](i,r)}),r)}}(r,this));else{var n=this[d].read();if(null!==n)return Promise.resolve(_(n,!1));i=new Promise(this[h])}return this[u]=i,i}},Symbol.asyncIterator,(function(){return this})),n(r,"return",(function(){var e=this;return new Promise((function(t,i){e[d].destroy(null,(function(e){e?i(e):t(_(void 0,!0))}))}))})),r),m);e.exports=function(e){var t,i=Object.create(g,(n(t={},d,{value:e,writable:!0}),n(t,a,{value:null,writable:!0}),n(t,s,{value:null,writable:!0}),n(t,l,{value:null,writable:!0}),n(t,c,{value:e._readableState.endEmitted,writable:!0}),n(t,h,{value:function(e,t){var r=i[d].read();r?(i[u]=null,i[a]=null,i[s]=null,e(_(r,!1))):(i[a]=e,i[s]=t)},writable:!0}),t));return i[u]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=i[s];return null!==t&&(i[u]=null,i[a]=null,i[s]=null,t(e)),void(i[l]=e)}var r=i[a];null!==r&&(i[u]=null,i[a]=null,i[s]=null,r(_(void 0,!0))),i[c]=!0})),e.on("readable",p.bind(null,i)),i}},2726:(e,t,i)=>{"use strict";function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function n(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){o(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function o(e,t,i){return(t=s(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function a(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var l=i(8287).Buffer,c=i(5340).inspect,u=c&&c.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,i;return t=e,(i=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,i=""+t.data;t=t.next;)i+=e+t.data;return i}},{key:"concat",value:function(e){if(0===this.length)return l.alloc(0);for(var t,i,r,n=l.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,i=n,r=a,l.prototype.copy.call(t,i,r),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(e,t){var i;return e<this.head.data.length?(i=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):i=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,i=1,r=t.data;for(e-=r.length;t=t.next;){var n=t.data,o=e>n.length?n.length:e;if(o===n.length?r+=n:r+=n.slice(0,e),0==(e-=o)){o===n.length?(++i,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(o));break}++i}return this.length-=i,r}},{key:"_getBuffer",value:function(e){var t=l.allocUnsafe(e),i=this.head,r=1;for(i.data.copy(t),e-=i.data.length;i=i.next;){var n=i.data,o=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,o),0==(e-=o)){o===n.length?(++r,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=n.slice(o));break}++r}return this.length-=r,t}},{key:u,value:function(e,t){return c(this,n(n({},t),{},{depth:0,customInspect:!1}))}}])&&a(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},5896:e=>{"use strict";function t(e,t){r(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}e.exports={destroy:function(e,n){var o=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(n?n(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,e)):process.nextTick(r,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!n&&e?o._writableState?o._writableState.errorEmitted?process.nextTick(i,o):(o._writableState.errorEmitted=!0,process.nextTick(t,o,e)):process.nextTick(t,o,e):n?(process.nextTick(i,o),n(e)):process.nextTick(i,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var i=e._readableState,r=e._writableState;i&&i.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}},6238:(e,t,i)=>{"use strict";var r=i(6048).F.ERR_STREAM_PREMATURE_CLOSE;function n(){}e.exports=function e(t,i,o){if("function"==typeof i)return e(t,null,i);i||(i={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];e.apply(this,r)}}}(o||n);var a=i.readable||!1!==i.readable&&t.readable,s=i.writable||!1!==i.writable&&t.writable,l=function(){t.writable||u()},c=t._writableState&&t._writableState.finished,u=function(){s=!1,c=!0,a||o.call(t)},h=t._readableState&&t._readableState.endEmitted,d=function(){a=!1,h=!0,s||o.call(t)},_=function(e){o.call(t,e)},f=function(){var e;return a&&!h?(t._readableState&&t._readableState.ended||(e=new r),o.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new r),o.call(t,e)):void 0},p=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",f),t.req?p():t.on("request",p)):s&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",d),t.on("finish",u),!1!==i.error&&t.on("error",_),t.on("close",f),function(){t.removeListener("complete",u),t.removeListener("abort",f),t.removeListener("request",p),t.req&&t.req.removeListener("finish",u),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",u),t.removeListener("end",d),t.removeListener("error",_),t.removeListener("close",f)}}},5157:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},7758:(e,t,i)=>{"use strict";var r,n=i(6048).F,o=n.ERR_MISSING_ARGS,a=n.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function l(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var u,h=function(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var d=t.map((function(e,n){var o=n<t.length-1;return function(e,t,n,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;e.on("close",(function(){s=!0})),void 0===r&&(r=i(6238)),r(e,{readable:t,writable:n},(function(e){if(e)return o(e);s=!0,o()}));var l=!1;return function(t){if(!s&&!l)return l=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new a("pipe"))}}(e,o,n>0,(function(e){u||(u=e),e&&d.forEach(l),o||(d.forEach(l),h(u))}))}));return t.reduce(c)}},5291:(e,t,i)=>{"use strict";var r=i(6048).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,i,n){var o=function(e,t,i){return null!=e.highWaterMark?e.highWaterMark:t?e[i]:null}(t,n,i);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(n?i:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},345:(e,t,i)=>{e.exports=i(7007).EventEmitter},2861:(e,t,i)=>{var r=i(8287),n=r.Buffer;function o(e,t){for(var i in e)t[i]=e[i]}function a(e,t,i){return n(e,t,i)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),a.prototype=Object.create(n.prototype),o(n,a),a.from=function(e,t,i){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,i)},a.alloc=function(e,t,i){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"==typeof i?r.fill(t,i):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},4043:(e,t,i)=>{!function(e){e.parser=function(e,t){return new n(e,t)},e.SAXParser=n,e.SAXStream=a,e.createStream=function(e,t){return new a(e,t)},e.MAX_BUFFER_LENGTH=65536;var t,r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function n(t,i){if(!(this instanceof n))return new n(t,i);var o=this;!function(e){for(var t=0,i=r.length;t<i;t++)e[r[t]]=""}(o),o.q=o.c="",o.bufferCheckPosition=e.MAX_BUFFER_LENGTH,o.opt=i||{},o.opt.lowercase=o.opt.lowercase||o.opt.lowercasetags,o.looseCase=o.opt.lowercase?"toLowerCase":"toUpperCase",o.tags=[],o.closed=o.closedRoot=o.sawRoot=!1,o.tag=o.error=null,o.strict=!!t,o.noscript=!(!t&&!o.opt.noscript),o.state=S.BEGIN,o.strictEntities=o.opt.strictEntities,o.ENTITIES=o.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),o.attribList=[],o.opt.xmlns&&(o.ns=Object.create(h)),void 0===o.opt.unquotedAttributeValues&&(o.opt.unquotedAttributeValues=!t),o.trackPosition=!1!==o.opt.position,o.trackPosition&&(o.position=o.line=o.column=0),E(o,"onready")}e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i);return t}),n.prototype={end:function(){A(this)},write:function(t){var i=this;if(this.error)throw this.error;if(i.closed)return O(i,"Cannot write after close. Assign an onready handler.");if(null===t)return A(i);"object"==typeof t&&(t=t.toString());for(var n=0,o="";o=z(t,n++),i.c=o,o;)switch(i.trackPosition&&(i.position++,"\n"===o?(i.line++,i.column=0):i.column++),i.state){case S.BEGIN:if(i.state=S.BEGIN_WHITESPACE,"\ufeff"===o)continue;V(i,o);continue;case S.BEGIN_WHITESPACE:V(i,o);continue;case S.TEXT:if(i.sawRoot&&!i.closedRoot){for(var a=n-1;o&&"<"!==o&&"&"!==o;)(o=z(t,n++))&&i.trackPosition&&(i.position++,"\n"===o?(i.line++,i.column=0):i.column++);i.textNode+=t.substring(a,n-1)}"<"!==o||i.sawRoot&&i.closedRoot&&!i.strict?(m(o)||i.sawRoot&&!i.closedRoot||R(i,"Text data outside of root node."),"&"===o?i.state=S.TEXT_ENTITY:i.textNode+=o):(i.state=S.OPEN_WAKA,i.startTagPosition=i.position);continue;case S.SCRIPT:"<"===o?i.state=S.SCRIPT_ENDING:i.script+=o;continue;case S.SCRIPT_ENDING:"/"===o?i.state=S.CLOSE_TAG:(i.script+="<"+o,i.state=S.SCRIPT);continue;case S.OPEN_WAKA:if("!"===o)i.state=S.SGML_DECL,i.sgmlDecl="";else if(m(o));else if(b(d,o))i.state=S.OPEN_TAG,i.tagName=o;else if("/"===o)i.state=S.CLOSE_TAG,i.tagName="";else if("?"===o)i.state=S.PROC_INST,i.procInstName=i.procInstBody="";else{if(R(i,"Unencoded <"),i.startTagPosition+1<i.position){var c=i.position-i.startTagPosition;o=new Array(c).join(" ")+o}i.textNode+="<"+o,i.state=S.TEXT}continue;case S.SGML_DECL:if(i.sgmlDecl+o==="--"){i.state=S.COMMENT,i.comment="",i.sgmlDecl="";continue}i.doctype&&!0!==i.doctype&&i.sgmlDecl?(i.state=S.DOCTYPE_DTD,i.doctype+="<!"+i.sgmlDecl+o,i.sgmlDecl=""):(i.sgmlDecl+o).toUpperCase()===s?(w(i,"onopencdata"),i.state=S.CDATA,i.sgmlDecl="",i.cdata=""):(i.sgmlDecl+o).toUpperCase()===l?(i.state=S.DOCTYPE,(i.doctype||i.sawRoot)&&R(i,"Inappropriately located doctype declaration"),i.doctype="",i.sgmlDecl=""):">"===o?(w(i,"onsgmldeclaration",i.sgmlDecl),i.sgmlDecl="",i.state=S.TEXT):g(o)?(i.state=S.SGML_DECL_QUOTED,i.sgmlDecl+=o):i.sgmlDecl+=o;continue;case S.SGML_DECL_QUOTED:o===i.q&&(i.state=S.SGML_DECL,i.q=""),i.sgmlDecl+=o;continue;case S.DOCTYPE:">"===o?(i.state=S.TEXT,w(i,"ondoctype",i.doctype),i.doctype=!0):(i.doctype+=o,"["===o?i.state=S.DOCTYPE_DTD:g(o)&&(i.state=S.DOCTYPE_QUOTED,i.q=o));continue;case S.DOCTYPE_QUOTED:i.doctype+=o,o===i.q&&(i.q="",i.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:"]"===o?(i.doctype+=o,i.state=S.DOCTYPE):"<"===o?(i.state=S.OPEN_WAKA,i.startTagPosition=i.position):g(o)?(i.doctype+=o,i.state=S.DOCTYPE_DTD_QUOTED,i.q=o):i.doctype+=o;continue;case S.DOCTYPE_DTD_QUOTED:i.doctype+=o,o===i.q&&(i.state=S.DOCTYPE_DTD,i.q="");continue;case S.COMMENT:"-"===o?i.state=S.COMMENT_ENDING:i.comment+=o;continue;case S.COMMENT_ENDING:"-"===o?(i.state=S.COMMENT_ENDED,i.comment=M(i.opt,i.comment),i.comment&&w(i,"oncomment",i.comment),i.comment=""):(i.comment+="-"+o,i.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==o?(R(i,"Malformed comment"),i.comment+="--"+o,i.state=S.COMMENT):i.doctype&&!0!==i.doctype?i.state=S.DOCTYPE_DTD:i.state=S.TEXT;continue;case S.CDATA:"]"===o?i.state=S.CDATA_ENDING:i.cdata+=o;continue;case S.CDATA_ENDING:"]"===o?i.state=S.CDATA_ENDING_2:(i.cdata+="]"+o,i.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===o?(i.cdata&&w(i,"oncdata",i.cdata),w(i,"onclosecdata"),i.cdata="",i.state=S.TEXT):"]"===o?i.cdata+="]":(i.cdata+="]]"+o,i.state=S.CDATA);continue;case S.PROC_INST:"?"===o?i.state=S.PROC_INST_ENDING:m(o)?i.state=S.PROC_INST_BODY:i.procInstName+=o;continue;case S.PROC_INST_BODY:if(!i.procInstBody&&m(o))continue;"?"===o?i.state=S.PROC_INST_ENDING:i.procInstBody+=o;continue;case S.PROC_INST_ENDING:">"===o?(w(i,"onprocessinginstruction",{name:i.procInstName,body:i.procInstBody}),i.procInstName=i.procInstBody="",i.state=S.TEXT):(i.procInstBody+="?"+o,i.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:b(_,o)?i.tagName+=o:(L(i),">"===o?D(i):"/"===o?i.state=S.OPEN_TAG_SLASH:(m(o)||R(i,"Invalid character in tag name"),i.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===o?(D(i,!0),N(i)):(R(i,"Forward-slash in opening tag not followed by >"),i.state=S.ATTRIB);continue;case S.ATTRIB:if(m(o))continue;">"===o?D(i):"/"===o?i.state=S.OPEN_TAG_SLASH:b(d,o)?(i.attribName=o,i.attribValue="",i.state=S.ATTRIB_NAME):R(i,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===o?i.state=S.ATTRIB_VALUE:">"===o?(R(i,"Attribute without value"),i.attribValue=i.attribName,F(i),D(i)):m(o)?i.state=S.ATTRIB_NAME_SAW_WHITE:b(_,o)?i.attribName+=o:R(i,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===o)i.state=S.ATTRIB_VALUE;else{if(m(o))continue;R(i,"Attribute without value"),i.tag.attributes[i.attribName]="",i.attribValue="",w(i,"onattribute",{name:i.attribName,value:""}),i.attribName="",">"===o?D(i):b(d,o)?(i.attribName=o,i.state=S.ATTRIB_NAME):(R(i,"Invalid attribute name"),i.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(m(o))continue;g(o)?(i.q=o,i.state=S.ATTRIB_VALUE_QUOTED):(i.opt.unquotedAttributeValues||O(i,"Unquoted attribute value"),i.state=S.ATTRIB_VALUE_UNQUOTED,i.attribValue=o);continue;case S.ATTRIB_VALUE_QUOTED:if(o!==i.q){"&"===o?i.state=S.ATTRIB_VALUE_ENTITY_Q:i.attribValue+=o;continue}F(i),i.q="",i.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:m(o)?i.state=S.ATTRIB:">"===o?D(i):"/"===o?i.state=S.OPEN_TAG_SLASH:b(d,o)?(R(i,"No whitespace between attributes"),i.attribName=o,i.attribValue="",i.state=S.ATTRIB_NAME):R(i,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(!v(o)){"&"===o?i.state=S.ATTRIB_VALUE_ENTITY_U:i.attribValue+=o;continue}F(i),">"===o?D(i):i.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(i.tagName)">"===o?N(i):b(_,o)?i.tagName+=o:i.script?(i.script+="</"+i.tagName,i.tagName="",i.state=S.SCRIPT):(m(o)||R(i,"Invalid tagname in closing tag"),i.state=S.CLOSE_TAG_SAW_WHITE);else{if(m(o))continue;y(d,o)?i.script?(i.script+="</"+o,i.state=S.SCRIPT):R(i,"Invalid tagname in closing tag."):i.tagName=o}continue;case S.CLOSE_TAG_SAW_WHITE:if(m(o))continue;">"===o?N(i):R(i,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var u,h;switch(i.state){case S.TEXT_ENTITY:u=S.TEXT,h="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:u=S.ATTRIB_VALUE_QUOTED,h="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:u=S.ATTRIB_VALUE_UNQUOTED,h="attribValue"}if(";"===o){var x=k(i);i.opt.unparsedEntities&&!Object.values(e.XML_ENTITIES).includes(x)?(i.entity="",i.state=u,i.write(x)):(i[h]+=x,i.entity="",i.state=u)}else b(i.entity.length?p:f,o)?i.entity+=o:(R(i,"Invalid character in entity name"),i[h]+="&"+i.entity+o,i.entity="",i.state=u);continue;default:throw new Error(i,"Unknown state: "+i.state)}return i.position>=i.bufferCheckPosition&&function(t){for(var i=Math.max(e.MAX_BUFFER_LENGTH,10),n=0,o=0,a=r.length;o<a;o++){var s=t[r[o]].length;if(s>i)switch(r[o]){case"textNode":I(t);break;case"cdata":w(t,"oncdata",t.cdata),t.cdata="";break;case"script":w(t,"onscript",t.script),t.script="";break;default:O(t,"Max buffer length exceeded: "+r[o])}n=Math.max(n,s)}var l=e.MAX_BUFFER_LENGTH-n;t.bufferCheckPosition=l+t.position}(i),i},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;I(e=this),""!==e.cdata&&(w(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(w(e,"onscript",e.script),e.script="")}};try{t=i(8310).Stream}catch(e){t=function(){}}t||(t=function(){});var o=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function a(e,i){if(!(this instanceof a))return new a(e,i);t.apply(this),this._parser=new n(e,i),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit("end")},this._parser.onerror=function(e){r.emit("error",e),r._parser.error=null},this._decoder=null,o.forEach((function(e){Object.defineProperty(r,"on"+e,{get:function(){return r._parser["on"+e]},set:function(t){if(!t)return r.removeAllListeners(e),r._parser["on"+e]=t,t;r.on(e,t)},enumerable:!0,configurable:!1})}))}a.prototype=Object.create(t.prototype,{constructor:{value:a}}),a.prototype.write=function(e){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e)){if(!this._decoder){var t=i(3141).I;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},a.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},a.prototype.on=function(e,i){var r=this;return r._parser["on"+e]||-1===o.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),t.prototype.on.call(r,e,i)};var s="[CDATA[",l="DOCTYPE",c="http://www.w3.org/XML/1998/namespace",u="http://www.w3.org/2000/xmlns/",h={xml:c,xmlns:u},d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function m(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function g(e){return'"'===e||"'"===e}function v(e){return">"===e||m(e)}function b(e,t){return e.test(t)}function y(e,t){return!b(e,t)}var x,T,C,S=0;for(var P in e.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach((function(t){var i=e.ENTITIES[t],r="number"==typeof i?String.fromCharCode(i):i;e.ENTITIES[t]=r})),e.STATE)e.STATE[e.STATE[P]]=P;function E(e,t,i){e[t]&&e[t](i)}function w(e,t,i){e.textNode&&I(e),E(e,t,i)}function I(e){e.textNode=M(e.opt,e.textNode),e.textNode&&E(e,"ontext",e.textNode),e.textNode=""}function M(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function O(e,t){return I(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,E(e,"onerror",t),e}function A(e){return e.sawRoot&&!e.closedRoot&&R(e,"Unclosed root tag"),e.state!==S.BEGIN&&e.state!==S.BEGIN_WHITESPACE&&e.state!==S.TEXT&&O(e,"Unexpected end"),I(e),e.c="",e.closed=!0,E(e,"onend"),n.call(e,e.strict,e.opt),e}function R(e,t){if("object"!=typeof e||!(e instanceof n))throw new Error("bad call to strictFail");e.strict&&O(e,t)}function L(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,i=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(i.ns=t.ns),e.attribList.length=0,w(e,"onopentagstart",i)}function B(e,t){var i=e.indexOf(":")<0?["",e]:e.split(":"),r=i[0],n=i[1];return t&&"xmlns"===e&&(r="xmlns",n=""),{prefix:r,local:n}}function F(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=B(e.attribName,!0),i=t.prefix,r=t.local;if("xmlns"===i)if("xml"===r&&e.attribValue!==c)R(e,"xml: prefix must be bound to "+c+"\nActual: "+e.attribValue);else if("xmlns"===r&&e.attribValue!==u)R(e,"xmlns: prefix must be bound to "+u+"\nActual: "+e.attribValue);else{var n=e.tag,o=e.tags[e.tags.length-1]||e;n.ns===o.ns&&(n.ns=Object.create(o.ns)),n.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,w(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function D(e,t){if(e.opt.xmlns){var i=e.tag,r=B(e.tagName);i.prefix=r.prefix,i.local=r.local,i.uri=i.ns[r.prefix]||"",i.prefix&&!i.uri&&(R(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),i.uri=r.prefix);var n=e.tags[e.tags.length-1]||e;i.ns&&n.ns!==i.ns&&Object.keys(i.ns).forEach((function(t){w(e,"onopennamespace",{prefix:t,uri:i.ns[t]})}));for(var o=0,a=e.attribList.length;o<a;o++){var s=e.attribList[o],l=s[0],c=s[1],u=B(l,!0),h=u.prefix,d=u.local,_=""===h?"":i.ns[h]||"",f={name:l,value:c,prefix:h,local:d,uri:_};h&&"xmlns"!==h&&!_&&(R(e,"Unbound namespace prefix: "+JSON.stringify(h)),f.uri=h),e.tag.attributes[l]=f,w(e,"onattribute",f)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),w(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=S.TEXT:e.state=S.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function N(e){if(!e.tagName)return R(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=S.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=S.SCRIPT);w(e,"onscript",e.script),e.script=""}var t=e.tags.length,i=e.tagName;e.strict||(i=i[e.looseCase]());for(var r=i;t--&&e.tags[t].name!==r;)R(e,"Unexpected close tag");if(t<0)return R(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=S.TEXT);e.tagName=i;for(var n=e.tags.length;n-- >t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,w(e,"onclosetag",e.tagName);var a={};for(var s in o.ns)a[s]=o.ns[s];var l=e.tags[e.tags.length-1]||e;e.opt.xmlns&&o.ns!==l.ns&&Object.keys(o.ns).forEach((function(t){var i=o.ns[t];w(e,"onclosenamespace",{prefix:t,uri:i})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=S.TEXT}function k(e){var t,i=e.entity,r=i.toLowerCase(),n="";return e.ENTITIES[i]?e.ENTITIES[i]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(i=r).charAt(0)&&("x"===i.charAt(1)?(i=i.slice(2),n=(t=parseInt(i,16)).toString(16)):(i=i.slice(1),n=(t=parseInt(i,10)).toString(10))),i=i.replace(/^0+/,""),isNaN(t)||n.toLowerCase()!==i?(R(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function V(e,t){"<"===t?(e.state=S.OPEN_WAKA,e.startTagPosition=e.position):m(t)||(R(e,"Non-whitespace before first tag."),e.textNode=t,e.state=S.TEXT)}function z(e,t){var i="";return t<e.length&&(i=e.charAt(t)),i}S=e.STATE,String.fromCodePoint||(x=String.fromCharCode,T=Math.floor,C=function(){var e,t,i=[],r=-1,n=arguments.length;if(!n)return"";for(var o="";++r<n;){var a=Number(arguments[r]);if(!isFinite(a)||a<0||a>1114111||T(a)!==a)throw RangeError("Invalid code point: "+a);a<=65535?i.push(a):(e=55296+((a-=65536)>>10),t=a%1024+56320,i.push(e,t)),(r+1===n||i.length>16384)&&(o+=x.apply(null,i),i.length=0)}return o},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:C,configurable:!0,writable:!0}):String.fromCodePoint=C)}(t)},2791:function(e,t,i){!function(e){"use strict";if(!e.setImmediate){var t,i,r,n,o,a=1,s={},l=!1,c=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?t=function(e){process.nextTick((function(){d(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,i=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=i,t}}()?(n="setImmediate$"+Math.random()+"$",o=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(n)&&d(+t.data.slice(n.length))},e.addEventListener?e.addEventListener("message",o,!1):e.attachEvent("onmessage",o),t=function(t){e.postMessage(n+t,"*")}):e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){d(e.data)},t=function(e){r.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,t=function(e){var t=c.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):t=function(e){setTimeout(d,0,e)},u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var i=new Array(arguments.length-1),r=0;r<i.length;r++)i[r]=arguments[r+1];var n={callback:e,args:i};return s[a]=n,t(a),a++},u.clearImmediate=h}function h(e){delete s[e]}function d(e){if(l)setTimeout(d,0,e);else{var t=s[e];if(t){l=!0;try{!function(e){var t=e.callback,i=e.args;switch(i.length){case 0:t();break;case 1:t(i[0]);break;case 2:t(i[0],i[1]);break;case 3:t(i[0],i[1],i[2]);break;default:t.apply(void 0,i)}}(t)}finally{h(e),l=!1}}}}}("undefined"==typeof self?void 0===i.g?this:i.g:self)},8310:(e,t,i)=>{e.exports=n;var r=i(7007).EventEmitter;function n(){r.call(this)}i(6698)(n,r),n.Readable=i(5412),n.Writable=i(6708),n.Duplex=i(5382),n.Transform=i(4610),n.PassThrough=i(3600),n.finished=i(6238),n.pipeline=i(7758),n.Stream=n,n.prototype.pipe=function(e,t){var i=this;function n(t){e.writable&&!1===e.write(t)&&i.pause&&i.pause()}function o(){i.readable&&i.resume&&i.resume()}i.on("data",n),e.on("drain",o),e._isStdio||t&&!1===t.end||(i.on("end",s),i.on("close",l));var a=!1;function s(){a||(a=!0,e.end())}function l(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(u(),0===r.listenerCount(this,"error"))throw e}function u(){i.removeListener("data",n),e.removeListener("drain",o),i.removeListener("end",s),i.removeListener("close",l),i.removeListener("error",c),e.removeListener("error",c),i.removeListener("end",u),i.removeListener("close",u),e.removeListener("close",u)}return i.on("error",c),e.on("error",c),i.on("end",u),i.on("close",u),e.on("close",u),e.emit("pipe",i),e}},3141:(e,t,i)=>{"use strict";var r=i(2861).Buffer,n=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=u,this.end=h,t=3;break;default:return this.write=d,void(this.end=_)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,i=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==i?i:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var i=e.toString("utf16le",t);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}function u(e,t){var i=(e.length-t)%3;return 0===i?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-i))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function _(e){return e&&e.length?this.write(e):""}t.I=o,o.prototype.write=function(e){if(0===e.length)return"";var t,i;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<e.length?t?t+this.text(e,i):this.text(e,i):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var i=function(e,t,i){var r=t.length-1;if(r<i)return 0;var n=a(t[r]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--r<i||-2===n?0:(n=a(t[r]))>=0?(n>0&&(e.lastNeed=n-2),n):--r<i||-2===n?0:(n=a(t[r]))>=0?(n>0&&(2===n?n=0:e.lastNeed=n-3),n):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var r=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},7103:function(e,t,i){var r=void 0!==i.g&&i.g||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(n.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new o(n.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},i(2791),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==i.g&&i.g.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==i.g&&i.g.clearImmediate||this&&this.clearImmediate},4643:(e,t,i)=>{function r(e){try{if(!i.g.localStorage)return!1}catch(e){return!1}var t=i.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var i=!1;return function(){if(!i){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}}},3177:function(e,t){(function(){"use strict";t.stripBOM=function(e){return"\ufeff"===e[0]?e.substring(1):e}}).call(this)},6712:function(e,t,i){(function(){"use strict";var e,r,n,o,a,s={}.hasOwnProperty;e=i(9665),r=i(6465).defaults,o=function(e){return"string"==typeof e&&(e.indexOf("&")>=0||e.indexOf(">")>=0||e.indexOf("<")>=0)},a=function(e){return"<![CDATA["+n(e)+"]]>"},n=function(e){return e.replace("]]>","]]]]><![CDATA[>")},t.Builder=function(){function t(e){var t,i,n;for(t in this.options={},i=r[.2])s.call(i,t)&&(n=i[t],this.options[t]=n);for(t in e)s.call(e,t)&&(n=e[t],this.options[t]=n)}return t.prototype.buildObject=function(t){var i,n,l,c,u,h;return i=this.options.attrkey,n=this.options.charkey,1===Object.keys(t).length&&this.options.rootName===r[.2].rootName?t=t[u=Object.keys(t)[0]]:u=this.options.rootName,h=this,l=function(e,t){var r,c,u,d,_,f;if("object"!=typeof t)h.options.cdata&&o(t)?e.raw(a(t)):e.txt(t);else if(Array.isArray(t)){for(d in t)if(s.call(t,d))for(_ in c=t[d])u=c[_],e=l(e.ele(_),u).up()}else for(_ in t)if(s.call(t,_))if(c=t[_],_===i){if("object"==typeof c)for(r in c)f=c[r],e=e.att(r,f)}else if(_===n)e=h.options.cdata&&o(c)?e.raw(a(c)):e.txt(c);else if(Array.isArray(c))for(d in c)s.call(c,d)&&(e="string"==typeof(u=c[d])?h.options.cdata&&o(u)?e.ele(_).raw(a(u)).up():e.ele(_,u).up():l(e.ele(_),u).up());else"object"==typeof c?e=l(e.ele(_),c).up():"string"==typeof c&&h.options.cdata&&o(c)?e=e.ele(_).raw(a(c)).up():(null==c&&(c=""),e=e.ele(_,c.toString()).up());return e},c=e.create(u,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),l(c,t).end(this.options.renderOpts)},t}()}).call(this)},6465:function(e,t){(function(){t.defaults={.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:"\n"},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(this)},1912:function(e,t,i){(function(){"use strict";var e,r,n,o,a,s,l,c,u,h=function(e,t){return function(){return e.apply(t,arguments)}},d={}.hasOwnProperty;c=i(4043),o=i(7007),e=i(3177),l=i(2114),u=i(7103).setImmediate,r=i(6465).defaults,a=function(e){return"object"==typeof e&&null!=e&&0===Object.keys(e).length},s=function(e,t,i){var r,n;for(r=0,n=e.length;r<n;r++)t=(0,e[r])(t,i);return t},n=function(e,t,i){var r;return(r=Object.create(null)).value=i,r.writable=!0,r.enumerable=!0,r.configurable=!0,Object.defineProperty(e,t,r)},t.Parser=function(i){function o(e){var i,n,o;if(this.parseStringPromise=h(this.parseStringPromise,this),this.parseString=h(this.parseString,this),this.reset=h(this.reset,this),this.assignOrPush=h(this.assignOrPush,this),this.processAsync=h(this.processAsync,this),!(this instanceof t.Parser))return new t.Parser(e);for(i in this.options={},n=r[.2])d.call(n,i)&&(o=n[i],this.options[i]=o);for(i in e)d.call(e,i)&&(o=e[i],this.options[i]=o);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(l.normalize)),this.reset()}return function(e,t){for(var i in t)d.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(o,i),o.prototype.processAsync=function(){var e,t;try{return this.remaining.length<=this.options.chunkSize?(e=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(e),this.saxParser.close()):(e=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(e),u(this.processAsync))}catch(e){if(t=e,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(t)}},o.prototype.assignOrPush=function(e,t,i){return t in e?(e[t]instanceof Array||n(e,t,[e[t]]),e[t].push(i)):this.options.explicitArray?n(e,t,[i]):n(e,t,i)},o.prototype.reset=function(){var e,t,i,r,o;return this.removeAllListeners(),this.saxParser=c.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(o=this,function(e){if(o.saxParser.resume(),!o.saxParser.errThrown)return o.saxParser.errThrown=!0,o.emit("error",e)}),this.saxParser.onend=function(e){return function(){if(!e.saxParser.ended)return e.saxParser.ended=!0,e.emit("end",e.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,r=[],e=this.options.attrkey,t=this.options.charkey,this.saxParser.onopentag=function(i){return function(o){var a,l,c,u,h;if((c={})[t]="",!i.options.ignoreAttrs)for(a in h=o.attributes)d.call(h,a)&&(e in c||i.options.mergeAttrs||(c[e]={}),l=i.options.attrValueProcessors?s(i.options.attrValueProcessors,o.attributes[a],a):o.attributes[a],u=i.options.attrNameProcessors?s(i.options.attrNameProcessors,a):a,i.options.mergeAttrs?i.assignOrPush(c,u,l):n(c[e],u,l));return c["#name"]=i.options.tagNameProcessors?s(i.options.tagNameProcessors,o.name):o.name,i.options.xmlns&&(c[i.options.xmlnskey]={uri:o.uri,local:o.local}),r.push(c)}}(this),this.saxParser.onclosetag=function(e){return function(){var i,o,l,c,u,h,_,f,p,m;if(h=r.pop(),u=h["#name"],e.options.explicitChildren&&e.options.preserveChildrenOrder||delete h["#name"],!0===h.cdata&&(i=h.cdata,delete h.cdata),p=r[r.length-1],h[t].match(/^\s*$/)&&!i?(o=h[t],delete h[t]):(e.options.trim&&(h[t]=h[t].trim()),e.options.normalize&&(h[t]=h[t].replace(/\s{2,}/g," ").trim()),h[t]=e.options.valueProcessors?s(e.options.valueProcessors,h[t],u):h[t],1===Object.keys(h).length&&t in h&&!e.EXPLICIT_CHARKEY&&(h=h[t])),a(h)&&(h="function"==typeof e.options.emptyTag?e.options.emptyTag():""!==e.options.emptyTag?e.options.emptyTag:o),null!=e.options.validator&&(m="/"+function(){var e,t,i;for(i=[],e=0,t=r.length;e<t;e++)c=r[e],i.push(c["#name"]);return i}().concat(u).join("/"),function(){var t;try{return h=e.options.validator(m,p&&p[u],h)}catch(i){return t=i,e.emit("error",t)}}()),e.options.explicitChildren&&!e.options.mergeAttrs&&"object"==typeof h)if(e.options.preserveChildrenOrder){if(p){for(l in p[e.options.childkey]=p[e.options.childkey]||[],_={},h)d.call(h,l)&&n(_,l,h[l]);p[e.options.childkey].push(_),delete h["#name"],1===Object.keys(h).length&&t in h&&!e.EXPLICIT_CHARKEY&&(h=h[t])}}else c={},e.options.attrkey in h&&(c[e.options.attrkey]=h[e.options.attrkey],delete h[e.options.attrkey]),!e.options.charsAsChildren&&e.options.charkey in h&&(c[e.options.charkey]=h[e.options.charkey],delete h[e.options.charkey]),Object.getOwnPropertyNames(h).length>0&&(c[e.options.childkey]=h),h=c;return r.length>0?e.assignOrPush(p,u,h):(e.options.explicitRoot&&(f=h,n(h={},u,f)),e.resultObject=h,e.saxParser.ended=!0,e.emit("end",e.resultObject))}}(this),i=function(e){return function(i){var n,o;if(o=r[r.length-1])return o[t]+=i,e.options.explicitChildren&&e.options.preserveChildrenOrder&&e.options.charsAsChildren&&(e.options.includeWhiteChars||""!==i.replace(/\\n/g,"").trim())&&(o[e.options.childkey]=o[e.options.childkey]||[],(n={"#name":"__text__"})[t]=i,e.options.normalize&&(n[t]=n[t].replace(/\s{2,}/g," ").trim()),o[e.options.childkey].push(n)),o}}(this),this.saxParser.ontext=i,this.saxParser.oncdata=function(e){var t;if(t=i(e))return t.cdata=!0}},o.prototype.parseString=function(t,i){var r;null!=i&&"function"==typeof i&&(this.on("end",(function(e){return this.reset(),i(null,e)})),this.on("error",(function(e){return this.reset(),i(e)})));try{return""===(t=t.toString()).trim()?(this.emit("end",null),!0):(t=e.stripBOM(t),this.options.async?(this.remaining=t,u(this.processAsync),this.saxParser):this.saxParser.write(t).close())}catch(e){if(r=e,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",r),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw r}},o.prototype.parseStringPromise=function(e){return new Promise((t=this,function(i,r){return t.parseString(e,(function(e,t){return e?r(e):i(t)}))}));var t},o}(o),t.parseString=function(e,i,r){var n,o;return null!=r?("function"==typeof r&&(n=r),"object"==typeof i&&(o=i)):("function"==typeof i&&(n=i),o={}),new t.Parser(o).parseString(e,n)},t.parseStringPromise=function(e,i){var r;return"object"==typeof i&&(r=i),new t.Parser(r).parseStringPromise(e)}}).call(this)},2114:function(e,t){(function(){"use strict";var e;e=new RegExp(/(?!xmlns)^.*:/),t.normalize=function(e){return e.toLowerCase()},t.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},t.stripPrefix=function(t){return t.replace(e,"")},t.parseNumbers=function(e){return isNaN(e)||(e=e%1==0?parseInt(e,10):parseFloat(e)),e},t.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e="true"===e.toLowerCase()),e}}).call(this)},8805:function(e,t,i){(function(){"use strict";var e,r,n,o,a={}.hasOwnProperty;r=i(6465),e=i(6712),n=i(1912),o=i(2114),t.defaults=r.defaults,t.processors=o,t.ValidationError=function(){function e(e){this.message=e}return function(e,t){for(var i in t)a.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(e,Error),e}(),t.Builder=e.Builder,t.Parser=n.Parser,t.parseString=n.parseString,t.parseStringPromise=n.parseStringPromise}).call(this)},4923:function(e){(function(){e.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},1737:function(e){(function(){e.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},9241:function(e){(function(){var t,i,r,n,o,a,s,l=[].slice,c={}.hasOwnProperty;t=function(){var e,t,i,r,n,a;if(a=arguments[0],n=2<=arguments.length?l.call(arguments,1):[],o(Object.assign))Object.assign.apply(null,arguments);else for(e=0,i=n.length;e<i;e++)if(null!=(r=n[e]))for(t in r)c.call(r,t)&&(a[t]=r[t]);return a},o=function(e){return!!e&&"[object Function]"===Object.prototype.toString.call(e)},a=function(e){var t;return!!e&&("function"==(t=typeof e)||"object"===t)},r=function(e){return o(Array.isArray)?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)},n=function(e){var t;if(r(e))return!e.length;for(t in e)if(c.call(e,t))return!1;return!0},s=function(e){var t,i;return a(e)&&(i=Object.getPrototypeOf(e))&&(t=i.constructor)&&"function"==typeof t&&t instanceof t&&Function.prototype.toString.call(t)===Function.prototype.toString.call(Object)},i=function(e){return o(e.valueOf)?e.valueOf():e},e.exports.assign=t,e.exports.isFunction=o,e.exports.isObject=a,e.exports.isArray=r,e.exports.isEmpty=n,e.exports.isPlainObject=s,e.exports.getValue=i}).call(this)},8753:function(e){(function(){e.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},4238:function(e,t,i){(function(){var t;t=i(1737),i(468),e.exports=function(){function e(e,i,r){if(this.parent=e,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),null==i)throw new Error("Missing attribute name. "+this.debugInfo(i));this.name=this.stringify.name(i),this.value=this.stringify.attValue(r),this.type=t.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(e.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(e.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}}),Object.defineProperty(e.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(e.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(e.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(e.prototype,"specified",{get:function(){return!0}}),e.prototype.clone=function(){return Object.create(this)},e.prototype.toString=function(e){return this.options.writer.attribute(this,this.options.writer.filterOptions(e))},e.prototype.debugInfo=function(e){return null==(e=e||this.name)?"parent: <"+this.parent.name+">":"attribute: {"+e+"}, parent: <"+this.parent.name+">"},e.prototype.isEqualNode=function(e){return e.namespaceURI===this.namespaceURI&&e.prefix===this.prefix&&e.localName===this.localName&&e.value===this.value},e}()}).call(this)},2691:function(e,t,i){(function(){var t,r,n={}.hasOwnProperty;t=i(1737),r=i(7457),e.exports=function(e){function i(e,r){if(i.__super__.constructor.call(this,e),null==r)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=t.CData,this.value=this.stringify.cdata(r)}return function(e,t){for(var i in t)n.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(e){return this.options.writer.cdata(this,this.options.writer.filterOptions(e))},i}(r)}).call(this)},7457:function(e,t,i){(function(){var t,r={}.hasOwnProperty;t=i(468),e.exports=function(e){function t(e){t.__super__.constructor.call(this,e),this.value=""}return function(e,t){for(var i in t)r.call(t,i)&&(e[i]=t[i]);function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),Object.defineProperty(t.prototype,"data",{get:function(){return this.value},set:function(e){return this.value=e||""}}),Object.defineProperty(t.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(t.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}}),t.prototype.clone=function(){return Object.create(this)},t.prototype.substringData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.appendData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.insertData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.deleteData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.replaceData=function(e,t,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.isEqualNode=function(e){return!!t.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)&&e.data===this.data},t}(t)}).call(this)},2679:function(e,t,i){(function(){var t,r,n={}.hasOwnProperty;t=i(1737),r=i(7457),e.exports=function(e){function i(e,r){if(i.__super__.constructor.call(this,e),null==r)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=t.Comment,this.value=this.stringify.comment(r)}return function(e,t){for(var i in t)n.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(e){return this.options.writer.comment(this,this.options.writer.filterOptions(e))},i}(r)}).call(this)},3074:function(e,t,i){(function(){var t,r;t=i(5660),r=i(2527),e.exports=function(){function e(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new t,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=Object.create(this.defaultParams)}return Object.defineProperty(e.prototype,"parameterNames",{get:function(){return new r(Object.keys(this.defaultParams))}}),e.prototype.getParameter=function(e){return this.params.hasOwnProperty(e)?this.params[e]:null},e.prototype.canSetParameter=function(e,t){return!0},e.prototype.setParameter=function(e,t){return null!=t?this.params[e]=t:delete this.params[e]},e}()}).call(this)},5660:function(e){(function(){e.exports=function(){function e(){}return e.prototype.handleError=function(e){throw new Error(e)},e}()}).call(this)},7260:function(e){(function(){e.exports=function(){function e(){}return e.prototype.hasFeature=function(e,t){return!0},e.prototype.createDocumentType=function(e,t,i){throw new Error("This DOM method is not implemented.")},e.prototype.createDocument=function(e,t,i){throw new Error("This DOM method is not implemented.")},e.prototype.createHTMLDocument=function(e){throw new Error("This DOM method is not implemented.")},e.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented.")},e}()}).call(this)},2527:function(e){(function(){e.exports=function(){function e(e){this.arr=e||[]}return Object.defineProperty(e.prototype,"length",{get:function(){return this.arr.length}}),e.prototype.item=function(e){return this.arr[e]||null},e.prototype.contains=function(e){return-1!==this.arr.indexOf(e)},e}()}).call(this)},4111:function(e,t,i){(function(){var t,r,n={}.hasOwnProperty;r=i(468),t=i(1737),e.exports=function(e){function i(e,r,n,o,a,s){if(i.__super__.constructor.call(this,e),null==r)throw new Error("Missing DTD element name. "+this.debugInfo());if(null==n)throw new Error("Missing DTD attribute name. "+this.debugInfo(r));if(!o)throw new Error("Missing DTD attribute type. "+this.debugInfo(r));if(!a)throw new Error("Missing DTD attribute default. "+this.debugInfo(r));if(0!==a.indexOf("#")&&(a="#"+a),!a.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(r));if(s&&!a.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(r));this.elementName=this.stringify.name(r),this.type=t.AttributeDeclaration,this.attributeName=this.stringify.name(n),this.attributeType=this.stringify.dtdAttType(o),s&&(this.defaultValue=this.stringify.dtdAttDefault(s)),this.defaultValueType=a}return function(e,t){for(var i in t)n.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),i.prototype.toString=function(e){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(e))},i}(r)}).call(this)},7696:function(e,t,i){(function(){var t,r,n={}.hasOwnProperty;r=i(468),t=i(1737),e.exports=function(e){function i(e,r,n){if(i.__super__.constructor.call(this,e),null==r)throw new Error("Missing DTD element name. "+this.debugInfo());n||(n="(#PCDATA)"),Array.isArray(n)&&(n="("+n.join(",")+")"),this.name=this.stringify.name(r),this.type=t.ElementDeclaration,this.value=this.stringify.dtdElementValue(n)}return function(e,t){for(var i in t)n.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),i.prototype.toString=function(e){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(e))},i}(r)}).call(this)},5529:function(e,t,i){(function(){var t,r,n,o={}.hasOwnProperty;n=i(9241).isObject,r=i(468),t=i(1737),e.exports=function(e){function i(e,r,o,a){if(i.__super__.constructor.call(this,e),null==o)throw new Error("Missing DTD entity name. "+this.debugInfo(o));if(null==a)throw new Error("Missing DTD entity value. "+this.debugInfo(o));if(this.pe=!!r,this.name=this.stringify.name(o),this.type=t.EntityDeclaration,n(a)){if(!a.pubID&&!a.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(o));if(a.pubID&&!a.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(o));if(this.internal=!1,null!=a.pubID&&(this.pubID=this.stringify.dtdPubID(a.pubID)),null!=a.sysID&&(this.sysID=this.stringify.dtdSysID(a.sysID)),null!=a.nData&&(this.nData=this.stringify.dtdNData(a.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(o))}else this.value=this.stringify.dtdEntityValue(a),this.internal=!0}return function(e,t){for(var i in t)o.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(i.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(i.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(i.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(i.prototype,"xmlVersion",{get:function(){return null}}),i.prototype.toString=function(e){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(e))},i}(r)}).call(this)},8012:function(e,t,i){(function(){var t,r,n={}.hasOwnProperty;r=i(468),t=i(1737),e.exports=function(e){function i(e,r,n){if(i.__super__.constructor.call(this,e),null==r)throw new Error("Missing DTD notation name. "+this.debugInfo(r));if(!n.pubID&&!n.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(r));this.name=this.stringify.name(r),this.type=t.NotationDeclaration,null!=n.pubID&&(this.pubID=this.stringify.dtdPubID(n.pubID)),null!=n.sysID&&(this.sysID=this.stringify.dtdSysID(n.sysID))}return function(e,t){for(var i in t)n.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}}),i.prototype.toString=function(e){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(e))},i}(r)}).call(this)},4130:function(e,t,i){(function(){var t,r,n,o={}.hasOwnProperty;n=i(9241).isObject,r=i(468),t=i(1737),e.exports=function(e){function i(e,r,o,a){var s;i.__super__.constructor.call(this,e),n(r)&&(r=(s=r).version,o=s.encoding,a=s.standalone),r||(r="1.0"),this.type=t.Declaration,this.version=this.stringify.xmlVersion(r),null!=o&&(this.encoding=this.stringify.xmlEncoding(o)),null!=a&&(this.standalone=this.stringify.xmlStandalone(a))}return function(e,t){for(var i in t)o.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),i.prototype.toString=function(e){return this.options.writer.declaration(this,this.options.writer.filterOptions(e))},i}(r)}).call(this)},6376:function(e,t,i){(function(){var t,r,n,o,a,s,l,c,u={}.hasOwnProperty;c=i(9241).isObject,l=i(468),t=i(1737),r=i(4111),o=i(5529),n=i(7696),a=i(8012),s=i(4797),e.exports=function(e){function i(e,r,n){var o,a,s,l,u,h;if(i.__super__.constructor.call(this,e),this.type=t.DocType,e.children)for(a=0,s=(l=e.children).length;a<s;a++)if((o=l[a]).type===t.Element){this.name=o.name;break}this.documentObject=e,c(r)&&(r=(u=r).pubID,n=u.sysID),null==n&&(n=(h=[r,n])[0],r=h[1]),null!=r&&(this.pubID=this.stringify.dtdPubID(r)),null!=n&&(this.sysID=this.stringify.dtdSysID(n))}return function(e,t){for(var i in t)u.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),Object.defineProperty(i.prototype,"entities",{get:function(){var e,i,r,n,o;for(n={},i=0,r=(o=this.children).length;i<r;i++)(e=o[i]).type!==t.EntityDeclaration||e.pe||(n[e.name]=e);return new s(n)}}),Object.defineProperty(i.prototype,"notations",{get:function(){var e,i,r,n,o;for(n={},i=0,r=(o=this.children).length;i<r;i++)(e=o[i]).type===t.NotationDeclaration&&(n[e.name]=e);return new s(n)}}),Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(i.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),i.prototype.element=function(e,t){var i;return i=new n(this,e,t),this.children.push(i),this},i.prototype.attList=function(e,t,i,n,o){var a;return a=new r(this,e,t,i,n,o),this.children.push(a),this},i.prototype.entity=function(e,t){var i;return i=new o(this,!1,e,t),this.children.push(i),this},i.prototype.pEntity=function(e,t){var i;return i=new o(this,!0,e,t),this.children.push(i),this},i.prototype.notation=function(e,t){var i;return i=new a(this,e,t),this.children.push(i),this},i.prototype.toString=function(e){return this.options.writer.docType(this,this.options.writer.filterOptions(e))},i.prototype.ele=function(e,t){return this.element(e,t)},i.prototype.att=function(e,t,i,r,n){return this.attList(e,t,i,r,n)},i.prototype.ent=function(e,t){return this.entity(e,t)},i.prototype.pent=function(e,t){return this.pEntity(e,t)},i.prototype.not=function(e,t){return this.notation(e,t)},i.prototype.up=function(){return this.root()||this.documentObject},i.prototype.isEqualNode=function(e){return!!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)&&e.name===this.name&&e.publicId===this.publicId&&e.systemId===this.systemId},i}(l)}).call(this)},1933:function(e,t,i){(function(){var t,r,n,o,a,s,l,c={}.hasOwnProperty;l=i(9241).isPlainObject,n=i(7260),r=i(3074),o=i(468),t=i(1737),s=i(3976),a=i(382),e.exports=function(e){function i(e){i.__super__.constructor.call(this,null),this.name="#document",this.type=t.Document,this.documentURI=null,this.domConfig=new r,e||(e={}),e.writer||(e.writer=new a),this.options=e,this.stringify=new s(e)}return function(e,t){for(var i in t)c.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),Object.defineProperty(i.prototype,"implementation",{value:new n}),Object.defineProperty(i.prototype,"doctype",{get:function(){var e,i,r,n;for(i=0,r=(n=this.children).length;i<r;i++)if((e=n[i]).type===t.DocType)return e;return null}}),Object.defineProperty(i.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(i.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(i.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(i.prototype,"xmlEncoding",{get:function(){return 0!==this.children.length&&this.children[0].type===t.Declaration?this.children[0].encoding:null}}),Object.defineProperty(i.prototype,"xmlStandalone",{get:function(){return 0!==this.children.length&&this.children[0].type===t.Declaration&&"yes"===this.children[0].standalone}}),Object.defineProperty(i.prototype,"xmlVersion",{get:function(){return 0!==this.children.length&&this.children[0].type===t.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(i.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(i.prototype,"origin",{get:function(){return null}}),Object.defineProperty(i.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(i.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(i.prototype,"contentType",{get:function(){return null}}),i.prototype.end=function(e){var t;return t={},e?l(e)&&(t=e,e=this.options.writer):e=this.options.writer,e.document(this,e.filterOptions(t))},i.prototype.toString=function(e){return this.options.writer.document(this,this.options.writer.filterOptions(e))},i.prototype.createElement=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createTextNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createComment=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createCDATASection=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createProcessingInstruction=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createAttribute=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createEntityReference=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.importNode=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createElementNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByTagNameNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementById=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.adoptNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.renameNode=function(e,t,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByClassName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createEvent=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createNodeIterator=function(e,t,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createTreeWalker=function(e,t,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},i}(o)}).call(this)},400:function(e,t,i){(function(){var t,r,n,o,a,s,l,c,u,h,d,_,f,p,m,g,v,b,y,x,T,C,S,P={}.hasOwnProperty;S=i(9241),T=S.isObject,x=S.isFunction,C=S.isPlainObject,y=S.getValue,t=i(1737),_=i(1933),f=i(3906),o=i(2691),a=i(2679),m=i(1268),b=i(2535),p=i(5915),h=i(4130),d=i(6376),s=i(4111),c=i(5529),l=i(7696),u=i(8012),n=i(4238),v=i(3976),g=i(382),r=i(8753),e.exports=function(){function e(e,i,r){var n;this.name="?xml",this.type=t.Document,e||(e={}),n={},e.writer?C(e.writer)&&(n=e.writer,e.writer=new g):e.writer=new g,this.options=e,this.writer=e.writer,this.writerOptions=this.writer.filterOptions(n),this.stringify=new v(e),this.onDataCallback=i||function(){},this.onEndCallback=r||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return e.prototype.createChildNode=function(e){var i,r,n,o,a,s,l,c;switch(e.type){case t.CData:this.cdata(e.value);break;case t.Comment:this.comment(e.value);break;case t.Element:for(r in n={},l=e.attribs)P.call(l,r)&&(i=l[r],n[r]=i.value);this.node(e.name,n);break;case t.Dummy:this.dummy();break;case t.Raw:this.raw(e.value);break;case t.Text:this.text(e.value);break;case t.ProcessingInstruction:this.instruction(e.target,e.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+e.constructor.name)}for(a=0,s=(c=e.children).length;a<s;a++)o=c[a],this.createChildNode(o),o.type===t.Element&&this.up();return this},e.prototype.dummy=function(){return this},e.prototype.node=function(e,t,i){var r;if(null==e)throw new Error("Missing node name.");if(this.root&&-1===this.currentLevel)throw new Error("Document can only have one root node. "+this.debugInfo(e));return this.openCurrent(),e=y(e),null==t&&(t={}),t=y(t),T(t)||(i=(r=[t,i])[0],t=r[1]),this.currentNode=new f(this,e,t),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,null!=i&&this.text(i),this},e.prototype.element=function(e,i,r){var n,o,a,s,l,c;if(this.currentNode&&this.currentNode.type===t.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(e)||T(e)||x(e))for(s=this.options.noValidation,this.options.noValidation=!0,(c=new _(this.options).element("TEMP_ROOT")).element(e),this.options.noValidation=s,o=0,a=(l=c.children).length;o<a;o++)n=l[o],this.createChildNode(n),n.type===t.Element&&this.up();else this.node(e,i,r);return this},e.prototype.attribute=function(e,t){var i,r;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(e));if(null!=e&&(e=y(e)),T(e))for(i in e)P.call(e,i)&&(r=e[i],this.attribute(i,r));else x(t)&&(t=t.apply()),this.options.keepNullAttributes&&null==t?this.currentNode.attribs[e]=new n(this,e,""):null!=t&&(this.currentNode.attribs[e]=new n(this,e,t));return this},e.prototype.text=function(e){var t;return this.openCurrent(),t=new b(this,e),this.onData(this.writer.text(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},e.prototype.cdata=function(e){var t;return this.openCurrent(),t=new o(this,e),this.onData(this.writer.cdata(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},e.prototype.comment=function(e){var t;return this.openCurrent(),t=new a(this,e),this.onData(this.writer.comment(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},e.prototype.raw=function(e){var t;return this.openCurrent(),t=new m(this,e),this.onData(this.writer.raw(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},e.prototype.instruction=function(e,t){var i,r,n,o,a;if(this.openCurrent(),null!=e&&(e=y(e)),null!=t&&(t=y(t)),Array.isArray(e))for(i=0,o=e.length;i<o;i++)r=e[i],this.instruction(r);else if(T(e))for(r in e)P.call(e,r)&&(n=e[r],this.instruction(r,n));else x(t)&&(t=t.apply()),a=new p(this,e,t),this.onData(this.writer.processingInstruction(a,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},e.prototype.declaration=function(e,t,i){var r;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return r=new h(this,e,t,i),this.onData(this.writer.declaration(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},e.prototype.doctype=function(e,t,i){if(this.openCurrent(),null==e)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new d(this,t,i),this.currentNode.rootNodeName=e,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},e.prototype.dtdElement=function(e,t){var i;return this.openCurrent(),i=new l(this,e,t),this.onData(this.writer.dtdElement(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},e.prototype.attList=function(e,t,i,r,n){var o;return this.openCurrent(),o=new s(this,e,t,i,r,n),this.onData(this.writer.dtdAttList(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},e.prototype.entity=function(e,t){var i;return this.openCurrent(),i=new c(this,!1,e,t),this.onData(this.writer.dtdEntity(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},e.prototype.pEntity=function(e,t){var i;return this.openCurrent(),i=new c(this,!0,e,t),this.onData(this.writer.dtdEntity(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},e.prototype.notation=function(e,t){var i;return this.openCurrent(),i=new u(this,e,t),this.onData(this.writer.dtdNotation(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},e.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},e.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},e.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},e.prototype.openNode=function(e){var i,n,o,a;if(!e.isOpen){if(this.root||0!==this.currentLevel||e.type!==t.Element||(this.root=e),n="",e.type===t.Element){for(o in this.writerOptions.state=r.OpenTag,n=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<"+e.name,a=e.attribs)P.call(a,o)&&(i=a[o],n+=this.writer.attribute(i,this.writerOptions,this.currentLevel));n+=(e.children?">":"/>")+this.writer.endline(e,this.writerOptions,this.currentLevel),this.writerOptions.state=r.InsideTag}else this.writerOptions.state=r.OpenTag,n=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+e.rootNodeName,e.pubID&&e.sysID?n+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"':e.sysID&&(n+=' SYSTEM "'+e.sysID+'"'),e.children?(n+=" [",this.writerOptions.state=r.InsideTag):(this.writerOptions.state=r.CloseTag,n+=">"),n+=this.writer.endline(e,this.writerOptions,this.currentLevel);return this.onData(n,this.currentLevel),e.isOpen=!0}},e.prototype.closeNode=function(e){var i;if(!e.isClosed)return"",this.writerOptions.state=r.CloseTag,i=e.type===t.Element?this.writer.indent(e,this.writerOptions,this.currentLevel)+"</"+e.name+">"+this.writer.endline(e,this.writerOptions,this.currentLevel):this.writer.indent(e,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(e,this.writerOptions,this.currentLevel),this.writerOptions.state=r.None,this.onData(i,this.currentLevel),e.isClosed=!0},e.prototype.onData=function(e,t){return this.documentStarted=!0,this.onDataCallback(e,t+1)},e.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},e.prototype.debugInfo=function(e){return null==e?"":"node: <"+e+">"},e.prototype.ele=function(){return this.element.apply(this,arguments)},e.prototype.nod=function(e,t,i){return this.node(e,t,i)},e.prototype.txt=function(e){return this.text(e)},e.prototype.dat=function(e){return this.cdata(e)},e.prototype.com=function(e){return this.comment(e)},e.prototype.ins=function(e,t){return this.instruction(e,t)},e.prototype.dec=function(e,t,i){return this.declaration(e,t,i)},e.prototype.dtd=function(e,t,i){return this.doctype(e,t,i)},e.prototype.e=function(e,t,i){return this.element(e,t,i)},e.prototype.n=function(e,t,i){return this.node(e,t,i)},e.prototype.t=function(e){return this.text(e)},e.prototype.d=function(e){return this.cdata(e)},e.prototype.c=function(e){return this.comment(e)},e.prototype.r=function(e){return this.raw(e)},e.prototype.i=function(e,t){return this.instruction(e,t)},e.prototype.att=function(){return this.currentNode&&this.currentNode.type===t.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},e.prototype.a=function(){return this.currentNode&&this.currentNode.type===t.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},e.prototype.ent=function(e,t){return this.entity(e,t)},e.prototype.pent=function(e,t){return this.pEntity(e,t)},e.prototype.not=function(e,t){return this.notation(e,t)},e}()}).call(this)},1218:function(e,t,i){(function(){var t,r,n={}.hasOwnProperty;r=i(468),t=i(1737),e.exports=function(e){function i(e){i.__super__.constructor.call(this,e),this.type=t.Dummy}return function(e,t){for(var i in t)n.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(e){return""},i}(r)}).call(this)},3906:function(e,t,i){(function(){var t,r,n,o,a,s,l,c,u={}.hasOwnProperty;c=i(9241),l=c.isObject,s=c.isFunction,a=c.getValue,o=i(468),t=i(1737),r=i(4238),n=i(4797),e.exports=function(e){function i(e,r,n){var o,a,s,l;if(i.__super__.constructor.call(this,e),null==r)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(r),this.type=t.Element,this.attribs={},this.schemaTypeInfo=null,null!=n&&this.attribute(n),e.type===t.Document&&(this.isRoot=!0,this.documentObject=e,e.rootObject=this,e.children))for(a=0,s=(l=e.children).length;a<s;a++)if((o=l[a]).type===t.DocType){o.name=this.name;break}}return function(e,t){for(var i in t)u.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),Object.defineProperty(i.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(i.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(i.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(i.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(i.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(i.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(i.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(i.prototype,"attributes",{get:function(){return this.attributeMap&&this.attributeMap.nodes||(this.attributeMap=new n(this.attribs)),this.attributeMap}}),i.prototype.clone=function(){var e,t,i,r;for(t in(i=Object.create(this)).isRoot&&(i.documentObject=null),i.attribs={},r=this.attribs)u.call(r,t)&&(e=r[t],i.attribs[t]=e.clone());return i.children=[],this.children.forEach((function(e){var t;return(t=e.clone()).parent=i,i.children.push(t)})),i},i.prototype.attribute=function(e,t){var i,n;if(null!=e&&(e=a(e)),l(e))for(i in e)u.call(e,i)&&(n=e[i],this.attribute(i,n));else s(t)&&(t=t.apply()),this.options.keepNullAttributes&&null==t?this.attribs[e]=new r(this,e,""):null!=t&&(this.attribs[e]=new r(this,e,t));return this},i.prototype.removeAttribute=function(e){var t,i,r;if(null==e)throw new Error("Missing attribute name. "+this.debugInfo());if(e=a(e),Array.isArray(e))for(i=0,r=e.length;i<r;i++)t=e[i],delete this.attribs[t];else delete this.attribs[e];return this},i.prototype.toString=function(e){return this.options.writer.element(this,this.options.writer.filterOptions(e))},i.prototype.att=function(e,t){return this.attribute(e,t)},i.prototype.a=function(e,t){return this.attribute(e,t)},i.prototype.getAttribute=function(e){return this.attribs.hasOwnProperty(e)?this.attribs[e].value:null},i.prototype.setAttribute=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getAttributeNode=function(e){return this.attribs.hasOwnProperty(e)?this.attribs[e]:null},i.prototype.setAttributeNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.removeAttributeNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.setAttributeNS=function(e,t,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.removeAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getAttributeNodeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.setAttributeNodeNS=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByTagNameNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.hasAttribute=function(e){return this.attribs.hasOwnProperty(e)},i.prototype.hasAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.setIdAttribute=function(e,t){return this.attribs.hasOwnProperty(e)?this.attribs[e].isId:t},i.prototype.setIdAttributeNS=function(e,t,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.setIdAttributeNode=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByTagNameNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByClassName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.isEqualNode=function(e){var t,r,n;if(!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(e))return!1;if(e.namespaceURI!==this.namespaceURI)return!1;if(e.prefix!==this.prefix)return!1;if(e.localName!==this.localName)return!1;if(e.attribs.length!==this.attribs.length)return!1;for(t=r=0,n=this.attribs.length-1;0<=n?r<=n:r>=n;t=0<=n?++r:--r)if(!this.attribs[t].isEqualNode(e.attribs[t]))return!1;return!0},i}(o)}).call(this)},4797:function(e){(function(){e.exports=function(){function e(e){this.nodes=e}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),e.prototype.clone=function(){return this.nodes=null},e.prototype.getNamedItem=function(e){return this.nodes[e]},e.prototype.setNamedItem=function(e){var t;return t=this.nodes[e.nodeName],this.nodes[e.nodeName]=e,t||null},e.prototype.removeNamedItem=function(e){var t;return t=this.nodes[e],delete this.nodes[e],t||null},e.prototype.item=function(e){return this.nodes[Object.keys(this.nodes)[e]]||null},e.prototype.getNamedItemNS=function(e,t){throw new Error("This DOM method is not implemented.")},e.prototype.setNamedItemNS=function(e){throw new Error("This DOM method is not implemented.")},e.prototype.removeNamedItemNS=function(e,t){throw new Error("This DOM method is not implemented.")},e}()}).call(this)},468:function(e,t,i){(function(){var t,r,n,o,a,s,l,c,u,h,d,_,f,p,m,g,v,b={}.hasOwnProperty;v=i(9241),g=v.isObject,m=v.isFunction,p=v.isEmpty,f=v.getValue,c=null,n=null,o=null,a=null,s=null,d=null,_=null,h=null,l=null,r=null,u=null,t=null,e.exports=function(){function e(e){this.parent=e,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,c||(c=i(3906),n=i(2691),o=i(2679),a=i(4130),s=i(6376),d=i(1268),_=i(2535),h=i(5915),l=i(1218),r=i(1737),u=i(6684),i(4797),t=i(4923))}return Object.defineProperty(e.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(e.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(e.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(e.prototype,"childNodes",{get:function(){return this.childNodeList&&this.childNodeList.nodes||(this.childNodeList=new u(this.children)),this.childNodeList}}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){var e;return e=this.parent.children.indexOf(this),this.parent.children[e-1]||null}}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){var e;return e=this.parent.children.indexOf(this),this.parent.children[e+1]||null}}),Object.defineProperty(e.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(e.prototype,"textContent",{get:function(){var e,t,i,n,o;if(this.nodeType===r.Element||this.nodeType===r.DocumentFragment){for(o="",t=0,i=(n=this.children).length;t<i;t++)(e=n[t]).textContent&&(o+=e.textContent);return o}return null},set:function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),e.prototype.setParent=function(e){var t,i,r,n,o;for(this.parent=e,e&&(this.options=e.options,this.stringify=e.stringify),o=[],i=0,r=(n=this.children).length;i<r;i++)t=n[i],o.push(t.setParent(this));return o},e.prototype.element=function(e,t,i){var r,n,o,a,s,l,c,u,h,d,_;if(l=null,null===t&&null==i&&(t=(h=[{},null])[0],i=h[1]),null==t&&(t={}),t=f(t),g(t)||(i=(d=[t,i])[0],t=d[1]),null!=e&&(e=f(e)),Array.isArray(e))for(o=0,c=e.length;o<c;o++)n=e[o],l=this.element(n);else if(m(e))l=this.element(e.apply());else if(g(e)){for(s in e)if(b.call(e,s))if(_=e[s],m(_)&&(_=_.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&0===s.indexOf(this.stringify.convertAttKey))l=this.attribute(s.substr(this.stringify.convertAttKey.length),_);else if(!this.options.separateArrayItems&&Array.isArray(_)&&p(_))l=this.dummy();else if(g(_)&&p(_))l=this.element(s);else if(this.options.keepNullNodes||null!=_)if(!this.options.separateArrayItems&&Array.isArray(_))for(a=0,u=_.length;a<u;a++)n=_[a],(r={})[s]=n,l=this.element(r);else g(_)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&0===s.indexOf(this.stringify.convertTextKey)?l=this.element(_):(l=this.element(s)).element(_):l=this.element(s,_);else l=this.dummy()}else l=this.options.keepNullNodes||null!==i?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&0===e.indexOf(this.stringify.convertTextKey)?this.text(i):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&0===e.indexOf(this.stringify.convertCDataKey)?this.cdata(i):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&0===e.indexOf(this.stringify.convertCommentKey)?this.comment(i):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&0===e.indexOf(this.stringify.convertRawKey)?this.raw(i):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&0===e.indexOf(this.stringify.convertPIKey)?this.instruction(e.substr(this.stringify.convertPIKey.length),i):this.node(e,t,i):this.dummy();if(null==l)throw new Error("Could not create any elements with: "+e+". "+this.debugInfo());return l},e.prototype.insertBefore=function(e,t,i){var r,n,o,a,s;if(null!=e?e.type:void 0)return a=t,(o=e).setParent(this),a?(n=children.indexOf(a),s=children.splice(n),children.push(o),Array.prototype.push.apply(children,s)):children.push(o),o;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(e));return n=this.parent.children.indexOf(this),s=this.parent.children.splice(n),r=this.parent.element(e,t,i),Array.prototype.push.apply(this.parent.children,s),r},e.prototype.insertAfter=function(e,t,i){var r,n,o;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(e));return n=this.parent.children.indexOf(this),o=this.parent.children.splice(n+1),r=this.parent.element(e,t,i),Array.prototype.push.apply(this.parent.children,o),r},e.prototype.remove=function(){var e;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return e=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[e,e-e+1].concat([])),this.parent},e.prototype.node=function(e,t,i){var r,n;return null!=e&&(e=f(e)),t||(t={}),t=f(t),g(t)||(i=(n=[t,i])[0],t=n[1]),r=new c(this,e,t),null!=i&&r.text(i),this.children.push(r),r},e.prototype.text=function(e){var t;return g(e)&&this.element(e),t=new _(this,e),this.children.push(t),this},e.prototype.cdata=function(e){var t;return t=new n(this,e),this.children.push(t),this},e.prototype.comment=function(e){var t;return t=new o(this,e),this.children.push(t),this},e.prototype.commentBefore=function(e){var t,i;return t=this.parent.children.indexOf(this),i=this.parent.children.splice(t),this.parent.comment(e),Array.prototype.push.apply(this.parent.children,i),this},e.prototype.commentAfter=function(e){var t,i;return t=this.parent.children.indexOf(this),i=this.parent.children.splice(t+1),this.parent.comment(e),Array.prototype.push.apply(this.parent.children,i),this},e.prototype.raw=function(e){var t;return t=new d(this,e),this.children.push(t),this},e.prototype.dummy=function(){return new l(this)},e.prototype.instruction=function(e,t){var i,r,n,o,a;if(null!=e&&(e=f(e)),null!=t&&(t=f(t)),Array.isArray(e))for(o=0,a=e.length;o<a;o++)i=e[o],this.instruction(i);else if(g(e))for(i in e)b.call(e,i)&&(r=e[i],this.instruction(i,r));else m(t)&&(t=t.apply()),n=new h(this,e,t),this.children.push(n);return this},e.prototype.instructionBefore=function(e,t){var i,r;return i=this.parent.children.indexOf(this),r=this.parent.children.splice(i),this.parent.instruction(e,t),Array.prototype.push.apply(this.parent.children,r),this},e.prototype.instructionAfter=function(e,t){var i,r;return i=this.parent.children.indexOf(this),r=this.parent.children.splice(i+1),this.parent.instruction(e,t),Array.prototype.push.apply(this.parent.children,r),this},e.prototype.declaration=function(e,t,i){var n,o;return n=this.document(),o=new a(n,e,t,i),0===n.children.length?n.children.unshift(o):n.children[0].type===r.Declaration?n.children[0]=o:n.children.unshift(o),n.root()||n},e.prototype.dtd=function(e,t){var i,n,o,a,l,c,u,h,d;for(i=this.document(),n=new s(i,e,t),o=a=0,c=(h=i.children).length;a<c;o=++a)if(h[o].type===r.DocType)return i.children[o]=n,n;for(o=l=0,u=(d=i.children).length;l<u;o=++l)if(d[o].isRoot)return i.children.splice(o,0,n),n;return i.children.push(n),n},e.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},e.prototype.root=function(){var e;for(e=this;e;){if(e.type===r.Document)return e.rootObject;if(e.isRoot)return e;e=e.parent}},e.prototype.document=function(){var e;for(e=this;e;){if(e.type===r.Document)return e;e=e.parent}},e.prototype.end=function(e){return this.document().end(e)},e.prototype.prev=function(){var e;if((e=this.parent.children.indexOf(this))<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[e-1]},e.prototype.next=function(){var e;if(-1===(e=this.parent.children.indexOf(this))||e===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[e+1]},e.prototype.importDocument=function(e){var t;return(t=e.root().clone()).parent=this,t.isRoot=!1,this.children.push(t),this},e.prototype.debugInfo=function(e){var t,i;return null!=(e=e||this.name)||(null!=(t=this.parent)?t.name:void 0)?null==e?"parent: <"+this.parent.name+">":(null!=(i=this.parent)?i.name:void 0)?"node: <"+e+">, parent: <"+this.parent.name+">":"node: <"+e+">":""},e.prototype.ele=function(e,t,i){return this.element(e,t,i)},e.prototype.nod=function(e,t,i){return this.node(e,t,i)},e.prototype.txt=function(e){return this.text(e)},e.prototype.dat=function(e){return this.cdata(e)},e.prototype.com=function(e){return this.comment(e)},e.prototype.ins=function(e,t){return this.instruction(e,t)},e.prototype.doc=function(){return this.document()},e.prototype.dec=function(e,t,i){return this.declaration(e,t,i)},e.prototype.e=function(e,t,i){return this.element(e,t,i)},e.prototype.n=function(e,t,i){return this.node(e,t,i)},e.prototype.t=function(e){return this.text(e)},e.prototype.d=function(e){return this.cdata(e)},e.prototype.c=function(e){return this.comment(e)},e.prototype.r=function(e){return this.raw(e)},e.prototype.i=function(e,t){return this.instruction(e,t)},e.prototype.u=function(){return this.up()},e.prototype.importXMLBuilder=function(e){return this.importDocument(e)},e.prototype.replaceChild=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.removeChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.appendChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.hasChildNodes=function(){return 0!==this.children.length},e.prototype.cloneNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.isSupported=function(e,t){return!0},e.prototype.hasAttributes=function(){return 0!==this.attribs.length},e.prototype.compareDocumentPosition=function(e){var i,r;return(i=this)===e?0:this.document()!==e.document()?(r=t.Disconnected|t.ImplementationSpecific,Math.random()<.5?r|=t.Preceding:r|=t.Following,r):i.isAncestor(e)?t.Contains|t.Preceding:i.isDescendant(e)?t.Contains|t.Following:i.isPreceding(e)?t.Preceding:t.Following},e.prototype.isSameNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.lookupPrefix=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.isDefaultNamespace=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.lookupNamespaceURI=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.isEqualNode=function(e){var t,i,r;if(e.nodeType!==this.nodeType)return!1;if(e.children.length!==this.children.length)return!1;for(t=i=0,r=this.children.length-1;0<=r?i<=r:i>=r;t=0<=r?++i:--i)if(!this.children[t].isEqualNode(e.children[t]))return!1;return!0},e.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.setUserData=function(e,t,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.getUserData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.contains=function(e){return!!e&&(e===this||this.isDescendant(e))},e.prototype.isDescendant=function(e){var t,i,r,n;for(i=0,r=(n=this.children).length;i<r;i++){if(e===(t=n[i]))return!0;if(t.isDescendant(e))return!0}return!1},e.prototype.isAncestor=function(e){return e.isDescendant(this)},e.prototype.isPreceding=function(e){var t,i;return t=this.treePosition(e),i=this.treePosition(this),-1!==t&&-1!==i&&t<i},e.prototype.isFollowing=function(e){var t,i;return t=this.treePosition(e),i=this.treePosition(this),-1!==t&&-1!==i&&t>i},e.prototype.treePosition=function(e){var t,i;return i=0,t=!1,this.foreachTreeNode(this.document(),(function(r){if(i++,!t&&r===e)return t=!0})),t?i:-1},e.prototype.foreachTreeNode=function(e,t){var i,r,n,o,a;for(e||(e=this.document()),r=0,n=(o=e.children).length;r<n;r++){if(a=t(i=o[r]))return a;if(a=this.foreachTreeNode(i,t))return a}},e}()}).call(this)},6684:function(e){(function(){e.exports=function(){function e(e){this.nodes=e}return Object.defineProperty(e.prototype,"length",{get:function(){return this.nodes.length||0}}),e.prototype.clone=function(){return this.nodes=null},e.prototype.item=function(e){return this.nodes[e]||null},e}()}).call(this)},5915:function(e,t,i){(function(){var t,r,n={}.hasOwnProperty;t=i(1737),r=i(7457),e.exports=function(e){function i(e,r,n){if(i.__super__.constructor.call(this,e),null==r)throw new Error("Missing instruction target. "+this.debugInfo());this.type=t.ProcessingInstruction,this.target=this.stringify.insTarget(r),this.name=this.target,n&&(this.value=this.stringify.insValue(n))}return function(e,t){for(var i in t)n.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(e){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(e))},i.prototype.isEqualNode=function(e){return!!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)&&e.target===this.target},i}(r)}).call(this)},1268:function(e,t,i){(function(){var t,r,n={}.hasOwnProperty;t=i(1737),r=i(468),e.exports=function(e){function i(e,r){if(i.__super__.constructor.call(this,e),null==r)throw new Error("Missing raw text. "+this.debugInfo());this.type=t.Raw,this.value=this.stringify.raw(r)}return function(e,t){for(var i in t)n.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(e){return this.options.writer.raw(this,this.options.writer.filterOptions(e))},i}(r)}).call(this)},6775:function(e,t,i){(function(){var t,r,n,o={}.hasOwnProperty;t=i(1737),n=i(6286),r=i(8753),e.exports=function(e){function i(e,t){this.stream=e,i.__super__.constructor.call(this,t)}return function(e,t){for(var i in t)o.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),i.prototype.endline=function(e,t,n){return e.isLastRootNode&&t.state===r.CloseTag?"":i.__super__.endline.call(this,e,t,n)},i.prototype.document=function(e,t){var i,r,n,o,a,s,l,c,u;for(r=n=0,a=(l=e.children).length;n<a;r=++n)(i=l[r]).isLastRootNode=r===e.children.length-1;for(t=this.filterOptions(t),u=[],o=0,s=(c=e.children).length;o<s;o++)i=c[o],u.push(this.writeChildNode(i,t,0));return u},i.prototype.attribute=function(e,t,r){return this.stream.write(i.__super__.attribute.call(this,e,t,r))},i.prototype.cdata=function(e,t,r){return this.stream.write(i.__super__.cdata.call(this,e,t,r))},i.prototype.comment=function(e,t,r){return this.stream.write(i.__super__.comment.call(this,e,t,r))},i.prototype.declaration=function(e,t,r){return this.stream.write(i.__super__.declaration.call(this,e,t,r))},i.prototype.docType=function(e,t,i){var n,o,a,s;if(i||(i=0),this.openNode(e,t,i),t.state=r.OpenTag,this.stream.write(this.indent(e,t,i)),this.stream.write("<!DOCTYPE "+e.root().name),e.pubID&&e.sysID?this.stream.write(' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'):e.sysID&&this.stream.write(' SYSTEM "'+e.sysID+'"'),e.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(e,t,i)),t.state=r.InsideTag,o=0,a=(s=e.children).length;o<a;o++)n=s[o],this.writeChildNode(n,t,i+1);t.state=r.CloseTag,this.stream.write("]")}return t.state=r.CloseTag,this.stream.write(t.spaceBeforeSlash+">"),this.stream.write(this.endline(e,t,i)),t.state=r.None,this.closeNode(e,t,i)},i.prototype.element=function(e,i,n){var a,s,l,c,u,h,d,_,f;for(d in n||(n=0),this.openNode(e,i,n),i.state=r.OpenTag,this.stream.write(this.indent(e,i,n)+"<"+e.name),_=e.attribs)o.call(_,d)&&(a=_[d],this.attribute(a,i,n));if(c=0===(l=e.children.length)?null:e.children[0],0===l||e.children.every((function(e){return(e.type===t.Text||e.type===t.Raw)&&""===e.value})))i.allowEmpty?(this.stream.write(">"),i.state=r.CloseTag,this.stream.write("</"+e.name+">")):(i.state=r.CloseTag,this.stream.write(i.spaceBeforeSlash+"/>"));else if(!i.pretty||1!==l||c.type!==t.Text&&c.type!==t.Raw||null==c.value){for(this.stream.write(">"+this.endline(e,i,n)),i.state=r.InsideTag,u=0,h=(f=e.children).length;u<h;u++)s=f[u],this.writeChildNode(s,i,n+1);i.state=r.CloseTag,this.stream.write(this.indent(e,i,n)+"</"+e.name+">")}else this.stream.write(">"),i.state=r.InsideTag,i.suppressPrettyCount++,this.writeChildNode(c,i,n+1),i.suppressPrettyCount--,i.state=r.CloseTag,this.stream.write("</"+e.name+">");return this.stream.write(this.endline(e,i,n)),i.state=r.None,this.closeNode(e,i,n)},i.prototype.processingInstruction=function(e,t,r){return this.stream.write(i.__super__.processingInstruction.call(this,e,t,r))},i.prototype.raw=function(e,t,r){return this.stream.write(i.__super__.raw.call(this,e,t,r))},i.prototype.text=function(e,t,r){return this.stream.write(i.__super__.text.call(this,e,t,r))},i.prototype.dtdAttList=function(e,t,r){return this.stream.write(i.__super__.dtdAttList.call(this,e,t,r))},i.prototype.dtdElement=function(e,t,r){return this.stream.write(i.__super__.dtdElement.call(this,e,t,r))},i.prototype.dtdEntity=function(e,t,r){return this.stream.write(i.__super__.dtdEntity.call(this,e,t,r))},i.prototype.dtdNotation=function(e,t,r){return this.stream.write(i.__super__.dtdNotation.call(this,e,t,r))},i}(n)}).call(this)},382:function(e,t,i){(function(){var t,r={}.hasOwnProperty;t=i(6286),e.exports=function(e){function t(e){t.__super__.constructor.call(this,e)}return function(e,t){for(var i in t)r.call(t,i)&&(e[i]=t[i]);function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.document=function(e,t){var i,r,n,o,a;for(t=this.filterOptions(t),o="",r=0,n=(a=e.children).length;r<n;r++)i=a[r],o+=this.writeChildNode(i,t,0);return t.pretty&&o.slice(-t.newline.length)===t.newline&&(o=o.slice(0,-t.newline.length)),o},t}(t)}).call(this)},3976:function(e){(function(){var t=function(e,t){return function(){return e.apply(t,arguments)}},i={}.hasOwnProperty;e.exports=function(){function e(e){var r,n,o;for(r in this.assertLegalName=t(this.assertLegalName,this),this.assertLegalChar=t(this.assertLegalChar,this),e||(e={}),this.options=e,this.options.version||(this.options.version="1.0"),n=e.stringify||{})i.call(n,r)&&(o=n[r],this[r]=o)}return e.prototype.name=function(e){return this.options.noValidation?e:this.assertLegalName(""+e||"")},e.prototype.text=function(e){return this.options.noValidation?e:this.assertLegalChar(this.textEscape(""+e||""))},e.prototype.cdata=function(e){return this.options.noValidation?e:(e=(e=""+e||"").replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(e))},e.prototype.comment=function(e){if(this.options.noValidation)return e;if((e=""+e||"").match(/--/))throw new Error("Comment text cannot contain double-hypen: "+e);return this.assertLegalChar(e)},e.prototype.raw=function(e){return this.options.noValidation?e:""+e||""},e.prototype.attValue=function(e){return this.options.noValidation?e:this.assertLegalChar(this.attEscape(e=""+e||""))},e.prototype.insTarget=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.insValue=function(e){if(this.options.noValidation)return e;if((e=""+e||"").match(/\?>/))throw new Error("Invalid processing instruction value: "+e);return this.assertLegalChar(e)},e.prototype.xmlVersion=function(e){if(this.options.noValidation)return e;if(!(e=""+e||"").match(/1\.[0-9]+/))throw new Error("Invalid version number: "+e);return e},e.prototype.xmlEncoding=function(e){if(this.options.noValidation)return e;if(!(e=""+e||"").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+e);return this.assertLegalChar(e)},e.prototype.xmlStandalone=function(e){return this.options.noValidation?e:e?"yes":"no"},e.prototype.dtdPubID=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdSysID=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdElementValue=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdAttType=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdAttDefault=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdEntityValue=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.dtdNData=function(e){return this.options.noValidation?e:this.assertLegalChar(""+e||"")},e.prototype.convertAttKey="@",e.prototype.convertPIKey="?",e.prototype.convertTextKey="#text",e.prototype.convertCDataKey="#cdata",e.prototype.convertCommentKey="#comment",e.prototype.convertRawKey="#raw",e.prototype.assertLegalChar=function(e){var t,i;if(this.options.noValidation)return e;if(t="","1.0"===this.options.version){if(t=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,i=e.match(t))throw new Error("Invalid character in string: "+e+" at index "+i.index)}else if("1.1"===this.options.version&&(t=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,i=e.match(t)))throw new Error("Invalid character in string: "+e+" at index "+i.index);return e},e.prototype.assertLegalName=function(e){var t;if(this.options.noValidation)return e;if(this.assertLegalChar(e),t=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!e.match(t))throw new Error("Invalid character in name");return e},e.prototype.textEscape=function(e){var t;return this.options.noValidation?e:(t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,e.replace(t,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},e.prototype.attEscape=function(e){var t;return this.options.noValidation?e:(t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,e.replace(t,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},e}()}).call(this)},2535:function(e,t,i){(function(){var t,r,n={}.hasOwnProperty;t=i(1737),r=i(7457),e.exports=function(e){function i(e,r){if(i.__super__.constructor.call(this,e),null==r)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=t.Text,this.value=this.stringify.text(r)}return function(e,t){for(var i in t)n.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(i,e),Object.defineProperty(i.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(i.prototype,"wholeText",{get:function(){var e,t,i;for(i="",t=this.previousSibling;t;)i=t.data+i,t=t.previousSibling;for(i+=this.data,e=this.nextSibling;e;)i+=e.data,e=e.nextSibling;return i}}),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(e){return this.options.writer.text(this,this.options.writer.filterOptions(e))},i.prototype.splitText=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.replaceWholeText=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i}(r)}).call(this)},6286:function(e,t,i){(function(){var t,r,n,o={}.hasOwnProperty;n=i(9241).assign,t=i(1737),i(4130),i(6376),i(2691),i(2679),i(3906),i(1268),i(2535),i(5915),i(1218),i(4111),i(7696),i(5529),i(8012),r=i(8753),e.exports=function(){function e(e){var t,i,r;for(t in e||(e={}),this.options=e,i=e.writer||{})o.call(i,t)&&(r=i[t],this["_"+t]=this[t],this[t]=r)}return e.prototype.filterOptions=function(e){var t,i,o,a,s,l,c,u;return e||(e={}),e=n({},this.options,e),(t={writer:this}).pretty=e.pretty||!1,t.allowEmpty=e.allowEmpty||!1,t.indent=null!=(i=e.indent)?i:" ",t.newline=null!=(o=e.newline)?o:"\n",t.offset=null!=(a=e.offset)?a:0,t.dontPrettyTextNodes=null!=(s=null!=(l=e.dontPrettyTextNodes)?l:e.dontprettytextnodes)?s:0,t.spaceBeforeSlash=null!=(c=null!=(u=e.spaceBeforeSlash)?u:e.spacebeforeslash)?c:"",!0===t.spaceBeforeSlash&&(t.spaceBeforeSlash=" "),t.suppressPrettyCount=0,t.user={},t.state=r.None,t},e.prototype.indent=function(e,t,i){var r;return!t.pretty||t.suppressPrettyCount?"":t.pretty&&(r=(i||0)+t.offset+1)>0?new Array(r).join(t.indent):""},e.prototype.endline=function(e,t,i){return!t.pretty||t.suppressPrettyCount?"":t.newline},e.prototype.attribute=function(e,t,i){var r;return this.openAttribute(e,t,i),r=" "+e.name+'="'+e.value+'"',this.closeAttribute(e,t,i),r},e.prototype.cdata=function(e,t,i){var n;return this.openNode(e,t,i),t.state=r.OpenTag,n=this.indent(e,t,i)+"<![CDATA[",t.state=r.InsideTag,n+=e.value,t.state=r.CloseTag,n+="]]>"+this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),n},e.prototype.comment=function(e,t,i){var n;return this.openNode(e,t,i),t.state=r.OpenTag,n=this.indent(e,t,i)+"\x3c!-- ",t.state=r.InsideTag,n+=e.value,t.state=r.CloseTag,n+=" --\x3e"+this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),n},e.prototype.declaration=function(e,t,i){var n;return this.openNode(e,t,i),t.state=r.OpenTag,n=this.indent(e,t,i)+"<?xml",t.state=r.InsideTag,n+=' version="'+e.version+'"',null!=e.encoding&&(n+=' encoding="'+e.encoding+'"'),null!=e.standalone&&(n+=' standalone="'+e.standalone+'"'),t.state=r.CloseTag,n+=t.spaceBeforeSlash+"?>",n+=this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),n},e.prototype.docType=function(e,t,i){var n,o,a,s,l;if(i||(i=0),this.openNode(e,t,i),t.state=r.OpenTag,s=this.indent(e,t,i),s+="<!DOCTYPE "+e.root().name,e.pubID&&e.sysID?s+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"':e.sysID&&(s+=' SYSTEM "'+e.sysID+'"'),e.children.length>0){for(s+=" [",s+=this.endline(e,t,i),t.state=r.InsideTag,o=0,a=(l=e.children).length;o<a;o++)n=l[o],s+=this.writeChildNode(n,t,i+1);t.state=r.CloseTag,s+="]"}return t.state=r.CloseTag,s+=t.spaceBeforeSlash+">",s+=this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),s},e.prototype.element=function(e,i,n){var a,s,l,c,u,h,d,_,f,p,m,g,v,b;for(f in n||(n=0),p=!1,m="",this.openNode(e,i,n),i.state=r.OpenTag,m+=this.indent(e,i,n)+"<"+e.name,g=e.attribs)o.call(g,f)&&(a=g[f],m+=this.attribute(a,i,n));if(c=0===(l=e.children.length)?null:e.children[0],0===l||e.children.every((function(e){return(e.type===t.Text||e.type===t.Raw)&&""===e.value})))i.allowEmpty?(m+=">",i.state=r.CloseTag,m+="</"+e.name+">"+this.endline(e,i,n)):(i.state=r.CloseTag,m+=i.spaceBeforeSlash+"/>"+this.endline(e,i,n));else if(!i.pretty||1!==l||c.type!==t.Text&&c.type!==t.Raw||null==c.value){if(i.dontPrettyTextNodes)for(u=0,d=(v=e.children).length;u<d;u++)if(((s=v[u]).type===t.Text||s.type===t.Raw)&&null!=s.value){i.suppressPrettyCount++,p=!0;break}for(m+=">"+this.endline(e,i,n),i.state=r.InsideTag,h=0,_=(b=e.children).length;h<_;h++)s=b[h],m+=this.writeChildNode(s,i,n+1);i.state=r.CloseTag,m+=this.indent(e,i,n)+"</"+e.name+">",p&&i.suppressPrettyCount--,m+=this.endline(e,i,n),i.state=r.None}else m+=">",i.state=r.InsideTag,i.suppressPrettyCount++,p=!0,m+=this.writeChildNode(c,i,n+1),i.suppressPrettyCount--,p=!1,i.state=r.CloseTag,m+="</"+e.name+">"+this.endline(e,i,n);return this.closeNode(e,i,n),m},e.prototype.writeChildNode=function(e,i,r){switch(e.type){case t.CData:return this.cdata(e,i,r);case t.Comment:return this.comment(e,i,r);case t.Element:return this.element(e,i,r);case t.Raw:return this.raw(e,i,r);case t.Text:return this.text(e,i,r);case t.ProcessingInstruction:return this.processingInstruction(e,i,r);case t.Dummy:return"";case t.Declaration:return this.declaration(e,i,r);case t.DocType:return this.docType(e,i,r);case t.AttributeDeclaration:return this.dtdAttList(e,i,r);case t.ElementDeclaration:return this.dtdElement(e,i,r);case t.EntityDeclaration:return this.dtdEntity(e,i,r);case t.NotationDeclaration:return this.dtdNotation(e,i,r);default:throw new Error("Unknown XML node type: "+e.constructor.name)}},e.prototype.processingInstruction=function(e,t,i){var n;return this.openNode(e,t,i),t.state=r.OpenTag,n=this.indent(e,t,i)+"<?",t.state=r.InsideTag,n+=e.target,e.value&&(n+=" "+e.value),t.state=r.CloseTag,n+=t.spaceBeforeSlash+"?>",n+=this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),n},e.prototype.raw=function(e,t,i){var n;return this.openNode(e,t,i),t.state=r.OpenTag,n=this.indent(e,t,i),t.state=r.InsideTag,n+=e.value,t.state=r.CloseTag,n+=this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),n},e.prototype.text=function(e,t,i){var n;return this.openNode(e,t,i),t.state=r.OpenTag,n=this.indent(e,t,i),t.state=r.InsideTag,n+=e.value,t.state=r.CloseTag,n+=this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),n},e.prototype.dtdAttList=function(e,t,i){var n;return this.openNode(e,t,i),t.state=r.OpenTag,n=this.indent(e,t,i)+"<!ATTLIST",t.state=r.InsideTag,n+=" "+e.elementName+" "+e.attributeName+" "+e.attributeType,"#DEFAULT"!==e.defaultValueType&&(n+=" "+e.defaultValueType),e.defaultValue&&(n+=' "'+e.defaultValue+'"'),t.state=r.CloseTag,n+=t.spaceBeforeSlash+">"+this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),n},e.prototype.dtdElement=function(e,t,i){var n;return this.openNode(e,t,i),t.state=r.OpenTag,n=this.indent(e,t,i)+"<!ELEMENT",t.state=r.InsideTag,n+=" "+e.name+" "+e.value,t.state=r.CloseTag,n+=t.spaceBeforeSlash+">"+this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),n},e.prototype.dtdEntity=function(e,t,i){var n;return this.openNode(e,t,i),t.state=r.OpenTag,n=this.indent(e,t,i)+"<!ENTITY",t.state=r.InsideTag,e.pe&&(n+=" %"),n+=" "+e.name,e.value?n+=' "'+e.value+'"':(e.pubID&&e.sysID?n+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"':e.sysID&&(n+=' SYSTEM "'+e.sysID+'"'),e.nData&&(n+=" NDATA "+e.nData)),t.state=r.CloseTag,n+=t.spaceBeforeSlash+">"+this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),n},e.prototype.dtdNotation=function(e,t,i){var n;return this.openNode(e,t,i),t.state=r.OpenTag,n=this.indent(e,t,i)+"<!NOTATION",t.state=r.InsideTag,n+=" "+e.name,e.pubID&&e.sysID?n+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"':e.pubID?n+=' PUBLIC "'+e.pubID+'"':e.sysID&&(n+=' SYSTEM "'+e.sysID+'"'),t.state=r.CloseTag,n+=t.spaceBeforeSlash+">"+this.endline(e,t,i),t.state=r.None,this.closeNode(e,t,i),n},e.prototype.openNode=function(e,t,i){},e.prototype.closeNode=function(e,t,i){},e.prototype.openAttribute=function(e,t,i){},e.prototype.closeAttribute=function(e,t,i){},e}()}).call(this)},9665:function(e,t,i){(function(){var t,r,n,o,a,s,l,c,u,h;h=i(9241),c=h.assign,u=h.isFunction,n=i(7260),o=i(1933),a=i(400),l=i(382),s=i(6775),t=i(1737),r=i(8753),e.exports.create=function(e,t,i,r){var n,a;if(null==e)throw new Error("Root element needs a name.");return r=c({},t,i,r),a=(n=new o(r)).element(e),r.headless||(n.declaration(r),null==r.pubID&&null==r.sysID||n.dtd(r)),a},e.exports.begin=function(e,t,i){var r;return u(e)&&(t=(r=[e,t])[0],i=r[1],e={}),t?new a(e,t,i):new o(e)},e.exports.stringWriter=function(e){return new l(e)},e.exports.streamWriter=function(e,t){return new s(e,t)},e.exports.implementation=new n,e.exports.nodeType=t,e.exports.writerState=r}).call(this)},9859:t=>{"use strict";t.exports=e},5340:()=>{},9838:()=>{},1603:()=>{},9247:()=>{}},i={};function r(e){var n=i[e];if(void 0!==n)return n.exports;var o=i[e]={exports:{}};return t[e].call(o.exports,o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Box:()=>i,CollisionMaterial:()=>v,Cylinder:()=>t,Joint:()=>p,JointType:()=>o,Link:()=>m,Material:()=>g,Mesh:()=>c,RenderTestMain:()=>D,Robot:()=>T,RobotScene:()=>B,Sphere:()=>u,Visual:()=>C,applyRotationToTransform:()=>f,deserializeJoint:()=>I,deserializeLink:()=>w,deserializeMaterial:()=>P,deserializeUrdfToRobot:()=>M,deserializeVisual:()=>E,parseColor:()=>_,parseRPY:()=>d,parseUrdf:()=>S,parseVector:()=>h});var e=r(9859);class t{constructor(e,t){this.length=0,this.radius=0,this.meshes=[],this.length=e,this.radius=t}create(t,i){this.transform=new e.TransformNode("mesh_cylinder",t),this.meshes.push(e.MeshBuilder.CreateCylinder("cylinder",{diameter:2*this.radius,height:this.length},t)),this.meshes[0].parent=this.transform,this.meshes[0].addRotation(Math.PI/2,0,0),null!=i&&null!=i.material&&(this.meshes[0].material=i.material)}dispose(){var e;null!=this.meshes&&this.meshes.forEach((e=>{e.dispose()})),null===(e=this.transform)||void 0===e||e.dispose()}}class i{constructor(e,t,i){this.width=0,this.height=0,this.depth=0,this.meshes=[],this.width=e,this.height=t,this.depth=i}create(t,i){this.transform=new e.TransformNode("mesh_box",t),this.meshes.push(e.MeshBuilder.CreateBox("box",{width:this.width,height:this.height,depth:this.depth},t)),this.meshes[0].parent=this.transform,null!=i&&null!=i.material&&(this.meshes[0].material=i.material)}dispose(){var e;null!=this.meshes&&this.meshes.forEach((e=>{e.dispose()})),null===(e=this.transform)||void 0===e||e.dispose()}}r(3988);var o,a=r(9247),s=r.n(a),l=r(1603);class c{constructor(t,i){this.uri="",this.scale=new e.Vector3(1,1,1),this.meshes=void 0,this.transform=void 0,this.material=void 0,this.skeletons=void 0,this.ext="",this.name="mesh",this.uri=t,this.scale=i}setLoadCompleteCallback(e){this.onLoadComplete=e}meshCallback(t,i,r,n,o,a,s,l,c){if(i.length>0&&null!=this.transform&&(this.meshes=i,null!=this.transform)){const t=a.find((e=>!e.parent));t&&(t.parent=this.transform),-1!==this.ext.toLowerCase().indexOf(".stl")&&this.meshes.forEach((t=>{null!=this.transform&&(t.addRotation(0,0,Math.PI).addRotation(Math.PI/2,0,0),t.scaling=new e.Vector3(-1,1,1),t.parent=this.transform,null!=this.material&&null!=this.material.material&&(t.material=this.material.material))}))}this.onLoadComplete&&this.onLoadComplete()}create(t,i){if(this.material=null!=i?i:this.material,this.uri.startsWith("file://")){var r=this.uri.substring(7);r.startsWith("/")||(r=s().join("/",r)),this.ext=r.substring(r.lastIndexOf(".")),this.name=s().basename(r,this.ext);var n=(0,l.readFileSync)(r).toString("base64");this.transform=new e.TransformNode(`mesh_${this.name}`,t),this.transform.scaling=this.scale,e.SceneLoader.ImportMesh(null,"","data:;base64,"+n,t,((e,i,r,n,o,a,s,l)=>{this.meshCallback(t,e,i,r,n,o,a,s,l)}),null,null,this.ext)}else{let i=this.uri.substring(this.uri.lastIndexOf("/")+1);if(i){let r=this.uri.substring(0,this.uri.lastIndexOf("/")+1);this.ext=this.uri.substring(this.uri.lastIndexOf(".")),this.name=i.substring(0,i.lastIndexOf(".")),this.transform=new e.TransformNode(`mesh_${this.name}`,t),this.transform.scaling=this.scale,e.SceneLoader.ImportMesh(null,r,i,t,((e,i,r,n,o,a,s,l)=>{this.meshCallback(t,e,i,r,n,o,a,s,l)}))}}}dispose(){var e;null!=this.skeletons&&this.skeletons.forEach((e=>{e.bones.forEach((e=>{e.getChildMeshes().forEach((e=>{e.dispose()}))})),e.dispose()})),null!=this.meshes&&this.meshes.forEach((e=>{e.dispose()})),null===(e=this.transform)||void 0===e||e.dispose()}}class u{constructor(e){this.length=0,this.radius=0,this.meshes=[],this.radius=e}create(t,i){this.transform=new e.TransformNode("mesh_sphere",t),this.meshes.push(e.MeshBuilder.CreateSphere("sphere",{diameter:2*this.radius},t)),this.meshes[0].parent=this.transform,null!=i&&null!=i.material&&(this.meshes[0].material=i.material)}dispose(){var e;null!=this.meshes&&this.meshes.forEach((e=>{e.dispose()})),null===(e=this.transform)||void 0===e||e.dispose()}}function h(t){var i=(t=t.trim()).split(" ");if(3!=i.length)throw new Error("Vector ${vec} does not have 3 values");return new e.Vector3(parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2]))}function d(t){let i=h(t);return new e.Vector3(i.x,i.y,i.z)}function _(t){var i=(t=t.trim()).split(" ");if(4!=i.length)throw new Error("Color ${rgba} does not have 4 values");return new e.Color4(parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3]))}function f(e,t){e.addRotation(0,0,t.z).addRotation(0,t.y,0).addRotation(t.x,0,0)}!function(e){e.Fixed="fixed",e.Revolute="revolute",e.Continuous="continuous",e.Prismatic="prismatic",e.Floating="floating",e.Planar="planar"}(o||(o={}));class p{constructor(){this.name="",this.type=o.Fixed,this.origin=new e.Vector3(0,0,0),this.rpy=new e.Vector3(0,0,0),this.axis=new e.Vector3(1,0,0),this.parentName="",this.childName="",this.parent=void 0,this.child=void 0,this.lowerLimit=0,this.upperLimit=0}create(t,i){this.transform=new e.TransformNode(this.name,t),this.transform.position=this.origin,f(this.transform,this.rpy)}dispose(){var e;null===(e=this.transform)||void 0===e||e.dispose()}}class m{constructor(){this.name="",this.material=void 0,this.visuals=new Array,this.collisions=new Array}create(t,i){if(this.transform=new e.TransformNode(this.name,t),this.visuals.length>0)for(let e of this.visuals)e.create(t,i),e.transform&&(e.transform.parent=this.transform);if(this.collisions.length>0)for(let e of this.collisions)e.material=i.get("collision"),e.create(t,i),e.transform&&(e.transform.parent=this.transform),e.setEnabled(!1)}dispose(){var e,t;if(this.visuals.length>0)for(let e of this.visuals)e.dispose();if(this.collisions.length>0)for(let e of this.collisions)e.dispose();null===(e=this.material)||void 0===e||e.dispose(),null===(t=this.transform)||void 0===t||t.dispose()}}class g{constructor(){this.name="default",this.filename="",this.color=void 0,this.material=void 0}isReference(){return""===this.filename&&null==this.color}create(t){if(this.filename){let i=new e.StandardMaterial(this.name,t);i.diffuseTexture=new e.Texture(this.filename),i.diffuseTexture.hasAlpha=!0}else{let i=new e.StandardMaterial(this.name,t);null==this.color&&(this.color=new e.Color4(1,1,1,1)),i.diffuseColor=new e.Color3(this.color.r,this.color.g,this.color.b),i.alpha=this.color.a,this.material=i}this.material&&(this.material.backFaceCulling=!1)}dispose(){var e;null===(e=this.material)||void 0===e||e.dispose()}}class v extends g{constructor(){super(),this.name="collision"}create(t){let i=new e.StandardMaterial("collision_material",t);i.diffuseColor=new e.Color3(1,0,0),i.alpha=.25,i.backFaceCulling=!1,this.material=i}}function b(e,t,i,r){return new(i||(i=Promise))((function(n,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var y=r(4216),x=r(8805);class T{constructor(){this.name="",this.links=new Map,this.joints=new Map,this.materials=new Map;let t=new g;t.name="default",t.color=new e.Color4(.5,.5,.5,1),this.materials.set("default",t),this.materials.set("collision",new v)}create(t){this.transform=new e.TransformNode(this.name,t),this.transform.rotation=new e.Vector3(-Math.PI/2,0,0);for(let[e,i]of this.materials)i.create(t);for(let[e,i]of this.links)i.create(t,this.materials);for(let[e,i]of this.joints)i.create(t,this.materials);for(let[e,t]of this.joints)null!=t.transform&&(null!=t.parent&&null!=t.parent.transform&&(t.transform.parent=t.parent.transform),null!=t.child&&null!=t.child.transform&&(t.child.transform.parent=t.transform));for(let[e,t]of this.links)null!=t.transform&&null==t.transform.parent&&(t.transform.parent=this.transform)}dispose(){var e,t;null===(e=this.transform)||void 0===e||e.dispose();for(let[e,i]of this.materials)null===(t=i.material)||void 0===t||t.dispose();for(let[e,t]of this.links)t.dispose();for(let[e,t]of this.joints)t.dispose()}}class C{constructor(){this.name="",this.geometry=void 0,this.material=void 0,this.origin=new e.Vector3(0,0,0),this.rpy=new e.Vector3(0,0,0)}create(t,i){this.transform=new e.TransformNode(this.name,t),this.transform.position=this.origin,f(this.transform,this.rpy);let r=this.material;null!=this.material&&(this.material.isReference()?r=i.get(this.material.name):this.material.create(t)),null!=this.geometry&&(this.geometry.create(t,r),null!=this.transform&&null!=this.geometry.transform&&(this.geometry.transform.parent=this.transform))}setEnabled(e){null!=this.transform&&this.transform.setEnabled(e)}isEnabled(){return null!=this.transform&&this.transform.isEnabled()}dispose(){var e,t,i,r;null===(e=this.geometry)||void 0===e||e.dispose(),0==(null===(t=this.material)||void 0===t?void 0:t.isReference())&&(null===(i=this.material)||void 0===i||i.dispose()),null===(r=this.transform)||void 0===r||r.dispose()}}function S(e){return b(this,void 0,void 0,(function*(){return(0,x.parseStringPromise)(e)}))}function P(e){var t,i,r,n,o,a,s,l,c;let u=new g;if(u.name=null===(t=e.$)||void 0===t?void 0:t.name,1==(null===(i=e.color)||void 0===i?void 0:i.length)&&(null===(r=e.color[0].$)||void 0===r?void 0:r.rgba)){let t=_(e.color[0].$.rgba);return u.color=t,u}if((null===(n=e.color)||void 0===n?void 0:n.length)>1)throw new Error(`Material ${null===(o=e.$)||void 0===o?void 0:o.name} has multiple color values; should only have 1.`);if(1==(null===(a=e.texture)||void 0===a?void 0:a.length)&&(null===(s=e.texture[0].$)||void 0===s?void 0:s.filename))u.filename=e.texture[0].$.filename;else if((null===(l=e.texture)||void 0===l?void 0:l.length)>1)throw new Error(`Material ${null===(c=e.$)||void 0===c?void 0:c.name} has multiple texture values; should only have 1.`);return u}function E(r){return b(this,void 0,void 0,(function*(){var n,o,a,s,l,_,f,p,m,g,v,b,y;let x=new C;if(r.origin&&1==r.origin.length&&(r.origin[0].$.xyz&&(x.origin=h(null==r?void 0:r.origin[0].$.xyz)),r.origin[0].$.rpy&&(x.rpy=d(r.origin[0].$.rpy))),1==(null===(n=r.material)||void 0===n?void 0:n.length))x.material=P(r.material[0]);else if((null===(o=r.material)||void 0===o?void 0:o.length)>1)throw new Error("Visual has multiple materials; must only have 1.");if((null===(a=r.geometry[0])||void 0===a?void 0:a.cylinder)&&1==(null===(s=r.geometry[0])||void 0===s?void 0:s.cylinder.length))x.geometry=new t((null===(l=r.geometry[0].cylinder[0].$)||void 0===l?void 0:l.length)||0,(null===(_=r.geometry[0].cylinder[0].$)||void 0===_?void 0:_.radius)||0);else if((null===(f=r.geometry[0])||void 0===f?void 0:f.box)&&1==(null===(p=r.geometry[0])||void 0===p?void 0:p.box.length)){let e=h(r.geometry[0].box[0].$.size);x.geometry=new i(e.x,e.y,e.z)}else if(null!=(null===(m=r.geometry[0])||void 0===m?void 0:m.mesh)){let t=new e.Vector3(1,1,1);(null===(g=r.geometry[0].mesh[0].$)||void 0===g?void 0:g.scale)&&(t=h(r.geometry[0].mesh[0].$.scale)),x.geometry=new c(null===(v=r.geometry[0].mesh[0].$)||void 0===v?void 0:v.filename,t)}else null!=(null===(b=r.geometry[0])||void 0===b?void 0:b.sphere)&&(x.geometry=new u((null===(y=r.geometry[0].sphere[0].$)||void 0===y?void 0:y.radius)||1));return x}))}function w(e){return b(this,void 0,void 0,(function*(){var t,i,r,n;let o=new m;if(!(null===(t=e.$)||void 0===t?void 0:t.name))throw new Error("Links must have a name.");if(o.name=e.$.name,1==(null===(i=e.material)||void 0===i?void 0:i.length))throw new Error(`Link ${o.name} has a material; Did you mean to put it on visual?`);if((null===(r=e.visual)||void 0===r?void 0:r.length)>0)for(let t of e.visual){let e=yield E(t);e.name=o.name,o.visuals.push(e)}if((null===(n=e.collision)||void 0===n?void 0:n.length)>0)for(let t of e.collision){let e=yield E(t);e.name=o.name,o.collisions.push(e)}return o}))}function I(e){return b(this,void 0,void 0,(function*(){var t,i,r,n,a,s,l,c,u,_,f,m,g,v,b,y,x,T;let C=new p;if(!(null===(t=e.$)||void 0===t?void 0:t.name))throw new Error("Links must have a name.");if(C.name=e.$.name,!(null===(i=e.$)||void 0===i?void 0:i.type))throw new Error(`Link ${C.name} must have a type.`);try{C.type=e.$.type}catch(e){throw new Error(`Link ${C.name} has an unknown type.`)}if(1==(null===(r=e.axis)||void 0===r?void 0:r.length))C.axis=h(e.axis[0].$.xyz);else if((null===(n=e.axis)||void 0===n?void 0:n.length)>1)throw new Error(`Joint ${null===(a=e.$)||void 0===a?void 0:a.name} has multiple axis; should only have 1.`);if(1==(null===(s=e.limit)||void 0===s?void 0:s.length))C.lowerLimit=parseFloat(null===(l=e.limit[0].$)||void 0===l?void 0:l.lower),C.upperLimit=parseFloat(null===(c=e.limit[0].$)||void 0===c?void 0:c.upper);else if((null===(u=e.limit)||void 0===u?void 0:u.length)>1)throw new Error(`Joint ${null===(_=e.$)||void 0===_?void 0:_.name} has multiple limits; should only have 1.`);if(!(C.type!=o.Prismatic&&C.type!=o.Revolute||0!=(null===(f=e.limit)||void 0===f?void 0:f.length)&&null!=(null===(m=e.limit[0].$)||void 0===m?void 0:m.effort)&&null!=(null===(g=e.limit[0].$)||void 0===g?void 0:g.velocity)))throw new Error(`a Prismatic or Revolute Joint ${null===(v=e.$)||void 0===v?void 0:v.name} must specify effort and velocity.`);if(null==e.parent||0==e.parent.length)throw new Error(`Joint ${null===(b=e.$)||void 0===b?void 0:b.name} must have a parent.`);if(1!=e.parent.length)throw new Error(`Joint ${null===(y=e.$)||void 0===y?void 0:y.name} has multiple parents, and requires only a single.`);if(C.parentName=e.parent[0].$.link,null==e.child||0==e.child.length)throw new Error(`Joint ${null===(x=e.$)||void 0===x?void 0:x.name} must have a child.`);if(1!=e.child.length)throw new Error(`Joint ${null===(T=e.$)||void 0===T?void 0:T.name} has multiple children, and requires only a single.`);return C.childName=e.child[0].$.link,e.origin&&1==e.origin.length&&(e.origin[0].$.xyz&&(C.origin=h(e.origin[0].$.xyz)),e.origin[0].$.rpy&&(C.rpy=d(e.origin[0].$.rpy))),C}))}function M(e){return b(this,void 0,void 0,(function*(){var t;let i;try{i=yield S(e)}catch(e){throw console.error(`*** Failed to parse URDF: ${e.message}`),new Error(`Failed to parse URDF: ${e.message}`)}if(void 0!==i.parsererror)throw new Error(`Failed to parse URDF: ${i.parsererror._}`);if(null==i.robot)throw new Error("URDF does not contain a robot element.");let r=new T;if(r.name=null===(t=i.robot.$)||void 0===t?void 0:t.name,i.robot.material instanceof Array)for(let e of i.robot.material){let t=yield P(e);r.materials.set(t.name,t)}if(i.robot.link instanceof Array)for(let e of i.robot.link){let t=yield w(e);if(r.links.has(t.name))throw new Error(`Robot already has ${t.name} please use another name for the second link.`);r.links.set(t.name,t)}if(i.robot.joint instanceof Array)for(let e of i.robot.joint){let t=yield I(e);r.joints.set(t.name,t);let i=r.links.get(t.parentName);if(!i)throw new Error(`Joint ${t.name} has refered to a link ${t.parentName} which could not be found.`);t.parent=i;let n=r.links.get(t.childName);if(!n)throw new Error(`Joint ${t.name} has refered to a link ${t.childName} which could not be found.`);t.child=n}return r}))}class O extends e.Gizmo{constructor(t,i=e.Color3.Gray(),r=e.UtilityLayerRenderer.DefaultUtilityLayer,n=!0,o=32,a=null,s=1,l=e.Color3.Yellow(),c=e.Color3.Gray()){var u,h;super(r),this._pointerObserver=null,this.snapDistance=0,this.onSnapObservable=new e.Observable,this.angle=0,this.sensitivity=1,this.enableLimits=!0,this.associatedJoint=void 0,this._isEnabled=!0,this._parent=null,this._dragging=!1,this._angles=new e.Vector3,this._parent=a,this.associatedJoint=t,this.enableLimits=n,this._coloredMaterial=new e.StandardMaterial("",r.utilityLayerScene),this._coloredMaterial.diffuseColor=i,this._coloredMaterial.specularColor=i.subtract(new e.Color3(.1,.1,.1)),this._hoverMaterial=new e.StandardMaterial("",r.utilityLayerScene),this._hoverMaterial.diffuseColor=l,this._hoverMaterial.specularColor=l,this._disableMaterial=new e.StandardMaterial("",r.utilityLayerScene),this._disableMaterial.diffuseColor=c,this._disableMaterial.alpha=.4,this._gizmoMesh=new e.Mesh("",r.utilityLayerScene);const{rotationMesh:d,collider:_}=this._createGizmoMesh(this._gizmoMesh,s,o);this._rotationDisplayPlane=e.CreatePlane("rotationDisplay",{size:.6,updatable:!1},this.gizmoLayer.utilityLayerScene),this._rotationDisplayPlane.rotation.z=.5*Math.PI,this._rotationDisplayPlane.parent=this._gizmoMesh,this._rotationDisplayPlane.setEnabled(!1),e.Effect.ShadersStore.rotationGizmoVertexShader||(e.Effect.ShadersStore.rotationGizmoVertexShader=O._RotationGizmoVertexShader),e.Effect.ShadersStore.rotationGizmoFragmentShader||(e.Effect.ShadersStore.rotationGizmoFragmentShader=O._RotationGizmoFragmentShader),this._rotationShaderMaterial=new e.ShaderMaterial("shader",this.gizmoLayer.utilityLayerScene,{vertex:"rotationGizmo",fragment:"rotationGizmo"},{attributes:["position","uv"],uniforms:["worldViewProjection","angles","rotationColor","limits","enableLimits"]}),this._rotationShaderMaterial.backFaceCulling=!1,this.rotationColor=l,this._rotationShaderMaterial.setVector2("limits",new e.Vector2(null===(u=this.associatedJoint)||void 0===u?void 0:u.lowerLimit,null===(h=this.associatedJoint)||void 0===h?void 0:h.upperLimit)),this._rotationShaderMaterial.setFloat("enableLimits",this.enableLimits?1:0),this._rotationDisplayPlane.material=this._rotationShaderMaterial,this._rotationDisplayPlane.visibility=.999,this._gizmoMesh.lookAt(this._rootMesh.position.add((null==t?void 0:t.axis)||e.Vector3.Zero())),this._rootMesh.addChild(this._gizmoMesh,e.Gizmo.PreserveScaling),this._gizmoMesh.scaling.scaleInPlace(1/3),this.dragBehavior=new e.PointerDragBehavior({dragPlaneNormal:(null==t?void 0:t.axis)||e.Vector3.Zero()}),this.dragBehavior.moveAttached=!1,this.dragBehavior.maxDragAngle=O.MaxDragAngle,this.dragBehavior._useAlternatePickedPointAboveMaxDragAngle=!0,this._rootMesh.addBehavior(this.dragBehavior);const f=new e.Vector3,p=new e.Matrix,m=new e.Vector3;let g=new e.Vector3;this.dragBehavior.onDragStartObservable.add((t=>{this.attachedNode&&(f.copyFrom(t.dragPlanePoint),this._rotationDisplayPlane.setEnabled(!0),this._rotationDisplayPlane.getWorldMatrix().invertToRef(p),e.Vector3.TransformCoordinatesToRef(t.dragPlanePoint,p,f),this._angles.x=Math.atan2(f.y,f.x)+Math.PI,this._angles.y=0,this._angles.z=this.updateGizmoRotationToMatchAttachedMesh?1:0,this._dragging=!0,f.copyFrom(t.dragPlanePoint),this._rotationShaderMaterial.setVector3("angles",this._angles))})),this.dragBehavior.onDragEndObservable.add((()=>{this._dragging=!1,this._rotationDisplayPlane.setEnabled(!1)}));const v={snapDistance:0};let b=0;const y=new e.Matrix,x=new e.Quaternion;this.dragBehavior.onDragObservable.add((i=>{var n,o;if(this.attachedNode){const a=new e.Vector3(1,1,1),s=new e.Quaternion(0,0,0,1),l=new e.Vector3(0,0,0),c=this._attachedNode;if(c&&c.isUsingPivotMatrix&&c.isUsingPivotMatrix()&&c.position&&c.getWorldMatrix().setTranslation(c.position),this.attachedNode.getWorldMatrix().decompose(a,s,l),!(Math.abs(Math.abs(a.x)-Math.abs(a.y))<=e.Epsilon&&Math.abs(Math.abs(a.x)-Math.abs(a.z))<=e.Epsilon)&&this.updateGizmoRotationToMatchAttachedMesh)return void e.Logger.Warn("Unable to use a rotation gizmo matching mesh rotation with non uniform scaling. Use uniform scaling or set updateGizmoRotationToMatchAttachedMesh to false.");s.normalize();const u=this.updateGizmoPositionToMatchAttachedMesh?l:this._rootMesh.absolutePosition,h=i.dragPlanePoint.subtract(u).normalize(),d=f.subtract(u).normalize(),_=e.Vector3.Cross(h,d),T=e.Vector3.Dot(h,d);let C=Math.atan2(_.length(),T)*this.sensitivity;m.copyFrom((null==t?void 0:t.axis)||e.Vector3.Zero()),g.copyFrom((null==t?void 0:t.axis)||e.Vector3.Zero()),this.updateGizmoRotationToMatchAttachedMesh&&(s.toRotationMatrix(p),g=e.Vector3.TransformCoordinates(m,p));let S=!1;if(r.utilityLayerScene.activeCamera){const t=r.utilityLayerScene.activeCamera.position.subtract(u).normalize();e.Vector3.Dot(t,g)>0&&(m.scaleInPlace(-1),g.scaleInPlace(-1),S=!0)}e.Vector3.Dot(g,_)>0&&(C=-C),e.TmpVectors.Vector3[0].set(C,0,0),this.dragBehavior.validateDrag(e.TmpVectors.Vector3[0])||(C=0);let P=!1;if(0!=this.snapDistance)if(b+=C,Math.abs(b)>this.snapDistance){let e=Math.floor(Math.abs(b)/this.snapDistance);b<0&&(e*=-1),b%=this.snapDistance,C=this.snapDistance*e,P=!0}else C=0;const E=S?-C:C;let w=this.angle+E;this.enableLimits&&this.associatedJoint&&(w<this.associatedJoint.lowerLimit?(w=this.associatedJoint.lowerLimit,C=(w-this.angle)/(S?-1:1)):w>this.associatedJoint.upperLimit&&(w=this.associatedJoint.upperLimit,C=(w-this.angle)/(S?-1:1)));const I=Math.sin(C/2);if(x.set(m.x*I,m.y*I,m.z*I,Math.cos(C/2)),y.determinant()>0){const t=new e.Vector3;x.toEulerAnglesToRef(t),e.Quaternion.RotationYawPitchRollToRef(t.y,-t.x,-t.z,x)}if(this.updateGizmoRotationToMatchAttachedMesh)s.multiplyToRef(x,s),s.normalize(),e.Matrix.ComposeToRef(a,s,l,this.attachedNode.getWorldMatrix());else{x.toRotationMatrix(e.TmpVectors.Matrix[0]);const t=this.attachedNode.getWorldMatrix().getTranslation();this.attachedNode.getWorldMatrix().multiplyToRef(e.TmpVectors.Matrix[0],this.attachedNode.getWorldMatrix()),this.attachedNode.getWorldMatrix().setTranslation(t)}f.copyFrom(i.dragPlanePoint),P&&(v.snapDistance=C,this.onSnapObservable.notifyObservers(v)),this._angles.y+=C,this.angle=w,this._rotationShaderMaterial.setVector3("angles",this._angles),this._rotationShaderMaterial.setVector2("limits",new e.Vector2(null===(n=this.associatedJoint)||void 0===n?void 0:n.lowerLimit,null===(o=this.associatedJoint)||void 0===o?void 0:o.upperLimit)),this._rotationShaderMaterial.setFloat("enableLimits",this.enableLimits?1:0),this._matrixChanged()}}));const T=r._getSharedGizmoLight();T.includedOnlyMeshes=T.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(!1));const C={colliderMeshes:[_],gizmoMeshes:[d],material:this._coloredMaterial,hoverMaterial:this._hoverMaterial,disableMaterial:this._disableMaterial,active:!1,dragBehavior:this.dragBehavior};this._parent&&this._parent.addToAxisCache&&this._parent.addToAxisCache(this._gizmoMesh,C),this._pointerObserver=r.utilityLayerScene.onPointerObservable.add((e=>{var t;if(!this._customMeshSet&&(this.dragBehavior.maxDragAngle=O.MaxDragAngle,this._isHovered=!(-1==C.colliderMeshes.indexOf(null===(t=null==e?void 0:e.pickInfo)||void 0===t?void 0:t.pickedMesh)),!this._parent)){const e=C.dragBehavior.enabled?this._isHovered||this._dragging?this._hoverMaterial:this._coloredMaterial:this._disableMaterial;this._setGizmoMeshMaterial(C.gizmoMeshes,e)}})),this.dragBehavior.onEnabledObservable.add((e=>{this._setGizmoMeshMaterial(C.gizmoMeshes,e?this._coloredMaterial:this._disableMaterial)}))}_createGizmoMesh(t,i,r){const n=e.CreateTorus("ignore",{diameter:.6,thickness:.03*i,tessellation:r},this.gizmoLayer.utilityLayerScene);n.visibility=0;const o=e.CreateTorus("",{diameter:.6,thickness:.005*i,tessellation:r},this.gizmoLayer.utilityLayerScene);return o.material=this._coloredMaterial,o.rotation.x=Math.PI/2,n.rotation.x=Math.PI/2,t.addChild(o,e.Gizmo.PreserveScaling),t.addChild(n,e.Gizmo.PreserveScaling),{rotationMesh:o,collider:n}}_attachedNodeChanged(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)}set isEnabled(e){this._isEnabled=e,e?this._parent&&(this.attachedMesh=this._parent.attachedMesh):this.attachedMesh=null}get isEnabled(){return this._isEnabled}set rotationColor(e){this._rotationShaderMaterial.setColor3("rotationColor",e)}get coloredMaterial(){return this._coloredMaterial}get hoverMaterial(){return this._hoverMaterial}get disableMaterial(){return this._disableMaterial}dispose(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),this._gizmoMesh&&this._gizmoMesh.dispose(),this._rotationDisplayPlane&&this._rotationDisplayPlane.dispose(),this._rotationShaderMaterial&&this._rotationShaderMaterial.dispose();const e=[this._coloredMaterial,this._hoverMaterial,this._disableMaterial];for(const t of e)t&&t.dispose();super.dispose()}}O.MaxDragAngle=9*Math.PI/20,O._RotationGizmoVertexShader="\n precision highp float;\n attribute vec3 position;\n attribute vec2 uv;\n uniform mat4 worldViewProjection;\n varying vec3 vPosition;\n varying vec2 vUV;\n\n void main(void) {\n gl_Position = worldViewProjection * vec4(position, 1.0);\n vUV = uv;\n }",O._RotationGizmoFragmentShader="\n precision highp float;\n varying vec2 vUV;\n varying vec3 vPosition;\n uniform vec3 angles;\n uniform vec3 rotationColor;\n uniform vec2 limits;\n uniform float enableLimits;\n\n #define twopi 6.283185307 \n void main(void) {\n vec2 uv = vUV - vec2(0.5);\n float angle = atan(uv.y, uv.x) + 3.141592;\n float len = sqrt(dot(uv,uv));\n float opacity = 1. - step(0.5, len);\n \n // Default values for when limits are disabled\n float start = 0.0;\n float end = twopi;\n \n // Apply joint limits if enabled\n if (enableLimits > 0.5) {\n // Only show the arc between lower and upper limits\n start = limits.x; // lowerLimit\n end = limits.y; // upperLimit\n }\n\n float base = abs(floor(start / twopi)) * twopi;\n start = start + base;\n end = end + base;\n\n float intensity = 0.;\n float currentAngle = angle;\n for (int i = 0; i < 5; i++) {\n intensity += max(step(start, currentAngle) - step(end, currentAngle), 0.);\n currentAngle += twopi;\n } // Use constant opacity for the limits arc\n float finalOpacity = min(intensity * 0.25, 0.8);\n \n // Use consistent color for the entire limits arc\n vec3 finalColor = rotationColor;\n\n gl_FragColor = vec4(finalColor, finalOpacity) * opacity;\n }\n ";class A extends e.Gizmo{get coloredMaterial(){return this._coloredMaterial}get hoverMaterial(){return this._hoverMaterial}get disableMaterial(){return this._disableMaterial}static _CreateArrow(t,i,r=1,n=!1){const o=new e.TransformNode("arrow",t),a=e.CreateCylinder("cylinder",{diameterTop:0,height:.075,diameterBottom:.0375*(1+(r-1)/4),tessellation:96},t),s=e.CreateCylinder("cylinder",{diameterTop:.005*r,height:.275,diameterBottom:.005*r,tessellation:96},t);return a.parent=o,a.material=i,a.rotation.x=Math.PI/2,a.position.z+=.3,s.parent=o,s.material=i,s.position.z+=.1375,s.rotation.x=Math.PI/2,n&&(s.visibility=0,a.visibility=0),o}static _CreateArrowInstance(t,i){const r=new e.TransformNode("arrow",t);for(const e of i.getChildMeshes())e.createInstance(e.name).parent=r;return r}constructor(t,i=e.Color3.Gray(),r=e.UtilityLayerRenderer.DefaultUtilityLayer,n=1,o=e.Color3.Yellow(),a=e.Color3.Gray()){var s,l;super(r),this._pointerObserver=null,this.snapDistance=0,this.onSnapObservable=new e.Observable,this._isEnabled=!0,this._dragging=!1,this.associatedJoint=void 0,this.associatedJoint=t,this._coloredMaterial=new e.StandardMaterial("",r.utilityLayerScene),this._coloredMaterial.diffuseColor=i,this._coloredMaterial.specularColor=i.subtract(new e.Color3(.1,.1,.1)),this._hoverMaterial=new e.StandardMaterial("",r.utilityLayerScene),this._hoverMaterial.diffuseColor=o,this._disableMaterial=new e.StandardMaterial("",r.utilityLayerScene),this._disableMaterial.diffuseColor=a,this._disableMaterial.alpha=.4;const c=A._CreateArrow(r.utilityLayerScene,this._coloredMaterial,n),u=A._CreateArrow(r.utilityLayerScene,this._coloredMaterial,8*n,!0);this._gizmoMesh=new e.Mesh("",r.utilityLayerScene),this._gizmoMesh.addChild(c),this._gizmoMesh.addChild(u),this._gizmoMesh.lookAt(this._rootMesh.position.add((null===(s=this.associatedJoint)||void 0===s?void 0:s.axis)||e.Vector3.Zero())),this._gizmoMesh.parent=this._rootMesh,this.dragBehavior=new e.PointerDragBehavior({dragAxis:(null===(l=this.associatedJoint)||void 0===l?void 0:l.axis)||e.Vector3.Zero()}),this.dragBehavior.moveAttached=!1,this.dragBehavior.updateDragPlane=!1,this._rootMesh.addBehavior(this.dragBehavior),this.dragBehavior.onDragObservable.add((t=>{if(this.attachedNode){let i=!1;if(this.associatedJoint&&(0!==this.associatedJoint.lowerLimit||0!==this.associatedJoint.upperLimit)){const i=this.associatedJoint.origin.clone(),r=e.TmpVectors.Vector3[3];this.attachedNode.getWorldMatrix().getTranslationToRef(r);const n=i.subtract(r),o=this.associatedJoint.axis.normalize(),a=e.Vector3.Dot(n,o),s=e.Vector3.Dot(t.delta,o),l=(t.delta.clone(),a+s);if(console.log(`Current position along axis: ${a.toFixed(3)}`),console.log(`Delta along axis: ${s.toFixed(3)}`),console.log(`New position along axis: ${l.toFixed(3)}`),console.log(`Limits: [${this.associatedJoint.lowerLimit.toFixed(3)}, ${this.associatedJoint.upperLimit.toFixed(3)}]`),l<this.associatedJoint.lowerLimit){if(!(s>0&&a<=this.associatedJoint.lowerLimit))return console.log(`Movement aborted: would exceed lower limit (${this.associatedJoint.lowerLimit.toFixed(3)})`),void t.delta.scaleInPlace(0);console.log("Allowing movement away from lower limit")}else if(l>this.associatedJoint.upperLimit){if(!(s<0&&a>=this.associatedJoint.upperLimit))return console.log(`Movement aborted: would exceed upper limit (${this.associatedJoint.upperLimit.toFixed(3)})`),void t.delta.scaleInPlace(0);console.log("Allowing movement away from upper limit")}else console.log(`Movement within limits: ${l.toFixed(3)} is between [${this.associatedJoint.lowerLimit.toFixed(3)}, ${this.associatedJoint.upperLimit.toFixed(3)}]`)}this.attachedNode.getWorldMatrix().getTranslationToRef(e.TmpVectors.Vector3[2]),e.TmpVectors.Vector3[2].addInPlace(t.delta),this.dragBehavior.validateDrag(e.TmpVectors.Vector3[2])&&(this.attachedNode.position&&this.attachedNode.position.addInPlaceFromFloats(t.delta.x,t.delta.y,t.delta.z),this.attachedNode.getWorldMatrix().addTranslationFromFloats(t.delta.x,t.delta.y,t.delta.z),this.attachedNode.updateCache(),i=!0),i&&this._matrixChanged()}})),this.dragBehavior.onDragStartObservable.add((()=>{this._dragging=!0})),this.dragBehavior.onDragEndObservable.add((()=>{this._dragging=!1}));const h=r._getSharedGizmoLight();h.includedOnlyMeshes=h.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(!1));const d={gizmoMeshes:c.getChildMeshes(),colliderMeshes:u.getChildMeshes(),material:this._coloredMaterial,hoverMaterial:this._hoverMaterial,disableMaterial:this._disableMaterial,active:!1,dragBehavior:this.dragBehavior};this._pointerObserver=r.utilityLayerScene.onPointerObservable.add((e=>{var t;if(this._customMeshSet)return;this._isHovered=!(-1==d.colliderMeshes.indexOf(null===(t=null==e?void 0:e.pickInfo)||void 0===t?void 0:t.pickedMesh));const i=this.dragBehavior.enabled?this._isHovered||this._dragging?this._hoverMaterial:this._coloredMaterial:this._disableMaterial;this._setGizmoMeshMaterial(d.gizmoMeshes,i)})),this.dragBehavior.onEnabledObservable.add((e=>{this._setGizmoMeshMaterial(d.gizmoMeshes,e?d.material:d.disableMaterial)}))}_attachedNodeChanged(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)}set isEnabled(e){this._isEnabled=e,e||(this.attachedMesh=null,this.attachedNode=null)}get isEnabled(){return this._isEnabled}dispose(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),this._gizmoMesh&&this._gizmoMesh.dispose();const e=[this._coloredMaterial,this._hoverMaterial,this._disableMaterial];for(const t of e)t&&t.dispose();super.dispose()}}var R=r(5695),L=r(471);class B{constructor(){this.engine=void 0,this.scene=void 0,this.currentURDF=void 0,this.currentRobot=void 0,this.UILayer=void 0,this.ground=void 0,this.camera=void 0,this.statusLabel=new R.TextBlock,this.readyToRender=!1,this.jointAxisList=[],this.linkAxisList=[],this.jointRotationGizmos=[],this.linkRotationGizmos=[],this.worldAxis=void 0,this.worldAxisSize=8,this.selectedVisual=void 0,this.hoveredJoint=void 0,this.utilLayer=void 0,this.gizmoLayer=void 0,this.planeRotationGizmo=void 0,this.planePositionGizmo=void 0,this.hasBeenFramed=!1,this.pendingMeshLoads=0,this.meshLoadPromises=[],this.savedFramingTarget=new e.Vector3(0,0,0),this.savedFramingRadius=1,this.savedFramingAlpha=-Math.PI/3,this.savedFramingBeta=5*Math.PI/12}clearStatus(){this.statusLabel.text=""}clearAxisGizmos(){this.linkAxisList.forEach((e=>{e.dispose()})),this.linkAxisList=[],this.jointAxisList.forEach((e=>{e.dispose()})),this.jointAxisList=[]}addAxisToTransform(t,i,r,n){if(n){let i=new e.PositionGizmo(r);i.scaleRatio=.5,i.attachedNode=n,t.push(i);let o=()=>{n&&(this.statusLabel.text=n.name+"\nX: "+n.position.x.toFixed(6)+"\nY: "+n.position.y.toFixed(6)+"\nZ: "+n.position.z.toFixed(6),this.statusLabel.linkOffsetY=-100,this.statusLabel.linkWithMesh(n))};i.xGizmo.dragBehavior.onDragObservable.add(o),i.yGizmo.dragBehavior.onDragObservable.add(o),i.zGizmo.dragBehavior.onDragObservable.add(o)}}toggleAxisOnRobot(e,t,i){if(!this.currentRobot||!t)return;let r=e?this.jointAxisList:this.linkAxisList;0===r.length?e?Array.from(this.currentRobot.joints.entries()).forEach((([e,n])=>{this.addAxisToTransform(r,t,i,n.transform)})):Array.from(this.currentRobot.links.entries()).forEach((([e,n])=>{n.visuals.forEach((e=>{this.addAxisToTransform(r,t,i,e.transform)}))})):(this.clearAxisGizmos(),this.clearStatus())}clearRotationGizmos(){this.jointRotationGizmos.forEach((e=>{e.dispose()})),this.jointRotationGizmos=[],this.linkRotationGizmos.forEach((e=>{e.dispose()})),this.linkRotationGizmos=[]}addRotationToTransform(t,i,r,n){if(i&&n){let i=new e.RotationGizmo(r);i.scaleRatio=.5,i.attachedNode=n,t.push(i);let o=()=>{n&&(this.statusLabel.text=n.name+"\nR:"+n.rotation.x.toFixed(6)+"\nP:"+n.rotation.y.toFixed(6)+"\nY:"+n.rotation.z.toFixed(6),this.statusLabel.linkOffsetY=-100,this.statusLabel.linkWithMesh(n))};i.xGizmo.dragBehavior.onDragObservable.add(o),i.yGizmo.dragBehavior.onDragObservable.add(o),i.zGizmo.dragBehavior.onDragObservable.add(o)}}toggleAxisRotationOnRobot(e,t,i,r){if(!this.currentRobot||!i||!t)return;let n=e?this.jointRotationGizmos:this.linkRotationGizmos;0===n.length?e?Array.from(this.currentRobot.joints.entries()).forEach((([e,t])=>{this.addRotationToTransform(n,i,r,t.transform)})):Array.from(this.currentRobot.links.entries()).forEach((([e,t])=>{t.visuals.forEach((e=>{this.addRotationToTransform(n,i,r,e.transform)}))})):(this.clearRotationGizmos(),this.clearStatus())}clearJointExerciseGizmos(){var e,t;null===(e=this.planeRotationGizmo)||void 0===e||e.dispose(),this.planeRotationGizmo=void 0,null===(t=this.planePositionGizmo)||void 0===t||t.dispose(),this.planePositionGizmo=void 0}addExerciseGizmoToJoint(t,i,r){if(t.transform){if(console.log(`Creating gizmo for joint: ${t.name}, type: ${t.type}`),t.type!==o.Fixed)switch(t.type){case o.Continuous:case o.Revolute:Math.abs(t.axis.y)>.5?(console.log(`Joint ${t.name} is primarily rotating around y-axis`),this.planeRotationGizmo=new O(t,e.Color3.Green(),r)):Math.abs(t.axis.z)>.5?(console.log(`Joint ${t.name} is primarily rotating around z-axis`),this.planeRotationGizmo=new O(t,e.Color3.Blue(),r)):(console.log(`Joint ${t.name} rotating around x-axis`),this.planeRotationGizmo=new O(t,e.Color3.Red(),r)),this.planeRotationGizmo.scaleRatio=.75,this.planeRotationGizmo.attachedNode=t.transform,this.planeRotationGizmo.enableLimits=t.type!==o.Continuous,this.planeRotationGizmo.dragBehavior.onDragObservable.add((()=>{t.transform&&this.updateJointStatusLabel(t)}));break;case o.Prismatic:this.planePositionGizmo=void 0,Math.abs(t.axis.y)>.5?this.planePositionGizmo=new A(t,e.Color3.Blue(),r):Math.abs(t.axis.z)>.5?this.planePositionGizmo=new A(t,e.Color3.Red(),r):this.planePositionGizmo=new A(t,e.Color3.Green(),r),this.planePositionGizmo&&(this.planePositionGizmo.scaleRatio=.75,this.planePositionGizmo.attachedNode=t.transform);break;case o.Planar:console.log(`Joint ${t.name} is using a planar joint, which is not yet supported for exercise gizmos. If you would like to see this, please open an issue on the GitHub repository.`);break;case o.Floating:console.log(`Joint ${t.name} is using a floating joint, which is not yet supported for exercise gizmos. If you would like to see this, please open an issue on the GitHub repository.`)}}else console.log(`No transform for joint: ${t.name}`)}updateJointStatusLabel(e){if(!e.transform)return;let t="",i="";e.type!==o.Revolute&&e.type!==o.Continuous||(i="\nRotation: "+e.transform.rotation.x.toFixed(3)+","+e.transform.rotation.y.toFixed(3)+","+e.transform.rotation.z.toFixed(3),isNaN(e.lowerLimit)||isNaN(e.upperLimit)||e.lowerLimit===e.upperLimit||e.type===o.Continuous||(t="\nLimits: "+e.lowerLimit.toFixed(2)+" to "+e.upperLimit.toFixed(2)));let r="";e.type===o.Prismatic&&(r="\nPosition: "+e.transform.position.x.toFixed(3)+","+e.transform.position.y.toFixed(3)+","+e.transform.position.z.toFixed(3)),this.statusLabel.text=e.name+"\nType: "+e.type+t+i+r,this.statusLabel.linkOffsetY=-100,this.statusLabel.linkWithMesh(e.transform)}toggleCollision(){this.currentRobot&&Array.from(this.currentRobot.links.entries()).forEach((([e,t])=>{t.collisions.forEach((e=>{e.setEnabled(!e.isEnabled())}))}))}toggleVisuals(){this.currentRobot&&Array.from(this.currentRobot.links.entries()).forEach((([e,t])=>{t.visuals.forEach((e=>{e.setEnabled(!e.isEnabled())}))}))}toggleBoundingBoxes(){this.currentRobot&&Array.from(this.currentRobot.links.entries()).forEach((([e,t])=>{t.visuals.forEach((e=>{var t,i;null===(i=null===(t=e.geometry)||void 0===t?void 0:t.meshes)||void 0===i||i.forEach((e=>{e.showBoundingBox=!e.showBoundingBox}))}))}))}resetCamera(){this.camera&&(this.hasBeenFramed?(this.camera.setTarget(this.savedFramingTarget),this.camera.radius=this.savedFramingRadius,this.camera.alpha=this.savedFramingAlpha,this.camera.beta=this.savedFramingBeta):(this.camera.alpha=-Math.PI/3,this.camera.beta=5*Math.PI/12,this.camera.target=new e.Vector3(0,0,0),this.camera.radius=1))}createButton(e,t,i,r,n){var o=R.Button.CreateSimpleButton(t,i);return o.width="100px",o.height="20px",o.color="white",o.cornerRadius=5,o.background="green",o.onPointerUpObservable.add(n),e.addControl(o),o}makeTextPlane(t,i,r){if(!this.scene)return;var n=new e.DynamicTexture("DynamicTexture",50,this.scene,!0);n.hasAlpha=!0,n.drawText(t,5,40,"bold 36px Arial",i,"transparent",!0);var o=e.MeshBuilder.CreatePlane("TextPlane",{size:r},this.scene);let a=new e.StandardMaterial("TextPlaneMaterial",this.scene);return a.backFaceCulling=!1,a.specularColor=new e.Color3(0,0,0),a.diffuseTexture=n,o.material=a,o}createWorldAxis(){if(this.scene){this.worldAxis=new e.TransformNode("worldAxis",this.scene),this.worldAxis.rotation=new e.Vector3(-Math.PI/2,0,0);var t=e.MeshBuilder.CreateLines("axisX",{points:[new e.Vector3(0,0,0),new e.Vector3(this.worldAxisSize,0,0),new e.Vector3(.95*this.worldAxisSize,.05*this.worldAxisSize,0),new e.Vector3(this.worldAxisSize,0,0),new e.Vector3(.95*this.worldAxisSize,-.05*this.worldAxisSize,0)]},this.scene);t.color=new e.Color3(1,0,0),t.parent=this.worldAxis;var i=this.makeTextPlane("X","red",this.worldAxisSize/10);void 0!==i&&(i.position=new e.Vector3(.9*this.worldAxisSize,-.05*this.worldAxisSize,0),i.parent=this.worldAxis);var r=e.MeshBuilder.CreateLines("axisY",{points:[new e.Vector3(0,0,0),new e.Vector3(0,this.worldAxisSize,0),new e.Vector3(-.05*this.worldAxisSize,.95*this.worldAxisSize,0),new e.Vector3(0,this.worldAxisSize,0),new e.Vector3(.05*this.worldAxisSize,.95*this.worldAxisSize,0)]},this.scene);r.color=new e.Color3(0,1,0),r.parent=this.worldAxis;var n=this.makeTextPlane("Y","green",this.worldAxisSize/10);void 0!==n&&(n.position=new e.Vector3(-.05*this.worldAxisSize,.9*this.worldAxisSize,0),n.parent=this.worldAxis);var o=e.MeshBuilder.CreateLines("axisZ",{points:[new e.Vector3(0,0,0),new e.Vector3(0,0,this.worldAxisSize),new e.Vector3(0,-.05*this.worldAxisSize,.95*this.worldAxisSize),new e.Vector3(0,0,this.worldAxisSize),new e.Vector3(0,.05*this.worldAxisSize,.95*this.worldAxisSize)]},this.scene);o.color=new e.Color3(0,0,1),o.parent=this.worldAxis;var a=this.makeTextPlane("Z","blue",this.worldAxisSize/10);void 0!==a&&(a.position=new e.Vector3(0,.05*this.worldAxisSize,.9*this.worldAxisSize),a.rotation=new e.Vector3(-Math.PI/2,0,0),a.parent=this.worldAxis),this.worldAxis.position=new e.Vector3(0,0,0)}}toggleWorldAxis(){null!=this.worldAxis&&(this.worldAxis.isEnabled()?this.worldAxis.setEnabled(!1):this.worldAxis.setEnabled(!0))}createUI(){if(!this.scene)return;this.UILayer=R.AdvancedDynamicTexture.CreateFullscreenUI("UI",!0,this.scene),this.statusLabel.color="white",this.statusLabel.textHorizontalAlignment=R.Control.HORIZONTAL_ALIGNMENT_LEFT,this.statusLabel.horizontalAlignment=R.Control.HORIZONTAL_ALIGNMENT_CENTER,this.statusLabel.resizeToFit=!0,this.statusLabel.outlineColor="green",this.statusLabel.outlineWidth=2,this.UILayer.addControl(this.statusLabel);var t=new R.StackPanel;t.paddingTop="10px",t.paddingLeft="10px",t.width="100%",t.height="50px",t.fontSize="14px",t.horizontalAlignment=R.Control.HORIZONTAL_ALIGNMENT_LEFT,t.verticalAlignment=R.Control.VERTICAL_ALIGNMENT_TOP,t.isVertical=!1,this.UILayer.addControl(t),this.utilLayer=new e.UtilityLayerRenderer(this.scene),this.utilLayer.shouldRender=!0,this.utilLayer.onlyCheckPointerDownEvents=!1;const i=new e.GizmoManager(this.scene,5,this.utilLayer);i.usePointerToAttachGizmos=!1,i.positionGizmoEnabled=!0,i.rotationGizmoEnabled=!0,this.createWorldAxis(),this.createButton(t,"jointAxisButton","Joint Axis",this.scene,(()=>{this.toggleAxisOnRobot(!0,this.scene,this.utilLayer)})),this.createButton(t,"linkAxisButton","Link Axis",this.scene,(()=>{this.toggleAxisOnRobot(!1,this.scene,this.utilLayer)})),this.createButton(t,"jointRotationButton","Joint Rotation",this.scene,(()=>{this.toggleAxisRotationOnRobot(!0,this.UILayer,this.scene,this.utilLayer)})),this.createButton(t,"linkRotationButton","Link Rotation",this.scene,(()=>{this.toggleAxisRotationOnRobot(!1,this.UILayer,this.scene,this.utilLayer)})),this.createButton(t,"worldAxis","World Axis",this.scene,(()=>{this.toggleWorldAxis()})),this.createButton(t,"collision","Collision",this.scene,(()=>{this.toggleCollision()})),this.createButton(t,"visuals","Visuals",this.scene,(()=>{this.toggleVisuals()})),this.createButton(t,"reset","Reset",this.scene,(()=>{void 0!==this.currentURDF&&this.applyURDF(this.currentURDF)}));let r=this;this.scene.onPointerDown=function(){var t,i;if(r.scene&&r.camera){r.selectedVisual&&(null===(i=null===(t=r.selectedVisual.geometry)||void 0===t?void 0:t.meshes)||void 0===i||i.forEach((e=>{e.showBoundingBox=!1})),r.selectedVisual=void 0),r.clearStatus();var n=r.scene.createPickingRay(r.scene.pointerX,r.scene.pointerY,e.Matrix.Identity(),r.camera,!1),a=r.scene.pickWithRay(n);if((null==a?void 0:a.pickedMesh)&&r.currentRobot){let e;Array.from(r.currentRobot.joints.entries()).forEach((([t,i])=>{var r;if(i.type!==o.Fixed&&i.transform){if((null===(r=null==a?void 0:a.pickedMesh)||void 0===r?void 0:r.parent)===i.transform)return e=i,void console.log(`Found joint (direct parent): ${i.name}`);i.child&&!e&&i.child.visuals.forEach((t=>{var r;(null===(r=t.geometry)||void 0===r?void 0:r.meshes)&&t.geometry.meshes.forEach((t=>{if(t===(null==a?void 0:a.pickedMesh))return e=i,void console.log(`Found joint (child link visual): ${i.name}`)}))}))}})),e?(console.log(`Creating gizmo for joint: ${e.name}`),e!==r.hoveredJoint&&(r.clearJointExerciseGizmos(),r.hoveredJoint=e,r.addExerciseGizmoToJoint(e,r.scene,r.utilLayer),e.transform&&r.updateJointStatusLabel(e))):(r.hoveredJoint=void 0,r.clearJointExerciseGizmos(),r.clearStatus())}}}}applyURDF(e){return b(this,arguments,void 0,(function*(e,t=void 0){if(this.clearAxisGizmos(),this.clearRotationGizmos(),this.clearJointExerciseGizmos(),this.clearStatus(),this.currentRobot){var i=this.currentRobot;this.currentRobot=void 0,i.dispose()}void 0!==t&&t.postMessage({command:"trace",text:"loading urdf"});try{this.scene&&(this.currentURDF=e,this.meshLoadPromises=[],this.pendingMeshLoads=0,this.hasBeenFramed=!1,this.currentRobot=yield M(e),this.currentRobot.links.forEach((e=>{e.visuals.forEach((e=>{if(e.geometry&&e.geometry instanceof c){this.pendingMeshLoads++;const t=new Promise((t=>{var i,r;null===(r=null===(i=e.geometry)||void 0===i?void 0:i.setLoadCompleteCallback)||void 0===r||r.call(i,(()=>{this.pendingMeshLoads--,t(),0!==this.pendingMeshLoads||this.hasBeenFramed||setTimeout((()=>{this.frameModel()}),100)}))}));this.meshLoadPromises.push(t)}}))})),this.currentRobot.create(this.scene),0!==this.pendingMeshLoads||this.hasBeenFramed||setTimeout((()=>{this.frameModel()}),100))}catch(e){return void(void 0===t?console.error(`Error loading urdf: ${e.message}`):t.postMessage({command:"error",text:e.message}))}void 0!==t&&t.postMessage({command:"trace",text:"loaded urdf"})}))}takeScreenshot(t,i){return b(this,void 0,void 0,(function*(){var r,n,o,a;if(!this.scene||!this.engine||!this.camera)throw new Error("Scene, engine, or camera not initialized");const s=null!==(n=null===(r=this.utilLayer)||void 0===r?void 0:r.shouldRender)&&void 0!==n&&n,l=null!==(a=null===(o=this.gizmoLayer)||void 0===o?void 0:o.shouldRender)&&void 0!==a&&a;try{this.utilLayer&&(this.utilLayer.shouldRender=!1),this.gizmoLayer&&(this.gizmoLayer.shouldRender=!1);const r=this.engine.getRenderingCanvas(),n=t||(null==r?void 0:r.width)||1024,o=i||(null==r?void 0:r.height)||1024;return new Promise(((t,i)=>{this.scene.executeWhenReady((()=>{try{e.Tools.CreateScreenshotUsingRenderTarget(this.engine,this.camera,{width:n,height:o},(e=>{t(e.split(",")[1])}),"image/png",1,!1)}catch(e){i(e)}}))}))}finally{this.utilLayer&&(this.utilLayer.shouldRender=s),this.gizmoLayer&&(this.gizmoLayer.shouldRender=l)}}))}frameModel(){if(!this.scene||!this.camera||!this.currentRobot)return;const t=[];if(this.currentRobot.links.forEach((e=>{e.visuals.forEach((e=>{e.geometry&&e.geometry.meshes&&t.push(...e.geometry.meshes)}))})),0===t.length)return;let i=new e.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r=new e.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);t.forEach((t=>{const n=t.getBoundingInfo(),o=n.boundingBox.minimumWorld,a=n.boundingBox.maximumWorld;i=e.Vector3.Minimize(i,o),r=e.Vector3.Maximize(r,a)}));const n=e.Vector3.Center(i,r),o=r.subtract(i),a=Math.max(o.x,o.y,o.z);this.camera.setTarget(n);const s=1.5*a;this.camera.radius=Math.max(s,1),this.camera.alpha=-Math.PI/3,this.camera.beta=5*Math.PI/12,this.savedFramingTarget=n.clone(),this.savedFramingRadius=this.camera.radius,this.savedFramingAlpha=this.camera.alpha,this.savedFramingBeta=this.camera.beta,this.hasBeenFramed=!0}takeScreenshotDataURL(e,t){return b(this,void 0,void 0,(function*(){return`data:image/png;base64,${yield this.takeScreenshot(e,t)}`}))}createScene(t){return b(this,void 0,void 0,(function*(){let i=new e.Engine(t,!0);this.engine=i,this.scene=new e.Scene(i),e.SceneLoader&&e.SceneLoader.RegisterPlugin(new L.DAEFileLoader),this.scene.createDefaultEnvironment({createGround:!0,createSkybox:!1,enableGroundMirror:!0,groundMirrorSizeRatio:.15}),this.scene.useRightHandedSystem=!0,this.scene.clearColor=e.Color4.FromColor3(e.Color3.Black()),this.camera=new e.ArcRotateCamera("camera1",-Math.PI/3,5*Math.PI/12,1,new e.Vector3(0,0,0),this.scene),this.camera.wheelDeltaPercentage=.01,this.camera.minZ=.1,new e.HemisphericLight("light",new e.Vector3(0,1,0),this.scene),new e.HemisphericLight("light2",new e.Vector3(1,0,0),this.scene),new e.HemisphericLight("light3",new e.Vector3(0,0,1),this.scene),this.camera.attachControl(t,!0);var r=new y.GridMaterial("groundMaterial",this.scene);r.majorUnitFrequency=5,r.minorUnitVisibility=.5,r.gridRatio=1,r.opacity=.8,r.useMaxLine=!0,r.lineColor=e.Color3.Green(),r.mainColor=e.Color3.Green(),this.ground=e.MeshBuilder.CreateGround("ground",{width:50,height:50},this.scene),this.ground.material=r,this.ground.isPickable=!1}))}}let F;function D(){return b(this,void 0,void 0,(function*(){const e=document.getElementById("renderCanvas");F=new B,F.createScene(e),void 0!==F.scene&&void 0!==F.engine&&(F.scene.debugLayer.show(),F.createUI(),function(e){if(void 0!==e.UILayer){var t=new R.SelectionPanel("tests");t.color="white",t.width=.25,t.height=.75,t.horizontalAlignment=R.Control.HORIZONTAL_ALIGNMENT_LEFT,t.verticalAlignment=R.Control.VERTICAL_ALIGNMENT_BOTTOM,e.UILayer.addControl(t);var i=new R.RadioGroup("Basic Tests");t.addGroup(i),i.groupPanel.color="white",[{name:"Basic",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/basic.urdf"},{name:"Basic Joint",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/basic_with_joint.urdf"},{name:"Basic Revolute Joint",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/basic_with_joint_with_effort.urdf"},{name:"Planar Joint",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/basic_with_joint_planar.urdf"},{name:"Prismatic Joint",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/basic_with_joint_prismatic.urdf"},{name:"Basic Material",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/basic_with_material.urdf"},{name:"Basic Remote Mesh",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/basic_with_remote_mesh.urdf"},{name:"Basic with STL",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/basic_with_stl_mesh.urdf"},{name:"Orientation",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/orientation.urdf"},{name:"Bad",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/bad.urdf"},{name:"DAE",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/leo_chassis.urdf"}].forEach((t=>{i.addRadio(t.name,(()=>b(this,void 0,void 0,(function*(){const i=yield fetch(t.url),r=yield i.text();e.applyURDF(r)}))))}));var r=new R.RadioGroup("Robot Tests");t.addGroup(r),r.groupPanel.color="white",[{name:"leo",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/leo.urdf"},{name:"BB",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/bb.urdf"},{name:"Motoman",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/motoman.urdf"},{name:"Arti Robot",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/arti.urdf"},{name:"Mule",url:"https://raw.githubusercontent.com/Ranch-Hand-Robotics/babylon_ros/main/test/testdata/mule.urdf"},{name:"inline",url:""}].forEach((t=>{r.addRadio(t.name,(()=>b(this,void 0,void 0,(function*(){if("inline"===t.name){const t='<?xml version="1.0"?>\n<robot name="planar_joint_example">\n\n \x3c!-- Base Link --\x3e\n <link name="base_link">\n <visual>\n <geometry>\n <box size="0.25 0.25 0.1"/>\n </geometry>\n <origin xyz="0 0 0" rpy="0 0 0"/>\n <material name="blue">\n <color rgba="0 0 1 1"/>\n </material>\n </visual>\n <collision>\n <geometry>\n <box size="0.5 0.5 0.1"/>\n </geometry>\n <origin xyz="0 0 0" rpy="0 0 0"/>\n </collision>\n <inertial>\n <mass value="1.0"/>\n <inertia ixx="0.01" ixy="0.0" ixz="0.0" iyy="0.01" iyz="0.0" izz="0.01"/>\n </inertial>\n </link>\n\n \x3c!-- Moving Link --\x3e\n <link name="moving_link">\n <visual>\n <geometry>\n <cylinder radius="0.05" length="0.2"/>\n </geometry>\n <origin xyz="0 0 0.1" rpy="0 0 0"/>\n <material name="red">\n <color rgba="1 0 0 1"/>\n </material>\n </visual>\n <collision>\n <geometry>\n <cylinder radius="0.05" length="0.2"/>\n </geometry>\n <origin xyz="0 0 0.1" rpy="0 0 0"/>\n </collision>\n <inertial>\n <mass value="0.5"/>\n <inertia ixx="0.005" ixy="0.0" ixz="0.0" iyy="0.005" iyz="0.0" izz="0.005"/>\n </inertial>\n </link>\n\n \x3c!-- Prismatic Joint --\x3e\n <joint name="prismatic_joint" type="prismatic">\n <parent link="base_link"/>\n <child link="moving_link"/>\n <origin xyz="0 0 0.05" rpy="0 0 0"/>\n <axis xyz="0 0 1"/>\n <limit effort="1000" velocity="1.0" lower="-0.25" upper="0.25"/> \x3c!-- Limits for translation --\x3e\n </joint>\n\n</robot>\n';return void e.applyURDF(t)}const i=yield fetch(t.url),r=yield i.text();e.applyURDF(r)}))))})),function e(t){t.color="white",t instanceof R.Container&&t.children.forEach((t=>{e(t)}))}(t)}}(F),F.engine.runRenderLoop((function(){void 0!==F&&void 0!==F.scene&&F.scene.render()})),F.engine.resize(),window.addEventListener("resize",(function(){void 0!==F&&void 0!==F.engine&&F.engine.resize()})))}))}})(),n})()));
|
|
3
|
+
//# sourceMappingURL=ros.js.map
|