diff --git a/build/build.js b/build/build.js index 767ef2d7..0f6755db 100644 --- a/build/build.js +++ b/build/build.js @@ -1,4 +1,4 @@ -!function(e){var t=this.webpackHotUpdate;this.webpackHotUpdate=function(e,a){!function(e,t){if(!w[e]||!A[e])return;for(var a in A[e]=!1,t)Object.prototype.hasOwnProperty.call(t,a)&&(f[a]=t[a]);0==--y&&0===g&&k()}(e,a),t&&t(e,a)};var a,s=!0,n="5240b60f8d7cb42cee8a",r={},o=[],i=[];function c(e){var t=P[e];if(!t)return j;var s=function(s){return t.hot.active?(P[s]?-1===P[s].parents.indexOf(e)&&P[s].parents.push(e):(o=[e],a=s),-1===t.children.indexOf(s)&&t.children.push(s)):(console.warn("[HMR] unexpected require("+s+") from disposed module "+e),o=[]),j(s)},n=function(e){return{configurable:!0,enumerable:!0,get:function(){return j[e]},set:function(t){j[e]=t}}};for(var r in j)Object.prototype.hasOwnProperty.call(j,r)&&"e"!==r&&"t"!==r&&Object.defineProperty(s,r,n(r));return s.e=function(e){return"ready"===u&&h("prepare"),g++,j.e(e).then(t,(function(e){throw t(),e}));function t(){g--,"prepare"===u&&(v[e]||T(e),0===g&&0===y&&k())}},s.t=function(e,t){return 1&t&&(e=s(e)),j.t(e,-2&t)},s}function d(t){var s={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:a!==t,active:!0,accept:function(e,t){if(void 0===e)s._selfAccepted=!0;else if("function"==typeof e)s._selfAccepted=e;else if("object"==typeof e)for(var a=0;a=0&&s._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,u){case"idle":(f={})[t]=e[t],h("ready");break;case"ready":x(t);break;case"prepare":case"check":case"dispose":case"apply":(b=b||[]).push(t)}},check:E,apply:R,status:function(e){if(!e)return u;l.push(e)},addStatusHandler:function(e){l.push(e)},removeStatusHandler:function(e){var t=l.indexOf(e);t>=0&&l.splice(t,1)},data:r[t]};return a=void 0,s}var l=[],u="idle";function h(e){u=e;for(var t=0;t0;){var n=s.pop(),r=n.id,o=n.chain;if((l=P[r])&&(!l.hot._selfAccepted||l.hot._selfInvalidated)){if(l.hot._selfDeclined)return{type:"self-declined",chain:o,moduleId:r};if(l.hot._main)return{type:"unaccepted",chain:o,moduleId:r};for(var i=0;i ")),k.type){case"self-declined":s.onDeclined&&s.onDeclined(k),s.ignoreDeclined||(R=new Error("Aborted because of self decline: "+k.moduleId+M));break;case"declined":s.onDeclined&&s.onDeclined(k),s.ignoreDeclined||(R=new Error("Aborted because of declined dependency: "+k.moduleId+" in "+k.parentId+M));break;case"unaccepted":s.onUnaccepted&&s.onUnaccepted(k),s.ignoreUnaccepted||(R=new Error("Aborted because "+u+" is not accepted"+M));break;case"accepted":s.onAccepted&&s.onAccepted(k),x=!0;break;case"disposed":s.onDisposed&&s.onDisposed(k),L=!0;break;default:throw new Error("Unexception type "+k.type)}if(R)return h("abort"),Promise.reject(R);if(x)for(u in A[u]=f[u],y(v,k.outdatedModules),k.outdatedDependencies)Object.prototype.hasOwnProperty.call(k.outdatedDependencies,u)&&(g[u]||(g[u]=[]),y(g[u],k.outdatedDependencies[u]));L&&(y(v,[k.moduleId]),A[u]=E)}var _,D=[];for(c=0;c0;)if(u=Z.pop(),l=P[u]){var C={},U=l.hot._disposeHandlers;for(d=0;d=0&&F.parents.splice(_,1))}}for(u in g)if(Object.prototype.hasOwnProperty.call(g,u)&&(l=P[u]))for(O=g[u],d=0;d=0&&l.children.splice(_,1);h("apply"),void 0!==p&&(n=p,p=void 0);for(u in f=void 0,A)Object.prototype.hasOwnProperty.call(A,u)&&(e[u]=A[u]);var q=null;for(u in g)if(Object.prototype.hasOwnProperty.call(g,u)&&(l=P[u])){O=g[u];var H=[];for(c=0;c1)for(var a=1;a=0&&s._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,u){case"idle":(f={})[t]=e[t],h("ready");break;case"ready":x(t);break;case"prepare":case"check":case"dispose":case"apply":(b=b||[]).push(t)}},check:E,apply:R,status:function(e){if(!e)return u;l.push(e)},addStatusHandler:function(e){l.push(e)},removeStatusHandler:function(e){var t=l.indexOf(e);t>=0&&l.splice(t,1)},data:r[t]};return a=void 0,s}var l=[],u="idle";function h(e){u=e;for(var t=0;t0;){var n=s.pop(),r=n.id,o=n.chain;if((l=P[r])&&(!l.hot._selfAccepted||l.hot._selfInvalidated)){if(l.hot._selfDeclined)return{type:"self-declined",chain:o,moduleId:r};if(l.hot._main)return{type:"unaccepted",chain:o,moduleId:r};for(var i=0;i ")),k.type){case"self-declined":s.onDeclined&&s.onDeclined(k),s.ignoreDeclined||(R=new Error("Aborted because of self decline: "+k.moduleId+M));break;case"declined":s.onDeclined&&s.onDeclined(k),s.ignoreDeclined||(R=new Error("Aborted because of declined dependency: "+k.moduleId+" in "+k.parentId+M));break;case"unaccepted":s.onUnaccepted&&s.onUnaccepted(k),s.ignoreUnaccepted||(R=new Error("Aborted because "+u+" is not accepted"+M));break;case"accepted":s.onAccepted&&s.onAccepted(k),x=!0;break;case"disposed":s.onDisposed&&s.onDisposed(k),L=!0;break;default:throw new Error("Unexception type "+k.type)}if(R)return h("abort"),Promise.reject(R);if(x)for(u in A[u]=f[u],y(v,k.outdatedModules),k.outdatedDependencies)Object.prototype.hasOwnProperty.call(k.outdatedDependencies,u)&&(g[u]||(g[u]=[]),y(g[u],k.outdatedDependencies[u]));L&&(y(v,[k.moduleId]),A[u]=E)}var _,D=[];for(c=0;c0;)if(u=Z.pop(),l=P[u]){var C={},U=l.hot._disposeHandlers;for(d=0;d=0&&F.parents.splice(_,1))}}for(u in g)if(Object.prototype.hasOwnProperty.call(g,u)&&(l=P[u]))for(O=g[u],d=0;d=0&&l.children.splice(_,1);h("apply"),void 0!==p&&(n=p,p=void 0);for(u in f=void 0,A)Object.prototype.hasOwnProperty.call(A,u)&&(e[u]=A[u]);var q=null;for(u in g)if(Object.prototype.hasOwnProperty.call(g,u)&&(l=P[u])){O=g[u];var H=[];for(c=0;c1)for(var a=1;a=(null!=s?s:t.logLevel)&&e({level:r[a].toLowerCase(),message:i,args:n,type:t.name})}},s=0,n=o;s{},console.timeEnd=()=>{},a(41),a(42),a(43),a(44),a(45),a(46),a(48),a(49),AFRAME.log=()=>{},a(51),a(53),a(54),a(55),a(56),a(57),s(a(58)),s(a(191)),a(195),a(202),e.hot.accept(),document.addEventListener("DOMContentLoaded",()=>{!function(){const e=document.querySelector("form");if(!e)return;if(localStorage.getItem("subscribeClosed")){const t=e.parentNode;return void t.parentNode.removeChild(t)}document.getElementById("subscribeClose").addEventListener("click",()=>{const t=e.parentNode;t.parentNode.removeChild(t),localStorage.setItem("subscribeClosed",!0)});const t=e.querySelector(".submit"),a=e.querySelector('input[type="email"]'),s=document.querySelector("#subscribeForm > h2");let n="";s&&(n=s.innerHTML);e.addEventListener("submit",e=>{e.preventDefault();const a=new XMLHttpRequest;let n="http://localhost:5000/mail/subscribe";return n="https://supermedium.com/mail/subscribe",a.open("POST",n),a.addEventListener("load",()=>{200!==parseInt(a.status,10)&&(window.location.href="https://supermedium/subscribe/"),t&&(t.disabled=!0,t.innerHTML="Subscribed!"),s&&(s.innerHTML="Successfully subscribed, thank you!")}),a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),a.send(JSON.stringify({email:document.querySelector('[name="email"]').value,source:"moonrider"})),!1}),t&&a.addEventListener("keydown",()=>{t.hasAttribute("disabled")&&(t.innerHTML="Subscribe",t.removeAttribute("disabled")),s&&n&&(s.innerHTML=n)})}()}),"http:"!==window.location.protocol||window.location.host.startsWith("localhost")||window.location.replace("https:"+location.href.substring(location.protocol.length))},function(e,t){THREE.BufferGeometryUtils={computeTangents:function(e){var t=e.index,a=e.attributes;if(null!==t&&void 0!==a.position&&void 0!==a.normal&&void 0!==a.uv){var s=t.array,n=a.position.array,r=a.normal.array,o=a.uv.array,i=n.length/3;void 0===a.tangent&&e.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*i),4));for(var c=a.tangent.array,d=[],l=[],u=0;u0){p=p.clone();for(var b=0;b=s.x&&this.boxMin.y<=n.y&&this.boxMax.y>=s.y&&this.boxMin.z<=n.z&&this.boxMax.z>=s.z}}(),setDirty:function(){this.dirty=!0},refreshObjects:function(){const e=this.data;this.objectEls=e.objects?this.el.sceneEl.querySelectorAll(e.objects):this.el.sceneEl.children,this.dirty=!1}})},function(e,t){var a=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function s(e,t,s,n){const r=1/n,o=1/s;return a[0].set(r*t,o*e+o),a[1].set(r*t,o*e),a[2].set(r*t+r,o*e),a[3].set(r*t+r,o*e+o),a}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const e=this.data,t=s(e.row-1,e.column-1,e.totalRows,e.totalColumns),a=this.el.getObject3D("mesh").geometry;var n=new Float32Array([t[0].x,t[0].y,t[3].x,t[3].y,t[1].x,t[1].y,t[2].x,t[2].y]);a.setAttribute("uv",new THREE.BufferAttribute(n,2)),a.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const e=this.canvas=document.createElement("canvas");e.id=this.data.canvasId,e.height=this.data.canvasHeight,e.width=this.data.canvasWidth,this.ctx=e.getContext("2d"),document.body.appendChild(e),this.data.debug&&(e.style.left=0,e.style.top=0,e.style.position="fixed",e.style.zIndex=9999999999)},drawTexture:function(e,t,a,n,r){const o=this.canvas,i=this.data;e.complete||(e.onload=()=>{this.drawTexture(e,t,a)});const c=r||o.height/i.numRows,d=n||o.width/i.numColumns;return this.ctx.drawImage(e,d*t,d*a,d,c),s(t,a,i.numRows,i.numColumns)}}),e.exports.getGridUvs=s},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var a={};AFRAME.registerComponent("audioanalyser",{schema:{buffer:{default:!1},beatDetectionDecay:{default:.99},beatDetectionMinVolume:{default:15},beatDetectionThrottle:{default:250},cache:{default:!1},enabled:{default:!0},enableBeatDetection:{default:!0},enableLevels:{default:!0},enableWaveform:{default:!0},enableVolume:{default:!0},fftSize:{default:2048},smoothingTimeConstant:{default:.8},src:{parse:function(e){return e.constructor!==String?e:e.startsWith("#")||e.startsWith(".")?document.querySelector(e):e}},unique:{default:!1}},init:function(){this.audioEl=null,this.levels=null,this.waveform=null,this.volume=0,this.xhr=null,this.initContext()},update:function(e){var t=this.analyser,a=this.data;e.fftSize===a.fftSize&&e.smoothingTimeConstant===a.smoothingTimeConstant||(t.fftSize=a.fftSize,t.smoothingTimeConstant=a.smoothingTimeConstant,this.levels=new Uint8Array(t.frequencyBinCount),this.waveform=new Uint8Array(t.fftSize)),a.src&&this.refreshSource()},tick:function(e,t){var a,s=this.data;if(s.enabled){if((s.enableLevels||s.enableVolume)&&this.analyser.getByteFrequencyData(this.levels),s.enableWaveform&&this.analyser.getByteTimeDomainData(this.waveform),s.enableVolume||s.enableBeatDetection){for(var n=0,r=0;rthis.beatCutOff&&a>this.data.beatDetectionMinVolume?(this.el.emit("audioanalyserbeat",null,!1),this.beatCutOff=1.5*a,this.beatTime=0):this.beatTime<=this.data.beatDetectionThrottle?this.beatTime+=t:(this.beatCutOff*=this.data.beatDetectionDecay,this.beatCutOff=Math.max(this.beatCutOff,this.data.beatDetectionMinVolume)))}},initContext:function(){var e,t=this.data;this.context=new(window.webkitAudioContext||window.AudioContext),e=this.analyser=this.context.createAnalyser(),(this.gainNode=this.context.createGain()).connect(e),e.connect(this.context.destination),e.fftSize=t.fftSize,e.smoothingTimeConstant=t.smoothingTimeConstant,this.levels=new Uint8Array(e.frequencyBinCount),this.waveform=new Uint8Array(e.fftSize)},refreshSource:function(){this.analyser;var e=this.data;e.buffer&&e.src.constructor===String?this.getBufferSource().then(e=>{this.source=e,this.source.connect(this.gainNode)}):(this.source=this.getMediaSource(),this.source.connect(this.gainNode))},suspendContext:function(){this.context.suspend()},resumeContext:function(){this.context.resume()},fetchAudioBuffer:function(e){return a[e]?a[e].constructor===Promise?a[e]:Promise.resolve(a[e]):(this.data.cache||Object.keys(a).forEach((function(e){delete a[e]})),a[e]=new Promise(t=>{const s=this.xhr=new XMLHttpRequest;s.open("GET",e),s.responseType="arraybuffer",s.addEventListener("load",()=>{function n(s){a[e]=s,t(s)}const r=this.context.decodeAudioData(s.response,n);r&&r.constructor===Promise&&r.then(n).catch(console.error)}),s.send()}),a[e])},getBufferSource:function(){var e=this.data;return this.fetchAudioBuffer(e.src).then(()=>{var t;return(t=this.context.createBufferSource()).buffer=a[e.src],this.el.emit("audioanalyserbuffersource",t,!1),t}).catch(console.error)},getMediaSource:function(){const e={};return function(){const t=this.data.src.constructor===String?this.data.src:this.data.src.src;if(e[t])return e[t];this.data.src.constructor===String?(this.audio=document.createElement("audio"),this.audio.crossOrigin="anonymous",this.audio.setAttribute("src",this.data.src)):this.audio=this.data.src;const a=this.context.createMediaElementSource(this.audio);return e[t]=a,a}}()})},function(e,t){var a=AFRAME.utils.styleParser;if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("event-set",{schema:{default:"",parse:function(e){return a.parse(e)}},multiple:!0,init:function(){this.eventHandler=null,this.eventName=null},update:function(e){this.removeEventListener(),this.updateEventListener(),this.addEventListener()},remove:function(){this.removeEventListener()},pause:function(){this.removeEventListener()},play:function(){this.addEventListener()},updateEventListener:function(){var e,t,a,s=this.data,n=this.el;e=s._event||this.id,t=s._target,a=t?n.sceneEl.querySelector(t):n,this.eventName=e;const r=()=>{var e;for(e in s)"_event"!==e&&"_target"!==e&&AFRAME.utils.entity.setComponentProperty.call(this,a,e,s[e])};isNaN(s._delay)?this.eventHandler=r:this.eventHandler=()=>{setTimeout(r,parseFloat(s._delay))}},addEventListener:function(){this.el.addEventListener(this.eventName,this.eventHandler)},removeEventListener:function(){this.el.removeEventListener(this.eventName,this.eventHandler)}})},function(e,t,a){THREE.BufferGeometryUtils||a(47),AFRAME.registerComponent("geometry-merger",{schema:{preserveOriginal:{default:!1}},init:function(){var e=this;this.geometry=new THREE.Geometry,this.mesh=new THREE.Mesh(this.geometry),this.el.setObject3D("mesh",this.mesh),this.faceIndex={},this.vertexIndex={},this.el.object3D.traverse((function(t){"Mesh"===t.type&&t!==e.mesh&&(e.faceIndex[t.parent.uuid]=[e.geometry.faces.length,e.geometry.faces.length+t.geometry.faces.length-1],e.vertexIndex[t.parent.uuid]=[e.geometry.vertices.length,e.geometry.vertices.length+t.geometry.vertices.length-1],t.parent.updateMatrix(),e.geometry.merge(t.geometry,t.parent.matrix),e.data.preserveOriginal||t.parent.remove(t))}))}}),AFRAME.registerComponent("buffer-geometry-merger",{schema:{preserveOriginal:{default:!1}},init:function(){var e=[];this.el.sceneEl.object3D.updateMatrixWorld(),this.el.object3D.traverse((function(t){"Mesh"===t.type&&t.el!==self.el&&(t.geometry.applyMatrix(t.matrixWorld),e.push(t.geometry.clone()),t.parent.remove(t))}));const t=THREE.BufferGeometryUtils.mergeBufferGeometries(e);this.mesh=new THREE.Mesh(t),this.el.setObject3D("mesh",this.mesh)}})},function(e,t){THREE.BufferGeometryUtils={computeTangents:function(e){var t=e.index,a=e.attributes;if(null!==t&&void 0!==a.position&&void 0!==a.normal&&void 0!==a.uv){var s=t.array,n=a.position.array,r=a.normal.array,o=a.uv.array,i=n.length/3;void 0===a.tangent&&e.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*i),4));for(var c=a.tangent.array,d=[],l=[],u=0;ua.max&&this.logs.shift(),this.el.setAttribute("text",{value:this.logs.join("\n")}))},remove:function(){this.el.removeAttribute("text"),this.system.unregisterLogger(this)}})},function(e,t,a){a(52),AFRAME.registerComponent("orbit-controls",{dependencies:["camera"],schema:{autoRotate:{type:"boolean"},autoRotateSpeed:{default:2},dampingFactor:{default:.1},enabled:{default:!0},enableDamping:{default:!0},enableKeys:{default:!0},enablePan:{default:!0},enableRotate:{default:!0},enableZoom:{default:!0},initialPosition:{type:"vec3"},keyPanSpeed:{default:7},minAzimuthAngle:{type:"number",default:1/0},maxAzimuthAngle:{type:"number",default:1/0},maxDistance:{default:1e3},maxPolarAngle:{default:AFRAME.utils.device.isMobile()?90:120},minDistance:{default:1},minPolarAngle:{default:0},minZoom:{default:0},panSpeed:{default:1},rotateSpeed:{default:.05},screenSpacePanning:{default:!1},target:{type:"vec3"},zoomSpeed:{default:.5}},init:function(){var e,t=this.el;this.controls=new THREE.OrbitControls(t.getObject3D("camera"),t.sceneEl.renderer.domElement),e=new THREE.Vector3,t.sceneEl.addEventListener("enter-vr",()=>{(AFRAME.utils.device.checkHeadsetConnected()||AFRAME.utils.device.isMobile())&&(this.controls.enabled=!1,t.hasAttribute("look-controls")&&(t.setAttribute("look-controls","enabled",!0),e.copy(t.getObject3D("camera").position),t.getObject3D("camera").position.set(0,0,0)))}),t.sceneEl.addEventListener("exit-vr",()=>{(AFRAME.utils.device.checkHeadsetConnected()||AFRAME.utils.device.isMobile())&&(this.controls.enabled=!0,t.getObject3D("camera").position.copy(e),t.hasAttribute("look-controls")&&t.setAttribute("look-controls","enabled",!1))}),document.body.style.cursor="grab",document.addEventListener("mousedown",()=>{document.body.style.cursor="grabbing"}),document.addEventListener("mouseup",()=>{document.body.style.cursor="grab"}),this.target=new THREE.Vector3,t.getObject3D("camera").position.copy(this.data.initialPosition)},update:function(e){var t=this.controls,a=this.data;t.target=this.target.copy(a.target),t.autoRotate=a.autoRotate,t.autoRotateSpeed=a.autoRotateSpeed,t.dampingFactor=a.dampingFactor,t.enabled=a.enabled,t.enableDamping=a.enableDamping,t.enableKeys=a.enableKeys,t.enablePan=a.enablePan,t.enableRotate=a.enableRotate,t.enableZoom=a.enableZoom,t.keyPanSpeed=a.keyPanSpeed,t.maxPolarAngle=THREE.Math.degToRad(a.maxPolarAngle),t.maxDistance=a.maxDistance,t.minDistance=a.minDistance,t.minPolarAngle=THREE.Math.degToRad(a.minPolarAngle),t.minZoom=a.minZoom,t.panSpeed=a.panSpeed,t.rotateSpeed=a.rotateSpeed,t.screenSpacePanning=a.screenSpacePanning,t.zoomSpeed=a.zoomSpeed},tick:function(){var e=this.controls;this.data.enabled&&e.enabled&&(e.enableDamping||e.autoRotate)&&this.controls.update()}})},function(e,t){THREE.OrbitControls=function(e,t){var a,s,n,r,o;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new THREE.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:THREE.MOUSE.LEFT,ZOOM:THREE.MOUSE.MIDDLE,PAN:THREE.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=function(){i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(c),i.update(),h=u.NONE},this.update=(a=new THREE.Vector3,s=(new THREE.Quaternion).setFromUnitVectors(e.up,new THREE.Vector3(0,1,0)),n=s.clone().inverse(),r=new THREE.Vector3,o=new THREE.Quaternion,function(){var e=i.object.position;return a.copy(e).sub(i.target),a.applyQuaternion(s),f.setFromVector3(a),i.autoRotate&&h===u.NONE&&P(2*Math.PI/60/60*i.autoRotateSpeed),f.theta+=p.theta,f.phi+=p.phi,f.theta=Math.max(i.minAzimuthAngle,Math.min(i.maxAzimuthAngle,f.theta)),f.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,f.phi)),f.makeSafe(),f.radius*=b,f.radius=Math.max(i.minDistance,Math.min(i.maxDistance,f.radius)),i.target.add(y),a.setFromSpherical(f),a.applyQuaternion(n),e.copy(i.target).add(a),i.object.lookAt(i.target),!0===i.enableDamping?(p.theta*=1-i.dampingFactor,p.phi*=1-i.dampingFactor):p.set(0,0,0),b=1,y.set(0,0,0),!!(g||r.distanceToSquared(i.object.position)>m||8*(1-o.dot(i.object.quaternion))>m)&&(i.dispatchEvent(c),r.copy(i.object.position),o.copy(i.object.quaternion),g=!1,!0)}),this.dispose=function(){i.domElement.removeEventListener("contextmenu",V,!1),i.domElement.removeEventListener("mousedown",Z,!1),i.domElement.removeEventListener("wheel",F,!1),i.domElement.removeEventListener("touchstart",H,!1),i.domElement.removeEventListener("touchend",z,!1),i.domElement.removeEventListener("touchmove",B,!1),document.removeEventListener("mousemove",C,!1),document.removeEventListener("mouseup",U,!1),window.removeEventListener("keydown",q,!1)};var i=this,c={type:"change"},d={type:"start"},l={type:"end"},u={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},h=u.NONE,m=1e-6,f=new THREE.Spherical,p=new THREE.Spherical,b=1,y=new THREE.Vector3,g=!1,v=new THREE.Vector2,A=new THREE.Vector2,w=new THREE.Vector2,S=new THREE.Vector2,E=new THREE.Vector2,T=new THREE.Vector2,k=new THREE.Vector2,R=new THREE.Vector2,N=new THREE.Vector2;function x(){return Math.pow(.95,i.zoomSpeed)}function P(e){p.theta-=e}function j(e){p.phi-=e}var L,M=(L=new THREE.Vector3,function(e,t){L.setFromMatrixColumn(t,0),L.multiplyScalar(-e),y.add(L)}),_=function(){var e=new THREE.Vector3;return function(t,a){e.setFromMatrixColumn(a,1),e.multiplyScalar(t),y.add(e)}}(),D=function(){var e=new THREE.Vector3;return function(t,a){var s=i.domElement===document?i.domElement.body:i.domElement;if(i.object.isPerspectiveCamera){var n=i.object.position;e.copy(n).sub(i.target);var r=e.length();r*=Math.tan(i.object.fov/2*Math.PI/180),M(2*t*r/s.clientHeight,i.object.matrix),_(2*a*r/s.clientHeight,i.object.matrix)}else i.object.isOrthographicCamera?(M(t*(i.object.right-i.object.left)/i.object.zoom/s.clientWidth,i.object.matrix),_(a*(i.object.top-i.object.bottom)/i.object.zoom/s.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}}();function I(e){i.object.isPerspectiveCamera?b/=e:i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom*e)),i.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function O(e){i.object.isPerspectiveCamera?b*=e:i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/e)),i.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function Z(e){if(!1!==i.enabled){switch(e.preventDefault(),e.button){case i.mouseButtons.ORBIT:if(!1===i.enableRotate)return;!function(e){v.set(e.clientX,e.clientY)}(e),h=u.ROTATE;break;case i.mouseButtons.ZOOM:if(!1===i.enableZoom)return;!function(e){k.set(e.clientX,e.clientY)}(e),h=u.DOLLY;break;case i.mouseButtons.PAN:if(!1===i.enablePan)return;!function(e){S.set(e.clientX,e.clientY)}(e),h=u.PAN}h!==u.NONE&&(document.addEventListener("mousemove",C,!1),document.addEventListener("mouseup",U,!1),i.dispatchEvent(d))}}function C(e){if(!1!==i.enabled)switch(e.preventDefault(),h){case u.ROTATE:if(!1===i.enableRotate)return;!function(e){A.set(e.clientX,e.clientY),w.subVectors(A,v);var t=i.domElement===document?i.domElement.body:i.domElement;P(2*Math.PI*w.x/t.clientWidth*i.rotateSpeed),j(2*Math.PI*w.y/t.clientHeight*i.rotateSpeed),v.copy(A),i.update()}(e);break;case u.DOLLY:if(!1===i.enableZoom)return;!function(e){R.set(e.clientX,e.clientY),N.subVectors(R,k),N.y>0?I(x()):N.y<0&&O(x()),k.copy(R),i.update()}(e);break;case u.PAN:if(!1===i.enablePan)return;!function(e){E.set(e.clientX,e.clientY),T.subVectors(E,S),D(T.x,T.y),S.copy(E),i.update()}(e)}}function U(e){!1!==i.enabled&&(document.removeEventListener("mousemove",C,!1),document.removeEventListener("mouseup",U,!1),i.dispatchEvent(l),h=u.NONE)}function F(e){!1===i.enabled||!1===i.enableZoom||h!==u.NONE&&h!==u.ROTATE||(e.preventDefault(),e.stopPropagation(),i.dispatchEvent(d),function(e){e.deltaY<0?O(x()):e.deltaY>0&&I(x()),i.update()}(e),i.dispatchEvent(l))}function q(e){!1!==i.enabled&&!1!==i.enableKeys&&!1!==i.enablePan&&function(e){switch(e.keyCode){case i.keys.UP:D(0,i.keyPanSpeed),i.update();break;case i.keys.BOTTOM:D(0,-i.keyPanSpeed),i.update();break;case i.keys.LEFT:D(i.keyPanSpeed,0),i.update();break;case i.keys.RIGHT:D(-i.keyPanSpeed,0),i.update()}}(e)}function H(e){if(!1!==i.enabled){switch(e.touches.length){case 1:if(!1===i.enableRotate)return;!function(e){v.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=u.TOUCH_ROTATE;break;case 2:if(!1===i.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY,s=Math.sqrt(t*t+a*a);k.set(0,s)}(e),h=u.TOUCH_DOLLY;break;case 3:if(!1===i.enablePan)return;!function(e){S.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=u.TOUCH_PAN;break;default:h=u.NONE}h!==u.NONE&&i.dispatchEvent(d)}}function B(e){if(!1!==i.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===i.enableRotate)return;if(h!==u.TOUCH_ROTATE)return;!function(e){A.set(e.touches[0].pageX,e.touches[0].pageY),w.subVectors(A,v);var t=i.domElement===document?i.domElement.body:i.domElement;P(2*Math.PI*w.x/t.clientWidth*i.rotateSpeed),j(2*Math.PI*w.y/t.clientHeight*i.rotateSpeed),v.copy(A),i.update()}(e);break;case 2:if(!1===i.enableZoom)return;if(h!==u.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY,s=Math.sqrt(t*t+a*a);R.set(0,s),N.subVectors(R,k),N.y>0?O(x()):N.y<0&&I(x()),k.copy(R),i.update()}(e);break;case 3:if(!1===i.enablePan)return;if(h!==u.TOUCH_PAN)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY),T.subVectors(E,S),D(T.x,T.y),S.copy(E),i.update()}(e);break;default:h=u.NONE}}function z(e){!1!==i.enabled&&(i.dispatchEvent(l),h=u.NONE)}function V(e){!1!==i.enabled&&e.preventDefault()}i.domElement.addEventListener("contextmenu",V,!1),i.domElement.addEventListener("mousedown",Z,!1),i.domElement.addEventListener("wheel",F,!1),i.domElement.addEventListener("touchstart",H,!1),i.domElement.addEventListener("touchend",z,!1),i.domElement.addEventListener("touchmove",B,!1),window.addEventListener("keydown",q,!1),this.update()},THREE.OrbitControls.prototype=Object.create(THREE.EventDispatcher.prototype),THREE.OrbitControls.prototype.constructor=THREE.OrbitControls,Object.defineProperties(THREE.OrbitControls.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}})},function(e,t){AFRAME.registerComponent("proxy-event",{schema:{captureBubbles:{default:!1},enabled:{default:!0},event:{type:"string"},from:{type:"string"},to:{type:"string"},as:{type:"string"},bubbles:{default:!1}},multiple:!0,init:function(){var e,t,a,s=this.data,n=this.el,r=this;if(s.from?e="PARENT"===s.from?[n.parentNode]:document.querySelectorAll(s.from):a="CHILDREN"===s.to?n.querySelectorAll("*"):"SELF"===s.to?[n]:document.querySelectorAll(s.to),s.from)for(t=0;t{"nonrecursive"!==this.id&&e.detail.object.traverse(this.set)})},update:function(){"nonrecursive"===this.id?this.set(this.el.object3D):this.el.object3D.traverse(this.set)},set:function(e){isNaN(this.data)?e.renderOrder=this.system.order[this.data]:e.renderOrder=parseFloat(this.data)}}),AFRAME.registerComponent("render-order-recursive",{init:function(){this.el.addEventListener("child-attached",e=>{e.detail.el.setAttribute("render-order",this.el.getAttribute("render-order"))})}})},function(e,t,a){var s;"undefined"!=typeof self&&self,s=function(){return function(e){var t={};function a(s){if(t[s])return t[s].exports;var n=t[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,a),n.l=!0,n.exports}return a.m=e,a.c=t,a.d=function(e,t,s){a.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:s})},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=1)}([function(e,t,a){"use strict";var s={};e.exports.select=function(e,t,a){return s[t]||(s[t]=new Function("state","item","return "+c(t)+";")),s[t](e,a)};var n=/\.([A-Za-z][\w_-]*)/g,r=/([=&|!?:+-])(\s*)([\(]?)([A-Za-z][\w_-]*)/g,o=/^([\(]?)([A-Za-z][\w_-]*)/g,i=/state\["item"\]/g;function c(e){return e=(e=(e=(e=e.replace(n,'["$1"]')).replace(o,'$1state["$2"]')).replace(r,'$1$2$3state["$4"]')).replace(i,"item")}function d(){var e=arguments;return function(){var t;for(t=0;t","<","<=",">="],u=/\s+/,h=/\(|\)|\!/g;function m(e){return-1===(e=function(e){return 0===e.indexOf("!!")?e.replace("!!",""):0===e.indexOf("!")?e.replace("!",""):e}(e.trim())).indexOf(".")?e:e.substring(0,e.indexOf("."))}e.exports.parseKeysToWatch=function(e,t,a){var s,n;for(n=p(t,u),s=0;s [data-bind-for-active="false"]'))(s=o.querySelector('[data-bind-for-active="false"]')).setAttribute("data-bind-for-key",c),s.setAttribute("data-bind-for-value",d),s.object3D.visible=!0,s.play(),s.setAttribute("data-bind-for-active","true"),s.emit("bindforupdateinplace",i,!1);else{var l=this.generateFromTemplate(i,a);l.addEventListener("loaded",(function(){l.emit("bindforupdateinplace",i,!1)})),o.appendChild(l)}this.renderedKeys.push(d)}else-1!==t.indexOf(d)&&(e.length&&e[0].constructor===String?(s=o.querySelector('[data-bind-for-value="'+d+'"]')).setAttribute("data-bind-for-key",a):s=o.querySelector('[data-bind-for-key="'+c+'"]'),s.emit("bindforupdateinplace",i,!1));e[a+1]&&(this.data.delay?setTimeout((function(){n.renderItemsInPlace(e,t,a+1)}),this.data.delay):this.renderItemsInPlace(e,t,a+1))},generateFromTemplate:function(e,t){var a=this.data;this.el.appendChild(this.system.renderTemplate(this.template,e));var s=this.el.children[this.el.children.length-1];if(!e)return s.setAttribute("data-bind-for-key",""),s.setAttribute("data-bind-for-active","false"),s;var n=this.getBindForKey(e,t);return s.setAttribute("data-bind-for-key",n),a.key||s.setAttribute("data-bind-for-value",e),s.setAttribute("data-bind-for-active","true"),s},getElsToRemove:(s=[],function(e,t){var a=this.data,n=this.el;s.length=0;for(var r=0;r{n[e]={},n[e].START="thumb"+e+"start",n[e].END="thumb"+e+"end"});AFRAME.registerComponent("thumb-controls",{schema:{thresholdAngle:{default:89.5},thresholdPad:{default:.05},thresholdStick:{default:.75}},init:function(){var e=this.el;this.onTrackpadDown=this.onTrackpadDown.bind(this),this.onTrackpadUp=this.onTrackpadUp.bind(this),this.directionStick="",this.directionTrackpad="",e.components["tracked-controls"]&&(this.axis=e.components["tracked-controls"].axis),this.type="STICK",e.addEventListener("controllerconnected",t=>{this.axis=e.components["tracked-controls"].axis,"oculus-touch-controls"!==t.detail.name&&"windows-motion-controls"!==t.detail.name?this.type="PAD":this.type="STICK"})},play:function(){var e=this.el;e.addEventListener("trackpaddown",this.onTrackpadDown),e.addEventListener("trackpadup",this.onTrackpadUp),e.addEventListener("touchpaddown",this.onTrackpadDown),e.addEventListener("touchpadup",this.onTrackpadUp)},pause:function(){var e=this.el;e.removeEventListener("trackpaddown",this.onTrackpadDown),e.removeEventListener("trackpadup",this.onTrackpadUp),e.removeEventListener("touchpaddown",this.onTrackpadDown),e.removeEventListener("touchpadup",this.onTrackpadUp)},onTrackpadDown:function(){var e,t=this.el;this.getDistance()this.data.thresholdStick){if(!(e=this.getDirection()))return;return this.directionStick=e,t.emit(n.NULL.START,null,!1),void t.emit(n[this.directionStick].START,null,!1)}this.directionStick&&this.getDistance()360&&(o-=360),(t=a[n]-r)<0&&(e>=360+t&&e<=360||e>=0&&e<=o))return s[n];if(e>=t&&e<=o)return s[n]}},getAngle:function(){var e,t=this.axis;return this.axis?((e="PAD"===this.type?Math.atan2(-t[1],t[0]):Math.atan2(-t[3],t[2]))<0&&(e=2*Math.PI+e),THREE.Math.radToDeg(e)):0}}),AFRAME.registerComponent("thumb-controls-debug",{dependencies:["thumb-controls"],schema:{controllerType:{type:"string"},hand:{type:"string"},enabled:{default:!1}},init:function(){var e,t,a,s,n=this.el;if(this.data.enabled||AFRAME.utils.getUrlParameter("debug-thumb")){console.log("%c debug-thumb","background: #111; color: red");var r=function(){n.components["tracked-controls"].handleAxes=()=>{},a={axis:t=[0,0,0]},n.components["tracked-controls"].axis=t,n.components["thumb-controls"].axis=t};n.components["tracked-controls"]?r():this.el.addEventListener("controllerconnected",(function(){r()})),(s=this.createCanvas()).addEventListener("click",s=>{"vive-controls"===this.data.controllerType?e?n.emit("trackpadup"):n.emit("trackpaddown"):e&&(t[0]=0,t[1]=0,n.emit("axismove",a,!1)),e=!e}),s.addEventListener("mousemove",r=>{var o;e&&(o=s.getBoundingClientRect(),t[0]=(r.clientX-o.left)/240*2-1,t[1]=(r.clientY-o.top)/240*2-1,n.emit("axismove",a,!1))}),s.addEventListener("mouseleave",s=>{e&&(t[0]=0,t[1]=0,n.emit("axismove",a,!1))})}},createCanvas:function(){var e,t;return(e=document.createElement("canvas")).classList.add("debugThumb"),e.height=240,e.width=240,e.style.bottom=0,e.style.borderRadius="250px",e.style.opacity=.5,e.style.position="fixed",e.style.zIndex=999999999,"left"===this.data.hand?e.style.left=0:e.style.right=0,(t=e.getContext("2d")).fillStyle="#333",t.fillRect(0,0,240,240),document.body.appendChild(e),e}})},function(e,t,a){var s={"./active-item.js":59,"./beat-cut-fx.js":60,"./beat-generator.js":15,"./beat-hit-sound.js":61,"./beat.js":21,"./blade.js":62,"./check-vr.js":63,"./console-shortcuts.js":64,"./controller.js":65,"./copy-texture.js":66,"./cursor-laser.js":67,"./cursor-mesh.js":68,"./curve-follow-rig-reset.js":69,"./cutfx-shader.js":70,"./debug-beat-generator.js":73,"./debug-beat-positioning.js":74,"./debug-controller.js":75,"./debug-cursor.js":76,"./debug-intro.js":77,"./debug-song-time.js":78,"./debug-state.js":79,"./delayed-proxy-event.js":80,"./difficulty-background.js":81,"./difficulty-filter.js":82,"./difficulty-text.js":83,"./follow-position.js":84,"./follow-z.js":85,"./gameover.js":86,"./gpu-preloader.js":87,"./gradient-shader.js":88,"./hand-swapper.js":90,"./handstar-shader.js":91,"./haptics-wall.js":94,"./haptics-weapon.js":95,"./headfist.js":96,"./history.js":97,"./intro-song.js":98,"./keyboard-raycastable.js":99,"./leaderboard.js":100,"./materials.js":107,"./menu-controls.js":122,"./menu-difficulty-select.js":123,"./menu-genre.js":124,"./menu-midsection.js":125,"./menu-mode.js":126,"./menu-playlist-button.js":127,"./menu-playlist.js":128,"./menu-selected-challenge-image.js":129,"./menu-slide-animation.js":130,"./multiplier-ring.js":131,"./no-frustum-cull.js":132,"./panel-shader.js":133,"./pause.js":136,"./pauser.js":137,"./play-sound.js":138,"./player-height.js":140,"./plume.js":141,"./punch.js":142,"./raycaster-target.js":143,"./recenter.js":144,"./ring.js":145,"./score-texts.js":148,"./search-thumbnail-atlas.js":149,"./search.js":150,"./song-info-positioner.js":153,"./song-preview.js":154,"./song-progress-info.js":155,"./song.js":156,"./stage-colors.js":157,"./stage-lasers.js":158,"./stars.js":159,"./stats-param.js":160,"./stepback.js":161,"./sub-object.js":162,"./super-keyboard.js":163,"./supercurve-color.js":164,"./supercurve-shader.js":165,"./supercurve.js":168,"./supercutfx-shader.js":171,"./supercutfx.js":172,"./tail.js":173,"./text-counter.js":174,"./text-geometry.js":175,"./text-truncate.js":176,"./text-uppercase.js":177,"./toggle-pause-play.js":178,"./trail.js":179,"./tunnels.js":180,"./vertex-colors-buffer.js":181,"./victory-accuracy-ring.js":182,"./victory-rank.js":183,"./visible-raycastable.js":184,"./wall-shader.js":185,"./wall.js":188,"./weapon-particles.js":189,"./zip-loader.js":190};function n(e){var t=r(e);return a(t)}function r(e){if(!a.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}n.keys=function(){return Object.keys(s)},n.resolve=r,e.exports=n,n.id=58},function(e,t,a){if(AFRAME.registerComponent("active-item",{dependencies:["material"],schema:{active:{default:!1},opacity:{default:1}},init:function(){this.defaultOpacity=this.el.getAttribute("material").opacity,this.materialObj={opacity:this.data.opacity}},update:function(){var e=this.el;this.data.active?(e.setAttribute("material",this.materialObj),e.object3D.visible=!0):(e.setAttribute("material","opacity",this.defaultOpacity),e.components.animation__mouseleave&&setTimeout(()=>{e.emit("mouseleave",null,!1)}))}}),AFRAME.registerComponent("active-text-color",{dependencies:["text"],schema:{active:{default:!1},color:{default:"#333"}},init:function(){this.defaultColor=this.el.getAttribute("text").color},update:function(){var e=this.el;this.data.active?e.setAttribute("text","color",this.data.color):e.setAttribute("text","color",this.defaultColor)}}),window.AFRAME){const t=["active-item","active-text-color"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;sMath.abs(t.y)?"right":"down"),t.z*=.01,s.copy(t).multiplyScalar(-.0025).clampLength(0,.01);for(let t=0;t{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{AFRAME.utils.device.checkHeadsetConnected()&&this.el.emit("displayconnected")},250)}}),window.AFRAME){const t=[],a=[],s=["check-vr"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;sdocument.querySelector(e),window.$$=e=>document.querySelectorAll(e),window.$$$=e=>document.querySelector(`[${e}]`).getAttribute(e),window.$$$$=e=>document.querySelector(`[${e}]`).components[e],window.scene=this.el,window.state=this.el.systems.state.state}}),window.AFRAME){const t=["console-shortcuts"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{this.controllerType=e.detail.name,this.el.setAttribute("cursor",this.config[this.controllerType].cursor||{})});const a={hand:t.hand,model:!1};e.setAttribute("daydream-controls",a),e.setAttribute("oculus-go-controls",a),e.setAttribute("oculus-touch-controls",{hand:t.hand,model:!1,orientationOffset:{x:0,y:0,z:0}}),e.setAttribute("vive-controls",a),e.setAttribute("vive-focus-controls",a),e.setAttribute("windows-motion-controls",a),e.setAttribute("generic-tracked-controller-controls",a)},config:{"daydream-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"oculus-go-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"oculus-touch-controls":{cursor:{downEvents:["triggerdown","gripdown","abuttondown","bbuttondown","xbuttondown","ybuttondown"],upEvents:["triggerup","gripup","abuttonup","bbuttonup","xbuttonup","ybuttonup"]}},"vive-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"vive-focus-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"windows-motion-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"generic-tracked-controller-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]}}}}),window.AFRAME){const t=["controller"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{this.copyTexture()}),this.copyTexture()},copyTexture:function(){const e=this.el,t=this.data.from,a=e.getObject3D("mesh").material;t.getObject3D("mesh")&&(a.map=t.getObject3D("mesh").material.map,a.map&&(a.map.needsUpdate=!0,a.needsUpdate=!0))}}),window.AFRAME){const t=["copy-texture"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{this.reset()})},update:function(e){const t=this.data;this.el;!e.isVictory&&t.isVictory&&this.reset()},reset:function(){this.el.components["supercurve-follow"].curveProgress=0,this.el.object3D.position.set(0,0,0),this.el.object3D.rotation.set(0,0,0)}}),window.AFRAME){const t=["curve-follow-rig-reset"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{t.spawn()});r.style.width="460px",r.style.bottomMargin="10px"}()},addDebugStageControls:function(){var e=0;const t=(t,a,s)=>{const n=document.createElement("div");n.style.position="absolute",n.id="stagecontrol"+t,n.style.width="100px",n.style.height="30px",n.style.top="element"===s?"20px":"70px",n.style.background="#000",n.style.color="#fff",n.style.zIndex=999999999,n.style.padding="5px",n.style.font="14px sans-serif",n.style.textAlign="center",n.style.cursor="pointer",n.style.left=20+120*t+"px",n.innerHTML=a,"element"===s?n.addEventListener("click",()=>{document.getElementById("stagecontrol"+e).style.background="#000",n.style.background="#66f",e=t}):n.addEventListener("click",()=>{this.beatLoader.generateEvent({_type:e,_value:t})}),document.body.appendChild(n)};["sky","tunnelNeon","leftStageLasers","rightStageLasers","floor"].forEach((e,a)=>{t(a,e,"element")}),["off","blue","blue","bluefade","","red","red","redfade"].forEach((e,a)=>{t(a,e,"value")})}}),window.AFRAME){const t=["debug-beat-generator"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{const t=this.el.sceneEl.components["beat-generator"];t.data.gameMode=e,scene.components["beat-system"].data.gameMode=e,scene.components["beat-system"].updateBeatPositioning(),s.forEach(a=>{n.forEach(s=>{let n=t.requestBeat("punch"===e?"dot":"arrow","red"),r=Math.random()<.5?"left":"right";n.components.beat.onGenerate(.001,a,s,r),n.object3D.renderOrder=9999,n.play(),n=t.requestBeat("dot","blue"),r=Math.random()<.5?"down":"up",n.components.beat.onGenerate(.0015,a,s,r),n.object3D.renderOrder=9999,n.play()})});const a=scene.components.pool__wall.requestEntity();a.components.wall.onGenerate(.0015,"left",4,4,!0),a.play(),document.getElementById("beatContainer").removeAttribute("bind__visible"),document.getElementById("beatContainer").object3D.visible=!0},500))}}),window.AFRAME){const t=["debug-beat-positioning"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{t.isTrusted&&(e.emit("triggerdown"),e.emit("triggerup"))}),"oculus"===AFRAME.utils.getUrlParameter("debug")?(e.emit("controllerconnected",{name:"oculus-touch-controls"}),t.emit("controllerconnected",{name:"oculus-touch-controls"}),e.setAttribute("controller","controllerType","oculus-touch-controls"),t.setAttribute("controller","controllerType","oculus-touch-controls")):(e.emit("controllerconnected",{name:"vive-controls"}),t.emit("controllerconnected",{name:"vive-controls"}),e.setAttribute("controller","controllerType","vive-controls"),t.setAttribute("controller","controllerType","vive-controls")),this.el.emit("enter-vr",null,!1),document.addEventListener("keydown",a=>{var s,n,r,o;a.shiftKey&&(32!==a.keyCode?81!==a.keyCode?(78===a.keyCode&&(this.secondaryGripDown?(t.emit("gripup"),this.secondaryGripDown=!1):(t.emit("gripdown"),this.secondaryGripDown=!0)),77===a.keyCode&&(this.primaryGripDown?(e.emit("gripup"),this.primaryGripDown=!1):(e.emit("gripdown"),this.primaryGripDown=!0)),49===a.keyCode&&t.emit("menudown"),a.ctrlKey?(r=t.getAttribute("position"),72===a.keyCode&&(r.x-=.02),74===a.keyCode&&(r.y-=.02),75===a.keyCode&&(r.y+=.02),76===a.keyCode&&(r.x+=.02),59!==a.keyCode&&186!==a.keyCode||(r.z-=.01),222===a.keyCode&&(r.z+=.01),t.setAttribute("position",AFRAME.utils.clone(r))):(s=e.getAttribute("position"),72===a.keyCode&&(s.x-=.02),74===a.keyCode&&(s.y-=.02),75===a.keyCode&&(s.y+=.02),76===a.keyCode&&(s.x+=.02),59!==a.keyCode&&186!==a.keyCode||(s.z-=.02),222===a.keyCode&&(s.z+=.02),e.setAttribute("position",AFRAME.utils.clone(s))),a.ctrlKey?(o=t.getAttribute("rotation"),89===a.keyCode&&(o.x-=10),79===a.keyCode&&(o.x+=10),85===a.keyCode&&(o.y-=10),73===a.keyCode&&(o.y+=10),t.setAttribute("rotation",AFRAME.utils.clone(o))):(n=e.getAttribute("rotation"),89===a.keyCode&&(n.x-=10),79===a.keyCode&&(n.x+=10),85===a.keyCode&&(n.y-=10),73===a.keyCode&&(n.y+=10),e.setAttribute("rotation",AFRAME.utils.clone(n)))):this.isSecondaryTriggerDown?(t.emit("triggerup"),this.isSecondaryTriggerDown=!1):(t.emit("triggerdown"),this.isSecondaryTriggerDown=!0):this.isTriggerDown?(e.emit("triggerup"),this.isTriggerDown=!1):(e.emit("triggerdown"),this.isTriggerDown=!0))})))},play:function(){var e,t;if(this.bounds=document.body.getBoundingClientRect(),!AFRAME.utils.getUrlParameter("debug"))return;if(AFRAME.utils.getUrlParameter("headfist"))return;e=document.getElementById("rightHand"),(t=document.getElementById("leftHand")).object3D.position.set(-.2,1.5,-.5),e.object3D.position.set(.2,1.5,-.5),t.setAttribute("rotation",{x:35,y:0,z:0});const a=AFRAME.utils.getUrlParameter("type");[e,t].forEach(e=>{e.querySelector(".laser").object3D.visible=!1,"classic"===a?(e.querySelector(".bladeContainer").removeAttribute("bind__visible"),e.querySelector(".bladeContainer").object3D.visible=!0,e.querySelector(".bladeContainer").object3D.scale.set(1,1,1)):"punch"===a?(e.querySelector(".punch").removeAttribute("bind__visible"),e.querySelector(".punch").object3D.visible=!0,e.querySelector(".punch").object3D.visible=!0,e.querySelector(".bladeHandle").object3D.visible=!1):"ride"===a&&(e.querySelector(".handStar").removeAttribute("bind__visible"),e.querySelector(".handStar").object3D.visible=!0,e.querySelector(".bladeHandle").object3D.visible=!1)})},onMouseMove:function(){const e=new THREE.Vector3,t=new THREE.Vector2,a=new THREE.Vector3;return function(s){const n=this.bounds,r=this.el.sceneEl.camera,o=s.clientX-n.left,i=s.clientY-n.top;t.x=o/n.width*2-1,t.y=-i/n.height*2-1,document.getElementById("camera").object3D.getWorldPosition(a),e.set(t.x,t.y,.5).unproject(r).sub(a).normalize();const c=document.getElementById("rightHand").object3D.position,d=-a.z/e.z;r.getWorldPosition(c).add(e.multiplyScalar(d)),c.y+=.8}}()}),window.AFRAME){const t=["debug-controller"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{console.log(this.el.components.song.getCurrentTime())},250)}}),window.AFRAME){const t=["debug-song-time"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.split(",").forEach(e=>{this.el.sceneEl.emit("debug"+e.trim(),null,!1)})},500)}}),window.AFRAME){const t=["debug-state"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{var s=r.data;if(s.enabled&&(s.captureBubbles||e.target===n))for(t=0;t{var t=a.data;t.enabled&&(t.captureBubbles||s.target===e)&&a.el.emit(t.as||t.event,s.detail?s.detail:null,!1)},t.delay)}))}}),window.AFRAME){const t=["delayed-proxy-event"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s=0&&(this.beatContainer.object3D.position.z=1.5*-Math.pow(1-this.countDown,2),this.countDown-=t/1e3)},reset:function(){this.beatContainer.object3D.position.z=0,this.el.sceneEl.setAttribute("stage-colors","color","blue")},triggerAnimations:function(){for(let e=0;e{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{this.preloadFromSelector("#mainLogo"),this.preloadFromSelector("#prevArrow"),this.preloadFromSelector("#stepback"),this.preloadFromSelector(".difficultyBackground"),this.preloadFromSelector(".genreIcon"),this.preloadFromSelector(".merkababloom"),this.preloadFromSelector(".searchResultBackground"),this.preloadMaterialsComponentTextures(),this.preloadKeyboard(),this.preloadSlice(),this.preloadEnvMap(),this.preloadFXs()},1e3)},preloadFromSelector:function(e){const t=document.querySelector(e);this.preloadTexture(t.getObject3D("mesh").material.map)},preloadMaterialsComponentTextures:function(){const e=this.el.systems.materials.textureList;for(var t=0;t{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{this.el.addEventListener(e,this.swapHand)})},swapHand:function(){this.data.enabled&&this.el.sceneEl.emit("activehandswap",null,!1)}}),window.AFRAME){const t=["hand-swapper"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{if(!t.detail||!t.detail.intersectedEl||!this.data.enabled)return;const a=t.detail.intersectedEl;a.classList.contains("blade")&&a!==e?(this.isColliding=!0,this.el.components.haptics__weapon.pulse()):this.isColliding=!1}),e.addEventListener("mouseleave",e=>{this.isColliding=!1})},tick:function(){this.isColliding&&this.data.enabled&&this.el.components.haptics__weapon.pulse()}}),window.AFRAME){const t=["haptics-weapons"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{this.username=e.detail.value,localStorage.setItem("moonriderusername",this.username)}),this.el.addEventListener("leaderboardsubmit",this.addScore.bind(this))},update:function(e){!s.apps.length&&this.data.apiKey&&(s.initializeApp({apiKey:this.data.apiKey,authDomain:this.data.authDomain,databaseURL:this.data.databaseURL,projectId:this.data.projectId,storageBucket:this.data.storageBucket,messagingSenderId:this.data.messagingSenderId}),this.firestore=s.firestore(),this.firestore.settings({}),this.db=this.firestore.collection("scores")),!e.isVictory&&this.data.isVictory&&this.checkLeaderboardQualify(),this.data.difficulty&&e.difficulty!==this.data.difficulty||this.data.menuSelectedChallengeId&&e.menuSelectedChallengeId!==this.data.menuSelectedChallengeId?this.fetchScores(this.data.menuSelectedChallengeId):this.data.challengeId&&e.challengeId!==this.data.challengeId&&this.fetchScores(this.data.challengeId)},addScore:function(){const e=this.el.sceneEl.systems.state.state;if(!e.isVictory||!e.inVR)return;const t={accuracy:e.score.accuracy,challengeId:e.challenge.id,gameMode:this.data.gameMode,score:e.score.score,username:this.username,difficulty:this.data.difficulty||e.challenge.difficulty,time:new Date};n.includes(this.username.toLowerCase())||this.username.match(r)||this.db.add(t),this.addEventDetail.scoreData=t,this.el.emit("leaderboardscoreadded",this.addEventDetail,!1)},fetchScores:function(e){if("ride"===this.data.gameMode)return;const t=this.el.sceneEl.systems.state.state;this.db.where("challengeId","==",e).where("difficulty","==",t.menuSelectedChallenge.id?t.menuSelectedChallenge.difficulty:t.challenge.difficulty).where("gameMode","==",this.data.gameMode).orderBy("score","desc").orderBy("time","asc").limit(10).get().then(t=>{this.eventDetail.challengeId=e,this.scores.length=0,t.empty||t.forEach(e=>this.scores.push(e.data())),this.el.sceneEl.emit("leaderboard",this.eventDetail,!1)}).catch(e=>{console.error("[firestore]",e)})},checkLeaderboardQualify:function(){const e=this.el.sceneEl.systems.state.state.score.score;if(!AFRAME.utils.getUrlParameter("dot")){if(this.scores.length<10)return this.qualifyingIndex=this.scores.length,void this.el.sceneEl.emit("leaderboardqualify",this.scores.length,!1);for(let t=0;tthis.scores[t].score)return this.qualifyingIndex=t,void this.el.sceneEl.emit("leaderboardqualify",t,!1)}}}),window.AFRAME){const t=["leaderboard"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s=(null!=s?s:t.logLevel)&&e({level:r[a].toLowerCase(),message:i,args:n,type:t.name})}},s=0,n=o;s{},console.timeEnd=()=>{},a(41),a(42),a(43),a(44),a(45),a(46),a(48),a(49),AFRAME.log=()=>{},a(51),a(53),a(54),a(55),a(56),a(57),s(a(58)),s(a(191)),a(195),a(202),e.hot.accept(),document.addEventListener("DOMContentLoaded",()=>{!function(){const e=document.querySelector("form");if(!e)return;if(localStorage.getItem("subscribeClosed")){const t=e.parentNode;return void t.parentNode.removeChild(t)}document.getElementById("subscribeClose").addEventListener("click",()=>{const t=e.parentNode;t.parentNode.removeChild(t),localStorage.setItem("subscribeClosed",!0)});const t=e.querySelector(".submit"),a=e.querySelector('input[type="email"]'),s=document.querySelector("#subscribeForm > h2");let n="";s&&(n=s.innerHTML);e.addEventListener("submit",e=>{e.preventDefault();const a=new XMLHttpRequest;let n="http://localhost:5000/mail/subscribe";return n="https://supermedium.com/mail/subscribe",a.open("POST",n),a.addEventListener("load",()=>{200!==parseInt(a.status,10)&&(window.location.href="https://supermedium/subscribe/"),t&&(t.disabled=!0,t.innerHTML="Subscribed!"),s&&(s.innerHTML="Successfully subscribed, thank you!")}),a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),a.send(JSON.stringify({email:document.querySelector('[name="email"]').value,source:"moonrider"})),!1}),t&&a.addEventListener("keydown",()=>{t.hasAttribute("disabled")&&(t.innerHTML="Subscribe",t.removeAttribute("disabled")),s&&n&&(s.innerHTML=n)})}()}),"http:"!==window.location.protocol||window.location.host.startsWith("localhost")||window.location.replace("https:"+location.href.substring(location.protocol.length))},function(e,t){THREE.BufferGeometryUtils={computeTangents:function(e){var t=e.index,a=e.attributes;if(null!==t&&void 0!==a.position&&void 0!==a.normal&&void 0!==a.uv){var s=t.array,n=a.position.array,r=a.normal.array,o=a.uv.array,i=n.length/3;void 0===a.tangent&&e.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*i),4));for(var c=a.tangent.array,d=[],l=[],u=0;u0){p=p.clone();for(var b=0;b=s.x&&this.boxMin.y<=n.y&&this.boxMax.y>=s.y&&this.boxMin.z<=n.z&&this.boxMax.z>=s.z}}(),setDirty:function(){this.dirty=!0},refreshObjects:function(){const e=this.data;this.objectEls=e.objects?this.el.sceneEl.querySelectorAll(e.objects):this.el.sceneEl.children,this.dirty=!1}})},function(e,t){var a=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function s(e,t,s,n){const r=1/n,o=1/s;return a[0].set(r*t,o*e+o),a[1].set(r*t,o*e),a[2].set(r*t+r,o*e),a[3].set(r*t+r,o*e+o),a}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const e=this.data,t=s(e.row-1,e.column-1,e.totalRows,e.totalColumns),a=this.el.getObject3D("mesh").geometry;a.faceVertexUvs[0][0][0].copy(t[0]),a.faceVertexUvs[0][0][1].copy(t[1]),a.faceVertexUvs[0][0][2].copy(t[3]),a.faceVertexUvs[0][1][0].copy(t[1]),a.faceVertexUvs[0][1][1].copy(t[2]),a.faceVertexUvs[0][1][2].copy(t[3]),a.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const e=this.canvas=document.createElement("canvas");e.id=this.data.canvasId,e.height=this.data.canvasHeight,e.width=this.data.canvasWidth,this.ctx=e.getContext("2d"),document.body.appendChild(e),this.data.debug&&(e.style.left=0,e.style.top=0,e.style.position="fixed",e.style.zIndex=9999999999)},drawTexture:function(e,t,a,n,r){const o=this.canvas,i=this.data;e.complete||(e.onload=()=>{this.drawTexture(e,t,a)});const c=r||o.height/i.numRows,d=n||o.width/i.numColumns;return this.ctx.drawImage(e,d*t,d*a,d,c),s(t,a,i.numRows,i.numColumns)}}),e.exports.getGridUvs=s},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var a={};AFRAME.registerComponent("audioanalyser",{schema:{buffer:{default:!1},beatDetectionDecay:{default:.99},beatDetectionMinVolume:{default:15},beatDetectionThrottle:{default:250},cache:{default:!1},enabled:{default:!0},enableBeatDetection:{default:!0},enableLevels:{default:!0},enableWaveform:{default:!0},enableVolume:{default:!0},fftSize:{default:2048},smoothingTimeConstant:{default:.8},src:{parse:function(e){return e.constructor!==String?e:e.startsWith("#")||e.startsWith(".")?document.querySelector(e):e}},unique:{default:!1}},init:function(){this.audioEl=null,this.levels=null,this.waveform=null,this.volume=0,this.xhr=null,this.initContext()},update:function(e){var t=this.analyser,a=this.data;e.fftSize===a.fftSize&&e.smoothingTimeConstant===a.smoothingTimeConstant||(t.fftSize=a.fftSize,t.smoothingTimeConstant=a.smoothingTimeConstant,this.levels=new Uint8Array(t.frequencyBinCount),this.waveform=new Uint8Array(t.fftSize)),a.src&&this.refreshSource()},tick:function(e,t){var a,s=this.data;if(s.enabled){if((s.enableLevels||s.enableVolume)&&this.analyser.getByteFrequencyData(this.levels),s.enableWaveform&&this.analyser.getByteTimeDomainData(this.waveform),s.enableVolume||s.enableBeatDetection){for(var n=0,r=0;rthis.beatCutOff&&a>this.data.beatDetectionMinVolume?(this.el.emit("audioanalyserbeat",null,!1),this.beatCutOff=1.5*a,this.beatTime=0):this.beatTime<=this.data.beatDetectionThrottle?this.beatTime+=t:(this.beatCutOff*=this.data.beatDetectionDecay,this.beatCutOff=Math.max(this.beatCutOff,this.data.beatDetectionMinVolume)))}},initContext:function(){var e,t=this.data;this.context=new(window.webkitAudioContext||window.AudioContext),e=this.analyser=this.context.createAnalyser(),(this.gainNode=this.context.createGain()).connect(e),e.connect(this.context.destination),e.fftSize=t.fftSize,e.smoothingTimeConstant=t.smoothingTimeConstant,this.levels=new Uint8Array(e.frequencyBinCount),this.waveform=new Uint8Array(e.fftSize)},refreshSource:function(){this.analyser;var e=this.data;e.buffer&&e.src.constructor===String?this.getBufferSource().then(e=>{this.source=e,this.source.connect(this.gainNode)}):(this.source=this.getMediaSource(),this.source.connect(this.gainNode))},suspendContext:function(){this.context.suspend()},resumeContext:function(){this.context.resume()},fetchAudioBuffer:function(e){return a[e]?a[e].constructor===Promise?a[e]:Promise.resolve(a[e]):(this.data.cache||Object.keys(a).forEach((function(e){delete a[e]})),a[e]=new Promise(t=>{const s=this.xhr=new XMLHttpRequest;s.open("GET",e),s.responseType="arraybuffer",s.addEventListener("load",()=>{function n(s){a[e]=s,t(s)}const r=this.context.decodeAudioData(s.response,n);r&&r.constructor===Promise&&r.then(n).catch(console.error)}),s.send()}),a[e])},getBufferSource:function(){var e=this.data;return this.fetchAudioBuffer(e.src).then(()=>{var t;return(t=this.context.createBufferSource()).buffer=a[e.src],this.el.emit("audioanalyserbuffersource",t,!1),t}).catch(console.error)},getMediaSource:function(){const e={};return function(){const t=this.data.src.constructor===String?this.data.src:this.data.src.src;if(e[t])return e[t];this.data.src.constructor===String?(this.audio=document.createElement("audio"),this.audio.crossOrigin="anonymous",this.audio.setAttribute("src",this.data.src)):this.audio=this.data.src;const a=this.context.createMediaElementSource(this.audio);return e[t]=a,a}}()})},function(e,t){var a=AFRAME.utils.styleParser;if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("event-set",{schema:{default:"",parse:function(e){return a.parse(e)}},multiple:!0,init:function(){this.eventHandler=null,this.eventName=null},update:function(e){this.removeEventListener(),this.updateEventListener(),this.addEventListener()},remove:function(){this.removeEventListener()},pause:function(){this.removeEventListener()},play:function(){this.addEventListener()},updateEventListener:function(){var e,t,a,s=this.data,n=this.el;e=s._event||this.id,t=s._target,a=t?n.sceneEl.querySelector(t):n,this.eventName=e;const r=()=>{var e;for(e in s)"_event"!==e&&"_target"!==e&&AFRAME.utils.entity.setComponentProperty.call(this,a,e,s[e])};isNaN(s._delay)?this.eventHandler=r:this.eventHandler=()=>{setTimeout(r,parseFloat(s._delay))}},addEventListener:function(){this.el.addEventListener(this.eventName,this.eventHandler)},removeEventListener:function(){this.el.removeEventListener(this.eventName,this.eventHandler)}})},function(e,t,a){THREE.BufferGeometryUtils||a(47),AFRAME.registerComponent("geometry-merger",{schema:{preserveOriginal:{default:!1}},init:function(){var e=this;this.geometry=new THREE.Geometry,this.mesh=new THREE.Mesh(this.geometry),this.el.setObject3D("mesh",this.mesh),this.faceIndex={},this.vertexIndex={},this.el.object3D.traverse((function(t){"Mesh"===t.type&&t!==e.mesh&&(e.faceIndex[t.parent.uuid]=[e.geometry.faces.length,e.geometry.faces.length+t.geometry.faces.length-1],e.vertexIndex[t.parent.uuid]=[e.geometry.vertices.length,e.geometry.vertices.length+t.geometry.vertices.length-1],t.parent.updateMatrix(),e.geometry.merge(t.geometry,t.parent.matrix),e.data.preserveOriginal||t.parent.remove(t))}))}}),AFRAME.registerComponent("buffer-geometry-merger",{schema:{preserveOriginal:{default:!1}},init:function(){var e=[];this.el.sceneEl.object3D.updateMatrixWorld(),this.el.object3D.traverse((function(t){"Mesh"===t.type&&t.el!==self.el&&(t.geometry.applyMatrix(t.matrixWorld),e.push(t.geometry.clone()),t.parent.remove(t))}));const t=THREE.BufferGeometryUtils.mergeBufferGeometries(e);this.mesh=new THREE.Mesh(t),this.el.setObject3D("mesh",this.mesh)}})},function(e,t){THREE.BufferGeometryUtils={computeTangents:function(e){var t=e.index,a=e.attributes;if(null!==t&&void 0!==a.position&&void 0!==a.normal&&void 0!==a.uv){var s=t.array,n=a.position.array,r=a.normal.array,o=a.uv.array,i=n.length/3;void 0===a.tangent&&e.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*i),4));for(var c=a.tangent.array,d=[],l=[],u=0;ua.max&&this.logs.shift(),this.el.setAttribute("text",{value:this.logs.join("\n")}))},remove:function(){this.el.removeAttribute("text"),this.system.unregisterLogger(this)}})},function(e,t,a){a(52),AFRAME.registerComponent("orbit-controls",{dependencies:["camera"],schema:{autoRotate:{type:"boolean"},autoRotateSpeed:{default:2},dampingFactor:{default:.1},enabled:{default:!0},enableDamping:{default:!0},enableKeys:{default:!0},enablePan:{default:!0},enableRotate:{default:!0},enableZoom:{default:!0},initialPosition:{type:"vec3"},keyPanSpeed:{default:7},minAzimuthAngle:{type:"number",default:1/0},maxAzimuthAngle:{type:"number",default:1/0},maxDistance:{default:1e3},maxPolarAngle:{default:AFRAME.utils.device.isMobile()?90:120},minDistance:{default:1},minPolarAngle:{default:0},minZoom:{default:0},panSpeed:{default:1},rotateSpeed:{default:.05},screenSpacePanning:{default:!1},target:{type:"vec3"},zoomSpeed:{default:.5}},init:function(){var e,t=this.el;this.controls=new THREE.OrbitControls(t.getObject3D("camera"),t.sceneEl.renderer.domElement),e=new THREE.Vector3,t.sceneEl.addEventListener("enter-vr",()=>{(AFRAME.utils.device.checkHeadsetConnected()||AFRAME.utils.device.isMobile())&&(this.controls.enabled=!1,t.hasAttribute("look-controls")&&(t.setAttribute("look-controls","enabled",!0),e.copy(t.getObject3D("camera").position),t.getObject3D("camera").position.set(0,0,0)))}),t.sceneEl.addEventListener("exit-vr",()=>{(AFRAME.utils.device.checkHeadsetConnected()||AFRAME.utils.device.isMobile())&&(this.controls.enabled=!0,t.getObject3D("camera").position.copy(e),t.hasAttribute("look-controls")&&t.setAttribute("look-controls","enabled",!1))}),document.body.style.cursor="grab",document.addEventListener("mousedown",()=>{document.body.style.cursor="grabbing"}),document.addEventListener("mouseup",()=>{document.body.style.cursor="grab"}),this.target=new THREE.Vector3,t.getObject3D("camera").position.copy(this.data.initialPosition)},update:function(e){var t=this.controls,a=this.data;t.target=this.target.copy(a.target),t.autoRotate=a.autoRotate,t.autoRotateSpeed=a.autoRotateSpeed,t.dampingFactor=a.dampingFactor,t.enabled=a.enabled,t.enableDamping=a.enableDamping,t.enableKeys=a.enableKeys,t.enablePan=a.enablePan,t.enableRotate=a.enableRotate,t.enableZoom=a.enableZoom,t.keyPanSpeed=a.keyPanSpeed,t.maxPolarAngle=THREE.Math.degToRad(a.maxPolarAngle),t.maxDistance=a.maxDistance,t.minDistance=a.minDistance,t.minPolarAngle=THREE.Math.degToRad(a.minPolarAngle),t.minZoom=a.minZoom,t.panSpeed=a.panSpeed,t.rotateSpeed=a.rotateSpeed,t.screenSpacePanning=a.screenSpacePanning,t.zoomSpeed=a.zoomSpeed},tick:function(){var e=this.controls;this.data.enabled&&e.enabled&&(e.enableDamping||e.autoRotate)&&this.controls.update()}})},function(e,t){THREE.OrbitControls=function(e,t){var a,s,n,r,o;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new THREE.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:THREE.MOUSE.LEFT,ZOOM:THREE.MOUSE.MIDDLE,PAN:THREE.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=function(){i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(c),i.update(),h=u.NONE},this.update=(a=new THREE.Vector3,s=(new THREE.Quaternion).setFromUnitVectors(e.up,new THREE.Vector3(0,1,0)),n=s.clone().inverse(),r=new THREE.Vector3,o=new THREE.Quaternion,function(){var e=i.object.position;return a.copy(e).sub(i.target),a.applyQuaternion(s),f.setFromVector3(a),i.autoRotate&&h===u.NONE&&P(2*Math.PI/60/60*i.autoRotateSpeed),f.theta+=p.theta,f.phi+=p.phi,f.theta=Math.max(i.minAzimuthAngle,Math.min(i.maxAzimuthAngle,f.theta)),f.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,f.phi)),f.makeSafe(),f.radius*=b,f.radius=Math.max(i.minDistance,Math.min(i.maxDistance,f.radius)),i.target.add(y),a.setFromSpherical(f),a.applyQuaternion(n),e.copy(i.target).add(a),i.object.lookAt(i.target),!0===i.enableDamping?(p.theta*=1-i.dampingFactor,p.phi*=1-i.dampingFactor):p.set(0,0,0),b=1,y.set(0,0,0),!!(g||r.distanceToSquared(i.object.position)>m||8*(1-o.dot(i.object.quaternion))>m)&&(i.dispatchEvent(c),r.copy(i.object.position),o.copy(i.object.quaternion),g=!1,!0)}),this.dispose=function(){i.domElement.removeEventListener("contextmenu",V,!1),i.domElement.removeEventListener("mousedown",Z,!1),i.domElement.removeEventListener("wheel",F,!1),i.domElement.removeEventListener("touchstart",H,!1),i.domElement.removeEventListener("touchend",z,!1),i.domElement.removeEventListener("touchmove",B,!1),document.removeEventListener("mousemove",C,!1),document.removeEventListener("mouseup",U,!1),window.removeEventListener("keydown",q,!1)};var i=this,c={type:"change"},d={type:"start"},l={type:"end"},u={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},h=u.NONE,m=1e-6,f=new THREE.Spherical,p=new THREE.Spherical,b=1,y=new THREE.Vector3,g=!1,v=new THREE.Vector2,A=new THREE.Vector2,w=new THREE.Vector2,S=new THREE.Vector2,E=new THREE.Vector2,T=new THREE.Vector2,k=new THREE.Vector2,R=new THREE.Vector2,N=new THREE.Vector2;function x(){return Math.pow(.95,i.zoomSpeed)}function P(e){p.theta-=e}function j(e){p.phi-=e}var L,M=(L=new THREE.Vector3,function(e,t){L.setFromMatrixColumn(t,0),L.multiplyScalar(-e),y.add(L)}),_=function(){var e=new THREE.Vector3;return function(t,a){e.setFromMatrixColumn(a,1),e.multiplyScalar(t),y.add(e)}}(),D=function(){var e=new THREE.Vector3;return function(t,a){var s=i.domElement===document?i.domElement.body:i.domElement;if(i.object.isPerspectiveCamera){var n=i.object.position;e.copy(n).sub(i.target);var r=e.length();r*=Math.tan(i.object.fov/2*Math.PI/180),M(2*t*r/s.clientHeight,i.object.matrix),_(2*a*r/s.clientHeight,i.object.matrix)}else i.object.isOrthographicCamera?(M(t*(i.object.right-i.object.left)/i.object.zoom/s.clientWidth,i.object.matrix),_(a*(i.object.top-i.object.bottom)/i.object.zoom/s.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}}();function I(e){i.object.isPerspectiveCamera?b/=e:i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom*e)),i.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function O(e){i.object.isPerspectiveCamera?b*=e:i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/e)),i.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function Z(e){if(!1!==i.enabled){switch(e.preventDefault(),e.button){case i.mouseButtons.ORBIT:if(!1===i.enableRotate)return;!function(e){v.set(e.clientX,e.clientY)}(e),h=u.ROTATE;break;case i.mouseButtons.ZOOM:if(!1===i.enableZoom)return;!function(e){k.set(e.clientX,e.clientY)}(e),h=u.DOLLY;break;case i.mouseButtons.PAN:if(!1===i.enablePan)return;!function(e){S.set(e.clientX,e.clientY)}(e),h=u.PAN}h!==u.NONE&&(document.addEventListener("mousemove",C,!1),document.addEventListener("mouseup",U,!1),i.dispatchEvent(d))}}function C(e){if(!1!==i.enabled)switch(e.preventDefault(),h){case u.ROTATE:if(!1===i.enableRotate)return;!function(e){A.set(e.clientX,e.clientY),w.subVectors(A,v);var t=i.domElement===document?i.domElement.body:i.domElement;P(2*Math.PI*w.x/t.clientWidth*i.rotateSpeed),j(2*Math.PI*w.y/t.clientHeight*i.rotateSpeed),v.copy(A),i.update()}(e);break;case u.DOLLY:if(!1===i.enableZoom)return;!function(e){R.set(e.clientX,e.clientY),N.subVectors(R,k),N.y>0?I(x()):N.y<0&&O(x()),k.copy(R),i.update()}(e);break;case u.PAN:if(!1===i.enablePan)return;!function(e){E.set(e.clientX,e.clientY),T.subVectors(E,S),D(T.x,T.y),S.copy(E),i.update()}(e)}}function U(e){!1!==i.enabled&&(document.removeEventListener("mousemove",C,!1),document.removeEventListener("mouseup",U,!1),i.dispatchEvent(l),h=u.NONE)}function F(e){!1===i.enabled||!1===i.enableZoom||h!==u.NONE&&h!==u.ROTATE||(e.preventDefault(),e.stopPropagation(),i.dispatchEvent(d),function(e){e.deltaY<0?O(x()):e.deltaY>0&&I(x()),i.update()}(e),i.dispatchEvent(l))}function q(e){!1!==i.enabled&&!1!==i.enableKeys&&!1!==i.enablePan&&function(e){switch(e.keyCode){case i.keys.UP:D(0,i.keyPanSpeed),i.update();break;case i.keys.BOTTOM:D(0,-i.keyPanSpeed),i.update();break;case i.keys.LEFT:D(i.keyPanSpeed,0),i.update();break;case i.keys.RIGHT:D(-i.keyPanSpeed,0),i.update()}}(e)}function H(e){if(!1!==i.enabled){switch(e.touches.length){case 1:if(!1===i.enableRotate)return;!function(e){v.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=u.TOUCH_ROTATE;break;case 2:if(!1===i.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY,s=Math.sqrt(t*t+a*a);k.set(0,s)}(e),h=u.TOUCH_DOLLY;break;case 3:if(!1===i.enablePan)return;!function(e){S.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=u.TOUCH_PAN;break;default:h=u.NONE}h!==u.NONE&&i.dispatchEvent(d)}}function B(e){if(!1!==i.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===i.enableRotate)return;if(h!==u.TOUCH_ROTATE)return;!function(e){A.set(e.touches[0].pageX,e.touches[0].pageY),w.subVectors(A,v);var t=i.domElement===document?i.domElement.body:i.domElement;P(2*Math.PI*w.x/t.clientWidth*i.rotateSpeed),j(2*Math.PI*w.y/t.clientHeight*i.rotateSpeed),v.copy(A),i.update()}(e);break;case 2:if(!1===i.enableZoom)return;if(h!==u.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY,s=Math.sqrt(t*t+a*a);R.set(0,s),N.subVectors(R,k),N.y>0?O(x()):N.y<0&&I(x()),k.copy(R),i.update()}(e);break;case 3:if(!1===i.enablePan)return;if(h!==u.TOUCH_PAN)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY),T.subVectors(E,S),D(T.x,T.y),S.copy(E),i.update()}(e);break;default:h=u.NONE}}function z(e){!1!==i.enabled&&(i.dispatchEvent(l),h=u.NONE)}function V(e){!1!==i.enabled&&e.preventDefault()}i.domElement.addEventListener("contextmenu",V,!1),i.domElement.addEventListener("mousedown",Z,!1),i.domElement.addEventListener("wheel",F,!1),i.domElement.addEventListener("touchstart",H,!1),i.domElement.addEventListener("touchend",z,!1),i.domElement.addEventListener("touchmove",B,!1),window.addEventListener("keydown",q,!1),this.update()},THREE.OrbitControls.prototype=Object.create(THREE.EventDispatcher.prototype),THREE.OrbitControls.prototype.constructor=THREE.OrbitControls,Object.defineProperties(THREE.OrbitControls.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}})},function(e,t){AFRAME.registerComponent("proxy-event",{schema:{captureBubbles:{default:!1},enabled:{default:!0},event:{type:"string"},from:{type:"string"},to:{type:"string"},as:{type:"string"},bubbles:{default:!1}},multiple:!0,init:function(){var e,t,a,s=this.data,n=this.el,r=this;if(s.from?e="PARENT"===s.from?[n.parentNode]:document.querySelectorAll(s.from):a="CHILDREN"===s.to?n.querySelectorAll("*"):"SELF"===s.to?[n]:document.querySelectorAll(s.to),s.from)for(t=0;t{"nonrecursive"!==this.id&&e.detail.object.traverse(this.set)})},update:function(){"nonrecursive"===this.id?this.set(this.el.object3D):this.el.object3D.traverse(this.set)},set:function(e){isNaN(this.data)?e.renderOrder=this.system.order[this.data]:e.renderOrder=parseFloat(this.data)}}),AFRAME.registerComponent("render-order-recursive",{init:function(){this.el.addEventListener("child-attached",e=>{e.detail.el.setAttribute("render-order",this.el.getAttribute("render-order"))})}})},function(e,t,a){var s;"undefined"!=typeof self&&self,s=function(){return function(e){var t={};function a(s){if(t[s])return t[s].exports;var n=t[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,a),n.l=!0,n.exports}return a.m=e,a.c=t,a.d=function(e,t,s){a.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:s})},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=1)}([function(e,t,a){"use strict";var s={};e.exports.select=function(e,t,a){return s[t]||(s[t]=new Function("state","item","return "+c(t)+";")),s[t](e,a)};var n=/\.([A-Za-z][\w_-]*)/g,r=/([=&|!?:+-])(\s*)([\(]?)([A-Za-z][\w_-]*)/g,o=/^([\(]?)([A-Za-z][\w_-]*)/g,i=/state\["item"\]/g;function c(e){return e=(e=(e=(e=e.replace(n,'["$1"]')).replace(o,'$1state["$2"]')).replace(r,'$1$2$3state["$4"]')).replace(i,"item")}function d(){var e=arguments;return function(){var t;for(t=0;t","<","<=",">="],u=/\s+/,h=/\(|\)|\!/g;function m(e){return-1===(e=function(e){return 0===e.indexOf("!!")?e.replace("!!",""):0===e.indexOf("!")?e.replace("!",""):e}(e.trim())).indexOf(".")?e:e.substring(0,e.indexOf("."))}e.exports.parseKeysToWatch=function(e,t,a){var s,n;for(n=p(t,u),s=0;s [data-bind-for-active="false"]'))(s=o.querySelector('[data-bind-for-active="false"]')).setAttribute("data-bind-for-key",c),s.setAttribute("data-bind-for-value",d),s.object3D.visible=!0,s.play(),s.setAttribute("data-bind-for-active","true"),s.emit("bindforupdateinplace",i,!1);else{var l=this.generateFromTemplate(i,a);l.addEventListener("loaded",(function(){l.emit("bindforupdateinplace",i,!1)})),o.appendChild(l)}this.renderedKeys.push(d)}else-1!==t.indexOf(d)&&(e.length&&e[0].constructor===String?(s=o.querySelector('[data-bind-for-value="'+d+'"]')).setAttribute("data-bind-for-key",a):s=o.querySelector('[data-bind-for-key="'+c+'"]'),s.emit("bindforupdateinplace",i,!1));e[a+1]&&(this.data.delay?setTimeout((function(){n.renderItemsInPlace(e,t,a+1)}),this.data.delay):this.renderItemsInPlace(e,t,a+1))},generateFromTemplate:function(e,t){var a=this.data;this.el.appendChild(this.system.renderTemplate(this.template,e));var s=this.el.children[this.el.children.length-1];if(!e)return s.setAttribute("data-bind-for-key",""),s.setAttribute("data-bind-for-active","false"),s;var n=this.getBindForKey(e,t);return s.setAttribute("data-bind-for-key",n),a.key||s.setAttribute("data-bind-for-value",e),s.setAttribute("data-bind-for-active","true"),s},getElsToRemove:(s=[],function(e,t){var a=this.data,n=this.el;s.length=0;for(var r=0;r{n[e]={},n[e].START="thumb"+e+"start",n[e].END="thumb"+e+"end"});AFRAME.registerComponent("thumb-controls",{schema:{thresholdAngle:{default:89.5},thresholdPad:{default:.05},thresholdStick:{default:.75}},init:function(){var e=this.el;this.onTrackpadDown=this.onTrackpadDown.bind(this),this.onTrackpadUp=this.onTrackpadUp.bind(this),this.directionStick="",this.directionTrackpad="",e.components["tracked-controls"]&&(this.axis=e.components["tracked-controls"].axis),this.type="STICK",e.addEventListener("controllerconnected",t=>{this.axis=e.components["tracked-controls"].axis,"oculus-touch-controls"!==t.detail.name&&"windows-motion-controls"!==t.detail.name?this.type="PAD":this.type="STICK"})},play:function(){var e=this.el;e.addEventListener("trackpaddown",this.onTrackpadDown),e.addEventListener("trackpadup",this.onTrackpadUp),e.addEventListener("touchpaddown",this.onTrackpadDown),e.addEventListener("touchpadup",this.onTrackpadUp)},pause:function(){var e=this.el;e.removeEventListener("trackpaddown",this.onTrackpadDown),e.removeEventListener("trackpadup",this.onTrackpadUp),e.removeEventListener("touchpaddown",this.onTrackpadDown),e.removeEventListener("touchpadup",this.onTrackpadUp)},onTrackpadDown:function(){var e,t=this.el;this.getDistance()this.data.thresholdStick){if(!(e=this.getDirection()))return;return this.directionStick=e,t.emit(n.NULL.START,null,!1),void t.emit(n[this.directionStick].START,null,!1)}this.directionStick&&this.getDistance()360&&(o-=360),(t=a[n]-r)<0&&(e>=360+t&&e<=360||e>=0&&e<=o))return s[n];if(e>=t&&e<=o)return s[n]}},getAngle:function(){var e,t=this.axis;return this.axis?((e="PAD"===this.type?Math.atan2(-t[1],t[0]):Math.atan2(-t[3],t[2]))<0&&(e=2*Math.PI+e),THREE.Math.radToDeg(e)):0}}),AFRAME.registerComponent("thumb-controls-debug",{dependencies:["thumb-controls"],schema:{controllerType:{type:"string"},hand:{type:"string"},enabled:{default:!1}},init:function(){var e,t,a,s,n=this.el;if(this.data.enabled||AFRAME.utils.getUrlParameter("debug-thumb")){console.log("%c debug-thumb","background: #111; color: red");var r=function(){n.components["tracked-controls"].handleAxes=()=>{},a={axis:t=[0,0,0]},n.components["tracked-controls"].axis=t,n.components["thumb-controls"].axis=t};n.components["tracked-controls"]?r():this.el.addEventListener("controllerconnected",(function(){r()})),(s=this.createCanvas()).addEventListener("click",s=>{"vive-controls"===this.data.controllerType?e?n.emit("trackpadup"):n.emit("trackpaddown"):e&&(t[0]=0,t[1]=0,n.emit("axismove",a,!1)),e=!e}),s.addEventListener("mousemove",r=>{var o;e&&(o=s.getBoundingClientRect(),t[0]=(r.clientX-o.left)/240*2-1,t[1]=(r.clientY-o.top)/240*2-1,n.emit("axismove",a,!1))}),s.addEventListener("mouseleave",s=>{e&&(t[0]=0,t[1]=0,n.emit("axismove",a,!1))})}},createCanvas:function(){var e,t;return(e=document.createElement("canvas")).classList.add("debugThumb"),e.height=240,e.width=240,e.style.bottom=0,e.style.borderRadius="250px",e.style.opacity=.5,e.style.position="fixed",e.style.zIndex=999999999,"left"===this.data.hand?e.style.left=0:e.style.right=0,(t=e.getContext("2d")).fillStyle="#333",t.fillRect(0,0,240,240),document.body.appendChild(e),e}})},function(e,t,a){var s={"./active-item.js":59,"./beat-cut-fx.js":60,"./beat-generator.js":15,"./beat-hit-sound.js":61,"./beat.js":21,"./blade.js":62,"./check-vr.js":63,"./console-shortcuts.js":64,"./controller.js":65,"./copy-texture.js":66,"./cursor-laser.js":67,"./cursor-mesh.js":68,"./curve-follow-rig-reset.js":69,"./cutfx-shader.js":70,"./debug-beat-generator.js":73,"./debug-beat-positioning.js":74,"./debug-controller.js":75,"./debug-cursor.js":76,"./debug-intro.js":77,"./debug-song-time.js":78,"./debug-state.js":79,"./delayed-proxy-event.js":80,"./difficulty-background.js":81,"./difficulty-filter.js":82,"./difficulty-text.js":83,"./follow-position.js":84,"./follow-z.js":85,"./gameover.js":86,"./gpu-preloader.js":87,"./gradient-shader.js":88,"./hand-swapper.js":90,"./handstar-shader.js":91,"./haptics-wall.js":94,"./haptics-weapon.js":95,"./headfist.js":96,"./history.js":97,"./intro-song.js":98,"./keyboard-raycastable.js":99,"./leaderboard.js":100,"./materials.js":107,"./menu-controls.js":122,"./menu-difficulty-select.js":123,"./menu-genre.js":124,"./menu-midsection.js":125,"./menu-mode.js":126,"./menu-playlist-button.js":127,"./menu-playlist.js":128,"./menu-selected-challenge-image.js":129,"./menu-slide-animation.js":130,"./multiplier-ring.js":131,"./no-frustum-cull.js":132,"./panel-shader.js":133,"./pause.js":136,"./pauser.js":137,"./play-sound.js":138,"./player-height.js":140,"./plume.js":141,"./punch.js":142,"./raycaster-target.js":143,"./recenter.js":144,"./ring.js":145,"./score-texts.js":148,"./search-thumbnail-atlas.js":149,"./search.js":150,"./song-info-positioner.js":153,"./song-preview.js":154,"./song-progress-info.js":155,"./song.js":156,"./stage-colors.js":157,"./stage-lasers.js":158,"./stars.js":159,"./stats-param.js":160,"./stepback.js":161,"./sub-object.js":162,"./super-keyboard.js":163,"./supercurve-color.js":164,"./supercurve-shader.js":165,"./supercurve.js":168,"./supercutfx-shader.js":171,"./supercutfx.js":172,"./tail.js":173,"./text-counter.js":174,"./text-geometry.js":175,"./text-truncate.js":176,"./text-uppercase.js":177,"./toggle-pause-play.js":178,"./trail.js":179,"./tunnels.js":180,"./vertex-colors-buffer.js":181,"./victory-accuracy-ring.js":182,"./victory-rank.js":183,"./visible-raycastable.js":184,"./wall-shader.js":185,"./wall.js":188,"./weapon-particles.js":189,"./zip-loader.js":190};function n(e){var t=r(e);return a(t)}function r(e){if(!a.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}n.keys=function(){return Object.keys(s)},n.resolve=r,e.exports=n,n.id=58},function(e,t,a){if(AFRAME.registerComponent("active-item",{dependencies:["material"],schema:{active:{default:!1},opacity:{default:1}},init:function(){this.defaultOpacity=this.el.getAttribute("material").opacity,this.materialObj={opacity:this.data.opacity}},update:function(){var e=this.el;this.data.active?(e.setAttribute("material",this.materialObj),e.object3D.visible=!0):(e.setAttribute("material","opacity",this.defaultOpacity),e.components.animation__mouseleave&&setTimeout(()=>{e.emit("mouseleave",null,!1)}))}}),AFRAME.registerComponent("active-text-color",{dependencies:["text"],schema:{active:{default:!1},color:{default:"#333"}},init:function(){this.defaultColor=this.el.getAttribute("text").color},update:function(){var e=this.el;this.data.active?e.setAttribute("text","color",this.data.color):e.setAttribute("text","color",this.defaultColor)}}),window.AFRAME){const t=["active-item","active-text-color"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;sMath.abs(t.y)?"right":"down"),t.z*=.01,s.copy(t).multiplyScalar(-.0025).clampLength(0,.01);for(let t=0;t{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{AFRAME.utils.device.checkHeadsetConnected()&&this.el.emit("displayconnected")},250)}}),window.AFRAME){const t=[],a=[],s=["check-vr"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;sdocument.querySelector(e),window.$$=e=>document.querySelectorAll(e),window.$$$=e=>document.querySelector(`[${e}]`).getAttribute(e),window.$$$$=e=>document.querySelector(`[${e}]`).components[e],window.scene=this.el,window.state=this.el.systems.state.state}}),window.AFRAME){const t=["console-shortcuts"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{this.controllerType=e.detail.name,this.el.setAttribute("cursor",this.config[this.controllerType].cursor||{})});const a={hand:t.hand,model:!1};e.setAttribute("daydream-controls",a),e.setAttribute("oculus-go-controls",a),e.setAttribute("oculus-touch-controls",{hand:t.hand,model:!1,orientationOffset:{x:0,y:0,z:0}}),e.setAttribute("vive-controls",a),e.setAttribute("vive-focus-controls",a),e.setAttribute("windows-motion-controls",a),e.setAttribute("generic-tracked-controller-controls",a)},config:{"daydream-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"oculus-go-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"oculus-touch-controls":{cursor:{downEvents:["triggerdown","gripdown","abuttondown","bbuttondown","xbuttondown","ybuttondown"],upEvents:["triggerup","gripup","abuttonup","bbuttonup","xbuttonup","ybuttonup"]}},"vive-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"vive-focus-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"windows-motion-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"generic-tracked-controller-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]}}}}),window.AFRAME){const t=["controller"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{this.copyTexture()}),this.copyTexture()},copyTexture:function(){const e=this.el,t=this.data.from,a=e.getObject3D("mesh").material;t.getObject3D("mesh")&&(a.map=t.getObject3D("mesh").material.map,a.map&&(a.map.needsUpdate=!0,a.needsUpdate=!0))}}),window.AFRAME){const t=["copy-texture"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{this.reset()})},update:function(e){const t=this.data;this.el;!e.isVictory&&t.isVictory&&this.reset()},reset:function(){this.el.components["supercurve-follow"].curveProgress=0,this.el.object3D.position.set(0,0,0),this.el.object3D.rotation.set(0,0,0)}}),window.AFRAME){const t=["curve-follow-rig-reset"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{t.spawn()});r.style.width="460px",r.style.bottomMargin="10px"}()},addDebugStageControls:function(){var e=0;const t=(t,a,s)=>{const n=document.createElement("div");n.style.position="absolute",n.id="stagecontrol"+t,n.style.width="100px",n.style.height="30px",n.style.top="element"===s?"20px":"70px",n.style.background="#000",n.style.color="#fff",n.style.zIndex=999999999,n.style.padding="5px",n.style.font="14px sans-serif",n.style.textAlign="center",n.style.cursor="pointer",n.style.left=20+120*t+"px",n.innerHTML=a,"element"===s?n.addEventListener("click",()=>{document.getElementById("stagecontrol"+e).style.background="#000",n.style.background="#66f",e=t}):n.addEventListener("click",()=>{this.beatLoader.generateEvent({_type:e,_value:t})}),document.body.appendChild(n)};["sky","tunnelNeon","leftStageLasers","rightStageLasers","floor"].forEach((e,a)=>{t(a,e,"element")}),["off","blue","blue","bluefade","","red","red","redfade"].forEach((e,a)=>{t(a,e,"value")})}}),window.AFRAME){const t=["debug-beat-generator"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{const t=this.el.sceneEl.components["beat-generator"];t.data.gameMode=e,scene.components["beat-system"].data.gameMode=e,scene.components["beat-system"].updateBeatPositioning(),s.forEach(a=>{n.forEach(s=>{let n=t.requestBeat("punch"===e?"dot":"arrow","red"),r=Math.random()<.5?"left":"right";n.components.beat.onGenerate(.001,a,s,r),n.object3D.renderOrder=9999,n.play(),n=t.requestBeat("dot","blue"),r=Math.random()<.5?"down":"up",n.components.beat.onGenerate(.0015,a,s,r),n.object3D.renderOrder=9999,n.play()})});const a=scene.components.pool__wall.requestEntity();a.components.wall.onGenerate(.0015,"left",4,4,!0),a.play(),document.getElementById("beatContainer").removeAttribute("bind__visible"),document.getElementById("beatContainer").object3D.visible=!0},500))}}),window.AFRAME){const t=["debug-beat-positioning"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{t.isTrusted&&(e.emit("triggerdown"),e.emit("triggerup"))}),"oculus"===AFRAME.utils.getUrlParameter("debug")?(e.emit("controllerconnected",{name:"oculus-touch-controls"}),t.emit("controllerconnected",{name:"oculus-touch-controls"}),e.setAttribute("controller","controllerType","oculus-touch-controls"),t.setAttribute("controller","controllerType","oculus-touch-controls")):(e.emit("controllerconnected",{name:"vive-controls"}),t.emit("controllerconnected",{name:"vive-controls"}),e.setAttribute("controller","controllerType","vive-controls"),t.setAttribute("controller","controllerType","vive-controls")),this.el.emit("enter-vr",null,!1),document.addEventListener("keydown",a=>{var s,n,r,o;a.shiftKey&&(32!==a.keyCode?81!==a.keyCode?(78===a.keyCode&&(this.secondaryGripDown?(t.emit("gripup"),this.secondaryGripDown=!1):(t.emit("gripdown"),this.secondaryGripDown=!0)),77===a.keyCode&&(this.primaryGripDown?(e.emit("gripup"),this.primaryGripDown=!1):(e.emit("gripdown"),this.primaryGripDown=!0)),49===a.keyCode&&t.emit("menudown"),a.ctrlKey?(r=t.getAttribute("position"),72===a.keyCode&&(r.x-=.02),74===a.keyCode&&(r.y-=.02),75===a.keyCode&&(r.y+=.02),76===a.keyCode&&(r.x+=.02),59!==a.keyCode&&186!==a.keyCode||(r.z-=.01),222===a.keyCode&&(r.z+=.01),t.setAttribute("position",AFRAME.utils.clone(r))):(s=e.getAttribute("position"),72===a.keyCode&&(s.x-=.02),74===a.keyCode&&(s.y-=.02),75===a.keyCode&&(s.y+=.02),76===a.keyCode&&(s.x+=.02),59!==a.keyCode&&186!==a.keyCode||(s.z-=.02),222===a.keyCode&&(s.z+=.02),e.setAttribute("position",AFRAME.utils.clone(s))),a.ctrlKey?(o=t.getAttribute("rotation"),89===a.keyCode&&(o.x-=10),79===a.keyCode&&(o.x+=10),85===a.keyCode&&(o.y-=10),73===a.keyCode&&(o.y+=10),t.setAttribute("rotation",AFRAME.utils.clone(o))):(n=e.getAttribute("rotation"),89===a.keyCode&&(n.x-=10),79===a.keyCode&&(n.x+=10),85===a.keyCode&&(n.y-=10),73===a.keyCode&&(n.y+=10),e.setAttribute("rotation",AFRAME.utils.clone(n)))):this.isSecondaryTriggerDown?(t.emit("triggerup"),this.isSecondaryTriggerDown=!1):(t.emit("triggerdown"),this.isSecondaryTriggerDown=!0):this.isTriggerDown?(e.emit("triggerup"),this.isTriggerDown=!1):(e.emit("triggerdown"),this.isTriggerDown=!0))})))},play:function(){var e,t;if(this.bounds=document.body.getBoundingClientRect(),!AFRAME.utils.getUrlParameter("debug"))return;if(AFRAME.utils.getUrlParameter("headfist"))return;e=document.getElementById("rightHand"),(t=document.getElementById("leftHand")).object3D.position.set(-.2,1.5,-.5),e.object3D.position.set(.2,1.5,-.5),t.setAttribute("rotation",{x:35,y:0,z:0});const a=AFRAME.utils.getUrlParameter("type");[e,t].forEach(e=>{e.querySelector(".laser").object3D.visible=!1,"classic"===a?(e.querySelector(".bladeContainer").removeAttribute("bind__visible"),e.querySelector(".bladeContainer").object3D.visible=!0,e.querySelector(".bladeContainer").object3D.scale.set(1,1,1)):"punch"===a?(e.querySelector(".punch").removeAttribute("bind__visible"),e.querySelector(".punch").object3D.visible=!0,e.querySelector(".punch").object3D.visible=!0,e.querySelector(".bladeHandle").object3D.visible=!1):"ride"===a&&(e.querySelector(".handStar").removeAttribute("bind__visible"),e.querySelector(".handStar").object3D.visible=!0,e.querySelector(".bladeHandle").object3D.visible=!1)})},onMouseMove:function(){const e=new THREE.Vector3,t=new THREE.Vector2,a=new THREE.Vector3;return function(s){const n=this.bounds,r=this.el.sceneEl.camera,o=s.clientX-n.left,i=s.clientY-n.top;t.x=o/n.width*2-1,t.y=-i/n.height*2-1,document.getElementById("camera").object3D.getWorldPosition(a),e.set(t.x,t.y,.5).unproject(r).sub(a).normalize();const c=document.getElementById("rightHand").object3D.position,d=-a.z/e.z;r.getWorldPosition(c).add(e.multiplyScalar(d)),c.y+=.8}}()}),window.AFRAME){const t=["debug-controller"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{console.log(this.el.components.song.getCurrentTime())},250)}}),window.AFRAME){const t=["debug-song-time"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.split(",").forEach(e=>{this.el.sceneEl.emit("debug"+e.trim(),null,!1)})},500)}}),window.AFRAME){const t=["debug-state"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{var s=r.data;if(s.enabled&&(s.captureBubbles||e.target===n))for(t=0;t{var t=a.data;t.enabled&&(t.captureBubbles||s.target===e)&&a.el.emit(t.as||t.event,s.detail?s.detail:null,!1)},t.delay)}))}}),window.AFRAME){const t=["delayed-proxy-event"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s=0&&(this.beatContainer.object3D.position.z=1.5*-Math.pow(1-this.countDown,2),this.countDown-=t/1e3)},reset:function(){this.beatContainer.object3D.position.z=0,this.el.sceneEl.setAttribute("stage-colors","color","blue")},triggerAnimations:function(){for(let e=0;e{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{this.preloadFromSelector("#mainLogo"),this.preloadFromSelector("#prevArrow"),this.preloadFromSelector("#stepback"),this.preloadFromSelector(".difficultyBackground"),this.preloadFromSelector(".genreIcon"),this.preloadFromSelector(".merkababloom"),this.preloadFromSelector(".searchResultBackground"),this.preloadMaterialsComponentTextures(),this.preloadKeyboard(),this.preloadSlice(),this.preloadEnvMap(),this.preloadFXs()},1e3)},preloadFromSelector:function(e){const t=document.querySelector(e);this.preloadTexture(t.getObject3D("mesh").material.map)},preloadMaterialsComponentTextures:function(){const e=this.el.systems.materials.textureList;for(var t=0;t{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{this.el.addEventListener(e,this.swapHand)})},swapHand:function(){this.data.enabled&&this.el.sceneEl.emit("activehandswap",null,!1)}}),window.AFRAME){const t=["hand-swapper"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{if(!t.detail||!t.detail.intersectedEl||!this.data.enabled)return;const a=t.detail.intersectedEl;a.classList.contains("blade")&&a!==e?(this.isColliding=!0,this.el.components.haptics__weapon.pulse()):this.isColliding=!1}),e.addEventListener("mouseleave",e=>{this.isColliding=!1})},tick:function(){this.isColliding&&this.data.enabled&&this.el.components.haptics__weapon.pulse()}}),window.AFRAME){const t=["haptics-weapons"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s{this.username=e.detail.value,localStorage.setItem("moonriderusername",this.username)}),this.el.addEventListener("leaderboardsubmit",this.addScore.bind(this))},update:function(e){!s.apps.length&&this.data.apiKey&&(s.initializeApp({apiKey:this.data.apiKey,authDomain:this.data.authDomain,databaseURL:this.data.databaseURL,projectId:this.data.projectId,storageBucket:this.data.storageBucket,messagingSenderId:this.data.messagingSenderId}),this.firestore=s.firestore(),this.firestore.settings({}),this.db=this.firestore.collection("scores")),!e.isVictory&&this.data.isVictory&&this.checkLeaderboardQualify(),this.data.difficulty&&e.difficulty!==this.data.difficulty||this.data.menuSelectedChallengeId&&e.menuSelectedChallengeId!==this.data.menuSelectedChallengeId?this.fetchScores(this.data.menuSelectedChallengeId):this.data.challengeId&&e.challengeId!==this.data.challengeId&&this.fetchScores(this.data.challengeId)},addScore:function(){const e=this.el.sceneEl.systems.state.state;if(!e.isVictory||!e.inVR)return;const t={accuracy:e.score.accuracy,challengeId:e.challenge.id,gameMode:this.data.gameMode,score:e.score.score,username:this.username,difficulty:this.data.difficulty||e.challenge.difficulty,time:new Date};n.includes(this.username.toLowerCase())||this.username.match(r)||this.db.add(t),this.addEventDetail.scoreData=t,this.el.emit("leaderboardscoreadded",this.addEventDetail,!1)},fetchScores:function(e){if("ride"===this.data.gameMode)return;const t=this.el.sceneEl.systems.state.state;this.db.where("challengeId","==",e).where("difficulty","==",t.menuSelectedChallenge.id?t.menuSelectedChallenge.difficulty:t.challenge.difficulty).where("gameMode","==",this.data.gameMode).orderBy("score","desc").orderBy("time","asc").limit(10).get().then(t=>{this.eventDetail.challengeId=e,this.scores.length=0,t.empty||t.forEach(e=>this.scores.push(e.data())),this.el.sceneEl.emit("leaderboard",this.eventDetail,!1)}).catch(e=>{console.error("[firestore]",e)})},checkLeaderboardQualify:function(){const e=this.el.sceneEl.systems.state.state.score.score;if(!AFRAME.utils.getUrlParameter("dot")){if(this.scores.length<10)return this.qualifyingIndex=this.scores.length,void this.el.sceneEl.emit("leaderboardqualify",this.scores.length,!1);for(let t=0;tthis.scores[t].score)return this.qualifyingIndex=t,void this.el.sceneEl.emit("leaderboardqualify",t,!1)}}}),window.AFRAME){const t=["leaderboard"],a=[],s=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let a=0;a{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let a=0;a{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,a=document.querySelectorAll(`[${t}]`);for(let s=0;s=0&&r._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,h){case"idle":(p={})[t]=e[t],c("ready");break;case"ready":A(t);break;case"prepare":case"check":case"dispose":case"apply":(g=g||[]).push(t)}},check:k,apply:T,status:function(e){if(!e)return h;f.push(e)},addStatusHandler:function(e){f.push(e)},removeStatusHandler:function(e){var t=f.indexOf(e);t>=0&&f.splice(t,1)},data:o[t]};return n=void 0,r}var f=[],h="idle";function c(e){h=e;for(var t=0;t0;){var i=r.pop(),o=i.id,a=i.chain;if((f=R[o])&&(!f.hot._selfAccepted||f.hot._selfInvalidated)){if(f.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:o};if(f.hot._main)return{type:"unaccepted",chain:a,moduleId:o};for(var s=0;s ")),x.type){case"self-declined":r.onDeclined&&r.onDeclined(x),r.ignoreDeclined||(T=new Error("Aborted because of self decline: "+x.moduleId+U));break;case"declined":r.onDeclined&&r.onDeclined(x),r.ignoreDeclined||(T=new Error("Aborted because of declined dependency: "+x.moduleId+" in "+x.parentId+U));break;case"unaccepted":r.onUnaccepted&&r.onUnaccepted(x),r.ignoreUnaccepted||(T=new Error("Aborted because "+h+" is not accepted"+U));break;case"accepted":r.onAccepted&&r.onAccepted(x),A=!0;break;case"disposed":r.onDisposed&&r.onDisposed(x),I=!0;break;default:throw new Error("Unexception type "+x.type)}if(T)return c("abort"),Promise.reject(T);if(A)for(h in v[h]=p[h],b(m,x.outdatedModules),x.outdatedDependencies)Object.prototype.hasOwnProperty.call(x.outdatedDependencies,h)&&(y[h]||(y[h]=[]),b(y[h],x.outdatedDependencies[h]));I&&(b(m,[x.moduleId]),v[h]=k)}var z,D=[];for(l=0;l0;)if(h=B.pop(),f=R[h]){var P={},F=f.hot._disposeHandlers;for(u=0;u=0&&C.parents.splice(z,1))}}for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(f=R[h]))for(N=y[h],u=0;u=0&&f.children.splice(z,1);c("apply"),void 0!==_&&(i=_,_=void 0);for(h in p=void 0,v)Object.prototype.hasOwnProperty.call(v,h)&&(e[h]=v[h]);var Z=null;for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(f=R[h])){N=y[h];var j=[];for(l=0;l=0&&r._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,h){case"idle":(p={})[t]=e[t],c("ready");break;case"ready":A(t);break;case"prepare":case"check":case"dispose":case"apply":(g=g||[]).push(t)}},check:k,apply:T,status:function(e){if(!e)return h;f.push(e)},addStatusHandler:function(e){f.push(e)},removeStatusHandler:function(e){var t=f.indexOf(e);t>=0&&f.splice(t,1)},data:o[t]};return n=void 0,r}var f=[],h="idle";function c(e){h=e;for(var t=0;t0;){var i=r.pop(),o=i.id,a=i.chain;if((f=R[o])&&(!f.hot._selfAccepted||f.hot._selfInvalidated)){if(f.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:o};if(f.hot._main)return{type:"unaccepted",chain:a,moduleId:o};for(var s=0;s ")),x.type){case"self-declined":r.onDeclined&&r.onDeclined(x),r.ignoreDeclined||(T=new Error("Aborted because of self decline: "+x.moduleId+U));break;case"declined":r.onDeclined&&r.onDeclined(x),r.ignoreDeclined||(T=new Error("Aborted because of declined dependency: "+x.moduleId+" in "+x.parentId+U));break;case"unaccepted":r.onUnaccepted&&r.onUnaccepted(x),r.ignoreUnaccepted||(T=new Error("Aborted because "+h+" is not accepted"+U));break;case"accepted":r.onAccepted&&r.onAccepted(x),A=!0;break;case"disposed":r.onDisposed&&r.onDisposed(x),I=!0;break;default:throw new Error("Unexception type "+x.type)}if(T)return c("abort"),Promise.reject(T);if(A)for(h in v[h]=p[h],b(m,x.outdatedModules),x.outdatedDependencies)Object.prototype.hasOwnProperty.call(x.outdatedDependencies,h)&&(y[h]||(y[h]=[]),b(y[h],x.outdatedDependencies[h]));I&&(b(m,[x.moduleId]),v[h]=k)}var z,D=[];for(l=0;l0;)if(h=B.pop(),f=R[h]){var P={},F=f.hot._disposeHandlers;for(u=0;u=0&&C.parents.splice(z,1))}}for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(f=R[h]))for(N=y[h],u=0;u=0&&f.children.splice(z,1);c("apply"),void 0!==_&&(i=_,_=void 0);for(h in p=void 0,v)Object.prototype.hasOwnProperty.call(v,h)&&(e[h]=v[h]);var Z=null;for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(f=R[h])){N=y[h];var j=[];for(l=0;l