From d31651dcf8bfa2dba2c99902c06d2001aae378d7 Mon Sep 17 00:00:00 2001 From: altspaceautobot Date: Fri, 19 Jan 2018 15:51:50 -0800 Subject: [PATCH] Version bump 2.7.2 --- README.md | 4 +-- dist/altspace.js | 29 +++++++++++-------- dist/altspace.min.js | 8 ++--- doc/aframe/index.html | 4 +-- ...e_components.altspace-cursor-collider.html | 2 +- ..._components.altspace-tracked-controls.html | 2 +- .../module-altspace_components.altspace.html | 4 +-- ...le-altspace_components.collapse-model.html | 2 +- doc/aframe/module-altspace_components.html | 2 +- ...dule-altspace_components.instantiator.html | 2 +- ...odule-altspace_components.n-billboard.html | 2 +- ...le-altspace_components.n-box-collider.html | 2 +- ...ltspace_components.n-capsule-collider.html | 2 +- ...-altspace_components.n-cockpit-parent.html | 2 +- ...module-altspace_components.n-collider.html | 2 +- ...odule-altspace_components.n-container.html | 2 +- ...e-altspace_components.n-mesh-collider.html | 2 +- .../module-altspace_components.n-object.html | 2 +- .../module-altspace_components.n-portal.html | 2 +- ...altspace_components.n-skeleton-parent.html | 2 +- .../module-altspace_components.n-sound.html | 2 +- .../module-altspace_components.n-spawner.html | 2 +- ...altspace_components.n-sphere-collider.html | 2 +- .../module-altspace_components.n-text.html | 2 +- ...dule-altspace_components.one-per-user.html | 2 +- ...module-altspace_components.sync-color.html | 2 +- ...ace_components.sync-n-skeleton-parent.html | 2 +- ...dule-altspace_components.sync-n-sound.html | 2 +- ...odule-altspace_components.sync-system.html | 2 +- ...le-altspace_components.sync-transform.html | 2 +- .../module-altspace_components.sync.html | 2 +- .../module-altspace_components.wire.html | 2 +- doc/index.html | 4 +-- doc/js/index.html | 2 +- package.json | 2 +- 35 files changed, 58 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 0aa71cca..acb614a1 100644 --- a/README.md +++ b/README.md @@ -34,11 +34,11 @@ Many APIs are present in the client without loading `altspace.js`, but please st The version baked into the altspace.js script will determine which version of the entire SDK the client will provide your app. This means that if we make any breaking internal changes to things like rendering or cursor events, and you are using an older version of `altspace.js`, we will try to return legacy behavior appropriate to your version of `altspace.js`. Versioning will follow [SEMVER](http://semver.org/) as closely as possible. Details for each version can be found in the [Release Notes](https://github.com/AltspaceVR/AltspaceSDK/releases). -**Latest Version: v2.7.1 -- [See Changes](https://github.com/AltspaceVR/AltspaceSDK/releases/tag/v2.7.1)** +**Latest Version: v2.7.2 -- [See Changes](https://github.com/AltspaceVR/AltspaceSDK/releases/tag/v2.7.2)** Include the latest version of the SDK in your app with: -`` +`` If you use npm, you can install altspace.js with: diff --git a/dist/altspace.js b/dist/altspace.js index 29c6e50c..4a1648cb 100644 --- a/dist/altspace.js +++ b/dist/altspace.js @@ -501,7 +501,7 @@ var AltspaceTrackedControls = (function (AFrameComponent$$1) { * * My A-Frame Scene * -* +* * * * @@ -795,6 +795,7 @@ var SyncColor = (function (AFrameComponent$$1) { SyncColor.prototype.init = function init () { this.sync = this.el.components.sync; + this.lastValue = null; // wait for firebase connection to start sync routine if(this.sync.isConnected) @@ -805,6 +806,8 @@ var SyncColor = (function (AFrameComponent$$1) { SyncColor.prototype.start = function start () { + var this$1 = this; + var colorRef = this.sync.dataRef.child('material/color'); var refChangedLocked = false; var firstValue = true; @@ -812,13 +815,15 @@ var SyncColor = (function (AFrameComponent$$1) { this.el.addEventListener('componentchanged', function (event) { var name = event.detail.name; - var oldData = event.detail.oldData; - var newData = event.detail.newData; - if (name === 'material' && !refChangedLocked && oldData.color !== newData.color && self.sync.isMine) - { - //For some reason A-Frame has a misconfigured material reference if we do this too early - setTimeout(function () { return colorRef.set(newData.color); }, 0); + if (name === 'material'){ + var newData = self.el.getAttribute('material').color; + if(!refChangedLocked && this$1.lastValue !== newData && self.sync.isMine) + { + self.lastValue = newData; + //For some reason A-Frame has a misconfigured material reference if we do this too early + setTimeout(function () { return colorRef.set(newData); }, 0); + } } }); @@ -1443,7 +1448,7 @@ var SyncTransform = (function (AFrameComponent$$1) { if (!sync.isMine) { return; } var name = event.detail.name; - var newData = event.detail.newData; + var newData = component.el.getAttribute(name); if (name === 'position') { sendPosition(newData); @@ -1552,7 +1557,7 @@ var SyncNSound = (function (AFrameComponent$$1) { if (!this$1.sync.isMine) { return; } var name = event.detail.name; if (name !== 'n-sound') { return; } - this$1.soundStateRef.set(event.detail.newData); + this$1.soundStateRef.set(this$1.el.getAttribute(name)); }); this.soundStateRef.on('value', function (snapshot) { @@ -1629,7 +1634,7 @@ var SyncNSkeletonParent = (function (AFrameComponent$$1) { if (!this.sync.isMine) { return; } var name = event.detail.name; if (name === 'n-skeleton-parent') { - this.attributeRef.set(event.detail.newData); + this.attributeRef.set(this.el.getAttribute(name)); } }.bind(this)); }; @@ -3073,7 +3078,7 @@ var Visible = (function (AFrameComponent$$1) { * * My A-Frame Scene * -* +* * * * @@ -6339,7 +6344,7 @@ var utilities_lib = Object.freeze({ if(!Object.isFrozen(window.altspace)) { Object.assign(window.altspace, {components: {}, utilities: {}, inClient: false}); } -var version = '2.7.1'; +var version = '2.7.2'; if (window.altspace.requestVersion) { window.altspace.requestVersion(version); } diff --git a/dist/altspace.min.js b/dist/altspace.min.js index 86fe388e..3f6195fa 100644 --- a/dist/altspace.min.js +++ b/dist/altspace.min.js @@ -1,7 +1,7 @@ !function(){function n(t){return void 0!==t}function ba(){}function ca(t){t.vb=function(){return t.uf?t.uf:t.uf=new t}}function da(t){var e=typeof t;if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var n=Object.prototype.toString.call(t);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof t.length&&"undefined"!=typeof t.splice&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||"undefined"!=typeof t.call&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&"undefined"==typeof t.call)return"object";return e}function ea(t){return"array"==da(t)}function fa(t){var e=da(t);return"array"==e||"object"==e&&"number"==typeof t.length}function p(t){return"string"==typeof t}function ga(t){return"number"==typeof t}function ha(t){return"function"==da(t)}function ia(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function ja(t,e,n){return t.call.apply(t.bind,arguments)}function ka(t,e,n){if(!t)throw Error();if(2o;o++)n.push(r),r=e[o],Ca(t,t.Sd?t.Sd.call(e,String(o),r):r,n),r=",";n.push("]");break}n.push("{"),i="";for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r=e[o],"function"!=typeof r&&(n.push(i),Da(o,n),n.push(":"),Ca(t,t.Sd?t.Sd.call(e,o,r):r,n),i=","));n.push("}");break;case"function":break;default:throw Error("Unknown type: "+typeof e)}}function Da(t,e){e.push('"',t.replace(Fa,function(t){if(t in Ea)return Ea[t];var e=t.charCodeAt(0),n="\\u";return 16>e?n+="000":256>e?n+="00":4096>e&&(n+="0"),Ea[t]=n+e.toString(16)}),'"')}function Ga(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^la()).toString(36)}function Ka(){this.Wa=-1}function La(){this.Wa=-1,this.Wa=64,this.P=[],this.ne=[],this.Uf=[],this.Ld=[],this.Ld[0]=128;for(var t=1;tr;r++)i[r]=e.charCodeAt(n)<<24|e.charCodeAt(n+1)<<16|e.charCodeAt(n+2)<<8|e.charCodeAt(n+3),n+=4;else for(r=0;16>r;r++)i[r]=e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3],n+=4;for(r=16;80>r;r++){var o=i[r-3]^i[r-8]^i[r-14]^i[r-16];i[r]=4294967295&(o<<1|o>>>31)}e=t.P[0],n=t.P[1];for(var a,s=t.P[2],c=t.P[3],u=t.P[4],r=0;80>r;r++)40>r?20>r?(o=c^n&(s^c),a=1518500249):(o=n^s^c,a=1859775393):60>r?(o=n&s|c&(n|s),a=2400959708):(o=n^s^c,a=3395469782),o=(e<<5|e>>>27)+o+u+a+i[r]&4294967295,u=c,c=s,s=4294967295&(n<<30|n>>>2),n=e,e=o;t.P[0]=t.P[0]+e&4294967295,t.P[1]=t.P[1]+n&4294967295,t.P[2]=t.P[2]+s&4294967295,t.P[3]=t.P[3]+c&4294967295,t.P[4]=t.P[4]+u&4294967295}function Ta(t,e){var n=Ua(t,e,void 0);return 0>n?null:p(t)?t.charAt(n):t[n]}function Ua(t,e,n){for(var i=t.length,r=p(t)?t.split(""):t,o=0;i>o;o++)if(o in r&&e.call(n,r[o],o,t))return o;return-1}function Va(t,e){var n=Na(t,e);n>=0&&u.splice.call(t,n,1)}function Wa(t,e,n){return 2>=arguments.length?u.slice.call(t,e):u.slice.call(t,e,n)}function Xa(t,e){t.sort(e||Ya)}function Ya(t,e){return t>e?1:e>t?-1:0}function fb(t,e){if(!fa(t))throw Error("encodeByteArray takes an array as a parameter");gb();for(var n=e?db:cb,i=[],r=0;r>2,o=(3&o)<<4|s>>4,s=(15&s)<<2|u>>6,u=63&u;c||(u=64,a||(s=64)),i.push(n[h],n[o],n[s],n[u])}return i.join("")}function gb(){if(!cb){cb={},db={},eb={};for(var t=0;65>t;t++)cb[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t),db[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(t),eb[db[t]]=t,t>=62&&(eb["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t)]=t)}}function v(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function w(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function ib(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function jb(t){var e={};return ib(t,function(t,n){e[t]=n}),e}function kb(t){var e=[];return ib(t,function(t,n){ea(n)?Oa(n,function(n){e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}),e.length?"&"+e.join("&"):""}function lb(t){var e={};return t=t.replace(/^\?/,"").split("&"),Oa(t,function(t){t&&(t=t.split("="),e[t[0]]=t[1])}),e}function x(t,e,n,i){var r;if(e>i?r="at least "+e:i>n&&(r=0===n?"none":"no more than "+n),r)throw Error(t+" failed: Was called with "+i+(1===i?" argument.":" arguments.")+" Expects "+r+".")}function z(t,e,n){var i="";switch(e){case 1:i=n?"first":"First";break;case 2:i=n?"second":"Second";break;case 3:i=n?"third":"Third";break;case 4:i=n?"fourth":"Fourth";break;default:throw Error("errorPrefix called with argumentNumber > 4. Need to update it?")}return t=t+" failed: "+(i+" argument ")}function A(t,e,i,r){if((!r||n(i))&&!ha(i))throw Error(z(t,e,r)+"must be a valid function.")}function mb(t,e,i){if(n(i)&&(!ia(i)||null===i))throw Error(z(t,e,!0)+"must be a valid context object.")}function nb(t){return"undefined"!=typeof JSON&&n(JSON.parse)?JSON.parse(t):Aa(t)}function B(t){if("undefined"!=typeof JSON&&n(JSON.stringify))t=JSON.stringify(t);else{var e=[];Ca(new Ba,t,e),t=e.join("")}return t}function ob(){this.Wd=C}function pb(){}function rb(t,e,n){this.Rf=t,this.Ka=e,this.Kd=n}function vb(){this.ub=[]}function wb(t,e){for(var n=null,i=0;in?i=i.left:n>0&&(r=i,i=i.right)}throw Error("Attempted to find predecessor key for a nonexistent key. What gives?")}function cc(t,e,n,i,r){for(this.Ud=r||null,this.Ge=i,this.Qa=[],r=1;!t.e();)if(r=e?n(t.key,e):1,i&&(r*=-1),0>r)t=this.Ge?t.left:t.right;else{if(0===r){this.Qa.push(t);break}this.Qa.push(t),t=this.Ge?t.right:t.left}}function J(t){if(0===t.Qa.length)return null;var e,n=t.Qa.pop();if(e=t.Ud?t.Ud(n.key,n.value):{key:n.key,value:n.value},t.Ge)for(n=n.left;!n.e();)t.Qa.push(n),n=n.right;else for(n=n.right;!n.e();)t.Qa.push(n),n=n.left;return e}function dc(t){if(0===t.Qa.length)return null;var e;return e=t.Qa,e=e[e.length-1],t.Ud?t.Ud(e.key,e.value):{key:e.key,value:e.value}}function ec(t,e,n,i,r){this.key=t,this.value=e,this.color=null!=n?n:!0,this.left=null!=i?i:ac,this.right=null!=r?r:ac}function fc(t){return t.left.e()?t:fc(t.left)}function hc(t){return t.left.e()?ac:(t.left.fa()||t.left.left.fa()||(t=ic(t)),t=t.X(null,null,null,hc(t.left),null),gc(t))}function gc(t){return t.right.fa()&&!t.left.fa()&&(t=lc(t)),t.left.fa()&&t.left.left.fa()&&(t=jc(t)),t.left.fa()&&t.right.fa()&&(t=kc(t)),t}function ic(t){return t=kc(t),t.right.left.fa()&&(t=t.X(null,null,null,null,jc(t.right)),t=lc(t),t=kc(t)),t}function lc(t){return t.right.X(null,null,t.color,t.X(null,null,!0,null,t.right.left),null)}function jc(t){return t.left.X(null,null,t.color,null,t.X(null,null,!0,t.left.right,null))}function kc(t){return t.X(null,null,!t.color,t.left.X(null,null,!t.left.color,null,null),t.right.X(null,null,!t.right.color,null,null))}function mc(){}function nc(t,e){return t&&"object"==typeof t?(K(".sv"in t,"Unexpected leaf node or priority contents"),e[t[".sv"]]):t}function oc(t,e){var n=new pc;return qc(t,new L(""),function(t,i){n.nc(t,rc(i,e))}),n}function rc(t,e){var n,i=t.B().H(),i=nc(i,e);if(t.L()){var r=nc(t.Ca(),e);return r!==t.Ca()||i!==t.B().H()?new sc(r,M(i)):t}return n=t,i!==t.B().H()&&(n=n.ga(new sc(i))),t.R(N,function(t,i){var r=rc(i,e);r!==i&&(n=n.O(t,r))}),n}function L(t,e){if(1==arguments.length){this.n=t.split("/");for(var n=0,i=0;i=t.n.length?null:t.n[t.Z]}function tc(t){return t.n.length-t.Z}function H(t){var e=t.Z;return e>4),64!=s&&(i.push(a<<4&240|s>>2),64!=c&&i.push(s<<6&192|c))}if(8192>i.length)e=String.fromCharCode.apply(null,i);else{for(t="",n=0;nt.ac?t.update(t.Ld,56-t.ac):t.update(t.Ld,t.Wa-(t.ac-56));for(var i=t.Wa-1;i>=56;i--)t.ne[i]=255&n,n/=256;for(Ma(t,t.ne),i=n=0;5>i;i++)for(var r=24;r>=0;r-=8)e[n]=t.P[i]>>r&255,++n;return fb(e)}function Kc(t){for(var e="",n=0;n=0&&(a=t.substring(0,c-1),t=t.substring(c+2)),c=t.indexOf("/"),-1===c&&(c=t.length),e=t.substring(0,c),r="",t=t.substring(c).split("/"),c=0;c=0&&(o="https"===a||"wss"===a,s=e.substring(c+1),isFinite(s)&&(s=String(s)),s=p(s)?/^\s*-?0x/i.test(s)?parseInt(s,16):parseInt(s,10):NaN)}return{host:e,port:s,domain:n,Rg:i,lb:o,scheme:a,$c:r}}function Rc(t){return ga(t)&&(t!=t||t==Number.POSITIVE_INFINITY||t==Number.NEGATIVE_INFINITY)}function Sc(t){if("complete"===document.readyState)t();else{var e=!1,n=function(){document.body?e||(e=!0,t()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&n()}),window.attachEvent("onload",n))}}function Ub(t,e){if(t===e)return 0;if("[MIN_NAME]"===t||"[MAX_NAME]"===e)return-1;if("[MIN_NAME]"===e||"[MAX_NAME]"===t)return 1;var n=Tc(t),i=Tc(e);return null!==n?null!==i?0==n-i?t.length-e.length:n-i:-1:null!==i?1:e>t?-1:1}function Uc(t,e){if(e&&t in e)return e[t];throw Error("Missing required key ("+t+") in object: "+B(e))}function Vc(t){if("object"!=typeof t||null===t)return B(t);var e,n=[];for(e in t)n.push(e);n.sort(),e="{";for(var i=0;it?n.push(t.substring(i,t.length)):n.push(t.substring(i,i+e));return n}function Xc(t,e){if(ea(t))for(var n=0;nt,t=Math.abs(t),t>=Math.pow(2,-1022)?(i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023),n=i+1023,i=Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,i=Math.round(t/Math.pow(2,-1074)))),r=[],t=52;t;--t)r.push(i%2?1:0),i=Math.floor(i/2);for(t=11;t;--t)r.push(n%2?1:0),n=Math.floor(n/2);for(r.push(e?1:0),r.reverse(),e=r.join(""),n="",t=0;64>t;t+=8)i=parseInt(e.substr(t,8),2).toString(16),1===i.length&&(i="0"+i),n+=i;return n.toLowerCase()}function Tc(t){return Zc.test(t)&&(t=Number(t),t>=-2147483648&&2147483647>=t)?t:null}function Db(t){try{t()}catch(e){setTimeout(function(){throw Q("Exception was thrown by user callback.",e.stack||""),e},Math.floor(0))}}function R(t,e){if(ha(t)){var n=Array.prototype.slice.call(arguments,1).slice();Db(function(){t.apply(null,n)})}}function Jc(t){for(var e=[],n=0,i=0;i=55296&&56319>=r&&(r-=55296,i++,K(ir?e[n++]=r:(2048>r?e[n++]=r>>6|192:(65536>r?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return e}function wc(t){for(var e=0,n=0;ni?e++:2048>i?e+=2:i>=55296&&56319>=i?(e+=4,n++):e+=3}return e}function $c(t){var e={},n={},i={},r="";try{var o=t.split("."),e=nb(Hc(o[0])||""),n=nb(Hc(o[1])||""),r=o[2],i=n.d||{};delete n.d}catch(a){}return{Xg:e,Bc:n,data:i,Og:r}}function ad(t){return t=$c(t).Bc,"object"==typeof t&&t.hasOwnProperty("iat")?w(t,"iat"):null}function bd(t){t=$c(t);var e=t.Bc;return!!t.Og&&!!e&&"object"==typeof e&&e.hasOwnProperty("iat")}function cd(t){this.V=t,this.g=t.o.g}function dd(t,e,n,i){var r=[],o=[];return Oa(e,function(e){"child_changed"===e.type&&t.g.Ad(e.Le,e.Ja)&&o.push(new D("child_moved",e.Ja,e.Xa))}),ed(t,r,"child_removed",e,i,n),ed(t,r,"child_added",e,i,n),ed(t,r,"child_moved",o,i,n),ed(t,r,"child_changed",e,i,n),ed(t,r,Fb,e,i,n),r}function ed(t,e,n,i,r,o){i=Pa(i,function(t){return t.type===n}),Xa(i,q(t.fg,t)),Oa(i,function(n){var i=fd(t,n,o);Oa(r,function(r){r.Kf(n.type)&&e.push(r.createEvent(i,t.V))})})}function fd(t,e,n){return"value"!==e.type&&"child_removed"!==e.type&&(e.Qd=n.rf(e.Xa,e.Ja,t.g)),e}function gd(){this.bb={}}function hd(t,e){var n=e.type,i=e.Xa;K("child_added"==n||"child_changed"==n||"child_removed"==n,"Only child changes supported for tracking"),K(".priority"!==i,"Only non-priority child changes can be tracked.");var r=w(t.bb,i);if(r){var o=r.type;if("child_added"==n&&"child_removed"==o)t.bb[i]=new D("child_changed",e.Ja,i,r.Ja);else if("child_removed"==n&&"child_added"==o)delete t.bb[i];else if("child_removed"==n&&"child_changed"==o)t.bb[i]=new D("child_removed",r.Le,i);else if("child_changed"==n&&"child_added"==o)t.bb[i]=new D("child_added",e.Ja,i);else{if("child_changed"!=n||"child_changed"!=o)throw Gc("Illegal combination of changes: "+e+" occurred after "+r);t.bb[i]=new D("child_changed",e.Ja,i,r.Le)}}else t.bb[i]=e}function id(t,e,n){this.Rb=t,this.qb=e,this.sb=n||null}function jd(t,e,n){this.ha=t,this.qb=e,this.sb=n}function kd(t){this.g=t}function ld(t){this.Ce=new kd(t.g),this.g=t.g;var e;t.ma?(e=md(t),e=t.g.Pc(nd(t),e)):e=t.g.Tc(),this.ed=e,t.pa?(e=od(t),t=t.g.Pc(pd(t),e)):t=t.g.Qc(),this.Gc=t}function qd(t){this.sa=new ld(t),this.g=t.g,K(t.ja,"Only valid if limit has been set"),this.ka=t.ka,this.Jb=!rd(t)}function sd(t,e,n,i,r,o){var a;if(t.Jb){var s=td(t.g);a=function(t,e){return s(e,t)}}else a=td(t.g);K(e.Eb()==t.ka,"");var c=new F(n,i),u=t.Jb?ud(e,t.g):vd(e,t.g),h=t.sa.matches(c);if(e.Da(n)){for(var l=e.J(n),u=r.ze(t.g,u,t.Jb);null!=u&&(u.name==n||e.Da(u.name));)u=r.ze(t.g,u,t.Jb);return r=null==u?1:a(u,c),h&&!i.e()&&r>=0?(null!=o&&hd(o,new D("child_changed",i,n,l)),e.O(n,i)):(null!=o&&hd(o,new D("child_removed",l,n)),e=e.O(n,C),null!=u&&t.sa.matches(u)?(null!=o&&hd(o,new D("child_added",u.S,u.name)),e.O(u.name,u.S)):e)}return i.e()?e:h&&0<=a(u,c)?(null!=o&&(hd(o,new D("child_removed",u.S,u.name)),hd(o,new D("child_added",i,n))),e.O(n,i).O(u.name,C)):e}function wd(t,e){this.ke=t,this.dg=e}function yd(t){this.U=t}function Hd(t,e,n,i,r,o){var a=e.Q;if(null!=i.tc(n))return e;var s;if(n.e())K(Ib(e.C()),"If change path is empty, we must have complete server data"),e.C().Ub?(r=ub(e),i=i.yc(r instanceof T?r:C)):i=i.za(ub(e)),o=t.U.xa(e.Q.j(),i,o);else{var c=E(n);if(".priority"==c)K(1==tc(n),"Can't have a priority with additional path components"),o=a.j(),s=e.C().j(),i=i.ld(n,o,s),o=null!=i?t.U.ga(o,i):a.j();else{var u=H(n);sb(a,c)?(s=e.C().j(),i=i.ld(n,a.j(),s),i=null!=i?a.j().J(c).K(u,i):a.j().J(c)):i=i.xc(c,e.C()),o=null!=i?t.U.K(a.j(),c,i,u,r,o):a.j()}}return Fd(e,o,a.ea||n.e(),t.U.Na())}function Ad(t,e,n,i,r,o,a,s){var c=e.C();if(a=a?t.U:t.U.Wb(),n.e())i=a.xa(c.j(),i,null);else if(a.Na()&&!c.Ub)i=c.j().K(n,i),i=a.xa(c.j(),i,null);else{var u=E(n);if(!Jb(c,n)&&1o.status){try{e=nb(o.responseText)}catch(n){Q("Failed to parse JSON response for "+r+": "+o.responseText)}i(null,e)}else 401!==o.status&&404!==o.status&&Q("Got unsuccessful REST response for "+r+" Status: "+o.status),i(o.status);i=null}},o.open("GET",r,!0),o.send()}function Be(t,e){this.value=t,this.children=e||Ce}function De(t){var e=Nd;return r(t,function(t,n){e=e.set(new L(n),t)}),e}function Ee(t,e,n){if(null!=t.value&&n(t.value))return{path:G,value:t.value};if(e.e())return null;var i=E(e);return t=t.children.get(i),null!==t?(e=Ee(t,H(e),n),null!=e?{path:new L(i).u(e.path),value:e.value}:null):null}function Fe(t,e){return Ee(t,e,function(){return!0})}function Md(t,e,n){if(e.e())return n;var i=E(e);return e=Md(t.children.get(i)||Nd,H(e),n),i=e.e()?t.children.remove(i):t.children.Oa(i,e),new Be(t.value,i)}function Ge(t,e){return He(t,G,e)}function He(t,e,n){var i={};return t.children.ia(function(t,r){i[t]=He(r,e.u(t),n)}),n(e,t.value,i)}function Ie(t,e,n){return Je(t,e,G,n)}function Je(t,e,n,i){var r=t.value?i(n,t.value):!1;return r?r:e.e()?null:(r=E(e),(t=t.children.get(r))?Je(t,H(e),n.u(r),i):null)}function Ke(t,e,n){var i=G;if(!e.e()){var r=!0;t.value&&(r=n(i,t.value)),!0===r&&(r=E(e),(t=t.children.get(r))&&Le(t,H(e),i.u(r),n))}}function Le(t,e,n,i){if(e.e())return t;t.value&&i(n,t.value);var r=E(e);return(t=t.children.get(r))?Le(t,H(e),n.u(r),i):Nd}function Kd(t,e){Me(t,G,e)}function Me(t,e,n){t.children.ia(function(t,i){Me(i,e.u(t),n)}),t.value&&n(e,t.value)}function Ne(t,e){t.children.ia(function(t,n){n.value&&e(t,n.value)})}function Oe(t,e,n){this.type=Ed,this.source=Pe,this.path=t,this.Qb=e,this.Vd=n}function Qe(t,e,n,i){this.xe=t,this.pf=e,this.Ib=n,this.bf=i,K(!i||e,"Tagged queries must be from server.")}function Se(t){this.W=t}function Ue(t,e,n){if(e.e())return new Se(new Be(n));var i=Fe(t.W,e);if(null!=i){var r=i.path,i=i.value;return e=O(r,e),i=i.K(e,n),new Se(t.W.set(r,i))}return t=Md(t.W,e,new Be(n)),new Se(t)}function Ve(t,e,n){var i=t;return ib(n,function(t,n){i=Ue(i,e.u(t),n)}),i}function We(t,e){var n=Fe(t.W,e);return null!=n?t.W.get(n.path).Y(O(n.path,e)):null}function Xe(t){var e=[],n=t.W.value;return null!=n?n.L()||n.R(N,function(t,n){e.push(new F(t,n))}):t.W.children.ia(function(t,n){null!=n.value&&e.push(new F(t,n.value))}),e}function Ye(t,e){if(e.e())return t;var n=We(t,e);return new Se(null!=n?new Be(n):t.W.subtree(e))}function Ze(t,e,n){if(null!=e.value)return n.K(t,e.value);var i=null;return e.children.ia(function(e,r){".priority"===e?(K(null!==r.value,"Priority writes must always be leaf nodes"),i=r.value):n=Ze(t.u(e),r,n)}),n.Y(t).e()||null===i||(n=n.K(t.u(".priority"),i)),n}function $e(){this.T=Te,this.na=[],this.Mc=-1}function af(t,e){for(var n=0;na.Mc,"Stacking an older write on top of newer ones"),n(s)||(s=!0),a.na.push({path:e,Ga:i,kd:r,visible:s}),s&&(a.T=Ue(a.T,e,i)),a.Mc=r,o?mf(t,new Wb(Pe,e,i)):[]}function nf(t,e,n,i){var r=t.jb;return K(i>r.Mc,"Stacking an older merge on top of newer ones"),r.na.push({path:e,children:n,kd:i,visible:!0}),r.T=Ve(r.T,e,n),r.Mc=i,n=De(n),mf(t,new xe(Pe,e,n))}function of(t,e,n){n=n||!1;var i=af(t.jb,e);if(t.jb.Rd(e)){var r=Nd;return null!=i.Ga?r=r.set(G,!0):ib(i.children,function(t,e){r=r.set(new L(t),e)}),mf(t,new Oe(i.path,r,n))}return[]}function pf(t,e,n){return n=De(n),mf(t,new xe(Re,e,n))}function qf(t,e,n,i){if(i=rf(t,i),null!=i){var r=sf(i);return i=r.path,r=r.Ib,e=O(i,e),n=new Wb(new Qe(!1,!0,r,!0),e,n),tf(t,i,n)}return[]}function uf(t,e,n,i){if(i=rf(t,i)){var r=sf(i);return i=r.path,r=r.Ib,e=O(i,e),n=De(n),n=new xe(new Qe(!1,!0,r,!0),e,n),tf(t,i,n)}return[]}function yf(t){return Ge(t,function(t,e,n){if(e&&null!=gf(e))return[gf(e)];var i=[];return e&&(i=hf(e)),r(n,function(t){i=i.concat(t)}),i})}function Bf(t,e){for(var n=0;n10485760/3&&10485760=t}else if(-1=t;return!1}function tg(){var t,e=window.opener.frames;for(t=e.length-1;t>=0;t--)try{if(e[t].location.protocol===window.location.protocol&&e[t].location.host===window.location.host&&"__winchan_relay_frame"===e[t].name)return e[t]}catch(n){}return null}function ug(t,e,n){t.attachEvent?t.attachEvent("on"+e,n):t.addEventListener&&t.addEventListener(e,n,!1)}function vg(t,e,n){t.detachEvent?t.detachEvent("on"+e,n):t.removeEventListener&&t.removeEventListener(e,n,!1)}function wg(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(t);return e?e[1]:t}function xg(t){var e="";try{t=t.replace("#","");var n=lb(t);n&&v(n,"__firebase_request_key")&&(e=w(n,"__firebase_request_key"))}catch(i){}return e}function yg(){var t=Qc(kg);return t.scheme+"://"+t.host+"/v2"}function zg(t){return yg()+"/"+t+"/auth/channel"}function Ag(t){var e=this;if(this.Ac=t,this.de="*",sg(8)?this.Rc=this.zd=tg():(this.Rc=window.opener,this.zd=window),!e.Rc)throw"Unable to find relay frame";ug(this.zd,"message",q(this.ic,this)),ug(this.zd,"message",q(this.Bf,this));try{Bg(this,{a:"ready"})}catch(n){ug(this.Rc,"load",function(){Bg(e,{a:"ready"})})}ug(window,"unload",q(this.zg,this))}function Bg(t,e){e=B(e),sg(8)?t.Rc.doPost(e,t.de):t.Rc.postMessage(e,t.de)}function Cg(t){this.pc=Ga()+Ga()+Ga(),this.Ef=t}function Eg(t){var e=Error(w(Dg,t),t);return e.code=t,e}function Fg(t){var e;(e=!t.window_features)||(e=pg(),e=-1!==e.indexOf("Fennec/")||-1!==e.indexOf("Firefox/")&&-1!==e.indexOf("Android")),e&&(t.window_features=void 0),t.window_name||(t.window_name="_blank"),this.options=t}function Gg(t){t.method||(t.method="GET"),t.headers||(t.headers={}),t.headers.content_type||(t.headers.content_type="application/json"),t.headers.content_type=t.headers.content_type.toLowerCase(),this.options=t}function Hg(t){this.pc=Ga()+Ga()+Ga(),this.Ef=t}function Ig(t){t.callback_parameter||(t.callback_parameter="callback"),this.options=t,window.__firebase_auth_jsonp=window.__firebase_auth_jsonp||{}}function Jg(t,e,n){setTimeout(function(){try{var i=document.createElement("script");i.type="text/javascript",i.id=t,i.async=!0,i.src=e,i.onerror=function(){var e=document.getElementById(t);null!==e&&e.parentNode.removeChild(e),n&&n(Eg("NETWORK_ERROR"))};var r=document.getElementsByTagName("head");(r&&0!=r.length?r[0]:document.documentElement).appendChild(i)}catch(o){n&&n(Eg("NETWORK_ERROR"))}},0)}function Kg(t,e,n,i){Lf.call(this,["auth_status"]),this.F=t,this.ef=e,this.Tg=n,this.Me=i,this.sc=new og(t,[Cc,P]),this.nb=null,this.Te=!1,Lg(this)}function Lg(t){P.get("redirect_request_id")&&Mg(t);var e=t.sc.get();e&&e.token?(Ng(t,e),t.ef(e.token,function(n,i){Og(t,n,i,!1,e.token,e)},function(e,n){Pg(t,"resumeSession()",e,n)})):Ng(t,null)}function Qg(t,e,n,i,r,o){"firebaseio-demo.com"===t.F.domain&&Q("Firebase authentication is not supported on demo Firebases (*.firebaseio-demo.com). To secure your Firebase, create a production Firebase at https://www.firebase.com."),t.ef(e,function(o,a){Og(t,o,a,!0,e,n,i||{},r)},function(e,n){Pg(t,"auth()",e,n,o)})}function Rg(t,e){t.sc.clear(),Ng(t,null),t.Tg(function(t,n){if("ok"===t)R(e,null);else{var i=(t||"error").toUpperCase(),r=i;n&&(r+=": "+n),r=Error(r),r.code=i,R(e,r)}})}function Og(t,e,n,i,r,o,a,s){"ok"===e?(i&&(e=n.auth,o.auth=e,o.expires=n.expires,o.token=bd(r)?r:"",n=null,e&&v(e,"uid")?n=w(e,"uid"):v(o,"uid")&&(n=w(o,"uid")),o.uid=n,n="custom",e&&v(e,"provider")?n=w(e,"provider"):v(o,"provider")&&(n=w(o,"provider")),o.provider=n,t.sc.clear(),bd(r)&&(a=a||{},n=Cc,"sessionOnly"===a.remember&&(n=P),"none"!==a.remember&&t.sc.set(o,n)),Ng(t,o)),R(s,null,o)):(t.sc.clear(),Ng(t,null),o=t=(e||"error").toUpperCase(),n&&(o+=": "+n),o=Error(o),o.code=t,R(s,o))}function Pg(t,e,n,i,r){Q(e+" was canceled: "+i),t.sc.clear(),Ng(t,null),t=Error(i),t.code=n.toUpperCase(),R(r,t)}function Sg(t,e,n,i,r){Tg(t),n=new lg(i||{},{},n||{}),Ug(t,[Gg,Ig],"/auth/"+e,n,r)}function Vg(t,e,n,i){Tg(t);var r=[Fg,Hg];n=ng(n),"anonymous"===e||"password"===e?setTimeout(function(){R(i,Eg("TRANSPORT_UNAVAILABLE"))},0):(n.fe.window_features="menubar=yes,modal=yes,alwaysRaised=yeslocation=yes,resizable=yes,scrollbars=yes,status=yes,height=625,width=625,top="+("object"==typeof screen?.5*(screen.height-625):0)+",left="+("object"==typeof screen?.5*(screen.width-625):0),n.fe.relay_url=zg(t.F.Db),n.fe.requestWithCredential=q(t.qc,t),Ug(t,r,"/auth/"+e,n,i))}function Mg(t){var e=P.get("redirect_request_id");if(e){var n=P.get("redirect_client_options");P.remove("redirect_request_id"),P.remove("redirect_client_options");var i=[Gg,Ig],e={requestId:e,requestKey:xg(document.location.hash)},n=new lg(n,{},e);t.Te=!0;try{document.location.hash=document.location.hash.replace(/&__firebase_request_key=([a-zA-z0-9]*)/,"")}catch(r){}Ug(t,i,"/auth/session",n,function(){this.Te=!1}.bind(t))}}function Ug(t,e,n,i,r){Wg(t,e,n,i,function(e,n){!e&&n&&n.token&&n.uid?Qg(t,n.token,n,i.od,function(t,e){t?R(r,t):R(r,null,e)}):R(r,e||Eg("UNKNOWN_ERROR"))})}function Wg(t,e,n,i,r){e=Pa(e,function(t){return"function"==typeof t.isAvailable&&t.isAvailable()}),0===e.length?setTimeout(function(){R(r,Eg("TRANSPORT_UNAVAILABLE"))},0):(e=new(e.shift())(i.fe),i=jb(i.$a),i.v="js-"+hb,i.transport=e.Cc(),i.suppress_status_codes=!0,t=yg()+"/"+t.F.Db+n,e.open(t,i,function(t,e){if(t)R(r,t);else if(e&&e.error){var n=Error(e.error.message);n.code=e.error.code,n.details=e.error.details,R(r,n)}else R(r,null,e)}))}function Ng(t,e){var n=null!==t.nb||null!==e;t.nb=e,n&&t.ge("auth_status",e),t.Me(null!==e)}function Tg(t){var e=t.F;if("firebaseio.com"!==e.domain&&"firebaseio-demo.com"!==e.domain&&"auth.firebase.com"===kg)throw Error("This custom Firebase server ('"+t.F.domain+"') does not support delegated login.")}function Xg(t){this.ic=t,this.Nd=[],this.Sb=0,this.re=-1,this.Gb=null}function Yg(t,e,n){t.re=e,t.Gb=n,t.redocument.domain="'+document.domain+'";'),t=""+t+"";try{this.Ea.fb.open(),this.Ea.fb.write(t),this.Ea.fb.close()}catch(o){Cb("frame writing exception"),o.stack&&Cb(o.stack),Cb(o)}}function fh(t){if(t.me&&t.Xd&&t.Qe.count()<(0=t.ad[0].kf.length+30+n.length;){var r=t.ad.shift(),n=n+"&seg"+i+"="+r.Kg+"&ts"+i+"="+r.Sg+"&d"+i+"="+r.kf;i++}return gh(t,e+n,t.ue),!0}return!1}function gh(t,e,n){function i(){t.Qe.remove(n),fh(t)}t.Qe.add(n,1);var r=setTimeout(i,Math.floor(25e3));eh(t,e,function(){clearTimeout(r),i()})}function eh(t,e,n){setTimeout(function(){try{if(t.Xd){var i=t.Ea.fb.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){var t=i.readyState;t&&"loaded"!==t&&"complete"!==t||(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),n())},i.onerror=function(){Cb("Long-poll script failed to load: "+e),t.Xd=!1,t.close()},t.Ea.fb.body.appendChild(i)}}catch(r){}},Math.floor(1))}function ih(t,e,n){this.se=t,this.f=Nc(this.se),this.frames=this.Kc=null,this.ob=this.pb=this.cf=0,this.Va=Qb(e),this.eb=(e.lb?"wss://":"ws://")+e.Pa+"/.ws?v=5","undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(this.eb+="&r=f"),e.host!==e.Pa&&(this.eb=this.eb+"&ns="+e.Db),n&&(this.eb=this.eb+"&s="+n)}function lh(t,e){if(t.frames.push(e),t.frames.length==t.cf){var n=t.frames.join("");t.frames=null,n=nb(n),t.xg(n)}}function kh(t){clearInterval(t.Kc),t.Kc=setInterval(function(){t.ua&&t.ua.send("0"),kh(t)},Math.floor(45e3))}function mh(t){nh(this,t)}function nh(t,e){var n=ih&&ih.isAvailable(),i=n&&!(Cc.wf||!0===Cc.get("previous_websocket_failure"));if(e.Ug&&(n||Q("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)t.gd=[ih];else{var r=t.gd=[];Xc(oh,function(t,e){e&&e.isAvailable()&&r.push(e)})}}function ph(t){if(00&&(t.yd=setTimeout(function(){t.yd=null,t.Bb||(t.I&&102400=t.Mf?(t.f("Secondary connection is healthy."),t.Bb=!0,t.D.Ed(),t.D.start(),t.f("sending client ack on secondary"),t.D.send({t:"c",d:{t:"a",d:{}}}),t.f("Ending transmission on primary"),t.I.send({t:"c",d:{t:"n",d:{}}}),t.hd=t.D,wh(t)):(t.f("sending ping on secondary."),t.D.send({t:"c",d:{t:"p",d:{}}}))}function yh(t){t.Bb||(t.Se--,0>=t.Se&&(t.f("Primary connection is healthy."),t.Bb=!0,t.I.Ed()))}function vh(t,e){t.D=new e("c:"+t.id+":"+t.ff++,t.F,t.Zd),t.Mf=e.responsesRequiredToBeHealthy||0,t.D.open(sh(t,t.D),th(t,t.D)),setTimeout(function(){t.D&&(t.f("Timed out trying to upgrade."),t.D.close())},Math.floor(6e4))}function uh(t,e,n){t.f("Realtime connection established."),t.I=e,t.Ua=1,t.Wc&&(t.Wc(n),t.Wc=null),0===t.Se?(t.f("Primary connection is healthy."),t.Bb=!0):setTimeout(function(){zh(t)},Math.floor(5e3))}function zh(t){t.Bb||1!==t.Ua||(t.f("sending ping on primary."),Bh(t,{t:"c",d:{t:"p",d:{}}}))}function Bh(t,e){if(1!==t.Ua)throw"Connection is not connected";t.hd.send(e)}function xh(t){t.f("Shutting down all connections"),t.I&&(t.I.close(),t.I=null),t.D&&(t.D.close(),t.D=null),t.yd&&(clearTimeout(t.yd),t.yd=null)}function Ch(t,e,n,i){this.id=Dh++,this.f=Nc("p:"+this.id+":"),this.xf=this.Fe=!1,this.$={},this.qa=[],this.Yc=0,this.Vc=[],this.oa=!1,this.Za=1e3,this.Fd=3e5,this.Hb=e,this.Uc=n,this.Pe=i,this.F=t,this.tb=this.Aa=this.Ia=this.Xe=null,this.Ob=!1,this.Td={},this.Jg=0,this.nf=!0,this.Lc=this.He=null,Eh(this,0),Pf.vb().Fb("visible",this.Ag,this),-1===t.host.indexOf("fblocal")&&Of.vb().Fb("online",this.yg,this)}function Gh(t,e){var n=e.Gg,i=n.path.toString(),r=n.va();t.f("Listen on "+i+" for "+r);var o={p:i};e.tag&&(o.q=ce(n.o),o.t=e.tag),o.h=e.xd(),t.Fa("q",o,function(o){var a=o.d,s=o.s;if(a&&"object"==typeof a&&v(a,"w")){var c=w(a,"w");ea(c)&&0<=Na(c,"no_index")&&Q("Using an unspecified index. Consider adding "+('".indexOn": "'+n.o.g.toString()+'"')+" at "+n.path.toString()+" to your security rules for better performance")}(t.$[i]&&t.$[i][r])===e&&(t.f("listen response",o),"ok"!==s&&Hh(t,i,r),e.G&&e.G(s,a))})}function Ih(t){var e=t.Aa;t.oa&&e&&t.Fa("auth",{cred:e.gg},function(n){var i=n.s;n=n.d||"error","ok"!==i&&t.Aa===e&&delete t.Aa,e.of?"ok"!==i&&e.md&&e.md(i,n):(e.of=!0,e.zc&&e.zc(i,n))})}function Jh(t,e,n,i,r){n={p:n,d:i},t.f("onDisconnect "+e,n),t.Fa(e,n,function(t){r&&setTimeout(function(){r(t.s,t.d)},Math.floor(0))})}function Kh(t,e,i,r,o,a){r={p:i,d:r},n(a)&&(r.h=a),t.qa.push({action:e,Jf:r,G:o}),t.Yc++,e=t.qa.length-1,t.oa?Lh(t,e):t.f("Buffering put: "+i)}function Lh(t,e){var n=t.qa[e].action,i=t.qa[e].Jf,r=t.qa[e].G;t.qa[e].Hg=t.oa,t.Fa(n,i,function(i){t.f(n+" response",i),delete t.qa[e],t.Yc--,0===t.Yc&&(t.qa=[]),r&&r(i.s,i.d)})}function Eh(t,e){K(!t.Ia,"Scheduling a connect when we're already connected/ing?"),t.tb&&clearTimeout(t.tb),t.tb=setTimeout(function(){t.tb=null,Oh(t)},Math.floor(e))}function Oh(t){if(Ph(t)){t.f("Making a connection attempt"),t.He=(new Date).getTime(),t.Lc=null;var e=q(t.Id,t),n=q(t.Wc,t),i=q(t.Df,t),r=t.id+":"+Fh++;t.Ia=new qh(r,t.F,e,n,i,function(e){Q(e+" ("+t.F.toString()+")"),t.xf=!0})}}function Mh(t,e,n){n=n?Qa(n,function(t){return Vc(t)}).join("$"):"default",(t=Hh(t,e,n))&&t.G&&t.G("permission_denied")}function Hh(t,e,i){e=new L(e).toString();var r;return n(t.$[e])?(r=t.$[e][i],delete t.$[e][i],0===pa(t.$[e])&&delete t.$[e]):r=void 0,r}function Nh(t){Ih(t),r(t.$,function(e){r(e,function(e){Gh(t,e)})});for(var e=0;ea.Mc,"Stacking an older write on top of newer ones"),n(s)||(s=!0),a.na.push({path:e,Ga:i,kd:r,visible:s}),s&&(a.T=Ue(a.T,e,i)),a.Mc=r,o?mf(t,new Wb(Pe,e,i)):[]}function nf(t,e,n,i){var r=t.jb;return K(i>r.Mc,"Stacking an older merge on top of newer ones"),r.na.push({path:e,children:n,kd:i,visible:!0}),r.T=Ve(r.T,e,n),r.Mc=i,n=De(n),mf(t,new xe(Pe,e,n))}function of(t,e,n){n=n||!1;var i=af(t.jb,e);if(t.jb.Rd(e)){var r=Nd;return null!=i.Ga?r=r.set(G,!0):ib(i.children,function(t,e){r=r.set(new L(t),e)}),mf(t,new Oe(i.path,r,n))}return[]}function pf(t,e,n){return n=De(n),mf(t,new xe(Re,e,n))}function qf(t,e,n,i){if(i=rf(t,i),null!=i){var r=sf(i);return i=r.path,r=r.Ib,e=O(i,e),n=new Wb(new Qe(!1,!0,r,!0),e,n),tf(t,i,n)}return[]}function uf(t,e,n,i){if(i=rf(t,i)){var r=sf(i);return i=r.path,r=r.Ib,e=O(i,e),n=De(n),n=new xe(new Qe(!1,!0,r,!0),e,n),tf(t,i,n)}return[]}function yf(t){return Ge(t,function(t,e,n){if(e&&null!=gf(e))return[gf(e)];var i=[];return e&&(i=hf(e)),r(n,function(t){i=i.concat(t)}),i})}function Bf(t,e){for(var n=0;n10485760/3&&10485760=t}else if(-1=t;return!1}function tg(){var t,e=window.opener.frames;for(t=e.length-1;t>=0;t--)try{if(e[t].location.protocol===window.location.protocol&&e[t].location.host===window.location.host&&"__winchan_relay_frame"===e[t].name)return e[t]}catch(n){}return null}function ug(t,e,n){t.attachEvent?t.attachEvent("on"+e,n):t.addEventListener&&t.addEventListener(e,n,!1)}function vg(t,e,n){t.detachEvent?t.detachEvent("on"+e,n):t.removeEventListener&&t.removeEventListener(e,n,!1)}function wg(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(t);return e?e[1]:t}function xg(t){var e="";try{t=t.replace("#","");var n=lb(t);n&&v(n,"__firebase_request_key")&&(e=w(n,"__firebase_request_key"))}catch(i){}return e}function yg(){var t=Qc(kg);return t.scheme+"://"+t.host+"/v2"}function zg(t){return yg()+"/"+t+"/auth/channel"}function Ag(t){var e=this;if(this.Ac=t,this.de="*",sg(8)?this.Rc=this.zd=tg():(this.Rc=window.opener,this.zd=window),!e.Rc)throw"Unable to find relay frame";ug(this.zd,"message",q(this.ic,this)),ug(this.zd,"message",q(this.Bf,this));try{Bg(this,{a:"ready"})}catch(n){ug(this.Rc,"load",function(){Bg(e,{a:"ready"})})}ug(window,"unload",q(this.zg,this))}function Bg(t,e){e=B(e),sg(8)?t.Rc.doPost(e,t.de):t.Rc.postMessage(e,t.de)}function Cg(t){this.pc=Ga()+Ga()+Ga(),this.Ef=t}function Eg(t){var e=Error(w(Dg,t),t);return e.code=t,e}function Fg(t){var e;(e=!t.window_features)||(e=pg(),e=-1!==e.indexOf("Fennec/")||-1!==e.indexOf("Firefox/")&&-1!==e.indexOf("Android")),e&&(t.window_features=void 0),t.window_name||(t.window_name="_blank"),this.options=t}function Gg(t){t.method||(t.method="GET"),t.headers||(t.headers={}),t.headers.content_type||(t.headers.content_type="application/json"),t.headers.content_type=t.headers.content_type.toLowerCase(),this.options=t}function Hg(t){this.pc=Ga()+Ga()+Ga(),this.Ef=t}function Ig(t){t.callback_parameter||(t.callback_parameter="callback"),this.options=t,window.__firebase_auth_jsonp=window.__firebase_auth_jsonp||{}}function Jg(t,e,n){setTimeout(function(){try{var i=document.createElement("script");i.type="text/javascript",i.id=t,i.async=!0,i.src=e,i.onerror=function(){var e=document.getElementById(t);null!==e&&e.parentNode.removeChild(e),n&&n(Eg("NETWORK_ERROR"))};var r=document.getElementsByTagName("head");(r&&0!=r.length?r[0]:document.documentElement).appendChild(i)}catch(o){n&&n(Eg("NETWORK_ERROR"))}},0)}function Kg(t,e,n,i){Lf.call(this,["auth_status"]),this.F=t,this.ef=e,this.Tg=n,this.Me=i,this.sc=new og(t,[Cc,P]),this.nb=null,this.Te=!1,Lg(this)}function Lg(t){P.get("redirect_request_id")&&Mg(t);var e=t.sc.get();e&&e.token?(Ng(t,e),t.ef(e.token,function(n,i){Og(t,n,i,!1,e.token,e)},function(e,n){Pg(t,"resumeSession()",e,n)})):Ng(t,null)}function Qg(t,e,n,i,r,o){"firebaseio-demo.com"===t.F.domain&&Q("Firebase authentication is not supported on demo Firebases (*.firebaseio-demo.com). To secure your Firebase, create a production Firebase at https://www.firebase.com."),t.ef(e,function(o,a){Og(t,o,a,!0,e,n,i||{},r)},function(e,n){Pg(t,"auth()",e,n,o)})}function Rg(t,e){t.sc.clear(),Ng(t,null),t.Tg(function(t,n){if("ok"===t)R(e,null);else{var i=(t||"error").toUpperCase(),r=i;n&&(r+=": "+n),r=Error(r),r.code=i,R(e,r)}})}function Og(t,e,n,i,r,o,a,s){"ok"===e?(i&&(e=n.auth,o.auth=e,o.expires=n.expires,o.token=bd(r)?r:"",n=null,e&&v(e,"uid")?n=w(e,"uid"):v(o,"uid")&&(n=w(o,"uid")),o.uid=n,n="custom",e&&v(e,"provider")?n=w(e,"provider"):v(o,"provider")&&(n=w(o,"provider")),o.provider=n,t.sc.clear(),bd(r)&&(a=a||{},n=Cc,"sessionOnly"===a.remember&&(n=P),"none"!==a.remember&&t.sc.set(o,n)),Ng(t,o)),R(s,null,o)):(t.sc.clear(),Ng(t,null),o=t=(e||"error").toUpperCase(),n&&(o+=": "+n),o=Error(o),o.code=t,R(s,o))}function Pg(t,e,n,i,r){Q(e+" was canceled: "+i),t.sc.clear(),Ng(t,null),t=Error(i),t.code=n.toUpperCase(),R(r,t)}function Sg(t,e,n,i,r){Tg(t),n=new lg(i||{},{},n||{}),Ug(t,[Gg,Ig],"/auth/"+e,n,r)}function Vg(t,e,n,i){Tg(t);var r=[Fg,Hg];n=ng(n),"anonymous"===e||"password"===e?setTimeout(function(){R(i,Eg("TRANSPORT_UNAVAILABLE"))},0):(n.fe.window_features="menubar=yes,modal=yes,alwaysRaised=yeslocation=yes,resizable=yes,scrollbars=yes,status=yes,height=625,width=625,top="+("object"==typeof screen?.5*(screen.height-625):0)+",left="+("object"==typeof screen?.5*(screen.width-625):0),n.fe.relay_url=zg(t.F.Db),n.fe.requestWithCredential=q(t.qc,t),Ug(t,r,"/auth/"+e,n,i))}function Mg(t){var e=P.get("redirect_request_id");if(e){var n=P.get("redirect_client_options");P.remove("redirect_request_id"),P.remove("redirect_client_options");var i=[Gg,Ig],e={requestId:e,requestKey:xg(document.location.hash)},n=new lg(n,{},e);t.Te=!0;try{document.location.hash=document.location.hash.replace(/&__firebase_request_key=([a-zA-z0-9]*)/,"")}catch(r){}Ug(t,i,"/auth/session",n,function(){this.Te=!1}.bind(t))}}function Ug(t,e,n,i,r){Wg(t,e,n,i,function(e,n){!e&&n&&n.token&&n.uid?Qg(t,n.token,n,i.od,function(t,e){t?R(r,t):R(r,null,e)}):R(r,e||Eg("UNKNOWN_ERROR"))})}function Wg(t,e,n,i,r){e=Pa(e,function(t){return"function"==typeof t.isAvailable&&t.isAvailable()}),0===e.length?setTimeout(function(){R(r,Eg("TRANSPORT_UNAVAILABLE"))},0):(e=new(e.shift())(i.fe),i=jb(i.$a),i.v="js-"+hb,i.transport=e.Cc(),i.suppress_status_codes=!0,t=yg()+"/"+t.F.Db+n,e.open(t,i,function(t,e){if(t)R(r,t);else if(e&&e.error){var n=Error(e.error.message);n.code=e.error.code,n.details=e.error.details,R(r,n)}else R(r,null,e)}))}function Ng(t,e){var n=null!==t.nb||null!==e;t.nb=e,n&&t.ge("auth_status",e),t.Me(null!==e)}function Tg(t){var e=t.F;if("firebaseio.com"!==e.domain&&"firebaseio-demo.com"!==e.domain&&"auth.firebase.com"===kg)throw Error("This custom Firebase server ('"+t.F.domain+"') does not support delegated login.")}function Xg(t){this.ic=t,this.Nd=[],this.Sb=0,this.re=-1,this.Gb=null}function Yg(t,e,n){t.re=e,t.Gb=n,t.redocument.domain="'+document.domain+'";'),t=""+t+"";try{this.Ea.fb.open(),this.Ea.fb.write(t),this.Ea.fb.close()}catch(o){Cb("frame writing exception"),o.stack&&Cb(o.stack),Cb(o)}}function fh(t){if(t.me&&t.Xd&&t.Qe.count()<(0=t.ad[0].kf.length+30+n.length;){var r=t.ad.shift(),n=n+"&seg"+i+"="+r.Kg+"&ts"+i+"="+r.Sg+"&d"+i+"="+r.kf;i++}return gh(t,e+n,t.ue),!0}return!1}function gh(t,e,n){function i(){t.Qe.remove(n),fh(t)}t.Qe.add(n,1);var r=setTimeout(i,Math.floor(25e3));eh(t,e,function(){clearTimeout(r),i()})}function eh(t,e,n){setTimeout(function(){try{if(t.Xd){var i=t.Ea.fb.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){var t=i.readyState;t&&"loaded"!==t&&"complete"!==t||(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),n())},i.onerror=function(){Cb("Long-poll script failed to load: "+e),t.Xd=!1,t.close()},t.Ea.fb.body.appendChild(i)}}catch(r){}},Math.floor(1))}function ih(t,e,n){this.se=t,this.f=Nc(this.se),this.frames=this.Kc=null,this.ob=this.pb=this.cf=0,this.Va=Qb(e),this.eb=(e.lb?"wss://":"ws://")+e.Pa+"/.ws?v=5","undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(this.eb+="&r=f"),e.host!==e.Pa&&(this.eb=this.eb+"&ns="+e.Db),n&&(this.eb=this.eb+"&s="+n)}function lh(t,e){if(t.frames.push(e),t.frames.length==t.cf){var n=t.frames.join("");t.frames=null,n=nb(n),t.xg(n)}}function kh(t){clearInterval(t.Kc),t.Kc=setInterval(function(){t.ua&&t.ua.send("0"),kh(t)},Math.floor(45e3))}function mh(t){nh(this,t)}function nh(t,e){var n=ih&&ih.isAvailable(),i=n&&!(Cc.wf||!0===Cc.get("previous_websocket_failure"));if(e.Ug&&(n||Q("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)t.gd=[ih];else{var r=t.gd=[];Xc(oh,function(t,e){e&&e.isAvailable()&&r.push(e)})}}function ph(t){if(00&&(t.yd=setTimeout(function(){t.yd=null,t.Bb||(t.I&&102400=t.Mf?(t.f("Secondary connection is healthy."),t.Bb=!0,t.D.Ed(),t.D.start(),t.f("sending client ack on secondary"),t.D.send({t:"c",d:{t:"a",d:{}}}),t.f("Ending transmission on primary"),t.I.send({t:"c",d:{t:"n",d:{}}}),t.hd=t.D,wh(t)):(t.f("sending ping on secondary."),t.D.send({t:"c",d:{t:"p",d:{}}}))}function yh(t){t.Bb||(t.Se--,0>=t.Se&&(t.f("Primary connection is healthy."),t.Bb=!0,t.I.Ed()))}function vh(t,e){t.D=new e("c:"+t.id+":"+t.ff++,t.F,t.Zd),t.Mf=e.responsesRequiredToBeHealthy||0,t.D.open(sh(t,t.D),th(t,t.D)),setTimeout(function(){t.D&&(t.f("Timed out trying to upgrade."),t.D.close())},Math.floor(6e4))}function uh(t,e,n){t.f("Realtime connection established."),t.I=e,t.Ua=1,t.Wc&&(t.Wc(n),t.Wc=null),0===t.Se?(t.f("Primary connection is healthy."),t.Bb=!0):setTimeout(function(){zh(t)},Math.floor(5e3))}function zh(t){t.Bb||1!==t.Ua||(t.f("sending ping on primary."),Bh(t,{t:"c",d:{t:"p",d:{}}}))}function Bh(t,e){if(1!==t.Ua)throw"Connection is not connected";t.hd.send(e)}function xh(t){t.f("Shutting down all connections"),t.I&&(t.I.close(),t.I=null),t.D&&(t.D.close(),t.D=null),t.yd&&(clearTimeout(t.yd),t.yd=null)}function Ch(t,e,n,i){this.id=Dh++,this.f=Nc("p:"+this.id+":"),this.xf=this.Fe=!1,this.$={},this.qa=[],this.Yc=0,this.Vc=[],this.oa=!1,this.Za=1e3,this.Fd=3e5,this.Hb=e,this.Uc=n,this.Pe=i,this.F=t,this.tb=this.Aa=this.Ia=this.Xe=null,this.Ob=!1,this.Td={},this.Jg=0,this.nf=!0,this.Lc=this.He=null,Eh(this,0),Pf.vb().Fb("visible",this.Ag,this),-1===t.host.indexOf("fblocal")&&Of.vb().Fb("online",this.yg,this)}function Gh(t,e){var n=e.Gg,i=n.path.toString(),r=n.va();t.f("Listen on "+i+" for "+r);var o={p:i};e.tag&&(o.q=ce(n.o),o.t=e.tag),o.h=e.xd(),t.Fa("q",o,function(o){var a=o.d,s=o.s;if(a&&"object"==typeof a&&v(a,"w")){var c=w(a,"w");ea(c)&&0<=Na(c,"no_index")&&Q("Using an unspecified index. Consider adding "+('".indexOn": "'+n.o.g.toString()+'"')+" at "+n.path.toString()+" to your security rules for better performance")}(t.$[i]&&t.$[i][r])===e&&(t.f("listen response",o),"ok"!==s&&Hh(t,i,r),e.G&&e.G(s,a))})}function Ih(t){var e=t.Aa;t.oa&&e&&t.Fa("auth",{cred:e.gg},function(n){var i=n.s;n=n.d||"error","ok"!==i&&t.Aa===e&&delete t.Aa,e.of?"ok"!==i&&e.md&&e.md(i,n):(e.of=!0,e.zc&&e.zc(i,n))})}function Jh(t,e,n,i,r){n={p:n,d:i},t.f("onDisconnect "+e,n),t.Fa(e,n,function(t){r&&setTimeout(function(){r(t.s,t.d)},Math.floor(0))})}function Kh(t,e,i,r,o,a){r={p:i,d:r},n(a)&&(r.h=a),t.qa.push({action:e,Jf:r,G:o}),t.Yc++,e=t.qa.length-1,t.oa?Lh(t,e):t.f("Buffering put: "+i)}function Lh(t,e){var n=t.qa[e].action,i=t.qa[e].Jf,r=t.qa[e].G;t.qa[e].Hg=t.oa,t.Fa(n,i,function(i){t.f(n+" response",i),delete t.qa[e],t.Yc--,0===t.Yc&&(t.qa=[]),r&&r(i.s,i.d)})}function Eh(t,e){K(!t.Ia,"Scheduling a connect when we're already connected/ing?"),t.tb&&clearTimeout(t.tb),t.tb=setTimeout(function(){t.tb=null,Oh(t)},Math.floor(e))}function Oh(t){if(Ph(t)){t.f("Making a connection attempt"),t.He=(new Date).getTime(),t.Lc=null;var e=q(t.Id,t),n=q(t.Wc,t),i=q(t.Df,t),r=t.id+":"+Fh++;t.Ia=new qh(r,t.F,e,n,i,function(e){Q(e+" ("+t.F.toString()+")"),t.xf=!0})}}function Mh(t,e,n){n=n?Qa(n,function(t){return Vc(t)}).join("$"):"default",(t=Hh(t,e,n))&&t.G&&t.G("permission_denied")}function Hh(t,e,i){e=new L(e).toString();var r;return n(t.$[e])?(r=t.$[e][i],delete t.$[e][i],0===pa(t.$[e])&&delete t.$[e]):r=void 0,r}function Nh(t){Ih(t),r(t.$,function(e){r(e,function(e){Gh(t,e)})});for(var e=0;e.firebaseio.com instead"),n&&"undefined"!=n||Pc("Cannot parse Firebase url. Please use https://.firebaseio.com"),i.lb||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&Q("Insecure Firebase access from a secure page. Please use https in calls to new Firebase()."),n=new Dc(i.host,i.lb,n,"ws"===i.scheme||"wss"===i.scheme),i=new L(i.$c),r=i.toString();var o;if(!(o=!p(n.host)||0===n.host.length||!Tf(n.Db))&&(o=0!==r.length)&&(r&&(r=r.replace(/^\/*\.info(\/|$)/,"/")),o=!(p(r)&&0!==r.length&&!Rf.test(r))),o)throw Error(z("new Firebase",1,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".');if(e)if(e instanceof W)r=e;else{if(!p(e))throw Error("Expected a valid Firebase.Context for second argument to new Firebase()");r=W.vb(),n.Od=e}else r=W.vb();o=n.toString();var a=w(r.oc,o);a||(a=new Qh(n,r.Qf),r.oc[o]=a),n=a}Y.call(this,n,i,$d,!1)}function Mc(t,e){K(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?("undefined"!=typeof console&&("function"==typeof console.log?Bb=q(console.log,console):"object"==typeof console.log&&(Bb=function(t){console.log(t)})),e&&P.set("logging_enabled",!0)):t?Bb=t:(Bb=null,P.remove("logging_enabled"))}var g,aa=this,la=Date.now||function(){return+new Date},ya="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),Ea={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"," ":"\\u000b"},Fa=/\uffff/.test("ï¿¿")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,Ha;t:{var Ia=aa.navigator;if(Ia){var Ja=Ia.userAgent;if(Ja){Ha=Ja;break t}}Ha=""}ma(La,Ka),La.prototype.reset=function(){this.P[0]=1732584193,this.P[1]=4023233417,this.P[2]=2562383102,this.P[3]=271733878,this.P[4]=3285377520,this.ee=this.ac=0},La.prototype.update=function(t,e){if(null!=t){n(e)||(e=t.length);for(var i=e-this.Wa,r=0,o=this.ne,a=this.ac;e>r;){if(0==a)for(;i>=r;)Ma(this,t,r),r+=this.Wa;if(p(t)){for(;e>r;)if(o[a]=t.charCodeAt(r),++a,++r,a==this.Wa){Ma(this,o),a=0;break}}else for(;e>r;)if(o[a]=t[r],++a,++r,a==this.Wa){Ma(this,o),a=0;break}}this.ac=a,this.ee+=e}};var u=Array.prototype,Na=u.indexOf?function(t,e,n){return u.indexOf.call(t,e,n)}:function(t,e,n){if(n=null==n?0:0>n?Math.max(0,t.length+n):n,p(t))return p(e)&&1==e.length?t.indexOf(e,n):-1;for(;no;o++)o in r&&e.call(n,r[o],o,t)},Pa=u.filter?function(t,e,n){return u.filter.call(t,e,n)}:function(t,e,n){for(var i=t.length,r=[],o=0,a=p(t)?t.split(""):t,s=0;i>s;s++)if(s in a){var c=a[s];e.call(n,c,s,t)&&(r[o++]=c)}return r},Qa=u.map?function(t,e,n){return u.map.call(t,e,n)}:function(t,e,n){for(var i=t.length,r=Array(i),o=p(t)?t.split(""):t,a=0;i>a;a++)a in o&&(r[a]=e.call(n,o[a],a,t));return r},Ra=u.reduce?function(t,e,n,i){for(var r=[],o=1,a=arguments.length;a>o;o++)r.push(arguments[o]);return i&&(r[0]=q(e,i)),u.reduce.apply(t,r)}:function(t,e,n,i){var r=n;return Oa(t,function(n,o){r=e.call(i,r,n,o,t)}),r},Sa=u.every?function(t,e,n){return u.every.call(t,e,n)}:function(t,e,n){for(var i=t.length,r=p(t)?t.split(""):t,o=0;i>o;o++)if(o in r&&!e.call(n,r[o],o,t))return!1;return!0},Za=-1!=Ha.indexOf("Opera")||-1!=Ha.indexOf("OPR"),$a=-1!=Ha.indexOf("Trident")||-1!=Ha.indexOf("MSIE"),ab=-1!=Ha.indexOf("Gecko")&&-1==Ha.toLowerCase().indexOf("webkit")&&!(-1!=Ha.indexOf("Trident")||-1!=Ha.indexOf("MSIE")),bb=-1!=Ha.toLowerCase().indexOf("webkit");!function(){var t,e="";return Za&&aa.opera?(e=aa.opera.version,ha(e)?e():e):(ab?t=/rv\:([^\);]+)(\)|;)/:$a?t=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:bb&&(t=/WebKit\/(\S+)/),t&&(e=(e=t.exec(Ha))?e[1]:""),$a&&(t=(t=aa.document)?t.documentMode:void 0,t>parseFloat(e))?String(t):e)}();var cb=null,db=null,eb=null,hb=hb||"2.2.9";ob.prototype.j=function(t){return this.Wd.Y(t)},ob.prototype.toString=function(){return this.Wd.toString()},pb.prototype.qf=function(){return null},pb.prototype.ze=function(){return null};var qb=new pb;rb.prototype.qf=function(t){var e=this.Ka.Q;return sb(e,t)?e.j().J(t):(e=null!=this.Kd?new tb(this.Kd,!0,!1):this.Ka.C(),this.Rf.xc(t,e))},rb.prototype.ze=function(t,e,n){var i=null!=this.Kd?this.Kd:ub(this.Ka);return t=this.Rf.oe(i,e,1,n,t),0===t.length?null:t[0]},xb.prototype.add=function(t){this.vd.push(t)},xb.prototype.Zb=function(){return this.ra};var Fb="value";Gb.prototype.Zb=function(){var t=this.$d.mc();return"value"===this.ud?t.path:t.parent().path},Gb.prototype.Ae=function(){return this.ud},Gb.prototype.Vb=function(){return this.ve.Vb(this)},Gb.prototype.toString=function(){return this.Zb().toString()+":"+this.ud+":"+B(this.$d.mf())},Hb.prototype.Zb=function(){return this.path},Hb.prototype.Ae=function(){return"cancel"},Hb.prototype.Vb=function(){return this.ve.Vb(this)},Hb.prototype.toString=function(){return this.path.toString()+":cancel"},tb.prototype.j=function(){return this.w},Kb.prototype.get=function(){var t=this.eg.get(),e=xa(t);if(this.Dd)for(var n in this.Dd)e[n]-=this.Dd[n];return this.Dd=t,e},Lb.prototype.If=function(){var t,e=this.fd.get(),n={},i=!1;for(t in e)0e?n=n.left:e>0&&(n=n.right)}return null},g.e=function(){return this.wa.e()},g.count=function(){return this.wa.count()},g.Sc=function(){return this.wa.Sc()},g.fc=function(){return this.wa.fc()},g.ia=function(t){return this.wa.ia(t)},g.Xb=function(t){return new cc(this.wa,null,this.La,!1,t)},g.Yb=function(t,e){return new cc(this.wa,t,this.La,!1,e)},g.$b=function(t,e){return new cc(this.wa,t,this.La,!0,e)},g.sf=function(t){return new cc(this.wa,null,this.La,!0,t)},g=ec.prototype,g.X=function(t,e,n,i,r){return new ec(null!=t?t:this.key,null!=e?e:this.value,null!=n?n:this.color,null!=i?i:this.left,null!=r?r:this.right)},g.count=function(){return this.left.count()+1+this.right.count()},g.e=function(){return!1},g.ia=function(t){return this.left.ia(t)||t(this.key,this.value)||this.right.ia(t)},g.Sc=function(){return fc(this).key},g.fc=function(){return this.right.e()?this.key:this.right.fc()},g.Oa=function(t,e,n){var i,r;return r=this,i=n(t,r.key),r=0>i?r.X(null,null,null,r.left.Oa(t,e,n),null):0===i?r.X(null,e,null,null,null):r.X(null,null,null,null,r.right.Oa(t,e,n)),gc(r)},g.remove=function(t,e){var n,i;if(n=this,0>e(t,n.key))n.left.e()||n.left.fa()||n.left.left.fa()||(n=ic(n)),n=n.X(null,null,null,n.left.remove(t,e),null);else{if(n.left.fa()&&(n=jc(n)),n.right.e()||n.right.fa()||n.right.left.fa()||(n=kc(n),n.left.left.fa()&&(n=jc(n),n=kc(n))),0===e(t,n.key)){if(n.right.e())return ac;i=fc(n.right),n=n.X(i.key,i.value,null,null,hc(n.right))}n=n.X(null,null,null,null,n.right.remove(t,e))}return gc(n)},g.fa=function(){return this.color},g=mc.prototype,g.X=function(){return this},g.Oa=function(t,e){return new ec(t,e,null)},g.remove=function(){return this},g.count=function(){return 0},g.e=function(){return!0},g.ia=function(){return!1},g.Sc=function(){return null},g.fc=function(){return null},g.fa=function(){return!1};var ac=new mc;g=L.prototype,g.toString=function(){for(var t="",e=this.Z;e=this.n.length)return null;for(var t=[],e=this.Z;e=this.n.length},g.ca=function(t){if(tc(this)!==tc(t))return!1;for(var e=this.Z,n=t.Z;e<=this.n.length;e++,n++)if(this.n[e]!==t.n[n])return!1;return!0},g.contains=function(t){var e=this.Z,n=t.Z;if(tc(this)>tc(t))return!1;for(;e"),t};var Fc=function(){var t=1;return function(){return t++}}(),Bb=null,Lc=!0,Zc=/^-?\d{1,10}$/;cd.prototype.fg=function(t,e){if(null==t.Xa||null==e.Xa)throw Gc("Should only compare child_ events.");return this.g.compare(new F(t.Xa,t.Ja),new F(e.Xa,e.Ja))},g=id.prototype,g.Kf=function(t){return"value"===t},g.createEvent=function(t,e){var n=e.o.g;return new Gb("value",this,new S(t.Ja,e.mc(),n))},g.Vb=function(t){var e=this.sb;if("cancel"===t.Ae()){K(this.qb,"Raising a cancel event on a listener with no cancel callback");var n=this.qb;return function(){n.call(e,t.error)}}var i=this.Rb;return function(){i.call(e,t.$d)}},g.gf=function(t,e){return this.qb?new Hb(this,t,e):null},g.matches=function(t){return t instanceof id?t.Rb&&this.Rb?t.Rb===this.Rb&&t.sb===this.sb:!0:!1},g.tf=function(){return null!==this.Rb},g=jd.prototype,g.Kf=function(t){return t="children_added"===t?"child_added":t,("children_removed"===t?"child_removed":t)in this.ha},g.gf=function(t,e){return this.qb?new Hb(this,t,e):null},g.createEvent=function(t,e){K(null!=t.Xa,"Child events should have a childName.");var n=e.mc().u(t.Xa);return new Gb(t.type,this,new S(t.Ja,n,e.o.g),t.Qd)},g.Vb=function(t){var e=this.sb;if("cancel"===t.Ae()){K(this.qb,"Raising a cancel event on a listener with no cancel callback");var n=this.qb;return function(){n.call(e,t.error)}}var i=this.ha[t.ud];return function(){i.call(e,t.$d,t.Qd)}},g.matches=function(t){if(t instanceof jd){if(!this.ha||!t.ha)return!0;if(this.sb===t.sb){var e=pa(t.ha);if(e===pa(this.ha)){if(1===e){var e=qa(t.ha),n=qa(this.ha);return!(n!==e||t.ha[e]&&this.ha[n]&&t.ha[e]!==this.ha[n])}return oa(this.ha,function(e,n){return t.ha[n]===e})}}}return!1},g.tf=function(){return null!==this.ha},g=kd.prototype,g.K=function(t,e,n,i,r,o){return K(t.Jc(this.g),"A node must be indexed if only a child is updated"),r=t.J(e),r.Y(i).ca(n.Y(i))&&r.e()==n.e()?t:(null!=o&&(n.e()?t.Da(e)?hd(o,new D("child_removed",r,e)):K(t.L(),"A child remove without an old child only makes sense on a leaf node"):r.e()?hd(o,new D("child_added",n,e)):hd(o,new D("child_changed",n,e,r))),t.L()&&n.e()?t:t.O(e,n).mb(this.g))},g.xa=function(t,e,n){return null!=n&&(t.L()||t.R(N,function(t,i){e.Da(t)||hd(n,new D("child_removed",i,t))}),e.L()||e.R(N,function(e,i){if(t.Da(e)){var r=t.J(e);r.ca(i)||hd(n,new D("child_changed",i,e,r))}else hd(n,new D("child_added",i,e))})),e.mb(this.g)},g.ga=function(t,e){return t.e()?C:t.ga(e)},g.Na=function(){return!1},g.Wb=function(){return this},g=ld.prototype,g.matches=function(t){return 0>=this.g.compare(this.ed,t)&&0>=this.g.compare(t,this.Gc)},g.K=function(t,e,n,i,r,o){return this.matches(new F(e,n))||(n=C),this.Ce.K(t,e,n,i,r,o)},g.xa=function(t,e,n){e.L()&&(e=C);var i=e.mb(this.g),i=i.ga(C),r=this;return e.R(N,function(t,e){r.matches(new F(t,e))||(i=i.O(t,C))}),this.Ce.xa(t,i,n)},g.ga=function(t){return t},g.Na=function(){return!0},g.Wb=function(){return this.Ce},g=qd.prototype,g.K=function(t,e,n,i,r,o){return this.sa.matches(new F(e,n))||(n=C),t.J(e).ca(n)?t:t.Eb()=this.g.compare(this.sa.ed,a):0>=this.g.compare(a,this.sa.Gc)))break;i=i.O(a.name,a.S),r++}}else{i=e.mb(this.g),i=i.ga(C);var s,c,u;if(this.Jb){e=i.sf(this.g),s=this.sa.Gc,c=this.sa.ed;var h=td(this.g);u=function(t,e){return h(e,t)}}else e=i.Xb(this.g),s=this.sa.ed,c=this.sa.Gc,u=td(this.g);for(var r=0,l=!1;0=u(s,a)&&(l=!0),(o=l&&r=u(a,c))?r++:i=i.O(a.name,C)}return this.sa.Wb().xa(t,i,n)},g.ga=function(t){return t},g.Na=function(){return!0},g.Wb=function(){return this.sa.Wb()},yd.prototype.ab=function(t,e,n,i){var r,o=new gd;if(e.type===Xb)e.source.xe?n=zd(this,t,e.path,e.Ga,n,i,o):(K(e.source.pf,"Unknown source."),r=e.source.bf,n=Ad(this,t,e.path,e.Ga,n,i,r,o));else if(e.type===Bd)e.source.xe?n=Cd(this,t,e.path,e.children,n,i,o):(K(e.source.pf,"Unknown source."),r=e.source.bf,n=Dd(this,t,e.path,e.children,n,i,r,o));else if(e.type===Ed)if(e.Vd)if(e=e.path,null!=n.tc(e))n=t;else{if(r=new rb(n,t,i),i=t.Q.j(),e.e()||".priority"===E(e))Ib(t.C())?e=n.za(ub(t)):(e=t.C().j(),K(e instanceof T,"serverChildren would be complete if leaf node"),e=n.yc(e)),e=this.U.xa(i,e,o);else{var a=E(e),s=n.xc(a,t.C());null==s&&sb(t.C(),a)&&(s=i.J(a)),e=null!=s?this.U.K(i,a,s,H(e),r,o):t.Q.j().Da(a)?this.U.K(i,a,C,H(e),r,o):i,e.e()&&Ib(t.C())&&(i=n.za(ub(t)),i.L()&&(e=this.U.xa(e,i,o)))}i=Ib(t.C())||null!=n.tc(G),n=Fd(t,e,i,this.U.Na())}else n=Gd(this,t,e.path,e.Qb,n,i,o);else{if(e.type!==Zb)throw Gc("Unknown operation type: "+e.type);i=e.path,e=t.C(),r=e.j(),a=e.ea||i.e(),n=Hd(this,new Id(t.Q,new tb(r,a,e.Ub)),i,n,qb,o)}return o=ra(o.bb),i=n,e=i.Q,e.ea&&(r=e.j().L()||e.j().e(),a=Jd(t),(0=0,"Unknown leaf type: "+e),K(r>=0,"Unknown leaf type: "+n),i===r?"object"===n?0:this.Ai){var o,a=[];for(o in e)a[o]=e[o];return a}return t&&!this.B().e()&&(e[".priority"]=this.B().H()),e},g.hash=function(){if(null===this.Cb){var t="";this.B().e()||(t+="priority:"+me(this.B().H())+":"),this.R(N,function(e,n){var i=n.hash();""!==i&&(t+=":"+e+":"+i)}),this.Cb=""===t?"":Ic(t)}return this.Cb},g.rf=function(t,e,n){return(n=oe(this,n))?(t=bc(n,new F(t,e)))?t.name:null:bc(this.m,t)},g.R=function(t,e){var n=oe(this,t);return n?n.ia(function(t){return e(t.name,t.S)}):this.m.ia(e)},g.Xb=function(t){return this.Yb(t.Tc(),t)},g.Yb=function(t,e){var n=oe(this,e);if(n)return n.Yb(t,function(t){return t});for(var n=this.m.Yb(t.name,Sb),i=dc(n);null!=i&&0>e.compare(i,t);)J(n),i=dc(n);return n},g.sf=function(t){return this.$b(t.Qc(),t)},g.$b=function(t,e){var n=oe(this,e);if(n)return n.$b(t,function(t){return t});for(var n=this.m.$b(t.name,Sb),i=dc(n);null!=i&&0t?-1:1});g=Be.prototype,g.e=function(){return null===this.value&&this.children.e()},g.subtree=function(t){if(t.e())return this;var e=this.children.get(E(t));return null!==e?e.subtree(H(t)):Nd},g.set=function(t,e){if(t.e())return new Be(e,this.children);var n=E(t),i=(this.children.get(n)||Nd).set(H(t),e),n=this.children.Oa(n,i);return new Be(this.value,n)},g.remove=function(t){if(t.e())return this.children.e()?Nd:new Be(null,this.children);var e=E(t),n=this.children.get(e);return n?(t=n.remove(H(t)),e=t.e()?this.children.remove(e):this.children.Oa(e,t),null===this.value&&e.e()?Nd:new Be(this.value,e)):this},g.get=function(t){if(t.e())return this.value;var e=this.children.get(E(t));return e?e.get(H(t)):null};var Nd=new Be(null);Be.prototype.toString=function(){var t={};return Kd(this,function(e,n){t[e.toString()]=n.toString()}),B(t)},Oe.prototype.Xc=function(t){return this.path.e()?null!=this.Qb.value?(K(this.Qb.children.e(),"affectedTree should not have overlapping affected paths."),this):(t=this.Qb.subtree(new L(t)),new Oe(G,t,this.Vd)):(K(E(this.path)===t,"operationForChild called for unrelated child."),new Oe(H(this.path),this.Qb,this.Vd))},Oe.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" ack write revert="+this.Vd+" affectedTree="+this.Qb+")"};var Xb=0,Bd=1,Ed=2,Zb=3,Pe=new Qe(!0,!1,null,!1),Re=new Qe(!1,!0,null,!1);Qe.prototype.toString=function(){return this.xe?"user":this.bf?"server(queryID="+this.Ib+")":"server"};var Te=new Se(new Be(null));Se.prototype.Rd=function(t){return t.e()?Te:(t=Md(this.W,t,Nd),new Se(t))},Se.prototype.e=function(){return this.W.e()},Se.prototype.apply=function(t){return Ze(G,this.W,t)},g=$e.prototype,g.Rd=function(t){var e=Ua(this.na,function(e){return e.kd===t});K(e>=0,"removeWrite called with nonexistent writeId.");var n=this.na[e];this.na.splice(e,1);for(var i=n.visible,o=!1,a=this.na.length-1;i&&a>=0;){var s=this.na[a];s.visible&&(a>=e&&bf(s,n.path)?i=!1:n.path.contains(s.path)&&(o=!0)),a--}if(i){if(o)this.T=cf(this.na,df,G),this.Mc=0=0;o--)r[o]="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(n%64),n=Math.floor(n/64);if(K(0===n,"Cannot push at time == 0"),n=r.join(""),i){for(o=11;o>=0&&63===e[o];o--)e[o]=0;e[o]++}else for(o=0;12>o;o++)e[o]=Math.floor(64*Math.random());for(o=0;12>o;o++)n+="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(e[o]);return K(20===n.length,"nextPushId: Length should be 20."), n}}();ma(Of,Lf),Of.prototype.Be=function(t){return K("online"===t,"Unknown event type: "+t),[this.jc]},ca(Of),ma(Pf,Lf),Pf.prototype.Be=function(t){return K("visible"===t,"Unknown event type: "+t),[this.Ob]},ca(Pf);var Qf=/[\[\].#$\/\u0000-\u001F\u007F]/,Rf=/[\[\].#$\u0000-\u001F\u007F]/,Sf=/^[a-zA-Z][a-zA-Z._\-+]+$/;g=hg.prototype,g.add=function(t,e){this.set[t]=null!==e?e:!0},g.contains=function(t){return v(this.set,t)},g.get=function(t){return this.contains(t)?this.set[t]:void 0},g.remove=function(t){delete this.set[t]},g.clear=function(){this.set={}},g.e=function(){return wa(this.set)},g.count=function(){return pa(this.set)},g.keys=function(){var t=[];return r(this.set,function(e,n){t.push(n)}),t},pc.prototype.find=function(t){if(null!=this.A)return this.A.Y(t);if(t.e()||null==this.m)return null;var e=E(t);return t=H(t),this.m.contains(e)?this.m.get(e).find(t):null},pc.prototype.nc=function(t,e){if(t.e())this.A=e,this.m=null;else if(null!==this.A)this.A=this.A.K(t,e);else{null==this.m&&(this.m=new hg);var n=E(t);this.m.contains(n)||this.m.add(n,new pc),n=this.m.get(n),t=H(t),n.nc(t,e)}},pc.prototype.R=function(t){null!==this.m&&ig(this.m,function(e,n){t(e,n)})};var kg="auth.firebase.com",mg=["remember","redirectTo"];og.prototype.set=function(t,e){if(!e){if(!this.ce.length)throw Error("fb.login.SessionManager : No storage options available!");e=this.ce[0]}e.set(this.Re,t)},og.prototype.get=function(){var t=Qa(this.ce,q(this.og,this)),t=Pa(t,function(t){return null!==t});return Xa(t,function(t,e){return ad(e.token)-ad(t.token)}),0o.status){try{t=nb(o.responseText)}catch(e){}n(null,t)}else n(500<=o.status&&600>o.status?Eg("SERVER_ERROR"):Eg("NETWORK_ERROR"));n=null,vg(window,"beforeunload",i)}},"GET"===a)t+=(/\?/.test(t)?"":"?")+kb(e),r=null;else{var s=this.options.headers.content_type;"application/json"===s&&(r=B(e)),"application/x-www-form-urlencoded"===s&&(r=kb(e))}o.open(a,t,!0),t={"X-Requested-With":"XMLHttpRequest",Accept:"application/json;text/plain"},za(t,this.options.headers);for(var c in t)o.setRequestHeader(c,t[c]);o.send(r)},Gg.isAvailable=function(){var t;return(t=!!window.XMLHttpRequest)&&(t=pg(),t=!(t.match(/MSIE/)||t.match(/Trident/))||sg(10)),t},Gg.prototype.Cc=function(){return"json"},Hg.prototype.open=function(t,e,n){function i(){n&&(n(Eg("USER_CANCELLED")),n=null)}var r,o=this,a=Qc(kg);e.requestId=this.pc,e.redirectTo=a.scheme+"://"+a.host+"/blank/page.html",t+=/\?/.test(t)?"":"?",t+=kb(e),(r=window.open(t,"_blank","location=no"))&&ha(r.addEventListener)?(r.addEventListener("loadstart",function(t){var e;if(e=t&&t.url)t:{try{var s=document.createElement("a");s.href=t.url,e=s.host===a.host&&"/blank/page.html"===s.pathname;break t}catch(c){}e=!1}e&&(t=xg(t.url),r.removeEventListener("exit",i),r.close(),t=new lg(null,null,{requestId:o.pc,requestKey:t}),o.Ef.requestWithCredential("/auth/session",t,n),n=null)}),r.addEventListener("exit",i)):n(Eg("TRANSPORT_UNAVAILABLE"))},Hg.isAvailable=function(){return qg()},Hg.prototype.Cc=function(){return"redirect"},Ig.prototype.open=function(t,e,n){function i(){n&&(n(Eg("REQUEST_INTERRUPTED")),n=null)}function r(){setTimeout(function(){window.__firebase_auth_jsonp[o]=void 0,wa(window.__firebase_auth_jsonp)&&(window.__firebase_auth_jsonp=void 0);try{var t=document.getElementById(o);t&&t.parentNode.removeChild(t)}catch(e){}},1),vg(window,"beforeunload",i)}var o="fn"+(new Date).getTime()+Math.floor(99999*Math.random());e[this.options.callback_parameter]="__firebase_auth_jsonp."+o,t+=(/\?/.test(t)?"":"?")+kb(e),ug(window,"beforeunload",i),window.__firebase_auth_jsonp[o]=function(t){n&&(n(null,t),n=null),r()},Jg(o,t,n)},Ig.isAvailable=function(){return"undefined"!=typeof document&&null!=document.createElement},Ig.prototype.Cc=function(){return"json"},ma(Kg,Lf),g=Kg.prototype,g.ye=function(){return this.nb||null},g.te=function(t,e){Tg(this);var n=ng(t);n.$a._method="POST",this.qc("/users",n,function(t,n){t?R(e,t):R(e,t,n)})},g.Ue=function(t,e){var n=this;Tg(this);var i="/users/"+encodeURIComponent(t.email),r=ng(t);r.$a._method="DELETE",this.qc(i,r,function(t,i){!t&&i&&i.uid&&n.nb&&n.nb.uid&&n.nb.uid===i.uid&&Rg(n),R(e,t)})},g.qe=function(t,e){Tg(this);var n="/users/"+encodeURIComponent(t.email)+"/password",i=ng(t);i.$a._method="PUT",i.$a.password=t.newPassword,this.qc(n,i,function(t){R(e,t)})},g.pe=function(t,e){Tg(this);var n="/users/"+encodeURIComponent(t.oldEmail)+"/email",i=ng(t);i.$a._method="PUT",i.$a.email=t.newEmail,i.$a.password=t.password,this.qc(n,i,function(t){R(e,t)})},g.We=function(t,e){Tg(this);var n="/users/"+encodeURIComponent(t.email)+"/password",i=ng(t);i.$a._method="POST",this.qc(n,i,function(t){R(e,t)})},g.qc=function(t,e,n){Wg(this,[Gg,Ig],t,e,n)},g.Be=function(t){return K("auth_status"===t,'initial event must be of type "auth_status"'),this.Te?null:[this.nb]};var ah,bh;$g.prototype.open=function(t,e){this.hf=0,this.la=e,this.Af=new Xg(t),this.Ab=!1;var n=this;this.rb=setTimeout(function(){n.f("Timed out trying to connect."),n.hb(),n.rb=null},Math.floor(3e4)),Sc(function(){if(!n.Ab){n.Ta=new ch(function(t,e,i,r,o){if(dh(n,arguments),n.Ta)if(n.rb&&(clearTimeout(n.rb),n.rb=null),n.Hc=!0,"start"==t)n.id=e,n.Gf=i;else{if("close"!==t)throw Error("Unrecognized command received: "+t);e?(n.Ta.Xd=!1,Yg(n.Af,e,function(){n.hb()})):n.hb()}},function(t,e){dh(n,arguments),Zg(n.Af,t,e)},function(){n.hb()},n.jd);var t={start:"t"};t.ser=Math.floor(1e8*Math.random()),n.Ta.ie&&(t.cb=n.Ta.ie),t.v="5",n.Zd&&(t.s=n.Zd),"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(t.r="f"),t=n.jd(t),n.f("Connecting via long-poll to "+t),eh(n.Ta,t,function(){})}})},$g.prototype.start=function(){var t=this.Ta,e=this.Gf;for(t.sg=this.id,t.tg=e,t.me=!0;fh(t););t=this.id,e=this.Gf,this.gc=document.createElement("iframe");var n={dframe:"t"};n.id=t,n.pw=e,this.gc.src=this.jd(n),this.gc.style.display="none",document.body.appendChild(this.gc)},$g.isAvailable=function(){return ah||!bh&&"undefined"!=typeof document&&null!=document.createElement&&!("object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))&&!("object"==typeof Windows&&"object"==typeof Windows.Vg)&&!0},g=$g.prototype,g.Ed=function(){},g.dd=function(){this.Ab=!0,this.Ta&&(this.Ta.close(),this.Ta=null),this.gc&&(document.body.removeChild(this.gc),this.gc=null),this.rb&&(clearTimeout(this.rb),this.rb=null)},g.hb=function(){this.Ab||(this.f("Longpoll is closing itself"),this.dd(),this.la&&(this.la(this.Hc),this.la=null))},g.close=function(){this.Ab||(this.f("Longpoll is being closed."),this.dd())},g.send=function(t){t=B(t),this.pb+=t.length,Nb(this.Va,"bytes_sent",t.length),t=Jc(t),t=fb(t,!0),t=Wc(t,1840);for(var e=0;e=t.length){var e=Number(t);if(!isNaN(e)){r.cf=e,r.frames=[],t=null;break t}}r.cf=1,r.frames=[]}null!==t&&lh(r,t)}},this.ua.onerror=function(t){r.f("WebSocket error. Closing connection."),(t=t.message||t.data)&&r.f(t),r.hb()}},ih.prototype.start=function(){},ih.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var e=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);e&&1parseFloat(e[1])&&(t=!0)}return!t&&null!==hh&&!jh},ih.responsesRequiredToBeHealthy=2,ih.healthyTimeout=3e4,g=ih.prototype,g.Ed=function(){Cc.remove("previous_websocket_failure")},g.send=function(t){kh(this),t=B(t),this.pb+=t.length,Nb(this.Va,"bytes_sent",t.length),t=Wc(t,16384),1r;r++)e+=" ";console.log(e+i)}}},g.$e=function(t){Nb(this.Va,t),this.Qg.Nf[t]=!0},g.f=function(t){var e="";this.Sa&&(e=this.Sa.id+":"),Cb(e,arguments)},W.prototype.zb=function(){for(var t in this.oc)this.oc[t].zb()},W.prototype.rc=function(){for(var t in this.oc)this.oc[t].rc()},W.prototype.we=function(){this.Qf=!0},ca(W),W.prototype.interrupt=W.prototype.zb,W.prototype.resume=W.prototype.rc,X.prototype.cancel=function(t){x("Firebase.onDisconnect().cancel",0,1,arguments.length),A("Firebase.onDisconnect().cancel",1,t,!0),this.bd.Jd(this.ra,t||null)},X.prototype.cancel=X.prototype.cancel,X.prototype.remove=function(t){x("Firebase.onDisconnect().remove",0,1,arguments.length),bg("Firebase.onDisconnect().remove",this.ra),A("Firebase.onDisconnect().remove",1,t,!0),Yh(this.bd,this.ra,null,t)},X.prototype.remove=X.prototype.remove,X.prototype.set=function(t,e){x("Firebase.onDisconnect().set",1,2,arguments.length),bg("Firebase.onDisconnect().set",this.ra),Vf("Firebase.onDisconnect().set",t,this.ra,!1),A("Firebase.onDisconnect().set",2,e,!0),Yh(this.bd,this.ra,t,e)},X.prototype.set=X.prototype.set,X.prototype.Kb=function(t,e,n){x("Firebase.onDisconnect().setWithPriority",2,3,arguments.length),bg("Firebase.onDisconnect().setWithPriority",this.ra),Vf("Firebase.onDisconnect().setWithPriority",t,this.ra,!1),Yf("Firebase.onDisconnect().setWithPriority",2,e),A("Firebase.onDisconnect().setWithPriority",3,n,!0),Zh(this.bd,this.ra,t,e,n)},X.prototype.setWithPriority=X.prototype.Kb,X.prototype.update=function(t,e){if(x("Firebase.onDisconnect().update",1,2,arguments.length),bg("Firebase.onDisconnect().update",this.ra),ea(t)){for(var n={},i=0;i=t)throw Error("Query.limit: First argument must be a positive integer.");if(this.o.ja)throw Error("Query.limit: Limit was already set (by another call to limit, limitToFirst, orlimitToLast.");var e=this.o.Ie(t);return li(e),new Y(this.k,this.path,e,this.kc)},g.Je=function(t){if(x("Query.limitToFirst",1,1,arguments.length),!ga(t)||Math.floor(t)!==t||0>=t)throw Error("Query.limitToFirst: First argument must be a positive integer.");if(this.o.ja)throw Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new Y(this.k,this.path,this.o.Je(t),this.kc)},g.Ke=function(t){if(x("Query.limitToLast",1,1,arguments.length),!ga(t)||Math.floor(t)!==t||0>=t)throw Error("Query.limitToLast: First argument must be a positive integer.");if(this.o.ja)throw Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new Y(this.k,this.path,this.o.Ke(t),this.kc)},g.Cg=function(t){if(x("Query.orderByChild",1,1,arguments.length),"$key"===t)throw Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===t)throw Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===t)throw Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');$f("Query.orderByChild",1,t,!1),mi(this,"Query.orderByChild");var e=be(this.o,new Sd(t));return ki(e),new Y(this.k,this.path,e,!0)},g.Dg=function(){x("Query.orderByKey",0,0,arguments.length),mi(this,"Query.orderByKey");var t=be(this.o,Od);return ki(t),new Y(this.k,this.path,t,!0)},g.Eg=function(){x("Query.orderByPriority",0,0,arguments.length),mi(this,"Query.orderByPriority");var t=be(this.o,N);return ki(t),new Y(this.k,this.path,t,!0)},g.Fg=function(){x("Query.orderByValue",0,0,arguments.length),mi(this,"Query.orderByValue");var t=be(this.o,Yd);return ki(t),new Y(this.k,this.path,t,!0)},g.ae=function(t,e){x("Query.startAt",0,2,arguments.length),Vf("Query.startAt",t,this.path,!0),$f("Query.startAt",2,e,!0);var i=this.o.ae(t,e);if(li(i),ki(i),this.o.ma)throw Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return n(t)||(e=t=null),new Y(this.k,this.path,i,this.kc)},g.td=function(t,e){x("Query.endAt",0,2,arguments.length),Vf("Query.endAt",t,this.path,!0),$f("Query.endAt",2,e,!0);var n=this.o.td(t,e);if(li(n),ki(n),this.o.pa)throw Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new Y(this.k,this.path,n,this.kc)},g.ig=function(t,e){if(x("Query.equalTo",1,2,arguments.length),Vf("Query.equalTo",t,this.path,!1),$f("Query.equalTo",2,e,!0),this.o.ma)throw Error("Query.equalTo: Starting point was already set (by another call to endAt or equalTo).");if(this.o.pa)throw Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.ae(t,e).td(t,e)},g.toString=function(){x("Query.toString",0,0,arguments.length);for(var t=this.path,e="",n=t.Z;n=128?"dark":"light"}function o(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function a(t){function e(){i=(i+1)%256,r=(r+n[i])%256;var t=n[i];return n[i]=n[r],n[r]=t,n[(n[i]+n[r])%256]}for(var n=[],i=0,r=0,o=0;256>o;o++)n[o]=o;for(var a=0,s=0;256>a;a++){s=(s+n[a]+t.charCodeAt(a%t.length))%256;var c=n[a];n[a]=n[s],n[s]=c}this.random=function(){for(var t=0,n=0,i=1;8>t;t++)n+=e()*i,i*=256;return n/0x10000000000000000}}var s={},c={aliceblue:"F0F8FF",antiquewhite:"FAEBD7",aqua:"00FFFF",aquamarine:"7FFFD4",azure:"F0FFFF",beige:"F5F5DC",bisque:"FFE4C4",black:"000000",blanchedalmond:"FFEBCD",blue:"0000FF",blueviolet:"8A2BE2",brown:"A52A2A",burlywood:"DEB887",cadetblue:"5F9EA0",chartreuse:"7FFF00",chocolate:"D2691E",coral:"FF7F50",cornflowerblue:"6495ED",cornsilk:"FFF8DC",crimson:"DC143C",cyan:"00FFFF",darkblue:"00008B",darkcyan:"008B8B",darkgoldenrod:"B8860B",darkgray:"A9A9A9",darkgrey:"A9A9A9",darkgreen:"006400",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkseagreen:"8FBC8F",darkslateblue:"483D8B",darkslategray:"2F4F4F",darkslategrey:"2F4F4F",darkturquoise:"00CED1",darkviolet:"9400D3",deeppink:"FF1493",deepskyblue:"00BFFF",dimgray:"696969",dimgrey:"696969",dodgerblue:"1E90FF",firebrick:"B22222",floralwhite:"FFFAF0",forestgreen:"228B22",fuchsia:"FF00FF",gainsboro:"DCDCDC",ghostwhite:"F8F8FF",gold:"FFD700",goldenrod:"DAA520",gray:"808080",grey:"808080",green:"008000",greenyellow:"ADFF2F",honeydew:"F0FFF0",hotpink:"FF69B4",indianred:"CD5C5C",indigo:"4B0082",ivory:"FFFFF0",khaki:"F0E68C",lavender:"E6E6FA",lavenderblush:"FFF0F5",lawngreen:"7CFC00",lemonchiffon:"FFFACD",lightblue:"ADD8E6",lightcoral:"F08080",lightcyan:"E0FFFF",lightgoldenrodyellow:"FAFAD2",lightgray:"D3D3D3",lightgrey:"D3D3D3",lightgreen:"90EE90",lightpink:"FFB6C1",lightsalmon:"FFA07A",lightseagreen:"20B2AA",lightskyblue:"87CEFA",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"B0C4DE",lightyellow:"FFFFE0",lime:"00FF00",limegreen:"32CD32",linen:"FAF0E6",magenta:"FF00FF",maroon:"800000",mediumaquamarine:"66CDAA",mediumblue:"0000CD",mediumorchid:"BA55D3",mediumpurple:"9370D8",mediumseagreen:"3CB371",mediumslateblue:"7B68EE",mediumspringgreen:"00FA9A",mediumturquoise:"48D1CC",mediumvioletred:"C71585",midnightblue:"191970",mintcream:"F5FFFA",mistyrose:"FFE4E1",moccasin:"FFE4B5",navajowhite:"FFDEAD",navy:"000080",oldlace:"FDF5E6",olive:"808000",olivedrab:"6B8E23",orange:"FFA500",orangered:"FF4500",orchid:"DA70D6",palegoldenrod:"EEE8AA",palegreen:"98FB98",paleturquoise:"AFEEEE",palevioletred:"D87093",papayawhip:"FFEFD5",peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",rebeccapurple:"663399",red:"FF0000",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0C0C0",skyblue:"87CEEB",slateblue:"6A5ACD",slategray:"708090",slategrey:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"FFFFFF",whitesmoke:"F5F5F5",yellow:"FFFF00",yellowgreen:"9ACD32"},u=.618033988749895,h={hue:null,saturation:null,value:null,base_color:"",greyscale:!1,grayscale:!1,golden:!0,full_random:!1,colors_returned:1,format:"hex",seed:null},l={scheme_type:"analogous",format:"hex"},f={golden:!1,format:"hex"};return s.NAME_to_HEX=function(t){return t=t.toLowerCase(),t in c?c[t]:void console.error("Color name not recognized.")},s.NAME_to_RGB=function(t){return s.HEX_to_RGB(s.NAME_to_HEX(t))},s.NAME_to_HSV=function(t){return s.HEX_to_HSV(s.NAME_to_HEX(t))},s.HEX_to_RGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,n,i){return e+e+n+n+i+i});var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null},s.RGB_to_HEX=function(t){return"#"+((1<<24)+(t.r<<16)+(t.g<<8)+t.b).toString(16).slice(1)},s.HSV_to_RGB=function(t){var e,n,i,r,o,a,s,c,u=t.h,h=t.s,l=t.v;if(0===h)return{r:l,g:l,b:l};switch(u/=60,r=Math.floor(u),o=u-r,a=l*(1-h),s=l*(1-h*o),c=l*(1-h*(1-o)),r){case 0:e=l,n=c,i=a;break;case 1:e=s,n=l,i=a;break;case 2:e=a,n=l,i=c;break;case 3:e=a,n=s,i=l;break;case 4:e=c,n=a,i=l;break;case 5:e=l,n=a,i=s}return{r:Math.floor(255*e),g:Math.floor(255*n),b:Math.floor(255*i)}},s.RGB_to_HSV=function(t){var e=t.r/255,n=t.g/255,i=t.b/255,r=0,o=0,a=0,s=Math.min(e,Math.min(n,i)),c=Math.max(e,Math.max(n,i));if(s===c)return a=s,{h:0,s:0,v:a};var u=e===s?n-i:i===s?e-n:i-e,h=e===s?3:i===s?1:5;return r=60*(h-u/(c-s)),o=(c-s)/c,a=c,{h:r,s:o,v:a}},s.HSV_to_HEX=function(t){return s.RGB_to_HEX(s.HSV_to_RGB(t))},s.HEX_to_HSV=function(t){return s.RGB_to_HSV(s.HEX_to_RGB(t))},s.make_scheme=function(t,e){function r(t){return{h:t.h,s:t.s,v:t.v}}var a,s,c,u,h,f=o(l);if(null!==e)for(var d in e)e.hasOwnProperty(d)&&(f[d]=e[d]);var p=[t];switch(f.scheme_type.toLowerCase()){case"monochromatic":case"mono":for(h=1;2>=h;h++)a=r(t),c=a.s+.1*h,c=n(c,0,1),u=a.v+.1*h,u=n(u,0,1),a.s=c,a.v=u,p.push(a);for(h=1;2>=h;h++)a=r(t),c=a.s-.1*h,c=n(c,0,1),u=a.v-.1*h,u=n(u,0,1),a.s=c,a.v=u,p.push(a);break;case"complementary":case"complement":case"comp":a=r(t),a.h=(a.h+180)%360,p.push(a);break;case"split-complementary":case"split-complement":case"split":a=r(t),a.h=(a.h+165)%360,p.push(a),a=r(t),a.h=Math.abs((a.h-165)%360),p.push(a);break;case"double-complementary":case"double-complement":case"double":a=r(t),a.h=(a.h+180)%360,p.push(a),a.h=(a.h+30)%360,s=r(a),p.push(a),a.h=(a.h+180)%360,p.push(s);break;case"analogous":case"ana":for(h=1;5>=h;h++)a=r(t),a.h=(a.h+20*h)%360,p.push(a);break;case"triadic":case"triad":case"tri":for(h=1;3>h;h++)a=r(t),a.h=(a.h+120*h)%360,p.push(a);break;default:console.error("Color scheme not recognized.")}return i(f.format.toLowerCase(),p),p},s.make_color=function(r){var c=[],l=o(h),f=null;if(null!==r)for(var d in r)r.hasOwnProperty(d)&&(l[d]=r[d]);var p=null;"string"==typeof l.seed&&(p=new a(l.seed)),l.base_color.length>0&&(f=l.base_color.match(/^#?([0-9a-f]{3})([0-9a-f]{3})?$/i)?s.HEX_to_HSV(l.base_color):s.NAME_to_HSV(l.base_color));for(var g=0;gc;c++)n[f[c]]=u[f[c]];for(;".."==l[0];)h.pop(),l.shift();n.path=("/"!=i.substring(0,1)?h.join("/"):"")+"/"+l.join("/")}r(n)},i=function(t){return t=t.replace(/\+/g," "),t=t.replace(/%([ef][0-9a-f])%([89ab][0-9a-f])%([89ab][0-9a-f])/gi,function(t,e,n,i){var r=parseInt(e,16)-224,o=parseInt(n,16)-128;if(0==r&&32>o)return t;var a=parseInt(i,16)-128,s=(r<<12)+(o<<6)+a;return s>65535?t:String.fromCharCode(s)}),t=t.replace(/%([cd][0-9a-f])%([89ab][0-9a-f])/gi,function(t,e,n){var i=parseInt(e,16)-192;if(2>i)return t;var r=parseInt(n,16)-128;return String.fromCharCode((i<<6)+r)}),t=t.replace(/%([0-7][0-9a-f])/gi,function(t,e){return String.fromCharCode(parseInt(e,16))})},r=function(t){var e=t.query;t.query=new function(t){for(var e,n=/([^=&]+)(=([^&]*))?/g;e=n.exec(t);){var r=decodeURIComponent(e[1].replace(/\+/g," ")),o=e[3]?i(e[3]):"";null!=this[r]?(this[r]instanceof Array||(this[r]=[this[r]]),this[r].push(o)):this[r]=o}this.clear=function(){for(r in this)this[r]instanceof Function||delete this[r]},this.toString=function(){var t="",e=encodeURIComponent;for(var n in this)if(!(this[n]instanceof Function))if(this[n]instanceof Array){var i=this[n].length;if(i)for(var r=0;i>r;r++)t+=t?"&":"",t+=e(n)+"="+e(this[n][r]);else t+=(t?"&":"")+e(n)+"="}else t+=t?"&":"",t+=e(n)+"="+e(this[n]);return t}}(e)};return function(t){this.toString=function(){return(this.protocol&&this.protocol+"://")+(this.user&&this.user+(this.pass&&":"+this.pass)+"@")+(this.host&&this.host)+(this.port&&":"+this.port)+(this.path&&this.path)+(this.query.toString()&&"?"+this.query)+(this.hash&&"#"+this.hash)},n(this,t)}}();!function(t,e,n){"use strict";function i(t){var e={};return e=t.__proto__?Object.assign(i(t.__proto__),t):Object.assign({schema:{},dependencies:[]},t),t.schema&&Object.assign(e.schema,t.schema),t.dependencies&&(n=e.dependencies).push.apply(n,t.dependencies),e;var n}function r(t,e){AFRAME.registerComponent(t,i(new e))}function o(t,e){AFRAME.registerSystem(t,i(new e))}function a(t,e,n){return 0===e.length?n:(t[e[0]]=a(t[e[0]]||{},e.slice(1),n),t)}function s(t,e,n){var i,r,o,a,s=0;n||(n={});var c=function(){s=n.leading===!1?0:Date.now(),i=null,a=t.apply(r,o),i||(r=o=null)},u=function(){var u=Date.now();s||n.leading!==!1||(s=u);var h=e-(u-s);return r=this,o=arguments,0>=h||h>e?(i&&(clearTimeout(i),i=null),s=u,a=t.apply(r,o),i||(r=o=null)):i||n.trailing===!1||(i=setTimeout(c,h)),a};return u.cancel=function(){clearTimeout(i),s=0,i=r=o=null},u}function c(t){return t?encodeURIComponent(t).replace(/\./g,"%2E").replace(/%[A-Z0-9]{2}/g,"-"):null}function u(){var t=document.querySelector("link[rel=canonical]");return t?t.href:window.location.href}function h(t,e,n){return c(e||n)+":"+c(t||"")}function l(n){n=n||{};var i=new e,r=n.baseRefUrl||"https://altspace-apps.firebaseio.com/apps/examples/",o=new t(r),a=n.instanceId||i.query["altspace-sync-instance"],s=n.spaceId||i.query["altspace-sync-space"],u=n.userId||i.query["altspace-sync-user"];if(!n.appId||!n.authorId)throw new Error("Both the appId and authorId must be provided to connect.");var l=[];Et&&(s||l.unshift(altspace.getSpace()),u||l.unshift(altspace.getUser()));var f={},d=h(n.appId,n.authorId,_t);f.app=o.child(d).child("app");var p=f.app.child("instances");return a?(f.instance=p.child(a),Promise.all(l).then(function(t){Et&&(s||(s=t.pop().sid),u||(u=t.pop().userId)),s=c(s),u=c(u),a=c(a),f.space=s?f.app.child("spaces").child(s):null,f.user=u?f.app.child("users").child(u):null;var e=f;return e})):(f.instance=p.push(),a=f.instance.key(),i.query["altspace-sync-instance"]=a,window.location.href=i.toString(),Promise.reject(new Error("Sync instance id not found. Reloading app with new sync id.")))}function f(t,e,n){if(!(t&&t instanceof THREE.Scene))throw new TypeError("Requires THREE.Scene argument");if(!(e&&e instanceof THREE.Camera))throw new TypeError("Requires THREE.Camera argument");bt=t,yt=e;var i=n||{};vt=i.renderer&&i.renderer.domElement||window,vt.addEventListener("mousedown",d,!1),vt.addEventListener("mouseup",p,!1),vt.addEventListener("mousemove",g,!1)}function d(t){var e=y(t);if(e&&e.point){var n=b("cursordown",e);e.object.dispatchEvent(n)}}function p(t){var e=y(t),n=b("cursorup",e);e?e.object.dispatchEvent(n):bt.dispatchEvent(n)}function g(t){var e=y(t),n=b("cursormove",e);bt.dispatchEvent(n);var i=e?e.object:null;mt!=i&&(mt&&(n=b("cursorleave",e),mt.dispatchEvent(n)),i&&(n=b("cursorenter",e),i.dispatchEvent(n)),mt=i)}function b(t,e){return{type:t,bubbles:!0,target:e?e.object:null,ray:{origin:St.ray.origin.clone(),direction:St.ray.direction.clone()},point:e?e.point.clone():null}}function y(t){var e=new THREE.Vector2;e.x=t.offsetX/(vt.width||vt.innerWidth)*2-1,e.y=2*-(t.offsetY/(vt.height||vt.innerHeight))+1,St.setFromCamera(e,yt);var n=St.intersectObjects(bt.children,!0);return n.find(function(t){return!t.object.userData||!t.object.userData.altspace||!t.object.userData.altspace.collider||t.object.userData.altspace.collider.enabled!==!1})||null}function v(t){var e=t||{};kt=e.TRACE||!1,e.crossOrigin&&(Rt=e.crossOrigin),e.baseUrl&&(Tt=e.baseUrl),"/"!==Tt.slice(-1)&&(Tt+="/"),Ct=new altspace.utilities.shims.OBJMTLLoader,Ct.crossOrigin=Rt,kt&&console.log("MultiLoader initialized with params",t)}function m(t,e){var n=t,i=Date.now();if(!(n&&n instanceof xt))throw new Error("MultiLoader.load expects first arg of type LoadRequest");if(!e||"function"!=typeof e)throw new Error("MultiLoader.load expects second arg of type function");if(!n.objUrls||!n.mtlUrls||n.objUrls.length!==n.mtlUrls.length)throw new Error("MultiLoader.load called with bad LoadRequest");var r=n.objUrls.length;kt&&console.log("Loading models...");for(var o=0;r>o;o++){var a=function(t,n){var o=Tt+t.objUrls[n],a=Tt+t.mtlUrls[n];kt&&console.log("Loading obj:"+o+", mtl:"+a),Ct.load(o,a,function(o){if(t.objects[n]=o,t.objectsLoaded++,t.objectsLoaded===r){var a=((Date.now()-i)/1e3).toFixed(2);kt&&console.log("Loaded "+r+" models in "+a+" seconds"),e()}},w,function(){var e=xhr.target.responseURL||"";t.error="Error loading file "+e})};a(n,o)}}function w(t){if(t.lengthComputable&&t.target.responseURL){var e=t.loaded/t.total*100,n=t.target.responseURL.split("/").pop();kt&&console.log("..."+n+" "+Math.round(e,2)+"% downloaded")}}function E(){console.log("In a tile: "+Mt),console.log("In VR: "+Dt)}function _(){if(!Mt&&Dt);else{var t=document.createElement("style");t.type="text/css",t.innerHTML="@import url(https://fonts.googleapis.com/css?family=Open+Sans:800);.altspace-info{text-align:center;font-family:'Open Sans',sans-serif;line-height:.5}.altspace-vr-notice{color:rgba(0,0,0,.7);font-size:5vw}.altspace-pen-name{font-size:7vw}",document.head.appendChild(t),document.body.style.background=n.make_color({seed:F()});var e=document.createElement("div");e.className="altspace-info",document.body.appendChild(e);var i=document.createElement("span");if(i.className="altspace-pen-name",i.innerHTML="

"+It.toUpperCase()+"

",e.appendChild(i),Mt){var r="VR mode does not support preview tiles. Stopping code execution.";throw console.log("ERROR: "+r),new Error(r)}if(!Dt){var o=document.createElement("span");o.className="altspace-vr-notice",o.innerHTML="

View

",e.insertBefore(o,i);var a=document.createElement("span");a.className="altspace-vr-notice",a.innerHTML='

in AltspaceVR

',e.appendChild(a);var r="Not in VR mode. Stopping code execution.";throw Mt&&console.log("ERROR: "+r),new Error(r)}}}function j(t){It=t}function S(){var t=document.querySelector("link[rel=canonical]"),n=t?t.href:window.location.href;return new e(n)}function F(){var t=S(),e=t.path.split("/"),n=e[e.length-1];return n}function O(){var t=S(),e=t.path.split("/"),n="team"==e[1],i=n?"team-"+e[2]:e[1];return i}function A(t){var e,n,i=this;if(t.bubbles&&(t.currentTarget=this,t.stopPropagation=function(){e=!0},t.stopImmediatePropagation=function(){n=!0}),this._listeners){var r=this._listeners,o=r[t.type];if(o){t.target=t.target||this;for(var a=[],s=o.length,c=0;s>c;c++)a[c]=o[c];for(var c=0;s>c;c++)if(a[c].call(i,t),n)return}}t.bubbles&&this.parent&&this.parent.dispatchEvent&&!e&&A.call(this.parent,t)}function C(t){t.updateMatrixWorld();var e=new THREE.Vector3;return e.setFromMatrixPosition(t.matrixWorld),e}function k(t){return new Promise(function(e,n){var i=null;return t.traverse(function(t){return"TrackingSkeleton"===t.type?void(i=t):void 0}),i?e(i):void altspace.getThreeJSTrackingSkeleton().then(function(n){return i=n,t.add(i),e(i)})})}function T(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length)return t.every(function(n,i){return T(t[i],e[i])});if(t instanceof Object&&e instanceof Object&&T(Object.keys(t).sort(),Object.keys(e).sort())){for(var n in t)if(!T(t[n],e[n]))return!1;return!0}return!1}function R(){fe.forEach(function(t){return t.autoSend()})}function x(t,e){var n=function(i,r){var o=altspace.getGamepads().find(function(e){return"steamvr"===e.mapping&&e.hand===t});o?(e.logging&&console.log("SteamVR input device found",o),i(o)):(e.logging&&console.log("SteamVR input device not found trying again in 500ms..."),setTimeout(n,500,i,r))};return new Promise(n)}t=t&&t.hasOwnProperty("default")?t["default"]:t,e=e&&e.hasOwnProperty("default")?e["default"]:e,n=n&&n.hasOwnProperty("default")?n["default"]:n;var L=function(){},I={schema:{}};I.schema.get=function(){return null},L.prototype.init=function(){},L.prototype.tick=function(t,e){},L.prototype.pause=function(){},L.prototype.play=function(){},Object.defineProperties(L.prototype,I);var M=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(t){},e.prototype.remove=function(){},e.prototype.updateSchema=function(t){},e}(L),D=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{enabled:{type:"boolean","default":!0}}},e.prototype.init=function(){var t=this;this.setColliderFlag(this.data.enabled),this.el.addEventListener("model-loaded",function(){t.setColliderFlag(t.data.enabled)}.bind(this))},e.prototype.update=function(){this.setColliderFlag(this.data.enabled)},e.prototype.setColliderFlag=function(t){var e=this.el.object3D;e&&(a(e.userData,["altspace","collider","enabled"],t),e.traverse(function(e){e instanceof THREE.Mesh&&a(e.userData,["altspace","collider","enabled"],t)}))},Object.defineProperties(e.prototype,n),e}(M),P=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(){this.gamepadIndex=null,this.trackedControlsSystem=document.querySelector("a-scene").systems["tracked-controls"],this.systemGamepads=0,altspace.getGamepads()},e.prototype.tick=function(){if(this.trackedControlsSystem&&this.systemGamepads!==this.trackedControlsSystem.controllers.length&&window.altspace&&altspace.getGamepads&&altspace.getGamepads().length){var t=this.el.components;t["paint-controls"]&&(this.gamepadIndex="left"===t["paint-controls"].data.hand?2:1),null===this.gamepadIndex&&t["hand-controls"]&&(this.gamepadIndex="left"===t["hand-controls"].data?2:1),null===this.gamepadIndex&&t["vive-controls"]&&(this.gamepadIndex="left"===t["vive-controls"].data.hand?2:1),null===this.gamepadIndex&&t["tracked-controls"]&&(this.gamepadIndex=t["tracked-controls"].data.controller),this.el.setAttribute("tracked-controls","id",altspace.getGamepads()[this.gamepadIndex].id),this.el.setAttribute("tracked-controls","controller",0),this.systemGamepads=this.trackedControlsSystem.controllers.length}},e}(M),U=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{usePixelScale:{type:"boolean","default":!1},verticalAlign:{type:"string","default":"middle"},enclosuresOnly:{type:"boolean","default":!0},fullspace:{type:"boolean","default":!1}}},e.prototype.init=function(){return this.version="AFRAME_ALTSPACE_VERSION",this.el.object3D instanceof THREE.Scene?void(window.altspace&&window.altspace.inClient?(this.el.setAttribute("vr-mode-ui",{enabled:!1}),this.initRenderer(),this.initCursorEvents(),this.initCollisionEvents()):console.warn("aframe-altspace-component only works inside of AltspaceVR")):void console.warn("aframe-altspace-component can only be attached to a-scene")},e.prototype.tick=function(t,e){this.el.object3D.updateAllBehaviors&&this.el.object3D.updateAllBehaviors()},e.prototype.initRenderer=function(){var t=this,e=this.el.object3D,n=this.el.sceneEl,i=n.getAttribute("scale")||{x:1,y:1,z:1};altspace.getEnclosure().then(function(n){switch(t.data.fullspace&&(n.fullspace&&a(e.userData,["altspace","initialized"],!0),n.requestFullspace(),n.addEventListener("fullspacechange",function(){e.scale.copy(i).multiplyScalar(n.pixelsPerMeter),a(e.userData,["altspace","initialized"],!0)})),(!t.data.usePixelScale||t.data.fullspace)&&e.scale.copy(i).multiplyScalar(n.pixelsPerMeter),t.data.verticalAlign){case"bottom":e.position.y-=n.innerHeight/2;break;case"top":e.position.y+=n.innerHeight/2;break;case"middle":break;default:console.warn("Unexpected value for verticalAlign: ",t.data.verticalAlign)}t.data.enclosuresOnly&&1===n.innerDepth&&(t.el.renderer.render(new THREE.Scene),t.el.renderer=t.el.effect=r),t.data.fullspace||a(e.userData,["altspace","initialized"],!0)}.bind(this));var r=this.el.renderer,o=this.el.renderer=this.el.effect=altspace.getThreeJSRenderer({aframeComponentVersion:this.version}),s=function(){};o.setSize=s,o.setPixelRatio=s,o.setClearColor=s,o.clear=s,o.enableScissorTest=s,o.setScissor=s,o.setViewport=s,o.getPixelRatio=s,o.getMaxAnisotropy=s,o.setFaceCulling=s,o.submitFrame=s,o.context={canvas:{}},o.shadowMap={},o.requestAnimationFrame=window.requestAnimationFrame},e.prototype.initCursorEvents=function(){function t(t,e){var i=e.target.el;n&&n.emit(t,{target:i,ray:e.ray,point:e.point}),i&&i.emit(t,{target:i,ray:e.ray,point:e.point})}var e=this.el.object3D,n=document.querySelector("a-cursor")||document.querySelector("a-entity[cursor]");n&&(n.setAttribute("material","transparent",!0),n.setAttribute("material","opacity",0));var i=null;e.addEventListener("cursordown",function(e){i=e.target,t("mousedown",e)}),e.addEventListener("cursorup",function(e){t("mouseup",e),e.target.uuid===i.uuid&&t("click",e),i=null}),e.addEventListener("cursorenter",function(e){e.target.el&&(e.target.el.addState("hovered"),n&&n.addState("hovering"),t("mouseenter",e))}),e.addEventListener("cursorleave",function(e){e.target.el&&(e.target.el.removeState("hovered"),n&&n.removeState("hovering"),t("mouseleave",e))})},e.prototype.initCollisionEvents=function(){function t(t,e){var n=e.target.el;n&&(e.target=n,e.other&&e.other.el&&(e.other=e.other.el),n.emit(t,e))}var e=this.el.object3D;e.addEventListener("collisionenter",function(e){t("collisionenter",e)}),e.addEventListener("collisionexit",function(e){t("collisionexit",e)}),e.addEventListener("triggerenter",function(e){t("triggerenter",e)}),e.addEventListener("triggerexit",function(e){t("triggerexit",e)})},Object.defineProperties(e.prototype,n),e}(M),N=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={dependencies:{}};return n.dependencies.get=function(){return["sync"]},e.prototype.init=function(){this.sync=this.el.components.sync,this.sync.isConnected?start():this.el.addEventListener("connected",this.start.bind(this))},e.prototype.start=function(){var t=this.sync.dataRef.child("material/color"),e=!1,n=!0,i=this;this.el.addEventListener("componentchanged",function(n){var r=n.detail.name,o=n.detail.oldData,a=n.detail.newData;"material"===r&&!e&&o.color!==a.color&&i.sync.isMine&&setTimeout(function(){return t.set(a.color)},0)}),t.on("value",function(t){if(!i.sync.isMine||n){var r=t.val();e=!0,i.el.setAttribute("material","color",r),e=!1,n=!1}})},Object.defineProperties(e.prototype,n),e}(M),B=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{mode:{"default":"link"},ownOn:{type:"string"}}},e.prototype.init=function(){var t=this;if(this.isMine=!1,this.scene=this.el.sceneEl,this.syncSys=this.scene.systems["sync-system"],this.isConnected=!1,this.syncSys.isConnected?this.start():this.scene.addEventListener("connected",this.start.bind(this)),this.data.ownOn){var e=this.data.ownOn.split(/[ ,]+/);e.forEach(function(e){t.el.addEventListener(e,function(){t.isConnected&&t.takeOwnership()}.bind(t))}.bind(this))}},e.prototype.takeOwnership=function(){this.ownerRef.set(this.syncSys.clientId),this.ownerRef.onDisconnect().set(null)},e.prototype.start=function(){var t=this;if(this.scene.addEventListener("clientleft",function(e){var n=(!t.ownerId||t.ownerId===e.detail.id)&&t.syncSys.isMasterClient;n&&t.takeOwnership()}.bind(this)),"link"!==this.data.mode)return void console.error("Unsupported sync mode: "+this.data.mode);var e=this.el.id;return e?(this.link(this.syncSys.sceneRef.child(e)),this.setupReceive(),this.isConnected=!0,void this.el.emit("connected",null,!1)):void console.error("Entities cannot be synced using link mode without an id.")},e.prototype.link=function(t){this.ref=t,this.key=this.ref.key(),this.dataRef=this.ref.child("data"),this.ownerRef=this.ref.child("owner")},e.prototype.setupReceive=function(){function t(t){var e=t.val(),n=e===this.syncSys.clientId&&!this.isMine;n&&this.el.emit("ownershipgained",null,!1);var i=e!==this.syncSys.clientId;i&&(this.el.emit("ownershiplost",null,!1),this.ownerRef.onDisconnect().cancel()),this.ownerId=e,this.isMine=e===this.syncSys.clientId}var e=this;this.ownerRef.transaction(function(t){return t?void 0:e.syncSys.clientId}.bind(this),function(n,i){i&&e.ownerRef.onDisconnect().set(null),e.ownerRef.on("value",t.bind(e))}.bind(this))},Object.defineProperties(e.prototype,n),e}(M),H=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{author:{type:"string"},app:{type:"string"},instance:{type:"string"},refUrl:{type:"string"}}},e.prototype.init=function(){return this.data&&this.data.app?(console.log(this.data),this.clientId=this.sceneEl.object3D.uuid,this.masterClientId=null,this.queuedInstantiations=[],this.isConnected=!1,void Promise.all([altspace.utilities.sync.connect({authorId:this.data.author,appId:this.data.app,instanceId:this.data.instance,baseRefUrl:this.data.refUrl}),altspace.getUser()]).then(this.connected.bind(this))):void console.warn("The sync-system must be present on the scene and configured with required data."); -},e.prototype.connected=function(t){this.connection=t.shift(),this.userInfo=t.shift(),this.sceneRef=this.connection.instance.child("scene"),this.clientsRef=this.connection.instance.child("clients"),this.instantiatedElementsRef=this.connection.instance.child("instantiatedElements"),this.instantiatedElementsRef.on("child_added",this.listenToInstantiationGroup.bind(this)),this.instantiatedElementsRef.on("child_removed",this.stopListeningToInstantiationGroup.bind(this));var e=this;this.clientsRef.on("value",function(t){var n=t.val(),i=Object.keys(n)[0];e.masterClientId=n[i]}),this.clientsRef.on("child_added",function(t){var n=t.val();setTimeout(function(){e.sceneEl.emit("clientjoined",{id:n},!1)},0)}),this.clientsRef.on("child_removed",function(t){var n=t.val();setTimeout(function(){e.sceneEl.emit("clientleft",{id:n},!1)},0)}),this.clientsRef.push(this.clientId).onDisconnect().remove(),this.connection.instance.child("initialized").once("value",function(t){var n=!t.val();t.ref().set(!0),e.processQueuedInstantiations(),e.sceneEl.emit("connected",{shouldInitialize:n},!1),e.isConnected=!0})},e.prototype.isMasterClient=function(){return this.masterClientId===this.clientId},e.prototype.listenToInstantiationGroup=function(t){t.ref().on("child_added",this.createElement.bind(this)),t.ref().on("child_removed",this.removeElement.bind(this))},e.prototype.stopListeningToInstantiationGroup=function(t){t.ref().off("child_added"),t.ref().off("child_removed")},e.prototype.processQueuedInstantiations=function(){var t=this;this.queuedInstantiations.forEach(function(e){e.creatorUserId=t.userInfo.userId,e.clientId=t.clientId,t.instantiatedElementsRef.child(e.groupName).push(e).onDisconnect().remove()}.bind(this)),this.queuedInstantiations.length=0},e.prototype.instantiate=function(t,e,n,i,r){if(!t)return void console.error("AltspaceVR: Instantiation requires a mixin value.",n);var o=e&&e.id,a="A-SCENE"===e.nodeName;if(!o&&!a)return void console.error("AltspaceVR: Instantiation requires a parent with an id.",n);var s=o?"#"+e.id:"a-scene",c={instantiatorId:r||"",groupName:i||"main",mixin:t,parent:s};this.queuedInstantiations.push(c),this.isConnected&&this.processQueuedInstantiations()},e.prototype.removeLast=function(t){var e=this;return new Promise(function(n){e.instantiatedElementsRef.child(t).orderByKey().limitToLast(1).once("value",function(t){if(!t.hasChildren())return void n();var e=t.val(),i=Object.keys(e)[0];n(e[i].instantiatorId),t.ref().child(i).remove()})}.bind(this))},e.prototype.createElement=function(t){var e=t.val(),n=t.key(),i=document.createElement("a-entity");i.id=e.groupName+"-instance-"+n,document.querySelector(e.parent).appendChild(i),i.setAttribute("mixin",e.mixin),i.dataset.creatorUserId=e.creatorUserId,this.userInfo.userId===e.creatorUserId&&i.classList.add("mine")},e.prototype.removeElement=function(t){var e=t.val(),n=t.key(),i=e.groupName+"-instance-"+n,r=document.querySelector("#"+i);r.parentNode.removeChild(r)},Object.defineProperties(e.prototype,n),e}(L),q=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={dependencies:{}};return n.dependencies.get=function(){return["sync"]},e.prototype.init=function(){this.sync=this.el.components.sync,this.sync.isConnected?start():this.el.addEventListener("connected",this.start.bind(this))},e.prototype.start=function(){function t(t,e){if(!n.isMine){var r=t.val();r&&i.el.setAttribute(e,r)}}function e(t){if(n.isMine){var e=t.detail.name,i=t.detail.newData;"position"===e?u(i):"rotation"===e?h(i):"scale"===e&&l(i)}}var n=this.sync,i=this,r=n.dataRef.child("position"),o=n.dataRef.child("rotation"),a=n.dataRef.child("scale");i.updateRate=100;var c=[];i.el.addEventListener("ownershiplost",function(){Array.from(i.el.children).forEach(function(t){var e=t.tagName.toLowerCase();"a-animation"===e&&(c.push(t),t.stop())})}),i.el.addEventListener("ownershipgained",function(){c.forEach(function(t){return t.start()}),c=[]}),r.on("value",function(e){return t(e,"position")}),o.on("value",function(e){return t(e,"rotation")}),a.on("value",function(e){return t(e,"scale")});var u=s(function(t){r.set(t)},i.updateRate),h=s(function(t){o.set(t)},i.updateRate),l=s(function(t){a.set(t)},i.updateRate);i.el.addEventListener("componentchanged",e)},Object.defineProperties(e.prototype,n),e}(M),W=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={dependencies:{}};return n.dependencies.get=function(){return["sync"]},e.prototype.init=function(){this.sync=this.el.components.sync,this.scene=this.el.sceneEl,this.syncSys=this.scene.systems["sync-system"],this.soundStateRef=null,this.soundEventRef=null,this.sync.isConnected?this.start():this.el.addEventListener("connected",this.start.bind(this))},e.prototype.remove=function(){this.soundStateRef.off("value"),this.soundEventRef.off("value")},e.prototype.start=function(){function t(t){if(this.sync.isMine){var t={type:t.type,sender:this.syncSys.clientId,el:this.el.id,time:Firebase.ServerValue.TIMESTAMP};this.soundEventRef.set(t)}}var e=this;this.soundStateRef=this.sync.dataRef.child("sound/state"),this.soundEventRef=this.sync.dataRef.child("sound/event"),this.el.addEventListener("sound-played",t.bind(this)),this.el.addEventListener("sound-paused",t.bind(this)),this.soundEventRef.once("value",function(t){var n=t.val();e.soundEventRef.on("value",function(t){var i=t.val();if(!(!i||n&&i.time===n.time||e.sync.isMine)&&i.el===e.el.id){var r=e.el.components["n-sound"];"sound-played"===i.type?r.playSound():r.pauseSound()}})}),this.el.addEventListener("componentchanged",function(t){if(e.sync.isMine){var n=t.detail.name;"n-sound"===n&&e.soundStateRef.set(t.detail.newData)}}),this.soundStateRef.on("value",function(t){if(!e.sync.isMine){var n=t.val();n&&e.el.setAttribute("n-sound",n)}})},Object.defineProperties(e.prototype,n),e}(M),V=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={dependencies:{}};return n.dependencies.get=function(){return["sync"]},e.prototype.init=function(){var t=this.el.sceneEl;this.syncSys=t.systems["sync-system"],this.sync=this.el.components.sync,this.syncSys.isConnected?this._start():t.addEventListener("connected",this._start.bind(this))},e.prototype.getDataRef=function(t){return this.sync.dataRef.child("n-skeleton-parent/"+t)},e.prototype._start=function(){this.attributeRef=this.sync.dataRef.child("n-skeleton-parent"),this.attributeRef.on("value",function(t){var e=t.val();e&&this.el.setAttribute("n-skeleton-parent",e)}.bind(this)),this.el.dataset.creatorUserId&&this.attributeRef.set(Object.assign({},this.el.components["n-skeleton-parent"].data,{userId:this.el.dataset.creatorUserId})),this.el.addEventListener("componentchanged",function(t){if(this.sync.isMine){var e=t.detail.name;"n-skeleton-parent"===e&&this.attributeRef.set(t.detail.newData)}}.bind(this))},Object.defineProperties(e.prototype,n),e}(M),G=function(t){function e(){t.call(this),this.multiple=!0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{on:{type:"string"},emit:{type:"string"},gained:{type:"string"},lost:{type:"string"},gain:{type:"string"},lose:{type:"string"},targets:{type:"selectorAll"},target:{type:"selector"}}},e.prototype.init=function(){this.actOnTargets=function(){function t(t){this.data.emit&&t.emit(this.data.emit),this.data.gain&&t.addState(this.data.gain),this.data.lose&&t.removeState(this.data.lose)}this.updateProperties(this.attrValue),this.data.targets&&this.data.targets.forEach(t.bind(this)),this.data.target&&t.call(this,this.data.target),this.data.targets||this.data.target||t.call(this,this.el)}.bind(this),this.actOnTargetsIfStateMatches=function(t){var e=t.detail.state;(e===this.data.gained||e===this.data.lost)&&this.actOnTargets()}.bind(this)},e.prototype.update=function(t){t.on&&this.el.removeEventListener(t.on,this.actOnTargets),t.gained&&this.el.removeEventListener("stateadded",this.actOnTargetsIfStateMatches),t.lost&&this.el.removeEventListener("stateremoved",this.actOnTargetsIfStateMatches),this.data.on&&this.el.addEventListener(this.data.on,this.actOnTargets),this.data.gained&&this.el.addEventListener("stateadded",this.actOnTargetsIfStateMatches),this.data.lost&&this.el.addEventListener("stateremoved",this.actOnTargetsIfStateMatches)},e.prototype.remove=function(){this.el.removeEventListener(this.data.on,this.actOnTargets),this.el.removeEventListener("stateadded",this.actOnTargetsIfStateMatches),this.el.removeEventListener("stateremoved",this.actOnTargetsIfStateMatches)},Object.defineProperties(e.prototype,n),e}(M),K=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{mixin:{type:"string"},parent:{type:"selector"}}},e.prototype.init=function(){var t=this.el.sceneEl;this.syncSys=t.systems["sync-system"],this.syncSys.instantiate(this.data.mixin,this.data.parent||this.el.parentNode,this.el)},Object.defineProperties(e.prototype,n),e}(M),Q=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{on:{type:"string"},mixin:{type:"string"},parent:{type:"selector","default":"a-scene"},group:{type:"string","default":"main"},removeLast:{type:"boolean","default":!0}}},e.prototype.init=function(){this.onHandler=this.instantiateOrToggle.bind(this),this.el.addEventListener(this.data.on,this.onHandler),this.syncSys=this.el.sceneEl.systems["sync-system"]},e.prototype.instantiateOrToggle=function(){var t=this.data.group+"-"+this.syncSys.userInfo.userId;this.data.removeLast?this.syncSys.removeLast(t).then(function(e){e!==this.el.id&&this.syncSys.instantiate(this.data.mixin,this.data.parent,this.el,t,this.el.id)}.bind(this)):this.syncSys.instantiate(this.el.id,t,this.data.mixin,this.data.parent)},e.prototype.remove=function(){this.el.removeEventListener(this.data.on,this.onHandler)},Object.defineProperties(e.prototype,n),e}(M);if(!window.altspace||!altspace.inClient){var z=function(){};a(window,["altspace","addNativeComponent"],z),a(window,["altspace","updateNativeComponent"],z),a(window,["altspace","removeNativeComponent"],z)}var Y=new THREE.BoxGeometry(.001,.001,.001),X=new THREE.MeshBasicMaterial({color:0});X.visible=!1;var J=function(t){function e(){t.call(this,Y,X)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(THREE.Mesh),$=function(t){function e(e,n){void 0===n&&(n=!0),t.call(this),Object.assign(this,{name:e,sendUpdates:n})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(){var t=this,e=this.mesh||this.el.getOrCreateObject3D("mesh",J);this.currentMesh=e,a(e.userData,["altspace","collider","enabled"],!1),altspace.addNativeComponent(e,this.name),this.update(),this.mesh||this._dontRebind||this.el.addEventListener("object3dset",function(e){"mesh"===e.detail.type&&(altspace.removeNativeComponent(t.currentMesh,t.name),t._dontRebind=!0,t.init())}.bind(this))},e.prototype.update=function(){var t=this.mesh||this.el.object3DMap.mesh;this.sendUpdates&&altspace.updateNativeComponent(t,this.name,this.data)},e.prototype.remove=function(){var t=this.mesh||this.el.object3DMap.mesh;altspace.removeNativeComponent(t,this.name)},e.prototype.callComponent=function(t){for(var e=[],n=arguments.length-1;n-->0;)e[n]=arguments[n+1];var i=this.mesh||this.el.object3DMap.mesh;altspace.callNativeComponent(i,this.name,t,e)},e}(M),Z=function(t){function e(){t.call(this,"n-object")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{res:{type:"string"}}},Object.defineProperties(e.prototype,n),e}($),tt=function(t){function e(){t.call(this,"n-spawner")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{res:{type:"string"}}},Object.defineProperties(e.prototype,n),e}($),et=function(t){function e(){t.call(this,"n-billboard",!1)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}($),nt=function(t){function e(){t.call(this,"n-skeleton-parent")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{part:{type:"string"},side:{type:"string","default":"center"},index:{type:"int","default":0},userId:{type:"string"}}},Object.defineProperties(e.prototype,n),e}($),it=function(t){function e(){t.call(this,"n-cockpit-parent",!1)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}($),rt=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{center:{type:"vec3"},type:{type:"string","default":"object"},isTrigger:{"default":!1,type:"boolean"}}},Object.defineProperties(e.prototype,n),e}($),ot=function(t){function e(){t.call(this,"n-sphere-collider")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{radius:{"default":1,type:"number"}}},Object.defineProperties(e.prototype,n),e}(rt),at=function(t){function e(){t.call(this,"n-box-collider")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{size:{type:"vec3","default":{x:1,y:1,z:1}}}},Object.defineProperties(e.prototype,n),e}(rt),st=function(t){function e(){t.call(this,"n-capsule-collider")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{radius:{"default":0,type:"number"},height:{"default":0,type:"number"},direction:{"default":"y"}}},Object.defineProperties(e.prototype,n),e}(rt),ct=function(t){function e(e,n){void 0===e&&(e=null),t.call(this,"n-mesh-collider"),this.mesh=e,this.subcomponents=[]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{convex:{type:"boolean","default":!0}}},e.prototype.init=function(){var n=this;if(this.mesh)t.prototype.init.call(this);else{this.subcomponents=[];var i=this.el.object3D;i.traverse(function(t){if(t instanceof THREE.Mesh){var i=new e(t);n.subcomponents.push(i),i.data=n.data,i.init()}}.bind(this)),this.el.addEventListener("model-loaded",this.init.bind(this))}},e.prototype.update=function(e){var n=this;this.mesh?t.prototype.update.call(this,e):this.subcomponents.forEach(function(t){t.data=n.data,t.update(e)}.bind(this))},e.prototype.remove=function(){this.mesh?t.prototype.remove.call(this):this.subcomponents.forEach(function(t){t.remove()}.bind(this))},Object.defineProperties(e.prototype,n),e}(rt),ut=function(t){function e(){t.call(this,"n-container")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{capacity:{"default":4,type:"number"}}},e.prototype.init=function(){t.prototype.init.call(this);var e=this.el,n=this;e.addEventListener("stateadded",function(t){"container-full"===t.detail.state&&e.emit("container-full"),"container-empty"===t.detail.state&&e.emit("container-empty")}),e.addEventListener("container-count-changed",function(t){n.count=t.detail.count})},Object.defineProperties(e.prototype,n),e}($),ht=function(t){function e(){t.call(this,"n-portal")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{targetSpace:{type:"string"},targetEvent:{type:"string"},targetEntity:{type:"selector"}}},e.prototype.update=function(){var t,e,n=this.el.object3DMap.mesh;if(this.data.targetEntity){this.el.sceneEl.object3D.updateMatrixWorld(!0),t=this.data.targetEntity.object3D.getWorldPosition();var i=this.data.targetEntity.object3D.getWorldQuaternion();e={x:i.x,y:i.y,z:i.z,w:i.w}}var r={targetSpace:this.data.targetSpace,targetEvent:this.data.targetEvent,targetPosition:t,targetQuaternion:e};altspace.updateNativeComponent(n,this.name,r)},Object.defineProperties(e.prototype,n),e}($);!function(){String.prototype.codePointAt||!function(){var t=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),e=function(t){if(null==this)throw TypeError();var e=this+"",n=e.length,i=t?+t:0;if(i!=i&&(i=0),!(0>i||i>=n)){var r,o=e.charCodeAt(i);return o>=55296&&56319>=o&&n>i+1&&(r=e.charCodeAt(i+1),r>=56320&&57343>=r)?1024*(o-55296)+r-56320+65536:o}};t?t(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e}(),String.prototype.repeat||!function(){var t=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),e=function(t){if(null==this)throw TypeError();var e=this+"",n=t?+t:0;if(n!=n&&(n=0),0>n||n==1/0)throw RangeError();for(var i="";n;)n%2==1&&(i+=e),n>1&&(e+=e),n>>=1;return i};t?t(String.prototype,"repeat",{value:e,configurable:!0,writable:!0}):String.prototype.repeat=e}(),String.prototype.includes||!function(){var t={}.toString,e=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),n="".indexOf,i=function(e){if(null==this)throw TypeError();var i=this+"";if(e&&"[object RegExp]"==t.call(e))throw TypeError();var r=i.length,o=e+"",a=o.length,s=arguments.length>1?arguments[1]:void 0,c=s?+s:0;return c!=c&&(c=0),!(a+Math.min(Math.max(c,0),r)>r)&&-1!=n.call(i,o,c)};e?e(String.prototype,"includes",{value:i,configurable:!0,writable:!0}):String.prototype.includes=i}(),String.prototype.startsWith||!function(){var t=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),e={}.toString,n=function(t){if(null==this)throw TypeError();var n=this+"";if(t&&"[object RegExp]"==e.call(t))throw TypeError();var i=n.length,r=t+"",o=r.length,a=arguments.length>1?arguments[1]:void 0,s=a?+a:0;s!=s&&(s=0);var c=Math.min(Math.max(s,0),i);if(o+c>i)return!1;for(var u=-1;++u1){var s=arguments[1];void 0!==s&&(a=s?+s:0,a!=a&&(a=0))}var c=Math.min(Math.max(a,0),i),u=c-o;if(0>u)return!1;for(var h=-1;++hl||l>1114111||n(l)!=l)throw RangeError("Invalid code point: "+l);65535>=l?s.push(l):(l-=65536,i=(l>>10)+55296,r=l%1024+56320,s.push(i,r)),(c+1==u||s.length>a)&&(h+=e.apply(null,s),s.length=0)}return h};t?t(String,"fromCodePoint",{value:i,configurable:!0,writable:!0}):String.fromCodePoint=i}(),Object.defineProperty(String,"raw",{configurable:!0,enumerable:!1,writable:!0,value:function(t,e){var n;t=null!=t?t:{},e=arguments.length>1?i(arguments).slice(1):[];try{n=i(t.raw)}catch(i){throw new TypeError("Cannot convert undefined or null to object")}return n.map(function(n,i){return t.raw.length<=i?n:null!=e[i-1]?e[i-1]+n:n}).join("")}})}();var lt=function(t){function e(){t.call(this,"n-sound")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{res:{type:"string"},src:{type:"string"},on:{type:"string"},loop:{type:"boolean"},volume:{type:"number","default":1},autoplay:{type:"boolean"},oneshot:{type:"boolean"},spatialBlend:{type:"float","default":1},pitch:{type:"float","default":1},minDistance:{type:"float","default":1},maxDistance:{type:"float","default":12},rolloff:{type:"string","default":"logarithmic"}}},e.prototype.init=function(){var e=this.data.src;if(e&&!e.startsWith("http"))if(e.startsWith("/"))this.data.src=location.origin+e;else{var n=location.pathname;n.endsWith("/")||(n=location.pathname.split("/").slice(0,-1).join("/")+"/"),this.data.src=location.origin+n+e}t.prototype.init.call(this)},e.prototype.update=function(e){t.prototype.update.call(this,e),this.playHandler&&this.el.removeEventListener(e.on,this.playHandler),this.data.on&&(this.playHandler=this.playSound.bind(this),this.el.addEventListener(this.data.on,this.playHandler))},e.prototype.remove=function(){t.prototype.remove.call(this),this.playHandler&&this.el.removeEventListener(this.data.on,this.playHandler)},e.prototype.pauseSound=function(){this.callComponent("pause"),this.el.emit("sound-paused")},e.prototype.playSound=function(){this.callComponent("play"),this.el.emit("sound-played")},e.prototype.seek=function(t){this.callComponent("seek",{time:t})},Object.defineProperties(e.prototype,n),e}($),ft=function(t){function e(){t.call(this,"n-layout-browser")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{url:{"default":"about:blank"},isEnclosure:{"default":!1}}},Object.defineProperties(e.prototype,n),e}($),dt=function(t){function e(){t.call(this,"n-text")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{text:{"default":"",type:"string"},fontSize:{"default":10,type:"int"},width:{"default":10,type:"number"},height:{"default":1,type:"number"},horizontalAlign:{"default":"middle"},verticalAlign:{"default":"middle"}}},Object.defineProperties(e.prototype,n),e}($),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(){function t(e){return e.isMesh?e:0===e.children.length?null:e.children.reduce(function(e,n){return e||t(n)},null)}var e=this;this.el.addEventListener("model-loaded",function(){e.el.setObject3D("mesh",t(e.el.object3DMap.mesh))})},e}(M);window.AFRAME&&delete AFRAME.components.visible;var gt=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{"default":!0}},e.prototype.init=function(){this.el.addEventListener("model-loaded",this.update.bind(this))},e.prototype.update=function(){var t=this;this.el.object3D.traverse(function(e){return e.visible=t.data})},Object.defineProperties(e.prototype,n),e}(M);window.AFRAME&&(r("altspace-cursor-collider",D),r("altspace-tracked-controls",P),r("altspace",U),o("sync-system",H),r("sync-color",N),r("sync-transform",q),r("sync",B),r("sync-n-sound",W),r("sync-n-skeleton-parent",V),r("wire",G),r("one-per-user",K),r("instantiator",Q),r("n-object",Z),r("n-portal",ht),r("n-spawner",tt),r("n-text",dt),r("n-billboard",et),r("n-skeleton-parent",nt),r("n-cockpit-parent",it),r("n-container",ut),r("n-sound",lt),r("n-sphere-collider",ot),r("n-box-collider",at),r("n-capsule-collider",st),r("n-mesh-collider",ct),r("n-layout-browser",ft),r("collapse-model",pt),r("visible",gt));var bt,yt,vt,mt,wt=Object.freeze({AltspaceComponent:U,AltspaceCursorCollider:D,AltspaceTrackedControls:P,SyncSystem:H,SyncComponent:B,SyncColor:N,SyncTransform:q,SyncNSound:W,Wire:G,OnePerUser:K,Instantiator:Q,SyncNSkeletonParent:V,NObject:Z,NPortal:ht,NSpawner:tt,NText:dt,NBillboard:et,NSkeletonParent:nt,NCockpitParent:it,NContainer:ut,NSound:lt,NSphereCollider:ot,NBoxCollider:at,NCapsuleCollider:st,NMeshCollider:ct,NLayoutBrowser:ft,CollapseModel:pt}),Et=altspace&&altspace.inClient,_t=u(),jt=Object.freeze({connect:l}),St=new THREE.Raycaster,Ft=Object.freeze({init:f}),Ot=function(t){void 0===t&&(t={auto:!0}),this._scene=null,this._renderer=null,this._camera=null;var e=window.AFRAME&&document.querySelector("a-scene");if(e){var n=document.querySelector("a-scene");this._scene=n.object3D,this._renderer=n.renderer;var i=document.querySelector("a-camera");i&&(this._camera=i.object3D)}else window.altspace&&altspace.inClient?(this._scene=new THREE.Scene,this._renderer=altspace.getThreeJSRenderer(),this._camera=new THREE.PerspectiveCamera):this._setupWebGL();t.auto&&!e&&this.loop()},At={scene:{},renderer:{},camera:{}};Ot.prototype._setupWebGL=function(){function t(){i.aspect=window.innerWidth/window.innerHeight,i.updateProjectionMatrix(),n.setSize(window.innerWidth,window.innerHeight)}var e=this._scene=new THREE.Scene,n=this._renderer=new THREE.WebGLRenderer({antialias:!0}),i=this._camera=new THREE.PerspectiveCamera;document.addEventListener("DOMContentLoaded",function(t){document.body.style.margin="0px",document.body.style.overflow="hidden",n.setClearColor("#035F72");var e=document.createElement("div");document.body.appendChild(e),e.appendChild(n.domElement)}),window.addEventListener("resize",t),t(),i.position.z=500,i.fov=45,i.near=1,i.far=2e3,e.add(i),e.add(new THREE.AmbientLight("white")),this.cursor=f(e,i)},Ot.prototype.loop=function(){window.requestAnimationFrame(this.loop.bind(this)),this.scene.updateAllBehaviors&&this.scene.updateAllBehaviors(),this.renderer.render(this.scene,this.camera)},At.scene.get=function(){return this._scene},At.renderer.get=function(){return this._renderer},At.camera.get=function(){return this._camera},Object.defineProperties(Ot.prototype,At);var Ct,kt,Tt="",Rt="",xt=function(){this.objUrls=[],this.mtlUrls=[],this.objects=[],this.error=null,this.objectsLoaded=0},Lt=Object.freeze({init:v,load:m,LoadRequest:xt}),It="VR CodePen",Mt=window.name&&"pen-"===window.name.slice(0,4),Dt=!!window.altspace.inClient,Pt=!!location.href.match("codepen.io/"),Ut=Object.freeze({inTile:Mt,inVR:Dt,inCodePen:Pt,ensureInVR:_,setName:j,getPenId:F,getAuthorId:O,printDebugInfo:E}),Nt=function(){};Nt.prototype.load=function(t,e,n){var i=new THREE.MTLLoader,r=e.split("/").slice(0,-1).join("/");i.setTexturePath(r+"/"),i.setCrossOrigin(this.crossOrigin),i.load(e,function(e){var i=new THREE.OBJLoader;i.setMaterials(e),i.load(t,n)})},THREE&&!altspace.inClient&&(THREE.EventDispatcher.prototype.dispatchEvent=A,THREE.Object3D.prototype.dispatchEvent=A),THREE.Scene.prototype.updateAllBehaviors=function(){var t=performance.now(),e=this.__lastNow||t,n=t-e,i=this,r=[];this.traverse(function(t){t.__behaviorList&&r.push(t)});for(var o=0,a=r.length;a>o;o++){var s=r[o];s.updateBehaviors(n,i)}this.__lastNow=t},THREE.Object3D.prototype.addBehavior=function(t){this.addBehaviors(t)},THREE.Object3D.prototype.addBehaviors=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.__behaviorList=this.__behaviorList||[],(n=this.__behaviorList).push.apply(n,t);var n},THREE.Object3D.prototype.removeBehavior=function(t){if(!this.__behaviorList||0===this.__behaviorList.length)return null;var e=this.__behaviorList.indexOf(t);if(-1!==e){this.__behaviorList.splice(e,1);try{t.dispose&&t.dispose.call(t,this)}catch(n){console.group(),(console.error||console.log).call(console,n.stack||n),console.log("[Behavior]"),console.log(t),console.log("[Object3D]"),console.log(this),console.groupEnd()}}},THREE.Object3D.prototype.removeAllBehaviors=function(){var t=this;if(!this.__behaviorList||0===this.__behaviorList.length)return null;for(var e=0,n=this.__behaviorList.length;n>e;e++){var i=t.__behaviorList[e];try{i.dispose&&i.dispose.call(i,t)}catch(r){console.group(),(console.error||console.log).call(console,r.stack||r),console.log("[Behavior]"),console.log(i),console.log("[Object3D]"),console.log(t),console.groupEnd()}}this.__behaviorList.length=0},THREE.Object3D.prototype.getBehaviorByType=function(t){var e=this;if(!this.__behaviorList||0===this.__behaviorList.length)return null;for(var n=0,i=this.__behaviorList.length;i>n;n++)if(e.__behaviorList[n].type===t)return e.__behaviorList[n]},THREE.Object3D.prototype.updateBehaviors=function(t,e){var n=this;if(this.__behaviorList&&0!==this.__behaviorList.length){for(var i=[],r=this.__behaviorList.slice(),o=0,a=this.__behaviorList.length;a>o;o++){var s=n.__behaviorList[o];s.__isInitialized||i.push(s)}for(var o=0,a=i.length;a>o;o++){var s=i[o];try{s.awake&&s.awake.call(s,n,e)}catch(c){console.group(),(console.error||console.log).call(console,c.stack||c),console.log("[Behavior]"),console.log(s),console.log("[Object3D]"),console.log(n),console.groupEnd()}}for(var o=0,a=i.length;a>o;o++){var s=i[o];try{s.start&&s.start.call(s)}catch(c){console.group(),(console.error||console.log).call(console,c.stack||c),console.log("[Behavior]"),console.log(s),console.log("[Object3D]"),console.log(n),console.groupEnd()}s.__isInitialized=!0}for(var o=0,a=r.length;a>o;o++){var s=r[o];try{s.update&&s.update.call(s,t)}catch(c){console.group(),(console.error||console.log).call(console,c.stack||c),console.log("[Behavior]"),console.log(s),console.log("[Object3D]"),console.log(n),console.groupEnd()}}}};var Bt=Object.freeze({OBJMTLLoader:Nt,cursor:Ft}),Ht=function(){},qt={type:{}};qt.type.get=function(){return this._typeWarning||(console.warn("Behavior",this,"does not expose type information!","It will not be queryable by getBehaviorByType, which will break","some built-in behaviors."),this._typeWarning=!0),null},Ht.prototype.awake=function(t,e){},Ht.prototype.start=function(){},Ht.prototype.update=function(t){},Ht.prototype.dispose=function(t){},Object.defineProperties(Ht.prototype,qt);var Wt=function(t){function e(e){t.call(this),this.config=Object.assign({x:3,y:5,shouldRotate:!0,shouldMove:!0},e),this.object3d=null,this.offsetPosition=null,this.lastBobPosition=new THREE.Vector3,this.nowOffset=1e4*Math.random()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"Bob"},e.prototype.awake=function(t){this.object3d=t,this.offsetPosition=this.object3d.position.clone()},e.prototype.update=function(t){var e=Math.floor(performance.now())+this.nowOffset;this.config.shouldMove&&(this.lastBobPosition.equals(this.object3d.position)||this.offsetPosition.copy(this.object3d.position),this.object3d.position.y=this.offsetPosition.y+Math.sin(e/800)*this.config.x,this.object3d.position.x=this.offsetPosition.x+Math.sin(e/500)*this.config.y,this.lastBobPosition.copy(this.object3d.position)),this.config.shouldRotate&&(this.object3d.rotation.x=Math.sin(e/500)/15)},Object.defineProperties(e.prototype,n),e}(Ht),Vt=function(t){function e(e){t.call(this),this.config=Object.assign({overBrightness:1.5,downBrightness:.5},e),this.object3d=null,this.scene=null,this.originalColor=null,this.modifiedColor=new THREE.Color,this._cbs={cursorenter:this.cursorEnter.bind(this),cursordown:this.cursorDown.bind(this),cursorup:this.cursorUp.bind(this),cursorleave:this.cursorLeave.bind(this)}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"ButtonStateStyle"},e.prototype.awake=function(t,e){this.object3d=t,this.scene=e,this.originalColor=this.config.originalColor||this.object3d.material.color,this.object3d.addEventListener("cursorenter",this._cbs.cursorenter),this.object3d.addEventListener("cursordown",this._cbs.cursordown)},e.prototype.dispose=function(){ -this.object3d.removeEventListener("cursorenter",this._cbs.cursorenter),this.object3d.removeEventListener("cursorleave",this._cbs.cursorleave),this.object3d.removeEventListener("cursorup",this._cbs.cursorup),this.object3d.removeEventListener("cursordown",this._cbs.cursordown)},e.prototype.changeBrightness=function(t){this.modifiedColor.set(this.originalColor),this.modifiedColor.multiplyScalar(t),this.modifiedColor.r=THREE.Math.clamp(this.modifiedColor.r,0,1),this.modifiedColor.g=THREE.Math.clamp(this.modifiedColor.g,0,1),this.modifiedColor.b=THREE.Math.clamp(this.modifiedColor.b,0,1),this.object3d.material.color=this.modifiedColor},e.prototype.cursorLeave=function(){this.object3d.removeEventListener("cursorleave",this._cbs.cursorleave),this.changeBrightness(1)},e.prototype.cursorEnter=function(){this.changeBrightness(this.config.overBrightness),this.object3d.addEventListener("cursorleave",this._cbs.cursorleave)},e.prototype.cursorUp=function(t){this.scene.removeEventListener("cursorup",this._cbs.cursorup),this.object3d.addEventListener("cursorenter",this._cbs.cursorenter),t.target===this.object3d?(this.changeBrightness(this.config.overBrightness),this.object3d.addEventListener("cursorleave",this._cbs.cursorleave)):this.changeBrightness(1)},e.prototype.cursorDown=function(){this.scene.addEventListener("cursorup",this._cbs.cursorup),this.object3d.removeEventListener("cursorleave",this._cbs.cursorleave),this.object3d.removeEventListener("cursorenter",this._cbs.cursorenter),this.changeBrightness(this.config.downBrightness)},Object.defineProperties(e.prototype,n),e}(Ht),Gt=function(t){function e(e){t.call(this),this.config=e=Object.assign({space:"world",x:!1,y:!1,z:!1,cursorSnap:!0},e),this.min=new THREE.Vector3(void 0!==e.x.min?e.x.min:Number.NEGATIVE_INFINITY,void 0!==e.y.min?e.y.min:Number.NEGATIVE_INFINITY,void 0!==e.z.min?e.z.min:Number.NEGATIVE_INFINITY),this.max=new THREE.Vector3(void 0!==e.x.max?e.x.max:Number.POSITIVE_INFINITY,void 0!==e.y.max?e.y.max:Number.POSITIVE_INFINITY,void 0!==e.z.max?e.z.max:Number.POSITIVE_INFINITY),this.object3d=null,this.scene=null,this.sync=null,this.intersector=null,this.dragOffset=new THREE.Vector3,this.raycaster=new THREE.Raycaster,this.raycaster.linePrecision=3,this._cbs={startDrag:this.startDrag.bind(this),moveDrag:this.moveDrag.bind(this),stopDrag:this.stopDrag.bind(this)}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"Drag"},e.prototype.awake=function(t,e){this.object3d=t,this.scene=e,this.sync=t.getBehaviorByType("Object3DSync"),this.makeIntersector(),this.scene.add(this.intersector)},e.prototype.start=function(){this.object3d.addEventListener("cursordown",this._cbs.startDrag)},e.prototype.dispose=function(){this.object3d.removeEventListener("cursordown",this._cbs.startDrag)},e.prototype.makeIntersector=function(){function t(){r.rotateY(Math.PI)}function e(){r.rotateX(Math.PI/2)}function n(){r.rotateY(Math.PI/2)}var i=1e4,r=new THREE.PlaneGeometry(i,i),o=!!this.config.x,a=!!this.config.y,s=!!this.config.z,c=o+a+s;if(3===c)throw new Error("Arbitrary dragging currently unsupported. Please lock at least one axis.");if(2!==c)throw 1===c?new Error("Single axis dragging currently unsupported."):new Error("Invalid axis configuration");o&&a?t():o&&s?e():a&&s&&n();var u=new THREE.MeshBasicMaterial({color:"purple"});u.side=THREE.DoubleSide,this.intersector=new THREE.Mesh(r,u),this.intersector.visible=!1,this.intersector.material.visible=!1},e.prototype.startDrag=function(t){this.scene.addEventListener("cursorup",this._cbs.stopDrag),this.scene.addEventListener("cursormove",this._cbs.moveDrag),this.raycaster.set(t.ray.origin,t.ray.direction);var e=this.raycaster.intersectObject(this.object3d,!0)[0];if(e){var n=e.point.clone(),i=C(this.object3d).clone();this.dragOffset.copy(n).sub(i),this.intersector.position.copy(this.intersector.parent.worldToLocal(n)),this.intersector.quaternion.copy(this.object3d.parent.quaternion),this.intersector.updateMatrixWorld();var r=this.createDragEvent("dragstart");this.object3d.dispatchEvent(r)}},e.prototype.moveDrag=function(t){this.sync&&!this.sync.isMine&&this.sync.takeOwnership(),this.intersector.visible=!0,this.raycaster.set(t.ray.origin,t.ray.direction);var e=this.raycaster.intersectObject(this.intersector,!0)[0];if(this.intersector.visible=!1,e){var n=new THREE.Vector3;n.copy(e.point).sub(this.dragOffset);var i=this,r=C(this.object3d);["x","y","z"].filter(function(t){return!i.config[t]}).forEach(function(t){n[t]=r[t]}),n.clamp(this.min,this.max),this.object3d.parent.updateMatrixWorld();var o=this.object3d.parent.worldToLocal(n);this.object3d.position.set(this.config.x?o.x:this.object3d.position.x,this.config.y?o.y:this.object3d.position.y,this.config.z?o.z:this.object3d.position.z)}},e.prototype.stopDrag=function(){this.scene.removeEventListener("cursorup",this._cbs.stopDrag),this.scene.removeEventListener("cursormove",this._cbs.moveDrag);var t=this.createDragEvent("dragstop");this.object3d.dispatchEvent(t)},e.prototype.createDragEvent=function(t){return{type:t,bubbles:!0,target:this.object3d,ray:this.raycaster.ray.clone()}},Object.defineProperties(e.prototype,n),e}(Ht),Kt=.2,Qt=function(t){function e(e){t.call(this),this.config=Object.assign({position:!0,rotation:!0,scale:!0},e),this.object3d=null,this.gamepad=null,this.scene=null,this.sync=null,this.isAltModeR=!1,this.isAltModeL=!1,this.prevAltButtonR=!1,this.prevAltButtonL=!1,this.isInitialized=!1,this.originalObj=null}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"GamepadControls"},e.prototype.awake=function(t,e){var n=this;if(this.object3d=t,this.scene=e,this.sync=this.object3d.getBehaviorByType("Object3DSync"),this.originalObj=this.object3d.clone(),this.gamepad=this.getGamepad(),this.gamepad)console.log("Gamepad detected: "+this.gamepad.id);else var i=setInterval(function(){n.gamepad=n.getGamepad(),n.gamepad&&(console.log("Gamepad connected: "+n.gamepad.id),clearInterval(i))}.bind(this),500);this.scene.addEventListener("cursordown",function(t){n.gamepad&&!n.isInitialized&&(n.preventDefault(n.gamepad),n.isInitialized=!0)}.bind(this))},e.prototype.getGamepad=function(){var t=this,e=[];if(e=altspace&&altspace.inClient?altspace.getGamepads():navigator.getGamepads(),e.length>0)for(var n=0;nKt||Math.abs(r)>Kt;o&&!this.sync.isMine&&this.sync.takeOwnership();var a=200*(t/1e3);Math.abs(i)>Kt&&(this.object3d.position.x+=a*i),Math.abs(r)>Kt&&(this.isAltModeL?this.object3d.position.y+=a*-r:this.object3d.position.z+=a*r)}if(this.config.rotation){var s=this.gamepad.buttons[11].pressed;this.prevAltButtonR&&!s&&(this.isAltModeR=!this.isAltModeR),this.prevAltButtonR=s;var c=this.gamepad.axes[2],u=this.gamepad.axes[3],h=Math.abs(c)>Kt||Math.abs(u)>Kt;h&&!this.sync.isMine&&this.sync.takeOwnership();var l=Math.PI*(t/1e3);!this.isAltModeR&&Math.abs(u)>Kt&&(this.object3d.rotation.x+=l*u),Math.abs(c)>Kt&&(this.isAltModeR?this.object3d.rotation.z+=l*-c:this.object3d.rotation.y+=l*c)}if(this.config.scale){var f=10*(t/1e3),d=this.gamepad.buttons[12].pressed,p=this.gamepad.buttons[13].pressed,g=this.gamepad.buttons[12].pressed||this.gamepad.buttons[13].pressed;g&&!this.sync.isMine&&this.sync.takeOwnership();var b=this.object3d.scale,y=new THREE.Vector3(1,1,1);y.multiplyScalar(f),d&&this.object3d.scale.add(y),p&&b.x>y.x&&b.y>y.y&&b.z>y.z&&this.object3d.scale.sub(y)}}},Object.defineProperties(e.prototype,n),e}(Ht),zt=function(t){function e(e){var n=this;if(t.call(this),this.config=Object.assign({event:"cursorenter",color:new THREE.Color("yellow")},e),"cursorenter"!==this.config.event&&"cursordown"!==this.config.event)throw Error('Expected config.event "cursorenter" or "cursordown"');this.object3d=null,this.cursordownObject=null,this.cursorenterObject=null,this.scene=null,this.cursordown=function(t){n.cursordownObject=n.object3d,"cursordown"===n.config.event&&n.setColor(n.cursordownObject)}.bind(this),this.cursorenter=function(t){n.cursordownObject&&n.cursordownObject!==n.object3d||(n.cursorenterObject&&n.unsetColor(n.cursorenterObject),n.cursorenterObject=n.object3d,n.setColor(n.object3d))}.bind(this),this.cursorleave=function(t){n.cursorenterObject===n.object3d&&(n.cursorenterObject=null,n.unsetColor(n.object3d))}.bind(this),this.cursorupScene=function(t){"cursordown"===n.config.event&&n.cursordownObject&&n.unsetColor(n.cursordownObject),n.cursordownObject=null}.bind(this)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"HoverColor"},e.prototype.awake=function(t,e){this.object3d=t,this.scene=e,this.object3d.addEventListener("cursordown",this.cursordown),this.scene.addEventListener("cursorup",this.cursorupScene),"cursorenter"===this.config.event&&(this.object3d.addEventListener("cursorenter",this.cursorenter),this.object3d.addEventListener("cursorleave",this.cursorleave))},e.prototype.dispose=function(){this.object3d.removeEventListener("cursordown",this.cursordown),this.scene.removeEventListener("cursorup",this.cursorupScene),this.object3d.removeEventListener("cursorenter",this.cursorenter),this.object3d.removeEventListener("cursorleave",this.cursorleave)},e.prototype.setColor=function(t){t.material&&t.material.color&&(t.userData.origColor=t.material.color,t.material.color=this.config.color,t.material&&(t.material.needsUpdate=!0)),t.children.forEach(this.setColor.bind(this))},e.prototype.unsetColor=function(t){if(t.material&&t.material.color){if(!t.userData.origColor)return void console.error("Cannot unsetColor, no userData.origColor for object",t);t.material.color=t.userData.origColor,t.material&&(t.material.needsUpdate=!0)}t.children.forEach(this.unsetColor.bind(this))},Object.defineProperties(e.prototype,n),e}(Ht),Yt=function(t){function e(e){var n=this;t.call(this),this.config=Object.assign({scale:1.15,duration:75,revertOnDispose:!0},e),this.object3d=null,this.originalScale=null,this.elapsedTime=this.config.duration,this.progress=1,this.srcScale=null,this.destScale=null,this.onHoverStateChange=function(){var t;t=[n.destScale,n.srcScale],n.srcScale=t[0],n.destScale=t[1],n.progress=1-n.progress,n.elapsedTime=n.config.duration-n.elapsedTime}.bind(this)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"HoverScale"},e.prototype.awake=function(t,e){this.object3d=t,this.originalScale=this.object3d.scale.clone(),this.srcScale=this.object3d.scale.clone(),this.srcScale.multiplyScalar(this.config.scale),this.destScale=new THREE.Vector3,this.destScale.copy(this.originalScale),this.progress=1,this.elapsedTime=this.config.duration,this.object3d.addEventListener("cursorenter",this.onHoverStateChange),this.object3d.addEventListener("cursorleave",this.onHoverStateChange)},e.prototype.update=function(t){this.progress<1&&(this.elapsedTime=THREE.Math.clamp(this.elapsedTime+t,0,this.config.duration),this.progress=THREE.Math.clamp(this.elapsedTime/this.config.duration,0,1),this.object3d.scale.lerpVectors(this.srcScale,this.destScale,this.progress))},e.prototype.dispose=function(){this.object3d.removeEventListener("cursorenter",this.onHoverStateChange),this.object3d.removeEventListener("cursorleave",this.onHoverStateChange),this.config.revertOnDispose&&this.object3d.scale.copy(this.originalScale),this.originalScale=null,this.srcScale=null,this.destScale=null,this.object3d=null},Object.defineProperties(e.prototype,n),e}(Ht),Xt=function(t){function e(n){t.call(this),this.config=Object.assign({jointCubeSize:15,joints:e.HAND_JOINTS},n),this.object3d=null,this.skeleton=null,this.jointCube=null,this.hasCollided=!1,this.collidedJoints=[],this.jointIntersectUnion=null}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"JointCollisionEvents"},e.prototype.awake=function(t,e){this.object3d=t;var n=this;k(e).then(function(t){n.skeleton=t,n.jointCube=new THREE.Vector3(n.config.jointCubeSize,n.config.jointCubeSize,n.config.jointCubeSize)})["catch"](function(t){console.log("Failed to get tracking skeleton",t)})},e.prototype.update=function(t){var e=this;if(this.skeleton){for(var n=[],i=0;iNumber.EPSILON&&this.object3d.scale.y>Number.EPSILON&&this.object3d.scale.z>Number.EPSILON)for(var c=0;c0){if(T(t,this.lastTransform))return;this.transformRef.set(t),this.lastTransform=t}}},e.prototype.takeOwnership=function(){this.ownerRef.set(this.sceneSync.clientId)},Object.defineProperties(e.prototype,n),e}(Ht),fe=[],de={},pe={},ge=function(t){function e(e,n){t.call(this),this.config=Object.assign({instantiators:{},destroyers:{},ready:null,autoSendRateMS:100},n),this.instanceRef=e,this.sceneRef=e.child("scene"),this.clientsRef=e.child("clients"),this.clientId=null,this.masterClientId=null}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{},isMasterClient:{}};return n.type.get=function(){return"SceneSync"},e.prototype.awake=function(t,e){var n=this;setInterval(R,this.config.autoSendRateMS);var i=e;this.clientId=i.uuid,this.clientsRef.on("value",function(t){var e=t.val();if(e){var i=Object.keys(e)[0];n.masterClientId=e[i]}}.bind(this)),this.clientsRef.push(this.clientId).onDisconnect().remove(),this.instanceRef.child("initialized").once("value",function(t){var e=!t.val();t.ref().set(!0),n.config.ready&&n.config.ready(e)}.bind(this)),this.sceneRef.on("child_added",this.onInstantiate.bind(this)),this.sceneRef.on("child_removed",this.onDestroy.bind(this))},e.prototype.instantiate=function(t,e,n){void 0===e&&(e={});var i=this.sceneRef.push({syncType:t,initData:e},function(t){if(t)throw Error("Failed to save to Firebase",t)});n&&i.onDisconnect().remove();var r=de[i.key()];return r.getBehaviorByType("Object3DSync").takeOwnership(),r},e.prototype.onInstantiate=function(t){var e=t.val(),n=t.key(),i=this.config.instantiators[e.syncType];if(!i)return void console.warn("No instantiator found for syncType: "+e.syncType);var r=i(e.initData,e.syncType);if(!r)return void console.error(e.syncType+".create must return an Object3D");de[n]=r,pe[r.uuid]=n;var o=r.getBehaviorByType("Object3DSync");return o?(fe.push(o),void o.link(t.ref(),this)):void console.error(e.syncType+" instantiator must return an Object3D with an Object3DSync behavior")},e.prototype.destroy=function(t){var e=pe[t.uuid];return e?(this.sceneRef.child(e).remove(function(t){t&&console.warn("Failed to remove from Firebase",t)}),void this.sceneRef.child(e).off()):void console.warn("Failed to find key for object3d to be destroyed",t)},e.prototype.onDestroy=function(t){function e(t){t.removeAllBehaviors(),t.parent&&t.parent.remove(t),t.geometry&&t.geometry.dispose(),t.material&&(t.material.map&&t.material.map.dispose(),t.material.dispose())}var n=t.val(),i=t.key(),r=de[i];if(!r)return void console.warn("Failed to find object matching deleted key",i);var o=n.syncType;if(!o)return void console.warn("No syncType found for object being destroyed",r);var a=this.config.destroyers[o],s=!a;a&&(s=a(r)),s&&e(r),delete de[i],delete pe[r.uuid]},n.isMasterClient.get=function(){return this.masterClientId===this.clientId},Object.defineProperties(e.prototype,n),e}(Ht),be=function(t){function e(e){t.call(this),this.config=Object.assign({speed:1e-4,axis:new THREE.Vector3(0,1,0)},e),this.config.axis.normalize(),this.object3d=null}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"Spin"},e.prototype.awake=function(t){this.object3d=t},e.prototype.update=function(t){this.object3d.rotateOnAxis(this.config.axis,this.config.speed*t)},Object.defineProperties(e.prototype,n),e}(Ht),ye=function(t){function e(e){t.call(this),this.config=Object.assign({logging:!1},e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"SteamVRInput"},e.prototype.awake=function(){var t=this;this.leftControllerPromise=x(e.LEFT_CONTROLLER,this.config),this.rightControllerPromise=x(e.RIGHT_CONTROLLER,this.config),this.firstControllerPromise=Promise.race([this.leftControllerPromise,this.rightControllerPromise]),this.leftControllerPromise.then(function(e){t.leftController=e}),this.rightControllerPromise.then(function(e){t.rightController=e}),this.firstControllerPromise.then(function(n){t.firstController=n;var i=n.axes.map(function(){return!1}),r=n.buttons.map(function(){return!1});r[e.BUTTON_TRIGGER]=!0,r[e.BUTTON_TOUCHPAD]=!0,n.preventDefault(i,r)})},Object.defineProperties(e.prototype,n),e}(Ht);Object.assign(ye,{BUTTON_TRIGGER:0,BUTTON_GRIP:1,BUTTON_TOUCHPAD:2,BUTTON_DPAD_UP:3,BUTTON_DPAD_RIGHT:4,BUTTON_DPAD_DOWN:5,BUTTON_DPAD_LEFT:6,AXIS_TOUCHPAD_X:0,AXIS_TOUCHPAD_Y:1,FIRST_CONTROLLER:"first",LEFT_CONTROLLER:"left",RIGHT_CONTROLLER:"right"});var ve=function(t){function e(e){var n=e.hand;void 0===n&&(n="first"),t.call(this),this._hand=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"SteamVRTrackedObject"},e.prototype.awake=function(t,e){this._object3d=t,this._scene=e,this._steamVRInput=this._scene.getBehaviorByType("SteamVRInput")},e.prototype.update=function(){var t=this._steamVRInput[this._hand+"Controller"],e=this._object3d;if(t){var n=t.position,i=n.x,r=n.y,o=n.z;e.position.set(i,r,o);var a=t.rotation,i=a.x,r=a.y,o=a.z,s=a.w;e.quaternion.set(i,r,o,s)}},Object.defineProperties(e.prototype,n),e}(Ht),me=function(t){function e(e){void 0===e&&(e={}),t.call(this),this.object3d=null,this.scene=null,this.startingRotation=null,this.activelyRotating=!1,this.lastDisplacementX=0,this.runningCount=5,this.runningAverageVelocityX=0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"TouchpadRotate"},e.prototype.awake=function(t,e){this.object3d=t,this.scene=e,altspace.addEventListener("touchpadup",this.onTouchpadUp.bind(this)),altspace.addEventListener("touchpaddown",this.onTouchpadDown.bind(this)),altspace.addEventListener("touchpadmove",this.onTouchpadMove.bind(this))},e.prototype.update=function(t){!this.activelyRotating&&Math.abs(this.runningAverageVelocityX)>.01&&(this.object3d.rotation.y+=this.runningAverageVelocityX,this.runningAverageVelocityX*=.97)},e.prototype.onTouchpadUp=function(t){this.activelyRotating=!1},e.prototype.onTouchpadDown=function(t){this.activelyRotating=!0,this.startingRotation=this.object3d.rotation.clone()},e.prototype.onTouchpadMove=function(t){var e=t.displacementX-this.lastDisplacementX;this.object3d.rotation.set(this.startingRotation.x,this.startingRotation.y+t.displacementX/300,this.startingRotation.z),this.runningAverageVelocityX=(this.runningAverageVelocityX*this.runningCount+e/300)/(this.runningCount+1),this.lastDisplacementX=t.displacementX},Object.defineProperties(e.prototype,n),e}(Ht),we=Object.freeze({Behavior:Ht,Bob:Wt,ButtonStateStyle:Vt,Drag:Gt,GamepadControls:Qt,HoverColor:zt,HoverScale:Yt,JointCollisionEvents:Xt,Layout:he,Object3DSync:le,SceneSync:ge,Spin:be,SteamVRInput:ye,SteamVRTrackedObject:ve,TouchpadRotate:me}),Ee=Object.freeze({sync:jt,Simulation:Ot,multiloader:Lt,codePen:Ut,shims:Bt,behaviors:we});Object.isFrozen(window.altspace)||Object.assign(window.altspace,{components:{},utilities:{},inClient:!1});var _e="2.7.1";window.altspace.requestVersion&&window.altspace.requestVersion(_e),window.AFRAME&&!window.THREE&&(window.THREE=window.AFRAME.THREE),Object.assign(window.altspace.components||{},wt),Object.assign(window.altspace.utilities||{},Ee)}(Firebase,Url,Please); \ No newline at end of file +new X(this.k,this.path)},U.prototype.onDisconnect=U.prototype.ib,U.prototype.N=function(t,e,n){Q("FirebaseRef.auth() being deprecated. Please use FirebaseRef.authWithCustomToken() instead."),x("Firebase.auth",1,3,arguments.length),cg("Firebase.auth",t),A("Firebase.auth",2,e,!0),A("Firebase.auth",3,e,!0),Qg(this.k.N,t,{},{remember:"none"},e,n)},U.prototype.auth=U.prototype.N,U.prototype.he=function(t){x("Firebase.unauth",0,1,arguments.length),A("Firebase.unauth",1,t,!0),Rg(this.k.N,t)},U.prototype.unauth=U.prototype.he,U.prototype.ye=function(){return x("Firebase.getAuth",0,0,arguments.length),this.k.N.ye()},U.prototype.getAuth=U.prototype.ye,U.prototype.vg=function(t,e){x("Firebase.onAuth",1,2,arguments.length),A("Firebase.onAuth",1,t,!1),mb("Firebase.onAuth",2,e),this.k.N.Fb("auth_status",t,e)},U.prototype.onAuth=U.prototype.vg,U.prototype.ug=function(t,e){x("Firebase.offAuth",1,2,arguments.length),A("Firebase.offAuth",1,t,!1),mb("Firebase.offAuth",2,e),this.k.N.hc("auth_status",t,e)},U.prototype.offAuth=U.prototype.ug,U.prototype.Xf=function(t,e,n){x("Firebase.authWithCustomToken",2,3,arguments.length),cg("Firebase.authWithCustomToken",t),A("Firebase.authWithCustomToken",2,e,!1),fg("Firebase.authWithCustomToken",3,n,!0),Qg(this.k.N,t,{},n||{},e)},U.prototype.authWithCustomToken=U.prototype.Xf,U.prototype.Yf=function(t,e,n){x("Firebase.authWithOAuthPopup",2,3,arguments.length),eg("Firebase.authWithOAuthPopup",t),A("Firebase.authWithOAuthPopup",2,e,!1),fg("Firebase.authWithOAuthPopup",3,n,!0),Vg(this.k.N,t,n,e)},U.prototype.authWithOAuthPopup=U.prototype.Yf,U.prototype.Zf=function(t,e,n){x("Firebase.authWithOAuthRedirect",2,3,arguments.length),eg("Firebase.authWithOAuthRedirect",t),A("Firebase.authWithOAuthRedirect",2,e,!1),fg("Firebase.authWithOAuthRedirect",3,n,!0);var i=this.k.N;Tg(i);var r=[Cg],o=ng(n);"anonymous"===t||"firebase"===t?R(e,Eg("TRANSPORT_UNAVAILABLE")):(P.set("redirect_client_options",o.od),Ug(i,r,"/auth/"+t,o,e))},U.prototype.authWithOAuthRedirect=U.prototype.Zf,U.prototype.$f=function(t,e,n,i){x("Firebase.authWithOAuthToken",3,4,arguments.length),eg("Firebase.authWithOAuthToken",t),A("Firebase.authWithOAuthToken",3,n,!1),fg("Firebase.authWithOAuthToken",4,i,!0),p(e)?(dg("Firebase.authWithOAuthToken",2,e),Sg(this.k.N,t+"/token",{access_token:e},i,n)):(fg("Firebase.authWithOAuthToken",2,e,!1),Sg(this.k.N,t+"/token",e,i,n))},U.prototype.authWithOAuthToken=U.prototype.$f,U.prototype.Wf=function(t,e){x("Firebase.authAnonymously",1,2,arguments.length),A("Firebase.authAnonymously",1,t,!1),fg("Firebase.authAnonymously",2,e,!0),Sg(this.k.N,"anonymous",{},e,t)},U.prototype.authAnonymously=U.prototype.Wf,U.prototype.ag=function(t,e,n){x("Firebase.authWithPassword",2,3,arguments.length),fg("Firebase.authWithPassword",1,t,!1),gg("Firebase.authWithPassword",t,"email"),gg("Firebase.authWithPassword",t,"password"),A("Firebase.authWithPassword",2,e,!1),fg("Firebase.authWithPassword",3,n,!0),Sg(this.k.N,"password",t,n,e)},U.prototype.authWithPassword=U.prototype.ag,U.prototype.te=function(t,e){x("Firebase.createUser",2,2,arguments.length),fg("Firebase.createUser",1,t,!1),gg("Firebase.createUser",t,"email"),gg("Firebase.createUser",t,"password"),A("Firebase.createUser",2,e,!1),this.k.N.te(t,e)},U.prototype.createUser=U.prototype.te,U.prototype.Ue=function(t,e){x("Firebase.removeUser",2,2,arguments.length),fg("Firebase.removeUser",1,t,!1),gg("Firebase.removeUser",t,"email"),gg("Firebase.removeUser",t,"password"),A("Firebase.removeUser",2,e,!1),this.k.N.Ue(t,e)},U.prototype.removeUser=U.prototype.Ue,U.prototype.qe=function(t,e){x("Firebase.changePassword",2,2,arguments.length),fg("Firebase.changePassword",1,t,!1),gg("Firebase.changePassword",t,"email"),gg("Firebase.changePassword",t,"oldPassword"),gg("Firebase.changePassword",t,"newPassword"),A("Firebase.changePassword",2,e,!1),this.k.N.qe(t,e)},U.prototype.changePassword=U.prototype.qe,U.prototype.pe=function(t,e){x("Firebase.changeEmail",2,2,arguments.length),fg("Firebase.changeEmail",1,t,!1),gg("Firebase.changeEmail",t,"oldEmail"),gg("Firebase.changeEmail",t,"newEmail"),gg("Firebase.changeEmail",t,"password"),A("Firebase.changeEmail",2,e,!1),this.k.N.pe(t,e)},U.prototype.changeEmail=U.prototype.pe,U.prototype.We=function(t,e){x("Firebase.resetPassword",2,2,arguments.length),fg("Firebase.resetPassword",1,t,!1),gg("Firebase.resetPassword",t,"email"),A("Firebase.resetPassword",2,e,!1),this.k.N.We(t,e)},U.prototype.resetPassword=U.prototype.We}(),!function(t,e,n){"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?module.exports=n():e[t]=n()}("Please",this,function(){"use strict";function t(){function t(t,e,n){var i=Math.random;return n instanceof a&&(i=n.random),Math.floor(i()*(e-t+1))+t}function e(t,e,n){var i=Math.random;return n instanceof a&&(i=n.random),i()*(e-t)+t}function n(t,e,n){return Math.max(e,Math.min(t,n))}function i(t,e){var n;switch(t){case"hex":for(n=0;n=128?"dark":"light"}function o(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function a(t){function e(){i=(i+1)%256,r=(r+n[i])%256;var t=n[i];return n[i]=n[r],n[r]=t,n[(n[i]+n[r])%256]}for(var n=[],i=0,r=0,o=0;256>o;o++)n[o]=o;for(var a=0,s=0;256>a;a++){s=(s+n[a]+t.charCodeAt(a%t.length))%256;var c=n[a];n[a]=n[s],n[s]=c}this.random=function(){for(var t=0,n=0,i=1;8>t;t++)n+=e()*i,i*=256;return n/0x10000000000000000}}var s={},c={aliceblue:"F0F8FF",antiquewhite:"FAEBD7",aqua:"00FFFF",aquamarine:"7FFFD4",azure:"F0FFFF",beige:"F5F5DC",bisque:"FFE4C4",black:"000000",blanchedalmond:"FFEBCD",blue:"0000FF",blueviolet:"8A2BE2",brown:"A52A2A",burlywood:"DEB887",cadetblue:"5F9EA0",chartreuse:"7FFF00",chocolate:"D2691E",coral:"FF7F50",cornflowerblue:"6495ED",cornsilk:"FFF8DC",crimson:"DC143C",cyan:"00FFFF",darkblue:"00008B",darkcyan:"008B8B",darkgoldenrod:"B8860B",darkgray:"A9A9A9",darkgrey:"A9A9A9",darkgreen:"006400",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkseagreen:"8FBC8F",darkslateblue:"483D8B",darkslategray:"2F4F4F",darkslategrey:"2F4F4F",darkturquoise:"00CED1",darkviolet:"9400D3",deeppink:"FF1493",deepskyblue:"00BFFF",dimgray:"696969",dimgrey:"696969",dodgerblue:"1E90FF",firebrick:"B22222",floralwhite:"FFFAF0",forestgreen:"228B22",fuchsia:"FF00FF",gainsboro:"DCDCDC",ghostwhite:"F8F8FF",gold:"FFD700",goldenrod:"DAA520",gray:"808080",grey:"808080",green:"008000",greenyellow:"ADFF2F",honeydew:"F0FFF0",hotpink:"FF69B4",indianred:"CD5C5C",indigo:"4B0082",ivory:"FFFFF0",khaki:"F0E68C",lavender:"E6E6FA",lavenderblush:"FFF0F5",lawngreen:"7CFC00",lemonchiffon:"FFFACD",lightblue:"ADD8E6",lightcoral:"F08080",lightcyan:"E0FFFF",lightgoldenrodyellow:"FAFAD2",lightgray:"D3D3D3",lightgrey:"D3D3D3",lightgreen:"90EE90",lightpink:"FFB6C1",lightsalmon:"FFA07A",lightseagreen:"20B2AA",lightskyblue:"87CEFA",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"B0C4DE",lightyellow:"FFFFE0",lime:"00FF00",limegreen:"32CD32",linen:"FAF0E6",magenta:"FF00FF",maroon:"800000",mediumaquamarine:"66CDAA",mediumblue:"0000CD",mediumorchid:"BA55D3",mediumpurple:"9370D8",mediumseagreen:"3CB371",mediumslateblue:"7B68EE",mediumspringgreen:"00FA9A",mediumturquoise:"48D1CC",mediumvioletred:"C71585",midnightblue:"191970",mintcream:"F5FFFA",mistyrose:"FFE4E1",moccasin:"FFE4B5",navajowhite:"FFDEAD",navy:"000080",oldlace:"FDF5E6",olive:"808000",olivedrab:"6B8E23",orange:"FFA500",orangered:"FF4500",orchid:"DA70D6",palegoldenrod:"EEE8AA",palegreen:"98FB98",paleturquoise:"AFEEEE",palevioletred:"D87093",papayawhip:"FFEFD5",peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",rebeccapurple:"663399",red:"FF0000",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0C0C0",skyblue:"87CEEB",slateblue:"6A5ACD",slategray:"708090",slategrey:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"FFFFFF",whitesmoke:"F5F5F5",yellow:"FFFF00",yellowgreen:"9ACD32"},u=.618033988749895,h={hue:null,saturation:null,value:null,base_color:"",greyscale:!1,grayscale:!1,golden:!0,full_random:!1,colors_returned:1,format:"hex",seed:null},l={scheme_type:"analogous",format:"hex"},f={golden:!1,format:"hex"};return s.NAME_to_HEX=function(t){return t=t.toLowerCase(),t in c?c[t]:void console.error("Color name not recognized.")},s.NAME_to_RGB=function(t){return s.HEX_to_RGB(s.NAME_to_HEX(t))},s.NAME_to_HSV=function(t){return s.HEX_to_HSV(s.NAME_to_HEX(t))},s.HEX_to_RGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,n,i){return e+e+n+n+i+i});var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null},s.RGB_to_HEX=function(t){return"#"+((1<<24)+(t.r<<16)+(t.g<<8)+t.b).toString(16).slice(1)},s.HSV_to_RGB=function(t){var e,n,i,r,o,a,s,c,u=t.h,h=t.s,l=t.v;if(0===h)return{r:l,g:l,b:l};switch(u/=60,r=Math.floor(u),o=u-r,a=l*(1-h),s=l*(1-h*o),c=l*(1-h*(1-o)),r){case 0:e=l,n=c,i=a;break;case 1:e=s,n=l,i=a;break;case 2:e=a,n=l,i=c;break;case 3:e=a,n=s,i=l;break;case 4:e=c,n=a,i=l;break;case 5:e=l,n=a,i=s}return{r:Math.floor(255*e),g:Math.floor(255*n),b:Math.floor(255*i)}},s.RGB_to_HSV=function(t){var e=t.r/255,n=t.g/255,i=t.b/255,r=0,o=0,a=0,s=Math.min(e,Math.min(n,i)),c=Math.max(e,Math.max(n,i));if(s===c)return a=s,{h:0,s:0,v:a};var u=e===s?n-i:i===s?e-n:i-e,h=e===s?3:i===s?1:5;return r=60*(h-u/(c-s)),o=(c-s)/c,a=c,{h:r,s:o,v:a}},s.HSV_to_HEX=function(t){return s.RGB_to_HEX(s.HSV_to_RGB(t))},s.HEX_to_HSV=function(t){return s.RGB_to_HSV(s.HEX_to_RGB(t))},s.make_scheme=function(t,e){function r(t){return{h:t.h,s:t.s,v:t.v}}var a,s,c,u,h,f=o(l);if(null!==e)for(var p in e)e.hasOwnProperty(p)&&(f[p]=e[p]);var d=[t];switch(f.scheme_type.toLowerCase()){case"monochromatic":case"mono":for(h=1;2>=h;h++)a=r(t),c=a.s+.1*h,c=n(c,0,1),u=a.v+.1*h,u=n(u,0,1),a.s=c,a.v=u,d.push(a);for(h=1;2>=h;h++)a=r(t),c=a.s-.1*h,c=n(c,0,1),u=a.v-.1*h,u=n(u,0,1),a.s=c,a.v=u,d.push(a);break;case"complementary":case"complement":case"comp":a=r(t),a.h=(a.h+180)%360,d.push(a);break;case"split-complementary":case"split-complement":case"split":a=r(t),a.h=(a.h+165)%360,d.push(a),a=r(t),a.h=Math.abs((a.h-165)%360),d.push(a);break;case"double-complementary":case"double-complement":case"double":a=r(t),a.h=(a.h+180)%360,d.push(a),a.h=(a.h+30)%360,s=r(a),d.push(a),a.h=(a.h+180)%360,d.push(s);break;case"analogous":case"ana":for(h=1;5>=h;h++)a=r(t),a.h=(a.h+20*h)%360,d.push(a);break;case"triadic":case"triad":case"tri":for(h=1;3>h;h++)a=r(t),a.h=(a.h+120*h)%360,d.push(a);break;default:console.error("Color scheme not recognized.")}return i(f.format.toLowerCase(),d),d},s.make_color=function(r){var c=[],l=o(h),f=null;if(null!==r)for(var p in r)r.hasOwnProperty(p)&&(l[p]=r[p]);var d=null;"string"==typeof l.seed&&(d=new a(l.seed)),l.base_color.length>0&&(f=l.base_color.match(/^#?([0-9a-f]{3})([0-9a-f]{3})?$/i)?s.HEX_to_HSV(l.base_color):s.NAME_to_HSV(l.base_color));for(var g=0;gc;c++)n[f[c]]=u[f[c]];for(;".."==l[0];)h.pop(),l.shift();n.path=("/"!=i.substring(0,1)?h.join("/"):"")+"/"+l.join("/")}r(n)},i=function(t){return t=t.replace(/\+/g," "),t=t.replace(/%([ef][0-9a-f])%([89ab][0-9a-f])%([89ab][0-9a-f])/gi,function(t,e,n,i){var r=parseInt(e,16)-224,o=parseInt(n,16)-128;if(0==r&&32>o)return t;var a=parseInt(i,16)-128,s=(r<<12)+(o<<6)+a;return s>65535?t:String.fromCharCode(s)}),t=t.replace(/%([cd][0-9a-f])%([89ab][0-9a-f])/gi,function(t,e,n){var i=parseInt(e,16)-192;if(2>i)return t;var r=parseInt(n,16)-128;return String.fromCharCode((i<<6)+r)}),t=t.replace(/%([0-7][0-9a-f])/gi,function(t,e){return String.fromCharCode(parseInt(e,16))})},r=function(t){var e=t.query;t.query=new function(t){for(var e,n=/([^=&]+)(=([^&]*))?/g;e=n.exec(t);){var r=decodeURIComponent(e[1].replace(/\+/g," ")),o=e[3]?i(e[3]):"";null!=this[r]?(this[r]instanceof Array||(this[r]=[this[r]]),this[r].push(o)):this[r]=o}this.clear=function(){for(r in this)this[r]instanceof Function||delete this[r]},this.toString=function(){var t="",e=encodeURIComponent;for(var n in this)if(!(this[n]instanceof Function))if(this[n]instanceof Array){var i=this[n].length;if(i)for(var r=0;i>r;r++)t+=t?"&":"",t+=e(n)+"="+e(this[n][r]);else t+=(t?"&":"")+e(n)+"="}else t+=t?"&":"",t+=e(n)+"="+e(this[n]);return t}}(e)};return function(t){this.toString=function(){return(this.protocol&&this.protocol+"://")+(this.user&&this.user+(this.pass&&":"+this.pass)+"@")+(this.host&&this.host)+(this.port&&":"+this.port)+(this.path&&this.path)+(this.query.toString()&&"?"+this.query)+(this.hash&&"#"+this.hash)},n(this,t)}}();!function(t,e,n){"use strict";function i(t){var e={};return e=t.__proto__?Object.assign(i(t.__proto__),t):Object.assign({schema:{},dependencies:[]},t),t.schema&&Object.assign(e.schema,t.schema),t.dependencies&&(n=e.dependencies).push.apply(n,t.dependencies),e;var n}function r(t,e){AFRAME.registerComponent(t,i(new e))}function o(t,e){AFRAME.registerSystem(t,i(new e))}function a(t,e,n){return 0===e.length?n:(t[e[0]]=a(t[e[0]]||{},e.slice(1),n),t)}function s(t,e,n){var i,r,o,a,s=0;n||(n={});var c=function(){s=n.leading===!1?0:Date.now(),i=null,a=t.apply(r,o),i||(r=o=null)},u=function(){var u=Date.now();s||n.leading!==!1||(s=u);var h=e-(u-s);return r=this,o=arguments,0>=h||h>e?(i&&(clearTimeout(i),i=null),s=u,a=t.apply(r,o),i||(r=o=null)):i||n.trailing===!1||(i=setTimeout(c,h)),a};return u.cancel=function(){clearTimeout(i),s=0,i=r=o=null},u}function c(t){return t?encodeURIComponent(t).replace(/\./g,"%2E").replace(/%[A-Z0-9]{2}/g,"-"):null}function u(){var t=document.querySelector("link[rel=canonical]");return t?t.href:window.location.href}function h(t,e,n){return c(e||n)+":"+c(t||"")}function l(n){n=n||{};var i=new e,r=n.baseRefUrl||"https://altspace-apps.firebaseio.com/apps/examples/",o=new t(r),a=n.instanceId||i.query["altspace-sync-instance"],s=n.spaceId||i.query["altspace-sync-space"],u=n.userId||i.query["altspace-sync-user"];if(!n.appId||!n.authorId)throw new Error("Both the appId and authorId must be provided to connect.");var l=[];Et&&(s||l.unshift(altspace.getSpace()),u||l.unshift(altspace.getUser()));var f={},p=h(n.appId,n.authorId,_t);f.app=o.child(p).child("app");var d=f.app.child("instances");return a?(f.instance=d.child(a),Promise.all(l).then(function(t){Et&&(s||(s=t.pop().sid),u||(u=t.pop().userId)),s=c(s),u=c(u),a=c(a),f.space=s?f.app.child("spaces").child(s):null,f.user=u?f.app.child("users").child(u):null;var e=f;return e})):(f.instance=d.push(),a=f.instance.key(),i.query["altspace-sync-instance"]=a,window.location.href=i.toString(),Promise.reject(new Error("Sync instance id not found. Reloading app with new sync id.")))}function f(t,e,n){if(!(t&&t instanceof THREE.Scene))throw new TypeError("Requires THREE.Scene argument");if(!(e&&e instanceof THREE.Camera))throw new TypeError("Requires THREE.Camera argument");bt=t,yt=e;var i=n||{};vt=i.renderer&&i.renderer.domElement||window,vt.addEventListener("mousedown",p,!1),vt.addEventListener("mouseup",d,!1),vt.addEventListener("mousemove",g,!1)}function p(t){var e=y(t);if(e&&e.point){var n=b("cursordown",e);e.object.dispatchEvent(n)}}function d(t){var e=y(t),n=b("cursorup",e);e?e.object.dispatchEvent(n):bt.dispatchEvent(n)}function g(t){var e=y(t),n=b("cursormove",e);bt.dispatchEvent(n);var i=e?e.object:null;mt!=i&&(mt&&(n=b("cursorleave",e),mt.dispatchEvent(n)),i&&(n=b("cursorenter",e),i.dispatchEvent(n)),mt=i)}function b(t,e){return{type:t,bubbles:!0,target:e?e.object:null,ray:{origin:St.ray.origin.clone(),direction:St.ray.direction.clone()},point:e?e.point.clone():null}}function y(t){var e=new THREE.Vector2;e.x=t.offsetX/(vt.width||vt.innerWidth)*2-1,e.y=2*-(t.offsetY/(vt.height||vt.innerHeight))+1,St.setFromCamera(e,yt);var n=St.intersectObjects(bt.children,!0);return n.find(function(t){return!t.object.userData||!t.object.userData.altspace||!t.object.userData.altspace.collider||t.object.userData.altspace.collider.enabled!==!1})||null}function v(t){var e=t||{};kt=e.TRACE||!1,e.crossOrigin&&(Rt=e.crossOrigin),e.baseUrl&&(Tt=e.baseUrl),"/"!==Tt.slice(-1)&&(Tt+="/"),Ct=new altspace.utilities.shims.OBJMTLLoader,Ct.crossOrigin=Rt,kt&&console.log("MultiLoader initialized with params",t)}function m(t,e){var n=t,i=Date.now();if(!(n&&n instanceof xt))throw new Error("MultiLoader.load expects first arg of type LoadRequest");if(!e||"function"!=typeof e)throw new Error("MultiLoader.load expects second arg of type function");if(!n.objUrls||!n.mtlUrls||n.objUrls.length!==n.mtlUrls.length)throw new Error("MultiLoader.load called with bad LoadRequest");var r=n.objUrls.length;kt&&console.log("Loading models...");for(var o=0;r>o;o++){var a=function(t,n){var o=Tt+t.objUrls[n],a=Tt+t.mtlUrls[n];kt&&console.log("Loading obj:"+o+", mtl:"+a),Ct.load(o,a,function(o){if(t.objects[n]=o,t.objectsLoaded++,t.objectsLoaded===r){var a=((Date.now()-i)/1e3).toFixed(2);kt&&console.log("Loaded "+r+" models in "+a+" seconds"),e()}},w,function(){var e=xhr.target.responseURL||"";t.error="Error loading file "+e})};a(n,o)}}function w(t){if(t.lengthComputable&&t.target.responseURL){var e=t.loaded/t.total*100,n=t.target.responseURL.split("/").pop();kt&&console.log("..."+n+" "+Math.round(e,2)+"% downloaded")}}function E(){console.log("In a tile: "+Mt),console.log("In VR: "+Dt)}function _(){if(!Mt&&Dt);else{var t=document.createElement("style");t.type="text/css",t.innerHTML="@import url(https://fonts.googleapis.com/css?family=Open+Sans:800);.altspace-info{text-align:center;font-family:'Open Sans',sans-serif;line-height:.5}.altspace-vr-notice{color:rgba(0,0,0,.7);font-size:5vw}.altspace-pen-name{font-size:7vw}",document.head.appendChild(t),document.body.style.background=n.make_color({seed:F()});var e=document.createElement("div");e.className="altspace-info",document.body.appendChild(e);var i=document.createElement("span");if(i.className="altspace-pen-name",i.innerHTML="

"+It.toUpperCase()+"

",e.appendChild(i),Mt){var r="VR mode does not support preview tiles. Stopping code execution.";throw console.log("ERROR: "+r),new Error(r)}if(!Dt){var o=document.createElement("span");o.className="altspace-vr-notice",o.innerHTML="

View

",e.insertBefore(o,i);var a=document.createElement("span");a.className="altspace-vr-notice",a.innerHTML='

in AltspaceVR

',e.appendChild(a);var r="Not in VR mode. Stopping code execution.";throw Mt&&console.log("ERROR: "+r),new Error(r)}}}function j(t){It=t}function S(){var t=document.querySelector("link[rel=canonical]"),n=t?t.href:window.location.href;return new e(n)}function F(){var t=S(),e=t.path.split("/"),n=e[e.length-1];return n}function A(){var t=S(),e=t.path.split("/"),n="team"==e[1],i=n?"team-"+e[2]:e[1];return i}function O(t){var e,n,i=this;if(t.bubbles&&(t.currentTarget=this,t.stopPropagation=function(){e=!0},t.stopImmediatePropagation=function(){n=!0}),this._listeners){var r=this._listeners,o=r[t.type];if(o){t.target=t.target||this;for(var a=[],s=o.length,c=0;s>c;c++)a[c]=o[c];for(var c=0;s>c;c++)if(a[c].call(i,t),n)return}}t.bubbles&&this.parent&&this.parent.dispatchEvent&&!e&&O.call(this.parent,t)}function C(t){t.updateMatrixWorld();var e=new THREE.Vector3;return e.setFromMatrixPosition(t.matrixWorld),e}function k(t){return new Promise(function(e,n){var i=null;return t.traverse(function(t){return"TrackingSkeleton"===t.type?void(i=t):void 0}),i?e(i):void altspace.getThreeJSTrackingSkeleton().then(function(n){return i=n,t.add(i),e(i)})})}function T(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length)return t.every(function(n,i){return T(t[i],e[i])});if(t instanceof Object&&e instanceof Object&&T(Object.keys(t).sort(),Object.keys(e).sort())){for(var n in t)if(!T(t[n],e[n]))return!1;return!0}return!1}function R(){fe.forEach(function(t){return t.autoSend()})}function x(t,e){var n=function(i,r){var o=altspace.getGamepads().find(function(e){return"steamvr"===e.mapping&&e.hand===t});o?(e.logging&&console.log("SteamVR input device found",o),i(o)):(e.logging&&console.log("SteamVR input device not found trying again in 500ms..."),setTimeout(n,500,i,r))};return new Promise(n)}t=t&&t.hasOwnProperty("default")?t["default"]:t,e=e&&e.hasOwnProperty("default")?e["default"]:e,n=n&&n.hasOwnProperty("default")?n["default"]:n;var L=function(){},I={schema:{}};I.schema.get=function(){return null},L.prototype.init=function(){},L.prototype.tick=function(t,e){},L.prototype.pause=function(){},L.prototype.play=function(){},Object.defineProperties(L.prototype,I);var M=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(t){},e.prototype.remove=function(){},e.prototype.updateSchema=function(t){},e}(L),D=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{enabled:{type:"boolean","default":!0}}},e.prototype.init=function(){var t=this;this.setColliderFlag(this.data.enabled),this.el.addEventListener("model-loaded",function(){t.setColliderFlag(t.data.enabled)}.bind(this))},e.prototype.update=function(){this.setColliderFlag(this.data.enabled)},e.prototype.setColliderFlag=function(t){var e=this.el.object3D;e&&(a(e.userData,["altspace","collider","enabled"],t),e.traverse(function(e){e instanceof THREE.Mesh&&a(e.userData,["altspace","collider","enabled"],t)}))},Object.defineProperties(e.prototype,n),e}(M),P=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(){this.gamepadIndex=null,this.trackedControlsSystem=document.querySelector("a-scene").systems["tracked-controls"],this.systemGamepads=0,altspace.getGamepads()},e.prototype.tick=function(){if(this.trackedControlsSystem&&this.systemGamepads!==this.trackedControlsSystem.controllers.length&&window.altspace&&altspace.getGamepads&&altspace.getGamepads().length){var t=this.el.components;t["paint-controls"]&&(this.gamepadIndex="left"===t["paint-controls"].data.hand?2:1),null===this.gamepadIndex&&t["hand-controls"]&&(this.gamepadIndex="left"===t["hand-controls"].data?2:1),null===this.gamepadIndex&&t["vive-controls"]&&(this.gamepadIndex="left"===t["vive-controls"].data.hand?2:1),null===this.gamepadIndex&&t["tracked-controls"]&&(this.gamepadIndex=t["tracked-controls"].data.controller),this.el.setAttribute("tracked-controls","id",altspace.getGamepads()[this.gamepadIndex].id),this.el.setAttribute("tracked-controls","controller",0),this.systemGamepads=this.trackedControlsSystem.controllers.length}},e}(M),U=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{usePixelScale:{type:"boolean","default":!1},verticalAlign:{type:"string","default":"middle"},enclosuresOnly:{type:"boolean","default":!0},fullspace:{type:"boolean","default":!1}}},e.prototype.init=function(){return this.version="AFRAME_ALTSPACE_VERSION",this.el.object3D instanceof THREE.Scene?void(window.altspace&&window.altspace.inClient?(this.el.setAttribute("vr-mode-ui",{enabled:!1}),this.initRenderer(),this.initCursorEvents(),this.initCollisionEvents()):console.warn("aframe-altspace-component only works inside of AltspaceVR")):void console.warn("aframe-altspace-component can only be attached to a-scene")},e.prototype.tick=function(t,e){this.el.object3D.updateAllBehaviors&&this.el.object3D.updateAllBehaviors()},e.prototype.initRenderer=function(){var t=this,e=this.el.object3D,n=this.el.sceneEl,i=n.getAttribute("scale")||{x:1,y:1,z:1};altspace.getEnclosure().then(function(n){switch(t.data.fullspace&&(n.fullspace&&a(e.userData,["altspace","initialized"],!0),n.requestFullspace(),n.addEventListener("fullspacechange",function(){e.scale.copy(i).multiplyScalar(n.pixelsPerMeter),a(e.userData,["altspace","initialized"],!0)})),(!t.data.usePixelScale||t.data.fullspace)&&e.scale.copy(i).multiplyScalar(n.pixelsPerMeter),t.data.verticalAlign){case"bottom":e.position.y-=n.innerHeight/2;break;case"top":e.position.y+=n.innerHeight/2;break;case"middle":break;default:console.warn("Unexpected value for verticalAlign: ",t.data.verticalAlign)}t.data.enclosuresOnly&&1===n.innerDepth&&(t.el.renderer.render(new THREE.Scene),t.el.renderer=t.el.effect=r),t.data.fullspace||a(e.userData,["altspace","initialized"],!0)}.bind(this));var r=this.el.renderer,o=this.el.renderer=this.el.effect=altspace.getThreeJSRenderer({aframeComponentVersion:this.version}),s=function(){};o.setSize=s,o.setPixelRatio=s,o.setClearColor=s,o.clear=s,o.enableScissorTest=s,o.setScissor=s,o.setViewport=s,o.getPixelRatio=s,o.getMaxAnisotropy=s,o.setFaceCulling=s,o.submitFrame=s,o.context={canvas:{}},o.shadowMap={},o.requestAnimationFrame=window.requestAnimationFrame},e.prototype.initCursorEvents=function(){function t(t,e){var i=e.target.el;n&&n.emit(t,{target:i,ray:e.ray,point:e.point}),i&&i.emit(t,{target:i,ray:e.ray,point:e.point})}var e=this.el.object3D,n=document.querySelector("a-cursor")||document.querySelector("a-entity[cursor]");n&&(n.setAttribute("material","transparent",!0),n.setAttribute("material","opacity",0));var i=null;e.addEventListener("cursordown",function(e){i=e.target,t("mousedown",e)}),e.addEventListener("cursorup",function(e){t("mouseup",e),e.target.uuid===i.uuid&&t("click",e),i=null}),e.addEventListener("cursorenter",function(e){e.target.el&&(e.target.el.addState("hovered"),n&&n.addState("hovering"),t("mouseenter",e))}),e.addEventListener("cursorleave",function(e){e.target.el&&(e.target.el.removeState("hovered"),n&&n.removeState("hovering"),t("mouseleave",e))})},e.prototype.initCollisionEvents=function(){function t(t,e){var n=e.target.el;n&&(e.target=n,e.other&&e.other.el&&(e.other=e.other.el),n.emit(t,e))}var e=this.el.object3D;e.addEventListener("collisionenter",function(e){t("collisionenter",e)}),e.addEventListener("collisionexit",function(e){t("collisionexit",e)}),e.addEventListener("triggerenter",function(e){t("triggerenter",e)}),e.addEventListener("triggerexit",function(e){t("triggerexit",e)})},Object.defineProperties(e.prototype,n),e}(M),N=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={dependencies:{}};return n.dependencies.get=function(){return["sync"]},e.prototype.init=function(){this.sync=this.el.components.sync,this.lastValue=null,this.sync.isConnected?start():this.el.addEventListener("connected",this.start.bind(this))},e.prototype.start=function(){var t=this,e=this.sync.dataRef.child("material/color"),n=!1,i=!0,r=this;this.el.addEventListener("componentchanged",function(i){var o=i.detail.name;if("material"===o){var a=r.el.getAttribute("material").color;!n&&t.lastValue!==a&&r.sync.isMine&&(r.lastValue=a,setTimeout(function(){return e.set(a)},0))}}),e.on("value",function(t){if(!r.sync.isMine||i){var e=t.val();n=!0,r.el.setAttribute("material","color",e),n=!1,i=!1}})},Object.defineProperties(e.prototype,n),e}(M),B=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{mode:{"default":"link"},ownOn:{type:"string"}}},e.prototype.init=function(){var t=this;if(this.isMine=!1,this.scene=this.el.sceneEl,this.syncSys=this.scene.systems["sync-system"],this.isConnected=!1,this.syncSys.isConnected?this.start():this.scene.addEventListener("connected",this.start.bind(this)),this.data.ownOn){var e=this.data.ownOn.split(/[ ,]+/);e.forEach(function(e){t.el.addEventListener(e,function(){t.isConnected&&t.takeOwnership()}.bind(t))}.bind(this))}},e.prototype.takeOwnership=function(){this.ownerRef.set(this.syncSys.clientId),this.ownerRef.onDisconnect().set(null)},e.prototype.start=function(){var t=this;if(this.scene.addEventListener("clientleft",function(e){var n=(!t.ownerId||t.ownerId===e.detail.id)&&t.syncSys.isMasterClient;n&&t.takeOwnership()}.bind(this)),"link"!==this.data.mode)return void console.error("Unsupported sync mode: "+this.data.mode);var e=this.el.id;return e?(this.link(this.syncSys.sceneRef.child(e)),this.setupReceive(),this.isConnected=!0,void this.el.emit("connected",null,!1)):void console.error("Entities cannot be synced using link mode without an id.")},e.prototype.link=function(t){this.ref=t,this.key=this.ref.key(),this.dataRef=this.ref.child("data"),this.ownerRef=this.ref.child("owner")},e.prototype.setupReceive=function(){function t(t){var e=t.val(),n=e===this.syncSys.clientId&&!this.isMine;n&&this.el.emit("ownershipgained",null,!1);var i=e!==this.syncSys.clientId;i&&(this.el.emit("ownershiplost",null,!1),this.ownerRef.onDisconnect().cancel()),this.ownerId=e,this.isMine=e===this.syncSys.clientId}var e=this;this.ownerRef.transaction(function(t){return t?void 0:e.syncSys.clientId}.bind(this),function(n,i){i&&e.ownerRef.onDisconnect().set(null),e.ownerRef.on("value",t.bind(e))}.bind(this))},Object.defineProperties(e.prototype,n),e}(M),H=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{author:{type:"string"},app:{type:"string"},instance:{type:"string"},refUrl:{type:"string"}}},e.prototype.init=function(){return this.data&&this.data.app?(console.log(this.data),this.clientId=this.sceneEl.object3D.uuid,this.masterClientId=null,this.queuedInstantiations=[],this.isConnected=!1,void Promise.all([altspace.utilities.sync.connect({authorId:this.data.author,appId:this.data.app,instanceId:this.data.instance, +baseRefUrl:this.data.refUrl}),altspace.getUser()]).then(this.connected.bind(this))):void console.warn("The sync-system must be present on the scene and configured with required data.")},e.prototype.connected=function(t){this.connection=t.shift(),this.userInfo=t.shift(),this.sceneRef=this.connection.instance.child("scene"),this.clientsRef=this.connection.instance.child("clients"),this.instantiatedElementsRef=this.connection.instance.child("instantiatedElements"),this.instantiatedElementsRef.on("child_added",this.listenToInstantiationGroup.bind(this)),this.instantiatedElementsRef.on("child_removed",this.stopListeningToInstantiationGroup.bind(this));var e=this;this.clientsRef.on("value",function(t){var n=t.val(),i=Object.keys(n)[0];e.masterClientId=n[i]}),this.clientsRef.on("child_added",function(t){var n=t.val();setTimeout(function(){e.sceneEl.emit("clientjoined",{id:n},!1)},0)}),this.clientsRef.on("child_removed",function(t){var n=t.val();setTimeout(function(){e.sceneEl.emit("clientleft",{id:n},!1)},0)}),this.clientsRef.push(this.clientId).onDisconnect().remove(),this.connection.instance.child("initialized").once("value",function(t){var n=!t.val();t.ref().set(!0),e.processQueuedInstantiations(),e.sceneEl.emit("connected",{shouldInitialize:n},!1),e.isConnected=!0})},e.prototype.isMasterClient=function(){return this.masterClientId===this.clientId},e.prototype.listenToInstantiationGroup=function(t){t.ref().on("child_added",this.createElement.bind(this)),t.ref().on("child_removed",this.removeElement.bind(this))},e.prototype.stopListeningToInstantiationGroup=function(t){t.ref().off("child_added"),t.ref().off("child_removed")},e.prototype.processQueuedInstantiations=function(){var t=this;this.queuedInstantiations.forEach(function(e){e.creatorUserId=t.userInfo.userId,e.clientId=t.clientId,t.instantiatedElementsRef.child(e.groupName).push(e).onDisconnect().remove()}.bind(this)),this.queuedInstantiations.length=0},e.prototype.instantiate=function(t,e,n,i,r){if(!t)return void console.error("AltspaceVR: Instantiation requires a mixin value.",n);var o=e&&e.id,a="A-SCENE"===e.nodeName;if(!o&&!a)return void console.error("AltspaceVR: Instantiation requires a parent with an id.",n);var s=o?"#"+e.id:"a-scene",c={instantiatorId:r||"",groupName:i||"main",mixin:t,parent:s};this.queuedInstantiations.push(c),this.isConnected&&this.processQueuedInstantiations()},e.prototype.removeLast=function(t){var e=this;return new Promise(function(n){e.instantiatedElementsRef.child(t).orderByKey().limitToLast(1).once("value",function(t){if(!t.hasChildren())return void n();var e=t.val(),i=Object.keys(e)[0];n(e[i].instantiatorId),t.ref().child(i).remove()})}.bind(this))},e.prototype.createElement=function(t){var e=t.val(),n=t.key(),i=document.createElement("a-entity");i.id=e.groupName+"-instance-"+n,document.querySelector(e.parent).appendChild(i),i.setAttribute("mixin",e.mixin),i.dataset.creatorUserId=e.creatorUserId,this.userInfo.userId===e.creatorUserId&&i.classList.add("mine")},e.prototype.removeElement=function(t){var e=t.val(),n=t.key(),i=e.groupName+"-instance-"+n,r=document.querySelector("#"+i);r.parentNode.removeChild(r)},Object.defineProperties(e.prototype,n),e}(L),q=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={dependencies:{}};return n.dependencies.get=function(){return["sync"]},e.prototype.init=function(){this.sync=this.el.components.sync,this.sync.isConnected?start():this.el.addEventListener("connected",this.start.bind(this))},e.prototype.start=function(){function t(t,e){if(!n.isMine){var r=t.val();r&&i.el.setAttribute(e,r)}}function e(t){if(n.isMine){var e=t.detail.name,r=i.el.getAttribute(e);"position"===e?u(r):"rotation"===e?h(r):"scale"===e&&l(r)}}var n=this.sync,i=this,r=n.dataRef.child("position"),o=n.dataRef.child("rotation"),a=n.dataRef.child("scale");i.updateRate=100;var c=[];i.el.addEventListener("ownershiplost",function(){Array.from(i.el.children).forEach(function(t){var e=t.tagName.toLowerCase();"a-animation"===e&&(c.push(t),t.stop())})}),i.el.addEventListener("ownershipgained",function(){c.forEach(function(t){return t.start()}),c=[]}),r.on("value",function(e){return t(e,"position")}),o.on("value",function(e){return t(e,"rotation")}),a.on("value",function(e){return t(e,"scale")});var u=s(function(t){r.set(t)},i.updateRate),h=s(function(t){o.set(t)},i.updateRate),l=s(function(t){a.set(t)},i.updateRate);i.el.addEventListener("componentchanged",e)},Object.defineProperties(e.prototype,n),e}(M),W=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={dependencies:{}};return n.dependencies.get=function(){return["sync"]},e.prototype.init=function(){this.sync=this.el.components.sync,this.scene=this.el.sceneEl,this.syncSys=this.scene.systems["sync-system"],this.soundStateRef=null,this.soundEventRef=null,this.sync.isConnected?this.start():this.el.addEventListener("connected",this.start.bind(this))},e.prototype.remove=function(){this.soundStateRef.off("value"),this.soundEventRef.off("value")},e.prototype.start=function(){function t(t){if(this.sync.isMine){var t={type:t.type,sender:this.syncSys.clientId,el:this.el.id,time:Firebase.ServerValue.TIMESTAMP};this.soundEventRef.set(t)}}var e=this;this.soundStateRef=this.sync.dataRef.child("sound/state"),this.soundEventRef=this.sync.dataRef.child("sound/event"),this.el.addEventListener("sound-played",t.bind(this)),this.el.addEventListener("sound-paused",t.bind(this)),this.soundEventRef.once("value",function(t){var n=t.val();e.soundEventRef.on("value",function(t){var i=t.val();if(!(!i||n&&i.time===n.time||e.sync.isMine)&&i.el===e.el.id){var r=e.el.components["n-sound"];"sound-played"===i.type?r.playSound():r.pauseSound()}})}),this.el.addEventListener("componentchanged",function(t){if(e.sync.isMine){var n=t.detail.name;"n-sound"===n&&e.soundStateRef.set(e.el.getAttribute(n))}}),this.soundStateRef.on("value",function(t){if(!e.sync.isMine){var n=t.val();n&&e.el.setAttribute("n-sound",n)}})},Object.defineProperties(e.prototype,n),e}(M),V=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={dependencies:{}};return n.dependencies.get=function(){return["sync"]},e.prototype.init=function(){var t=this.el.sceneEl;this.syncSys=t.systems["sync-system"],this.sync=this.el.components.sync,this.syncSys.isConnected?this._start():t.addEventListener("connected",this._start.bind(this))},e.prototype.getDataRef=function(t){return this.sync.dataRef.child("n-skeleton-parent/"+t)},e.prototype._start=function(){this.attributeRef=this.sync.dataRef.child("n-skeleton-parent"),this.attributeRef.on("value",function(t){var e=t.val();e&&this.el.setAttribute("n-skeleton-parent",e)}.bind(this)),this.el.dataset.creatorUserId&&this.attributeRef.set(Object.assign({},this.el.components["n-skeleton-parent"].data,{userId:this.el.dataset.creatorUserId})),this.el.addEventListener("componentchanged",function(t){if(this.sync.isMine){var e=t.detail.name;"n-skeleton-parent"===e&&this.attributeRef.set(this.el.getAttribute(e))}}.bind(this))},Object.defineProperties(e.prototype,n),e}(M),G=function(t){function e(){t.call(this),this.multiple=!0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{on:{type:"string"},emit:{type:"string"},gained:{type:"string"},lost:{type:"string"},gain:{type:"string"},lose:{type:"string"},targets:{type:"selectorAll"},target:{type:"selector"}}},e.prototype.init=function(){this.actOnTargets=function(){function t(t){this.data.emit&&t.emit(this.data.emit),this.data.gain&&t.addState(this.data.gain),this.data.lose&&t.removeState(this.data.lose)}this.updateProperties(this.attrValue),this.data.targets&&this.data.targets.forEach(t.bind(this)),this.data.target&&t.call(this,this.data.target),this.data.targets||this.data.target||t.call(this,this.el)}.bind(this),this.actOnTargetsIfStateMatches=function(t){var e=t.detail.state;(e===this.data.gained||e===this.data.lost)&&this.actOnTargets()}.bind(this)},e.prototype.update=function(t){t.on&&this.el.removeEventListener(t.on,this.actOnTargets),t.gained&&this.el.removeEventListener("stateadded",this.actOnTargetsIfStateMatches),t.lost&&this.el.removeEventListener("stateremoved",this.actOnTargetsIfStateMatches),this.data.on&&this.el.addEventListener(this.data.on,this.actOnTargets),this.data.gained&&this.el.addEventListener("stateadded",this.actOnTargetsIfStateMatches),this.data.lost&&this.el.addEventListener("stateremoved",this.actOnTargetsIfStateMatches)},e.prototype.remove=function(){this.el.removeEventListener(this.data.on,this.actOnTargets),this.el.removeEventListener("stateadded",this.actOnTargetsIfStateMatches),this.el.removeEventListener("stateremoved",this.actOnTargetsIfStateMatches)},Object.defineProperties(e.prototype,n),e}(M),K=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{mixin:{type:"string"},parent:{type:"selector"}}},e.prototype.init=function(){var t=this.el.sceneEl;this.syncSys=t.systems["sync-system"],this.syncSys.instantiate(this.data.mixin,this.data.parent||this.el.parentNode,this.el)},Object.defineProperties(e.prototype,n),e}(M),Q=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{on:{type:"string"},mixin:{type:"string"},parent:{type:"selector","default":"a-scene"},group:{type:"string","default":"main"},removeLast:{type:"boolean","default":!0}}},e.prototype.init=function(){this.onHandler=this.instantiateOrToggle.bind(this),this.el.addEventListener(this.data.on,this.onHandler),this.syncSys=this.el.sceneEl.systems["sync-system"]},e.prototype.instantiateOrToggle=function(){var t=this.data.group+"-"+this.syncSys.userInfo.userId;this.data.removeLast?this.syncSys.removeLast(t).then(function(e){e!==this.el.id&&this.syncSys.instantiate(this.data.mixin,this.data.parent,this.el,t,this.el.id)}.bind(this)):this.syncSys.instantiate(this.el.id,t,this.data.mixin,this.data.parent)},e.prototype.remove=function(){this.el.removeEventListener(this.data.on,this.onHandler)},Object.defineProperties(e.prototype,n),e}(M);if(!window.altspace||!altspace.inClient){var z=function(){};a(window,["altspace","addNativeComponent"],z),a(window,["altspace","updateNativeComponent"],z),a(window,["altspace","removeNativeComponent"],z)}var Y=new THREE.BoxGeometry(.001,.001,.001),X=new THREE.MeshBasicMaterial({color:0});X.visible=!1;var J=function(t){function e(){t.call(this,Y,X)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(THREE.Mesh),$=function(t){function e(e,n){void 0===n&&(n=!0),t.call(this),Object.assign(this,{name:e,sendUpdates:n})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(){var t=this,e=this.mesh||this.el.getOrCreateObject3D("mesh",J);this.currentMesh=e,a(e.userData,["altspace","collider","enabled"],!1),altspace.addNativeComponent(e,this.name),this.update(),this.mesh||this._dontRebind||this.el.addEventListener("object3dset",function(e){"mesh"===e.detail.type&&(altspace.removeNativeComponent(t.currentMesh,t.name),t._dontRebind=!0,t.init())}.bind(this))},e.prototype.update=function(){var t=this.mesh||this.el.object3DMap.mesh;this.sendUpdates&&altspace.updateNativeComponent(t,this.name,this.data)},e.prototype.remove=function(){var t=this.mesh||this.el.object3DMap.mesh;altspace.removeNativeComponent(t,this.name)},e.prototype.callComponent=function(t){for(var e=[],n=arguments.length-1;n-->0;)e[n]=arguments[n+1];var i=this.mesh||this.el.object3DMap.mesh;altspace.callNativeComponent(i,this.name,t,e)},e}(M),Z=function(t){function e(){t.call(this,"n-object")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{res:{type:"string"}}},Object.defineProperties(e.prototype,n),e}($),tt=function(t){function e(){t.call(this,"n-spawner")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{res:{type:"string"}}},Object.defineProperties(e.prototype,n),e}($),et=function(t){function e(){t.call(this,"n-billboard",!1)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}($),nt=function(t){function e(){t.call(this,"n-skeleton-parent")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{part:{type:"string"},side:{type:"string","default":"center"},index:{type:"int","default":0},userId:{type:"string"}}},Object.defineProperties(e.prototype,n),e}($),it=function(t){function e(){t.call(this,"n-cockpit-parent",!1)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}($),rt=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{center:{type:"vec3"},type:{type:"string","default":"object"},isTrigger:{"default":!1,type:"boolean"}}},Object.defineProperties(e.prototype,n),e}($),ot=function(t){function e(){t.call(this,"n-sphere-collider")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{radius:{"default":1,type:"number"}}},Object.defineProperties(e.prototype,n),e}(rt),at=function(t){function e(){t.call(this,"n-box-collider")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{size:{type:"vec3","default":{x:1,y:1,z:1}}}},Object.defineProperties(e.prototype,n),e}(rt),st=function(t){function e(){t.call(this,"n-capsule-collider")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{radius:{"default":0,type:"number"},height:{"default":0,type:"number"},direction:{"default":"y"}}},Object.defineProperties(e.prototype,n),e}(rt),ct=function(t){function e(e,n){void 0===e&&(e=null),t.call(this,"n-mesh-collider"),this.mesh=e,this.subcomponents=[]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{convex:{type:"boolean","default":!0}}},e.prototype.init=function(){var n=this;if(this.mesh)t.prototype.init.call(this);else{this.subcomponents=[];var i=this.el.object3D;i.traverse(function(t){if(t instanceof THREE.Mesh){var i=new e(t);n.subcomponents.push(i),i.data=n.data,i.init()}}.bind(this)),this.el.addEventListener("model-loaded",this.init.bind(this))}},e.prototype.update=function(e){var n=this;this.mesh?t.prototype.update.call(this,e):this.subcomponents.forEach(function(t){t.data=n.data,t.update(e)}.bind(this))},e.prototype.remove=function(){this.mesh?t.prototype.remove.call(this):this.subcomponents.forEach(function(t){t.remove()}.bind(this))},Object.defineProperties(e.prototype,n),e}(rt),ut=function(t){function e(){t.call(this,"n-container")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{capacity:{"default":4,type:"number"}}},e.prototype.init=function(){t.prototype.init.call(this);var e=this.el,n=this;e.addEventListener("stateadded",function(t){"container-full"===t.detail.state&&e.emit("container-full"),"container-empty"===t.detail.state&&e.emit("container-empty")}),e.addEventListener("container-count-changed",function(t){n.count=t.detail.count})},Object.defineProperties(e.prototype,n),e}($),ht=function(t){function e(){t.call(this,"n-portal")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{targetSpace:{type:"string"},targetEvent:{type:"string"},targetEntity:{type:"selector"}}},e.prototype.update=function(){var t,e,n=this.el.object3DMap.mesh;if(this.data.targetEntity){this.el.sceneEl.object3D.updateMatrixWorld(!0),t=this.data.targetEntity.object3D.getWorldPosition();var i=this.data.targetEntity.object3D.getWorldQuaternion();e={x:i.x,y:i.y,z:i.z,w:i.w}}var r={targetSpace:this.data.targetSpace,targetEvent:this.data.targetEvent,targetPosition:t,targetQuaternion:e};altspace.updateNativeComponent(n,this.name,r)},Object.defineProperties(e.prototype,n),e}($);!function(){String.prototype.codePointAt||!function(){var t=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),e=function(t){if(null==this)throw TypeError();var e=this+"",n=e.length,i=t?+t:0;if(i!=i&&(i=0),!(0>i||i>=n)){var r,o=e.charCodeAt(i);return o>=55296&&56319>=o&&n>i+1&&(r=e.charCodeAt(i+1),r>=56320&&57343>=r)?1024*(o-55296)+r-56320+65536:o}};t?t(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e}(),String.prototype.repeat||!function(){var t=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),e=function(t){if(null==this)throw TypeError();var e=this+"",n=t?+t:0;if(n!=n&&(n=0),0>n||n==1/0)throw RangeError();for(var i="";n;)n%2==1&&(i+=e),n>1&&(e+=e),n>>=1;return i};t?t(String.prototype,"repeat",{value:e,configurable:!0,writable:!0}):String.prototype.repeat=e}(),String.prototype.includes||!function(){var t={}.toString,e=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),n="".indexOf,i=function(e){if(null==this)throw TypeError();var i=this+"";if(e&&"[object RegExp]"==t.call(e))throw TypeError();var r=i.length,o=e+"",a=o.length,s=arguments.length>1?arguments[1]:void 0,c=s?+s:0;return c!=c&&(c=0),!(a+Math.min(Math.max(c,0),r)>r)&&-1!=n.call(i,o,c)};e?e(String.prototype,"includes",{value:i,configurable:!0,writable:!0}):String.prototype.includes=i}(),String.prototype.startsWith||!function(){var t=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),e={}.toString,n=function(t){if(null==this)throw TypeError();var n=this+"";if(t&&"[object RegExp]"==e.call(t))throw TypeError();var i=n.length,r=t+"",o=r.length,a=arguments.length>1?arguments[1]:void 0,s=a?+a:0;s!=s&&(s=0);var c=Math.min(Math.max(s,0),i);if(o+c>i)return!1;for(var u=-1;++u1){var s=arguments[1];void 0!==s&&(a=s?+s:0,a!=a&&(a=0))}var c=Math.min(Math.max(a,0),i),u=c-o;if(0>u)return!1;for(var h=-1;++hl||l>1114111||n(l)!=l)throw RangeError("Invalid code point: "+l);65535>=l?s.push(l):(l-=65536,i=(l>>10)+55296,r=l%1024+56320,s.push(i,r)),(c+1==u||s.length>a)&&(h+=e.apply(null,s),s.length=0)}return h};t?t(String,"fromCodePoint",{value:i,configurable:!0,writable:!0}):String.fromCodePoint=i}(),Object.defineProperty(String,"raw",{configurable:!0,enumerable:!1,writable:!0,value:function(t,e){var n;t=null!=t?t:{},e=arguments.length>1?i(arguments).slice(1):[];try{n=i(t.raw)}catch(i){throw new TypeError("Cannot convert undefined or null to object")}return n.map(function(n,i){return t.raw.length<=i?n:null!=e[i-1]?e[i-1]+n:n}).join("")}})}();var lt=function(t){function e(){t.call(this,"n-sound")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{res:{type:"string"},src:{type:"string"},on:{type:"string"},loop:{type:"boolean"},volume:{type:"number","default":1},autoplay:{type:"boolean"},oneshot:{type:"boolean"},spatialBlend:{type:"float","default":1},pitch:{type:"float","default":1},minDistance:{type:"float","default":1},maxDistance:{type:"float","default":12},rolloff:{type:"string","default":"logarithmic"}}},e.prototype.init=function(){var e=this.data.src;if(e&&!e.startsWith("http"))if(e.startsWith("/"))this.data.src=location.origin+e;else{var n=location.pathname;n.endsWith("/")||(n=location.pathname.split("/").slice(0,-1).join("/")+"/"),this.data.src=location.origin+n+e}t.prototype.init.call(this)},e.prototype.update=function(e){t.prototype.update.call(this,e),this.playHandler&&this.el.removeEventListener(e.on,this.playHandler),this.data.on&&(this.playHandler=this.playSound.bind(this),this.el.addEventListener(this.data.on,this.playHandler))},e.prototype.remove=function(){t.prototype.remove.call(this),this.playHandler&&this.el.removeEventListener(this.data.on,this.playHandler)},e.prototype.pauseSound=function(){this.callComponent("pause"),this.el.emit("sound-paused")},e.prototype.playSound=function(){this.callComponent("play"),this.el.emit("sound-played")},e.prototype.seek=function(t){this.callComponent("seek",{time:t})},Object.defineProperties(e.prototype,n),e}($),ft=function(t){function e(){t.call(this,"n-layout-browser")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{url:{"default":"about:blank"},isEnclosure:{"default":!1}}},Object.defineProperties(e.prototype,n),e}($),pt=function(t){function e(){t.call(this,"n-text")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{text:{"default":"",type:"string"},fontSize:{"default":10,type:"int"},width:{"default":10,type:"number"},height:{"default":1,type:"number"},horizontalAlign:{"default":"middle"},verticalAlign:{"default":"middle"}}},Object.defineProperties(e.prototype,n),e}($),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.init=function(){function t(e){return e.isMesh?e:0===e.children.length?null:e.children.reduce(function(e,n){return e||t(n)},null)}var e=this;this.el.addEventListener("model-loaded",function(){e.el.setObject3D("mesh",t(e.el.object3DMap.mesh))})},e}(M);window.AFRAME&&delete AFRAME.components.visible;var gt=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={schema:{}};return n.schema.get=function(){return{"default":!0}},e.prototype.init=function(){this.el.addEventListener("model-loaded",this.update.bind(this))},e.prototype.update=function(){var t=this;this.el.object3D.traverse(function(e){return e.visible=t.data})},Object.defineProperties(e.prototype,n),e}(M);window.AFRAME&&(r("altspace-cursor-collider",D),r("altspace-tracked-controls",P),r("altspace",U),o("sync-system",H),r("sync-color",N),r("sync-transform",q),r("sync",B),r("sync-n-sound",W),r("sync-n-skeleton-parent",V),r("wire",G),r("one-per-user",K),r("instantiator",Q),r("n-object",Z),r("n-portal",ht),r("n-spawner",tt),r("n-text",pt),r("n-billboard",et),r("n-skeleton-parent",nt),r("n-cockpit-parent",it),r("n-container",ut),r("n-sound",lt),r("n-sphere-collider",ot),r("n-box-collider",at),r("n-capsule-collider",st),r("n-mesh-collider",ct),r("n-layout-browser",ft),r("collapse-model",dt),r("visible",gt));var bt,yt,vt,mt,wt=Object.freeze({AltspaceComponent:U,AltspaceCursorCollider:D,AltspaceTrackedControls:P,SyncSystem:H,SyncComponent:B,SyncColor:N,SyncTransform:q,SyncNSound:W,Wire:G,OnePerUser:K,Instantiator:Q,SyncNSkeletonParent:V,NObject:Z,NPortal:ht,NSpawner:tt,NText:pt,NBillboard:et,NSkeletonParent:nt,NCockpitParent:it,NContainer:ut,NSound:lt,NSphereCollider:ot,NBoxCollider:at,NCapsuleCollider:st,NMeshCollider:ct,NLayoutBrowser:ft,CollapseModel:dt}),Et=altspace&&altspace.inClient,_t=u(),jt=Object.freeze({connect:l}),St=new THREE.Raycaster,Ft=Object.freeze({init:f}),At=function(t){void 0===t&&(t={auto:!0}),this._scene=null,this._renderer=null,this._camera=null;var e=window.AFRAME&&document.querySelector("a-scene");if(e){var n=document.querySelector("a-scene");this._scene=n.object3D,this._renderer=n.renderer;var i=document.querySelector("a-camera");i&&(this._camera=i.object3D)}else window.altspace&&altspace.inClient?(this._scene=new THREE.Scene,this._renderer=altspace.getThreeJSRenderer(),this._camera=new THREE.PerspectiveCamera):this._setupWebGL();t.auto&&!e&&this.loop()},Ot={scene:{},renderer:{},camera:{}};At.prototype._setupWebGL=function(){function t(){i.aspect=window.innerWidth/window.innerHeight,i.updateProjectionMatrix(),n.setSize(window.innerWidth,window.innerHeight)}var e=this._scene=new THREE.Scene,n=this._renderer=new THREE.WebGLRenderer({antialias:!0}),i=this._camera=new THREE.PerspectiveCamera;document.addEventListener("DOMContentLoaded",function(t){document.body.style.margin="0px",document.body.style.overflow="hidden",n.setClearColor("#035F72");var e=document.createElement("div");document.body.appendChild(e),e.appendChild(n.domElement)}),window.addEventListener("resize",t),t(),i.position.z=500,i.fov=45,i.near=1,i.far=2e3,e.add(i),e.add(new THREE.AmbientLight("white")),this.cursor=f(e,i)},At.prototype.loop=function(){window.requestAnimationFrame(this.loop.bind(this)),this.scene.updateAllBehaviors&&this.scene.updateAllBehaviors(),this.renderer.render(this.scene,this.camera)},Ot.scene.get=function(){return this._scene},Ot.renderer.get=function(){return this._renderer},Ot.camera.get=function(){return this._camera},Object.defineProperties(At.prototype,Ot);var Ct,kt,Tt="",Rt="",xt=function(){this.objUrls=[],this.mtlUrls=[],this.objects=[],this.error=null,this.objectsLoaded=0},Lt=Object.freeze({init:v,load:m,LoadRequest:xt}),It="VR CodePen",Mt=window.name&&"pen-"===window.name.slice(0,4),Dt=!!window.altspace.inClient,Pt=!!location.href.match("codepen.io/"),Ut=Object.freeze({inTile:Mt,inVR:Dt,inCodePen:Pt,ensureInVR:_,setName:j,getPenId:F,getAuthorId:A,printDebugInfo:E}),Nt=function(){};Nt.prototype.load=function(t,e,n){var i=new THREE.MTLLoader,r=e.split("/").slice(0,-1).join("/");i.setTexturePath(r+"/"),i.setCrossOrigin(this.crossOrigin),i.load(e,function(e){var i=new THREE.OBJLoader;i.setMaterials(e),i.load(t,n)})},THREE&&!altspace.inClient&&(THREE.EventDispatcher.prototype.dispatchEvent=O,THREE.Object3D.prototype.dispatchEvent=O),THREE.Scene.prototype.updateAllBehaviors=function(){var t=performance.now(),e=this.__lastNow||t,n=t-e,i=this,r=[];this.traverse(function(t){t.__behaviorList&&r.push(t)});for(var o=0,a=r.length;a>o;o++){var s=r[o];s.updateBehaviors(n,i)}this.__lastNow=t},THREE.Object3D.prototype.addBehavior=function(t){this.addBehaviors(t)},THREE.Object3D.prototype.addBehaviors=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];this.__behaviorList=this.__behaviorList||[],(n=this.__behaviorList).push.apply(n,t);var n},THREE.Object3D.prototype.removeBehavior=function(t){if(!this.__behaviorList||0===this.__behaviorList.length)return null;var e=this.__behaviorList.indexOf(t);if(-1!==e){this.__behaviorList.splice(e,1);try{t.dispose&&t.dispose.call(t,this)}catch(n){console.group(),(console.error||console.log).call(console,n.stack||n),console.log("[Behavior]"),console.log(t),console.log("[Object3D]"),console.log(this),console.groupEnd()}}},THREE.Object3D.prototype.removeAllBehaviors=function(){var t=this;if(!this.__behaviorList||0===this.__behaviorList.length)return null;for(var e=0,n=this.__behaviorList.length;n>e;e++){var i=t.__behaviorList[e];try{i.dispose&&i.dispose.call(i,t)}catch(r){console.group(),(console.error||console.log).call(console,r.stack||r),console.log("[Behavior]"),console.log(i),console.log("[Object3D]"),console.log(t),console.groupEnd()}}this.__behaviorList.length=0},THREE.Object3D.prototype.getBehaviorByType=function(t){var e=this;if(!this.__behaviorList||0===this.__behaviorList.length)return null;for(var n=0,i=this.__behaviorList.length;i>n;n++)if(e.__behaviorList[n].type===t)return e.__behaviorList[n]},THREE.Object3D.prototype.updateBehaviors=function(t,e){var n=this;if(this.__behaviorList&&0!==this.__behaviorList.length){for(var i=[],r=this.__behaviorList.slice(),o=0,a=this.__behaviorList.length;a>o;o++){var s=n.__behaviorList[o];s.__isInitialized||i.push(s)}for(var o=0,a=i.length;a>o;o++){var s=i[o];try{s.awake&&s.awake.call(s,n,e)}catch(c){console.group(),(console.error||console.log).call(console,c.stack||c),console.log("[Behavior]"),console.log(s),console.log("[Object3D]"),console.log(n),console.groupEnd()}}for(var o=0,a=i.length;a>o;o++){var s=i[o];try{s.start&&s.start.call(s)}catch(c){console.group(),(console.error||console.log).call(console,c.stack||c),console.log("[Behavior]"),console.log(s),console.log("[Object3D]"),console.log(n),console.groupEnd()}s.__isInitialized=!0}for(var o=0,a=r.length;a>o;o++){var s=r[o];try{s.update&&s.update.call(s,t)}catch(c){console.group(),(console.error||console.log).call(console,c.stack||c),console.log("[Behavior]"),console.log(s),console.log("[Object3D]"),console.log(n),console.groupEnd()}}}};var Bt=Object.freeze({OBJMTLLoader:Nt,cursor:Ft}),Ht=function(){},qt={type:{}};qt.type.get=function(){return this._typeWarning||(console.warn("Behavior",this,"does not expose type information!","It will not be queryable by getBehaviorByType, which will break","some built-in behaviors."),this._typeWarning=!0),null},Ht.prototype.awake=function(t,e){},Ht.prototype.start=function(){},Ht.prototype.update=function(t){},Ht.prototype.dispose=function(t){},Object.defineProperties(Ht.prototype,qt);var Wt=function(t){function e(e){t.call(this),this.config=Object.assign({x:3,y:5,shouldRotate:!0,shouldMove:!0},e),this.object3d=null,this.offsetPosition=null,this.lastBobPosition=new THREE.Vector3,this.nowOffset=1e4*Math.random()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"Bob"},e.prototype.awake=function(t){this.object3d=t,this.offsetPosition=this.object3d.position.clone()},e.prototype.update=function(t){var e=Math.floor(performance.now())+this.nowOffset;this.config.shouldMove&&(this.lastBobPosition.equals(this.object3d.position)||this.offsetPosition.copy(this.object3d.position),this.object3d.position.y=this.offsetPosition.y+Math.sin(e/800)*this.config.x,this.object3d.position.x=this.offsetPosition.x+Math.sin(e/500)*this.config.y,this.lastBobPosition.copy(this.object3d.position)),this.config.shouldRotate&&(this.object3d.rotation.x=Math.sin(e/500)/15)},Object.defineProperties(e.prototype,n),e}(Ht),Vt=function(t){function e(e){t.call(this),this.config=Object.assign({overBrightness:1.5,downBrightness:.5},e),this.object3d=null,this.scene=null,this.originalColor=null,this.modifiedColor=new THREE.Color,this._cbs={cursorenter:this.cursorEnter.bind(this),cursordown:this.cursorDown.bind(this),cursorup:this.cursorUp.bind(this),cursorleave:this.cursorLeave.bind(this)}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"ButtonStateStyle"},e.prototype.awake=function(t,e){this.object3d=t,this.scene=e,this.originalColor=this.config.originalColor||this.object3d.material.color, +this.object3d.addEventListener("cursorenter",this._cbs.cursorenter),this.object3d.addEventListener("cursordown",this._cbs.cursordown)},e.prototype.dispose=function(){this.object3d.removeEventListener("cursorenter",this._cbs.cursorenter),this.object3d.removeEventListener("cursorleave",this._cbs.cursorleave),this.object3d.removeEventListener("cursorup",this._cbs.cursorup),this.object3d.removeEventListener("cursordown",this._cbs.cursordown)},e.prototype.changeBrightness=function(t){this.modifiedColor.set(this.originalColor),this.modifiedColor.multiplyScalar(t),this.modifiedColor.r=THREE.Math.clamp(this.modifiedColor.r,0,1),this.modifiedColor.g=THREE.Math.clamp(this.modifiedColor.g,0,1),this.modifiedColor.b=THREE.Math.clamp(this.modifiedColor.b,0,1),this.object3d.material.color=this.modifiedColor},e.prototype.cursorLeave=function(){this.object3d.removeEventListener("cursorleave",this._cbs.cursorleave),this.changeBrightness(1)},e.prototype.cursorEnter=function(){this.changeBrightness(this.config.overBrightness),this.object3d.addEventListener("cursorleave",this._cbs.cursorleave)},e.prototype.cursorUp=function(t){this.scene.removeEventListener("cursorup",this._cbs.cursorup),this.object3d.addEventListener("cursorenter",this._cbs.cursorenter),t.target===this.object3d?(this.changeBrightness(this.config.overBrightness),this.object3d.addEventListener("cursorleave",this._cbs.cursorleave)):this.changeBrightness(1)},e.prototype.cursorDown=function(){this.scene.addEventListener("cursorup",this._cbs.cursorup),this.object3d.removeEventListener("cursorleave",this._cbs.cursorleave),this.object3d.removeEventListener("cursorenter",this._cbs.cursorenter),this.changeBrightness(this.config.downBrightness)},Object.defineProperties(e.prototype,n),e}(Ht),Gt=function(t){function e(e){t.call(this),this.config=e=Object.assign({space:"world",x:!1,y:!1,z:!1,cursorSnap:!0},e),this.min=new THREE.Vector3(void 0!==e.x.min?e.x.min:Number.NEGATIVE_INFINITY,void 0!==e.y.min?e.y.min:Number.NEGATIVE_INFINITY,void 0!==e.z.min?e.z.min:Number.NEGATIVE_INFINITY),this.max=new THREE.Vector3(void 0!==e.x.max?e.x.max:Number.POSITIVE_INFINITY,void 0!==e.y.max?e.y.max:Number.POSITIVE_INFINITY,void 0!==e.z.max?e.z.max:Number.POSITIVE_INFINITY),this.object3d=null,this.scene=null,this.sync=null,this.intersector=null,this.dragOffset=new THREE.Vector3,this.raycaster=new THREE.Raycaster,this.raycaster.linePrecision=3,this._cbs={startDrag:this.startDrag.bind(this),moveDrag:this.moveDrag.bind(this),stopDrag:this.stopDrag.bind(this)}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"Drag"},e.prototype.awake=function(t,e){this.object3d=t,this.scene=e,this.sync=t.getBehaviorByType("Object3DSync"),this.makeIntersector(),this.scene.add(this.intersector)},e.prototype.start=function(){this.object3d.addEventListener("cursordown",this._cbs.startDrag)},e.prototype.dispose=function(){this.object3d.removeEventListener("cursordown",this._cbs.startDrag)},e.prototype.makeIntersector=function(){function t(){r.rotateY(Math.PI)}function e(){r.rotateX(Math.PI/2)}function n(){r.rotateY(Math.PI/2)}var i=1e4,r=new THREE.PlaneGeometry(i,i),o=!!this.config.x,a=!!this.config.y,s=!!this.config.z,c=o+a+s;if(3===c)throw new Error("Arbitrary dragging currently unsupported. Please lock at least one axis.");if(2!==c)throw 1===c?new Error("Single axis dragging currently unsupported."):new Error("Invalid axis configuration");o&&a?t():o&&s?e():a&&s&&n();var u=new THREE.MeshBasicMaterial({color:"purple"});u.side=THREE.DoubleSide,this.intersector=new THREE.Mesh(r,u),this.intersector.visible=!1,this.intersector.material.visible=!1},e.prototype.startDrag=function(t){this.scene.addEventListener("cursorup",this._cbs.stopDrag),this.scene.addEventListener("cursormove",this._cbs.moveDrag),this.raycaster.set(t.ray.origin,t.ray.direction);var e=this.raycaster.intersectObject(this.object3d,!0)[0];if(e){var n=e.point.clone(),i=C(this.object3d).clone();this.dragOffset.copy(n).sub(i),this.intersector.position.copy(this.intersector.parent.worldToLocal(n)),this.intersector.quaternion.copy(this.object3d.parent.quaternion),this.intersector.updateMatrixWorld();var r=this.createDragEvent("dragstart");this.object3d.dispatchEvent(r)}},e.prototype.moveDrag=function(t){this.sync&&!this.sync.isMine&&this.sync.takeOwnership(),this.intersector.visible=!0,this.raycaster.set(t.ray.origin,t.ray.direction);var e=this.raycaster.intersectObject(this.intersector,!0)[0];if(this.intersector.visible=!1,e){var n=new THREE.Vector3;n.copy(e.point).sub(this.dragOffset);var i=this,r=C(this.object3d);["x","y","z"].filter(function(t){return!i.config[t]}).forEach(function(t){n[t]=r[t]}),n.clamp(this.min,this.max),this.object3d.parent.updateMatrixWorld();var o=this.object3d.parent.worldToLocal(n);this.object3d.position.set(this.config.x?o.x:this.object3d.position.x,this.config.y?o.y:this.object3d.position.y,this.config.z?o.z:this.object3d.position.z)}},e.prototype.stopDrag=function(){this.scene.removeEventListener("cursorup",this._cbs.stopDrag),this.scene.removeEventListener("cursormove",this._cbs.moveDrag);var t=this.createDragEvent("dragstop");this.object3d.dispatchEvent(t)},e.prototype.createDragEvent=function(t){return{type:t,bubbles:!0,target:this.object3d,ray:this.raycaster.ray.clone()}},Object.defineProperties(e.prototype,n),e}(Ht),Kt=.2,Qt=function(t){function e(e){t.call(this),this.config=Object.assign({position:!0,rotation:!0,scale:!0},e),this.object3d=null,this.gamepad=null,this.scene=null,this.sync=null,this.isAltModeR=!1,this.isAltModeL=!1,this.prevAltButtonR=!1,this.prevAltButtonL=!1,this.isInitialized=!1,this.originalObj=null}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"GamepadControls"},e.prototype.awake=function(t,e){var n=this;if(this.object3d=t,this.scene=e,this.sync=this.object3d.getBehaviorByType("Object3DSync"),this.originalObj=this.object3d.clone(),this.gamepad=this.getGamepad(),this.gamepad)console.log("Gamepad detected: "+this.gamepad.id);else var i=setInterval(function(){n.gamepad=n.getGamepad(),n.gamepad&&(console.log("Gamepad connected: "+n.gamepad.id),clearInterval(i))}.bind(this),500);this.scene.addEventListener("cursordown",function(t){n.gamepad&&!n.isInitialized&&(n.preventDefault(n.gamepad),n.isInitialized=!0)}.bind(this))},e.prototype.getGamepad=function(){var t=this,e=[];if(e=altspace&&altspace.inClient?altspace.getGamepads():navigator.getGamepads(),e.length>0)for(var n=0;nKt||Math.abs(r)>Kt;o&&!this.sync.isMine&&this.sync.takeOwnership();var a=200*(t/1e3);Math.abs(i)>Kt&&(this.object3d.position.x+=a*i),Math.abs(r)>Kt&&(this.isAltModeL?this.object3d.position.y+=a*-r:this.object3d.position.z+=a*r)}if(this.config.rotation){var s=this.gamepad.buttons[11].pressed;this.prevAltButtonR&&!s&&(this.isAltModeR=!this.isAltModeR),this.prevAltButtonR=s;var c=this.gamepad.axes[2],u=this.gamepad.axes[3],h=Math.abs(c)>Kt||Math.abs(u)>Kt;h&&!this.sync.isMine&&this.sync.takeOwnership();var l=Math.PI*(t/1e3);!this.isAltModeR&&Math.abs(u)>Kt&&(this.object3d.rotation.x+=l*u),Math.abs(c)>Kt&&(this.isAltModeR?this.object3d.rotation.z+=l*-c:this.object3d.rotation.y+=l*c)}if(this.config.scale){var f=10*(t/1e3),p=this.gamepad.buttons[12].pressed,d=this.gamepad.buttons[13].pressed,g=this.gamepad.buttons[12].pressed||this.gamepad.buttons[13].pressed;g&&!this.sync.isMine&&this.sync.takeOwnership();var b=this.object3d.scale,y=new THREE.Vector3(1,1,1);y.multiplyScalar(f),p&&this.object3d.scale.add(y),d&&b.x>y.x&&b.y>y.y&&b.z>y.z&&this.object3d.scale.sub(y)}}},Object.defineProperties(e.prototype,n),e}(Ht),zt=function(t){function e(e){var n=this;if(t.call(this),this.config=Object.assign({event:"cursorenter",color:new THREE.Color("yellow")},e),"cursorenter"!==this.config.event&&"cursordown"!==this.config.event)throw Error('Expected config.event "cursorenter" or "cursordown"');this.object3d=null,this.cursordownObject=null,this.cursorenterObject=null,this.scene=null,this.cursordown=function(t){n.cursordownObject=n.object3d,"cursordown"===n.config.event&&n.setColor(n.cursordownObject)}.bind(this),this.cursorenter=function(t){n.cursordownObject&&n.cursordownObject!==n.object3d||(n.cursorenterObject&&n.unsetColor(n.cursorenterObject),n.cursorenterObject=n.object3d,n.setColor(n.object3d))}.bind(this),this.cursorleave=function(t){n.cursorenterObject===n.object3d&&(n.cursorenterObject=null,n.unsetColor(n.object3d))}.bind(this),this.cursorupScene=function(t){"cursordown"===n.config.event&&n.cursordownObject&&n.unsetColor(n.cursordownObject),n.cursordownObject=null}.bind(this)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"HoverColor"},e.prototype.awake=function(t,e){this.object3d=t,this.scene=e,this.object3d.addEventListener("cursordown",this.cursordown),this.scene.addEventListener("cursorup",this.cursorupScene),"cursorenter"===this.config.event&&(this.object3d.addEventListener("cursorenter",this.cursorenter),this.object3d.addEventListener("cursorleave",this.cursorleave))},e.prototype.dispose=function(){this.object3d.removeEventListener("cursordown",this.cursordown),this.scene.removeEventListener("cursorup",this.cursorupScene),this.object3d.removeEventListener("cursorenter",this.cursorenter),this.object3d.removeEventListener("cursorleave",this.cursorleave)},e.prototype.setColor=function(t){t.material&&t.material.color&&(t.userData.origColor=t.material.color,t.material.color=this.config.color,t.material&&(t.material.needsUpdate=!0)),t.children.forEach(this.setColor.bind(this))},e.prototype.unsetColor=function(t){if(t.material&&t.material.color){if(!t.userData.origColor)return void console.error("Cannot unsetColor, no userData.origColor for object",t);t.material.color=t.userData.origColor,t.material&&(t.material.needsUpdate=!0)}t.children.forEach(this.unsetColor.bind(this))},Object.defineProperties(e.prototype,n),e}(Ht),Yt=function(t){function e(e){var n=this;t.call(this),this.config=Object.assign({scale:1.15,duration:75,revertOnDispose:!0},e),this.object3d=null,this.originalScale=null,this.elapsedTime=this.config.duration,this.progress=1,this.srcScale=null,this.destScale=null,this.onHoverStateChange=function(){var t;t=[n.destScale,n.srcScale],n.srcScale=t[0],n.destScale=t[1],n.progress=1-n.progress,n.elapsedTime=n.config.duration-n.elapsedTime}.bind(this)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"HoverScale"},e.prototype.awake=function(t,e){this.object3d=t,this.originalScale=this.object3d.scale.clone(),this.srcScale=this.object3d.scale.clone(),this.srcScale.multiplyScalar(this.config.scale),this.destScale=new THREE.Vector3,this.destScale.copy(this.originalScale),this.progress=1,this.elapsedTime=this.config.duration,this.object3d.addEventListener("cursorenter",this.onHoverStateChange),this.object3d.addEventListener("cursorleave",this.onHoverStateChange)},e.prototype.update=function(t){this.progress<1&&(this.elapsedTime=THREE.Math.clamp(this.elapsedTime+t,0,this.config.duration),this.progress=THREE.Math.clamp(this.elapsedTime/this.config.duration,0,1),this.object3d.scale.lerpVectors(this.srcScale,this.destScale,this.progress))},e.prototype.dispose=function(){this.object3d.removeEventListener("cursorenter",this.onHoverStateChange),this.object3d.removeEventListener("cursorleave",this.onHoverStateChange),this.config.revertOnDispose&&this.object3d.scale.copy(this.originalScale),this.originalScale=null,this.srcScale=null,this.destScale=null,this.object3d=null},Object.defineProperties(e.prototype,n),e}(Ht),Xt=function(t){function e(n){t.call(this),this.config=Object.assign({jointCubeSize:15,joints:e.HAND_JOINTS},n),this.object3d=null,this.skeleton=null,this.jointCube=null,this.hasCollided=!1,this.collidedJoints=[],this.jointIntersectUnion=null}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"JointCollisionEvents"},e.prototype.awake=function(t,e){this.object3d=t;var n=this;k(e).then(function(t){n.skeleton=t,n.jointCube=new THREE.Vector3(n.config.jointCubeSize,n.config.jointCubeSize,n.config.jointCubeSize)})["catch"](function(t){console.log("Failed to get tracking skeleton",t)})},e.prototype.update=function(t){var e=this;if(this.skeleton){for(var n=[],i=0;iNumber.EPSILON&&this.object3d.scale.y>Number.EPSILON&&this.object3d.scale.z>Number.EPSILON)for(var c=0;c0){if(T(t,this.lastTransform))return;this.transformRef.set(t),this.lastTransform=t}}},e.prototype.takeOwnership=function(){this.ownerRef.set(this.sceneSync.clientId)},Object.defineProperties(e.prototype,n),e}(Ht),fe=[],pe={},de={},ge=function(t){function e(e,n){t.call(this),this.config=Object.assign({instantiators:{},destroyers:{},ready:null,autoSendRateMS:100},n),this.instanceRef=e,this.sceneRef=e.child("scene"),this.clientsRef=e.child("clients"),this.clientId=null,this.masterClientId=null}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{},isMasterClient:{}};return n.type.get=function(){return"SceneSync"},e.prototype.awake=function(t,e){var n=this;setInterval(R,this.config.autoSendRateMS);var i=e;this.clientId=i.uuid,this.clientsRef.on("value",function(t){var e=t.val();if(e){var i=Object.keys(e)[0];n.masterClientId=e[i]}}.bind(this)),this.clientsRef.push(this.clientId).onDisconnect().remove(),this.instanceRef.child("initialized").once("value",function(t){var e=!t.val();t.ref().set(!0),n.config.ready&&n.config.ready(e)}.bind(this)),this.sceneRef.on("child_added",this.onInstantiate.bind(this)),this.sceneRef.on("child_removed",this.onDestroy.bind(this))},e.prototype.instantiate=function(t,e,n){void 0===e&&(e={});var i=this.sceneRef.push({syncType:t,initData:e},function(t){if(t)throw Error("Failed to save to Firebase",t)});n&&i.onDisconnect().remove();var r=pe[i.key()];return r.getBehaviorByType("Object3DSync").takeOwnership(),r},e.prototype.onInstantiate=function(t){var e=t.val(),n=t.key(),i=this.config.instantiators[e.syncType];if(!i)return void console.warn("No instantiator found for syncType: "+e.syncType);var r=i(e.initData,e.syncType);if(!r)return void console.error(e.syncType+".create must return an Object3D");pe[n]=r,de[r.uuid]=n;var o=r.getBehaviorByType("Object3DSync");return o?(fe.push(o),void o.link(t.ref(),this)):void console.error(e.syncType+" instantiator must return an Object3D with an Object3DSync behavior")},e.prototype.destroy=function(t){var e=de[t.uuid];return e?(this.sceneRef.child(e).remove(function(t){t&&console.warn("Failed to remove from Firebase",t)}),void this.sceneRef.child(e).off()):void console.warn("Failed to find key for object3d to be destroyed",t)},e.prototype.onDestroy=function(t){function e(t){t.removeAllBehaviors(),t.parent&&t.parent.remove(t),t.geometry&&t.geometry.dispose(),t.material&&(t.material.map&&t.material.map.dispose(),t.material.dispose())}var n=t.val(),i=t.key(),r=pe[i];if(!r)return void console.warn("Failed to find object matching deleted key",i);var o=n.syncType;if(!o)return void console.warn("No syncType found for object being destroyed",r);var a=this.config.destroyers[o],s=!a;a&&(s=a(r)),s&&e(r),delete pe[i],delete de[r.uuid]},n.isMasterClient.get=function(){return this.masterClientId===this.clientId},Object.defineProperties(e.prototype,n),e}(Ht),be=function(t){function e(e){t.call(this),this.config=Object.assign({speed:1e-4,axis:new THREE.Vector3(0,1,0)},e),this.config.axis.normalize(),this.object3d=null}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"Spin"},e.prototype.awake=function(t){this.object3d=t},e.prototype.update=function(t){this.object3d.rotateOnAxis(this.config.axis,this.config.speed*t)},Object.defineProperties(e.prototype,n),e}(Ht),ye=function(t){function e(e){t.call(this),this.config=Object.assign({logging:!1},e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"SteamVRInput"},e.prototype.awake=function(){var t=this;this.leftControllerPromise=x(e.LEFT_CONTROLLER,this.config),this.rightControllerPromise=x(e.RIGHT_CONTROLLER,this.config),this.firstControllerPromise=Promise.race([this.leftControllerPromise,this.rightControllerPromise]),this.leftControllerPromise.then(function(e){t.leftController=e}),this.rightControllerPromise.then(function(e){t.rightController=e}),this.firstControllerPromise.then(function(n){t.firstController=n;var i=n.axes.map(function(){return!1}),r=n.buttons.map(function(){return!1});r[e.BUTTON_TRIGGER]=!0,r[e.BUTTON_TOUCHPAD]=!0,n.preventDefault(i,r)})},Object.defineProperties(e.prototype,n),e}(Ht);Object.assign(ye,{BUTTON_TRIGGER:0,BUTTON_GRIP:1,BUTTON_TOUCHPAD:2,BUTTON_DPAD_UP:3,BUTTON_DPAD_RIGHT:4,BUTTON_DPAD_DOWN:5,BUTTON_DPAD_LEFT:6,AXIS_TOUCHPAD_X:0,AXIS_TOUCHPAD_Y:1,FIRST_CONTROLLER:"first",LEFT_CONTROLLER:"left",RIGHT_CONTROLLER:"right"});var ve=function(t){function e(e){var n=e.hand;void 0===n&&(n="first"),t.call(this),this._hand=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"SteamVRTrackedObject"},e.prototype.awake=function(t,e){this._object3d=t,this._scene=e,this._steamVRInput=this._scene.getBehaviorByType("SteamVRInput")},e.prototype.update=function(){var t=this._steamVRInput[this._hand+"Controller"],e=this._object3d;if(t){var n=t.position,i=n.x,r=n.y,o=n.z;e.position.set(i,r,o);var a=t.rotation,i=a.x,r=a.y,o=a.z,s=a.w;e.quaternion.set(i,r,o,s)}},Object.defineProperties(e.prototype,n),e}(Ht),me=function(t){function e(e){void 0===e&&(e={}),t.call(this),this.object3d=null,this.scene=null,this.startingRotation=null,this.activelyRotating=!1,this.lastDisplacementX=0,this.runningCount=5,this.runningAverageVelocityX=0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={type:{}};return n.type.get=function(){return"TouchpadRotate"},e.prototype.awake=function(t,e){this.object3d=t,this.scene=e,altspace.addEventListener("touchpadup",this.onTouchpadUp.bind(this)),altspace.addEventListener("touchpaddown",this.onTouchpadDown.bind(this)),altspace.addEventListener("touchpadmove",this.onTouchpadMove.bind(this))},e.prototype.update=function(t){!this.activelyRotating&&Math.abs(this.runningAverageVelocityX)>.01&&(this.object3d.rotation.y+=this.runningAverageVelocityX,this.runningAverageVelocityX*=.97)},e.prototype.onTouchpadUp=function(t){this.activelyRotating=!1},e.prototype.onTouchpadDown=function(t){this.activelyRotating=!0,this.startingRotation=this.object3d.rotation.clone()},e.prototype.onTouchpadMove=function(t){var e=t.displacementX-this.lastDisplacementX;this.object3d.rotation.set(this.startingRotation.x,this.startingRotation.y+t.displacementX/300,this.startingRotation.z),this.runningAverageVelocityX=(this.runningAverageVelocityX*this.runningCount+e/300)/(this.runningCount+1),this.lastDisplacementX=t.displacementX},Object.defineProperties(e.prototype,n),e}(Ht),we=Object.freeze({Behavior:Ht,Bob:Wt,ButtonStateStyle:Vt,Drag:Gt,GamepadControls:Qt,HoverColor:zt,HoverScale:Yt,JointCollisionEvents:Xt,Layout:he,Object3DSync:le,SceneSync:ge,Spin:be,SteamVRInput:ye,SteamVRTrackedObject:ve,TouchpadRotate:me}),Ee=Object.freeze({sync:jt,Simulation:At,multiloader:Lt,codePen:Ut,shims:Bt,behaviors:we});Object.isFrozen(window.altspace)||Object.assign(window.altspace,{components:{},utilities:{},inClient:!1});var _e="2.7.2";window.altspace.requestVersion&&window.altspace.requestVersion(_e),window.AFRAME&&!window.THREE&&(window.THREE=window.AFRAME.THREE),Object.assign(window.altspace.components||{},wt),Object.assign(window.altspace.utilities||{},Ee)}(Firebase,Url,Please); \ No newline at end of file diff --git a/doc/aframe/index.html b/doc/aframe/index.html index 632cb175..1611eaa5 100644 --- a/doc/aframe/index.html +++ b/doc/aframe/index.html @@ -73,7 +73,7 @@

Quick Start

This is a fully functional example of what A-Frame code l

<!DOCTYPE html>
 <html><head>
 <script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
-<script src="https://sdk.altvr.com/libs/altspace.js/2.7.1/altspace.min.js"></script>
+<script src="https://sdk.altvr.com/libs/altspace.js/2.7.2/altspace.min.js"></script>
 <script>
 
 // an example custom component, that will change the color when clicked
@@ -81,7 +81,7 @@ 

Quick Start

This is a fully functional example of what A-Frame code l schema: {}, init: function(){ var self = this; - self.el.object3D.addEventListener('cursorup', function(){ + this.el.addEventListener('click', function(){ var rgb = [ Math.floor(Math.random()*255), Math.floor(Math.random()*255), diff --git a/doc/aframe/module-altspace_components.altspace-cursor-collider.html b/doc/aframe/module-altspace_components.altspace-cursor-collider.html index 4c3402fb..b92b7897 100644 --- a/doc/aframe/module-altspace_components.altspace-cursor-collider.html +++ b/doc/aframe/module-altspace_components.altspace-cursor-collider.html @@ -57,7 +57,7 @@

altspace-cursor-collider

-

Enable or disable cursor collision on the object.

+

Enable or disable cursor collision on the object.

diff --git a/doc/aframe/module-altspace_components.altspace-tracked-controls.html b/doc/aframe/module-altspace_components.altspace-tracked-controls.html index 2b22ab08..f8a220bc 100644 --- a/doc/aframe/module-altspace_components.altspace-tracked-controls.html +++ b/doc/aframe/module-altspace_components.altspace-tracked-controls.html @@ -58,7 +58,7 @@

Enables tracked control support for A-Frame applications that use the built-in -tracked-controls, vive-controls or hand-controls components.

+tracked-controls, vive-controls or hand-controls components.

diff --git a/doc/aframe/module-altspace_components.altspace.html b/doc/aframe/module-altspace_components.altspace.html index f0c16ea0..95f1443a 100644 --- a/doc/aframe/module-altspace_components.altspace.html +++ b/doc/aframe/module-altspace_components.altspace.html @@ -59,7 +59,7 @@

The altspace component makes A-Frame apps compatible with AltspaceVR.

Note: This component can have side-effects on some default components. To be -safe, this component should be specified last.

+safe, this component should be specified last.

@@ -134,7 +134,7 @@

Example
-
<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
  <script src="https://cdn.rawgit.com/AltspaceVR/AltspaceSDK/v2.7.1/dist/altspace.min.js"></script>
</head>
<body>
  <a-scene altspace>
    <a-entity geometry="primitive: box" material="color: #C03546"></a-entity>
  </a-scene>
</body>
+
<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
  <script src="https://cdn.rawgit.com/AltspaceVR/AltspaceSDK/v2.7.2/dist/altspace.min.js"></script>
</head>
<body>
  <a-scene altspace>
    <a-entity geometry="primitive: box" material="color: #C03546"></a-entity>
  </a-scene>
</body>
diff --git a/doc/aframe/module-altspace_components.collapse-model.html b/doc/aframe/module-altspace_components.collapse-model.html index e74d86e3..4a4820ac 100644 --- a/doc/aframe/module-altspace_components.collapse-model.html +++ b/doc/aframe/module-altspace_components.collapse-model.html @@ -59,7 +59,7 @@

Reaches into a model's hierarchy and directly assigns the first mesh found to the containing entity. This is mostly necessary for use alongside native -components like n-skeleton-parent.

+components like n-skeleton-parent.

diff --git a/doc/aframe/module-altspace_components.html b/doc/aframe/module-altspace_components.html index d90c3dff..3c5efb2a 100644 --- a/doc/aframe/module-altspace_components.html +++ b/doc/aframe/module-altspace_components.html @@ -136,7 +136,7 @@

altspace/components

Example
-
<html>
  <head>
    <title>My A-Frame Scene</title>
    <script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
    <script src="https://cdn.rawgit.com/AltspaceVR/AltspaceSDK/v2.7.1/dist/altspace.min.js"></script>
  </head>
  <body>
    <a-scene altspace>
      <a-entity geometry="primitive: box" material="color: #C03546"></a-entity>
    </a-scene>
  </body>
</html>
+
<html>
  <head>
    <title>My A-Frame Scene</title>
    <script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
    <script src="https://cdn.rawgit.com/AltspaceVR/AltspaceSDK/v2.7.2/dist/altspace.min.js"></script>
  </head>
  <body>
    <a-scene altspace>
      <a-entity geometry="primitive: box" material="color: #C03546"></a-entity>
    </a-scene>
  </body>
</html>
diff --git a/doc/aframe/module-altspace_components.instantiator.html b/doc/aframe/module-altspace_components.instantiator.html index 9bdde258..bec4733a 100644 --- a/doc/aframe/module-altspace_components.instantiator.html +++ b/doc/aframe/module-altspace_components.instantiator.html @@ -58,7 +58,7 @@

Instantiates objects on an event trigger, adds them to the scene and syncs their creation across clients. -The instantiated objects are built using the specified mixins.

+The instantiated objects are built using the specified mixins.

diff --git a/doc/aframe/module-altspace_components.n-billboard.html b/doc/aframe/module-altspace_components.n-billboard.html index cf45ac08..c6914036 100644 --- a/doc/aframe/module-altspace_components.n-billboard.html +++ b/doc/aframe/module-altspace_components.n-billboard.html @@ -58,7 +58,7 @@

Make the object's +Z always face the viewer. Currently will only directly apply -to main mesh or native component on the attached entity, not any children or submeshes.

+to main mesh or native component on the attached entity, not any children or submeshes.

diff --git a/doc/aframe/module-altspace_components.n-box-collider.html b/doc/aframe/module-altspace_components.n-box-collider.html index f897e40a..ebfa7d99 100644 --- a/doc/aframe/module-altspace_components.n-box-collider.html +++ b/doc/aframe/module-altspace_components.n-box-collider.html @@ -58,7 +58,7 @@

Creates a box-shaped collider with the given dimensions. Collides with -the cursor or avatars depending on the type property.

+the cursor or avatars depending on the type property.

diff --git a/doc/aframe/module-altspace_components.n-capsule-collider.html b/doc/aframe/module-altspace_components.n-capsule-collider.html index d78ae540..79c8bb9a 100644 --- a/doc/aframe/module-altspace_components.n-capsule-collider.html +++ b/doc/aframe/module-altspace_components.n-capsule-collider.html @@ -59,7 +59,7 @@

Create a capsule-shaped collider on this entity. Capsules are a union of a cylinder and two hemispheres on top and bottom. Collides with -the cursor or avatars depending on the type property.

+the cursor or avatars depending on the type property.

diff --git a/doc/aframe/module-altspace_components.n-cockpit-parent.html b/doc/aframe/module-altspace_components.n-cockpit-parent.html index 2cf968cb..831c84b9 100644 --- a/doc/aframe/module-altspace_components.n-cockpit-parent.html +++ b/doc/aframe/module-altspace_components.n-cockpit-parent.html @@ -58,7 +58,7 @@

Parents an entity to the cockpit, i.e. the player's HUD. This is primarily used for UI elements. -Note that this does not dock the items to the radial menu. If you want that, use altspace.open.

+Note that this does not dock the items to the radial menu. If you want that, use altspace.open.

diff --git a/doc/aframe/module-altspace_components.n-collider.html b/doc/aframe/module-altspace_components.n-collider.html index 5f2b91a9..5df54a69 100644 --- a/doc/aframe/module-altspace_components.n-collider.html +++ b/doc/aframe/module-altspace_components.n-collider.html @@ -62,7 +62,7 @@

n-capsule-collider, and n-mesh-collider. You cannot use this class directly, but instead you should add one of those components -to your objects.

+to your objects.

diff --git a/doc/aframe/module-altspace_components.n-container.html b/doc/aframe/module-altspace_components.n-container.html index e7758749..874a8bdd 100644 --- a/doc/aframe/module-altspace_components.n-container.html +++ b/doc/aframe/module-altspace_components.n-container.html @@ -60,7 +60,7 @@

A container keeps a running tally of how many objects are within its bounds, and adds and removes the states container-full and container-empty based on the current count of objects. Requires a native -collider component set to trigger mode.

+collider component set to trigger mode.

diff --git a/doc/aframe/module-altspace_components.n-mesh-collider.html b/doc/aframe/module-altspace_components.n-mesh-collider.html index ef2e6214..450d5927 100644 --- a/doc/aframe/module-altspace_components.n-mesh-collider.html +++ b/doc/aframe/module-altspace_components.n-mesh-collider.html @@ -59,7 +59,7 @@

Enable collision for the entire attached mesh. This is expensive to evaluate, so should only be used on low-poly meshes. If using this alongside the geometry component, make sure that -geometry comes before this component.

+geometry comes before this component.

diff --git a/doc/aframe/module-altspace_components.n-object.html b/doc/aframe/module-altspace_components.n-object.html index 13e7b10d..acdfa761 100644 --- a/doc/aframe/module-altspace_components.n-object.html +++ b/doc/aframe/module-altspace_components.n-object.html @@ -57,7 +57,7 @@

n-object

-

Attach a given native object to this entity.

+

Attach a given native object to this entity.

diff --git a/doc/aframe/module-altspace_components.n-portal.html b/doc/aframe/module-altspace_components.n-portal.html index aaa14aa6..0ae1c0cf 100644 --- a/doc/aframe/module-altspace_components.n-portal.html +++ b/doc/aframe/module-altspace_components.n-portal.html @@ -57,7 +57,7 @@

n-portal

-

Spawn a portal that allows you to travel to a different space or a different location in the current space.

+

Spawn a portal that allows you to travel to a different space or a different location in the current space.

diff --git a/doc/aframe/module-altspace_components.n-skeleton-parent.html b/doc/aframe/module-altspace_components.n-skeleton-parent.html index 85977ca3..b3a7cf08 100644 --- a/doc/aframe/module-altspace_components.n-skeleton-parent.html +++ b/doc/aframe/module-altspace_components.n-skeleton-parent.html @@ -57,7 +57,7 @@

n-skeleton-parent

-

Parents an entity to a joint on the avatar skeleton.

+

Parents an entity to a joint on the avatar skeleton.

diff --git a/doc/aframe/module-altspace_components.n-sound.html b/doc/aframe/module-altspace_components.n-sound.html index 4cee9e53..c9c192d5 100644 --- a/doc/aframe/module-altspace_components.n-sound.html +++ b/doc/aframe/module-altspace_components.n-sound.html @@ -58,7 +58,7 @@

Play a sound from a particular location. Limiting sound duration to 5 seconds -or less is recommended to prevent hitching when the sound loads.

+or less is recommended to prevent hitching when the sound loads.

diff --git a/doc/aframe/module-altspace_components.n-spawner.html b/doc/aframe/module-altspace_components.n-spawner.html index cfd159c6..e3c5beaf 100644 --- a/doc/aframe/module-altspace_components.n-spawner.html +++ b/doc/aframe/module-altspace_components.n-spawner.html @@ -59,7 +59,7 @@

Create an object that spawns additional copies of itself when grabbed by a user (the copies are not spawners themselves). These copies will be physically interactive and automatically synchronized -between users.

+between users.

diff --git a/doc/aframe/module-altspace_components.n-sphere-collider.html b/doc/aframe/module-altspace_components.n-sphere-collider.html index e2003ea9..d791bf2f 100644 --- a/doc/aframe/module-altspace_components.n-sphere-collider.html +++ b/doc/aframe/module-altspace_components.n-sphere-collider.html @@ -58,7 +58,7 @@

Creates a sphere-shaped collider of the given radius. Collides with -the cursor or avatars depending on the type property.

+the cursor or avatars depending on the type property.

diff --git a/doc/aframe/module-altspace_components.n-text.html b/doc/aframe/module-altspace_components.n-text.html index a267fd76..9c0b8cd3 100644 --- a/doc/aframe/module-altspace_components.n-text.html +++ b/doc/aframe/module-altspace_components.n-text.html @@ -58,7 +58,7 @@

Creates dynamic 2D text on the entity. The text will wrap automatically based on the width and height provided. -This text will be clearer than texture-based text and more performant than geometry-based text.

+This text will be clearer than texture-based text and more performant than geometry-based text.

diff --git a/doc/aframe/module-altspace_components.one-per-user.html b/doc/aframe/module-altspace_components.one-per-user.html index 96bb6cbe..94cdbbd4 100644 --- a/doc/aframe/module-altspace_components.one-per-user.html +++ b/doc/aframe/module-altspace_components.one-per-user.html @@ -57,7 +57,7 @@

one-per-user

-

Instantiates an entity for every user in the space using sync-system.

+

Instantiates an entity for every user in the space using sync-system.

diff --git a/doc/aframe/module-altspace_components.sync-color.html b/doc/aframe/module-altspace_components.sync-color.html index 04fc0d9e..1eb2fcfc 100644 --- a/doc/aframe/module-altspace_components.sync-color.html +++ b/doc/aframe/module-altspace_components.sync-color.html @@ -59,7 +59,7 @@

Sync the color property of the object between clients. Requires both a sync-system component on the a-scene, and a -sync component on the target entity.

+sync component on the target entity.

diff --git a/doc/aframe/module-altspace_components.sync-n-skeleton-parent.html b/doc/aframe/module-altspace_components.sync-n-skeleton-parent.html index 92bb33e1..3e4e2963 100644 --- a/doc/aframe/module-altspace_components.sync-n-skeleton-parent.html +++ b/doc/aframe/module-altspace_components.sync-n-skeleton-parent.html @@ -59,7 +59,7 @@

Syncs the attributes of an n-skeleton-parent component across clients. Requires the sync component be present -on the entity.

+on the entity.

diff --git a/doc/aframe/module-altspace_components.sync-n-sound.html b/doc/aframe/module-altspace_components.sync-n-sound.html index 66ae8f9b..2f592769 100644 --- a/doc/aframe/module-altspace_components.sync-n-sound.html +++ b/doc/aframe/module-altspace_components.sync-n-sound.html @@ -59,7 +59,7 @@

Synchronize the playback state of an n-sound component between clients. Requires both a sync-system component on the a-scene, and a -sync component on the target entity.

+sync component on the target entity.

diff --git a/doc/aframe/module-altspace_components.sync-system.html b/doc/aframe/module-altspace_components.sync-system.html index 5d6b3927..f6faa1bd 100644 --- a/doc/aframe/module-altspace_components.sync-system.html +++ b/doc/aframe/module-altspace_components.sync-system.html @@ -60,7 +60,7 @@

Connect to a remote Firebase server, and facilitate synchronization. These options correspond exactly with the configuration options for altspace.utilities.sync.connect. -This component must be present on a-scene for any other sync components to work.

+This component must be present on a-scene for any other sync components to work.

diff --git a/doc/aframe/module-altspace_components.sync-transform.html b/doc/aframe/module-altspace_components.sync-transform.html index fbff65e6..88afdf22 100644 --- a/doc/aframe/module-altspace_components.sync-transform.html +++ b/doc/aframe/module-altspace_components.sync-transform.html @@ -59,7 +59,7 @@

Synchronize the position, rotation, and scale of this object with all clients. Requires both a sync-system component on the a-scene, and a -sync component on the target entity.

+sync component on the target entity.

diff --git a/doc/aframe/module-altspace_components.sync.html b/doc/aframe/module-altspace_components.sync.html index 6e017564..24978952 100644 --- a/doc/aframe/module-altspace_components.sync.html +++ b/doc/aframe/module-altspace_components.sync.html @@ -59,7 +59,7 @@

Enables the synchronization of properties of the entity. Must be used in conjuction with the sync-system component and a component for a -specific property (e.g. sync-transform).

+specific property (e.g. sync-transform).

diff --git a/doc/aframe/module-altspace_components.wire.html b/doc/aframe/module-altspace_components.wire.html index 29be3908..3308e27a 100644 --- a/doc/aframe/module-altspace_components.wire.html +++ b/doc/aframe/module-altspace_components.wire.html @@ -58,7 +58,7 @@

The wire component allows you to trigger an event on one entity when an event -occurs on the another entity. If no targets are selected, it will target itself.

+occurs on the another entity. If no targets are selected, it will target itself.

diff --git a/doc/index.html b/doc/index.html index bf4e362d..42bd67a9 100644 --- a/doc/index.html +++ b/doc/index.html @@ -23,9 +23,9 @@

altspace.js

altspace.js should be included whenever you use the SDK. It contains core utilities and APIs, and is useful both inside and outside of the client.

Many APIs are present in the client without loading altspace.js, but please still include it, as this may change in the future.

The version baked into the altspace.js script will determine which version of the entire SDK the client will provide your app. This means that if we make any breaking internal changes to things like rendering or cursor events, and you are using an older version of altspace.js, we will try to return legacy behavior appropriate to your version of altspace.js. Versioning will follow SEMVER as closely as possible. Details for each version can be found in the Release Notes.

-

Latest Version: v2.7.1 -- See Changes

+

Latest Version: v2.7.2 -- See Changes

Include the latest version of the SDK in your app with:

-

<script src="https://sdk.altvr.com/libs/altspace.js/2.7.1/altspace.min.js"></script>

+

<script src="https://sdk.altvr.com/libs/altspace.js/2.7.2/altspace.min.js"></script>

If you use npm, you can install altspace.js with:

npm install altspace

SDK Feature Overview

diff --git a/doc/js/index.html b/doc/js/index.html index 28cdd983..3fe95612 100644 --- a/doc/js/index.html +++ b/doc/js/index.html @@ -85,7 +85,7 @@

Quick Start

This is a fully functional example of what Three.js code <html lang=en> <head> <script src="https://cdn.rawgit.com/mrdoob/three.js/r84/build/three.js"></script> - <script src="https://sdk.altvr.com/libs/altspace.js/2.7.1/altspace.min.js"></script> + <script src="https://sdk.altvr.com/libs/altspace.js/2.7.2/altspace.min.js"></script> </head> <body> <script> diff --git a/package.json b/package.json index df315c64..44097e96 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "altspace", "author": "AltspaceVR", - "version": "2.7.1", + "version": "2.7.2", "repository": { "type": "git", "url": "git+https://github.com/AltspaceVR/AltspaceSDK.git"