@playcanvas/web-components 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/gsplat-component.d.ts +29 -0
- package/dist/pwc.cjs +53 -2
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +53 -2
- package/dist/pwc.js.map +1 -1
- package/dist/pwc.min.js +1 -1
- package/dist/pwc.min.js.map +1 -1
- package/dist/pwc.mjs +53 -2
- package/dist/pwc.mjs.map +1 -1
- package/package.json +4 -4
- package/src/components/gsplat-component.ts +59 -2
package/dist/pwc.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("playcanvas")):"function"==typeof define&&define.amd?define(["exports","playcanvas"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).pd={},e.pc)}(this,function(e,t){"use strict";class i extends HTMLElement{constructor(){super(),this._readyPromise=new Promise(e=>{this._readyResolve=e})}get closestApp(){var e;return null===(e=this.parentElement)||void 0===e?void 0:e.closest("pc-app")}get closestEntity(){var e;return null===(e=this.parentElement)||void 0===e?void 0:e.closest("pc-entity")}_onReady(){this._readyResolve(),this.dispatchEvent(new CustomEvent("ready"))}ready(){return this._readyPromise.then(()=>this)}}class a extends HTMLElement{constructor(){super(),this.loadPromise=this.loadModule()}async loadModule(){const e=this.getAttribute("name"),i={glueUrl:this.getAttribute("glue"),wasmUrl:this.getAttribute("wasm"),fallbackUrl:this.getAttribute("fallback")};"Basis"===e?t.basisInitialize(i):(t.WasmModule.setConfig(e,i),await new Promise(i=>{t.WasmModule.getInstance(e,()=>i())}))}getLoadPromise(){return this.loadPromise}}customElements.define("pc-module",a);class s extends i{constructor(){super(),this._canvas=null,this._alpha=!0,this._backend="webgl2",this._antialias=!0,this._depth=!0,this._stencil=!0,this._highResolution=!0,this._hierarchyReady=!1,this._picker=null,this._hasPointerListeners={pointerenter:!1,pointerleave:!1,pointerdown:!1,pointerup:!1,pointermove:!1},this._hoveredEntity=null,this._pointerHandlers={pointermove:null,pointerdown:null,pointerup:null},this.app=null,this._onWindowResize=this._onWindowResize.bind(this)}async connectedCallback(){const e=this.querySelectorAll(":scope > pc-module");await Promise.all(Array.from(e).map(e=>e.getLoadPromise())),this._canvas=document.createElement("canvas"),this.appendChild(this._canvas);const i={webgpu:["webgpu","webgl2"],webgl2:["webgl2"],null:["null"]}[this._backend]||[],a=await t.createGraphicsDevice(this._canvas,{alpha:this._alpha,antialias:this._antialias,depth:this._depth,deviceTypes:i,stencil:this._stencil});a.maxPixelRatio=this._highResolution?window.devicePixelRatio:1;const s=new t.AppOptions;s.graphicsDevice=a,s.keyboard=new t.Keyboard(window),s.mouse=new t.Mouse(this._canvas),s.elementInput=new t.ElementInput(this._canvas,{useMouse:!0,useTouch:!0}),s.componentSystems=[t.AnimComponentSystem,t.AnimationComponentSystem,t.AudioListenerComponentSystem,t.ButtonComponentSystem,t.CameraComponentSystem,t.CollisionComponentSystem,t.ElementComponentSystem,t.GSplatComponentSystem,t.JointComponentSystem,t.LayoutChildComponentSystem,t.LayoutGroupComponentSystem,t.LightComponentSystem,t.ModelComponentSystem,t.ParticleSystemComponentSystem,t.RenderComponentSystem,t.RigidBodyComponentSystem,t.ScreenComponentSystem,t.ScriptComponentSystem,t.ScrollbarComponentSystem,t.ScrollViewComponentSystem,t.SoundComponentSystem,t.SpriteComponentSystem,t.ZoneComponentSystem],s.resourceHandlers=[t.AnimClipHandler,t.AnimationHandler,t.AnimStateGraphHandler,t.AudioHandler,t.BinaryHandler,t.CssHandler,t.ContainerHandler,t.CubemapHandler,t.FolderHandler,t.FontHandler,t.GSplatHandler,t.HierarchyHandler,t.HtmlHandler,t.JsonHandler,t.MaterialHandler,t.ModelHandler,t.RenderHandler,t.ScriptHandler,t.SceneHandler,t.ShaderHandler,t.SpriteHandler,t.TemplateHandler,t.TextHandler,t.TextureAtlasHandler,t.TextureHandler],s.soundManager=new t.SoundManager,s.lightmapper=t.Lightmapper,s.batchManager=t.BatchManager,s.xr=t.XrManager,this.app=new t.AppBase(this._canvas),this.app.init(s),this.app.setCanvasFillMode(t.FILLMODE_FILL_WINDOW),this.app.setCanvasResolution(t.RESOLUTION_AUTO),this._pickerCreate();const n=this.querySelectorAll(":scope > pc-asset");Array.from(n).forEach(e=>{e.createAsset();const t=e.asset;t&&this.app.assets.add(t)});const o=this.querySelectorAll(":scope > pc-material");Array.from(o).forEach(e=>{e.createMaterial()});const r=this.querySelectorAll("pc-entity");Array.from(r).forEach(e=>{e.createEntity(this.app)}),r.forEach(e=>{e.buildHierarchy(this.app)}),this._hierarchyReady=!0,this.app.preload(()=>{this.app.start(),window.addEventListener("resize",this._onWindowResize),this._onReady()})}disconnectedCallback(){this._pickerDestroy(),this.app&&(this.app.destroy(),this.app=null),window.removeEventListener("resize",this._onWindowResize),this._canvas&&this.contains(this._canvas)&&(this.removeChild(this._canvas),this._canvas=null)}_onWindowResize(){this.app&&this.app.resizeCanvas()}_pickerCreate(){const{width:e,height:i}=this.app.graphicsDevice;this._picker=new t.Picker(this.app,e,i),this._pointerHandlers.pointermove=this._onPointerMove.bind(this),this._pointerHandlers.pointerdown=this._onPointerDown.bind(this),this._pointerHandlers.pointerup=this._onPointerUp.bind(this),["pointermove","pointerdown","pointerup","pointerenter","pointerleave"].forEach(e=>{this.addEventListener(`${e}:connect`,()=>this._onPointerListenerAdded(e)),this.addEventListener(`${e}:disconnect`,()=>this._onPointerListenerRemoved(e))})}_pickerDestroy(){this._canvas&&Object.entries(this._pointerHandlers).forEach(([e,t])=>{t&&this._canvas.removeEventListener(e,t)}),this._picker=null,this._pointerHandlers={pointermove:null,pointerdown:null,pointerup:null}}_getPickerCoordinates(e){const t=this._canvas.getBoundingClientRect(),i=this._canvas.width/t.width,a=this._canvas.height/t.height;return{x:(e.clientX-t.left)*i,y:(e.clientY-t.top)*a}}_onPointerMove(e){if(!this._picker||!this.app)return;const i=this.app.root.findComponent("camera");if(!i)return;const{x:a,y:s}=this._getPickerCoordinates(e);this._picker.prepare(i,this.app.scene);const n=this._picker.getSelection(a,s);let o=null;if(n.length>0){const e=n[0];let i=e instanceof t.MeshInstance?e.node:e.entity;for(;null!==i;){const e=this.querySelector(`pc-entity[name="${i.name}"]`);if(e){o=e;break}i=i.parent}}this._hoveredEntity!==o&&(this._hoveredEntity&&this._hoveredEntity.hasListeners("pointerleave")&&this._hoveredEntity.dispatchEvent(new PointerEvent("pointerleave",e)),o&&o.hasListeners("pointerenter")&&o.dispatchEvent(new PointerEvent("pointerenter",e))),this._hoveredEntity=o,o&&o.hasListeners("pointermove")&&o.dispatchEvent(new PointerEvent("pointermove",e))}_onPointerDown(e){if(!this._picker||!this.app)return;const i=this.app.root.findComponent("camera");if(!i)return;const{x:a,y:s}=this._getPickerCoordinates(e);this._picker.prepare(i,this.app.scene);const n=this._picker.getSelection(a,s);if(n.length>0){const i=n[0];let a=i instanceof t.MeshInstance?i.node:i.entity;for(;null!==a;){const t=this.querySelector(`pc-entity[name="${a.name}"]`);if(t&&t.hasListeners("pointerdown")){t.dispatchEvent(new PointerEvent("pointerdown",e));break}a=a.parent}}}_onPointerUp(e){if(!this._picker||!this.app)return;const i=this.app.root.findComponent("camera");if(!i)return;const{x:a,y:s}=this._getPickerCoordinates(e);this._picker.prepare(i,this.app.scene);const n=this._picker.getSelection(a,s);if(n.length>0){const i=n[0],a=i instanceof t.MeshInstance?i.node:i.entity,s=this.querySelector(`pc-entity[name="${a.name}"]`);s&&s.hasListeners("pointerup")&&s.dispatchEvent(new PointerEvent("pointerup",e))}}_onPointerListenerAdded(e){if(!this._hasPointerListeners[e]&&this._canvas){this._hasPointerListeners[e]=!0;const t="pointerenter"===e||"pointerleave"===e?this._pointerHandlers.pointermove:this._pointerHandlers[e];t&&this._canvas.addEventListener("pointerenter"===e||"pointerleave"===e?"pointermove":e,t)}}_onPointerListenerRemoved(e){if(!Array.from(this.querySelectorAll("pc-entity")).some(t=>t.hasListeners(e))&&this._canvas){this._hasPointerListeners[e]=!1;const t="pointerenter"===e||"pointerleave"===e?this._pointerHandlers.pointermove:this._pointerHandlers[e];t&&this._canvas.removeEventListener("pointerenter"===e||"pointerleave"===e?"pointermove":e,t)}}set alpha(e){this._alpha=e}get alpha(){return this._alpha}set antialias(e){this._antialias=e}get antialias(){return this._antialias}set backend(e){this._backend=e}get backend(){return this._backend}set depth(e){this._depth=e}get depth(){return this._depth}get hierarchyReady(){return this._hierarchyReady}set highResolution(e){this._highResolution=e,this.app&&(this.app.graphicsDevice.maxPixelRatio=e?window.devicePixelRatio:1)}get highResolution(){return this._highResolution}set stencil(e){this._stencil=e}get stencil(){return this._stencil}static get observedAttributes(){return["alpha","antialias","backend","depth","stencil","high-resolution"]}attributeChangedCallback(e,t,i){switch(e){case"alpha":this.alpha="false"!==i;break;case"antialias":this.antialias="false"!==i;break;case"backend":"webgpu"!==i&&"webgl2"!==i&&"null"!==i||(this.backend=i);break;case"depth":this.depth="false"!==i;break;case"high-resolution":this.highResolution="false"!==i;break;case"stencil":this.stencil="false"!==i}}}customElements.define("pc-app",s);const n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},o=e=>{const i=n[e.toLowerCase()];if(i)return(new t.Color).fromString(i);if(e.startsWith("#"))return(new t.Color).fromString(e);const a=e.split(" ").map(Number);return new t.Color(a)},r=e=>{const i=e.split(" ").map(Number);return new t.Vec2(i)},c=e=>{const i=e.split(" ").map(Number);return new t.Vec3(i)},h=e=>{const i=e.split(" ").map(Number);return new t.Vec4(i)},b=(e,t,i)=>{const a=t.get(e);if(void 0!==a)return a;const s=Number(e);return Number.isFinite(s)?s:i},l=e=>{var t,i;if(!e)return null;let a=null;try{a=document.querySelector(e)}catch(e){a=null}return a||(a=null!==(t=document.getElementById(e))&&void 0!==t?t:document.querySelector(`pc-entity[name="${e}"]`)),null!==(i=null==a?void 0:a.entity)&&void 0!==i?i:null};class p extends i{constructor(){super(...arguments),this._enabled=!0,this._name="Untitled",this._position=new t.Vec3,this._rotation=new t.Vec3,this._scale=new t.Vec3(1,1,1),this._tags=[],this._listeners={},this._built=!1,this.entity=null}createEntity(e){if(this.entity)return;this.entity=new t.Entity(this.getAttribute("name")||this._name,e);const i=this.getAttribute("enabled");i&&(this.entity.enabled="false"!==i);const a=this.getAttribute("position");a&&this.entity.setLocalPosition(c(a));const s=this.getAttribute("rotation");s&&this.entity.setLocalEulerAngles(c(s));const n=this.getAttribute("scale");n&&this.entity.setLocalScale(c(n));const o=this.getAttribute("tags");o&&this.entity.tags.add(o.split(",").map(e=>e.trim()));["onpointerenter","onpointerleave","onpointerdown","onpointerup","onpointermove"].forEach(e=>{const t=this.getAttribute(e);if(t){const i=e.substring(2),a=e=>{try{new Function("event",t).call(this,e)}catch(e){console.error("Error in event handler:",e)}};this.addEventListener(i,a)}})}buildHierarchy(e){if(!this.entity||this._built)return;this._built=!0;const t=this.closestEntity;(null==t?void 0:t.entity)?t.entity.addChild(this.entity):e.root.addChild(this.entity),this._onReady()}connectedCallback(){const e=this.closestApp;if(e&&e.hierarchyReady){const t=e.app;this.createEntity(t),this.buildHierarchy(t);const i=this.querySelectorAll("pc-entity");i.forEach(e=>{e.createEntity(t)}),i.forEach(e=>{e.buildHierarchy(t)})}}disconnectedCallback(){if(this.entity){this.querySelectorAll("pc-entity").forEach(e=>{e.entity=null}),this.entity.destroy(),this.entity=null,this._built=!1}}set enabled(e){this._enabled=e,this.entity&&(this.entity.enabled=e)}get enabled(){return this._enabled}set name(e){this._name=e,this.entity&&(this.entity.name=e)}get name(){return this._name}set position(e){this._position=e,this.entity&&this.entity.setLocalPosition(this._position)}get position(){return this._position}set rotation(e){this._rotation=e,this.entity&&this.entity.setLocalEulerAngles(this._rotation)}get rotation(){return this._rotation}set scale(e){this._scale=e,this.entity&&this.entity.setLocalScale(this._scale)}get scale(){return this._scale}set tags(e){this._tags=e,this.entity&&(this.entity.tags.clear(),this.entity.tags.add(this._tags))}get tags(){return this._tags}static get observedAttributes(){return["enabled","name","position","rotation","scale","tags","onpointerenter","onpointerleave","onpointerdown","onpointerup","onpointermove"]}attributeChangedCallback(e,t,i){switch(e){case"enabled":this.enabled="false"!==i;break;case"name":this.name=i;break;case"position":this.position=c(i);break;case"rotation":this.rotation=c(i);break;case"scale":this.scale=c(i);break;case"tags":this.tags=i.split(",").map(e=>e.trim());break;case"onpointerenter":case"onpointerleave":case"onpointerdown":case"onpointerup":case"onpointermove":if(i){const t=e.substring(2),i=e=>{try{const i=this.getAttribute(t)||"";new Function("event",i).call(this,e)}catch(e){console.error("Error in event handler:",e)}};this.addEventListener(t,i)}}}addEventListener(e,t,i){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),super.addEventListener(e,t,i),e.startsWith("pointer")&&this.dispatchEvent(new CustomEvent(`${e}:connect`,{bubbles:!0}))}removeEventListener(e,t,i){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter(e=>e!==t)),super.removeEventListener(e,t,i),e.startsWith("pointer")&&this.dispatchEvent(new CustomEvent(`${e}:disconnect`,{bubbles:!0}))}hasListeners(e){var t;return Boolean(null===(t=this._listeners[e])||void 0===t?void 0:t.length)}}customElements.define("pc-entity",p);var d=function(){var e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if("object"!=typeof WebAssembly)return{supported:!1};var i,a=WebAssembly.validate(e)?"b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb":"b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",s=WebAssembly.instantiate(n(a),{}).then(function(e){(i=e.instance).exports.__wasm_call_ctors()});function n(e){for(var i=new Uint8Array(e.length),a=0;a<e.length;++a){var s=e.charCodeAt(a);i[a]=s>96?s-97:s>64?s-39:s+4}var n=0;for(a=0;a<e.length;++a)i[n++]=i[a]<60?t[i[a]]:64*(i[a]-60)+i[++a];return i.buffer.slice(0,n)}function o(e,t,a,s,n,o){var r=i.exports.sbrk,c=a+3&-4,h=r(c*s),b=r(n.length),l=new Uint8Array(i.exports.memory.buffer);l.set(n,b);var p=e(h,a,s,b,n.length);if(0==p&&o&&o(h,c,s),t.set(l.subarray(h,h+a*s)),r(h-r(0)),0!=p)throw new Error("Malformed buffer data: "+p)}var r={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],b=0;function l(e){var t={object:new Worker(e),pending:0,requests:{}};return t.object.onmessage=function(e){var i=e.data;t.pending-=i.count,t.requests[i.id][i.action](i.value),delete t.requests[i.id]},t}function p(e){for(var t="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(n(a))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+o.toString()+d.toString(),i=new Blob([t],{type:"text/javascript"}),s=URL.createObjectURL(i),r=0;r<e;++r)h[r]=l(s);URL.revokeObjectURL(s)}function d(e){s.then(function(){var t=e.data;try{var a=new Uint8Array(t.count*t.size);o(i.exports[t.mode],a,t.count,t.size,t.source,i.exports[t.filter]),self.postMessage({id:t.id,count:t.count,action:"resolve",value:a},[a.buffer])}catch(e){self.postMessage({id:t.id,count:t.count,action:"reject",value:e})}})}return{ready:s,supported:!0,useWorkers:function(e){p(e)},decodeVertexBuffer:function(e,t,a,s,n){o(i.exports.meshopt_decodeVertexBuffer,e,t,a,s,i.exports[r[n]])},decodeIndexBuffer:function(e,t,a,s){o(i.exports.meshopt_decodeIndexBuffer,e,t,a,s)},decodeIndexSequence:function(e,t,a,s){o(i.exports.meshopt_decodeIndexSequence,e,t,a,s)},decodeGltfBuffer:function(e,t,a,s,n,h){o(i.exports[c[n]],e,t,a,s,i.exports[r[h]])},decodeGltfBufferAsync:function(e,t,a,n,l){return h.length>0?function(e,t,i,a,s){for(var n=h[0],o=1;o<h.length;++o)h[o].pending<n.pending&&(n=h[o]);return new Promise(function(o,r){var c=new Uint8Array(i),h=b++;n.pending+=e,n.requests[h]={resolve:o,reject:r},n.object.postMessage({id:h,count:e,size:t,source:c,mode:a,filter:s},[c.buffer])})}(e,t,a,c[n],r[l]):s.then(function(){var s=new Uint8Array(e*t);return o(i.exports[c[n]],s,e,t,a,i.exports[r[l]]),s})}}}();const m=new Map([["simple",t.SPRITE_RENDERMODE_SIMPLE],["sliced",t.SPRITE_RENDERMODE_SLICED],["tiled",t.SPRITE_RENDERMODE_TILED]]),u=new Map([["bin","binary"],["css","css"],["frag","shader"],["glb","container"],["glsl","shader"],["hdr","texture"],["html","html"],["jpg","texture"],["js","script"],["json","json"],["mp3","audio"],["mjs","script"],["ply","gsplat"],["png","texture"],["sog","gsplat"],["txt","text"],["vert","shader"],["webp","texture"]]),g=(e,t,i)=>{if(e.extensions&&e.extensions.EXT_meshopt_compression){const a=e.extensions.EXT_meshopt_compression;Promise.all([d.ready,t[a.buffer]]).then(e=>{const t=e[1],s=a.byteOffset||0,n=a.byteLength||0,o=a.count,r=a.byteStride,c=new Uint8Array(o*r),h=new Uint8Array(t.buffer,t.byteOffset+s,n);d.decodeGltfBuffer(c,o,r,h,a.mode,a.filter),i(null,c)})}else i(null,null)};class f extends HTMLElement{constructor(){super(...arguments),this._lazy=!1,this.asset=null}disconnectedCallback(){this.destroyAsset()}createAsset(){var e;const i=this.getAttribute("id")||"",a=this.getAttribute("src")||"";let s=this.getAttribute("type");if(!s){const t=a.split(".").pop();s=null!==(e=u.get(t||""))&&void 0!==e?e:null}if(!s)return void console.warn(`Unsupported asset type: ${a}`);const n=this._buildData(s);this.asset="container"===s?new t.Asset(i,s,{url:a},void 0,{bufferView:{processAsync:g.bind(this)}}):"sprite"===s?new t.Asset(i,s,null,n):new t.Asset(i,s,a?{url:a}:null,n),this.asset.preload=!this._lazy}_buildData(e){var i,a,s,n;let o;const r=this.getAttribute("data");if(r)try{o=JSON.parse(r)}catch(e){console.warn(`Invalid 'data' JSON on pc-asset: ${r}`)}if("sprite"===e){o=null!=o?o:{};const e=null!==(i=this.getAttribute("atlas"))&&void 0!==i?i:o.textureAtlasAsset;if("string"==typeof e){const t=f.get(e);t?o.textureAtlasAsset=t.id:console.warn(`pc-asset sprite '${this.getAttribute("id")}' could not find atlas '${e}'`)}const r=this.getAttribute("frame-keys");null!==r&&(o.frameKeys=r.split(/[\s,]+/).filter(Boolean));const c=this.getAttribute("pixels-per-unit");null!==c&&(o.pixelsPerUnit=Number(c));const h=this.getAttribute("render-mode");null!==h&&(o.renderMode=b(h,m,t.SPRITE_RENDERMODE_SIMPLE)),o.renderMode=null!==(a=o.renderMode)&&void 0!==a?a:t.SPRITE_RENDERMODE_SIMPLE,o.pixelsPerUnit=null!==(s=o.pixelsPerUnit)&&void 0!==s?s:1,o.frameKeys=null!==(n=o.frameKeys)&&void 0!==n?n:[]}return o}destroyAsset(){this.asset&&(this.asset.unload(),this.asset=null)}set lazy(e){this._lazy=e,this.asset&&(this.asset.preload=!e)}get lazy(){return this._lazy}static get(e){const t=document.querySelector(`pc-asset[id="${e}"]`);return null==t?void 0:t.asset}static get observedAttributes(){return["lazy"]}attributeChangedCallback(e,t,i){"lazy"===e&&(this.lazy=this.hasAttribute("lazy"))}}customElements.define("pc-asset",f);class _ extends i{constructor(e){super(),this._enabled=!0,this._component=null,this._componentName=e}getInitialComponentData(){return{}}async addComponent(){const e=this.closestEntity;if(e){await e.ready();const t=this.getInitialComponentData();this._component=e.entity.addComponent(this._componentName,t)}}initComponent(){}async connectedCallback(){var e;await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),await this.addComponent(),this.initComponent(),this._onReady()}disconnectedCallback(){this.component&&this.component.entity&&(this._component.entity.removeComponent(this._componentName),this._component=null)}get component(){return this._component}set enabled(e){this._enabled=e,this.component&&(this.component.enabled=e)}get enabled(){return this._enabled}static get observedAttributes(){return["enabled"]}attributeChangedCallback(e,t,i){if("enabled"===e)this.enabled="false"!==i}}class v extends _{constructor(){super("audiolistener")}get component(){return super.component}}customElements.define("pc-listener",v);const k=new Map([["tint",t.BUTTON_TRANSITION_MODE_TINT],["sprite",t.BUTTON_TRANSITION_MODE_SPRITE_CHANGE]]);class y extends _{constructor(){super("button"),this._active=!0,this._image="",this._hitPadding=new t.Vec4(0,0,0,0),this._transitionMode=t.BUTTON_TRANSITION_MODE_TINT,this._hoverTint=new t.Color(1,1,1,1),this._pressedTint=new t.Color(1,1,1,1),this._inactiveTint=new t.Color(1,1,1,1),this._fadeDuration=0,this._hoverSpriteAsset="",this._hoverSpriteFrame=0,this._pressedSpriteAsset="",this._pressedSpriteFrame=0,this._inactiveSpriteAsset="",this._inactiveSpriteFrame=0}getInitialComponentData(){var e;const t={active:this._active,hitPadding:this._hitPadding,transitionMode:this._transitionMode,hoverTint:this._hoverTint,pressedTint:this._pressedTint,inactiveTint:this._inactiveTint,fadeDuration:this._fadeDuration,hoverSpriteFrame:this._hoverSpriteFrame,pressedSpriteFrame:this._pressedSpriteFrame,inactiveSpriteFrame:this._inactiveSpriteFrame},i=this._image?l(this._image):null===(e=this.closestEntity)||void 0===e?void 0:e.entity;i&&(t.imageEntity=i);const a=f.get(this._hoverSpriteAsset);a&&(t.hoverSpriteAsset=a.id);const s=f.get(this._pressedSpriteAsset);s&&(t.pressedSpriteAsset=s.id);const n=f.get(this._inactiveSpriteAsset);return n&&(t.inactiveSpriteAsset=n.id),t}get component(){return super.component}set active(e){this._active=e,this.component&&(this.component.active=e)}get active(){return this._active}set image(e){this._image=e;const t=l(e);this.component&&t&&(this.component.imageEntity=t)}get image(){return this._image}set hitPadding(e){this._hitPadding=e,this.component&&(this.component.hitPadding=e)}get hitPadding(){return this._hitPadding}set transitionMode(e){this._transitionMode=e,this.component&&(this.component.transitionMode=e)}get transitionMode(){return this._transitionMode}set hoverTint(e){this._hoverTint=e,this.component&&(this.component.hoverTint=e)}get hoverTint(){return this._hoverTint}set pressedTint(e){this._pressedTint=e,this.component&&(this.component.pressedTint=e)}get pressedTint(){return this._pressedTint}set inactiveTint(e){this._inactiveTint=e,this.component&&(this.component.inactiveTint=e)}get inactiveTint(){return this._inactiveTint}set fadeDuration(e){this._fadeDuration=e,this.component&&(this.component.fadeDuration=e)}get fadeDuration(){return this._fadeDuration}set hoverSpriteAsset(e){this._hoverSpriteAsset=e;const t=f.get(e);this.component&&t&&(this.component.hoverSpriteAsset=t.id)}get hoverSpriteAsset(){return this._hoverSpriteAsset}set hoverSpriteFrame(e){this._hoverSpriteFrame=e,this.component&&(this.component.hoverSpriteFrame=e)}get hoverSpriteFrame(){return this._hoverSpriteFrame}set pressedSpriteAsset(e){this._pressedSpriteAsset=e;const t=f.get(e);this.component&&t&&(this.component.pressedSpriteAsset=t.id)}get pressedSpriteAsset(){return this._pressedSpriteAsset}set pressedSpriteFrame(e){this._pressedSpriteFrame=e,this.component&&(this.component.pressedSpriteFrame=e)}get pressedSpriteFrame(){return this._pressedSpriteFrame}set inactiveSpriteAsset(e){this._inactiveSpriteAsset=e;const t=f.get(e);this.component&&t&&(this.component.inactiveSpriteAsset=t.id)}get inactiveSpriteAsset(){return this._inactiveSpriteAsset}set inactiveSpriteFrame(e){this._inactiveSpriteFrame=e,this.component&&(this.component.inactiveSpriteFrame=e)}get inactiveSpriteFrame(){return this._inactiveSpriteFrame}static get observedAttributes(){return[...super.observedAttributes,"active","image","hit-padding","transition-mode","hover-tint","pressed-tint","inactive-tint","fade-duration","hover-sprite-asset","hover-sprite-frame","pressed-sprite-asset","pressed-sprite-frame","inactive-sprite-asset","inactive-sprite-frame"]}attributeChangedCallback(e,i,a){switch(super.attributeChangedCallback(e,i,a),e){case"active":this.active="false"!==a;break;case"image":this.image=a;break;case"hit-padding":this.hitPadding=h(a);break;case"transition-mode":this.transitionMode=b(a,k,t.BUTTON_TRANSITION_MODE_TINT);break;case"hover-tint":this.hoverTint=o(a);break;case"pressed-tint":this.pressedTint=o(a);break;case"inactive-tint":this.inactiveTint=o(a);break;case"fade-duration":this.fadeDuration=Number(a);break;case"hover-sprite-asset":this.hoverSpriteAsset=a;break;case"hover-sprite-frame":this.hoverSpriteFrame=Number(a);break;case"pressed-sprite-asset":this.pressedSpriteAsset=a;break;case"pressed-sprite-frame":this.pressedSpriteFrame=Number(a);break;case"inactive-sprite-asset":this.inactiveSpriteAsset=a;break;case"inactive-sprite-frame":this.inactiveSpriteFrame=Number(a)}}}customElements.define("pc-button",y);const w=new Map([["none",t.TONEMAP_NONE],["linear",t.TONEMAP_LINEAR],["filmic",t.TONEMAP_FILMIC],["hejl",t.TONEMAP_HEJL],["aces",t.TONEMAP_ACES],["aces2",t.TONEMAP_ACES2],["neutral",t.TONEMAP_NEUTRAL]]);class S extends _{constructor(){super("camera"),this._clearColor=new t.Color(.75,.75,.75,1),this._clearColorBuffer=!0,this._clearDepthBuffer=!0,this._clearStencilBuffer=!1,this._cullFaces=!0,this._farClip=1e3,this._flipFaces=!1,this._fov=45,this._frustumCulling=!0,this._gamma="srgb",this._horizontalFov=!1,this._nearClip=.1,this._orthographic=!1,this._orthoHeight=10,this._priority=0,this._rect=new t.Vec4(0,0,1,1),this._scissorRect=new t.Vec4(0,0,1,1),this._tonemap="none"}getInitialComponentData(){return{clearColor:this._clearColor,clearColorBuffer:this._clearColorBuffer,clearDepthBuffer:this._clearDepthBuffer,clearStencilBuffer:this._clearStencilBuffer,cullFaces:this._cullFaces,farClip:this._farClip,flipFaces:this._flipFaces,fov:this._fov,frustumCulling:this._frustumCulling,gammaCorrection:"srgb"===this._gamma?t.GAMMA_SRGB:t.GAMMA_NONE,horizontalFov:this._horizontalFov,nearClip:this._nearClip,orthographic:this._orthographic,orthoHeight:this._orthoHeight,priority:this._priority,rect:this._rect,scissorRect:this._scissorRect,toneMapping:w.get(this._tonemap)}}get xrAvailable(){var e;const i=null===(e=this.component)||void 0===e?void 0:e.system.app.xr;return i&&i.supported&&i.isAvailable(t.XRTYPE_VR)}startXr(e,t){this.component&&this.xrAvailable&&this.component.startXr(e,t,{callback:e=>{e&&console.error(`WebXR Immersive VR failed to start: ${e.message}`)}})}endXr(){this.component&&this.component.endXr()}get component(){return super.component}set clearColor(e){this._clearColor=e,this.component&&(this.component.clearColor=e)}get clearColor(){return this._clearColor}set clearColorBuffer(e){this._clearColorBuffer=e,this.component&&(this.component.clearColorBuffer=e)}get clearColorBuffer(){return this._clearColorBuffer}set clearDepthBuffer(e){this._clearDepthBuffer=e,this.component&&(this.component.clearDepthBuffer=e)}get clearDepthBuffer(){return this._clearDepthBuffer}set clearStencilBuffer(e){this._clearStencilBuffer=e,this.component&&(this.component.clearStencilBuffer=e)}get clearStencilBuffer(){return this._clearStencilBuffer}set cullFaces(e){this._cullFaces=e,this.component&&(this.component.cullFaces=e)}get cullFaces(){return this._cullFaces}set farClip(e){this._farClip=e,this.component&&(this.component.farClip=e)}get farClip(){return this._farClip}set flipFaces(e){this._flipFaces=e,this.component&&(this.component.flipFaces=e)}get flipFaces(){return this._flipFaces}set fov(e){this._fov=e,this.component&&(this.component.fov=e)}get fov(){return this._fov}set frustumCulling(e){this._frustumCulling=e,this.component&&(this.component.frustumCulling=e)}get frustumCulling(){return this._frustumCulling}set gamma(e){this._gamma=e,this.component&&(this.component.gammaCorrection="srgb"===e?t.GAMMA_SRGB:t.GAMMA_NONE)}get gamma(){return this._gamma}set horizontalFov(e){this._horizontalFov=e,this.component&&(this.component.horizontalFov=e)}get horizontalFov(){return this._horizontalFov}set nearClip(e){this._nearClip=e,this.component&&(this.component.nearClip=e)}get nearClip(){return this._nearClip}set orthographic(e){this._orthographic=e,this.component&&(this.component.projection=e?t.PROJECTION_ORTHOGRAPHIC:t.PROJECTION_PERSPECTIVE)}get orthographic(){return this._orthographic}set orthoHeight(e){this._orthoHeight=e,this.component&&(this.component.orthoHeight=e)}get orthoHeight(){return this._orthoHeight}set priority(e){this._priority=e,this.component&&(this.component.priority=e)}get priority(){return this._priority}set rect(e){this._rect=e,this.component&&(this.component.rect=e)}get rect(){return this._rect}set scissorRect(e){this._scissorRect=e,this.component&&(this.component.scissorRect=e)}get scissorRect(){return this._scissorRect}set tonemap(e){var i;this._tonemap=e,this.component&&(this.component.toneMapping=null!==(i=w.get(e))&&void 0!==i?i:t.TONEMAP_NONE)}get tonemap(){return this._tonemap}static get observedAttributes(){return[...super.observedAttributes,"clear-color","clear-color-buffer","clear-depth-buffer","clear-stencil-buffer","cull-faces","far-clip","flip-faces","fov","frustum-culling","gamma","horizontal-fov","near-clip","orthographic","ortho-height","priority","rect","scissor-rect","tonemap"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"clear-color":this.clearColor=o(i);break;case"clear-color-buffer":this.clearColorBuffer="false"!==i;break;case"clear-depth-buffer":this.clearDepthBuffer="false"!==i;break;case"clear-stencil-buffer":this.clearStencilBuffer="false"!==i;break;case"cull-faces":this.cullFaces="false"!==i;break;case"far-clip":this.farClip=parseFloat(i);break;case"flip-faces":this.flipFaces="true"!==i;break;case"fov":this.fov=parseFloat(i);break;case"frustum-culling":this.frustumCulling="false"!==i;break;case"gamma":this.gamma=i;break;case"horizontal-fov":this.horizontalFov=this.hasAttribute("horizontal-fov");break;case"near-clip":this.nearClip=parseFloat(i);break;case"orthographic":this.orthographic=this.hasAttribute("orthographic");break;case"ortho-height":this.orthoHeight=parseFloat(i);break;case"priority":this.priority=parseFloat(i);break;case"rect":this.rect=h(i);break;case"scissor-rect":this.scissorRect=h(i);break;case"tonemap":this.tonemap=i}}}customElements.define("pc-camera",S);class A extends _{constructor(){super("collision"),this._angularOffset=new t.Quat,this._axis=1,this._convexHull=!1,this._halfExtents=new t.Vec3(.5,.5,.5),this._height=2,this._linearOffset=new t.Vec3,this._radius=.5,this._type="box"}getInitialComponentData(){return{axis:this._axis,angularOffset:this._angularOffset,convexHull:this._convexHull,halfExtents:this._halfExtents,height:this._height,linearOffset:this._linearOffset,radius:this._radius,type:this._type}}get component(){return super.component}set angularOffset(e){this._angularOffset=e,this.component&&(this.component.angularOffset=e)}get angularOffset(){return this._angularOffset}set axis(e){this._axis=e,this.component&&(this.component.axis=e)}get axis(){return this._axis}set convexHull(e){this._convexHull=e,this.component&&(this.component.convexHull=e)}get convexHull(){return this._convexHull}set halfExtents(e){this._halfExtents=e,this.component&&(this.component.halfExtents=e)}get halfExtents(){return this._halfExtents}set height(e){this._height=e,this.component&&(this.component.height=e)}get height(){return this._height}set linearOffset(e){this._linearOffset=e,this.component&&(this.component.linearOffset=e)}get linearOffset(){return this._linearOffset}set radius(e){this._radius=e,this.component&&(this.component.radius=e)}get radius(){return this._radius}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}static get observedAttributes(){return[...super.observedAttributes,"angular-offset","axis","convex-hull","half-extents","height","linear-offset","radius","type"]}attributeChangedCallback(e,i,a){switch(super.attributeChangedCallback(e,i,a),e){case"angular-offset":this.angularOffset=(e=>{const[i,a,s]=e.split(" ").map(Number),n=new t.Quat;return n.setFromEulerAngles(i,a,s),n})(a);break;case"axis":this.axis=parseInt(a,10);break;case"convex-hull":this.convexHull=this.hasAttribute("convex-hull");break;case"half-extents":this.halfExtents=c(a);break;case"height":this.height=parseFloat(a);break;case"linear-offset":this.linearOffset=c(a);break;case"radius":this.radius=parseFloat(a);break;case"type":this.type=a}}}customElements.define("pc-collision",A);class x extends _{constructor(){super("element"),this._anchor=new t.Vec4(.5,.5,.5,.5),this._asset="",this._autoWidth=!0,this._autoHeight=!0,this._autoFitWidth=!1,this._autoFitHeight=!1,this._color=new t.Color(1,1,1,1),this._enableMarkup=!1,this._fontSize=32,this._maxFontSize=32,this._minFontSize=8,this._height=0,this._lineHeight=32,this._margin=null,this._mask=!1,this._opacity=1,this._pivot=new t.Vec2(.5,.5),this._pixelsPerUnit=null,this._spriteAsset="",this._spriteFrame=0,this._text="",this._textureAsset="",this._type="group",this._useInput=!1,this._width=0,this._wrapLines=!1}initComponent(){var e,t;const i=this.component;i&&((null===(e=i._text)||void 0===e?void 0:e._material)&&(i._text._material.useFog=!0),null===(t=i._dirtifyMask)||void 0===t||t.call(i))}getInitialComponentData(){const e={anchor:this._anchor,autoWidth:this._autoWidth,autoHeight:this._autoHeight,autoFitWidth:this._autoFitWidth,autoFitHeight:this._autoFitHeight,color:this._color,enableMarkup:this._enableMarkup,fontSize:this._fontSize,maxFontSize:this._maxFontSize,minFontSize:this._minFontSize,height:this._height,lineHeight:this._lineHeight,mask:this._mask,opacity:this._opacity,pivot:this._pivot,spriteFrame:this._spriteFrame,type:this._type,text:this._text,useInput:this._useInput,width:this._width,wrapLines:this._wrapLines},t=f.get(this._asset);t&&(e.fontAsset=t.id);const i=f.get(this._spriteAsset);i&&(e.spriteAsset=i.id);const a=f.get(this._textureAsset);return a&&(e.textureAsset=a.id),this._margin&&(e.margin=this._margin),null!==this._pixelsPerUnit&&(e.pixelsPerUnit=this._pixelsPerUnit),e}get component(){return super.component}set anchor(e){this._anchor=e,this.component&&(this.component.anchor=e)}get anchor(){return this._anchor}set asset(e){this._asset=e;const t=f.get(e);this.component&&t&&(this.component.fontAsset=t.id)}get asset(){return this._asset}set autoWidth(e){this._autoWidth=e,this.component&&(this.component.autoWidth=e)}get autoWidth(){return this._autoWidth}set autoHeight(e){this._autoHeight=e,this.component&&(this.component.autoHeight=e)}get autoHeight(){return this._autoHeight}set color(e){this._color=e,this.component&&(this.component.color=e)}get color(){return this._color}set enableMarkup(e){this._enableMarkup=e,this.component&&(this.component.enableMarkup=e)}get enableMarkup(){return this._enableMarkup}set fontSize(e){this._fontSize=e,this.component&&(this.component.fontSize=e)}get fontSize(){return this._fontSize}set height(e){this._height=e,this.component&&(this.component.height=e)}get height(){return this._height}set lineHeight(e){this._lineHeight=e,this.component&&(this.component.lineHeight=e)}get lineHeight(){return this._lineHeight}set margin(e){this._margin=e,this.component&&e&&(this.component.margin=e)}get margin(){return this._margin}set mask(e){this._mask=e,this.component&&(this.component.mask=e)}get mask(){return this._mask}set opacity(e){this._opacity=e,this.component&&(this.component.opacity=e)}get opacity(){return this._opacity}set pivot(e){this._pivot=e,this.component&&(this.component.pivot=e)}get pivot(){return this._pivot}set pixelsPerUnit(e){this._pixelsPerUnit=e,this.component&&null!==e&&(this.component.pixelsPerUnit=e)}get pixelsPerUnit(){return this._pixelsPerUnit}set spriteAsset(e){this._spriteAsset=e;const t=f.get(e);this.component&&t&&(this.component.spriteAsset=t.id)}get spriteAsset(){return this._spriteAsset}set spriteFrame(e){this._spriteFrame=e,this.component&&(this.component.spriteFrame=e)}get spriteFrame(){return this._spriteFrame}set text(e){this._text=e,this.component&&(this.component.text=e)}get text(){return this._text}set textureAsset(e){this._textureAsset=e;const t=f.get(e);this.component&&t&&(this.component.textureAsset=t.id)}get textureAsset(){return this._textureAsset}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}set useInput(e){this._useInput=e,this.component&&(this.component.useInput=e)}get useInput(){return this._useInput}set width(e){this._width=e,this.component&&(this.component.width=e)}get width(){return this._width}set wrapLines(e){this._wrapLines=e,this.component&&(this.component.wrapLines=e)}get wrapLines(){return this._wrapLines}set autoFitWidth(e){this._autoFitWidth=e,this.component&&(this.component.autoFitWidth=e)}get autoFitWidth(){return this._autoFitWidth}set autoFitHeight(e){this._autoFitHeight=e,this.component&&(this.component.autoFitHeight=e)}get autoFitHeight(){return this._autoFitHeight}set minFontSize(e){this._minFontSize=e,this.component&&(this.component.minFontSize=e)}get minFontSize(){return this._minFontSize}set maxFontSize(e){this._maxFontSize=e,this.component&&(this.component.maxFontSize=e)}get maxFontSize(){return this._maxFontSize}static get observedAttributes(){return[...super.observedAttributes,"anchor","asset","auto-width","auto-height","auto-fit-width","auto-fit-height","color","enable-markup","font-size","max-font-size","min-font-size","height","line-height","margin","mask","opacity","pivot","pixels-per-unit","sprite-asset","sprite-frame","text","texture-asset","type","use-input","width","wrap-lines"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"anchor":this.anchor=h(i);break;case"asset":this.asset=i;break;case"auto-width":this.autoWidth="false"!==i;break;case"auto-height":this.autoHeight="false"!==i;break;case"auto-fit-width":this.autoFitWidth="false"!==i;break;case"auto-fit-height":this.autoFitHeight="false"!==i;break;case"color":this.color=o(i);break;case"enable-markup":this.enableMarkup=this.hasAttribute(e);break;case"font-size":this.fontSize=Number(i);break;case"max-font-size":this.maxFontSize=Number(i);break;case"min-font-size":this.minFontSize=Number(i);break;case"height":this.height=Number(i);break;case"line-height":this.lineHeight=Number(i);break;case"margin":this.margin=h(i);break;case"mask":this.mask=this.hasAttribute(e);break;case"opacity":this.opacity=Number(i);break;case"pivot":this.pivot=r(i);break;case"pixels-per-unit":this.pixelsPerUnit=Number(i);break;case"sprite-asset":this.spriteAsset=i;break;case"sprite-frame":this.spriteFrame=Number(i);break;case"text":this.text=i;break;case"texture-asset":this.textureAsset=i;break;case"type":this.type=i;break;case"use-input":this.useInput=this.hasAttribute(e);break;case"width":this.width=Number(i);break;case"wrap-lines":this.wrapLines=this.hasAttribute(e)}}}customElements.define("pc-element",x);class F extends _{constructor(){super("layoutchild"),this._minWidth=0,this._minHeight=0,this._maxWidth=null,this._maxHeight=null,this._fitWidthProportion=0,this._fitHeightProportion=0,this._excludeFromLayout=!1}getInitialComponentData(){return{minWidth:this._minWidth,minHeight:this._minHeight,maxWidth:this._maxWidth,maxHeight:this._maxHeight,fitWidthProportion:this._fitWidthProportion,fitHeightProportion:this._fitHeightProportion,excludeFromLayout:this._excludeFromLayout}}get component(){return super.component}set minWidth(e){this._minWidth=e,this.component&&(this.component.minWidth=e)}get minWidth(){return this._minWidth}set minHeight(e){this._minHeight=e,this.component&&(this.component.minHeight=e)}get minHeight(){return this._minHeight}set maxWidth(e){this._maxWidth=e,this.component&&(this.component.maxWidth=e)}get maxWidth(){return this._maxWidth}set maxHeight(e){this._maxHeight=e,this.component&&(this.component.maxHeight=e)}get maxHeight(){return this._maxHeight}set fitWidthProportion(e){this._fitWidthProportion=e,this.component&&(this.component.fitWidthProportion=e)}get fitWidthProportion(){return this._fitWidthProportion}set fitHeightProportion(e){this._fitHeightProportion=e,this.component&&(this.component.fitHeightProportion=e)}get fitHeightProportion(){return this._fitHeightProportion}set excludeFromLayout(e){this._excludeFromLayout=e,this.component&&(this.component.excludeFromLayout=e)}get excludeFromLayout(){return this._excludeFromLayout}static get observedAttributes(){return[...super.observedAttributes,"min-width","min-height","max-width","max-height","fit-width-proportion","fit-height-proportion","exclude-from-layout"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"min-width":this.minWidth=Number(i);break;case"min-height":this.minHeight=Number(i);break;case"max-width":this.maxWidth=""===i?null:Number(i);break;case"max-height":this.maxHeight=""===i?null:Number(i);break;case"fit-width-proportion":this.fitWidthProportion=Number(i);break;case"fit-height-proportion":this.fitHeightProportion=Number(i);break;case"exclude-from-layout":this.excludeFromLayout="false"!==i}}}customElements.define("pc-layoutchild",F);const C=new Map([["horizontal",t.ORIENTATION_HORIZONTAL],["vertical",t.ORIENTATION_VERTICAL]]),E=new Map([["none",t.FITTING_NONE],["stretch",t.FITTING_STRETCH],["shrink",t.FITTING_SHRINK],["both",t.FITTING_BOTH]]);class j extends _{constructor(){super("layoutgroup"),this._orientation=t.ORIENTATION_HORIZONTAL,this._reverseX=!1,this._reverseY=!1,this._alignment=new t.Vec2(0,1),this._padding=new t.Vec4(0,0,0,0),this._spacing=new t.Vec2(0,0),this._widthFitting=t.FITTING_NONE,this._heightFitting=t.FITTING_NONE,this._wrap=!1}getInitialComponentData(){return{orientation:this._orientation,reverseX:this._reverseX,reverseY:this._reverseY,alignment:this._alignment,padding:this._padding,spacing:this._spacing,widthFitting:this._widthFitting,heightFitting:this._heightFitting,wrap:this._wrap}}get component(){return super.component}set orientation(e){this._orientation=e,this.component&&(this.component.orientation=e)}get orientation(){return this._orientation}set reverseX(e){this._reverseX=e,this.component&&(this.component.reverseX=e)}get reverseX(){return this._reverseX}set reverseY(e){this._reverseY=e,this.component&&(this.component.reverseY=e)}get reverseY(){return this._reverseY}set alignment(e){this._alignment=e,this.component&&(this.component.alignment=e)}get alignment(){return this._alignment}set padding(e){this._padding=e,this.component&&(this.component.padding=e)}get padding(){return this._padding}set spacing(e){this._spacing=e,this.component&&(this.component.spacing=e)}get spacing(){return this._spacing}set widthFitting(e){this._widthFitting=e,this.component&&(this.component.widthFitting=e)}get widthFitting(){return this._widthFitting}set heightFitting(e){this._heightFitting=e,this.component&&(this.component.heightFitting=e)}get heightFitting(){return this._heightFitting}set wrap(e){this._wrap=e,this.component&&(this.component.wrap=e)}get wrap(){return this._wrap}static get observedAttributes(){return[...super.observedAttributes,"orientation","reverse-x","reverse-y","alignment","padding","spacing","width-fitting","height-fitting","wrap"]}attributeChangedCallback(e,i,a){switch(super.attributeChangedCallback(e,i,a),e){case"orientation":this.orientation=b(a,C,t.ORIENTATION_HORIZONTAL);break;case"reverse-x":this.reverseX="false"!==a;break;case"reverse-y":this.reverseY="false"!==a;break;case"alignment":this.alignment=r(a);break;case"padding":this.padding=h(a);break;case"spacing":this.spacing=r(a);break;case"width-fitting":this.widthFitting=b(a,E,t.FITTING_NONE);break;case"height-fitting":this.heightFitting=b(a,E,t.FITTING_NONE);break;case"wrap":this.wrap="false"!==a}}}customElements.define("pc-layoutgroup",j);const O=new Map([["pcf1-16f",t.SHADOW_PCF1_16F],["pcf1-32f",t.SHADOW_PCF1_32F],["pcf3-16f",t.SHADOW_PCF3_16F],["pcf3-32f",t.SHADOW_PCF3_32F],["pcf5-16f",t.SHADOW_PCF5_16F],["pcf5-32f",t.SHADOW_PCF5_32F],["vsm-16f",t.SHADOW_VSM_16F],["vsm-32f",t.SHADOW_VSM_32F],["pcss-32f",t.SHADOW_PCSS_32F]]);class R extends _{constructor(){super("light"),this._castShadows=!1,this._color=new t.Color(1,1,1),this._innerConeAngle=40,this._intensity=1,this._normalOffsetBias=.05,this._outerConeAngle=45,this._range=10,this._shadowBias=.2,this._shadowDistance=16,this._shadowIntensity=1,this._shadowResolution=1024,this._shadowType="pcf3-32f",this._type="directional",this._vsmBias=.01,this._vsmBlurSize=11,this._penumbraSize=1,this._penumbraFalloff=1,this._shadowSamples=16,this._shadowBlockerSamples=16}getInitialComponentData(){return{castShadows:this._castShadows,color:this._color,innerConeAngle:this._innerConeAngle,intensity:this._intensity,normalOffsetBias:this._normalOffsetBias,outerConeAngle:this._outerConeAngle,penumbraFalloff:this._penumbraFalloff,penumbraSize:this._penumbraSize,range:this._range,shadowBias:this._shadowBias,shadowBlockerSamples:this._shadowBlockerSamples,shadowDistance:this._shadowDistance,shadowIntensity:this._shadowIntensity,shadowResolution:this._shadowResolution,shadowSamples:this._shadowSamples,shadowType:O.get(this._shadowType),type:this._type,vsmBias:this._vsmBias,vsmBlurSize:this._vsmBlurSize}}get component(){return super.component}set castShadows(e){this._castShadows=e,this.component&&(this.component.castShadows=e)}get castShadows(){return this._castShadows}set color(e){this._color=e,this.component&&(this.component.color=e)}get color(){return this._color}set innerConeAngle(e){this._innerConeAngle=e,this.component&&(this.component.innerConeAngle=e)}get innerConeAngle(){return this._innerConeAngle}set intensity(e){this._intensity=e,this.component&&(this.component.intensity=e)}get intensity(){return this._intensity}set normalOffsetBias(e){this._normalOffsetBias=e,this.component&&(this.component.normalOffsetBias=e)}get normalOffsetBias(){return this._normalOffsetBias}set outerConeAngle(e){this._outerConeAngle=e,this.component&&(this.component.outerConeAngle=e)}get outerConeAngle(){return this._outerConeAngle}set range(e){this._range=e,this.component&&(this.component.range=e)}get range(){return this._range}set shadowBias(e){this._shadowBias=e,this.component&&(this.component.shadowBias=e)}get shadowBias(){return this._shadowBias}set shadowDistance(e){this._shadowDistance=e,this.component&&(this.component.shadowDistance=e)}get shadowDistance(){return this._shadowDistance}set shadowIntensity(e){this._shadowIntensity=e,this.component&&(this.component.shadowIntensity=e)}get shadowIntensity(){return this._shadowIntensity}set shadowResolution(e){this._shadowResolution=e,this.component&&(this.component.shadowResolution=e)}get shadowResolution(){return this._shadowResolution}set shadowType(e){var i;this._shadowType=e,this.component&&(this.component.shadowType=null!==(i=O.get(e))&&void 0!==i?i:t.SHADOW_PCF3_32F)}get shadowType(){return this._shadowType}set type(e){["directional","omni","spot"].includes(e)?(this._type=e,this.component&&(this.component.type=e)):console.warn(`Invalid light type '${e}', using default type '${this._type}'.`)}get type(){return this._type}set vsmBias(e){this._vsmBias=e,this.component&&(this.component.vsmBias=e)}get vsmBias(){return this._vsmBias}set vsmBlurSize(e){this._vsmBlurSize=e,this.component&&(this.component.vsmBlurSize=e)}get vsmBlurSize(){return this._vsmBlurSize}set penumbraSize(e){this._penumbraSize=e,this.component&&(this.component.penumbraSize=e)}get penumbraSize(){return this._penumbraSize}set penumbraFalloff(e){this._penumbraFalloff=e,this.component&&(this.component.penumbraFalloff=e)}get penumbraFalloff(){return this._penumbraFalloff}set shadowSamples(e){this._shadowSamples=e,this.component&&(this.component.shadowSamples=e)}get shadowSamples(){return this._shadowSamples}set shadowBlockerSamples(e){this._shadowBlockerSamples=e,this.component&&(this.component.shadowBlockerSamples=e)}get shadowBlockerSamples(){return this._shadowBlockerSamples}static get observedAttributes(){return[...super.observedAttributes,"color","cast-shadows","intensity","inner-cone-angle","normal-offset-bias","outer-cone-angle","penumbra-falloff","penumbra-size","range","shadow-bias","shadow-blocker-samples","shadow-distance","shadow-intensity","shadow-resolution","shadow-samples","shadow-type","type","vsm-bias","vsm-blur-size"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"color":this.color=o(i);break;case"cast-shadows":this.castShadows=this.hasAttribute("cast-shadows");break;case"inner-cone-angle":this.innerConeAngle=Number(i);break;case"intensity":this.intensity=Number(i);break;case"normal-offset-bias":this.normalOffsetBias=Number(i);break;case"outer-cone-angle":this.outerConeAngle=Number(i);break;case"penumbra-falloff":this.penumbraFalloff=Number(i);break;case"penumbra-size":this.penumbraSize=Number(i);break;case"range":this.range=Number(i);break;case"shadow-bias":this.shadowBias=Number(i);break;case"shadow-distance":this.shadowDistance=Number(i);break;case"shadow-blocker-samples":this.shadowBlockerSamples=Number(i);break;case"shadow-resolution":this.shadowResolution=Number(i);break;case"shadow-intensity":this.shadowIntensity=Number(i);break;case"shadow-samples":this.shadowSamples=Number(i);break;case"shadow-type":this.shadowType=i;break;case"type":this.type=i;break;case"vsm-bias":this.vsmBias=Number(i);break;case"vsm-blur-size":this.vsmBlurSize=Number(i)}}}customElements.define("pc-light",R);class z extends _{constructor(){super("particlesystem"),this._asset=""}getInitialComponentData(){var e;const t=f.get(this._asset);if(!t)return{};if(t.resource.colorMapAsset){const i=t.resource.colorMapAsset,a=null===(e=f.get(i))||void 0===e?void 0:e.id;a&&(t.resource.colorMapAsset=a)}return t.resource}get component(){return super.component}applyConfig(e){if(this.component)for(const t in e)e.hasOwnProperty(t)&&(this.component[t]=e[t])}async _loadAsset(){var e;const t=await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),i=null==t?void 0:t.app,a=f.get(this._asset);a&&(a.loaded?this.applyConfig(a.resource):(a.once("load",()=>{this.applyConfig(a.resource)}),i.assets.load(a)))}set asset(e){this._asset=e,this.isConnected&&this._loadAsset()}get asset(){return this._asset}play(){this.component&&this.component.play()}pause(){this.component&&this.component.pause()}reset(){this.component&&this.component.reset()}stop(){this.component&&this.component.stop()}static get observedAttributes(){return[...super.observedAttributes,"asset"]}attributeChangedCallback(e,t,i){if(super.attributeChangedCallback(e,t,i),"asset"===e)this.asset=i}}customElements.define("pc-particles",z);class H extends HTMLElement{constructor(){super(...arguments),this._diffuse=new t.Color(1,1,1),this._diffuseMap="",this._metalnessMap="",this._normalMap="",this._roughnessMap="",this.material=null}createMaterial(){this.material=new t.StandardMaterial,this.material.glossInvert=!1,this.material.useMetalness=!1,this.material.diffuse=this._diffuse,this.diffuseMap=this._diffuseMap,this.metalnessMap=this._metalnessMap,this.normalMap=this._normalMap,this.roughnessMap=this._roughnessMap,this.material.update()}disconnectedCallback(){this.material&&(this.material.destroy(),this.material=null)}setMap(e,t){if(this.material){const i=f.get(e);i&&(i.loaded?(this.material[t]=i.resource,this.material[t].anisotropy=4):i.once("load",()=>{this.material[t]=i.resource,this.material[t].anisotropy=4,this.material.update()}))}}set diffuse(e){this._diffuse=e,this.material&&(this.material.diffuse=e)}get diffuse(){return this._diffuse}set diffuseMap(e){this._diffuseMap=e,this.setMap(e,"diffuseMap")}get diffuseMap(){return this._diffuseMap}set metalnessMap(e){this._metalnessMap=e,this.setMap(e,"metalnessMap")}get metalnessMap(){return this._metalnessMap}set normalMap(e){this._normalMap=e,this.setMap(e,"normalMap")}get normalMap(){return this._normalMap}set roughnessMap(e){this._roughnessMap=e,this.setMap(e,"glossMap")}get roughnessMap(){return this._roughnessMap}static get(e){const t=document.querySelector(`pc-material[id="${e}"]`);return null==t?void 0:t.material}static get observedAttributes(){return["diffuse","diffuse-map","metalness-map","normal-map","roughness-map"]}attributeChangedCallback(e,t,i){switch(e){case"diffuse":this.diffuse=o(i);break;case"diffuse-map":this.diffuseMap=i;break;case"metalness-map":this.metalnessMap=i;break;case"normal-map":this.normalMap=i;break;case"roughness-map":this.roughnessMap=i}}}customElements.define("pc-material",H);class P extends _{constructor(){super("render"),this._castShadows=!0,this._material="",this._receiveShadows=!0,this._type="asset"}getInitialComponentData(){return{type:this._type,castShadows:this._castShadows,material:H.get(this._material),receiveShadows:this._receiveShadows}}get component(){return super.component}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}set castShadows(e){this._castShadows=e,this.component&&(this.component.castShadows=e)}get castShadows(){return this._castShadows}set material(e){this._material=e,this.component&&(this.component.material=H.get(e))}get material(){return this._material}set receiveShadows(e){this._receiveShadows=e,this.component&&(this.component.receiveShadows=e)}get receiveShadows(){return this._receiveShadows}static get observedAttributes(){return[...super.observedAttributes,"cast-shadows","material","receive-shadows","type"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"cast-shadows":this.castShadows="false"!==i;break;case"material":this.material=i;break;case"receive-shadows":this.receiveShadows="false"!==i;break;case"type":this.type=i}}}customElements.define("pc-render",P);class D extends _{constructor(){super("rigidbody"),this._angularDamping=0,this._angularFactor=new t.Vec3(1,1,1),this._friction=.5,this._linearDamping=0,this._linearFactor=new t.Vec3(1,1,1),this._mass=1,this._restitution=0,this._rollingFriction=0,this._type="static"}getInitialComponentData(){return{angularDamping:this._angularDamping,angularFactor:this._angularFactor,friction:this._friction,linearDamping:this._linearDamping,linearFactor:this._linearFactor,mass:this._mass,restitution:this._restitution,rollingFriction:this._rollingFriction,type:this._type}}get component(){return super.component}set angularDamping(e){this._angularDamping=e,this.component&&(this.component.angularDamping=e)}get angularDamping(){return this._angularDamping}set angularFactor(e){this._angularFactor=e,this.component&&(this.component.angularFactor=e)}get angularFactor(){return this._angularFactor}set friction(e){this._friction=e,this.component&&(this.component.friction=e)}get friction(){return this._friction}set linearDamping(e){this._linearDamping=e,this.component&&(this.component.linearDamping=e)}get linearDamping(){return this._linearDamping}set linearFactor(e){this._linearFactor=e,this.component&&(this.component.linearFactor=e)}get linearFactor(){return this._linearFactor}set mass(e){this._mass=e,this.component&&(this.component.mass=e)}get mass(){return this._mass}set restitution(e){this._restitution=e,this.component&&(this.component.restitution=e)}get restitution(){return this._restitution}set rollingFriction(e){this._rollingFriction=e,this.component&&(this.component.rollingFriction=e)}get rollingFriction(){return this._rollingFriction}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}static get observedAttributes(){return[...super.observedAttributes,"angular-damping","angular-factor","friction","linear-damping","linear-factor","mass","restitution","rolling-friction","type"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"angular-damping":this.angularDamping=parseFloat(i);break;case"angular-factor":this.angularFactor=c(i);break;case"friction":this.friction=parseFloat(i);break;case"linear-damping":this.linearDamping=parseFloat(i);break;case"linear-factor":this.linearFactor=c(i);break;case"mass":this.mass=parseFloat(i);break;case"restitution":this.restitution=parseFloat(i);break;case"rolling-friction":this.rollingFriction=parseFloat(i);break;case"type":this.type=i}}}customElements.define("pc-rigidbody",D);class M extends _{constructor(){super("screen"),this._screenSpace=!1,this._resolution=new t.Vec2(640,320),this._referenceResolution=new t.Vec2(640,320),this._priority=0,this._blend=!1,this._scaleBlend=.5}getInitialComponentData(){return{priority:this._priority,referenceResolution:this._referenceResolution,resolution:this._resolution,scaleBlend:this._scaleBlend,scaleMode:this._blend?t.SCALEMODE_BLEND:t.SCALEMODE_NONE,screenSpace:this._screenSpace}}get component(){return super.component}set priority(e){this._priority=e,this.component&&(this.component.priority=this._priority)}get priority(){return this._priority}set referenceResolution(e){this._referenceResolution=e,this.component&&(this.component.referenceResolution=this._referenceResolution)}get referenceResolution(){return this._referenceResolution}set resolution(e){this._resolution=e,this.component&&(this.component.resolution=this._resolution)}get resolution(){return this._resolution}set scaleBlend(e){this._scaleBlend=e,this.component&&(this.component.scaleBlend=this._scaleBlend)}get scaleBlend(){return this._scaleBlend}set blend(e){this._blend=e,this.component&&(this.component.scaleMode=this._blend?t.SCALEMODE_BLEND:t.SCALEMODE_NONE)}get blend(){return this._blend}set screenSpace(e){this._screenSpace=e,this.component&&(this.component.screenSpace=this._screenSpace)}get screenSpace(){return this._screenSpace}static get observedAttributes(){return[...super.observedAttributes,"blend","screen-space","resolution","reference-resolution","priority","scale-blend"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"priority":this.priority=parseInt(i,10);break;case"reference-resolution":this.referenceResolution=r(i);break;case"resolution":this.resolution=r(i);break;case"scale-blend":this.scaleBlend=parseFloat(i);break;case"blend":this.blend=this.hasAttribute("blend");break;case"screen-space":this.screenSpace=this.hasAttribute("screen-space")}}}customElements.define("pc-screen",M);const T=new Map([["horizontal",t.ORIENTATION_HORIZONTAL],["vertical",t.ORIENTATION_VERTICAL]]);class B extends _{constructor(){super("scrollbar"),this._orientation=t.ORIENTATION_HORIZONTAL,this._value=0,this._handleSize=.5,this._handle=""}getInitialComponentData(){const e={orientation:this._orientation,value:this._value,handleSize:this._handleSize},t=l(this._handle);return t&&(e.handleEntity=t),e}get component(){return super.component}set orientation(e){this._orientation=e,this.component&&(this.component.orientation=e)}get orientation(){return this._orientation}set value(e){this._value=e,this.component&&(this.component.value=e)}get value(){return this._value}set handleSize(e){this._handleSize=e,this.component&&(this.component.handleSize=e)}get handleSize(){return this._handleSize}set handle(e){this._handle=e;const t=l(e);this.component&&t&&(this.component.handleEntity=t)}get handle(){return this._handle}static get observedAttributes(){return[...super.observedAttributes,"orientation","value","handle-size","handle"]}attributeChangedCallback(e,i,a){switch(super.attributeChangedCallback(e,i,a),e){case"orientation":this.orientation=b(a,T,t.ORIENTATION_HORIZONTAL);break;case"value":this.value=Number(a);break;case"handle-size":this.handleSize=Number(a);break;case"handle":this.handle=a}}}customElements.define("pc-scrollbar",B);const G=new Map([["clamp",t.SCROLL_MODE_CLAMP],["bounce",t.SCROLL_MODE_BOUNCE],["infinite",t.SCROLL_MODE_INFINITE]]),N=new Map([["always",t.SCROLLBAR_VISIBILITY_SHOW_ALWAYS],["when-required",t.SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIRED]]);class L extends _{constructor(){super("scrollview"),this._horizontal=!0,this._vertical=!0,this._scrollMode=t.SCROLL_MODE_BOUNCE,this._bounceAmount=.1,this._friction=.05,this._useMouseWheel=!0,this._mouseWheelSensitivity=new t.Vec2(1,1),this._horizontalScrollbarVisibility=t.SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIRED,this._verticalScrollbarVisibility=t.SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIRED,this._viewport="",this._content="",this._horizontalScrollbar="",this._verticalScrollbar=""}getInitialComponentData(){const e={horizontal:this._horizontal,vertical:this._vertical,scrollMode:this._scrollMode,bounceAmount:this._bounceAmount,friction:this._friction,useMouseWheel:this._useMouseWheel,mouseWheelSensitivity:this._mouseWheelSensitivity,horizontalScrollbarVisibility:this._horizontalScrollbarVisibility,verticalScrollbarVisibility:this._verticalScrollbarVisibility},t=l(this._viewport);t&&(e.viewportEntity=t);const i=l(this._content);i&&(e.contentEntity=i);const a=l(this._horizontalScrollbar);a&&(e.horizontalScrollbarEntity=a);const s=l(this._verticalScrollbar);return s&&(e.verticalScrollbarEntity=s),e}get component(){return super.component}set horizontal(e){this._horizontal=e,this.component&&(this.component.horizontal=e)}get horizontal(){return this._horizontal}set vertical(e){this._vertical=e,this.component&&(this.component.vertical=e)}get vertical(){return this._vertical}set scrollMode(e){this._scrollMode=e,this.component&&(this.component.scrollMode=e)}get scrollMode(){return this._scrollMode}set bounceAmount(e){this._bounceAmount=e,this.component&&(this.component.bounceAmount=e)}get bounceAmount(){return this._bounceAmount}set friction(e){this._friction=e,this.component&&(this.component.friction=e)}get friction(){return this._friction}set useMouseWheel(e){this._useMouseWheel=e,this.component&&(this.component.useMouseWheel=e)}get useMouseWheel(){return this._useMouseWheel}set mouseWheelSensitivity(e){this._mouseWheelSensitivity=e,this.component&&(this.component.mouseWheelSensitivity=e)}get mouseWheelSensitivity(){return this._mouseWheelSensitivity}set horizontalScrollbarVisibility(e){this._horizontalScrollbarVisibility=e,this.component&&(this.component.horizontalScrollbarVisibility=e)}get horizontalScrollbarVisibility(){return this._horizontalScrollbarVisibility}set verticalScrollbarVisibility(e){this._verticalScrollbarVisibility=e,this.component&&(this.component.verticalScrollbarVisibility=e)}get verticalScrollbarVisibility(){return this._verticalScrollbarVisibility}set viewport(e){this._viewport=e;const t=l(e);this.component&&t&&(this.component.viewportEntity=t)}get viewport(){return this._viewport}set content(e){this._content=e;const t=l(e);this.component&&t&&(this.component.contentEntity=t)}get content(){return this._content}set horizontalScrollbar(e){this._horizontalScrollbar=e;const t=l(e);this.component&&t&&(this.component.horizontalScrollbarEntity=t)}get horizontalScrollbar(){return this._horizontalScrollbar}set verticalScrollbar(e){this._verticalScrollbar=e;const t=l(e);this.component&&t&&(this.component.verticalScrollbarEntity=t)}get verticalScrollbar(){return this._verticalScrollbar}static get observedAttributes(){return[...super.observedAttributes,"horizontal","vertical","scroll-mode","bounce-amount","friction","use-mouse-wheel","mouse-wheel-sensitivity","horizontal-scrollbar-visibility","vertical-scrollbar-visibility","viewport","content","horizontal-scrollbar","vertical-scrollbar"]}attributeChangedCallback(e,i,a){switch(super.attributeChangedCallback(e,i,a),e){case"horizontal":this.horizontal="false"!==a;break;case"vertical":this.vertical="false"!==a;break;case"scroll-mode":this.scrollMode=b(a,G,t.SCROLL_MODE_BOUNCE);break;case"bounce-amount":this.bounceAmount=Number(a);break;case"friction":this.friction=Number(a);break;case"use-mouse-wheel":this.useMouseWheel="false"!==a;break;case"mouse-wheel-sensitivity":this.mouseWheelSensitivity=r(a);break;case"horizontal-scrollbar-visibility":this.horizontalScrollbarVisibility=b(a,N,t.SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIRED);break;case"vertical-scrollbar-visibility":this.verticalScrollbarVisibility=b(a,N,t.SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIRED);break;case"viewport":this.viewport=a;break;case"content":this.content=a;break;case"horizontal-scrollbar":this.horizontalScrollbar=a;break;case"vertical-scrollbar":this.verticalScrollbar=a}}}customElements.define("pc-scrollview",L);class W extends _{constructor(){super("script"),this.observer=new MutationObserver(this.handleMutations.bind(this)),this.observer.observe(this,{childList:!0}),this.addEventListener("scriptattributeschange",this.handleScriptAttributesChange.bind(this)),this.addEventListener("scriptenablechange",this.handleScriptEnableChange.bind(this))}initComponent(){this.querySelectorAll(":scope > pc-script").forEach(e=>{const t=e.getAttribute("name"),i=e.getAttribute("attributes");t&&this.createScript(t,i)})}convertAttributes(e){if("string"==typeof e){if(e.startsWith("asset:")){const t=e.slice(6),i=document.querySelector(`pc-asset#${t}`);if(i)return i.asset}if(e.startsWith("entity:")){const t=e.slice(7),i=document.querySelector(`pc-entity[name="${t}"]`);if(i)return i.entity}if(e.startsWith("vec2:")){const i=e.slice(5).split(",").map(Number);if(2===i.length&&i.every(e=>!isNaN(e)))return new t.Vec2(i[0],i[1])}if(e.startsWith("vec3:")){const i=e.slice(5).split(",").map(Number);if(3===i.length&&i.every(e=>!isNaN(e)))return new t.Vec3(i[0],i[1],i[2])}if(e.startsWith("vec4:")){const i=e.slice(5).split(",").map(Number);if(4===i.length&&i.every(e=>!isNaN(e)))return new t.Vec4(i[0],i[1],i[2],i[3])}if(e.startsWith("color:")){const i=e.slice(6).split(",").map(Number);if(4===i.length&&i.every(e=>!isNaN(e)))return new t.Color(i[0],i[1],i[2],i[3])}return e}if(Array.isArray(e))return e.length>0&&e[0],e.map(e=>this.convertAttributes(e));if(e&&"object"==typeof e){const t={};for(const i in e)t[i]=this.convertAttributes(e[i]);return t}return e}preprocessAttributes(e){return this.convertAttributes(e)}mergeDeep(e,t){for(const i in t)t[i]&&"object"==typeof t[i]&&!Array.isArray(t[i])?(e[i]&&"object"==typeof e[i]||(e[i]={}),this.mergeDeep(e[i],t[i])):e[i]=t[i];return e}applyAttributes(e,t){try{const i=t?JSON.parse(t):{},a=this.convertAttributes(i);this.mergeDeep(e,a)}catch(e){console.error(`Error parsing attributes JSON string ${t}:`,e)}}handleScriptAttributesChange(e){const t=e.target.getAttribute("name");if(!t||!this.component)return;const i=this.component.get(t);i&&this.applyAttributes(i,e.detail.attributes)}handleScriptEnableChange(e){const t=e.target.getAttribute("name");if(!t||!this.component)return;const i=this.component.get(t);i&&(i.enabled=e.detail.enabled)}createScript(e,t){if(!this.component)return null;let i={};if(t)try{i=JSON.parse(t),i=this.preprocessAttributes(i)}catch(e){console.error(`Error parsing attributes JSON string ${t}:`,e)}return this.component.create(e,{properties:i})}destroyScript(e){this.component&&this.component.destroy(e)}handleMutations(e){for(const t of e)t.addedNodes.forEach(e=>{if(e instanceof HTMLElement&&"pc-script"===e.tagName.toLowerCase()){const t=e.getAttribute("name"),i=e.getAttribute("attributes");t&&this.createScript(t,i)}}),t.removedNodes.forEach(e=>{if(e instanceof HTMLElement&&"pc-script"===e.tagName.toLowerCase()){const t=e.getAttribute("name");t&&this.destroyScript(t)}})}disconnectedCallback(){var e;this.observer.disconnect(),null===(e=super.disconnectedCallback)||void 0===e||e.call(this)}get component(){return super.component}}customElements.define("pc-scripts",W);class q extends HTMLElement{constructor(){super(...arguments),this._attributes="{}",this._enabled=!0,this._name=""}set scriptAttributes(e){this._attributes=e,this.dispatchEvent(new CustomEvent("scriptattributeschange",{detail:{attributes:e},bubbles:!0}))}get scriptAttributes(){return this._attributes}set enabled(e){this._enabled=e,this.dispatchEvent(new CustomEvent("scriptenablechange",{detail:{enabled:e},bubbles:!0}))}get enabled(){return this._enabled}set name(e){this._name=e}get name(){return this._name}static get observedAttributes(){return["attributes","enabled","name"]}attributeChangedCallback(e,t,i){switch(e){case"attributes":this.scriptAttributes=i;break;case"enabled":this.enabled="false"!==i;break;case"name":this.name=i}}}customElements.define("pc-script",q);class I extends _{constructor(){super("sound"),this._distanceModel="linear",this._maxDistance=1e4,this._pitch=1,this._positional=!1,this._refDistance=1,this._rollOffFactor=1,this._volume=1}getInitialComponentData(){return{distanceModel:this._distanceModel,maxDistance:this._maxDistance,pitch:this._pitch,positional:this._positional,refDistance:this._refDistance,rollOffFactor:this._rollOffFactor,volume:this._volume}}get component(){return super.component}set distanceModel(e){this._distanceModel=e,this.component&&(this.component.distanceModel=e)}get distanceModel(){return this._distanceModel}set maxDistance(e){this._maxDistance=e,this.component&&(this.component.maxDistance=e)}get maxDistance(){return this._maxDistance}set pitch(e){this._pitch=e,this.component&&(this.component.pitch=e)}get pitch(){return this._pitch}set positional(e){this._positional=e,this.component&&(this.component.positional=e)}get positional(){return this._positional}set refDistance(e){this._refDistance=e,this.component&&(this.component.refDistance=e)}get refDistance(){return this._refDistance}set rollOffFactor(e){this._rollOffFactor=e,this.component&&(this.component.rollOffFactor=e)}get rollOffFactor(){return this._rollOffFactor}set volume(e){this._volume=e,this.component&&(this.component.volume=e)}get volume(){return this._volume}static get observedAttributes(){return[...super.observedAttributes,"distance-model","max-distance","pitch","positional","ref-distance","roll-off-factor","volume"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"distance-model":this.distanceModel=i;break;case"max-distance":this.maxDistance=parseFloat(i);break;case"pitch":this.pitch=parseFloat(i);break;case"positional":this.positional=this.hasAttribute("positional");break;case"ref-distance":this.refDistance=parseFloat(i);break;case"roll-off-factor":this.rollOffFactor=parseFloat(i);break;case"volume":this.volume=parseFloat(i)}}}customElements.define("pc-sounds",I);class Q extends i{constructor(){super(...arguments),this._asset="",this._autoPlay=!1,this._duration=null,this._loop=!1,this._name="",this._overlap=!1,this._pitch=1,this._startTime=0,this._volume=1,this.soundSlot=null}async connectedCallback(){var e;await(null===(e=this.soundElement)||void 0===e?void 0:e.ready());const t={autoPlay:this._autoPlay,loop:this._loop,overlap:this._overlap,pitch:this._pitch,startTime:this._startTime,volume:this._volume};this._duration&&(t.duration=this._duration),this.soundSlot=this.soundElement.component.addSlot(this._name,t),this.asset=this._asset,this._autoPlay&&this.soundSlot.play(),this._onReady()}disconnectedCallback(){this.soundElement.component.removeSlot(this._name)}get soundElement(){const e=this.parentElement;return e instanceof I?e:(console.warn("pc-sound-slot must be a direct child of a pc-sound element"),null)}set asset(e){var t;if(this._asset=e,this.soundSlot){const i=null===(t=f.get(e))||void 0===t?void 0:t.id;i&&(this.soundSlot.asset=i)}}get asset(){return this._asset}set autoPlay(e){this._autoPlay=e,this.soundSlot&&(this.soundSlot.autoPlay=e)}get autoPlay(){return this._autoPlay}set duration(e){this._duration=e,this.soundSlot&&(this.soundSlot.duration=e)}get duration(){return this._duration}set loop(e){this._loop=e,this.soundSlot&&(this.soundSlot.loop=e)}get loop(){return this._loop}set name(e){this._name=e,this.soundSlot&&(this.soundSlot.name=e)}get name(){return this._name}set overlap(e){this._overlap=e,this.soundSlot&&(this.soundSlot.overlap=e)}get overlap(){return this._overlap}set pitch(e){this._pitch=e,this.soundSlot&&(this.soundSlot.pitch=e)}get pitch(){return this._pitch}set startTime(e){this._startTime=e,this.soundSlot&&(this.soundSlot.startTime=e)}get startTime(){return this._startTime}set volume(e){this._volume=e,this.soundSlot&&(this.soundSlot.volume=e)}get volume(){return this._volume}static get observedAttributes(){return["asset","auto-play","duration","loop","name","overlap","pitch","start-time","volume"]}attributeChangedCallback(e,t,i){switch(e){case"asset":this.asset=i;break;case"auto-play":this.autoPlay=this.hasAttribute("auto-play");break;case"duration":this.duration=parseFloat(i);break;case"loop":this.loop=this.hasAttribute("loop");break;case"name":this.name=i;break;case"overlap":this.overlap=this.hasAttribute("overlap");break;case"pitch":this.pitch=parseFloat(i);break;case"start-time":this.startTime=parseFloat(i);break;case"volume":this.volume=parseFloat(i)}}}customElements.define("pc-sound",Q);class K extends _{constructor(){super("gsplat"),this._asset="",this._castShadows=!1,this._lodBaseDistance=5,this._lodMultiplier=3}getInitialComponentData(){return{asset:f.get(this._asset),castShadows:this._castShadows,lodBaseDistance:this._lodBaseDistance,lodMultiplier:this._lodMultiplier}}get component(){return super.component}set asset(e){this._asset=e;const t=f.get(e);this.component&&t&&(this.component.asset=t)}get asset(){return this._asset}set castShadows(e){this._castShadows=e,this.component&&(this.component.castShadows=e)}get castShadows(){return this._castShadows}set lodBaseDistance(e){this._lodBaseDistance=e,this.component&&(this.component.lodBaseDistance=e)}get lodBaseDistance(){return this._lodBaseDistance}set lodMultiplier(e){this._lodMultiplier=e,this.component&&(this.component.lodMultiplier=e)}get lodMultiplier(){return this._lodMultiplier}static get observedAttributes(){return[...super.observedAttributes,"asset","cast-shadows","lod-base-distance","lod-multiplier"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"asset":this.asset=i;break;case"cast-shadows":this.castShadows=this.hasAttribute("cast-shadows");break;case"lod-base-distance":this.lodBaseDistance=Number(i);break;case"lod-multiplier":this.lodMultiplier=Number(i)}}}customElements.define("pc-gsplat",K);class V extends i{constructor(){super(...arguments),this._asset="",this._entity=null}connectedCallback(){this._loadModel(),this._onReady()}disconnectedCallback(){this._unloadModel()}_instantiate(e){this._entity=e.instantiateRenderEntity(),e.animations.length>0&&(this._entity.addComponent("anim"),this._entity.anim.assignAnimation("animation",e.animations[0].resource));const t=this.closestEntity;if(t)t.ready().then(()=>{t.entity.addChild(this._entity)});else{const e=this.closestApp;e&&e.ready().then(()=>{e.app.root.addChild(this._entity)})}}async _loadModel(){var e;this._unloadModel();const t=await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),i=null==t?void 0:t.app,a=f.get(this._asset);a&&(a.loaded?this._instantiate(a.resource):(a.once("load",()=>{this._instantiate(a.resource)}),i.assets.load(a)))}_unloadModel(){var e;null===(e=this._entity)||void 0===e||e.destroy(),this._entity=null}set asset(e){this._asset=e,this.isConnected&&this._loadModel()}get asset(){return this._asset}static get observedAttributes(){return["asset"]}attributeChangedCallback(e,t,i){if("asset"===e)this.asset=i}}customElements.define("pc-model",V);class J extends i{constructor(){super(...arguments),this._fog="none",this._fogColor=new t.Color(1,1,1),this._fogDensity=0,this._fogStart=0,this._fogEnd=1e3,this._gravity=new t.Vec3(0,-9.81,0),this.scene=null}async connectedCallback(){var e;await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),this.scene=this.closestApp.app.scene,this.updateSceneSettings(),this._onReady()}updateSceneSettings(){if(this.scene){this.scene.fog.type=this._fog,this.scene.fog.color=this._fogColor,this.scene.fog.density=this._fogDensity,this.scene.fog.start=this._fogStart,this.scene.fog.end=this._fogEnd;this.parentElement.app.systems.rigidbody.gravity.copy(this._gravity)}}set fog(e){this._fog=e,this.scene&&(this.scene.fog.type=e)}get fog(){return this._fog}set fogColor(e){this._fogColor=e,this.scene&&(this.scene.fog.color=e)}get fogColor(){return this._fogColor}set fogDensity(e){this._fogDensity=e,this.scene&&(this.scene.fog.density=e)}get fogDensity(){return this._fogDensity}set fogStart(e){this._fogStart=e,this.scene&&(this.scene.fog.start=e)}get fogStart(){return this._fogStart}set fogEnd(e){this._fogEnd=e,this.scene&&(this.scene.fog.end=e)}get fogEnd(){return this._fogEnd}set gravity(e){if(this._gravity=e,this.scene){this.parentElement.app.systems.rigidbody.gravity.copy(e)}}get gravity(){return this._gravity}static get observedAttributes(){return["fog","fog-color","fog-density","fog-start","fog-end","gravity"]}attributeChangedCallback(e,t,i){switch(e){case"fog":this.fog=i;break;case"fog-color":this.fogColor=o(i);break;case"fog-density":this.fogDensity=parseFloat(i);break;case"fog-start":this.fogStart=parseFloat(i);break;case"fog-end":this.fogEnd=parseFloat(i);break;case"gravity":this.gravity=c(i)}}}customElements.define("pc-scene",J);class U extends i{constructor(){super(...arguments),this._asset="",this._center=new t.Vec3(0,.01,0),this._intensity=1,this._rotation=new t.Vec3,this._level=0,this._lighting=!1,this._scale=new t.Vec3(100,100,100),this._type="infinite",this._scene=null}connectedCallback(){this._loadSkybox(),this._onReady()}disconnectedCallback(){this._unloadSkybox()}_generateSkybox(e){if(!this._scene)return;const i=e.resource,a=t.EnvLighting.generateSkyboxCubemap(i);if(a.anisotropy=4,this._scene.skybox=a,this._lighting){const e=t.EnvLighting.generateLightingSource(i),a=t.EnvLighting.generateAtlas(e);this._scene.envAtlas=a}const s=this._scene.layers.getLayerById(t.LAYERID_SKYBOX);s&&(s.enabled="none"!==this._type),this._scene.sky.type=this._type,this._scene.sky.node.setLocalScale(this._scale),this._scene.sky.center=this._center,this._scene.skyboxIntensity=this._intensity,this._scene.skyboxMip=this._level}async _loadSkybox(){var e;const t=await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),i=null==t?void 0:t.app;if(!i)return;const a=f.get(this._asset);a&&(this._scene=i.scene,a.loaded?this._generateSkybox(a):(a.once("load",()=>{this._generateSkybox(a)}),i.assets.load(a)))}_unloadSkybox(){var e,t;this._scene&&(null===(e=this._scene.skybox)||void 0===e||e.destroy(),this._scene.skybox=null,null===(t=this._scene.envAtlas)||void 0===t||t.destroy(),this._scene.envAtlas=null,this._scene=null)}set asset(e){this._asset=e,this.isConnected&&this._loadSkybox()}get asset(){return this._asset}set center(e){this._center=e,this._scene&&(this._scene.sky.center=this._center)}get center(){return this._center}set intensity(e){this._intensity=e,this._scene&&(this._scene.skyboxIntensity=this._intensity)}get intensity(){return this._intensity}set level(e){this._level=e,this._scene&&(this._scene.skyboxMip=this._level)}get level(){return this._level}set lighting(e){this._lighting=e}get lighting(){return this._lighting}set rotation(e){this._rotation=e,this._scene&&(this._scene.skyboxRotation=(new t.Quat).setFromEulerAngles(e))}get rotation(){return this._rotation}set scale(e){this._scale=e,this._scene&&this._scene.sky.node.setLocalScale(this._scale)}get scale(){return this._scale}set type(e){if(this._type=e,this._scene){this._scene.sky.type=this._type;const e=this._scene.layers.getLayerById(t.LAYERID_SKYBOX);e&&(e.enabled="none"!==this._type)}}get type(){return this._type}static get observedAttributes(){return["asset","center","intensity","level","lighting","rotation","scale","type"]}attributeChangedCallback(e,t,i){switch(e){case"asset":this.asset=i;break;case"center":this.center=c(i);break;case"intensity":this.intensity=parseFloat(i);break;case"level":this.level=parseInt(i,10);break;case"lighting":this.lighting=this.hasAttribute(e);break;case"rotation":this.rotation=c(i);break;case"scale":this.scale=c(i);break;case"type":this.type=i}}}customElements.define("pc-sky",U),e.AppElement=s,e.AssetElement=f,e.AsyncElement=i,e.ButtonComponentElement=y,e.CameraComponentElement=S,e.CollisionComponentElement=A,e.ComponentElement=_,e.ElementComponentElement=x,e.EntityElement=p,e.GSplatComponentElement=K,e.LayoutChildComponentElement=F,e.LayoutGroupComponentElement=j,e.LightComponentElement=R,e.ListenerComponentElement=v,e.MaterialElement=H,e.ModelElement=V,e.ModuleElement=a,e.ParticleSystemComponentElement=z,e.RenderComponentElement=P,e.RigidBodyComponentElement=D,e.SceneElement=J,e.ScreenComponentElement=M,e.ScriptComponentElement=W,e.ScriptElement=q,e.ScrollViewComponentElement=L,e.ScrollbarComponentElement=B,e.SkyElement=U,e.SoundComponentElement=I,e.SoundSlotElement=Q});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("playcanvas")):"function"==typeof define&&define.amd?define(["exports","playcanvas"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).pd={},e.pc)}(this,function(e,t){"use strict";class i extends HTMLElement{constructor(){super(),this._readyPromise=new Promise(e=>{this._readyResolve=e})}get closestApp(){var e;return null===(e=this.parentElement)||void 0===e?void 0:e.closest("pc-app")}get closestEntity(){var e;return null===(e=this.parentElement)||void 0===e?void 0:e.closest("pc-entity")}_onReady(){this._readyResolve(),this.dispatchEvent(new CustomEvent("ready"))}ready(){return this._readyPromise.then(()=>this)}}class a extends HTMLElement{constructor(){super(),this.loadPromise=this.loadModule()}async loadModule(){const e=this.getAttribute("name"),i={glueUrl:this.getAttribute("glue"),wasmUrl:this.getAttribute("wasm"),fallbackUrl:this.getAttribute("fallback")};"Basis"===e?t.basisInitialize(i):(t.WasmModule.setConfig(e,i),await new Promise(i=>{t.WasmModule.getInstance(e,()=>i())}))}getLoadPromise(){return this.loadPromise}}customElements.define("pc-module",a);class s extends i{constructor(){super(),this._canvas=null,this._alpha=!0,this._backend="webgl2",this._antialias=!0,this._depth=!0,this._stencil=!0,this._highResolution=!0,this._hierarchyReady=!1,this._picker=null,this._hasPointerListeners={pointerenter:!1,pointerleave:!1,pointerdown:!1,pointerup:!1,pointermove:!1},this._hoveredEntity=null,this._pointerHandlers={pointermove:null,pointerdown:null,pointerup:null},this.app=null,this._onWindowResize=this._onWindowResize.bind(this)}async connectedCallback(){const e=this.querySelectorAll(":scope > pc-module");await Promise.all(Array.from(e).map(e=>e.getLoadPromise())),this._canvas=document.createElement("canvas"),this.appendChild(this._canvas);const i={webgpu:["webgpu","webgl2"],webgl2:["webgl2"],null:["null"]}[this._backend]||[],a=await t.createGraphicsDevice(this._canvas,{alpha:this._alpha,antialias:this._antialias,depth:this._depth,deviceTypes:i,stencil:this._stencil});a.maxPixelRatio=this._highResolution?window.devicePixelRatio:1;const s=new t.AppOptions;s.graphicsDevice=a,s.keyboard=new t.Keyboard(window),s.mouse=new t.Mouse(this._canvas),s.elementInput=new t.ElementInput(this._canvas,{useMouse:!0,useTouch:!0}),s.componentSystems=[t.AnimComponentSystem,t.AnimationComponentSystem,t.AudioListenerComponentSystem,t.ButtonComponentSystem,t.CameraComponentSystem,t.CollisionComponentSystem,t.ElementComponentSystem,t.GSplatComponentSystem,t.JointComponentSystem,t.LayoutChildComponentSystem,t.LayoutGroupComponentSystem,t.LightComponentSystem,t.ModelComponentSystem,t.ParticleSystemComponentSystem,t.RenderComponentSystem,t.RigidBodyComponentSystem,t.ScreenComponentSystem,t.ScriptComponentSystem,t.ScrollbarComponentSystem,t.ScrollViewComponentSystem,t.SoundComponentSystem,t.SpriteComponentSystem,t.ZoneComponentSystem],s.resourceHandlers=[t.AnimClipHandler,t.AnimationHandler,t.AnimStateGraphHandler,t.AudioHandler,t.BinaryHandler,t.CssHandler,t.ContainerHandler,t.CubemapHandler,t.FolderHandler,t.FontHandler,t.GSplatHandler,t.HierarchyHandler,t.HtmlHandler,t.JsonHandler,t.MaterialHandler,t.ModelHandler,t.RenderHandler,t.ScriptHandler,t.SceneHandler,t.ShaderHandler,t.SpriteHandler,t.TemplateHandler,t.TextHandler,t.TextureAtlasHandler,t.TextureHandler],s.soundManager=new t.SoundManager,s.lightmapper=t.Lightmapper,s.batchManager=t.BatchManager,s.xr=t.XrManager,this.app=new t.AppBase(this._canvas),this.app.init(s),this.app.setCanvasFillMode(t.FILLMODE_FILL_WINDOW),this.app.setCanvasResolution(t.RESOLUTION_AUTO),this._pickerCreate();const n=this.querySelectorAll(":scope > pc-asset");Array.from(n).forEach(e=>{e.createAsset();const t=e.asset;t&&this.app.assets.add(t)});const o=this.querySelectorAll(":scope > pc-material");Array.from(o).forEach(e=>{e.createMaterial()});const r=this.querySelectorAll("pc-entity");Array.from(r).forEach(e=>{e.createEntity(this.app)}),r.forEach(e=>{e.buildHierarchy(this.app)}),this._hierarchyReady=!0,this.app.preload(()=>{this.app.start(),window.addEventListener("resize",this._onWindowResize),this._onReady()})}disconnectedCallback(){this._pickerDestroy(),this.app&&(this.app.destroy(),this.app=null),window.removeEventListener("resize",this._onWindowResize),this._canvas&&this.contains(this._canvas)&&(this.removeChild(this._canvas),this._canvas=null)}_onWindowResize(){this.app&&this.app.resizeCanvas()}_pickerCreate(){const{width:e,height:i}=this.app.graphicsDevice;this._picker=new t.Picker(this.app,e,i),this._pointerHandlers.pointermove=this._onPointerMove.bind(this),this._pointerHandlers.pointerdown=this._onPointerDown.bind(this),this._pointerHandlers.pointerup=this._onPointerUp.bind(this),["pointermove","pointerdown","pointerup","pointerenter","pointerleave"].forEach(e=>{this.addEventListener(`${e}:connect`,()=>this._onPointerListenerAdded(e)),this.addEventListener(`${e}:disconnect`,()=>this._onPointerListenerRemoved(e))})}_pickerDestroy(){this._canvas&&Object.entries(this._pointerHandlers).forEach(([e,t])=>{t&&this._canvas.removeEventListener(e,t)}),this._picker=null,this._pointerHandlers={pointermove:null,pointerdown:null,pointerup:null}}_getPickerCoordinates(e){const t=this._canvas.getBoundingClientRect(),i=this._canvas.width/t.width,a=this._canvas.height/t.height;return{x:(e.clientX-t.left)*i,y:(e.clientY-t.top)*a}}_onPointerMove(e){if(!this._picker||!this.app)return;const i=this.app.root.findComponent("camera");if(!i)return;const{x:a,y:s}=this._getPickerCoordinates(e);this._picker.prepare(i,this.app.scene);const n=this._picker.getSelection(a,s);let o=null;if(n.length>0){const e=n[0];let i=e instanceof t.MeshInstance?e.node:e.entity;for(;null!==i;){const e=this.querySelector(`pc-entity[name="${i.name}"]`);if(e){o=e;break}i=i.parent}}this._hoveredEntity!==o&&(this._hoveredEntity&&this._hoveredEntity.hasListeners("pointerleave")&&this._hoveredEntity.dispatchEvent(new PointerEvent("pointerleave",e)),o&&o.hasListeners("pointerenter")&&o.dispatchEvent(new PointerEvent("pointerenter",e))),this._hoveredEntity=o,o&&o.hasListeners("pointermove")&&o.dispatchEvent(new PointerEvent("pointermove",e))}_onPointerDown(e){if(!this._picker||!this.app)return;const i=this.app.root.findComponent("camera");if(!i)return;const{x:a,y:s}=this._getPickerCoordinates(e);this._picker.prepare(i,this.app.scene);const n=this._picker.getSelection(a,s);if(n.length>0){const i=n[0];let a=i instanceof t.MeshInstance?i.node:i.entity;for(;null!==a;){const t=this.querySelector(`pc-entity[name="${a.name}"]`);if(t&&t.hasListeners("pointerdown")){t.dispatchEvent(new PointerEvent("pointerdown",e));break}a=a.parent}}}_onPointerUp(e){if(!this._picker||!this.app)return;const i=this.app.root.findComponent("camera");if(!i)return;const{x:a,y:s}=this._getPickerCoordinates(e);this._picker.prepare(i,this.app.scene);const n=this._picker.getSelection(a,s);if(n.length>0){const i=n[0],a=i instanceof t.MeshInstance?i.node:i.entity,s=this.querySelector(`pc-entity[name="${a.name}"]`);s&&s.hasListeners("pointerup")&&s.dispatchEvent(new PointerEvent("pointerup",e))}}_onPointerListenerAdded(e){if(!this._hasPointerListeners[e]&&this._canvas){this._hasPointerListeners[e]=!0;const t="pointerenter"===e||"pointerleave"===e?this._pointerHandlers.pointermove:this._pointerHandlers[e];t&&this._canvas.addEventListener("pointerenter"===e||"pointerleave"===e?"pointermove":e,t)}}_onPointerListenerRemoved(e){if(!Array.from(this.querySelectorAll("pc-entity")).some(t=>t.hasListeners(e))&&this._canvas){this._hasPointerListeners[e]=!1;const t="pointerenter"===e||"pointerleave"===e?this._pointerHandlers.pointermove:this._pointerHandlers[e];t&&this._canvas.removeEventListener("pointerenter"===e||"pointerleave"===e?"pointermove":e,t)}}set alpha(e){this._alpha=e}get alpha(){return this._alpha}set antialias(e){this._antialias=e}get antialias(){return this._antialias}set backend(e){this._backend=e}get backend(){return this._backend}set depth(e){this._depth=e}get depth(){return this._depth}get hierarchyReady(){return this._hierarchyReady}set highResolution(e){this._highResolution=e,this.app&&(this.app.graphicsDevice.maxPixelRatio=e?window.devicePixelRatio:1)}get highResolution(){return this._highResolution}set stencil(e){this._stencil=e}get stencil(){return this._stencil}static get observedAttributes(){return["alpha","antialias","backend","depth","stencil","high-resolution"]}attributeChangedCallback(e,t,i){switch(e){case"alpha":this.alpha="false"!==i;break;case"antialias":this.antialias="false"!==i;break;case"backend":"webgpu"!==i&&"webgl2"!==i&&"null"!==i||(this.backend=i);break;case"depth":this.depth="false"!==i;break;case"high-resolution":this.highResolution="false"!==i;break;case"stencil":this.stencil="false"!==i}}}customElements.define("pc-app",s);const n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},o=e=>{const i=n[e.toLowerCase()];if(i)return(new t.Color).fromString(i);if(e.startsWith("#"))return(new t.Color).fromString(e);const a=e.split(" ").map(Number);return new t.Color(a)},r=e=>{const i=e.split(" ").map(Number);return new t.Vec2(i)},c=e=>{const i=e.split(" ").map(Number);return new t.Vec3(i)},h=e=>{const i=e.split(" ").map(Number);return new t.Vec4(i)},b=(e,t,i)=>{const a=t.get(e);if(void 0!==a)return a;const s=Number(e);return Number.isFinite(s)?s:i},l=e=>{var t,i;if(!e)return null;let a=null;try{a=document.querySelector(e)}catch(e){a=null}return a||(a=null!==(t=document.getElementById(e))&&void 0!==t?t:document.querySelector(`pc-entity[name="${e}"]`)),null!==(i=null==a?void 0:a.entity)&&void 0!==i?i:null};class p extends i{constructor(){super(...arguments),this._enabled=!0,this._name="Untitled",this._position=new t.Vec3,this._rotation=new t.Vec3,this._scale=new t.Vec3(1,1,1),this._tags=[],this._listeners={},this._built=!1,this.entity=null}createEntity(e){if(this.entity)return;this.entity=new t.Entity(this.getAttribute("name")||this._name,e);const i=this.getAttribute("enabled");i&&(this.entity.enabled="false"!==i);const a=this.getAttribute("position");a&&this.entity.setLocalPosition(c(a));const s=this.getAttribute("rotation");s&&this.entity.setLocalEulerAngles(c(s));const n=this.getAttribute("scale");n&&this.entity.setLocalScale(c(n));const o=this.getAttribute("tags");o&&this.entity.tags.add(o.split(",").map(e=>e.trim()));["onpointerenter","onpointerleave","onpointerdown","onpointerup","onpointermove"].forEach(e=>{const t=this.getAttribute(e);if(t){const i=e.substring(2),a=e=>{try{new Function("event",t).call(this,e)}catch(e){console.error("Error in event handler:",e)}};this.addEventListener(i,a)}})}buildHierarchy(e){if(!this.entity||this._built)return;this._built=!0;const t=this.closestEntity;(null==t?void 0:t.entity)?t.entity.addChild(this.entity):e.root.addChild(this.entity),this._onReady()}connectedCallback(){const e=this.closestApp;if(e&&e.hierarchyReady){const t=e.app;this.createEntity(t),this.buildHierarchy(t);const i=this.querySelectorAll("pc-entity");i.forEach(e=>{e.createEntity(t)}),i.forEach(e=>{e.buildHierarchy(t)})}}disconnectedCallback(){if(this.entity){this.querySelectorAll("pc-entity").forEach(e=>{e.entity=null}),this.entity.destroy(),this.entity=null,this._built=!1}}set enabled(e){this._enabled=e,this.entity&&(this.entity.enabled=e)}get enabled(){return this._enabled}set name(e){this._name=e,this.entity&&(this.entity.name=e)}get name(){return this._name}set position(e){this._position=e,this.entity&&this.entity.setLocalPosition(this._position)}get position(){return this._position}set rotation(e){this._rotation=e,this.entity&&this.entity.setLocalEulerAngles(this._rotation)}get rotation(){return this._rotation}set scale(e){this._scale=e,this.entity&&this.entity.setLocalScale(this._scale)}get scale(){return this._scale}set tags(e){this._tags=e,this.entity&&(this.entity.tags.clear(),this.entity.tags.add(this._tags))}get tags(){return this._tags}static get observedAttributes(){return["enabled","name","position","rotation","scale","tags","onpointerenter","onpointerleave","onpointerdown","onpointerup","onpointermove"]}attributeChangedCallback(e,t,i){switch(e){case"enabled":this.enabled="false"!==i;break;case"name":this.name=i;break;case"position":this.position=c(i);break;case"rotation":this.rotation=c(i);break;case"scale":this.scale=c(i);break;case"tags":this.tags=i.split(",").map(e=>e.trim());break;case"onpointerenter":case"onpointerleave":case"onpointerdown":case"onpointerup":case"onpointermove":if(i){const t=e.substring(2),i=e=>{try{const i=this.getAttribute(t)||"";new Function("event",i).call(this,e)}catch(e){console.error("Error in event handler:",e)}};this.addEventListener(t,i)}}}addEventListener(e,t,i){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),super.addEventListener(e,t,i),e.startsWith("pointer")&&this.dispatchEvent(new CustomEvent(`${e}:connect`,{bubbles:!0}))}removeEventListener(e,t,i){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter(e=>e!==t)),super.removeEventListener(e,t,i),e.startsWith("pointer")&&this.dispatchEvent(new CustomEvent(`${e}:disconnect`,{bubbles:!0}))}hasListeners(e){var t;return Boolean(null===(t=this._listeners[e])||void 0===t?void 0:t.length)}}customElements.define("pc-entity",p);var d=function(){var e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if("object"!=typeof WebAssembly)return{supported:!1};var i,a=WebAssembly.validate(e)?"b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb":"b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",s=WebAssembly.instantiate(n(a),{}).then(function(e){(i=e.instance).exports.__wasm_call_ctors()});function n(e){for(var i=new Uint8Array(e.length),a=0;a<e.length;++a){var s=e.charCodeAt(a);i[a]=s>96?s-97:s>64?s-39:s+4}var n=0;for(a=0;a<e.length;++a)i[n++]=i[a]<60?t[i[a]]:64*(i[a]-60)+i[++a];return i.buffer.slice(0,n)}function o(e,t,a,s,n,o){var r=i.exports.sbrk,c=a+3&-4,h=r(c*s),b=r(n.length),l=new Uint8Array(i.exports.memory.buffer);l.set(n,b);var p=e(h,a,s,b,n.length);if(0==p&&o&&o(h,c,s),t.set(l.subarray(h,h+a*s)),r(h-r(0)),0!=p)throw new Error("Malformed buffer data: "+p)}var r={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],b=0;function l(e){var t={object:new Worker(e),pending:0,requests:{}};return t.object.onmessage=function(e){var i=e.data;t.pending-=i.count,t.requests[i.id][i.action](i.value),delete t.requests[i.id]},t}function p(e){for(var t="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(n(a))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+o.toString()+d.toString(),i=new Blob([t],{type:"text/javascript"}),s=URL.createObjectURL(i),r=0;r<e;++r)h[r]=l(s);URL.revokeObjectURL(s)}function d(e){s.then(function(){var t=e.data;try{var a=new Uint8Array(t.count*t.size);o(i.exports[t.mode],a,t.count,t.size,t.source,i.exports[t.filter]),self.postMessage({id:t.id,count:t.count,action:"resolve",value:a},[a.buffer])}catch(e){self.postMessage({id:t.id,count:t.count,action:"reject",value:e})}})}return{ready:s,supported:!0,useWorkers:function(e){p(e)},decodeVertexBuffer:function(e,t,a,s,n){o(i.exports.meshopt_decodeVertexBuffer,e,t,a,s,i.exports[r[n]])},decodeIndexBuffer:function(e,t,a,s){o(i.exports.meshopt_decodeIndexBuffer,e,t,a,s)},decodeIndexSequence:function(e,t,a,s){o(i.exports.meshopt_decodeIndexSequence,e,t,a,s)},decodeGltfBuffer:function(e,t,a,s,n,h){o(i.exports[c[n]],e,t,a,s,i.exports[r[h]])},decodeGltfBufferAsync:function(e,t,a,n,l){return h.length>0?function(e,t,i,a,s){for(var n=h[0],o=1;o<h.length;++o)h[o].pending<n.pending&&(n=h[o]);return new Promise(function(o,r){var c=new Uint8Array(i),h=b++;n.pending+=e,n.requests[h]={resolve:o,reject:r},n.object.postMessage({id:h,count:e,size:t,source:c,mode:a,filter:s},[c.buffer])})}(e,t,a,c[n],r[l]):s.then(function(){var s=new Uint8Array(e*t);return o(i.exports[c[n]],s,e,t,a,i.exports[r[l]]),s})}}}();const m=new Map([["simple",t.SPRITE_RENDERMODE_SIMPLE],["sliced",t.SPRITE_RENDERMODE_SLICED],["tiled",t.SPRITE_RENDERMODE_TILED]]),u=new Map([["bin","binary"],["css","css"],["frag","shader"],["glb","container"],["glsl","shader"],["hdr","texture"],["html","html"],["jpg","texture"],["js","script"],["json","json"],["mp3","audio"],["mjs","script"],["ply","gsplat"],["png","texture"],["sog","gsplat"],["txt","text"],["vert","shader"],["webp","texture"]]),g=(e,t,i)=>{if(e.extensions&&e.extensions.EXT_meshopt_compression){const a=e.extensions.EXT_meshopt_compression;Promise.all([d.ready,t[a.buffer]]).then(e=>{const t=e[1],s=a.byteOffset||0,n=a.byteLength||0,o=a.count,r=a.byteStride,c=new Uint8Array(o*r),h=new Uint8Array(t.buffer,t.byteOffset+s,n);d.decodeGltfBuffer(c,o,r,h,a.mode,a.filter),i(null,c)})}else i(null,null)};class f extends HTMLElement{constructor(){super(...arguments),this._lazy=!1,this.asset=null}disconnectedCallback(){this.destroyAsset()}createAsset(){var e;const i=this.getAttribute("id")||"",a=this.getAttribute("src")||"";let s=this.getAttribute("type");if(!s){const t=a.split(".").pop();s=null!==(e=u.get(t||""))&&void 0!==e?e:null}if(!s)return void console.warn(`Unsupported asset type: ${a}`);const n=this._buildData(s);this.asset="container"===s?new t.Asset(i,s,{url:a},void 0,{bufferView:{processAsync:g.bind(this)}}):"sprite"===s?new t.Asset(i,s,null,n):new t.Asset(i,s,a?{url:a}:null,n),this.asset.preload=!this._lazy}_buildData(e){var i,a,s,n;let o;const r=this.getAttribute("data");if(r)try{o=JSON.parse(r)}catch(e){console.warn(`Invalid 'data' JSON on pc-asset: ${r}`)}if("sprite"===e){o=null!=o?o:{};const e=null!==(i=this.getAttribute("atlas"))&&void 0!==i?i:o.textureAtlasAsset;if("string"==typeof e){const t=f.get(e);t?o.textureAtlasAsset=t.id:console.warn(`pc-asset sprite '${this.getAttribute("id")}' could not find atlas '${e}'`)}const r=this.getAttribute("frame-keys");null!==r&&(o.frameKeys=r.split(/[\s,]+/).filter(Boolean));const c=this.getAttribute("pixels-per-unit");null!==c&&(o.pixelsPerUnit=Number(c));const h=this.getAttribute("render-mode");null!==h&&(o.renderMode=b(h,m,t.SPRITE_RENDERMODE_SIMPLE)),o.renderMode=null!==(a=o.renderMode)&&void 0!==a?a:t.SPRITE_RENDERMODE_SIMPLE,o.pixelsPerUnit=null!==(s=o.pixelsPerUnit)&&void 0!==s?s:1,o.frameKeys=null!==(n=o.frameKeys)&&void 0!==n?n:[]}return o}destroyAsset(){this.asset&&(this.asset.unload(),this.asset=null)}set lazy(e){this._lazy=e,this.asset&&(this.asset.preload=!e)}get lazy(){return this._lazy}static get(e){const t=document.querySelector(`pc-asset[id="${e}"]`);return null==t?void 0:t.asset}static get observedAttributes(){return["lazy"]}attributeChangedCallback(e,t,i){"lazy"===e&&(this.lazy=this.hasAttribute("lazy"))}}customElements.define("pc-asset",f);class _ extends i{constructor(e){super(),this._enabled=!0,this._component=null,this._componentName=e}getInitialComponentData(){return{}}async addComponent(){const e=this.closestEntity;if(e){await e.ready();const t=this.getInitialComponentData();this._component=e.entity.addComponent(this._componentName,t)}}initComponent(){}async connectedCallback(){var e;await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),await this.addComponent(),this.initComponent(),this._onReady()}disconnectedCallback(){this.component&&this.component.entity&&(this._component.entity.removeComponent(this._componentName),this._component=null)}get component(){return this._component}set enabled(e){this._enabled=e,this.component&&(this.component.enabled=e)}get enabled(){return this._enabled}static get observedAttributes(){return["enabled"]}attributeChangedCallback(e,t,i){if("enabled"===e)this.enabled="false"!==i}}class v extends _{constructor(){super("audiolistener")}get component(){return super.component}}customElements.define("pc-listener",v);const k=new Map([["tint",t.BUTTON_TRANSITION_MODE_TINT],["sprite",t.BUTTON_TRANSITION_MODE_SPRITE_CHANGE]]);class y extends _{constructor(){super("button"),this._active=!0,this._image="",this._hitPadding=new t.Vec4(0,0,0,0),this._transitionMode=t.BUTTON_TRANSITION_MODE_TINT,this._hoverTint=new t.Color(1,1,1,1),this._pressedTint=new t.Color(1,1,1,1),this._inactiveTint=new t.Color(1,1,1,1),this._fadeDuration=0,this._hoverSpriteAsset="",this._hoverSpriteFrame=0,this._pressedSpriteAsset="",this._pressedSpriteFrame=0,this._inactiveSpriteAsset="",this._inactiveSpriteFrame=0}getInitialComponentData(){var e;const t={active:this._active,hitPadding:this._hitPadding,transitionMode:this._transitionMode,hoverTint:this._hoverTint,pressedTint:this._pressedTint,inactiveTint:this._inactiveTint,fadeDuration:this._fadeDuration,hoverSpriteFrame:this._hoverSpriteFrame,pressedSpriteFrame:this._pressedSpriteFrame,inactiveSpriteFrame:this._inactiveSpriteFrame},i=this._image?l(this._image):null===(e=this.closestEntity)||void 0===e?void 0:e.entity;i&&(t.imageEntity=i);const a=f.get(this._hoverSpriteAsset);a&&(t.hoverSpriteAsset=a.id);const s=f.get(this._pressedSpriteAsset);s&&(t.pressedSpriteAsset=s.id);const n=f.get(this._inactiveSpriteAsset);return n&&(t.inactiveSpriteAsset=n.id),t}get component(){return super.component}set active(e){this._active=e,this.component&&(this.component.active=e)}get active(){return this._active}set image(e){this._image=e;const t=l(e);this.component&&t&&(this.component.imageEntity=t)}get image(){return this._image}set hitPadding(e){this._hitPadding=e,this.component&&(this.component.hitPadding=e)}get hitPadding(){return this._hitPadding}set transitionMode(e){this._transitionMode=e,this.component&&(this.component.transitionMode=e)}get transitionMode(){return this._transitionMode}set hoverTint(e){this._hoverTint=e,this.component&&(this.component.hoverTint=e)}get hoverTint(){return this._hoverTint}set pressedTint(e){this._pressedTint=e,this.component&&(this.component.pressedTint=e)}get pressedTint(){return this._pressedTint}set inactiveTint(e){this._inactiveTint=e,this.component&&(this.component.inactiveTint=e)}get inactiveTint(){return this._inactiveTint}set fadeDuration(e){this._fadeDuration=e,this.component&&(this.component.fadeDuration=e)}get fadeDuration(){return this._fadeDuration}set hoverSpriteAsset(e){this._hoverSpriteAsset=e;const t=f.get(e);this.component&&t&&(this.component.hoverSpriteAsset=t.id)}get hoverSpriteAsset(){return this._hoverSpriteAsset}set hoverSpriteFrame(e){this._hoverSpriteFrame=e,this.component&&(this.component.hoverSpriteFrame=e)}get hoverSpriteFrame(){return this._hoverSpriteFrame}set pressedSpriteAsset(e){this._pressedSpriteAsset=e;const t=f.get(e);this.component&&t&&(this.component.pressedSpriteAsset=t.id)}get pressedSpriteAsset(){return this._pressedSpriteAsset}set pressedSpriteFrame(e){this._pressedSpriteFrame=e,this.component&&(this.component.pressedSpriteFrame=e)}get pressedSpriteFrame(){return this._pressedSpriteFrame}set inactiveSpriteAsset(e){this._inactiveSpriteAsset=e;const t=f.get(e);this.component&&t&&(this.component.inactiveSpriteAsset=t.id)}get inactiveSpriteAsset(){return this._inactiveSpriteAsset}set inactiveSpriteFrame(e){this._inactiveSpriteFrame=e,this.component&&(this.component.inactiveSpriteFrame=e)}get inactiveSpriteFrame(){return this._inactiveSpriteFrame}static get observedAttributes(){return[...super.observedAttributes,"active","image","hit-padding","transition-mode","hover-tint","pressed-tint","inactive-tint","fade-duration","hover-sprite-asset","hover-sprite-frame","pressed-sprite-asset","pressed-sprite-frame","inactive-sprite-asset","inactive-sprite-frame"]}attributeChangedCallback(e,i,a){switch(super.attributeChangedCallback(e,i,a),e){case"active":this.active="false"!==a;break;case"image":this.image=a;break;case"hit-padding":this.hitPadding=h(a);break;case"transition-mode":this.transitionMode=b(a,k,t.BUTTON_TRANSITION_MODE_TINT);break;case"hover-tint":this.hoverTint=o(a);break;case"pressed-tint":this.pressedTint=o(a);break;case"inactive-tint":this.inactiveTint=o(a);break;case"fade-duration":this.fadeDuration=Number(a);break;case"hover-sprite-asset":this.hoverSpriteAsset=a;break;case"hover-sprite-frame":this.hoverSpriteFrame=Number(a);break;case"pressed-sprite-asset":this.pressedSpriteAsset=a;break;case"pressed-sprite-frame":this.pressedSpriteFrame=Number(a);break;case"inactive-sprite-asset":this.inactiveSpriteAsset=a;break;case"inactive-sprite-frame":this.inactiveSpriteFrame=Number(a)}}}customElements.define("pc-button",y);const w=new Map([["none",t.TONEMAP_NONE],["linear",t.TONEMAP_LINEAR],["filmic",t.TONEMAP_FILMIC],["hejl",t.TONEMAP_HEJL],["aces",t.TONEMAP_ACES],["aces2",t.TONEMAP_ACES2],["neutral",t.TONEMAP_NEUTRAL]]);class S extends _{constructor(){super("camera"),this._clearColor=new t.Color(.75,.75,.75,1),this._clearColorBuffer=!0,this._clearDepthBuffer=!0,this._clearStencilBuffer=!1,this._cullFaces=!0,this._farClip=1e3,this._flipFaces=!1,this._fov=45,this._frustumCulling=!0,this._gamma="srgb",this._horizontalFov=!1,this._nearClip=.1,this._orthographic=!1,this._orthoHeight=10,this._priority=0,this._rect=new t.Vec4(0,0,1,1),this._scissorRect=new t.Vec4(0,0,1,1),this._tonemap="none"}getInitialComponentData(){return{clearColor:this._clearColor,clearColorBuffer:this._clearColorBuffer,clearDepthBuffer:this._clearDepthBuffer,clearStencilBuffer:this._clearStencilBuffer,cullFaces:this._cullFaces,farClip:this._farClip,flipFaces:this._flipFaces,fov:this._fov,frustumCulling:this._frustumCulling,gammaCorrection:"srgb"===this._gamma?t.GAMMA_SRGB:t.GAMMA_NONE,horizontalFov:this._horizontalFov,nearClip:this._nearClip,orthographic:this._orthographic,orthoHeight:this._orthoHeight,priority:this._priority,rect:this._rect,scissorRect:this._scissorRect,toneMapping:w.get(this._tonemap)}}get xrAvailable(){var e;const i=null===(e=this.component)||void 0===e?void 0:e.system.app.xr;return i&&i.supported&&i.isAvailable(t.XRTYPE_VR)}startXr(e,t){this.component&&this.xrAvailable&&this.component.startXr(e,t,{callback:e=>{e&&console.error(`WebXR Immersive VR failed to start: ${e.message}`)}})}endXr(){this.component&&this.component.endXr()}get component(){return super.component}set clearColor(e){this._clearColor=e,this.component&&(this.component.clearColor=e)}get clearColor(){return this._clearColor}set clearColorBuffer(e){this._clearColorBuffer=e,this.component&&(this.component.clearColorBuffer=e)}get clearColorBuffer(){return this._clearColorBuffer}set clearDepthBuffer(e){this._clearDepthBuffer=e,this.component&&(this.component.clearDepthBuffer=e)}get clearDepthBuffer(){return this._clearDepthBuffer}set clearStencilBuffer(e){this._clearStencilBuffer=e,this.component&&(this.component.clearStencilBuffer=e)}get clearStencilBuffer(){return this._clearStencilBuffer}set cullFaces(e){this._cullFaces=e,this.component&&(this.component.cullFaces=e)}get cullFaces(){return this._cullFaces}set farClip(e){this._farClip=e,this.component&&(this.component.farClip=e)}get farClip(){return this._farClip}set flipFaces(e){this._flipFaces=e,this.component&&(this.component.flipFaces=e)}get flipFaces(){return this._flipFaces}set fov(e){this._fov=e,this.component&&(this.component.fov=e)}get fov(){return this._fov}set frustumCulling(e){this._frustumCulling=e,this.component&&(this.component.frustumCulling=e)}get frustumCulling(){return this._frustumCulling}set gamma(e){this._gamma=e,this.component&&(this.component.gammaCorrection="srgb"===e?t.GAMMA_SRGB:t.GAMMA_NONE)}get gamma(){return this._gamma}set horizontalFov(e){this._horizontalFov=e,this.component&&(this.component.horizontalFov=e)}get horizontalFov(){return this._horizontalFov}set nearClip(e){this._nearClip=e,this.component&&(this.component.nearClip=e)}get nearClip(){return this._nearClip}set orthographic(e){this._orthographic=e,this.component&&(this.component.projection=e?t.PROJECTION_ORTHOGRAPHIC:t.PROJECTION_PERSPECTIVE)}get orthographic(){return this._orthographic}set orthoHeight(e){this._orthoHeight=e,this.component&&(this.component.orthoHeight=e)}get orthoHeight(){return this._orthoHeight}set priority(e){this._priority=e,this.component&&(this.component.priority=e)}get priority(){return this._priority}set rect(e){this._rect=e,this.component&&(this.component.rect=e)}get rect(){return this._rect}set scissorRect(e){this._scissorRect=e,this.component&&(this.component.scissorRect=e)}get scissorRect(){return this._scissorRect}set tonemap(e){var i;this._tonemap=e,this.component&&(this.component.toneMapping=null!==(i=w.get(e))&&void 0!==i?i:t.TONEMAP_NONE)}get tonemap(){return this._tonemap}static get observedAttributes(){return[...super.observedAttributes,"clear-color","clear-color-buffer","clear-depth-buffer","clear-stencil-buffer","cull-faces","far-clip","flip-faces","fov","frustum-culling","gamma","horizontal-fov","near-clip","orthographic","ortho-height","priority","rect","scissor-rect","tonemap"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"clear-color":this.clearColor=o(i);break;case"clear-color-buffer":this.clearColorBuffer="false"!==i;break;case"clear-depth-buffer":this.clearDepthBuffer="false"!==i;break;case"clear-stencil-buffer":this.clearStencilBuffer="false"!==i;break;case"cull-faces":this.cullFaces="false"!==i;break;case"far-clip":this.farClip=parseFloat(i);break;case"flip-faces":this.flipFaces="true"!==i;break;case"fov":this.fov=parseFloat(i);break;case"frustum-culling":this.frustumCulling="false"!==i;break;case"gamma":this.gamma=i;break;case"horizontal-fov":this.horizontalFov=this.hasAttribute("horizontal-fov");break;case"near-clip":this.nearClip=parseFloat(i);break;case"orthographic":this.orthographic=this.hasAttribute("orthographic");break;case"ortho-height":this.orthoHeight=parseFloat(i);break;case"priority":this.priority=parseFloat(i);break;case"rect":this.rect=h(i);break;case"scissor-rect":this.scissorRect=h(i);break;case"tonemap":this.tonemap=i}}}customElements.define("pc-camera",S);class A extends _{constructor(){super("collision"),this._angularOffset=new t.Quat,this._axis=1,this._convexHull=!1,this._halfExtents=new t.Vec3(.5,.5,.5),this._height=2,this._linearOffset=new t.Vec3,this._radius=.5,this._type="box"}getInitialComponentData(){return{axis:this._axis,angularOffset:this._angularOffset,convexHull:this._convexHull,halfExtents:this._halfExtents,height:this._height,linearOffset:this._linearOffset,radius:this._radius,type:this._type}}get component(){return super.component}set angularOffset(e){this._angularOffset=e,this.component&&(this.component.angularOffset=e)}get angularOffset(){return this._angularOffset}set axis(e){this._axis=e,this.component&&(this.component.axis=e)}get axis(){return this._axis}set convexHull(e){this._convexHull=e,this.component&&(this.component.convexHull=e)}get convexHull(){return this._convexHull}set halfExtents(e){this._halfExtents=e,this.component&&(this.component.halfExtents=e)}get halfExtents(){return this._halfExtents}set height(e){this._height=e,this.component&&(this.component.height=e)}get height(){return this._height}set linearOffset(e){this._linearOffset=e,this.component&&(this.component.linearOffset=e)}get linearOffset(){return this._linearOffset}set radius(e){this._radius=e,this.component&&(this.component.radius=e)}get radius(){return this._radius}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}static get observedAttributes(){return[...super.observedAttributes,"angular-offset","axis","convex-hull","half-extents","height","linear-offset","radius","type"]}attributeChangedCallback(e,i,a){switch(super.attributeChangedCallback(e,i,a),e){case"angular-offset":this.angularOffset=(e=>{const[i,a,s]=e.split(" ").map(Number),n=new t.Quat;return n.setFromEulerAngles(i,a,s),n})(a);break;case"axis":this.axis=parseInt(a,10);break;case"convex-hull":this.convexHull=this.hasAttribute("convex-hull");break;case"half-extents":this.halfExtents=c(a);break;case"height":this.height=parseFloat(a);break;case"linear-offset":this.linearOffset=c(a);break;case"radius":this.radius=parseFloat(a);break;case"type":this.type=a}}}customElements.define("pc-collision",A);class x extends _{constructor(){super("element"),this._anchor=new t.Vec4(.5,.5,.5,.5),this._asset="",this._autoWidth=!0,this._autoHeight=!0,this._autoFitWidth=!1,this._autoFitHeight=!1,this._color=new t.Color(1,1,1,1),this._enableMarkup=!1,this._fontSize=32,this._maxFontSize=32,this._minFontSize=8,this._height=0,this._lineHeight=32,this._margin=null,this._mask=!1,this._opacity=1,this._pivot=new t.Vec2(.5,.5),this._pixelsPerUnit=null,this._spriteAsset="",this._spriteFrame=0,this._text="",this._textureAsset="",this._type="group",this._useInput=!1,this._width=0,this._wrapLines=!1}initComponent(){var e,t;const i=this.component;i&&((null===(e=i._text)||void 0===e?void 0:e._material)&&(i._text._material.useFog=!0),null===(t=i._dirtifyMask)||void 0===t||t.call(i))}getInitialComponentData(){const e={anchor:this._anchor,autoWidth:this._autoWidth,autoHeight:this._autoHeight,autoFitWidth:this._autoFitWidth,autoFitHeight:this._autoFitHeight,color:this._color,enableMarkup:this._enableMarkup,fontSize:this._fontSize,maxFontSize:this._maxFontSize,minFontSize:this._minFontSize,height:this._height,lineHeight:this._lineHeight,mask:this._mask,opacity:this._opacity,pivot:this._pivot,spriteFrame:this._spriteFrame,type:this._type,text:this._text,useInput:this._useInput,width:this._width,wrapLines:this._wrapLines},t=f.get(this._asset);t&&(e.fontAsset=t.id);const i=f.get(this._spriteAsset);i&&(e.spriteAsset=i.id);const a=f.get(this._textureAsset);return a&&(e.textureAsset=a.id),this._margin&&(e.margin=this._margin),null!==this._pixelsPerUnit&&(e.pixelsPerUnit=this._pixelsPerUnit),e}get component(){return super.component}set anchor(e){this._anchor=e,this.component&&(this.component.anchor=e)}get anchor(){return this._anchor}set asset(e){this._asset=e;const t=f.get(e);this.component&&t&&(this.component.fontAsset=t.id)}get asset(){return this._asset}set autoWidth(e){this._autoWidth=e,this.component&&(this.component.autoWidth=e)}get autoWidth(){return this._autoWidth}set autoHeight(e){this._autoHeight=e,this.component&&(this.component.autoHeight=e)}get autoHeight(){return this._autoHeight}set color(e){this._color=e,this.component&&(this.component.color=e)}get color(){return this._color}set enableMarkup(e){this._enableMarkup=e,this.component&&(this.component.enableMarkup=e)}get enableMarkup(){return this._enableMarkup}set fontSize(e){this._fontSize=e,this.component&&(this.component.fontSize=e)}get fontSize(){return this._fontSize}set height(e){this._height=e,this.component&&(this.component.height=e)}get height(){return this._height}set lineHeight(e){this._lineHeight=e,this.component&&(this.component.lineHeight=e)}get lineHeight(){return this._lineHeight}set margin(e){this._margin=e,this.component&&e&&(this.component.margin=e)}get margin(){return this._margin}set mask(e){this._mask=e,this.component&&(this.component.mask=e)}get mask(){return this._mask}set opacity(e){this._opacity=e,this.component&&(this.component.opacity=e)}get opacity(){return this._opacity}set pivot(e){this._pivot=e,this.component&&(this.component.pivot=e)}get pivot(){return this._pivot}set pixelsPerUnit(e){this._pixelsPerUnit=e,this.component&&null!==e&&(this.component.pixelsPerUnit=e)}get pixelsPerUnit(){return this._pixelsPerUnit}set spriteAsset(e){this._spriteAsset=e;const t=f.get(e);this.component&&t&&(this.component.spriteAsset=t.id)}get spriteAsset(){return this._spriteAsset}set spriteFrame(e){this._spriteFrame=e,this.component&&(this.component.spriteFrame=e)}get spriteFrame(){return this._spriteFrame}set text(e){this._text=e,this.component&&(this.component.text=e)}get text(){return this._text}set textureAsset(e){this._textureAsset=e;const t=f.get(e);this.component&&t&&(this.component.textureAsset=t.id)}get textureAsset(){return this._textureAsset}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}set useInput(e){this._useInput=e,this.component&&(this.component.useInput=e)}get useInput(){return this._useInput}set width(e){this._width=e,this.component&&(this.component.width=e)}get width(){return this._width}set wrapLines(e){this._wrapLines=e,this.component&&(this.component.wrapLines=e)}get wrapLines(){return this._wrapLines}set autoFitWidth(e){this._autoFitWidth=e,this.component&&(this.component.autoFitWidth=e)}get autoFitWidth(){return this._autoFitWidth}set autoFitHeight(e){this._autoFitHeight=e,this.component&&(this.component.autoFitHeight=e)}get autoFitHeight(){return this._autoFitHeight}set minFontSize(e){this._minFontSize=e,this.component&&(this.component.minFontSize=e)}get minFontSize(){return this._minFontSize}set maxFontSize(e){this._maxFontSize=e,this.component&&(this.component.maxFontSize=e)}get maxFontSize(){return this._maxFontSize}static get observedAttributes(){return[...super.observedAttributes,"anchor","asset","auto-width","auto-height","auto-fit-width","auto-fit-height","color","enable-markup","font-size","max-font-size","min-font-size","height","line-height","margin","mask","opacity","pivot","pixels-per-unit","sprite-asset","sprite-frame","text","texture-asset","type","use-input","width","wrap-lines"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"anchor":this.anchor=h(i);break;case"asset":this.asset=i;break;case"auto-width":this.autoWidth="false"!==i;break;case"auto-height":this.autoHeight="false"!==i;break;case"auto-fit-width":this.autoFitWidth="false"!==i;break;case"auto-fit-height":this.autoFitHeight="false"!==i;break;case"color":this.color=o(i);break;case"enable-markup":this.enableMarkup=this.hasAttribute(e);break;case"font-size":this.fontSize=Number(i);break;case"max-font-size":this.maxFontSize=Number(i);break;case"min-font-size":this.minFontSize=Number(i);break;case"height":this.height=Number(i);break;case"line-height":this.lineHeight=Number(i);break;case"margin":this.margin=h(i);break;case"mask":this.mask=this.hasAttribute(e);break;case"opacity":this.opacity=Number(i);break;case"pivot":this.pivot=r(i);break;case"pixels-per-unit":this.pixelsPerUnit=Number(i);break;case"sprite-asset":this.spriteAsset=i;break;case"sprite-frame":this.spriteFrame=Number(i);break;case"text":this.text=i;break;case"texture-asset":this.textureAsset=i;break;case"type":this.type=i;break;case"use-input":this.useInput=this.hasAttribute(e);break;case"width":this.width=Number(i);break;case"wrap-lines":this.wrapLines=this.hasAttribute(e)}}}customElements.define("pc-element",x);class F extends _{constructor(){super("layoutchild"),this._minWidth=0,this._minHeight=0,this._maxWidth=null,this._maxHeight=null,this._fitWidthProportion=0,this._fitHeightProportion=0,this._excludeFromLayout=!1}getInitialComponentData(){return{minWidth:this._minWidth,minHeight:this._minHeight,maxWidth:this._maxWidth,maxHeight:this._maxHeight,fitWidthProportion:this._fitWidthProportion,fitHeightProportion:this._fitHeightProportion,excludeFromLayout:this._excludeFromLayout}}get component(){return super.component}set minWidth(e){this._minWidth=e,this.component&&(this.component.minWidth=e)}get minWidth(){return this._minWidth}set minHeight(e){this._minHeight=e,this.component&&(this.component.minHeight=e)}get minHeight(){return this._minHeight}set maxWidth(e){this._maxWidth=e,this.component&&(this.component.maxWidth=e)}get maxWidth(){return this._maxWidth}set maxHeight(e){this._maxHeight=e,this.component&&(this.component.maxHeight=e)}get maxHeight(){return this._maxHeight}set fitWidthProportion(e){this._fitWidthProportion=e,this.component&&(this.component.fitWidthProportion=e)}get fitWidthProportion(){return this._fitWidthProportion}set fitHeightProportion(e){this._fitHeightProportion=e,this.component&&(this.component.fitHeightProportion=e)}get fitHeightProportion(){return this._fitHeightProportion}set excludeFromLayout(e){this._excludeFromLayout=e,this.component&&(this.component.excludeFromLayout=e)}get excludeFromLayout(){return this._excludeFromLayout}static get observedAttributes(){return[...super.observedAttributes,"min-width","min-height","max-width","max-height","fit-width-proportion","fit-height-proportion","exclude-from-layout"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"min-width":this.minWidth=Number(i);break;case"min-height":this.minHeight=Number(i);break;case"max-width":this.maxWidth=""===i?null:Number(i);break;case"max-height":this.maxHeight=""===i?null:Number(i);break;case"fit-width-proportion":this.fitWidthProportion=Number(i);break;case"fit-height-proportion":this.fitHeightProportion=Number(i);break;case"exclude-from-layout":this.excludeFromLayout="false"!==i}}}customElements.define("pc-layoutchild",F);const C=new Map([["horizontal",t.ORIENTATION_HORIZONTAL],["vertical",t.ORIENTATION_VERTICAL]]),E=new Map([["none",t.FITTING_NONE],["stretch",t.FITTING_STRETCH],["shrink",t.FITTING_SHRINK],["both",t.FITTING_BOTH]]);class j extends _{constructor(){super("layoutgroup"),this._orientation=t.ORIENTATION_HORIZONTAL,this._reverseX=!1,this._reverseY=!1,this._alignment=new t.Vec2(0,1),this._padding=new t.Vec4(0,0,0,0),this._spacing=new t.Vec2(0,0),this._widthFitting=t.FITTING_NONE,this._heightFitting=t.FITTING_NONE,this._wrap=!1}getInitialComponentData(){return{orientation:this._orientation,reverseX:this._reverseX,reverseY:this._reverseY,alignment:this._alignment,padding:this._padding,spacing:this._spacing,widthFitting:this._widthFitting,heightFitting:this._heightFitting,wrap:this._wrap}}get component(){return super.component}set orientation(e){this._orientation=e,this.component&&(this.component.orientation=e)}get orientation(){return this._orientation}set reverseX(e){this._reverseX=e,this.component&&(this.component.reverseX=e)}get reverseX(){return this._reverseX}set reverseY(e){this._reverseY=e,this.component&&(this.component.reverseY=e)}get reverseY(){return this._reverseY}set alignment(e){this._alignment=e,this.component&&(this.component.alignment=e)}get alignment(){return this._alignment}set padding(e){this._padding=e,this.component&&(this.component.padding=e)}get padding(){return this._padding}set spacing(e){this._spacing=e,this.component&&(this.component.spacing=e)}get spacing(){return this._spacing}set widthFitting(e){this._widthFitting=e,this.component&&(this.component.widthFitting=e)}get widthFitting(){return this._widthFitting}set heightFitting(e){this._heightFitting=e,this.component&&(this.component.heightFitting=e)}get heightFitting(){return this._heightFitting}set wrap(e){this._wrap=e,this.component&&(this.component.wrap=e)}get wrap(){return this._wrap}static get observedAttributes(){return[...super.observedAttributes,"orientation","reverse-x","reverse-y","alignment","padding","spacing","width-fitting","height-fitting","wrap"]}attributeChangedCallback(e,i,a){switch(super.attributeChangedCallback(e,i,a),e){case"orientation":this.orientation=b(a,C,t.ORIENTATION_HORIZONTAL);break;case"reverse-x":this.reverseX="false"!==a;break;case"reverse-y":this.reverseY="false"!==a;break;case"alignment":this.alignment=r(a);break;case"padding":this.padding=h(a);break;case"spacing":this.spacing=r(a);break;case"width-fitting":this.widthFitting=b(a,E,t.FITTING_NONE);break;case"height-fitting":this.heightFitting=b(a,E,t.FITTING_NONE);break;case"wrap":this.wrap="false"!==a}}}customElements.define("pc-layoutgroup",j);const O=new Map([["pcf1-16f",t.SHADOW_PCF1_16F],["pcf1-32f",t.SHADOW_PCF1_32F],["pcf3-16f",t.SHADOW_PCF3_16F],["pcf3-32f",t.SHADOW_PCF3_32F],["pcf5-16f",t.SHADOW_PCF5_16F],["pcf5-32f",t.SHADOW_PCF5_32F],["vsm-16f",t.SHADOW_VSM_16F],["vsm-32f",t.SHADOW_VSM_32F],["pcss-32f",t.SHADOW_PCSS_32F]]);class R extends _{constructor(){super("light"),this._castShadows=!1,this._color=new t.Color(1,1,1),this._innerConeAngle=40,this._intensity=1,this._normalOffsetBias=.05,this._outerConeAngle=45,this._range=10,this._shadowBias=.2,this._shadowDistance=16,this._shadowIntensity=1,this._shadowResolution=1024,this._shadowType="pcf3-32f",this._type="directional",this._vsmBias=.01,this._vsmBlurSize=11,this._penumbraSize=1,this._penumbraFalloff=1,this._shadowSamples=16,this._shadowBlockerSamples=16}getInitialComponentData(){return{castShadows:this._castShadows,color:this._color,innerConeAngle:this._innerConeAngle,intensity:this._intensity,normalOffsetBias:this._normalOffsetBias,outerConeAngle:this._outerConeAngle,penumbraFalloff:this._penumbraFalloff,penumbraSize:this._penumbraSize,range:this._range,shadowBias:this._shadowBias,shadowBlockerSamples:this._shadowBlockerSamples,shadowDistance:this._shadowDistance,shadowIntensity:this._shadowIntensity,shadowResolution:this._shadowResolution,shadowSamples:this._shadowSamples,shadowType:O.get(this._shadowType),type:this._type,vsmBias:this._vsmBias,vsmBlurSize:this._vsmBlurSize}}get component(){return super.component}set castShadows(e){this._castShadows=e,this.component&&(this.component.castShadows=e)}get castShadows(){return this._castShadows}set color(e){this._color=e,this.component&&(this.component.color=e)}get color(){return this._color}set innerConeAngle(e){this._innerConeAngle=e,this.component&&(this.component.innerConeAngle=e)}get innerConeAngle(){return this._innerConeAngle}set intensity(e){this._intensity=e,this.component&&(this.component.intensity=e)}get intensity(){return this._intensity}set normalOffsetBias(e){this._normalOffsetBias=e,this.component&&(this.component.normalOffsetBias=e)}get normalOffsetBias(){return this._normalOffsetBias}set outerConeAngle(e){this._outerConeAngle=e,this.component&&(this.component.outerConeAngle=e)}get outerConeAngle(){return this._outerConeAngle}set range(e){this._range=e,this.component&&(this.component.range=e)}get range(){return this._range}set shadowBias(e){this._shadowBias=e,this.component&&(this.component.shadowBias=e)}get shadowBias(){return this._shadowBias}set shadowDistance(e){this._shadowDistance=e,this.component&&(this.component.shadowDistance=e)}get shadowDistance(){return this._shadowDistance}set shadowIntensity(e){this._shadowIntensity=e,this.component&&(this.component.shadowIntensity=e)}get shadowIntensity(){return this._shadowIntensity}set shadowResolution(e){this._shadowResolution=e,this.component&&(this.component.shadowResolution=e)}get shadowResolution(){return this._shadowResolution}set shadowType(e){var i;this._shadowType=e,this.component&&(this.component.shadowType=null!==(i=O.get(e))&&void 0!==i?i:t.SHADOW_PCF3_32F)}get shadowType(){return this._shadowType}set type(e){["directional","omni","spot"].includes(e)?(this._type=e,this.component&&(this.component.type=e)):console.warn(`Invalid light type '${e}', using default type '${this._type}'.`)}get type(){return this._type}set vsmBias(e){this._vsmBias=e,this.component&&(this.component.vsmBias=e)}get vsmBias(){return this._vsmBias}set vsmBlurSize(e){this._vsmBlurSize=e,this.component&&(this.component.vsmBlurSize=e)}get vsmBlurSize(){return this._vsmBlurSize}set penumbraSize(e){this._penumbraSize=e,this.component&&(this.component.penumbraSize=e)}get penumbraSize(){return this._penumbraSize}set penumbraFalloff(e){this._penumbraFalloff=e,this.component&&(this.component.penumbraFalloff=e)}get penumbraFalloff(){return this._penumbraFalloff}set shadowSamples(e){this._shadowSamples=e,this.component&&(this.component.shadowSamples=e)}get shadowSamples(){return this._shadowSamples}set shadowBlockerSamples(e){this._shadowBlockerSamples=e,this.component&&(this.component.shadowBlockerSamples=e)}get shadowBlockerSamples(){return this._shadowBlockerSamples}static get observedAttributes(){return[...super.observedAttributes,"color","cast-shadows","intensity","inner-cone-angle","normal-offset-bias","outer-cone-angle","penumbra-falloff","penumbra-size","range","shadow-bias","shadow-blocker-samples","shadow-distance","shadow-intensity","shadow-resolution","shadow-samples","shadow-type","type","vsm-bias","vsm-blur-size"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"color":this.color=o(i);break;case"cast-shadows":this.castShadows=this.hasAttribute("cast-shadows");break;case"inner-cone-angle":this.innerConeAngle=Number(i);break;case"intensity":this.intensity=Number(i);break;case"normal-offset-bias":this.normalOffsetBias=Number(i);break;case"outer-cone-angle":this.outerConeAngle=Number(i);break;case"penumbra-falloff":this.penumbraFalloff=Number(i);break;case"penumbra-size":this.penumbraSize=Number(i);break;case"range":this.range=Number(i);break;case"shadow-bias":this.shadowBias=Number(i);break;case"shadow-distance":this.shadowDistance=Number(i);break;case"shadow-blocker-samples":this.shadowBlockerSamples=Number(i);break;case"shadow-resolution":this.shadowResolution=Number(i);break;case"shadow-intensity":this.shadowIntensity=Number(i);break;case"shadow-samples":this.shadowSamples=Number(i);break;case"shadow-type":this.shadowType=i;break;case"type":this.type=i;break;case"vsm-bias":this.vsmBias=Number(i);break;case"vsm-blur-size":this.vsmBlurSize=Number(i)}}}customElements.define("pc-light",R);class z extends _{constructor(){super("particlesystem"),this._asset=""}getInitialComponentData(){var e;const t=f.get(this._asset);if(!t)return{};if(t.resource.colorMapAsset){const i=t.resource.colorMapAsset,a=null===(e=f.get(i))||void 0===e?void 0:e.id;a&&(t.resource.colorMapAsset=a)}return t.resource}get component(){return super.component}applyConfig(e){if(this.component)for(const t in e)e.hasOwnProperty(t)&&(this.component[t]=e[t])}async _loadAsset(){var e;const t=await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),i=null==t?void 0:t.app,a=f.get(this._asset);a&&(a.loaded?this.applyConfig(a.resource):(a.once("load",()=>{this.applyConfig(a.resource)}),i.assets.load(a)))}set asset(e){this._asset=e,this.isConnected&&this._loadAsset()}get asset(){return this._asset}play(){this.component&&this.component.play()}pause(){this.component&&this.component.pause()}reset(){this.component&&this.component.reset()}stop(){this.component&&this.component.stop()}static get observedAttributes(){return[...super.observedAttributes,"asset"]}attributeChangedCallback(e,t,i){if(super.attributeChangedCallback(e,t,i),"asset"===e)this.asset=i}}customElements.define("pc-particles",z);class H extends HTMLElement{constructor(){super(...arguments),this._diffuse=new t.Color(1,1,1),this._diffuseMap="",this._metalnessMap="",this._normalMap="",this._roughnessMap="",this.material=null}createMaterial(){this.material=new t.StandardMaterial,this.material.glossInvert=!1,this.material.useMetalness=!1,this.material.diffuse=this._diffuse,this.diffuseMap=this._diffuseMap,this.metalnessMap=this._metalnessMap,this.normalMap=this._normalMap,this.roughnessMap=this._roughnessMap,this.material.update()}disconnectedCallback(){this.material&&(this.material.destroy(),this.material=null)}setMap(e,t){if(this.material){const i=f.get(e);i&&(i.loaded?(this.material[t]=i.resource,this.material[t].anisotropy=4):i.once("load",()=>{this.material[t]=i.resource,this.material[t].anisotropy=4,this.material.update()}))}}set diffuse(e){this._diffuse=e,this.material&&(this.material.diffuse=e)}get diffuse(){return this._diffuse}set diffuseMap(e){this._diffuseMap=e,this.setMap(e,"diffuseMap")}get diffuseMap(){return this._diffuseMap}set metalnessMap(e){this._metalnessMap=e,this.setMap(e,"metalnessMap")}get metalnessMap(){return this._metalnessMap}set normalMap(e){this._normalMap=e,this.setMap(e,"normalMap")}get normalMap(){return this._normalMap}set roughnessMap(e){this._roughnessMap=e,this.setMap(e,"glossMap")}get roughnessMap(){return this._roughnessMap}static get(e){const t=document.querySelector(`pc-material[id="${e}"]`);return null==t?void 0:t.material}static get observedAttributes(){return["diffuse","diffuse-map","metalness-map","normal-map","roughness-map"]}attributeChangedCallback(e,t,i){switch(e){case"diffuse":this.diffuse=o(i);break;case"diffuse-map":this.diffuseMap=i;break;case"metalness-map":this.metalnessMap=i;break;case"normal-map":this.normalMap=i;break;case"roughness-map":this.roughnessMap=i}}}customElements.define("pc-material",H);class M extends _{constructor(){super("render"),this._castShadows=!0,this._material="",this._receiveShadows=!0,this._type="asset"}getInitialComponentData(){return{type:this._type,castShadows:this._castShadows,material:H.get(this._material),receiveShadows:this._receiveShadows}}get component(){return super.component}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}set castShadows(e){this._castShadows=e,this.component&&(this.component.castShadows=e)}get castShadows(){return this._castShadows}set material(e){this._material=e,this.component&&(this.component.material=H.get(e))}get material(){return this._material}set receiveShadows(e){this._receiveShadows=e,this.component&&(this.component.receiveShadows=e)}get receiveShadows(){return this._receiveShadows}static get observedAttributes(){return[...super.observedAttributes,"cast-shadows","material","receive-shadows","type"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"cast-shadows":this.castShadows="false"!==i;break;case"material":this.material=i;break;case"receive-shadows":this.receiveShadows="false"!==i;break;case"type":this.type=i}}}customElements.define("pc-render",M);class P extends _{constructor(){super("rigidbody"),this._angularDamping=0,this._angularFactor=new t.Vec3(1,1,1),this._friction=.5,this._linearDamping=0,this._linearFactor=new t.Vec3(1,1,1),this._mass=1,this._restitution=0,this._rollingFriction=0,this._type="static"}getInitialComponentData(){return{angularDamping:this._angularDamping,angularFactor:this._angularFactor,friction:this._friction,linearDamping:this._linearDamping,linearFactor:this._linearFactor,mass:this._mass,restitution:this._restitution,rollingFriction:this._rollingFriction,type:this._type}}get component(){return super.component}set angularDamping(e){this._angularDamping=e,this.component&&(this.component.angularDamping=e)}get angularDamping(){return this._angularDamping}set angularFactor(e){this._angularFactor=e,this.component&&(this.component.angularFactor=e)}get angularFactor(){return this._angularFactor}set friction(e){this._friction=e,this.component&&(this.component.friction=e)}get friction(){return this._friction}set linearDamping(e){this._linearDamping=e,this.component&&(this.component.linearDamping=e)}get linearDamping(){return this._linearDamping}set linearFactor(e){this._linearFactor=e,this.component&&(this.component.linearFactor=e)}get linearFactor(){return this._linearFactor}set mass(e){this._mass=e,this.component&&(this.component.mass=e)}get mass(){return this._mass}set restitution(e){this._restitution=e,this.component&&(this.component.restitution=e)}get restitution(){return this._restitution}set rollingFriction(e){this._rollingFriction=e,this.component&&(this.component.rollingFriction=e)}get rollingFriction(){return this._rollingFriction}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}static get observedAttributes(){return[...super.observedAttributes,"angular-damping","angular-factor","friction","linear-damping","linear-factor","mass","restitution","rolling-friction","type"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"angular-damping":this.angularDamping=parseFloat(i);break;case"angular-factor":this.angularFactor=c(i);break;case"friction":this.friction=parseFloat(i);break;case"linear-damping":this.linearDamping=parseFloat(i);break;case"linear-factor":this.linearFactor=c(i);break;case"mass":this.mass=parseFloat(i);break;case"restitution":this.restitution=parseFloat(i);break;case"rolling-friction":this.rollingFriction=parseFloat(i);break;case"type":this.type=i}}}customElements.define("pc-rigidbody",P);class D extends _{constructor(){super("screen"),this._screenSpace=!1,this._resolution=new t.Vec2(640,320),this._referenceResolution=new t.Vec2(640,320),this._priority=0,this._blend=!1,this._scaleBlend=.5}getInitialComponentData(){return{priority:this._priority,referenceResolution:this._referenceResolution,resolution:this._resolution,scaleBlend:this._scaleBlend,scaleMode:this._blend?t.SCALEMODE_BLEND:t.SCALEMODE_NONE,screenSpace:this._screenSpace}}get component(){return super.component}set priority(e){this._priority=e,this.component&&(this.component.priority=this._priority)}get priority(){return this._priority}set referenceResolution(e){this._referenceResolution=e,this.component&&(this.component.referenceResolution=this._referenceResolution)}get referenceResolution(){return this._referenceResolution}set resolution(e){this._resolution=e,this.component&&(this.component.resolution=this._resolution)}get resolution(){return this._resolution}set scaleBlend(e){this._scaleBlend=e,this.component&&(this.component.scaleBlend=this._scaleBlend)}get scaleBlend(){return this._scaleBlend}set blend(e){this._blend=e,this.component&&(this.component.scaleMode=this._blend?t.SCALEMODE_BLEND:t.SCALEMODE_NONE)}get blend(){return this._blend}set screenSpace(e){this._screenSpace=e,this.component&&(this.component.screenSpace=this._screenSpace)}get screenSpace(){return this._screenSpace}static get observedAttributes(){return[...super.observedAttributes,"blend","screen-space","resolution","reference-resolution","priority","scale-blend"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"priority":this.priority=parseInt(i,10);break;case"reference-resolution":this.referenceResolution=r(i);break;case"resolution":this.resolution=r(i);break;case"scale-blend":this.scaleBlend=parseFloat(i);break;case"blend":this.blend=this.hasAttribute("blend");break;case"screen-space":this.screenSpace=this.hasAttribute("screen-space")}}}customElements.define("pc-screen",D);const T=new Map([["horizontal",t.ORIENTATION_HORIZONTAL],["vertical",t.ORIENTATION_VERTICAL]]);class B extends _{constructor(){super("scrollbar"),this._orientation=t.ORIENTATION_HORIZONTAL,this._value=0,this._handleSize=.5,this._handle=""}getInitialComponentData(){const e={orientation:this._orientation,value:this._value,handleSize:this._handleSize},t=l(this._handle);return t&&(e.handleEntity=t),e}get component(){return super.component}set orientation(e){this._orientation=e,this.component&&(this.component.orientation=e)}get orientation(){return this._orientation}set value(e){this._value=e,this.component&&(this.component.value=e)}get value(){return this._value}set handleSize(e){this._handleSize=e,this.component&&(this.component.handleSize=e)}get handleSize(){return this._handleSize}set handle(e){this._handle=e;const t=l(e);this.component&&t&&(this.component.handleEntity=t)}get handle(){return this._handle}static get observedAttributes(){return[...super.observedAttributes,"orientation","value","handle-size","handle"]}attributeChangedCallback(e,i,a){switch(super.attributeChangedCallback(e,i,a),e){case"orientation":this.orientation=b(a,T,t.ORIENTATION_HORIZONTAL);break;case"value":this.value=Number(a);break;case"handle-size":this.handleSize=Number(a);break;case"handle":this.handle=a}}}customElements.define("pc-scrollbar",B);const G=new Map([["clamp",t.SCROLL_MODE_CLAMP],["bounce",t.SCROLL_MODE_BOUNCE],["infinite",t.SCROLL_MODE_INFINITE]]),N=new Map([["always",t.SCROLLBAR_VISIBILITY_SHOW_ALWAYS],["when-required",t.SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIRED]]);class L extends _{constructor(){super("scrollview"),this._horizontal=!0,this._vertical=!0,this._scrollMode=t.SCROLL_MODE_BOUNCE,this._bounceAmount=.1,this._friction=.05,this._useMouseWheel=!0,this._mouseWheelSensitivity=new t.Vec2(1,1),this._horizontalScrollbarVisibility=t.SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIRED,this._verticalScrollbarVisibility=t.SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIRED,this._viewport="",this._content="",this._horizontalScrollbar="",this._verticalScrollbar=""}getInitialComponentData(){const e={horizontal:this._horizontal,vertical:this._vertical,scrollMode:this._scrollMode,bounceAmount:this._bounceAmount,friction:this._friction,useMouseWheel:this._useMouseWheel,mouseWheelSensitivity:this._mouseWheelSensitivity,horizontalScrollbarVisibility:this._horizontalScrollbarVisibility,verticalScrollbarVisibility:this._verticalScrollbarVisibility},t=l(this._viewport);t&&(e.viewportEntity=t);const i=l(this._content);i&&(e.contentEntity=i);const a=l(this._horizontalScrollbar);a&&(e.horizontalScrollbarEntity=a);const s=l(this._verticalScrollbar);return s&&(e.verticalScrollbarEntity=s),e}get component(){return super.component}set horizontal(e){this._horizontal=e,this.component&&(this.component.horizontal=e)}get horizontal(){return this._horizontal}set vertical(e){this._vertical=e,this.component&&(this.component.vertical=e)}get vertical(){return this._vertical}set scrollMode(e){this._scrollMode=e,this.component&&(this.component.scrollMode=e)}get scrollMode(){return this._scrollMode}set bounceAmount(e){this._bounceAmount=e,this.component&&(this.component.bounceAmount=e)}get bounceAmount(){return this._bounceAmount}set friction(e){this._friction=e,this.component&&(this.component.friction=e)}get friction(){return this._friction}set useMouseWheel(e){this._useMouseWheel=e,this.component&&(this.component.useMouseWheel=e)}get useMouseWheel(){return this._useMouseWheel}set mouseWheelSensitivity(e){this._mouseWheelSensitivity=e,this.component&&(this.component.mouseWheelSensitivity=e)}get mouseWheelSensitivity(){return this._mouseWheelSensitivity}set horizontalScrollbarVisibility(e){this._horizontalScrollbarVisibility=e,this.component&&(this.component.horizontalScrollbarVisibility=e)}get horizontalScrollbarVisibility(){return this._horizontalScrollbarVisibility}set verticalScrollbarVisibility(e){this._verticalScrollbarVisibility=e,this.component&&(this.component.verticalScrollbarVisibility=e)}get verticalScrollbarVisibility(){return this._verticalScrollbarVisibility}set viewport(e){this._viewport=e;const t=l(e);this.component&&t&&(this.component.viewportEntity=t)}get viewport(){return this._viewport}set content(e){this._content=e;const t=l(e);this.component&&t&&(this.component.contentEntity=t)}get content(){return this._content}set horizontalScrollbar(e){this._horizontalScrollbar=e;const t=l(e);this.component&&t&&(this.component.horizontalScrollbarEntity=t)}get horizontalScrollbar(){return this._horizontalScrollbar}set verticalScrollbar(e){this._verticalScrollbar=e;const t=l(e);this.component&&t&&(this.component.verticalScrollbarEntity=t)}get verticalScrollbar(){return this._verticalScrollbar}static get observedAttributes(){return[...super.observedAttributes,"horizontal","vertical","scroll-mode","bounce-amount","friction","use-mouse-wheel","mouse-wheel-sensitivity","horizontal-scrollbar-visibility","vertical-scrollbar-visibility","viewport","content","horizontal-scrollbar","vertical-scrollbar"]}attributeChangedCallback(e,i,a){switch(super.attributeChangedCallback(e,i,a),e){case"horizontal":this.horizontal="false"!==a;break;case"vertical":this.vertical="false"!==a;break;case"scroll-mode":this.scrollMode=b(a,G,t.SCROLL_MODE_BOUNCE);break;case"bounce-amount":this.bounceAmount=Number(a);break;case"friction":this.friction=Number(a);break;case"use-mouse-wheel":this.useMouseWheel="false"!==a;break;case"mouse-wheel-sensitivity":this.mouseWheelSensitivity=r(a);break;case"horizontal-scrollbar-visibility":this.horizontalScrollbarVisibility=b(a,N,t.SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIRED);break;case"vertical-scrollbar-visibility":this.verticalScrollbarVisibility=b(a,N,t.SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIRED);break;case"viewport":this.viewport=a;break;case"content":this.content=a;break;case"horizontal-scrollbar":this.horizontalScrollbar=a;break;case"vertical-scrollbar":this.verticalScrollbar=a}}}customElements.define("pc-scrollview",L);class W extends _{constructor(){super("script"),this.observer=new MutationObserver(this.handleMutations.bind(this)),this.observer.observe(this,{childList:!0}),this.addEventListener("scriptattributeschange",this.handleScriptAttributesChange.bind(this)),this.addEventListener("scriptenablechange",this.handleScriptEnableChange.bind(this))}initComponent(){this.querySelectorAll(":scope > pc-script").forEach(e=>{const t=e.getAttribute("name"),i=e.getAttribute("attributes");t&&this.createScript(t,i)})}convertAttributes(e){if("string"==typeof e){if(e.startsWith("asset:")){const t=e.slice(6),i=document.querySelector(`pc-asset#${t}`);if(i)return i.asset}if(e.startsWith("entity:")){const t=e.slice(7),i=document.querySelector(`pc-entity[name="${t}"]`);if(i)return i.entity}if(e.startsWith("vec2:")){const i=e.slice(5).split(",").map(Number);if(2===i.length&&i.every(e=>!isNaN(e)))return new t.Vec2(i[0],i[1])}if(e.startsWith("vec3:")){const i=e.slice(5).split(",").map(Number);if(3===i.length&&i.every(e=>!isNaN(e)))return new t.Vec3(i[0],i[1],i[2])}if(e.startsWith("vec4:")){const i=e.slice(5).split(",").map(Number);if(4===i.length&&i.every(e=>!isNaN(e)))return new t.Vec4(i[0],i[1],i[2],i[3])}if(e.startsWith("color:")){const i=e.slice(6).split(",").map(Number);if(4===i.length&&i.every(e=>!isNaN(e)))return new t.Color(i[0],i[1],i[2],i[3])}return e}if(Array.isArray(e))return e.length>0&&e[0],e.map(e=>this.convertAttributes(e));if(e&&"object"==typeof e){const t={};for(const i in e)t[i]=this.convertAttributes(e[i]);return t}return e}preprocessAttributes(e){return this.convertAttributes(e)}mergeDeep(e,t){for(const i in t)t[i]&&"object"==typeof t[i]&&!Array.isArray(t[i])?(e[i]&&"object"==typeof e[i]||(e[i]={}),this.mergeDeep(e[i],t[i])):e[i]=t[i];return e}applyAttributes(e,t){try{const i=t?JSON.parse(t):{},a=this.convertAttributes(i);this.mergeDeep(e,a)}catch(e){console.error(`Error parsing attributes JSON string ${t}:`,e)}}handleScriptAttributesChange(e){const t=e.target.getAttribute("name");if(!t||!this.component)return;const i=this.component.get(t);i&&this.applyAttributes(i,e.detail.attributes)}handleScriptEnableChange(e){const t=e.target.getAttribute("name");if(!t||!this.component)return;const i=this.component.get(t);i&&(i.enabled=e.detail.enabled)}createScript(e,t){if(!this.component)return null;let i={};if(t)try{i=JSON.parse(t),i=this.preprocessAttributes(i)}catch(e){console.error(`Error parsing attributes JSON string ${t}:`,e)}return this.component.create(e,{properties:i})}destroyScript(e){this.component&&this.component.destroy(e)}handleMutations(e){for(const t of e)t.addedNodes.forEach(e=>{if(e instanceof HTMLElement&&"pc-script"===e.tagName.toLowerCase()){const t=e.getAttribute("name"),i=e.getAttribute("attributes");t&&this.createScript(t,i)}}),t.removedNodes.forEach(e=>{if(e instanceof HTMLElement&&"pc-script"===e.tagName.toLowerCase()){const t=e.getAttribute("name");t&&this.destroyScript(t)}})}disconnectedCallback(){var e;this.observer.disconnect(),null===(e=super.disconnectedCallback)||void 0===e||e.call(this)}get component(){return super.component}}customElements.define("pc-scripts",W);class q extends HTMLElement{constructor(){super(...arguments),this._attributes="{}",this._enabled=!0,this._name=""}set scriptAttributes(e){this._attributes=e,this.dispatchEvent(new CustomEvent("scriptattributeschange",{detail:{attributes:e},bubbles:!0}))}get scriptAttributes(){return this._attributes}set enabled(e){this._enabled=e,this.dispatchEvent(new CustomEvent("scriptenablechange",{detail:{enabled:e},bubbles:!0}))}get enabled(){return this._enabled}set name(e){this._name=e}get name(){return this._name}static get observedAttributes(){return["attributes","enabled","name"]}attributeChangedCallback(e,t,i){switch(e){case"attributes":this.scriptAttributes=i;break;case"enabled":this.enabled="false"!==i;break;case"name":this.name=i}}}customElements.define("pc-script",q);class I extends _{constructor(){super("sound"),this._distanceModel="linear",this._maxDistance=1e4,this._pitch=1,this._positional=!1,this._refDistance=1,this._rollOffFactor=1,this._volume=1}getInitialComponentData(){return{distanceModel:this._distanceModel,maxDistance:this._maxDistance,pitch:this._pitch,positional:this._positional,refDistance:this._refDistance,rollOffFactor:this._rollOffFactor,volume:this._volume}}get component(){return super.component}set distanceModel(e){this._distanceModel=e,this.component&&(this.component.distanceModel=e)}get distanceModel(){return this._distanceModel}set maxDistance(e){this._maxDistance=e,this.component&&(this.component.maxDistance=e)}get maxDistance(){return this._maxDistance}set pitch(e){this._pitch=e,this.component&&(this.component.pitch=e)}get pitch(){return this._pitch}set positional(e){this._positional=e,this.component&&(this.component.positional=e)}get positional(){return this._positional}set refDistance(e){this._refDistance=e,this.component&&(this.component.refDistance=e)}get refDistance(){return this._refDistance}set rollOffFactor(e){this._rollOffFactor=e,this.component&&(this.component.rollOffFactor=e)}get rollOffFactor(){return this._rollOffFactor}set volume(e){this._volume=e,this.component&&(this.component.volume=e)}get volume(){return this._volume}static get observedAttributes(){return[...super.observedAttributes,"distance-model","max-distance","pitch","positional","ref-distance","roll-off-factor","volume"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"distance-model":this.distanceModel=i;break;case"max-distance":this.maxDistance=parseFloat(i);break;case"pitch":this.pitch=parseFloat(i);break;case"positional":this.positional=this.hasAttribute("positional");break;case"ref-distance":this.refDistance=parseFloat(i);break;case"roll-off-factor":this.rollOffFactor=parseFloat(i);break;case"volume":this.volume=parseFloat(i)}}}customElements.define("pc-sounds",I);class Q extends i{constructor(){super(...arguments),this._asset="",this._autoPlay=!1,this._duration=null,this._loop=!1,this._name="",this._overlap=!1,this._pitch=1,this._startTime=0,this._volume=1,this.soundSlot=null}async connectedCallback(){var e;await(null===(e=this.soundElement)||void 0===e?void 0:e.ready());const t={autoPlay:this._autoPlay,loop:this._loop,overlap:this._overlap,pitch:this._pitch,startTime:this._startTime,volume:this._volume};this._duration&&(t.duration=this._duration),this.soundSlot=this.soundElement.component.addSlot(this._name,t),this.asset=this._asset,this._autoPlay&&this.soundSlot.play(),this._onReady()}disconnectedCallback(){this.soundElement.component.removeSlot(this._name)}get soundElement(){const e=this.parentElement;return e instanceof I?e:(console.warn("pc-sound-slot must be a direct child of a pc-sound element"),null)}set asset(e){var t;if(this._asset=e,this.soundSlot){const i=null===(t=f.get(e))||void 0===t?void 0:t.id;i&&(this.soundSlot.asset=i)}}get asset(){return this._asset}set autoPlay(e){this._autoPlay=e,this.soundSlot&&(this.soundSlot.autoPlay=e)}get autoPlay(){return this._autoPlay}set duration(e){this._duration=e,this.soundSlot&&(this.soundSlot.duration=e)}get duration(){return this._duration}set loop(e){this._loop=e,this.soundSlot&&(this.soundSlot.loop=e)}get loop(){return this._loop}set name(e){this._name=e,this.soundSlot&&(this.soundSlot.name=e)}get name(){return this._name}set overlap(e){this._overlap=e,this.soundSlot&&(this.soundSlot.overlap=e)}get overlap(){return this._overlap}set pitch(e){this._pitch=e,this.soundSlot&&(this.soundSlot.pitch=e)}get pitch(){return this._pitch}set startTime(e){this._startTime=e,this.soundSlot&&(this.soundSlot.startTime=e)}get startTime(){return this._startTime}set volume(e){this._volume=e,this.soundSlot&&(this.soundSlot.volume=e)}get volume(){return this._volume}static get observedAttributes(){return["asset","auto-play","duration","loop","name","overlap","pitch","start-time","volume"]}attributeChangedCallback(e,t,i){switch(e){case"asset":this.asset=i;break;case"auto-play":this.autoPlay=this.hasAttribute("auto-play");break;case"duration":this.duration=parseFloat(i);break;case"loop":this.loop=this.hasAttribute("loop");break;case"name":this.name=i;break;case"overlap":this.overlap=this.hasAttribute("overlap");break;case"pitch":this.pitch=parseFloat(i);break;case"start-time":this.startTime=parseFloat(i);break;case"volume":this.volume=parseFloat(i)}}}customElements.define("pc-sound",Q);class K extends _{constructor(){super("gsplat"),this._asset="",this._castShadows=!1,this._lodBaseDistance=5,this._lodMultiplier=3,this._lodRangeMin=0,this._lodRangeMax=99}getInitialComponentData(){return{asset:f.get(this._asset),castShadows:this._castShadows,lodBaseDistance:this._lodBaseDistance,lodMultiplier:this._lodMultiplier,lodRangeMin:this._lodRangeMin,lodRangeMax:this._lodRangeMax}}get component(){return super.component}set asset(e){this._asset=e;const t=f.get(e);this.component&&t&&(this.component.asset=t)}get asset(){return this._asset}set castShadows(e){this._castShadows=e,this.component&&(this.component.castShadows=e)}get castShadows(){return this._castShadows}set lodBaseDistance(e){this._lodBaseDistance=e,this.component&&(this.component.lodBaseDistance=e)}get lodBaseDistance(){return this._lodBaseDistance}set lodMultiplier(e){this._lodMultiplier=e,this.component&&(this.component.lodMultiplier=e)}get lodMultiplier(){return this._lodMultiplier}set lodRangeMin(e){this._lodRangeMin=e,this.component&&(this.component.lodRangeMin=e)}get lodRangeMin(){return this._lodRangeMin}set lodRangeMax(e){this._lodRangeMax=e,this.component&&(this.component.lodRangeMax=e)}get lodRangeMax(){return this._lodRangeMax}static get observedAttributes(){return[...super.observedAttributes,"asset","cast-shadows","lod-base-distance","lod-multiplier","lod-range-min","lod-range-max"]}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case"asset":this.asset=i;break;case"cast-shadows":this.castShadows=this.hasAttribute("cast-shadows");break;case"lod-base-distance":this.lodBaseDistance=Number(i);break;case"lod-multiplier":this.lodMultiplier=Number(i);break;case"lod-range-min":this.lodRangeMin=Number(i);break;case"lod-range-max":this.lodRangeMax=Number(i)}}}customElements.define("pc-gsplat",K);class V extends i{constructor(){super(...arguments),this._asset="",this._entity=null}connectedCallback(){this._loadModel(),this._onReady()}disconnectedCallback(){this._unloadModel()}_instantiate(e){this._entity=e.instantiateRenderEntity(),e.animations.length>0&&(this._entity.addComponent("anim"),this._entity.anim.assignAnimation("animation",e.animations[0].resource));const t=this.closestEntity;if(t)t.ready().then(()=>{t.entity.addChild(this._entity)});else{const e=this.closestApp;e&&e.ready().then(()=>{e.app.root.addChild(this._entity)})}}async _loadModel(){var e;this._unloadModel();const t=await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),i=null==t?void 0:t.app,a=f.get(this._asset);a&&(a.loaded?this._instantiate(a.resource):(a.once("load",()=>{this._instantiate(a.resource)}),i.assets.load(a)))}_unloadModel(){var e;null===(e=this._entity)||void 0===e||e.destroy(),this._entity=null}set asset(e){this._asset=e,this.isConnected&&this._loadModel()}get asset(){return this._asset}static get observedAttributes(){return["asset"]}attributeChangedCallback(e,t,i){if("asset"===e)this.asset=i}}customElements.define("pc-model",V);class J extends i{constructor(){super(...arguments),this._fog="none",this._fogColor=new t.Color(1,1,1),this._fogDensity=0,this._fogStart=0,this._fogEnd=1e3,this._gravity=new t.Vec3(0,-9.81,0),this.scene=null}async connectedCallback(){var e;await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),this.scene=this.closestApp.app.scene,this.updateSceneSettings(),this._onReady()}updateSceneSettings(){if(this.scene){this.scene.fog.type=this._fog,this.scene.fog.color=this._fogColor,this.scene.fog.density=this._fogDensity,this.scene.fog.start=this._fogStart,this.scene.fog.end=this._fogEnd;this.parentElement.app.systems.rigidbody.gravity.copy(this._gravity)}}set fog(e){this._fog=e,this.scene&&(this.scene.fog.type=e)}get fog(){return this._fog}set fogColor(e){this._fogColor=e,this.scene&&(this.scene.fog.color=e)}get fogColor(){return this._fogColor}set fogDensity(e){this._fogDensity=e,this.scene&&(this.scene.fog.density=e)}get fogDensity(){return this._fogDensity}set fogStart(e){this._fogStart=e,this.scene&&(this.scene.fog.start=e)}get fogStart(){return this._fogStart}set fogEnd(e){this._fogEnd=e,this.scene&&(this.scene.fog.end=e)}get fogEnd(){return this._fogEnd}set gravity(e){if(this._gravity=e,this.scene){this.parentElement.app.systems.rigidbody.gravity.copy(e)}}get gravity(){return this._gravity}static get observedAttributes(){return["fog","fog-color","fog-density","fog-start","fog-end","gravity"]}attributeChangedCallback(e,t,i){switch(e){case"fog":this.fog=i;break;case"fog-color":this.fogColor=o(i);break;case"fog-density":this.fogDensity=parseFloat(i);break;case"fog-start":this.fogStart=parseFloat(i);break;case"fog-end":this.fogEnd=parseFloat(i);break;case"gravity":this.gravity=c(i)}}}customElements.define("pc-scene",J);class U extends i{constructor(){super(...arguments),this._asset="",this._center=new t.Vec3(0,.01,0),this._intensity=1,this._rotation=new t.Vec3,this._level=0,this._lighting=!1,this._scale=new t.Vec3(100,100,100),this._type="infinite",this._scene=null}connectedCallback(){this._loadSkybox(),this._onReady()}disconnectedCallback(){this._unloadSkybox()}_generateSkybox(e){if(!this._scene)return;const i=e.resource,a=t.EnvLighting.generateSkyboxCubemap(i);if(a.anisotropy=4,this._scene.skybox=a,this._lighting){const e=t.EnvLighting.generateLightingSource(i),a=t.EnvLighting.generateAtlas(e);this._scene.envAtlas=a}const s=this._scene.layers.getLayerById(t.LAYERID_SKYBOX);s&&(s.enabled="none"!==this._type),this._scene.sky.type=this._type,this._scene.sky.node.setLocalScale(this._scale),this._scene.sky.center=this._center,this._scene.skyboxIntensity=this._intensity,this._scene.skyboxMip=this._level}async _loadSkybox(){var e;const t=await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),i=null==t?void 0:t.app;if(!i)return;const a=f.get(this._asset);a&&(this._scene=i.scene,a.loaded?this._generateSkybox(a):(a.once("load",()=>{this._generateSkybox(a)}),i.assets.load(a)))}_unloadSkybox(){var e,t;this._scene&&(null===(e=this._scene.skybox)||void 0===e||e.destroy(),this._scene.skybox=null,null===(t=this._scene.envAtlas)||void 0===t||t.destroy(),this._scene.envAtlas=null,this._scene=null)}set asset(e){this._asset=e,this.isConnected&&this._loadSkybox()}get asset(){return this._asset}set center(e){this._center=e,this._scene&&(this._scene.sky.center=this._center)}get center(){return this._center}set intensity(e){this._intensity=e,this._scene&&(this._scene.skyboxIntensity=this._intensity)}get intensity(){return this._intensity}set level(e){this._level=e,this._scene&&(this._scene.skyboxMip=this._level)}get level(){return this._level}set lighting(e){this._lighting=e}get lighting(){return this._lighting}set rotation(e){this._rotation=e,this._scene&&(this._scene.skyboxRotation=(new t.Quat).setFromEulerAngles(e))}get rotation(){return this._rotation}set scale(e){this._scale=e,this._scene&&this._scene.sky.node.setLocalScale(this._scale)}get scale(){return this._scale}set type(e){if(this._type=e,this._scene){this._scene.sky.type=this._type;const e=this._scene.layers.getLayerById(t.LAYERID_SKYBOX);e&&(e.enabled="none"!==this._type)}}get type(){return this._type}static get observedAttributes(){return["asset","center","intensity","level","lighting","rotation","scale","type"]}attributeChangedCallback(e,t,i){switch(e){case"asset":this.asset=i;break;case"center":this.center=c(i);break;case"intensity":this.intensity=parseFloat(i);break;case"level":this.level=parseInt(i,10);break;case"lighting":this.lighting=this.hasAttribute(e);break;case"rotation":this.rotation=c(i);break;case"scale":this.scale=c(i);break;case"type":this.type=i}}}customElements.define("pc-sky",U),e.AppElement=s,e.AssetElement=f,e.AsyncElement=i,e.ButtonComponentElement=y,e.CameraComponentElement=S,e.CollisionComponentElement=A,e.ComponentElement=_,e.ElementComponentElement=x,e.EntityElement=p,e.GSplatComponentElement=K,e.LayoutChildComponentElement=F,e.LayoutGroupComponentElement=j,e.LightComponentElement=R,e.ListenerComponentElement=v,e.MaterialElement=H,e.ModelElement=V,e.ModuleElement=a,e.ParticleSystemComponentElement=z,e.RenderComponentElement=M,e.RigidBodyComponentElement=P,e.SceneElement=J,e.ScreenComponentElement=D,e.ScriptComponentElement=W,e.ScriptElement=q,e.ScrollViewComponentElement=L,e.ScrollbarComponentElement=B,e.SkyElement=U,e.SoundComponentElement=I,e.SoundSlotElement=Q});
|
|
2
2
|
//# sourceMappingURL=pwc.min.js.map
|