From 8931d18a842535e5db33d73fd27a8620a2765a32 Mon Sep 17 00:00:00 2001 From: Gheric Speiginer Date: Tue, 2 May 2017 09:42:37 -0400 Subject: [PATCH] fix(DeviceService): Prevent the manager from publishing stable state to itself --- dist/argon.core.js | 2 +- dist/argon.js | 2 +- dist/argon.min.js | 4 ++-- src/device.ts | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dist/argon.core.js b/dist/argon.core.js index 886ab55..c9b6fba 100644 --- a/dist/argon.core.js +++ b/dist/argon.core.js @@ -23844,7 +23844,7 @@ $__System.register('1', ['2', '3', '3b', '4', '9', '10', 'a', '1f', '32', '41', JulianDate.now(this._publishTime); for (var id in this._subscribers) { var session = this._subscribers[id]; - if (session.version[0] > 0) { + if (session.version[0] > 0 && session !== this.sessionService.manager) { for (var k in stableState.entities) { delete stableState.entities[k]; } diff --git a/dist/argon.js b/dist/argon.js index 0c5d7b1..e340b63 100644 --- a/dist/argon.js +++ b/dist/argon.js @@ -29424,7 +29424,7 @@ $__System.register('1', ['2', '3', '3b', '4', '9', '10', 'a', '1f', '32', '41', JulianDate.now(this._publishTime); for (var id in this._subscribers) { var session = this._subscribers[id]; - if (session.version[0] > 0) { + if (session.version[0] > 0 && session !== this.sessionService.manager) { for (var k in stableState.entities) { delete stableState.entities[k]; } diff --git a/dist/argon.min.js b/dist/argon.min.js index 3ae1ed3..809b0fb 100644 --- a/dist/argon.min.js +++ b/dist/argon.min.js @@ -14,6 +14,6 @@ this.icon=r.base64("image/svg+xml","PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRG e.paused&&(e.src=o.base64("video/mp4","AAAAGGZ0eXBpc29tAAAAAG1wNDFhdmMxAAAIA21vb3YAAABsbXZoZAAAAADSa9v60mvb+gABX5AAlw/gAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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EmoQWyZTAgh//7hAAAACkGeHkUVLD//voAAAAAIAZ49dEN/xIAAAAAIAZ4/akN/xIEAAAAOQZokSahBbJlMCCH//uAAAAAKQZ5CRRUsP/++gQAAAAgBnmF0Q3/EgAAAAAgBnmNqQ3/EgQAAAA5BmmhJqEFsmUwIIf/+4QAAAApBnoZFFSw//76BAAAACAGepXRDf8SBAAAACAGep2pDf8SAAAAADkGarEmoQWyZTAgh//7gAAAACkGeykUVLD//voEAAAAIAZ7pdEN/xIAAAAAIAZ7rakN/xIAAAAAPQZruSahBbJlMFEw3//7B"),e.play())},this.release=function(){e.pause(),e.src=""}}function r(){var e=null;this.request=function(){e||(e=setInterval(function(){window.location=window.location,setTimeout(window.stop,0)},3e4))},this.release=function(){e&&(clearInterval(e),e=null)}}var o=(this||self,e("82"));return i.exports=function(){var e=navigator.userAgent||navigator.vendor||window.opera;return e.match(/iPhone/i)||e.match(/iPod/i)?r:n}(),i.exports}),e.registerDynamic("92",["82","95"],!0,function(e,t,i){function n(){this.leftProjectionMatrix=new Float32Array(16),this.leftViewMatrix=new Float32Array(16),this.rightProjectionMatrix=new Float32Array(16),this.rightViewMatrix=new Float32Array(16),this.pose=null}function r(){this.isPolyfilled=!0,this.displayId=l++,this.displayName="webvr-polyfill displayName",this.depthNear=.01,this.depthFar=1e4,this.isConnected=!0,this.isPresenting=!1,this.capabilities={hasPosition:!1,hasOrientation:!1,hasExternalDisplay:!1,canPresent:!1,maxLayers:1},this.stageParameters=null,this.waitingForPresent_=!1,this.layer_=null,this.fullscreenElement_=null,this.fullscreenWrapper_=null,this.fullscreenElementCachedStyle_=null,this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null,this.wakelock_=new c}function o(){this.isPolyfilled=!0,this.hardwareUnitId="webvr-polyfill hardwareUnitId",this.deviceId="webvr-polyfill deviceId",this.deviceName="webvr-polyfill deviceName"}function s(){}function a(){}var u=(this||self,e("82")),c=e("95"),l=1e3,h=!1,f=[0,0,.5,1],d=[.5,0,.5,1];return r.prototype.getFrameData=function(e){return u.frameDataFromPose(e,this.getPose(),this)},r.prototype.getPose=function(){return this.getImmediatePose()},r.prototype.requestAnimationFrame=function(e){return window.requestAnimationFrame(e)},r.prototype.cancelAnimationFrame=function(e){return window.cancelAnimationFrame(e)},r.prototype.wrapForFullscreen=function(e){if(u.isIOS())return e;if(!this.fullscreenWrapper_){this.fullscreenWrapper_=document.createElement("div");var t=["height: "+Math.min(screen.height,screen.width)+"px !important","top: 0 !important","left: 0 !important","right: 0 !important","border: 0","margin: 0","padding: 0","z-index: 999999 !important","position: fixed"];this.fullscreenWrapper_.setAttribute("style",t.join("; ")+";"),this.fullscreenWrapper_.classList.add("webvr-polyfill-fullscreen-wrapper")}if(this.fullscreenElement_==e)return this.fullscreenWrapper_;this.removeFullscreenWrapper(),this.fullscreenElement_=e;var i=this.fullscreenElement_.parentElement;i.insertBefore(this.fullscreenWrapper_,this.fullscreenElement_),i.removeChild(this.fullscreenElement_),this.fullscreenWrapper_.insertBefore(this.fullscreenElement_,this.fullscreenWrapper_.firstChild),this.fullscreenElementCachedStyle_=this.fullscreenElement_.getAttribute("style");var n=this;return function(){if(n.fullscreenElement_){var e=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0"];n.fullscreenElement_.setAttribute("style",e.join("; ")+";")}}(),this.fullscreenWrapper_},r.prototype.removeFullscreenWrapper=function(){if(this.fullscreenElement_){var e=this.fullscreenElement_;this.fullscreenElementCachedStyle_?e.setAttribute("style",this.fullscreenElementCachedStyle_):e.removeAttribute("style"),this.fullscreenElement_=null,this.fullscreenElementCachedStyle_=null;var t=this.fullscreenWrapper_.parentElement;return this.fullscreenWrapper_.removeChild(e),t.insertBefore(e,this.fullscreenWrapper_),t.removeChild(this.fullscreenWrapper_),e}},r.prototype.requestPresent=function(e){var t=this.isPresenting,i=this;return e instanceof Array||(h||(console.warn("Using a deprecated form of requestPresent. Should pass in an array of VRLayers."),h=!0),e=[e]),new Promise(function(n,r){function o(){var e=u.getFullscreenElement();i.isPresenting=g===e,i.isPresenting?(screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape-primary").catch(function(e){console.error("screen.orientation.lock() failed due to",e.message)}),i.waitingForPresent_=!1,i.beginPresent_(),n()):(screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),i.removeFullscreenWrapper(),i.wakelock_.release(),i.endPresent_(),i.removeFullscreenListeners_()),i.fireVRDisplayPresentChange_()}function s(){i.waitingForPresent_&&(i.removeFullscreenWrapper(),i.removeFullscreenListeners_(),i.wakelock_.release(),i.waitingForPresent_=!1,i.isPresenting=!1,r(new Error("Unable to present.")))}if(!i.capabilities.canPresent)return void r(new Error("VRDisplay is not capable of presenting."));if(0==e.length||e.length>i.capabilities.maxLayers)return void r(new Error("Invalid number of layers."));var a=e[0];if(!a.source)return void n();var c=a.leftBounds||f,l=a.rightBounds||d;if(t){var h=!1,p=i.layer_;p.source!==a.source&&(p.source=a.source,h=!0);for(var M=0;M<4;M++)p.leftBounds[M]!==c[M]&&(p.leftBounds[M]=c[M],h=!0),p.rightBounds[M]!==l[M]&&(p.rightBounds[M]=l[M],h=!0);return h&&i.fireVRDisplayPresentChange_(),void n()}if(i.layer_={predistorted:a.predistorted,source:a.source,leftBounds:c.slice(0),rightBounds:l.slice(0)},i.waitingForPresent_=!1,i.layer_&&i.layer_.source){var g=i.wrapForFullscreen(i.layer_.source);i.addFullscreenListeners_(g,o,s),u.requestFullscreen(g)?(i.wakelock_.request(),i.waitingForPresent_=!0):u.isIOS()&&(i.wakelock_.request(),i.isPresenting=!0,i.beginPresent_(),i.fireVRDisplayPresentChange_(),n())}i.waitingForPresent_||u.isIOS()||(u.exitFullscreen(),r(new Error("Unable to present.")))})},r.prototype.exitPresent=function(){var e=this.isPresenting,t=this;return this.isPresenting=!1,this.layer_=null,this.wakelock_.release(),new Promise(function(i,n){e?(!u.exitFullscreen()&&u.isIOS()&&(t.endPresent_(),t.fireVRDisplayPresentChange_()),i()):n(new Error("Was not presenting to VRDisplay."))})},r.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},r.prototype.fireVRDisplayPresentChange_=function(){var e=new CustomEvent("vrdisplaypresentchange",{detail:{vrdisplay:this}});window.dispatchEvent(e)},r.prototype.addFullscreenListeners_=function(e,t,i){this.removeFullscreenListeners_(),this.fullscreenEventTarget_=e,this.fullscreenChangeHandler_=t,this.fullscreenErrorHandler_=i,t&&(document.fullscreenEnabled?e.addEventListener("fullscreenchange",t,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenchange",t,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenchange",t,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenchange",t,!1)),i&&(document.fullscreenEnabled?e.addEventListener("fullscreenerror",i,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenerror",i,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenerror",i,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenerror",i,!1))},r.prototype.removeFullscreenListeners_=function(){if(this.fullscreenEventTarget_){var e=this.fullscreenEventTarget_;if(this.fullscreenChangeHandler_){var t=this.fullscreenChangeHandler_;e.removeEventListener("fullscreenchange",t,!1),e.removeEventListener("webkitfullscreenchange",t,!1),document.removeEventListener("mozfullscreenchange",t,!1),e.removeEventListener("msfullscreenchange",t,!1)}if(this.fullscreenErrorHandler_){var i=this.fullscreenErrorHandler_;e.removeEventListener("fullscreenerror",i,!1),e.removeEventListener("webkitfullscreenerror",i,!1),document.removeEventListener("mozfullscreenerror",i,!1),e.removeEventListener("msfullscreenerror",i,!1)}this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null}},r.prototype.beginPresent_=function(){},r.prototype.endPresent_=function(){},r.prototype.submitFrame=function(e){},r.prototype.getEyeParameters=function(e){return null},s.prototype=new o,a.prototype=new o,i.exports.VRFrameData=n,i.exports.VRDisplay=r,i.exports.VRDevice=o,i.exports.HMDVRDevice=s,i.exports.PositionSensorVRDevice=a,i.exports}),e.registerDynamic("96",["92"],!0,function(e,t,i){function n(e){this.display=e,this.hardwareUnitId=e.displayId,this.deviceId="webvr-polyfill:HMD:"+e.displayId,this.deviceName=e.displayName+" (HMD)"}function r(e){this.display=e,this.hardwareUnitId=e.displayId,this.deviceId="webvr-polyfill:PositionSensor: "+e.displayId,this.deviceName=e.displayName+" (PositionSensor)"}var o=(this||self,e("92").VRDisplay,e("92").HMDVRDevice),s=e("92").PositionSensorVRDevice;return n.prototype=new o,n.prototype.getEyeParameters=function(e){var t=this.display.getEyeParameters(e);return{currentFieldOfView:t.fieldOfView,maximumFieldOfView:t.fieldOfView,minimumFieldOfView:t.fieldOfView,recommendedFieldOfView:t.fieldOfView,eyeTranslation:{x:t.offset[0],y:t.offset[1],z:t.offset[2]},renderRect:{x:"right"==e?t.renderWidth:0,y:0,width:t.renderWidth,height:t.renderHeight}}},n.prototype.setFieldOfView=function(e,t,i,n){},r.prototype=new s,r.prototype.getState=function(){var e=this.display.getPose();return{position:e.position?{x:e.position[0],y:e.position[1],z:e.position[2]}:null,orientation:e.orientation?{x:e.orientation[0],y:e.orientation[1],z:e.orientation[2],w:e.orientation[3]}:null,linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},r.prototype.resetState=function(){return this.positionDevice.resetPose()},i.exports.VRDisplayHMDDevice=n,i.exports.VRDisplayPositionSensorDevice=r,i.exports}),e.registerDynamic("97",["82","91","93","92","96"],!0,function(e,t,i){function n(){this.displays=[],this.devices=[],this.devicesPopulated=!1,this.nativeWebVRAvailable=this.isWebVRAvailable(),this.nativeLegacyWebVRAvailable=this.isDeprecatedWebVRAvailable(),this.nativeLegacyWebVRAvailable||(this.nativeWebVRAvailable||this.enablePolyfill(),WebVRConfig.ENABLE_DEPRECATED_API&&this.enableDeprecatedPolyfill()),r()}function r(){"VRDisplay"in window&&!("VRFrameData"in window)&&(window.VRFrameData=c,"depthNear"in window.VRDisplay.prototype||(window.VRDisplay.prototype.depthNear=.01),"depthFar"in window.VRDisplay.prototype||(window.VRDisplay.prototype.depthFar=1e4),window.VRDisplay.prototype.getFrameData=function(e){return o.frameDataFromPose(e,this.getPose(),this)})}var o=(this||self,e("82")),s=e("91"),a=e("93"),u=e("92").VRDisplay,c=e("92").VRFrameData,l=e("92").HMDVRDevice,h=e("92").PositionSensorVRDevice,f=e("96").VRDisplayHMDDevice,d=e("96").VRDisplayPositionSensorDevice;return n.prototype.isWebVRAvailable=function(){return"getVRDisplays"in navigator},n.prototype.isDeprecatedWebVRAvailable=function(){return"getVRDevices"in navigator||"mozGetVRDevices"in navigator},n.prototype.populateDevices=function(){if(!this.devicesPopulated){var e=null;this.isCardboardCompatible()&&(e=new s,this.displays.push(e),WebVRConfig.ENABLE_DEPRECATED_API&&(this.devices.push(new f(e)),this.devices.push(new d(e)))),this.isMobile()||WebVRConfig.MOUSE_KEYBOARD_CONTROLS_DISABLED||(e=new a,this.displays.push(e),WebVRConfig.ENABLE_DEPRECATED_API&&(this.devices.push(new f(e)),this.devices.push(new d(e)))),this.devicesPopulated=!0}},n.prototype.enablePolyfill=function(){navigator.getVRDisplays=this.getVRDisplays.bind(this),window.VRDisplay=u;var e=this;Object.defineProperty(navigator,"vrEnabled",{get:function(){return e.isCardboardCompatible()&&(document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||!1)}}),window.VRFrameData=c},n.prototype.enableDeprecatedPolyfill=function(){navigator.getVRDevices=this.getVRDevices.bind(this),window.HMDVRDevice=l,window.PositionSensorVRDevice=h},n.prototype.getVRDisplays=function(){this.populateDevices();var e=this.displays;return new Promise(function(t,i){try{t(e)}catch(e){i(e)}})},n.prototype.getVRDevices=function(){console.warn("getVRDevices is deprecated. Please update your code to use getVRDisplays instead.");var e=this;return new Promise(function(t,i){try{if(!e.devicesPopulated){if(e.nativeWebVRAvailable)return navigator.getVRDisplays(function(i){for(var n=0;n1?t-1:0),n=1;n=1?r(e):r()}function M(e){return function(t){et.define(et.invoker,e,t)}}function g(e){var t=function(e){et.define(et.invoker,Ot.instance,e)};return e?t(e):t}function y(e){return function(t){et.define(et.registration,e,t)}}function A(e){return y(new Lt(e))}function w(e){var t=!(arguments.length<=1||void 0===arguments[1])&&arguments[1];return y(new St(e,t))}function E(e){if(null===e||void 0===e)throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?")}function m(e,t,i,n){for(var r=i.length,o=new Array(r);r--;)o[r]=e.get(i[r]);return void 0!==n&&(o=o.concat(n)),Reflect.construct(t,o)}function v(e){return e.hasOwnProperty("inject")?"function"==typeof e.inject?e.inject():e.inject:[]}function N(e){var t=function(e){var t=e.inject,i=et.getOwn(et.paramTypes,e)||_t;if(t)for(var n=0;n-1&&t.splice(r,1),t.splice(r>-1&&r0&&(i.splice(0,n),e._values.splice(0,n*e._innerType.packedLength),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e))}function I(e,t){if(void 0!==t){var i=e._times.length-t;i>0&&(e._times.splice(0,i),e._values.splice(0,i*e._innerType.packedLength),e._updateTableLength=!0)}}function O(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return Pt[255&e]+Pt[e>>8&255]+Pt[e>>16&255]+Pt[e>>24&255]+"-"+Pt[255&t]+Pt[t>>8&255]+"-"+Pt[t>>16&15|64]+Pt[t>>24&255]+"-"+Pt[63&i|128]+Pt[i>>8&255]+"-"+Pt[i>>16&255]+Pt[i>>24&255]+Pt[255&n]+Pt[n>>8&255]+Pt[n>>16&255]+Pt[n>>24&255]}function L(e){this._token=e.token,this._url=e.url,this._tilingScheme=e.tilingScheme,fe(this._tilingScheme)||(this._tilingScheme=new Ve({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:he(e.ellipsoid,pe.WGS84)})),this._heightmapWidth=64,this._levelZeroMaximumGeometricError=Ye.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._proxy=e.proxy,this._terrainDataStructure={heightScale:1/256,heightOffset:-32768,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215},this._errorEvent=new ye;var t=e.credit;"string"==typeof t&&(t=new Xe(t)),this._credit=t,this._readyPromise=Promise.resolve(!0)}function S(){if(oi)return oi;var e,t=function(e,t,i){if(e){var n={view:i.view,clientX:i.clientX,clientY:i.clientY,screenX:i.screenX,screenY:i.screenY,relatedTarget:t};n.bubbles=!0,e.dispatchEvent(new MouseEvent("mouseout",n)),n.bubbles=!1;var r=e;do{r.dispatchEvent(new MouseEvent("mouseleave",n)),r=r.parentElement}while(r)}},i=function(e,t,i){var n={view:i.view,clientX:i.clientX,clientY:i.clientY,screenX:i.screenX,screenY:i.screenY,relatedTarget:t};n.bubbles=!0,e.dispatchEvent(new MouseEvent("mouseover",n)),n.bubbles=!1;var r=e;do{r.dispatchEvent(new MouseEvent("mouseenter",n)),r=r.parentElement}while(r)},n=function(e,t,i){var n=i.bubbles;i.bubbles=!0,e.dispatchEvent(new PointerEvent("pointerover",i)),i.bubbles=!1;var r=e;do{r.dispatchEvent(new PointerEvent("pointerenter",i)),r=r.parentElement}while(r);i.bubbles=n},r=function(e,t,i){if(e){i.bubbles=!0,e.dispatchEvent(new PointerEvent("pointerout",i)),i.bubbles=!1;var n=e;do{n.dispatchEvent(new PointerEvent("pointerleave",i)),n=n.parentElement}while(n)}},o=function(e,t,i){return e.forEach(function(n,r){document.createTouch?e[r]=document.createTouch(i.view,t,n.identifier,n.clientX,n.clientY,n.screenX,n.screenY):void 0!==typeof Touch&&(n.target=t,e[r]=new Touch(n))}),e},s={},a={},u={},c={};return document.documentElement.addEventListener("gotpointercapture",function(e){c[e.pointerId]=e.target}),document.documentElement.addEventListener("lostpointercapture",function(e){delete c[e.pointerId]}),Element.prototype.setPointerCapture=function(e){c[e]=this},Element.prototype.releasePointerCapture=function(e){c[e]=null},oi=function(l){l.view=window;var h;switch(l.type){case"wheel":h=document.elementFromPoint(l.clientX,l.clientY)||window,h.dispatchEvent(new WheelEvent(l.type,l));break;case"mouseleave":h=document.elementFromPoint(l.clientX,l.clientY)||window,t(e,void 0,l),e=void 0;break;case"mouseenter":h=document.elementFromPoint(l.clientX,l.clientY)||window,i(h,void 0,l),e=h;break;case"mousemove":h=document.elementFromPoint(l.clientX,l.clientY)||window,h!==e&&(t(e,h,l),i(h,e,l),e=h),h.dispatchEvent(new MouseEvent(l.type,l));break;case"touchstart":var f=l.changedTouches[0];h=document.elementFromPoint(f.clientX,f.clientY)||window;for(var d=0,p=l.changedTouches;d0?g=new TouchEvent(l.type,{cancelable:l.cancelable,bubbles:l.bubbles,touches:y,targetTouches:A,changedTouches:w}):(g.initUIEvent(l.type,l.bubbles,l.cancelable,l.view,l.detail),g.touches=y,g.targetTouches=A,g.changedTouches=w),"touchend"===l.type||"touchcancel"==l.type){h.dispatchEvent(g);var E=w[0];l.clientX=E.clientX,l.clientY=E.clientY,l.screenX=E.screenX,l.screenY=E.screenY,l.button=0,l.detail=1,"touchend"===l.type?performance.now()-a[E.identifier]<300&&!g.defaultPrevented&&(h.dispatchEvent(new MouseEvent("mousedown",l)),h.dispatchEvent(new MouseEvent("mouseup",l)),h.dispatchEvent(new MouseEvent("click",l))):h.dispatchEvent(new MouseEvent("mouseout",l));for(var m=0,v=l.changedTouches;m0&&(i=!1,n.event=o,e.uiEvent.raiseEvent(n),!i))return void o.stopImmediatePropagation();"touchstart"===o.type&&o.preventDefault();var c=e.element.getBoundingClientRect(),l=ui(o.touches,c),h=ui(o.changedTouches,c),f=ui(o.targetTouches,c);r.timeStamp=o.timeStamp,r.type=o.type,r.bubbles=o.bubbles,r.cancelable=o.cancelable,r.which=o.which,r.detail=o.detail,r.composed=o.composed,r.timeStamp=o.timeStamp,r.altKey=o.altKey,r.ctrlKey=o.ctrlKey,r.metaKey=o.metaKey,r.button=o.button,r.buttons=o.buttons,r.clientX=o.clientX-c.left,r.clientY=o.clientY-c.top,r.screenX=o.screenX,r.screenY=o.screenY,r.movementX=o.movementX,r.movementY=o.movementY,r.deltaX=o.deltaX,r.deltaY=o.deltaY,r.deltaZ=o.deltaZ,r.deltaMode=o.deltaMode,r.wheelDelta=o.wheelDelta,r.wheelDeltaX=o.wheelDeltaX,r.wheelDeltaY=o.wheelDeltaY,r.touches=l,r.changedTouches=h,r.targetTouches=f,r.pointerId=o.pointerId,r.pointerType=o.pointerType,r.width=o.width,r.height=o.height,r.pressure=o.pressure,r.tiltX=o.tiltX,r.tiltY=o.tiltY,r.isPrimary=o.isPrimary,t(r)}else o.stopImmediatePropagation()},s=["wheel","click","dblclick","contextmenu"];s.push("pointerenter","pointerleave","pointerdown","pointermove","pointerup","pointercancel"),s.push("mouseenter","mouseleave","mousedown","mousemove","mouseup","touchstart","touchend","touchmove","touchcancel"),s.forEach(function(t){e.element.addEventListener(t,o,!1)})}function j(e,t){void 0===t&&(t=[]);var i=t;i.length=0;var n=e;do{var r=n.position;n=r&&r.referenceFrame,fe(n)&&i.unshift(n)}while(fe(n));return i}function x(e,t,i){void 0===i&&(i=[]);var n=i;n.length=0;var r=e,o=!1;do{var s=r.position,a=r&&r.orientation;r=s&&s.referenceFrame;var u=fe(r),c=u&&s&&s.getValueInReferenceFrame(t,r,li),l=u&&c&&a&&a.getValue(t,hi);o=c&&l,o&&n.unshift(r)}while(o);return n}function C(e,t,i,n){return e.position&&e.position.getValueInReferenceFrame(t,i,n)}function b(e,t,i,n){var r=e.position&&e.position.referenceFrame;if(fe(r)){var o=e.orientation&&e.orientation.getValue(t,n);if(fe(o))return Oe.convertToReferenceFrame(t,o,r,i,n)}}function R(e,t,i){var n=void 0;if(fe(i)||(n=x(e,t,pi),i=n[0]),!fe(i))return null;var r=e.id+"@"+(i.id?i.id:i),o=Mi[r];o||(o={},Mi[r]=o);var s=C(e,t,i,o.p||{});if(!s)return null;var a=b(e,t,i,o.o||{});return a&&s&&a?(o.p=s,o.o=a,o.r="number"==typeof i?i:i.id,o.meta=e.meta,o):null}function z(e){if(!gi)throw new Error("resolveURL requires DOM api");if(void 0===e)throw new Error("Expected inURL");return gi.href="",gi.href=e,gi.href}function P(e){if(!gi)throw new Error("parseURL requires DOM api");if(void 0===e)throw new Error("Expected inURL");return gi.href="",gi.href=e,{href:gi.href,protocol:gi.protocol,hostname:gi.hostname,port:gi.port,pathname:gi.pathname,search:gi.search,hash:gi.hash,host:gi.host}}function U(e){return e instanceof HTMLElement?Promise.resolve(e):new Promise(function(t,i){var n=function(){var n=document.querySelector(""+e);n?t(n):i(new Error("Unable to resolve element id "+e))};"loading"==document.readyState?document.addEventListener("DOMContentLoaded",n):n()})}function B(e,t){var i=e[Ie.COLUMN0ROW0],n=e[Ie.COLUMN1ROW1],r=e[Ie.COLUMN2ROW0],o=e[Ie.COLUMN2ROW1],s=e[Ie.COLUMN2ROW2],a=e[Ie.COLUMN3ROW2],u=t.near=a/(s-1);return t.far=a/(s+1),t.bottom=u*(o-1)/n,t.top=u*(o+1)/n,t.left=u*(r-1)/i,t.right=u*(r+1)/i,t}function k(e,t){var i,n=B(e,yi),r=(n.left+n.right)/2,o=(n.top+n.bottom)/2,s=n.near,a=n.far,u=n.right-r,c=n.top-o,l=u/c,h=2*Math.atan(c/s);return i=l<1?h:2*Math.atan(Math.tan(.5*h)*l),t.near=s,t.far=a,t.fov=i,t.aspectRatio=l, t.xOffset=r,t.yOffset=o,t}function F(e,t,i){return!!(e.position&&e.position instanceof ce&&e.orientation&&e.orientation instanceof le)&&(!!C(e,t,i,Ai)&&(!!b(e,t,i,wi)&&(e.position.setValue(Ai,i),e.orientation.setValue(wi),!0)))}function Q(){Ei&&(window.location.href="https://itunes.apple.com/us/app/argon4/id1089308600?mt=8")}function Y(){Ei&&(window.location.href="argon4://open?url="+encodeURIComponent(window.location.href))}function q(e){var t=!1;return function(i,n,r){var o=r.get||r.value,s="function"==typeof r.value?"function":"property",a='The "'+n+'" '+s+" is deprecated. ";if(e){var u="function"==typeof i[e]?"function":"property";a+='Please use the "'+e+'" '+u+" instead."}var c=function(){return t||(console.warn(a),t=!0),o.apply(this,arguments)};return r.value?r.value=c:r.get=c,r}}function G(e){return Ti[0]=e,Ze(Di,15,Ti).then(V)}function V(e){return e[0]}function H(e){for(var t=e.split("."),i=0,n=t.length;i0||window.top!==window?Vt.APPLICATION:Vt.REALITY_MANAGER,r.role=s}return i||(i=new bt),i.registerInstance(yn,n||null),new $r(r,i).container.get(Jr)}function X(e,t){if(void 0===e&&(e={}),void 0===t&&(t=new bt),Jr.instance)throw new Error("A shared ArgonSystem instance already exists");return e.role=Vt.REALITY_VIEW,e.supportsCustomProtocols=!0,e["reality.supportsControlPort"]=!0,e.protocols=e.protocols||[],e.protocols.push("ar.uievent"),new $r(e,t).container.get(Jr)}var Z,K,J,$,ee,te,ie,ne,re,oe,se,ae,ue,ce,le,he,fe,de,pe,Me,ge,ye,Ae,we,Ee,me,ve,Ne,De,Te,Ie,Oe,Le,Se,_e,je,xe,Ce,be,Re,ze,Pe,Ue,Be,ke,Fe,Qe,Ye,qe,Ge,Ve,He,We,Xe,Ze,Ke,Je,$e,et,tt,it,nt,rt,ot,st,at,ut,ct,lt,ht,ft,dt,pt,Mt,gt,yt,At,wt,Et,mt,vt,Nt,Dt,Tt,It,Ot,Lt,St,_t,jt,xt,Ct,bt,Rt,zt,Pt,Ut,Bt,kt,Ft,Qt,Yt,qt,Gt,Vt,Ht,Wt,Xt,Zt,Kt,Jt,$t,ei,ti,ii,ni,ri,oi,si,ai,ui,ci,li,hi,fi,di,pi,Mi,gi,yi,Ai,wi,Ei,mi,vi,Ni,Di,Ti,Ii,Oi,Li,Si,_i,ji,xi,Ci,bi,Ri,zi,Pi,Ui,Bi,ki,Fi,Qi,Yi,qi,Gi,Vi,Hi,Wi,Xi,Zi,Ki,Ji,$i,en,tn,nn,rn,on,sn,an,un,cn,ln,hn,fn,dn,pn,Mn,gn,yn,An,wn,En,mn,vn,Nn,Dn,Tn,In,On,Ln,Sn,_n,jn,xn,Cn,bn,Rn,zn,Pn,Un,Bn,kn,Fn,Qn,Yn,qn,Gn,Vn,Hn,Wn,Xn,Zn,Kn,Jn,$n,er,tr,ir,nr,rr,or,sr,ar,ur,cr,lr,hr,fr,dr,pr,Mr,gr,yr,Ar,wr,Er,mr,vr,Nr,Dr,Tr,Ir,Or,Lr,Sr,_r,jr,xr,Cr,br,Rr,zr,Pr,Ur,Br,kr,Fr,Qr,Yr,qr,Gr,Vr,Hr,Wr,Xr,Zr,Kr,Jr,$r,eo,to,io,no,ro,oo,so,ao,uo,co,lo,ho,fo,po,Mo,go,yo,Ao;return{setters:[function(e){},function(e){Z=e.AggregateError,K=e.PLATFORM},function(e){J=e.default},function(e){$=e.default},function(e){ee=e.default},function(e){te=e.default},function(e){ie=e.default},function(e){ne=e.default},function(e){re=e.default},function(e){oe=e.default},function(e){se=e.default},function(e){ae=e.default},function(e){ue=e.default},function(e){ce=e.default},function(e){le=e.default},function(e){he=e.default},function(e){fe=e.default},function(e){de=e.default},function(e){pe=e.default},function(e){Me=e.default},function(e){ge=e.default},function(e){ye=e.default},function(e){Ae=e.default},function(e){we=e.default},function(e){Ee=e.default},function(e){me=e.default},function(e){ve=e.default},function(e){Ne=e.default},function(e){De=e.default},function(e){Te=e.default},function(e){Ie=e.default},function(e){Oe=e.default},function(e){Le=e.default},function(e){Se=e.default},function(e){_e=e.default},function(e){je=e.default},function(e){xe=e.default},function(e){Ce=e.default},function(e){be=e.default},function(e){Re=e.default},function(e){ze=e.default},function(e){Pe=e.default},function(e){Ue=e.default},function(e){Be=e.default},function(e){ke=e.default},function(e){Fe=e.default},function(e){Qe=e.default},function(e){Ye=e.default},function(e){qe=e.default},function(e){Ge=e.default},function(e){Ve=e.default},function(e){He=e.default},function(e){We=e.default},function(e){Xe=e.default},function(e){Ze=e.default},function(e){Ke=e.default},function(e){}],execute:function(){for(Je=Object.assign||function(e){for(var t=1;t1?t-1:0),n=1;n0?this.dynamicDependencies.map(function(t){return t["protocol:aurelia:resolver"]?t.get(e):e.get(t)}):void 0,i=e.invoke(this.key,t);return e.registerInstance(this.asKey,i),i},e.prototype.as=function(e){return this.asKey=e,this},e.of=function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),r=1;rr-o&&s.clientXi.clientHeight-o?e(n):s.clientX0&&!e._currentCommandPending&&e._executeNextCommand()})},e.prototype.pause=function(){this._paused=!0},e.prototype.clear=function(){this._queue.forEach(function(e){e.reject("Unable to execute.")}),this._queue=[]},e.prototype._executeNextCommand=function(){var e=this;if(this._currentCommand=void 0,this._currentCommandPending=void 0,!this._paused){var t=this._queue.shift();t&&(this._currentCommand=t.command,this._currentCommandPending=t.execute().then(this._executeNextCommand.bind(this)).catch(function(t){e.errorEvent.raiseEvent(t),e._executeNextCommand()}))}},e}()),e("MessageChannelLike",ii=function(){function e(){var e,t,i,n=this,r=!0;e=new Promise(function(e){n.port1={set onmessage(t){i=t,e()},get onmessage(){return i},postMessage:function(e){r&&t.then(function(){n.port2.onmessage&&n.port2.onmessage({data:e})})},close:function(){r=!1}}});var o;t=new Promise(function(t){n.port2={set onmessage(e){o=e,t()},get onmessage(){return o},postMessage:function(t){r&&e.then(function(){n.port1.onmessage&&n.port1.onmessage({data:t})})},close:function(){r=!1}}})}return e}()),e("SynchronousMessageChannel",ni=function(){function e(){var e=this,t=[],i=function(e){t.push(e)};e.port1={get onmessage(){return i},set onmessage(e){i=e,t.forEach(function(t){return e(t)}),t=[]},postMessage:function(t){e.port2.onmessage&&e.port2.onmessage({data:t})},close:function(){e.port1.onmessage=void 0,e.port2.onmessage=void 0}};var n=[],r=function(e){n.push(e)};e.port2={get onmessage(){return r},set onmessage(e){r=e,n.forEach(function(t){return e(t)}),n=[]},postMessage:function(t){e.port1.onmessage&&e.port1.onmessage({data:t})},close:function(){e.port1.onmessage=void 0,e.port2.onmessage=void 0}}}return e}()),e("MessageChannelFactory",ri=function(){function e(){}return e.prototype.create=function(){return"undefined"!=typeof MessageChannel?new MessageChannel:new ii},e.prototype.createSynchronous=function(){return new ni},e}()),e("getEventSynthesizier",si="undefined"!=typeof document&&document.createElement?S:function(){}),ai=function(e,t){return{identifier:e.identifier,clientX:e.clientX-t.left,clientY:e.clientY-t.top,screenX:e.screenX,screenY:e.screenY}},ui=function(e,t){if(e){for(var i=[],n=0;n=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Si=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},_i=Object.freeze({}),e("SessionPort",ji=function(){function e(t){var i=this;this.uri=t,this.id=O(),this._connectEvent=new ei,this.closeEvent=new ei,this.errorEvent=new ei,this.on={},this.suppressErrorOnUnknownTopic=!1,this._isOpened=!1,this._isConnected=!1,this._isClosed=!1,this.on[e.OPEN]=function(e){if(!e)throw new Error("Session did not provide a configuration ("+i.uri+")");if(i._isConnected)throw new Error("Session has already connected! ("+i.uri+")");i._info=e,i._version=e.version||[0],i._isConnected=!0,i._connectEvent.raiseEvent(void 0)},this.on[e.CLOSE]=function(){i._isClosed=!0,i._isConnected=!1,i.messagePort&&i.messagePort.close&&i.messagePort.close(),i.closeEvent.raiseEvent(void 0)},this.on[e.ERROR]=function(e){var t=new Error("Session Error: "+e.message);e.stack&&(t.stack=e.stack),i.errorEvent.raiseEvent(t)},this.errorEvent.addEventListener(function(e){1===i.errorEvent.numberOfListeners&&console.error(e)})}return Object.defineProperty(e.prototype,"connectEvent",{get:function(){if(this._isConnected)throw new Error("The connectEvent only fires once and the session is already connected.");return this._connectEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"info",{get:function(){if(!this.isConnected)throw new Error("info is not available until the session is connected.");return this._info},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){if(!fe(this._version))throw new Error("version is not available until the session is opened.");return this._version},enumerable:!0,configurable:!0}),e.prototype.supportsProtocol=function(e,t){if(!this._isConnected)throw new Error("Session has not yet connected");var i=this.info.protocols;if(!i)return!1;var n=!1,r=new Set;return i.forEach(function(t){if(-1!==t.indexOf(e)){var i=+t.split("@v")[1]||0;r.add(i)}}),t?Array.isArray(t)?t.forEach(function(e){r.has(e)&&(n=!0)}):r.has(t)&&(n=!0):t||(n=!0),n},e.prototype.whenConnected=function(){var e=this;return new Promise(function(t,i){e.isConnected&&t();var n=e._connectEvent.addEventListener(function(){n(),t()})})},e.prototype.open=function(t,i){var n=this;if(!this._isClosed){if(this._isOpened)throw new Error("Session can only be opened once");if(!i)throw new Error("Session options must be provided");this.messagePort=t,this._isOpened=!0,this.messagePort.onmessage=function(e){if(!n._isClosed){var t="string"==typeof e.data?JSON.parse(e.data):e.data,i=t[0],r=t[1],o=t[2]||_i,s=t[3],a=n.on[r];if(a&&!s)try{var u=a(o,e);u&&console.warn("Handler for "+r+" returned an unexpected response")}catch(e){n.sendError(e),n.errorEvent.raiseEvent(e)}else if(a){var u=new Promise(function(t){return t(a(o,e))});Promise.resolve(u).then(function(e){n._isClosed||n.send(r+":resolve:"+i,e)}).catch(function(e){if(!n._isClosed){var t;"string"==typeof e?t=e:"string"==typeof e.message&&(t=e.message),n.send(r+":reject:"+i,{reason:t})}})}else if(!n.suppressErrorOnUnknownTopic){var c="Unable to handle message for topic "+r+" ("+n.uri+")";s&&n.send(r+":reject:"+i,{reason:c}),n.errorEvent.raiseEvent(new Error(c))}}},this.send(e.OPEN,i)}},e.prototype.send=function(e,t){if(!this._isOpened)throw new Error("Session must be open to send messages");if(this._isClosed)return!1;var i=O(),n=[i,e,t];return this.messagePort.postMessage(Ei?n:JSON.stringify(n)),!0},e.prototype.sendError=function(t){var i=t;return i instanceof Error&&(i={message:i.message,stack:i.stack}),this.send(e.ERROR,i)},e.prototype.request=function(e,t){var i=this;if(!this._isOpened||this._isClosed)throw new Error("Session must be open to make requests");var n=O(),r=e+":resolve:"+n,o=e+":reject:"+n,s=new Promise(function(t,n){i.on[r]=function(e){delete i.on[r],delete i.on[o],t(e)},i.on[o]=function(t){delete i.on[r],delete i.on[o],console.warn("Request '"+e+"' rejected with reason:\n"+t.reason),n(new Error(t.reason))}}),a=[n,e,t,!0];return this.messagePort.postMessage(Ei?a:JSON.stringify(a)),s},e.prototype.close=function(){this._isClosed||(this._isOpened&&this.send(e.CLOSE),this._isClosed=!0,this._isConnected=!1,this.messagePort&&this.messagePort.close&&this.messagePort.close(),this.closeEvent.raiseEvent(void 0))},Object.defineProperty(e.prototype,"isConnected",{get:function(){return this._isConnected},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isClosed",{get:function(){return this._isClosed},enumerable:!0,configurable:!0}),e}()),ji.OPEN="ar.session.open",ji.CLOSE="ar.session.close",ji.ERROR="ar.session.error",e("SessionPortFactory",xi=function(){function e(){}return e.prototype.create=function(e){return new ji(e)},e}()),e("ConnectService",Ci=function(){function e(){}return e}()),e("SessionService",bi=function(){function e(e,t,i,n){var r=this;this.configuration=e,this.connectService=t,this.sessionPortFactory=i,this.messageChannelFactory=n,this.manager=this.createSessionPort("argon:manager"),this.errorEvent=new ei,this._connectEvent=new ei,this._managedSessions=[],e.version=H(Ii),e.uri="undefined"!=typeof window&&window.location?window.location.href:void 0,e.title="undefined"!=typeof document?document.title:void 0,this.errorEvent.addEventListener(function(e){1===r.errorEvent.numberOfListeners&&console.error(e)}),this.manager.errorEvent.addEventListener(function(e){r.errorEvent.raiseEvent(e)}),this.manager.closeEvent.addEventListener(function(){r.managedSessions.forEach(function(e){e.close()})}),Object.freeze(this)}return Object.defineProperty(e.prototype,"connectEvent",{get:function(){return this._connectEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"managedSessions",{get:function(){return this._managedSessions},enumerable:!0,configurable:!0}),e.prototype.connect=function(){this.connectService&&this.connectService.connect?this.connectService.connect(this):console.warn("Argon: Unable to connect to a manager session; a connect service is not available")},e.prototype.addManagedSessionPort=function(e){var t=this;this.ensureIsRealityManager();var i=this.sessionPortFactory.create(e);return i.errorEvent.addEventListener(function(e){t.errorEvent.raiseEvent(e)}),i.connectEvent.addEventListener(function(){t.managedSessions.push(i),t.connectEvent.raiseEvent(i)}),i.closeEvent.addEventListener(function(){var e=t.managedSessions.indexOf(i);e>-1&&t.managedSessions.splice(e,1)}),i},e.prototype.createSessionPort=function(e){return this.sessionPortFactory.create(e)},e.prototype.createMessageChannel=function(){return this.messageChannelFactory.create()},e.prototype.createSynchronousMessageChannel=function(){return this.messageChannelFactory.createSynchronous()},Object.defineProperty(e.prototype,"isRealityManager",{get:function(){return Vt.isRealityManager(this.configuration&&this.configuration.role)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRealityAugmenter",{get:function(){return Vt.isRealityAugmenter(this.configuration&&this.configuration.role)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRealityViewer",{get:function(){return Vt.isRealityViewer(this.configuration&&this.configuration.role)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isManager",{get:function(){return this.isRealityManager},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isApplication",{get:function(){return this.isRealityAugmenter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRealityView",{get:function(){return this.isRealityViewer},enumerable:!0,configurable:!0}),e.prototype.ensureIsRealityManager=function(){if(!this.isRealityManager)throw new Error("An reality-manager only API was accessed from a non reality-manager.")},e.prototype.ensureIsRealityViewer=function(){if(!this.isRealityViewer)throw new Error("An reality-viewer only API was accessed from a non reality-viewer.")},e.prototype.ensureNotRealityViewer=function(){if(this.isRealityViewer)throw new Error("An non-permitted API was accessed from a reality-viewer.")}, e.prototype.ensureNotRealityAugmenter=function(){if(this.isRealityAugmenter)throw new Error("An non-permitted API was accessed from a reality-viewer.")},e.prototype.ensureConnected=function(){if(!this.manager.isConnected)throw new Error("Session is not connected to manager")},e}()),Li([q("isRealityManager"),Si("design:type",Object),Si("design:paramtypes",[])],bi.prototype,"isManager",null),Li([q("isRealityAugmenter"),Si("design:type",Object),Si("design:paramtypes",[])],bi.prototype,"isApplication",null),Li([q("isRealityViewer"),Si("design:type",Object),Si("design:paramtypes",[])],bi.prototype,"isRealityView",null),e("SessionService",bi=Li([N,Si("design:paramtypes",["function"==typeof(ki=void 0!==Ht&&Ht)&&ki||Object,Ci,xi,"function"==typeof(Fi=void 0!==ri&&ri)&&Fi||Object])],bi)),e("LoopbackConnectService",Ri=function(e){function t(){return e.apply(this,arguments)||this}return Oi(t,e),t.prototype.connect=function(e){var t=e.createSynchronousMessageChannel(),i=t.port1;t.port2.onmessage=function(e){t.port2.postMessage(e.data)},e.manager.connectEvent.addEventListener(function(){e.connectEvent.raiseEvent(e.manager)}),e.manager.open(i,e.configuration)},t}(Ci)),e("DOMConnectService",zi=function(e){function t(){return e.apply(this,arguments)||this}return Oi(t,e),t.isAvailable=function(){return"undefined"!=typeof window&&void 0!==window.parent},t.prototype.connect=function(e){var t=e.createMessageChannel();window.parent.postMessage({type:"ARGON_SESSION",name:window.name},"*",[t.port1]),e.manager.open(t.port2,e.configuration)},t}(Ci)),e("DebugConnectService",Pi=function(e){function t(){return e.apply(this,arguments)||this}return Oi(t,e),t.isAvailable=function(){return"undefined"!=typeof window&&!!window.__ARGON_DEBUG_PORT__},t.prototype.connect=function(e){var t=e.manager,i=e.configuration;t.open(window.__ARGON_DEBUG_PORT__,i)},t}(Ci)),e("WKWebViewConnectService",Ui=function(e){function t(){return e.apply(this,arguments)||this}return Oi(t,e),t.isAvailable=function(){return"undefined"!=typeof window&&window.webkit&&window.webkit.messageHandlers},t.prototype.connect=function(e){var t=e.createSynchronousMessageChannel();t.port2.onmessage=function(e){webkit.messageHandlers.argon.postMessage(JSON.stringify(e.data))},window.__ARGON_PORT__=t.port2,e.manager.open(t.port1,e.configuration),window.addEventListener("beforeunload",function(){e.manager.close()})},t}(Ci)),e("AndroidWebViewConnectService",Bi=function(e){function t(){return e.apply(this,arguments)||this}return Oi(t,e),t.isAvailable=function(){return"undefined"!=typeof window&&window.__argon_android__},t.prototype.connect=function(e){var t=e.createSynchronousMessageChannel();t.port2.onmessage=function(e){window.__argon_android__.emit("argon",JSON.stringify(e.data))},window.__ARGON_PORT__=t.port2,e.manager.open(t.port1,e.configuration),window.addEventListener("beforeunload",function(){e.manager.close()})},t}(Ci)),Qi=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Yi=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("EntityPose",qi=function(){function e(e,t,i){if(this.context=e,this.status=0,this.position=new ne,this.orientation=new xe,this.time=new Ne(0,0),this._previousStatus=0,"string"==typeof t){var n=this.context.entities.getById(t);n||(n=new Ce(e.entities,t)),this._entity=n}else this._entity=t;if("string"==typeof i){var r=this.context.entities.getById(i);fe(r)||(r=new Ce(e.entities,i)),this._referenceFrame=r}else this._referenceFrame=i}return Object.defineProperty(e.prototype,"entity",{get:function(){return this._entity},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"referenceFrame",{get:function(){return fe(this._referenceFrame)?this._referenceFrame:this.context.defaultReferenceFrame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"poseStatus",{get:function(){return this.status},enumerable:!0,configurable:!0}),e.prototype.update=function(e){void 0===e&&(e=this.context.time),Ne.clone(e,this.time),Ne.equals(this._previousTime,e)||(this._previousStatus=this.status,this._previousTime=Ne.clone(e,this._previousTime));var t=this.entity,i=this.referenceFrame,n=C(t,e,i,this.position),r=b(t,e,i,this.orientation),o=n&&r,s=0,a=this._previousStatus;o&&(s|=Gi.KNOWN),!o||a&Gi.KNOWN?!o&&a&Gi.KNOWN&&(s|=Gi.LOST):s|=Gi.FOUND,this.status=s},e}()),function(e){e[e.KNOWN=1]="KNOWN",e[e.FOUND=2]="FOUND",e[e.LOST=4]="LOST"}(Gi||e("PoseStatus",Gi={})),e("ContextService",Vi=function(){function e(e){var t=this;this.sessionService=e,this.frameStateEvent=new ei,this.updateEvent=new ei,this.renderEvent=new ei,this.postRenderEvent=new ei,this.localOriginChangeEvent=new ei,this._localOriginChanged=!1,this.timestamp=-1,this.deltaTime=0,this.maxDeltaTime=1/3*1e3,this.time=new Ne(0,0),this.entities=new ge,this.localOrigin=this.entities.add(new Me({id:"ar.localOrigin",name:"Local Origin (ENU)",position:new ce(void 0,be.FIXED),orientation:new le(void 0)})),this.localOriginEastNorthUp=this.localOrigin,this.localOriginEastUpSouth=this.entities.add(new Me({id:"ar.localOriginEUS",name:"Local Origin (EUS)",position:new ce(ne.ZERO,this.localOriginEastNorthUp),orientation:new le(xe.fromAxisAngle(ne.UNIT_X,Math.PI/2))})),this.defaultReferenceFrame=this.localOriginEastNorthUp,this.stage=this.entities.add(new Me({id:"ar.stage",name:"Stage (ENU)",position:new ce(void 0,be.FIXED),orientation:new le(void 0)})),this.stageEastNorthUp=this.stage,this.stageEastUpSouth=this.entities.add(new Me({id:"ar.stageEUS",name:"Stage (EUS)",position:new ce(ne.ZERO,this.localOriginEastNorthUp),orientation:new le(xe.fromAxisAngle(ne.UNIT_X,Math.PI/2))})),this.user=this.entities.add(new Me({id:"ar.user",name:"User",position:new ce(void 0,this.stage),orientation:new le(void 0)})),this.view=this.entities.add(new Me({id:"ar.view",name:"View",position:new ce(ne.ZERO,this.user),orientation:new le(xe.IDENTITY)})),this.floor=this.entities.add(new Me({id:"ar.floor",name:"Floor",position:new ce(ne.ZERO,this.stage),orientation:new le(xe.IDENTITY)})),this._entityPoseMap=new Map,this._updatingEntities=new Set,this._knownEntities=new Set,this._scratchCartesian=new ne,this._scratchQuaternion=new xe,this._scratchFrustum=new Le,this._scratchMatrix3=new Te,this._scratchMatrix4=new Ie,this._frameIndex=-1,this._getReachableAncestorReferenceFrames=x,this._scratchArray=[],this._localOriginPose=this.createEntityPose(this.localOrigin,this.stage),this.sessionService.manager.on["ar.context.update"]=function(e){var i=t._scratchFrustum;if("string"!=typeof e.reality&&(e.reality=e.reality&&e.reality.uri),!e.viewport&&e.view&&e.view.viewport&&(e.viewport=e.view.viewport),!e.subviews&&e.view&&e.view.subviews){e.subviews=e.view.subviews,i.near=qt,i.far=Gt;for(var n=0,r=e.subviews;n1e4){var o=this._getReachableAncestorReferenceFrames(i,n,this._scratchArray)[0];if(fe(o)){var s=i.position.getValueInReferenceFrame(n,o,this._scratchCartesian),a=i.orientation.getValue(n,this._scratchQuaternion);if(s&&a)return console.log("Updating local origin to "+JSON.stringify(s)+" at "+this._stringFromReferenceFrame(o)),t.position.setValue(s,o),void t.orientation.setValue(a)}t.position.setValue(ne.ZERO,i),t.orientation.setValue(xe.IDENTITY)}},e.prototype.updateEntityFromSerializedState=function(e,t){var i=this.entities.getOrCreateEntity(e);if(!t)return i.position&&i.position.setValue(void 0),i.orientation&&i.orientation.setValue(void 0),i.meta=void 0,i;var n=t.p,r=xe.clone(t.o,this._scratchQuaternion),o="number"==typeof t.r?t.r:this.entities.getOrCreateEntity(t.r),s=i.position,a=i.orientation;return s instanceof ce?s.setValue(n,o):i.position=new ce(n,o),a instanceof le?a.setValue(r):i.orientation=new le(r),i.meta=t.meta,i},e.prototype.getSubviewEntity=function(e){var t=this.entities.getOrCreateEntity("ar.view_"+e);return t.position||(t.position=new ce),t.orientation||(t.orientation=new le),t},e.prototype.subscribeGeolocation=function(e){var t=this;return this.sessionService.manager.whenConnected().then(function(){return t.sessionService.manager.version[0]>0&&t.sessionService.manager.send("ar.context.setGeolocationOptions",{options:e}),t.subscribe(t.stage.id).then(function(){})})},e.prototype.unsubscribeGeolocation=function(){this.unsubscribe(this.stage.id)},Object.defineProperty(e.prototype,"geoHeadingAccuracy",{get:function(){return this.user.meta&&this.user.meta.geoHeadingAccuracy},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"geoHorizontalAccuracy",{get:function(){return this.user.meta&&this.user.meta.geoHorizontalAccuracy||this.stage.meta&&this.stage.meta.geoHorizontalAccuracy},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"geoVerticalAccuracy",{get:function(){return this.user.meta&&this.user.meta.geoVerticalAccuracy||this.stage.meta&&this.stage.meta.geoVerticalAccuracy},enumerable:!0,configurable:!0}),e.prototype._stringFromReferenceFrame=function(e){var t=e;return fe(t.id)?t.id:""+t},e}()),Qi([q("timestamp"),Yi("design:type",Object),Yi("design:paramtypes",[])],Vi.prototype,"systemTime",null),Qi([q("time"),Yi("design:type",Function),Yi("design:paramtypes",[]),Yi("design:returntype","function"==typeof(Wi=void 0!==Ne&&Ne)&&Wi||Object)],Vi.prototype,"getTime",null),Qi([q("defaultReferenceFrame"),Yi("design:type",Function),Yi("design:paramtypes",["function"==typeof(Xi=void 0!==Me&&Me)&&Xi||Object]),Yi("design:returntype",void 0)],Vi.prototype,"setDefaultReferenceFrame",null),Qi([q("defaultReferenceFrame"),Yi("design:type",Function),Yi("design:paramtypes",[]),Yi("design:returntype","function"==typeof(Zi=void 0!==Me&&Me)&&Zi||Object)],Vi.prototype,"getDefaultReferenceFrame",null),Qi([q("subscribe"),Yi("design:type",Function),Yi("design:paramtypes",[String]),Yi("design:returntype","function"==typeof(Ki=void 0!==Me&&Me)&&Ki||Object)],Vi.prototype,"subscribeToEntityById",null),e("ContextService",Vi=Qi([N(),Yi("design:paramtypes",["function"==typeof(Ji=void 0!==bi&&bi)&&Ji||Object])],Vi)),e("ContextServiceProvider",Hi=function(){function e(e,t){var i=this;this.sessionService=e,this.contextService=t,this.entitySubscriptionsBySubscriber=new WeakMap,this.subscribersByEntityId=new Map,this.subscribersChangeEvent=new ei,this.publishingReferenceFrameMap=new Map,this._cacheTime=new Ne(0,0),this._entityPoseCache={},this._getSerializedEntityState=R,this._sessionEntities={},this._temp={},this.desiredGeolocationOptions={},this.sessionGeolocationOptions=new Map,this.publishingReferenceFrameMap.set(this.contextService.stage.id,be.FIXED),e.connectEvent.addEventListener(function(e){var t={};i.entitySubscriptionsBySubscriber.set(e,t),e.on["ar.context.subscribe"]=function(n){var r=n.id;if(!t[r]){var o=i.subscribersByEntityId.get(r)||new Set;i.subscribersByEntityId.set(r,o),o.add(e),t[r]=!0,i.subscribersChangeEvent.raiseEvent({id:r,subscribers:o}),e.closeEvent.addEventListener(function(){o.delete(e),i.subscribersChangeEvent.raiseEvent({id:r,subscribers:o})})}},e.on["ar.context.unsubscribe"]=function(n){var r=n.id;if(t[r]){var o=i.subscribersByEntityId.get(r);o&&o.delete(e),delete t[r],i.subscribersChangeEvent.raiseEvent({id:r,subscribers:o})}},e.on["ar.context.setGeolocationOptions"]=function(t){var n=t.options;i._handleSetGeolocationOptions(e,n)},e.closeEvent.addEventListener(function(){i.entitySubscriptionsBySubscriber.delete(e);for(var n in t){var r=i.subscribersByEntityId.get(n);r&&r.delete(e),i.subscribersChangeEvent.raiseEvent({id:n,subscribers:r})}})}),this.contextService.updateEvent.addEventListener(function(){i._publishUpdates()})}return e.prototype.fillEntityStateMapForSession=function(e,t,i){var n=this.entitySubscriptionsBySubscriber.get(e);if(n)for(var r in n){var o=this.contextService.entities.getById(r);i[r]=o?this._getCachedSerializedEntityState(o,t):null}},e.prototype._publishUpdates=function(){var e=this.contextService.serializedFrameState;this._cacheTime=Ne.clone(e.time,this._cacheTime);for(var t=0,i=this.sessionService.managedSessions;t0)},enumerable:!0,configurable:!0}),e}()),e("ContextServiceProvider",Hi=Qi([N(),Yi("design:paramtypes",["function"==typeof($i=void 0!==bi&&bi)&&$i||Object,Vi])],Hi)),en=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},tn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("FocusService",nn=function(){function e(e){var t=this;this.focusEvent=new ei,this.blurEvent=new ei,this._hasFocus=!1,e.manager.on["ar.focus.state"]=function(e){var i=e.state;t._hasFocus!==i&&(t._hasFocus=i,i?t.focusEvent.raiseEvent(void 0):t.blurEvent.raiseEvent(void 0))}}return Object.defineProperty(e.prototype,"hasFocus",{get:function(){return this._hasFocus},enumerable:!0,configurable:!0}),e}()),e("FocusService",nn=en([D(bi),tn("design:paramtypes",["function"==typeof(on=void 0!==bi&&bi)&&on||Object])],nn)),e("FocusServiceProvider",rn=function(){function e(e){var t=this;this.sessionService=e,this.sessionFocusEvent=new ei,e.ensureIsRealityManager(),e.manager.connectEvent.addEventListener(function(){setTimeout(function(){!t._session&&t.sessionService.manager.isConnected&&(t.session=t.sessionService.manager)})})}return Object.defineProperty(e.prototype,"session",{get:function(){return this._session},set:function(e){if(e&&!e.isConnected)throw new Error("Only a connected session can be granted focus");var t=this._session;t!==e&&(t&&t.send("ar.focus.state",{state:!1}),e&&e.send("ar.focus.state",{state:!0}),this._session=e,this.sessionFocusEvent.raiseEvent({previous:t,current:e}))},enumerable:!0,configurable:!0}),e}()),e("FocusServiceProvider",rn=en([D(bi,nn),tn("design:paramtypes",["function"==typeof(sn=void 0!==bi&&bi)&&sn||Object])],rn)),an=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},un=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("VisibilityService",cn=function(){function e(e){var t=this;this.showEvent=new ei,this.hideEvent=new ei,this._isVisible=!1,e.manager.on["ar.visibility.state"]=function(e){var i=e.state;t._isVisible!==i&&(t._isVisible=i,i?t.showEvent.raiseEvent(void 0):t.hideEvent.raiseEvent(void 0))},e.manager.closeEvent.addEventListener(function(){t._isVisible&&(t._isVisible=!1,t.hideEvent.raiseEvent(void 0))}),e.manager.connectEvent.addEventListener(function(){0===e.manager.version[0]&&(t._isVisible=!0,t.showEvent.raiseEvent(void 0))})}return Object.defineProperty(e.prototype,"isVisible",{get:function(){return this._isVisible},enumerable:!0,configurable:!0}),e}()),e("VisibilityService",cn=an([D(bi),un("design:paramtypes",["function"==typeof(hn=void 0!==bi&&bi)&&hn||Object])],cn)),e("VisibilityServiceProvider",ln=function(){function e(e){var t=this;this.visibleSessions=new Set,this.sessionChangeEvent=new ei,e.ensureIsRealityManager(),this.sessionChangeEvent.addEventListener(function(e){e.send("ar.visibility.state",{state:t.visibleSessions.has(e)})}),e.manager.connectEvent.addEventListener(function(){t.set(e.manager,!0)})}return e.prototype.set=function(e,t){t?this.visibleSessions.has(e)||(this.visibleSessions.add(e),this.sessionChangeEvent.raiseEvent(e)):this.visibleSessions.has(e)&&(this.visibleSessions.delete(e),this.sessionChangeEvent.raiseEvent(e))},e}()),e("VisibilityServiceProvider",ln=an([D(bi,cn),un("design:paramtypes",["function"==typeof(fn=void 0!==bi&&bi)&&fn||Object])],ln)),dn=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},pn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("Subview",Mn=function(){function e(){}return e}()),function(e){e[e.EMBEDDED=0]="EMBEDDED",e[e.PAGE=0]="PAGE",e[e.IMMERSIVE=1]="IMMERSIVE"}(gn||e("ViewportMode",gn={})),e("ViewElement",yn=function(){function e(){}return e}()),e("ViewService",An=function(){function e(e,t,i,n){var r=this;if(this.sessionService=e,this.contextService=t,this.focusService=i,this.uiEvent=new ei,this.viewportChangeEvent=new ei,this.viewportModeChangeEvent=new ei,this._mode=gn.EMBEDDED,this._viewport=new Wt,this._renderWidth=0,this._renderHeight=0,this.autoLayoutImmersiveMode=!0,this.autoStyleLayerElements=!0,this.autoPublishEmbeddedMode=!0,this._layers=[],this._subviews=[],this._subviewPose=[],this._subviewFrustum=[],this._IDENTITY_SUBVIEW_POSE={p:ne.ZERO,o:xe.IDENTITY,r:this.contextService.view.id},this._desiredViewportMode=this.viewportMode,this._embeddedViewport=new Wt,"undefined"!=typeof document&&document.createElement){var o=n;if(!o||"string"==typeof o){var s=o;if((o=s?document.querySelector(s):void 0)||s){if(!o)throw new Error("Unable to find element with selector: "+s)}else(o=document.querySelector("#argon"))||(o=document.createElement("div"),o.id="argon",document.body.appendChild(o))}if(this.element=o,o.classList.add("argon-view"),Ei){var a=function(e){e.touches.length>1&&e.preventDefault()};this.element.addEventListener("touchmove",a,!0),this.sessionService.manager.closeEvent.addEventListener(function(){r.element.removeEventListener("touchmove",a)})}this.focusService.focusEvent.addEventListener(function(){document.documentElement.classList.remove("argon-no-focus"),document.documentElement.classList.remove("argon-blur"),document.documentElement.classList.add("argon-focus")}),this.focusService.blurEvent.addEventListener(function(){document.documentElement.classList.remove("argon-focus"),document.documentElement.classList.add("argon-blur"),document.documentElement.classList.add("argon-no-focus")}),this.viewportModeChangeEvent.addEventListener(function(e){switch(e){case gn.EMBEDDED:document.documentElement.classList.remove("argon-immersive");break;case gn.IMMERSIVE:document.documentElement.classList.add("argon-immersive")}}),this.sessionService.isRealityViewer&&(this.sessionService.manager.on["ar.view.uievent"]=si()),this.sessionService.isRealityViewer||(_(this,function(e){r.sessionService.manager.isConnected&&r.sessionService.manager.version[0]>=1&&r.sessionService.manager.send("ar.view.forwardUIEvent",e)}),this._watchEmbeddedViewport())}e.manager.on["ar.view.viewportMode"]=function(e){var t=e.mode;r._updateViewportMode(t)},e.isRealityManager||this._updateViewportMode(gn.IMMERSIVE),e.manager.connectEvent.addEventListener(function(){0!==e.manager.version[0]&&e.isRealityManager||r._updateViewportMode(gn.IMMERSIVE)})}return Object.defineProperty(e.prototype,"viewportMode",{get:function(){return this._mode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"presentationMode",{get:function(){return this.viewportMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewport",{get:function(){return this._viewport},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderWidth",{get:function(){return this._renderWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderHeight",{get:function(){return this._renderHeight},enumerable:!0,configurable:!0}),e.prototype.getViewport=function(){return this.viewport},e.prototype.setLayers=function(e){if(this._layers)for(var t=0,i=this._layers;t0&&t.sessionService.manager.send("ar.view.desiredViewportMode",{mode:e})})},enumerable:!0,configurable:!0}),e.prototype._updateViewportMode=function(e){this.viewportMode!==e&&(this._mode=e,this.viewportModeChangeEvent.raiseEvent(e))},e.prototype.publishEmbeddedViewport=function(e){this.sessionService.manager.isConnected&&this.sessionService.manager.version[0]>=1&&this.sessionService.manager.send("ar.view.embeddedViewport",{viewport:e})},e.prototype._updateViewport=function(e){var t=this,i=JSON.stringify(e);this._layers.length&&this.autoStyleLayerElements&&requestAnimationFrame(function(){for(var i=-t._layers.length,n=0,r=t._layers;n0&&i.send("ar.view.viewportMode",{mode:n})}},e}()),e("ViewServiceProvider",wn=dn([N(),pn("design:paramtypes",["function"==typeof(On=void 0!==bi&&bi)&&On||Object,An,"function"==typeof(Ln=void 0!==rn&&rn)&&Ln||Object,"function"==typeof(Sn=void 0!==ln&&ln)&&Sn||Object])],wn)),"undefined"!=typeof document&&document.createElement&&(En=document.querySelector("meta[name=viewport]"),En||(En=document.createElement("meta")),En.name="viewport",En.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0",document.head.appendChild(En),mn=document.querySelector("meta[name=argon]"),mn||(mn=document.createElement("meta")),mn.name="argon",document.head.appendChild(mn),vn=document.createElement("style"),vn.type="text/css",document.head.insertBefore(vn,document.head.firstChild),Nn=vn.sheet,Nn.insertRule("\n #argon {\n position: fixed;\n width: 100%;\n height: 100%;\n left: 0;\n bottom: 0;\n margin: 0;\n border: 0;\n padding: 0;\n }\n ",Nn.cssRules.length),Nn.insertRule("\n .argon-view {\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n user-select: none;\n }\n ",Nn.cssRules.length),Nn.insertRule("\n .argon-immersive .argon-view {\n position: fixed !important;\n width: 100% !important;\n height: 100% !important;\n max-width: 100% !important;\n max-height: 100% !important;\n left: 0;\n bottom: 0;\n margin: 0;\n border: 0;\n padding: 0;\n visibility: visible;\n }\n ",Nn.cssRules.length),Nn.insertRule("\n .argon-immersive body {\n visibility: hidden;\n }\n ",Nn.cssRules.length),Nn.insertRule("\n .argon-interactive {\n pointer-events: auto;\n }\n ",Nn.cssRules.length)),_n=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},jn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("DeviceStableState",xn=function(){function e(){this.entities={},this.suggestedUserHeight=Yt,this.geolocationDesired=!1,this.geolocationOptions={},this.isPresentingHMD=!1,this.isPresentingRealityHMD=!1,this.strict=!1}return e}()),e("DeviceFrameState",Cn=function(){function e(){this._scratchFrustum=new Le,this.time=Ne.now(),this.viewport=new Xt,this.subviews=[{type:Zt.SINGULAR,pose:null,viewport:new Wt,projectionMatrix:(this._scratchFrustum.near=qt,this._scratchFrustum.far=Gt,this._scratchFrustum.fov=De.PI_OVER_THREE,this._scratchFrustum.aspectRatio=1,Ie.clone(this._scratchFrustum.projectionMatrix))}]}return e}()),e("DeviceService",bn=function(){function e(e,t,i,n){var r=this;if(this.sessionService=e,this.contextService=t,this.viewService=i,this.visibilityService=n,this.autoSubmitFrame=!0,this.frameState=new Cn,this.frameStateEvent=new ei,this.presentHMDChangeEvent=new ei,this.screenOrientationChangeEvent=new ei,this.stage=this.contextService.entities.add(new Me({id:"ar.device.stage",name:"Device Stage",position:void 0,orientation:void 0})),this.user=this.contextService.entities.add(new Me({id:"ar.device.user",name:"Device User",position:void 0,orientation:void 0})),this.defaultUserHeight=Yt,this._getEntityPositionInReferenceFrame=C,this._getEntityOrientationInReferenceFrame=b,this._scratchCartesian=new ne,this._scratchCartesian2=new ne,this._scratchFrustum=new Le,this._updatingFrameState=!1,this._updateFrameState=function(){if(r._updatingFrameState){r.requestAnimationFrame(r._updateFrameState);var e=r.frameState,t=Ne.now(e.time);r.onUpdateFrameState();for(var i=r.contextService.view.id,n=0;n0==!1&&(this._setupVRPresentChangeHandler(),navigator.getVRDisplays().then(function(e){r._vrDisplays=e,r._vrDisplay=e[0]})),"undefined"!=typeof window&&window.addEventListener){var o=function(){r.screenOrientationChangeEvent.raiseEvent(void 0)};window.addEventListener("orientationchange",o),e.manager.closeEvent.addEventListener(function(){window.removeEventListener("orientationchange",o)})}}return Object.defineProperty(e.prototype,"geoHeadingAccuracy",{get:function(){return this.user.meta?this.user.meta.geoHeadingAccuracy:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"geoHorizontalAccuracy",{get:function(){return this.stage.meta?this.stage.meta.geoHorizonatalAccuracy:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"geoVerticalAccuracy",{get:function(){return this.stage.meta?this.stage.meta.geoVerticalAccuracy:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"geolocationDesired",{get:function(){return this._parentState&&this._parentState.geolocationDesired||!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"geolocationOptions",{get:function(){return this._parentState&&this._parentState.geolocationOptions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"suggestedUserHeight",{get:function(){return this._parentState&&this._parentState.suggestedUserHeight||this.isPresentingHMD?this.defaultUserHeight:this.defaultUserHeight/2},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"strict",{get:function(){return!(!this._parentState||!this._parentState.strict)||this._hasPolyfillWebVRDisplay()||!1},enumerable:!0,configurable:!0}),e.prototype._processContextFrameState=function(e){var t=e.time,i=this.contextService,n=e.entities,r=this.stage,o=i.stage;if(void 0===n[o.id]){var s=o.position,a=o.orientation;s.setValue(ne.ZERO,r),a.setValue(xe.IDENTITY)}var u=this.user,c=i.user;if(void 0===n[c.id]){var l=this._getEntityPositionInReferenceFrame(u,t,r,this._scratchCartesian),h=this._getEntityOrientationInReferenceFrame(u,t,r,this._scratchQuaternion),f=c.position,d=c.orientation;f.setValue(l,o),d.setValue(h)}var p=i.view;if(void 0===n[p.id]){var M=p.position,g=p.orientation;M.setValue(ne.ZERO,c),g.setValue(xe.IDENTITY)}if(void 0===n[i.floor.id]){i.floor.position.setValue(ne.ZERO,o)}if(this.sessionService.manager.isConnected&&0===this.sessionService.manager.version[0]){var y=this._getEntityPositionInReferenceFrame(c,t,be.FIXED,this._scratchCartesian);if(y){var A=ke.eastNorthUpToFixedFrame(y,void 0,this._scratchMatrix4),w=Ie.getRotation(A,this._scratchMatrix3),E=xe.fromRotationMatrix(w);o.position.setValue(y,be.FIXED),o.orientation.setValue(E)}}},e.prototype._processStableState=function(e){var t=e.entities,i=this.contextService;if(t)for(var n in t)i.updateEntityFromSerializedState(n,t[n]);this._parentState=e},Object.defineProperty(e.prototype,"screenOrientationDegrees",{get:function(){return"undefined"!=typeof window?screen.orientation&&-screen.orientation.angle||-window.orientation||0:0},enumerable:!0,configurable:!0}),e.prototype.getScreenOrientationDegrees=function(){return this.getScreenOrientationDegrees},e.prototype._startUpdates=function(){var e=this;this._updatingFrameState||this.requestAnimationFrame(this._updateFrameState),this._updatingFrameState=!0,this.sessionService.manager.whenConnected().then(function(){e.sessionService.manager.version[0]>0&&e.sessionService.manager.send("ar.device.startUpdates")})},e.prototype._stopUpdates=function(){var e=this;this._updatingFrameState=!1,this.sessionService.manager.whenConnected().then(function(){e.sessionService.manager.version[0]>0&&e.sessionService.manager.send("ar.device.stopUpdates")})},e.prototype.onUpdateFrameState=function(){this._updateViewport(),this._vrDisplay&&this._vrDisplay.isPresenting?this._updateForWebVR():this._updateDefault()},e.prototype._updateViewport=function(){var e=this._parentState,t=this.frameState,i=t.viewport;if(e&&e.viewport)Xt.clone(e.viewport,i);else{var n=this.viewService.element;i.x=0,i.y=0,i.width=n&&n.clientWidth||0,i.height=n&&n.clientHeight||0;var r=this._vrDisplay;if(r&&r.isPresenting){var o=r.getEyeParameters("left"),s=r.getEyeParameters("right"),a=t.viewport;a.renderWidthScaleFactor=2*Math.max(o.renderWidth,s.renderWidth)/a.width,a.renderHeightScaleFactor=Math.max(o.renderHeight,s.renderHeight)/a.height}else i.renderHeightScaleFactor=1,i.renderWidthScaleFactor=1}},e.prototype._updateDefault=function(){this._updateUserDefault();var e=this._parentState,t=this.frameState,i=t.viewport;e&&e.viewport&&Xt.clone(e.viewport,i);var n=t.subviews;if(e&&e.subviews)$t.clone(e.subviews,n);else{n.length=1;var r=n[0]||{};r.type=Zt.SINGULAR,r.viewport.x=0,r.viewport.y=0,r.viewport.width=i.width,r.viewport.height=i.height;var o=i.width/i.height,s=this._scratchFrustum;s.near=qt,s.far=Gt,s.fov=De.PI_OVER_THREE,s.aspectRatio=isFinite(o)&&0!==o?o:1,r.projectionMatrix=Ie.clone(s.projectionMatrix,r.projectionMatrix);var a=this.getSubviewEntity(0);a.position.setValue(ne.ZERO,this.user),a.orientation.setValue(xe.IDENTITY)}},e.prototype._updateForWebVR=function(){var e=this._vrDisplay;if(e){var t=this.frameState,i=this._vrFrameData=this._vrFrameData||new VRFrameData;if(!e.getFrameData(i))return this.frameState;var n=e.getLayers()[0],r=n&&n.leftBounds,o=n&&n.rightBounds;n?(r=n.leftBounds&&4===n.leftBounds.length?n.leftBounds:this._defaultLeftBounds,o=n.rightBounds&&4===n.rightBounds.length?n.rightBounds:this._defaultRightBounds):(r=this._defaultLeftBounds,o=this._defaultRightBounds);var s=t.viewport,a=t.subviews=t.subviews||[];a.length=2;var u=a[0]=a[0]||{},c=a[1]=a[1]||{};u.type=Zt.LEFTEYE,c.type=Zt.RIGHTEYE;var l=u.viewport=u.viewport||{};l.x=r[0]*s.width,l.y=r[1]*s.height,l.width=r[2]*s.width,l.height=r[3]*s.height;var h=c.viewport=c.viewport||{};h.x=o[0]*s.width,h.y=o[1]*s.height,h.width=o[2]*s.width,h.height=o[3]*s.height,u.projectionMatrix=Ie.clone(i.leftProjectionMatrix,u.projectionMatrix),c.projectionMatrix=Ie.clone(i.rightProjectionMatrix,c.projectionMatrix);var f=e.stageParameters?e.stageParameters.sittingToStandingTransform:Ie.IDENTITY,d=Ie.getRotation(f,this._scratchMatrix3),p=xe.fromRotationMatrix(d,this._scratchQuaternion),M=this.user,g=this.vrStandingSpace,y=i.pose.position?ne.unpack(i.pose.position,0,this._scratchCartesian):void 0,A=y?Ie.multiplyByPoint(f,y,this._scratchCartesian):void 0,w=i.pose.orientation?xe.unpack(i.pose.orientation,0,this._scratchQuaternion2):void 0,E=w?xe.multiply(p,w,this._scratchQuaternion):void 0;if(M.position||(M.position=new ce),M.orientation||(M.orientation=new le),M.position.setValue(A,g),M.orientation.setValue(E),A&&E){var m=Ie.inverseTransformation(i.leftViewMatrix,this._scratchMatrix4),v=Ie.multiplyTransformation(f,m,this._scratchMatrix4),N=this.getSubviewEntity(0),D=Ie.getTranslation(v,this._scratchCartesian),T=Ie.getRotation(v,this._scratchMatrix3),I=xe.fromRotationMatrix(T,this._scratchQuaternion);N.position.setValue(D,g),N.orientation.setValue(I);var O=Ie.inverseTransformation(i.rightViewMatrix,this._scratchMatrix4),L=Ie.multiplyTransformation(f,O,this._scratchMatrix4),S=this.getSubviewEntity(1),_=Ie.getTranslation(L,this._scratchCartesian),j=Ie.getRotation(L,this._scratchMatrix3),x=xe.fromRotationMatrix(j,this._scratchQuaternion);S.position.setValue(_,g),S.orientation.setValue(x)}e.displayName.match(/polyfill/g)&&(M.position.setValue(void 0,void 0),M.orientation.setValue(void 0),this._updateUserDefault())}},e.prototype._hasPolyfillWebVRDisplay=function(){return!!this._vrDisplay&&!!this._vrDisplay.displayName.match(/polyfill/g)},e.prototype.onRequestPresentHMD=function(){if(this._vrDisplay){var e=this.viewService.element,t=[{source:this.viewService.layers[0]&&this.viewService.layers[0].source||e.querySelector("canvas")||e.lastElementChild}];return this._vrDisplay.requestPresent(t).catch(function(e){throw e})}throw new Error("No HMD available")},e.prototype.onExitPresentHMD=function(){return this._vrDisplay&&this._vrDisplay.isPresenting?this._vrDisplay.exitPresent():Promise.resolve()},e.prototype.createContextFrameState=function(e,t,i,n){for(var r=0,o=i;r0&&t.send("ar.device.setGeolocationOptions",{options:e}),this.contextService.subscribe(this.stage.id,t).then(function(){})},e.prototype.unsubscribeGeolocation=function(e){void 0===e&&(e=this.sessionService.manager),this.contextService.unsubscribe(this.stage.id,e)},Object.defineProperty(e.prototype,"isPresentingHMD",{get:function(){return this._parentState&&this._parentState.isPresentingHMD||this._vrDisplay&&this._vrDisplay.isPresenting||!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isPresentingRealityHMD",{get:function(){return this._parentState&&this._parentState.isPresentingRealityHMD||this._vrDisplay&&this._vrDisplay.isPresenting&&!!this._vrDisplay.displayName.match(/polyfill/g)||!1},enumerable:!0,configurable:!0}),e.prototype.requestPresentHMD=function(){if(!this.sessionService.manager.isConnected)throw new Error("Session must be connected");return this.sessionService.isRealityManager?this.onRequestPresentHMD():this.sessionService.manager.request("ar.device.requestPresentHMD")},e.prototype.exitPresentHMD=function(){if(!this.sessionService.manager.isConnected)throw new Error("Session must be connected");return this.sessionService.isRealityManager?this.onExitPresentHMD():this.sessionService.manager.request("ar.device.exitPresentHMD")},e.prototype._updateUserDefault=function(){var e=this.user,t=this.stage,i=this._deviceOrientation;if(this._tryOrientationUpdates(),!i)return e.position=void 0,void(e.orientation=void 0);var n=xe.fromAxisAngle(ne.UNIT_Z,this.screenOrientationDegrees*De.RADIANS_PER_DEGREE,this._scratchQuaternion);e.position||(e.position=new ce),e.orientation||(e.orientation=new le),e.position.setValue(ne.fromElements(0,0,this.suggestedUserHeight,this._scratchCartesian),t),e.orientation.setValue(xe.multiply(i,n,this._scratchQuaternion)),e.meta=e.meta||{},e.meta.geoHeadingAccuracy=this._deviceOrientationHeadingAccuracy},e.prototype._tryOrientationUpdates=function(){var e=this;if("undefined"!=typeof window&&window.addEventListener&&!fe(this._deviceOrientationListener)){var t=void 0;this._deviceOrientationListener=function(i){var n=i.alpha,r=i.webkitCompassHeading,o=+i.webkitCompassAccuracy;if(fe(n)&&(i.absolute&&(t=0),e._deviceOrientationHeadingAccuracy=o>0?o:void 0,(!fe(t)||Math.abs(0)>5)&&fe(r)&&o>=0&&o<80&&r>=0&&(fe(t)?t-=0:t=-r),fe(t)&&fe(i.alpha)&&fe(i.beta)&&fe(i.gamma))){var s=De.RADIANS_PER_DEGREE*(i.alpha+t||-r||0),a=De.RADIANS_PER_DEGREE*i.beta,u=De.RADIANS_PER_DEGREE*i.gamma,c=xe.fromAxisAngle(ne.UNIT_Z,s,e._scratchQuaternion),l=xe.fromAxisAngle(ne.UNIT_X,a,e._scratchQuaternion2),h=xe.multiply(c,l,e._scratchQuaternion),f=xe.fromAxisAngle(ne.UNIT_Y,u,e._scratchQuaternion2),d=xe.multiply(h,f,e._scratchQuaternion);e._deviceOrientation=xe.clone(d,e._deviceOrientation),e._deviceOrientationHeadingAccuracy=o}},"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",this._deviceOrientationListener):"ondeviceorientation"in window&&window.addEventListener("deviceorientation",this._deviceOrientationListener)}},e.prototype._setupVRPresentChangeHandler=function(){var e=this;if("undefined"!=typeof window&&window.addEventListener){this.viewService.viewportModeChangeEvent.addEventListener(function(t){t===gn.PAGE&&e._vrDisplay&&e._vrDisplay.displayName.match(/polyfill/g)&&e.exitPresentHMD()});var t,i,n=function(n){var r=e.viewService,o=n.display||n.detail.vrdisplay||n.detail.display;o&&(o.isPresenting?(e._vrDisplay=o,o.displayName.match(/polyfill/g)&&(t=o.getLayers()[0].source,t&&t.classList.add("argon-interactive"),i=r.viewportMode,r.desiredViewportMode=gn.IMMERSIVE),e.requestPresentHMD()):(t&&o.displayName.match(/polyfill/g)&&(t.classList.remove("argon-interactive"),t=void 0,r.desiredViewportMode=i),e.exitPresentHMD()))};window.addEventListener("vrdisplaypresentchange",n)}},e}()),e("DeviceService",bn=_n([N(),jn("design:paramtypes",["function"==typeof(zn=void 0!==bi&&bi)&&zn||Object,"function"==typeof(Pn=void 0!==Vi&&Vi)&&Pn||Object,"function"==typeof(Un=void 0!==An&&An)&&Un||Object,"function"==typeof(Bn=void 0!==cn&&cn)&&Bn||Object])],bn)),e("DeviceServiceProvider",Rn=function(){function e(e,t,i,n,r){var o=this;this.sessionService=e,this.deviceService=t,this.contextService=i,this.viewService=n,this.contextServiceProvider=r,this._subscribers={},this._needsPublish=!1,this._publishTime=new Ne(0,0),this._stableState=new xn,this._targetGeolocationOptions={},this._sessionGeolocationOptions=new Map,this._scratchCartesianLocalOrigin=new ne,this._scratchQuaternionLocalOrigin=new xe,this._scratchFrustum=new Le,this._identityHPR=new me,this._scratchCartographic=new oe,this.contextServiceProvider.publishingReferenceFrameMap.set(t.stage.id,be.FIXED),this.contextServiceProvider.publishingReferenceFrameMap.set(t.user.id,t.stage.id),this.sessionService.connectEvent.addEventListener(function(e){e.on["ar.device.requestFrameState"]=function(){return o._subscribers[e.id]=e,new Promise(function(e){var t=o.deviceService.frameStateEvent.addEventListener(function(i){e(i),t()})})},e.on["ar.device.startUpdates"]=function(){o._subscribers[e.id]=e},e.on["ar.device.stopUpdates"]=function(){delete o._subscribers[e.id]},e.on["ar.device.setGeolocationOptions"]=function(t){o._handleSetGeolocationOptions(e,t)},e.on["ar.device.requestPresentHMD"]=function(){return o.handleRequestPresentHMD(e)},e.on["ar.device.exitPresentHMD"]=function(){return o.handleExitPresentHMD(e)}}),this.contextServiceProvider.subscribersChangeEvent.addEventListener(function(e){var t=e.id;o.deviceService.stage.id!==t&&o.contextService.stage.id!==t||o._checkDeviceGeolocationSubscribers()}),this.viewService.viewportChangeEvent.addEventListener(function(){o._needsPublish=!0}),this.viewService.viewportModeChangeEvent.addEventListener(function(){o._needsPublish=!0}),this.deviceService.presentHMDChangeEvent.addEventListener(function(){o._needsPublish=!0}),this.deviceService.screenOrientationChangeEvent.addEventListener(function(){o._needsPublish=!0}),this.deviceService.frameStateEvent.addEventListener(function(){o._needsPublish&&o.publishStableState()})}return e.prototype.handleRequestPresentHMD=function(e){return this.deviceService.requestPresentHMD()},e.prototype.handleExitPresentHMD=function(e){return this.deviceService.exitPresentHMD()},e.prototype.publishStableState=function(){var e=this._stableState;e.geolocationDesired=this.contextServiceProvider.geolocationDesired,e.geolocationOptions=e.geolocationOptions||{},e.geolocationOptions.enableHighAccuracy=this.contextServiceProvider.desiredGeolocationOptions.enableHighAccuracy,e.suggestedUserHeight=this.deviceService.suggestedUserHeight,e.strict=this.deviceService.strict,e.viewport=Xt.clone(this.deviceService.frameState.viewport,e.viewport),e.subviews=$t.clone(this.deviceService.frameState.subviews,e.subviews),this.onUpdateStableState(this._stableState),Ne.now(this._publishTime);for(var t in this._subscribers){var i=this._subscribers[t];if(i.version[0]>0){for(var n in e.entities)delete e.entities[n];this.contextServiceProvider.fillEntityStateMapForSession(i,this._publishTime,e.entities),i.send("ar.device.state",e)}}this._needsPublish=!1},e.prototype.onUpdateStableState=function(e){},e.prototype._checkDeviceGeolocationSubscribers=function(){var e=this.contextServiceProvider.subscribersByEntityId.get(this.deviceService.stage.id);e&&e.size>0?(this._updateTargetGeolocationOptions(),JSON.stringify(this._targetGeolocationOptions)!==JSON.stringify(this._currentGeolocationOptions)&&(this._currentGeolocationOptions=this._targetGeolocationOptions,this.onStopGeolocationUpdates(),this.onStartGeolocationUpdates(this._targetGeolocationOptions))):(this.onStopGeolocationUpdates(),this._currentGeolocationOptions=void 0),this._needsPublish=!0},e.prototype._handleSetGeolocationOptions=function(e,t){var i=this;this._sessionGeolocationOptions.set(e,t),e.closeEvent.addEventListener(function(){i._sessionGeolocationOptions.delete(e)})},e.prototype._updateTargetGeolocationOptions=function(){var e={};this._sessionGeolocationOptions.forEach(function(t,i){e.enableHighAccuracy=e.enableHighAccuracy||t&&t.enableHighAccuracy||!1}),this._targetGeolocationOptions.enableHighAccuracy!==e.enableHighAccuracy&&(this._targetGeolocationOptions=e),this._needsPublish=!0},e.prototype.configureStage=function(e,t,i){var n=this;if(!fe(i)&&0===e.height)return void G(e).then(function(){return n.configureStage(e,t,0)});var r=this.deviceService.stage,o=ne.fromRadians(e.longitude,e.latitude,e.height,void 0,this._scratchCartesianLocalOrigin),s=ke.headingPitchRollQuaternion(o,this._identityHPR,void 0,this._scratchQuaternionLocalOrigin);r.position=r.position||new ce,r.orientation=r.orientation||new le,r.position.setValue(o,be.FIXED),r.orientation.setValue(s),r.meta={geoHorizontalAccuracy:t,geoVerticalAccuracy:i}},e.prototype.onStartGeolocationUpdates=function(e){var t=this;if("undefined"==typeof navigator||!navigator.geolocation)throw new Error("Unable to start geolocation updates");fe(this._geolocationWatchId)||(this._geolocationWatchId=navigator.geolocation.watchPosition(function(e){var i=e.coords.longitude,n=e.coords.latitude,r=e.coords.altitude,o=oe.fromDegrees(i,n,r||0,t._scratchCartographic);t.configureStage(o,e.coords.accuracy>0?e.coords.accuracy:void 0,e.coords.altitudeAccuracy||void 0)},function(e){console.warn("Unable to start geolocation updates: "+e.message)},e))},e.prototype.onStopGeolocationUpdates=function(){"undefined"!=typeof navigator&&fe(this._geolocationWatchId)&&(navigator.geolocation.clearWatch(this._geolocationWatchId),this._geolocationWatchId=void 0)},e}()),e("DeviceServiceProvider",Rn=_n([N(),jn("design:paramtypes",["function"==typeof(kn=void 0!==bi&&bi)&&kn||Object,bn,"function"==typeof(Fn=void 0!==Vi&&Vi)&&Fn||Object,"function"==typeof(Qn=void 0!==An&&An)&&Qn||Object,"function"==typeof(Yn=void 0!==Hi&&Hi)&&Yn||Object])],Rn)),e("RealityViewer",qn=function(){function e(e){var t=this;this.uri=e,this.providedReferenceFrames=[],this.connectEvent=new ei,this.presentChangeEvent=new ei,this._isPresenting=!1,this.connectEvent.addEventListener(function(e){t._session&&t._session.close(),t._session=e,e.closeEvent.addEventListener(function(){t._session===e&&(t._session=void 0)})})}return Object.defineProperty(e.prototype,"isPresenting",{get:function(){return this._isPresenting},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"session",{get:function(){return this._session},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.setPresenting(!1),this.session&&this.session.close()},e.prototype.setPresenting=function(e){this._isPresenting!==e&&(this._isPresenting=e,this.presentChangeEvent.raiseEvent(void 0))},e.getType=function(e){if(void 0!==e)return"reality"===e.split(":")[0]?e:"hosted"},e}()),qn.DEFAULT="reality:default",qn.EMPTY="reality:empty",qn.LIVE="reality:live",Gn=function(e,t){function i(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Vn=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Hn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("EmptyRealityViewer",Wn=function(e){function t(t,i,n,r,o){function s(e){switch(e){case"W".charCodeAt(0):return"moveForward";case"S".charCodeAt(0):return"moveBackward";case"E".charCodeAt(0):return"moveUp";case"R".charCodeAt(0):return"moveDown";case"D".charCodeAt(0):return"moveRight";case"A".charCodeAt(0):return"moveLeft";default:return}}var a=e.call(this,o)||this;a.sessionService=t,a.contextService=i,a.viewService=n,a.deviceService=r,a.uri=o,a.type="empty",a._moveFlags={moveForward:!1,moveBackward:!1,moveUp:!1,moveDown:!1,moveLeft:!1,moveRight:!1},a._scratchMatrix3=new Te,a._scratchMatrix4=new Ie;var u=function(e){var t=s(e.keyCode);void 0!==t&&(a._moveFlags[t]=!0)},c=function(e){var t=s(e.keyCode);void 0!==t&&(a._moveFlags[t]=!1)};return"undefined"!=typeof document&&a.presentChangeEvent.addEventListener(function(){if(a.isPresenting)!a._aggregator&&a.viewService.element&&(a.viewService.element.disableRootEvents=!0,a._aggregator=new ee(a.viewService.element),document.addEventListener("keydown",u,!1),document&&document.addEventListener("keyup",c,!1));else{a._aggregator&&a._aggregator.destroy(),a._aggregator=void 0,document&&document.removeEventListener("keydown",u),document&&document.removeEventListener("keyup",c);for(var e in a._moveFlags)a._moveFlags[e]=!1}}),a}return Gn(t,e),t.prototype.load=function(){var e=this,t=this.sessionService.addManagedSessionPort(this.uri);t.connectEvent.addEventListener(function(){e.connectEvent.raiseEvent(t)});var i=this.sessionService.createSessionPort(this.uri);i.suppressErrorOnUnknownTopic=!0;var n,r;i.on["argon.configureStage.setStageGeolocation"]=function(t){var i=t.geolocation;n=ne.fromRadians(i.longitude,i.latitude,i.height,void 0,n);var o=ci(n,void 0,e._scratchMatrix4),s=Ie.getRotation(o,e._scratchMatrix3);r=xe.fromRotationMatrix(s,r)},i.on["argon.configureStage.resetStageGeolocation"]=function(){n=void 0,r=void 0},i.connectEvent.addEventListener(function(){var t=new xe,o=new xe,s=new ne,a=new ne,u=new Te,c=new ne(0,0,1),l=new ne(1,0,0),h=new ne(0,-1,0),f=new Le,d=e.deviceService.stage,p=e.deviceService.user,M=new ne(0,0,-1),g=xe.fromAxisAngle(ne.UNIT_X,De.PI_OVER_TWO),y=[],A=e.contextService.createEntityPose(p,d),w=!1,E=e.deviceService.frameStateEvent.addEventListener(function(d){if(!i.isClosed){var p=e._aggregator,E=e._moveFlags;if(!e.isPresenting)return void(p&&p.reset());if(e.deviceService.geolocationDesired?w||(w=!0,e.deviceService.subscribeGeolocation(e.deviceService.geolocationOptions,i)):w&&(w=!1,e.deviceService.unsubscribeGeolocation(i)),$t.clone(d.subviews,y),!e.deviceService.strict){if(k(y[0].projectionMatrix,f),f.fov=e.viewService.subviews[0]&&e.viewService.subviews[0].frustum.fov||De.PI_OVER_THREE,p&&p.isMoving(te.WHEEL)){var m=p.getMovement(te.WHEEL),v=m.endPosition.y;f.fov=Math.min(Math.max(f.fov-.02*v,Math.PI/8),Math.PI-Math.PI/8)}if(p&&p.isMoving(te.PINCH)){var N=p.getMovement(te.PINCH),v=N.distance.endPosition.y-N.distance.startPosition.y;f.fov=Math.min(Math.max(f.fov-.02*v,Math.PI/8),Math.PI-Math.PI/8)}y.forEach(function(e){var t=e.viewport.width/e.viewport.height;f.aspectRatio=isFinite(t)?t:1,Ie.clone(f.projectionMatrix,e.projectionMatrix)})}var D=d.time;A.update(D);var T=!(A.status&Gi.KNOWN);if(T){var I=e.contextService.user,O=e.contextService.stage,L=C(I,D,O,s)||ne.clone(ne.ZERO,s),S=b(I,D,O,t)||xe.clone(g,t);if(p&&p.isMoving(te.LEFT_DRAG)){var _=p.getMovement(te.LEFT_DRAG);if(S){var j=xe.fromAxisAngle(ne.UNIT_Y,f.fov*(_.endPosition.x-_.startPosition.x)/d.viewport.width,o);S=xe.multiply(S,j,j),I.orientation.setValue(S)}}Te.fromQuaternion(S,u),Te.multiplyByVector(u,ne.UNIT_Y,c),Te.multiplyByVector(u,ne.UNIT_X,l),Te.multiplyByVector(u,M,h);E.moveForward&&(ne.multiplyByScalar(h,.02,a),ne.add(L,a,L)),E.moveBackward&&(ne.multiplyByScalar(h,-.02,a),ne.add(L,a,L)),E.moveUp&&(ne.multiplyByScalar(c,.02,a),ne.add(L,a,L)),E.moveDown&&(ne.multiplyByScalar(c,-.02,a),ne.add(L,a,L)),E.moveLeft&&(ne.multiplyByScalar(l,-.02,a),ne.add(L,a,L)),E.moveRight&&(ne.multiplyByScalar(l,.02,a),ne.add(L,a,L)),I.position.setValue(L,O),I.orientation.setValue(S)}var x=!(!n||!r);if(x){var O=e.contextService.stage;O.position.setValue(n,be.FIXED),O.orientation.setValue(r)}var R=e.deviceService.createContextFrameState(D,d.viewport,y,{overrideUser:T,overrideStage:x});i.send("ar.reality.frameState",R),p&&p.reset()}});i.closeEvent.addEventListener(function(){E()})}),Promise.resolve().then(function(){if(!e.sessionService.manager.isClosed){var n=e.sessionService.createSynchronousMessageChannel();t.open(n.port1,e.sessionService.configuration),i.open(n.port2,{role:Vt.REALITY_VIEWER,uri:e.uri,title:"Empty",version:e.sessionService.configuration.version,protocols:["argon.configureStage@v1"]})}})},t}(qn)),e("EmptyRealityViewer",Wn=Vn([D(bi,Vi,An,bn),Hn("design:paramtypes",["function"==typeof(Xn=void 0!==bi&&bi)&&Xn||Object,"function"==typeof(Zn=void 0!==Vi&&Vi)&&Zn||Object,"function"==typeof(Kn=void 0!==An&&An)&&Kn||Object,"function"==typeof(Jn=void 0!==bn&&bn)&&Jn||Object,String])],Wn)),$n=function(e,t){function i(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},er=function(e,t,i,n){ -var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},tr=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("LiveRealityViewer",ir=function(e){function t(t,i,n,r){var o=e.call(this,r)||this;if(o.sessionService=t,o.viewService=i,o.deviceService=n,o.uri=r,"undefined"!=typeof document){o.settingsIframe=document.createElement("iframe"),o.settingsIframe.width="0",o.settingsIframe.height="0",o.settingsIframe.src="https://argonjs.io/tools.argonjs.io/",o.settingsIframe.style.display="none",o.videoFov=Math.PI/2,o.videoElement=document.createElement("video"),o.videoElement.style.width="100%",o.videoElement.style.height="height:100%",o.videoElement.controls=!1,o.videoElement.autoplay=!0,o.videoElement.style.display="none",o.videoElement.style.zIndex="-100";var s=o.viewService.element;s.insertBefore(o.settingsIframe,s.firstChild),s.insertBefore(o.videoElement,s.firstChild),o.canvas=document.createElement("canvas"),o.context=o.canvas.getContext("2d"),window.addEventListener("message",function(e){"http://argonjs.io"===e.origin&&(o.videoFov=e.data)})}return o.presentChangeEvent.addEventListener(function(){"undefined"!=typeof document&&(o.videoElement.style.display=o.isPresenting?"initial":"none")}),o}return $n(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),"undefined"!=typeof document&&(this.settingsIframe.remove(),this.videoElement.remove(),this.canvas.remove())},t.prototype.setupInternalSession=function(e){var t=this;e.connectEvent.addEventListener(function(){if(t.videoElement){var i=t.videoElement,n=navigator.mediaDevices;(n.getUserMedia||n.mozGetUserMedia||n.msGetUserMedia||n.webkitGetUserMedia).bind(n)({audio:!1,video:!0}).then(function(t){var n=function(){for(var e=0,i=t.getTracks();e=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},ur=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("HostedRealityViewer",cr=function(e){function t(t,i,n){var r=e.call(this,n)||this;if(r.sessionService=t,r.viewService=i,r.uri=n,r.type="hosted","undefined"!=typeof document&&document.createElement){var o=r.iframeElement=document.createElement("iframe");o.name=O(),o.style.border="0",o.width="100%",o.height="100%",o.style.position="absolute",o.style.opacity="0",o.style.pointerEvents="none",o.style.zIndex="-100";var s=r.viewService.element;s.insertBefore(o,s.firstChild),r.presentChangeEvent.addEventListener(function(){r.iframeElement.style.opacity=r.isPresenting?"1":"0"})}return r}return sr(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),this.iframeElement&&this.iframeElement.remove()},t.prototype.load=function(){var e=this;if("undefined"!=typeof document&&document.createElement){var t=this.sessionService.addManagedSessionPort(this.uri);t.connectEvent.addEventListener(function(){e.sessionService.manager.isClosed||e.connectEvent.raiseEvent(t)});var i=function(n){if("ARGON_SESSION"===n.data.type){var r=n.data.name,o=n.ports&&n.ports[0];if(!o)throw new Error("Received an ARGON_SESSION message without a MessagePort object");r===e.iframeElement.name&&(window.removeEventListener("message",i),t.open(o,e.sessionService.configuration))}};window.addEventListener("message",i),this.iframeElement.src="",this.iframeElement.src=this.uri}},t}(qn)),e("HostedRealityViewer",cr=ar([D(bi,An),ur("design:paramtypes",["function"==typeof(lr=void 0!==bi&&bi)&&lr||Object,"function"==typeof(hr=void 0!==An&&An)&&hr||Object,String])],cr)),fr=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},dr=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("RealityViewerFactory",pr=function(){function e(e,t,i){this._createEmptyReality=e,this._createLiveReality=t,this._createHostedReality=i}return e.prototype.createRealityViewer=function(e){switch(qn.getType(e)){case qn.EMPTY:return this._createEmptyReality(e);case qn.LIVE:return this._createLiveReality(e);case"hosted":return this._createHostedReality(e);default:throw new Error("Unsupported Reality Viewer: "+e)}},e}()),e("RealityViewerFactory",pr=fr([D(Tt.of(Wn),Tt.of(ir),Tt.of(cr)),dr("design:paramtypes",[Object,Object,Object])],pr)),e("RealityService",Mr=function(){function e(e,t){var i=this;this.sessionService=e,this.contextService=t,this._connectEvent=new ei,this._changeEvent=new ei,this.default=qn.EMPTY,e.manager.on["ar.reality.connect"]=function(e){var t=e.id,n=i.sessionService.createSessionPort(t),r=i.sessionService.createSynchronousMessageChannel(),o="ar.reality.message.route."+t,s="ar.reality.message.send."+t,a="ar.reality.close."+t;r.port1.onmessage=function(e){i.sessionService.manager.send(o,e.data)},i.sessionService.manager.on[s]=function(e){r.port1.postMessage(e)},i.sessionService.manager.on[a]=function(){n.close()},n.connectEvent.addEventListener(function(){i.connectEvent.raiseEvent(n)}),i.sessionService.manager.closeEvent.addEventListener(function(){n.close(),delete i.sessionService.manager.on[s],delete i.sessionService.manager.on[a]}),n.open(r.port2,i.sessionService.configuration)};var n=0;this.contextService.frameStateEvent.addEventListener(function(t){if(e.isRealityViewer&&e.manager.isConnected)if(e.manager.isConnected&&0===e.manager.version[0]){var r=t.eye=t.eye||{};r.pose=t.entities["ar.user"],r.viewport=Wt.clone(t.subviews[0].viewport,r.viewport),delete t.entities["ar.user"],n++%2==0&&e.manager.send("ar.reality.frameState",t),t.entities["ar.user"]=r.pose}else e.manager.send("ar.reality.frameState",t);var o=t.reality,s=i._current;s!==o&&(i._current=o,i.changeEvent.raiseEvent({previous:s,current:o}))})}return Object.defineProperty(e.prototype,"connectEvent",{get:function(){return this._connectEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"changeEvent",{get:function(){return this._changeEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"current",{get:function(){return this._current},enumerable:!0,configurable:!0}),e.prototype.install=function(e){var t=this;return this.sessionService.manager.whenConnected().then(function(){return t.sessionService.manager.version[0]>=1!=!0?Promise.reject(new Error("Not supported")):t.sessionService.manager.request("ar.reality.install",{uri:e})})},e.prototype.uninstall=function(e){var t=this;return this.sessionService.manager.whenConnected().then(function(){return t.sessionService.manager.version[0]>=1!=!0?Promise.reject(new Error("Not supported")):t.sessionService.manager.request("ar.reality.uninstall",{uri:e})})},e.prototype.request=function(e){var t=this;return this.sessionService.manager.whenConnected().then(function(){return t.sessionService.manager.version[0]>=1!=!0?t.sessionService.manager.request("ar.reality.desired",{reality:{uri:e}}):t.sessionService.manager.request("ar.reality.request",{uri:e})})},e.prototype.setDesired=function(e){this.request(e?e.uri:qn.DEFAULT)},e.prototype.setStageGeolocation=function(e,t){return e.supportsProtocol("ar.configureStage")?e.request("ar.configureStage.setStageGeolocation",{geolocation:t}):Promise.reject("Protocol `ar.configureStage` is not supported")},e.prototype.resetStageGeolocation=function(e){return e.supportsProtocol("ar.configureStage")?e.request("ar.configureStage.resetStageGeolocation"):Promise.reject("Protocol `ar.configureStage` is not supported")},e}()),fr([q("request"),dr("design:type",Function),dr("design:paramtypes",[Object]),dr("design:returntype",void 0)],Mr.prototype,"setDesired",null),e("RealityService",Mr=fr([N(),dr("design:paramtypes",["function"==typeof(yr=void 0!==bi&&bi)&&yr||Object,"function"==typeof(Ar=void 0!==Vi&&Vi)&&Ar||Object])],Mr)),e("RealityServiceProvider",gr=function(){function e(e,t,i,n,r,o,s,a){var u=this;this.sessionService=e,this.realityService=t,this.contextService=i,this.deviceService=n,this.viewServiceProvider=r,this.visibilityServiceProvider=o,this.focusServiceProvider=s,this.realityViewerFactory=a,this.installedEvent=new ei,this.uninstalledEvent=new ei,this._viewerByURI=new Map,this._installersByURI=new Map,this._scratchFrustum=new Le,e.ensureIsRealityManager(),e.manager.connectEvent.addEventListener(function(){setTimeout(function(){!u._presentingRealityViewer&&u.realityService.default&&u._handleRequest(u.sessionService.manager,{uri:u.realityService.default})})}),e.manager.closeEvent.addEventListener(function(){u._viewerByURI.forEach(function(e){e.destroy()})}),e.connectEvent.addEventListener(function(e){Vt.isRealityViewer(e.info.role)||(e.on["ar.reality.install"]=function(t){var i=t.uri;return u._handleInstall(e,i)},e.on["ar.reality.uninstall"]=function(t){var i=t.uri;return u._handleUninstall(e,i)},e.on["ar.reality.request"]=function(t){return u._handleRequest(e,t)},e.on["ar.reality.desired"]=function(t){var i=t.reality;if(i&&i.type){var n=i.type;i.uri=i.uri||"reality:"+n,"hosted"===n&&(i.uri=i.url)}u._handleRequest(e,{uri:i.uri})})}),this.viewServiceProvider.forwardedUIEvent.addEventListener(function(e){var t=u._presentingRealityViewer&&u._presentingRealityViewer.session;t&&u.viewServiceProvider.sendUIEventToSession(e,t)})}return Object.defineProperty(e.prototype,"presentingRealityViewer",{get:function(){return this._presentingRealityViewer},enumerable:!0,configurable:!0}),e.prototype._handleInstall=function(e,t){var i=this,n=this._installersByURI.get(t);if(n)n.add(e);else{var r=this.realityViewerFactory.createRealityViewer(t);this._viewerByURI.set(t,r),n=new Set,n.add(e),this._installersByURI.set(t,n),r.connectEvent.addEventListener(function(n){if(!Vt.isRealityViewer(n.info.role))throw n.sendError({message:"Expected a reality viewer"}),n.close(),new Error('The application "'+n.uri+'" does not support being loaded as a reality viewer');if(n.on["ar.reality.frameState"]=function(e){if(i._presentingRealityViewer===r){if(0===n.version[0]){var t=i.deviceService.frameState;if(!t)return;e.viewport=Xt.clone(t.viewport,e.viewport),e.subviews=$t.clone(t.subviews,e.subviews);var o=e.eye,s=o.pose,a=o.fov;e.entities=e.entities||{},e.entities["ar.user"]=s;for(var u=0,c=e.subviews;u=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Ir=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Or="url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='768' height='768'%3E%3Cpath fill='white' d='M448.5 96H672v223.5h-64.5v-114L294 519l-45-45 313.5-313.5h-114V96zm159 511.5V384H672v223.5c0 34.5-30 64.5-64.5 64.5h-447c-36 0-64.5-30-64.5-64.5v-447C96 126 124.5 96 160.5 96H384v64.5H160.5v447h447z'/%3E%3C/svg%3E\")",Lr="url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='512' height='512'%3E%3Cpath fill='white' d='M256 96C144.34 96 47.56 161.02 0 256c47.56 94.98 144.34 160 256 160 111.656 0 208.438-65.02 256-160-47.558-94.98-144.344-160-256-160zm126.225 84.852c30.08 19.187 55.57 44.887 74.717 75.148-19.146 30.26-44.637 55.96-74.718 75.148C344.427 355.258 300.78 368 256 368s-88.43-12.743-126.226-36.852c-30.08-19.186-55.57-44.886-74.716-75.148 19.146-30.262 44.637-55.962 74.717-75.148 1.96-1.25 3.938-2.46 5.93-3.65C130.725 190.866 128 205.612 128 221c0 70.69 57.308 128 128 128s128-57.31 128-128c0-15.387-2.726-30.134-7.704-43.8 1.99 1.19 3.97 2.402 5.93 3.652zM256 208c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48z'/%3E%3C/svg%3E\")",Sr="url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20245.82%20141.73%22%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill%3A%23fff%3Bfill-rule%3Aevenodd%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Emask%3C%2Ftitle%3E%3Cpath%20class%3D%22a%22%20d%3D%22M175.56%2C111.37c-22.52%2C0-40.77-18.84-40.77-42.07S153%2C27.24%2C175.56%2C27.24s40.77%2C18.84%2C40.77%2C42.07S198.08%2C111.37%2C175.56%2C111.37ZM26.84%2C69.31c0-23.23%2C18.25-42.07%2C40.77-42.07s40.77%2C18.84%2C40.77%2C42.07-18.26%2C42.07-40.77%2C42.07S26.84%2C92.54%2C26.84%2C69.31ZM27.27%2C0C11.54%2C0%2C0%2C12.34%2C0%2C28.58V110.9c0%2C16.24%2C11.54%2C30.83%2C27.27%2C30.83H99.57c2.17%2C0%2C4.19-1.83%2C5.4-3.7L116.47%2C118a8%2C8%2C0%2C0%2C1%2C12.52-.18l11.51%2C20.34c1.2%2C1.86%2C3.22%2C3.61%2C5.39%2C3.61h72.29c15.74%2C0%2C27.63-14.6%2C27.63-30.83V28.58C245.82%2C12.34%2C233.93%2C0%2C218.19%2C0H27.27Z%22%2F%3E%3C%2Fsvg%3E)",_r='url(\'data:image/svg+xml;utf8,\')',jr="url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBYRXhpZgAATU0AKgAAAAgABAExAAIAAAARAAAAPlEQAAEAAAABAQAAAFERAAQAAAABAAAAAFESAAQAAAABAAAAAAAAAABBZG9iZSBJbWFnZVJlYWR5AAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCACQAJADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAA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VfeY3/r+vVfeWKKr/AGu1/wCfm3/7/R//ABVH2u1/5+bf/v8AR/8AxVHLL+WX3P8ArqvvC/8AX9eq+8sUVX+12v8Az82//f6P/wCKo+12v/Pzb/8Af6P/AOKo5Zfyy+5/11X3hf8Ar+vVfeWKr3f/AB63P/XvN/6Laj7Xa/8APzb/APf6P/4qoLq6tWtrhRc22WglAzPCoyY2AyzOFUepJAHUkCnCMuaPuv4o9H3X+aFdd1/X/Do//9k=)",e("DefaultUIService",xr=function(){function e(e,t,i,n,r){var o=this;this.sessionService=e,this.viewService=t,this.realityService=i,this.realityServiceProvider=n,this.deviceService=r,this.realityViewerItemElements=new Map,this.menuItems=[],this.menuOpen=!1;var s=this.sessionService.configuration.defaultUI||{};if(document&&!s.disable){var a=document.createElement("style");a.type="text/css",document.head.insertBefore(a,document.head.firstChild);var u=a.sheet;u.insertRule("\n .argon-ui {\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n }\n ",u.cssRules.length),u.insertRule("\n .argon-ui-button {\n background-image: "+jr+";\n width: 144px;\n height: 144px;\n }\n ",u.cssRules.length),u.insertRule("\n .argon-ui-blur {\n background-color: rgba(238, 178, 17, 0.7);\n -webkit-backdrop-filter: blur(5px);\n }\n ",u.cssRules.length),u.insertRule("\n .argon-ui-box {\n webkit-user-select: none;\n ms-user-select: none;\n user-select: none;\n }\n ",u.cssRules.length), +e.on["ar.view.forwardUIEvent"]=function(e){r.forwardedUIEvent.raiseEvent(e)},e.on["ar.view.desiredViewportMode"]=function(t){var i=t.mode;r.sessionViewportMode.set(e,i),r._publishViewportModes()},e.on["ar.view.embeddedViewport"]=function(t){r.sessionEmbeddedViewport.set(e,t)},r._publishViewportModes()}),i.sessionFocusEvent.addEventListener(function(){r._publishViewportModes()})}return e.prototype.sendUIEventToSession=function(e,t){t.send("ar.view.uievent",e)},e.prototype._publishViewportModes=function(){this.sessionService.manager.send("ar.view.viewportMode",{mode:this.sessionViewportMode.get(this.sessionService.manager)});for(var e=0,t=this.sessionService.managedSessions;e0&&i.send("ar.view.viewportMode",{mode:n})}},e}()),e("ViewServiceProvider",wn=dn([N(),pn("design:paramtypes",["function"==typeof(On=void 0!==bi&&bi)&&On||Object,An,"function"==typeof(Ln=void 0!==rn&&rn)&&Ln||Object,"function"==typeof(Sn=void 0!==ln&&ln)&&Sn||Object])],wn)),"undefined"!=typeof document&&document.createElement&&(En=document.querySelector("meta[name=viewport]"),En||(En=document.createElement("meta")),En.name="viewport",En.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0",document.head.appendChild(En),mn=document.querySelector("meta[name=argon]"),mn||(mn=document.createElement("meta")),mn.name="argon",document.head.appendChild(mn),vn=document.createElement("style"),vn.type="text/css",document.head.insertBefore(vn,document.head.firstChild),Nn=vn.sheet,Nn.insertRule("\n #argon {\n position: fixed;\n width: 100%;\n height: 100%;\n left: 0;\n bottom: 0;\n margin: 0;\n border: 0;\n padding: 0;\n }\n ",Nn.cssRules.length),Nn.insertRule("\n .argon-view {\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n user-select: none;\n }\n ",Nn.cssRules.length),Nn.insertRule("\n .argon-immersive .argon-view {\n position: fixed !important;\n width: 100% !important;\n height: 100% !important;\n max-width: 100% !important;\n max-height: 100% !important;\n left: 0;\n bottom: 0;\n margin: 0;\n border: 0;\n padding: 0;\n visibility: visible;\n }\n ",Nn.cssRules.length),Nn.insertRule("\n .argon-immersive body {\n visibility: hidden;\n }\n ",Nn.cssRules.length),Nn.insertRule("\n .argon-interactive {\n pointer-events: auto;\n }\n ",Nn.cssRules.length)),_n=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},jn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("DeviceStableState",xn=function(){function e(){this.entities={},this.suggestedUserHeight=Yt,this.geolocationDesired=!1,this.geolocationOptions={},this.isPresentingHMD=!1,this.isPresentingRealityHMD=!1,this.strict=!1}return e}()),e("DeviceFrameState",Cn=function(){function e(){this._scratchFrustum=new Le,this.time=Ne.now(),this.viewport=new Xt,this.subviews=[{type:Zt.SINGULAR,pose:null,viewport:new Wt,projectionMatrix:(this._scratchFrustum.near=qt,this._scratchFrustum.far=Gt,this._scratchFrustum.fov=De.PI_OVER_THREE,this._scratchFrustum.aspectRatio=1,Ie.clone(this._scratchFrustum.projectionMatrix))}]}return e}()),e("DeviceService",bn=function(){function e(e,t,i,n){var r=this;if(this.sessionService=e,this.contextService=t,this.viewService=i,this.visibilityService=n,this.autoSubmitFrame=!0,this.frameState=new Cn,this.frameStateEvent=new ei,this.presentHMDChangeEvent=new ei,this.screenOrientationChangeEvent=new ei,this.stage=this.contextService.entities.add(new Me({id:"ar.device.stage",name:"Device Stage",position:void 0,orientation:void 0})),this.user=this.contextService.entities.add(new Me({id:"ar.device.user",name:"Device User",position:void 0,orientation:void 0})),this.defaultUserHeight=Yt,this._getEntityPositionInReferenceFrame=C,this._getEntityOrientationInReferenceFrame=b,this._scratchCartesian=new ne,this._scratchCartesian2=new ne,this._scratchFrustum=new Le,this._updatingFrameState=!1,this._updateFrameState=function(){if(r._updatingFrameState){r.requestAnimationFrame(r._updateFrameState);var e=r.frameState,t=Ne.now(e.time);r.onUpdateFrameState();for(var i=r.contextService.view.id,n=0;n0==!1&&(this._setupVRPresentChangeHandler(),navigator.getVRDisplays().then(function(e){r._vrDisplays=e,r._vrDisplay=e[0]})),"undefined"!=typeof window&&window.addEventListener){var o=function(){r.screenOrientationChangeEvent.raiseEvent(void 0)};window.addEventListener("orientationchange",o),e.manager.closeEvent.addEventListener(function(){window.removeEventListener("orientationchange",o)})}}return Object.defineProperty(e.prototype,"geoHeadingAccuracy",{get:function(){return this.user.meta?this.user.meta.geoHeadingAccuracy:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"geoHorizontalAccuracy",{get:function(){return this.stage.meta?this.stage.meta.geoHorizonatalAccuracy:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"geoVerticalAccuracy",{get:function(){return this.stage.meta?this.stage.meta.geoVerticalAccuracy:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"geolocationDesired",{get:function(){return this._parentState&&this._parentState.geolocationDesired||!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"geolocationOptions",{get:function(){return this._parentState&&this._parentState.geolocationOptions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"suggestedUserHeight",{get:function(){return this._parentState&&this._parentState.suggestedUserHeight||this.isPresentingHMD?this.defaultUserHeight:this.defaultUserHeight/2},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"strict",{get:function(){return!(!this._parentState||!this._parentState.strict)||this._hasPolyfillWebVRDisplay()||!1},enumerable:!0,configurable:!0}),e.prototype._processContextFrameState=function(e){var t=e.time,i=this.contextService,n=e.entities,r=this.stage,o=i.stage;if(void 0===n[o.id]){var s=o.position,a=o.orientation;s.setValue(ne.ZERO,r),a.setValue(xe.IDENTITY)}var u=this.user,c=i.user;if(void 0===n[c.id]){var l=this._getEntityPositionInReferenceFrame(u,t,r,this._scratchCartesian),h=this._getEntityOrientationInReferenceFrame(u,t,r,this._scratchQuaternion),f=c.position,d=c.orientation;f.setValue(l,o),d.setValue(h)}var p=i.view;if(void 0===n[p.id]){var M=p.position,g=p.orientation;M.setValue(ne.ZERO,c),g.setValue(xe.IDENTITY)}if(void 0===n[i.floor.id]){i.floor.position.setValue(ne.ZERO,o)}if(this.sessionService.manager.isConnected&&0===this.sessionService.manager.version[0]){var y=this._getEntityPositionInReferenceFrame(c,t,be.FIXED,this._scratchCartesian);if(y){var A=ke.eastNorthUpToFixedFrame(y,void 0,this._scratchMatrix4),w=Ie.getRotation(A,this._scratchMatrix3),E=xe.fromRotationMatrix(w);o.position.setValue(y,be.FIXED),o.orientation.setValue(E)}}},e.prototype._processStableState=function(e){var t=e.entities,i=this.contextService;if(t)for(var n in t)i.updateEntityFromSerializedState(n,t[n]);this._parentState=e},Object.defineProperty(e.prototype,"screenOrientationDegrees",{get:function(){return"undefined"!=typeof window?screen.orientation&&-screen.orientation.angle||-window.orientation||0:0},enumerable:!0,configurable:!0}),e.prototype.getScreenOrientationDegrees=function(){return this.getScreenOrientationDegrees},e.prototype._startUpdates=function(){var e=this;this._updatingFrameState||this.requestAnimationFrame(this._updateFrameState),this._updatingFrameState=!0,this.sessionService.manager.whenConnected().then(function(){e.sessionService.manager.version[0]>0&&e.sessionService.manager.send("ar.device.startUpdates")})},e.prototype._stopUpdates=function(){var e=this;this._updatingFrameState=!1,this.sessionService.manager.whenConnected().then(function(){e.sessionService.manager.version[0]>0&&e.sessionService.manager.send("ar.device.stopUpdates")})},e.prototype.onUpdateFrameState=function(){this._updateViewport(),this._vrDisplay&&this._vrDisplay.isPresenting?this._updateForWebVR():this._updateDefault()},e.prototype._updateViewport=function(){var e=this._parentState,t=this.frameState,i=t.viewport;if(e&&e.viewport)Xt.clone(e.viewport,i);else{var n=this.viewService.element;i.x=0,i.y=0,i.width=n&&n.clientWidth||0,i.height=n&&n.clientHeight||0;var r=this._vrDisplay;if(r&&r.isPresenting){var o=r.getEyeParameters("left"),s=r.getEyeParameters("right"),a=t.viewport;a.renderWidthScaleFactor=2*Math.max(o.renderWidth,s.renderWidth)/a.width,a.renderHeightScaleFactor=Math.max(o.renderHeight,s.renderHeight)/a.height}else i.renderHeightScaleFactor=1,i.renderWidthScaleFactor=1}},e.prototype._updateDefault=function(){this._updateUserDefault();var e=this._parentState,t=this.frameState,i=t.viewport;e&&e.viewport&&Xt.clone(e.viewport,i);var n=t.subviews;if(e&&e.subviews)$t.clone(e.subviews,n);else{n.length=1;var r=n[0]||{};r.type=Zt.SINGULAR,r.viewport.x=0,r.viewport.y=0,r.viewport.width=i.width,r.viewport.height=i.height;var o=i.width/i.height,s=this._scratchFrustum;s.near=qt,s.far=Gt,s.fov=De.PI_OVER_THREE,s.aspectRatio=isFinite(o)&&0!==o?o:1,r.projectionMatrix=Ie.clone(s.projectionMatrix,r.projectionMatrix);var a=this.getSubviewEntity(0);a.position.setValue(ne.ZERO,this.user),a.orientation.setValue(xe.IDENTITY)}},e.prototype._updateForWebVR=function(){var e=this._vrDisplay;if(e){var t=this.frameState,i=this._vrFrameData=this._vrFrameData||new VRFrameData;if(!e.getFrameData(i))return this.frameState;var n=e.getLayers()[0],r=n&&n.leftBounds,o=n&&n.rightBounds;n?(r=n.leftBounds&&4===n.leftBounds.length?n.leftBounds:this._defaultLeftBounds,o=n.rightBounds&&4===n.rightBounds.length?n.rightBounds:this._defaultRightBounds):(r=this._defaultLeftBounds,o=this._defaultRightBounds);var s=t.viewport,a=t.subviews=t.subviews||[];a.length=2;var u=a[0]=a[0]||{},c=a[1]=a[1]||{};u.type=Zt.LEFTEYE,c.type=Zt.RIGHTEYE;var l=u.viewport=u.viewport||{};l.x=r[0]*s.width,l.y=r[1]*s.height,l.width=r[2]*s.width,l.height=r[3]*s.height;var h=c.viewport=c.viewport||{};h.x=o[0]*s.width,h.y=o[1]*s.height,h.width=o[2]*s.width,h.height=o[3]*s.height,u.projectionMatrix=Ie.clone(i.leftProjectionMatrix,u.projectionMatrix),c.projectionMatrix=Ie.clone(i.rightProjectionMatrix,c.projectionMatrix);var f=e.stageParameters?e.stageParameters.sittingToStandingTransform:Ie.IDENTITY,d=Ie.getRotation(f,this._scratchMatrix3),p=xe.fromRotationMatrix(d,this._scratchQuaternion),M=this.user,g=this.vrStandingSpace,y=i.pose.position?ne.unpack(i.pose.position,0,this._scratchCartesian):void 0,A=y?Ie.multiplyByPoint(f,y,this._scratchCartesian):void 0,w=i.pose.orientation?xe.unpack(i.pose.orientation,0,this._scratchQuaternion2):void 0,E=w?xe.multiply(p,w,this._scratchQuaternion):void 0;if(M.position||(M.position=new ce),M.orientation||(M.orientation=new le),M.position.setValue(A,g),M.orientation.setValue(E),A&&E){var m=Ie.inverseTransformation(i.leftViewMatrix,this._scratchMatrix4),v=Ie.multiplyTransformation(f,m,this._scratchMatrix4),N=this.getSubviewEntity(0),D=Ie.getTranslation(v,this._scratchCartesian),T=Ie.getRotation(v,this._scratchMatrix3),I=xe.fromRotationMatrix(T,this._scratchQuaternion);N.position.setValue(D,g),N.orientation.setValue(I);var O=Ie.inverseTransformation(i.rightViewMatrix,this._scratchMatrix4),L=Ie.multiplyTransformation(f,O,this._scratchMatrix4),S=this.getSubviewEntity(1),_=Ie.getTranslation(L,this._scratchCartesian),j=Ie.getRotation(L,this._scratchMatrix3),x=xe.fromRotationMatrix(j,this._scratchQuaternion);S.position.setValue(_,g),S.orientation.setValue(x)}e.displayName.match(/polyfill/g)&&(M.position.setValue(void 0,void 0),M.orientation.setValue(void 0),this._updateUserDefault())}},e.prototype._hasPolyfillWebVRDisplay=function(){return!!this._vrDisplay&&!!this._vrDisplay.displayName.match(/polyfill/g)},e.prototype.onRequestPresentHMD=function(){if(this._vrDisplay){var e=this.viewService.element,t=[{source:this.viewService.layers[0]&&this.viewService.layers[0].source||e.querySelector("canvas")||e.lastElementChild}];return this._vrDisplay.requestPresent(t).catch(function(e){throw e})}throw new Error("No HMD available")},e.prototype.onExitPresentHMD=function(){return this._vrDisplay&&this._vrDisplay.isPresenting?this._vrDisplay.exitPresent():Promise.resolve()},e.prototype.createContextFrameState=function(e,t,i,n){for(var r=0,o=i;r0&&t.send("ar.device.setGeolocationOptions",{options:e}),this.contextService.subscribe(this.stage.id,t).then(function(){})},e.prototype.unsubscribeGeolocation=function(e){void 0===e&&(e=this.sessionService.manager),this.contextService.unsubscribe(this.stage.id,e)},Object.defineProperty(e.prototype,"isPresentingHMD",{get:function(){return this._parentState&&this._parentState.isPresentingHMD||this._vrDisplay&&this._vrDisplay.isPresenting||!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isPresentingRealityHMD",{get:function(){return this._parentState&&this._parentState.isPresentingRealityHMD||this._vrDisplay&&this._vrDisplay.isPresenting&&!!this._vrDisplay.displayName.match(/polyfill/g)||!1},enumerable:!0,configurable:!0}),e.prototype.requestPresentHMD=function(){if(!this.sessionService.manager.isConnected)throw new Error("Session must be connected");return this.sessionService.isRealityManager?this.onRequestPresentHMD():this.sessionService.manager.request("ar.device.requestPresentHMD")},e.prototype.exitPresentHMD=function(){if(!this.sessionService.manager.isConnected)throw new Error("Session must be connected");return this.sessionService.isRealityManager?this.onExitPresentHMD():this.sessionService.manager.request("ar.device.exitPresentHMD")},e.prototype._updateUserDefault=function(){var e=this.user,t=this.stage,i=this._deviceOrientation;if(this._tryOrientationUpdates(),!i)return e.position=void 0,void(e.orientation=void 0);var n=xe.fromAxisAngle(ne.UNIT_Z,this.screenOrientationDegrees*De.RADIANS_PER_DEGREE,this._scratchQuaternion);e.position||(e.position=new ce),e.orientation||(e.orientation=new le),e.position.setValue(ne.fromElements(0,0,this.suggestedUserHeight,this._scratchCartesian),t),e.orientation.setValue(xe.multiply(i,n,this._scratchQuaternion)),e.meta=e.meta||{},e.meta.geoHeadingAccuracy=this._deviceOrientationHeadingAccuracy},e.prototype._tryOrientationUpdates=function(){var e=this;if("undefined"!=typeof window&&window.addEventListener&&!fe(this._deviceOrientationListener)){var t=void 0;this._deviceOrientationListener=function(i){var n=i.alpha,r=i.webkitCompassHeading,o=+i.webkitCompassAccuracy;if(fe(n)&&(i.absolute&&(t=0),e._deviceOrientationHeadingAccuracy=o>0?o:void 0,(!fe(t)||Math.abs(0)>5)&&fe(r)&&o>=0&&o<80&&r>=0&&(fe(t)?t-=0:t=-r),fe(t)&&fe(i.alpha)&&fe(i.beta)&&fe(i.gamma))){var s=De.RADIANS_PER_DEGREE*(i.alpha+t||-r||0),a=De.RADIANS_PER_DEGREE*i.beta,u=De.RADIANS_PER_DEGREE*i.gamma,c=xe.fromAxisAngle(ne.UNIT_Z,s,e._scratchQuaternion),l=xe.fromAxisAngle(ne.UNIT_X,a,e._scratchQuaternion2),h=xe.multiply(c,l,e._scratchQuaternion),f=xe.fromAxisAngle(ne.UNIT_Y,u,e._scratchQuaternion2),d=xe.multiply(h,f,e._scratchQuaternion);e._deviceOrientation=xe.clone(d,e._deviceOrientation),e._deviceOrientationHeadingAccuracy=o}},"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",this._deviceOrientationListener):"ondeviceorientation"in window&&window.addEventListener("deviceorientation",this._deviceOrientationListener)}},e.prototype._setupVRPresentChangeHandler=function(){var e=this;if("undefined"!=typeof window&&window.addEventListener){this.viewService.viewportModeChangeEvent.addEventListener(function(t){t===gn.PAGE&&e._vrDisplay&&e._vrDisplay.displayName.match(/polyfill/g)&&e.exitPresentHMD()});var t,i,n=function(n){var r=e.viewService,o=n.display||n.detail.vrdisplay||n.detail.display;o&&(o.isPresenting?(e._vrDisplay=o,o.displayName.match(/polyfill/g)&&(t=o.getLayers()[0].source,t&&t.classList.add("argon-interactive"),i=r.viewportMode,r.desiredViewportMode=gn.IMMERSIVE),e.requestPresentHMD()):(t&&o.displayName.match(/polyfill/g)&&(t.classList.remove("argon-interactive"),t=void 0,r.desiredViewportMode=i),e.exitPresentHMD()))};window.addEventListener("vrdisplaypresentchange",n)}},e}()),e("DeviceService",bn=_n([N(),jn("design:paramtypes",["function"==typeof(zn=void 0!==bi&&bi)&&zn||Object,"function"==typeof(Pn=void 0!==Vi&&Vi)&&Pn||Object,"function"==typeof(Un=void 0!==An&&An)&&Un||Object,"function"==typeof(Bn=void 0!==cn&&cn)&&Bn||Object])],bn)),e("DeviceServiceProvider",Rn=function(){function e(e,t,i,n,r){var o=this;this.sessionService=e,this.deviceService=t,this.contextService=i,this.viewService=n,this.contextServiceProvider=r,this._subscribers={},this._needsPublish=!1,this._publishTime=new Ne(0,0),this._stableState=new xn,this._targetGeolocationOptions={},this._sessionGeolocationOptions=new Map,this._scratchCartesianLocalOrigin=new ne,this._scratchQuaternionLocalOrigin=new xe,this._scratchFrustum=new Le,this._identityHPR=new me,this._scratchCartographic=new oe,this.contextServiceProvider.publishingReferenceFrameMap.set(t.stage.id,be.FIXED),this.contextServiceProvider.publishingReferenceFrameMap.set(t.user.id,t.stage.id),this.sessionService.connectEvent.addEventListener(function(e){e.on["ar.device.requestFrameState"]=function(){return o._subscribers[e.id]=e,new Promise(function(e){var t=o.deviceService.frameStateEvent.addEventListener(function(i){e(i),t()})})},e.on["ar.device.startUpdates"]=function(){o._subscribers[e.id]=e},e.on["ar.device.stopUpdates"]=function(){delete o._subscribers[e.id]},e.on["ar.device.setGeolocationOptions"]=function(t){o._handleSetGeolocationOptions(e,t)},e.on["ar.device.requestPresentHMD"]=function(){return o.handleRequestPresentHMD(e)},e.on["ar.device.exitPresentHMD"]=function(){return o.handleExitPresentHMD(e)}}),this.contextServiceProvider.subscribersChangeEvent.addEventListener(function(e){var t=e.id;o.deviceService.stage.id!==t&&o.contextService.stage.id!==t||o._checkDeviceGeolocationSubscribers()}),this.viewService.viewportChangeEvent.addEventListener(function(){o._needsPublish=!0}),this.viewService.viewportModeChangeEvent.addEventListener(function(){o._needsPublish=!0}),this.deviceService.presentHMDChangeEvent.addEventListener(function(){o._needsPublish=!0}),this.deviceService.screenOrientationChangeEvent.addEventListener(function(){o._needsPublish=!0}),this.deviceService.frameStateEvent.addEventListener(function(){o._needsPublish&&o.publishStableState()})}return e.prototype.handleRequestPresentHMD=function(e){return this.deviceService.requestPresentHMD()},e.prototype.handleExitPresentHMD=function(e){return this.deviceService.exitPresentHMD()},e.prototype.publishStableState=function(){var e=this._stableState;e.geolocationDesired=this.contextServiceProvider.geolocationDesired,e.geolocationOptions=e.geolocationOptions||{},e.geolocationOptions.enableHighAccuracy=this.contextServiceProvider.desiredGeolocationOptions.enableHighAccuracy,e.suggestedUserHeight=this.deviceService.suggestedUserHeight,e.strict=this.deviceService.strict,e.viewport=Xt.clone(this.deviceService.frameState.viewport,e.viewport),e.subviews=$t.clone(this.deviceService.frameState.subviews,e.subviews),this.onUpdateStableState(this._stableState),Ne.now(this._publishTime);for(var t in this._subscribers){var i=this._subscribers[t];if(i.version[0]>0&&i!==this.sessionService.manager){for(var n in e.entities)delete e.entities[n];this.contextServiceProvider.fillEntityStateMapForSession(i,this._publishTime,e.entities),i.send("ar.device.state",e)}}this._needsPublish=!1},e.prototype.onUpdateStableState=function(e){},e.prototype._checkDeviceGeolocationSubscribers=function(){var e=this.contextServiceProvider.subscribersByEntityId.get(this.deviceService.stage.id);e&&e.size>0?(this._updateTargetGeolocationOptions(),JSON.stringify(this._targetGeolocationOptions)!==JSON.stringify(this._currentGeolocationOptions)&&(this._currentGeolocationOptions=this._targetGeolocationOptions,this.onStopGeolocationUpdates(),this.onStartGeolocationUpdates(this._targetGeolocationOptions))):(this.onStopGeolocationUpdates(),this._currentGeolocationOptions=void 0),this._needsPublish=!0},e.prototype._handleSetGeolocationOptions=function(e,t){var i=this;this._sessionGeolocationOptions.set(e,t),e.closeEvent.addEventListener(function(){i._sessionGeolocationOptions.delete(e)})},e.prototype._updateTargetGeolocationOptions=function(){var e={};this._sessionGeolocationOptions.forEach(function(t,i){e.enableHighAccuracy=e.enableHighAccuracy||t&&t.enableHighAccuracy||!1}),this._targetGeolocationOptions.enableHighAccuracy!==e.enableHighAccuracy&&(this._targetGeolocationOptions=e),this._needsPublish=!0},e.prototype.configureStage=function(e,t,i){var n=this;if(!fe(i)&&0===e.height)return void G(e).then(function(){return n.configureStage(e,t,0)});var r=this.deviceService.stage,o=ne.fromRadians(e.longitude,e.latitude,e.height,void 0,this._scratchCartesianLocalOrigin),s=ke.headingPitchRollQuaternion(o,this._identityHPR,void 0,this._scratchQuaternionLocalOrigin);r.position=r.position||new ce,r.orientation=r.orientation||new le,r.position.setValue(o,be.FIXED),r.orientation.setValue(s),r.meta={geoHorizontalAccuracy:t,geoVerticalAccuracy:i}},e.prototype.onStartGeolocationUpdates=function(e){var t=this;if("undefined"==typeof navigator||!navigator.geolocation)throw new Error("Unable to start geolocation updates");fe(this._geolocationWatchId)||(this._geolocationWatchId=navigator.geolocation.watchPosition(function(e){var i=e.coords.longitude,n=e.coords.latitude,r=e.coords.altitude,o=oe.fromDegrees(i,n,r||0,t._scratchCartographic);t.configureStage(o,e.coords.accuracy>0?e.coords.accuracy:void 0,e.coords.altitudeAccuracy||void 0)},function(e){console.warn("Unable to start geolocation updates: "+e.message)},e))},e.prototype.onStopGeolocationUpdates=function(){"undefined"!=typeof navigator&&fe(this._geolocationWatchId)&&(navigator.geolocation.clearWatch(this._geolocationWatchId),this._geolocationWatchId=void 0)},e}()),e("DeviceServiceProvider",Rn=_n([N(),jn("design:paramtypes",["function"==typeof(kn=void 0!==bi&&bi)&&kn||Object,bn,"function"==typeof(Fn=void 0!==Vi&&Vi)&&Fn||Object,"function"==typeof(Qn=void 0!==An&&An)&&Qn||Object,"function"==typeof(Yn=void 0!==Hi&&Hi)&&Yn||Object])],Rn)),e("RealityViewer",qn=function(){function e(e){var t=this;this.uri=e,this.providedReferenceFrames=[],this.connectEvent=new ei,this.presentChangeEvent=new ei,this._isPresenting=!1,this.connectEvent.addEventListener(function(e){t._session&&t._session.close(),t._session=e,e.closeEvent.addEventListener(function(){t._session===e&&(t._session=void 0)})})}return Object.defineProperty(e.prototype,"isPresenting",{get:function(){return this._isPresenting},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"session",{get:function(){return this._session},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.setPresenting(!1),this.session&&this.session.close()},e.prototype.setPresenting=function(e){this._isPresenting!==e&&(this._isPresenting=e,this.presentChangeEvent.raiseEvent(void 0))},e.getType=function(e){if(void 0!==e)return"reality"===e.split(":")[0]?e:"hosted"},e}()),qn.DEFAULT="reality:default",qn.EMPTY="reality:empty",qn.LIVE="reality:live",Gn=function(e,t){function i(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Vn=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Hn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("EmptyRealityViewer",Wn=function(e){function t(t,i,n,r,o){function s(e){switch(e){case"W".charCodeAt(0):return"moveForward";case"S".charCodeAt(0):return"moveBackward";case"E".charCodeAt(0):return"moveUp";case"R".charCodeAt(0):return"moveDown";case"D".charCodeAt(0):return"moveRight";case"A".charCodeAt(0):return"moveLeft";default:return}}var a=e.call(this,o)||this;a.sessionService=t,a.contextService=i,a.viewService=n,a.deviceService=r,a.uri=o,a.type="empty",a._moveFlags={moveForward:!1,moveBackward:!1,moveUp:!1,moveDown:!1,moveLeft:!1,moveRight:!1},a._scratchMatrix3=new Te,a._scratchMatrix4=new Ie;var u=function(e){var t=s(e.keyCode);void 0!==t&&(a._moveFlags[t]=!0)},c=function(e){var t=s(e.keyCode);void 0!==t&&(a._moveFlags[t]=!1)};return"undefined"!=typeof document&&a.presentChangeEvent.addEventListener(function(){if(a.isPresenting)!a._aggregator&&a.viewService.element&&(a.viewService.element.disableRootEvents=!0,a._aggregator=new ee(a.viewService.element),document.addEventListener("keydown",u,!1),document&&document.addEventListener("keyup",c,!1));else{a._aggregator&&a._aggregator.destroy(),a._aggregator=void 0,document&&document.removeEventListener("keydown",u),document&&document.removeEventListener("keyup",c);for(var e in a._moveFlags)a._moveFlags[e]=!1}}),a}return Gn(t,e),t.prototype.load=function(){var e=this,t=this.sessionService.addManagedSessionPort(this.uri);t.connectEvent.addEventListener(function(){e.connectEvent.raiseEvent(t)});var i=this.sessionService.createSessionPort(this.uri);i.suppressErrorOnUnknownTopic=!0;var n,r;i.on["argon.configureStage.setStageGeolocation"]=function(t){var i=t.geolocation;n=ne.fromRadians(i.longitude,i.latitude,i.height,void 0,n);var o=ci(n,void 0,e._scratchMatrix4),s=Ie.getRotation(o,e._scratchMatrix3);r=xe.fromRotationMatrix(s,r)},i.on["argon.configureStage.resetStageGeolocation"]=function(){n=void 0,r=void 0},i.connectEvent.addEventListener(function(){var t=new xe,o=new xe,s=new ne,a=new ne,u=new Te,c=new ne(0,0,1),l=new ne(1,0,0),h=new ne(0,-1,0),f=new Le,d=e.deviceService.stage,p=e.deviceService.user,M=new ne(0,0,-1),g=xe.fromAxisAngle(ne.UNIT_X,De.PI_OVER_TWO),y=[],A=e.contextService.createEntityPose(p,d),w=!1,E=e.deviceService.frameStateEvent.addEventListener(function(d){if(!i.isClosed){var p=e._aggregator,E=e._moveFlags;if(!e.isPresenting)return void(p&&p.reset());if(e.deviceService.geolocationDesired?w||(w=!0,e.deviceService.subscribeGeolocation(e.deviceService.geolocationOptions,i)):w&&(w=!1,e.deviceService.unsubscribeGeolocation(i)),$t.clone(d.subviews,y),!e.deviceService.strict){if(k(y[0].projectionMatrix,f),f.fov=e.viewService.subviews[0]&&e.viewService.subviews[0].frustum.fov||De.PI_OVER_THREE,p&&p.isMoving(te.WHEEL)){var m=p.getMovement(te.WHEEL),v=m.endPosition.y;f.fov=Math.min(Math.max(f.fov-.02*v,Math.PI/8),Math.PI-Math.PI/8)}if(p&&p.isMoving(te.PINCH)){var N=p.getMovement(te.PINCH),v=N.distance.endPosition.y-N.distance.startPosition.y;f.fov=Math.min(Math.max(f.fov-.02*v,Math.PI/8),Math.PI-Math.PI/8)}y.forEach(function(e){var t=e.viewport.width/e.viewport.height;f.aspectRatio=isFinite(t)?t:1,Ie.clone(f.projectionMatrix,e.projectionMatrix)})}var D=d.time;A.update(D);var T=!(A.status&Gi.KNOWN);if(T){var I=e.contextService.user,O=e.contextService.stage,L=C(I,D,O,s)||ne.clone(ne.ZERO,s),S=b(I,D,O,t)||xe.clone(g,t);if(p&&p.isMoving(te.LEFT_DRAG)){var _=p.getMovement(te.LEFT_DRAG);if(S){var j=xe.fromAxisAngle(ne.UNIT_Y,f.fov*(_.endPosition.x-_.startPosition.x)/d.viewport.width,o);S=xe.multiply(S,j,j),I.orientation.setValue(S)}}Te.fromQuaternion(S,u),Te.multiplyByVector(u,ne.UNIT_Y,c),Te.multiplyByVector(u,ne.UNIT_X,l),Te.multiplyByVector(u,M,h);E.moveForward&&(ne.multiplyByScalar(h,.02,a),ne.add(L,a,L)),E.moveBackward&&(ne.multiplyByScalar(h,-.02,a),ne.add(L,a,L)),E.moveUp&&(ne.multiplyByScalar(c,.02,a),ne.add(L,a,L)),E.moveDown&&(ne.multiplyByScalar(c,-.02,a),ne.add(L,a,L)),E.moveLeft&&(ne.multiplyByScalar(l,-.02,a),ne.add(L,a,L)),E.moveRight&&(ne.multiplyByScalar(l,.02,a),ne.add(L,a,L)),I.position.setValue(L,O),I.orientation.setValue(S)}var x=!(!n||!r);if(x){var O=e.contextService.stage;O.position.setValue(n,be.FIXED),O.orientation.setValue(r)}var R=e.deviceService.createContextFrameState(D,d.viewport,y,{overrideUser:T,overrideStage:x});i.send("ar.reality.frameState",R),p&&p.reset()}});i.closeEvent.addEventListener(function(){E()})}),Promise.resolve().then(function(){if(!e.sessionService.manager.isClosed){var n=e.sessionService.createSynchronousMessageChannel();t.open(n.port1,e.sessionService.configuration),i.open(n.port2,{role:Vt.REALITY_VIEWER,uri:e.uri,title:"Empty",version:e.sessionService.configuration.version,protocols:["argon.configureStage@v1"]})}})},t}(qn)),e("EmptyRealityViewer",Wn=Vn([D(bi,Vi,An,bn),Hn("design:paramtypes",["function"==typeof(Xn=void 0!==bi&&bi)&&Xn||Object,"function"==typeof(Zn=void 0!==Vi&&Vi)&&Zn||Object,"function"==typeof(Kn=void 0!==An&&An)&&Kn||Object,"function"==typeof(Jn=void 0!==bn&&bn)&&Jn||Object,String])],Wn)),$n=function(e,t){function i(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}, +er=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},tr=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("LiveRealityViewer",ir=function(e){function t(t,i,n,r){var o=e.call(this,r)||this;if(o.sessionService=t,o.viewService=i,o.deviceService=n,o.uri=r,"undefined"!=typeof document){o.settingsIframe=document.createElement("iframe"),o.settingsIframe.width="0",o.settingsIframe.height="0",o.settingsIframe.src="https://argonjs.io/tools.argonjs.io/",o.settingsIframe.style.display="none",o.videoFov=Math.PI/2,o.videoElement=document.createElement("video"),o.videoElement.style.width="100%",o.videoElement.style.height="height:100%",o.videoElement.controls=!1,o.videoElement.autoplay=!0,o.videoElement.style.display="none",o.videoElement.style.zIndex="-100";var s=o.viewService.element;s.insertBefore(o.settingsIframe,s.firstChild),s.insertBefore(o.videoElement,s.firstChild),o.canvas=document.createElement("canvas"),o.context=o.canvas.getContext("2d"),window.addEventListener("message",function(e){"http://argonjs.io"===e.origin&&(o.videoFov=e.data)})}return o.presentChangeEvent.addEventListener(function(){"undefined"!=typeof document&&(o.videoElement.style.display=o.isPresenting?"initial":"none")}),o}return $n(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),"undefined"!=typeof document&&(this.settingsIframe.remove(),this.videoElement.remove(),this.canvas.remove())},t.prototype.setupInternalSession=function(e){var t=this;e.connectEvent.addEventListener(function(){if(t.videoElement){var i=t.videoElement,n=navigator.mediaDevices;(n.getUserMedia||n.mozGetUserMedia||n.msGetUserMedia||n.webkitGetUserMedia).bind(n)({audio:!1,video:!0}).then(function(t){var n=function(){for(var e=0,i=t.getTracks();e=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},ur=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("HostedRealityViewer",cr=function(e){function t(t,i,n){var r=e.call(this,n)||this;if(r.sessionService=t,r.viewService=i,r.uri=n,r.type="hosted","undefined"!=typeof document&&document.createElement){var o=r.iframeElement=document.createElement("iframe");o.name=O(),o.style.border="0",o.width="100%",o.height="100%",o.style.position="absolute",o.style.opacity="0",o.style.pointerEvents="none",o.style.zIndex="-100";var s=r.viewService.element;s.insertBefore(o,s.firstChild),r.presentChangeEvent.addEventListener(function(){r.iframeElement.style.opacity=r.isPresenting?"1":"0"})}return r}return sr(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),this.iframeElement&&this.iframeElement.remove()},t.prototype.load=function(){var e=this;if("undefined"!=typeof document&&document.createElement){var t=this.sessionService.addManagedSessionPort(this.uri);t.connectEvent.addEventListener(function(){e.sessionService.manager.isClosed||e.connectEvent.raiseEvent(t)});var i=function(n){if("ARGON_SESSION"===n.data.type){var r=n.data.name,o=n.ports&&n.ports[0];if(!o)throw new Error("Received an ARGON_SESSION message without a MessagePort object");r===e.iframeElement.name&&(window.removeEventListener("message",i),t.open(o,e.sessionService.configuration))}};window.addEventListener("message",i),this.iframeElement.src="",this.iframeElement.src=this.uri}},t}(qn)),e("HostedRealityViewer",cr=ar([D(bi,An),ur("design:paramtypes",["function"==typeof(lr=void 0!==bi&&bi)&&lr||Object,"function"==typeof(hr=void 0!==An&&An)&&hr||Object,String])],cr)),fr=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},dr=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("RealityViewerFactory",pr=function(){function e(e,t,i){this._createEmptyReality=e,this._createLiveReality=t,this._createHostedReality=i}return e.prototype.createRealityViewer=function(e){switch(qn.getType(e)){case qn.EMPTY:return this._createEmptyReality(e);case qn.LIVE:return this._createLiveReality(e);case"hosted":return this._createHostedReality(e);default:throw new Error("Unsupported Reality Viewer: "+e)}},e}()),e("RealityViewerFactory",pr=fr([D(Tt.of(Wn),Tt.of(ir),Tt.of(cr)),dr("design:paramtypes",[Object,Object,Object])],pr)),e("RealityService",Mr=function(){function e(e,t){var i=this;this.sessionService=e,this.contextService=t,this._connectEvent=new ei,this._changeEvent=new ei,this.default=qn.EMPTY,e.manager.on["ar.reality.connect"]=function(e){var t=e.id,n=i.sessionService.createSessionPort(t),r=i.sessionService.createSynchronousMessageChannel(),o="ar.reality.message.route."+t,s="ar.reality.message.send."+t,a="ar.reality.close."+t;r.port1.onmessage=function(e){i.sessionService.manager.send(o,e.data)},i.sessionService.manager.on[s]=function(e){r.port1.postMessage(e)},i.sessionService.manager.on[a]=function(){n.close()},n.connectEvent.addEventListener(function(){i.connectEvent.raiseEvent(n)}),i.sessionService.manager.closeEvent.addEventListener(function(){n.close(),delete i.sessionService.manager.on[s],delete i.sessionService.manager.on[a]}),n.open(r.port2,i.sessionService.configuration)};var n=0;this.contextService.frameStateEvent.addEventListener(function(t){if(e.isRealityViewer&&e.manager.isConnected)if(e.manager.isConnected&&0===e.manager.version[0]){var r=t.eye=t.eye||{};r.pose=t.entities["ar.user"],r.viewport=Wt.clone(t.subviews[0].viewport,r.viewport),delete t.entities["ar.user"],n++%2==0&&e.manager.send("ar.reality.frameState",t),t.entities["ar.user"]=r.pose}else e.manager.send("ar.reality.frameState",t);var o=t.reality,s=i._current;s!==o&&(i._current=o,i.changeEvent.raiseEvent({previous:s,current:o}))})}return Object.defineProperty(e.prototype,"connectEvent",{get:function(){return this._connectEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"changeEvent",{get:function(){return this._changeEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"current",{get:function(){return this._current},enumerable:!0,configurable:!0}),e.prototype.install=function(e){var t=this;return this.sessionService.manager.whenConnected().then(function(){return t.sessionService.manager.version[0]>=1!=!0?Promise.reject(new Error("Not supported")):t.sessionService.manager.request("ar.reality.install",{uri:e})})},e.prototype.uninstall=function(e){var t=this;return this.sessionService.manager.whenConnected().then(function(){return t.sessionService.manager.version[0]>=1!=!0?Promise.reject(new Error("Not supported")):t.sessionService.manager.request("ar.reality.uninstall",{uri:e})})},e.prototype.request=function(e){var t=this;return this.sessionService.manager.whenConnected().then(function(){return t.sessionService.manager.version[0]>=1!=!0?t.sessionService.manager.request("ar.reality.desired",{reality:{uri:e}}):t.sessionService.manager.request("ar.reality.request",{uri:e})})},e.prototype.setDesired=function(e){this.request(e?e.uri:qn.DEFAULT)},e.prototype.setStageGeolocation=function(e,t){return e.supportsProtocol("ar.configureStage")?e.request("ar.configureStage.setStageGeolocation",{geolocation:t}):Promise.reject("Protocol `ar.configureStage` is not supported")},e.prototype.resetStageGeolocation=function(e){return e.supportsProtocol("ar.configureStage")?e.request("ar.configureStage.resetStageGeolocation"):Promise.reject("Protocol `ar.configureStage` is not supported")},e}()),fr([q("request"),dr("design:type",Function),dr("design:paramtypes",[Object]),dr("design:returntype",void 0)],Mr.prototype,"setDesired",null),e("RealityService",Mr=fr([N(),dr("design:paramtypes",["function"==typeof(yr=void 0!==bi&&bi)&&yr||Object,"function"==typeof(Ar=void 0!==Vi&&Vi)&&Ar||Object])],Mr)),e("RealityServiceProvider",gr=function(){function e(e,t,i,n,r,o,s,a){var u=this;this.sessionService=e,this.realityService=t,this.contextService=i,this.deviceService=n,this.viewServiceProvider=r,this.visibilityServiceProvider=o,this.focusServiceProvider=s,this.realityViewerFactory=a,this.installedEvent=new ei,this.uninstalledEvent=new ei,this._viewerByURI=new Map,this._installersByURI=new Map,this._scratchFrustum=new Le,e.ensureIsRealityManager(),e.manager.connectEvent.addEventListener(function(){setTimeout(function(){!u._presentingRealityViewer&&u.realityService.default&&u._handleRequest(u.sessionService.manager,{uri:u.realityService.default})})}),e.manager.closeEvent.addEventListener(function(){u._viewerByURI.forEach(function(e){e.destroy()})}),e.connectEvent.addEventListener(function(e){Vt.isRealityViewer(e.info.role)||(e.on["ar.reality.install"]=function(t){var i=t.uri;return u._handleInstall(e,i)},e.on["ar.reality.uninstall"]=function(t){var i=t.uri;return u._handleUninstall(e,i)},e.on["ar.reality.request"]=function(t){return u._handleRequest(e,t)},e.on["ar.reality.desired"]=function(t){var i=t.reality;if(i&&i.type){var n=i.type;i.uri=i.uri||"reality:"+n,"hosted"===n&&(i.uri=i.url)}u._handleRequest(e,{uri:i.uri})})}),this.viewServiceProvider.forwardedUIEvent.addEventListener(function(e){var t=u._presentingRealityViewer&&u._presentingRealityViewer.session;t&&u.viewServiceProvider.sendUIEventToSession(e,t)})}return Object.defineProperty(e.prototype,"presentingRealityViewer",{get:function(){return this._presentingRealityViewer},enumerable:!0,configurable:!0}),e.prototype._handleInstall=function(e,t){var i=this,n=this._installersByURI.get(t);if(n)n.add(e);else{var r=this.realityViewerFactory.createRealityViewer(t);this._viewerByURI.set(t,r),n=new Set,n.add(e),this._installersByURI.set(t,n),r.connectEvent.addEventListener(function(n){if(!Vt.isRealityViewer(n.info.role))throw n.sendError({message:"Expected a reality viewer"}),n.close(),new Error('The application "'+n.uri+'" does not support being loaded as a reality viewer');if(n.on["ar.reality.frameState"]=function(e){if(i._presentingRealityViewer===r){if(0===n.version[0]){var t=i.deviceService.frameState;if(!t)return;e.viewport=Xt.clone(t.viewport,e.viewport),e.subviews=$t.clone(t.subviews,e.subviews);var o=e.eye,s=o.pose,a=o.fov;e.entities=e.entities||{},e.entities["ar.user"]=s;for(var u=0,c=e.subviews;u=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Ir=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Or="url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='768' height='768'%3E%3Cpath fill='white' d='M448.5 96H672v223.5h-64.5v-114L294 519l-45-45 313.5-313.5h-114V96zm159 511.5V384H672v223.5c0 34.5-30 64.5-64.5 64.5h-447c-36 0-64.5-30-64.5-64.5v-447C96 126 124.5 96 160.5 96H384v64.5H160.5v447h447z'/%3E%3C/svg%3E\")",Lr="url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='512' height='512'%3E%3Cpath fill='white' d='M256 96C144.34 96 47.56 161.02 0 256c47.56 94.98 144.34 160 256 160 111.656 0 208.438-65.02 256-160-47.558-94.98-144.344-160-256-160zm126.225 84.852c30.08 19.187 55.57 44.887 74.717 75.148-19.146 30.26-44.637 55.96-74.718 75.148C344.427 355.258 300.78 368 256 368s-88.43-12.743-126.226-36.852c-30.08-19.186-55.57-44.886-74.716-75.148 19.146-30.262 44.637-55.962 74.717-75.148 1.96-1.25 3.938-2.46 5.93-3.65C130.725 190.866 128 205.612 128 221c0 70.69 57.308 128 128 128s128-57.31 128-128c0-15.387-2.726-30.134-7.704-43.8 1.99 1.19 3.97 2.402 5.93 3.652zM256 208c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48z'/%3E%3C/svg%3E\")",Sr="url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20245.82%20141.73%22%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill%3A%23fff%3Bfill-rule%3Aevenodd%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Emask%3C%2Ftitle%3E%3Cpath%20class%3D%22a%22%20d%3D%22M175.56%2C111.37c-22.52%2C0-40.77-18.84-40.77-42.07S153%2C27.24%2C175.56%2C27.24s40.77%2C18.84%2C40.77%2C42.07S198.08%2C111.37%2C175.56%2C111.37ZM26.84%2C69.31c0-23.23%2C18.25-42.07%2C40.77-42.07s40.77%2C18.84%2C40.77%2C42.07-18.26%2C42.07-40.77%2C42.07S26.84%2C92.54%2C26.84%2C69.31ZM27.27%2C0C11.54%2C0%2C0%2C12.34%2C0%2C28.58V110.9c0%2C16.24%2C11.54%2C30.83%2C27.27%2C30.83H99.57c2.17%2C0%2C4.19-1.83%2C5.4-3.7L116.47%2C118a8%2C8%2C0%2C0%2C1%2C12.52-.18l11.51%2C20.34c1.2%2C1.86%2C3.22%2C3.61%2C5.39%2C3.61h72.29c15.74%2C0%2C27.63-14.6%2C27.63-30.83V28.58C245.82%2C12.34%2C233.93%2C0%2C218.19%2C0H27.27Z%22%2F%3E%3C%2Fsvg%3E)",_r='url(\'data:image/svg+xml;utf8,\')',jr="url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBYRXhpZgAATU0AKgAAAAgABAExAAIAAAARAAAAPlEQAAEAAAABAQAAAFERAAQAAAABAAAAAFESAAQAAAABAAAAAAAAAABBZG9iZSBJbWFnZVJlYWR5AAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCACQAJADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK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PMhE0bSWEjE/Kfmy1mx4ikPMJxHIcbWrkftdr/wA/Nv8A9/o//iq/ZcDjKOY4anisK5Tp1FqnG06c1bmpVY68tSF1dXaacZQcoSjKXxdehUw1WVGqkpR1TTvGcX8M4P7UZdHve8WlJNKxRVf7Xa/8/Nv/AN/o/wD4qj7Xa/8APzb/APf6P/4quzll/LL7n/XVfeY3/r+vVfeWKKr/AGu1/wCfm3/7/R//ABVH2u1/5+bf/v8AR/8AxVHLL+WX3P8ArqvvC/8AX9eq+8sUVX+12v8Az82//f6P/wCKo+12v/Pzb/8Af6P/AOKo5Zfyy+5/11X3hf8Ar+vVfeWKr3f/AB63P/XvN/6Laj7Xa/8APzb/APf6P/4qoLq6tWtrhRc22WglAzPCoyY2AyzOFUepJAHUkCnCMuaPuv4o9H3X+aFdd1/X/Do//9k=)",e("DefaultUIService",xr=function(){function e(e,t,i,n,r){var o=this;this.sessionService=e,this.viewService=t,this.realityService=i,this.realityServiceProvider=n,this.deviceService=r,this.realityViewerItemElements=new Map,this.menuItems=[],this.menuOpen=!1;var s=this.sessionService.configuration.defaultUI||{};if(document&&!s.disable){var a=document.createElement("style");a.type="text/css",document.head.insertBefore(a,document.head.firstChild);var u=a.sheet;u.insertRule("\n .argon-ui {\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n }\n ",u.cssRules.length),u.insertRule("\n .argon-ui-button {\n background-image: "+jr+";\n width: 144px;\n height: 144px;\n }\n ",u.cssRules.length),u.insertRule("\n .argon-ui-blur {\n background-color: rgba(238, 178, 17, 0.7);\n -webkit-backdrop-filter: blur(5px);\n }\n ",u.cssRules.length),u.insertRule("\n .argon-ui-box {\n webkit-user-select: none;\n ms-user-select: none;\n user-select: none;\n }\n ",u.cssRules.length), u.insertRule("\n .argon-ui-list-item {\n align-items: center;\n background: white;\n border-top: 1px solid lightgrey;\n display: flex;\n height: 20px;\n justify-content: space-between;\n padding: 20px;\n width: 100%;\n cursor: pointer;\n font-family: 'Sans-serif';\n font-size: 12px;\n color: #5F5F5F;\n box-sizing: border-box;\n }\n ",u.cssRules.length),u.insertRule("\n .argon-ui-list-item:hover {\n background: rgb(240,240,240);\n }\n ",u.cssRules.length),this.element=document.createElement("div"),this.element.className="argon-ui",this.element.style.position="absolute",this.element.style.bottom="0",this.element.style.right="0",this.element.style.width="100%",this.element.style.height="100%",this.element.style.userSelect="none",this.element.style.webkitUserSelect="none",this.element.style.zIndex="10",this.element.style.pointerEvents="none",this.element.style.overflow="hidden",this.viewService.element.appendChild(this.element),this.sessionService.manager.closeEvent.addEventListener(function(){o.element.remove()});var c=document.createElement("div");c.className="argon-overlay",c.style.width="100%",c.style.height="100%",c.style.display="flex",c.style.alignItems="center",c.style.pointerEvents="auto",c.addEventListener("click",function(e){e.target===c&&(c.remove(),e.stopPropagation())}),this.realityViewerSelectorElement=document.createElement("div"),this.realityViewerSelectorElement.classList.add("argon-ui-box"),this.realityViewerSelectorElement.classList.add("argon-ui-blur"),this.realityViewerSelectorElement.style.maxWidth="300px",this.realityViewerSelectorElement.style.maxHeight="70%",this.realityViewerSelectorElement.style.width="70%",this.realityViewerSelectorElement.style.margin="auto",this.realityViewerSelectorElement.style.padding="20px",this.realityViewerSelectorElement.style.boxShadow="rgb(102,102,102) 0 5px 20px",c.appendChild(this.realityViewerSelectorElement);var l=document.createElement("h2");l.innerText="Select a Reality",l.style.fontFamily="Sans-Serif",l.style.color="white",l.style.marginTop="0",l.style.flex="0 1 auto",this.realityViewerSelectorElement.appendChild(l),this.realityViewerListElement=document.createElement("div"),this.realityViewerListElement.style.flex="1 1 auto",this.realityViewerListElement.style.maxHeight="250px",this.realityViewerListElement.style.overflowY="auto",this.realityViewerSelectorElement.appendChild(this.realityViewerListElement),this.realityServiceProvider.installedEvent.addEventListener(function(e){var t=e.viewer,i=t.uri,n=document.createElement("div");n.innerText=i,t.connectEvent.addEventListener(function(e){n.innerText=e.info.title||i}),n.className="argon-ui-list-item",o.realityViewerItemElements.set(i,n),o.realityViewerListElement.appendChild(n),n.addEventListener("click",function(){o.realityService.request(i),c.remove()})}),this.realityServiceProvider.uninstalledEvent.addEventListener(function(e){var t=e.viewer,i=t.uri,n=o.realityViewerItemElements.get(i);o.realityViewerItemElements.delete(i),n.remove()}),this.menuBackgroundElement=document.createElement("div"),this.menuBackgroundElement.className="argon-ui-blur",this.menuBackgroundElement.style.position="absolute",this.menuBackgroundElement.style.bottom="-150px",this.menuBackgroundElement.style.right="-150px",this.menuBackgroundElement.style.width="300px",this.menuBackgroundElement.style.height="300px",this.menuBackgroundElement.style.transform="scale(0.1)",this.menuBackgroundElement.style.transition="transform 0.3s, opacity 0.3s",this.menuBackgroundElement.style.borderRadius="150px",this.menuBackgroundElement.style.zIndex="-2",this.element.appendChild(this.menuBackgroundElement);var h=document.createElement("div");this.element.appendChild(h),h.className="argon-ui-button",h.style.position="absolute",h.style.bottom="0",h.style.right="0",h.style.transform="scale(0.36)",h.style.transformOrigin="110% 110%",h.style.borderRadius="72px",h.style.cursor="pointer",h.style.pointerEvents="auto",h.style.zIndex="-1",this.openInArgonMenuItem=this._createMenuItem(Or,"Open in Argon"),this.openInArgonMenuItem.addEventListener("touchstart",function(){Y()}),this.openInArgonMenuItem.addEventListener("touchend",function(){confirm("Oops, it looks like you are still here! You may not have the Argon Browser installed. Would you like to install it now?")&&Q(),o.menuOpen=!1,o.updateMenu()}),this.hmdMenuItem=this._createMenuItem(Sr,"Toggle HMD",function(){o.menuOpen=!1,o.updateMenu(),o.deviceService.isPresentingHMD?o.deviceService.exitPresentHMD():o.deviceService.requestPresentHMD()}),this.realityMenuItem=this._createMenuItem(Lr,"Select Reality Viewer...",function(){o.menuOpen=!1,o.updateMenu(),c.style.backgroundColor="rgba(0,0,0,0.3)",o.element.appendChild(c)}),this.maximizeMenuItem=this._createMenuItem(_r,"Toggle Immersive View",function(){o.menuOpen=!1,o.updateMenu(),o.viewService.viewportMode===gn.IMMERSIVE?o.viewService.desiredViewportMode=gn.EMBEDDED:o.viewService.desiredViewportMode=gn.IMMERSIVE}),this.onSelect(h,this.toggleMenu.bind(this)),this.updateMenu(),this.viewService.viewportChangeEvent.addEventListener(function(){o.updateMenu()}),this.viewService.viewportModeChangeEvent.addEventListener(function(){o.updateMenu()})}}return e.prototype._createMenuItem=function(e,t,i){var n=document.createElement("div");return n.style.position="absolute",n.style.bottom="-20px",n.style.right="-20px",n.style.textAlign="left",n.style.width="40px",n.style.height="40px",n.style.fontFamily="Arial Black",n.style.color="black",n.style.cursor="default",n.style.textShadow="-1px -1px 0px #545454, 1px -1px 0px #545454, -1px 1px 0px #545454, 1px 1px 0px #545454",n.style.transition="transform 0.3s ease 0.1s, opacity 0.3s ease 0.1s",n.style.opacity="0",n.style.pointerEvents="none",n.style.transformOrigin="50% 50%",n.style.backgroundImage=e,n.style.backgroundSize="100% 100%",n.style.backgroundRepeat="no-repeat",n.style.zIndex="2",n.style.cursor="pointer",this.element.appendChild(n),n.title=t,i&&this.onSelect(n,i),n.addEventListener("mouseenter",function(){n.style.color="#eeb211"}),n.addEventListener("mouseleave",function(){n.style.color="white"}),n},e.prototype.onSelect=function(e,t){e.addEventListener("touchend",function(e){e.preventDefault(),e.stopPropagation(),t()}),e.addEventListener("click",function(e){e.stopPropagation(),t()})},e.prototype.toggleMenu=function(){this.menuOpen?this.menuOpen=!1:this.menuOpen=!0,this.updateMenu()},e.prototype._hideMenuItem=function(e){e.style.transform="scale(0.2)",e.style.opacity="0",e.style.pointerEvents="none"},e.prototype.updateMenu=function(){var e=this;this.deviceService.isPresentingHMD&&Ei?this.element.style.display="none":this.element.style.display="block",this.menuItems=[],this.menuItems.push(null),Ei?this.menuItems.push(this.openInArgonMenuItem):this._hideMenuItem(this.openInArgonMenuItem);var t=this.viewService.element.parentElement,i=t?t.clientWidth:0,n=t?t.clientHeight:0;if(window.innerWidth!==i||window.innerHeight!==n?this.menuItems.push(this.maximizeMenuItem):this._hideMenuItem(this.maximizeMenuItem),Ei||"getVRDisplays"in navigator?this.menuItems.push(this.hmdMenuItem):this._hideMenuItem(this.hmdMenuItem),this.realityViewerItemElements.size>0?this.menuItems.push(this.realityMenuItem):this._hideMenuItem(this.realityMenuItem),this.menuItems.push(null),this.menuOpen){var r=this.menuItems.length;this.menuItems.forEach(function(e,t){if(e){var i=t/(r-1)*(Math.PI/2+Math.PI/8)-Math.PI/16,n=100*Math.cos(i),o=100*Math.sin(i);e.style.transform="translateX("+-n+"px) translateY("+-o+"px) scale(0.8)",e.style.opacity="1",e.style.pointerEvents="auto"}}),this.menuBackgroundElement.style.transform="scale(1)"}else this.menuItems.forEach(function(t,i){t&&e._hideMenuItem(t)}),this.menuBackgroundElement.style.transform="scale(0.1)"},e}()),e("DefaultUIService",xr=Tr([N(),Ir("design:paramtypes",["function"==typeof(Cr=void 0!==bi&&bi)&&Cr||Object,"function"==typeof(br=void 0!==An&&An)&&br||Object,"function"==typeof(Rr=void 0!==Mr&&Mr)&&Rr||Object,"function"==typeof(zr=void 0!==gr&&gr)&&zr||Object,"function"==typeof(Pr=void 0!==bn&&bn)&&Pr||Object])],xr)),Ur=function(e,t){function i(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Br=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},kr=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("VuforiaServiceProvider",Fr=function(){function e(e){e.isRealityManager&&(e.connectEvent.addEventListener(function(e){e.on["ar.vuforia.isAvailable"]=function(){return Promise.resolve({available:!1})}}),e.connectEvent.addEventListener(function(e){e.on["ar.vuforia.init"]=function(){return Promise.reject(new Error("Vuforia is not supported on this system"))}}))}return e}()),e("VuforiaServiceProvider",Fr=Br([D(bi),kr("design:paramtypes",["function"==typeof(Hr=void 0!==bi&&bi)&&Hr||Object])],Fr)),e("VuforiaService",Qr=function(){function e(e){this.sessionService=e}return e.prototype.isAvailable=function(){return this.sessionService.manager.request("ar.vuforia.isAvailable").then(function(e){return e.available})},e.prototype.init=function(e){var t=this;if("string"==typeof e&&(e={encryptedLicenseData:e}),!e.encryptedLicenseData||"string"!=typeof e.encryptedLicenseData)throw new Error("options.encryptedLicenseData is required.");return this.sessionService.manager.request("ar.vuforia.init",e).then(function(){return new Yr(t.sessionService.manager)})},e.prototype.initWithUnencryptedKey=function(e){var t=this;return"string"==typeof e&&(e={key:e}),this.sessionService.manager.request("ar.vuforia.init",e).then(function(){return new Yr(t.sessionService.manager)})},e}()),e("VuforiaService",Qr=Br([D(bi,Fr),kr("design:paramtypes",["function"==typeof(Wr=void 0!==bi&&bi)&&Wr||Object])],Qr)),e("VuforiaAPI",Yr=function(){function e(e){this.objectTracker=new Gr(e)}return e}()),e("VuforiaTracker",qr=function(){function e(){}return e}()),e("VuforiaObjectTracker",Gr=function(e){function t(t){var i=e.call(this)||this;return i.managerSession=t,i.dataSetLoadEvent=new ei,i.dataSetUnloadEvent=new ei,i.dataSetActivateEvent=new ei,i.dataSetDeactivateEvent=new ei,i._deprecatedDataSetInstanceMap=new Map,t.on["ar.vuforia.objectTrackerLoadDataSetEvent"]=function(e){i.dataSetLoadEvent.raiseEvent(e)},t.on["ar.vuforia.objectTrackerUnloadDataSetEvent"]=function(e){i.dataSetUnloadEvent.raiseEvent(e)},t.on["ar.vuforia.objectTrackerActivateDataSetEvent"]=function(e){var t=i._deprecatedDataSetInstanceMap.get(e.id);t?(t._onActivate(),i.dataSetActivateEvent.raiseEvent(t)):i.dataSetActivateEvent.raiseEvent(e)},t.on["ar.vuforia.objectTrackerDeactivateDataSetEvent"]=function(e){var t=i._deprecatedDataSetInstanceMap.get(e.id);t?(t._onDeactivate(),i.dataSetActivateEvent.raiseEvent(t)):i.dataSetDeactivateEvent.raiseEvent(e)},i}return Ur(t,e),t.prototype.createDataSet=function(e){var t=this;return e&&window.document&&(e=z(e)),this.managerSession.request("ar.vuforia.objectTrackerCreateDataSet",{url:e}).then(function(e){var i=new Vr(e.id,t.managerSession);return t._deprecatedDataSetInstanceMap.set(e.id,i),i})},t.prototype.createDataSetFromURL=function(e){return e&&window.document&&(e=z(e)),this.managerSession.request("ar.vuforia.objectTrackerCreateDataSet",{url:e}).then(function(e){return e.id})},Object.defineProperty(t.prototype,"createDataSetFromURI",{get:function(){return this.createDataSetFromURL},enumerable:!0,configurable:!0}),t.prototype.loadDataSet=function(e){var t=this;return this.managerSession.whenConnected().then(function(){return 0==t.managerSession.version[0]?t.managerSession.request("ar.vuforia.dataSetLoad",{id:e}):t.managerSession.request("ar.vuforia.objectTrackerLoadDataSet",{id:e})})},t.prototype.unloadDataSet=function(e){var t=this;return this.managerSession.whenConnected().then(function(){return 0==t.managerSession.version[0]?t.deactivateDataSet(e):t.managerSession.request("ar.vuforia.objectTrackerUnloadDataSet",{id:e})})},t.prototype.activateDataSet=function(e){return e=e instanceof Vr?e.id:e,this.managerSession.request("ar.vuforia.objectTrackerActivateDataSet",{id:e})},t.prototype.deactivateDataSet=function(e){return e=e instanceof Vr?e.id:e,this.managerSession.request("ar.vuforia.objectTrackerDeactivateDataSet",{id:e})},t}(qr)),Br([q("createDataSetFromURL"),kr("design:type",Function),kr("design:paramtypes",[String]),kr("design:returntype",Object)],Gr.prototype,"createDataSet",null),Br([q("createDataSetFromURL"),kr("design:type",Object),kr("design:paramtypes",[])],Gr.prototype,"createDataSetFromURI",null),e("DeprecatedVuforiaDataSet",Vr=function(){function e(e,t){this.id=e,this.managerSession=t,this._isActive=!1}return e.prototype._onActivate=function(){this._isActive=!0},e.prototype._onDeactivate=function(){this._isActive=!1},e.prototype.fetch=function(){return this.managerSession.request("ar.vuforia.dataSetFetch",{id:this.id})},e.prototype.load=function(){var e=this;return this.managerSession.request("ar.vuforia.dataSetLoad",{id:this.id}).then(function(t){return e._trackables=t,t})},e.prototype.isActive=function(){return this._isActive},e.prototype.getTrackables=function(){return this._trackables},e}()),Xr=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Zr=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},e("ArgonSystemProvider",Kr=function(){function e(e,t,i,n,r,o,s){this.context=e,this.focus=t,this.device=i,this.visibility=n,this.reality=r,this.view=o,this.vuforia=s}return e}()),e("ArgonSystemProvider",Kr=Xr([N(),Zr("design:paramtypes",["function"==typeof(to=void 0!==Hi&&Hi)&&to||Object,"function"==typeof(io=void 0!==rn&&rn)&&io||Object,"function"==typeof(no=void 0!==Rn&&Rn)&&no||Object,"function"==typeof(ro=void 0!==ln&&ln)&&ro||Object,"function"==typeof(oo=void 0!==gr&&gr)&&oo||Object,"function"==typeof(so=void 0!==wn&&wn)&&so||Object,"function"==typeof(ao=void 0!==Fr&&Fr)&&ao||Object])],Kr)),e("ArgonSystem",Jr=uo=function(){function e(e,t,i,n,r,o,s,a,u){var c=this;this.container=e,this.context=t,this.device=i,this.focus=n,this.reality=r,this.session=o,this.view=s,this.visibility=a,this.vuforia=u,uo.instance||(uo.instance=this),this.container.hasResolver(Kr)&&(this._provider=this.container.get(Kr)),this.context.frameStateEvent.addEventListener(function(e){c.device._processContextFrameState(e),c.view._processContextFrameState(e)}),this.session.connect()}return Object.defineProperty(e.prototype,"provider",{get:function(){return this.session.ensureIsRealityManager(),this._provider},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateEvent",{get:function(){return this.context.updateEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderEvent",{get:function(){return this.context.renderEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focusEvent",{get:function(){return this.focus.focusEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurEvent",{get:function(){return this.focus.blurEvent},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.session.manager.close(),uo.instance===this&&(uo.instance=void 0)},e}()),e("ArgonSystem",Jr=uo=Xr([N,Zr("design:paramtypes",["function"==typeof(co=(void 0!==Rt&&Rt).Container)&&co||Object,"function"==typeof(lo=void 0!==Vi&&Vi)&&lo||Object,"function"==typeof(ho=void 0!==bn&&bn)&&ho||Object,"function"==typeof(fo=void 0!==nn&&nn)&&fo||Object,"function"==typeof(po=void 0!==Mr&&Mr)&&po||Object,"function"==typeof(Mo=void 0!==bi&&bi)&&Mo||Object,"function"==typeof(go=void 0!==An&&An)&&go||Object,"function"==typeof(yo=void 0!==cn&&cn)&&yo||Object,"function"==typeof(Ao=void 0!==Qr&&Qr)&&Ao||Object])],Jr)),e("ArgonConfigurationManager",$r=function(){function e(t,i){void 0===i&&(i=new bt),this.configuration=t,this.container=i,i.registerInstance(Ht,t),Vt.isRealityManager(t.role)&&i.registerSingleton(Kr),e.configure(this)}return e.configure=function(e){e.standardConfiguration()},e.prototype.standardConfiguration=function(){this.defaultConnect(),this.defaultUI()},e.prototype.defaultConnect=function(){var e=this.container,t=this.configuration;Vt.isRealityManager(t.role)?e.registerSingleton(Ci,Ri):Ui.isAvailable()?e.registerSingleton(Ci,Ui):Bi.isAvailable()?e.registerSingleton(Ci,Bi):zi.isAvailable()?e.registerSingleton(Ci,zi):Pi.isAvailable()&&e.registerSingleton(Ci,Pi)},e.prototype.defaultUI=function(){Vt.isRealityManager(this.configuration.role)&&"undefined"!=typeof document&&this.container.get(xr)},e}()),e("initReality",eo=X),e("DI",Rt),e("Cesium",Bt),e("RealityViewer",qn),e("EmptyRealityViewer",Wn),e("LiveRealityViewer",ir),e("HostedRealityViewer",cr),e("ArgonSystemProvider",Kr),e("ArgonSystem",Jr),e("ArgonConfigurationManager",$r),e("init",W),e("initRealityViewer",X),e("initReality",eo),e("AVERAGE_EYE_HEIGHT",Yt),e("DEFAULT_NEAR_PLANE",qt),e("DEFAULT_FAR_PLANE",Gt),e("Role",Vt),e("Configuration",Ht),e("Viewport",Wt),e("CanvasViewport",Xt),e("SubviewType",Zt),e("SerializedEntityState",Kt),e("SerializedSubview",Jt),e("SerializedSubviewList",$t),e("EntityPose",qi),e("PoseStatus",Gi),e("ContextService",Vi),e("ContextServiceProvider",Hi),e("FocusService",nn);e("FocusServiceProvider",rn),e("DeviceStableState",xn),e("DeviceFrameState",Cn),e("DeviceService",bn),e("DeviceServiceProvider",Rn),e("RealityViewerFactory",pr),e("RealityService",Mr),e("RealityServiceProvider",gr),e("version",Ii),e("SessionPort",ji),e("SessionPortFactory",xi),e("ConnectService",Ci),e("SessionService",bi),e("LoopbackConnectService",Ri),e("DOMConnectService",zi),e("DebugConnectService",Pi),e("WKWebViewConnectService",Ui),e("AndroidWebViewConnectService",Bi),e("DefaultUIService",xr),e("eastUpSouthToFixedFrame",ci),e("getAncestorReferenceFrames",j),e("getReachableAncestorReferenceFrames",x),e("getEntityPositionInReferenceFrame",C),e("getEntityPosition",fi),e("getEntityOrientationInReferenceFrame",b),e("getEntityOrientation",di),e("getSerializedEntityState",R),e("resolveURL",z),e("parseURL",P),e("resolveElement",U),e("decomposePerspectiveOffCenterProjectionMatrix",B),e("decomposePerspectiveProjectionMatrix",k),e("convertEntityReferenceFrame",F),e("isIOS",Ei),e("installArgonApp",Q),e("openInArgonApp",Y),e("requestAnimationFrame",vi),e("cancelAnimationFrame",Ni),e("deprecated",q),e("defaultTerrainProvider",Di),e("updateHeightFromTerrain",G),e("getEventSynthesizier",si),e("createEventForwarder",_),e("CommandQueue",ti),e("Event",ei),e("MessageChannelLike",ii),e("SynchronousMessageChannel",ni),e("MessageChannelFactory",ri),e("Subview",Mn),e("ViewportMode",gn),e("ViewElement",yn),e("ViewService",An),e("ViewServiceProvider",wn),e("VisibilityService",cn),e("VisibilityServiceProvider",ln),e("VuforiaServiceProvider",Fr),e("VuforiaService",Qr),e("VuforiaAPI",Yr),e("VuforiaTracker",qr),e("VuforiaObjectTracker",Gr),e("DeprecatedVuforiaDataSet",Vr)}}})})(function(e){"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports&&"function"==typeof require?module.exports=e():Argon=e()}); \ No newline at end of file diff --git a/src/device.ts b/src/device.ts index 781af80..68f456a 100644 --- a/src/device.ts +++ b/src/device.ts @@ -30,7 +30,8 @@ import { SerializedEntityStateMap, SubviewType, ContextFrameState, - GeolocationOptions + GeolocationOptions, + Role } from './common' import { @@ -1034,7 +1035,7 @@ export class DeviceServiceProvider { JulianDate.now(this._publishTime); for (const id in this._subscribers) { const session = this._subscribers[id]; - if (session.version[0] > 0) { + if (session.version[0] > 0 && session !== this.sessionService.manager) { for (const k in stableState.entities) {delete stableState.entities[k]}; this.contextServiceProvider.fillEntityStateMapForSession(session, this._publishTime, stableState.entities); session.send('ar.device.state', stableState);