Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

build(rider): commit pre-built artifacts to skip Vercel webpack rebuild

nirholas655b858d7bc8
diff --git a/.gitignore b/.gitignore
index 1aee39825..76d82dd19 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,8 +16,7 @@ npm-debug.log*
character-studio/node_modules
character-studio/build
-# Rider subproject build output
-rider/build
+# rider/build — tracked so Vercel skips the webpack rebuild
character-studio/public/loot-assets
.mcp.json
.claude/worktrees/
diff --git a/rider/build/build.js b/rider/build/build.js
new file mode 100644
index 000000000..594e6ce27
--- /dev/null
+++ b/rider/build/build.js
@@ -0,0 +1,1296 @@
+!function(e){var t=this.webpackHotUpdate;this.webpackHotUpdate=function(e,n){!function(e,t){if(!A[e]||!w[e])return;for(var n in w[e]=!1,t)Object.prototype.hasOwnProperty.call(t,n)&&(f[n]=t[n]);0==--y&&0===v&&S()}(e,n),t&&t(e,n)};var n,r=!0,i="0eb3afe3ce20db27d2ce",a={},o=[],s=[];function c(e){var t=k[e];if(!t)return C;var r=function(r){return t.hot.active?(k[r]?-1===k[r].parents.indexOf(e)&&k[r].parents.push(e):(o=[e],n=r),-1===t.children.indexOf(r)&&t.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+e),o=[]),C(r)},i=function(e){return{configurable:!0,enumerable:!0,get:function(){return C[e]},set:function(t){C[e]=t}}};for(var a in C)Object.prototype.hasOwnProperty.call(C,a)&&"e"!==a&&"t"!==a&&Object.defineProperty(r,a,i(a));return r.e=function(e){return"ready"===h&&d("prepare"),v++,C.e(e).then(t,(function(e){throw t(),e}));function t(){v--,"prepare"===h&&(b[e]||_(e),0===v&&0===y&&S())}},r.t=function(e,t){return 1&t&&(e=r(e)),C.t(e,-2&t)},r}function l(t){var r={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:n!==t,active:!0,accept:function(e,t){if(void 0===e)r._selfAccepted=!0;else if("function"==typeof e)r._selfAccepted=e;else if("object"==typeof e)for(var n=0;n<e.length;n++)r._acceptedDependencies[e[n]]=t||function(){};else r._acceptedDependencies[e]=t||function(){}},decline:function(e){if(void 0===e)r._selfDeclined=!0;else if("object"==typeof e)for(var t=0;t<e.length;t++)r._declinedDependencies[e[t]]=!0;else r._declinedDependencies[e]=!0},dispose:function(e){r._disposeHandlers.push(e)},addDisposeHandler:function(e){r._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=r._disposeHandlers.indexOf(e);t>=0&&r._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,h){case"idle":(f={})[t]=e[t],d("ready");break;case"ready":R(t);break;case"prepare":case"check":case"dispose":case"apply":(g=g||[]).push(t)}},check:x,apply:M,status:function(e){if(!e)return h;u.push(e)},addStatusHandler:function(e){u.push(e)},removeStatusHandler:function(e){var t=u.indexOf(e);t>=0&&u.splice(t,1)},data:a[t]};return n=void 0,r}var u=[],h="idle";function d(e){h=e;for(var t=0;t<u.length;t++)u[t].call(null,e)}var p,f,m,g,y=0,v=0,b={},w={},A={};function E(e){return+e+""===e?+e:e}function x(e){if("idle"!==h)throw new Error("check() is only allowed in idle status");return r=e,d("check"),(t=1e4,t=t||1e4,new Promise((function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,a=C.p+""+i+".hot-update.json";r.open("GET",a,!0),r.timeout=t,r.send(null)}catch(e){return n(e)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+a+" timed out."));else if(404===r.status)e();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+a+" failed."));else{try{var t=JSON.parse(r.responseText)}catch(e){return void n(e)}e(t)}}}))).then((function(e){if(!e)return d(T()?"ready":"idle"),null;w={},b={},A=e.c,m=e.h,d("prepare");var t=new Promise((function(e,t){p={resolve:e,reject:t}}));f={};return _(0),"prepare"===h&&0===v&&0===y&&S(),t}));var t}function _(e){A[e]?(w[e]=!0,y++,function(e){var t=document.createElement("script");t.charset="utf-8",t.src=C.p+""+e+"."+i+".hot-update.js",document.head.appendChild(t)}(e)):b[e]=!0}function S(){d("ready");var e=p;if(p=null,e)if(r)Promise.resolve().then((function(){return M(r)})).then((function(t){e.resolve(t)}),(function(t){e.reject(t)}));else{var t=[];for(var n in f)Object.prototype.hasOwnProperty.call(f,n)&&t.push(E(n));e.resolve(t)}}function M(t){if("ready"!==h)throw new Error("apply() is only allowed in ready status");return function t(r){var s,c,l,u,h;function p(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){var i=r.pop(),a=i.id,o=i.chain;if((u=k[a])&&(!u.hot._selfAccepted||u.hot._selfInvalidated)){if(u.hot._selfDeclined)return{type:"self-declined",chain:o,moduleId:a};if(u.hot._main)return{type:"unaccepted",chain:o,moduleId:a};for(var s=0;s<u.parents.length;s++){var c=u.parents[s],l=k[c];if(l){if(l.hot._declinedDependencies[a])return{type:"declined",chain:o.concat([c]),moduleId:a,parentId:c};-1===t.indexOf(c)&&(l.hot._acceptedDependencies[a]?(n[c]||(n[c]=[]),y(n[c],[a])):(delete n[c],t.push(c),r.push({chain:o.concat([c]),id:c})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}T();var v={},b=[],w={},x=function(){console.warn("[HMR] unexpected require("+S.moduleId+") to disposed module")};for(var _ in f)if(Object.prototype.hasOwnProperty.call(f,_)){var S;h=E(_),S=f[_]?p(h):{type:"disposed",moduleId:_};var M=!1,R=!1,O=!1,P="";switch(S.chain&&(P="\nUpdate propagation: "+S.chain.join(" -> ")),S.type){case"self-declined":r.onDeclined&&r.onDeclined(S),r.ignoreDeclined||(M=new Error("Aborted because of self decline: "+S.moduleId+P));break;case"declined":r.onDeclined&&r.onDeclined(S),r.ignoreDeclined||(M=new Error("Aborted because of declined dependency: "+S.moduleId+" in "+S.parentId+P));break;case"unaccepted":r.onUnaccepted&&r.onUnaccepted(S),r.ignoreUnaccepted||(M=new Error("Aborted because "+h+" is not accepted"+P));break;case"accepted":r.onAccepted&&r.onAccepted(S),R=!0;break;case"disposed":r.onDisposed&&r.onDisposed(S),O=!0;break;default:throw new Error("Unexception type "+S.type)}if(M)return d("abort"),Promise.reject(M);if(R)for(h in w[h]=f[h],y(b,S.outdatedModules),S.outdatedDependencies)Object.prototype.hasOwnProperty.call(S.outdatedDependencies,h)&&(v[h]||(v[h]=[]),y(v[h],S.outdatedDependencies[h]));O&&(y(b,[S.moduleId]),w[h]=x)}var I,N=[];for(c=0;c<b.length;c++)h=b[c],k[h]&&k[h].hot._selfAccepted&&w[h]!==x&&!k[h].hot._selfInvalidated&&N.push({module:h,parents:k[h].parents.slice(),errorHandler:k[h].hot._selfAccepted});d("dispose"),Object.keys(A).forEach((function(e){!1===A[e]&&function(e){delete installedChunks[e]}(e)}));var L,D,F=b.slice();for(;F.length>0;)if(h=F.pop(),u=k[h]){var j={},U=u.hot._disposeHandlers;for(l=0;l<U.length;l++)(s=U[l])(j);for(a[h]=j,u.hot.active=!1,delete k[h],delete v[h],l=0;l<u.children.length;l++){var B=k[u.children[l]];B&&((I=B.parents.indexOf(h))>=0&&B.parents.splice(I,1))}}for(h in v)if(Object.prototype.hasOwnProperty.call(v,h)&&(u=k[h]))for(D=v[h],l=0;l<D.length;l++)L=D[l],(I=u.children.indexOf(L))>=0&&u.children.splice(I,1);d("apply"),void 0!==m&&(i=m,m=void 0);for(h in f=void 0,w)Object.prototype.hasOwnProperty.call(w,h)&&(e[h]=w[h]);var V=null;for(h in v)if(Object.prototype.hasOwnProperty.call(v,h)&&(u=k[h])){D=v[h];var z=[];for(c=0;c<D.length;c++)if(L=D[c],s=u.hot._acceptedDependencies[L]){if(-1!==z.indexOf(s))continue;z.push(s)}for(c=0;c<z.length;c++){s=z[c];try{s(D)}catch(e){r.onErrored&&r.onErrored({type:"accept-errored",moduleId:h,dependencyId:D[c],error:e}),r.ignoreErrored||V||(V=e)}}}for(c=0;c<N.length;c++){var H=N[c];h=H.module,o=H.parents,n=h;try{C(h)}catch(e){if("function"==typeof H.errorHandler)try{H.errorHandler(e)}catch(t){r.onErrored&&r.onErrored({type:"self-accept-error-handler-errored",moduleId:h,error:t,originalError:e}),r.ignoreErrored||V||(V=t),V||(V=e)}else r.onErrored&&r.onErrored({type:"self-accept-errored",moduleId:h,error:e}),r.ignoreErrored||V||(V=e)}}if(V)return d("fail"),Promise.reject(V);if(g)return t(r).then((function(e){return b.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e}));return d("idle"),new Promise((function(e){e(b)}))}(t=t||{})}function T(){if(g)return f||(f={}),g.forEach(R),g=void 0,!0}function R(t){Object.prototype.hasOwnProperty.call(f,t)||(f[t]=e[t])}var k={};function C(t){if(k[t])return k[t].exports;var n=k[t]={i:t,l:!1,exports:{},hot:l(t),parents:(s=o,o=[],s),children:[]};return e[t].call(n.exports,n,n.exports,c(t)),n.l=!0,n.exports}C.m=e,C.c=k,C.d=function(e,t,n){C.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},C.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},C.t=function(e,t){if(1&t&&(e=C(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(C.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)C.d(n,r,function(t){return e[t]}.bind(null,r));return n},C.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return C.d(t,"a",t),t},C.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},C.p="",C.h=function(){return i},c(40)(C.s=40)}([function(e,t){const n={OFF:"#111",WHITE:"#f0f0f0",DARKRED:"#5A354B",RED:"#f971c3",BRIGHTRED:"#ffd3ee",DARKBLUE:"#2B4D4C",BLUE:"#6ff9ea",BRIGHTBLUE:"#d7fdf9",YELLOW:"#fff568",UI_ACCENT:"#08bfa2",UI_ACCENT2:"#f01978"};n.schemes={default:{name:"Super Medium",off:"#111",primary:n.RED,primarybright:n.BRIGHTRED,secondary:n.BLUE,secondarybright:n.BRIGHTBLUE,tertiary:n.YELLOW},blue:{name:"Star Warrior",off:"#111",primary:"#1e4482",primarybright:"#0B4BB3",secondary:"#c27727",secondarybright:"#FFD840",tertiary:"#d7fdf9"},purple:{name:"Galactic Royal",off:"#111",primary:"#6A39B3",primarybright:"#B685FF",secondary:"#FAF239",secondarybright:"#FFFC9E",tertiary:"#50FFF2"},green:{name:"Space Joker",off:"#111",primary:"#779E37",primarybright:"#C0FF59",secondary:"#6A39B3",secondarybright:"#B685FF",tertiary:"#FAFAFA"},yellow:{name:"Solar Flare",off:"#111",primary:"#C2C04C",primarybright:"#FAF761",secondary:"#E03A3E",secondarybright:"#FA7578",tertiary:"#278ECC"},red:{name:"Trail Blazer",off:"#111",primary:"#E03A3E",primarybright:"#FA7578",secondary:"#DADADA",secondarybright:"#EFEFEF",tertiary:"#666"},rgb:{name:"Mint Choco",off:"#111",primary:"#34eb89",primarYBRIGht:"#40fb95",secondary:"#34ebd8",secondarybright:"#40fbeA",tertiary:"#eb3434"},cheetah:{name:"Cheetah SoL",off:"#111",primary:"#c27727",primarYBright:"#e68319",secondary:"#635c54",secondarybright:"#8a857f",tertiary:"#ebebeb"},black:{name:"Ash Nova",off:"#111",primary:"#555",primarybright:"#808080",secondary:"#FFF",secondarybright:"#FFF",tertiary:"#B8B8B8"}},n.options=Object.keys(n.schemes),"undefined"==typeof localStorage?n.initial="default":n.initial=n.schemes[localStorage.getItem("colorScheme")||"blue"],e.exports=n},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},,function(e,t){var n,r,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var c,l=[],u=!1,h=-1;function d(){u&&c&&(u=!1,c.length?l=c.concat(l):h=-1,l.length&&p())}function p(){if(!u){var e=s(d);u=!0;for(var t=l.length;t;){for(c=l,l=[];++h<t;)c&&c[h].run();h=-1,t=l.length}c=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||u||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},,,function(e,t){var n;e.exports.getS3FileUrl=function(e,t){return`https://previews.three.ws/${e}-${t}?v=2`},console.line=(n={},function(e,t,r,i){i=i||"#FFF",n[r=r||"default"]||(n[r]=document.createElement("a-entity"),n[r].setAttribute("line","color",i||"#FFF"),n[r].setAttribute("id",r),AFRAME.scenes[0].appendChild(n[r])),n[r].setAttribute("line","start",e.clone()),n[r].setAttribute("line","end",t.clone())}),console.vec3=function(){const e={},t={primitive:"box",width:.05,height:.05,depth:.05},n={shader:"flat"};return function(r,i,a){a=a||"#FFF",e[i=i||"default"]||(e[i]=document.createElement("a-entity"),n.color=a||"#FFF",e[i].setAttribute("geometry",t),e[i].setAttribute("material",n),e[i].setAttribute("id",i),e[i].setAttribute("text",{align:"center",value:i,side:"double"}),AFRAME.scenes[0].appendChild(e[i])),e[i].object3D.position.copy(r)}}()},function(e,t){e.exports="varying vec2 uvs;\nvarying float distance;\nvoid main() {\n uvs.xy = uv.xy;\n distance = length((modelMatrix * vec4(position, 1.0)).xyz - cameraPosition);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvarying float distance;\nuniform sampler2D src;\nuniform vec3 color;\n\nvoid main() {\n float alpha = texture2D(src, uvs).a;\n alpha *= 1.0 - clamp(distance / 40.0, 0.0, 1.0);\n gl_FragColor = vec4(color, alpha);\n}\n"},,,function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return i})),n.d(t,"__assign",(function(){return a})),n.d(t,"__rest",(function(){return o})),n.d(t,"__decorate",(function(){return s})),n.d(t,"__param",(function(){return c})),n.d(t,"__metadata",(function(){return l})),n.d(t,"__awaiter",(function(){return u})),n.d(t,"__generator",(function(){return h})),n.d(t,"__exportStar",(function(){return d})),n.d(t,"__values",(function(){return p})),n.d(t,"__read",(function(){return f})),n.d(t,"__spread",(function(){return m})),n.d(t,"__spreadArrays",(function(){return g})),n.d(t,"__await",(function(){return y})),n.d(t,"__asyncGenerator",(function(){return v})),n.d(t,"__asyncDelegator",(function(){return b})),n.d(t,"__asyncValues",(function(){return w})),n.d(t,"__makeTemplateObject",(function(){return A})),n.d(t,"__importStar",(function(){return E})),n.d(t,"__importDefault",(function(){return x}));
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function s(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o}function c(e,t){return function(n,r){t(n,r,e)}}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,s)}c((r=r.apply(e,t||[])).next())}))}function h(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function d(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function p(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(f(arguments[t]));return e}function g(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}function y(e){return this instanceof y?(this.v=e,this):new y(e)}function v(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof y?Promise.resolve(n.value.v).then(c,l):u(a[0][2],n)}catch(e){u(a[0][3],e)}var n}function c(e){s("next",e)}function l(e){s("throw",e)}function u(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function b(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:y(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function w(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=p(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function A(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function x(e){return e&&e.__esModule?e:{default:e}}},,,,function(e,t,n){"use strict";n.r(t),n.d(t,"BEAT_ANTICIPATION_TIME",(function(){return a})),n.d(t,"BEAT_PRELOAD_TIME",(function(){return o})),n.d(t,"PUNCH_OFFSET",(function(){return s})),n.d(t,"SWORD_OFFSET",(function(){return c}));n(6);let r=AFRAME.utils.getUrlParameter("skip")||0;r=parseInt(r,10);const i=AFRAME.utils.getUrlParameter("debugmines"),a=1.1,o=1.1,s=.5,c=1.5,l=AFRAME.utils.device.isMobile(),u=l?2e3:3500,h=l?7500:1e4;function d(e,t){return e._time-t._time}if(AFRAME.registerComponent("beat-generator",{dependencies:["stage-colors"],schema:{challengeId:{type:"string"},gameMode:{type:"string"},difficulty:{type:"string"},beatmapCharacteristic:{type:"string"},has3DOFVR:{default:!1},hasSongLoadError:{default:!1},isPlaying:{default:!1},isZipFetching:{default:!1},menuSelectedChallengeId:{type:"string"},songDuration:{type:"number"},speed:{type:"number"}},orientationsHumanized:["up","down","left","right","upleft","upright","downleft","downright"],horizontalPositions:[-.75,-.25,.25,.75],horizontalPositionsHumanized:{0:"left",1:"middleleft",2:"middleright",3:"right"},positionHumanized:{topLeft:{layer:2,index:0},topCenterLeft:{layer:2,index:1},topCenterRight:{layer:2,index:2},topRight:{layer:2,index:3},middleLeft:{layer:1,index:0},middleCenterLeft:{layer:1,index:1},middleCenterRight:{layer:1,index:2},middleRight:{layer:1,index:3},bottomLeft:{layer:0,index:0},bottomCenterLeft:{layer:0,index:1},bottomCenterRight:{layer:0,index:2},bottomRight:{layer:0,index:3}},verticalPositionsHumanized:{0:"bottom",1:"middle",2:"top"},init:function(){this.audioAnalyserEl=document.getElementById("audioanalyser"),this.beatContainer=document.getElementById("beatContainer"),this.beats=null,this.beatData=null,this.beatDataProcessed=!1,this.preloadTime=0,this.songTime=void 0,this.bpm=void 0,this.curve=null,this.curveEl=document.getElementById("curve"),this.curveFollowRigEl=document.getElementById("curveFollowRig"),this.tube=document.getElementById("tube"),this.index={events:0,notes:0,obstacles:0},this.wallContainer=document.getElementById("wallContainer"),this.leftStageLasers=document.getElementById("leftStageLasers"),this.rightStageLasers=document.getElementById("rightStageLasers"),this.stageColors=this.el.components["stage-colors"],this.el.addEventListener("cleargame",this.onClearGame.bind(this)),this.el.addEventListener("gamemenurestart",this.onRestart.bind(this)),this.el.addEventListener("ziploaderend",e=>{this.beats=e.detail.beats,this.data.challengeId&&!this.data.hasSongLoadError&&(this.beatData=this.beats[this.data.beatmapCharacteristic+"-"+this.data.difficulty],this.processBeats())})},play:function(){this.playerHeight=document.querySelector("[player-height]").components["player-height"]},update:function(e){const t=this.data;e.challengeId!==t.challengeId&&t.challengeId&&(this.index.events=0,this.index.notes=0,this.index.obstacles=0,this.data.isZipFetching||!this.beats||this.data.hasSongLoadError||(this.beatData=this.beats[this.data.beatmapCharacteristic+"-"+this.data.difficulty],this.processBeats()),this.curveEl.components.supercurve.generateCurve(t.speed*t.songDuration),this.curve=this.curveEl.components.supercurve.curve)},processBeats:function(){if(this.data.hasSongLoadError)return;this.beatData.version&&"3"===this.beatData.version.charAt(0)&&(this.beatData=function(e){const t={_version:"3.2.2",_beatsPerMinute:e._beatsPerMinute,_events:[],_notes:[],_obstacles:[]};t._notes=e.colorNotes.map(e=>({_time:e.b,_lineIndex:e.x,_lineLayer:e.y,_type:e.c,_cutDirection:e.d}));for(const n of e.bombNotes)t._notes.push({_time:n.b,_lineIndex:n.x,_lineLayer:n.y,_type:3});return t._notes.sort((e,t)=>e._time-t._time),t._obstacles=e.obstacles.map(e=>({_time:e.b,_lineIndex:e.x,_lineLayer:e.y,_type:e._type,_duration:e.d,_width:e.w,_height:e.h})),t}(this.beatData)),this.songTime=0,this.preloadTime=0,this.beatData._events=this.beatData._events||[],this.beatData._obstacles=this.beatData._obstacles||[],this.beatData._notes=this.beatData._notes||[],this.beatData._events.sort(d),this.beatData._obstacles.sort(d),this.beatData._notes.sort(d),this.bpm=this.beatData._beatsPerMinute,this.beatData._obstacles.length>256&&(this.beatData._obstacles=[]);const e=this.beatData._events;if(e.length&&e[0]._time<0)for(let t=0;e[t]._time<0;t++)this.generateEvent(e[t]);this.beatDataProcessed=!0,console.log("[beat-generator] Finished processing beat data.")},tick:function(e,t){if(!this.data.isPlaying||!this.data.challengeId||!this.beatData)return;let n;const i=this.el.components.song;if(void 0===this.preloadTime){if(!i.isAudioPlaying)return;n=1e3*i.getCurrentTime()+r}else n=this.preloadTime;this.beatData._beatsPerMinute;const a=6e4/this.beatData._beatsPerMinute,s=this.beatData._notes;for(let e=this.index.notes;e<s.length;++e)n+u>s[e]._time*a&&(this.generateBeat(s[e]),this.index.notes++);if("ride"!==this.data.gameMode){const e=this.beatData._obstacles;for(let t=this.index.obstacles;t<e.length;++t)n+h>=e[t]._time*a&&(this.generateWall(e[t]),this.index.obstacles++)}const c=this.beatData._events;for(let e=this.index.events;e<c.length;++e)n>=c[e]._time*a&&(this.generateEvent(c[e]),this.index.events++);void 0!==this.preloadTime&&(this.preloadTime>=1e3*o?(this.el.sceneEl.emit("beatloaderpreloadfinish",null,!1),this.preloadTime=void 0):this.preloadTime+=t)},generateBeat:function(e,t){const n=this.data;let r;i&&(e._type=3);let a=8===e._cutDirection?"dot":"arrow";if(0===e._type?r="red":1===e._type?r="blue":(a="mine",r=void 0),n.has3DOFVR&&"viewer"!==n.gameMode&&"ride"!==n.gameMode&&"red"===r)return;(AFRAME.utils.getUrlParameter("dot")||"punch"===n.gameMode)&&(a="dot");const o=this.requestBeat(a,r);o&&(o.components.beat||o.components.plume?this.setupBeat(o,e):setTimeout(()=>{this.setupBeat(o,e)}))},setupBeat:function(e,t){const n=this.data,r=this.orientationsHumanized[t._cutDirection],i=this.horizontalPositionsHumanized[t._lineIndex]||"left",o=this.verticalPositionsHumanized[t._lineLayer]||"middle",l=(("classic"===this.data.gameMode?c:s)/n.speed+a)/n.songDuration,u=1e3*n.songDuration,h=6e4/this.beatData._beatsPerMinute,d=t._time*h/u+l,p=this.el.systems["render-order"].order.beats+1-d;"ride"===n.gameMode?(e.components.plume.onGenerate(d,i,o,this.playerHeight.beatOffset),e.setAttribute("render-order",p)):(e.components.beat.onGenerate(d,i,o,r,this.playerHeight.beatOffset),e.components.beat.blockEl.object3D.renderOrder=p),e.play()},generateWall:function(e){this.data;const t=this.el.sceneEl.components.pool__wall.requestEntity();t&&(t.components.wall?this.setupWall(t,e):setTimeout(()=>{this.setupWall(t,e)}))},setupWall:function(e,t){const n=this.data;if(n.has3DOFVR&&"viewer"!==n.gameMode)return;const r=t._duration/this.bpm*60,i=this.horizontalPositionsHumanized[t._lineIndex]||"none",o=1===t._type,s=r*n.speed,c=t._width/2,l=a/n.songDuration,u=1e3*n.songDuration,h=6e4/this.beatData._beatsPerMinute,d=t._time*h/u+l,p=s/this.curveEl.components.supercurve.length;e.components.wall.onGenerate(d,i,c,s,o,d+p),e.play(),e.object3D.renderOrder=this.el.systems["render-order"].order.beats+1-(d+p)},generateEvent:function(e){switch(e._type){case 0:this.stageColors.setColor("bg",e._value),this.stageColors.setColorInstant("moon",e._value);break;case 1:this.stageColors.setColorInstant("stars",e._value);break;case 2:this.stageColors.setColor("curveeven",e._value);break;case 3:this.stageColors.setColor("curveodd",e._value);break;case 4:this.stageColors.setColor("floor",e._value);break;case 8:case 9:this.tube.emit("pulse",null,!1);break;case 12:this.stageColors.setColor("leftglow",e._value);break;case 13:this.stageColors.setColor("rightglow",e._value)}},requestBeat:function(e,t){let n="pool__beat-"+e;"ride"===this.data.gameMode&&(n="pool__plume-"+e),"mine"!==e&&t&&(n+="-"+t);const r=this.el.sceneEl.components[n];if(r)return r.requestEntity();console.warn("Pool "+n+" unavailable")},onClearGame:function(){this.preloadTime=0,this.index.events=0,this.index.notes=0,this.index.obstacles=0;for(let e=0;e<this.beatContainer.children.length;e++){const t=this.beatContainer.children[e];t.object3D.position.set(0,0,-9999),t.components.beat&&t.components.beat.returnToPool()}for(let e=0;e<this.wallContainer.children.length;e++){const t=this.wallContainer.children[e];t.object3D.position.set(0,-9999,0),t.components.wall&&t.components.wall.returnToPool()}},onRestart:function(){const e=this.data;this.curveEl.components.supercurve.generateCurve(e.speed*e.songDuration),this.curve=this.curveEl.components.supercurve.curve}}),window.AFRAME){const t=["beat-generator"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=n(11),i={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},a=function(e,t){if(!e)throw o(t)},o=function(e){return new Error("Firebase Database ("+i.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},s=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},c={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i<e.length;i+=3){var a=e[i],o=i+1<e.length,s=o?e[i+1]:0,c=i+2<e.length,l=c?e[i+2]:0,u=a>>2,h=(3&a)<<4|s>>4,d=(15&s)<<2|l>>6,p=63&l;c||(p=64,o||(d=64)),r.push(n[u],n[h],n[d],n[p])}return r.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(s(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],n=0,r=0;n<e.length;){var i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){var a=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&a)}else if(i>239&&i<365){var o=((7&i)<<18|(63&(a=e[n++]))<<12|(63&(s=e[n++]))<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(o>>10)),t[r++]=String.fromCharCode(56320+(1023&o))}else{a=e[n++];var s=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&a)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<e.length;){var a=n[e.charAt(i++)],o=i<e.length?n[e.charAt(i)]:0,s=++i<e.length?n[e.charAt(i)]:64,c=++i<e.length?n[e.charAt(i)]:64;if(++i,null==a||null==o||null==s||null==c)throw Error();var l=a<<2|o>>4;if(r.push(l),64!==s){var u=o<<4&240|s>>2;if(r.push(u),64!==c){var h=s<<6&192|c;r.push(h)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},l=function(e){try{return c.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function u(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n in t)t.hasOwnProperty(n)&&(e[n]=u(e[n],t[n]));return e}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var h=function(){function e(){var e=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))}return e.prototype.wrapCallback=function(e){var t=this;return function(n,r){n?t.reject(n):t.resolve(r),"function"==typeof e&&(t.promise.catch((function(){})),1===e.length?e(n):e(n,r))}},e}();
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function d(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function p(){try{return"[object process]"===Object.prototype.toString.call(e.process)}catch(e){return!1}}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var f=function(e){function t(n,r){var i=e.call(this,r)||this;return i.code=n,i.name="FirebaseError",Object.setPrototypeOf(i,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,m.prototype.create),i}return r.__extends(t,e),t}(Error),m=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n}return e.prototype.create=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=t[0]||{},i=this.service+"/"+e,a=this.errors[e],o=a?g(a,r):"Error",s=this.serviceName+": "+o+" ("+i+").",c=new f(i,s),l=0,u=Object.keys(r);l<u.length;l++){var h=u[l];"_"!==h.slice(-1)&&(h in c&&console.warn('Overwriting FirebaseError base field "'+h+'" can cause unexpected behavior.'),c[h]=r[h])}return c},e}();function g(e,t){return e.replace(y,(function(e,n){var r=t[n];return null!=r?String(r):"<"+n+"?>"}))}var y=/\{\$([^}]+)}/g;
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function v(e){return JSON.parse(e)}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var b=function(e){var t={},n={},r={},i="";try{var a=e.split(".");t=v(l(a[0])||""),n=v(l(a[1])||""),i=a[2],r=n.d||{},delete n.d}catch(e){}return{header:t,claims:n,data:r,signature:i}};
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var w=function(){function e(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}return e.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},e.prototype.compress_=function(e,t){t||(t=0);var n=this.W_;if("string"==typeof e)for(var r=0;r<16;r++)n[r]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(r=0;r<16;r++)n[r]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(r=16;r<80;r++){var i=n[r-3]^n[r-8]^n[r-14]^n[r-16];n[r]=4294967295&(i<<1|i>>>31)}var a,o,s=this.chain_[0],c=this.chain_[1],l=this.chain_[2],u=this.chain_[3],h=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(a=u^c&(l^u),o=1518500249):(a=c^l^u,o=1859775393):r<60?(a=c&l|u&(c|l),o=2400959708):(a=c^l^u,o=3395469782);i=(s<<5|s>>>27)+a+h+o+n[r]&4294967295;h=u,u=l,l=4294967295&(c<<30|c>>>2),c=s,s=i}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+c&4294967295,this.chain_[2]=this.chain_[2]+l&4294967295,this.chain_[3]=this.chain_[3]+u&4294967295,this.chain_[4]=this.chain_[4]+h&4294967295},e.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var n=t-this.blockSize,r=0,i=this.buf_,a=this.inbuf_;r<t;){if(0===a)for(;r<=n;)this.compress_(e,r),r+=this.blockSize;if("string"==typeof e){for(;r<t;)if(i[a]=e.charCodeAt(r),++r,++a===this.blockSize){this.compress_(i),a=0;break}}else for(;r<t;)if(i[a]=e[r],++r,++a===this.blockSize){this.compress_(i),a=0;break}}this.inbuf_=a,this.total_+=t}},e.prototype.digest=function(){var e=[],t=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var n=this.blockSize-1;n>=56;n--)this.buf_[n]=255&t,t/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)e[r]=this.chain_[n]>>i&255,++r;return e},e}();var A=function(){function e(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((function(){e(n)})).catch((function(e){n.error(e)}))}return e.prototype.next=function(e){this.forEachObserver((function(t){t.next(e)}))},e.prototype.error=function(e){this.forEachObserver((function(t){t.error(e)})),this.close(e)},e.prototype.complete=function(){this.forEachObserver((function(e){e.complete()})),this.close()},e.prototype.subscribe=function(e,t,n){var r,i=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(e,t){if("object"!=typeof e||null===e)return!1;for(var n=0,r=t;n<r.length;n++){var i=r[n];if(i in e&&"function"==typeof e[i])return!0}return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n}).next&&(r.next=E),void 0===r.error&&(r.error=E),void 0===r.complete&&(r.complete=E);var a=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((function(){try{i.finalError?r.error(i.finalError):r.complete()}catch(e){}})),this.observers.push(r),a},e.prototype.unsubscribeOne=function(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},e.prototype.forEachObserver=function(e){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,e)},e.prototype.sendOne=function(e,t){var n=this;this.task.then((function(){if(void 0!==n.observers&&void 0!==n.observers[e])try{t(n.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}}))},e.prototype.close=function(e){var t=this;this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then((function(){t.observers=void 0,t.onNoObservers=void 0})))},e}();function E(){}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function x(e,t,n){var r="";switch(t){case 1:r=n?"first":"First";break;case 2:r=n?"second":"Second";break;case 3:r=n?"third":"Third";break;case 4:r=n?"fourth":"Fourth";break;default:throw new Error("errorPrefix called with argumentNumber > 4. Need to update it?")}var i=e+" failed: ";return i+=r+" argument "}t.CONSTANTS=i,t.Deferred=h,t.ErrorFactory=m,t.FirebaseError=f,t.Sha1=w,t.areCookiesEnabled=function(){return!(!navigator||!navigator.cookieEnabled)},t.assert=a,t.assertionError=o,t.async=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Promise.resolve(!0).then((function(){e.apply(void 0,n)})).catch((function(e){t&&t(e)}))}},t.base64=c,t.base64Decode=l,t.base64Encode=function(e){var t=s(e);return c.encodeByteArray(t,!0)},t.contains=
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.createSubscribe=function(e,t){var n=new A(e,t);return n.subscribe.bind(n)},t.decode=b,t.deepCopy=
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+function(e){return u(void 0,e)},t.deepExtend=u,t.errorPrefix=x,t.getUA=d,t.isAdmin=function(e){var t=b(e).claims;return"object"==typeof t&&!0===t.admin},t.isBrowser=function(){return"object"==typeof self&&self.self===self},t.isBrowserExtension=function(){var e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id},t.isElectron=function(){return d().indexOf("Electron/")>=0},t.isEmpty=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},t.isIE=function(){var e=d();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0},t.isIndexedDBAvailable=function(){return"indexedDB"in self&&null!==indexedDB},t.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(d())},t.isNode=p,t.isNodeSdk=function(){return!0===i.NODE_CLIENT||!0===i.NODE_ADMIN},t.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},t.isSafari=function(){return!p()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")},t.isUWP=function(){return d().indexOf("MSAppHost/")>=0},t.isValidFormat=function(e){var t=b(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")},t.isValidTimestamp=function(e){var t=b(e).claims,n=Math.floor((new Date).getTime()/1e3),r=0,i=0;return"object"==typeof t&&(t.hasOwnProperty("nbf")?r=t.nbf:t.hasOwnProperty("iat")&&(r=t.iat),i=t.hasOwnProperty("exp")?t.exp:r+86400),!!n&&!!r&&!!i&&n>=r&&n<=i},t.issuedAtTime=function(e){var t=b(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null},t.jsonEval=v,t.map=function(e,t,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t.call(n,e[i],i,e));return r}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */,t.querystring=function(e){for(var t=[],n=function(e,n){Array.isArray(n)?n.forEach((function(n){t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))})):t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))},r=0,i=Object.entries(e);r<i.length;r++){var a=i[r];n(a[0],a[1])}return t.length?"&"+t.join("&"):""},t.querystringDecode=function(e){var t={};return e.replace(/^\?/,"").split("&").forEach((function(e){if(e){var n=e.split("=");t[n[0]]=n[1]}})),t},t.safeGet=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},t.stringLength=function(e){for(var t=0,n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t++:r<2048?t+=2:r>=55296&&r<=56319?(t+=4,n++):t+=3}return t},t.stringToByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);if(i>=55296&&i<=56319){var o=i-55296;r++,a(r<e.length,"Surrogate pair missing trail surrogate."),i=65536+(o<<10)+(e.charCodeAt(r)-56320)}i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):i<65536?(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},t.stringify=function(e){return JSON.stringify(e)},t.validateArgCount=function(e,t,n,r){var i;if(r<t?i="at least "+t:r>n&&(i=0===n?"none":"no more than "+n),i)throw new Error(e+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")},t.validateCallback=function(e,t,n,r){if((!r||n)&&"function"!=typeof n)throw new Error(x(e,t,r)+"must be a valid function.")},t.validateContextObject=function(e,t,n,r){if((!r||n)&&("object"!=typeof n||null===n))throw new Error(x(e,t,r)+"must be a valid context object.")}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */,t.validateIndexedDBOpenable=function(){return new Promise((function(e,t){try{var n=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=window.indexedDB.open(r);i.onsuccess=function(){i.result.close(),n||window.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=function(){n=!1},i.onerror=function(){var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}}))},t.validateNamespace=function(e,t,n,r){if((!r||n)&&"string"!=typeof n)throw new Error(x(e,t,r)+"must be a valid firebase namespace.")}}).call(this,n(1))},function(e,t,n){var r=n(197);(e.exports=n(198)(!1)).push([e.i,"html {\n background: #000;\n}\n\n#vrButton {\n position: absolute;\n background: url("+r(n(199))+") no-repeat;\n background-size: cover;\n border: 0;\n cursor: pointer;\n right: 20px;\n bottom: 20px;\n text-decoration: none;\n z-index: 9999999;\n width: 84px;\n height: 47px;\n}\n\n#vrButton.a-hidden {\n visibility: hidden;\n}\n\n#vrButton:active {\n border: 0;\n}\n\n#vrButton:hover {\n background-position: 0 -50.5px;\n}\n\n#vrButton p {\n bottom: 45px;\n color: #FFF;\n font-size: 12px;\n font-family: monospace;\n font-weight: bold;\n text-align: center;\n text-transform: uppercase;\n position: relative;\n}\n\n.a-loader-title {\n animation: loaderTitle 1s infinite alternate;\n color: rgba(0,0,0,0);\n background: none;\n background-image: url("+r(n(200))+");\n height: 36.2vh;\n background-repeat: no-repeat;\n background-position: center;\n margin-top: 0;\n background-size: contain;\n}\n\n@keyframes loaderTitle {\n 0% { opacity: 1; }\n 50% { opacity: 0.8; }\n 100% { opacity: 1; }\n}\n\nbutton {\n border: 0;\n background: #FF74b8;\n border-radius: 20px;\n cursor: pointer;\n font-size: 14px;\n color: #FAFAFA;\n text-transform: uppercase;\n transition: .1s all;\n padding: 11px 20px;\n vertical-align: middle;\n}\n\nbutton:hover {\n background: #FF94C8;\n}\n",""])},,,function(e,t,n){"use strict";n.r(t);var r=n(15);n(0),new THREE.Object3D,new THREE.Box3,new THREE.Box3;const i=2*Math.PI,a=(o=1.33,s=.5,e=>1-function(e,t){function n(e,t,n){return Math.min(Math.max(e,t),n)}const r=n(e||1,1,10),i=n(t||.5,.1,2);return e=>0===e||1===e?e:-r*Math.pow(2,10*(e-1))*Math.sin((e-1-i/(2*Math.PI)*Math.asin(1/r))*(2*Math.PI)/i)}(o,s)(1-e));var o,s;const c={once:!0},l=!!AFRAME.utils.getUrlParameter("synctest"),u=(new THREE.Object3D,new THREE.Vector3,"mine"),h={up:new THREE.Vector3(0,1,0),down:new THREE.Vector3(0,-1,0),left:new THREE.Vector3(-1,0,0),right:new THREE.Vector3(1,0,0),upleft:new THREE.Vector3(-1,1,0).normalize(),upright:new THREE.Vector3(1,1,0).normalize(),downleft:new THREE.Vector3(-1,-1,0).normalize(),downright:new THREE.Vector3(1,-1,0).normalize()},d={arrowblue:"blueBeatObjTemplate",arrowred:"redBeatObjTemplate",dotblue:"dotBlueObjTemplate",dotred:"dotRedObjTemplate",mine:"mineObjTemplate"},p={right:"blue",left:"red"},f={right:0,upright:45,up:90,upleft:135,left:180,downleft:225,down:270,downright:315},m={classic:.48,punch:.35,ride:.4};AFRAME.registerComponent("beat-system",{schema:{gameMode:{default:"classic",oneOf:["classic","punch","ride"]},hasVR:{default:!1},inVR:{default:!1},isLoading:{default:!1},isPlaying:{default:!1}},init:function(){this.beats=[],this.beatsToCheck=[],this.blades=[],this.fists=[],this.weapons=null,this.bladeEls=this.el.sceneEl.querySelectorAll("a-entity[blade]"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.punchEls=this.el.sceneEl.querySelectorAll("a-entity[punch]"),this.curveEl=document.getElementById("curve"),this.size=m[this.data.gameMode],this.supercurveFollow=null},play:function(){for(let e=0;e<2;e++)this.blades.push(this.bladeEls[e].components.blade),this.fists.push(this.punchEls[e].components.punch);this.supercurve=this.curveEl.components.supercurve,this.supercurveFollow=this.curveFollowRig.components["supercurve-follow"]},update:function(e){this.size=m[this.data.gameMode],e.isLoading&&!this.data.isLoading&&(this.updateBeatPositioning(),this.weaponOffset="classic"===this.data.gameMode?1.15*r.SWORD_OFFSET:r.PUNCH_OFFSET,this.weaponOffset=this.weaponOffset/this.supercurve.curve.getLength()),e.gameMode!==this.data.gameMode&&(this.weapons="classic"===this.data.gameMode?this.blades:this.fists)},tick:function(e,t){if(!this.data.isPlaying||"ride"===this.data.gameMode)return;const n=this.beatsToCheck,r=(this.supercurve.curve,this.supercurveFollow.songProgress);n.length=0;for(let e=0;e<this.beats.length;e++){const t=this.beats[e];if(t.destroyed)continue;if(r<t.songPosition-this.weaponOffset)continue;let i=!0;for(let e=0;e<n.length&&(t.horizontalPosition===n[e].horizontalPosition&&t.verticalPosition===n[e].verticalPosition&&t.songPosition>n[e].songPosition&&(i=!1),i);e++);i&&n.push(t)}if(this.weapons[0].tickBeatSystem(e,t),this.weapons[1].tickBeatSystem(e,t),n.length)for(let e=0;e<n.length;e++)!l&&this.data.hasVR||n[e].data.type===u?this.checkCollision(n[e],this.weapons[0],this.weapons[1]):n[e].autoHit(this.weapons[0].el)},checkCollision:function(e,t,n){if(e.data.type===u)return t.checkCollision(e)?void e.onHit(t.el):void(n.checkCollision(e)&&e.onHit(n.el));const r=p[t.el.dataset.hand]===e.data.color?t:n;if(r.checkCollision(e))return void e.onHit(r.el);const i=r===t?n:t;if(i.checkCollision(e)){if("classic"===this.data.gameMode&&i.strokeSpeed<15)return;if("punch"===this.data.gameMode&&i.speed<2)return;e.onHit(i.el,!0),e.destroyBeat(i.el,!1)}},horizontalPositions:{},verticalPositions:{},updateBeatPositioning:function(){const e={classic:.95,ride:.95,punch:1.2};return function(){const t=this.data.gameMode,n=this.horizontalPositions,r=this.verticalPositions,i=this.el.sceneEl.camera.el.object3D.position.y-1.6,a=m[t],o="classic"===t?a:1.2*a;n.left=-1.5*o,n.middleleft=-.5*o,n.middle=o,n.middleright=.5*o,n.right=1.5*o;const s=e[t],c=a;r.bottom=Math.max(.4,s+i),r.middle=Math.max(.4+c,s+c+i),r.top=Math.max(.4+2*c,s+2*c+i)}}(),registerBeat:function(e){this.beats.push(e)},unregisterBeat:function(e){this.beats.splice(this.beats.indexOf(e),1)}}),AFRAME.registerComponent("beat",{schema:{color:{default:"red",oneOf:["red","blue"]},debug:{default:!1},type:{default:"arrow",oneOf:["arrow","dot",u]}},init:function(){this.bbox=null,this.beatSystem=this.el.sceneEl.components["beat-system"],this.broken=null,this.brokenPoolName=void 0,this.destroyed=!1,this.hitEventDetail={},this.poolName=void 0,this.returnToPoolTimer=1e3,this.rotationAxis=new THREE.Vector3,this.superCutIdx=0,this.startPositionZ=void 0,this.warmupTime=0,this.weaponColors={right:"blue",left:"red"},this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.mineParticles=document.getElementById("mineParticles"),this.rigContainer=document.getElementById("rigContainer"),this.superCuts=document.querySelectorAll(".superCutFx"),this.verticalPositions=this.beatSystem.verticalPositions,this.explodeEventDetail={beatDirection:"",color:this.data.color,correctHit:!1,direction:new THREE.Vector3,gameMode:"",position:new THREE.Vector3,rotation:new THREE.Euler},this.blockEl=document.createElement("a-entity"),this.blockEl.setAttribute("mixin","beatBlock"),this.el.appendChild(this.blockEl),this.initMesh(),this.data.type===u?this.poolName="pool__beat-mine":this.poolName=`pool__beat-${this.data.type}-${this.data.color}`},tick:function(e,t){const n=this.el;this.data;if(this.queueBeatHitEvent?(n.sceneEl.emit("beathit",this.queueBeatHitEvent,!0),this.queueBeatHitEvent=null):this.queueBeatWrongEvent&&(n.sceneEl.emit("beatwrong",null,!0),this.queueBeatWrongEvent=null),this.destroyed)return this.returnToPoolTimer-=t,void(this.returnToPoolTimer<=0&&this.returnToPool());if(this.warmupTime<2e3){const e=a(this.warmupTime/2e3);n.object3D.rotation.y=this.rotationStart+e*this.rotationChange,n.object3D.position.y=this.positionStart+e*this.positionChange,this.warmupTime+=t}const r="mine"===this.data.type?.25:1.25;n.object3D.position.z-r>this.curveFollowRig.object3D.position.z&&(this.returnToPool(),this.missHit())},onGenerate:function(e,t,n,r,a){const o=this.data,s=this.el;this.beatSystem.registerBeat(this);const c=m[this.beatSystem.data.gameMode]*(1/.29);if(this.blockEl.object3D.scale.set(c,c,c),r=r||"down",this.cutDirection=r,this.horizontalPosition=t,this.verticalPosition=n,this.songPosition=e,!this.blockEl)return void console.warn("Unable to generate beat. blockEl was undefined.");this.blockEl.object3D.visible=!0,this.destroyed=!1,s.object3D.visible=!0,this.warmupTime=0;const l=this.curveEl.components.supercurve;l.getPointAt(e,s.object3D.position),l.alignToCurve(e,s.object3D),s.object3D.position.x+=this.beatSystem.horizontalPositions[t],"dot"!==o.type&&(s.object3D.rotation.z=THREE.Math.degToRad(f[r])),this.rotationStart=s.object3D.rotation.y,this.rotationChange=i,Math.random>.5&&(this.rotationChange*=-1);s.object3D.position.y-=.5,this.positionStart=s.object3D.position.y,this.positionChange=this.verticalPositions[n]+.5+a},initMesh:function(){const e=this.blockEl,t=(this.el,this.data.type);!function e(t,n){if(!g[n]){const r=document.getElementById(n);if(!r.getObject3D("mesh"))return void r.addEventListener("object3dset",r=>{"mesh"===r.detail.type&&e(t,n)},c);g[n]=r.getObject3D("mesh").children[0].geometry}g[n]&&(t.getObject3D("mesh")||t.setObject3D("mesh",new THREE.Mesh),t.getObject3D("mesh").geometry=g[n])}(e,d["mine"!==t?`${t}${this.data.color}`:t]),e.setAttribute("materials","name","beat");const n=e.getObject3D("mesh");if(n.geometry.computeBoundingBox(),this.bbox=n.geometry.boundingBox,"mine"===this.data.type){const e=new THREE.Vector3;this.bbox.getSize(e),e.multiplyScalar(-.25),this.bbox.expandByVector(e)}},wrongHit:function(){this.destroyed=!0,this.queueBeatWrongEvent=!0},missHit:function(){this.data.type!==u&&this.el.sceneEl.emit("beatmiss",null,!0)},destroyBeat:function(e,t){this.data;const n=this.explodeEventDetail,r=this.rigContainer.object3D;let i;if(this.blockEl.object3D.visible=!1,this.destroyed=!0,this.returnToPoolTimer=1e3,n.beatDirection=this.cutDirection,n.color=this.data.color,n.correctHit=t,n.gameMode=this.beatSystem.data.gameMode,n.position.copy(this.el.object3D.position),r.worldToLocal(n.position),this.data.type===u)i="pool__beat-broken-mine";else{i=`pool__${"classic"===this.beatSystem.data.gameMode?"beat":"punch"}-broken-${this.data.color}`,"dot"===this.data.type&&(i+="-dot")}this.broken=this.el.sceneEl.components[i].requestEntity(),this.broken&&this.broken.emit("explode",this.explodeEventDetail,!1),"classic"===this.beatSystem.data.gameMode&&t&&e.components.trail.pulse()},returnToPool:function(){this.beatSystem.unregisterBeat(this),this.el.object3D.position.set(0,0,-9999),this.el.object3D.visible=!1,this.el.sceneEl.components[this.poolName].returnEntity(this.el)},onHit:function(e,t){const n=this.data;try{e.components.haptics__beat.pulse()}catch(e){console.log(e)}if(this.el.parentNode.components["beat-hit-sound"].playSound(this.el,this.cutDirection),t)this.wrongHit();else{if(n.type===u)return this.destroyBeat(e,!1),void this.el.sceneEl.emit("minehit",null,!0);if("classic"===this.beatSystem.data.gameMode){let t=0;if("arrow"===n.type){if(t=e.components.blade.strokeDirectionVector.dot(h[this.cutDirection]),t<.625)return this.destroyBeat(e,!1),void this.wrongHit()}return this.destroyBeat(e,!0),void this.calculateScoreBlade(e,t)}"punch"===this.beatSystem.data.gameMode&&(this.destroyBeat(e,!0),this.calculateScorePunch(e))}},score:function(e,t){const n=this.el,r=this.hitEventDetail;e=10*Math.ceil(parseInt(e,10)/10),r.percent=t,r.score=e,this.queueBeatHitEvent=r,t>=100&&(this.superCuts[this.superCutIdx].components.supercutfx.createSuperCut(n.object3D,this.data.color),this.superCutIdx=(this.superCutIdx+1)%this.superCuts.length)},calculateScoreBlade:function(e,t){const n=e.components.blade.strokeSpeed,r=e.components.blade.strokeSpeed/10*30;let i;i=n<=10?Math.min(r,30):y(v(n,10,25),10,25,30,50);let a=Math.min(r,30);"dot"===this.data.type?(i+=70,a+=70):(i+=70*t,a+=t>.97?70:70*t),this.score(i,a)},calculateScorePunch:function(e){const t=e.components.punch.speed,n=t/1.5*40;let r;r=t<=1.5?60+Math.min(n,40):60+y(v(t,1.5,6),1.5,6,40,70);const i=60+Math.min(n,40);this.score(r,i)},autoHit:function(e){const t=this.el;this.destroyBeat(e,Math.random()<.9),t.parentNode.components["beat-hit-sound"].playSound(t,this.cutDirection);const n=this.hitEventDetail;n.percent=100,n.score=100,this.queueBeatHitEvent=n}});const g={};function y(e,t,n,r,i){return r+(i-r)*(e-t)/(n-t)}function v(e,t,n){return Math.min(Math.max(e,t),n)}if(window.AFRAME){const t=["beat-system","beat"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i,a=n(11),o=n(17),s=n(23),c=n(24),l=((r={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",r["bad-app-name"]="Illegal App name: '{$appName}",r["duplicate-app"]="Firebase App named '{$appName}' already exists",r["app-deleted"]="Firebase App named '{$appName}' already deleted",r["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",r["invalid-log-argument"]="First argument to `onLog` must be null or a function.",r),u=new o.ErrorFactory("app","Firebase",l),h=((i={})["@firebase/app"]="fire-core",i["@firebase/analytics"]="fire-analytics",i["@firebase/auth"]="fire-auth",i["@firebase/database"]="fire-rtdb",i["@firebase/functions"]="fire-fn",i["@firebase/installations"]="fire-iid",i["@firebase/messaging"]="fire-fcm",i["@firebase/performance"]="fire-perf",i["@firebase/remote-config"]="fire-rc",i["@firebase/storage"]="fire-gcs",i["@firebase/firestore"]="fire-fst",i["fire-js"]="fire-js",i["firebase-wrapper"]="fire-js-all",i),d=new c.Logger("@firebase/app"),p=function(){function e(e,t,n){var r,i,c=this;this.firebase_=n,this.isDeleted_=!1,this.name_=t.name,this.automaticDataCollectionEnabled_=t.automaticDataCollectionEnabled||!1,this.options_=o.deepCopy(e),this.container=new s.ComponentContainer(t.name),this._addComponent(new s.Component("app",(function(){return c}),"PUBLIC"));try{for(var l=a.__values(this.firebase_.INTERNAL.components.values()),u=l.next();!u.done;u=l.next()){var h=u.value;this._addComponent(h)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}return Object.defineProperty(e.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(e){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),e.prototype.delete=function(){var e=this;return new Promise((function(t){e.checkDestroyed_(),t()})).then((function(){return e.firebase_.INTERNAL.removeApp(e.name_),Promise.all(e.container.getProviders().map((function(e){return e.delete()})))})).then((function(){e.isDeleted_=!0}))},e.prototype._getService=function(e,t){return void 0===t&&(t="[DEFAULT]"),this.checkDestroyed_(),this.container.getProvider(e).getImmediate({identifier:t})},e.prototype._removeServiceInstance=function(e,t){void 0===t&&(t="[DEFAULT]"),this.container.getProvider(e).clearInstance(t)},e.prototype._addComponent=function(e){try{this.container.addComponent(e)}catch(t){d.debug("Component "+e.name+" failed to register with FirebaseApp "+this.name,t)}},e.prototype._addOrOverwriteComponent=function(e){this.container.addOrOverwriteComponent(e)},e.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw u.create("app-deleted",{appName:this.name_})},e}();p.prototype.name&&p.prototype.options||p.prototype.delete||console.log("dc");var f=
+/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+function e(){var t=
+/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+function(e){var t={},n=new Map,r={__esModule:!0,initializeApp:function(n,i){void 0===i&&(i={});if("object"!=typeof i||null===i){i={name:i}}var a=i;void 0===a.name&&(a.name="[DEFAULT]");var s=a.name;if("string"!=typeof s||!s)throw u.create("bad-app-name",{appName:String(s)});if(o.contains(t,s))throw u.create("duplicate-app",{appName:s});var c=new e(n,a,r);return t[s]=c,c},app:i,registerVersion:function(e,t,n){var r,i=null!==(r=h[e])&&void 0!==r?r:e;n&&(i+="-"+n);var a=i.match(/\s|\//),o=t.match(/\s|\//);if(a||o){var c=['Unable to register library "'+i+'" with version "'+t+'":'];return a&&c.push('library name "'+i+'" contains illegal characters (whitespace or "/")'),a&&o&&c.push("and"),o&&c.push('version name "'+t+'" contains illegal characters (whitespace or "/")'),void d.warn(c.join(" "))}l(new s.Component(i+"-version",(function(){return{library:i,version:t}}),"VERSION"))},setLogLevel:c.setLogLevel,onLog:function(e,t){if(null!==e&&"function"!=typeof e)throw u.create("invalid-log-argument",{appName:name});c.setUserLogHandler(e,t)},apps:null,SDK_VERSION:"7.18.0",INTERNAL:{registerComponent:l,removeApp:function(e){delete t[e]},components:n,useAsService:function(e,t){if("serverAuth"===t)return null;return t}}};function i(e){if(e=e||"[DEFAULT]",!o.contains(t,e))throw u.create("no-app",{appName:e});return t[e]}function l(s){var c,l,h=s.name;if(n.has(h))return d.debug("There were multiple attempts to register component "+h+"."),"PUBLIC"===s.type?r[h]:null;if(n.set(h,s),"PUBLIC"===s.type){var p=function(e){if(void 0===e&&(e=i()),"function"!=typeof e[h])throw u.create("invalid-app-argument",{appName:h});return e[h]()};void 0!==s.serviceProps&&o.deepExtend(p,s.serviceProps),r[h]=p,e.prototype[h]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this._getService.bind(this,h);return n.apply(this,s.multipleInstances?e:[])}}try{for(var f=a.__values(Object.keys(t)),m=f.next();!m.done;m=f.next()){var g=m.value;t[g]._addComponent(s)}}catch(e){c={error:e}}finally{try{m&&!m.done&&(l=f.return)&&l.call(f)}finally{if(c)throw c.error}}return"PUBLIC"===s.type?r[h]:null}return r.default=r,Object.defineProperty(r,"apps",{get:function(){return Object.keys(t).map((function(e){return t[e]}))}}),i.App=e,r}(p);return t.INTERNAL=a.__assign(a.__assign({},t.INTERNAL),{createFirebaseNamespace:e,extendNamespace:function(e){o.deepExtend(t,e)},createSubscribe:o.createSubscribe,ErrorFactory:o.ErrorFactory,deepExtend:o.deepExtend}),t}(),m=function(){function e(e){this.container=e}return e.prototype.getPlatformInfoString=function(){return this.container.getProviders().map((function(e){if(function(e){var t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}
+/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */(e)){var t=e.getImmediate();return t.library+"/"+t.version}return null})).filter((function(e){return e})).join(" ")},e}();
+/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+if(o.isBrowser()&&void 0!==self.firebase){d.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n ");var g=self.firebase.SDK_VERSION;g&&g.indexOf("LITE")>=0&&d.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n ")}var y=f.initializeApp;f.initializeApp=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.isNode()&&d.warn('\n Warning: This is a browser-targeted Firebase bundle but it appears it is being\n run in a Node environment. If running in a Node environment, make sure you\n are using the bundle specified by the "main" field in package.json.\n \n If you are using Webpack, you can specify "main" as the first item in\n "resolve.mainFields":\n https://webpack.js.org/configuration/resolve/#resolvemainfields\n \n If using Rollup, use the rollup-plugin-node-resolve plugin and specify "main"\n as the first item in "mainFields", e.g. [\'main\', \'module\'].\n https://github.com/rollup/rollup-plugin-node-resolve\n '),y.apply(void 0,e)};var v=f;!function(e,t){e.INTERNAL.registerComponent(new s.Component("platform-logger",(function(e){return new m(e)}),"PRIVATE")),e.registerVersion("@firebase/app","0.6.10",t),e.registerVersion("fire-js","")}(v),t.default=v,t.firebase=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(11),i=n(17),a=function(){function e(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY"}return e.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},e.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},e.prototype.setServiceProps=function(e){return this.serviceProps=e,this},e}(),o=function(){function e(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map}return e.prototype.get=function(e){void 0===e&&(e="[DEFAULT]");var t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){var n=new i.Deferred;this.instancesDeferred.set(t,n);try{var r=this.getOrInitializeService(t);r&&n.resolve(r)}catch(e){}}return this.instancesDeferred.get(t).promise},e.prototype.getImmediate=function(e){var t=r.__assign({identifier:"[DEFAULT]",optional:!1},e),n=t.identifier,i=t.optional,a=this.normalizeInstanceIdentifier(n);try{var o=this.getOrInitializeService(a);if(!o){if(i)return null;throw Error("Service "+this.name+" is not available")}return o}catch(e){if(i)return null;throw e}},e.prototype.getComponent=function(){return this.component},e.prototype.setComponent=function(e){var t,n;if(e.name!==this.name)throw Error("Mismatching Component "+e.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=e,function(e){return"EAGER"===e.instantiationMode}
+/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */(e))try{this.getOrInitializeService("[DEFAULT]")}catch(e){}try{for(var i=r.__values(this.instancesDeferred.entries()),a=i.next();!a.done;a=i.next()){var o=r.__read(a.value,2),s=o[0],c=o[1],l=this.normalizeInstanceIdentifier(s);try{var u=this.getOrInitializeService(l);c.resolve(u)}catch(e){}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.clearInstance=function(e){void 0===e&&(e="[DEFAULT]"),this.instancesDeferred.delete(e),this.instances.delete(e)},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){var e;return r.__generator(this,(function(t){switch(t.label){case 0:return e=Array.from(this.instances.values()),[4,Promise.all(e.filter((function(e){return"INTERNAL"in e})).map((function(e){return e.INTERNAL.delete()})))];case 1:return t.sent(),[2]}}))}))},e.prototype.isComponentSet=function(){return null!=this.component},e.prototype.getOrInitializeService=function(e){var t=this.instances.get(e);return!t&&this.component&&(t=this.component.instanceFactory(this.container,function(e){return"[DEFAULT]"===e?void 0:e}(e)),this.instances.set(e,t)),t||null},e.prototype.normalizeInstanceIdentifier=function(e){return this.component?this.component.multipleInstances?e:"[DEFAULT]":e},e}();var s=function(){function e(e){this.name=e,this.providers=new Map}return e.prototype.addComponent=function(e){var t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component "+e.name+" has already been registered with "+this.name);t.setComponent(e)},e.prototype.addOrOverwriteComponent=function(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)},e.prototype.getProvider=function(e){if(this.providers.has(e))return this.providers.get(e);var t=new o(e,this);return this.providers.set(e,t),t},e.prototype.getProviders=function(){return Array.from(this.providers.values())},e}();t.Component=a,t.ComponentContainer=s,t.Provider=o},function(e,t,n){"use strict";
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var i;n.r(t),n.d(t,"LogLevel",(function(){return a})),n.d(t,"Logger",(function(){return h})),n.d(t,"setLogLevel",(function(){return d})),n.d(t,"setUserLogHandler",(function(){return p}));var a,o=[];!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(a||(a={}));var s={debug:a.DEBUG,verbose:a.VERBOSE,info:a.INFO,warn:a.WARN,error:a.ERROR,silent:a.SILENT},c=a.INFO,l=((i={})[a.DEBUG]="log",i[a.VERBOSE]="log",i[a.INFO]="info",i[a.WARN]="warn",i[a.ERROR]="error",i),u=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!(t<e.logLevel)){var a=(new Date).toISOString(),o=l[t];if(!o)throw new Error("Attempted to log a message with an invalid logType (value: "+t+")");console[o].apply(console,r(["["+a+"] "+e.name+":"],n))}},h=function(){function e(e){this.name=e,this._logLevel=c,this._logHandler=u,this._userLogHandler=null,o.push(this)}return Object.defineProperty(e.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){if(!(e in a))throw new TypeError('Invalid value "'+e+'" assigned to `logLevel`');this._logLevel=e},enumerable:!1,configurable:!0}),e.prototype.setLogLevel=function(e){this._logLevel="string"==typeof e?s[e]:e},Object.defineProperty(e.prototype,"logHandler",{get:function(){return this._logHandler},set:function(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(e){this._userLogHandler=e},enumerable:!1,configurable:!0}),e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.DEBUG],e)),this._logHandler.apply(this,r([this,a.DEBUG],e))},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.VERBOSE],e)),this._logHandler.apply(this,r([this,a.VERBOSE],e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.INFO],e)),this._logHandler.apply(this,r([this,a.INFO],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.WARN],e)),this._logHandler.apply(this,r([this,a.WARN],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.ERROR],e)),this._logHandler.apply(this,r([this,a.ERROR],e))},e}();function d(e){o.forEach((function(t){t.setLogLevel(e)}))}function p(e,t){for(var n=function(n){var r=null;t&&t.level&&(r=s[t.level]),n.userLogHandler=null===e?null:function(t,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];var s=i.map((function(e){if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}})).filter((function(e){return e})).join(" ");n>=(null!=r?r:t.logLevel)&&e({level:a[n].toLowerCase(),message:s,args:i,type:t.name})}},r=0,i=o;r<i.length;r++){n(i[r])}}},function(e,t){e.exports="#define T time * 0.06\nvarying vec2 uvs;\nuniform float time;\nuniform float thickness;\nvoid main() {\n uvs.xy = uv.xy;\n vec3 pos = position;\n\n pos.x *= thickness + sin(T) * ((0.1 + uv.x) * 16.0 + uv.y * 4.9) * thickness * 0.005;\n pos.z *= thickness + cos(T) * ((0.1 + uv.x) * 13.0 + uv.y * 14.9) * thickness * 0.005;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float time;\n\n#define T time * 0.04\n\nvoid main() {\n vec2 uv = uvs;\n uv += T * 0.05;\n vec3 col = texture2D(src, uv).xyz;\n float core = step(0.125, uvs.x);\n gl_FragColor = vec4(col * color, mix(1.0, 0.07, core));\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float time;\n\n#define T time * 0.03\n\nvoid main() {\n vec3 col = texture2D(src, uvs * vec2(1.0, 0.7) + vec2(T * 0.01, T * 0.05)).xyz;\n gl_FragColor = vec4(col * color, 0.4 * uvs.y);\n}\n"},function(e,t){e.exports=function(e){if(e.converted)return e;e.map&&(e=e.map),e.version=e.versions[0].hash,e.directDownload=e.versions[0].downloadURL,e.coverURL=e.versions[0].coverURL.replace(/^https?:\/\/[^/]+\//,"https://eu.cdn.beatsaver.com/");let t=e.versions[0].diffs;e.metadata.characteristics={};for(const n of t)void 0===e.metadata.characteristics[n.characteristic]&&(e.metadata.characteristics[n.characteristic]={}),e.metadata.characteristics[n.characteristic][n.difficulty]=n;return e.metadata.characteristics=JSON.stringify(e.metadata.characteristics),e.converted=!0,e}},,,,,,,,,,,,function(e,t,n){function r(e){e.keys().forEach(e)}console.time=()=>{},console.timeEnd=()=>{},n(41),n(42),n(43),n(44),n(45),n(46),n(48),n(49),AFRAME.log=()=>{},n(51),n(53),n(54),n(55),n(56),n(57),r(n(58)),r(n(192)),n(196),n(203),e.hot.accept(),"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,n=e.attributes;if(null!==t&&void 0!==n.position&&void 0!==n.normal&&void 0!==n.uv){var r=t.array,i=n.position.array,a=n.normal.array,o=n.uv.array,s=i.length/3;void 0===n.tangent&&e.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*s),4));for(var c=n.tangent.array,l=[],u=[],h=0;h<s;h++)l[h]=new THREE.Vector3,u[h]=new THREE.Vector3;var d=new THREE.Vector3,p=new THREE.Vector3,f=new THREE.Vector3,m=new THREE.Vector2,g=new THREE.Vector2,y=new THREE.Vector2,v=new THREE.Vector3,b=new THREE.Vector3,w=e.groups;0===w.length&&(w=[{start:0,count:r.length}]);for(var A=0,E=w.length;A<E;++A)for(var x=I=(P=w[A]).start,_=I+P.count;x<_;x+=3)N(r[x+0],r[x+1],r[x+2]);var S,M,T,R=new THREE.Vector3,k=new THREE.Vector3,C=new THREE.Vector3,O=new THREE.Vector3;for(A=0,E=w.length;A<E;++A){var P,I;for(x=I=(P=w[A]).start,_=I+P.count;x<_;x+=3)L(r[x+0]),L(r[x+1]),L(r[x+2])}}else console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function N(e,t,n){d.fromArray(i,3*e),p.fromArray(i,3*t),f.fromArray(i,3*n),m.fromArray(o,2*e),g.fromArray(o,2*t),y.fromArray(o,2*n);var r=p.x-d.x,a=f.x-d.x,s=p.y-d.y,c=f.y-d.y,h=p.z-d.z,w=f.z-d.z,A=g.x-m.x,E=y.x-m.x,x=g.y-m.y,_=y.y-m.y,S=1/(A*_-E*x);v.set((_*r-x*a)*S,(_*s-x*c)*S,(_*h-x*w)*S),b.set((A*a-E*r)*S,(A*c-E*s)*S,(A*w-E*h)*S),l[e].add(v),l[t].add(v),l[n].add(v),u[e].add(b),u[t].add(b),u[n].add(b)}function L(e){C.fromArray(a,3*e),O.copy(C),M=l[e],R.copy(M),R.sub(C.multiplyScalar(C.dot(M))).normalize(),k.crossVectors(O,M),T=k.dot(u[e]),S=T<0?-1:1,c[4*e]=R.x,c[4*e+1]=R.y,c[4*e+2]=R.z,c[4*e+3]=S}},mergeBufferGeometries:function(e,t){for(var n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),a={},o={},s=new THREE.BufferGeometry,c=0,l=0;l<e.length;++l){var u=e[l];if(n!==(null!==u.index))return null;for(var h in u.attributes){if(!r.has(h))return null;void 0===a[h]&&(a[h]=[]),a[h].push(u.attributes[h])}for(var h in u.morphAttributes){if(!i.has(h))return null;void 0===o[h]&&(o[h]=[]),o[h].push(u.morphAttributes[h])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(u.userData),t){var d;if(n)d=u.index.count;else{if(void 0===u.attributes.position)return null;d=u.attributes.position.count}s.addGroup(c,d,l),c+=d}}if(n){var p=0,f=[];for(l=0;l<e.length;++l){var m=e[l].index;if(p>0){m=m.clone();for(var g=0;g<m.count;++g)m.setX(g,m.getX(g)+p)}f.push(m),p+=e[l].attributes.position.count}var y=this.mergeBufferAttributes(f);if(!y)return null;s.index=y}for(var h in a){var v=this.mergeBufferAttributes(a[h]);if(!v)return null;s.addAttribute(h,v)}for(var h in o){var b=o[h][0].length;if(0===b)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[h]=[];for(l=0;l<b;++l){var w=[];for(g=0;g<o[h].length;++g)w.push(o[h][g][l]);var A=this.mergeBufferAttributes(w);if(!A)return null;s.morphAttributes[h].push(A)}}return s},mergeBufferAttributes:function(e){for(var t,n,r,i=0,a=0;a<e.length;++a){var o=e[a];if(o.isInterleavedBufferAttribute)return null;if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return null;if(void 0===n&&(n=o.itemSize),n!==o.itemSize)return null;if(void 0===r&&(r=o.normalized),r!==o.normalized)return null;i+=o.array.length}for(var s=new t(i),c=0,l=0;l<e.length;++l)s.set(e[l].array,c),c+=e[l].array.length;return new THREE.BufferAttribute(s,n,r)},toTrianglesDrawMode:function(e,t){if(t===THREE.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===THREE.TriangleFanDrawMode||t===THREE.TriangleStripDrawMode){var n=e.getIndex();if(null===n){var r=[],i=e.getAttribute("position");if(void 0===i)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(var a=0;a<i.count;a++)r.push(a);e.setIndex(r),n=e.getIndex()}var o=n.count-2,s=[];if(t===THREE.TriangleFanDrawMode)for(a=1;a<=o;a++)s.push(n.getX(0)),s.push(n.getX(a)),s.push(n.getX(a+1));else for(a=0;a<o;a++)a%2==0?(s.push(n.getX(a)),s.push(n.getX(a+1)),s.push(n.getX(a+2))):(s.push(n.getX(a+2)),s.push(n.getX(a+1)),s.push(n.getX(a)));s.length/3!==o&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var c=e.clone();return c.setIndex(s),c.clearGroups(),c}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}}},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");const n={childList:!0,attributes:!0,subtree:!0};AFRAME.registerComponent("aabb-collider",{schema:{collideNonVisible:{default:!1},debug:{default:!1},enabled:{default:!0},interval:{default:80},objects:{default:""}},init:function(){this.centerDifferenceVec3=new THREE.Vector3,this.clearedIntersectedEls=[],this.closestIntersectedEl=null,this.boundingBox=new THREE.Box3,this.boxCenter=new THREE.Vector3,this.boxHelper=new THREE.BoxHelper,this.boxMax=new THREE.Vector3,this.boxMin=new THREE.Vector3,this.hitClosestClearEventDetail={},this.hitClosestEventDetail={},this.intersectedEls=[],this.objectEls=[],this.newIntersectedEls=[],this.prevCheckTime=void 0,this.previousIntersectedEls=[],this.setDirty=this.setDirty.bind(this),this.observer=new MutationObserver(this.setDirty),this.dirty=!0,this.hitStartEventDetail={intersectedEls:this.newIntersectedEls}},play:function(){this.observer.observe(this.el.sceneEl,n),this.el.sceneEl.addEventListener("object3dset",this.setDirty),this.el.sceneEl.addEventListener("object3dremove",this.setDirty)},remove:function(){this.observer.disconnect(),this.el.sceneEl.removeEventListener("object3dset",this.setDirty),this.el.sceneEl.removeEventListener("object3dremove",this.setDirty)},tick:function(e){const t=this.boundingBox,n=this.centerDifferenceVec3,r=this.clearedIntersectedEls,i=this.el,a=this.intersectedEls,o=this.newIntersectedEls,s=this.objectEls,c=this.prevCheckTime,l=this.previousIntersectedEls;let u,h,d;if(this.data.enabled&&!(c&&e-c<this.data.interval)){for(this.prevCheckTime=e,this.dirty&&this.refreshObjects(),t.setFromObject(i.object3D),this.boxMin.copy(t.min),this.boxMax.copy(t.max),t.getCenter(this.boxCenter),this.data.debug&&(this.boxHelper.setFromObject(i.object3D),this.boxHelper.parent||i.sceneEl.object3D.add(this.boxHelper)),function(e,t){e.length=0;for(let n=0;n<t.length;n++)e[n]=t[n]}(l,a),a.length=0,d=0;d<s.length;d++)if(s[d]!==this.el)if(this.data.collideNonVisible||s[d].getAttribute("visible"))this.isIntersecting(s[d])&&a.push(s[d]);else if(this.data.debug){const e=s[d].object3D.boxHelper;e&&(i.sceneEl.object3D.remove(e),s[d].object3D.boxHelper=null)}for(o.length=0,d=0;d<a.length;d++)-1===l.indexOf(a[d])&&o.push(a[d]);for(r.length=0,d=0;d<l.length;d++)-1===a.indexOf(l[d])&&(l[d].hasAttribute("aabb-collider")||l[d].emit("hitend"),r.push(l[d]));for(d=0;d<o.length;d++)o[d]!==this.el&&(o[d].hasAttribute("aabb-collider")||o[d].emit("hitstart"));for(d=0;d<a.length;d++)a[d]!==this.el&&(n.copy(a[d].object3D.boundingBoxCenter).sub(this.boxCenter),(void 0===u||n.length()<u)&&(u=n.length(),h=a[d]));!a.length&&this.closestIntersectedEl?(this.hitClosestClearEventDetail.el=this.closestIntersectedEl,this.closestIntersectedEl.emit("hitclosestclear"),this.closestIntersectedEl=null,i.emit("hitclosestclear",this.hitClosestClearEventDetail)):h!==this.closestIntersectedEl&&(this.closestIntersectedEl&&(this.hitClosestClearEventDetail.el=this.closestIntersectedEl,this.closestIntersectedEl.emit("hitclosestclear",this.hitClosestClearEventDetail)),h&&(h.emit("hitclosest"),this.closestIntersectedEl=h,this.hitClosestEventDetail.el=h,i.emit("hitclosest",this.hitClosestEventDetail))),r.length&&i.emit("hitend"),o.length&&i.emit("hitstart",this.hitStartEventDetail)}},isIntersecting:function(){const e=new THREE.Box3;return function(t){let n;t.dataset.aabbColliderDynamic&&(e.setFromObject(t.object3D),n=e,t.object3D.boundingBoxCenter=t.object3D.boundingBoxCenter||new THREE.Vector3,n.getCenter(t.object3D.boundingBoxCenter)),t.dataset.aabbColliderDynamic||(t.object3D.aabbBox||(t.object3D.aabbBox=(new THREE.Box3).setFromObject(t.object3D),t.object3D.boundingBoxCenter=new THREE.Vector3,t.object3D.aabbBox.getCenter(t.object3D.boundingBoxCenter)),n=t.object3D.aabbBox),this.data.debug&&(t.object3D.boxHelper||(t.object3D.boxHelper=new THREE.BoxHelper(t.object3D,new THREE.Color(Math.random(),Math.random(),Math.random())),t.sceneEl.object3D.add(t.object3D.boxHelper)),t.object3D.boxHelper.setFromObject(t.object3D));const r=n.min,i=n.max;return this.boxMin.x<=i.x&&this.boxMax.x>=r.x&&this.boxMin.y<=i.y&&this.boxMax.y>=r.y&&this.boxMin.z<=i.z&&this.boxMax.z>=r.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 n=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function r(e,t,r,i){const a=1/i,o=1/r;return n[0].set(a*t,o*e+o),n[1].set(a*t,o*e),n[2].set(a*t+a,o*e),n[3].set(a*t+a,o*e+o),n}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=r(e.row-1,e.column-1,e.totalRows,e.totalColumns),n=this.el.getObject3D("mesh").geometry;var i=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]);n.setAttribute("uv",new THREE.BufferAttribute(i,2)),n.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,n,i,a){const o=this.canvas,s=this.data;e.complete||(e.onload=()=>{this.drawTexture(e,t,n)});const c=a||o.height/s.numRows,l=i||o.width/s.numColumns;return this.ctx.drawImage(e,l*t,l*n,l,c),r(t,n,s.numRows,s.numColumns)}}),e.exports.getGridUvs=r},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var n={};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,n=this.data;e.fftSize===n.fftSize&&e.smoothingTimeConstant===n.smoothingTimeConstant||(t.fftSize=n.fftSize,t.smoothingTimeConstant=n.smoothingTimeConstant,this.levels=new Uint8Array(t.frequencyBinCount),this.waveform=new Uint8Array(t.fftSize)),n.src&&this.refreshSource()},tick:function(e,t){var n,r=this.data;if(r.enabled){if((r.enableLevels||r.enableVolume)&&this.analyser.getByteFrequencyData(this.levels),r.enableWaveform&&this.analyser.getByteTimeDomainData(this.waveform),r.enableVolume||r.enableBeatDetection){for(var i=0,a=0;a<this.levels.length;a++)i+=this.levels[a];this.volume=i/this.levels.length}r.enableBeatDetection&&(n=this.volume,this.beatCutOff||(this.beatCutOff=n),n>this.beatCutOff&&n>this.data.beatDetectionMinVolume?(this.el.emit("audioanalyserbeat",null,!1),this.beatCutOff=1.5*n,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 n[e]?n[e].constructor===Promise?n[e]:Promise.resolve(n[e]):(this.data.cache||Object.keys(n).forEach((function(e){delete n[e]})),n[e]=new Promise(t=>{const r=this.xhr=new XMLHttpRequest;r.open("GET",e),r.responseType="arraybuffer",r.addEventListener("load",()=>{function i(r){n[e]=r,t(r)}const a=this.context.decodeAudioData(r.response,i);a&&a.constructor===Promise&&a.then(i).catch(console.error)}),r.send()}),n[e])},getBufferSource:function(){var e=this.data;return this.fetchAudioBuffer(e.src).then(()=>{var t;return(t=this.context.createBufferSource()).buffer=n[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 n=this.context.createMediaElementSource(this.audio);return e[t]=n,n}}()})},function(e,t){var n=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 n.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,n,r=this.data,i=this.el;e=r._event||this.id,t=r._target,n=t?i.sceneEl.querySelector(t):i,this.eventName=e;const a=()=>{var e;for(e in r)"_event"!==e&&"_target"!==e&&AFRAME.utils.entity.setComponentProperty.call(this,n,e,r[e])};isNaN(r._delay)?this.eventHandler=a:this.eventHandler=()=>{setTimeout(a,parseFloat(r._delay))}},addEventListener:function(){this.el.addEventListener(this.eventName,this.eventHandler)},removeEventListener:function(){this.el.removeEventListener(this.eventName,this.eventHandler)}})},function(e,t,n){THREE.BufferGeometryUtils||n(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,n=e.attributes;if(null!==t&&void 0!==n.position&&void 0!==n.normal&&void 0!==n.uv){var r=t.array,i=n.position.array,a=n.normal.array,o=n.uv.array,s=i.length/3;void 0===n.tangent&&e.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*s),4));for(var c=n.tangent.array,l=[],u=[],h=0;h<s;h++)l[h]=new THREE.Vector3,u[h]=new THREE.Vector3;var d=new THREE.Vector3,p=new THREE.Vector3,f=new THREE.Vector3,m=new THREE.Vector2,g=new THREE.Vector2,y=new THREE.Vector2,v=new THREE.Vector3,b=new THREE.Vector3,w=e.groups;0===w.length&&(w=[{start:0,count:r.length}]);h=0;for(var A=w.length;h<A;++h)for(var E=P=(O=w[h]).start,x=P+O.count;E<x;E+=3)I(r[E+0],r[E+1],r[E+2]);var _,S,M,T=new THREE.Vector3,R=new THREE.Vector3,k=new THREE.Vector3,C=new THREE.Vector3;for(h=0,A=w.length;h<A;++h){var O,P;for(E=P=(O=w[h]).start,x=P+O.count;E<x;E+=3)N(r[E+0]),N(r[E+1]),N(r[E+2])}}else console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function I(e,t,n){d.fromArray(i,3*e),p.fromArray(i,3*t),f.fromArray(i,3*n),m.fromArray(o,2*e),g.fromArray(o,2*t),y.fromArray(o,2*n);var r=p.x-d.x,a=f.x-d.x,s=p.y-d.y,c=f.y-d.y,h=p.z-d.z,w=f.z-d.z,A=g.x-m.x,E=y.x-m.x,x=g.y-m.y,_=y.y-m.y,S=1/(A*_-E*x);v.set((_*r-x*a)*S,(_*s-x*c)*S,(_*h-x*w)*S),b.set((A*a-E*r)*S,(A*c-E*s)*S,(A*w-E*h)*S),l[e].add(v),l[t].add(v),l[n].add(v),u[e].add(b),u[t].add(b),u[n].add(b)}function N(e){k.fromArray(a,3*e),C.copy(k),S=l[e],T.copy(S),T.sub(k.multiplyScalar(k.dot(S))).normalize(),R.crossVectors(C,S),M=R.dot(u[e]),_=M<0?-1:1,c[4*e]=T.x,c[4*e+1]=T.y,c[4*e+2]=T.z,c[4*e+3]=_}},mergeBufferGeometries:function(e,t){for(var n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),a={},o={},s=new THREE.BufferGeometry,c=0,l=0;l<e.length;++l){var u=e[l];if(n!==(null!==u.index))return null;for(var h in u.attributes){if(!r.has(h))return null;void 0===a[h]&&(a[h]=[]),a[h].push(u.attributes[h])}for(var h in u.morphAttributes){if(!i.has(h))return null;void 0===o[h]&&(o[h]=[]),o[h].push(u.morphAttributes[h])}if(s.userData&&(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(u.userData)),t){var d;if(n)d=u.index.count;else{if(void 0===u.attributes.position)return null;d=u.attributes.position.count}s.addGroup(c,d,l),c+=d}}if(n){var p=0,f=[];for(l=0;l<e.length;++l){for(var m=e[l].index,g=0;g<m.count;++g)f.push(m.getX(g)+p);p+=e[l].attributes.position.count}s.setIndex(f)}for(var h in a){var y=this.mergeBufferAttributes(a[h]);if(!y)return null;s.addAttribute(h,y)}for(var h in o){var v=o[h][0].length;if(0===v)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[h]=[];for(l=0;l<v;++l){var b=[];for(g=0;g<o[h].length;++g)b.push(o[h][g][l]);var w=this.mergeBufferAttributes(b);if(!w)return null;s.morphAttributes[h].push(w)}}return s},mergeBufferAttributes:function(e){for(var t,n,r,i=0,a=0;a<e.length;++a){var o=e[a];if(o.isInterleavedBufferAttribute)return null;if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return null;if(void 0===n&&(n=o.itemSize),n!==o.itemSize)return null;if(void 0===r&&(r=o.normalized),r!==o.normalized)return null;i+=o.array.length}var s=new t(i),c=0;for(a=0;a<e.length;++a)s.set(e[a].array,c),c+=e[a].array.length;return new THREE.BufferAttribute(s,n,r)}}},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("haptics",{schema:{actuatorIndex:{default:0},dur:{default:100},enabled:{default:!0},events:{type:"array"},eventsFrom:{type:"string"},force:{default:1}},multiple:!0,init:function(){this.data;var e=this;this.callPulse=function(){e.pulse()};var t=function(){e.gamepad=e.el.components["tracked-controls"].controller,e.gamepad.gamepad&&(e.gamepad=e.gamepad.gamepad),e.gamepad&&e.gamepad.hapticActuators&&e.gamepad.hapticActuators.length&&e.addEventListeners()};this.el.components["tracked-controls"]&&this.el.components["tracked-controls"].controller?t():this.el.addEventListener("controllerconnected",(function(){t()}))},remove:function(){this.removeEventListeners()},pulse:function(e,t){var n=this.data;n.enabled&&this.gamepad&&this.gamepad.hapticActuators&&this.gamepad.hapticActuators[n.actuatorIndex].pulse(e||n.force,t||n.dur)},addEventListeners:function(){var e,t,n=this.data;for(t=n.eventsFrom?document.querySelector(n.eventsFrom):this.el,e=0;e<n.events.length;e++)t.addEventListener(n.events[e],this.callPulse)},removeEventListeners:function(){var e,t,n=this.data;for(t=n.eventsFrom?document.querySelector(n.eventsFrom):this.el,e=0;e<n.events.length;e++)t.removeEventListener(n.events[e],this.callPulse)}})},function(e,t){var n=[],r=new THREE.Vector3;function i(e,t,i){var a,o,s,c,l,h,d=Math.ceil(t/e.columns);for(o=e.marginColumn,s=e.marginRow,i&&(o=e.margin,s=e.margin),l=u(e.align,d),c=u(e.align,e.columns),h=0;h<d;h++)for(a=0;a<e.columns;a++)r.set(0,0,0),0===e.plane.indexOf("x")&&(r.x=(a-c)*o),0===e.plane.indexOf("y")&&(r.y=(a-c)*o),1===e.plane.indexOf("y")&&(r.y=(h-l)*s),1===e.plane.indexOf("z")&&(r.z=(h-l)*s),f(r);return n}function a(e,t){var i,a;for(i=0;i<t;i++)a=isNaN(e.angle)?i*(2*Math.PI)/t:i*e.angle*.01745329252,r.set(0,0,0),0===e.plane.indexOf("x")&&(r.x=e.radius*Math.cos(a)),0===e.plane.indexOf("y")&&(r.y=e.radius*Math.cos(a)),1===e.plane.indexOf("y")&&(r.y=e.radius*Math.sin(a)),1===e.plane.indexOf("z")&&(r.z=e.radius*Math.sin(a)),f(r);return n}function o(e,t){return e.columns=t,i(e,t,!0)}function s(e,t){return p(1,0,0,0,1,0,0,0,1,-1,0,0,0,-1,0,0,0,-1),h(e.radius/2),n}function c(e,t){var r=(1+Math.sqrt(5))/2,i=1/r,a=2-r,o=-1*i,s=-1*a;return p(-1,a,0,-1,s,0,0,-1,a,0,-1,s,0,1,a,0,1,s,1,a,0,1,s,0,i,i,i,i,i,o,i,o,i,i,o,o,a,0,1,a,0,-1,o,i,i,o,i,o,o,o,i,o,o,o,s,0,1,s,0,-1),h(e.radius/2),n}function l(e,t){var r=Math.sqrt(3),i=-1/Math.sqrt(3);return p(0,0,r+i,-1,0,i,1,0,i,0,2*Math.sqrt(2/3),0),h(e.radius/2),n}function u(e,t){switch(e){case"start":return t-1;case"center":return(t-1)/2;case"end":return 0}}function h(e){var t;for(t=0;t<n.length;t++)n[t]=n[t]*e}function d(e,t,n){var r,i,a;if(n)for(i=0;i<e.length;i++)null!=(r=e[i].getAttribute(n))&&(a=3*parseInt(r,10),e[i].object3D.position.set(t[a],t[a+1],t[a+2]));else for(i=0;i<t.length;i+=3){if(!e[i/3])return;e[i/3].object3D.position.set(t[i],t[i+1],t[i+2])}}function p(){var e;for(e=0;e<arguments.length;e++)n.push(e)}function f(e){n.push(e.x),n.push(e.y),n.push(e.z)}AFRAME.registerComponent("layout",{schema:{angle:{type:"number",default:!1,min:0,max:360,if:{type:["circle"]}},columns:{default:1,min:0,if:{type:["box"]}},margin:{default:1,min:0,if:{type:["box","line"]}},marginColumn:{default:1,min:0,if:{type:["box"]}},marginRow:{default:1,min:0,if:{type:["box"]}},orderAttribute:{default:""},plane:{default:"xy"},radius:{default:1,min:0,if:{type:["circle","cube","dodecahedron","pyramid"]}},reverse:{default:!1},type:{default:"line",oneOf:["box","circle","cube","dodecahedron","line","pyramid"]},fill:{default:!0,if:{type:["circle"]}},align:{default:"end",oneOf:["start","center","end"]}},init:function(){var e=this,t=this.el;this.children=t.getChildEntities(),this.initialPositions=[],this.children.forEach((function(t){if(t.hasLoaded)return n();function n(){e.initialPositions.push(t.object3D.position.x),e.initialPositions.push(t.object3D.position.y),e.initialPositions.push(t.object3D.position.z)}t.addEventListener("loaded",n)})),this.handleChildAttached=this.handleChildAttached.bind(this),this.handleChildDetached=this.handleChildDetached.bind(this),t.addEventListener("child-attached",this.handleChildAttached),t.addEventListener("child-detached",this.handleChildDetached),t.addEventListener("layoutrefresh",this.update.bind(this))},update:function(e){var t,r,u,h=this.children,p=this.data,f=this.el;switch(r=h.length,p.type){case"box":u=i;break;case"circle":u=a;break;case"cube":u=s;break;case"dodecahedron":u=c;break;case"pyramid":u=l;break;default:u=o}t=f.getDOMAttribute("layout"),n.length=0,n=u(p,r,"string"==typeof t?-1!==t.indexOf("margin"):"margin"in t),p.reverse&&n.reverse(),d(h,n,p.orderAttribute)},remove:function(){this.el.removeEventListener("child-attached",this.handleChildAttached),this.el.removeEventListener("child-detached",this.handleChildDetached),d(this.children,this.initialPositions)},handleChildAttached:function(e){var t=this.el;e.detail.el.parentNode===t&&(this.children.push(e.detail.el),this.update())},handleChildDetached:function(e){-1!==this.children.indexOf(e.detail.el)&&(this.children.splice(this.children.indexOf(e.detail.el),1),this.initialPositions.splice(this.children.indexOf(e.detail.el),1),this.update())}}),e.exports.getBoxPositions=i,e.exports.getCirclePositions=a,e.exports.getLinePositions=o,e.exports.getCubePositions=s,e.exports.getDodecahedronPositions=c,e.exports.getPyramidPositions=l},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerPrimitive("a-log",{defaultComponents:{geometry:{primitive:"plane",height:5},log:{},material:{color:"#111",shader:"flat",side:"double"},text:{color:"lightgreen",baseline:"top",align:"center",height:5}},mappings:{channel:"log.channel"}}),AFRAME.registerSystem("log",{schema:{console:{default:!0}},init:function(){var e=this.data,t=this.logs=[],n=this.loggers=[];AFRAME.log=function(r,i){t.push([r,i]),n.forEach((function(e){e.receiveLog(r,i)})),e.console&&console.log("[log:"+(i||"")+"] "+r)}},registerLogger:function(e){this.loggers.push(e),this.logs.forEach((function(t){e.receiveLog.apply(e,t)}))},unregisterLogger:function(e){this.loggers.splice(this.loggers.indexOf(e),1)}}),AFRAME.registerComponent("log",{schema:{channel:{type:"string"},filter:{type:"string"},max:{default:100},showErrors:{default:!0}},init:function(){this.logs=[],this.system.registerLogger(this)},play:function(){var e=this;this.el.sceneEl.addEventListener("log",(function(t){t.detail&&e.receiveLog(t.detail.message,t.detail.channel)})),window.onerror=function(t,n,r,i,a){e.receiveLog("Error: "+t)}},receiveLog:function(e,t){var n=this.data;"string"!=typeof e&&(e=JSON.stringify(e)),n.channel&&t&&n.channel!==t||n.filter&&-1===e.indexOf(n.filter)||(this.logs.push(e),n.max&&this.logs.length>n.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,n){n(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,n=this.data;t.target=this.target.copy(n.target),t.autoRotate=n.autoRotate,t.autoRotateSpeed=n.autoRotateSpeed,t.dampingFactor=n.dampingFactor,t.enabled=n.enabled,t.enableDamping=n.enableDamping,t.enableKeys=n.enableKeys,t.enablePan=n.enablePan,t.enableRotate=n.enableRotate,t.enableZoom=n.enableZoom,t.keyPanSpeed=n.keyPanSpeed,t.maxPolarAngle=THREE.Math.degToRad(n.maxPolarAngle),t.maxDistance=n.maxDistance,t.minDistance=n.minDistance,t.minPolarAngle=THREE.Math.degToRad(n.minPolarAngle),t.minZoom=n.minZoom,t.panSpeed=n.panSpeed,t.rotateSpeed=n.rotateSpeed,t.screenSpacePanning=n.screenSpacePanning,t.zoomSpeed=n.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 n,r,i,a,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(){s.target0.copy(s.target),s.position0.copy(s.object.position),s.zoom0=s.object.zoom},this.reset=function(){s.target.copy(s.target0),s.object.position.copy(s.position0),s.object.zoom=s.zoom0,s.object.updateProjectionMatrix(),s.dispatchEvent(c),s.update(),d=h.NONE},this.update=(n=new THREE.Vector3,r=(new THREE.Quaternion).setFromUnitVectors(e.up,new THREE.Vector3(0,1,0)),i=r.clone().inverse(),a=new THREE.Vector3,o=new THREE.Quaternion,function(){var e=s.object.position;return n.copy(e).sub(s.target),n.applyQuaternion(r),f.setFromVector3(n),s.autoRotate&&d===h.NONE&&k(2*Math.PI/60/60*s.autoRotateSpeed),f.theta+=m.theta,f.phi+=m.phi,f.theta=Math.max(s.minAzimuthAngle,Math.min(s.maxAzimuthAngle,f.theta)),f.phi=Math.max(s.minPolarAngle,Math.min(s.maxPolarAngle,f.phi)),f.makeSafe(),f.radius*=g,f.radius=Math.max(s.minDistance,Math.min(s.maxDistance,f.radius)),s.target.add(y),n.setFromSpherical(f),n.applyQuaternion(i),e.copy(s.target).add(n),s.object.lookAt(s.target),!0===s.enableDamping?(m.theta*=1-s.dampingFactor,m.phi*=1-s.dampingFactor):m.set(0,0,0),g=1,y.set(0,0,0),!!(v||a.distanceToSquared(s.object.position)>p||8*(1-o.dot(s.object.quaternion))>p)&&(s.dispatchEvent(c),a.copy(s.object.position),o.copy(s.object.quaternion),v=!1,!0)}),this.dispose=function(){s.domElement.removeEventListener("contextmenu",q,!1),s.domElement.removeEventListener("mousedown",F,!1),s.domElement.removeEventListener("wheel",B,!1),s.domElement.removeEventListener("touchstart",z,!1),s.domElement.removeEventListener("touchend",G,!1),s.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",U,!1),window.removeEventListener("keydown",V,!1)};var s=this,c={type:"change"},l={type:"start"},u={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},d=h.NONE,p=1e-6,f=new THREE.Spherical,m=new THREE.Spherical,g=1,y=new THREE.Vector3,v=!1,b=new THREE.Vector2,w=new THREE.Vector2,A=new THREE.Vector2,E=new THREE.Vector2,x=new THREE.Vector2,_=new THREE.Vector2,S=new THREE.Vector2,M=new THREE.Vector2,T=new THREE.Vector2;function R(){return Math.pow(.95,s.zoomSpeed)}function k(e){m.theta-=e}function C(e){m.phi-=e}var O,P=(O=new THREE.Vector3,function(e,t){O.setFromMatrixColumn(t,0),O.multiplyScalar(-e),y.add(O)}),I=function(){var e=new THREE.Vector3;return function(t,n){e.setFromMatrixColumn(n,1),e.multiplyScalar(t),y.add(e)}}(),N=function(){var e=new THREE.Vector3;return function(t,n){var r=s.domElement===document?s.domElement.body:s.domElement;if(s.object.isPerspectiveCamera){var i=s.object.position;e.copy(i).sub(s.target);var a=e.length();a*=Math.tan(s.object.fov/2*Math.PI/180),P(2*t*a/r.clientHeight,s.object.matrix),I(2*n*a/r.clientHeight,s.object.matrix)}else s.object.isOrthographicCamera?(P(t*(s.object.right-s.object.left)/s.object.zoom/r.clientWidth,s.object.matrix),I(n*(s.object.top-s.object.bottom)/s.object.zoom/r.clientHeight,s.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),s.enablePan=!1)}}();function L(e){s.object.isPerspectiveCamera?g/=e:s.object.isOrthographicCamera?(s.object.zoom=Math.max(s.minZoom,Math.min(s.maxZoom,s.object.zoom*e)),s.object.updateProjectionMatrix(),v=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),s.enableZoom=!1)}function D(e){s.object.isPerspectiveCamera?g*=e:s.object.isOrthographicCamera?(s.object.zoom=Math.max(s.minZoom,Math.min(s.maxZoom,s.object.zoom/e)),s.object.updateProjectionMatrix(),v=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),s.enableZoom=!1)}function F(e){if(!1!==s.enabled){switch(e.preventDefault(),e.button){case s.mouseButtons.ORBIT:if(!1===s.enableRotate)return;!function(e){b.set(e.clientX,e.clientY)}(e),d=h.ROTATE;break;case s.mouseButtons.ZOOM:if(!1===s.enableZoom)return;!function(e){S.set(e.clientX,e.clientY)}(e),d=h.DOLLY;break;case s.mouseButtons.PAN:if(!1===s.enablePan)return;!function(e){E.set(e.clientX,e.clientY)}(e),d=h.PAN}d!==h.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",U,!1),s.dispatchEvent(l))}}function j(e){if(!1!==s.enabled)switch(e.preventDefault(),d){case h.ROTATE:if(!1===s.enableRotate)return;!function(e){w.set(e.clientX,e.clientY),A.subVectors(w,b);var t=s.domElement===document?s.domElement.body:s.domElement;k(2*Math.PI*A.x/t.clientWidth*s.rotateSpeed),C(2*Math.PI*A.y/t.clientHeight*s.rotateSpeed),b.copy(w),s.update()}(e);break;case h.DOLLY:if(!1===s.enableZoom)return;!function(e){M.set(e.clientX,e.clientY),T.subVectors(M,S),T.y>0?L(R()):T.y<0&&D(R()),S.copy(M),s.update()}(e);break;case h.PAN:if(!1===s.enablePan)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,E),N(_.x,_.y),E.copy(x),s.update()}(e)}}function U(e){!1!==s.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",U,!1),s.dispatchEvent(u),d=h.NONE)}function B(e){!1===s.enabled||!1===s.enableZoom||d!==h.NONE&&d!==h.ROTATE||(e.preventDefault(),e.stopPropagation(),s.dispatchEvent(l),function(e){e.deltaY<0?D(R()):e.deltaY>0&&L(R()),s.update()}(e),s.dispatchEvent(u))}function V(e){!1!==s.enabled&&!1!==s.enableKeys&&!1!==s.enablePan&&function(e){switch(e.keyCode){case s.keys.UP:N(0,s.keyPanSpeed),s.update();break;case s.keys.BOTTOM:N(0,-s.keyPanSpeed),s.update();break;case s.keys.LEFT:N(s.keyPanSpeed,0),s.update();break;case s.keys.RIGHT:N(-s.keyPanSpeed,0),s.update()}}(e)}function z(e){if(!1!==s.enabled){switch(e.touches.length){case 1:if(!1===s.enableRotate)return;!function(e){b.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_ROTATE;break;case 2:if(!1===s.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);S.set(0,r)}(e),d=h.TOUCH_DOLLY;break;case 3:if(!1===s.enablePan)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_PAN;break;default:d=h.NONE}d!==h.NONE&&s.dispatchEvent(l)}}function H(e){if(!1!==s.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===s.enableRotate)return;if(d!==h.TOUCH_ROTATE)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY),A.subVectors(w,b);var t=s.domElement===document?s.domElement.body:s.domElement;k(2*Math.PI*A.x/t.clientWidth*s.rotateSpeed),C(2*Math.PI*A.y/t.clientHeight*s.rotateSpeed),b.copy(w),s.update()}(e);break;case 2:if(!1===s.enableZoom)return;if(d!==h.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);M.set(0,r),T.subVectors(M,S),T.y>0?D(R()):T.y<0&&L(R()),S.copy(M),s.update()}(e);break;case 3:if(!1===s.enablePan)return;if(d!==h.TOUCH_PAN)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,E),N(_.x,_.y),E.copy(x),s.update()}(e);break;default:d=h.NONE}}function G(e){!1!==s.enabled&&(s.dispatchEvent(u),d=h.NONE)}function q(e){!1!==s.enabled&&e.preventDefault()}s.domElement.addEventListener("contextmenu",q,!1),s.domElement.addEventListener("mousedown",F,!1),s.domElement.addEventListener("wheel",B,!1),s.domElement.addEventListener("touchstart",z,!1),s.domElement.addEventListener("touchend",G,!1),s.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",V,!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,n,r=this.data,i=this.el,a=this;if(r.from?e="PARENT"===r.from?[i.parentNode]:document.querySelectorAll(r.from):n="CHILDREN"===r.to?i.querySelectorAll("*"):"SELF"===r.to?[i]:document.querySelectorAll(r.to),r.from)for(t=0;t<e.length;t++)this.addEventListenerFrom(e[t]);else i.addEventListener(r.event,(function(e){var r=a.data;if(r.enabled&&(r.captureBubbles||e.target===i))for(t=0;t<n.length;t++)n[t].emit(r.as||r.event,e.detail?e.detail:null,r.bubbles)}))},addEventListenerFrom:function(e){var t=this.data,n=this;e.addEventListener(t.event,(function(t){var r=n.data;r.enabled&&(r.captureBubbles||t.target===e)&&n.el.emit(r.as||r.event,t.detail?t.detail:null,!1)}))}})},function(e,t){AFRAME.registerSystem("render-order",{schema:{type:"array"},init:function(){this.el.renderer.sortObjects=!0},update:function(){for(this.order={},i=0;i<this.data.length;i++)this.order[this.data[i]]=i}}),AFRAME.registerComponent("render-order",{schema:{type:"string"},multiple:!0,init:function(){this.set=this.set.bind(this),this.el.addEventListener("object3dset",e=>{"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,n){var r;"undefined"!=typeof self&&self,r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";var r={};e.exports.select=function(e,t,n){return r[t]||(r[t]=new Function("state","item","return "+c(t)+";")),r[t](e,n)};var i=/\.([A-Za-z][\w_-]*)/g,a=/([=&|!?:+-])(\s*)([\(]?)([A-Za-z][\w_-]*)/g,o=/^([\(]?)([A-Za-z][\w_-]*)/g,s=/state\["item"\]/g;function c(e){return e=(e=(e=(e=e.replace(i,'["$1"]')).replace(o,'$1state["$2"]')).replace(a,'$1$2$3state["$4"]')).replace(s,"item")}function l(){var e=arguments;return function(){var t;for(t=0;t<e.length;t++)e[t].apply(this,arguments)}}e.exports.generateExpression=c,e.exports.clearObject=function(e){for(var t in e)delete e[t]},e.exports.composeHandlers=function(){var e,t,n,r=arguments;for(n={},t=0;t<r.length;t++)for(e in r[t])e in n?n[e].constructor===Array?n[e].push(r[t][e]):n[e]=[n[e],r[t][e]]:n[e]=r[t][e];for(e in n)n[e].constructor===Array&&(n[e]=l.apply(this,n[e]));return n},e.exports.composeFunctions=l;var u=["||","&&","!=","!==","==","===",">","<","<=",">="],h=/\s+/,d=/\(|\)|\!/g;function p(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,n){var r,i;for(i=m(t,h),r=0;r<i.length;r++)if(-1===u.indexOf(i[r])&&!i[r].startsWith("'")&&-1===e.indexOf(i[r])){if(n&&"item"===i[r])continue;e.push(p(i[r]).replace(d,""))}return e};var f={};function m(e,t){return f[t]||(f[t]={}),f[t][e]||(f[t][e]=e.split(t)),f[t][e]}e.exports.split=m,e.exports.copyArray=function(e,t){var n;for(e.length=0,n=0;n<t.length;n++)e[n]=t[n]}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n(2);var i,a,o=n(3),s=n(0),c=n(4).wrapArray,l={initialState:{},nonBindedStateKeys:[],handlers:{},computeState:function(){}};AFRAME.registerState=function(e){AFRAME.utils.extend(l,e)},AFRAME.registerSystem("state",{init:function(){var e,t=this;for(e in this.arrays=[],this.dirtyArrays=[],this.diff={},this.state=AFRAME.utils.clone(l.initialState),this.subscriptions=[],this.initEventHandlers(),this.state)this.state[e]&&this.state[e].constructor===Array&&(this.arrays.push(e),this.state[e].__dirty=!0,c(this.state[e]));this.lastState=AFRAME.utils.clone(this.state),this.eventDetail={lastState:this.lastState,state:this.state},this.el.addEventListener("loaded",(function(){var e;for(l.computeState(t.state,"@@INIT"),e=0;e<t.subscriptions.length;e++)t.subscriptions[e].onStateUpdate(t.state)}))},dispatch:(a=[],function(e,t){var n,r;for(r in l.handlers[e](this.state,t),l.computeState(this.state,e,t),this.diff)delete this.diff[r];for(o(this.lastState,this.state,this.diff,l.nonBindedStateKeys),this.dirtyArrays.length=0,n=0;n<this.arrays.length;n++)this.state[this.arrays[n]].__dirty&&this.dirtyArrays.push(this.arrays[n]);for(a.length=0,n=0;n<this.subscriptions.length;n++){if("bind-for"===this.subscriptions[n].name){if(!this.state[this.subscriptions[n].keysToWatch[0]].__dirty)continue}else if(!this.shouldUpdate(this.subscriptions[n].keysToWatch,this.diff,this.dirtyArrays))continue;-1===a.indexOf(this.subscriptions[n])&&a.push(this.subscriptions[n])}for(n=0;n<a.length;n++)a[n].onStateUpdate();for(r in this.state)this.state[r]&&this.state[r].constructor===Array&&(this.state[r].__dirty=!1);this.copyState(this.lastState,this.state),this.eventDetail.action=e,this.eventDetail.payload=t,this.el.emit("stateupdate",this.eventDetail)}),copyState:function(e,t,n){var r;for(r in t)if(n||-1===l.nonBindedStateKeys.indexOf(r))if(t[r]&&t[r].constructor===Object){if(!(r in e)){e[r]=AFRAME.utils.clone(t[r]);continue}this.copyState(e[r],t[r],!0)}else e[r]=t[r]},subscribe:function(e){this.subscriptions.push(e)},unsubscribe:function(e){this.subscriptions.splice(this.subscriptions.indexOf(e),1)},shouldUpdate:function(e,t,n){for(var r=0;r<e.length;r++)if(e[r]in t||-1!==n.indexOf(e[r]))return!0;return!1},initEventHandlers:function(){var e,t=[];for(e in n=n.bind(this),l.handlers)-1===t.indexOf(e)&&(t.push(e),n(e));function n(e){var t=this;this.el.addEventListener(e,(function(n){t.dispatch(e,n.detail)}))}},renderTemplate:(i=/{{\s*(\w*\.)?([\w.]+)\s*}}/g,function(e,t,n){var a,o;if(o=e,t)for(;a=i.exec(e);)o=o.replace(a[0],"object"===(void 0===t?"undefined":r(t))?s.select(t,a[2])||"":t);return n?o:document.createRange().createContextualFragment(o)}),select:s.select}),AFRAME.registerComponent("bind",{schema:{default:{},parse:function(e){var t,n,r,i;if(e.constructor===Object)return e;if(-1===e.indexOf(":"))return e;for(t={},r=s.split(e,";"),n=0;n<r.length;n++)t[(i=s.split(r[n].trim(),":"))[0]]=i[1].trim();return t}},multiple:!0,init:function(){var e;this.data,this.keysToWatch=[],this.onStateUpdate=this.onStateUpdate.bind(this),this.system=this.el.sceneEl.systems.state,this.id&&(e=s.split(this.id,"__")[0]),this.isNamespacedBind=this.id&&e in AFRAME.components&&!AFRAME.components[e].isSingleProp||e in AFRAME.systems,this.lastData={},this.updateObj={},this.system.subscribe(this),this.onStateUpdate=this.onStateUpdate.bind(this)},update:function(){var e,t=this.data;if(this.keysToWatch.length=0,"string"==typeof t)s.parseKeysToWatch(this.keysToWatch,t);else for(e in t)s.parseKeysToWatch(this.keysToWatch,t[e]);this.onStateUpdate()},onStateUpdate:function(){var e,t,n,i,a=!1,o=this.el;if(o.parentNode){if(this.isNamespacedBind&&s.clearObject(this.updateObj),n=this.system.state,"object"!==r(this.data)){try{i=s.select(n,this.data)}catch(e){throw new Error("[aframe-state-component] Key '"+this.data+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}if("object"!==(void 0===i?"undefined":r(i))&&"object"!==r(this.lastData)&&this.lastData===i)return;return AFRAME.utils.entity.setComponentProperty(o,this.id,i),void(this.lastData=i)}for(e in this.data){t=this.data[e].trim();try{i=s.select(n,t)}catch(e){throw console.log(e),new Error("[aframe-state-component] Key '"+t+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}if("object"===(void 0===i?"undefined":r(i))||"object"===r(this.lastData[e])||this.lastData[e]!==i){if(e in AFRAME.components&&void 0===i)return void o.removeAttribute(e);this.isNamespacedBind?this.updateObj[e]=i:AFRAME.utils.entity.setComponentProperty(o,e,i),this.lastData[e]=i}}for(a in this.updateObj);this.isNamespacedBind&&a&&o.setAttribute(this.id,this.updateObj)}},remove:function(){this.system.unsubscribe(this)}}),AFRAME.registerComponent("bind-toggle",{schema:{type:"string"},multiple:!0,init:function(){this.system=this.el.sceneEl.systems.state,this.keysToWatch=[],this.onStateUpdate=this.onStateUpdate.bind(this),this.system.subscribe(this),this.onStateUpdate()},update:function(){this.keysToWatch.length=0,s.parseKeysToWatch(this.keysToWatch,this.data)},onStateUpdate:function(){var e,t,n=this.el;e=this.system.state;try{t=s.select(e,this.data)}catch(e){throw new Error("[aframe-state-component] Key '"+this.data+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}t?n.setAttribute(this.id,""):n.removeAttribute(this.id)},remove:function(){this.system.unsubscribe(this)}}),e.exports={composeFunctions:s.composeFunctions,composeHandlers:s.composeHandlers,select:s.select}},function(e,t,n){"use strict";var r,i,a=n(0);AFRAME.registerComponent("bind-for",{schema:{delay:{default:0},for:{type:"string",default:"item"},in:{type:"string"},key:{type:"string"},pool:{default:0},template:{type:"string"},updateInPlace:{default:!1}},init:function(){this.system=this.el.sceneEl.systems.state,this.onStateUpdate=this.onStateUpdate.bind(this),this.keysToWatch=[],this.renderedKeys=[],this.system.subscribe(this),this.el.children[0]&&"TEMPLATE"===this.el.children[0].tagName?this.template=this.el.children[0].innerHTML.trim():this.template=document.querySelector(this.data.template).innerHTML.trim();for(var e=0;e<this.data.pool;e++)this.el.appendChild(this.generateFromTemplate(null,e))},update:function(){this.keysToWatch[0]=a.split(this.data.in,".")[0],this.onStateUpdate()},onStateUpdateNaive:(i=[],function(){var e,t=this.data,n=this.el;try{e=a.select(this.system.state,t.in)}catch(e){throw new Error("[aframe-state-component] Key '"+t.in+"' not found in state. #"+n.getAttribute("id")+"["+this.attrName+"]")}i.length=0;for(var r=0;r<e.length;r++){var o=e[r];i.push(t.key?o[t.key].toString():o.toString())}for(var s=this.getElsToRemove(i,this.renderedKeys),c=0;c<s.length;c++)s[c].parentNode.removeChild(s[c]);e.length&&this.renderItems(e,i,0)}),renderItems:function(e,t,n){var r,i=this,a=this.data,o=this.el,s=e[n],c=a.key?s[a.key].toString():s.toString();if(-1===this.renderedKeys.indexOf(c))r=this.generateFromTemplate(s,n),o.appendChild(r),this.renderedKeys.push(c);else{if(e.length&&e[0].constructor===String){var l=a.key?s[a.key].toString():s.toString();(r=o.querySelector('[data-bind-for-value="'+l+'"]')).setAttribute("data-bind-for-key",n)}else{var u=this.getBindForKey(s,n);r=o.querySelector('[data-bind-for-key="'+u+'"]')}r.emit("bindforupdate",s,!1)}e[n+1]&&(this.data.delay?setTimeout((function(){i.renderItems(e,t,n+1)}),this.data.delay):this.renderItems(e,t,n+1))},onStateUpdateInPlace:function(){var e=[];return function(){var t,n,r=this.data,i=this.el;try{t=a.select(this.system.state,r.in)}catch(e){throw console.log(e),new Error("[aframe-state-component] Key '"+r.in+"' not found in state. #"+i.getAttribute("id")+"["+this.attrName+"]")}e.length=0;for(var o=0;o<t.length;o++){var s=t[o];n=r.key?s[r.key].toString():s.toString(),e.push(n)}for(var c=this.getElsToRemove(e,this.renderedKeys),l=0;l<c.length;l++)c[l].object3D.visible=!1,c[l].setAttribute("data-bind-for-active","false"),c[l].removeAttribute("data-bind-for-key"),c[l].removeAttribute("data-bind-for-value"),c[l].emit("bindfordeactivate",null,!1),c[l].pause();t.length&&this.renderItemsInPlace(t,e,0)}}(),renderItemsInPlace:function(e,t,n){var r,i=this,a=this.data,o=this.el,s=e[n],c=this.getBindForKey(s,n),l=a.key?s[a.key].toString():s.toString();if(-1===this.renderedKeys.indexOf(l)){if(o.querySelector(':scope > [data-bind-for-active="false"]'))(r=o.querySelector('[data-bind-for-active="false"]')).setAttribute("data-bind-for-key",c),r.setAttribute("data-bind-for-value",l),r.object3D.visible=!0,r.play(),r.setAttribute("data-bind-for-active","true"),r.emit("bindforupdateinplace",s,!1);else{var u=this.generateFromTemplate(s,n);u.addEventListener("loaded",(function(){u.emit("bindforupdateinplace",s,!1)})),o.appendChild(u)}this.renderedKeys.push(l)}else-1!==t.indexOf(l)&&(e.length&&e[0].constructor===String?(r=o.querySelector('[data-bind-for-value="'+l+'"]')).setAttribute("data-bind-for-key",n):r=o.querySelector('[data-bind-for-key="'+c+'"]'),r.emit("bindforupdateinplace",s,!1));e[n+1]&&(this.data.delay?setTimeout((function(){i.renderItemsInPlace(e,t,n+1)}),this.data.delay):this.renderItemsInPlace(e,t,n+1))},generateFromTemplate:function(e,t){var n=this.data;this.el.appendChild(this.system.renderTemplate(this.template,e));var r=this.el.children[this.el.children.length-1];if(!e)return r.setAttribute("data-bind-for-key",""),r.setAttribute("data-bind-for-active","false"),r;var i=this.getBindForKey(e,t);return r.setAttribute("data-bind-for-key",i),n.key||r.setAttribute("data-bind-for-value",e),r.setAttribute("data-bind-for-active","true"),r},getElsToRemove:(r=[],function(e,t){var n=this.data,i=this.el;r.length=0;for(var a=0;a<i.children.length;a++)if("TEMPLATE"!==i.children[a].tagName){var o=n.key?i.children[a].getAttribute("data-bind-for-key"):i.children[a].getAttribute("data-bind-for-value");-1===e.indexOf(o)&&-1!==t.indexOf(o)&&(r.push(i.children[a]),t.splice(t.indexOf(o),1))}return r}),getBindForKey:function(e,t){return this.data.key?e[this.data.key].toString():t.toString()},onStateUpdate:function(){this.data.updateInPlace?this.onStateUpdateInPlace():this.onStateUpdateNaive()}}),AFRAME.registerComponent("bind-item",{schema:{type:"string"},multiple:!0,init:function(){this.itemData=null,this.keysToWatch=[],this.prevValues={};var e=this.rootEl=this.el.closest("[data-bind-for-key]");if(!e)throw new Error("bind-item component must be attached to entity under a bind-for item.");e.addEventListener("bindforupdateinplace",this.updateInPlace.bind(this)),e.addEventListener("bindfordeactivate",this.deactivate.bind(this)),this.el.sceneEl.systems.state.subscribe(this)},update:function(){this.parseSelector()},updateInPlace:function(e){var t=this.propertyMap;if("false"!==this.rootEl.getAttribute("data-bind-for-active"))for(var n in e&&(this.itemData=e.detail),t){var r=this.select(this.itemData,t[n]);r!==this.prevValues[n]&&(AFRAME.utils.entity.setComponentProperty(this.el,n,r),this.prevValues[n]=r)}},onStateUpdate:function(){this.updateInPlace()},select:function(e,t){return a.select(this.el.sceneEl.systems.state.state,t,e)},deactivate:function(){this.prevValues={}},parseSelector:function(){var e=this.propertyMap={};this.keysToWatch.length=0;var t=a.split(this.id,"__")[0];if(!(t in AFRAME.components)||AFRAME.components[t].isSingleProp)e[this.id]=this.data,a.parseKeysToWatch(this.keysToWatch,this.data,!0);else for(var n=a.split(this.data,";"),r=0;r<n.length;r++){var i=a.split(n[r],":");e[this.id+"."+i[0].trim()]=i[1].trim(),a.parseKeysToWatch(this.keysToWatch,i[1].trim(),!0)}}})},function(e,t,n){"use strict";var r;e.exports=(r=[],function(e,t,n,i){var a,o,s,c,l,u,h;for(l in c=n||{},r.length=0,e)r.push(l);if(!t)return c;for(s in t)-1===r.indexOf(s)&&r.push(s);for(u=0;u<r.length;u++)l=r[u],i&&-1!==i.indexOf(l)||(a=e[l],o=t[l],((h=a&&o&&a.constructor===Object&&o.constructor===Object)&&!AFRAME.utils.deepEqual(a,o)||!h&&a!==o)&&(c[l]=o));return c})},function(e,t,n){"use strict";var r=["push","pop","shift","unshift","splice"];function i(e,t){var n=e[t];e[t]=function(){n.apply(e,arguments),e.__dirty=!0}}e.exports.wrapArray=function(e){var t;if(!e.__wrapped){for(t=0;t<r.length;t++)i(e,r[t]);e.__wrapped=!0}}}])},e.exports=r()},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("slice9",{schema:{width:{default:1,min:0},height:{default:1,min:0},left:{default:0,min:0},right:{default:0,min:0},bottom:{default:0,min:0},top:{default:0,min:0},side:{default:"front",oneOf:["front","back","double"]},padding:{default:.1,min:.01},color:{type:"color",default:"#fff"},opacity:{default:1,min:0,max:1},transparent:{default:!0},debug:{default:!1},src:{type:"map"}},multiple:!1,init:function(){var e=this.data,t=this.material=new THREE.MeshBasicMaterial({color:e.color,opacity:e.opacity,transparent:e.transparent,wireframe:e.debug}),n=this.geometry=new THREE.PlaneBufferGeometry(e.width,e.height,3,3);new THREE.TextureLoader;this.plane=new THREE.Mesh(n,t),this.el.setObject3D("mesh",this.plane),this.textureSrc=null},updateMap:function(){var e=this.data.src;if(e){if(e===this.textureSrc)return;return this.textureSrc=e,void this.el.sceneEl.systems.material.loadTexture(e,{src:e},t.bind(this))}function t(e){this.material.map=e,this.material.needsUpdate=!0,this.regenerateMesh()}this.material.map&&t(null)},regenerateMesh:function(){var e=this.data,t=this.geometry.attributes.position.array,n=this.geometry.attributes.uv.array,r=this.material.map.image;if(r){var i={left:e.left/r.width,right:e.right/r.width,top:e.top/r.height,bottom:e.bottom/r.height};d(1,i.left,1),d(2,i.right,1),d(4,0,i.bottom),d(5,i.left,i.bottom),d(6,i.right,i.bottom),d(7,1,i.bottom),d(8,0,i.top),d(9,i.left,i.top),d(10,i.right,i.top),d(11,1,i.top),d(13,i.left,0),d(14,i.right,0);var a=e.width/2,o=e.height/2,s=-a+e.padding,c=a-e.padding,l=o-e.padding,u=-o+e.padding;h(0,-a,o),h(1,s,o),h(2,c,o),h(3,a,o),h(4,-a,l),h(5,s,l),h(6,c,l),h(7,a,l),h(8,-a,u),h(9,s,u),h(10,c,u),h(11,a,u),h(13,s,-o),h(14,c,-o),h(12,-a,-o),h(15,a,-o),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.uv.needsUpdate=!0}function h(e,n,r){t[3*e]=n,t[3*e+1]=r}function d(e,t,r){n[2*e]=t,n[2*e+1]=r}},update:function(e){var t=this.data;this.material.color.setStyle(t.color),this.material.opacity=t.opacity,this.material.transparent=t.transparent,this.material.wireframe=t.debug,this.material.side=function(e){switch(e){case"back":return THREE.BackSide;case"double":return THREE.DoubleSide;default:return THREE.FrontSide}}(t.side);var n=AFRAME.utils.diff(t,e);"src"in n?this.updateMap():("width"in n||"height"in n||"padding"in n||"left"in n||"top"in n||"bottom"in n||"right"in n)&&this.regenerateMesh()},remove:function(){},pause:function(){},play:function(){}})},function(e,t){var n=[0,90,180,270],r=["right","up","left","down"],i={NULL:{START:"thumbstart",END:"thumbend"}};r.forEach(e=>{i[e]={},i[e].START="thumb"+e+"start",i[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.thresholdPad||(e=this.getDirection())&&(this.directionTrackpad=e,t.emit(i.NULL.START,null,!1),t.emit(i[this.directionTrackpad].START,null,!1))},onTrackpadUp:function(){var e=this.el;this.directionTrackpad&&(e.emit(i.NULL.END,null,!1),e.emit(i[this.directionTrackpad].END,null,!1),this.directionTrackpad="")},tick:function(){var e,t=this.el;if("PAD"!==this.type){if(!this.directionStick&&this.getDistance()>this.data.thresholdStick){if(!(e=this.getDirection()))return;return this.directionStick=e,t.emit(i.NULL.START,null,!1),void t.emit(i[this.directionStick].START,null,!1)}this.directionStick&&this.getDistance()<this.data.thresholdStick&&(t.emit(i.NULL.END,null,!1),t.emit(i[this.directionStick].END,null,!1),this.directionStick="")}},getDistance:function(){var e=this.axis;return this.axis?"PAD"===this.type?Math.sqrt(e[1]*e[1]+e[0]*e[0]):Math.sqrt(e[3]*e[3]+e[2]*e[2]):0},getDirection:function(){var e,t,i,a,o;for(e=this.getAngle(),a=this.data.thresholdAngle/2,i=0;i<n.length;i++){if((o=n[i]+a)>360&&(o-=360),(t=n[i]-a)<0&&(e>=360+t&&e<=360||e>=0&&e<=o))return r[i];if(e>=t&&e<=o)return r[i]}},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,n,r,i=this.el;if(this.data.enabled||AFRAME.utils.getUrlParameter("debug-thumb")){console.log("%c debug-thumb","background: #111; color: red");var a=function(){i.components["tracked-controls"].handleAxes=()=>{},n={axis:t=[0,0,0]},i.components["tracked-controls"].axis=t,i.components["thumb-controls"].axis=t};i.components["tracked-controls"]?a():this.el.addEventListener("controllerconnected",(function(){a()})),(r=this.createCanvas()).addEventListener("click",r=>{"vive-controls"===this.data.controllerType?e?i.emit("trackpadup"):i.emit("trackpaddown"):e&&(t[0]=0,t[1]=0,i.emit("axismove",n,!1)),e=!e}),r.addEventListener("mousemove",a=>{var o;e&&(o=r.getBoundingClientRect(),t[0]=(a.clientX-o.left)/240*2-1,t[1]=(a.clientY-o.top)/240*2-1,i.emit("axismove",n,!1))}),r.addEventListener("mouseleave",r=>{e&&(t[0]=0,t[1]=0,i.emit("axismove",n,!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,n){var r={"./active-item.js":59,"./agent-dance.js":60,"./agent-picker.js":61,"./beat-cut-fx.js":62,"./beat-generator.js":15,"./beat-hit-sound.js":63,"./beat.js":21,"./blade.js":64,"./check-vr.js":65,"./console-shortcuts.js":66,"./controller.js":67,"./copy-texture.js":68,"./cursor-laser.js":69,"./cursor-mesh.js":70,"./curve-follow-rig-reset.js":71,"./cutfx-shader.js":72,"./debug-beat-generator.js":75,"./debug-beat-positioning.js":76,"./debug-controller.js":77,"./debug-cursor.js":78,"./debug-intro.js":79,"./debug-song-time.js":80,"./debug-state.js":81,"./delayed-proxy-event.js":82,"./difficulty-background.js":83,"./difficulty-filter.js":84,"./difficulty-text.js":85,"./follow-position.js":86,"./follow-z.js":87,"./gameover.js":88,"./gpu-preloader.js":89,"./gradient-shader.js":90,"./hand-swapper.js":92,"./handstar-shader.js":93,"./haptics-wall.js":96,"./haptics-weapon.js":97,"./headfist.js":98,"./history.js":99,"./intro-song.js":100,"./keyboard-raycastable.js":101,"./leaderboard.js":102,"./materials.js":109,"./menu-controls.js":124,"./menu-difficulty-select.js":125,"./menu-genre.js":126,"./menu-midsection.js":127,"./menu-mode.js":128,"./menu-playlist-button.js":129,"./menu-playlist.js":130,"./menu-selected-challenge-image.js":131,"./menu-slide-animation.js":132,"./multiplier-ring.js":133,"./no-frustum-cull.js":134,"./panel-shader.js":135,"./pause.js":138,"./pauser.js":139,"./play-sound.js":140,"./player-height.js":142,"./plume.js":143,"./punch.js":144,"./raycaster-target.js":145,"./recenter.js":146,"./ring.js":147,"./score-texts.js":150,"./search-thumbnail-atlas.js":151,"./search.js":152,"./song-info-positioner.js":155,"./song-preview.js":156,"./song-progress-info.js":157,"./song.js":158,"./stage-colors.js":159,"./stage-lasers.js":160,"./stars.js":161,"./stats-param.js":162,"./stepback.js":163,"./sub-object.js":164,"./super-keyboard.js":165,"./supercurve-color.js":166,"./supercurve-shader.js":167,"./supercurve.js":170,"./supercutfx-shader.js":173,"./supercutfx.js":174,"./tail.js":175,"./text-counter.js":176,"./text-geometry.js":236,"./text-truncate.js":177,"./text-uppercase.js":178,"./toggle-pause-play.js":179,"./trail.js":180,"./tunnels.js":181,"./vertex-colors-buffer.js":182,"./victory-accuracy-ring.js":183,"./victory-rank.js":184,"./visible-raycastable.js":185,"./wall-shader.js":186,"./wall.js":189,"./weapon-particles.js":190,"./zip-loader.js":191};function i(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=a,e.exports=i,i.id=58},function(e,t,n){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"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=["dance","rumba","capoeira","thriller","wave","celebrate","taunt","silly","jump","pray","reaction","sitclap","sitlaugh","kiss","angry","defeated","falling","dying","idle"];if(AFRAME.registerComponent("agent-dance",{schema:{base:{default:"assets/clips/"},initial:{default:"dance"}},init:function(){this.clips={},this.currentAction=null;const e=this.el,t=()=>{const t=e.getObject3D("mesh");t&&(this.mixer=new THREE.AnimationMixer(t),this.play(this.data.initial),this.buildUI())};e.getObject3D("mesh")?t():e.addEventListener("model-loaded",t),this.onKeyDown=e=>{if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName)return;const t="1234567890".indexOf(e.key);t>=0&&r[t]&&(this.play(r[t]),this.ui&&(this.ui.value=r[t]))},window.addEventListener("keydown",this.onKeyDown)},remove:function(){window.removeEventListener("keydown",this.onKeyDown),this.ui&&this.ui.remove()},play:function(e){if(!this.mixer)return;const t=e=>{const t=this.mixer.clipAction(e);t.reset().play(),this.currentAction&&this.currentAction!==t&&this.currentAction.crossFadeTo(t,.3,!1),this.currentAction=t};this.clips[e]?t(this.clips[e]):fetch(this.data.base+e+".json").then(e=>e.ok?e.json():null).then(n=>{if(!n)return;const r=THREE.AnimationClip.parse(n);this.clips[e]=r,t(r)}).catch(()=>{})},buildUI:function(){const e=document.createElement("select");e.style.cssText="position:fixed;top:10px;left:10px;z-index:9999998;background:rgba(0,0,0,0.7);color:#fff;font-family:monospace;padding:6px;border:1px solid #444;border-radius:4px;",e.title="Agent animation (1-0 keys also work)",r.forEach((t,n)=>{const r=document.createElement("option");r.value=t;const i=n<10?`[${(n+1)%10}] `:"";r.textContent=i+t,t===this.data.initial&&(r.selected=!0),e.appendChild(r)}),e.addEventListener("change",()=>this.play(e.value)),document.body.appendChild(e),this.ui=e},tick:function(e,t){this.mixer&&this.mixer.update(t/1e3)}}),window.AFRAME){const t=["agent-dance"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=[{id:"cz",name:"CZ",url:"https://raw.githubusercontent.com/overstepping/-/main/cz.glb"}];function i(e){return String(e).replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]))}function a(e){return"three.ws"===window.location.hostname?e:e.replace(/^https:\/\/pub-2534e921bf9c4314addcd4d8a6e98b7b\.r2\.dev/,"/r2-proxy")}if(AFRAME.registerSystem("agent-picker",{init:function(){this.agents=r.slice(),this.currentId=null,this.companionEl=null,this.searchQuery="";const e=()=>{this.companionEl=document.querySelector("#agentCompanion"),this.companionEl&&(this.buildOverlay(),this.applyInitialSelection(),this.wireSceneEvents(),this.wirePostMessage(),this.fetchPublicAvatars())};this.sceneEl.hasLoaded?e():this.sceneEl.addEventListener("loaded",e)},fetchPublicAvatars:function(e=""){const t=new URL("https://three.ws/api/explore");t.searchParams.set("only3d","1"),t.searchParams.set("limit","40"),e&&t.searchParams.set("q",e),fetch(t.toString()).then(e=>e.ok?e.json():null).then(e=>{if(!e||!Array.isArray(e.items))return;const t=e.items.filter(e=>e.glbUrl).map(e=>({id:`${e.kind}-${e.agentId||e.name}-${e.sortDate}`,name:e.name||"Untitled",url:a(e.glbUrl),owner:e.ownerShort||""}));this.agents=r.concat(t),this.renderList()}).catch(()=>{})},buildOverlay:function(){if(document.getElementById("agentPicker"))return;const e=document.createElement("div");e.id="agentPicker",e.innerHTML='\n <style>\n #agentPicker {\n position: fixed; top: 12px; right: 12px; z-index: 9999;\n font-family: system-ui, sans-serif; user-select: none;\n transition: opacity 0.3s;\n }\n #agentPicker.playing { opacity: 0; pointer-events: none; }\n #agentPicker .ap-toggle {\n background: rgba(8, 10, 24, 0.85); color: #cfd6ff;\n border: 1px solid rgba(120, 140, 255, 0.4); border-radius: 8px;\n padding: 8px 14px; font-size: 12px; letter-spacing: 0.08em;\n cursor: pointer; backdrop-filter: blur(6px);\n }\n #agentPicker .ap-toggle:hover { background: rgba(40, 50, 100, 0.9); }\n #agentPicker .ap-panel {\n margin-top: 8px; background: rgba(8, 10, 24, 0.92);\n border: 1px solid rgba(120, 140, 255, 0.3); border-radius: 8px;\n padding: 8px; width: 260px; display: none;\n backdrop-filter: blur(6px);\n }\n #agentPicker.open .ap-panel { display: block; }\n #agentPicker .ap-search {\n width: 100%; box-sizing: border-box; background: rgba(0,0,0,0.4);\n color: #cfd6ff; border: 1px solid rgba(120, 140, 255, 0.3);\n border-radius: 6px; padding: 6px 8px; font-size: 12px;\n margin-bottom: 6px; outline: none;\n }\n #agentPicker .ap-list { max-height: 320px; overflow-y: auto; }\n #agentPicker .ap-item {\n display: flex; align-items: center; gap: 10px;\n padding: 8px 10px; border-radius: 6px; cursor: pointer;\n color: #cfd6ff; font-size: 13px;\n }\n #agentPicker .ap-item:hover { background: rgba(80, 100, 200, 0.25); }\n #agentPicker .ap-item.active { background: rgba(80, 100, 200, 0.4); }\n #agentPicker .ap-dot {\n width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;\n background: linear-gradient(135deg, #6699ff, #ff4488);\n }\n #agentPicker .ap-name {\n flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n }\n #agentPicker .ap-owner { color: #6677aa; font-size: 10px; }\n #agentPicker .ap-empty { padding: 10px; color: #6677aa; font-size: 12px; text-align: center; }\n </style>\n <button class="ap-toggle" type="button">AGENT</button>\n <div class="ap-panel">\n <input class="ap-search" type="text" placeholder="Search avatars on three.ws..." />\n <div class="ap-list"></div>\n </div>\n ',document.body.appendChild(e);const t=e.querySelector(".ap-toggle"),n=e.querySelector(".ap-search");let r;t.addEventListener("click",()=>e.classList.toggle("open")),n.addEventListener("input",()=>{clearTimeout(r),this.searchQuery=n.value.trim(),r=setTimeout(()=>this.fetchPublicAvatars(this.searchQuery),300)}),this.overlayEl=e,this.listEl=e.querySelector(".ap-list")},renderList:function(){this.listEl&&(this.listEl.innerHTML="",this.agents.length?this.agents.forEach(e=>{const t=document.createElement("div");t.className="ap-item"+(e.id===this.currentId?" active":""),t.dataset.id=e.id,t.innerHTML=`\n <span class="ap-dot"></span>\n <span class="ap-name">${i(e.name)}</span>\n ${e.owner?`<span class="ap-owner">${i(e.owner)}</span>`:""}\n `,t.addEventListener("click",()=>{this.selectAgent(e.id),this.overlayEl.classList.remove("open")}),this.listEl.appendChild(t)}):this.listEl.innerHTML='<div class="ap-empty">No avatars found.</div>')},applyInitialSelection:function(){const e=new URLSearchParams(window.location.search).get("agent");e&&this.agents.some(t=>t.id===e)?this.selectAgent(e):this.selectAgent(this.agents[0].id),this.renderList()},selectAgent:function(e){let t;"string"==typeof e?t=this.agents.find(t=>t.id===e):e&&e.url&&(t=e,this.agents.some(e=>e.id===t.id)||this.agents.push(t)),t&&this.companionEl&&(this.currentId=t.id,this.companionEl.setAttribute("gltf-model",`url(${t.url})`),this.renderList(),this.sceneEl.emit("agentchanged",{agentId:t.id,url:t.url}))},wireSceneEvents:function(){const e=()=>this.overlayEl&&this.overlayEl.classList.remove("playing");this.sceneEl.addEventListener("songstartfade",()=>this.overlayEl&&this.overlayEl.classList.add("playing")),this.sceneEl.addEventListener("cleargame",e),this.sceneEl.addEventListener("gameover",e),this.sceneEl.addEventListener("songcomplete",e)},wirePostMessage:function(){window.addEventListener("message",e=>{const t=e.data;t&&"rider:setAgent"===t.type&&(t.url?this.selectAgent({id:t.agentId||"external-"+Date.now(),name:t.name||"Agent",url:t.url}):t.agentId&&this.selectAgent(t.agentId))})}}),window.AFRAME){const t=[],n=[],r=["agent-picker"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Vector3,i={right:0,upright:45,up:90,upleft:135,left:180,downleft:225,down:270,downright:315},a={right:new THREE.Vector2(0,1),upright:new THREE.Vector2(-.5,.5),up:new THREE.Vector2(-1,0),upleft:new THREE.Vector2(-.5,-.5),left:new THREE.Vector2(0,-1),downleft:new THREE.Vector2(.5,-.5),down:new THREE.Vector2(1,0),downright:new THREE.Vector2(.5,.5)};function o(e,t){e.x+=(Math.random()-.5)*t,e.y+=(Math.random()-.5)*t,e.z+=(Math.random()-.5)*t}if(AFRAME.registerComponent("beat-cut-fx",{schema:{color:{type:"string"},type:{oneOf:["beat","dot","mine"],default:"beat"}},init:function(){this.breaking=!1,this.fx=null,this.fxpool=null,this.pieces=[],this.pool=null,this.returnToPoolTimer=500,this.el.addEventListener("model-loaded",this.setupModel.bind(this)),this.el.addEventListener("explode",this.explode.bind(this),!1)},update:function(){const e=this.el.sceneEl,t=this.data.color;"beat"===this.data.type?(this.material=e.systems.materials[t+"BeatPieces"],this.poolBeat=e.components["pool__beat-broken-"+t],this.poolBeatFx=e.components["pool__beat-fx-"+t],this.poolPunchFx=e.components["pool__punch-fx-"+t]):"dot"===this.data.type?(this.material=e.systems.materials[t+"BeatPieces"],this.poolBeat=e.components[`pool__beat-broken-${t}-dot`],this.poolPunch=e.components[`pool__punch-broken-${t}-dot`],this.poolBeatFx=e.components["pool__beat-fx-"+t],this.poolPunchFx=e.components["pool__punch-fx-"+t]):(this.material=e.systems.materials.minePieces,this.poolBeat=e.components["pool__beat-broken-mine"],this.poolBeatFx=e.components["pool__beat-fx-mine"],this.poolPunchFx=e.components["pool__punch-fx-mine"])},setupModel:function(e){const t=e.detail.model;this.pieces=t.children;for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];t.restPosition=t.position.clone(),t.restRotation=t.rotation.clone(),t.posVelocity=new THREE.Vector3,t.rotVelocity=new THREE.Vector3,t.material=this.material}},explode:function(e){const t=e.detail.direction,n=e.detail.gameMode,s=e.detail.correctHit,c=e.detail.position,l=e.detail.rotation;let u=e.detail.beatDirection;if(c&&l&&t&&this.data.color===e.detail.color){if(this.el.object3D.position.copy(c),"classic"===n&&"mine"!==this.data.type){const e="dot"===this.data.type;e&&(u=Math.abs(t.x)>Math.abs(t.y)?"right":"down"),t.z*=.01,r.copy(t).multiplyScalar(-.0025).clampLength(0,.01);for(let t=0;t<this.pieces.length;t++){let n=this.pieces[t];if(n.posVelocity.copy(r),n.rotation.z=THREE.Math.degToRad(i[u]),s){let r=t%2==0?-.001:.001;n.posVelocity.x+=a[u].x*r,n.posVelocity.y+=a[u].y*r,!e||t<2?(o(n.posVelocity,.002),o(n.rotVelocity,.004)):(n.posVelocity.copy(this.pieces[t-2].posVelocity),n.rotVelocity.copy(this.pieces[t-2].rotVelocity))}else n.posVelocity.y+=.001,n.rotVelocity.z+=.01}}else for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];s?(t.posVelocity.copy(t.position).normalize().multiplyScalar(.002),t.posVelocity.z=-.004,o(t.posVelocity,.001),o(t.rotVelocity,.01)):(t.posVelocity.y+=.001,t.posVelocity.z-=.001)}this.pool=this["classic"===n?"poolBeat":"poolPunch"],null===this.fx&&(this.fxpool=this["classic"===n?"poolBeatFx":"poolPunchFx"],this.fx=this.fxpool.requestEntity()),this.fx&&(this.fx.play(),this.fx.object3D.position.copy(c),this.fx.object3D.rotation.copy(l),this.fx.emit("explode")),this.returnToPoolTimer=500,this.breaking=!0,this.el.play()}},returnToPool:function(){for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];t.position.copy(t.restPosition),t.rotation.copy(t.restRotation),t.posVelocity.set(0,0,0),t.rotVelocity.set(0,0,0),t.scale.set(1,1,1)}this.fx&&(this.fxpool.returnEntity(this.fx),this.fx=null),this.pool.returnEntity(this.el),this.breaking=!1},tick:function(e,t){if(this.breaking)if(this.returnToPoolTimer-=t,this.returnToPoolTimer<=0)this.returnToPool();else for(let e=0;e<this.pieces.length;e++){const n=this.pieces[e];n.position.addScaledVector(n.posVelocity,t),n.rotation.set(n.rotation.x+n.rotVelocity.x*t,n.rotation.y+n.rotVelocity.y*t,n.rotation.z+n.rotVelocity.z*t),"mine"!==this.data.type?(this.returnToPoolTimer<250&&n.scale.multiplyScalar(.94),n.posVelocity.multiplyScalar(.97),n.posVelocity.y-=3e-6*t):(n.scale.multiplyScalar(.94),n.posVelocity.multiplyScalar(.97))}}}),window.AFRAME){const t=["beat-cut-fx"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("beat-hit-sound",{directionsToSounds:{up:"",down:"",upleft:"left",upright:"right",downleft:"left",downright:"right",left:"left",right:"right"},init:function(){this.currentBeatEl=null,this.currentCutDirection="",this.processSound=this.processSound.bind(this),this.sourceCreatedCallback.bind(this);for(let e=1;e<=10;e++)this.el.setAttribute("sound__beathit"+e,{poolSize:8,positional:!1,src:"#hitSound"+e,volume:.185}),this.el.setAttribute(`sound__beathit${e}left`,{poolSize:8,positional:!1,src:`#hitSound${e}left`,volume:.185}),this.el.setAttribute(`sound__beathit${e}right`,{poolSize:8,positional:!1,src:`#hitSound${e}right`,volume:.185})},play:function(){for(let e=1;e<=10;e++)this.el.components["sound__beathit"+e].loaded||(this.el.setAttribute("sound__beathit"+e,"src",""),this.el.setAttribute("sound__beathit"+e,"src","#hitSound"+e)),this.el.components[`sound__beathit${e}left`].loaded||(this.el.setAttribute(`sound__beathit${e}left`,"src",""),this.el.setAttribute(`sound__beathit${e}left`,"src",`#hitSound${e}left`)),this.el.components[`sound__beathit${e}right`].loaded||(this.el.setAttribute(`sound__beathit${e}right`,"src",""),this.el.setAttribute(`sound__beathit${e}right`,"src",`#hitSound${e}right`))},playSound:function(e,t,n){const r=1+Math.floor(10*Math.random()),i=this.directionsToSounds[n||"up"];this.el.components[`sound__beathit${r}${i}`].playSound(this.processSound)},processSound:function(e){e.detune=0},sourceCreatedCallback:function(e){const t=this.getLayer(this.currentBeatEl.object3D.position.y);"bottom"===t?e.detune.setValueAtTime(-400,0):"top"===t&&e.detune.setValueAtTime(200,0),"down"===this.currentCutDirection&&e.detune.linearRampToValueAtTime(-400,1),"up"===this.currentCutDirection&&e.detune.linearRampToValueAtTime(400,1)},getLayer:function(e){return 1===e?"bottom":1.7===e?"top":"middle"}}),window.AFRAME){const t=["beat-hit-sound"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("blade",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.data;this.bladeHandle=e.querySelector(".bladeHandleHelper").object3D,this.bladeTip=e.querySelector(".bladeTipHelper").object3D,this.rigEl=document.getElementById("curveFollowRig"),this.strokeDirectionVector=new THREE.Vector3,this.strokeSpeed=0,this.bladeBottomPosition=new THREE.Vector3,this.bladeTipPositions=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this.bladeWorldPositions=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this.bladeEl=this.el.querySelector(".blade")},update:function(e){!e.enabled&&this.data.enabled&&this.bladeEl.emit("drawblade")},tickBeatSystem:function(e,t){this.data.enabled&&this.updateVelocity(t)},updateVelocity:function(e){const t=this.bladeTipPositions,n=this.bladeWorldPositions;this.data;n[2].copy(n[0]),n[3].copy(n[1]),this.bladeTip.getWorldPosition(n[0]),this.bladeHandle.getWorldPosition(n[1]),t[2].copy(n[0]),this.rigEl.object3D.worldToLocal(t[2]),this.strokeDirectionVector.copy(t[2]).sub(t[0]);const r=this.strokeDirectionVector.length();this.strokeSpeed=r/(e/1e3),this.strokeDirectionVector.z=0,this.strokeDirectionVector.normalize();const i=t.shift();t.push(i)},checkCollision:function(){const e=new THREE.Box3,t=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],n=new THREE.Triangle;return function(r){if(this.strokeSpeed<1)return!1;for(let e=0;e<3;e++)t[e].copy(this.bladeWorldPositions[e]),r.blockEl.object3D.worldToLocal(t[e]),t[e].multiplyScalar(1.75);return n.set(t[0],t[1],t[2]),e.copy(r.bbox),e.expandByScalar(.02),"left"!==r.horizontalPosition&&"right"!==r.horizontalPosition||e.expandByScalar(.07),!!e.intersectsTriangle(n)||(t[3].copy(this.bladeWorldPositions[3]),r.blockEl.object3D.worldToLocal(t[3]),n.set(t[2],t[3],t[0]),!!e.intersectsTriangle(n))}}(),createDebugCube:function(e,t){const n=new THREE.BoxGeometry(.05,.05,.05),r=new THREE.Mesh(n,new THREE.MeshBasicMaterial({color:t,side:THREE.DoubleSide}));r.position.copy(e),this.el.sceneEl.object3D.add(r)}}),window.AFRAME){const t=["blade"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerSystem("check-vr",{init:function(){AFRAME.utils.device.isMobile()&&(document.getElementById("vrButton").style.display="none"),setTimeout(()=>{AFRAME.utils.device.checkHeadsetConnected()&&this.el.emit("displayconnected")},250)}}),window.AFRAME){const t=[],n=[],r=["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 n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("console-shortcuts",{play:function(){window.$=e=>document.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"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("controller",{schema:{hand:{default:"right",oneOf:["left","right"]}},init:function(){const e=this.el,t=this.data;this.controllerType="",e.addEventListener("controllerconnected",e=>{this.controllerType=e.detail.name,this.el.setAttribute("cursor",this.config[this.controllerType].cursor||{})});const n={hand:t.hand,model:!1};e.setAttribute("daydream-controls",n),e.setAttribute("oculus-go-controls",n),e.setAttribute("oculus-touch-controls",{hand:t.hand,model:!1,orientationOffset:{x:0,y:0,z:0}}),e.setAttribute("vive-controls",n),e.setAttribute("vive-focus-controls",n),e.setAttribute("windows-motion-controls",n),e.setAttribute("generic-tracked-controller-controls",n)},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"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("copy-texture",{dependencies:["geometry","material"],schema:{from:{type:"selector"}},init:function(){this.data.from.addEventListener("materialtextureloaded",()=>{this.copyTexture()}),this.copyTexture()},copyTexture:function(){const e=this.el,t=this.data.from,n=e.getObject3D("mesh").material;t.getObject3D("mesh")&&(n.map=t.getObject3D("mesh").material.map,n.map&&(n.map.needsUpdate=!0,n.needsUpdate=!0))}}),window.AFRAME){const t=["copy-texture"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("cursor-laser",{dependencies:["geometry"],schema:{enabled:{default:!0}},init:function(){const e=this.el;this.weaponEl=this.el.closest(".weapon");const t=this.el.getAttribute("geometry");e.object3D.position.z=-1*t.height/2,this.originalSize=t.height,this.currentLength=t.height},update:function(){this.el.object3D.visible=this.data.enabled},tick:function(){const e=this.el;if(!this.data.enabled)return;const t=this.weaponEl.components.cursor;if(!t)return;if(!t.intersectedEl)return e.object3D.position.z=-24.98,e.object3D.scale.x=.75,e.getObject3D("mesh").scale.y=50,void(this.currentLength=1);const n=this.weaponEl.components.raycaster.intersections[0];n&&(e.object3D.scale.x=1,e.object3D.position.z=-n.distance/2,e.getObject3D("mesh").scale.y=this.currentLength=n.distance)}}),window.AFRAME){const t=["cursor-laser"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("cursor-mesh",{schema:{active:{default:!0},cursorEl:{type:"selector"}},init:function(){this.scenePivotEl=document.getElementById("scenePivot")},update:function(){this.el.object3D.visible=this.data.active},tick:function(){var e,t,n=this.data.cursorEl,r=this.el,i=this.scenePivotEl;this.data.active&&n.components.cursor&&((t=n.components.cursor.intersectedEl)?(r.object3D.visible=!0,(e=n.components.raycaster.getIntersection(t))&&(r.object3D.position.copy(e.point),i&&r.object3D.rotation.copy(i.object3D.rotation))):r.object3D.visible=!1)}}),window.AFRAME){const t=["cursor-mesh"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("curve-follow-rig-reset",{schema:{isVictory:{type:"string"}},init:function(){this.el.sceneEl.addEventListener("cleargame",()=>{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"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("cutfxShader",{schema:{src:{type:"map",is:"uniform",default:"#cutfxImg"},color:{type:"color",is:"uniform",default:"#fff"},progress:{type:"number",is:"uniform"},transparent:{default:!0},blending:{default:"additive"},side:{default:"double"},depthTest:{default:!1},depthWrite:{default:!1}},vertexShader:n(73),fragmentShader:n(74)}),window.AFRAME){const t=[],n=["cutfxShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float progress;\n\nvoid main() {\n vec3 col = color;\n float alpha = smoothstep(progress, 1.0, texture2D(src, uvs).a);\n gl_FragColor = vec4(col, alpha);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("debug-beat-generator",{dependencies:["beat-generator"],schema:{beatEnabled:{default:!1},stageEnabled:{default:!1}},init:function(){this.beatLoader=this.el.components["beat-generator"],this.selectedBeat={color:"red",position:"middleCenterLeft",type:"arrow",orientation:"up"},this.beats={},this.onKeyDown=this.onKeyDown.bind(this),(this.data.stageEnabled||AFRAME.utils.getUrlParameter("debugstage"))&&this.addDebugStageControls(),(this.data.beatEnabled||"gameplay"===AFRAME.utils.getUrlParameter("debugstate").trim())&&(window.addEventListener("keydown",this.onKeyDown),this.addDebugBeatControls())},spawn:function(){var e=this;Object.keys(this.beats).forEach((function(t){e.generateBeat(e.beats[t])}))},generateBeat:function(e){var t;"wall"!==e.type?(t="mine"===e.type?3:"red"===e.color?0:1,this.beatLoader.generateBeat({_lineIndex:this.beatLoader.positionHumanized[e.position].index,_lineLayer:this.beatLoader.positionHumanized[e.position].layer,_cutDirection:"dot"===e.type?8:this.beatLoader.orientationsHumanized.indexOf(e.orientation),_type:t})):this.generateWall(e)},generateWall:function(e){this.beatLoader.bpm=90,this.beatLoader.generateWall({_lineIndex:this.beatLoader.positionHumanized[e.position].index,_width:1,_duration:3})},onKeyDown:function(e){switch(e.keyCode){case 32:this.spawn()}},addDebugBeatControls:function(){const e=document.createElement("div"),t=this;var n;function r(t){const n=document.createElement("div");return n.id=t,n.style.marginBottom="20px",n.style.width="500px",n.style.display="inline-block",e.appendChild(n),n}function i(e,n,r){const i=document.createElement("div"),a=r||function(){const e=i.parentElement.querySelectorAll(".button");for(let t=0;t<e.length;t++)e[t].style.background="#000";i.style.background="#66f",t.selectedBeat[i.parentElement.id]=this.id,t["selected"+i.parentElement.id.charAt(0).toUpperCase()+i.parentElement.id.slice(1)+"El"]=this};return i.classList.add("button"),i.id=e,i.style.width="100px",i.style.height="30px",i.style.background="#000",i.style.color="#fff",i.style.zIndex=999999999,i.style.padding="5px",i.style.margin="5px",i.style.font="14px sans-serif",i.style.textAlign="center",i.style.lineHeight="30px",i.style.cursor="pointer",i.style.display="inline-block",i.innerHTML=e,n.appendChild(i),i.addEventListener("click",a),i}e.style.position="absolute",e.style.right="0",e.style.top="0",e.style.padding="10px",e.style.width="500px",e.style.height="600px",document.body.appendChild(e),function(){const t=r("type");i("arrow",t),i("dot",t),i("mine",t),i("wall",t),e.appendChild(t)}(),function(){const t=r("color");i("blue",t),i("red",t),e.appendChild(t)}(),function(){const t=r("orientation");i("top",t),i("left",t),i("right",t),i("down",t),e.appendChild(t)}(),(n=i("Set Beat",e,(function(){var e="mine"!==t.selectedBeat.type?" "+t.selectedBeat.color:"",n="arrow"!==t.selectedBeat.type?"":" "+t.selectedBeat.orientation;t.selectedBeat={position:t.selectedBeat.position,type:t.selectedBeat.type,orientation:t.selectedBeat.orientation,color:t.selectedBeat.color},t.selectedPositionEl&&(t.selectedPositionEl.innerHTML=t.selectedBeat.type+e+n,t.beats[t.selectedPositionEl.id]={position:t.selectedBeat.position,type:t.selectedBeat.type,orientation:t.selectedBeat.orientation,color:t.selectedBeat.color})}))).style.width="460px",n.style.bottomMargin="10px",function(){const e=r("position");i("topLeft",e),i("topCenterLeft",e),i("topCenterRight",e),i("topRight",e),i("middleLeft",e),i("middleCenterLeft",e),i("middleCenterRight",e),i("middleRight",e),i("bottomLeft",e),i("bottomCenterLeft",e),i("bottomCenterRight",e),i("bottomRight",e)}(),function(n,r){const a=i("Spawn (Space Bar)",e,()=>{t.spawn()});a.style.width="460px",a.style.bottomMargin="10px"}()},addDebugStageControls:function(){var e=0;const t=(t,n,r)=>{const i=document.createElement("div");i.style.position="absolute",i.id="stagecontrol"+t,i.style.width="100px",i.style.height="30px",i.style.top="element"===r?"20px":"70px",i.style.background="#000",i.style.color="#fff",i.style.zIndex=999999999,i.style.padding="5px",i.style.font="14px sans-serif",i.style.textAlign="center",i.style.cursor="pointer",i.style.left=20+120*t+"px",i.innerHTML=n,"element"===r?i.addEventListener("click",()=>{document.getElementById("stagecontrol"+e).style.background="#000",i.style.background="#66f",e=t}):i.addEventListener("click",()=>{this.beatLoader.generateEvent({_type:e,_value:t})}),document.body.appendChild(i)};["sky","tunnelNeon","leftStageLasers","rightStageLasers","floor"].forEach((e,n)=>{t(n,e,"element")}),["off","blue","blue","bluefade","","red","red","redfade"].forEach((e,n)=>{t(n,e,"value")})}}),window.AFRAME){const t=["debug-beat-generator"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=["left","middleleft","middleright","right"],i=["bottom","middle","top"];if(AFRAME.registerComponent("debug-beat-positioning",{play:function(){let e=AFRAME.utils.getUrlParameter("debugbeatpositioning");e&&("punch"!==e&&"classic"!==e&&(e="classic"),this.el.emit("debugbeatpositioning"),setTimeout(()=>{const t=this.el.sceneEl.components["beat-generator"];t.data.gameMode=e,scene.components["beat-system"].data.gameMode=e,scene.components["beat-system"].updateBeatPositioning(),r.forEach(n=>{i.forEach(r=>{let i=t.requestBeat("punch"===e?"dot":"arrow","red"),a=Math.random()<.5?"left":"right";i.components.beat.onGenerate(.001,n,r,a),i.object3D.renderOrder=9999,i.play(),i=t.requestBeat("dot","blue"),a=Math.random()<.5?"down":"up",i.components.beat.onGenerate(.0015,n,r,a),i.object3D.renderOrder=9999,i.play()})});const n=scene.components.pool__wall.requestEntity();n.components.wall.onGenerate(.0015,"left",4,4,!0),n.play(),document.getElementById("beatContainer").removeAttribute("bind__visible"),document.getElementById("beatContainer").object3D.visible=!0},500))}}),window.AFRAME){const t=["debug-beat-positioning"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-controller",{init:function(){var e,t;AFRAME.utils.getUrlParameter("debug")&&(console.log("%c debug-controller enabled ","background: #111; color: red"),e=document.getElementById("rightHand"),t=document.getElementById("leftHand"),e.setAttribute("tracked-controls","autoHide",!1),e.object3D.visible=!0,t.object3D.visible=!0,t.setAttribute("tracked-controls","autoHide",!1),AFRAME.utils.getUrlParameter("headfist")||(window.addEventListener("click",t=>{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",n=>{var r,i,a,o;n.shiftKey&&(32!==n.keyCode?81!==n.keyCode?(78===n.keyCode&&(this.secondaryGripDown?(t.emit("gripup"),this.secondaryGripDown=!1):(t.emit("gripdown"),this.secondaryGripDown=!0)),77===n.keyCode&&(this.primaryGripDown?(e.emit("gripup"),this.primaryGripDown=!1):(e.emit("gripdown"),this.primaryGripDown=!0)),49===n.keyCode&&t.emit("menudown"),n.ctrlKey?(a=t.getAttribute("position"),72===n.keyCode&&(a.x-=.02),74===n.keyCode&&(a.y-=.02),75===n.keyCode&&(a.y+=.02),76===n.keyCode&&(a.x+=.02),59!==n.keyCode&&186!==n.keyCode||(a.z-=.01),222===n.keyCode&&(a.z+=.01),t.setAttribute("position",AFRAME.utils.clone(a))):(r=e.getAttribute("position"),72===n.keyCode&&(r.x-=.02),74===n.keyCode&&(r.y-=.02),75===n.keyCode&&(r.y+=.02),76===n.keyCode&&(r.x+=.02),59!==n.keyCode&&186!==n.keyCode||(r.z-=.02),222===n.keyCode&&(r.z+=.02),e.setAttribute("position",AFRAME.utils.clone(r))),n.ctrlKey?(o=t.getAttribute("rotation"),89===n.keyCode&&(o.x-=10),79===n.keyCode&&(o.x+=10),85===n.keyCode&&(o.y-=10),73===n.keyCode&&(o.y+=10),t.setAttribute("rotation",AFRAME.utils.clone(o))):(i=e.getAttribute("rotation"),89===n.keyCode&&(i.x-=10),79===n.keyCode&&(i.x+=10),85===n.keyCode&&(i.y-=10),73===n.keyCode&&(i.y+=10),e.setAttribute("rotation",AFRAME.utils.clone(i)))):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 n=AFRAME.utils.getUrlParameter("type");[e,t].forEach(e=>{e.querySelector(".laser").object3D.visible=!1,"classic"===n?(e.querySelector(".bladeContainer").removeAttribute("bind__visible"),e.querySelector(".bladeContainer").object3D.visible=!0,e.querySelector(".bladeContainer").object3D.scale.set(1,1,1)):"punch"===n?(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"===n&&(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,n=new THREE.Vector3;return function(r){const i=this.bounds,a=this.el.sceneEl.camera,o=r.clientX-i.left,s=r.clientY-i.top;t.x=o/i.width*2-1,t.y=-s/i.height*2-1,document.getElementById("camera").object3D.getWorldPosition(n),e.set(t.x,t.y,.5).unproject(a).sub(n).normalize();const c=document.getElementById("rightHand").object3D.position,l=-n.z/e.z;a.getWorldPosition(c).add(e.multiplyScalar(l)),c.y+=.8}}()}),window.AFRAME){const t=["debug-controller"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-cursor",{init:function(){},log:function(e,t,n){t.id?console.log(`%c[${e}] ${t.id}`,"color: "+n):(console.log(`%c[${e}]`,"color: "+n),console.log(t))}}),window.AFRAME){const t=["debug-cursor"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=AFRAME.utils.getUrlParameter("skipintro");if(AFRAME.registerComponent("debug-intro",{play:function(){r&&document.getElementById("startButton").emit("click")}}),window.AFRAME){const t=["debug-intro"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-song-time",{dependencies:["song"],init:function(){AFRAME.utils.getUrlParameter("debug-song-time")&&setInterval(()=>{console.log(this.el.components.song.getCurrentTime())},250)}}),window.AFRAME){const t=["debug-song-time"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-state",{play:function(){const e=AFRAME.utils.getUrlParameter("debugstate").trim();e&&setTimeout(()=>{e.split(",").forEach(e=>{this.el.sceneEl.emit("debug"+e.trim(),null,!1)})},500)}}),window.AFRAME){const t=["debug-state"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("delayed-proxy-event",{schema:{captureBubbles:{default:!1},enabled:{default:!0},event:{type:"string"},from:{type:"string"},to:{type:"string"},as:{type:"string"},bubbles:{default:!1},delay:{default:0,type:"int"}},multiple:!0,init:function(){var e,t,n,r=this.data,i=this.el,a=this;if(r.from?e="PARENT"===r.from?[i.parentNode]:document.querySelectorAll(r.from):n="CHILDREN"===r.to?i.querySelectorAll("*"):"SELF"===r.to?[i]:document.querySelectorAll(r.to),r.from)for(t=0;t<e.length;t++)this.addEventListenerFrom(e[t]);else i.addEventListener(r.event,(function(e){setTimeout(()=>{var r=a.data;if(r.enabled&&(r.captureBubbles||e.target===i))for(t=0;t<n.length;t++)n[t].emit(r.as||r.event,e.detail?e.detail:null,r.bubbles)},r.delay)}))},addEventListenerFrom:function(e){var t=this.data,n=this;e.addEventListener(t.event,(function(r){setTimeout(()=>{var t=n.data;t.enabled&&(t.captureBubbles||r.target===e)&&n.el.emit(t.as||t.event,r.detail?r.detail:null,!1)},t.delay)}))}}),window.AFRAME){const t=["delayed-proxy-event"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-background",{schema:{enabled:{type:!1}},update:function(){this.data.enabled?this.el.setAttribute("raycastable",""):this.el.removeAttribute("raycastable")}}),window.AFRAME){const t=["difficulty-background"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-filter",{events:{click:function(e){this.el.sceneEl.emit("difficultyfilter",e.target.parentNode.dataset.difficultyFilter)}}}),window.AFRAME){const t=["difficulty-filter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-text",{schema:{id:{value:"Standard-Easy"}},update:function(){this.el.setAttribute("text","value",this.data.id.replace("Standard-","").replace("-","\n"))}}),window.AFRAME){const t=["difficulty-text"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("follow-position",{schema:{target:{type:"selector"}},tick:function(){this.el.object3D.position.copy(this.data.target.object3D.position)}}),window.AFRAME){const t=["follow-position"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("follow-z",{schema:{offset:{type:"vec3"},target:{type:"selector"}},tick:function(){this.data.target&&(this.el.object3D.position.copy(this.data.offset),this.el.object3D.position.z+=this.data.target.object3D.position.z)}}),window.AFRAME){const t=["follow-z"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("gameover",{schema:{isGameOver:{default:!1}},init:function(){this.beatContainer=document.getElementById("beatContainer"),this.gameOverEls=document.querySelectorAll("[animation__gameover]")},update:function(e){this.data;!e.isGameOver&&this.data.isGameOver&&(this.triggerAnimations(),this.countDown=1),e.isGameOver&&!this.data.isGameOver&&this.reset()},tick:function(e,t){this.data.isGameOver&&this.countDown>=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<this.gameOverEls.length;e++)this.gameOverEls[e].emit("gameover",null,!1);this.el.emit("textglowoff",null,!1),this.el.emit("bgcolorgameover",null,!1)}}),window.AFRAME){const t=["gameover"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){let r=0;if(AFRAME.registerComponent("gpu-preloader",{dependencies:["materials"],play:function(){setTimeout(()=>{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.length;t++)this.preloadTexture(e[t])},preloadKeyboard:function(){const e=document.getElementById("keyboard").components["super-keyboard"];this.preloadTexture(e.kbImg.getObject3D("mesh").material.map),this.preloadTexture(e.keyColorPlane.getObject3D("mesh").material.map)},preloadSlice:function(){const e=document.getElementById("searchPrevPage");this.preloadTexture(e.components.slice9.material.map)},preloadEnvMap:function(){const e=document.querySelector("#wallContainer [wall]");this.preloadTexture(e.components.material.material.uniforms.environment.value)},preloadFXs:function(){const e=document.querySelector("#rigContainer [mixin~=blueBeatFX]");this.preloadTexture(e.components.material.material.uniforms.src.value);const t=document.querySelector("#rigContainer [mixin~=mineFX]");this.preloadTexture(t.components.material.material.map)},preloadTexture:function(e){e&&e.image?e.image.complete?this.el.renderer.setTexture2D(e,r++%8):console.warn("[gpu-preloader] Error preloading, image not loaded",e):console.warn("[gpu-preloader] Error preloading texture",e)}}),window.AFRAME){const t=["gpu-preloader"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("gradientShader",{schema:{color1:{type:"color",is:"uniform"},color2:{type:"color",is:"uniform"}},vertexShader:n(16),fragmentShader:n(91)}),window.AFRAME){const t=[],n=["gradientShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nuniform vec3 color1;\nuniform vec3 color2;\n\nvoid main () {\n float mixDistance = distance(uvs, vec2(0.5, 0));\n float alphaDistance = min(1., (0.5 - distance(uvs, vec2(0.5))) * 2.5);\n gl_FragColor = vec4(mix(color1, color2, pow(mixDistance, 2.4)), alphaDistance);\n}\n"},function(e,t,n){const r=["triggerdown","gripdown","abuttondown","bbuttondown","xbuttondown","ybuttondown","trackpaddown"];if(AFRAME.registerComponent("hand-swapper",{schema:{enabled:{default:!1}},init:function(){this.swapHand=this.swapHand.bind(this),r.forEach(e=>{this.el.addEventListener(e,this.swapHand)})},swapHand:function(){this.data.enabled&&this.el.sceneEl.emit("activehandswap",null,!1)}}),window.AFRAME){const t=["hand-swapper"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("handStar",{schema:{colorPrimary:{type:"color",is:"uniform",default:i.a.initial.primary},colorSecondary:{type:"color",is:"uniform",default:i.a.initial.secondary},colorTertiary:{type:"color",is:"uniform",default:i.a.initial.tertiary},pulse:{type:"number",is:"uniform",default:0},transparent:{default:!0},side:{default:"back"},depthTest:{default:!1}},vertexShader:n(94),fragmentShader:n(95)}),window.AFRAME){const t=[],n=["handStar"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying float fresnel;\nuniform float pulse;\n\nvoid main() {\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n vec3 worldNormal = normalize(mat3(modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz) * normal);\n vec3 viewVector = normalize(vWorldPosition - cameraPosition);\n fresnel = 0.08 * pow(0.4 + dot(viewVector, worldNormal), 6.0 + pulse);\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying float fresnel;\nuniform float pulse;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\n\nvoid main() {\n vec3 colorize = vWorldPosition-cameraPosition;\n colorize = clamp(colorize + 0.5, vec3(0.0), vec3(1.0));\n vec3 col = mix(mix(colorPrimary, colorSecondary, colorize.x), colorTertiary, colorize.z);\n col += (fresnel * pulse) * 0.1;\n gl_FragColor = vec4 (col, clamp(fresnel, 0.0, 1.0));\n}\n"},function(e,t,n){if(AFRAME.registerComponent("haptics-wall",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.isHittingWall=!1,e.setAttribute("haptics__wall",{dur:50,force:.15}),this.checkIfHittingWall=this.checkIfHittingWall.bind(this),e.addEventListener("mouseenter",this.checkIfHittingWall),e.addEventListener("mouseleave",this.checkIfHittingWall),this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),50)},checkIfHittingWall:function(){const e=this.el.components.raycaster__game.intersectedEls;this.isHittingWall=!1;for(let t=0;t<e.length;t++)if(e[t].components.wall)return void(this.isHittingWall=!0)},tick:function(){this.data.enabled&&this.isHittingWall&&this.el.components.haptics__wall.pulse()}}),window.AFRAME){const t=["haptics-wall"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("haptics-weapons",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.isColliding=!1,this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),100),e.setAttribute("haptics__weapon",{dur:100,force:.075}),e.addEventListener("mouseenter",t=>{if(!t.detail||!t.detail.intersectedEl||!this.data.enabled)return;const n=t.detail.intersectedEl;n.classList.contains("blade")&&n!==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"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=!!AFRAME.utils.getUrlParameter("headfist");if(AFRAME.registerComponent("headfist",{schema:{hand:{type:"string"},isPlaying:{default:!1}},init:function(){console.log("[headfist] "+r),r&&(this.camera=document.getElementById("camera").object3D,this.originalParent=this.el.object3D.parent)},update:function(){const e=this.el;if(r&&this.camera)return this.data.isPlaying?(this.camera.add(e.object3D),e.object3D.rotation.set(-5,0,0),e.object3D.position.set("right"===this.data.hand?.175:-.175,.15,-.2),e.components["tracked-controls"].pause(),e.components["tracked-controls-webvr"]&&e.components["tracked-controls-webvr"].pause(),void(e.components["tracked-controls-webxr"]&&e.components["tracked-controls-webxr"].pause())):void(e.object3D.parent!==this.originalParent&&(console.log("[headfist] Detach."),this.originalParent.add(e.object3D),e.components["tracked-controls-webvr"]&&e.components["tracked-controls-webvr"].play(),e.components["tracked-controls-webxr"]&&e.components["tracked-controls-webxr"].play()))}}),window.AFRAME){const t=["headfist"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("history",{schema:{challengeId:{type:"string"},songName:{type:"string"},songSubName:{type:"string"}},update:function(){const e=this.data;history.pushState("",e.songName,updateQueryParam(window.location.href,"challenge",e.challengeId)),document.title="Super Saber - "+e.songName}}),window.AFRAME){const t=["history"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("intro-song",{schema:{isPlaying:{default:!0},isSearching:{default:!1}},init:function(){this.analyserEl=document.getElementById("audioAnalyser"),this.audio=document.getElementById("introSong"),this.timeout=null},update:function(e){const t=this.audio;this.el.sceneEl.isPlaying&&(!e.isSearching&&this.data.isSearching||(!e.isPlaying&&this.data.isPlaying&&(this.analyserEl.components.audioanalyser.resumeContext(),this.analyserEl.setAttribute("audioanalyser","src",t),this.fadeInAudio()),e.isPlaying&&!this.data.isPlaying&&t.pause()))},pause:function(){this.audio.pause()},play:function(){this.fadeInAudio()},fadeInAudio:function(){if(AFRAME.utils.getUrlParameter("mute"))return;const e=this.analyserEl.components.audioanalyser.context,t=this.analyserEl.components.audioanalyser.gainNode;t.gain.setValueAtTime(0,e.currentTime),this.audio.play(),t.gain.linearRampToValueAtTime(.5,e.currentTime+.5)}}),window.AFRAME){const t=["intro-song"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("keyboard-raycastable",{dependencies:["super-keyboard"],schema:{condition:{default:""}},play:function(){this.el.components["super-keyboard"].kbImg.setAttribute("bind-toggle__raycastable",this.data.condition)}}),window.AFRAME){const t=["keyboard-raycastable"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(103),i=n(104);n(106);const a=/(fuc)|(ass)|(nig)|(shit)|(retard)/gi;if(AFRAME.registerComponent("leaderboard",{schema:{apiKey:{type:"string"},authDomain:{type:"string"},databaseURL:{type:"string"},projectId:{type:"string"},storageBucket:{type:"string"},messagingSenderId:{type:"string"},challengeId:{default:""},difficulty:{default:""},beatmapCharacteristic:{default:""},inVR:{default:!1},gameMode:{type:"string"},menuSelectedChallengeId:{default:""},isVictory:{default:!1}},init:function(){this.qualifyingIndex=void 0,this.scores=[],this.eventDetail={scores:this.scores},this.addEventDetail={scoreData:void 0,index:void 0},this.username=localStorage.getItem("threewsusername")||"Super Zealot",this.el.addEventListener("leaderboardusername",e=>{this.username=e.detail.value,localStorage.setItem("threewsusername",this.username)}),this.el.addEventListener("leaderboardsubmit",this.addScore.bind(this))},update:function(e){!r.apps.length&&this.data.apiKey&&(r.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=r.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};i.includes(this.username.toLowerCase())||this.username.match(a)||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;t<this.scores.length;t++)if(e>this.scores[t].score)return this.qualifyingIndex=t,void this.el.sceneEl.emit("leaderboardqualify",t,!1)}}}),window.AFRAME){const t=["leaderboard"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";var r,i=(r=n(22))&&"object"==typeof r&&"default"in r?r.default:r;
+/**
+ * @license
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+i.registerVersion("firebase","7.19.0","app"),e.exports=i},function(e,t,n){e.exports=n(105)},function(e){e.exports=JSON.parse('["2 girls 1 cup","2g1c","4r5e","5h1t","5hit","5ht","666","@$$","a s s","a s shole","a55","a55hole","a_s_s","abbo","abeed","abuse","acrotomophilia","addicts","aeolus","africoon","ahole","alabama hot pocket","alaskan pipeline","alligator bait","alligatorbait","amcik","anal","analannie","analprobe","analsex","andskota","anilingus","anus","apeshit","ar5e","arabush","arabushs","areola","areole","argie","arian","armo","armos","aroused","arrse","arschloch","arse","arsehole","aryan","ash0le","ash0les","asholes","ass monkey","ass","ass-fucker","ass-hat","ass-pirate","assbag","assbagger","assbandit","assbang","assbanged","assbanger","assbangs","assbite","assblaster","assclown","asscock","asscowboy","asscracker","asses","assface","assfuck","assfucker","assfukka","assgoblin","assh0le","assh0lez","asshat","asshead","assho1e","asshole","assholes","assholz","asshopper","asshore","assjacker","assjockey","asskiss","asskisser","assklown","asslick","asslicker","asslover","assman","assmaster","assmonkey","assmunch","assmuncher","assnigger","asspacker","asspirate","asspuppies","assrammer","assranger","assshit","assshole","asssucker","asswad","asswhole","asswhore","asswipe","asswipes","auto erotic","autoerotic","ayir","azazel","azz","azzhole","b a s t a r d","b i t c h","b o o b","b!+ch","b!tch","b!tchin","b*tch","b00b","b00bies","b00biez","b00bs","b00bz","b17ch","b1tch","b7ch","babeland","babes","baby batter","baby juice","backdoor","backdoorman","badfuck","bagging","ball gag","ball gravy","ball kicking","ball licking","ball sack","ball sucking","ballbag","balllicker","ballsack","bampot","bangbro","bangbros","banger","banging","bareback","barely legal","barelylegal","barenaked","barf","barface","barfface","bassterd","bassterds","bastard","bastardo","bastards","bastardz","basterds","basterdz","bastinado","bawdy","bazongas","bazooms","bbw","bdsm","beaner","beaners","beaney","beaneys","beardedclam","beastality","beastial","beastiality","beastility","beatch","beatoff","beatyourmeat","beaver cleaver","beaver lips","beaver","beeyotch","bellend","beotch","bestial","bestiality","bi curious","bi+ch","bi7ch","biatch","bicurious","big black","big breasts","big knockers","big tits","bigass","bigbastard","bigbreasts","bigbutt","bigtits","bimbo","bimbos","bint","birdlock","bitch","bitchass","bitched","bitcher","bitchers","bitches","bitchez","bitchin","bitching","bitchslap","bitchtit","bitchy","biteme","black cock","blackcock","blackman","blackout","blacks","blonde action","blonde on blonde action","blonde on blonde","bloody","blow j","blow job","blow your l","blow your load","blowjob","blowjobs","blue waffle","bluegum","bluegums","blumpkin","bo ob","bo obs","boang","boche","boches","bodily","boffing","bogan","bohunk","boink","boiolas","bollick","bollock","bollocks","bollok","bollox","bombers","bombing","bomd","bondage","boned","boner","boners","bong","boob","boobies","boobs","booby","boobz","boody","booger","bookie","boong","boonga","boongas","boongs","boonie","boonies","booobs","boooobs","booooobs","booooooobs","bootee","bootlip","bootlips","booty call","booty","bootycall","boozer","boozy","bosch","bosche","bosches","boschs","bosomy","bounty bar","bounty bars","bountybar","brea5t","breastjob","breastlover","breastman","brothel","brown showers","brunette action","btch","buceta","buddhahead","buddhaheads","buffies","bugger","buggered","buggery","bukkake","bule","bules","bullcrap","bulldike","bulldyke","bullet vibe","bullshit","bullshits","bullshitted","bullturds","bumblefuck","bumfuck","bung hole","bung","bunga","bungas","bunghole","bunny fucker","burr head","burr heads","burrhead","burrheads","butchbabes","butchdike","butchdyke","butt plug","butt-pirate","buttbang","buttcheeks","buttface","buttfuck","buttfucker","buttfuckers","butthead","butthole","buttman","buttmuch","buttmunch","buttmuncher","buttons","buttpirate","buttplug","buttstain","buttwipe","byatch","c u n t","c-0-c-k","c-o-c-k","c-u-n-t","c.0.c.k","c.o.c.k.","c.u.n.t","c0ck","c0cks","c0cksucker","c0k","cabron","caca","cacker","cahone","camel jockey","camel jockeys","camel toe","cameljockey","cameltoe","camgirl","camslut","camwhore","carpet muncher","carpetmuncher","carruth","cawk","cawks","cazzo","cervix","chav","cheese eating surrender monkey","cheese eating surrender monkies","cheeseeating surrender monkey","cheeseeating surrender monkies","cheesehead","cheeseheads","cherrypopper","chickslick","china swede","china swedes","chinaman","chinamen","chinaswede","chinaswedes","chinc","chincs","ching chong","ching chongs","chinga","chingchong","chingchongs","chink","chinks","chinky","choad","chocolate rosebuds","chode","chodes","chonkies","chonky","chonkys","chraa","christ killer","christ killers","chug","chugs","chuj","chunger","chungers","chunkies","chunkys","chute","cipa","circlejerk","cl1t","clamdigger","clamdiver","clamps","clansman","clansmen","clanswoman","clanswomen","cleveland steamer","climax","clit","clitface","clitfuck","clitoris","clitorus","clits","clitty","clogwog","clover clamps","clusterfuck","cnts","cntz","cnut","cocain","cocaine","cock","cock-head","cock-sucker","cockbite","cockblock","cockblocker","cockburger","cockcowboy","cockface","cockfight","cockfucker","cockhead","cockholster","cockknob","cockknocker","cocklicker","cocklover","cockmonkey","cockmunch","cockmuncher","cocknob","cocknose","cocknugget","cockqueen","cockrider","cocks","cockshit","cocksman","cocksmith","cocksmoker","cocksucer","cocksuck","cocksucked","cocksucker","cocksucking","cocksucks","cocksuka","cocksukka","cocktease","cocky","cohee","coital","coitus","cok","cokmuncher","coksucka","commie","condom","coochie","coochy","coolie","coolies","cooly","coon ass","coon asses","coon","coonass","coonasses","coondog","coons","cooter","coprolagnia","coprophilia","copulate","corksucker","cornhole","cowgirl","cox","cra5h","crabs","crackcocain","cracker","crackpipe","crackwhore","crap","crapola","crapper","crappy","crash","creampie","crotch","crotchjockey","crotchmonkey","crotchrot","cum","cumbubble","cumdumpster","cumfest","cumjockey","cumm","cummer","cummin","cumming","cumquat","cumqueen","cums","cumshot","cumshots","cumslut","cumstain","cumtart","cunilingus","cunillingus","cunn","cunnie","cunnilingus","cunntt","cunny","cunt","cunteyed","cuntface","cuntfuck","cuntfucker","cunthole","cunthunter","cuntlick","cuntlicker","cuntlicking","cuntrag","cunts","cuntslut","cuntsucker","cuntz","curry muncher","curry munchers","currymuncher","currymunchers","cushi","cushis","cyalis","cyberfuc","cyberfuck","cyberfucked","cyberfucker","cyberfuckers","cyberfucking","cybersex","cyberslimer","d0ng","d0uch3","d0uche","d1ck","d1ld0","d1ldo","d4mn","dago","dagos","dahmer","damm","dammit","damn","damnation","damned","damnit","darkey","darkeys","darkie","darkies","darky","date rape","daterape","datnigga","dawgie style","dawgie-style","daygo","deapthroat","deep throat","deep throating","deepaction","deepthroat","deepthroating","defecate","deggo","dego","degos","demon","dendrophilia","destroyyourpussy","deth","diaper head","diaper heads","diaperhead","diaperheads","dick pic","dick","dick-ish","dickbag","dickbeaters","dickbrain","dickdipper","dickface","dickflipper","dickforbrains","dickfuck","dickhead","dickheads","dickhole","dickish","dickjuice","dickless","dicklick","dicklicker","dickman","dickmilk","dickpic","dickripper","dicks","dicksipper","dickslap","dickwad","dickweasel","dickweed","dickwhipper","dickwod","dickzipper","diddle","dike","dild0","dild0s","dildo","dildos","dilf","diligaf","dilld0","dilld0s","dillweed","dimwit","dingle","dingleberries","dingleberry","dink","dinks","dipship","dipshit","dipstick","dirsa","dirty pillows","dirty sanchez","dix","dixiedike","dixiedyke","dlck","dog style","dog-fucker","doggie style","doggie","doggie-style","doggiestyle","doggin","dogging","doggy style","doggy-style","doggystyle","dolcett","domination","dominatricks","dominatrics","dominatrix","dommes","dong","donkey punch","donkeypunch","donkeyribber","doochbag","doodoo","doofus","dookie","doosh","dot head","dot heads","dothead","dotheads","double dong","double penetration","doubledong","doublepenetration","douch3","douche bag","douche","douche-fag","douchebag","douchebags","douchewaffle","douchey","dp action","dp","dpaction","dragqueen","dragqween","dripdick","drug","dry hump","dryhump","duche","dudette","dumass","dumb ass","dumbass","dumbasses","dumbbitch","dumbfuck","dumbshit","dummy","dumshit","dune coon","dune coons","dupa","dvda","dyefly","dyke","dykes","dziwka","earotics","easyslut","eat my ass","eat my","eatballs","eatme","eatmyass","eatpussy","ecchi","ejackulate","ejaculate","ejaculated","ejaculates","ejaculating","ejaculatings","ejaculation","ejaculations","ejakulate","ekrem","ekto","enculer","enema","enlargement","erect","erection","ero","erotic","erotism","escort","esqua","essohbee","ethical slut","evl","excrement","exkwew","explosion","extacy","extasy","f u c k e r","f u c k e","f u c k","f u k","f*ck","f-u-c-k","f.u.c.k","f4nny","f_u_c_k","facefucker","fack","faeces","faen","fag","fag1t","fagbag","faget","fagfucker","fagg","fagg1t","fagged","fagging","faggit","faggitt","faggot","faggotcock","faggs","fagit","fagot","fagots","fags","fagt","fagtard","fagz","faig","faigs","faigt","fanculo","fannybandit","fannyflaps","fannyfucker","fanyy","fartknocker","farty","fastfuck","fatah","fatass","fatfuck","fatfucker","fatso","fck","fckcum","fckd","fcuk","fcuker","fcuking","fecal","feces","feck","fecker","feg","felatio","felch","felcher","felching","fellate","fellatio","feltch","feltcher","feltching","female squirting","femalesquirtin","femalesquirting","femdom","fetish","ficken","figging","fingerbang","fingerfood","fingerfuck","fingerfucked","fingerfucker","fingerfuckers","fingerfucking","fingerfucks","fingering","fisted","fister","fistfuck","fistfucked","fistfucker","fistfuckers","fistfucking","fistfuckings","fistfucks","fisting","fisty","fitt","flamer","flange","flasher","flikker","flipping the bird","floo","floozy","flydie","flydye","foad","fok","fondle","foobar","fook","fooker","foot fetish","footaction","footfetish","footfuck","footfucker","footjob","footlicker","footstar","foreskin","forni","fornicate","fotze","foursome","fourtwenty","freakfuck","freakyfucker","freefuck","freex","frigg","frigga","frotting","fubar","fucck","fuck buttons","fuck","fuck-tard","fucka","fuckable","fuckass","fuckbag","fuckbook","fuckboy","fuckbrain","fuckbuddy","fuckbutt","fuckd","fucked","fuckedup","fucker","fuckers","fuckersucker","fuckface","fuckfest","fuckfreak","fuckfriend","fuckhead","fuckheads","fuckher","fuckhole","fuckin","fuckina","fucking","fuckingbitch","fuckings","fuckingshitmotherfucker","fuckinnuts","fuckinright","fuckit","fuckknob","fuckme","fuckmehard","fuckmonkey","fuckn","fucknugget","fucknut","fucknuts","fucknutt","fucknutz","fuckoff","fuckpig","fuckr","fucks","fuckstick","fucktard","fucktards","fuckup","fuckwad","fuckwhit","fuckwhore","fuckwit","fuckwitt","fuckyou","fudge packer","fudgepacker","fugly","fuk","fukah","fuken","fuker","fukin","fuking","fukk","fukkah","fukken","fukker","fukkin","fuks","fuktard","fuktards","fukwhit","fukwit","funeral","funfuck","fungus","futanari","futkretzn","fuuck","fux","fux0r","fvck","fvk","fxck","g-spot","g00k","gae","gai","gang bang","gangbang","gangbanged","gangbanger","gangbangs","gangsta","ganja","gator bait","gatorbait","gay sex","gayboy","gaygirl","gaylord","gaymuthafuckinwhore","gays","gaysex","gayz","geezer","geni","genital","genitals","getiton","gey","gfy","ghay","ghey","giant cock","gigolo","ginzo","ginzos","gipp","gippo","gippos","gipps","girl on top","girl on","girls gone wild","givehead","glans","glazeddonut","goatcx","goatse","gob","god dammit","god damn","god damnit","god-dam","god-damned","godam","godammit","godamn","godamnit","goddam","goddamit","goddamm","goddammit","goddamn","goddamned","goddamnes","goddamnit","goddamnmuthafucker","gokkun","golden shower","goldenshower","golliwog","golliwogs","gonad","gonads","gonorrehea","gonzagas","goo girl","gooch","goodpoop","gook eye","gook eyes","gook","gookeye","gookeyes","gookies","gooks","gooky","gora","goras","goregasm","gotohell","goy","goyim","greaseball","greaseballs","gringo","gringos","groe","groid","groids","grope","gross","grostulation","group sex","gspot","gstring","gtfo","gub","gubba","gubbas","gubs","guido","guiena","guineas","guizi","gummer","guro","gwailo","gwailos","gweilo","gweilos","gyopo","gyopos","gyp","gyped","gypo","gypos","gypp","gypped","gyppie","gyppies","gyppo","gyppos","gyppy","gyppys","gypsys","h e l l","h o m","h00r","h0ar","h0m0","h0mo","h0r","h0re","h4x0r","hadji","hadjis","hairyback","hairybacks","haji","hajis","hajji","hajjis","half breed","half caste","halfbreed","halfcaste","hamas","hand job","handjob","haole","haoles","hapa","hard core","hardcore","hardcoresex","hardon","harem","he11","headfuck","hebe","hebes","heeb","heebs","hell","hells","helvete","henhouse","hentai","heroin","herp","herpes","herpy","heshe","hijacker","hijacking","hillbillies","hillbilly","hindoo","hiscock","hitler","hitlerism","hitlerist","ho","hobag","hodgie","hoe","hoer","hoes","holestuffer","hom0","homey","homicide","homo","homobangers","homodumbshit","homoey","honger","honkers","honkey","honkeys","honkie","honkies","honky","hooch","hooker","hookers","hoor","hoore","hootch","hooter","hooters","hore","hori","horis","hork","horndawg","horndog","horney","horniest","horny","horseshit","hosejob","hoser","hot carl","hot chick","hotcarl","hotdamn","hotpussy","hotsex","hottotrot","how to kill","how to murder","huevon","huge fat","hugefat","hui","hummer","humped","humper","humpher","humphim","humpin","humping","husky","hussy","hustler","hymen","hymie","hymies","iblowu","ike","ikes","ikey","ikeymo","ikeymos","ikwe","illegal","illegals","inbred","incest","indon","indons","injun","injuns","insest","intercourse","interracial","intheass","inthebuff","israels","j3rk0ff","jack off","jack-off","jackass","jackhole","jackoff","jackshit","jacktheripper","jail bait","jailbait","jap","japcrap","japie","japies","japs","jebus","jelly donut","jerk off","jerk","jerk-off","jerk0ff","jerked","jerkoff","jerries","jerry","jesuschrist","jewed","jewess","jig","jiga","jigaboo","jigaboos","jigarooni","jigaroonis","jigg","jigga","jiggabo","jiggaboo","jiggabos","jiggas","jigger","jiggerboo","jiggers","jiggs","jiggy","jigs","jihad","jijjiboo","jijjiboos","jimfish","jisim","jism","jiss","jiz","jizim","jizin","jizjuice","jizm","jizn","jizz","jizzd","jizzed","jizzim","jizzin","jizzn","jizzum","jugg","juggs","jugs","jungle bunnies","jungle bunny","junglebunny","junkie","junky","kacap","kacapas","kacaps","kaffer","kaffir","kaffre","kafir","kanake","kanker","katsap","katsaps","kawk","khokhol","khokhols","kicking","kigger","kike","kikes","killer","kills","kimchis","kinbaku","kink","kinkster","kinky","kissass","kkk","klan","klansman","klansmen","klanswoman","klanswomen","klootzak","knobbing","knobead","knobed","knobend","knobhead","knobjocky","knobjokey","knobz","knockers","knulle","kock","kondum","kondums","kooch","kooches","koon","kootch","krap","krappy","kraut","krauts","kuffar","kuk","kuksuger","kum","kumbubble","kumbullbe","kumer","kummer","kumming","kumquat","kums","kunilingus","kunnilingus","kunt","kunts","kuntz","kurac","kurwa","kushi","kushis","kusi","kwa","kwai lo","kwai los","ky","kyke","kykes","kyopo","kyopos","kyrpa","l3i+ch","l3i\\\\+ch","l3itch","labia","lapdance","lds","leather restraint","leather straight jacket","leather straight","leatherrestraint","lebo","lebos","lech","lemon party","lemonparty","leper","lesbain","lesbayn","lesbian","lesbin","lesbo","lez","lezbe","lezbefriends","lezbian","lezbians","lezbo","lezbos","lezz","lezzian","lezzie","lezzies","lezzo","lezzy","libido","licker","licking","lickme","lilniglet","limey","limpdick","limy","lingerie","lipshits","lipshitz","livesex","lmfao","loadedgun","loin","loins","lolita","lovebone","lovegoo","lovegun","lovejuice","lovemaking","lovemuscle","lovepistol","loverocket","lowlife","lsd","lubejob","lubra","lucifer","luckycammeltoe","lugan","lugans","lust","lusting","lusty","lynch","m-fucking","m0f0","m0fo","m45terbate","ma5terb8","ma5terbate","mabuno","mabunos","macaca","macacas","magicwand","mahbuno","mahbunos","make me come","makemecome","makemecum","male squirting","mamhoon","mams","manhater","manpaste","maricon","maricón","marijuana","masochist","masokist","massa","massterbait","masstrbait","masstrbate","mastabate","mastabater","master-bate","masterb8","masterbaiter","masterbat","masterbat3","masterbate","masterbates","masterbating","masterbation","masterbations","masterblaster","mastrabator","masturbat","masturbate","masturbating","masturbation","mattressprincess","mau mau","mau maus","maumau","maumaus","mcfagget","meatbeatter","meatrack","menage a trois","menage","menses","menstruate","menstruation","merd","meth","mgger","mggor","mibun","mick","mickeyfinn","mideast","mierda","milf","minge","missionary position","missionary","mo-fo","mockey","mockie","mocky","mof0","mofo","moky","molest","molestation","molester","molestor","moneyshot","monkleigh","moolie","moon cricket","moon crickets","mooncricket","mooncrickets","mormon","moron","moskal","moskals","moslem","mosshead","motha fucker","motha fuker","motha fukkah","motha fukker","mothafuck","mothafucka","mothafuckas","mothafuckaz","mothafucked","mothafucker","mothafuckers","mothafuckin","mothafucking","mothafuckings","mothafucks","mother fucker","mother fukah","mother fuker","mother fukkah","mother fukker","mother-fucker","motherfuck","motherfucka","motherfucked","motherfucker","motherfuckers","motherfuckin","motherfucking","motherfuckings","motherfuckka","motherfucks","motherfvcker","motherlovebone","mothrfucker","mouliewop","mound of venus","moundofvenus","mr hands","mrhands","mtherfucker","mthrfuck","mthrfucker","mthrfucking","mtrfck","mtrfuck","mtrfucker","muff diver","muff","muffdive","muffdiver","muffdiving","muffindiver","mufflikcer","muie","mulatto","mulkku","muncher","munging","munt","murder","murderer","muschi","mutha fucker","mutha fukah","mutha fuker","mutha fukkah","mutha fukker","mutha","muthafecker","muthafuckaz","muthafucker","muthafuckker","muther","mutherfucker","mutherfucking","muthrfucking","mzungu","mzungus","n1gga","n1gger","n1gr","nad","nads","naked","nambla","nastt","nasty","nastybitch","nastyho","nastyslut","nastywhore","nawashi","nazi","nazis","nazism","necro","negres","negress","negro","negroes","negroid","negros","neonazi","nepesaurio","nig nog","nig","niga","nigar","nigars","nigas","niger","nigerian","nigerians","nigers","nigette","nigettes","nigg","nigg3r","nigg4h","nigga","niggah","niggahs","niggar","niggaracci","niggard","niggarded","niggarding","niggardliness","niggardlinesss","niggardly","niggards","niggars","niggas","niggaz","nigger","niggerhead","niggerhole","niggers","niggle","niggled","niggles","niggling","nigglings","niggor","niggress","niggresses","nigguh","nigguhs","niggur","niggurs","niglet","nignog","nigor","nigors","nigr","nigra","nigras","nigre","nigres","nigress","nigs","nigur","niiger","niigr","nimphomania","nimrod","ninny","nip","nipple","nipplering","nipples","nips","nittit","nlgger","nlggor","nob jokey","nob","nobhead","nobjocky","nobjokey","nofuckingway","nog","nookey","nookie","nooky","noonan","nooner","nsfw images","nsfw","nude","nudger","nudie","nudies","nudity","numbnuts","nut sack","nutfucker","nutsack","nymph","nympho","nymphomania","o c k","octopussy","omorashi","one cup two girls","one guy one jar","one guy","one jar","ontherag","orafis","oral","orally","orga","orgasim","orgasim;","orgasims","orgasm","orgasmic","orgasms","orgasum","orgies","orgy","oriface","orifice","orifiss","orospu","osama","ovum","ovums","p e n i s","p i s","p u s s y","p.u.s.s.y.","p0rn","packi","packie","packy","paddy","paedophile","paki","pakie","pakis","paky","palesimian","pancake face","pancake faces","panooch","pansies","pansy","panti","pantie","panties","panty","paska","pastie","pasty","payo","pcp","pearlnecklace","peck","pecker","peckerhead","peckerwood","pedo","pedobear","pedophile","pedophilia","pedophiliac","pee","peeenus","peeenusss","peehole","peenus","peepee","peepshow","peepshpw","pegging","peinus","pen1s","penas","pendejo","pendy","penetrate","penetration","peni5","penial","penile","penis","penis-breath","penises","penisfucker","penisland","penislick","penislicker","penispuffer","penthouse","penus","penuus","perse","perv","perversion","peyote","phalli","phallic","phone sex","phonesex","phuc","phuck","phuk","phuked","phuker","phuking","phukked","phukker","phukking","phuks","phungky","phuq","pi55","picaninny","piccaninny","picka","pickaninnies","pickaninny","piece of shit","pieceofshit","piefke","piefkes","pierdol","pigfucker","piker","pikey","piky","pillowbiter","pillu","pimmel","pimp","pimped","pimper","pimpis","pimpjuic","pimpjuice","pimpsimp","pindick","pinko","pis","pises","pisin","pising","pisof","piss pig","piss","piss-off","pissed","pisser","pissers","pisses","pissflaps","pisshead","pissin","pissing","pissoff","pisspig","pistol","pizda","playboy","playgirl","pleasure chest","pleasurechest","pms","pocha","pochas","pocho","pochos","pocketpool","pohm","pohms","polac","polack","polacks","polak","pole smoker","polesmoker","pollock","pollocks","pommie grant","pommie grants","pommie","pommies","pommy","ponyplay","poo","poof","poon","poonani","poonany","poontang","poontsee","poop chute","poop","poopchute","pooper","pooperscooper","pooping","poorwhitetrash","popimp","porch monkey","porch monkies","porchmonkey","porn","pornflick","pornking","porno","pornography","pornos","pornprincess","pound town","poundtown","pplicker","pr0n","pr1c","pr1ck","pr1k","prairie nigger","prairie niggers","premature","preteen","pric","prick","prickhead","pricks","prig","prince albert piercing","pron","propaganda","prostitute","pthc","pu55i","pu55y","pube","pubes","pubic","pubiclice","pubis","pud","pudboy","pudd","puddboy","puke","pula","pule","punanny","punany","punkass","punky","punta","puntang","purinapricness","pusies","puss","pusse","pussee","pussi","pussie","pussies","pussy","pussycat","pussydestroyer","pussyeater","pussyfucker","pussylicker","pussylicking","pussylips","pussylover","pussypounder","pussys","pusy","puta","puto","puuke","puuker","qahbeh","quashie","queaf","queef","queero","queers","queerz","quickie","quicky","quiff","quim","qweers","qweerz","qweir","r-tard","r-tards","r5e","ra8s","racial","radicals","raghead","ragheads","raging boner","raging","ragingboner","randy","rape","raped","raper","raping","rapist","raunch","rautenberg","rearend","rearentry","recktum","rectal","rectum","rectus","redleg","redlegs","redlight","redneck","rednecks","redskin","redskins","reefer","reestie","reetard","refugee","reich","renob","rentafuck","rere","retard","retarded","retards","retardz","reverse cowgirl","reversecowgirl","rigger","rimjaw","rimjob","rimming","ritard","rosebuds","rosy palm and her 5 sisters","rosy palm","rosypalm","rosypalmandher5sisters","rosypalmandherefivesisters","round eyes","roundeye","rtard","rtards","rump","rumprammer","ruski","russki","russkie","rusty trombone","rustytrombone","s h i t","s hit","s&m","s-h-1-t","s-h-i-t","s-o-b","s.h.i.t.","s.o.b.","s0b","s_h_i_t","sac","sack","sadis","sadism","sadist","sadom","sambo","sambos","samckdaddy","sanchez","sand nigger","sand niggers","sandm","sandnigger","santorum","scag","scallywag","scank","scantily","scat","schaffer","scheiss","schizo","schlampe","schlong","schmuck","schvartse","schvartsen","schwartze","schwartzen","scissoring","screwed","screwing","screwyou","scroat","scrog","scrot","scrote","scrotum","scrud","seduce","semen","seppo","seppos","septics","sex","sexed","sexfarm","sexhound","sexhouse","sexi","sexing","sexkitten","sexo","sexpot","sexslave","sextogo","sextoy","sextoys","sexual","sexually","sexwhore","sexx","sexxi","sexxx","sexxxi","sexxxy","sexxy","sexy","sexymoma","sexyslim","sh!+","sh!t","sh1t","sh1ter","sh1ts","sh1tter","sh1tz","shag","shagger","shaggin","shagging","shamedame","sharmuta","sharmute","shat","shav","shaved beaver","shaved pussy","shaved","shavedbeaver","shavedpussy","shawtypimp","sheeney","shemale","shhit","shi+","shibari","shinola","shipal","shit","shitass","shitbag","shitbagger","shitblimp","shitbrain","shitbreath","shitcan","shitcunt","shitdick","shite","shiteater","shited","shitey","shitface","shitfaced","shitfit","shitforbrains","shitfuck","shitfucker","shitfull","shithapens","shithappens","shithead","shithole","shithouse","shiting","shitings","shitlist","shitola","shitoutofluck","shits","shitspitter","shitstain","shitt","shitted","shitter","shitters","shittiest","shitting","shittings","shitty","shity","shitz","shiz","shiznit","shortfuck","shota","shrimping","shylock","shylocks","shyt","shyte","shytty","shyty","sissy","sixsixsix","sixtynine","sixtyniner","skag","skanck","skank","skankbitch","skankee","skankey","skankfuck","skanks","skankwhore","skanky","skankybitch","skankywhore","skeet","skinflute","skribz","skullfuck","skum","skumbag","skurwysyn","skwa","skwe","slag","slant","slanteye","slanty","slapper","slaughter","slave","slavedriver","sleaze","sleazy","sleezebag","sleezeball","slideitin","slimeball","slimebucket","slopehead","slopeheads","sloper","slopers","slopes","slopey","slopeys","slopies","slopy","slut","slutbag","slutdumper","slutkiss","sluts","slutt","slutting","slutty","slutwear","slutwhore","slutz","smack","smackthemonkey","smeg","smegma","smoker","smut","smutty","snatch","snatchpatch","snigger","sniggered","sniggering","sniggers","sniper","snowback","snowballing","snownigger","snuff","sob","socksucker","sodom","sodomise","sodomite","sodomize","sodomy","son of a bitch","son-of-a-bitch","sonofabitch","sonofbitch","sooties","sooty","souse","soused","spac","spade","spades","spaghettibender","spaghettinigger","spank","spankthemonkey","spearchucker","spearchuckers","sperm","spermacide","spermbag","spermhearder","spermherder","sphencter","spic","spick","spicks","spics","spierdalaj","spig","spigotty","spik","spiks","spitter","splittail","splooge moose","splooge","spludge","spooge","spread legs","spreadeagle","spunk","spunky","sqeh","squa","squarehead","squareheads","squaw","squinty","squirting","stagg","steamy","stfu","stiffy","stoned","stoner","strap on","strapon","strappado","stringer","strip club","stripclub","stroke","stroking","stuinties","stupid","stupidfuck","stupidfucker","style doggy","suck","suckdick","sucked","sucker","sucking","suckme","suckmyass","suckmydick","suckmytit","suckoff","sucks","suicide girl","suicide girls","suicide","suicidegirl","suicidegirls","suka","sultry women","sultry","sultrywoman","sultrywomen","sumofabiatch","swallow","swallower","swalow","swamp guinea","swamp guineas","swastika","swinger","syphilis","t i t","t i ts","t1t","t1tt1e5","t1tties","taboo","tacohead","tacoheads","taff","tainted love","tainted","take off your","tantra","tar babies","tar baby","tarbaby","tard","taste my","tastemy","tawdry","tea bagging","teabagging","teat","teets","teez","terd","terror","terrorist","teste","testee","testes","testical","testicle","testicles","testis","thicklip","thicklips","thirdeye","thirdleg","threesome","threeway","throat","throating","thrust","thug","thundercunt","ti","tied up","tight white","timber nigger","timber niggers","timbernigger","tinkle","tit","titbitnipply","titfuck","titfucker","titfuckin","titi","titjob","titlicker","titlover","tits","titt","tittie","tittie5","tittiefucker","titties","tittis","titty","tittyfuck","tittyfucker","tittys","tittywank","titwank","tity","to murder","toke","tongethruster","tongue in a","tongueina","tonguethrust","tonguetramp","toots","topless","tortur","torture","tosser","towel head","towel heads","towelhead","trailertrash","tramp","trannie","tranny","transsexual","transvestite","trashy","tribadism","triplex","trisexual","trois","trojan","trombone","trots","tub girl","tubgirl","tuckahoe","tunneloflove","turd","turnon","tush","tushy","tw4t","twat","twathead","twatlips","twats","twatty","twatwaffle","twink","twinkie","two girls one cup","twobitwhore","twunt","twunter","udge packer","ukrop","uncle tom","unclefucker","undies","undressing","unfuckable","unwed","upskirt","uptheass","upthebutt","urethra play","urethra","urethraplay","urinal","urinary","urinate","urine","urophilia","usama","ussys","uzi","v a g i n a","v14gra","v1gra","v4gra","va-j-j","va1jina","vag","vag1na","vagiina","vagina","vaginal","vaj1na","vajina","valium","venus mound","vgra","viagra","vibe","vibr","vibrater","vibrator","vietcong","violet wand","virgin","virginbreaker","vittu","vixen","vjayjay","vodka","vomit","vorarephilia","voyeur","vulgar","vullva","vulva","w00se","w0p","wab","wad","wang","wank","wanker","wanking","wanky","waysted","wazoo","wedgie","weed","weenie","weewee","weiner","weirdo","welcher","wench","wet dream","wetb","wetback","wetbacks","wetdream","wetspot","wh00r","wh0re","wh0reface","whacker","whash","whigger","whiggers","whiskeydick","whiskydick","whit","white power","white trash","whitenigger","whitepower","whites","whitetrash","whitey","whiteys","whities","whiz","whoar","whop","whoralicious","whore","whorealicious","whorebag","whored","whoreface","whorefucker","whorehopper","whorehouse","whores","whoring","wichser","wigga","wiggas","wigger","wiggers","willie","willies","williewanker","willy","wn","wog","wogs","woody","wop","wrapping men","wrinkled starfish","wtf","wuss","wuzzie","x-rated","xkwe","xrated","xtc","xx","xxx","xxxxxx","yank","yaoi","yarpie","yarpies","yeasty","yed","yellow showers","yellowman","yellowshowers","yid","yids","yiffy","yobbo","yourboobs","yourpenis","yourtits","zabourah","zigabo","zigabos","zipperhead","zipperheads","zoophile","zoophilia","🖕"]')},function(e,t,n){"use strict";n.r(t);n(107)},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(11),a=(r=n(22))&&"object"==typeof r&&"default"in r?r.default:r,o=n(24),s=n(17),c=n(108),l=n(23),u=new o.Logger("@firebase/firestore");function h(){return u.logLevel}function d(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(u.logLevel<=o.LogLevel.DEBUG){var r=t.map(m);u.debug.apply(u,i.__spreadArrays(["Firestore (7.19.0): "+e],r))}}function p(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(u.logLevel<=o.LogLevel.ERROR){var r=t.map(m);u.error.apply(u,i.__spreadArrays(["Firestore (7.19.0): "+e],r))}}function f(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(u.logLevel<=o.LogLevel.WARN){var r=t.map(m);u.warn.apply(u,i.__spreadArrays(["Firestore (7.19.0): "+e],r))}}function m(e){if("string"==typeof e)return e;try{return t=e,JSON.stringify(t)}catch(t){return e}
+/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var t}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function g(e){void 0===e&&(e="Unexpected state");var t="FIRESTORE (7.19.0) INTERNAL ASSERTION FAILED: "+e;throw p(t),new Error(t)}function y(e,t){e||g()}function v(e,t){return e}
+/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function b(e){var t="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(n);else for(var r=0;r<e;r++)n[r]=Math.floor(256*Math.random());return n}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var w=function(){function e(){}return e.t=function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=Math.floor(256/e.length)*e.length,n="";n.length<20;)for(var r=b(40),i=0;i<r.length;++i)n.length<20&&r[i]<t&&(n+=e.charAt(r[i]%e.length));return n},e}();function A(e,t){return e<t?-1:e>t?1:0}function E(e,t,n){return e.length===t.length&&e.every((function(e,r){return n(e,t[r])}))}function x(e){return e+"\0"}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var _=function(e,t,n,r,i){this.s=e,this.persistenceKey=t,this.host=n,this.ssl=r,this.forceLongPolling=i},S=function(){function e(e,t){this.projectId=e,this.database=t||"(default)"}return Object.defineProperty(e.prototype,"i",{get:function(){return"(default)"===this.database},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.projectId===this.projectId&&t.database===this.database},e.prototype.o=function(e){return A(this.projectId,e.projectId)||A(this.database,e.database)},e}();
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function M(e){var t=0;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function T(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function R(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var k=function(){function e(e,t){this.h=e,this.u=t,this.l={}}return e.prototype.get=function(e){var t=this.h(e),n=this.l[t];if(void 0!==n)for(var r=0,i=n;r<i.length;r++){var a=i[r],o=a[0],s=a[1];if(this.u(o,e))return s}},e.prototype.has=function(e){return void 0!==this.get(e)},e.prototype.set=function(e,t){var n=this.h(e),r=this.l[n];if(void 0!==r){for(var i=0;i<r.length;i++)if(this.u(r[i][0],e))return void(r[i]=[e,t]);r.push([e,t])}else this.l[n]=[[e,t]]},e.prototype.delete=function(e){var t=this.h(e),n=this.l[t];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(this.u(n[r][0],e))return 1===n.length?delete this.l[t]:n.splice(r,1),!0;return!1},e.prototype.forEach=function(e){T(this.l,(function(t,n){for(var r=0,i=n;r<i.length;r++){var a=i[r],o=a[0],s=a[1];e(o,s)}}))},e.prototype._=function(){return R(this.l)},e}(),C={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},O=function(e){function t(t,n){var r=this;return(r=e.call(this,n)||this).code=t,r.message=n,r.name="FirebaseError",r.toString=function(){return r.name+": [code="+r.code+"]: "+r.message},r}return i.__extends(t,e),t}(Error),P=function(){function e(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new O(C.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new O(C.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800)throw new O(C.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new O(C.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}return e.now=function(){return e.fromMillis(Date.now())},e.fromDate=function(t){return e.fromMillis(t.getTime())},e.fromMillis=function(t){var n=Math.floor(t/1e3);return new e(n,1e6*(t-1e3*n))},e.prototype.toDate=function(){return new Date(this.toMillis())},e.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},e.prototype.T=function(e){return this.seconds===e.seconds?A(this.nanoseconds,e.nanoseconds):A(this.seconds,e.seconds)},e.prototype.isEqual=function(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds},e.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},e.prototype.toJSON=function(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}},e.prototype.valueOf=function(){var e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")},e}(),I=function(){function e(e){this.timestamp=e}return e.m=function(t){return new e(t)},e.min=function(){return new e(new P(0,0))},e.prototype.o=function(e){return this.timestamp.T(e.timestamp)},e.prototype.isEqual=function(e){return this.timestamp.isEqual(e.timestamp)},e.prototype.I=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},e.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},e.prototype.A=function(){return this.timestamp},e}(),N=function(){function e(e,t,n){void 0===t?t=0:t>e.length&&g(),void 0===n?n=e.length-t:n>e.length-t&&g(),this.segments=e,this.offset=t,this.R=n}return Object.defineProperty(e.prototype,"length",{get:function(){return this.R},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return 0===e.P(this,t)},e.prototype.child=function(t){var n=this.segments.slice(this.offset,this.limit());return t instanceof e?t.forEach((function(e){n.push(e)})):n.push(t),this.g(n)},e.prototype.limit=function(){return this.offset+this.length},e.prototype.V=function(e){return e=void 0===e?1:e,this.g(this.segments,this.offset+e,this.length-e)},e.prototype.p=function(){return this.g(this.segments,this.offset,this.length-1)},e.prototype.v=function(){return this.segments[this.offset]},e.prototype.S=function(){return this.get(this.length-1)},e.prototype.get=function(e){return this.segments[this.offset+e]},e.prototype._=function(){return 0===this.length},e.prototype.D=function(e){if(e.length<this.length)return!1;for(var t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0},e.prototype.C=function(e){if(this.length+1!==e.length)return!1;for(var t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0},e.prototype.forEach=function(e){for(var t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])},e.prototype.N=function(){return this.segments.slice(this.offset,this.limit())},e.P=function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){var i=e.get(r),a=t.get(r);if(i<a)return-1;if(i>a)return 1}return e.length<t.length?-1:e.length>t.length?1:0},e}(),L=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.g=function(e,n,r){return new t(e,n,r)},t.prototype.F=function(){return this.N().join("/")},t.prototype.toString=function(){return this.F()},t.k=function(e){if(e.indexOf("//")>=0)throw new O(C.INVALID_ARGUMENT,"Invalid path ("+e+"). Paths must not contain // in them.");return new t(e.split("/").filter((function(e){return e.length>0})))},t.$=function(){return new t([])},t}(N),D=/^[_a-zA-Z][_a-zA-Z0-9]*$/,F=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.g=function(e,n,r){return new t(e,n,r)},t.O=function(e){return D.test(e)},t.prototype.F=function(){return this.N().map((function(e){return e=e.replace("\\","\\\\").replace("`","\\`"),t.O(e)||(e="`"+e+"`"),e})).join(".")},t.prototype.toString=function(){return this.F()},t.prototype.M=function(){return 1===this.length&&"__name__"===this.get(0)},t.L=function(){return new t(["__name__"])},t.q=function(e){for(var n=[],r="",i=0,a=function(){if(0===r.length)throw new O(C.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");n.push(r),r=""},o=!1;i<e.length;){var s=e[i];if("\\"===s){if(i+1===e.length)throw new O(C.INVALID_ARGUMENT,"Path has trailing escape character: "+e);var c=e[i+1];if("\\"!==c&&"."!==c&&"`"!==c)throw new O(C.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);r+=c,i+=2}else"`"===s?(o=!o,i++):"."!==s||o?(r+=s,i++):(a(),i++)}if(a(),o)throw new O(C.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new t(n)},t.$=function(){return new t([])},t}(N),j=function(){function e(e){this.path=e}return e.B=function(t){return new e(L.k(t))},e.U=function(t){return new e(L.k(t).V(5))},e.prototype.W=function(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e},e.prototype.isEqual=function(e){return null!==e&&0===L.P(this.path,e.path)},e.prototype.toString=function(){return this.path.toString()},e.P=function(e,t){return L.P(e.path,t.path)},e.j=function(e){return e.length%2==0},e.K=function(t){return new e(new L(t.slice()))},e}();
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function U(e){return null==e}function B(e){return-0===e&&1/e==-1/0}function V(e){return"number"==typeof e&&Number.isInteger(e)&&!B(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}
+/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var z=function(e,t,n,r,i,a,o){void 0===t&&(t=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===a&&(a=null),void 0===o&&(o=null),this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=a,this.endAt=o,this.G=null};function H(e,t,n,r,i,a,o){return void 0===t&&(t=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===a&&(a=null),void 0===o&&(o=null),new z(e,t,n,r,i,a,o)}function G(e){var t=v(e);if(null===t.G){var n=t.path.F();null!==t.collectionGroup&&(n+="|cg:"+t.collectionGroup),n+="|f:",n+=t.filters.map((function(e){return function(e){return e.field.F()+e.op.toString()+Le(e.value)}(e)})).join(","),n+="|ob:",n+=t.orderBy.map((function(e){return(t=e).field.F()+t.dir;var t})).join(","),U(t.limit)||(n+="|l:",n+=t.limit),t.startAt&&(n+="|lb:",n+=Pn(t.startAt)),t.endAt&&(n+="|ub:",n+=Pn(t.endAt)),t.G=n}return t.G}function q(e,t){if(e.limit!==t.limit)return!1;if(e.orderBy.length!==t.orderBy.length)return!1;for(var n=0;n<e.orderBy.length;n++)if(!Fn(e.orderBy[n],t.orderBy[n]))return!1;if(e.filters.length!==t.filters.length)return!1;for(var r=0;r<e.filters.length;r++)if(i=e.filters[r],a=t.filters[r],i.op!==a.op||!i.field.isEqual(a.field)||!Oe(i.value,a.value))return!1;var i,a;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!Nn(e.startAt,t.startAt)&&Nn(e.endAt,t.endAt)}function W(e){return j.j(e.path)&&null===e.collectionGroup&&0===e.filters.length}
+/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var J=function(){function e(e){this.H=e}return e.fromBase64String=function(t){return new e(atob(t))},e.fromUint8Array=function(t){return new e(function(e){for(var t="",n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(t))},e.prototype.toBase64=function(){return e=this.H,btoa(e);var e},e.prototype.toUint8Array=function(){return function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.H)},e.prototype.Y=function(){return 2*this.H.length},e.prototype.o=function(e){return A(this.H,e.H)},e.prototype.isEqual=function(e){return this.H===e.H},e}();J.J=new J("");var Z,X,Y=function(){function e(e,t,n,r,i,a,o){void 0===i&&(i=I.min()),void 0===a&&(a=I.min()),void 0===o&&(o=J.J),this.target=e,this.targetId=t,this.X=n,this.sequenceNumber=r,this.Z=i,this.lastLimboFreeSnapshotVersion=a,this.resumeToken=o}return e.prototype.tt=function(t){return new e(this.target,this.targetId,this.X,t,this.Z,this.lastLimboFreeSnapshotVersion,this.resumeToken)},e.prototype.et=function(t,n){return new e(this.target,this.targetId,this.X,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,t)},e.prototype.nt=function(t){return new e(this.target,this.targetId,this.X,this.sequenceNumber,this.Z,t,this.resumeToken)},e}(),K=function(e){this.count=e};
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function Q(e){switch(e){case C.OK:return g();case C.CANCELLED:case C.UNKNOWN:case C.DEADLINE_EXCEEDED:case C.RESOURCE_EXHAUSTED:case C.INTERNAL:case C.UNAVAILABLE:case C.UNAUTHENTICATED:return!1;case C.INVALID_ARGUMENT:case C.NOT_FOUND:case C.ALREADY_EXISTS:case C.PERMISSION_DENIED:case C.FAILED_PRECONDITION:case C.ABORTED:case C.OUT_OF_RANGE:case C.UNIMPLEMENTED:case C.DATA_LOSS:return!0;default:return g()}}function $(e){if(void 0===e)return p("GRPC error has no .code"),C.UNKNOWN;switch(e){case Z.OK:return C.OK;case Z.CANCELLED:return C.CANCELLED;case Z.UNKNOWN:return C.UNKNOWN;case Z.DEADLINE_EXCEEDED:return C.DEADLINE_EXCEEDED;case Z.RESOURCE_EXHAUSTED:return C.RESOURCE_EXHAUSTED;case Z.INTERNAL:return C.INTERNAL;case Z.UNAVAILABLE:return C.UNAVAILABLE;case Z.UNAUTHENTICATED:return C.UNAUTHENTICATED;case Z.INVALID_ARGUMENT:return C.INVALID_ARGUMENT;case Z.NOT_FOUND:return C.NOT_FOUND;case Z.ALREADY_EXISTS:return C.ALREADY_EXISTS;case Z.PERMISSION_DENIED:return C.PERMISSION_DENIED;case Z.FAILED_PRECONDITION:return C.FAILED_PRECONDITION;case Z.ABORTED:return C.ABORTED;case Z.OUT_OF_RANGE:return C.OUT_OF_RANGE;case Z.UNIMPLEMENTED:return C.UNIMPLEMENTED;case Z.DATA_LOSS:return C.DATA_LOSS;default:return g()}}(X=Z||(Z={}))[X.OK=0]="OK",X[X.CANCELLED=1]="CANCELLED",X[X.UNKNOWN=2]="UNKNOWN",X[X.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",X[X.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",X[X.NOT_FOUND=5]="NOT_FOUND",X[X.ALREADY_EXISTS=6]="ALREADY_EXISTS",X[X.PERMISSION_DENIED=7]="PERMISSION_DENIED",X[X.UNAUTHENTICATED=16]="UNAUTHENTICATED",X[X.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",X[X.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",X[X.ABORTED=10]="ABORTED",X[X.OUT_OF_RANGE=11]="OUT_OF_RANGE",X[X.UNIMPLEMENTED=12]="UNIMPLEMENTED",X[X.INTERNAL=13]="INTERNAL",X[X.UNAVAILABLE=14]="UNAVAILABLE",X[X.DATA_LOSS=15]="DATA_LOSS";
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var ee=function(){function e(e,t){this.P=e,this.root=t||ne.EMPTY}return e.prototype.st=function(t,n){return new e(this.P,this.root.st(t,n,this.P).copy(null,null,ne.it,null,null))},e.prototype.remove=function(t){return new e(this.P,this.root.remove(t,this.P).copy(null,null,ne.it,null,null))},e.prototype.get=function(e){for(var t=this.root;!t._();){var n=this.P(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null},e.prototype.indexOf=function(e){for(var t=0,n=this.root;!n._();){var r=this.P(e,n.key);if(0===r)return t+n.left.size;r<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1},e.prototype._=function(){return this.root._()},Object.defineProperty(e.prototype,"size",{get:function(){return this.root.size},enumerable:!1,configurable:!0}),e.prototype.rt=function(){return this.root.rt()},e.prototype.ot=function(){return this.root.ot()},e.prototype.ht=function(e){return this.root.ht(e)},e.prototype.forEach=function(e){this.ht((function(t,n){return e(t,n),!1}))},e.prototype.toString=function(){var e=[];return this.ht((function(t,n){return e.push(t+":"+n),!1})),"{"+e.join(", ")+"}"},e.prototype.at=function(e){return this.root.at(e)},e.prototype.ct=function(){return new te(this.root,null,this.P,!1)},e.prototype.ut=function(e){return new te(this.root,e,this.P,!1)},e.prototype.lt=function(){return new te(this.root,null,this.P,!0)},e.prototype._t=function(e){return new te(this.root,e,this.P,!0)},e}(),te=function(){function e(e,t,n,r){this.ft=r,this.dt=[];for(var i=1;!e._();)if(i=t?n(e.key,t):1,r&&(i*=-1),i<0)e=this.ft?e.left:e.right;else{if(0===i){this.dt.push(e);break}this.dt.push(e),e=this.ft?e.right:e.left}}return e.prototype.wt=function(){var e=this.dt.pop(),t={key:e.key,value:e.value};if(this.ft)for(e=e.left;!e._();)this.dt.push(e),e=e.right;else for(e=e.right;!e._();)this.dt.push(e),e=e.left;return t},e.prototype.Tt=function(){return this.dt.length>0},e.prototype.Et=function(){if(0===this.dt.length)return null;var e=this.dt[this.dt.length-1];return{key:e.key,value:e.value}},e}(),ne=function(){function e(t,n,r,i,a){this.key=t,this.value=n,this.color=null!=r?r:e.RED,this.left=null!=i?i:e.EMPTY,this.right=null!=a?a:e.EMPTY,this.size=this.left.size+1+this.right.size}return e.prototype.copy=function(t,n,r,i,a){return new e(null!=t?t:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=a?a:this.right)},e.prototype._=function(){return!1},e.prototype.ht=function(e){return this.left.ht(e)||e(this.key,this.value)||this.right.ht(e)},e.prototype.at=function(e){return this.right.at(e)||e(this.key,this.value)||this.left.at(e)},e.prototype.min=function(){return this.left._()?this:this.left.min()},e.prototype.rt=function(){return this.min().key},e.prototype.ot=function(){return this.right._()?this.key:this.right.ot()},e.prototype.st=function(e,t,n){var r=this,i=n(e,r.key);return(r=i<0?r.copy(null,null,null,r.left.st(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.st(e,t,n))).It()},e.prototype.At=function(){if(this.left._())return e.EMPTY;var t=this;return t.left.Rt()||t.left.left.Rt()||(t=t.Pt()),(t=t.copy(null,null,null,t.left.At(),null)).It()},e.prototype.remove=function(t,n){var r,i=this;if(n(t,i.key)<0)i.left._()||i.left.Rt()||i.left.left.Rt()||(i=i.Pt()),i=i.copy(null,null,null,i.left.remove(t,n),null);else{if(i.left.Rt()&&(i=i.gt()),i.right._()||i.right.Rt()||i.right.left.Rt()||(i=i.Vt()),0===n(t,i.key)){if(i.right._())return e.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.At())}i=i.copy(null,null,null,null,i.right.remove(t,n))}return i.It()},e.prototype.Rt=function(){return this.color},e.prototype.It=function(){var e=this;return e.right.Rt()&&!e.left.Rt()&&(e=e.yt()),e.left.Rt()&&e.left.left.Rt()&&(e=e.gt()),e.left.Rt()&&e.right.Rt()&&(e=e.pt()),e},e.prototype.Pt=function(){var e=this.pt();return e.right.left.Rt()&&(e=(e=(e=e.copy(null,null,null,null,e.right.gt())).yt()).pt()),e},e.prototype.Vt=function(){var e=this.pt();return e.left.left.Rt()&&(e=(e=e.gt()).pt()),e},e.prototype.yt=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.gt=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.pt=function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)},e.prototype.bt=function(){var e=this.vt();return Math.pow(2,e)<=this.size+1},e.prototype.vt=function(){if(this.Rt()&&this.left.Rt())throw g();if(this.right.Rt())throw g();var e=this.left.vt();if(e!==this.right.vt())throw g();return e+(this.Rt()?0:1)},e}();ne.EMPTY=null,ne.RED=!0,ne.it=!1,ne.EMPTY=new(function(){function e(){this.size=0}return Object.defineProperty(e.prototype,"key",{get:function(){throw g()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){throw g()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){throw g()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"left",{get:function(){throw g()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){throw g()},enumerable:!1,configurable:!0}),e.prototype.copy=function(e,t,n,r,i){return this},e.prototype.st=function(e,t,n){return new ne(e,t)},e.prototype.remove=function(e,t){return this},e.prototype._=function(){return!0},e.prototype.ht=function(e){return!1},e.prototype.at=function(e){return!1},e.prototype.rt=function(){return null},e.prototype.ot=function(){return null},e.prototype.Rt=function(){return!1},e.prototype.bt=function(){return!0},e.prototype.vt=function(){return 0},e}());
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var re=function(){function e(e){this.P=e,this.data=new ee(this.P)}return e.prototype.has=function(e){return null!==this.data.get(e)},e.prototype.first=function(){return this.data.rt()},e.prototype.last=function(){return this.data.ot()},Object.defineProperty(e.prototype,"size",{get:function(){return this.data.size},enumerable:!1,configurable:!0}),e.prototype.indexOf=function(e){return this.data.indexOf(e)},e.prototype.forEach=function(e){this.data.ht((function(t,n){return e(t),!1}))},e.prototype.St=function(e,t){for(var n=this.data.ut(e[0]);n.Tt();){var r=n.wt();if(this.P(r.key,e[1])>=0)return;t(r.key)}},e.prototype.Dt=function(e,t){var n;for(n=void 0!==t?this.data.ut(t):this.data.ct();n.Tt();)if(!e(n.wt().key))return},e.prototype.Ct=function(e){var t=this.data.ut(e);return t.Tt()?t.wt().key:null},e.prototype.ct=function(){return new ie(this.data.ct())},e.prototype.ut=function(e){return new ie(this.data.ut(e))},e.prototype.add=function(e){return this.copy(this.data.remove(e).st(e,!0))},e.prototype.delete=function(e){return this.has(e)?this.copy(this.data.remove(e)):this},e.prototype._=function(){return this.data._()},e.prototype.Nt=function(e){var t=this;return t.size<e.size&&(t=e,e=this),e.forEach((function(e){t=t.add(e)})),t},e.prototype.isEqual=function(t){if(!(t instanceof e))return!1;if(this.size!==t.size)return!1;for(var n=this.data.ct(),r=t.data.ct();n.Tt();){var i=n.wt().key,a=r.wt().key;if(0!==this.P(i,a))return!1}return!0},e.prototype.N=function(){var e=[];return this.forEach((function(t){e.push(t)})),e},e.prototype.toString=function(){var e=[];return this.forEach((function(t){return e.push(t)})),"SortedSet("+e.toString()+")"},e.prototype.copy=function(t){var n=new e(this.P);return n.data=t,n},e}(),ie=function(){function e(e){this.Ft=e}return e.prototype.wt=function(){return this.Ft.wt().key},e.prototype.Tt=function(){return this.Ft.Tt()},e}(),ae=new ee(j.P);function oe(){return ae}function se(){return oe()}var ce=new ee(j.P);function le(){return ce}var ue=new ee(j.P),he=new re(j.P);function de(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=he,r=0,i=e;r<i.length;r++){var a=i[r];n=n.add(a)}return n}var pe=new re(A);function fe(){return pe}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var me=function(){function e(e){this.P=e?function(t,n){return e(t,n)||j.P(t.key,n.key)}:function(e,t){return j.P(e.key,t.key)},this.kt=le(),this.$t=new ee(this.P)}return e.xt=function(t){return new e(t.P)},e.prototype.has=function(e){return null!=this.kt.get(e)},e.prototype.get=function(e){return this.kt.get(e)},e.prototype.first=function(){return this.$t.rt()},e.prototype.last=function(){return this.$t.ot()},e.prototype._=function(){return this.$t._()},e.prototype.indexOf=function(e){var t=this.kt.get(e);return t?this.$t.indexOf(t):-1},Object.defineProperty(e.prototype,"size",{get:function(){return this.$t.size},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e){this.$t.ht((function(t,n){return e(t),!1}))},e.prototype.add=function(e){var t=this.delete(e.key);return t.copy(t.kt.st(e.key,e),t.$t.st(e,null))},e.prototype.delete=function(e){var t=this.get(e);return t?this.copy(this.kt.remove(e),this.$t.remove(t)):this},e.prototype.isEqual=function(t){if(!(t instanceof e))return!1;if(this.size!==t.size)return!1;for(var n=this.$t.ct(),r=t.$t.ct();n.Tt();){var i=n.wt().key,a=r.wt().key;if(!i.isEqual(a))return!1}return!0},e.prototype.toString=function(){var e=[];return this.forEach((function(t){e.push(t.toString())})),0===e.length?"DocumentSet ()":"DocumentSet (\n "+e.join(" \n")+"\n)"},e.prototype.copy=function(t,n){var r=new e;return r.P=this.P,r.kt=t,r.$t=n,r},e}(),ge=function(){function e(){this.Ot=new ee(j.P)}return e.prototype.track=function(e){var t=e.doc.key,n=this.Ot.get(t);n?0!==e.type&&3===n.type?this.Ot=this.Ot.st(t,e):3===e.type&&1!==n.type?this.Ot=this.Ot.st(t,{type:n.type,doc:e.doc}):2===e.type&&2===n.type?this.Ot=this.Ot.st(t,{type:2,doc:e.doc}):2===e.type&&0===n.type?this.Ot=this.Ot.st(t,{type:0,doc:e.doc}):1===e.type&&0===n.type?this.Ot=this.Ot.remove(t):1===e.type&&2===n.type?this.Ot=this.Ot.st(t,{type:1,doc:n.doc}):0===e.type&&1===n.type?this.Ot=this.Ot.st(t,{type:2,doc:e.doc}):g():this.Ot=this.Ot.st(t,e)},e.prototype.Mt=function(){var e=[];return this.Ot.ht((function(t,n){e.push(n)})),e},e}(),ye=function(){function e(e,t,n,r,i,a,o,s){this.query=e,this.docs=t,this.Lt=n,this.docChanges=r,this.qt=i,this.fromCache=a,this.Bt=o,this.Ut=s}return e.Qt=function(t,n,r,i){var a=[];return n.forEach((function(e){a.push({type:0,doc:e})})),new e(t,n,me.xt(n),a,r,i,!0,!1)},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return!this.qt._()},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(e){if(!(this.fromCache===e.fromCache&&this.Bt===e.Bt&&this.qt.isEqual(e.qt)&&yn(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.Lt.isEqual(e.Lt)))return!1;var t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(var r=0;r<t.length;r++)if(t[r].type!==n[r].type||!t[r].doc.isEqual(n[r].doc))return!1;return!0},e}(),ve=function(){function e(e,t,n,r,i){this.Z=e,this.Wt=t,this.jt=n,this.Kt=r,this.Gt=i}return e.zt=function(t,n){var r=new Map;return r.set(t,be.Ht(t,n)),new e(I.min(),r,fe(),oe(),de())},e}(),be=function(){function e(e,t,n,r,i){this.resumeToken=e,this.Yt=t,this.Jt=n,this.Xt=r,this.Zt=i}return e.Ht=function(t,n){return new e(J.J,n,de(),de(),de())},e}(),we=function(e,t,n,r){this.te=e,this.removedTargetIds=t,this.key=n,this.ee=r},Ae=function(e,t){this.targetId=e,this.ne=t},Ee=function(e,t,n,r){void 0===n&&(n=J.J),void 0===r&&(r=null),this.state=e,this.targetIds=t,this.resumeToken=n,this.cause=r},xe=function(){function e(){this.se=0,this.ie=Me(),this.re=J.J,this.oe=!1,this.he=!0}return Object.defineProperty(e.prototype,"Yt",{get:function(){return this.oe},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resumeToken",{get:function(){return this.re},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ae",{get:function(){return 0!==this.se},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ce",{get:function(){return this.he},enumerable:!1,configurable:!0}),e.prototype.ue=function(e){e.Y()>0&&(this.he=!0,this.re=e)},e.prototype.le=function(){var e=de(),t=de(),n=de();return this.ie.forEach((function(r,i){switch(i){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:n=n.add(r);break;default:g()}})),new be(this.re,this.oe,e,t,n)},e.prototype._e=function(){this.he=!1,this.ie=Me()},e.prototype.fe=function(e,t){this.he=!0,this.ie=this.ie.st(e,t)},e.prototype.de=function(e){this.he=!0,this.ie=this.ie.remove(e)},e.prototype.we=function(){this.se+=1},e.prototype.Te=function(){this.se-=1},e.prototype.Ee=function(){this.he=!0,this.oe=!0},e}(),_e=function(){function e(e){this.me=e,this.Ie=new Map,this.Ae=oe(),this.Re=Se(),this.Pe=new re(A)}return e.prototype.ge=function(e){for(var t=0,n=e.te;t<n.length;t++){var r=n[t];e.ee instanceof rn?this.Ve(r,e.ee):e.ee instanceof an&&this.ye(r,e.key,e.ee)}for(var i=0,a=e.removedTargetIds;i<a.length;i++){var o=a[i];this.ye(o,e.key,e.ee)}},e.prototype.pe=function(e){var t=this;this.be(e,(function(n){var r=t.ve(n);switch(e.state){case 0:t.Se(n)&&r.ue(e.resumeToken);break;case 1:r.Te(),r.ae||r._e(),r.ue(e.resumeToken);break;case 2:r.Te(),r.ae||t.removeTarget(n);break;case 3:t.Se(n)&&(r.Ee(),r.ue(e.resumeToken));break;case 4:t.Se(n)&&(t.De(n),r.ue(e.resumeToken));break;default:g()}}))},e.prototype.be=function(e,t){var n=this;e.targetIds.length>0?e.targetIds.forEach(t):this.Ie.forEach((function(e,r){n.Se(r)&&t(r)}))},e.prototype.Ce=function(e){var t=e.targetId,n=e.ne.count,r=this.Ne(t);if(r){var i=r.target;if(W(i))if(0===n){var a=new j(i.path);this.ye(t,a,new an(a,I.min()))}else y(1===n);else this.Fe(t)!==n&&(this.De(t),this.Pe=this.Pe.add(t))}},e.prototype.ke=function(e){var t=this,n=new Map;this.Ie.forEach((function(r,i){var a=t.Ne(i);if(a){if(r.Yt&&W(a.target)){var o=new j(a.target.path);null!==t.Ae.get(o)||t.$e(i,o)||t.ye(i,o,new an(o,e))}r.ce&&(n.set(i,r.le()),r._e())}}));var r=de();this.Re.forEach((function(e,n){var i=!0;n.Dt((function(e){var n=t.Ne(e);return!n||2===n.X||(i=!1,!1)})),i&&(r=r.add(e))}));var i=new ve(e,n,this.Pe,this.Ae,r);return this.Ae=oe(),this.Re=Se(),this.Pe=new re(A),i},e.prototype.Ve=function(e,t){if(this.Se(e)){var n=this.$e(e,t.key)?2:0;this.ve(e).fe(t.key,n),this.Ae=this.Ae.st(t.key,t),this.Re=this.Re.st(t.key,this.xe(t.key).add(e))}},e.prototype.ye=function(e,t,n){if(this.Se(e)){var r=this.ve(e);this.$e(e,t)?r.fe(t,1):r.de(t),this.Re=this.Re.st(t,this.xe(t).delete(e)),n&&(this.Ae=this.Ae.st(t,n))}},e.prototype.removeTarget=function(e){this.Ie.delete(e)},e.prototype.Fe=function(e){var t=this.ve(e).le();return this.me.Oe(e).size+t.Jt.size-t.Zt.size},e.prototype.we=function(e){this.ve(e).we()},e.prototype.ve=function(e){var t=this.Ie.get(e);return t||(t=new xe,this.Ie.set(e,t)),t},e.prototype.xe=function(e){var t=this.Re.get(e);return t||(t=new re(A),this.Re=this.Re.st(e,t)),t},e.prototype.Se=function(e){var t=null!==this.Ne(e);return t||d("WatchChangeAggregator","Detected inactive target",e),t},e.prototype.Ne=function(e){var t=this.Ie.get(e);return t&&t.ae?null:this.me.Me(e)},e.prototype.De=function(e){var t=this;this.Ie.set(e,new xe),this.me.Oe(e).forEach((function(n){t.ye(e,n,null)}))},e.prototype.$e=function(e,t){return this.me.Oe(e).has(t)},e}();
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function Se(){return new ee(j.P)}function Me(){return new ee(j.P)}
+/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function Te(e){var t,n;return"server_timestamp"===(null===(n=((null===(t=null==e?void 0:e.mapValue)||void 0===t?void 0:t.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function Re(e){var t=De(e.mapValue.fields.__local_write_time__.timestampValue);return new P(t.seconds,t.nanos)}
+/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var ke=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Ce(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?Te(e)?4:10:g()}function Oe(e,t){var n=Ce(e);if(n!==Ce(t))return!1;switch(n){case 0:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return Re(e).isEqual(Re(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;var n=De(e.timestampValue),r=De(t.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(e,t){return je(e.bytesValue).isEqual(je(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return Fe(e.geoPointValue.latitude)===Fe(t.geoPointValue.latitude)&&Fe(e.geoPointValue.longitude)===Fe(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return Fe(e.integerValue)===Fe(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){var n=Fe(e.doubleValue),r=Fe(t.doubleValue);return n===r?B(n)===B(r):isNaN(n)&&isNaN(r)}return!1}(e,t);case 9:return E(e.arrayValue.values||[],t.arrayValue.values||[],Oe);case 10:return function(e,t){var n=e.mapValue.fields||{},r=t.mapValue.fields||{};if(M(n)!==M(r))return!1;for(var i in n)if(n.hasOwnProperty(i)&&(void 0===r[i]||!Oe(n[i],r[i])))return!1;return!0}(e,t);default:return g()}}function Pe(e,t){return void 0!==(e.values||[]).find((function(e){return Oe(e,t)}))}function Ie(e,t){var n=Ce(e),r=Ce(t);if(n!==r)return A(n,r);switch(n){case 0:return 0;case 1:return A(e.booleanValue,t.booleanValue);case 2:return function(e,t){var n=Fe(e.integerValue||e.doubleValue),r=Fe(t.integerValue||t.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(e,t);case 3:return Ne(e.timestampValue,t.timestampValue);case 4:return Ne(Re(e),Re(t));case 5:return A(e.stringValue,t.stringValue);case 6:return function(e,t){var n=je(e),r=je(t);return n.o(r)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){for(var n=e.split("/"),r=t.split("/"),i=0;i<n.length&&i<r.length;i++){var a=A(n[i],r[i]);if(0!==a)return a}return A(n.length,r.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){var n=A(Fe(e.latitude),Fe(t.latitude));return 0!==n?n:A(Fe(e.longitude),Fe(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return function(e,t){for(var n=e.values||[],r=t.values||[],i=0;i<n.length&&i<r.length;++i){var a=Ie(n[i],r[i]);if(a)return a}return A(n.length,r.length)}(e.arrayValue,t.arrayValue);case 10:return function(e,t){var n=e.fields||{},r=Object.keys(n),i=t.fields||{},a=Object.keys(i);r.sort(),a.sort();for(var o=0;o<r.length&&o<a.length;++o){var s=A(r[o],a[o]);if(0!==s)return s;var c=Ie(n[r[o]],i[a[o]]);if(0!==c)return c}return A(r.length,a.length)}(e.mapValue,t.mapValue);default:throw g()}}function Ne(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return A(e,t);var n=De(e),r=De(t),i=A(n.seconds,r.seconds);return 0!==i?i:A(n.nanos,r.nanos)}function Le(e){return function e(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(e){var t=De(e);return"time("+t.seconds+","+t.nanos+")"}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?je(t.bytesValue).toBase64():"referenceValue"in t?(r=t.referenceValue,j.U(r).toString()):"geoPointValue"in t?"geo("+(n=t.geoPointValue).latitude+","+n.longitude+")":"arrayValue"in t?function(t){for(var n="[",r=!0,i=0,a=t.values||[];i<a.length;i++){var o=a[i];r?r=!1:n+=",",n+=e(o)}return n+"]"}(t.arrayValue):"mapValue"in t?function(t){for(var n="{",r=!0,i=0,a=Object.keys(t.fields||{}).sort();i<a.length;i++){var o=a[i];r?r=!1:n+=",",n+=o+":"+e(t.fields[o])}return n+"}"}(t.mapValue):g();var n,r}(e)}function De(e){if(y(!!e),"string"==typeof e){var t=0,n=ke.exec(e);if(y(!!n),n[1]){var r=n[1];r=(r+"000000000").substr(0,9),t=Number(r)}var i=new Date(e);return{seconds:Math.floor(i.getTime()/1e3),nanos:t}}return{seconds:Fe(e.seconds),nanos:Fe(e.nanos)}}function Fe(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function je(e){return"string"==typeof e?J.fromBase64String(e):J.fromUint8Array(e)}function Ue(e,t){return{referenceValue:"projects/"+e.projectId+"/databases/"+e.database+"/documents/"+t.path.F()}}function Be(e){return!!e&&"integerValue"in e}function Ve(e){return!!e&&"arrayValue"in e}function ze(e){return!!e&&"nullValue"in e}function He(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function Ge(e){return!!e&&"mapValue"in e}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var qe={asc:"ASCENDING",desc:"DESCENDING"},We={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},Je=function(e,t){this.s=e,this.Le=t};function Ze(e){return{integerValue:""+e}}function Xe(e,t){if(e.Le){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:B(t)?"-0":t}}function Ye(e,t){return V(t)?Ze(t):Xe(e,t)}function Ke(e,t){return e.Le?new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+t.nanoseconds).slice(-9)+"Z":{seconds:""+t.seconds,nanos:t.nanoseconds}}function Qe(e,t){return e.Le?t.toBase64():t.toUint8Array()}function $e(e,t){return Ke(e,t.A())}function et(e){return y(!!e),I.m(function(e){var t=De(e);return new P(t.seconds,t.nanos)}(e))}function tt(e,t){return function(e){return new L(["projects",e.projectId,"databases",e.database])}(e).child("documents").child(t).F()}function nt(e){var t=L.k(e);return y(At(t)),t}function rt(e,t){return tt(e.s,t.path)}function it(e,t){var n=nt(t);return y(n.get(1)===e.s.projectId),y(!n.get(3)&&!e.s.database||n.get(3)===e.s.database),new j(ct(n))}function at(e,t){return tt(e.s,t)}function ot(e){var t=nt(e);return 4===t.length?L.$():ct(t)}function st(e){return new L(["projects",e.s.projectId,"databases",e.s.database]).F()}function ct(e){return y(e.length>4&&"documents"===e.get(4)),e.V(5)}function lt(e,t,n){return{name:rt(e,t),fields:n.proto.mapValue.fields}}function ut(e,t){var n;if(t instanceof qt)n={update:lt(e,t.key,t.value)};else if(t instanceof Kt)n={delete:rt(e,t.key)};else if(t instanceof Wt)n={update:lt(e,t.key,t.data),updateMask:wt(t.qe)};else if(t instanceof Zt)n={transform:{document:rt(e,t.key),fieldTransforms:t.fieldTransforms.map((function(e){return function(e,t){var n=t.transform;if(n instanceof Mt)return{fieldPath:t.field.F(),setToServerValue:"REQUEST_TIME"};if(n instanceof Tt)return{fieldPath:t.field.F(),appendMissingElements:{values:n.elements}};if(n instanceof kt)return{fieldPath:t.field.F(),removeAllFromArray:{values:n.elements}};if(n instanceof Ot)return{fieldPath:t.field.F(),increment:n.Be};throw g()}(0,e)}))}};else{if(!(t instanceof Qt))return g();n={verify:rt(e,t.key)}}return t.Qe.Ue||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:$e(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:g()}(e,t.Qe)),n}function ht(e,t){var n=t.currentDocument?function(e){return void 0!==e.updateTime?Ft.updateTime(et(e.updateTime)):void 0!==e.exists?Ft.exists(e.exists):Ft.We()}(t.currentDocument):Ft.We();if(t.update){t.update.name;var r=it(e,t.update.name),i=new $t({mapValue:{fields:t.update.fields}});if(t.updateMask){var a=function(e){var t=e.fieldPaths||[];return new Nt(t.map((function(e){return F.q(e)})))}(t.updateMask);return new Wt(r,i,a,n)}return new qt(r,i,n)}if(t.delete){var o=it(e,t.delete);return new Kt(o,n)}if(t.transform){var s=it(e,t.transform.document),c=t.transform.fieldTransforms.map((function(t){return function(e,t){var n=null;if("setToServerValue"in t)y("REQUEST_TIME"===t.setToServerValue),n=new Mt;else if("appendMissingElements"in t){var r=t.appendMissingElements.values||[];n=new Tt(r)}else if("removeAllFromArray"in t){var i=t.removeAllFromArray.values||[];n=new kt(i)}else"increment"in t?n=new Ot(e,t.increment):g();var a=F.q(t.fieldPath);return new Lt(a,n)}(e,t)}));return y(!0===n.exists),new Zt(s,c)}if(t.verify){var l=it(e,t.verify);return new Qt(l,n)}return g()}function dt(e,t){return{documents:[at(e,t.path)]}}function pt(e,t){var n={structuredQuery:{}},r=t.path;null!==t.collectionGroup?(n.parent=at(e,r),n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(n.parent=at(e,r.p()),n.structuredQuery.from=[{collectionId:r.S()}]);var i=function(e){if(0!==e.length){var t=e.map((function(e){return function(e){if("=="===e.op){if(He(e.value))return{unaryFilter:{field:gt(e.field),op:"IS_NAN"}};if(ze(e.value))return{unaryFilter:{field:gt(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(He(e.value))return{unaryFilter:{field:gt(e.field),op:"IS_NOT_NAN"}};if(ze(e.value))return{unaryFilter:{field:gt(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:gt(e.field),op:(t=e.op,We[t]),value:e.value}};var t}(e)}));return 1===t.length?t[0]:{compositeFilter:{op:"AND",filters:t}}}}(t.filters);i&&(n.structuredQuery.where=i);var a=function(e){if(0!==e.length)return e.map((function(e){return{field:gt((t=e).field),direction:(n=t.dir,qe[n])};var t,n}))}(t.orderBy);a&&(n.structuredQuery.orderBy=a);var o=function(e,t){return e.Le||U(t)?t:{value:t}}(e,t.limit);return null!==o&&(n.structuredQuery.limit=o),t.startAt&&(n.structuredQuery.startAt=ft(t.startAt)),t.endAt&&(n.structuredQuery.endAt=ft(t.endAt)),n}function ft(e){return{before:e.before,values:e.position}}function mt(e){var t=!!e.before,n=e.values||[];return new On(n,t)}function gt(e){return{fieldPath:e.F()}}function yt(e){return F.q(e.fieldPath)}function vt(e){return En.create(yt(e.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return g()}}(e.fieldFilter.op),e.fieldFilter.value)}function bt(e){switch(e.unaryFilter.op){case"IS_NAN":var t=yt(e.unaryFilter.field);return En.create(t,"==",{doubleValue:NaN});case"IS_NULL":var n=yt(e.unaryFilter.field);return En.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var r=yt(e.unaryFilter.field);return En.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=yt(e.unaryFilter.field);return En.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return g()}}function wt(e){var t=[];return e.fields.forEach((function(e){return t.push(e.F())})),{fieldPaths:t}}function At(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}
+/**
+ * @license
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var Et=function(){this.je=void 0};function xt(e,t,n){return e instanceof Mt?function(e,t){var n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&(n.fields.__previous_value__=t),{mapValue:n}}(n,t):e instanceof Tt?Rt(e,t):e instanceof kt?Ct(e,t):function(e,t){var n=St(e,t),r=Pt(n)+Pt(e.Be);return Be(n)&&Be(e.Be)?Ze(r):Xe(e.serializer,r)}(e,t)}function _t(e,t,n){return e instanceof Tt?Rt(e,t):e instanceof kt?Ct(e,t):n}function St(e,t){return e instanceof Ot?Be(n=t)||function(e){return!!e&&"doubleValue"in e}(n)?t:{integerValue:0}:null;var n}var Mt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t}(Et),Tt=function(e){function t(t){var n=this;return(n=e.call(this)||this).elements=t,n}return i.__extends(t,e),t}(Et);function Rt(e,t){for(var n=It(t),r=function(e){n.some((function(t){return Oe(t,e)}))||n.push(e)},i=0,a=e.elements;i<a.length;i++)r(a[i]);return{arrayValue:{values:n}}}var kt=function(e){function t(t){var n=this;return(n=e.call(this)||this).elements=t,n}return i.__extends(t,e),t}(Et);function Ct(e,t){for(var n=It(t),r=function(e){n=n.filter((function(t){return!Oe(t,e)}))},i=0,a=e.elements;i<a.length;i++)r(a[i]);return{arrayValue:{values:n}}}var Ot=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).serializer=t,r.Be=n,r}return i.__extends(t,e),t}(Et);function Pt(e){return Fe(e.integerValue||e.doubleValue)}function It(e){return Ve(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var Nt=function(){function e(e){this.fields=e,e.sort(F.P)}return e.prototype.Ke=function(e){for(var t=0,n=this.fields;t<n.length;t++)if(n[t].D(e))return!0;return!1},e.prototype.isEqual=function(e){return E(this.fields,e.fields,(function(e,t){return e.isEqual(t)}))},e}(),Lt=function(e,t){this.field=e,this.transform=t},Dt=function(e,t){this.version=e,this.transformResults=t},Ft=function(){function e(e,t){this.updateTime=e,this.exists=t}return e.We=function(){return new e},e.exists=function(t){return new e(void 0,t)},e.updateTime=function(t){return new e(t)},Object.defineProperty(e.prototype,"Ue",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)},e}();function jt(e,t){return void 0!==e.updateTime?t instanceof rn&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t instanceof rn}var Ut=function(){};function Bt(e,t,n){return e instanceof qt?function(e,t,n){return new rn(e.key,n.version,e.value,{hasCommittedMutations:!0})}(e,0,n):e instanceof Wt?function(e,t,n){if(!jt(e.Qe,t))return new on(e.key,n.version);var r=Jt(e,t);return new rn(e.key,n.version,r,{hasCommittedMutations:!0})}(e,t,n):e instanceof Zt?function(e,t,n){if(y(null!=n.transformResults),!jt(e.Qe,t))return new on(e.key,n.version);var r=Xt(e,t),i=function(e,t,n){var r=[];y(e.length===n.length);for(var i=0;i<n.length;i++){var a=e[i],o=a.transform,s=null;t instanceof rn&&(s=t.field(a.field)),r.push(_t(o,s,n[i]))}return r}(e.fieldTransforms,t,n.transformResults),a=n.version,o=Yt(e,r.data(),i);return new rn(e.key,a,o,{hasCommittedMutations:!0})}(e,t,n):function(e,t,n){return new an(e.key,n.version,{hasCommittedMutations:!0})}(e,0,n)}function Vt(e,t,n,r){return e instanceof qt?function(e,t){if(!jt(e.Qe,t))return t;var n=Gt(t);return new rn(e.key,n,e.value,{Ge:!0})}(e,t):e instanceof Wt?function(e,t){if(!jt(e.Qe,t))return t;var n=Gt(t),r=Jt(e,t);return new rn(e.key,n,r,{Ge:!0})}(e,t):e instanceof Zt?function(e,t,n,r){if(!jt(e.Qe,t))return t;var i=Xt(e,t),a=function(e,t,n,r){for(var i=[],a=0,o=e;a<o.length;a++){var s=o[a],c=s.transform,l=null;n instanceof rn&&(l=n.field(s.field)),null===l&&r instanceof rn&&(l=r.field(s.field)),i.push(xt(c,l,t))}return i}(e.fieldTransforms,n,t,r),o=Yt(e,i.data(),a);return new rn(e.key,i.version,o,{Ge:!0})}(e,t,r,n):function(e,t){return jt(e.Qe,t)?new an(e.key,I.min()):t}(e,t)}function zt(e,t){return e instanceof Zt?function(e,t){for(var n=null,r=0,i=e.fieldTransforms;r<i.length;r++){var a=i[r],o=t instanceof rn?t.field(a.field):void 0,s=St(a.transform,o||null);null!=s&&(n=null==n?(new en).set(a.field,s):n.set(a.field,s))}return n?n.ze():null}(e,t):null}function Ht(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.Qe.isEqual(t.Qe)&&(0===e.type?e.value.isEqual(t.value):1===e.type?e.data.isEqual(t.data)&&e.qe.isEqual(t.qe):2!==e.type||E(e.fieldTransforms,e.fieldTransforms,(function(e,t){return function(e,t){return e.field.isEqual(t.field)&&function(e,t){return e instanceof Tt&&t instanceof Tt||e instanceof kt&&t instanceof kt?E(e.elements,t.elements,Oe):e instanceof Ot&&t instanceof Ot?Oe(e.Be,t.Be):e instanceof Mt&&t instanceof Mt}(e.transform,t.transform)}(e,t)})))}function Gt(e){return e instanceof rn?e.version:I.min()}var qt=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).key=t,i.value=n,i.Qe=r,i.type=0,i}return i.__extends(t,e),t}(Ut),Wt=function(e){function t(t,n,r,i){var a=this;return(a=e.call(this)||this).key=t,a.data=n,a.qe=r,a.Qe=i,a.type=1,a}return i.__extends(t,e),t}(Ut);function Jt(e,t){return function(e,t){var n=new en(t);return e.qe.fields.forEach((function(t){if(!t._()){var r=e.data.field(t);null!==r?n.set(t,r):n.delete(t)}})),n.ze()}(e,t instanceof rn?t.data():$t.empty())}var Zt=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).key=t,r.fieldTransforms=n,r.type=2,r.Qe=Ft.exists(!0),r}return i.__extends(t,e),t}(Ut);function Xt(e,t){return t}function Yt(e,t,n){for(var r=new en(t),i=0;i<e.fieldTransforms.length;i++){var a=e.fieldTransforms[i];r.set(a.field,n[i])}return r.ze()}var Kt=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).key=t,r.Qe=n,r.type=3,r}return i.__extends(t,e),t}(Ut),Qt=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).key=t,r.Qe=n,r.type=4,r}return i.__extends(t,e),t}(Ut),$t=function(){function e(e){this.proto=e}return e.empty=function(){return new e({mapValue:{}})},e.prototype.field=function(e){if(e._())return this.proto;for(var t=this.proto,n=0;n<e.length-1;++n){if(!t.mapValue.fields)return null;if(!Ge(t=t.mapValue.fields[e.get(n)]))return null}return(t=(t.mapValue.fields||{})[e.S()])||null},e.prototype.isEqual=function(e){return Oe(this.proto,e.proto)},e}(),en=function(){function e(e){void 0===e&&(e=$t.empty()),this.He=e,this.Ye=new Map}return e.prototype.set=function(e,t){return this.Je(e,t),this},e.prototype.delete=function(e){return this.Je(e,null),this},e.prototype.Je=function(e,t){for(var n=this.Ye,r=0;r<e.length-1;++r){var i=e.get(r),a=n.get(i);a instanceof Map?n=a:a&&10===Ce(a)?(a=new Map(Object.entries(a.mapValue.fields||{})),n.set(i,a),n=a):(a=new Map,n.set(i,a),n=a)}n.set(e.S(),t)},e.prototype.ze=function(){var e=this.Xe(F.$(),this.Ye);return null!=e?new $t(e):this.He},e.prototype.Xe=function(e,t){var n=this,r=!1,i=this.He.field(e),a=Ge(i)?Object.assign({},i.mapValue.fields):{};return t.forEach((function(t,i){if(t instanceof Map){var o=n.Xe(e.child(i),t);null!=o&&(a[i]=o,r=!0)}else null!==t?(a[i]=t,r=!0):a.hasOwnProperty(i)&&(delete a[i],r=!0)})),r?{mapValue:{fields:a}}:null},e}();function tn(e){var t=[];return T(e.fields||{},(function(e,n){var r=new F([e]);if(Ge(n)){var i=tn(n.mapValue).fields;if(0===i.length)t.push(r);else for(var a=0,o=i;a<o.length;a++){var s=o[a];t.push(r.child(s))}}else t.push(r)})),new Nt(t)
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */}var nn=function(e,t){this.key=e,this.version=t},rn=function(e){function t(t,n,r,i){var a=this;return(a=e.call(this,t,n)||this).Ze=r,a.Ge=!!i.Ge,a.hasCommittedMutations=!!i.hasCommittedMutations,a}return i.__extends(t,e),t.prototype.field=function(e){return this.Ze.field(e)},t.prototype.data=function(){return this.Ze},t.prototype.tn=function(){return this.Ze.proto},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.Ge===e.Ge&&this.hasCommittedMutations===e.hasCommittedMutations&&this.Ze.isEqual(e.Ze)},t.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+this.Ze.toString()+", {hasLocalMutations: "+this.Ge+"}), {hasCommittedMutations: "+this.hasCommittedMutations+"})"},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return this.Ge||this.hasCommittedMutations},enumerable:!1,configurable:!0}),t}(nn),an=function(e){function t(t,n,r){var i=this;return(i=e.call(this,t,n)||this).hasCommittedMutations=!(!r||!r.hasCommittedMutations),i}return i.__extends(t,e),t.prototype.toString=function(){return"NoDocument("+this.key+", "+this.version+")"},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return this.hasCommittedMutations},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.hasCommittedMutations===this.hasCommittedMutations&&e.version.isEqual(this.version)&&e.key.isEqual(this.key)},t}(nn),on=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.toString=function(){return"UnknownDocument("+this.key+", "+this.version+")"},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.version.isEqual(this.version)&&e.key.isEqual(this.key)},t}(nn);
+/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function sn(e,t){if(!(e instanceof t))throw t.name===e.constructor.name?new O(C.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass '"+t.name+"' from a different Firestore SDK?"):new O(C.INVALID_ARGUMENT,"Expected type '"+t.name+"', but was '"+e.constructor.name+"'");return e}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var cn=function(){function e(e,t,n,r,i,a,o,s){void 0===t&&(t=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===a&&(a="F"),void 0===o&&(o=null),void 0===s&&(s=null),this.path=e,this.collectionGroup=t,this.en=n,this.filters=r,this.limit=i,this.nn=a,this.startAt=o,this.endAt=s,this.sn=null,this.rn=null,this.startAt,this.endAt}return e.prototype.on=function(t){return new e(t,null,this.en.slice(),this.filters.slice(),this.limit,this.nn,this.startAt,this.endAt)},e.prototype.hn=function(){return 0===this.filters.length&&null===this.limit&&null==this.startAt&&null==this.endAt&&(0===this.en.length||1===this.en.length&&this.en[0].field.M())},e.prototype.an=function(){return!U(this.limit)&&"F"===this.nn},e.prototype.cn=function(){return!U(this.limit)&&"L"===this.nn},e.prototype.un=function(){return this.en.length>0?this.en[0].field:null},e.prototype.ln=function(){for(var e=0,t=this.filters;e<t.length;e++){var n=t[e];if(n._n())return n.field}return null},e.prototype.fn=function(e){for(var t=0,n=this.filters;t<n.length;t++){var r=n[t];if(e.indexOf(r.op)>=0)return r.op}return null},e}();function ln(e,t,n,r,i,a,o,s){return new cn(e,t,n,r,i,a,o,s)}function un(e){return new cn(e)}function hn(e){return null!==e.collectionGroup}function dn(e){var t=sn(e,cn);if(null===t.sn){t.sn=[];var n=t.ln(),r=t.un();if(null!==n&&null===r)n.M()||t.sn.push(new Ln(n)),t.sn.push(new Ln(F.L(),"asc"));else{for(var i=!1,a=0,o=t.en;a<o.length;a++){var s=o[a];t.sn.push(s),s.field.M()&&(i=!0)}if(!i){var c=t.en.length>0?t.en[t.en.length-1].dir:"asc";t.sn.push(new Ln(F.L(),c))}}}return t.sn}function pn(e){var t=sn(e,cn);if(!t.rn)if("F"===t.nn)t.rn=H(t.path,t.collectionGroup,dn(t),t.filters,t.limit,t.startAt,t.endAt);else{for(var n=[],r=0,i=dn(t);r<i.length;r++){var a=i[r],o="desc"===a.dir?"asc":"desc";n.push(new Ln(a.field,o))}var s=t.endAt?new On(t.endAt.position,!t.endAt.before):null,c=t.startAt?new On(t.startAt.position,!t.startAt.before):null;t.rn=H(t.path,t.collectionGroup,n,t.filters,t.limit,s,c)}return t.rn}function fn(e,t,n){return new cn(e.path,e.collectionGroup,e.en.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function mn(e,t){return new cn(e.path,e.collectionGroup,e.en.slice(),e.filters.slice(),e.limit,e.nn,t,e.endAt)}function gn(e,t){return new cn(e.path,e.collectionGroup,e.en.slice(),e.filters.slice(),e.limit,e.nn,e.startAt,t)}function yn(e,t){return q(pn(e),pn(t))&&e.nn===t.nn}function vn(e){return G(pn(e))+"|lt:"+e.nn}function bn(e){return"Query(target="+function(e){var t=e.path.F();return null!==e.collectionGroup&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=", filters: ["+e.filters.map((function(e){return(t=e).field.F()+" "+t.op+" "+Le(t.value);var t})).join(", ")+"]"),U(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=", orderBy: ["+e.orderBy.map((function(e){return(t=e).field.F()+" ("+t.dir+")";var t})).join(", ")+"]"),e.startAt&&(t+=", startAt: "+Pn(e.startAt)),e.endAt&&(t+=", endAt: "+Pn(e.endAt)),"Target("+t+")"}(pn(e))+"; limitType="+e.nn+")"}function wn(e,t){return function(e,t){var n=t.key.path;return null!==e.collectionGroup?t.key.W(e.collectionGroup)&&e.path.D(n):j.j(e.path)?e.path.isEqual(n):e.path.C(n)}(e,t)&&function(e,t){for(var n=0,r=e.en;n<r.length;n++){var i=r[n];if(!i.field.M()&&null===t.field(i.field))return!1}return!0}(e,t)&&function(e,t){for(var n=0,r=e.filters;n<r.length;n++)if(!r[n].matches(t))return!1;return!0}(e,t)&&function(e,t){return!(e.startAt&&!In(e.startAt,dn(e),t)||e.endAt&&In(e.endAt,dn(e),t))}(e,t)}function An(e){return function(t,n){for(var r=!1,i=0,a=dn(e);i<a.length;i++){var o=a[i],s=Dn(o,t,n);if(0!==s)return s;r=r||o.field.M()}return 0}}var En=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).field=t,i.op=n,i.value=r,i}return i.__extends(t,e),t.create=function(e,n,r){if(e.M())return"in"===n||"not-in"===n?this.dn(e,n,r):new xn(e,n,r);if(ze(r)){if("=="!==n&&"!="!==n)throw new O(C.INVALID_ARGUMENT,"Invalid query. Null supports only equality comparisons.");return new t(e,n,r)}if(He(r)){if("=="!==n&&"!="!==n)throw new O(C.INVALID_ARGUMENT,"Invalid query. NaN supports only equality comparisons.");return new t(e,n,r)}return"array-contains"===n?new Tn(e,r):"in"===n?new Rn(e,r):"not-in"===n?new kn(e,r):"array-contains-any"===n?new Cn(e,r):new t(e,n,r)},t.dn=function(e,t,n){return"in"===t?new _n(e,n):new Sn(e,n)},t.prototype.matches=function(e){var t=e.field(this.field);return"!="===this.op?null!==t&&this.wn(Ie(t,this.value)):null!==t&&Ce(this.value)===Ce(t)&&this.wn(Ie(t,this.value))},t.prototype.wn=function(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return g()}},t.prototype._n=function(){return["<","<=",">",">=","!="].indexOf(this.op)>=0},t}((function(){})),xn=function(e){function t(t,n,r){var i=this;return(i=e.call(this,t,n,r)||this).key=j.U(r.referenceValue),i}return i.__extends(t,e),t.prototype.matches=function(e){var t=j.P(e.key,this.key);return this.wn(t)},t}(En),_n=function(e){function t(t,n){var r=this;return(r=e.call(this,t,"in",n)||this).keys=Mn("in",n),r}return i.__extends(t,e),t.prototype.matches=function(e){return this.keys.some((function(t){return t.isEqual(e.key)}))},t}(En),Sn=function(e){function t(t,n){var r=this;return(r=e.call(this,t,"not-in",n)||this).keys=Mn("not-in",n),r}return i.__extends(t,e),t.prototype.matches=function(e){return!this.keys.some((function(t){return t.isEqual(e.key)}))},t}(En);function Mn(e,t){var n;return((null===(n=t.arrayValue)||void 0===n?void 0:n.values)||[]).map((function(e){return j.U(e.referenceValue)}))}var Tn=function(e){function t(t,n){return e.call(this,t,"array-contains",n)||this}return i.__extends(t,e),t.prototype.matches=function(e){var t=e.field(this.field);return Ve(t)&&Pe(t.arrayValue,this.value)},t}(En),Rn=function(e){function t(t,n){return e.call(this,t,"in",n)||this}return i.__extends(t,e),t.prototype.matches=function(e){var t=e.field(this.field);return null!==t&&Pe(this.value.arrayValue,t)},t}(En),kn=function(e){function t(t,n){return e.call(this,t,"not-in",n)||this}return i.__extends(t,e),t.prototype.matches=function(e){var t=e.field(this.field);return null!==t&&!Pe(this.value.arrayValue,t)},t}(En),Cn=function(e){function t(t,n){return e.call(this,t,"array-contains-any",n)||this}return i.__extends(t,e),t.prototype.matches=function(e){var t=this,n=e.field(this.field);return!(!Ve(n)||!n.arrayValue.values)&&n.arrayValue.values.some((function(e){return Pe(t.value.arrayValue,e)}))},t}(En),On=function(e,t){this.position=e,this.before=t};function Pn(e){return(e.before?"b":"a")+":"+e.position.map((function(e){return Le(e)})).join(",")}function In(e,t,n){for(var r=0,i=0;i<e.position.length;i++){var a=t[i],o=e.position[i];if(r=a.field.M()?j.P(j.U(o.referenceValue),n.key):Ie(o,n.field(a.field)),"desc"===a.dir&&(r*=-1),0!==r)break}return e.before?r<=0:r<0}function Nn(e,t){if(null===e)return null===t;if(null===t)return!1;if(e.before!==t.before||e.position.length!==t.position.length)return!1;for(var n=0;n<e.position.length;n++)if(!Oe(e.position[n],t.position[n]))return!1;return!0}var Ln=function(e,t){void 0===t&&(t="asc"),this.field=e,this.dir=t};function Dn(e,t,n){var r=e.field.M()?j.P(t.key,n.key):function(e,t,n){var r=t.field(e),i=n.field(e);return null!==r&&null!==i?Ie(r,i):g()}(e.field,t,n);switch(e.dir){case"asc":return r;case"desc":return-1*r;default:return g()}}function Fn(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var jn=function(){function e(e,t,n,r){this.batchId=e,this.Tn=t,this.baseMutations=n,this.mutations=r}return e.prototype.En=function(e,t,n){for(var r=n.mn,i=0;i<this.mutations.length;i++){var a=this.mutations[i];a.key.isEqual(e)&&(t=Bt(a,t,r[i]))}return t},e.prototype.In=function(e,t){for(var n=0,r=this.baseMutations;n<r.length;n++){var i=r[n];i.key.isEqual(e)&&(t=Vt(i,t,t,this.Tn))}for(var a=t,o=0,s=this.mutations;o<s.length;o++){var c=s[o];c.key.isEqual(e)&&(t=Vt(c,t,a,this.Tn))}return t},e.prototype.An=function(e){var t=this,n=e;return this.mutations.forEach((function(r){var i=t.In(r.key,e.get(r.key));i&&(n=n.st(r.key,i))})),n},e.prototype.keys=function(){return this.mutations.reduce((function(e,t){return e.add(t.key)}),de())},e.prototype.isEqual=function(e){return this.batchId===e.batchId&&E(this.mutations,e.mutations,(function(e,t){return Ht(e,t)}))&&E(this.baseMutations,e.baseMutations,(function(e,t){return Ht(e,t)}))},e}(),Un=function(){function e(e,t,n,r){this.batch=e,this.Rn=t,this.mn=n,this.Pn=r}return e.from=function(t,n,r){y(t.mutations.length===r.length);for(var i=ue,a=t.mutations,o=0;o<a.length;o++)i=i.st(a[o].key,r[o].version);return new e(t,n,r,i)},e}(),Bn=function(){function e(e){var t=this;this.gn=null,this.Vn=null,this.result=void 0,this.error=void 0,this.yn=!1,this.pn=!1,e((function(e){t.yn=!0,t.result=e,t.gn&&t.gn(e)}),(function(e){t.yn=!0,t.error=e,t.Vn&&t.Vn(e)}))}return e.prototype.catch=function(e){return this.next(void 0,e)},e.prototype.next=function(t,n){var r=this;return this.pn&&g(),this.pn=!0,this.yn?this.error?this.bn(n,this.error):this.vn(t,this.result):new e((function(e,i){r.gn=function(n){r.vn(t,n).next(e,i)},r.Vn=function(t){r.bn(n,t).next(e,i)}}))},e.prototype.Sn=function(){var e=this;return new Promise((function(t,n){e.next(t,n)}))},e.prototype.Dn=function(t){try{var n=t();return n instanceof e?n:e.resolve(n)}catch(t){return e.reject(t)}},e.prototype.vn=function(t,n){return t?this.Dn((function(){return t(n)})):e.resolve(n)},e.prototype.bn=function(t,n){return t?this.Dn((function(){return t(n)})):e.reject(n)},e.resolve=function(t){return new e((function(e,n){e(t)}))},e.reject=function(t){return new e((function(e,n){n(t)}))},e.Cn=function(t){return new e((function(e,n){var r=0,i=0,a=!1;t.forEach((function(t){++r,t.next((function(){++i,a&&i===r&&e()}),(function(e){return n(e)}))})),a=!0,i===r&&e()}))},e.Nn=function(t){for(var n=e.resolve(!1),r=function(t){n=n.next((function(n){return n?e.resolve(n):t()}))},i=0,a=t;i<a.length;i++)r(a[i]);return n},e.forEach=function(e,t){var n=this,r=[];return e.forEach((function(e,i){r.push(t.call(n,e,i))})),this.Cn(r)},e}(),Vn=function(){function e(){this.Fn=new k((function(e){return e.toString()}),(function(e,t){return e.isEqual(t)})),this.kn=!1}return Object.defineProperty(e.prototype,"readTime",{get:function(){return this.$n},set:function(e){this.$n=e},enumerable:!1,configurable:!0}),e.prototype.xn=function(e,t){this.On(),this.readTime=t,this.Fn.set(e.key,e)},e.prototype.Mn=function(e,t){this.On(),t&&(this.readTime=t),this.Fn.set(e,null)},e.prototype.Ln=function(e,t){this.On();var n=this.Fn.get(t);return void 0!==n?Bn.resolve(n):this.qn(e,t)},e.prototype.getEntries=function(e,t){return this.Bn(e,t)},e.prototype.apply=function(e){return this.On(),this.kn=!0,this.Un(e)},e.prototype.On=function(){},e}(),zn="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",Hn=function(){function e(){this.Qn=[]}return e.prototype.Wn=function(e){this.Qn.push(e)},e.prototype.jn=function(){this.Qn.forEach((function(e){return e()}))},e}(),Gn=function(){function e(e,t,n){this.Kn=e,this.Gn=t,this.zn=n}return e.prototype.Hn=function(e,t){var n=this;return this.Gn.Yn(e,t).next((function(r){return n.Jn(e,t,r)}))},e.prototype.Jn=function(e,t,n){return this.Kn.Ln(e,t).next((function(e){for(var r=0,i=n;r<i.length;r++)e=i[r].In(t,e);return e}))},e.prototype.Xn=function(e,t,n){var r=se();return t.forEach((function(e,t){for(var i=0,a=n;i<a.length;i++)t=a[i].In(e,t);r=r.st(e,t)})),r},e.prototype.Zn=function(e,t){var n=this;return this.Kn.getEntries(e,t).next((function(t){return n.ts(e,t)}))},e.prototype.ts=function(e,t){var n=this;return this.Gn.es(e,t).next((function(r){var i=n.Xn(e,t,r),a=oe();return i.forEach((function(e,t){t||(t=new an(e,I.min())),a=a.st(e,t)})),a}))},e.prototype.ns=function(e,t,n){return function(e){return j.j(e.path)&&null===e.collectionGroup&&0===e.filters.length}(t)?this.ss(e,t.path):hn(t)?this.rs(e,t,n):this.os(e,t,n)},e.prototype.ss=function(e,t){return this.Hn(e,new j(t)).next((function(e){var t=le();return e instanceof rn&&(t=t.st(e.key,e)),t}))},e.prototype.rs=function(e,t,n){var r=this,i=t.collectionGroup,a=le();return this.zn.hs(e,i).next((function(o){return Bn.forEach(o,(function(o){var s=t.on(o.child(i));return r.os(e,s,n).next((function(e){e.forEach((function(e,t){a=a.st(e,t)}))}))})).next((function(){return a}))}))},e.prototype.os=function(e,t,n){var r,i,a=this;return this.Kn.ns(e,t,n).next((function(n){return r=n,a.Gn.as(e,t)})).next((function(t){return i=t,a.cs(e,i,r).next((function(e){r=e;for(var t=0,n=i;t<n.length;t++)for(var a=n[t],o=0,s=a.mutations;o<s.length;o++){var c=s[o],l=c.key,u=r.get(l),h=Vt(c,u,u,a.Tn);r=h instanceof rn?r.st(l,h):r.remove(l)}}))})).next((function(){return r.forEach((function(e,n){wn(t,n)||(r=r.remove(e))})),r}))},e.prototype.cs=function(e,t,n){for(var r=de(),i=0,a=t;i<a.length;i++)for(var o=0,s=a[i].mutations;o<s.length;o++){var c=s[o];c instanceof Wt&&null===n.get(c.key)&&(r=r.add(c.key))}var l=n;return this.Kn.getEntries(e,r).next((function(e){return e.forEach((function(e,t){null!==t&&t instanceof rn&&(l=l.st(e,t))})),l}))},e}(),qn=function(){function e(e,t,n,r){this.targetId=e,this.fromCache=t,this.us=n,this.ls=r}return e._s=function(t,n){for(var r=de(),i=de(),a=0,o=n.docChanges;a<o.length;a++){var s=o[a];switch(s.type){case 0:r=r.add(s.doc.key);break;case 1:i=i.add(s.doc.key)}}return new e(t,n.fromCache,r,i)},e}(),Wn=function(){function e(e,t){var n=this;this.previousValue=e,t&&(t.fs=function(e){return n.ds(e)},this.ws=function(e){return t.Ts(e)})}return e.prototype.ds=function(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue},e.prototype.next=function(){var e=++this.previousValue;return this.ws&&this.ws(e),e},e}();Wn.Es=-1;
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var Jn=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))},Zn=function(){function e(e,t,n,r,i){void 0===n&&(n=1e3),void 0===r&&(r=1.5),void 0===i&&(i=6e4),this.ms=e,this.Is=t,this.As=n,this.Rs=r,this.Ps=i,this.gs=0,this.Vs=null,this.ys=Date.now(),this.reset()}return e.prototype.reset=function(){this.gs=0},e.prototype.ps=function(){this.gs=this.Ps},e.prototype.bs=function(e){var t=this;this.cancel();var n=Math.floor(this.gs+this.vs()),r=Math.max(0,Date.now()-this.ys),i=Math.max(0,n-r);i>0&&d("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.gs+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.Vs=this.ms.Ss(this.Is,i,(function(){return t.ys=Date.now(),e()})),this.gs*=this.Rs,this.gs<this.As&&(this.gs=this.As),this.gs>this.Ps&&(this.gs=this.Ps)},e.prototype.Ds=function(){null!==this.Vs&&(this.Vs.Cs(),this.Vs=null)},e.prototype.cancel=function(){null!==this.Vs&&(this.Vs.cancel(),this.Vs=null)},e.prototype.vs=function(){return(Math.random()-.5)*this.gs},e}(),Xn=function(){function t(e,n,r){this.name=e,this.version=n,this.Ns=r,12.2===t.Fs(s.getUA())&&p("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}return t.delete=function(e){return d("SimpleDb","Removing database:",e),tr(window.indexedDB.deleteDatabase(e)).Sn()},t.ks=function(){if("undefined"==typeof indexedDB)return!1;if(t.$s())return!0;var e=s.getUA(),n=t.Fs(e),r=0<n&&n<10,i=t.xs(e),a=0<i&&i<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||a)},t.$s=function(){var t;return void 0!==e&&"YES"===(null===(t=e.env)||void 0===t?void 0:t.Os)},t.Ms=function(e,t){return e.store(t)},t.Fs=function(e){var t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(n)},t.xs=function(e){var t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)},t.prototype.Ls=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t=this;return i.__generator(this,(function(n){switch(n.label){case 0:return this.db?[3,2]:(d("SimpleDb","Opening database:",this.name),e=this,[4,new Promise((function(e,n){var r=indexedDB.open(t.name,t.version);r.onsuccess=function(t){var n=t.target.result;e(n)},r.onblocked=function(){n(new Kn("Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},r.onerror=function(e){var t=e.target.error;"VersionError"===t.name?n(new O(C.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):n(new Kn(t))},r.onupgradeneeded=function(e){d("SimpleDb",'Database "'+t.name+'" requires upgrade from version:',e.oldVersion);var n=e.target.result;t.Ns.createOrUpgrade(n,r.transaction,e.oldVersion,t.version).next((function(){d("SimpleDb","Database upgrade to version "+t.version+" complete")}))}}))]);case 1:e.db=n.sent(),n.label=2;case 2:return[2,(this.qs&&(this.db.onversionchange=function(e){return t.qs(e)}),this.db)]}}))}))},t.prototype.Bs=function(e){this.qs=e,this.db&&(this.db.onversionchange=function(t){return e(t)})},t.prototype.runTransaction=function(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var r,a,o,s,c;return i.__generator(this,(function(l){switch(l.label){case 0:r="readonly"===e,a=0,o=function(){var e,o,c,l,u;return i.__generator(this,(function(i){switch(i.label){case 0:++a,i.label=1;case 1:return i.trys.push([1,4,,5]),[4,s.Ls()];case 2:return s.db=i.sent(),e=$n.open(s.db,r?"readonly":"readwrite",t),o=n(e).catch((function(t){return e.abort(t),Bn.reject(t)})).Sn(),c={},o.catch((function(){})),[4,e.Us];case 3:return[2,(c.value=(i.sent(),o),c)];case 4:return l=i.sent(),u="FirebaseError"!==l.name&&a<3,d("SimpleDb","Transaction failed with error: %s. Retrying: %s.",l.message,u),s.close(),u?[3,5]:[2,{value:Promise.reject(l)}];case 5:return[2]}}))},s=this,l.label=1;case 1:return[5,o()];case 2:if("object"==typeof(c=l.sent()))return[2,c.value];l.label=3;case 3:return[3,1];case 4:return[2]}}))}))},t.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},t}(),Yn=function(){function e(e){this.Qs=e,this.Ws=!1,this.js=null}return Object.defineProperty(e.prototype,"yn",{get:function(){return this.Ws},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Ks",{get:function(){return this.js},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cursor",{set:function(e){this.Qs=e},enumerable:!1,configurable:!0}),e.prototype.done=function(){this.Ws=!0},e.prototype.Gs=function(e){this.js=e},e.prototype.delete=function(){return tr(this.Qs.delete())},e}(),Kn=function(e){function t(t){var n=this;return(n=e.call(this,C.UNAVAILABLE,"IndexedDB transaction failed: "+t)||this).name="IndexedDbTransactionError",n}return i.__extends(t,e),t}(O);
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function Qn(e){return"IndexedDbTransactionError"===e.name}var $n=function(){function e(e){var t=this;this.transaction=e,this.aborted=!1,this.zs=new Jn,this.transaction.oncomplete=function(){t.zs.resolve()},this.transaction.onabort=function(){e.error?t.zs.reject(new Kn(e.error)):t.zs.resolve()},this.transaction.onerror=function(e){var n=rr(e.target.error);t.zs.reject(new Kn(n))}}return e.open=function(t,n,r){try{return new e(t.transaction(r,n))}catch(t){throw new Kn(t)}},Object.defineProperty(e.prototype,"Us",{get:function(){return this.zs.promise},enumerable:!1,configurable:!0}),e.prototype.abort=function(e){e&&this.zs.reject(e),this.aborted||(d("SimpleDb","Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},e.prototype.store=function(e){var t=this.transaction.objectStore(e);return new er(t)},e}(),er=function(){function e(e){this.store=e}return e.prototype.put=function(e,t){var n;return void 0!==t?(d("SimpleDb","PUT",this.store.name,e,t),n=this.store.put(t,e)):(d("SimpleDb","PUT",this.store.name,"<auto-key>",e),n=this.store.put(e)),tr(n)},e.prototype.add=function(e){return d("SimpleDb","ADD",this.store.name,e,e),tr(this.store.add(e))},e.prototype.get=function(e){var t=this;return tr(this.store.get(e)).next((function(n){return void 0===n&&(n=null),d("SimpleDb","GET",t.store.name,e,n),n}))},e.prototype.delete=function(e){return d("SimpleDb","DELETE",this.store.name,e),tr(this.store.delete(e))},e.prototype.count=function(){return d("SimpleDb","COUNT",this.store.name),tr(this.store.count())},e.prototype.Hs=function(e,t){var n=this.cursor(this.options(e,t)),r=[];return this.Ys(n,(function(e,t){r.push(t)})).next((function(){return r}))},e.prototype.Js=function(e,t){d("SimpleDb","DELETE ALL",this.store.name);var n=this.options(e,t);n.Xs=!1;var r=this.cursor(n);return this.Ys(r,(function(e,t,n){return n.delete()}))},e.prototype.Zs=function(e,t){var n;t?n=e:(n={},t=e);var r=this.cursor(n);return this.Ys(r,t)},e.prototype.ti=function(e){var t=this.cursor({});return new Bn((function(n,r){t.onerror=function(e){var t=rr(e.target.error);r(t)},t.onsuccess=function(t){var r=t.target.result;r?e(r.primaryKey,r.value).next((function(e){e?r.continue():n()})):n()}}))},e.prototype.Ys=function(e,t){var n=[];return new Bn((function(r,i){e.onerror=function(e){i(e.target.error)},e.onsuccess=function(e){var i=e.target.result;if(i){var a=new Yn(i),o=t(i.primaryKey,i.value,a);if(o instanceof Bn){var s=o.catch((function(e){return a.done(),Bn.reject(e)}));n.push(s)}a.yn?r():null===a.Ks?i.continue():i.continue(a.Ks)}else r()}})).next((function(){return Bn.Cn(n)}))},e.prototype.options=function(e,t){var n=void 0;return void 0!==e&&("string"==typeof e?n=e:t=e),{index:n,range:t}},e.prototype.cursor=function(e){var t="next";if(e.reverse&&(t="prev"),e.index){var n=this.store.index(e.index);return e.Xs?n.openKeyCursor(e.range,t):n.openCursor(e.range,t)}return this.store.openCursor(e.range,t)},e}();function tr(e){return new Bn((function(t,n){e.onsuccess=function(e){var n=e.target.result;t(n)},e.onerror=function(e){var t=rr(e.target.error);n(t)}}))}var nr=!1;function rr(e){var t=Xn.Fs(s.getUA());if(t>=12.2&&t<13){var n="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(n)>=0){var r=new O("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+n+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return nr||(nr=!0,setTimeout((function(){throw r}),0)),r}}return e}
+/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function ir(){return"undefined"!=typeof window?window:null}function ar(){return"undefined"!=typeof document?document:null}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var or=function(){function e(e,t,n,r,i){this.ei=e,this.Is=t,this.ni=n,this.op=r,this.si=i,this.ii=new Jn,this.then=this.ii.promise.then.bind(this.ii.promise),this.ii.promise.catch((function(e){}))}return e.ri=function(t,n,r,i,a){var o=new e(t,n,Date.now()+r,i,a);return o.start(r),o},e.prototype.start=function(e){var t=this;this.oi=setTimeout((function(){return t.hi()}),e)},e.prototype.Cs=function(){return this.hi()},e.prototype.cancel=function(e){null!==this.oi&&(this.clearTimeout(),this.ii.reject(new O(C.CANCELLED,"Operation cancelled"+(e?": "+e:""))))},e.prototype.hi=function(){var e=this;this.ei.ai((function(){return null!==e.oi?(e.clearTimeout(),e.op().then((function(t){return e.ii.resolve(t)}))):Promise.resolve()}))},e.prototype.clearTimeout=function(){null!==this.oi&&(this.si(this),clearTimeout(this.oi),this.oi=null)},e}(),sr=function(){function e(){var e=this;this.ci=Promise.resolve(),this.ui=[],this.li=!1,this._i=[],this.fi=null,this.di=!1,this.wi=[],this.Ti=new Zn(this,"async_queue_retry"),this.Ei=function(){var t=ar();t&&d("AsyncQueue","Visibility state changed to ",t.visibilityState),e.Ti.Ds()};var t=ar();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.Ei)}return Object.defineProperty(e.prototype,"mi",{get:function(){return this.li},enumerable:!1,configurable:!0}),e.prototype.ai=function(e){this.enqueue(e)},e.prototype.Ii=function(e){this.Ai(),this.Ri(e)},e.prototype.Pi=function(){if(!this.li){this.li=!0;var e=ar();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("visibilitychange",this.Ei)}},e.prototype.enqueue=function(e){return this.Ai(),this.li?new Promise((function(e){})):this.Ri(e)},e.prototype.gi=function(e){var t=this;this.ui.push(e),this.ai((function(){return t.Vi()}))},e.prototype.Vi=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t=this;return i.__generator(this,(function(n){switch(n.label){case 0:if(0===this.ui.length)return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.ui[0]()];case 2:return n.sent(),this.ui.shift(),this.Ti.reset(),[3,4];case 3:if(!Qn(e=n.sent()))throw e;return d("AsyncQueue","Operation failed with retryable error: "+e),[3,4];case 4:this.ui.length>0&&this.Ti.bs((function(){return t.Vi()})),n.label=5;case 5:return[2]}}))}))},e.prototype.Ri=function(e){var t=this,n=this.ci.then((function(){return t.di=!0,e().catch((function(e){throw t.fi=e,t.di=!1,p("INTERNAL UNHANDLED ERROR: ",function(e){var t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}(e)),e})).then((function(e){return t.di=!1,e}))}));return this.ci=n,n},e.prototype.Ss=function(e,t,n){var r=this;this.Ai(),this.wi.indexOf(e)>-1&&(t=0);var i=or.ri(this,e,t,n,(function(e){return r.yi(e)}));return this._i.push(i),i},e.prototype.Ai=function(){this.fi&&g()},e.prototype.pi=function(){},e.prototype.bi=function(){return i.__awaiter(this,void 0,void 0,(function(){var e;return i.__generator(this,(function(t){switch(t.label){case 0:return[4,e=this.ci];case 1:t.sent(),t.label=2;case 2:if(e!==this.ci)return[3,0];t.label=3;case 3:return[2]}}))}))},e.prototype.vi=function(e){for(var t=0,n=this._i;t<n.length;t++)if(n[t].Is===e)return!0;return!1},e.prototype.Si=function(e){var t=this;return this.bi().then((function(){t._i.sort((function(e,t){return e.ni-t.ni}));for(var n=0,r=t._i;n<r.length;n++){var i=r[n];if(i.Cs(),"all"!==e&&i.Is===e)break}return t.bi()}))},e.prototype.Di=function(e){this.wi.push(e)},e.prototype.yi=function(e){var t=this._i.indexOf(e);this._i.splice(t,1)},e}();function cr(e,t){if(p("AsyncQueue",t+": "+e),Qn(e))return new O(C.UNAVAILABLE,t+": "+e);throw e}function lr(e,t){var n=e[0],r=e[1],i=t[0],a=t[1],o=A(n,i);return 0===o?A(r,a):o}var ur=function(){function e(e){this.Ci=e,this.buffer=new re(lr),this.Ni=0}return e.prototype.Fi=function(){return++this.Ni},e.prototype.ki=function(e){var t=[e,this.Fi()];if(this.buffer.size<this.Ci)this.buffer=this.buffer.add(t);else{var n=this.buffer.last();lr(t,n)<0&&(this.buffer=this.buffer.delete(n).add(t))}},Object.defineProperty(e.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!1,configurable:!0}),e}(),hr={$i:!1,xi:0,Oi:0,Mi:0},dr=function(){function e(e,t,n){this.Li=e,this.qi=t,this.Bi=n}return e.Ui=function(t){return new e(t,e.Qi,e.Wi)},e}();dr.ji=-1,dr.Ki=1048576,dr.Gi=41943040,dr.Qi=10,dr.Wi=1e3,dr.zi=new dr(dr.Gi,dr.Qi,dr.Wi),dr.Hi=new dr(dr.ji,0,0);var pr=function(){function e(e,t){this.Yi=e,this.ei=t,this.Ji=!1,this.Xi=null}return e.prototype.start=function(e){this.Yi.params.Li!==dr.ji&&this.Zi(e)},e.prototype.stop=function(){this.Xi&&(this.Xi.cancel(),this.Xi=null)},Object.defineProperty(e.prototype,"tr",{get:function(){return null!==this.Xi},enumerable:!1,configurable:!0}),e.prototype.Zi=function(e){var t=this,n=this.Ji?3e5:6e4;d("LruGarbageCollector","Garbage collection scheduled in "+n+"ms"),this.Xi=this.ei.Ss("lru_garbage_collection",n,(function(){return i.__awaiter(t,void 0,void 0,(function(){var t;return i.__generator(this,(function(n){switch(n.label){case 0:this.Xi=null,this.Ji=!0,n.label=1;case 1:return n.trys.push([1,3,,7]),[4,e.er(this.Yi)];case 2:return n.sent(),[3,7];case 3:return Qn(t=n.sent())?(d("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",t),[3,6]):[3,4];case 4:return[4,ki(t)];case 5:n.sent(),n.label=6;case 6:return[3,7];case 7:return[4,this.Zi(e)];case 8:return n.sent(),[2]}}))}))}))},e}(),fr=function(){function e(e,t){this.nr=e,this.params=t}return e.prototype.sr=function(e,t){return this.nr.ir(e).next((function(e){return Math.floor(t/100*e)}))},e.prototype.rr=function(e,t){var n=this;if(0===t)return Bn.resolve(Wn.Es);var r=new ur(t);return this.nr.be(e,(function(e){return r.ki(e.sequenceNumber)})).next((function(){return n.nr.or(e,(function(e){return r.ki(e)}))})).next((function(){return r.maxValue}))},e.prototype.hr=function(e,t,n){return this.nr.hr(e,t,n)},e.prototype.ar=function(e,t){return this.nr.ar(e,t)},e.prototype.cr=function(e,t){var n=this;return this.params.Li===dr.ji?(d("LruGarbageCollector","Garbage collection skipped; disabled"),Bn.resolve(hr)):this.ur(e).next((function(r){return r<n.params.Li?(d("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+n.params.Li),hr):n.lr(e,t)}))},e.prototype.ur=function(e){return this.nr.ur(e)},e.prototype.lr=function(e,t){var n,r,i,a,s,c,l,u=this,p=Date.now();return this.sr(e,this.params.qi).next((function(t){return t>u.params.Bi?(d("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+u.params.Bi+" from "+t),r=u.params.Bi):r=t,a=Date.now(),u.rr(e,r)})).next((function(r){return n=r,s=Date.now(),u.hr(e,n,t)})).next((function(t){return i=t,c=Date.now(),u.ar(e,n)})).next((function(e){return l=Date.now(),h()<=o.LogLevel.DEBUG&&d("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(a-p)+"ms\n\tDetermined least recently used "+r+" in "+(s-a)+"ms\n\tRemoved "+i+" targets in "+(c-s)+"ms\n\tRemoved "+e+" documents in "+(l-c)+"ms\nTotal Duration: "+(l-p)+"ms"),Bn.resolve({$i:!0,xi:r,Oi:i,Mi:e})}))},e}();
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function mr(e){for(var t="",n=0;n<e.length;n++)t.length>0&&(t=yr(t)),t=gr(e.get(n),t);return yr(t)}function gr(e,t){for(var n=t,r=e.length,i=0;i<r;i++){var a=e.charAt(i);switch(a){case"\0":n+="";break;case"":n+="";break;default:n+=a}}return n}function yr(e){return e+""}function vr(e){var t=e.length;if(y(t>=2),2===t)return y(""===e.charAt(0)&&""===e.charAt(1)),L.$();for(var n=t-2,r=[],i="",a=0;a<t;){var o=e.indexOf("",a);switch((o<0||o>n)&&g(),e.charAt(o+1)){case"":var s=e.substring(a,o),c=void 0;0===i.length?c=s:(c=i+=s,i=""),r.push(c);break;case"":i+=e.substring(a,o),i+="\0";break;case"":i+=e.substring(a,o+1);break;default:g()}a=o+2}return new L(r)}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var br=function(e){this._r=e};function wr(e,t){if(t.document)return function(e,t,n){var r=it(e,t.name),i=et(t.updateTime),a=new $t({mapValue:{fields:t.fields}});return new rn(r,i,a,{hasCommittedMutations:!!n})}(e._r,t.document,!!t.hasCommittedMutations);if(t.noDocument){var n=j.K(t.noDocument.path),r=Sr(t.noDocument.readTime);return new an(n,r,{hasCommittedMutations:!!t.hasCommittedMutations})}if(t.unknownDocument){var i=j.K(t.unknownDocument.path),a=Sr(t.unknownDocument.version);return new on(i,a)}return g()}function Ar(e,t,n){var r=Er(n),i=t.key.path.p().N();if(t instanceof rn){var a=function(e,t){return{name:rt(e,t.key),fields:t.tn().mapValue.fields,updateTime:Ke(e,t.version.A())}}(e._r,t),o=t.hasCommittedMutations;return new Yr(null,null,a,o,r,i)}if(t instanceof an){var s=t.key.path.N(),c=_r(t.version),l=t.hasCommittedMutations;return new Yr(null,new Zr(s,c),null,l,r,i)}if(t instanceof on){var u=t.key.path.N(),h=_r(t.version);return new Yr(new Xr(u,h),null,null,!0,r,i)}return g()}function Er(e){var t=e.A();return[t.seconds,t.nanoseconds]}function xr(e){var t=new P(e[0],e[1]);return I.m(t)}function _r(e){var t=e.A();return new Hr(t.seconds,t.nanoseconds)}function Sr(e){var t=new P(e.seconds,e.nanoseconds);return I.m(t)}function Mr(e,t){var n=(t.baseMutations||[]).map((function(t){return ht(e._r,t)})),r=t.mutations.map((function(t){return ht(e._r,t)})),i=P.fromMillis(t.localWriteTimeMs);return new jn(t.batchId,i,n,r)}function Tr(e){var t,n,r=Sr(e.readTime),i=void 0!==e.lastLimboFreeSnapshotVersion?Sr(e.lastLimboFreeSnapshotVersion):I.min();return void 0!==e.query.documents?(y(1===(n=e.query).documents.length),t=pn(un(ot(n.documents[0])))):t=function(e){var t=ot(e.parent),n=e.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){y(1===r);var a=n.from[0];a.allDescendants?i=a.collectionId:t=t.child(a.collectionId)}var o=[];n.where&&(o=function e(t){return t?void 0!==t.unaryFilter?[bt(t)]:void 0!==t.fieldFilter?[vt(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((function(t){return e(t)})).reduce((function(e,t){return e.concat(t)})):g():[]}(n.where));var s=[];n.orderBy&&(s=n.orderBy.map((function(e){return new Ln(yt((t=e).field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction));var t})));var c=null;n.limit&&(c=function(e){var t;return U(t="object"==typeof e?e.value:e)?null:t}(n.limit));var l=null;n.startAt&&(l=mt(n.startAt));var u=null;return n.endAt&&(u=mt(n.endAt)),pn(ln(t,i,s,o,c,"F",l,u))}(e.query),new Y(t,e.targetId,0,e.lastListenSequenceNumber,r,i,J.fromBase64String(e.resumeToken))}function Rr(e,t){var n,r=_r(t.Z),i=_r(t.lastLimboFreeSnapshotVersion);n=W(t.target)?dt(e._r,t.target):pt(e._r,t.target);var a=t.resumeToken.toBase64();return new Qr(t.targetId,G(t.target),r,a,t.sequenceNumber,i,n)}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var kr=function(){function e(e,t,n,r){this.userId=e,this.serializer=t,this.zn=n,this.dr=r,this.wr={}}return e.Tr=function(t,n,r,i){return y(""!==t.uid),new e(t.Er()?t.uid:"",n,r,i)},e.prototype.mr=function(e){var t=!0,n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return Pr(e).Zs({index:Wr.userMutationsIndex,range:n},(function(e,n,r){t=!1,r.done()})).next((function(){return t}))},e.prototype.Ir=function(e,t,n,r){var i=this,a=Ir(e),o=Pr(e);return o.add({}).next((function(s){y("number"==typeof s);for(var c=new jn(s,t,n,r),l=function(e,t,n){var r=n.baseMutations.map((function(t){return ut(e._r,t)})),i=n.mutations.map((function(t){return ut(e._r,t)}));return new Wr(t,n.batchId,n.Tn.toMillis(),r,i)}(i.serializer,i.userId,c),u=[],h=new re((function(e,t){return A(e.F(),t.F())})),d=0,p=r;d<p.length;d++){var f=p[d],m=Jr.key(i.userId,f.key.path,s);h=h.add(f.key.path.p()),u.push(o.put(l)),u.push(a.put(m,Jr.PLACEHOLDER))}return h.forEach((function(t){u.push(i.zn.Ar(e,t))})),e.Wn((function(){i.wr[s]=c.keys()})),Bn.Cn(u).next((function(){return c}))}))},e.prototype.Rr=function(e,t){var n=this;return Pr(e).get(t).next((function(e){return e?(y(e.userId===n.userId),Mr(n.serializer,e)):null}))},e.prototype.Pr=function(e,t){var n=this;return this.wr[t]?Bn.resolve(this.wr[t]):this.Rr(e,t).next((function(e){if(e){var r=e.keys();return n.wr[t]=r,r}return null}))},e.prototype.gr=function(e,t){var n=this,r=t+1,i=IDBKeyRange.lowerBound([this.userId,r]),a=null;return Pr(e).Zs({index:Wr.userMutationsIndex,range:i},(function(e,t,i){t.userId===n.userId&&(y(t.batchId>=r),a=Mr(n.serializer,t)),i.done()})).next((function(){return a}))},e.prototype.Vr=function(e){var t=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),n=-1;return Pr(e).Zs({index:Wr.userMutationsIndex,range:t,reverse:!0},(function(e,t,r){n=t.batchId,r.done()})).next((function(){return n}))},e.prototype.yr=function(e){var t=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return Pr(e).Hs(Wr.userMutationsIndex,n).next((function(e){return e.map((function(e){return Mr(t.serializer,e)}))}))},e.prototype.Yn=function(e,t){var n=this,r=Jr.prefixForPath(this.userId,t.path),i=IDBKeyRange.lowerBound(r),a=[];return Ir(e).Zs({range:i},(function(r,i,o){var s=r[0],c=r[1],l=r[2],u=vr(c);if(s===n.userId&&t.path.isEqual(u))return Pr(e).get(l).next((function(e){if(!e)throw g();y(e.userId===n.userId),a.push(Mr(n.serializer,e))}));o.done()})).next((function(){return a}))},e.prototype.es=function(e,t){var n=this,r=new re(A),i=[];return t.forEach((function(t){var a=Jr.prefixForPath(n.userId,t.path),o=IDBKeyRange.lowerBound(a),s=Ir(e).Zs({range:o},(function(e,i,a){var o=e[0],s=e[1],c=e[2],l=vr(s);o===n.userId&&t.path.isEqual(l)?r=r.add(c):a.done()}));i.push(s)})),Bn.Cn(i).next((function(){return n.pr(e,r)}))},e.prototype.as=function(e,t){var n=this,r=t.path,i=r.length+1,a=Jr.prefixForPath(this.userId,r),o=IDBKeyRange.lowerBound(a),s=new re(A);return Ir(e).Zs({range:o},(function(e,t,a){var o=e[0],c=e[1],l=e[2],u=vr(c);o===n.userId&&r.D(u)?u.length===i&&(s=s.add(l)):a.done()})).next((function(){return n.pr(e,s)}))},e.prototype.pr=function(e,t){var n=this,r=[],i=[];return t.forEach((function(t){i.push(Pr(e).get(t).next((function(e){if(null===e)throw g();y(e.userId===n.userId),r.push(Mr(n.serializer,e))})))})),Bn.Cn(i).next((function(){return r}))},e.prototype.br=function(e,t){var n=this;return Or(e.vr,this.userId,t).next((function(r){return e.Wn((function(){n.Sr(t.batchId)})),Bn.forEach(r,(function(t){return n.dr.Dr(e,t)}))}))},e.prototype.Sr=function(e){delete this.wr[e]},e.prototype.Cr=function(e){var t=this;return this.mr(e).next((function(n){if(!n)return Bn.resolve();var r=IDBKeyRange.lowerBound(Jr.prefixForUser(t.userId)),i=[];return Ir(e).Zs({range:r},(function(e,n,r){if(e[0]===t.userId){var a=vr(e[1]);i.push(a)}else r.done()})).next((function(){y(0===i.length)}))}))},e.prototype.Nr=function(e,t){return Cr(e,this.userId,t)},e.prototype.Fr=function(e){var t=this;return Nr(e).get(this.userId).next((function(e){return e||new qr(t.userId,-1,"")}))},e}();function Cr(e,t,n){var r=Jr.prefixForPath(t,n.path),i=r[1],a=IDBKeyRange.lowerBound(r),o=!1;return Ir(e).Zs({range:a,Xs:!0},(function(e,n,r){var a=e[0],s=e[1];e[2],a===t&&s===i&&(o=!0),r.done()})).next((function(){return o}))}function Or(e,t,n){var r=e.store(Wr.store),i=e.store(Jr.store),a=[],o=IDBKeyRange.only(n.batchId),s=0,c=r.Zs({range:o},(function(e,t,n){return s++,n.delete()}));a.push(c.next((function(){y(1===s)})));for(var l=[],u=0,h=n.mutations;u<h.length;u++){var d=h[u],p=Jr.key(t,d.key.path,n.batchId);a.push(i.delete(p)),l.push(d.key)}return Bn.Cn(a).next((function(){return l}))}function Pr(e){return fi.Ms(e,Wr.store)}function Ir(e){return fi.Ms(e,Jr.store)}function Nr(e){return fi.Ms(e,qr.store)}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var Lr=function(){function e(e,t){this.serializer=e,this.zn=t}return e.prototype.xn=function(e,t,n){return Fr(e).put(jr(t),n)},e.prototype.Mn=function(e,t){var n=Fr(e),r=jr(t);return n.delete(r)},e.prototype.updateMetadata=function(e,t){var n=this;return this.getMetadata(e).next((function(r){return r.byteSize+=t,n.kr(e,r)}))},e.prototype.Ln=function(e,t){var n=this;return Fr(e).get(jr(t)).next((function(e){return n.$r(e)}))},e.prototype.xr=function(e,t){var n=this;return Fr(e).get(jr(t)).next((function(e){var t=n.$r(e);return t?{Or:t,size:Ur(e)}:null}))},e.prototype.getEntries=function(e,t){var n=this,r=se();return this.Mr(e,t,(function(e,t){var i=n.$r(t);r=r.st(e,i)})).next((function(){return r}))},e.prototype.Lr=function(e,t){var n=this,r=se(),i=new ee(j.P);return this.Mr(e,t,(function(e,t){var a=n.$r(t);a?(r=r.st(e,a),i=i.st(e,Ur(t))):(r=r.st(e,null),i=i.st(e,0))})).next((function(){return{qr:r,Br:i}}))},e.prototype.Mr=function(e,t,n){if(t._())return Bn.resolve();var r=IDBKeyRange.bound(t.first().path.N(),t.last().path.N()),i=t.ct(),a=i.wt();return Fr(e).Zs({range:r},(function(e,t,r){for(var o=j.K(e);a&&j.P(a,o)<0;)n(a,null),a=i.wt();a&&a.isEqual(o)&&(n(a,t),a=i.Tt()?i.wt():null),a?r.Gs(a.path.N()):r.done()})).next((function(){for(;a;)n(a,null),a=i.Tt()?i.wt():null}))},e.prototype.ns=function(e,t,n){var r=this,i=le(),a=t.path.length+1,o={};if(n.isEqual(I.min())){var s=t.path.N();o.range=IDBKeyRange.lowerBound(s)}else{var c=t.path.N(),l=Er(n);o.range=IDBKeyRange.lowerBound([c,l],!0),o.index=Yr.collectionReadTimeIndex}return Fr(e).Zs(o,(function(e,n,o){if(e.length===a){var s=wr(r.serializer,n);t.path.D(s.key.path)?s instanceof rn&&wn(t,s)&&(i=i.st(s.key,s)):o.done()}})).next((function(){return i}))},e.prototype.Ur=function(e,t){var n=this,r=oe(),i=Er(t),a=Fr(e),o=IDBKeyRange.lowerBound(i,!0);return a.Zs({index:Yr.readTimeIndex,range:o},(function(e,t){var a=wr(n.serializer,t);r=r.st(a.key,a),i=t.readTime})).next((function(){return{Qr:r,readTime:xr(i)}}))},e.prototype.Wr=function(e){var t=Fr(e),n=I.min();return t.Zs({index:Yr.readTimeIndex,reverse:!0},(function(e,t,r){t.readTime&&(n=xr(t.readTime)),r.done()})).next((function(){return n}))},e.prototype.jr=function(t){return new e.Kr(this,!!t&&t.Gr)},e.prototype.zr=function(e){return this.getMetadata(e).next((function(e){return e.byteSize}))},e.prototype.getMetadata=function(e){return Dr(e).get(Kr.key).next((function(e){return y(!!e),e}))},e.prototype.kr=function(e,t){return Dr(e).put(Kr.key,t)},e.prototype.$r=function(e){if(e){var t=wr(this.serializer,e);return t instanceof an&&t.version.isEqual(I.min())?null:t}return null},e}();function Dr(e){return fi.Ms(e,Kr.store)}function Fr(e){return fi.Ms(e,Yr.store)}function jr(e){return e.path.N()}function Ur(e){var t;if(e.document)t=e.document;else if(e.unknownDocument)t=e.unknownDocument;else{if(!e.noDocument)throw g();t=e.noDocument}return JSON.stringify(t).length}
+/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */Lr.Kr=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).Hr=t,r.Gr=n,r.Yr=new k((function(e){return e.toString()}),(function(e,t){return e.isEqual(t)})),r}return i.__extends(t,e),t.prototype.Un=function(e){var t=this,n=[],r=0,i=new re((function(e,t){return A(e.F(),t.F())}));return this.Fn.forEach((function(a,o){var s=t.Yr.get(a);if(o){var c=Ar(t.Hr.serializer,o,t.readTime);i=i.add(a.path.p());var l=Ur(c);r+=l-s,n.push(t.Hr.xn(e,a,c))}else if(r-=s,t.Gr){var u=Ar(t.Hr.serializer,new an(a,I.min()),t.readTime);n.push(t.Hr.xn(e,a,u))}else n.push(t.Hr.Mn(e,a))})),i.forEach((function(r){n.push(t.Hr.zn.Ar(e,r))})),n.push(this.Hr.updateMetadata(e,r)),Bn.Cn(n)},t.prototype.qn=function(e,t){var n=this;return this.Hr.xr(e,t).next((function(e){return null===e?(n.Yr.set(t,0),null):(n.Yr.set(t,e.size),e.Or)}))},t.prototype.Bn=function(e,t){var n=this;return this.Hr.Lr(e,t).next((function(e){var t=e.qr;return e.Br.forEach((function(e,t){n.Yr.set(e,t)})),t}))},t}(Vn);var Br=function(){function e(){this.Jr=new Vr}return e.prototype.Ar=function(e,t){return this.Jr.add(t),Bn.resolve()},e.prototype.hs=function(e,t){return Bn.resolve(this.Jr.getEntries(t))},e}(),Vr=function(){function e(){this.index={}}return e.prototype.add=function(e){var t=e.S(),n=e.p(),r=this.index[t]||new re(L.P),i=!r.has(n);return this.index[t]=r.add(n),i},e.prototype.has=function(e){var t=e.S(),n=e.p(),r=this.index[t];return r&&r.has(n)},e.prototype.getEntries=function(e){return(this.index[e]||new re(L.P)).N()},e}(),zr=function(){function e(e){this.serializer=e}return e.prototype.createOrUpgrade=function(e,t,n,r){var i=this;y(n<r&&n>=0&&r<=10);var a=new $n(t);n<1&&r>=1&&(function(e){e.createObjectStore(Gr.store)}(e),function(e){e.createObjectStore(qr.store,{keyPath:qr.keyPath}),e.createObjectStore(Wr.store,{keyPath:Wr.keyPath,autoIncrement:!0}).createIndex(Wr.userMutationsIndex,Wr.userMutationsKeyPath,{unique:!0}),e.createObjectStore(Jr.store)}(e),ni(e),function(e){e.createObjectStore(Yr.store)}(e));var o=Bn.resolve();return n<3&&r>=3&&(0!==n&&(function(e){e.deleteObjectStore($r.store),e.deleteObjectStore(Qr.store),e.deleteObjectStore(ei.store)}(e),ni(e)),o=o.next((function(){return function(e){var t=e.store(ei.store),n=new ei(0,0,I.min().A(),0);return t.put(ei.key,n)}(a)}))),n<4&&r>=4&&(0!==n&&(o=o.next((function(){return function(e,t){return t.store(Wr.store).Hs().next((function(n){e.deleteObjectStore(Wr.store),e.createObjectStore(Wr.store,{keyPath:Wr.keyPath,autoIncrement:!0}).createIndex(Wr.userMutationsIndex,Wr.userMutationsKeyPath,{unique:!0});var r=t.store(Wr.store),i=n.map((function(e){return r.put(e)}));return Bn.Cn(i)}))}(e,a)}))),o=o.next((function(){!function(e){e.createObjectStore(ri.store,{keyPath:ri.keyPath})}(e)}))),n<5&&r>=5&&(o=o.next((function(){return i.removeAcknowledgedMutations(a)}))),n<6&&r>=6&&(o=o.next((function(){return function(e){e.createObjectStore(Kr.store)}(e),i.addDocumentGlobal(a)}))),n<7&&r>=7&&(o=o.next((function(){return i.ensureSequenceNumbers(a)}))),n<8&&r>=8&&(o=o.next((function(){return i.createCollectionParentIndex(e,a)}))),n<9&&r>=9&&(o=o.next((function(){!function(e){e.objectStoreNames.contains("remoteDocumentChanges")&&e.deleteObjectStore("remoteDocumentChanges")}(e),function(e){var t=e.objectStore(Yr.store);t.createIndex(Yr.readTimeIndex,Yr.readTimeIndexPath,{unique:!1}),t.createIndex(Yr.collectionReadTimeIndex,Yr.collectionReadTimeIndexPath,{unique:!1})}(t)}))),n<10&&r>=10&&(o=o.next((function(){return i.rewriteCanonicalIds(a)}))),o},e.prototype.addDocumentGlobal=function(e){var t=0;return e.store(Yr.store).Zs((function(e,n){t+=Ur(n)})).next((function(){var n=new Kr(t);return e.store(Kr.store).put(Kr.key,n)}))},e.prototype.removeAcknowledgedMutations=function(e){var t=this,n=e.store(qr.store),r=e.store(Wr.store);return n.Hs().next((function(n){return Bn.forEach(n,(function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.Hs(Wr.userMutationsIndex,i).next((function(r){return Bn.forEach(r,(function(r){y(r.userId===n.userId);var i=Mr(t.serializer,r);return Or(e,n.userId,i).next((function(){}))}))}))}))}))},e.prototype.ensureSequenceNumbers=function(e){var t=e.store($r.store),n=e.store(Yr.store);return e.store(ei.store).get(ei.key).next((function(e){var r=[];return n.Zs((function(n,i){var a=new L(n),o=function(e){return[0,mr(e)]}(a);r.push(t.get(o).next((function(n){return n?Bn.resolve():function(n){return t.put(new $r(0,mr(n),e.highestListenSequenceNumber))}(a)})))})).next((function(){return Bn.Cn(r)}))}))},e.prototype.createCollectionParentIndex=function(e,t){e.createObjectStore(ti.store,{keyPath:ti.keyPath});var n=t.store(ti.store),r=new Vr,i=function(e){if(r.add(e)){var t=e.S(),i=e.p();return n.put({collectionId:t,parent:mr(i)})}};return t.store(Yr.store).Zs({Xs:!0},(function(e,t){var n=new L(e);return i(n.p())})).next((function(){return t.store(Jr.store).Zs({Xs:!0},(function(e,t){e[0];var n=e[1],r=(e[2],vr(n));return i(r.p())}))}))},e.prototype.rewriteCanonicalIds=function(e){var t=this,n=e.store(Qr.store);return n.Zs((function(e,r){var i=Tr(r),a=Rr(t.serializer,i);return n.put(a)}))},e}(),Hr=function(e,t){this.seconds=e,this.nanoseconds=t},Gr=function(e,t,n){this.ownerId=e,this.allowTabSynchronization=t,this.leaseTimestampMs=n};Gr.store="owner",Gr.key="owner";var qr=function(e,t,n){this.userId=e,this.lastAcknowledgedBatchId=t,this.lastStreamToken=n};qr.store="mutationQueues",qr.keyPath="userId";var Wr=function(e,t,n,r,i){this.userId=e,this.batchId=t,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i};Wr.store="mutations",Wr.keyPath="batchId",Wr.userMutationsIndex="userMutationsIndex",Wr.userMutationsKeyPath=["userId","batchId"];var Jr=function(){function e(){}return e.prefixForUser=function(e){return[e]},e.prefixForPath=function(e,t){return[e,mr(t)]},e.key=function(e,t,n){return[e,mr(t),n]},e}();Jr.store="documentMutations",Jr.PLACEHOLDER=new Jr;var Zr=function(e,t){this.path=e,this.readTime=t},Xr=function(e,t){this.path=e,this.version=t},Yr=function(e,t,n,r,i,a){this.unknownDocument=e,this.noDocument=t,this.document=n,this.hasCommittedMutations=r,this.readTime=i,this.parentPath=a};Yr.store="remoteDocuments",Yr.readTimeIndex="readTimeIndex",Yr.readTimeIndexPath="readTime",Yr.collectionReadTimeIndex="collectionReadTimeIndex",Yr.collectionReadTimeIndexPath=["parentPath","readTime"];var Kr=function(e){this.byteSize=e};Kr.store="remoteDocumentGlobal",Kr.key="remoteDocumentGlobalKey";var Qr=function(e,t,n,r,i,a,o){this.targetId=e,this.canonicalId=t,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.lastLimboFreeSnapshotVersion=a,this.query=o};Qr.store="targets",Qr.keyPath="targetId",Qr.queryTargetsIndexName="queryTargetsIndex",Qr.queryTargetsKeyPath=["canonicalId","targetId"];var $r=function(e,t,n){this.targetId=e,this.path=t,this.sequenceNumber=n};$r.store="targetDocuments",$r.keyPath=["targetId","path"],$r.documentTargetsIndex="documentTargetsIndex",$r.documentTargetsKeyPath=["path","targetId"];var ei=function(e,t,n,r){this.highestTargetId=e,this.highestListenSequenceNumber=t,this.lastRemoteSnapshotVersion=n,this.targetCount=r};ei.key="targetGlobalKey",ei.store="targetGlobal";var ti=function(e,t){this.collectionId=e,this.parent=t};function ni(e){e.createObjectStore($r.store,{keyPath:$r.keyPath}).createIndex($r.documentTargetsIndex,$r.documentTargetsKeyPath,{unique:!0}),e.createObjectStore(Qr.store,{keyPath:Qr.keyPath}).createIndex(Qr.queryTargetsIndexName,Qr.queryTargetsKeyPath,{unique:!0}),e.createObjectStore(ei.store)}ti.store="collectionParents",ti.keyPath=["collectionId","parent"];var ri=function(e,t,n,r){this.clientId=e,this.updateTimeMs=t,this.networkEnabled=n,this.inForeground=r};ri.store="clientMetadata",ri.keyPath="clientId";var ii=i.__spreadArrays(i.__spreadArrays(i.__spreadArrays([qr.store,Wr.store,Jr.store,Yr.store,Qr.store,Gr.store,ei.store,$r.store],[ri.store]),[Kr.store]),[ti.store]),ai=function(){function e(){this.Xr=new Vr}return e.prototype.Ar=function(e,t){var n=this;if(!this.Xr.has(t)){var r=t.S(),i=t.p();e.Wn((function(){n.Xr.add(t)}));var a={collectionId:r,parent:mr(i)};return oi(e).put(a)}return Bn.resolve()},e.prototype.hs=function(e,t){var n=[],r=IDBKeyRange.bound([t,""],[x(t),""],!1,!0);return oi(e).Hs(r).next((function(e){for(var r=0,i=e;r<i.length;r++){var a=i[r];if(a.collectionId!==t)break;n.push(vr(a.parent))}return n}))},e}();
+/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function oi(e){return fi.Ms(e,ti.store)}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var si=function(){function e(e){this.Zr=e}return e.prototype.next=function(){return this.Zr+=2,this.Zr},e.to=function(){return new e(0)},e.eo=function(){return new e(-1)},e}(),ci=function(){function e(e,t){this.dr=e,this.serializer=t}return e.prototype.no=function(e){var t=this;return this.so(e).next((function(n){var r=new si(n.highestTargetId);return n.highestTargetId=r.next(),t.io(e,n).next((function(){return n.highestTargetId}))}))},e.prototype.ro=function(e){return this.so(e).next((function(e){return I.m(new P(e.lastRemoteSnapshotVersion.seconds,e.lastRemoteSnapshotVersion.nanoseconds))}))},e.prototype.oo=function(e){return this.so(e).next((function(e){return e.highestListenSequenceNumber}))},e.prototype.ho=function(e,t,n){var r=this;return this.so(e).next((function(i){return i.highestListenSequenceNumber=t,n&&(i.lastRemoteSnapshotVersion=n.A()),t>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=t),r.io(e,i)}))},e.prototype.ao=function(e,t){var n=this;return this.co(e,t).next((function(){return n.so(e).next((function(r){return r.targetCount+=1,n.uo(t,r),n.io(e,r)}))}))},e.prototype.lo=function(e,t){return this.co(e,t)},e.prototype._o=function(e,t){var n=this;return this.fo(e,t.targetId).next((function(){return li(e).delete(t.targetId)})).next((function(){return n.so(e)})).next((function(t){return y(t.targetCount>0),t.targetCount-=1,n.io(e,t)}))},e.prototype.hr=function(e,t,n){var r=this,i=0,a=[];return li(e).Zs((function(o,s){var c=Tr(s);c.sequenceNumber<=t&&null===n.get(c.targetId)&&(i++,a.push(r._o(e,c)))})).next((function(){return Bn.Cn(a)})).next((function(){return i}))},e.prototype.be=function(e,t){return li(e).Zs((function(e,n){var r=Tr(n);t(r)}))},e.prototype.so=function(e){return ui(e).get(ei.key).next((function(e){return y(null!==e),e}))},e.prototype.io=function(e,t){return ui(e).put(ei.key,t)},e.prototype.co=function(e,t){return li(e).put(Rr(this.serializer,t))},e.prototype.uo=function(e,t){var n=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,n=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,n=!0),n},e.prototype.do=function(e){return this.so(e).next((function(e){return e.targetCount}))},e.prototype.wo=function(e,t){var n=G(t),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]),i=null;return li(e).Zs({range:r,index:Qr.queryTargetsIndexName},(function(e,n,r){var a=Tr(n);q(t,a.target)&&(i=a,r.done())})).next((function(){return i}))},e.prototype.To=function(e,t,n){var r=this,i=[],a=hi(e);return t.forEach((function(t){var o=mr(t.path);i.push(a.put(new $r(n,o))),i.push(r.dr.Eo(e,n,t))})),Bn.Cn(i)},e.prototype.mo=function(e,t,n){var r=this,i=hi(e);return Bn.forEach(t,(function(t){var a=mr(t.path);return Bn.Cn([i.delete([n,a]),r.dr.Io(e,n,t)])}))},e.prototype.fo=function(e,t){var n=hi(e),r=IDBKeyRange.bound([t],[t+1],!1,!0);return n.delete(r)},e.prototype.Ao=function(e,t){var n=IDBKeyRange.bound([t],[t+1],!1,!0),r=hi(e),i=de();return r.Zs({range:n,Xs:!0},(function(e,t,n){var r=vr(e[1]),a=new j(r);i=i.add(a)})).next((function(){return i}))},e.prototype.Nr=function(e,t){var n=mr(t.path),r=IDBKeyRange.bound([n],[x(n)],!1,!0),i=0;return hi(e).Zs({index:$r.documentTargetsIndex,Xs:!0,range:r},(function(e,t,n){var r=e[0];e[1],0!==r&&(i++,n.done())})).next((function(){return i>0}))},e.prototype.Me=function(e,t){return li(e).get(t).next((function(e){return e?Tr(e):null}))},e}();
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function li(e){return fi.Ms(e,Qr.store)}function ui(e){return fi.Ms(e,ei.store)}function hi(e){return fi.Ms(e,$r.store)}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var di="Failed to obtain exclusive access to the persistence layer. To allow shared access, make sure to invoke `enablePersistence()` with `synchronizeTabs:true` in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",pi=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).vr=t,r.Ro=n,r}return i.__extends(t,e),t}(Hn),fi=function(){function e(t,n,r,i,a,o,s,c,l,u){if(this.allowTabSynchronization=t,this.persistenceKey=n,this.clientId=r,this.ms=a,this.window=o,this.document=s,this.Po=l,this.Vo=u,this.yo=null,this.po=!1,this.isPrimary=!1,this.networkEnabled=!0,this.bo=null,this.inForeground=!1,this.vo=null,this.So=null,this.Do=Number.NEGATIVE_INFINITY,this.Co=function(e){return Promise.resolve()},!e.ks())throw new O(C.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.dr=new yi(this,i),this.No=n+"main",this.serializer=new br(c),this.Fo=new Xn(this.No,10,new zr(this.serializer)),this.ko=new ci(this.dr,this.serializer),this.zn=new ai,this.Kn=new Lr(this.serializer,this.zn),this.window&&this.window.localStorage?this.$o=this.window.localStorage:(this.$o=null,!1===u&&p("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return e.Ms=function(e,t){if(e instanceof pi)return Xn.Ms(e.vr,t);throw g()},e.prototype.start=function(){var e=this;return this.xo().then((function(){if(!e.isPrimary&&!e.allowTabSynchronization)throw new O(C.FAILED_PRECONDITION,di);return e.Oo(),e.Mo(),e.Lo(),e.runTransaction("getHighestListenSequenceNumber","readonly",(function(t){return e.ko.oo(t)}))})).then((function(t){e.yo=new Wn(t,e.Po)})).then((function(){e.po=!0})).catch((function(t){return e.Fo&&e.Fo.close(),Promise.reject(t)}))},e.prototype.qo=function(e){var t=this;return this.Co=function(n){return i.__awaiter(t,void 0,void 0,(function(){return i.__generator(this,(function(t){return this.tr?[2,e(n)]:[2]}))}))},e(this.isPrimary)},e.prototype.Bo=function(e){var t=this;this.Fo.Bs((function(n){return i.__awaiter(t,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return null===n.newVersion?[4,e()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}))},e.prototype.Uo=function(e){var t=this;this.networkEnabled!==e&&(this.networkEnabled=e,this.ms.ai((function(){return i.__awaiter(t,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.tr?[4,this.xo()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))})))},e.prototype.xo=function(){var e=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(t){return gi(t).put(new ri(e.clientId,Date.now(),e.networkEnabled,e.inForeground)).next((function(){if(e.isPrimary)return e.Qo(t).next((function(t){t||(e.isPrimary=!1,e.ms.gi((function(){return e.Co(!1)})))}))})).next((function(){return e.Wo(t)})).next((function(n){return e.isPrimary&&!n?e.jo(t).next((function(){return!1})):!!n&&e.Ko(t).next((function(){return!0}))}))})).catch((function(t){if(Qn(t))return d("IndexedDbPersistence","Failed to extend owner lease: ",t),e.isPrimary;if(!e.allowTabSynchronization)throw t;return d("IndexedDbPersistence","Releasing owner lease after error during lease refresh",t),!1})).then((function(t){e.isPrimary!==t&&e.ms.gi((function(){return e.Co(t)})),e.isPrimary=t}))},e.prototype.Qo=function(e){var t=this;return mi(e).get(Gr.key).next((function(e){return Bn.resolve(t.Go(e))}))},e.prototype.zo=function(e){return gi(e).delete(this.clientId)},e.prototype.Ho=function(){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r,a,o=this;return i.__generator(this,(function(i){switch(i.label){case 0:return!this.isPrimary||this.Yo(this.Do,18e5)?[3,2]:(this.Do=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(t){var n=e.Ms(t,ri.store);return n.Hs().next((function(e){var t=o.Jo(e,18e5),r=e.filter((function(e){return-1===t.indexOf(e)}));return Bn.forEach(r,(function(e){return n.delete(e.clientId)})).next((function(){return r}))}))})).catch((function(){return[]}))]);case 1:if(t=i.sent(),this.$o)for(n=0,r=t;n<r.length;n++)a=r[n],this.$o.removeItem(this.Xo(a.clientId));i.label=2;case 2:return[2]}}))}))},e.prototype.Lo=function(){var e=this;this.So=this.ms.Ss("client_metadata_refresh",4e3,(function(){return e.xo().then((function(){return e.Ho()})).then((function(){return e.Lo()}))}))},e.prototype.Go=function(e){return!!e&&e.ownerId===this.clientId},e.prototype.Wo=function(e){var t=this;return this.Vo?Bn.resolve(!0):mi(e).get(Gr.key).next((function(n){if(null!==n&&t.Yo(n.leaseTimestampMs,5e3)&&!t.Zo(n.ownerId)){if(t.Go(n)&&t.networkEnabled)return!0;if(!t.Go(n)){if(!n.allowTabSynchronization)throw new O(C.FAILED_PRECONDITION,di);return!1}}return!(!t.networkEnabled||!t.inForeground)||gi(e).Hs().next((function(e){return void 0===t.Jo(e,5e3).find((function(e){if(t.clientId!==e.clientId){var n=!t.networkEnabled&&e.networkEnabled,r=!t.inForeground&&e.inForeground,i=t.networkEnabled===e.networkEnabled;if(n||r&&i)return!0}return!1}))}))})).next((function(e){return t.isPrimary!==e&&d("IndexedDbPersistence","Client "+(e?"is":"is not")+" eligible for a primary lease."),e}))},e.prototype.th=function(){return i.__awaiter(this,void 0,void 0,(function(){var e=this;return i.__generator(this,(function(t){switch(t.label){case 0:return this.po=!1,this.eh(),this.So&&(this.So.cancel(),this.So=null),this.nh(),this.sh(),[4,this.Fo.runTransaction("readwrite",[Gr.store,ri.store],(function(t){var n=new pi(t,Wn.Es);return e.jo(n).next((function(){return e.zo(n)}))}))];case 1:return t.sent(),this.Fo.close(),this.ih(),[2]}}))}))},e.prototype.Jo=function(e,t){var n=this;return e.filter((function(e){return n.Yo(e.updateTimeMs,t)&&!n.Zo(e.clientId)}))},e.prototype.rh=function(){var e=this;return this.runTransaction("getActiveClients","readonly",(function(t){return gi(t).Hs().next((function(t){return e.Jo(t,18e5).map((function(e){return e.clientId}))}))}))},Object.defineProperty(e.prototype,"tr",{get:function(){return this.po},enumerable:!1,configurable:!0}),e.prototype.oh=function(e){return kr.Tr(e,this.serializer,this.zn,this.dr)},e.prototype.hh=function(){return this.ko},e.prototype.ah=function(){return this.Kn},e.prototype.uh=function(){return this.zn},e.prototype.runTransaction=function(e,t,n){var r=this;d("IndexedDbPersistence","Starting transaction:",e);var i,a="readonly"===t?"readonly":"readwrite";return this.Fo.runTransaction(a,ii,(function(a){return i=new pi(a,r.yo?r.yo.next():Wn.Es),"readwrite-primary"===t?r.Qo(i).next((function(e){return!!e||r.Wo(i)})).next((function(t){if(!t)throw p("Failed to obtain primary lease for action '"+e+"'."),r.isPrimary=!1,r.ms.gi((function(){return r.Co(!1)})),new O(C.FAILED_PRECONDITION,zn);return n(i)})).next((function(e){return r.Ko(i).next((function(){return e}))})):r.lh(i).next((function(){return n(i)}))})).then((function(e){return i.jn(),e}))},e.prototype.lh=function(e){var t=this;return mi(e).get(Gr.key).next((function(e){if(null!==e&&t.Yo(e.leaseTimestampMs,5e3)&&!t.Zo(e.ownerId)&&!t.Go(e)&&!(t.Vo||t.allowTabSynchronization&&e.allowTabSynchronization))throw new O(C.FAILED_PRECONDITION,di)}))},e.prototype.Ko=function(e){var t=new Gr(this.clientId,this.allowTabSynchronization,Date.now());return mi(e).put(Gr.key,t)},e.ks=function(){return Xn.ks()},e.prototype.jo=function(e){var t=this,n=mi(e);return n.get(Gr.key).next((function(e){return t.Go(e)?(d("IndexedDbPersistence","Releasing primary lease."),n.delete(Gr.key)):Bn.resolve()}))},e.prototype.Yo=function(e,t){var n=Date.now();return!(e<n-t||e>n&&(p("Detected an update time that is in the future: "+e+" > "+n),1))},e.prototype.Oo=function(){var e=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.vo=function(){e.ms.ai((function(){return e.inForeground="visible"===e.document.visibilityState,e.xo()}))},this.document.addEventListener("visibilitychange",this.vo),this.inForeground="visible"===this.document.visibilityState)},e.prototype.nh=function(){this.vo&&(this.document.removeEventListener("visibilitychange",this.vo),this.vo=null)},e.prototype.Mo=function(){var e,t=this;"function"==typeof(null===(e=this.window)||void 0===e?void 0:e.addEventListener)&&(this.bo=function(){t.eh(),t.ms.ai((function(){return t.th()}))},this.window.addEventListener("unload",this.bo))},e.prototype.sh=function(){this.bo&&(this.window.removeEventListener("unload",this.bo),this.bo=null)},e.prototype.Zo=function(e){var t;try{var n=null!==(null===(t=this.$o)||void 0===t?void 0:t.getItem(this.Xo(e)));return d("IndexedDbPersistence","Client '"+e+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(e){return p("IndexedDbPersistence","Failed to get zombied client id.",e),!1}},e.prototype.eh=function(){if(this.$o)try{this.$o.setItem(this.Xo(this.clientId),String(Date.now()))}catch(e){p("Failed to set zombie client id.",e)}},e.prototype.ih=function(){if(this.$o)try{this.$o.removeItem(this.Xo(this.clientId))}catch(e){}},e.prototype.Xo=function(e){return"firestore_zombie_"+this.persistenceKey+"_"+e},e}();function mi(e){return fi.Ms(e,Gr.store)}function gi(e){return fi.Ms(e,ri.store)}var yi=function(){function e(e,t){this.db=e,this.Yi=new fr(this,t)}return e.prototype.ir=function(e){var t=this._h(e);return this.db.hh().do(e).next((function(e){return t.next((function(t){return e+t}))}))},e.prototype._h=function(e){var t=0;return this.or(e,(function(e){t++})).next((function(){return t}))},e.prototype.be=function(e,t){return this.db.hh().be(e,t)},e.prototype.or=function(e,t){return this.fh(e,(function(e,n){return t(n)}))},e.prototype.Eo=function(e,t,n){return vi(e,n)},e.prototype.Io=function(e,t,n){return vi(e,n)},e.prototype.hr=function(e,t,n){return this.db.hh().hr(e,t,n)},e.prototype.Dr=function(e,t){return vi(e,t)},e.prototype.dh=function(e,t){return function(e,t){var n=!1;return Nr(e).ti((function(r){return Cr(e,r,t).next((function(e){return e&&(n=!0),Bn.resolve(!e)}))})).next((function(){return n}))}(e,t)},e.prototype.ar=function(e,t){var n=this,r=this.db.ah().jr(),i=[],a=0;return this.fh(e,(function(o,s){if(s<=t){var c=n.dh(e,o).next((function(t){if(!t)return a++,r.Ln(e,o).next((function(){return r.Mn(o),hi(e).delete([0,mr(o.path)])}))}));i.push(c)}})).next((function(){return Bn.Cn(i)})).next((function(){return r.apply(e)})).next((function(){return a}))},e.prototype.removeTarget=function(e,t){var n=t.tt(e.Ro);return this.db.hh().lo(e,n)},e.prototype.wh=function(e,t){return vi(e,t)},e.prototype.fh=function(e,t){var n,r=hi(e),i=Wn.Es;return r.Zs({index:$r.documentTargetsIndex},(function(e,r){var a=e[0],o=(e[1],r.path),s=r.sequenceNumber;0===a?(i!==Wn.Es&&t(new j(vr(n)),i),i=s,n=o):i=Wn.Es})).next((function(){i!==Wn.Es&&t(new j(vr(n)),i)}))},e.prototype.ur=function(e){return this.db.ah().zr(e)},e}();function vi(e,t){return hi(e).put(function(e,t){return new $r(0,mr(e.path),t)}(t,e.Ro))}function bi(e,t){var n=e.projectId;return e.i||(n+="."+e.database),"firestore/"+t+"/"+n+"/"}var wi=function(){function e(e,t,n){this.persistence=e,this.Th=t,this.Eh=new ee(A),this.mh=new k((function(e){return G(e)}),q),this.Ih=I.min(),this.Gn=e.oh(n),this.Ah=e.ah(),this.ko=e.hh(),this.Rh=new Gn(this.Ah,this.Gn,this.persistence.uh()),this.Th.Ph(this.Rh)}return e.prototype.er=function(e){var t=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return e.cr(n,t.Eh)}))},e}();function Ai(e,t){var n=v(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(function(e){var r=t.batch.keys(),i=n.Ah.jr({Gr:!0});return function(e,t,n,r){var i=n.batch,a=i.keys(),o=Bn.resolve();return a.forEach((function(e){o=o.next((function(){return r.Ln(t,e)})).next((function(t){var a=t,o=n.Pn.get(e);y(null!==o),(!a||a.version.o(o)<0)&&(a=i.En(e,a,n))&&r.xn(a,n.Rn)}))})),o.next((function(){return e.Gn.br(t,i)}))}(n,e,t,i).next((function(){return i.apply(e)})).next((function(){return n.Gn.Cr(e)})).next((function(){return n.Rh.Zn(e,r)}))}))}function Ei(e){var t=v(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",(function(e){return t.ko.ro(e)}))}function xi(e,t){var n=v(e),r=t.Z,i=n.Eh;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(function(e){var a=n.Ah.jr({Gr:!0});i=n.Eh;var o=[];t.Wt.forEach((function(t,a){var s=i.get(a);if(s){o.push(n.ko.mo(e,t.Zt,a).next((function(){return n.ko.To(e,t.Jt,a)})));var c=t.resumeToken;if(c.Y()>0){var l=s.et(c,r).tt(e.Ro);i=i.st(a,l),function(e,t,n){return y(t.resumeToken.Y()>0),0===e.resumeToken.Y()||t.Z.I()-e.Z.I()>=3e8||n.Jt.size+n.Xt.size+n.Zt.size>0}(s,l,t)&&o.push(n.ko.lo(e,l))}}}));var s=oe(),c=de();if(t.Kt.forEach((function(e,t){c=c.add(e)})),o.push(a.getEntries(e,c).next((function(i){t.Kt.forEach((function(c,l){var u=i.get(c);l instanceof an&&l.version.isEqual(I.min())?(a.Mn(c,r),s=s.st(c,l)):null==u||l.version.o(u.version)>0||0===l.version.o(u.version)&&u.hasPendingWrites?(a.xn(l,r),s=s.st(c,l)):d("LocalStore","Ignoring outdated watch update for ",c,". Current version:",u.version," Watch version:",l.version),t.Gt.has(c)&&o.push(n.persistence.dr.wh(e,c))}))}))),!r.isEqual(I.min())){var l=n.ko.ro(e).next((function(t){return n.ko.ho(e,e.Ro,r)}));o.push(l)}return Bn.Cn(o).next((function(){return a.apply(e)})).next((function(){return n.Rh.ts(e,s)}))})).then((function(e){return n.Eh=i,e}))}function _i(e,t){var n=v(e);return n.persistence.runTransaction("Get next mutation batch","readonly",(function(e){return void 0===t&&(t=-1),n.Gn.gr(e,t)}))}function Si(e,t){var n=v(e);return n.persistence.runTransaction("Allocate target","readwrite",(function(e){var r;return n.ko.wo(e,t).next((function(i){return i?(r=i,Bn.resolve(r)):n.ko.no(e).next((function(i){return r=new Y(t,i,0,e.Ro),n.ko.ao(e,r).next((function(){return r}))}))}))})).then((function(e){var r=n.Eh.get(e.targetId);return(null===r||e.Z.o(r.Z)>0)&&(n.Eh=n.Eh.st(e.targetId,e),n.mh.set(t,e.targetId)),e}))}function Mi(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var r,a,o,s;return i.__generator(this,(function(i){switch(i.label){case 0:r=v(e),a=r.Eh.get(t),o=n?"readwrite":"readwrite-primary",i.label=1;case 1:return i.trys.push([1,4,,5]),n?[3,3]:[4,r.persistence.runTransaction("Release target",o,(function(e){return r.persistence.dr.removeTarget(e,a)}))];case 2:i.sent(),i.label=3;case 3:return[3,5];case 4:if(!Qn(s=i.sent()))throw s;return d("LocalStore","Failed to update sequence numbers for target "+t+": "+s),[3,5];case 5:return r.Eh=r.Eh.remove(t),r.mh.delete(a.target),[2]}}))}))}function Ti(e,t,n){var r=v(e),i=I.min(),a=de();return r.persistence.runTransaction("Execute query","readonly",(function(e){return function(e,t,n){var r=v(e),i=r.mh.get(n);return void 0!==i?Bn.resolve(r.Eh.get(i)):r.ko.wo(t,n)}(r,e,pn(t)).next((function(t){if(t)return i=t.lastLimboFreeSnapshotVersion,r.ko.Ao(e,t.targetId).next((function(e){a=e}))})).next((function(){return r.Th.ns(e,t,n?i:I.min(),n?a:de())})).next((function(e){return{documents:e,gh:a}}))}))}function Ri(e,t){var n=v(e),r=v(n.ko),i=n.Eh.get(t);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",(function(e){return r.Me(e,t).next((function(e){return e?e.target:null}))}))}function ki(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){if(e.code!==C.FAILED_PRECONDITION||e.message!==zn)throw e;return d("LocalStore","Unexpectedly lost primary lease"),[2]}))}))}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var Ci=function(){function e(){this.Vh=new re(Oi.yh),this.ph=new re(Oi.bh)}return e.prototype._=function(){return this.Vh._()},e.prototype.Eo=function(e,t){var n=new Oi(e,t);this.Vh=this.Vh.add(n),this.ph=this.ph.add(n)},e.prototype.vh=function(e,t){var n=this;e.forEach((function(e){return n.Eo(e,t)}))},e.prototype.Io=function(e,t){this.Sh(new Oi(e,t))},e.prototype.Dh=function(e,t){var n=this;e.forEach((function(e){return n.Io(e,t)}))},e.prototype.Ch=function(e){var t=this,n=new j(new L([])),r=new Oi(n,e),i=new Oi(n,e+1),a=[];return this.ph.St([r,i],(function(e){t.Sh(e),a.push(e.key)})),a},e.prototype.Nh=function(){var e=this;this.Vh.forEach((function(t){return e.Sh(t)}))},e.prototype.Sh=function(e){this.Vh=this.Vh.delete(e),this.ph=this.ph.delete(e)},e.prototype.Fh=function(e){var t=new j(new L([])),n=new Oi(t,e),r=new Oi(t,e+1),i=de();return this.ph.St([n,r],(function(e){i=i.add(e.key)})),i},e.prototype.Nr=function(e){var t=new Oi(e,0),n=this.Vh.Ct(t);return null!==n&&e.isEqual(n.key)},e}(),Oi=function(){function e(e,t){this.key=e,this.kh=t}return e.yh=function(e,t){return j.P(e.key,t.key)||A(e.kh,t.kh)},e.bh=function(e,t){return A(e.kh,t.kh)||j.P(e.key,t.key)},e}(),Pi=function(){function e(e){this.uid=e}return e.prototype.Er=function(){return null!=this.uid},e.prototype.$h=function(){return this.Er()?"uid:"+this.uid:"anonymous-user"},e.prototype.isEqual=function(e){return e.uid===this.uid},e}();Pi.UNAUTHENTICATED=new Pi(null),Pi.xh=new Pi("google-credentials-uid"),Pi.Oh=new Pi("first-party-uid");
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var Ii=function(e,t){this.user=t,this.type="OAuth",this.Mh={},this.Mh.Authorization="Bearer "+e},Ni=function(){function e(){this.Lh=null}return e.prototype.getToken=function(){return Promise.resolve(null)},e.prototype.qh=function(){},e.prototype.Bh=function(e){this.Lh=e,e(Pi.UNAUTHENTICATED)},e.prototype.Uh=function(){this.Lh=null},e}(),Li=function(){function e(e){var t=this;this.Qh=null,this.currentUser=Pi.UNAUTHENTICATED,this.Wh=!1,this.jh=0,this.Lh=null,this.forceRefresh=!1,this.Qh=function(){t.jh++,t.currentUser=t.Kh(),t.Wh=!0,t.Lh&&t.Lh(t.currentUser)},this.jh=0,this.auth=e.getImmediate({optional:!0}),this.auth?this.auth.addAuthTokenListener(this.Qh):(this.Qh(null),e.get().then((function(e){t.auth=e,t.Qh&&t.auth.addAuthTokenListener(t.Qh)}),(function(){})))}return e.prototype.getToken=function(){var e=this,t=this.jh,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((function(n){return e.jh!==t?(d("FirebaseCredentialsProvider","getToken aborted due to token change."),e.getToken()):n?(y("string"==typeof n.accessToken),new Ii(n.accessToken,e.currentUser)):null})):Promise.resolve(null)},e.prototype.qh=function(){this.forceRefresh=!0},e.prototype.Bh=function(e){this.Lh=e,this.Wh&&e(this.currentUser)},e.prototype.Uh=function(){this.auth&&this.auth.removeAuthTokenListener(this.Qh),this.Qh=null,this.Lh=null},e.prototype.Kh=function(){var e=this.auth&&this.auth.getUid();return y(null===e||"string"==typeof e),new Pi(e)},e}(),Di=function(){function e(e,t){this.Gh=e,this.zh=t,this.type="FirstParty",this.user=Pi.Oh}return Object.defineProperty(e.prototype,"Mh",{get:function(){var e={"X-Goog-AuthUser":this.zh},t=this.Gh.auth.Hh([]);return t&&(e.Authorization=t),e},enumerable:!1,configurable:!0}),e}(),Fi=function(){function e(e,t){this.Gh=e,this.zh=t}return e.prototype.getToken=function(){return Promise.resolve(new Di(this.Gh,this.zh))},e.prototype.Bh=function(e){e(Pi.Oh)},e.prototype.Uh=function(){},e.prototype.qh=function(){},e}(),ji=function(){function e(e,t,n,r,i,a){this.ms=e,this.Yh=n,this.Jh=r,this.Xh=i,this.listener=a,this.state=0,this.Zh=0,this.ta=null,this.stream=null,this.Ti=new Zn(e,t)}return e.prototype.ea=function(){return 1===this.state||2===this.state||4===this.state},e.prototype.na=function(){return 2===this.state},e.prototype.start=function(){3!==this.state?this.auth():this.sa()},e.prototype.stop=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.ea()?[4,this.close(0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.ia=function(){this.state=0,this.Ti.reset()},e.prototype.ra=function(){var e=this;this.na()&&null===this.ta&&(this.ta=this.ms.Ss(this.Yh,6e4,(function(){return e.oa()})))},e.prototype.ha=function(e){this.aa(),this.stream.send(e)},e.prototype.oa=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){return this.na()?[2,this.close(0)]:[2]}))}))},e.prototype.aa=function(){this.ta&&(this.ta.cancel(),this.ta=null)},e.prototype.close=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){switch(n.label){case 0:return this.aa(),this.Ti.cancel(),this.Zh++,3!==e?this.Ti.reset():t&&t.code===C.RESOURCE_EXHAUSTED?(p(t.toString()),p("Using maximum backoff delay to prevent overloading the backend."),this.Ti.ps()):t&&t.code===C.UNAUTHENTICATED&&this.Xh.qh(),null!==this.stream&&(this.ca(),this.stream.close(),this.stream=null),this.state=e,[4,this.listener.ua(t)];case 1:return n.sent(),[2]}}))}))},e.prototype.ca=function(){},e.prototype.auth=function(){var e=this;this.state=1;var t=this.la(this.Zh),n=this.Zh;this.Xh.getToken().then((function(t){e.Zh===n&&e._a(t)}),(function(n){t((function(){var t=new O(C.UNKNOWN,"Fetching auth token failed: "+n.message);return e.fa(t)}))}))},e.prototype._a=function(e){var t=this,n=this.la(this.Zh);this.stream=this.da(e),this.stream.wa((function(){n((function(){return t.state=2,t.listener.wa()}))})),this.stream.ua((function(e){n((function(){return t.fa(e)}))})),this.stream.onMessage((function(e){n((function(){return t.onMessage(e)}))}))},e.prototype.sa=function(){var e=this;this.state=4,this.Ti.bs((function(){return i.__awaiter(e,void 0,void 0,(function(){return i.__generator(this,(function(e){return this.state=0,this.start(),[2]}))}))}))},e.prototype.fa=function(e){return d("PersistentStream","close with error: "+e),this.stream=null,this.close(3,e)},e.prototype.la=function(e){var t=this;return function(n){t.ms.ai((function(){return t.Zh===e?n():(d("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},e}(),Ui=function(e){function t(t,n,r,i,a){var o=this;return(o=e.call(this,t,"listen_stream_connection_backoff","listen_stream_idle",n,r,a)||this).serializer=i,o}return i.__extends(t,e),t.prototype.da=function(e){return this.Jh.Ta("Listen",e)},t.prototype.onMessage=function(e){this.Ti.reset();var t=function(e,t){var n;if("targetChange"in t){t.targetChange;var r=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:g()}(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],a=function(e,t){return e.Le?(y(void 0===t||"string"==typeof t),J.fromBase64String(t||"")):(y(void 0===t||t instanceof Uint8Array),J.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),o=t.targetChange.cause,s=o&&function(e){var t=void 0===e.code?C.UNKNOWN:$(e.code);return new O(t,e.message||"")}(o);n=new Ee(r,i,a,s||null)}else if("documentChange"in t){t.documentChange;var c=t.documentChange;c.document,c.document.name,c.document.updateTime;var l=it(e,c.document.name),u=et(c.document.updateTime),h=new $t({mapValue:{fields:c.document.fields}}),d=new rn(l,u,h,{}),p=c.targetIds||[],f=c.removedTargetIds||[];n=new we(p,f,d.key,d)}else if("documentDelete"in t){t.documentDelete;var m=t.documentDelete;m.document;var v=it(e,m.document),b=m.readTime?et(m.readTime):I.min(),w=new an(v,b),A=m.removedTargetIds||[];n=new we([],A,w.key,w)}else if("documentRemove"in t){t.documentRemove;var E=t.documentRemove;E.document;var x=it(e,E.document),_=E.removedTargetIds||[];n=new we([],_,x,null)}else{if(!("filter"in t))return g();t.filter;var S=t.filter;S.targetId;var M=S.count||0,T=new K(M),R=S.targetId;n=new Ae(R,T)}return n}(this.serializer,e),n=function(e){if(!("targetChange"in e))return I.min();var t=e.targetChange;return t.targetIds&&t.targetIds.length?I.min():t.readTime?et(t.readTime):I.min()}(e);return this.listener.Ea(t,n)},t.prototype.ma=function(e){var t={};t.database=st(this.serializer),t.addTarget=function(e,t){var n,r=t.target;return(n=W(r)?{documents:dt(e,r)}:{query:pt(e,r)}).targetId=t.targetId,t.resumeToken.Y()>0&&(n.resumeToken=Qe(e,t.resumeToken)),n}(this.serializer,e);var n=function(e,t){var n=function(e,t){switch(t){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return g()}}(0,t.X);return null==n?null:{"goog-listen-tags":n}}(this.serializer,e);n&&(t.labels=n),this.ha(t)},t.prototype.Ia=function(e){var t={};t.database=st(this.serializer),t.removeTarget=e,this.ha(t)},t}(ji),Bi=function(e){function t(t,n,r,i,a){var o=this;return(o=e.call(this,t,"write_stream_connection_backoff","write_stream_idle",n,r,a)||this).serializer=i,o.Aa=!1,o}return i.__extends(t,e),Object.defineProperty(t.prototype,"Ra",{get:function(){return this.Aa},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.Aa=!1,this.lastStreamToken=void 0,e.prototype.start.call(this)},t.prototype.ca=function(){this.Aa&&this.Pa([])},t.prototype.da=function(e){return this.Jh.Ta("Write",e)},t.prototype.onMessage=function(e){if(y(!!e.streamToken),this.lastStreamToken=e.streamToken,this.Aa){this.Ti.reset();var t=function(e,t){return e&&e.length>0?(y(void 0!==t),e.map((function(e){return function(e,t){var n=e.updateTime?et(e.updateTime):et(t);n.isEqual(I.min())&&(n=et(t));var r=null;return e.transformResults&&e.transformResults.length>0&&(r=e.transformResults),new Dt(n,r)}(e,t)}))):[]}(e.writeResults,e.commitTime),n=et(e.commitTime);return this.listener.ga(n,t)}return y(!e.writeResults||0===e.writeResults.length),this.Aa=!0,this.listener.Va()},t.prototype.ya=function(){var e={};e.database=st(this.serializer),this.ha(e)},t.prototype.Pa=function(e){var t=this,n={streamToken:this.lastStreamToken,writes:e.map((function(e){return ut(t.serializer,e)}))};this.ha(n)},t}(ji),Vi=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).credentials=t,i.Jh=n,i.serializer=r,i.pa=!1,i}return i.__extends(t,e),t.prototype.ba=function(){if(this.pa)throw new O(C.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.va=function(e,t,n){var r=this;return this.ba(),this.credentials.getToken().then((function(i){return r.Jh.va(e,t,n,i)})).catch((function(e){throw e.code===C.UNAUTHENTICATED&&r.credentials.qh(),e}))},t.prototype.Sa=function(e,t,n){var r=this;return this.ba(),this.credentials.getToken().then((function(i){return r.Jh.Sa(e,t,n,i)})).catch((function(e){throw e.code===C.UNAUTHENTICATED&&r.credentials.qh(),e}))},t.prototype.terminate=function(){this.pa=!1},t}((function(){})),zi=function(){function e(e,t){this.ei=e,this.Da=t,this.state="Unknown",this.Ca=0,this.Na=null,this.Fa=!0}return e.prototype.ka=function(){var e=this;0===this.Ca&&(this.$a("Unknown"),this.Na=this.ei.Ss("online_state_timeout",1e4,(function(){return e.Na=null,e.xa("Backend didn't respond within 10 seconds."),e.$a("Offline"),Promise.resolve()})))},e.prototype.Oa=function(e){"Online"===this.state?this.$a("Unknown"):(this.Ca++,this.Ca>=1&&(this.Ma(),this.xa("Connection failed 1 times. Most recent error: "+e.toString()),this.$a("Offline")))},e.prototype.set=function(e){this.Ma(),this.Ca=0,"Online"===e&&(this.Fa=!1),this.$a(e)},e.prototype.$a=function(e){e!==this.state&&(this.state=e,this.Da(e))},e.prototype.xa=function(e){var t="Could not reach Cloud Firestore backend. "+e+"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.";this.Fa?(p(t),this.Fa=!1):d("OnlineStateTracker",t)},e.prototype.Ma=function(){null!==this.Na&&(this.Na.cancel(),this.Na=null)},e}(),Hi=function(){function e(e,t,n,r,a){var o=this;this.La=e,this.qa=t,this.ei=n,this.Ba=[],this.Ua=new Map,this.Qa=null,this.Wa=new Set,this.ja=a,this.ja.Ka((function(e){n.ai((function(){return i.__awaiter(o,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.Ga()?(d("RemoteStore","Restarting streams for network reachability change."),[4,this.za()]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))})),this.Ha=new zi(n,r),this.Ya=function(e,t,n){var r=v(e);return r.ba(),new Ui(t,r.Jh,r.credentials,r.serializer,n)}(this.qa,n,{wa:this.Ja.bind(this),ua:this.Xa.bind(this),Ea:this.Za.bind(this)}),this.tc=function(e,t,n){var r=v(e);return r.ba(),new Bi(t,r.Jh,r.credentials,r.serializer,n)}(this.qa,n,{wa:this.ec.bind(this),ua:this.nc.bind(this),Va:this.sc.bind(this),ga:this.ga.bind(this)})}return e.prototype.start=function(){return this.enableNetwork()},e.prototype.enableNetwork=function(){return this.Wa.delete(0),this.ic()},e.prototype.ic=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.Ga()?(this.rc()?this.oc():this.Ha.set("Unknown"),[4,this.hc()]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.disableNetwork=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.Wa.add(0),[4,this.ac()];case 1:return e.sent(),this.Ha.set("Offline"),[2]}}))}))},e.prototype.ac=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return[4,this.tc.stop()];case 1:return e.sent(),[4,this.Ya.stop()];case 2:return e.sent(),this.Ba.length>0&&(d("RemoteStore","Stopping write stream with "+this.Ba.length+" pending writes"),this.Ba=[]),this.cc(),[2]}}))}))},e.prototype.th=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return d("RemoteStore","RemoteStore shutting down."),this.Wa.add(5),[4,this.ac()];case 1:return e.sent(),this.ja.th(),this.Ha.set("Unknown"),[2]}}))}))},e.prototype.listen=function(e){this.Ua.has(e.targetId)||(this.Ua.set(e.targetId,e),this.rc()?this.oc():this.Ya.na()&&this.uc(e))},e.prototype.lc=function(e){this.Ua.delete(e),this.Ya.na()&&this._c(e),0===this.Ua.size&&(this.Ya.na()?this.Ya.ra():this.Ga()&&this.Ha.set("Unknown"))},e.prototype.Me=function(e){return this.Ua.get(e)||null},e.prototype.Oe=function(e){return this.fc.Oe(e)},e.prototype.uc=function(e){this.Qa.we(e.targetId),this.Ya.ma(e)},e.prototype._c=function(e){this.Qa.we(e),this.Ya.Ia(e)},e.prototype.oc=function(){this.Qa=new _e(this),this.Ya.start(),this.Ha.ka()},e.prototype.rc=function(){return this.Ga()&&!this.Ya.ea()&&this.Ua.size>0},e.prototype.Ga=function(){return 0===this.Wa.size},e.prototype.cc=function(){this.Qa=null},e.prototype.Ja=function(){return i.__awaiter(this,void 0,void 0,(function(){var e=this;return i.__generator(this,(function(t){return this.Ua.forEach((function(t,n){e.uc(t)})),[2]}))}))},e.prototype.Xa=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){return this.cc(),this.rc()?(this.Ha.Oa(e),this.oc()):this.Ha.set("Unknown"),[2]}))}))},e.prototype.Za=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,a;return i.__generator(this,(function(i){switch(i.label){case 0:if(this.Ha.set("Online"),!(e instanceof Ee&&2===e.state&&e.cause))return[3,6];i.label=1;case 1:return i.trys.push([1,3,,5]),[4,this.dc(e)];case 2:return i.sent(),[3,5];case 3:return n=i.sent(),d("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),n),[4,this.wc(n)];case 4:return i.sent(),[3,5];case 5:return[3,13];case 6:if(e instanceof we?this.Qa.ge(e):e instanceof Ae?this.Qa.Ce(e):this.Qa.pe(e),t.isEqual(I.min()))return[3,13];i.label=7;case 7:return i.trys.push([7,11,,13]),[4,Ei(this.La)];case 8:return r=i.sent(),t.o(r)>=0?[4,this.Tc(t)]:[3,10];case 9:i.sent(),i.label=10;case 10:return[3,13];case 11:return d("RemoteStore","Failed to raise snapshot:",a=i.sent()),[4,this.wc(a)];case 12:return i.sent(),[3,13];case 13:return[2]}}))}))},e.prototype.wc=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n=this;return i.__generator(this,(function(r){switch(r.label){case 0:if(!Qn(e))throw e;return this.Wa.add(1),[4,this.ac()];case 1:return r.sent(),this.Ha.set("Offline"),t||(t=function(){return Ei(n.La)}),this.ei.gi((function(){return i.__awaiter(n,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return d("RemoteStore","Retrying IndexedDB access"),[4,t()];case 1:return e.sent(),this.Wa.delete(1),[4,this.ic()];case 2:return e.sent(),[2]}}))}))})),[2]}}))}))},e.prototype.Ec=function(e){var t=this;return e().catch((function(n){return t.wc(n,e)}))},e.prototype.Tc=function(e){var t=this,n=this.Qa.ke(e);return n.Wt.forEach((function(n,r){if(n.resumeToken.Y()>0){var i=t.Ua.get(r);i&&t.Ua.set(r,i.et(n.resumeToken,e))}})),n.jt.forEach((function(e){var n=t.Ua.get(e);if(n){t.Ua.set(e,n.et(J.J,n.Z)),t._c(e);var r=new Y(n.target,e,1,n.sequenceNumber);t.uc(r)}})),this.fc.mc(n)},e.prototype.dc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r,a;return i.__generator(this,(function(i){switch(i.label){case 0:t=e.cause,n=0,r=e.targetIds,i.label=1;case 1:return n<r.length?(a=r[n],this.Ua.has(a)?[4,this.fc.Ic(a,t)]:[3,3]):[3,5];case 2:i.sent(),this.Ua.delete(a),this.Qa.removeTarget(a),i.label=3;case 3:i.label=4;case 4:return n++,[3,1];case 5:return[2]}}))}))},e.prototype.hc=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t,n;return i.__generator(this,(function(r){switch(r.label){case 0:e=this.Ba.length>0?this.Ba[this.Ba.length-1].batchId:-1,r.label=1;case 1:if(!this.Ac())return[3,7];r.label=2;case 2:return r.trys.push([2,4,,6]),[4,_i(this.La,e)];case 3:return null===(t=r.sent())?(0===this.Ba.length&&this.tc.ra(),[3,7]):(e=t.batchId,this.Rc(t),[3,6]);case 4:return n=r.sent(),[4,this.wc(n)];case 5:return r.sent(),[3,6];case 6:return[3,1];case 7:return this.Pc()&&this.gc(),[2]}}))}))},e.prototype.Ac=function(){return this.Ga()&&this.Ba.length<10},e.prototype.Vc=function(){return this.Ba.length},e.prototype.Rc=function(e){this.Ba.push(e),this.tc.na()&&this.tc.Ra&&this.tc.Pa(e.mutations)},e.prototype.Pc=function(){return this.Ga()&&!this.tc.ea()&&this.Ba.length>0},e.prototype.gc=function(){this.tc.start()},e.prototype.ec=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){return this.tc.ya(),[2]}))}))},e.prototype.sc=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t,n;return i.__generator(this,(function(r){for(e=0,t=this.Ba;e<t.length;e++)n=t[e],this.tc.Pa(n.mutations);return[2]}))}))},e.prototype.ga=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,a=this;return i.__generator(this,(function(i){switch(i.label){case 0:return n=this.Ba.shift(),r=Un.from(n,e,t),[4,this.Ec((function(){return a.fc.yc(r)}))];case 1:return i.sent(),[4,this.hc()];case 2:return i.sent(),[2]}}))}))},e.prototype.nc=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return e&&this.tc.Ra?[4,this.pc(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return this.Pc()&&this.gc(),[2]}}))}))},e.prototype.pc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r=this;return i.__generator(this,(function(i){switch(i.label){case 0:return Q(n=e.code)&&n!==C.ABORTED?(t=this.Ba.shift(),this.tc.ia(),[4,this.Ec((function(){return r.fc.bc(t.batchId,e)}))]):[3,3];case 1:return i.sent(),[4,this.hc()];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.za=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.Wa.add(4),[4,this.ac()];case 1:return e.sent(),this.Ha.set("Unknown"),this.tc.ia(),this.Ya.ia(),this.Wa.delete(4),[4,this.ic()];case 2:return e.sent(),[2]}}))}))},e.prototype.vc=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.ei.pi(),d("RemoteStore","RemoteStore received new credentials"),this.Wa.add(3),[4,this.ac()];case 1:return t.sent(),this.Ha.set("Unknown"),[4,this.fc.vc(e)];case 2:return t.sent(),this.Wa.delete(3),[4,this.ic()];case 3:return t.sent(),[2]}}))}))},e.prototype.Sc=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return e?(this.Wa.delete(2),[4,this.ic()]):[3,2];case 1:return t.sent(),[3,5];case 2:return e?[3,4]:(this.Wa.add(2),[4,this.ac()]);case 3:t.sent(),this.Ha.set("Unknown"),t.label=4;case 4:t.label=5;case 5:return[2]}}))}))},e}();
+/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function Gi(e,t){return"firestore_clients_"+e+"_"+t}function qi(e,t,n){var r="firestore_mutations_"+e+"_"+n;return t.Er()&&(r+="_"+t.uid),r}function Wi(e,t){return"firestore_targets_"+e+"_"+t}var Ji=function(){function e(e,t,n,r){this.user=e,this.batchId=t,this.state=n,this.error=r}return e.Dc=function(t,n,r){var i=JSON.parse(r),a="object"==typeof i&&-1!==["pending","acknowledged","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error),o=void 0;return a&&i.error&&(a="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(o=new O(i.error.code,i.error.message)),a?new e(t,n,i.state,o):(p("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+r),null)},e.prototype.Cc=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},e}(),Zi=function(){function e(e,t,n){this.targetId=e,this.state=t,this.error=n}return e.Dc=function(t,n){var r=JSON.parse(n),i="object"==typeof r&&-1!==["not-current","current","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error),a=void 0;return i&&r.error&&(i="string"==typeof r.error.message&&"string"==typeof r.error.code)&&(a=new O(r.error.code,r.error.message)),i?new e(t,r.state,a):(p("SharedClientState","Failed to parse target state for ID '"+t+"': "+n),null)},e.prototype.Cc=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},e}(),Xi=function(){function e(e,t){this.clientId=e,this.activeTargetIds=t}return e.Dc=function(t,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,a=fe(),o=0;i&&o<r.activeTargetIds.length;++o)i=V(r.activeTargetIds[o]),a=a.add(r.activeTargetIds[o]);return i?new e(t,a):(p("SharedClientState","Failed to parse client data for instance '"+t+"': "+n),null)},e}(),Yi=function(){function e(e,t){this.clientId=e,this.onlineState=t}return e.Dc=function(t){var n=JSON.parse(t);return"object"==typeof n&&-1!==["Unknown","Online","Offline"].indexOf(n.onlineState)&&"string"==typeof n.clientId?new e(n.clientId,n.onlineState):(p("SharedClientState","Failed to parse online state: "+t),null)},e}(),Ki=function(){function e(){this.activeTargetIds=fe()}return e.prototype.Nc=function(e){this.activeTargetIds=this.activeTargetIds.add(e)},e.prototype.Fc=function(e){this.activeTargetIds=this.activeTargetIds.delete(e)},e.prototype.Cc=function(){var e={activeTargetIds:this.activeTargetIds.N(),updateTimeMs:Date.now()};return JSON.stringify(e)},e}(),Qi=function(){function e(e,t,n,r,i){this.window=e,this.ms=t,this.persistenceKey=n,this.kc=r,this.fc=null,this.Da=null,this.fs=null,this.$c=this.xc.bind(this),this.Oc=new ee(A),this.tr=!1,this.Mc=[];var a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.Lc=Gi(this.persistenceKey,this.kc),this.qc=function(e){return"firestore_sequence_number_"+e}(this.persistenceKey),this.Oc=this.Oc.st(this.kc,new Ki),this.Bc=new RegExp("^firestore_clients_"+a+"_([^_]*)$"),this.Uc=new RegExp("^firestore_mutations_"+a+"_(\\d+)(?:_(.*))?$"),this.Qc=new RegExp("^firestore_targets_"+a+"_(\\d+)$"),this.Wc=function(e){return"firestore_online_state_"+e}(this.persistenceKey),this.window.addEventListener("storage",this.$c)}return e.ks=function(e){return!(!e||!e.localStorage)},e.prototype.start=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t,n,r,a,o,s,c,l,u,h,d=this;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,this.fc.rh()];case 1:for(e=i.sent(),t=0,n=e;t<n.length;t++)(r=n[t])!==this.kc&&(a=this.getItem(Gi(this.persistenceKey,r)))&&(o=Xi.Dc(r,a))&&(this.Oc=this.Oc.st(o.clientId,o));for(this.jc(),(s=this.storage.getItem(this.Wc))&&(c=this.Kc(s))&&this.Gc(c),l=0,u=this.Mc;l<u.length;l++)h=u[l],this.xc(h);return this.Mc=[],this.window.addEventListener("unload",(function(){return d.th()})),this.tr=!0,[2]}}))}))},e.prototype.Ts=function(e){this.setItem(this.qc,JSON.stringify(e))},e.prototype.zc=function(){return this.Hc(this.Oc)},e.prototype.Yc=function(e){var t=!1;return this.Oc.forEach((function(n,r){r.activeTargetIds.has(e)&&(t=!0)})),t},e.prototype.Jc=function(e){this.Xc(e,"pending")},e.prototype.Zc=function(e,t,n){this.Xc(e,t,n),this.tu(e)},e.prototype.eu=function(e){var t="not-current";if(this.Yc(e)){var n=this.storage.getItem(Wi(this.persistenceKey,e));if(n){var r=Zi.Dc(e,n);r&&(t=r.state)}}return this.nu.Nc(e),this.jc(),t},e.prototype.su=function(e){this.nu.Fc(e),this.jc()},e.prototype.iu=function(e){return this.nu.activeTargetIds.has(e)},e.prototype.ru=function(e){this.removeItem(Wi(this.persistenceKey,e))},e.prototype.ou=function(e,t,n){this.hu(e,t,n)},e.prototype.au=function(e,t,n){var r=this;t.forEach((function(e){r.tu(e)})),this.currentUser=e,n.forEach((function(e){r.Jc(e)}))},e.prototype.cu=function(e){this.uu(e)},e.prototype.th=function(){this.tr&&(this.window.removeEventListener("storage",this.$c),this.removeItem(this.Lc),this.tr=!1)},e.prototype.getItem=function(e){var t=this.storage.getItem(e);return d("SharedClientState","READ",e,t),t},e.prototype.setItem=function(e,t){d("SharedClientState","SET",e,t),this.storage.setItem(e,t)},e.prototype.removeItem=function(e){d("SharedClientState","REMOVE",e),this.storage.removeItem(e)},e.prototype.xc=function(e){var t=this,n=e;if(n.storageArea===this.storage){if(d("SharedClientState","EVENT",n.key,n.newValue),n.key===this.Lc)return void p("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.ms.gi((function(){return i.__awaiter(t,void 0,void 0,(function(){var e,t,r,a,o,s;return i.__generator(this,(function(i){if(this.tr){if(null!==n.key)if(this.Bc.test(n.key)){if(null==n.newValue)return e=this.lu(n.key),[2,this._u(e,null)];if(t=this.fu(n.key,n.newValue))return[2,this._u(t.clientId,t)]}else if(this.Uc.test(n.key)){if(null!==n.newValue&&(r=this.du(n.key,n.newValue)))return[2,this.wu(r)]}else if(this.Qc.test(n.key)){if(null!==n.newValue&&(a=this.Tu(n.key,n.newValue)))return[2,this.Eu(a)]}else if(n.key===this.Wc){if(null!==n.newValue&&(o=this.Kc(n.newValue)))return[2,this.Gc(o)]}else n.key===this.qc&&(s=function(e){var t=Wn.Es;if(null!=e)try{var n=JSON.parse(e);y("number"==typeof n),t=n}catch(e){p("SharedClientState","Failed to read sequence number from WebStorage",e)}return t}(n.newValue))!==Wn.Es&&this.fs(s)}else this.Mc.push(n);return[2]}))}))}))}},Object.defineProperty(e.prototype,"nu",{get:function(){return this.Oc.get(this.kc)},enumerable:!1,configurable:!0}),e.prototype.jc=function(){this.setItem(this.Lc,this.nu.Cc())},e.prototype.Xc=function(e,t,n){var r=new Ji(this.currentUser,e,t,n),i=qi(this.persistenceKey,this.currentUser,e);this.setItem(i,r.Cc())},e.prototype.tu=function(e){var t=qi(this.persistenceKey,this.currentUser,e);this.removeItem(t)},e.prototype.uu=function(e){var t={clientId:this.kc,onlineState:e};this.storage.setItem(this.Wc,JSON.stringify(t))},e.prototype.hu=function(e,t,n){var r=Wi(this.persistenceKey,e),i=new Zi(e,t,n);this.setItem(r,i.Cc())},e.prototype.lu=function(e){var t=this.Bc.exec(e);return t?t[1]:null},e.prototype.fu=function(e,t){var n=this.lu(e);return Xi.Dc(n,t)},e.prototype.du=function(e,t){var n=this.Uc.exec(e),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return Ji.Dc(new Pi(i),r,t)},e.prototype.Tu=function(e,t){var n=this.Qc.exec(e),r=Number(n[1]);return Zi.Dc(r,t)},e.prototype.Kc=function(e){return Yi.Dc(e)},e.prototype.wu=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){return e.user.uid===this.currentUser.uid?[2,this.fc.mu(e.batchId,e.state,e.error)]:(d("SharedClientState","Ignoring mutation for non-active user "+e.user.uid),[2])}))}))},e.prototype.Eu=function(e){return this.fc.Iu(e.targetId,e.state,e.error)},e.prototype._u=function(e,t){var n=this,r=t?this.Oc.st(e,t):this.Oc.remove(e),i=this.Hc(this.Oc),a=this.Hc(r),o=[],s=[];return a.forEach((function(e){i.has(e)||o.push(e)})),i.forEach((function(e){a.has(e)||s.push(e)})),this.fc.Au(o,s).then((function(){n.Oc=r}))},e.prototype.Gc=function(e){this.Oc.get(e.clientId)&&this.Da(e.onlineState)},e.prototype.Hc=function(e){var t=fe();return e.forEach((function(e,n){t=t.Nt(n.activeTargetIds)})),t},e}(),$i=function(){function e(){this.Ru=new Ki,this.Pu={},this.Da=null,this.fs=null}return e.prototype.Jc=function(e){},e.prototype.Zc=function(e,t,n){},e.prototype.eu=function(e){return this.Ru.Nc(e),this.Pu[e]||"not-current"},e.prototype.ou=function(e,t,n){this.Pu[e]=t},e.prototype.su=function(e){this.Ru.Fc(e)},e.prototype.iu=function(e){return this.Ru.activeTargetIds.has(e)},e.prototype.ru=function(e){delete this.Pu[e]},e.prototype.zc=function(){return this.Ru.activeTargetIds},e.prototype.Yc=function(e){return this.Ru.activeTargetIds.has(e)},e.prototype.start=function(){return this.Ru=new Ki,Promise.resolve()},e.prototype.au=function(e,t,n){},e.prototype.cu=function(e){},e.prototype.th=function(){},e.prototype.Ts=function(e){},e}(),ea=function(e){this.key=e},ta=function(e){this.key=e},na=function(){function e(e,t){this.query=e,this.gu=t,this.Vu=null,this.Yt=!1,this.yu=de(),this.qt=de(),this.pu=An(e),this.bu=new me(this.pu)}return Object.defineProperty(e.prototype,"vu",{get:function(){return this.gu},enumerable:!1,configurable:!0}),e.prototype.Su=function(e,t){var n=this,r=t?t.Du:new ge,i=t?t.bu:this.bu,a=t?t.qt:this.qt,o=i,s=!1,c=this.query.an()&&i.size===this.query.limit?i.last():null,l=this.query.cn()&&i.size===this.query.limit?i.first():null;if(e.ht((function(e,t){var u=i.get(e),h=t instanceof rn?t:null;h&&(h=wn(n.query,h)?h:null);var d=!!u&&n.qt.has(u.key),p=!!h&&(h.Ge||n.qt.has(h.key)&&h.hasCommittedMutations),f=!1;u&&h?u.data().isEqual(h.data())?d!==p&&(r.track({type:3,doc:h}),f=!0):n.Cu(u,h)||(r.track({type:2,doc:h}),f=!0,(c&&n.pu(h,c)>0||l&&n.pu(h,l)<0)&&(s=!0)):!u&&h?(r.track({type:0,doc:h}),f=!0):u&&!h&&(r.track({type:1,doc:u}),f=!0,(c||l)&&(s=!0)),f&&(h?(o=o.add(h),a=p?a.add(e):a.delete(e)):(o=o.delete(e),a=a.delete(e)))})),this.query.an()||this.query.cn())for(;o.size>this.query.limit;){var u=this.query.an()?o.last():o.first();o=o.delete(u.key),a=a.delete(u.key),r.track({type:1,doc:u})}return{bu:o,Du:r,Nu:s,qt:a}},e.prototype.Cu=function(e,t){return e.Ge&&t.hasCommittedMutations&&!t.Ge},e.prototype.Un=function(e,t,n){var r=this,i=this.bu;this.bu=e.bu,this.qt=e.qt;var a=e.Du.Mt();a.sort((function(e,t){return function(e,t){var n=function(e){switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return g()}};return n(e)-n(t)}(e.type,t.type)||r.pu(e.doc,t.doc)})),this.Fu(n);var o=t?this.ku():[],s=0===this.yu.size&&this.Yt?1:0,c=s!==this.Vu;return this.Vu=s,0!==a.length||c?{snapshot:new ye(this.query,e.bu,i,a,e.qt,0===s,c,!1),$u:o}:{$u:o}},e.prototype.xu=function(e){return this.Yt&&"Offline"===e?(this.Yt=!1,this.Un({bu:this.bu,Du:new ge,qt:this.qt,Nu:!1},!1)):{$u:[]}},e.prototype.Ou=function(e){return!this.gu.has(e)&&!!this.bu.has(e)&&!this.bu.get(e).Ge},e.prototype.Fu=function(e){var t=this;e&&(e.Jt.forEach((function(e){return t.gu=t.gu.add(e)})),e.Xt.forEach((function(e){})),e.Zt.forEach((function(e){return t.gu=t.gu.delete(e)})),this.Yt=e.Yt)},e.prototype.ku=function(){var e=this;if(!this.Yt)return[];var t=this.yu;this.yu=de(),this.bu.forEach((function(t){e.Ou(t.key)&&(e.yu=e.yu.add(t.key))}));var n=[];return t.forEach((function(t){e.yu.has(t)||n.push(new ta(t))})),this.yu.forEach((function(e){t.has(e)||n.push(new ea(e))})),n},e.prototype.Mu=function(e){this.gu=e.gh,this.yu=de();var t=this.Su(e.documents);return this.Un(t,!0)},e.prototype.Lu=function(){return ye.Qt(this.query,this.bu,this.qt,0===this.Vu)},e}(),ra=function(e,t,n){this.query=e,this.targetId=t,this.view=n},ia=function(e){this.key=e,this.qu=!1},aa=function(){function e(e,t,n,r,i,a){this.La=e,this.Bu=t,this.qa=n,this.Uu=r,this.currentUser=i,this.Qu=a,this.Wu=null,this.ju=new k((function(e){return vn(e)}),yn),this.Ku=new Map,this.Gu=[],this.zu=new ee(j.P),this.Hu=new Map,this.Yu=new Ci,this.Ju={},this.Xu=new Map,this.Zu=si.eo(),this.onlineState="Unknown",this.tl=void 0}return Object.defineProperty(e.prototype,"el",{get:function(){return!0===this.tl},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e){this.Wu=e},e.prototype.listen=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r,a,o;return i.__generator(this,(function(i){switch(i.label){case 0:return this.nl("listen()"),(r=this.ju.get(e))?(t=r.targetId,this.Uu.eu(t),n=r.view.Lu(),[3,4]):[3,1];case 1:return[4,Si(this.La,pn(e))];case 2:return a=i.sent(),o=this.Uu.eu(a.targetId),t=a.targetId,[4,this.sl(e,t,"current"===o)];case 3:n=i.sent(),this.el&&this.Bu.listen(a),i.label=4;case 4:return[2,n]}}))}))},e.prototype.sl=function(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var r,a,o,s,c,l;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,Ti(this.La,e,!0)];case 1:return r=i.sent(),a=new na(e,r.gh),o=a.Su(r.documents),s=be.Ht(t,n&&"Offline"!==this.onlineState),c=a.Un(o,this.el,s),this.il(t,c.$u),l=new ra(e,t,a),[2,(this.ju.set(e,l),this.Ku.has(t)?this.Ku.get(t).push(e):this.Ku.set(t,[e]),c.snapshot)]}}))}))},e.prototype.lc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r=this;return i.__generator(this,(function(i){switch(i.label){case 0:return this.nl("unlisten()"),t=this.ju.get(e),(n=this.Ku.get(t.targetId)).length>1?[2,(this.Ku.set(t.targetId,n.filter((function(t){return!yn(t,e)}))),void this.ju.delete(e))]:this.el?(this.Uu.su(t.targetId),this.Uu.Yc(t.targetId)?[3,2]:[4,Mi(this.La,t.targetId,!1).then((function(){r.Uu.ru(t.targetId),r.Bu.lc(t.targetId),r.rl(t.targetId)})).catch(ki)]):[3,3];case 1:i.sent(),i.label=2;case 2:return[3,5];case 3:return this.rl(t.targetId),[4,Mi(this.La,t.targetId,!0)];case 4:i.sent(),i.label=5;case 5:return[2]}}))}))},e.prototype.write=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,a;return i.__generator(this,(function(i){switch(i.label){case 0:this.nl("write()"),i.label=1;case 1:return i.trys.push([1,5,,6]),[4,function(e,t){var n,r=v(e),i=P.now(),a=t.reduce((function(e,t){return e.add(t.key)}),de());return r.persistence.runTransaction("Locally write mutations","readwrite",(function(e){return r.Rh.Zn(e,a).next((function(a){n=a;for(var o=[],s=0,c=t;s<c.length;s++){var l=c[s],u=zt(l,n.get(l.key));null!=u&&o.push(new Wt(l.key,u,tn(u.proto.mapValue),Ft.exists(!0)))}return r.Gn.Ir(e,i,o,t)}))})).then((function(e){var t=e.An(n);return{batchId:e.batchId,Fn:t}}))}(this.La,e)];case 2:return n=i.sent(),this.Uu.Jc(n.batchId),this.ol(n.batchId,t),[4,this.hl(n.Fn)];case 3:return i.sent(),[4,this.Bu.hc()];case 4:return i.sent(),[3,6];case 5:return r=i.sent(),a=cr(r,"Failed to persist write"),t.reject(a),[3,6];case 6:return[2]}}))}))},e.prototype.mc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n=this;return i.__generator(this,(function(r){switch(r.label){case 0:this.nl("applyRemoteEvent()"),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,xi(this.La,e)];case 2:return t=r.sent(),e.Wt.forEach((function(e,t){var r=n.Hu.get(t);r&&(y(e.Jt.size+e.Xt.size+e.Zt.size<=1),e.Jt.size>0?r.qu=!0:e.Xt.size>0?y(r.qu):e.Zt.size>0&&(y(r.qu),r.qu=!1))})),[4,this.hl(t,e)];case 3:return r.sent(),[3,6];case 4:return[4,ki(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},e.prototype.xu=function(e,t){if(this.el&&0===t||!this.el&&1===t){this.nl("applyOnlineStateChange()");var n=[];this.ju.forEach((function(t,r){var i=r.view.xu(e);i.snapshot&&n.push(i.snapshot)})),this.Wu.al(e),this.Wu.Ea(n),this.onlineState=e,this.el&&this.Uu.cu(e)}},e.prototype.Ic=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,a,o,s,c=this;return i.__generator(this,(function(i){switch(i.label){case 0:return this.nl("rejectListens()"),this.Uu.ou(e,"rejected",t),n=this.Hu.get(e),(r=n&&n.key)?(a=(a=new ee(j.P)).st(r,new an(r,I.min())),o=de().add(r),s=new ve(I.min(),new Map,new re(A),a,o),[4,this.mc(s)]):[3,2];case 1:return i.sent(),this.zu=this.zu.remove(r),this.Hu.delete(e),this.cl(),[3,4];case 2:return[4,Mi(this.La,e,!1).then((function(){return c.rl(e,t)})).catch(ki)];case 3:i.sent(),i.label=4;case 4:return[2]}}))}))},e.prototype.yc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n;return i.__generator(this,(function(r){switch(r.label){case 0:this.nl("applySuccessfulWrite()"),t=e.batch.batchId,r.label=1;case 1:return r.trys.push([1,4,,6]),[4,Ai(this.La,e)];case 2:return n=r.sent(),this.ul(t,null),this.ll(t),this.Uu.Zc(t,"acknowledged"),[4,this.hl(n)];case 3:return r.sent(),[3,6];case 4:return[4,ki(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},e.prototype.bc=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n;return i.__generator(this,(function(r){switch(r.label){case 0:this.nl("rejectFailedWrite()"),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,function(e,t){var n=v(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",(function(e){var r;return n.Gn.Rr(e,t).next((function(t){return y(null!==t),r=t.keys(),n.Gn.br(e,t)})).next((function(){return n.Gn.Cr(e)})).next((function(){return n.Rh.Zn(e,r)}))}))}(this.La,e)];case 2:return n=r.sent(),this.ul(e,t),this.ll(e),this.Uu.Zc(e,"rejected",t),[4,this.hl(n)];case 3:return r.sent(),[3,6];case 4:return[4,ki(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},e.prototype._l=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r,a;return i.__generator(this,(function(i){switch(i.label){case 0:this.Bu.Ga()||d("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled."),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,function(e){var t=v(e);return t.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(function(e){return t.Gn.Vr(e)}))}(this.La)];case 2:return-1===(t=i.sent())?[2,void e.resolve()]:((n=this.Xu.get(t)||[]).push(e),this.Xu.set(t,n),[3,4]);case 3:return r=i.sent(),a=cr(r,"Initialization of waitForPendingWrites() operation failed"),e.reject(a),[3,4];case 4:return[2]}}))}))},e.prototype.ll=function(e){(this.Xu.get(e)||[]).forEach((function(e){e.resolve()})),this.Xu.delete(e)},e.prototype.fl=function(e){this.Xu.forEach((function(t){t.forEach((function(t){t.reject(new O(C.CANCELLED,e))}))})),this.Xu.clear()},e.prototype.ol=function(e,t){var n=this.Ju[this.currentUser.$h()];n||(n=new ee(A)),n=n.st(e,t),this.Ju[this.currentUser.$h()]=n},e.prototype.ul=function(e,t){var n=this.Ju[this.currentUser.$h()];if(n){var r=n.get(e);r&&(t?r.reject(t):r.resolve(),n=n.remove(e)),this.Ju[this.currentUser.$h()]=n}},e.prototype.rl=function(e,t){var n=this;void 0===t&&(t=null),this.Uu.su(e);for(var r=0,i=this.Ku.get(e);r<i.length;r++){var a=i[r];this.ju.delete(a),t&&this.Wu.dl(a,t)}this.Ku.delete(e),this.el&&this.Yu.Ch(e).forEach((function(e){n.Yu.Nr(e)||n.wl(e)}))},e.prototype.wl=function(e){var t=this.zu.get(e);null!==t&&(this.Bu.lc(t),this.zu=this.zu.remove(e),this.Hu.delete(t),this.cl())},e.prototype.il=function(e,t){for(var n=0,r=t;n<r.length;n++){var i=r[n];i instanceof ea?(this.Yu.Eo(i.key,e),this.Tl(i)):i instanceof ta?(d("SyncEngine","Document no longer in limbo: "+i.key),this.Yu.Io(i.key,e),this.Yu.Nr(i.key)||this.wl(i.key)):g()}},e.prototype.Tl=function(e){var t=e.key;this.zu.get(t)||(d("SyncEngine","New document in limbo: "+t),this.Gu.push(t),this.cl())},e.prototype.cl=function(){for(;this.Gu.length>0&&this.zu.size<this.Qu;){var e=this.Gu.shift(),t=this.Zu.next();this.Hu.set(t,new ia(e)),this.zu=this.zu.st(e,t),this.Bu.listen(new Y(pn(un(e.path)),t,2,Wn.Es))}},e.prototype.El=function(){return this.zu},e.prototype.ml=function(){return this.Gu},e.prototype.hl=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,a,o=this;return i.__generator(this,(function(s){switch(s.label){case 0:return n=[],r=[],a=[],this.ju.forEach((function(i,s){a.push(Promise.resolve().then((function(){var t=s.view.Su(e);return t.Nu?Ti(o.La,s.query,!1).then((function(e){var n=e.documents;return s.view.Su(n,t)})):t})).then((function(e){var i=t&&t.Wt.get(s.targetId),a=s.view.Un(e,o.el,i);if(o.il(s.targetId,a.$u),a.snapshot){o.el&&o.Uu.ou(s.targetId,a.snapshot.fromCache?"not-current":"current"),n.push(a.snapshot);var c=qn._s(s.targetId,a.snapshot);r.push(c)}})))})),[4,Promise.all(a)];case 1:return s.sent(),this.Wu.Ea(n),[4,function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,a,o,s,c,l,u,h;return i.__generator(this,(function(i){switch(i.label){case 0:n=v(e),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(function(e){return Bn.forEach(t,(function(t){return Bn.forEach(t.us,(function(r){return n.persistence.dr.Eo(e,t.targetId,r)})).next((function(){return Bn.forEach(t.ls,(function(r){return n.persistence.dr.Io(e,t.targetId,r)}))}))}))}))];case 2:return i.sent(),[3,4];case 3:if(!Qn(r=i.sent()))throw r;return d("LocalStore","Failed to update sequence numbers: "+r),[3,4];case 4:for(a=0,o=t;a<o.length;a++)s=o[a],c=s.targetId,s.fromCache||(l=n.Eh.get(c),u=l.Z,h=l.nt(u),n.Eh=n.Eh.st(c,h));return[2]}}))}))}(this.La,r)];case 2:return s.sent(),[2]}}))}))},e.prototype.nl=function(e){},e.prototype.vc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t;return i.__generator(this,(function(n){switch(n.label){case 0:return this.currentUser.isEqual(e)?[3,3]:(d("SyncEngine","User change. New user:",e.$h()),[4,function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,a,o;return i.__generator(this,(function(i){switch(i.label){case 0:return n=v(e),r=n.Gn,a=n.Rh,[4,n.persistence.runTransaction("Handle user change","readonly",(function(e){var i;return n.Gn.yr(e).next((function(o){return i=o,r=n.persistence.oh(t),a=new Gn(n.Ah,r,n.persistence.uh()),r.yr(e)})).next((function(t){for(var n=[],r=[],o=de(),s=0,c=i;s<c.length;s++){var l=c[s];n.push(l.batchId);for(var u=0,h=l.mutations;u<h.length;u++){var d=h[u];o=o.add(d.key)}}for(var p=0,f=t;p<f.length;p++){var m=f[p];r.push(m.batchId);for(var g=0,y=m.mutations;g<y.length;g++){var v=y[g];o=o.add(v.key)}}return a.Zn(e,o).next((function(e){return{Il:e,Al:n,Rl:r}}))}))}))];case 1:return o=i.sent(),[2,(n.Gn=r,n.Rh=a,n.Th.Ph(n.Rh),o)]}}))}))}(this.La,e)]);case 1:return t=n.sent(),this.currentUser=e,this.fl("'waitForPendingWrites' promise is rejected due to a user change."),this.Uu.au(e,t.Al,t.Rl),[4,this.hl(t.Il)];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},e.prototype.Oe=function(e){var t=this.Hu.get(e);if(t&&t.qu)return de().add(t.key);var n=de(),r=this.Ku.get(e);if(!r)return n;for(var i=0,a=r;i<a.length;i++){var o=a[i],s=this.ju.get(o);n=n.Nt(s.view.vu)}return n},e}();function oa(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,a;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,Ti((n=v(e)).La,t.query,!0)];case 1:return r=i.sent(),a=t.view.Mu(r),[2,(n.el&&n.il(t.targetId,a.$u),a)]}}))}))}function sa(e,t,n,r){return i.__awaiter(this,void 0,void 0,(function(){var a,o;return i.__generator(this,(function(i){switch(i.label){case 0:return(a=v(e)).nl("applyBatchState()"),[4,function(e,t){var n=v(e),r=v(n.Gn);return n.persistence.runTransaction("Lookup mutation documents","readonly",(function(e){return r.Pr(e,t).next((function(t){return t?n.Rh.Zn(e,t):Bn.resolve(null)}))}))}(a.La,t)];case 1:return null===(o=i.sent())?[3,6]:"pending"!==n?[3,3]:[4,a.Bu.hc()];case 2:return i.sent(),[3,4];case 3:"acknowledged"===n||"rejected"===n?(a.ul(t,r||null),function(e,t){v(v(e).Gn).Sr(t)}(a.La,t)):g(),i.label=4;case 4:return[4,a.hl(o)];case 5:return i.sent(),[3,7];case 6:d("SyncEngine","Cannot apply mutation batch with id: "+t),i.label=7;case 7:return[2]}}))}))}function ca(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,a,o,s,c,l,u;return i.__generator(this,(function(i){switch(i.label){case 0:return n=v(e),!0!==t||!0===n.tl?[3,3]:(r=n.Uu.zc(),[4,la(n,r.N())]);case 1:return a=i.sent(),n.tl=!0,[4,n.Bu.Sc(!0)];case 2:for(i.sent(),o=0,s=a;o<s.length;o++)c=s[o],n.Bu.listen(c);return[3,7];case 3:return!1!==t||!1===n.tl?[3,7]:(l=[],u=Promise.resolve(),n.Ku.forEach((function(e,t){n.Uu.iu(t)?l.push(t):u=u.then((function(){return n.rl(t),Mi(n.La,t,!0)})),n.Bu.lc(t)})),[4,u]);case 4:return i.sent(),[4,la(n,l)];case 5:return i.sent(),function(e){var t=v(e);t.Hu.forEach((function(e,n){t.Bu.lc(n)})),t.Yu.Nh(),t.Hu=new Map,t.zu=new ee(j.P)}(n),n.tl=!1,[4,n.Bu.Sc(!1)];case 6:i.sent(),i.label=7;case 7:return[2]}}))}))}function la(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var n,r,a,o,s,c,l,u,h,d,p,f,m,g;return i.__generator(this,(function(i){switch(i.label){case 0:n=v(e),r=[],a=[],o=0,s=t,i.label=1;case 1:return o<s.length?(c=s[o],l=void 0,(u=n.Ku.get(c))&&0!==u.length?[4,Si(n.La,pn(u[0]))]:[3,7]):[3,13];case 2:l=i.sent(),h=0,d=u,i.label=3;case 3:return h<d.length?(p=d[h],f=n.ju.get(p),[4,oa(n,f)]):[3,6];case 4:(m=i.sent()).snapshot&&a.push(m.snapshot),i.label=5;case 5:return h++,[3,3];case 6:return[3,11];case 7:return[4,Ri(n.La,c)];case 8:return g=i.sent(),[4,Si(n.La,g)];case 9:return l=i.sent(),[4,n.sl(ua(g),c,!1)];case 10:i.sent(),i.label=11;case 11:r.push(l),i.label=12;case 12:return o++,[3,1];case 13:return[2,(n.Wu.Ea(a),r)]}}))}))}function ua(e){return ln(e.path,e.collectionGroup,e.orderBy,e.filters,e.limit,"F",e.startAt,e.endAt)}function ha(e){var t=v(e);return v(v(t.La).persistence).rh()}function da(e,t,n,r){return i.__awaiter(this,void 0,void 0,(function(){var a,o,s;return i.__generator(this,(function(i){switch(i.label){case 0:return(a=v(e)).tl?(d("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!a.Ku.has(t))return[3,8];switch(n){case"current":case"not-current":return[3,2];case"rejected":return[3,5]}return[3,7];case 2:return[4,function(e){var t=v(e),n=v(t.Ah);return t.persistence.runTransaction("Get new document changes","readonly",(function(e){return n.Ur(e,t.Ih)})).then((function(e){var n=e.Qr,r=e.readTime;return t.Ih=r,n}))}(a.La)];case 3:return o=i.sent(),s=ve.zt(t,"current"===n),[4,a.hl(o,s)];case 4:return i.sent(),[3,8];case 5:return[4,Mi(a.La,t,!0)];case 6:return i.sent(),a.rl(t,r),[3,8];case 7:g(),i.label=8;case 8:return[2]}}))}))}function pa(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var r,a,o,s,c,l,u,h,p,f;return i.__generator(this,(function(m){switch(m.label){case 0:if(!(r=v(e)).tl)return[3,10];a=0,o=t,m.label=1;case 1:return a<o.length?(s=o[a],r.Ku.has(s)?(d("SyncEngine","Adding an already active target "+s),[3,5]):[4,Ri(r.La,s)]):[3,6];case 2:return c=m.sent(),[4,Si(r.La,c)];case 3:return l=m.sent(),[4,r.sl(ua(c),l.targetId,!1)];case 4:m.sent(),r.Bu.listen(l),m.label=5;case 5:return a++,[3,1];case 6:u=function(e){return i.__generator(this,(function(t){switch(t.label){case 0:return r.Ku.has(e)?[4,Mi(r.La,e,!1).then((function(){r.Bu.lc(e),r.rl(e)})).catch(ki)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))},h=0,p=n,m.label=7;case 7:return h<p.length?(f=p[h],[5,u(f)]):[3,10];case 8:m.sent(),m.label=9;case 9:return h++,[3,7];case 10:return[2]}}))}))}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var fa=function(){this.Pl=void 0,this.listeners=[]},ma=function(){function e(e){this.fc=e,this.gl=new k((function(e){return vn(e)}),yn),this.onlineState="Unknown",this.Vl=new Set,this.fc.subscribe(this)}return e.prototype.listen=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r,a,o,s;return i.__generator(this,(function(i){switch(i.label){case 0:if(t=e.query,n=!1,(r=this.gl.get(t))||(n=!0,r=new fa),!n)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),a=r,[4,this.fc.listen(t)];case 2:return a.Pl=i.sent(),[3,4];case 3:return o=i.sent(),s=cr(o,"Initialization of query '"+bn(e.query)+"' failed"),[2,void e.onError(s)];case 4:return this.gl.set(t,r),r.listeners.push(e),e.xu(this.onlineState),r.Pl&&e.yl(r.Pl)&&this.pl(),[2]}}))}))},e.prototype.lc=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n,r,a;return i.__generator(this,(function(i){return t=e.query,n=!1,(r=this.gl.get(t))&&(a=r.listeners.indexOf(e))>=0&&(r.listeners.splice(a,1),n=0===r.listeners.length),n?[2,(this.gl.delete(t),this.fc.lc(t))]:[2]}))}))},e.prototype.Ea=function(e){for(var t=!1,n=0,r=e;n<r.length;n++){var i=r[n],a=i.query,o=this.gl.get(a);if(o){for(var s=0,c=o.listeners;s<c.length;s++)c[s].yl(i)&&(t=!0);o.Pl=i}}t&&this.pl()},e.prototype.dl=function(e,t){var n=this.gl.get(e);if(n)for(var r=0,i=n.listeners;r<i.length;r++)i[r].onError(t);this.gl.delete(e)},e.prototype.al=function(e){this.onlineState=e;var t=!1;this.gl.forEach((function(n,r){for(var i=0,a=r.listeners;i<a.length;i++)a[i].xu(e)&&(t=!0)})),t&&this.pl()},e.prototype.bl=function(e){this.Vl.add(e),e.next()},e.prototype.vl=function(e){this.Vl.delete(e)},e.prototype.pl=function(){this.Vl.forEach((function(e){e.next()}))},e}(),ga=function(){function e(e,t,n){this.query=e,this.Sl=t,this.Dl=!1,this.Cl=null,this.onlineState="Unknown",this.options=n||{}}return e.prototype.yl=function(e){if(!this.options.includeMetadataChanges){for(var t=[],n=0,r=e.docChanges;n<r.length;n++){var i=r[n];3!==i.type&&t.push(i)}e=new ye(e.query,e.docs,e.Lt,t,e.qt,e.fromCache,e.Bt,!0)}var a=!1;return this.Dl?this.Nl(e)&&(this.Sl.next(e),a=!0):this.Fl(e,this.onlineState)&&(this.kl(e),a=!0),this.Cl=e,a},e.prototype.onError=function(e){this.Sl.error(e)},e.prototype.xu=function(e){this.onlineState=e;var t=!1;return this.Cl&&!this.Dl&&this.Fl(this.Cl,e)&&(this.kl(this.Cl),t=!0),t},e.prototype.Fl=function(e,t){if(!e.fromCache)return!0;var n="Offline"!==t;return!(this.options.$l&&n||e.docs._()&&"Offline"!==t)},e.prototype.Nl=function(e){if(e.docChanges.length>0)return!0;var t=this.Cl&&this.Cl.hasPendingWrites!==e.hasPendingWrites;return!(!e.Bt&&!t)&&!0===this.options.includeMetadataChanges},e.prototype.kl=function(e){e=ye.Qt(e.query,e.docs,e.qt,e.fromCache),this.Dl=!0,this.Sl.next(e)},e}(),ya=function(){function e(){}return e.prototype.Ph=function(e){this.xl=e},e.prototype.ns=function(e,t,n,r){var i=this;return t.hn()||n.isEqual(I.min())?this.Ol(e,t):this.xl.Zn(e,r).next((function(a){var s=i.Ml(t,a);return(t.an()||t.cn())&&i.Nu(t.nn,s,r,n)?i.Ol(e,t):(h()<=o.LogLevel.DEBUG&&d("IndexFreeQueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),bn(t)),i.xl.ns(e,t,n).next((function(e){return s.forEach((function(t){e=e.st(t.key,t)})),e})))}))},e.prototype.Ml=function(e,t){var n=new re(An(e));return t.forEach((function(t,r){r instanceof rn&&wn(e,r)&&(n=n.add(r))})),n},e.prototype.Nu=function(e,t,n,r){if(n.size!==t.size)return!0;var i="F"===e?t.last():t.first();return!!i&&(i.hasPendingWrites||i.version.o(r)>0)},e.prototype.Ol=function(e,t){return h()<=o.LogLevel.DEBUG&&d("IndexFreeQueryEngine","Using full collection scan to execute query:",bn(t)),this.xl.ns(e,t,I.min())},e}(),va=function(){function e(e,t){this.zn=e,this.dr=t,this.Gn=[],this.Ll=1,this.ql=new re(Oi.yh)}return e.prototype.mr=function(e){return Bn.resolve(0===this.Gn.length)},e.prototype.Ir=function(e,t,n,r){var i=this.Ll;this.Ll++,this.Gn.length>0&&this.Gn[this.Gn.length-1];var a=new jn(i,t,n,r);this.Gn.push(a);for(var o=0,s=r;o<s.length;o++){var c=s[o];this.ql=this.ql.add(new Oi(c.key,i)),this.zn.Ar(e,c.key.path.p())}return Bn.resolve(a)},e.prototype.Rr=function(e,t){return Bn.resolve(this.Bl(t))},e.prototype.gr=function(e,t){var n=t+1,r=this.Ul(n),i=r<0?0:r;return Bn.resolve(this.Gn.length>i?this.Gn[i]:null)},e.prototype.Vr=function(){return Bn.resolve(0===this.Gn.length?-1:this.Ll-1)},e.prototype.yr=function(e){return Bn.resolve(this.Gn.slice())},e.prototype.Yn=function(e,t){var n=this,r=new Oi(t,0),i=new Oi(t,Number.POSITIVE_INFINITY),a=[];return this.ql.St([r,i],(function(e){var t=n.Bl(e.kh);a.push(t)})),Bn.resolve(a)},e.prototype.es=function(e,t){var n=this,r=new re(A);return t.forEach((function(e){var t=new Oi(e,0),i=new Oi(e,Number.POSITIVE_INFINITY);n.ql.St([t,i],(function(e){r=r.add(e.kh)}))})),Bn.resolve(this.Ql(r))},e.prototype.as=function(e,t){var n=t.path,r=n.length+1,i=n;j.j(i)||(i=i.child(""));var a=new Oi(new j(i),0),o=new re(A);return this.ql.Dt((function(e){var t=e.key.path;return!!n.D(t)&&(t.length===r&&(o=o.add(e.kh)),!0)}),a),Bn.resolve(this.Ql(o))},e.prototype.Ql=function(e){var t=this,n=[];return e.forEach((function(e){var r=t.Bl(e);null!==r&&n.push(r)})),n},e.prototype.br=function(e,t){var n=this;y(0===this.Wl(t.batchId,"removed")),this.Gn.shift();var r=this.ql;return Bn.forEach(t.mutations,(function(i){var a=new Oi(i.key,t.batchId);return r=r.delete(a),n.dr.Dr(e,i.key)})).next((function(){n.ql=r}))},e.prototype.Sr=function(e){},e.prototype.Nr=function(e,t){var n=new Oi(t,0),r=this.ql.Ct(n);return Bn.resolve(t.isEqual(r&&r.key))},e.prototype.Cr=function(e){return this.Gn.length,Bn.resolve()},e.prototype.Wl=function(e,t){return this.Ul(e)},e.prototype.Ul=function(e){return 0===this.Gn.length?0:e-this.Gn[0].batchId},e.prototype.Bl=function(e){var t=this.Ul(e);return t<0||t>=this.Gn.length?null:this.Gn[t]},e}(),ba=function(){function e(e,t){this.zn=e,this.jl=t,this.docs=new ee(j.P),this.size=0}return e.prototype.xn=function(e,t,n){var r=t.key,i=this.docs.get(r),a=i?i.size:0,o=this.jl(t);return this.docs=this.docs.st(r,{Or:t,size:o,readTime:n}),this.size+=o-a,this.zn.Ar(e,r.path.p())},e.prototype.Mn=function(e){var t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)},e.prototype.Ln=function(e,t){var n=this.docs.get(t);return Bn.resolve(n?n.Or:null)},e.prototype.getEntries=function(e,t){var n=this,r=se();return t.forEach((function(e){var t=n.docs.get(e);r=r.st(e,t?t.Or:null)})),Bn.resolve(r)},e.prototype.ns=function(e,t,n){for(var r=le(),i=new j(t.path.child("")),a=this.docs.ut(i);a.Tt();){var o=a.wt(),s=o.key,c=o.value,l=c.Or,u=c.readTime;if(!t.path.D(s.path))break;u.o(n)<=0||l instanceof rn&&wn(t,l)&&(r=r.st(l.key,l))}return Bn.resolve(r)},e.prototype.Kl=function(e,t){return Bn.forEach(this.docs,(function(e){return t(e)}))},e.prototype.jr=function(t){return new e.Kr(this)},e.prototype.zr=function(e){return Bn.resolve(this.size)},e}();ba.Kr=function(e){function t(t){var n=this;return(n=e.call(this)||this).Hr=t,n}return i.__extends(t,e),t.prototype.Un=function(e){var t=this,n=[];return this.Fn.forEach((function(r,i){i?n.push(t.Hr.xn(e,i,t.readTime)):t.Hr.Mn(r)})),Bn.Cn(n)},t.prototype.qn=function(e,t){return this.Hr.Ln(e,t)},t.prototype.Bn=function(e,t){return this.Hr.getEntries(e,t)},t}(Vn);
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var wa=function(){function e(e){this.persistence=e,this.Gl=new k((function(e){return G(e)}),q),this.lastRemoteSnapshotVersion=I.min(),this.highestTargetId=0,this.zl=0,this.Hl=new Ci,this.targetCount=0,this.Yl=si.to()}return e.prototype.be=function(e,t){return this.Gl.forEach((function(e,n){return t(n)})),Bn.resolve()},e.prototype.ro=function(e){return Bn.resolve(this.lastRemoteSnapshotVersion)},e.prototype.oo=function(e){return Bn.resolve(this.zl)},e.prototype.no=function(e){return this.highestTargetId=this.Yl.next(),Bn.resolve(this.highestTargetId)},e.prototype.ho=function(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.zl&&(this.zl=t),Bn.resolve()},e.prototype.co=function(e){this.Gl.set(e.target,e);var t=e.targetId;t>this.highestTargetId&&(this.Yl=new si(t),this.highestTargetId=t),e.sequenceNumber>this.zl&&(this.zl=e.sequenceNumber)},e.prototype.ao=function(e,t){return this.co(t),this.targetCount+=1,Bn.resolve()},e.prototype.lo=function(e,t){return this.co(t),Bn.resolve()},e.prototype._o=function(e,t){return this.Gl.delete(t.target),this.Hl.Ch(t.targetId),this.targetCount-=1,Bn.resolve()},e.prototype.hr=function(e,t,n){var r=this,i=0,a=[];return this.Gl.forEach((function(o,s){s.sequenceNumber<=t&&null===n.get(s.targetId)&&(r.Gl.delete(o),a.push(r.fo(e,s.targetId)),i++)})),Bn.Cn(a).next((function(){return i}))},e.prototype.do=function(e){return Bn.resolve(this.targetCount)},e.prototype.wo=function(e,t){var n=this.Gl.get(t)||null;return Bn.resolve(n)},e.prototype.To=function(e,t,n){return this.Hl.vh(t,n),Bn.resolve()},e.prototype.mo=function(e,t,n){this.Hl.Dh(t,n);var r=this.persistence.dr,i=[];return r&&t.forEach((function(t){i.push(r.Dr(e,t))})),Bn.Cn(i)},e.prototype.fo=function(e,t){return this.Hl.Ch(t),Bn.resolve()},e.prototype.Ao=function(e,t){var n=this.Hl.Fh(t);return Bn.resolve(n)},e.prototype.Nr=function(e,t){return Bn.resolve(this.Hl.Nr(t))},e}(),Aa=function(){function e(e){var t=this;this.Jl={},this.yo=new Wn(0),this.po=!1,this.po=!0,this.dr=e(this),this.ko=new wa(this),this.zn=new Br,this.Kn=new ba(this.zn,(function(e){return t.dr.Xl(e)}))}return e.prototype.start=function(){return Promise.resolve()},e.prototype.th=function(){return this.po=!1,Promise.resolve()},Object.defineProperty(e.prototype,"tr",{get:function(){return this.po},enumerable:!1,configurable:!0}),e.prototype.Bo=function(){},e.prototype.Uo=function(){},e.prototype.uh=function(){return this.zn},e.prototype.oh=function(e){var t=this.Jl[e.$h()];return t||(t=new va(this.zn,this.dr),this.Jl[e.$h()]=t),t},e.prototype.hh=function(){return this.ko},e.prototype.ah=function(){return this.Kn},e.prototype.runTransaction=function(e,t,n){var r=this;d("MemoryPersistence","Starting transaction:",e);var i=new Ea(this.yo.next());return this.dr.Zl(),n(i).next((function(e){return r.dr.t_(i).next((function(){return e}))})).Sn().then((function(e){return i.jn(),e}))},e.prototype.e_=function(e,t){return Bn.Nn(Object.values(this.Jl).map((function(n){return function(){return n.Nr(e,t)}})))},e}(),Ea=function(e){function t(t){var n=this;return(n=e.call(this)||this).Ro=t,n}return i.__extends(t,e),t}(Hn),xa=function(){function e(e){this.persistence=e,this.n_=new Ci,this.s_=null}return e.i_=function(t){return new e(t)},Object.defineProperty(e.prototype,"r_",{get:function(){if(this.s_)return this.s_;throw g()},enumerable:!1,configurable:!0}),e.prototype.Eo=function(e,t,n){return this.n_.Eo(n,t),this.r_.delete(n.toString()),Bn.resolve()},e.prototype.Io=function(e,t,n){return this.n_.Io(n,t),this.r_.add(n.toString()),Bn.resolve()},e.prototype.Dr=function(e,t){return this.r_.add(t.toString()),Bn.resolve()},e.prototype.removeTarget=function(e,t){var n=this;this.n_.Ch(t.targetId).forEach((function(e){return n.r_.add(e.toString())}));var r=this.persistence.hh();return r.Ao(e,t.targetId).next((function(e){e.forEach((function(e){return n.r_.add(e.toString())}))})).next((function(){return r._o(e,t)}))},e.prototype.Zl=function(){this.s_=new Set},e.prototype.t_=function(e){var t=this,n=this.persistence.ah().jr();return Bn.forEach(this.r_,(function(r){var i=j.B(r);return t.o_(e,i).next((function(e){e||n.Mn(i)}))})).next((function(){return t.s_=null,n.apply(e)}))},e.prototype.wh=function(e,t){var n=this;return this.o_(e,t).next((function(e){e?n.r_.delete(t.toString()):n.r_.add(t.toString())}))},e.prototype.Xl=function(e){return 0},e.prototype.o_=function(e,t){var n=this;return Bn.Nn([function(){return Bn.resolve(n.n_.Nr(t))},function(){return n.persistence.hh().Nr(e,t)},function(){return n.persistence.e_(e,t)}])},e}(),_a=function(){function e(e){this.h_=e.h_,this.a_=e.a_}return e.prototype.wa=function(e){this.c_=e},e.prototype.ua=function(e){this.u_=e},e.prototype.onMessage=function(e){this.l_=e},e.prototype.close=function(){this.a_()},e.prototype.send=function(e){this.h_(e)},e.prototype.__=function(){this.c_()},e.prototype.f_=function(e){this.u_(e)},e.prototype.d_=function(e){this.l_(e)},e}(),Sa={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"},Ma=function(e){function t(t){var n=this;return(n=e.call(this,t)||this).forceLongPolling=t.forceLongPolling,n}return i.__extends(t,e),t.prototype.A_=function(e,t,n,r){return new Promise((function(i,a){var o=new c.XhrIo;o.listenOnce(c.EventType.COMPLETE,(function(){try{switch(o.getLastErrorCode()){case c.ErrorCode.NO_ERROR:var t=o.getResponseJson();d("Connection","XHR received:",JSON.stringify(t)),i(t);break;case c.ErrorCode.TIMEOUT:d("Connection",'RPC "'+e+'" timed out'),a(new O(C.DEADLINE_EXCEEDED,"Request time out"));break;case c.ErrorCode.HTTP_ERROR:var n=o.getStatus();if(d("Connection",'RPC "'+e+'" failed with status:',n,"response text:",o.getResponseText()),n>0){var r=o.getResponseJson().error;if(r&&r.status&&r.message){var s=function(e){var t=e.toLowerCase().replace("_","-");return Object.values(C).indexOf(t)>=0?t:C.UNKNOWN}(r.status);a(new O(s,r.message))}else a(new O(C.UNKNOWN,"Server responded with status "+o.getStatus()))}else a(new O(C.UNAVAILABLE,"Connection failed."));break;default:g()}}finally{d("Connection",'RPC "'+e+'" completed.')}}));var s=JSON.stringify(r);o.send(t,"POST",s,n,15)}))},t.prototype.Ta=function(e,t){var n=[this.T_,"/","google.firestore.v1.Firestore","/",e,"/channel"],r=c.createWebChannelTransport(),i={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.s.projectId+"/databases/"+this.s.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling};this.I_(i.initMessageHeaders,t),s.isMobileCordova()||s.isReactNative()||s.isElectron()||s.isIE()||s.isUWP()||s.isBrowserExtension()||(i.httpHeadersOverwriteParam="$httpHeaders");var a=n.join("");d("Connection","Creating WebChannel: "+a,i);var o=r.createWebChannel(a,i),l=!1,u=!1,h=new _a({h_:function(e){u?d("Connection","Not sending because WebChannel is closed:",e):(l||(d("Connection","Opening WebChannel transport."),o.open(),l=!0),d("Connection","WebChannel sending:",e),o.send(e))},a_:function(){return o.close()}}),p=function(e,t){o.listen(e,(function(e){try{t(e)}catch(e){setTimeout((function(){throw e}),0)}}))};return p(c.WebChannel.EventType.OPEN,(function(){u||d("Connection","WebChannel transport opened.")})),p(c.WebChannel.EventType.CLOSE,(function(){u||(u=!0,d("Connection","WebChannel transport closed"),h.f_())})),p(c.WebChannel.EventType.ERROR,(function(e){u||(u=!0,f("Connection","WebChannel transport errored:",e),h.f_(new O(C.UNAVAILABLE,"The operation could not be completed")))})),p(c.WebChannel.EventType.MESSAGE,(function(e){var t;if(!u){var n=e.data[0];y(!!n);var r=n,i=r.error||(null===(t=r[0])||void 0===t?void 0:t.error);if(i){d("Connection","WebChannel received error:",i);var a=i.status,s=function(e){var t=Z[e];if(void 0!==t)return $(t)}(a),c=i.message;void 0===s&&(s=C.INTERNAL,c="Unknown error status: "+a+" with message "+i.message),u=!0,h.f_(new O(s,c)),o.close()}else d("Connection","WebChannel received:",n),h.d_(n)}})),setTimeout((function(){h.__()}),0),h},t}(function(){function e(e){this.w_=e,this.s=e.s;var t=e.ssl?"https":"http";this.T_=t+"://"+e.host,this.E_="projects/"+this.s.projectId+"/databases/"+this.s.database+"/documents"}return e.prototype.va=function(e,t,n,r){var i=this.m_(e,t);d("RestConnection","Sending: ",i,n);var a={};return this.I_(a,r),this.A_(e,i,a,n).then((function(e){return d("RestConnection","Received: ",e),e}),(function(t){throw f("RestConnection",e+" failed with error: ",t,"url: ",i,"request:",n),t}))},e.prototype.Sa=function(e,t,n,r){return this.va(e,t,n,r)},e.prototype.I_=function(e,t){if(e["X-Goog-Api-Client"]="gl-js/ fire/7.19.0",e["Content-Type"]="text/plain",t)for(var n in t.Mh)t.Mh.hasOwnProperty(n)&&(e[n]=t.Mh[n])},e.prototype.m_=function(e,t){var n=Sa[e];return this.T_+"/v1/"+t+":"+n},e}()),Ta=function(){function e(){var e=this;this.R_=function(){return e.P_()},this.g_=function(){return e.V_()},this.y_=[],this.p_()}return e.prototype.Ka=function(e){this.y_.push(e)},e.prototype.th=function(){window.removeEventListener("online",this.R_),window.removeEventListener("offline",this.g_)},e.prototype.p_=function(){window.addEventListener("online",this.R_),window.addEventListener("offline",this.g_)},e.prototype.P_=function(){d("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(var e=0,t=this.y_;e<t.length;e++)(0,t[e])(0)},e.prototype.V_=function(){d("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(var e=0,t=this.y_;e<t.length;e++)(0,t[e])(1)},e.ks=function(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener},e}(),Ra=function(){function e(){}return e.prototype.Ka=function(e){},e.prototype.th=function(){},e}();
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function ka(e){return new Je(e,!0)}
+/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var Ca="You are using the memory-only build of Firestore. Persistence support is only available via the @firebase/firestore bundle or the firebase-firestore.js build.",Oa=function(){function e(){}return e.prototype.initialize=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.Uu=this.b_(e),this.persistence=this.v_(e),[4,this.persistence.start()];case 1:return t.sent(),this.S_=this.D_(e),this.La=this.C_(e),[2]}}))}))},e.prototype.D_=function(e){return null},e.prototype.C_=function(e){return t=this.persistence,n=new ya,r=e.N_,new wi(t,n,r);var t,n,r},e.prototype.v_=function(e){if(e.k_.F_)throw new O(C.FAILED_PRECONDITION,Ca);return new Aa(xa.i_)},e.prototype.b_=function(e){return new $i},e.prototype.terminate=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.S_&&this.S_.stop(),[4,this.Uu.th()];case 1:return e.sent(),[4,this.persistence.th()];case 2:return e.sent(),[2]}}))}))},e.prototype.clearPersistence=function(e,t){throw new O(C.FAILED_PRECONDITION,Ca)},e}(),Pa=function(e){function t(t){var n=this;return(n=e.call(this)||this).x_=t,n}return i.__extends(t,e),t.prototype.initialize=function(t){return i.__awaiter(this,void 0,void 0,(function(){var n,r=this;return i.__generator(this,(function(a){switch(a.label){case 0:return[4,e.prototype.initialize.call(this,t)];case 1:return a.sent(),[4,this.x_.initialize(this,t)];case 2:return a.sent(),n=this.x_.fc,this.Uu instanceof Qi?(this.Uu.fc={mu:sa.bind(null,n),Iu:da.bind(null,n),Au:pa.bind(null,n),rh:ha.bind(null,n)},[4,this.Uu.start()]):[3,4];case 3:a.sent(),a.label=4;case 4:return[4,this.persistence.qo((function(e){return i.__awaiter(r,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return[4,ca(this.x_.fc,e)];case 1:return t.sent(),this.S_&&(e&&!this.S_.tr?this.S_.start(this.La):e||this.S_.stop()),[2]}}))}))}))];case 5:return a.sent(),[2]}}))}))},t.prototype.b_=function(e){if(e.k_.F_&&e.k_.synchronizeTabs){var t=ir();if(!Qi.ks(t))throw new O(C.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var n=bi(e.w_.s,e.w_.persistenceKey);return new Qi(t,e.ei,n,e.clientId,e.N_)}return new $i},t}(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(t){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){switch(n.label){case 0:return[4,e.prototype.initialize.call(this,t)];case 1:return n.sent(),[4,function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n;return i.__generator(this,(function(r){return t=v(e),n=v(t.Ah),[2,t.persistence.runTransaction("Synchronize last document change read time","readonly",(function(e){return n.Wr(e)})).then((function(e){t.Ih=e}))]}))}))}(this.La)];case 2:return n.sent(),[2]}}))}))},t.prototype.D_=function(e){var t=this.persistence.dr.Yi;return new pr(t,e.ei)},t.prototype.v_=function(e){var t=bi(e.w_.s,e.w_.persistenceKey),n=ka(e.w_.s);return new fi(e.k_.synchronizeTabs,t,e.clientId,dr.Ui(e.k_.cacheSizeBytes),e.ei,ir(),ar(),n,this.Uu,e.k_.Vo)},t.prototype.b_=function(e){return new $i},t.prototype.clearPersistence=function(e,t){return function(e){return i.__awaiter(this,void 0,void 0,(function(){var t;return i.__generator(this,(function(n){switch(n.label){case 0:return Xn.ks()?(t=e+"main",[4,Xn.delete(t)]):[2,Promise.resolve()];case 1:return n.sent(),[2]}}))}))}(bi(e,t))},t}(Oa)),Ia=function(){function e(){}return e.prototype.initialize=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n=this;return i.__generator(this,(function(r){switch(r.label){case 0:return this.La?[3,3]:(this.La=e.La,this.Uu=e.Uu,this.qa=this.O_(t),this.Bu=this.M_(t),this.fc=this.L_(t),this.q_=this.B_(t),this.Uu.Da=function(e){return n.fc.xu(e,1)},this.Bu.fc=this.fc,[4,this.Bu.start()]);case 1:return r.sent(),[4,this.Bu.Sc(this.fc.el)];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},e.prototype.B_=function(e){return new ma(this.fc)},e.prototype.O_=function(e){var t,n=ka(e.w_.s),r=(t=e.w_,new Ma(t));return function(e,t,n){return new Vi(e,t,n)}(e.credentials,r,n)},e.prototype.M_=function(e){var t=this;return new Hi(this.La,this.qa,e.ei,(function(e){return t.fc.xu(e,0)}),Ta.ks()?new Ta:new Ra)},e.prototype.L_=function(e){return function(e,t,n,r,i,a,o){var s=new aa(e,t,n,r,i,a);return o&&(s.tl=!0),s}(this.La,this.Bu,this.qa,this.Uu,e.N_,e.Qu,!e.k_.F_||!e.k_.synchronizeTabs)},e.prototype.terminate=function(){return this.Bu.th()},e}();
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function Na(e){return function(e,t){if("object"!=typeof e||null===e)return!1;for(var n=e,r=0,i=["next","error","complete"];r<i.length;r++){var a=i[r];if(a in n&&"function"==typeof n[a])return!0}return!1}(e)}var La=function(){function e(e){this.observer=e,this.muted=!1}return e.prototype.next=function(e){this.observer.next&&this.U_(this.observer.next,e)},e.prototype.error=function(e){this.observer.error?this.U_(this.observer.error,e):console.error("Uncaught Error in snapshot listener:",e)},e.prototype.Q_=function(){this.muted=!0},e.prototype.U_=function(e,t){var n=this;this.muted||setTimeout((function(){n.muted||e(t)}),0)},e}();
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function Da(e,t){if(0!==t.length)throw new O(C.INVALID_ARGUMENT,"Function "+e+"() does not support arguments, but was called with "+eo(t.length,"argument")+".")}function Fa(e,t,n){if(t.length!==n)throw new O(C.INVALID_ARGUMENT,"Function "+e+"() requires "+eo(n,"argument")+", but was called with "+eo(t.length,"argument")+".")}function ja(e,t,n){if(t.length<n)throw new O(C.INVALID_ARGUMENT,"Function "+e+"() requires at least "+eo(n,"argument")+", but was called with "+eo(t.length,"argument")+".")}function Ua(e,t,n,r){if(t.length<n||t.length>r)throw new O(C.INVALID_ARGUMENT,"Function "+e+"() requires between "+n+" and "+r+" arguments, but was called with "+eo(t.length,"argument")+".")}function Ba(e,t,n,r){Wa(e,t,$a(n)+" argument",r)}function Va(e,t,n,r){void 0!==r&&Ba(e,t,n,r)}function za(e,t,n,r){Wa(e,t,n+" option",r)}function Ha(e,t,n,r){void 0!==r&&za(e,t,n,r)}function Ga(e,t,n,r,i){void 0!==r&&function(e,t,n,r,i){for(var a=[],o=0,s=i;o<s.length;o++){var c=s[o];if(c===r)return;a.push(Za(c))}var l=Za(r);throw new O(C.INVALID_ARGUMENT,"Invalid value "+l+" provided to function "+e+'() for option "'+n+'". Acceptable values: '+a.join(", "))}(e,0,n,r,i)}function qa(e,t,n,r){if(!t.some((function(e){return e===r})))throw new O(C.INVALID_ARGUMENT,"Invalid value "+Za(r)+" provided to function "+e+"() for its "+$a(n)+" argument. Acceptable values: "+t.join(", "));return r}function Wa(e,t,n,r){if(!("object"===t?Ja(r):"non-empty string"===t?"string"==typeof r&&""!==r:typeof r===t)){var i=Za(r);throw new O(C.INVALID_ARGUMENT,"Function "+e+"() requires its "+n+" to be of type "+t+", but it was: "+i)}}function Ja(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}function Za(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=e.substring(0,20)+"..."),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";var t=function(e){if(e.constructor){var t=/function\s+([^\s(]+)\s*\(/.exec(e.constructor.toString());if(t&&t.length>1)return t[1]}return null}(e);return t?"a custom "+t+" object":"an object"}return"function"==typeof e?"a function":g()}function Xa(e,t,n){if(void 0===n)throw new O(C.INVALID_ARGUMENT,"Function "+e+"() requires a valid "+$a(t)+" argument, but it was undefined.")}function Ya(e,t,n){T(t,(function(t,r){if(n.indexOf(t)<0)throw new O(C.INVALID_ARGUMENT,"Unknown option '"+t+"' passed to function "+e+"(). Available options: "+n.join(", "))}))}function Ka(e,t,n,r){var i=Za(r);return new O(C.INVALID_ARGUMENT,"Function "+e+"() requires its "+$a(n)+" argument to be a "+t+", but it was: "+i)}function Qa(e,t,n){if(n<=0)throw new O(C.INVALID_ARGUMENT,"Function "+e+"() requires its "+$a(t)+" argument to be a positive number, but it was: "+n+".")}function $a(e){switch(e){case 1:return"first";case 2:return"second";case 3:return"third";default:return e+"th"}}function eo(e,t){return e+" "+t+(1===e?"":"s")}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function to(){if("undefined"==typeof Uint8Array)throw new O(C.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function no(){if("undefined"==typeof atob)throw new O(C.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var ro=function(){function e(e){no(),this.W_=e}return e.fromBase64String=function(t){Fa("Blob.fromBase64String",arguments,1),Ba("Blob.fromBase64String","string",1,t),no();try{return new e(J.fromBase64String(t))}catch(t){throw new O(C.INVALID_ARGUMENT,"Failed to construct Blob from Base64 string: "+t)}},e.fromUint8Array=function(t){if(Fa("Blob.fromUint8Array",arguments,1),to(),!(t instanceof Uint8Array))throw Ka("Blob.fromUint8Array","Uint8Array",1,t);return new e(J.fromUint8Array(t))},e.prototype.toBase64=function(){return Fa("Blob.toBase64",arguments,0),no(),this.W_.toBase64()},e.prototype.toUint8Array=function(){return Fa("Blob.toUint8Array",arguments,0),to(),this.W_.toUint8Array()},e.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},e.prototype.isEqual=function(e){return this.W_.isEqual(e.W_)},e}(),io=function(e){!function(e,t,n,r){if(!(t instanceof Array)||t.length<1)throw new O(C.INVALID_ARGUMENT,"Function FieldPath() requires its fieldNames argument to be an array with at least "+eo(1,"element")+".")}(0,e);for(var t=0;t<e.length;++t)if(Ba("FieldPath","string",t,e[t]),0===e[t].length)throw new O(C.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this.j_=new F(e)},ao=function(e){function t(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.call(this,t)||this}return i.__extends(t,e),t.documentId=function(){return new t(F.L().F())},t.prototype.isEqual=function(e){if(!(e instanceof t))throw Ka("isEqual","FieldPath",1,e);return this.j_.isEqual(e.j_)},t}(io),oo=new RegExp("[~\\*/\\[\\]]"),so=function(){this.K_=this},co=function(e){function t(t){var n=this;return(n=e.call(this)||this).G_=t,n}return i.__extends(t,e),t.prototype.z_=function(e){if(2!==e.H_)throw 1===e.H_?e.Y_(this.G_+"() can only appear at the top level of your update data"):e.Y_(this.G_+"() cannot be used with set() unless you pass {merge:true}");return e.qe.push(e.path),null},t.prototype.isEqual=function(e){return e instanceof t},t}(so);
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function lo(e,t,n){return new xo({H_:3,J_:t.settings.J_,methodName:e.G_,X_:n},t.s,t.serializer,t.ignoreUndefinedProperties)}var uo=function(e){function t(t){var n=this;return(n=e.call(this)||this).G_=t,n}return i.__extends(t,e),t.prototype.z_=function(e){return new Lt(e.path,new Mt)},t.prototype.isEqual=function(e){return e instanceof t},t}(so),ho=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).G_=t,r.Z_=n,r}return i.__extends(t,e),t.prototype.z_=function(e){var t=lo(this,e,!0),n=this.Z_.map((function(e){return ko(e,t)})),r=new Tt(n);return new Lt(e.path,r)},t.prototype.isEqual=function(e){return this===e},t}(so),po=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).G_=t,r.Z_=n,r}return i.__extends(t,e),t.prototype.z_=function(e){var t=lo(this,e,!0),n=this.Z_.map((function(e){return ko(e,t)})),r=new kt(n);return new Lt(e.path,r)},t.prototype.isEqual=function(e){return this===e},t}(so),fo=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).G_=t,r.tf=n,r}return i.__extends(t,e),t.prototype.z_=function(e){var t=new Ot(e.serializer,Ye(e.serializer,this.tf));return new Lt(e.path,t)},t.prototype.isEqual=function(e){return this===e},t}(so),mo=function(e){function t(){return e.call(this)||this}return i.__extends(t,e),t.delete=function(){return Da("FieldValue.delete",arguments),new go(new co("FieldValue.delete"))},t.serverTimestamp=function(){return Da("FieldValue.serverTimestamp",arguments),new go(new uo("FieldValue.serverTimestamp"))},t.arrayUnion=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ja("FieldValue.arrayUnion",arguments,1),new go(new ho("FieldValue.arrayUnion",e))},t.arrayRemove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ja("FieldValue.arrayRemove",arguments,1),new go(new po("FieldValue.arrayRemove",e))},t.increment=function(e){return Ba("FieldValue.increment","number",1,e),Fa("FieldValue.increment",arguments,1),new go(new fo("FieldValue.increment",e))},t}(so),go=function(e){function t(t){var n=this;return(n=e.call(this)||this).K_=t,n.G_=t.G_,n}return i.__extends(t,e),t.prototype.z_=function(e){return this.K_.z_(e)},t.prototype.isEqual=function(e){return e instanceof t&&this.K_.isEqual(e.K_)},t}(mo),yo=function(){function e(e,t){if(Fa("GeoPoint",arguments,2),Ba("GeoPoint","number",1,e),Ba("GeoPoint","number",2,t),!isFinite(e)||e<-90||e>90)throw new O(C.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new O(C.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this.ef=e,this.nf=t}return Object.defineProperty(e.prototype,"latitude",{get:function(){return this.ef},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"longitude",{get:function(){return this.nf},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(e){return this.ef===e.ef&&this.nf===e.nf},e.prototype.toJSON=function(){return{latitude:this.ef,longitude:this.nf}},e.prototype.T=function(e){return A(this.ef,e.ef)||A(this.nf,e.nf)},e}(),vo=/^__.*__$/,bo=function(e,t,n){this.sf=e,this.if=t,this.rf=n},wo=function(){function e(e,t,n){this.data=e,this.qe=t,this.fieldTransforms=n}return e.prototype.hf=function(e,t){var n=[];return null!==this.qe?n.push(new Wt(e,this.data,this.qe,t)):n.push(new qt(e,this.data,t)),this.fieldTransforms.length>0&&n.push(new Zt(e,this.fieldTransforms)),n},e}(),Ao=function(){function e(e,t,n){this.data=e,this.qe=t,this.fieldTransforms=n}return e.prototype.hf=function(e,t){var n=[new Wt(e,this.data,this.qe,t)];return this.fieldTransforms.length>0&&n.push(new Zt(e,this.fieldTransforms)),n},e}();function Eo(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw g()}}var xo=function(){function e(e,t,n,r,i,a){this.settings=e,this.s=t,this.serializer=n,this.ignoreUndefinedProperties=r,void 0===i&&this.af(),this.fieldTransforms=i||[],this.qe=a||[]}return Object.defineProperty(e.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"H_",{get:function(){return this.settings.H_},enumerable:!1,configurable:!0}),e.prototype.cf=function(t){return new e(Object.assign(Object.assign({},this.settings),t),this.s,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.qe)},e.prototype.uf=function(e){var t,n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.cf({path:n,X_:!1});return r.lf(e),r},e.prototype._f=function(e){var t,n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.cf({path:n,X_:!1});return r.af(),r},e.prototype.ff=function(e){return this.cf({path:void 0,X_:!0})},e.prototype.Y_=function(e){return Lo(e,this.settings.methodName,this.settings.df||!1,this.path,this.settings.J_)},e.prototype.contains=function(e){return void 0!==this.qe.find((function(t){return e.D(t)}))||void 0!==this.fieldTransforms.find((function(t){return e.D(t.field)}))},e.prototype.af=function(){if(this.path)for(var e=0;e<this.path.length;e++)this.lf(this.path.get(e))},e.prototype.lf=function(e){if(0===e.length)throw this.Y_("Document fields must not be empty");if(Eo(this.H_)&&vo.test(e))throw this.Y_('Document fields cannot begin and end with "__"')},e}(),_o=function(){function e(e,t,n){this.s=e,this.ignoreUndefinedProperties=t,this.serializer=n||ka(e)}return e.prototype.wf=function(e,t,n,r){return void 0===r&&(r=!1),new xo({H_:e,methodName:t,J_:n,path:F.$(),X_:!1,df:r},this.s,this.serializer,this.ignoreUndefinedProperties)},e}();function So(e,t,n,r,i,a){void 0===a&&(a={});var o=e.wf(a.merge||a.mergeFields?2:0,t,n,i);Po("Data must be an object, but it was:",o,r);var s,c,l=Co(r,o);if(a.merge)s=new Nt(o.qe),c=o.fieldTransforms;else if(a.mergeFields){for(var u=[],h=0,d=a.mergeFields;h<d.length;h++){var p=d[h],f=void 0;if(p instanceof io)f=p.j_;else{if("string"!=typeof p)throw g();f=No(t,p,n)}if(!o.contains(f))throw new O(C.INVALID_ARGUMENT,"Field '"+f+"' is specified in your field mask but missing from your input data.");Do(u,f)||u.push(f)}s=new Nt(u),c=o.fieldTransforms.filter((function(e){return s.Ke(e.field)}))}else s=null,c=o.fieldTransforms;return new wo(new $t(l),s,c)}function Mo(e,t,n,r){var i=e.wf(1,t,n);Po("Data must be an object, but it was:",i,r);var a=[],o=new en;T(r,(function(e,r){var s=No(t,e,n),c=i._f(s);if(r instanceof so&&r.K_ instanceof co)a.push(s);else{var l=ko(r,c);null!=l&&(a.push(s),o.set(s,l))}}));var s=new Nt(a);return new Ao(o.ze(),s,i.fieldTransforms)}function To(e,t,n,r,i,a){var o=e.wf(1,t,n),s=[Io(t,r,n)],c=[i];if(a.length%2!=0)throw new O(C.INVALID_ARGUMENT,"Function "+t+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var l=0;l<a.length;l+=2)s.push(Io(t,a[l])),c.push(a[l+1]);for(var u=[],h=new en,d=s.length-1;d>=0;--d)if(!Do(u,s[d])){var p=s[d],f=c[d],m=o._f(p);if(f instanceof so&&f.K_ instanceof co)u.push(p);else{var g=ko(f,m);null!=g&&(u.push(p),h.set(p,g))}}var y=new Nt(u);return new Ao(h.ze(),y,o.fieldTransforms)}function Ro(e,t,n,r){return void 0===r&&(r=!1),ko(n,e.wf(r?4:3,t))}function ko(e,t){if(Oo(e))return Po("Unsupported field value:",t,e),Co(e,t);if(e instanceof so)return function(e,t){if(!Eo(t.H_))throw t.Y_(e.G_+"() can only be used with update() and set()");if(!t.path)throw t.Y_(e.G_+"() is not currently supported inside arrays");var n=e.z_(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(t.path&&t.qe.push(t.path),e instanceof Array){if(t.settings.X_&&4!==t.H_)throw t.Y_("Nested arrays are not supported");return function(e,t){for(var n=[],r=0,i=0,a=e;i<a.length;i++){var o=ko(a[i],t.ff(r));null==o&&(o={nullValue:"NULL_VALUE"}),n.push(o),r++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===e)return{nullValue:"NULL_VALUE"};if("number"==typeof e)return Ye(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){var n=P.fromDate(e);return{timestampValue:Ke(t.serializer,n)}}if(e instanceof P){var r=new P(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:Ke(t.serializer,r)}}if(e instanceof yo)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof ro)return{bytesValue:Qe(t.serializer,e)};if(e instanceof bo){var i=t.s,a=e.sf;if(!a.isEqual(i))throw t.Y_("Document reference is for database "+a.projectId+"/"+a.database+" but should be for database "+i.projectId+"/"+i.database);return{referenceValue:tt(e.sf||t.s,e.if.path)}}if(void 0===e&&t.ignoreUndefinedProperties)return null;throw t.Y_("Unsupported field value: "+Za(e))}(e,t)}function Co(e,t){var n={};return R(e)?t.path&&t.path.length>0&&t.qe.push(t.path):T(e,(function(e,r){var i=ko(r,t.uf(e));null!=i&&(n[e]=i)})),{mapValue:{fields:n}}}function Oo(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof P||e instanceof yo||e instanceof ro||e instanceof bo||e instanceof so)}function Po(e,t,n){if(!Oo(n)||!Ja(n)){var r=Za(n);throw"an object"===r?t.Y_(e+" a custom object"):t.Y_(e+" "+r)}}function Io(e,t,n){if(t instanceof io)return t.j_;if("string"==typeof t)return No(e,t);throw Lo("Field path arguments must be of type string or FieldPath.",e,!1,void 0,n)}function No(e,t,n){try{return function(e){if(e.search(oo)>=0)throw new O(C.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not contain '~', '*', '/', '[', or ']'");try{return new(ao.bind.apply(ao,i.__spreadArrays([void 0],e.split("."))))}catch(t){throw new O(C.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'")}}(t).j_}catch(t){throw Lo((r=t)instanceof Error?r.message:r.toString(),e,!1,void 0,n)}var r}function Lo(e,t,n,r,i){var a=r&&!r._(),o=void 0!==i,s="Function "+t+"() called with invalid data";n&&(s+=" (via `toFirestore()`)");var c="";return(a||o)&&(c+=" (found",a&&(c+=" in field "+r),o&&(c+=" in document "+i),c+=")"),new O(C.INVALID_ARGUMENT,(s+=". ")+e+c)}function Do(e,t){return e.some((function(e){return e.isEqual(t)}))}
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */var Fo=function(){function e(e){this.qa=e,this.Tf=new Map,this.mutations=[],this.Ef=!1,this.mf=null,this.If=new Set}return e.prototype.Af=function(e){return i.__awaiter(this,void 0,void 0,(function(){var t,n=this;return i.__generator(this,(function(r){switch(r.label){case 0:if(this.Rf(),this.mutations.length>0)throw new O(C.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,a,o,s,c;return i.__generator(this,(function(i){switch(i.label){case 0:return n=v(e),r=st(n.serializer)+"/documents",a={documents:t.map((function(e){return rt(n.serializer,e)}))},[4,n.Sa("BatchGetDocuments",r,a)];case 1:return o=i.sent(),s=new Map,o.forEach((function(e){var t=function(e,t){return"found"in t?function(e,t){y(!!t.found),t.found.name,t.found.updateTime;var n=it(e,t.found.name),r=et(t.found.updateTime),i=new $t({mapValue:{fields:t.found.fields}});return new rn(n,r,i,{})}(e,t):"missing"in t?function(e,t){y(!!t.missing),y(!!t.readTime);var n=it(e,t.missing),r=et(t.readTime);return new an(n,r)}(e,t):g()}(n.serializer,e);s.set(t.key.toString(),t)})),c=[],[2,(t.forEach((function(e){var t=s.get(e.toString());y(!!t),c.push(t)})),c)]}}))}))}(this.qa,e)];case 1:return[2,((t=r.sent()).forEach((function(e){e instanceof an||e instanceof rn?n.Pf(e):g()})),t)]}}))}))},e.prototype.set=function(e,t){this.write(t.hf(e,this.Qe(e))),this.If.add(e.toString())},e.prototype.update=function(e,t){try{this.write(t.hf(e,this.gf(e)))}catch(e){this.mf=e}this.If.add(e.toString())},e.prototype.delete=function(e){this.write([new Kt(e,this.Qe(e))]),this.If.add(e.toString())},e.prototype.commit=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t=this;return i.__generator(this,(function(n){switch(n.label){case 0:if(this.Rf(),this.mf)throw this.mf;return e=this.Tf,this.mutations.forEach((function(t){e.delete(t.key.toString())})),e.forEach((function(e,n){var r=j.B(n);t.mutations.push(new Qt(r,t.Qe(r)))})),[4,function(e,t){return i.__awaiter(this,void 0,void 0,(function(){var n,r,a;return i.__generator(this,(function(i){switch(i.label){case 0:return n=v(e),r=st(n.serializer)+"/documents",a={writes:t.map((function(e){return ut(n.serializer,e)}))},[4,n.va("Commit",r,a)];case 1:return i.sent(),[2]}}))}))}(this.qa,this.mutations)];case 1:return n.sent(),this.Ef=!0,[2]}}))}))},e.prototype.Pf=function(e){var t;if(e instanceof rn)t=e.version;else{if(!(e instanceof an))throw g();t=I.min()}var n=this.Tf.get(e.key.toString());if(n){if(!t.isEqual(n))throw new O(C.ABORTED,"Document version changed between two reads.")}else this.Tf.set(e.key.toString(),t)},e.prototype.Qe=function(e){var t=this.Tf.get(e.toString());return!this.If.has(e.toString())&&t?Ft.updateTime(t):Ft.We()},e.prototype.gf=function(e){var t=this.Tf.get(e.toString());if(!this.If.has(e.toString())&&t){if(t.isEqual(I.min()))throw new O(C.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return Ft.updateTime(t)}return Ft.exists(!0)},e.prototype.write=function(e){this.Rf(),this.mutations=this.mutations.concat(e)},e.prototype.Rf=function(){},e}(),jo=function(){function e(e,t,n,r){this.ei=e,this.qa=t,this.updateFunction=n,this.ii=r,this.Vf=5,this.Ti=new Zn(this.ei,"transaction_retry")}return e.prototype.run=function(){this.yf()},e.prototype.yf=function(){var e=this;this.Ti.bs((function(){return i.__awaiter(e,void 0,void 0,(function(){var e,t,n=this;return i.__generator(this,(function(r){return e=new Fo(this.qa),(t=this.pf(e))&&t.then((function(t){n.ei.ai((function(){return e.commit().then((function(){n.ii.resolve(t)})).catch((function(e){n.bf(e)}))}))})).catch((function(e){n.bf(e)})),[2]}))}))}))},e.prototype.pf=function(e){try{var t=this.updateFunction(e);return!U(t)&&t.catch&&t.then?t:(this.ii.reject(Error("Transaction callback must return a Promise")),null)}catch(e){return this.ii.reject(e),null}},e.prototype.bf=function(e){var t=this;this.Vf>0&&this.vf(e)?(this.Vf-=1,this.ei.ai((function(){return t.yf(),Promise.resolve()}))):this.ii.reject(e)},e.prototype.vf=function(e){if("FirebaseError"===e.name){var t=e.code;return"aborted"===t||"failed-precondition"===t||!Q(t)}return!1},e}(),Uo=function(){function e(e,t){this.credentials=e,this.ei=t,this.clientId=w.t(),this.Sf=new Jn}return e.prototype.start=function(e,t,n,r){var i=this;this.Df(),this.w_=e;var a=new Jn,o=!1;return this.credentials.Bh((function(e){if(!o)return o=!0,d("FirestoreClient","Initializing. user=",e.uid),i.Cf(t,n,r,e,a).then(i.Sf.resolve,i.Sf.reject);i.ei.gi((function(){return i.Bu.vc(e)}))})),this.ei.ai((function(){return i.Sf.promise})),a.promise},e.prototype.enableNetwork=function(){var e=this;return this.Df(),this.ei.enqueue((function(){return e.persistence.Uo(!0),e.Bu.enableNetwork()}))},e.prototype.Cf=function(e,t,n,r,a){return i.__awaiter(this,void 0,void 0,(function(){var o,s,c=this;return i.__generator(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),o={ei:this.ei,w_:this.w_,clientId:this.clientId,credentials:this.credentials,N_:r,Qu:100,k_:n},[4,e.initialize(o)];case 1:return l.sent(),[4,t.initialize(e,o)];case 2:return l.sent(),this.persistence=e.persistence,this.Uu=e.Uu,this.La=e.La,this.S_=e.S_,this.qa=t.qa,this.Bu=t.Bu,this.fc=t.fc,this.Nf=t.q_,this.persistence.Bo((function(){return i.__awaiter(c,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return[4,this.terminate()];case 1:return e.sent(),[2]}}))}))})),a.resolve(),[3,4];case 3:if(s=l.sent(),a.reject(s),!this.Ff(s))throw s;return[2,(console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+s),this.Cf(new Oa,new Ia,{F_:!1},r,a))];case 4:return[2]}}))}))},e.prototype.Ff=function(e){return"FirebaseError"===e.name?e.code===C.FAILED_PRECONDITION||e.code===C.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&e instanceof DOMException)||22===e.code||20===e.code||11===e.code},e.prototype.Df=function(){if(this.ei.mi)throw new O(C.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.disableNetwork=function(){var e=this;return this.Df(),this.ei.enqueue((function(){return e.persistence.Uo(!1),e.Bu.disableNetwork()}))},e.prototype.terminate=function(){var e=this;this.ei.Pi();var t=new Jn;return this.ei.Ii((function(){return i.__awaiter(e,void 0,void 0,(function(){var e,n;return i.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),this.S_&&this.S_.stop(),[4,this.Bu.th()];case 1:return r.sent(),[4,this.Uu.th()];case 2:return r.sent(),[4,this.persistence.th()];case 3:return r.sent(),this.credentials.Uh(),t.resolve(),[3,5];case 4:return e=r.sent(),n=cr(e,"Failed to shutdown persistence"),t.reject(n),[3,5];case 5:return[2]}}))}))})),t.promise},e.prototype.waitForPendingWrites=function(){var e=this;this.Df();var t=new Jn;return this.ei.ai((function(){return e.fc._l(t)})),t.promise},e.prototype.listen=function(e,t,n){var r=this;this.Df();var i=new La(n),a=new ga(e,i,t);return this.ei.ai((function(){return r.Nf.listen(a)})),function(){i.Q_(),r.ei.ai((function(){return r.Nf.lc(a)}))}},e.prototype.kf=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.Df(),[4,this.Sf.promise];case 1:return[2,(t.sent(),function(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var r,a=this;return i.__generator(this,(function(o){switch(o.label){case 0:return r=new Jn,[4,e.enqueue((function(){return i.__awaiter(a,void 0,void 0,(function(){var e,a,o;return i.__generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,function(e,t){var n=v(e);return n.persistence.runTransaction("read document","readonly",(function(e){return n.Rh.Hn(e,t)}))}(t,n)];case 1:return(e=i.sent())instanceof rn?r.resolve(e):e instanceof an?r.resolve(null):r.reject(new O(C.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)")),[3,3];case 2:return a=i.sent(),o=cr(a,"Failed to get document '"+n+" from cache"),r.reject(o),[3,3];case 3:return[2]}}))}))}))];case 1:return[2,(o.sent(),r.promise)]}}))}))}(this.ei,this.La,e))]}}))}))},e.prototype.$f=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){switch(n.label){case 0:return this.Df(),[4,this.Sf.promise];case 1:return[2,(n.sent(),function(e,t,n,r){var i=new Jn,a=Bo(e,t,un(n.path),{includeMetadataChanges:!0,$l:!0},{next:function(e){a();var t=e.docs.has(n);!t&&e.fromCache?i.reject(new O(C.UNAVAILABLE,"Failed to get document because the client is offline.")):t&&e.fromCache&&r&&"server"===r.source?i.reject(new O(C.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):i.resolve(e)},error:function(e){return i.reject(e)}});return i.promise}(this.ei,this.Nf,e,t))]}}))}))},e.prototype.xf=function(e){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return this.Df(),[4,this.Sf.promise];case 1:return[2,(t.sent(),function(e,t,n){return i.__awaiter(this,void 0,void 0,(function(){var r,a=this;return i.__generator(this,(function(o){switch(o.label){case 0:return r=new Jn,[4,e.enqueue((function(){return i.__awaiter(a,void 0,void 0,(function(){var e,a,o,s,c,l;return i.__generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,Ti(t,n,!0)];case 1:return e=i.sent(),a=new na(n,e.gh),o=a.Su(e.documents),s=a.Un(o,!1),r.resolve(s.snapshot),[3,3];case 2:return c=i.sent(),l=cr(c,"Failed to execute query '"+n+" against cache"),r.reject(l),[3,3];case 3:return[2]}}))}))}))];case 1:return[2,(o.sent(),r.promise)]}}))}))}(this.ei,this.La,e))]}}))}))},e.prototype.Of=function(e,t){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){switch(n.label){case 0:return this.Df(),[4,this.Sf.promise];case 1:return[2,(n.sent(),function(e,t,n,r){var i=new Jn,a=Bo(e,t,n,{includeMetadataChanges:!0,$l:!0},{next:function(e){a(),e.fromCache&&r&&"server"===r.source?i.reject(new O(C.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):i.resolve(e)},error:function(e){return i.reject(e)}});return i.promise}(this.ei,this.Nf,e,t))]}}))}))},e.prototype.write=function(e){var t=this;this.Df();var n=new Jn;return this.ei.ai((function(){return t.fc.write(e,n)})),n.promise},e.prototype.s=function(){return this.w_.s},e.prototype.bl=function(e){var t=this;this.Df();var n=new La(e);return this.ei.ai((function(){return i.__awaiter(t,void 0,void 0,(function(){return i.__generator(this,(function(e){return[2,this.Nf.bl(n)]}))}))})),function(){n.Q_(),t.ei.ai((function(){return i.__awaiter(t,void 0,void 0,(function(){return i.__generator(this,(function(e){return[2,this.Nf.vl(n)]}))}))}))}},Object.defineProperty(e.prototype,"Mf",{get:function(){return this.ei.mi},enumerable:!1,configurable:!0}),e.prototype.transaction=function(e){var t=this;this.Df();var n=new Jn;return this.ei.ai((function(){return new jo(t.ei,t.qa,e,n).run(),Promise.resolve()})),n.promise},e}();
+/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function Bo(e,t,n,r,i){var a=new La(i),o=new ga(n,a,r);return e.ai((function(){return t.listen(o)})),function(){a.Q_(),e.ai((function(){return t.lc(o)}))}}var Vo=function(){function e(e,t,n,r){this.s=e,this.timestampsInSnapshots=t,this.Lf=n,this.qf=r}return e.prototype.Bf=function(e){switch(Ce(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Fe(e.integerValue||e.doubleValue);case 3:return this.Uf(e.timestampValue);case 4:return this.Qf(e);case 5:return e.stringValue;case 6:return new ro(je(e.bytesValue));case 7:return this.Wf(e.referenceValue);case 8:return this.jf(e.geoPointValue);case 9:return this.Kf(e.arrayValue);case 10:return this.Gf(e.mapValue);default:throw g()}},e.prototype.Gf=function(e){var t=this,n={};return T(e.fields||{},(function(e,r){n[e]=t.Bf(r)})),n},e.prototype.jf=function(e){return new yo(Fe(e.latitude),Fe(e.longitude))},e.prototype.Kf=function(e){var t=this;return(e.values||[]).map((function(e){return t.Bf(e)}))},e.prototype.Qf=function(e){switch(this.Lf){case"previous":var t=function e(t){var n=t.mapValue.fields.__previous_value__;return Te(n)?e(n):n}(e);return null==t?null:this.Bf(t);case"estimate":return this.Uf(Re(e));default:return null}},e.prototype.Uf=function(e){var t=De(e),n=new P(t.seconds,t.nanos);return this.timestampsInSnapshots?n:n.toDate()},e.prototype.Wf=function(e){var t=L.k(e);y(At(t));var n=new S(t.get(1),t.get(3)),r=new j(t.V(5));return n.isEqual(this.s)||p("Document "+r+" contains a document reference within a different database ("+n.projectId+"/"+n.database+") which is not supported. It will be treated as a reference in the current database ("+this.s.projectId+"/"+this.s.database+") instead."),this.qf(r)},e}(),zo=dr.ji,Ho=function(){function e(e){var t,n,r,i;if(void 0===e.host){if(void 0!==e.ssl)throw new O(C.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else za("settings","non-empty string","host",e.host),this.host=e.host,Ha("settings","boolean","ssl",e.ssl),this.ssl=null===(t=e.ssl)||void 0===t||t;if(Ya("settings",e,["host","ssl","credentials","timestampsInSnapshots","cacheSizeBytes","experimentalForceLongPolling","ignoreUndefinedProperties"]),Ha("settings","object","credentials",e.credentials),this.credentials=e.credentials,Ha("settings","boolean","timestampsInSnapshots",e.timestampsInSnapshots),Ha("settings","boolean","ignoreUndefinedProperties",e.ignoreUndefinedProperties),!0===e.timestampsInSnapshots?p("The setting 'timestampsInSnapshots: true' is no longer required and should be removed."):!1===e.timestampsInSnapshots&&p("Support for 'timestampsInSnapshots: false' will be removed soon. You must update your code to handle Timestamp objects."),this.timestampsInSnapshots=null===(n=e.timestampsInSnapshots)||void 0===n||n,this.ignoreUndefinedProperties=null!==(r=e.ignoreUndefinedProperties)&&void 0!==r&&r,Ha("settings","number","cacheSizeBytes",e.cacheSizeBytes),void 0===e.cacheSizeBytes)this.cacheSizeBytes=dr.Gi;else{if(e.cacheSizeBytes!==zo&&e.cacheSizeBytes<dr.Ki)throw new O(C.INVALID_ARGUMENT,"cacheSizeBytes must be at least "+dr.Ki);this.cacheSizeBytes=e.cacheSizeBytes}Ha("settings","boolean","experimentalForceLongPolling",e.experimentalForceLongPolling),this.forceLongPolling=null!==(i=e.experimentalForceLongPolling)&&void 0!==i&&i}return e.prototype.isEqual=function(e){return this.host===e.host&&this.ssl===e.ssl&&this.timestampsInSnapshots===e.timestampsInSnapshots&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.forceLongPolling===e.forceLongPolling&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties},e}(),Go=function(){function e(t,n,r,a){var o=this;if(void 0===r&&(r=new Oa),void 0===a&&(a=new Ia),this.zf=r,this.Hf=a,this.Yf=null,this.Jf=new sr,this.INTERNAL={delete:function(){return i.__awaiter(o,void 0,void 0,(function(){return i.__generator(this,(function(e){switch(e.label){case 0:return this.Xf(),[4,this.Zf.terminate()];case 1:return e.sent(),[2]}}))}))}},"object"==typeof t.options){var s=t;this.Yf=s,this.sf=e.td(s),this.ed=s.name,this.nd=new Li(n)}else{var c=t;if(!c.projectId)throw new O(C.INVALID_ARGUMENT,"Must provide projectId");this.sf=new S(c.projectId,c.database),this.ed="[DEFAULT]",this.nd=new Ni}this.sd=new Ho({})}return Object.defineProperty(e.prototype,"rd",{get:function(){return this.od||(this.od=new _o(this.sf,this.sd.ignoreUndefinedProperties)),this.od},enumerable:!1,configurable:!0}),e.prototype.settings=function(e){Fa("Firestore.settings",arguments,1),Ba("Firestore.settings","object",1,e);var t=new Ho(e);if(this.Zf&&!this.sd.isEqual(t))throw new O(C.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only call settings() before calling any other methods on a Firestore object.");this.sd=t,void 0!==t.credentials&&(this.nd=function(e){if(!e)return new Ni;switch(e.type){case"gapi":var t=e.hd;return y(!("object"!=typeof t||null===t||!t.auth||!t.auth.getAuthHeaderValueForFirstParty)),new Fi(t,e.zh||"0");case"provider":return e.hd;default:throw new O(C.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(t.credentials))},e.prototype.enableNetwork=function(){return this.Xf(),this.Zf.enableNetwork()},e.prototype.disableNetwork=function(){return this.Xf(),this.Zf.disableNetwork()},e.prototype.enablePersistence=function(e){var t,n;if(this.Zf)throw new O(C.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.");var r=!1,i=!1;if(e&&(void 0!==e.experimentalTabSynchronization&&p("The 'experimentalTabSynchronization' setting will be removed. Use 'synchronizeTabs' instead."),r=null!==(n=null!==(t=e.synchronizeTabs)&&void 0!==t?t:e.experimentalTabSynchronization)&&void 0!==n&&n,i=!!e.experimentalForceOwningTab&&e.experimentalForceOwningTab,r&&i))throw new O(C.INVALID_ARGUMENT,"The 'experimentalForceOwningTab' setting cannot be used with 'synchronizeTabs'.");return this.ad(this.zf,this.Hf,{F_:!0,cacheSizeBytes:this.sd.cacheSizeBytes,synchronizeTabs:r,Vo:i})},e.prototype.clearPersistence=function(){return i.__awaiter(this,void 0,void 0,(function(){var e,t=this;return i.__generator(this,(function(n){if(void 0!==this.Zf&&!this.Zf.Mf)throw new O(C.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");return e=new Jn,[2,(this.Jf.Ii((function(){return i.__awaiter(t,void 0,void 0,(function(){var t;return i.__generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.zf.clearPersistence(this.sf,this.ed)];case 1:return n.sent(),e.resolve(),[3,3];case 2:return t=n.sent(),e.reject(t),[3,3];case 3:return[2]}}))}))})),e.promise)]}))}))},e.prototype.terminate=function(){return this.app._removeServiceInstance("firestore"),this.INTERNAL.delete()},Object.defineProperty(e.prototype,"ud",{get:function(){return this.Xf(),this.Zf.Mf},enumerable:!1,configurable:!0}),e.prototype.waitForPendingWrites=function(){return this.Xf(),this.Zf.waitForPendingWrites()},e.prototype.onSnapshotsInSync=function(e){if(this.Xf(),Na(e))return this.Zf.bl(e);Ba("Firestore.onSnapshotsInSync","function",1,e);var t={next:e};return this.Zf.bl(t)},e.prototype.Xf=function(){return this.Zf||this.ad(new Oa,new Ia,{F_:!1}),this.Zf},e.prototype.ld=function(){return new _(this.sf,this.ed,this.sd.host,this.sd.ssl,this.sd.forceLongPolling)},e.prototype.ad=function(e,t,n){var r=this.ld();return this.Zf=new Uo(this.nd,this.Jf),this.Zf.start(r,e,t,n)},e.td=function(e){if(t=e.options,!Object.prototype.hasOwnProperty.call(t,"projectId"))throw new O(C.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');var t,n=e.options.projectId;
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */if(!n||"string"!=typeof n)throw new O(C.INVALID_ARGUMENT,"projectId must be a string in FirebaseApp.options");return new S(n)},Object.defineProperty(e.prototype,"app",{get:function(){if(!this.Yf)throw new O(C.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.Yf},enumerable:!1,configurable:!0}),e.prototype.collection=function(e){return Fa("Firestore.collection",arguments,1),Ba("Firestore.collection","non-empty string",1,e),this.Xf(),new as(L.k(e),this,null)},e.prototype.doc=function(e){return Fa("Firestore.doc",arguments,1),Ba("Firestore.doc","non-empty string",1,e),this.Xf(),Jo._d(L.k(e),this,null)},e.prototype.collectionGroup=function(e){if(Fa("Firestore.collectionGroup",arguments,1),Ba("Firestore.collectionGroup","non-empty string",1,e),e.indexOf("/")>=0)throw new O(C.INVALID_ARGUMENT,"Invalid collection ID '"+e+"' passed to function Firestore.collectionGroup(). Collection IDs must not contain '/'.");return this.Xf(),new rs(function(e){return new cn(L.$(),e)}(e),this,null)},e.prototype.runTransaction=function(e){var t=this;return Fa("Firestore.runTransaction",arguments,1),Ba("Firestore.runTransaction","function",1,e),this.Xf().transaction((function(n){return e(new qo(t,n))}))},e.prototype.batch=function(){return this.Xf(),new Wo(this)},Object.defineProperty(e,"logLevel",{get:function(){switch(h()){case o.LogLevel.DEBUG:return"debug";case o.LogLevel.ERROR:return"error";case o.LogLevel.SILENT:return"silent";case o.LogLevel.WARN:return"warn";case o.LogLevel.INFO:return"info";case o.LogLevel.VERBOSE:return"verbose";default:return"error"}},enumerable:!1,configurable:!0}),e.setLogLevel=function(e){var t;Fa("Firestore.setLogLevel",arguments,1),qa("setLogLevel",["debug","error","silent","warn","info","verbose"],1,e),t=e,u.setLogLevel(t)},e.prototype.fd=function(){return this.sd.timestampsInSnapshots},e}(),qo=function(){function e(e,t){this.dd=e,this.wd=t}return e.prototype.get=function(e){var t=this;Fa("Transaction.get",arguments,1);var n=ls("Transaction.get",e,this.dd);return this.wd.Af([n.if]).then((function(e){if(!e||1!==e.length)return g();var r=e[0];if(r instanceof an)return new Xo(t.dd,n.if,null,!1,!1,n.rf);if(r instanceof rn)return new Xo(t.dd,n.if,r,!1,!1,n.rf);throw g()}))},e.prototype.set=function(e,t,n){Ua("Transaction.set",arguments,2,3);var r=ls("Transaction.set",e,this.dd);n=os("Transaction.set",n);var i=hs(r.rf,t,n),a=So(this.dd.rd,"Transaction.set",r.if,i,null!==r.rf,n);return this.wd.set(r.if,a),this},e.prototype.update=function(e,t,n){for(var r,i,a=[],o=3;o<arguments.length;o++)a[o-3]=arguments[o];return"string"==typeof t||t instanceof ao?(ja("Transaction.update",arguments,3),r=ls("Transaction.update",e,this.dd),i=To(this.dd.rd,"Transaction.update",r.if,t,n,a)):(Fa("Transaction.update",arguments,2),r=ls("Transaction.update",e,this.dd),i=Mo(this.dd.rd,"Transaction.update",r.if,t)),this.wd.update(r.if,i),this},e.prototype.delete=function(e){Fa("Transaction.delete",arguments,1);var t=ls("Transaction.delete",e,this.dd);return this.wd.delete(t.if),this},e}(),Wo=function(){function e(e){this.dd=e,this.Td=[],this.Ed=!1}return e.prototype.set=function(e,t,n){Ua("WriteBatch.set",arguments,2,3),this.md();var r=ls("WriteBatch.set",e,this.dd);n=os("WriteBatch.set",n);var i=hs(r.rf,t,n),a=So(this.dd.rd,"WriteBatch.set",r.if,i,null!==r.rf,n);return this.Td=this.Td.concat(a.hf(r.if,Ft.We())),this},e.prototype.update=function(e,t,n){for(var r,i,a=[],o=3;o<arguments.length;o++)a[o-3]=arguments[o];return this.md(),"string"==typeof t||t instanceof ao?(ja("WriteBatch.update",arguments,3),r=ls("WriteBatch.update",e,this.dd),i=To(this.dd.rd,"WriteBatch.update",r.if,t,n,a)):(Fa("WriteBatch.update",arguments,2),r=ls("WriteBatch.update",e,this.dd),i=Mo(this.dd.rd,"WriteBatch.update",r.if,t)),this.Td=this.Td.concat(i.hf(r.if,Ft.exists(!0))),this},e.prototype.delete=function(e){Fa("WriteBatch.delete",arguments,1),this.md();var t=ls("WriteBatch.delete",e,this.dd);return this.Td=this.Td.concat(new Kt(t.if,Ft.We())),this},e.prototype.commit=function(){return this.md(),this.Ed=!0,this.Td.length>0?this.dd.Xf().write(this.Td):Promise.resolve()},e.prototype.md=function(){if(this.Ed)throw new O(C.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},e}(),Jo=function(e){function t(t,n,r){var i=this;return(i=e.call(this,n.sf,t,r)||this).if=t,i.firestore=n,i.rf=r,i.Zf=i.firestore.Xf(),i}return i.__extends(t,e),t._d=function(e,n,r){if(e.length%2!=0)throw new O(C.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+e.F()+" has "+e.length);return new t(new j(e),n,r)},Object.defineProperty(t.prototype,"id",{get:function(){return this.if.path.S()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new as(this.if.path.p(),this.firestore,this.rf)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this.if.path.F()},enumerable:!1,configurable:!0}),t.prototype.collection=function(e){if(Fa("DocumentReference.collection",arguments,1),Ba("DocumentReference.collection","non-empty string",1,e),!e)throw new O(C.INVALID_ARGUMENT,"Must provide a non-empty collection name to collection()");var t=L.k(e);return new as(this.if.path.child(t),this.firestore,null)},t.prototype.isEqual=function(e){if(!(e instanceof t))throw Ka("isEqual","DocumentReference",1,e);return this.firestore===e.firestore&&this.if.isEqual(e.if)&&this.rf===e.rf},t.prototype.set=function(e,t){Ua("DocumentReference.set",arguments,1,2),t=os("DocumentReference.set",t);var n=hs(this.rf,e,t),r=So(this.firestore.rd,"DocumentReference.set",this.if,n,null!==this.rf,t);return this.Zf.write(r.hf(this.if,Ft.We()))},t.prototype.update=function(e,t){for(var n,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return"string"==typeof e||e instanceof ao?(ja("DocumentReference.update",arguments,2),n=To(this.firestore.rd,"DocumentReference.update",this.if,e,t,r)):(Fa("DocumentReference.update",arguments,1),n=Mo(this.firestore.rd,"DocumentReference.update",this.if,e)),this.Zf.write(n.hf(this.if,Ft.exists(!0)))},t.prototype.delete=function(){return Fa("DocumentReference.delete",arguments,0),this.Zf.write([new Kt(this.if,Ft.We())])},t.prototype.onSnapshot=function(){for(var e,t,n,r=this,i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];Ua("DocumentReference.onSnapshot",arguments,1,4);var o={includeMetadataChanges:!1},s=0;"object"!=typeof i[s]||Na(i[s])||(Ya("DocumentReference.onSnapshot",o=i[s],["includeMetadataChanges"]),Ha("DocumentReference.onSnapshot","boolean","includeMetadataChanges",o.includeMetadataChanges),s++);var c={includeMetadataChanges:o.includeMetadataChanges};if(Na(i[s])){var l=i[s];i[s]=null===(e=l.next)||void 0===e?void 0:e.bind(l),i[s+1]=null===(t=l.error)||void 0===t?void 0:t.bind(l),i[s+2]=null===(n=l.complete)||void 0===n?void 0:n.bind(l)}else Ba("DocumentReference.onSnapshot","function",s,i[s]),Va("DocumentReference.onSnapshot","function",s+1,i[s+1]),Va("DocumentReference.onSnapshot","function",s+2,i[s+2]);var u={next:function(e){i[s]&&i[s](r.Id(e))},error:i[s+1],complete:i[s+2]};return this.Zf.listen(un(this.if.path),c,u)},t.prototype.get=function(e){var t=this;Ua("DocumentReference.get",arguments,0,1),cs("DocumentReference.get",e);var n=this.firestore.Xf();return e&&"cache"===e.source?n.kf(this.if).then((function(e){return new Xo(t.firestore,t.if,e,!0,e instanceof rn&&e.Ge,t.rf)})):n.$f(this.if,e).then((function(e){return t.Id(e)}))},t.prototype.withConverter=function(e){return new t(this.if,this.firestore,e)},t.prototype.Id=function(e){var t=e.docs.get(this.if);return new Xo(this.firestore,this.if,t,e.fromCache,e.hasPendingWrites,this.rf)},t}(bo),Zo=function(){function e(e,t){this.hasPendingWrites=e,this.fromCache=t}return e.prototype.isEqual=function(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache},e}(),Xo=function(){function e(e,t,n,r,i,a){this.dd=e,this.if=t,this.Ad=n,this.Rd=r,this.Pd=i,this.rf=a}return e.prototype.data=function(e){var t=this;if(Ua("DocumentSnapshot.data",arguments,0,1),e=ss("DocumentSnapshot.data",e),this.Ad){if(this.rf){var n=new Yo(this.dd,this.if,this.Ad,this.Rd,this.Pd,null);return this.rf.fromFirestore(n,e)}return new Vo(this.dd.sf,this.dd.fd(),e.serverTimestamps||"none",(function(e){return new Jo(e,t.dd,null)})).Bf(this.Ad.tn())}},e.prototype.get=function(e,t){var n=this;if(Ua("DocumentSnapshot.get",arguments,1,2),t=ss("DocumentSnapshot.get",t),this.Ad){var r=this.Ad.data().field(Io("DocumentSnapshot.get",e,this.if));if(null!==r)return new Vo(this.dd.sf,this.dd.fd(),t.serverTimestamps||"none",(function(e){return new Jo(e,n.dd,n.rf)})).Bf(r)}},Object.defineProperty(e.prototype,"id",{get:function(){return this.if.path.S()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ref",{get:function(){return new Jo(this.if,this.dd,this.rf)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"exists",{get:function(){return null!==this.Ad},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return new Zo(this.Pd,this.Rd)},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){if(!(t instanceof e))throw Ka("isEqual","DocumentSnapshot",1,t);return this.dd===t.dd&&this.Rd===t.Rd&&this.if.isEqual(t.if)&&(null===this.Ad?null===t.Ad:this.Ad.isEqual(t.Ad))&&this.rf===t.rf},e}(),Yo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.data=function(t){return e.prototype.data.call(this,t)},t}(Xo);
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function Ko(e,t,n,r,i,a,o){var s;if(i.M()){if("array-contains"===a||"array-contains-any"===a)throw new O(C.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+a+"' queries on FieldPath.documentId().");if("in"===a||"not-in"===a){es(o,a);for(var c=[],l=0,u=o;l<u.length;l++){var h=u[l];c.push($o(r,e,h))}s={arrayValue:{values:c}}}else s=$o(r,e,o)}else"in"!==a&&"not-in"!==a&&"array-contains-any"!==a||es(o,a),s=Ro(n,t,o,"in"===a||"not-in"===a);var d=En.create(i,a,s);return function(e,t){if(t._n()){var n=e.ln();if(null!==n&&!n.isEqual(t.field))throw new O(C.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '"+n.toString()+"' and '"+t.field.toString()+"'");var r=e.un();null!==r&&ts(e,t.field,r)}var i=e.fn(function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==i)throw i===t.op?new O(C.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+t.op.toString()+"' filter."):new O(C.INVALID_ARGUMENT,"Invalid query. You cannot use '"+t.op.toString()+"' filters with '"+i.toString()+"' filters.")}(e,d),d}function Qo(e,t,n){if(null!==e.startAt)throw new O(C.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new O(C.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var r=new Ln(t,n);return function(e,t){if(null===e.un()){var n=e.ln();null!==n&&ts(e,n,t.field)}}(e,r),r}function $o(e,t,n){if("string"==typeof n){if(""===n)throw new O(C.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!hn(t)&&-1!==n.indexOf("/"))throw new O(C.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+n+"' contains a '/' character.");var r=t.path.child(L.k(n));if(!j.j(r))throw new O(C.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+r+"' is not because it has an odd number of segments ("+r.length+").");return Ue(e,new j(r))}if(n instanceof bo)return Ue(e,n.if);throw new O(C.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+Za(n)+".")}function es(e,t){if(!Array.isArray(e)||0===e.length)throw new O(C.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+t.toString()+"' filters.");if(e.length>10)throw new O(C.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters support a maximum of 10 elements in the value array.");if("in"===t||"array-contains-any"===t){if(e.indexOf(null)>=0)throw new O(C.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters cannot contain 'null' in the value array.");if(e.filter((function(e){return Number.isNaN(e)})).length>0)throw new O(C.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters cannot contain 'NaN' in the value array.")}}function ts(e,t,n){if(!n.isEqual(t))throw new O(C.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+t.toString()+"' and so you must also use '"+t.toString()+"' as your first orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}function ns(e){if(e.cn()&&0===e.en.length)throw new O(C.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var rs=function(){function e(e,t,n){this.gd=e,this.firestore=t,this.rf=n}return e.prototype.where=function(t,n,r){var i;Fa("Query.where",arguments,3),Xa("Query.where",3,r),i="not-in"===n||"!="===n?n:qa("Query.where",["<","<=","==",">=",">","array-contains","in","array-contains-any"],2,n);var a=Io("Query.where",t),o=Ko(this.gd,"Query.where",this.firestore.rd,this.firestore.sf,a,i,r);return new e(function(e,t){var n=e.filters.concat([t]);return new cn(e.path,e.collectionGroup,e.en.slice(),n,e.limit,e.nn,e.startAt,e.endAt)}(this.gd,o),this.firestore,this.rf)},e.prototype.orderBy=function(t,n){var r;if(Ua("Query.orderBy",arguments,1,2),Va("Query.orderBy","non-empty string",2,n),void 0===n||"asc"===n)r="asc";else{if("desc"!==n)throw new O(C.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+n+"', expected 'asc' or 'desc'.");r="desc"}var i=Io("Query.orderBy",t),a=Qo(this.gd,i,r);return new e(function(e,t){var n=e.en.concat([t]);return new cn(e.path,e.collectionGroup,n,e.filters.slice(),e.limit,e.nn,e.startAt,e.endAt)}(this.gd,a),this.firestore,this.rf)},e.prototype.limit=function(t){return Fa("Query.limit",arguments,1),Ba("Query.limit","number",1,t),Qa("Query.limit",1,t),new e(fn(this.gd,t,"F"),this.firestore,this.rf)},e.prototype.limitToLast=function(t){return Fa("Query.limitToLast",arguments,1),Ba("Query.limitToLast","number",1,t),Qa("Query.limitToLast",1,t),new e(fn(this.gd,t,"L"),this.firestore,this.rf)},e.prototype.startAt=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ja("Query.startAt",arguments,1);var i=this.Vd("Query.startAt",t,n,!0);return new e(mn(this.gd,i),this.firestore,this.rf)},e.prototype.startAfter=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ja("Query.startAfter",arguments,1);var i=this.Vd("Query.startAfter",t,n,!1);return new e(mn(this.gd,i),this.firestore,this.rf)},e.prototype.endBefore=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ja("Query.endBefore",arguments,1);var i=this.Vd("Query.endBefore",t,n,!0);return new e(gn(this.gd,i),this.firestore,this.rf)},e.prototype.endAt=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ja("Query.endAt",arguments,1);var i=this.Vd("Query.endAt",t,n,!1);return new e(gn(this.gd,i),this.firestore,this.rf)},e.prototype.isEqual=function(t){if(!(t instanceof e))throw Ka("isEqual","Query",1,t);return this.firestore===t.firestore&&yn(this.gd,t.gd)&&this.rf===t.rf},e.prototype.withConverter=function(t){return new e(this.gd,this.firestore,t)},e.prototype.Vd=function(e,t,n,r){if(Xa(e,1,t),t instanceof Xo)return Fa(e,i.__spreadArrays([t],n),1),function(e,t,n,r,i){if(!r)throw new O(C.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+n+"().");for(var a=[],o=0,s=dn(e);o<s.length;o++){var c=s[o];if(c.field.M())a.push(Ue(t,r.key));else{var l=r.field(c.field);if(Te(l))throw new O(C.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+c.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===l){var u=c.field.F();throw new O(C.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+u+"' (used as the orderBy) does not exist.")}a.push(l)}}return new On(a,i)}(this.gd,this.firestore.sf,e,t.Ad,r);var a=[t].concat(n);return function(e,t,n,r,i,a){var o=e.en;if(i.length>o.length)throw new O(C.INVALID_ARGUMENT,"Too many arguments provided to "+r+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var s=[],c=0;c<i.length;c++){var l=i[c];if(o[c].field.M()){if("string"!=typeof l)throw new O(C.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+r+"(), but got a "+typeof l);if(!hn(e)&&-1!==l.indexOf("/"))throw new O(C.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to "+r+"() must be a plain document ID, but '"+l+"' contains a slash.");var u=e.path.child(L.k(l));if(!j.j(u))throw new O(C.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to "+r+"() must result in a valid document path, but '"+u+"' is not because it contains an odd number of segments.");var h=new j(u);s.push(Ue(t,h))}else{var d=Ro(n,r,l);s.push(d)}}return new On(s,a)}(this.gd,this.firestore.sf,this.firestore.rd,e,a,r)},e.prototype.onSnapshot=function(){for(var e,t,n,r=this,i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];Ua("Query.onSnapshot",arguments,1,4);var o={},s=0;if("object"!=typeof i[s]||Na(i[s])||(Ya("Query.onSnapshot",o=i[s],["includeMetadataChanges"]),Ha("Query.onSnapshot","boolean","includeMetadataChanges",o.includeMetadataChanges),s++),Na(i[s])){var c=i[s];i[s]=null===(e=c.next)||void 0===e?void 0:e.bind(c),i[s+1]=null===(t=c.error)||void 0===t?void 0:t.bind(c),i[s+2]=null===(n=c.complete)||void 0===n?void 0:n.bind(c)}else Ba("Query.onSnapshot","function",s,i[s]),Va("Query.onSnapshot","function",s+1,i[s+1]),Va("Query.onSnapshot","function",s+2,i[s+2]);var l={next:function(e){i[s]&&i[s](new is(r.firestore,r.gd,e,r.rf))},error:i[s+1],complete:i[s+2]};return ns(this.gd),this.firestore.Xf().listen(this.gd,o,l)},e.prototype.get=function(e){var t=this;Ua("Query.get",arguments,0,1),cs("Query.get",e),ns(this.gd);var n=this.firestore.Xf();return(e&&"cache"===e.source?n.xf(this.gd):n.Of(this.gd,e)).then((function(e){return new is(t.firestore,t.gd,e,t.rf)}))},e}(),is=function(){function e(e,t,n,r){this.dd=e,this.yd=t,this.pd=n,this.rf=r,this.bd=null,this.vd=null,this.metadata=new Zo(n.hasPendingWrites,n.fromCache)}return Object.defineProperty(e.prototype,"docs",{get:function(){var e=[];return this.forEach((function(t){return e.push(t)})),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return this.pd.docs._()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.pd.docs.size},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e,t){var n=this;Ua("QuerySnapshot.forEach",arguments,1,2),Ba("QuerySnapshot.forEach","function",1,e),this.pd.docs.forEach((function(r){e.call(t,n.Sd(r,n.metadata.fromCache,n.pd.qt.has(r.key)))}))},Object.defineProperty(e.prototype,"query",{get:function(){return new rs(this.yd,this.dd,this.rf)},enumerable:!1,configurable:!0}),e.prototype.docChanges=function(e){e&&(Ya("QuerySnapshot.docChanges",e,["includeMetadataChanges"]),Ha("QuerySnapshot.docChanges","boolean","includeMetadataChanges",e.includeMetadataChanges));var t=!(!e||!e.includeMetadataChanges);if(t&&this.pd.Ut)throw new O(C.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this.bd&&this.vd===t||(this.bd=function(e,t,n){if(e.Lt._()){var r=0;return e.docChanges.map((function(t){var i=n(t.doc,e.fromCache,e.qt.has(t.doc.key));return t.doc,{type:"added",doc:i,oldIndex:-1,newIndex:r++}}))}var i=e.Lt;return e.docChanges.filter((function(e){return t||3!==e.type})).map((function(t){var r=n(t.doc,e.fromCache,e.qt.has(t.doc.key)),a=-1,o=-1;return 0!==t.type&&(a=i.indexOf(t.doc.key),i=i.delete(t.doc.key)),1!==t.type&&(o=(i=i.add(t.doc)).indexOf(t.doc.key)),{type:us(t.type),doc:r,oldIndex:a,newIndex:o}}))}(this.pd,t,this.Sd.bind(this)),this.vd=t),this.bd},e.prototype.isEqual=function(t){if(!(t instanceof e))throw Ka("isEqual","QuerySnapshot",1,t);return this.dd===t.dd&&yn(this.yd,t.yd)&&this.pd.isEqual(t.pd)&&this.rf===t.rf},e.prototype.Sd=function(e,t,n){return new Yo(this.dd,e.key,e,t,n,this.rf)},e}(),as=function(e){function t(t,n,r){var i=this;if((i=e.call(this,un(t),n,r)||this).Dd=t,t.length%2!=1)throw new O(C.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+t.F()+" has "+t.length);return i}return i.__extends(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this.gd.path.S()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this.gd.path.p();return e._()?null:new Jo(new j(e),this.firestore,null)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this.gd.path.F()},enumerable:!1,configurable:!0}),t.prototype.doc=function(e){Ua("CollectionReference.doc",arguments,0,1),0===arguments.length&&(e=w.t()),Ba("CollectionReference.doc","non-empty string",1,e);var t=L.k(e);return Jo._d(this.gd.path.child(t),this.firestore,this.rf)},t.prototype.add=function(e){Fa("CollectionReference.add",arguments,1),Ba("CollectionReference.add","object",1,this.rf?this.rf.toFirestore(e):e);var t=this.doc();return t.set(e).then((function(){return t}))},t.prototype.withConverter=function(e){return new t(this.Dd,this.firestore,e)},t}(rs);function os(e,t){if(void 0===t)return{merge:!1};if(Ya(e,t,["merge","mergeFields"]),Ha(e,"boolean","merge",t.merge),function(e,t,n,r,i){void 0!==r&&function(e,t,n,r,i){if(!(r instanceof Array))throw new O(C.INVALID_ARGUMENT,"Function "+e+"() requires its "+t+" option to be an array, but it was: "+Za(r));for(var a=0;a<r.length;++a)if(!i(r[a]))throw new O(C.INVALID_ARGUMENT,"Function "+e+"() requires all "+t+" elements to be a string or a FieldPath, but the value at index "+a+" was: "+Za(r[a]))}(e,"mergeFields",0,r,(function(e){return"string"==typeof e||e instanceof ao}))}(e,0,0,t.mergeFields),void 0!==t.mergeFields&&void 0!==t.merge)throw new O(C.INVALID_ARGUMENT,"Invalid options passed to function "+e+'(): You cannot specify both "merge" and "mergeFields".');return t}function ss(e,t){return void 0===t?{}:(Ya(e,t,["serverTimestamps"]),Ga(e,0,"serverTimestamps",t.serverTimestamps,["estimate","previous","none"]),t)}function cs(e,t){Va(e,"object",1,t),t&&(Ya(e,t,["source"]),Ga(e,0,"source",t.source,["default","server","cache"]))}function ls(e,t,n){if(t instanceof bo){if(t.firestore!==n)throw new O(C.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}throw Ka(e,"DocumentReference",1,t)}function us(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return g()}}function hs(e,t,n){return e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t}var ds={Firestore:Go,GeoPoint:yo,Timestamp:P,Blob:ro,Transaction:qo,WriteBatch:Wo,DocumentReference:Jo,DocumentSnapshot:Xo,Query:rs,QueryDocumentSnapshot:Yo,QuerySnapshot:is,CollectionReference:as,FieldPath:ao,FieldValue:mo,setLogLevel:Go.setLogLevel,CACHE_SIZE_UNLIMITED:zo};
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */function ps(e){!function(e,t){e.INTERNAL.registerComponent(new l.Component("firestore",(function(e){return function(e,t){var n=new Ia,r=new Pa(n);return new Go(e,t,r,n)}(e.getProvider("app").getImmediate(),e.getProvider("auth-internal"))}),"PUBLIC").setServiceProps(Object.assign({},ds)))}(e),e.registerVersion("@firebase/firestore","1.16.5")}ps(a),t.__PRIVATE_registerFirestore=ps}).call(this,n(3))},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"ErrorCode",(function(){return nr})),n.d(t,"EventType",(function(){return rr})),n.d(t,"WebChannel",(function(){return ir})),n.d(t,"XhrIo",(function(){return ar})),n.d(t,"createWebChannelTransport",(function(){return tr}));
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+***************************************************************************** */
+var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var a,o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},s=s||{},c=o||self;function l(){}function u(e){var t=typeof e;return"object"!=t?t:e?Array.isArray(e)?"array":t:"null"}function h(e){var t=u(e);return"array"==t||"object"==t&&"number"==typeof e.length}function d(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var p="closure_uid_"+(1e9*Math.random()>>>0),f=0;function m(e,t,n){return e.call.apply(e.bind,arguments)}function g(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function y(e,t,n){return(y=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?m:g).apply(null,arguments)}function v(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}var b=Date.now;function w(e,t){function n(){}n.prototype=t.prototype,e.S=t.prototype,e.prototype=new n,e.prototype.constructor=e}function A(){this.j=this.j,this.i=this.i}A.prototype.j=!1,A.prototype.ja=function(){if(!this.j&&(this.j=!0,this.G(),0))(function(e){Object.prototype.hasOwnProperty.call(e,p)&&e[p]||(e[p]=++f)})(this)},A.prototype.G=function(){if(this.i)for(;this.i.length;)this.i.shift()()};var E=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if("string"==typeof e)return"string"!=typeof t||1!=t.length?-1:e.indexOf(t,0);for(var n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},x=Array.prototype.forEach?function(e,t,n){Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var r=e.length,i="string"==typeof e?e.split(""):e,a=0;a<r;a++)a in i&&t.call(n,i[a],a,e)};function _(e){return Array.prototype.concat.apply([],arguments)}function S(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]}function M(e){return/^[\s\xa0]*$/.test(e)}var T,R=String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]};function k(e,t){return-1!=e.indexOf(t)}function C(e,t){return e<t?-1:e>t?1:0}e:{var O=c.navigator;if(O){var P=O.userAgent;if(P){T=P;break e}}T=""}function I(e,t,n){for(var r in e)t.call(n,e[r],r,e)}function N(e){var t={};for(var n in e)t[n]=e[n];return t}var L="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function D(e,t){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])e[n]=r[n];for(var a=0;a<L.length;a++)n=L[a],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function F(e){return F[" "](e),e}F[" "]=l;var j,U,B=k(T,"Opera"),V=k(T,"Trident")||k(T,"MSIE"),z=k(T,"Edge"),H=z||V,G=k(T,"Gecko")&&!(k(T.toLowerCase(),"webkit")&&!k(T,"Edge"))&&!(k(T,"Trident")||k(T,"MSIE"))&&!k(T,"Edge"),q=k(T.toLowerCase(),"webkit")&&!k(T,"Edge");function W(){var e=c.document;return e?e.documentMode:void 0}e:{var J="",Z=(U=T,G?/rv:([^\);]+)(\)|;)/.exec(U):z?/Edge\/([\d\.]+)/.exec(U):V?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(U):q?/WebKit\/(\S+)/.exec(U):B?/(?:Version)[ \/]?(\S+)/.exec(U):void 0);if(Z&&(J=Z?Z[1]:""),V){var X=W();if(null!=X&&X>parseFloat(J)){j=String(X);break e}}j=J}var Y,K={};function Q(e){return function(e,t){var n=K;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,(function(){for(var t=0,n=R(String(j)).split("."),r=R(String(e)).split("."),i=Math.max(n.length,r.length),a=0;0==t&&a<i;a++){var o=n[a]||"",s=r[a]||"";do{if(o=/(\d*)(\D*)(.*)/.exec(o)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==o[0].length&&0==s[0].length)break;t=C(0==o[1].length?0:parseInt(o[1],10),0==s[1].length?0:parseInt(s[1],10))||C(0==o[2].length,0==s[2].length)||C(o[2],s[2]),o=o[3],s=s[3]}while(0==t)}return 0<=t}))}if(c.document&&V){var $=W();Y=$||(parseInt(j,10)||void 0)}else Y=void 0;var ee=Y,te=!V||9<=Number(ee),ne=V&&!Q("9"),re=function(){if(!c.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{c.addEventListener("test",l,t),c.removeEventListener("test",l,t)}catch(e){}return e}();function ie(e,t){this.type=e,this.a=this.target=t,this.defaultPrevented=!1}function ae(e,t){if(ie.call(this,e?e.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.a=t,t=e.relatedTarget){if(G){e:{try{F(t.nodeName);var i=!0;break e}catch(e){}i=!1}i||(t=null)}}else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"==typeof e.pointerType?e.pointerType:oe[e.pointerType]||"",this.c=e,e.defaultPrevented&&this.b()}}ie.prototype.b=function(){this.defaultPrevented=!0},w(ae,ie);var oe={2:"touch",3:"pen",4:"mouse"};ae.prototype.b=function(){ae.S.b.call(this);var e=this.c;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,ne)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}};var se="closure_listenable_"+(1e6*Math.random()|0),ce=0;function le(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.ca=i,this.key=++ce,this.Y=this.Z=!1}function ue(e){e.Y=!0,e.listener=null,e.proxy=null,e.src=null,e.ca=null}function he(e){this.src=e,this.a={},this.b=0}function de(e,t){var n=t.type;if(n in e.a){var r,i=e.a[n],a=E(i,t);(r=0<=a)&&Array.prototype.splice.call(i,a,1),r&&(ue(t),0==e.a[n].length&&(delete e.a[n],e.b--))}}function pe(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i];if(!a.Y&&a.listener==t&&a.capture==!!n&&a.ca==r)return i}return-1}he.prototype.add=function(e,t,n,r,i){var a=e.toString();(e=this.a[a])||(e=this.a[a]=[],this.b++);var o=pe(e,t,r,i);return-1<o?(t=e[o],n||(t.Z=!1)):((t=new le(t,this.src,a,!!r,i)).Z=n,e.push(t)),t};var fe="closure_lm_"+(1e6*Math.random()|0),me={};function ge(e,t,n,r,i){if(r&&r.once)return function e(t,n,r,i,a){if(Array.isArray(n)){for(var o=0;o<n.length;o++)e(t,n[o],r,i,a);return null}return r=_e(r),t&&t[se]?t.wa(n,r,d(i)?!!i.capture:!!i,a):ye(t,n,r,!0,i,a)}(e,t,n,r,i);if(Array.isArray(t)){for(var a=0;a<t.length;a++)ge(e,t[a],n,r,i);return null}return n=_e(n),e&&e[se]?e.va(t,n,d(r)?!!r.capture:!!r,i):ye(e,t,n,!1,r,i)}function ye(e,t,n,r,i,a){if(!t)throw Error("Invalid event type");var o=d(i)?!!i.capture:!!i;if(o&&!te)return null;var s=Ee(e);if(s||(e[fe]=s=new he(e)),(n=s.add(t,n,r,o,a)).proxy)return n;if(r=function(){var e=Ae,t=te?function(n){return e.call(t.src,t.listener,n)}:function(n){if(!(n=e.call(t.src,t.listener,n)))return n};return t}(),n.proxy=r,r.src=e,r.listener=n,e.addEventListener)re||(i=o),void 0===i&&(i=!1),e.addEventListener(t.toString(),r,i);else if(e.attachEvent)e.attachEvent(be(t.toString()),r);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(r)}return n}function ve(e){if("number"!=typeof e&&e&&!e.Y){var t=e.src;if(t&&t[se])de(t.c,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(be(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=Ee(t))?(de(n,e),0==n.b&&(n.src=null,t[fe]=null)):ue(e)}}}function be(e){return e in me?me[e]:me[e]="on"+e}function we(e,t){var n=e.listener,r=e.ca||e.src;return e.Z&&ve(e),n.call(r,t)}function Ae(e,t){if(e.Y)return!0;if(!te){if(!t)e:{t=["window","event"];for(var n=c,r=0;r<t.length;r++)if(null==(n=n[t[r]])){t=null;break e}t=n}return we(e,t=new ae(t,this))}return we(e,new ae(t,this))}function Ee(e){return(e=e[fe])instanceof he?e:null}var xe="__closure_events_fn_"+(1e9*Math.random()>>>0);function _e(e){return"function"==u(e)?e:(e[xe]||(e[xe]=function(t){return e.handleEvent(t)}),e[xe])}function Se(){A.call(this),this.c=new he(this),this.J=this,this.C=null}function Me(e,t,n,r){if(!(t=e.c.a[String(t)]))return!0;t=t.concat();for(var i=!0,a=0;a<t.length;++a){var o=t[a];if(o&&!o.Y&&o.capture==n){var s=o.listener,c=o.ca||o.src;o.Z&&de(e.c,o),i=!1!==s.call(c,r)&&i}}return i&&!r.defaultPrevented}w(Se,A),Se.prototype[se]=!0,(a=Se.prototype).addEventListener=function(e,t,n,r){ge(this,e,t,n,r)},a.removeEventListener=function(e,t,n,r){!function e(t,n,r,i,a){if(Array.isArray(n))for(var o=0;o<n.length;o++)e(t,n[o],r,i,a);else i=d(i)?!!i.capture:!!i,r=_e(r),t&&t[se]?(t=t.c,(n=String(n).toString())in t.a&&(-1<(r=pe(o=t.a[n],r,i,a))&&(ue(o[r]),Array.prototype.splice.call(o,r,1),0==o.length&&(delete t.a[n],t.b--)))):t&&(t=Ee(t))&&(n=t.a[n.toString()],t=-1,n&&(t=pe(n,r,i,a)),(r=-1<t?n[t]:null)&&ve(r))}(this,e,t,n,r)},a.dispatchEvent=function(e){var t,n=this.C;if(n)for(t=[];n;n=n.C)t.push(n);n=this.J;var r=e.type||e;if("string"==typeof e)e=new ie(e,n);else if(e instanceof ie)e.target=e.target||n;else{var i=e;D(e=new ie(r,n),i)}if(i=!0,t)for(var a=t.length-1;0<=a;a--){var o=e.a=t[a];i=Me(o,r,!0,e)&&i}if(i=Me(o=e.a=n,r,!0,e)&&i,i=Me(o,r,!1,e)&&i,t)for(a=0;a<t.length;a++)i=Me(o=e.a=t[a],r,!1,e)&&i;return i},a.G=function(){if(Se.S.G.call(this),this.c){var e,t=this.c;for(e in t.a){for(var n=t.a[e],r=0;r<n.length;r++)ue(n[r]);delete t.a[e],t.b--}}this.C=null},a.va=function(e,t,n,r){return this.c.add(String(e),t,!1,n,r)},a.wa=function(e,t,n,r){return this.c.add(String(e),t,!0,n,r)};var Te=c.JSON.stringify;function Re(){this.b=this.a=null}var ke,Ce=new(function(){function e(e,t,n){this.f=n,this.c=e,this.g=t,this.b=0,this.a=null}return e.prototype.get=function(){var e;return 0<this.b?(this.b--,e=this.a,this.a=e.next,e.next=null):e=this.c(),e},e}())((function(){return new Pe}),(function(e){e.reset()}),100);function Oe(){var e=De,t=null;return e.a&&(t=e.a,e.a=e.a.next,e.a||(e.b=null),t.next=null),t}function Pe(){this.next=this.b=this.a=null}function Ie(e){c.setTimeout((function(){throw e}),0)}function Ne(e,t){ke||function(){var e=c.Promise.resolve(void 0);ke=function(){e.then(Fe)}}(),Le||(ke(),Le=!0),De.add(e,t)}Re.prototype.add=function(e,t){var n=Ce.get();n.set(e,t),this.b?this.b.next=n:this.a=n,this.b=n},Pe.prototype.set=function(e,t){this.a=e,this.b=t,this.next=null},Pe.prototype.reset=function(){this.next=this.b=this.a=null};var Le=!1,De=new Re;function Fe(){for(var e;e=Oe();){try{e.a.call(e.b)}catch(e){Ie(e)}var t=Ce;t.g(e),t.b<t.f&&(t.b++,e.next=t.a,t.a=e)}Le=!1}function je(e,t){Se.call(this),this.b=e||1,this.a=t||c,this.f=y(this.Ya,this),this.g=b()}function Ue(e){e.aa=!1,e.M&&(e.a.clearTimeout(e.M),e.M=null)}function Be(e,t,n){if("function"==u(e))n&&(e=y(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=y(e.handleEvent,e)}return 2147483647<Number(t)?-1:c.setTimeout(e,t||0)}function Ve(e){e.a=Be((function(){e.a=null,e.c&&(e.c=!1,Ve(e))}),e.h);var t=e.b;e.b=null,e.g.apply(null,t)}w(je,Se),(a=je.prototype).aa=!1,a.M=null,a.Ya=function(){if(this.aa){var e=b()-this.g;0<e&&e<.8*this.b?this.M=this.a.setTimeout(this.f,this.b-e):(this.M&&(this.a.clearTimeout(this.M),this.M=null),this.dispatchEvent("tick"),this.aa&&(Ue(this),this.start()))}},a.start=function(){this.aa=!0,this.M||(this.M=this.a.setTimeout(this.f,this.b),this.g=b())},a.G=function(){je.S.G.call(this),Ue(this),delete this.a};var ze=function(e){function t(t,n,r){var i=e.call(this)||this;return i.g=null!=r?t.bind(r):t,i.h=n,i.b=null,i.c=!1,i.a=null,i}return function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.f=function(e){this.b=arguments,this.a?this.c=!0:Ve(this)},t.prototype.G=function(){e.prototype.G.call(this),this.a&&(c.clearTimeout(this.a),this.a=null,this.c=!1,this.b=null)},t}(A);function He(e){A.call(this),this.b=e,this.a={}}w(He,A);var Ge=[];function qe(e,t,n,r){Array.isArray(n)||(n&&(Ge[0]=n.toString()),n=Ge);for(var i=0;i<n.length;i++){var a=ge(t,n[i],r||e.handleEvent,!1,e.b||e);if(!a)break;e.a[a.key]=a}}function We(e){I(e.a,(function(e,t){this.a.hasOwnProperty(t)&&ve(e)}),e),e.a={}}function Je(){this.a=!0}function Ze(e,t,n,r){e.info((function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.a)return t;if(!t)return null;try{var n=JSON.parse(t);if(n)for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var r=n[e];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var a=i[0];if("noop"!=a&&"stop"!=a&&"close"!=a)for(var o=1;o<i.length;o++)i[o]=""}}}return Te(n)}catch(e){return t}}(e,n)+(r?" "+r:"")}))}He.prototype.G=function(){He.S.G.call(this),We(this)},He.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Je.prototype.info=function(){};var Xe=null;function Ye(){return Xe=Xe||new Se}function Ke(e){ie.call(this,"serverreachability",e)}function Qe(e){var t=Ye();t.dispatchEvent(new Ke(t,e))}function $e(e){ie.call(this,"statevent",e)}function et(e){var t=Ye();t.dispatchEvent(new $e(t,e))}function tt(e){ie.call(this,"timingevent",e)}function nt(e,t){if("function"!=u(e))throw Error("Fn must not be null and must be a function");return c.setTimeout((function(){e()}),t)}w(Ke,ie),w($e,ie),w(tt,ie);var rt={NO_ERROR:0,Za:1,gb:2,fb:3,bb:4,eb:5,hb:6,Da:7,TIMEOUT:8,kb:9},it={ab:"complete",ob:"success",Ea:"error",Da:"abort",mb:"ready",nb:"readystatechange",TIMEOUT:"timeout",ib:"incrementaldata",lb:"progress",cb:"downloadprogress",pb:"uploadprogress"};function at(){}function ot(e){var t;return(t=e.a)||(t=e.a={}),t}function st(){}at.prototype.a=null;var ct,lt={OPEN:"a",$a:"b",Ea:"c",jb:"d"};function ut(){ie.call(this,"d")}function ht(){ie.call(this,"c")}function dt(){}function pt(e,t,n,r){this.g=e,this.c=t,this.f=n,this.T=r||1,this.J=new He(this),this.P=ft,e=H?125:void 0,this.R=new je(e),this.B=null,this.b=!1,this.j=this.l=this.i=this.H=this.u=this.U=this.o=null,this.s=[],this.a=null,this.D=0,this.h=this.m=null,this.N=-1,this.A=!1,this.O=0,this.F=null,this.W=this.C=this.V=this.I=!1}w(ut,ie),w(ht,ie),w(dt,at),ct=new dt;var ft=45e3,mt={},gt={};function yt(e,t,n){e.H=1,e.i=Ut(It(t)),e.j=n,e.I=!0,vt(e,null)}function vt(e,t){e.u=b(),At(e),e.l=It(e.i);var n=e.l,r=e.T;Array.isArray(r)||(r=[String(r)]),Qt(n.b,"t",r),e.D=0,e.a=Jn(e.g,e.g.C?t:null),0<e.O&&(e.F=new ze(y(e.Ca,e,e.a),e.O)),qe(e.J,e.a,"readystatechange",e.Wa),t=e.B?N(e.B):{},e.j?(e.m||(e.m="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.a.ba(e.l,e.m,e.j,t)):(e.m="GET",e.a.ba(e.l,e.m,null,t)),Qe(1),function(e,t,n,r,i,a){e.info((function(){if(e.a)if(a)for(var o="",s=a.split("&"),c=0;c<s.length;c++){var l=s[c].split("=");if(1<l.length){var u=l[0];l=l[1];var h=u.split("_");o=2<=h.length&&"type"==h[1]?o+(u+"=")+l+"&":o+(u+"=redacted&")}}else o=null;else o=a;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+t+"\n"+n+"\n"+o}))}(e.c,e.m,e.l,e.f,e.T,e.j)}function bt(e,t,n){for(var r=!0;!e.A&&e.D<n.length;){var i=wt(e,n);if(i==gt){4==t&&(e.h=4,et(14),r=!1),Ze(e.c,e.f,null,"[Incomplete Response]");break}if(i==mt){e.h=4,et(15),Ze(e.c,e.f,n,"[Invalid Chunk]"),r=!1;break}Ze(e.c,e.f,i,null),Mt(e,i)}4==t&&0==n.length&&(e.h=1,et(16),r=!1),e.b=e.b&&r,r?0<n.length&&!e.W&&(e.W=!0,(t=e.g).a==e&&t.V&&!t.F&&(t.c.info("Great, no buffering proxy detected. Bytes received: "+n.length),Un(t),t.F=!0)):(Ze(e.c,e.f,n,"[Invalid Chunked Response]"),St(e),_t(e))}function wt(e,t){var n=e.D,r=t.indexOf("\n",n);return-1==r?gt:(n=Number(t.substring(n,r)),isNaN(n)?mt:(r+=1)+n>t.length?gt:(t=t.substr(r,n),e.D=r+n,t))}function At(e){e.U=b()+e.P,Et(e,e.P)}function Et(e,t){if(null!=e.o)throw Error("WatchDog timer not null");e.o=nt(y(e.Ua,e),t)}function xt(e){e.o&&(c.clearTimeout(e.o),e.o=null)}function _t(e){0==e.g.v||e.A||zn(e.g,e)}function St(e){xt(e);var t=e.F;t&&"function"==typeof t.ja&&t.ja(),e.F=null,Ue(e.R),We(e.J),e.a&&(t=e.a,e.a=null,t.abort(),t.ja())}function Mt(e,t){try{var n=e.g;if(0!=n.v&&(n.a==e||on(n.b,e)))if(n.I=e.N,!e.C&&on(n.b,e)&&3==n.v){try{var r=n.ka.a.parse(t)}catch(e){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){e:if(!n.j){if(n.a){if(!(n.a.u+3e3<e.u))break e;Vn(n),Cn(n)}jn(n),et(18)}}else n.oa=i[1],0<n.oa-n.P&&37500>i[2]&&n.H&&0==n.o&&!n.m&&(n.m=nt(y(n.Ra,n),6e3));if(1>=an(n.b)&&n.ea){try{n.ea()}catch(e){}n.ea=void 0}}else Gn(n,11)}else if((e.C||n.a==e)&&Vn(n),!M(t))for(t=r=n.ka.a.parse(t),r=0;r<t.length;r++)if(i=t[r],n.P=i[0],i=i[1],2==n.v)if("c"==i[0]){n.J=i[1],n.ga=i[2];var a=i[3];null!=a&&(n.ha=a,n.c.info("VER="+n.ha));var o=i[4];null!=o&&(n.pa=o,n.c.info("SVER="+n.pa));var s=i[5];if(null!=s&&"number"==typeof s&&0<s){var c=1.5*s;n.D=c,n.c.info("backChannelRequestTimeoutMs_="+c)}c=n;var l=e.a;if(l){var u=l.a?l.a.getResponseHeader("X-Client-Wire-Protocol"):null;if(u){var h=c.b;!h.a&&(k(u,"spdy")||k(u,"quic")||k(u,"h2"))&&(h.f=h.g,h.a=new Set,h.b&&(sn(h,h.b),h.b=null))}if(c.A){var d=l.a?l.a.getResponseHeader("X-HTTP-Session-Id"):null;d&&(c.na=d,jt(c.B,c.A,d))}}n.v=3,n.f&&n.f.ta(),n.V&&(n.N=b()-e.u,n.c.info("Handshake RTT: "+n.N+"ms"));var p=e;if((c=n).la=Wn(c,c.C?c.ga:null,c.fa),p.C){cn(c.b,p);var f=p,m=c.D;m&&f.setTimeout(m),f.o&&(xt(f),At(f)),c.a=p}else Fn(c);0<n.g.length&&In(n)}else"stop"!=i[0]&&"close"!=i[0]||Gn(n,7);else 3==n.v&&("stop"==i[0]||"close"==i[0]?"stop"==i[0]?Gn(n,7):kn(n):"noop"!=i[0]&&n.f&&n.f.sa(i),n.o=0);Qe(4)}catch(e){}}function Tt(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(h(e)||"string"==typeof e)x(e,t,void 0);else{if(e.L&&"function"==typeof e.L)var n=e.L();else if(e.K&&"function"==typeof e.K)n=void 0;else if(h(e)||"string"==typeof e){n=[];for(var r=e.length,i=0;i<r;i++)n.push(i)}else for(i in n=[],r=0,e)n[r++]=i;i=(r=function(e){if(e.K&&"function"==typeof e.K)return e.K();if("string"==typeof e)return e.split("");if(h(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e)).length;for(var a=0;a<i;a++)t.call(void 0,r[a],n&&n[a],e)}}function Rt(e,t){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(e)if(e instanceof Rt)for(n=e.L(),r=0;r<n.length;r++)this.set(n[r],e.get(n[r]));else for(r in e)this.set(r,e[r])}function kt(e){if(e.c!=e.a.length){for(var t=0,n=0;t<e.a.length;){var r=e.a[t];Ct(e.b,r)&&(e.a[n++]=r),t++}e.a.length=n}if(e.c!=e.a.length){var i={};for(n=t=0;t<e.a.length;)Ct(i,r=e.a[t])||(e.a[n++]=r,i[r]=1),t++;e.a.length=n}}function Ct(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(a=pt.prototype).setTimeout=function(e){this.P=e},a.Wa=function(e){e=e.target;var t=this.F;t&&3==Sn(e)?t.f():this.Ca(e)},a.Ca=function(e){try{if(e==this.a)e:{var t=Sn(this.a),n=this.a.ua(),r=this.a.X();if(!(3>t||3==t&&!H&&!this.a.$())){this.A||4!=t||7==n||Qe(8==n||0>=r?3:2),xt(this);var i=this.a.X();this.N=i;var a=this.a.$();if(this.b=200==i,function(e,t,n,r,i,a,o){e.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+a+" "+o}))}(this.c,this.m,this.l,this.f,this.T,t,i),this.b){if(this.V&&!this.C){t:{if(this.a){var o,s=this.a;if((o=s.a?s.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!M(o)){var c=o;break t}}c=null}if(!c){this.b=!1,this.h=3,et(12),St(this),_t(this);break e}Ze(this.c,this.f,c,"Initial handshake response via X-HTTP-Initial-Response"),this.C=!0,Mt(this,c)}this.I?(bt(this,t,a),H&&this.b&&3==t&&(qe(this.J,this.R,"tick",this.Va),this.R.start())):(Ze(this.c,this.f,a,null),Mt(this,a)),4==t&&St(this),this.b&&!this.A&&(4==t?zn(this.g,this):(this.b=!1,At(this)))}else 400==i&&0<a.indexOf("Unknown SID")?(this.h=3,et(12)):(this.h=0,et(13)),St(this),_t(this)}}}catch(e){}},a.Va=function(){if(this.a){var e=Sn(this.a),t=this.a.$();this.D<t.length&&(xt(this),bt(this,e,t),this.b&&4!=e&&At(this))}},a.cancel=function(){this.A=!0,St(this)},a.Ua=function(){this.o=null;var e=b();0<=e-this.U?(function(e,t){e.info((function(){return"TIMEOUT: "+t}))}(this.c,this.l),2!=this.H&&(Qe(3),et(17)),St(this),this.h=2,_t(this)):Et(this,this.U-e)},(a=Rt.prototype).K=function(){kt(this);for(var e=[],t=0;t<this.a.length;t++)e.push(this.b[this.a[t]]);return e},a.L=function(){return kt(this),this.a.concat()},a.get=function(e,t){return Ct(this.b,e)?this.b[e]:t},a.set=function(e,t){Ct(this.b,e)||(this.c++,this.a.push(e)),this.b[e]=t},a.forEach=function(e,t){for(var n=this.L(),r=0;r<n.length;r++){var i=n[r],a=this.get(i);e.call(t,a,i,this)}};var Ot=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Pt(e,t){if(this.c=this.j=this.f="",this.h=null,this.i=this.g="",this.a=!1,e instanceof Pt){this.a=void 0!==t?t:e.a,Nt(this,e.f),this.j=e.j,Lt(this,e.c),Dt(this,e.h),this.g=e.g,t=e.b;var n=new Zt;n.c=t.c,t.a&&(n.a=new Rt(t.a),n.b=t.b),Ft(this,n),this.i=e.i}else e&&(n=String(e).match(Ot))?(this.a=!!t,Nt(this,n[1]||"",!0),this.j=Bt(n[2]||""),Lt(this,n[3]||"",!0),Dt(this,n[4]),this.g=Bt(n[5]||"",!0),Ft(this,n[6]||"",!0),this.i=Bt(n[7]||"")):(this.a=!!t,this.b=new Zt(null,this.a))}function It(e){return new Pt(e)}function Nt(e,t,n){e.f=n?Bt(t,!0):t,e.f&&(e.f=e.f.replace(/:$/,""))}function Lt(e,t,n){e.c=n?Bt(t,!0):t}function Dt(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.h=t}else e.h=null}function Ft(e,t,n){t instanceof Zt?(e.b=t,function(e,t){t&&!e.f&&(Xt(e),e.c=null,e.a.forEach((function(e,t){var n=t.toLowerCase();t!=n&&(Yt(this,t),Qt(this,n,e))}),e)),e.f=t}(e.b,e.a)):(n||(t=Vt(t,Wt)),e.b=new Zt(t,e.a))}function jt(e,t,n){e.b.set(t,n)}function Ut(e){return jt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^b()).toString(36)),e}function Bt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Vt(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,zt),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function zt(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Pt.prototype.toString=function(){var e=[],t=this.f;t&&e.push(Vt(t,Ht,!0),":");var n=this.c;return(n||"file"==t)&&(e.push("//"),(t=this.j)&&e.push(Vt(t,Ht,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&e.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&e.push("/"),e.push(Vt(n,"/"==n.charAt(0)?qt:Gt,!0))),(n=this.b.toString())&&e.push("?",n),(n=this.i)&&e.push("#",Vt(n,Jt)),e.join("")};var Ht=/[#\/\?@]/g,Gt=/[#\?:]/g,qt=/[#\?]/g,Wt=/[#\?@]/g,Jt=/#/g;function Zt(e,t){this.b=this.a=null,this.c=e||null,this.f=!!t}function Xt(e){e.a||(e.a=new Rt,e.b=0,e.c&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),i=null;if(0<=r){var a=e[n].substring(0,r);i=e[n].substring(r+1)}else a=e[n];t(a,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.c,(function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)})))}function Yt(e,t){Xt(e),t=$t(e,t),Ct(e.a.b,t)&&(e.c=null,e.b-=e.a.get(t).length,Ct((e=e.a).b,t)&&(delete e.b[t],e.c--,e.a.length>2*e.c&&kt(e)))}function Kt(e,t){return Xt(e),t=$t(e,t),Ct(e.a.b,t)}function Qt(e,t,n){Yt(e,t),0<n.length&&(e.c=null,e.a.set($t(e,t),S(n)),e.b+=n.length)}function $t(e,t){return t=String(t),e.f&&(t=t.toLowerCase()),t}function en(e,t){this.b=e,this.a=t}function tn(e){this.g=e||nn,c.PerformanceNavigationTiming?e=0<(e=c.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(c.ia&&c.ia.ya&&c.ia.ya()&&c.ia.ya().qb),this.f=e?this.g:1,this.a=null,1<this.f&&(this.a=new Set),this.b=null,this.c=[]}(a=Zt.prototype).add=function(e,t){Xt(this),this.c=null,e=$t(this,e);var n=this.a.get(e);return n||this.a.set(e,n=[]),n.push(t),this.b+=1,this},a.forEach=function(e,t){Xt(this),this.a.forEach((function(n,r){x(n,(function(n){e.call(t,n,r,this)}),this)}),this)},a.L=function(){Xt(this);for(var e=this.a.K(),t=this.a.L(),n=[],r=0;r<t.length;r++)for(var i=e[r],a=0;a<i.length;a++)n.push(t[r]);return n},a.K=function(e){Xt(this);var t=[];if("string"==typeof e)Kt(this,e)&&(t=_(t,this.a.get($t(this,e))));else{e=this.a.K();for(var n=0;n<e.length;n++)t=_(t,e[n])}return t},a.set=function(e,t){return Xt(this),this.c=null,Kt(this,e=$t(this,e))&&(this.b-=this.a.get(e).length),this.a.set(e,[t]),this.b+=1,this},a.get=function(e,t){return e&&0<(e=this.K(e)).length?String(e[0]):t},a.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var e=[],t=this.a.L(),n=0;n<t.length;n++){var r=t[n],i=encodeURIComponent(String(r));r=this.K(r);for(var a=0;a<r.length;a++){var o=i;""!==r[a]&&(o+="="+encodeURIComponent(String(r[a]))),e.push(o)}}return this.c=e.join("&")};var nn=10;function rn(e){return!!e.b||!!e.a&&e.a.size>=e.f}function an(e){return e.b?1:e.a?e.a.size:0}function on(e,t){return e.b?e.b==t:!!e.a&&e.a.has(t)}function sn(e,t){e.a?e.a.add(t):e.b=t}function cn(e,t){e.b&&e.b==t?e.b=null:e.a&&e.a.has(t)&&e.a.delete(t)}function ln(e){var t,n;if(null!=e.b)return e.c.concat(e.b.s);if(null!=e.a&&0!==e.a.size){var r=e.c;try{for(var a=i(e.a.values()),o=a.next();!o.done;o=a.next()){var s=o.value;r=r.concat(s.s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r}return S(e.c)}function un(){}function hn(){this.a=new un}function dn(e,t,n){var r=n||"";try{Tt(e,(function(e,n){var i=e;d(e)&&(i=Te(e)),t.push(r+n+"="+encodeURIComponent(i))}))}catch(e){throw t.push(r+"type="+encodeURIComponent("_badmap")),e}}function pn(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(e){}}tn.prototype.cancel=function(){var e,t;if(this.c=ln(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(var n=i(this.a.values()),r=n.next();!r.done;r=n.next()){r.value.cancel()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.a.clear()}},un.prototype.stringify=function(e){return c.JSON.stringify(e,void 0)},un.prototype.parse=function(e){return c.JSON.parse(e,void 0)};var fn=c.JSON.parse;function mn(e){Se.call(this),this.headers=new Rt,this.H=e||null,this.b=!1,this.s=this.a=null,this.B="",this.h=0,this.f="",this.g=this.A=this.l=this.u=!1,this.o=0,this.m=null,this.I=gn,this.D=this.F=!1}w(mn,Se);var gn="",yn=/^https?$/i,vn=["POST","PUT"];function bn(e){return"content-type"==e.toLowerCase()}function wn(e,t){e.b=!1,e.a&&(e.g=!0,e.a.abort(),e.g=!1),e.f=t,e.h=5,An(e),xn(e)}function An(e){e.u||(e.u=!0,e.dispatchEvent("complete"),e.dispatchEvent("error"))}function En(e){if(e.b&&void 0!==s&&(!e.s[1]||4!=Sn(e)||2!=e.X()))if(e.l&&4==Sn(e))Be(e.za,0,e);else if(e.dispatchEvent("readystatechange"),4==Sn(e)){e.b=!1;try{var t,n=e.X();e:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break e;default:r=!1}if(!(t=r)){var i;if(i=0===n){var a=String(e.B).match(Ot)[1]||null;if(!a&&c.self&&c.self.location){var o=c.self.location.protocol;a=o.substr(0,o.length-1)}i=!yn.test(a?a.toLowerCase():"")}t=i}if(t)e.dispatchEvent("complete"),e.dispatchEvent("success");else{e.h=6;try{var l=2<Sn(e)?e.a.statusText:""}catch(e){l=""}e.f=l+" ["+e.X()+"]",An(e)}}finally{xn(e)}}}function xn(e,t){if(e.a){_n(e);var n=e.a,r=e.s[0]?l:null;e.a=null,e.s=null,t||e.dispatchEvent("ready");try{n.onreadystatechange=r}catch(e){}}}function _n(e){e.a&&e.D&&(e.a.ontimeout=null),e.m&&(c.clearTimeout(e.m),e.m=null)}function Sn(e){return e.a?e.a.readyState:0}function Mn(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}r||(n=function(e){var t="";return I(e,(function(e,n){t+=n,t+=":",t+=e,t+="\r\n"})),t}(n),"string"==typeof e?null!=n&&encodeURIComponent(String(n)):jt(e,t,n))}function Tn(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function Rn(e){this.pa=0,this.g=[],this.c=new Je,this.ga=this.la=this.B=this.fa=this.a=this.na=this.A=this.W=this.i=this.O=this.l=null,this.La=this.R=0,this.Ia=Tn("failFast",!1,e),this.H=this.m=this.j=this.h=this.f=null,this.T=!0,this.I=this.oa=this.P=-1,this.U=this.o=this.u=0,this.Fa=Tn("baseRetryDelayMs",5e3,e),this.Ma=Tn("retryDelaySeedMs",1e4,e),this.Ja=Tn("forwardChannelMaxRetries",2,e),this.ma=Tn("forwardChannelRequestTimeoutMs",2e4,e),this.Ka=e&&e.g||void 0,this.D=void 0,this.C=e&&e.supportsCrossDomainXhr||!1,this.J="",this.b=new tn(e&&e.concurrentRequestLimit),this.ka=new hn,this.da=e&&e.fastHandshake||!1,this.Ga=e&&e.b||!1,e&&e.f&&(this.c.a=!1),e&&e.forceLongPolling&&(this.T=!1),this.V=!this.da&&this.T&&e&&e.c||!1,this.ea=void 0,this.N=0,this.F=!1,this.s=null}function kn(e){if(On(e),3==e.v){var t=e.R++,n=It(e.B);jt(n,"SID",e.J),jt(n,"RID",t),jt(n,"TYPE","terminate"),Ln(e,n),(t=new pt(e,e.c,t,void 0)).H=2,t.i=Ut(It(n)),n=!1,c.navigator&&c.navigator.sendBeacon&&(n=c.navigator.sendBeacon(t.i.toString(),"")),!n&&c.Image&&((new Image).src=t.i,n=!0),n||(t.a=Jn(t.g,null),t.a.ba(t.i)),t.u=b(),At(t)}qn(e)}function Cn(e){e.a&&(Un(e),e.a.cancel(),e.a=null)}function On(e){Cn(e),e.j&&(c.clearTimeout(e.j),e.j=null),Vn(e),e.b.cancel(),e.h&&("number"==typeof e.h&&c.clearTimeout(e.h),e.h=null)}function Pn(e,t){e.g.push(new en(e.La++,t)),3==e.v&&In(e)}function In(e){rn(e.b)||e.h||(e.h=!0,Ne(e.Ba,e),e.u=0)}function Nn(e,t){var n;n=t?t.f:e.R++;var r=It(e.B);jt(r,"SID",e.J),jt(r,"RID",n),jt(r,"AID",e.P),Ln(e,r),e.i&&e.l&&Mn(r,e.i,e.l),n=new pt(e,e.c,n,e.u+1),null===e.i&&(n.B=e.l),t&&(e.g=t.s.concat(e.g)),t=Dn(e,n,1e3),n.setTimeout(Math.round(.5*e.ma)+Math.round(.5*e.ma*Math.random())),sn(e.b,n),yt(n,r,t)}function Ln(e,t){e.f&&Tt({},(function(e,n){jt(t,n,e)}))}function Dn(e,t,n){n=Math.min(e.g.length,n);var r=e.f?y(e.f.Ha,e.f,e):null;e:for(var i=e.g,a=-1;;){var o=["count="+n];-1==a?0<n?(a=i[0].b,o.push("ofs="+a)):a=0:o.push("ofs="+a);for(var s=!0,c=0;c<n;c++){var l=i[c].b,u=i[c].a;if(0>(l-=a))a=Math.max(0,i[c].b-100),s=!1;else try{dn(u,o,"req"+l+"_")}catch(e){r&&r(u)}}if(s){r=o.join("&");break e}}return e=e.g.splice(0,n),t.s=e,r}function Fn(e){e.a||e.j||(e.U=1,Ne(e.Aa,e),e.o=0)}function jn(e){return!(e.a||e.j||3<=e.o)&&(e.U++,e.j=nt(y(e.Aa,e),Hn(e,e.o)),e.o++,!0)}function Un(e){null!=e.s&&(c.clearTimeout(e.s),e.s=null)}function Bn(e){e.a=new pt(e,e.c,"rpc",e.U),null===e.i&&(e.a.B=e.l),e.a.O=0;var t=It(e.la);jt(t,"RID","rpc"),jt(t,"SID",e.J),jt(t,"CI",e.H?"0":"1"),jt(t,"AID",e.P),Ln(e,t),jt(t,"TYPE","xmlhttp"),e.i&&e.l&&Mn(t,e.i,e.l),e.D&&e.a.setTimeout(e.D);var n=e.a;e=e.ga,n.H=1,n.i=Ut(It(t)),n.j=null,n.I=!0,vt(n,e)}function Vn(e){null!=e.m&&(c.clearTimeout(e.m),e.m=null)}function zn(e,t){var n=null;if(e.a==t){Vn(e),Un(e),e.a=null;var r=2}else{if(!on(e.b,t))return;n=t.s,cn(e.b,t),r=1}if(e.I=t.N,0!=e.v)if(t.b)if(1==r){n=t.j?t.j.length:0,t=b()-t.u;var i=e.u;(r=Ye()).dispatchEvent(new tt(r,n,t,i)),In(e)}else Fn(e);else if(3==(i=t.h)||0==i&&0<e.I||!(1==r&&function(e,t){return!(an(e.b)>=e.b.f-(e.h?1:0))&&(e.h?(e.g=t.s.concat(e.g),!0):!(1==e.v||2==e.v||e.u>=(e.Ia?0:e.Ja))&&(e.h=nt(y(e.Ba,e,t),Hn(e,e.u)),e.u++,!0))}(e,t)||2==r&&jn(e)))switch(n&&0<n.length&&(t=e.b,t.c=t.c.concat(n)),i){case 1:Gn(e,5);break;case 4:Gn(e,10);break;case 3:Gn(e,6);break;default:Gn(e,2)}}function Hn(e,t){var n=e.Fa+Math.floor(Math.random()*e.Ma);return e.f||(n*=2),n*t}function Gn(e,t){if(e.c.info("Error code "+t),2==t){var n=null;e.f&&(n=null);var r=y(e.Xa,e);n||(n=new Pt("//www.google.com/images/cleardot.gif"),c.location&&"http"==c.location.protocol||Nt(n,"https"),Ut(n)),function(e,t){var n=new Je;if(c.Image){var r=new Image;r.onload=v(pn,n,r,"TestLoadImage: loaded",!0,t),r.onerror=v(pn,n,r,"TestLoadImage: error",!1,t),r.onabort=v(pn,n,r,"TestLoadImage: abort",!1,t),r.ontimeout=v(pn,n,r,"TestLoadImage: timeout",!1,t),c.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=e}else t(!1)}(n.toString(),r)}else et(2);e.v=0,e.f&&e.f.ra(t),qn(e),On(e)}function qn(e){e.v=0,e.I=-1,e.f&&(0==ln(e.b).length&&0==e.g.length||(e.b.c.length=0,S(e.g),e.g.length=0),e.f.qa())}function Wn(e,t,n){var r=function(e){return e instanceof Pt?It(e):new Pt(e,void 0)}(n);if(""!=r.c)t&&Lt(r,t+"."+r.c),Dt(r,r.h);else{var i=c.location;r=function(e,t,n,r){var i=new Pt(null,void 0);return e&&Nt(i,e),t&&Lt(i,t),n&&Dt(i,n),r&&(i.g=r),i}(i.protocol,t?t+"."+i.hostname:i.hostname,+i.port,n)}return e.W&&I(e.W,(function(e,t){jt(r,t,e)})),t=e.A,n=e.na,t&&n&&jt(r,t,n),jt(r,"VER",e.ha),Ln(e,r),r}function Jn(e,t){if(t&&!e.C)throw Error("Can't create secondary domain capable XhrIo object.");return(t=new mn(e.Ka)).F=e.C,t}function Zn(){}function Xn(){if(V&&!(10<=Number(ee)))throw Error("Environmental error: no available transport.")}function Yn(e,t){Se.call(this),this.a=new Rn(t),this.l=e,this.b=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.a.l=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.a&&(e?e["X-WebChannel-Client-Profile"]=t.a:e={"X-WebChannel-Client-Profile":t.a}),this.a.O=e,(e=t&&t.httpHeadersOverwriteParam)&&!M(e)&&(this.a.i=e),this.h=t&&t.supportsCrossDomainXhr||!1,this.g=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!M(t)&&(this.a.A=t,null!==(e=this.b)&&t in e&&(t in(e=this.b)&&delete e[t])),this.f=new $n(this)}function Kn(e){ut.call(this);var t=e.__sm__;if(t){e:{for(var n in t){e=n;break e}e=void 0}(this.c=e)?(e=this.c,this.data=null!==t&&e in t?t[e]:void 0):this.data=t}else this.data=e}function Qn(){ht.call(this),this.status=1}function $n(e){this.a=e}(a=mn.prototype).ba=function(e,t,n,r){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.B+"; newUri="+e);t=t?t.toUpperCase():"GET",this.B=e,this.f="",this.h=0,this.u=!1,this.b=!0,this.a=new XMLHttpRequest,this.s=this.H?ot(this.H):ot(ct),this.a.onreadystatechange=y(this.za,this);try{this.A=!0,this.a.open(t,String(e),!0),this.A=!1}catch(e){return void wn(this,e)}e=n||"";var i=new Rt(this.headers);r&&Tt(r,(function(e,t){i.set(t,e)})),r=function(e){e:{for(var t=bn,n=e.length,r="string"==typeof e?e.split(""):e,i=0;i<n;i++)if(i in r&&t.call(void 0,r[i],i,e)){t=i;break e}t=-1}return 0>t?null:"string"==typeof e?e.charAt(t):e[t]}(i.L()),n=c.FormData&&e instanceof c.FormData,!(0<=E(vn,t))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach((function(e,t){this.a.setRequestHeader(t,e)}),this),this.I&&(this.a.responseType=this.I),"withCredentials"in this.a&&this.a.withCredentials!==this.F&&(this.a.withCredentials=this.F);try{_n(this),0<this.o&&((this.D=function(e){return V&&Q(9)&&"number"==typeof e.timeout&&void 0!==e.ontimeout}(this.a))?(this.a.timeout=this.o,this.a.ontimeout=y(this.xa,this)):this.m=Be(this.xa,this.o,this)),this.l=!0,this.a.send(e),this.l=!1}catch(e){wn(this,e)}},a.xa=function(){void 0!==s&&this.a&&(this.f="Timed out after "+this.o+"ms, aborting",this.h=8,this.dispatchEvent("timeout"),this.abort(8))},a.abort=function(e){this.a&&this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.h=e||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),xn(this))},a.G=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),xn(this,!0)),mn.S.G.call(this)},a.za=function(){this.j||(this.A||this.l||this.g?En(this):this.Ta())},a.Ta=function(){En(this)},a.X=function(){try{return 2<Sn(this)?this.a.status:-1}catch(e){return-1}},a.$=function(){try{return this.a?this.a.responseText:""}catch(e){return""}},a.Na=function(e){if(this.a){var t=this.a.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),fn(t)}},a.ua=function(){return this.h},a.Qa=function(){return"string"==typeof this.f?this.f:String(this.f)},(a=Rn.prototype).ha=8,a.v=1,a.Ba=function(e){if(this.h)if(this.h=null,1==this.v){if(!e){this.R=Math.floor(1e5*Math.random()),e=this.R++;var t,n=new pt(this,this.c,e,void 0),r=this.l;if(this.O&&(r?D(r=N(r),this.O):r=this.O),null===this.i&&(n.B=r),this.da)e:{for(var i=t=0;i<this.g.length;i++){var a=this.g[i];if(void 0===(a="__data__"in a.a&&"string"==typeof(a=a.a.__data__)?a.length:void 0))break;if(4096<(t+=a)){t=i;break e}if(4096===t||i===this.g.length-1){t=i+1;break e}}t=1e3}else t=1e3;t=Dn(this,n,t),jt(i=It(this.B),"RID",e),jt(i,"CVER",22),this.A&&jt(i,"X-HTTP-Session-Id",this.A),Ln(this,i),this.i&&r&&Mn(i,this.i,r),sn(this.b,n),this.Ga&&jt(i,"TYPE","init"),this.da?(jt(i,"$req",t),jt(i,"SID","null"),n.V=!0,yt(n,i,null)):yt(n,i,t),this.v=2}}else 3==this.v&&(e?Nn(this,e):0==this.g.length||rn(this.b)||Nn(this))},a.Aa=function(){if(this.j=null,Bn(this),this.V&&!(this.F||null==this.a||0>=this.N)){var e=2*this.N;this.c.info("BP detection timer enabled: "+e),this.s=nt(y(this.Sa,this),e)}},a.Sa=function(){this.s&&(this.s=null,this.c.info("BP detection timeout reached."),this.c.info("Buffering proxy detected and switch to long-polling!"),this.H=!1,this.F=!0,Cn(this),Bn(this))},a.Ra=function(){null!=this.m&&(this.m=null,Cn(this),jn(this),et(19))},a.Xa=function(e){e?(this.c.info("Successfully pinged google.com"),et(2)):(this.c.info("Failed to ping google.com"),et(1))},(a=Zn.prototype).ta=function(){},a.sa=function(){},a.ra=function(){},a.qa=function(){},a.Ha=function(){},Xn.prototype.a=function(e,t){return new Yn(e,t)},w(Yn,Se),(a=Yn.prototype).addEventListener=function(e,t,n,r){Yn.S.addEventListener.call(this,e,t,n,r)},a.removeEventListener=function(e,t,n,r){Yn.S.removeEventListener.call(this,e,t,n,r)},a.Oa=function(){this.a.f=this.f,this.h&&(this.a.C=!0);var e=this.a,t=this.l,n=this.b||void 0;et(0),e.fa=t,e.W=n||{},e.H=e.T,e.B=Wn(e,null,e.fa),In(e)},a.close=function(){kn(this.a)},a.Pa=function(e){if("string"==typeof e){var t={};t.__data__=e,Pn(this.a,t)}else this.g?((t={}).__data__=Te(e),Pn(this.a,t)):Pn(this.a,e)},a.G=function(){this.a.f=null,delete this.f,kn(this.a),delete this.a,Yn.S.G.call(this)},w(Kn,ut),w(Qn,ht),w($n,Zn),$n.prototype.ta=function(){this.a.dispatchEvent("a")},$n.prototype.sa=function(e){this.a.dispatchEvent(new Kn(e))},$n.prototype.ra=function(e){this.a.dispatchEvent(new Qn(e))},$n.prototype.qa=function(){this.a.dispatchEvent("b")},Xn.prototype.createWebChannel=Xn.prototype.a,Yn.prototype.send=Yn.prototype.Pa,Yn.prototype.open=Yn.prototype.Oa,Yn.prototype.close=Yn.prototype.close,rt.NO_ERROR=0,rt.TIMEOUT=8,rt.HTTP_ERROR=6,it.COMPLETE="complete",st.EventType=lt,lt.OPEN="a",lt.CLOSE="b",lt.ERROR="c",lt.MESSAGE="d",Se.prototype.listen=Se.prototype.va,mn.prototype.listenOnce=mn.prototype.wa,mn.prototype.getLastError=mn.prototype.Qa,mn.prototype.getLastErrorCode=mn.prototype.ua,mn.prototype.getStatus=mn.prototype.X,mn.prototype.getResponseJson=mn.prototype.Na,mn.prototype.getResponseText=mn.prototype.$,mn.prototype.send=mn.prototype.ba;var er={createWebChannelTransport:function(){return new Xn},ErrorCode:rt,EventType:it,WebChannel:st,XhrIo:mn},tr=er.createWebChannelTransport,nr=er.ErrorCode,rr=er.EventType,ir=er.WebChannel,ar=er.XhrIo;t.default=er}.call(this,n(1))},function(e,t,n){const r=n(0),i=new THREE.Color;function a(e,t,n){i.set(n),e.uniforms?(e.uniforms[t].value.x=i.r,e.uniforms[t].value.y=i.g,e.uniforms[t].value.z=i.b):e[t].set(n)}function o(e,t,n,r,i,a){e.fillStyle=t,e.fillRect(n,r,i,a)}function s(e,t,n,r,i,a,o){let s;s=a>o?e.createLinearGradient(0,0,a,0):e.createLinearGradient(0,0,0,o),s.addColorStop(0,t),s.addColorStop(1,n),e.fillStyle=s,e.fillRect(r,i,a,o)}if(AFRAME.registerSystem("materials",{schema:{},init:function(){this.curve=null,this.panelMaterials=[];const e=localStorage.getItem("colorScheme")||"default";this.scheme=r.schemes[e],this.textureList=[],this.beatsCanvas=document.createElement("canvas"),this.beatsTexture=new THREE.CanvasTexture(this.beatsCanvas),this.generateBeatsTexture(),this.textureList.push(this.beatsTexture),this.envmapCanvas=document.createElement("canvas"),this.envmapTexture=new THREE.CanvasTexture(this.envmapCanvas),this.generateEnvmapTexture(),this.textureList.push(this.envmapTexture),this.fistsCanvas=document.createElement("canvas"),this.fistsTexture=new THREE.CanvasTexture(this.fistsCanvas),this.generateFistsTexture(),this.textureList.push(this.fistsTexture),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{this.createMaterials()}):this.createMaterials()},play:function(){this.setColorScheme()},tick:function(e,t){this.aurora.uniforms.time.value=e,this.home.animate&&(this.home.uniforms.time.value=e),this.leftFistWeapon.uniforms.time.value=e,this.leftWeapon.uniforms.time.value=e,this.rightFistWeapon.uniforms.time.value=e,this.rightWeapon.uniforms.time.value=e,this.rings.uniforms.time.value=e,this.tube.uniforms.time.value=e},createMaterials:function(){const e=this.scheme;this.tunnel=new THREE.ShaderMaterial({vertexShader:n(110),fragmentShader:n(111),uniforms:{fogColor:{value:new THREE.Color(e.primary)},color1:{value:new THREE.Color(e.primary)},color2:{value:new THREE.Color(e.secondary)},color3:{value:new THREE.Color(e.tertiary)},scale:{value:1}},transparent:!0}),this.merkaba=new THREE.MeshBasicMaterial({color:new THREE.Color(e.primary)}),this.backglow=new THREE.MeshBasicMaterial({transparent:!0,map:(new THREE.TextureLoader).load(document.getElementById("backGlowImg").src),color:new THREE.Color(e.primary)}),this.textureList.push(this.backglow.map),this.aurora=new THREE.ShaderMaterial({vertexShader:n(112),fragmentShader:n(113),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},time:{value:0}},transparent:!0}),this.rings=new THREE.ShaderMaterial({vertexShader:n(114),fragmentShader:n(115),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},colorTertiary:{value:new THREE.Color(e.tertiary)},time:{value:0}},transparent:!0,depthWrite:!1}),this.moon=new THREE.ShaderMaterial({vertexShader:n(116),fragmentShader:n(117),uniforms:{map:{value:(new THREE.TextureLoader).load(document.getElementById("moonImg").src)},tint:{value:new THREE.Color(e.secondarybright)}},transparent:!0}),this.textureList.push(this.moon.uniforms.map.value),this.home=new THREE.ShaderMaterial({vertexShader:n(118),fragmentShader:n(119),uniforms:{color1:{value:new THREE.Color(e.primary)},color2:{value:new THREE.Color(e.secondary)},color3:{value:new THREE.Color(e.tertiary)},src:{value:(new THREE.TextureLoader).load(document.getElementById("homeShadowImg").src)},time:{value:0}},transparent:!0}),this.textureList.push(this.home.uniforms.src.value);const t=(new THREE.TextureLoader).load(document.getElementById("weaponImg").src);t.wrapS=THREE.RepeatWrapping,t.wrapT=THREE.RepeatWrapping,t.repeat.set(2,2),t.magFilter=THREE.NearestFilter,this.textureList.push(t),this.rightWeapon=new THREE.ShaderMaterial({vertexShader:n(25),fragmentShader:n(26),uniforms:{src:{value:t},color:{value:new THREE.Color(e.secondary)},thickness:{value:1.6},time:{value:0}},transparent:!0,blending:THREE.AdditiveBlending}),this.leftWeapon=new THREE.ShaderMaterial({vertexShader:n(25),fragmentShader:n(26),uniforms:{src:{value:t},color:{value:new THREE.Color(e.primary)},thickness:{value:1.6},time:{value:0}},transparent:!0,blending:THREE.AdditiveBlending}),this.leftFistWeapon=new THREE.ShaderMaterial({vertexShader:n(16),fragmentShader:n(27),uniforms:{src:{value:t},color:{value:new THREE.Color(e.primary)},time:{value:0}},side:THREE.DoubleSide,transparent:!0,blending:THREE.AdditiveBlending}),this.rightFistWeapon=new THREE.ShaderMaterial({vertexShader:n(16),fragmentShader:n(27),uniforms:{src:{value:t},color:{value:new THREE.Color(e.secondary)},time:{value:0}},side:THREE.DoubleSide,transparent:!0,blending:THREE.AdditiveBlending});const i=(new THREE.TextureLoader).load(document.getElementById("weaponImg").src),a=(new THREE.TextureLoader).load(document.getElementById("weaponHandleImg").src);i.mapping=THREE.SphericalReflectionMapping,this.textureList.push(i),this.textureList.push(a),this.leftWeaponHandle=new THREE.MeshStandardMaterial({roughness:.4,metalness:.5,color:new THREE.Color(e.primary),map:a,envMap:i}),this.rightWeaponHandle=new THREE.MeshStandardMaterial({roughness:.4,metalness:.5,color:new THREE.Color(e.secondary),map:a,envMap:i});const o=(new THREE.TextureLoader).load(document.getElementById("weapon2Img").src);o.mapping=THREE.SphericalReflectionMapping,this.leftFist=new THREE.MeshStandardMaterial({roughness:.3,metalness:.8,map:this.fistsTexture,envMap:o,transparent:!0}),this.rightFist=new THREE.MeshStandardMaterial({roughness:.3,metalness:.8,map:this.fistsTexture,envMap:o,transparent:!0}),this.beat=new THREE.MeshLambertMaterial({map:this.beatsTexture,transparent:!0}),this.blueBeatPieces=new THREE.MeshLambertMaterial({map:this.beatsTexture,color:e.secondary,emissive:e.secondary,emissiveIntensity:.2}),this.redBeatPieces=new THREE.MeshLambertMaterial({map:this.beatsTexture,color:e.primary,emissive:e.primary,emissiveIntensity:.2}),this.minePieces=new THREE.MeshLambertMaterial({color:e.tertiary,emissive:e.tertiary,emissiveIntensity:.2});const s=(new THREE.TextureLoader).load(document.getElementById("backGlowImg").src);this.redBeatGlow=new THREE.MeshBasicMaterial({color:e.primary,map:s,blending:THREE.AdditiveBlending,transparent:!0}),this.blueBeatGlow=new THREE.MeshBasicMaterial({color:e.secondary,map:s,blending:THREE.AdditiveBlending,transparent:!0}),this.textureList.push(s),this.stars=new THREE.PointsMaterial({size:1,map:(new THREE.TextureLoader).load(document.getElementById("starImg").src),blending:THREE.AdditiveBlending,transparent:!0,color:new THREE.Color(e.secondary)}),this.textureList.push(this.stars.map);const c=(new THREE.TextureLoader).load(document.getElementById("sideglowImg").src);this.textureList.push(c),this.leftsideglow=new THREE.MeshBasicMaterial({map:c,transparent:!0,blending:THREE.AdditiveBlending,depthTest:!1,side:THREE.BackSide,color:new THREE.Color(r.OFF)}),this.rightsideglow=new THREE.MeshBasicMaterial({map:c,transparent:!0,blending:THREE.AdditiveBlending,depthTest:!1,color:new THREE.Color(r.OFF)});const l=(new THREE.TextureLoader).load(document.getElementById("plumeImg").src);l.minFilter=THREE.LinearFilter,this.arrowBluePlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.secondary)},src:{value:l}},transparent:!0,depthTest:!1}),this.arrowRedPlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.primary)},src:{value:l}},transparent:!0,depthTest:!1}),this.dotBluePlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.secondary)},src:{value:l}},transparent:!0,depthTest:!1}),this.dotRedPlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.primary)},src:{value:l}},transparent:!0,depthTest:!1}),this.minePlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.tertiary)},src:{value:l}},transparent:!0,depthTest:!1});const u=(new THREE.TextureLoader).load(document.getElementById("tubeImg").src),h=(new THREE.TextureLoader).load(document.getElementById("tubeColorImg").src);u.generateMipmaps=!1,u.minFilter=THREE.LinearFilter,h.generateMipmaps=!1,h.minFilter=THREE.LinearFilter,this.tube=new THREE.ShaderMaterial({vertexShader:n(120),fragmentShader:n(121),uniforms:{time:{value:0},opacity:{value:0},src:{value:u},color:{value:h}},transparent:!0,depthTest:!1,side:THREE.BackSide});const d=(new THREE.TextureLoader).load(document.getElementById("handStarTrailImg").src);d.generateMipmaps=!1,d.minFilter=THREE.LinearFilter,this.handStarTrail=new THREE.ShaderMaterial({vertexShader:n(122),fragmentShader:n(123),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},colorTertiary:{value:new THREE.Color(e.tertiary)},pulse:{value:0},src:{value:d}},transparent:!0,depthTest:!1,blending:THREE.AdditiveBlending,side:THREE.DoubleSide})},setColorScheme:function(e){this.el.sceneEl;const t=this.scheme=r.schemes[e]||r.schemes.default;a(this.arrowBluePlume,"color",t.secondary),a(this.arrowRedPlume,"color",t.primary),a(this.aurora,"colorPrimary",t.primary),a(this.aurora,"colorSecondary",t.secondary),a(this.backglow,"color",t.primary),a(this.blueBeatGlow,"color",t.secondary),a(this.blueBeatGlow,"color",t.secondary),a(this.blueBeatPieces,"color",t.secondary),a(this.blueBeatPieces,"emissive",t.secondary),a(this.dotBluePlume,"color",t.secondary),a(this.dotRedPlume,"color",t.primary),a(this.handStarTrail,"colorPrimary",t.primary),a(this.handStarTrail,"colorSecondary",t.secondary),a(this.handStarTrail,"colorTertiary",t.tertiary),a(this.home,"color1",t.primary),a(this.home,"color2",t.secondary),a(this.home,"color3",t.tertiary),a(this.leftFist,"color",t.primarybright),a(this.leftFistWeapon,"color",t.primary),a(this.leftWeapon,"color",t.primary),a(this.leftWeaponHandle,"color",t.primary),a(this.merkaba,"color",t.primary),a(this.minePieces,"color",t.tertiary),a(this.minePieces,"emissive",t.tertiary),a(this.minePlume,"color",t.tertiary),a(this.moon,"tint",t.secondarybright),a(this.redBeatGlow,"color",t.primary),a(this.redBeatGlow,"color",t.primary),a(this.redBeatPieces,"color",t.primary),a(this.redBeatPieces,"emissive",t.primary),a(this.rightFist,"color",t.secondarybright),a(this.rightWeapon,"color",t.secondary),a(this.rightFistWeapon,"color",t.secondary),a(this.rightWeaponHandle,"color",t.secondary),a(this.rings,"colorPrimary",t.primary),a(this.rings,"colorSecondary",t.secondary),a(this.rings,"colorTertiary",t.tertiary),a(this.stars,"color",t.secondary),a(this.tunnel,"fogColor",t.primary),a(this.tunnel,"color1",t.primary),a(this.tunnel,"color2",t.secondary),a(this.tunnel,"color3",t.tertiary),this.generateBeatsTexture(),this.generateEnvmapTexture(),this.generateFistsTexture(),document.querySelectorAll("a-entity[wall]").forEach(e=>{a(e.getObject3D("mesh").material,"colorTertiary",t.tertiary)}),this.panelMaterials.forEach(e=>{a(e,"colorPrimary",t.primary),a(e,"colorSecondary",t.secondary)}),a(this.curve,"fogColor",t.primary),a(this.curve,"color1",t.primary),a(this.curve,"color2",t.secondary)},generateBeatsTexture:function(){const e=this.scheme,t=new THREE.Color(e.primary),n=new THREE.Color(e.secondary),r=new THREE.Color(e.tertiary),i=this.beatsCanvas,a=i.getContext("2d");i.width=512,i.height=32,o(a,r.getStyle(),0,0,128,6),o(a,"#000",128,0,128,6),o(a,n.getStyle(),256,0,128,6),o(a,t.getStyle(),384,0,105,6),o(a,"#FFF",489,0,23,6),s(a,"#000000",n.getStyle(),0,6,512,4),s(a,"#000",t.getStyle(),0,10,512,5),s(a,"#000",r.getStyle(),0,15,512,4),s(a,`rgba(${n.r}, ${n.g}, ${n.b}, 0)`,n.getStyle(),0,19,512,5),s(a,`rgba(${t.r}, ${t.g}, ${t.b}, 0)`,t.getStyle(),0,24,512,4),s(a,`rgba(${r.r}, ${r.g}, ${r.b}, 0)`,r.getStyle(),0,28,512,4);const c=this.beatsTexture;return c.generateMipmaps=!1,c.magFilter=THREE.LinearFilter,c.minFilter=THREE.LinearFilter,c.needsUpdate=!0,c},generateFistsTexture:function(){const e=this.scheme,t=new THREE.Color(e.primarybright),n=new THREE.Color(e.secondarybright),r=this.fistsCanvas,i=r.getContext("2d");return r.width=8,r.height=128,s(i,t.getStyle(),`rgba(${t.r}, ${t.g}, ${t.b}, 0)`,0,0,4,128),s(i,n.getStyle(),`rgba(${n.r}, ${n.g}, ${n.b}, 0)`,4,0,4,128),this.fistsTexture.needsUpdate=!0,this.fistsTexture},generateEnvmapTexture:function(){const e=this.scheme,t=new THREE.Color(e.primary),n=new THREE.Color(e.secondary),r=document.getElementById("envmapTemplateImg");r.addEventListener("load",()=>{const e=r.width,i=r.height,a=this.envmapCanvas;a.width=e,a.height=i;const o=a.getContext("2d");o.drawImage(r,0,0);const s=o.getImageData(0,0,e,i),c=s.data;let l,u;for(let e=0;e<c.length;e+=4)l=c[e],u=c[e+1],l*=1-u/255,c[e+0]=Math.floor(t.r*l+n.r*u),c[e+1]=Math.floor(t.g*l+n.g*u),c[e+2]=Math.floor(t.b*l+n.b*u),c[e+3]=255;o.putImageData(s,0,0),document.getElementById("envmapImg").src=a.toDataURL("image/png")})},registerCurve:function(e){this.curve=e},registerPanel:function(e){this.panelMaterials.push(e)}}),AFRAME.registerComponent("materials",{schema:{animate:{default:!0},name:{default:""},recursive:{default:!0}},update:function(){if(""===this.data.name)return;if(this.material=this.system[this.data.name],!this.material)return void console.warn("[materials] Unknown material: "+this.data.name);let e=this.el.getObject3D("mesh");e?this.applyMaterial(e):this.el.addEventListener("object3dset",t=>{"mesh"===t.detail.type&&(e=this.el.getObject3D("mesh"),e&&this.applyMaterial(e))}),this.material.animate=this.data.animate},applyMaterial:function(e){e.detail&&(e=e.detail.model),this.data.recursive?e.traverse(e=>{"Mesh"===e.type&&(e.material=this.material)}):e.material=this.material}}),AFRAME.registerComponent("materials-color-menu",{play:function(){this.text=document.getElementById("colorName")},events:{mouseenter:function(e){this.text.setAttribute("text","value",e.target.dataset.colorName)},mouseleave:function(e){this.text.setAttribute("text","value","")},click:function(e){this.el.sceneEl.systems.materials.setColorScheme(e.target.dataset.colorScheme),this.el.sceneEl.emit("colorschemechange",e.target.dataset.colorScheme,!1)}}}),window.AFRAME){const t=["materials","materials-color-menu"],n=[],r=["materials"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec3 vWorldPos;\nvarying vec3 vPos;\nvarying vec3 vNormal;\n\nvoid main() {\n vNormal = normal;\n vPos = position;\n vWorldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="uniform sampler2D src;\nuniform float scale;\nvarying vec3 vPos;\nvarying vec3 vWorldPos;\nvarying vec3 vNormal;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 color3;\nuniform vec3 fogColor;\n\nvoid main() {\n vec3 pw = vWorldPos - cameraPosition;\n vec3 p = pw / scale;\n float pz = p.z * 0.3;\n\n // build color weights\n float f = clamp( (sin(p.x * 0.6 + pz ) + sin(p.y * 0.3 - pz)) * 0.3 + 0.17, 0.0, 1.0);\n float g = clamp( (sin(p.x * 0.7 + pz) + cos(p.y * 0.6 - 15.0) + sin(pz * 0.1)) * 0.25 + 0.15, 0.0, 1.0);\n float h = clamp( (sin(p.x * 0.4 + pz + 3.0) + cos(p.y * 0.8 - 5.0) + sin(pz * 0.3)) * 0.16 + 0.08, 0.0, 1.0);\n\n\n // mix colors using weights\n vec3 col = vec3(0.3);\n col = mix(col, color1, f);\n col = mix(col, color2, g);\n col = mix(col, color3, h);\n\n float fog = 1.0 - clamp(length(pw) / 180.0 - 0.1, 0.0, 1.0);\n\n // mix color with fog\n col = mix(fogColor, col, smoothstep(0.2, 0.9, fog));\n\n // calc shadow (using normal and fixed light pos + fade to black in y)\n float shadow = 0.5 + dot(vec3(0.0, 1.0, 1.0), vNormal) * 0.5;\n float shadowGrad = clamp((vPos.y + 2.0) / 6.0, 0.1, 1.0);\n // fade in fog\n shadow = mix(1.0, shadow, fog);\n shadowGrad = mix(1.0, shadowGrad, smoothstep(0.3, 1.0, fog));\n\n gl_FragColor = vec4(col * shadow * shadowGrad, smoothstep(0.3, 0.6, fog));\n //gl_FragColor = vec4(vec3(fog), 1.0);\n}"},function(e,t){e.exports="uniform float time;\nvarying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n float t = time * 0.0005;\n vec3 pos = position;\n pos.y += sin(t + uv.x * 3.0 + pos.x * 0.01) * 20.0;\n pos.y += sin(-t * 1.3 + uv.x * 7.0 + pos.x * 0.008) * 10.0;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( pos, 1.0 );\n}"},function(e,t){e.exports="uniform float time;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nvarying vec2 uvs;\n\nvoid main() {\n vec3 col = vec3(1.0);\n float t = time * 0.001;\n col *= 0.80 + sin(-t * 3.4 + 5.5 + uvs.x * 6.0) * 0.1;\n col *= 0.80 + sin(t * 1.4 + 0.5 + uvs.x * 12.0) * 0.2;\n col *= 0.80 + sin(t * 1.0 + 0.2 + uvs.x * 30.0) * 0.2;\n col *= 0.90 + sin(-t * 1.6 + 5.2 + uvs.x * 43.0) * 0.1;\n col *= 0.95 + sin(-t * 0.3 + 1.2 + uvs.x * 50.0) * 0.05;\n col *= 0.95 + sin(t * 0.8 + 1.2 + uvs.x * 80.0) * 0.05;\n col *= 0.94 + sin(-t + 0.1 + uvs.x * 180.0) * 0.01;\n col *= 0.90 + sin(t * 2.49 + 0.1 + uvs.x * 120.0) * 0.01;\n col *= 0.86 + sin(-t * 1.7 + 4.7 + uvs.x * 80.0) * 0.03;\n col *= 0.86 + sin(-t * 1.2 + 0.7 + uvs.x * 180.0) * 0.02;\n\n // border fades\n float alpha = 1.0;\n alpha *= 1.0 - smoothstep(0.0, 1.0, uvs.y);\n alpha *= smoothstep(0.0, 0.3, uvs.y);\n alpha *= sin(uvs.x * 3.141592);\n\n // colorize\n col = col * mix(colorPrimary, colorSecondary, uvs.y);\n gl_FragColor = vec4(col, alpha);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}"},function(e,t){e.exports="uniform float time;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\nvarying vec2 uvs;\n#define PI 3.14159265358979\n\nfloat pulse(float x, float t, float r){\n return 1.0 - smoothstep(0.0, r, abs((x - t)));\n}\n\nvoid main() {\n float t = time * 0.002;\n vec2 uv = uvs - 0.5;\n uv = vec2(-uv.y, uv.x);\n float d = length(uv);\n float f = pulse(d, 0.44, 0.012);\n float f2 = pulse(d, 0.44, 0.002);\n\n float g = pulse(d, 0.20, 0.01);\n float g1 = pulse(d, 0.20, 0.0018);\n\n float g2 = pulse(d, 0.21, 0.01);\n float g3 = pulse(d, 0.21, 0.0018);\n\n float ang = abs(atan(uv.y, uv.x)) / PI;\n float angalpha = sin(ang * 20.0 - t * 0.1) * 0.4 + 0.6;\n\n float sparks = pulse(angalpha, 0.4, 0.17) * (pulse(d, 0.435, 0.035) + pulse(d, 0.205, 0.026)) * 0.14;\n sparks += pulse(angalpha, 0.4, 0.2) * (pulse(d, 0.44, 0.002) + pulse(d, 0.2, 0.0018)) * 0.4;\n sparks *= sin(ang * 14.0 + t) * 0.5 + 0.5;\n vec3 col = mix(colorPrimary, colorSecondary, ang);\n col = mix (col, colorPrimary, g3);\n col = mix (col, colorSecondary, g1);\n col = mix (col, colorTertiary, sparks * 2.4);\n gl_FragColor = vec4(col, ((f + g + g2) * 0.1 + (f2 + g1 + g3) * 0.4) * angalpha + sparks);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D map;\nuniform vec3 tint;\n\nvoid main() {\n vec4 tex = texture2D(map, uvs);\n vec3 col = mix(tex.rgb * tint, tex.rgb, uvs.y);\n gl_FragColor = vec4(col, tex.a );\n}\n"},function(e,t){e.exports="uniform float time;\nvarying vec3 vWorldPos;\nvarying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n vWorldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n vec3 pos = vec3(position.x, position.y + sin(time * 0.002 - position.z) * 0.05 + 0.04, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvarying vec3 vWorldPos;\nuniform sampler2D src;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 color3;\n\nvoid main() {\n vec4 tex = texture2D(src, uvs);\n vec3 p = vWorldPos + cameraPosition;\n float pz = p.z * 0.36;\n float f = clamp( (sin(p.x + pz ) + sin(p.y - pz)) * 0.35 + 0.14, 0.0, 1.0);\n float g = clamp( (sin(p.x + pz + 2.0) + cos(p.y * 0.6 - 15.0) + sin(pz * 0.5)) * 0.3 + 0.1, 0.0, 1.0);\n float h = clamp( (sin(p.x * 0.7 + pz + 2.0) + cos(p.y * 0.8 - 5.0) + sin(pz * 0.8)) * 0.3 + 0.05, 0.0, 1.0);\n\n vec3 col = vec3(0.1);\n col = mix(col, color1, f);\n col = mix(col, color2, g);\n col = mix(col, color3, h);\n\n gl_FragColor = vec4((col * 1.5) * tex.r, 1.0);\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform float time;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform sampler2D color;\nuniform float time;\nuniform float opacity;\n\nvoid main() {\n vec2 uvanim = vec2(\n mod(uvs.x + sin(time / 20000.0), 1.0),\n mod(uvs.y + time / 2000.0, 1.0));\n vec4 texAlpha = texture2D(src, uvanim);\n float alpha = texAlpha.a * smoothstep(0.0, 0.5, uvs.y) * (1.0 - smoothstep(0.5, 1.0, uvs.y));\n gl_FragColor = vec4(texture2D(color, uvs).rgb, alpha * 0.7 * opacity);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying vec2 uvs;\n\nvoid main() {\n uvs = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying vec2 uvs;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\nuniform float pulse;\nuniform sampler2D src;\n\nvoid main() {\n vec3 colorize = vWorldPosition-cameraPosition;\n colorize = clamp(colorize + 0.5, vec3(0.0), vec3(1.0));\n vec3 col = mix(mix(colorPrimary, colorSecondary, colorize.x), colorTertiary, colorize.z);\n col += vec3(pulse) * 0.1;\n gl_FragColor = vec4 (col, texture2D(src, uvs).a);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("menu-controls",{schema:{enabled:{default:!0}},events:{thumbdownstart:function(){this.data.enabled&&this.el.sceneEl.emit("searchnextpage",null,!1)},thumbleftstart:function(){this.data.enabled&&this.el.sceneEl.emit("menuchallengeunselect",null,!1)},thumbupstart:function(){this.data.enabled&&this.el.sceneEl.emit("searchprevpage",null,!1)}}}),window.AFRAME){const t=["menu-controls"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-difficulty-select",{init:function(){this.el.sceneEl.addEventListener("menuchallengeselect",()=>{this.el.object3D.visible=!1,setTimeout(()=>{this.el.components.layout.update(),this.el.object3D.visible=!0},150)})},events:{click:function(e){this.el.sceneEl.emit("menudifficultyselect",e.target.closest(".difficultyOption").dataset.difficulty,!1)}}}),window.AFRAME){const t=["menu-difficulty-select"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-genre",{init:function(){this.el.addEventListener("click",e=>{this.el.sceneEl.emit("genreselect",e.target.closest(".genre").dataset.bindForKey)})}}),window.AFRAME){const t=["menu-genre"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-midsection",{schema:{active:{default:!1},selectedChallenge:{default:""}},update:function(e){e.active&&!this.data.active&&this.el.emit("hidedifficultysection",null,!1),(!e.active&&this.data.active||this.data.selectedChallenge&&e.selectedChallenge!==this.data.selectedChallenge)&&this.el.emit("showdifficultysection",null,!1)}}),window.AFRAME){const t=["menu-midsection"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0),i={classicvr:-.6,punchvr:.87,ride2d:.87,ridevr:.15,viewer2d:.15},a={classicvr:"classic",punchvr:"punch",ride2d:"ride",ridevr:"ride",viewer2d:"viewer"};if(AFRAME.registerComponent("menu-mode",{schema:{colorScheme:{default:"default"},hasVR:{default:!1}},init:function(){this.el.addEventListener("click",e=>{const t=e.target.closest("[data-mode]"),n=t.dataset.mode,r=t.dataset.name;this.el.sceneEl.emit("gamemode",n,!1),this.data.hasVR&&localStorage.setItem("gameMode",r),this.setModeOption(r)})},update:function(){this.data.hasVR?(this.setModeOption(localStorage.getItem("gameMode")||"punchvr"),this.el.sceneEl.emit("gamemode",a[localStorage.getItem("gameMode")||"punchvr"])):this.setModeOption("ride2d")},setModeOption:function(e){const t=this.el.querySelectorAll(".modeItem");document.getElementById("modeIcon").object3D.position.y=i[e];for(let n=0;n<t.length;n++){const i=t[n],a=i.dataset.name===e;i.emit(a?"select":"deselect",null,!1);const o=i.querySelector(".modeBackground");o.emit(a?"select":"deselect",null,!1),o.setAttribute("mixin","modeBackgroundSelect"+(a?"":" modeBackgroundHover"));i.querySelector(".modeThumb").emit(a?"select":"deselect",null,!1);i.querySelector(".modeTitle").setAttribute("text","color",a?r.WHITE:r.schemes[this.data.colorScheme].secondary);i.querySelector(".modeInstructions").setAttribute("text","color",a?r.WHITE:r.schemes[this.data.colorScheme].primary)}}}),window.AFRAME){const t=["menu-mode"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-playlist-button",{schema:{isFavorited:{default:!1},selectedChallenge:{default:""}},init:function(){const e=this.el;e.setAttribute("animation__scaleup",{property:"scale",from:"1 1 1",to:"1.2 1.2 1.2",dur:800,autoplay:!1,easing:"easeInOutElastic"}),e.setAttribute("animation__scaledown",{property:"scale",from:"1.2 1.2 1.2",to:"1 1 1",dur:100,autoplay:!1,easing:"easeInOutCubic"})},update:function(e){!e.isFavorited&&this.data.isFavorited&&e.selectedChallenge===this.data.selectedChallenge&&(this.el.object3D.position.z=.01,this.el.components.animation__scaleup.beginAnimation(),setTimeout(()=>{this.el.components.animation__scaledown.beginAnimation(),this.el.object3D.position.z=0},800))}}),window.AFRAME){const t=["menu-playlist-button"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-playlist",{init:function(){this.eventDetail={id:"",title:""},this.el.addEventListener("click",e=>{const t=e.target.closest(".playlist");this.eventDetail.id=t.dataset.playlist,this.eventDetail.title=t.dataset.title,this.el.sceneEl.emit("playlistselect",this.eventDetail)})}}),window.AFRAME){const t=["menu-playlist"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-selected-challenge-image",{schema:{coverURL:{type:"string"}},update:function(){this.el.setAttribute("material","src",this.data.coverURL)}}),window.AFRAME){const t=["menu-selected-challenge-image"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-slide-animation",{schema:{isSearching:{default:!1},menuSelectedChallengeId:{type:"string"}},init:function(){this.isLeft=!1},update:function(e){const t=this.data;if(this.isLeft)return!e.menuSelectedChallengeId||t.menuSelectedChallengeId||t.isSearching||this.rightMenu(),void(!e.isSearching||t.isSearching||t.menuSelectedChallengeId||this.rightMenu());this.isLeft||(!e.menuSelectedChallengeId&&t.menuSelectedChallengeId&&this.leftMenu(),!e.isSearching&&t.isSearching&&this.leftMenu())},rightMenu:function(){this.isLeft&&(this.el.components.animation__menuright.beginAnimation(),this.isLeft=!1)},leftMenu:function(){this.isLeft||(this.el.components.animation__menuleft.beginAnimation(),this.isLeft=!0)}}),window.AFRAME){const t=["menu-slide-animation"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r={0:0,1:.5,2:0,3:.25,4:.5,5:.75,6:0,7:.125,8:.25,9:.375,10:.5,11:.625,12:.75,13:.875};if(AFRAME.registerComponent("multiplier-ring",{dependencies:["geometry","material"],schema:{combo:{default:0},multiplier:{default:1}},init:function(){this.animationSet={from:void 0,to:void 0},this.progress=this.el.getObject3D("mesh").material.uniforms.progress,this.el.setAttribute("animation",{property:"components.material.material.uniforms.progress.value",dur:100,autoplay:!1})},update:function(){this.updateRing()},updateRing:function(){const e=this.data,t=this.el,n=this.progress;if(8===e.multiplier)return void(n.value=1);const i=this.animationSet;i.from=n.value,i.to=r[e.combo],t.setAttribute("animation",i),t.components.animation.beginAnimation()}}),window.AFRAME){const t=["multiplier-ring"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("no-frustum-cull",{init:function(){this.el.object3D.frustumCulled=!1}}),window.AFRAME){const t=["no-frustum-cull"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("panelShader",{schema:{activePanel:{type:"number",is:"uniform",default:0},brightness:{type:"number",is:"uniform",default:.3},borderWidth:{type:"number",is:"uniform",default:.004},borderRadius:{type:"number",is:"uniform",default:.15},colorPrimary:{type:"color",is:"uniform",default:i.a.initial.primary},colorSecondary:{type:"color",is:"uniform",default:i.a.initial.secondary},midSection:{type:"number",is:"uniform",default:0},opacity:{type:"number",is:"uniform",default:1},ratio:{type:"number",is:"uniform",default:.5},transparent:{default:!0}},vertexShader:n(136),fragmentShader:n(137),update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform"),this.el.sceneEl.systems.materials.registerPanel(this.material)}}),window.AFRAME){const t=[],n=["panelShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"},function(e,t){e.exports="#if __VERSION__ == 100\n #extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\n\n#define PI 3.141592\n#define DIFF_SECTION_WIDTH 0.06\n\nuniform float borderWidth;\nuniform float borderRadius;\nuniform float brightness;\nuniform float ratio;\nuniform float midSection;\nuniform float opacity;\nuniform float activePanel;\n\nvarying vec2 uvs;\n\nfloat sdBox( in vec2 p, in vec2 b )\n{\n vec2 d = abs(p)-b;\n return length(max(d,vec2(0.0))) + min(max(d.x,d.y), 0.0);\n}\n\nvoid main()\n{\n vec2 uv = uvs;\n vec2 uv2 = uv * 2.0 - 1.0; // from -1 to 1\n uv2.x *= ratio;\n\n vec3 col = mix(colorSecondary * uv.y, colorPrimary * uv.y, uv.x) * (brightness + activePanel * 0.4);\n vec3 borderCol = mix(colorSecondary, colorPrimary, uv.y);\n\n vec2 size = vec2(0.83 * ratio, 0.86) - borderRadius;\n float grad = sdBox(uv2, size) - borderRadius;\n grad = min(grad, sdBox(uv2 - size, vec2(borderRadius)));\n grad = min(grad, sdBox(uv2 + size, vec2(borderRadius)));\n grad = -grad;\n float aa = fwidth(grad);\n\n float isShape = smoothstep(-aa, 0.0, grad);\n float alpha = clamp(isShape + smoothstep(-0.15, 0.15, grad), 0.0, 1.0);\n float isBorder = smoothstep(-aa - borderWidth, aa - borderWidth, grad) - smoothstep(-aa + borderWidth, aa + borderWidth, grad);\n float mid = clamp(midSection, 0.0, 1.0);\n col *= 1.0 - mid * (step(0.5 - DIFF_SECTION_WIDTH * mid, uv.x) - step(0.5 + DIFF_SECTION_WIDTH * midSection, uv.x)) * 0.3;\n\n gl_FragColor = vec4(mix(col * isShape, borderCol, isBorder), alpha * opacity);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("pause",{schema:{isPaused:{default:!1}},update:function(){this.data.isPaused&&this.el.isPlaying?this.el.pause():this.data.isPaused||this.el.isPlaying||!this.el.sceneEl.isPlaying||this.el.play()}}),window.AFRAME){const t=["pause"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("pauser",{schema:{enabled:{default:!0}},init:function(){this.pauseGame=this.pauseGame.bind(this),document.addEventListener("keydown",e=>{27===e.keyCode&&this.pauseGame()}),this.el.sceneEl.addEventListener("controllerconnected",e=>{"vive-controls"===e.detail.name?this.el.addEventListener("menudown",this.pauseGame):(this.el.addEventListener("thumbstickdown",this.pauseGame),this.el.addEventListener("trackpaddown",this.pauseGame))}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.pauseGame()})},pauseGame:function(){this.data.enabled&&this.el.sceneEl.emit("pausegame",null,!1)}}),window.AFRAME){const t=["pauser"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r=n(141);if(AFRAME.registerSystem("play-sound",{init:function(){this.lastSoundPlayed="",this.lastSoundPlayedTime=0,this.pools={}},createPool:function(e,t){this.pools[e]||(this.pools[e]=new r(e,t))},playSound:function(e,t){this.pools[e]||this.createPool(e,t),this.pools[e].play(),this.lastSoundPlayed=e,this.lastSoundTime=this.el.time}}),AFRAME.registerComponent("play-sound",{schema:{enabled:{default:!0},event:{type:"string"},sound:{type:"string"},volume:{type:"number",default:1}},multiple:!0,init:function(){this.el.addEventListener(this.data.event,e=>{this.data.enabled&&this.system.playSound(this.src,this.data.volume)})},update:function(){this.src=this.data.sound,this.data.sound.startsWith("#")&&(this.src=document.querySelector(this.data.sound).getAttribute("src"))}}),window.AFRAME){const t=["play-sound"],n=[],r=["play-sound"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports=function(e,t){var n,r=0,i=[];return(n=new Audio(e)).volume=t,i.push(n),{play:function(){0===i[r].currentTime&&i[r].ended||((n=new Audio(e)).volume=t,i.push(n),r++),(0===i[r].currentTime||i[r].ended)&&i[r].play(),r=(r+1)%i.length}}}},function(e,t,n){function r(e,t){return e-t}if(AFRAME.registerComponent("player-height",{init:function(){this.beatOffset=0,this.heights=[],this.height=0,this.el.sceneEl.addEventListener("menuchallengeselect",this.updateHeight.bind(this)),this.el.sceneEl.addEventListener("playbuttonclick",this.updateHeight.bind(this))},pause:function(){this.heights.length=0},updateHeight:function(){const e=this.heights;e.length>3&&e.shift(),e.push(this.el.object3D.position.y),this.height=function(e){e.sort(r);const t=e.length/2;return t%1?e[t-.5]:(e[t-1]+e[t])/2}(e);const t=(n=this.height,i=1.6,a=2.2,Math.min(Math.max(n,i),a));var n,i,a,o,s;this.beatOffset=(s=0)+(.2-s)*(t-(o=1.6))/(2.2-o)}}),window.AFRAME){const t=["player-height"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("plume",{schema:{color:{default:""},cutDirection:{default:""},horizontalPosition:{default:"middleleft",oneOf:["left","middleleft","middleright","right"]},songPosition:{default:0},type:{default:"arrow",oneOf:["arrow","dot","mine"]},verticalPosition:{default:"middle",oneOf:["bottom","middle","top"]}},horizontalPositions:{left:-.95,middleleft:-.6,middleright:.6,right:.95},init:function(){this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.handsEls=this.el.sceneEl.querySelectorAll(".handStar"),this.handPos=new THREE.Vector3,this.verticalPositions=this.el.sceneEl.components["beat-system"].verticalPositions,this.el.sceneEl.addEventListener("cleargame",this.returnToPool.bind(this))},update:function(){"mine"===this.data.type?this.poolName="pool__plume-mine":this.poolName=`pool__plume-${this.data.type}-${this.data.color}`},onGenerate:function(e,t,n,r){this.data;const i=this.el,a=this.curveEl.components.supercurve;a.getPointAt(e,i.object3D.position),a.alignToCurve(e,i.object3D),i.object3D.position.x+=this.horizontalPositions[t],i.object3D.position.y+=this.verticalPositions[n]+r,i.object3D.rotation.z=Math.random()*Math.PI*2,this.songPosition=e},tock:function(){if(this.el.object3D.position.z>this.curveFollowRig.object3D.position.z+10)this.returnToPool();else for(let e=0;e<this.handsEls.length;e++){const t=this.handsEls[e];t.object3D.getWorldPosition(this.handPos),this.handPos.distanceToSquared(this.el.object3D.position)<.2&&t.emit("plumepulse")}},returnToPool:function(){this.el.object3D.position.set(0,0,-9999),this.el.object3D.visible=!1,this.el.isPlaying&&this.el.sceneEl.components[this.poolName].returnEntity(this.el)}}),window.AFRAME){const t=["plume"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("punch",{schema:{enabled:{default:!1}},init:function(){this.currentPos=new THREE.Vector3,this.direction=0,this.lastSample=new THREE.Vector3,this.lastSampleTime=0,this.speed=0,this.bbox=new THREE.Box3,this.bboxEl=this.el.querySelector(".punchBbox")},play:function(){this.rig=this.el.closest("#curveFollowRig")},tick:function(e,t){this.data.enabled&&(this.direction=this.currentPos.copy(this.el.object3D.position).sub(this.lastSample),this.speed=this.direction.length()/((e-this.lastSampleTime)/1e3),this.lastSample.copy(this.el.object3D.position),this.lastSampleTime=e)},tickBeatSystem:function(){this.bbox.setFromObject(this.bboxEl.getObject3D("mesh"))},checkCollision:function(){const e=new THREE.Box3,t=new THREE.Vector3(0,0,.2);return function(n){return e.copy(n.bbox).translate(n.el.object3D.position).expandByScalar(.1).expandByVector(t),this.bbox.intersectsBox(e)}}()}),window.AFRAME){const t=["punch"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r,i;if(AFRAME.registerComponent("raycaster-target",{schema:{bindToggle:{default:""},depth:{type:"number"},height:{type:"number"},position:{type:"vec3",default:{x:0,y:0,z:0}},rotation:{type:"vec3",default:{x:0,y:0,z:0}},useBoxTarget:{default:!1},width:{type:"number"}},init:(r={primitive:"box"},i={primitive:"plane"},function(){var e,t,n=this.data,a=this.el;(t=document.createElement("a-entity")).classList.add("raycasterTarget"),n.bindToggle?t.setAttribute("bind-toggle__raycastable",n.bindToggle):t.setAttribute("data-raycastable",""),n.useBoxTarget?((e=r).depth=n.depth,e.height=n.height,e.width=n.width):((e=i).height=n.height,e.width=n.width),t.setAttribute("geometry",e),t.object3D.visible=!1,t.object3D.position.copy(n.position),t.object3D.rotation.x=THREE.Math.degToRad(n.rotation.x),t.object3D.rotation.y=THREE.Math.degToRad(n.rotation.y),t.object3D.rotation.z=THREE.Math.degToRad(n.rotation.z),a.appendChild(t)})}),window.AFRAME){const t=["raycaster-target"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r,i,a,o;if(AFRAME.registerComponent("recenter",{schema:{enabled:{default:!0}},init:function(){this.el.sceneEl;this.recenter=this.recenter.bind(this),document.querySelectorAll("[tracked-controls]").forEach(e=>{e.addEventListener("menudown",this.recenter),e.addEventListener("thumbstickdown",this.recenter)}),this.el.addEventListener("recenter",this.recenter)},recenter:(r=new THREE.Euler,i=new THREE.Matrix4,a=new THREE.Matrix4,o=new THREE.Matrix4,function(){const e=this.el;if(!this.data.enabled)return;const t=e.sceneEl.camera.el.object3D;i.identity(),r.set(0,-1*t.rotation.y,0),a.makeRotationFromEuler(r),o.makeTranslation(-1*t.position.x,0,-1*t.position.z),i.multiply(a).multiply(o),i.decompose(e.object3D.position,e.object3D.quaternion,e.object3D.scale),e.object3D.updateMatrixWorld(!0),e.emit("recentered",null,!1)})}),window.AFRAME){const t=["recenter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("ring",{schema:{blur:{default:.01,is:"uniform"},color:{type:"color",is:"uniform"},progress:{default:0,is:"uniform"},radiusInner:{default:.6,is:"uniform"},radiusOuter:{default:1,is:"uniform"}},vertexShader:n(148),fragmentShader:n(149)}),window.AFRAME){const t=[],n=["ring"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 vUv;\n\nvoid main () {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="#if __VERSION__ == 100\n #extension GL_OES_standard_derivatives : enable\n#endif\n#define PI 3.14159265358979\nuniform float blur;\nuniform float progress;\nuniform float radiusInner;\nuniform float radiusOuter;\nuniform vec3 color;\n\nvarying vec2 vUv;\n\nvoid main () {\n // make uvs go from -1 to 1\n vec2 uv = vec2(vUv.x * 2.0 - 1.0, vUv.y * 2.0 - 1.0);\n // calculate distance of fragment to center\n float r = uv.x * uv.x + uv.y * uv.y;\n // calculate antialias\n float aa = fwidth(r);\n // make full circle (radiusOuter - radiusInner)\n float col = (1.0 - smoothstep(radiusOuter - aa, radiusOuter + blur + aa, r)) * smoothstep(radiusInner - aa, radiusInner + blur + aa, r);\n // radial gradient\n float a = smoothstep(-PI-aa, PI+aa, atan(uv.y, uv.x));\n // progress angle\n float p = 1.0 - progress - blur;\n // apply progress to full circle (1 for done part, 0 for part to go)\n col *= smoothstep(p, p + blur, a);\n // multiply by user color\n gl_FragColor = vec4(color * col, col);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("score-texts",{schema:{isLoading:{default:!1}},init:function(){this.textEls=this.el.querySelectorAll("[text]");for(let e=0;e<this.textEls.length;e++)this.textEls[e].setAttribute("animation__fadein",{autoplay:!1,property:"components.text.material.uniforms.opacity.value",delay:250,dur:750,easing:"easeInOutCubic",from:0,to:1})},update:function(e){if(e.isLoading&&!this.data.isLoading){for(let e=0;e<this.textEls.length;e++)this.textEls[e].components.animation__fadein.beginAnimation();this.el.sceneEl.emit("textglownormal",null,!1)}if(!e.isLoading&&this.data.isLoading){for(let e=0;e<this.textEls.length;e++)this.textEls[e].components.text.material.uniforms.opacity.value=0;this.el.sceneEl.emit("textglowoff",null,!1)}}}),window.AFRAME){const t=["score-texts"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);n(6);if(AFRAME.registerComponent("search-thumbnail-atlas",{dependencies:["geometry","material"],schema:{dummyUpdater:{type:"string"}},init:function(){const e=this.canvas=document.createElement("canvas");e.setAttribute("id","thumbnailAtlasMap"),e.height=512,e.width=64,e.style.visibility="hidden",this.ctx=e.getContext("2d"),this.clearCanvas(),document.body.appendChild(e);const t=this.alphaCanvas=document.createElement("canvas");t.setAttribute("id","thumbnailAlphaMap"),t.height=512,t.width=64,t.style.visibility="hidden",this.alphaCtx=t.getContext("2d"),document.body.appendChild(t),this.el.components.material.material.alphaMap=new THREE.CanvasTexture(t),this.el.setAttribute("material","src",e),this.images=[],this.lastNumResults=6},update:function(){const e=this.el.sceneEl.systems.state.state.searchResultsPage;for(let t=0;t<e.length;t++){let n=this.images[t]=this.images[t]||document.createElement("img");n.crossOrigin="anonymous",n.src=e[t].coverURL,n.complete?this.draw(n,t):n.onload=()=>{this.draw(n,t)}}e.length!==this.lastNumResults&&this.updateAlphaMap(e.length),this.lastNumResults=e.length},draw:function(e,t){this.ctx.drawImage(e,0,t*(512/384*64),64,512/384*64),this.el.getObject3D("mesh").material.map.needsUpdate=!0},clearCanvas:function(){const e=this.canvas;this.ctx.fillStyle="#111",this.ctx.fillRect(0,0,e.width,e.height)},updateAlphaMap:function(e){const t=this.alphaCanvas,n=this.alphaCtx;n.fillStyle="#FFF",n.fillRect(0,0,t.width,t.height),n.fillStyle="#000",n.fillRect(0,e*(512/384*64),t.width,t.height-e*(512/384*64)),this.el.getObject3D("mesh").material.alphaMap.needsUpdate=!0,this.el.getObject3D("mesh").material.needsUpdate=!0}}),window.AFRAME){const t=["search-thumbnail-atlas"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(153),i=n(28),a=n(154).map(i);if(AFRAME.registerComponent("search",{schema:{difficultyFilter:{default:"All"},genre:{default:""},playlist:{default:""},query:{default:""}},init:function(){this.eventDetail={query:"",results:a,url:"",page:0},this.keyboardEl=document.getElementById("keyboard"),this.popularHits=a,function(e){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}}(this.popularHits),this.queryObject={hitsPerPage:0,query:""},this.el.sceneEl.addEventListener("searchclear",()=>{this.search("")})},update:function(e){this.popularHits&&(e.query&&!this.data.query&&(this.keyboardEl.components["super-keyboard"].data.value="",this.keyboardEl.components["super-keyboard"].updateTextInput("")),this.debouncedSearch=r(this.search.bind(this),1e3),(this.data.genre||this.data.playlist||this.data.query)&&this.search(this.data.query))},play:function(){this.el.sceneEl.emit("searchresults",this.eventDetail),this.search("")},events:{superkeyboardchange:function(e){e.target===this.el&&this.debouncedSearch(e.detail.value)}},search:function(e){if(!e&&"All"===this.data.difficultyFilter&&!this.data.genre&&!this.data.playlist&&this.popularHits)return this.eventDetail.results=this.popularHits,this.eventDetail.query="",void this.el.sceneEl.emit("searchresults",this.eventDetail);if(this.eventDetail.query=e,this.queryObject.query=e,this.queryObject.hitsPerPage=e?30:150,"favorites"===this.data.playlist)return this.eventDetail.results=JSON.parse(localStorage.getItem("favorites-v2")),void this.el.sceneEl.emit("searchresults",this.eventDetail);let t="https://api.beatsaver.com/search/text/CURRENT_PAGE_INDEX?sortOrder=Rating&automapper=true&q="+encodeURIComponent(e);if(this.data.playlist)t=`https://api.beatsaver.com/playlists/id/${this.data.playlist}/CURRENT_PAGE_INDEX`;else if(this.data.genre){const e={Pop:"pop","R&B":"rb",Rap:"hip-hop-rap",Rock:"rock",Soundtrack:"tv-movie-soundtrack","Video Games":"video-game-soundtrack",Electronic:"electronic","Hip Hop":"hip-hop-rap",House:"house","J-Pop":"j-pop","K-Pop":"k-pop",Meme:"comedy-meme",Alternative:"alternative",Anime:"anime",Comedy:"comedy-meme",Dubstep:"dubstep",Dance:"dance"}[this.data.genre];t="https://api.beatsaver.com/search/text/CURRENT_PAGE_INDEX?sortOrder=Rating&automapper=true&tags="+encodeURIComponent(e)}else if(e&&e.length<3)return;fetch(t.replaceAll("CURRENT_PAGE_INDEX",0)).then(e=>e.json()).then(e=>{var n=(e.docs||e.maps).map(i);this.eventDetail.results=n,this.eventDetail.url=t,this.eventDetail.urlPage=0,this.el.sceneEl.emit("searchresults",this.eventDetail)})}}),AFRAME.registerComponent("search-result-list",{init:function(){new MutationObserver(e=>{for(let t=0;t<e.length;t++)"data-index"===e[t].attributeName&&this.refreshLayout()}).observe(this.el,{attributes:!0,childList:!1,subtree:!0})},events:{click:function(e){this.el.sceneEl.emit("menuchallengeselect",e.target.closest(".searchResult").dataset.id,!1)}},refreshLayout:function(){this.el.emit("layoutrefresh",null,!1)}}),window.AFRAME){const t=["search","search-result-list"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,l=s||c||Function("return this")(),u=Object.prototype.toString,h=Math.max,d=Math.min,p=function(){return l.Date.now()};function f(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(f(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=f(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=i.test(e);return s||a.test(e)?o(e.slice(2),s?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,a,o,s,c,l=0,u=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n)}function b(e){return l=e,s=setTimeout(A,t),u?v(e):o}function w(e){var n=e-c;return void 0===c||n>=t||n<0||g&&e-l>=a}function A(){var e=p();if(w(e))return E(e);s=setTimeout(A,function(e){var n=t-(e-c);return g?d(n,a-(e-l)):n}(e))}function E(e){return s=void 0,y&&r?v(e):(r=i=void 0,o)}function x(){var e=p(),n=w(e);if(r=arguments,i=this,c=e,n){if(void 0===s)return b(c);if(g)return s=setTimeout(A,t),v(c)}return void 0===s&&(s=setTimeout(A,t)),o}return t=m(t)||0,f(n)&&(u=!!n.leading,a=(g="maxWait"in n)?h(m(n.maxWait)||0,t):a,y="trailing"in n?!!n.trailing:y),x.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=c=i=s=void 0},x.flush=function(){return void 0===s?o:E(p())},x}}).call(this,n(1))},function(e,t){e.exports=[{id:"43a25",name:"[Extra Sensory II] Porter Robinson - Lifelike",description:"// MAP 3 OF EXTRA SENSORY II\n[ https://beatsaver.com/playlists/797071 ]\n\nthis is only the beginning...*\n\nVideo:\nhttps://www.youtube.com/watch?v=dlqYqNKcLII",uploader:{id:4340055,name:"nasafrasa",avatar:"https://cdn.beatsaver.com/avatar/16a6108559271b0c0a8d254ceb5ad43f896a0a28.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4340055/playlist"},metadata:{bpm:100.72,duration:96,songName:"Lifelike",songSubName:"",songAuthorName:"Porter Robinson",levelAuthorName:"nasafrasa"},stats:{plays:0,downloads:0,upvotes:3632,downvotes:14,score:.9918,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.030128Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0",state:"Published",createdAt:"2025-01-26T05:53:34.451213Z",sageScore:5,diffs:[{njs:16,offset:0,notes:123,bombs:0,obstacles:0,nps:1.564,length:132,characteristic:"Standard",difficulty:"Easy",events:77,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:78.634,paritySummary:{errors:0,warns:0,resets:0},maxScore:106395,label:"Nurture",environment:"BillieEnvironment"},{njs:16,offset:0,notes:145,bombs:0,obstacles:0,nps:1.844,length:132,characteristic:"Standard",difficulty:"Normal",events:77,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:78.634,paritySummary:{errors:0,warns:0,resets:0},maxScore:128235,label:"Lifelike",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.zip",coverURL:"https://eu.cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.jpg",previewURL:"https://eu.cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2025-01-27T00:42:00.509882Z",createdAt:"2025-01-26T05:53:34.451213Z",updatedAt:"2025-11-07T23:01:19.839738Z",lastPublishedAt:"2025-01-26T23:35:01.030128Z",tags:["accuracy","balanced","ambient","classical-orchestral"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"43a1f",name:"[Extra Sensory II] Simplifi - you",description:"// MAP 4 OF EXTRA SENSORY II\n[ https://beatsaver.com/playlists/797071 ]\n\n====================================================\n\neverything you see in this map was created (from scratch!) by me\n\nlong time coming. this map represents the end of a chapter, and the start of a new one. I've been dreaming of releasing a map with Vivify almost as long as I've been a Beat Saber creative. I was stuck for so long, but I finally had a breakthrough!\n\nand it's yours to keep.\n\n====================================================\n\nproject source: https://github.com/Swifter1243/you_map\ngameplay video: https://youtu.be/2SgLtmqxu-k \nExtra Sensory II website: https://exsii.totalbs.dev/",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:70,duration:157,songName:"you",songSubName:"",songAuthorName:"Simplifi",levelAuthorName:"Swifter"},stats:{plays:0,downloads:0,upvotes:5380,downvotes:28,score:.9914,reviews:35,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.797228Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d265d40935983502ad6f05ddeb5417f3e37c2290",state:"Published",createdAt:"2025-01-26T04:23:47.346441Z",sageScore:3,diffs:[{njs:8,offset:-.25,notes:160,bombs:0,obstacles:0,nps:1.106,length:168.75,characteristic:"Standard",difficulty:"Normal",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:144.643,paritySummary:{errors:0,warns:0,resets:0},maxScore:140835,environment:"BillieEnvironment"},{njs:8,offset:-.25,notes:160,bombs:0,obstacles:0,nps:1.106,length:168.75,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:144.643,paritySummary:{errors:0,warns:0,resets:0},maxScore:140675,environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.zip",coverURL:"https://eu.cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.jpg",previewURL:"https://eu.cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.mp3"}],curator:{id:4331555,name:"TheBlackParrot",avatar:"https://cdn.beatsaver.com/avatar/213097af5fb746f71825aad761723951ce4807ab.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4331555/playlist"},curatedAt:"2025-01-26T23:47:25.274685Z",createdAt:"2025-01-26T04:23:47.346441Z",updatedAt:"2025-02-09T02:00:19.217070Z",lastPublishedAt:"2025-01-26T23:35:01.797228Z",tags:["electronic","accuracy"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b6",name:"[Electro Swing Pack] The Electric Swing Circus - Empires",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/WJy6_2cTPYg\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:120,duration:173,songName:"Empires",songSubName:"",songAuthorName:"The Electric Swing Circus",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:5096,downvotes:31,score:.9905,reviews:2},uploaded:"2021-07-08T15:24:55.769Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cecc89118b3a75ea7d65ceff5949b3ef19fea716",key:"1a0b6",state:"Published",createdAt:"2021-07-08T15:24:55.769Z",sageScore:4,diffs:[{njs:16,offset:-.5,notes:522,bombs:0,obstacles:24,nps:3.173,length:329,characteristic:"Standard",difficulty:"Expert",events:2051,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:472995,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:823,bombs:0,obstacles:0,nps:5.003,length:329,characteristic:"Standard",difficulty:"ExpertPlus",events:2051,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:749915,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.zip",coverURL:"https://eu.cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.jpg",previewURL:"https://eu.cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.mp3"}],curator:{id:57657,name:"Pixelguy",hash:"5cff0b7698cc5a672c8541a8",avatar:"https://cdn.beatsaver.com/avatar/57657.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/57657/playlist"},curatedAt:"2021-07-08T15:24:55.769Z",createdAt:"2021-07-08T15:24:55.769Z",updatedAt:"2024-11-02T11:17:18.878282Z",lastPublishedAt:"2021-07-08T15:24:55.769Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1e6ff",name:"{Modchart} acloudyskye - Somewhere Out There",description:"MAP 10. https://beatsaver.com/playlists/8713\n\nWhat can I say about this map.\n\nI feel like this is the culmination of everything thats happened for modcharting this entire year. All of the advancements I've made with environments, mawntee has made with notemods, and reddek has made with walls come together into this piece that I can only describe as the next step. \n\nI really hope everyone enjoys this one. It's one of a kind.\n\nVideo: https://www.youtube.com/watch?v=rphHsDxJbpg",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:160,duration:323,songName:"Somewhere Out There",songSubName:"",songAuthorName:"acloudyskye",levelAuthorName:"Swifter, Mawntee, Reddek"},stats:{plays:0,downloads:0,upvotes:20023,downvotes:170,score:.9901,reviews:34,sentiment:"VERY_POSITIVE"},uploaded:"2021-11-30T01:27:30.018531Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"448d219117992026eb23c98dc920ce73a912f289",state:"Published",createdAt:"2022-09-26T15:58:45.498795Z",sageScore:1,diffs:[{njs:19,offset:-.5,notes:892,bombs:8,obstacles:3746,nps:2.973,length:800,characteristic:"Standard",difficulty:"Expert",events:38114,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:300,paritySummary:{errors:0,warns:0,resets:0},maxScore:813395,label:"Experience Recommended",environment:"BTSEnvironment"},{njs:19,offset:-.5,notes:1134,bombs:8,obstacles:3530,nps:3.78,length:800,characteristic:"Lawless",difficulty:"ExpertPlus",events:38114,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:300,paritySummary:{errors:719,warns:26,resets:1},maxScore:1036035,label:"Busier Mapping",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.zip",coverURL:"https://eu.cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.jpg",previewURL:"https://eu.cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.mp3"}],curator:{id:4284942,name:"blackjack",hash:"5e96ca3a16c96800062400fe",avatar:"https://cdn.beatsaver.com/avatar/dcd6d334252b91670180855821886983a1818f4a.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284942/playlist"},curatedAt:"2021-11-30T01:27:30.018531Z",createdAt:"2021-11-30T01:03:02.982731Z",updatedAt:"2023-08-26T19:08:38.528705Z",lastPublishedAt:"2022-09-26T16:01:29.467930Z",tags:["pop","balanced"],bookmarked:!1,collaborators:[{id:4233941,name:"reddek",hash:"5dbfb4426dea0b0006bd328d",avatar:"https://cdn.beatsaver.com/avatar/fc462a26fa97d9b2fdadbdf5d7a45ef75026f8e9.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4233941/playlist"},{id:4285959,name:"Mawntee",hash:"5cff0b7698cc5a672c854ca6",avatar:"https://cdn.beatsaver.com/avatar/e373d502d75ed37d9cc60d2aa58b08f8ab6ebc90.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285959/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"d7fa",name:"Geoxor - Gloom [Wallmap]",description:"REUPLOAD due to last minute mapping error\n\nSpecial thanks to:\nNyri0 - For providing scripts that were crucial to making this map possible, and for helping me along the way.\nLayanmeta - For giving me so much encouragement throughout the final stages and making a brilliant YouTube video on this map.\nBSMG discord - For the continued support throughout the development process\nAll you people/birds - For playing my map :D\n\nBRIAN HAS BECOME SENTIENT. ALL HAIL BRIAN",uploader:{id:18761,name:"minething",hash:"5e9b4ead16c9680006287387",avatar:"https://www.gravatar.com/avatar/f9bed76044f22e33e287d984993c59797049f1315d399c641b1ea7778975c926?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/18761/playlist"},metadata:{bpm:93,duration:167,songName:"Gloom",songSubName:"",songAuthorName:"Geoxor",levelAuthorName:"Mine Thing"},stats:{plays:0,downloads:0,upvotes:9917,downvotes:81,score:.9896,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2020-08-16T19:13:40.774Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"823b4e880baac024728ae96a7c20e28026c4585d",key:"d7fa",state:"Published",createdAt:"2020-08-16T19:13:40.774Z",sageScore:3,diffs:[{njs:12,offset:6,notes:0,bombs:0,obstacles:15605,nps:0,length:0,characteristic:"Standard",difficulty:"Easy",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Lightshow",environment:"RocketEnvironment"},{njs:12,offset:6,notes:202,bombs:0,obstacles:15605,nps:1.309,length:239.125,characteristic:"Standard",difficulty:"Hard",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.274,paritySummary:{errors:48,warns:6,resets:0},maxScore:178595,environment:"RocketEnvironment"},{njs:12,offset:6,notes:411,bombs:4,obstacles:15605,nps:2.665,length:239,characteristic:"Standard",difficulty:"Expert",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.194,paritySummary:{errors:0,warns:0,resets:1},maxScore:370875,environment:"RocketEnvironment"},{njs:12,offset:3,notes:411,bombs:4,obstacles:12340,nps:2.665,length:239,characteristic:"Standard",difficulty:"ExpertPlus",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.194,paritySummary:{errors:0,warns:0,resets:1},maxScore:370875,label:"Less Lag",environment:"RocketEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.zip",coverURL:"https://eu.cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.jpg",previewURL:"https://eu.cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-08-16T19:13:40.774Z",createdAt:"2020-08-16T19:13:40.774Z",updatedAt:"2020-08-16T19:13:40.774Z",lastPublishedAt:"2020-08-16T19:13:40.774Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"43a24",name:"[Extra Sensory II] Andrew Prahlow - End Times",description:"// MAP 2 OF EXTRA SENSORY II\n[https://beatsaver.com/playlists/797071]\n\n=================================================\n\nFirst off, I just want to say thank you. Thank you to the entire TotalBS team (Especially Swifter and Aeroluna) for giving me a chance with this project. When I started on this map, I honestly never thought it would turn into anything like this. At first, it was just going to be something simple with the sun, stars, and you. But as I kept learning more about Unity and Vivify, the project just kept growing little by little, until it became what it is now.\n\nI’ve gotta give a special shoutout to Swifter for helping so much with the shaders, and to Aeroluna for making the custom UI possible. Without those two, this map would not have been able to become what it is now.\n\nOver the past year or so working on this, I feel like my goals and what I want in life have completely shifted. I’ve got more drive and motivation now than I’ve ever had before, and I’m so thankful for that.\n\nI'd like to also thank my closest friend, Azushii, for introducing me to Outer Wilds and encouraging me to start this map in the first place. Rest in peace buddy.. <3\n\n=================================================\nCustom Saber Model: [Coming Soon]\nCustom Note Model: [Coming Soon]\nProject Source: [Coming Soon]\nGameplay Video: https://youtu.be/YtETILVC4V4\nExtra Sensory II Website: https://exsii.totalbs.dev/",uploader:{id:70911,name:"Chaimzy",hash:"605ae0535ab13d000609b331",avatar:"https://cdn.beatsaver.com/avatar/70911.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/70911/playlist"},metadata:{bpm:128,duration:157,songName:"End Times",songSubName:"Outer Wilds",songAuthorName:"Andrew Prahlow",levelAuthorName:"Chaimzy"},stats:{plays:0,downloads:0,upvotes:3127,downvotes:20,score:.9889,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.057933Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b4acc042f6541c06e57a384fa9796a10c45ff558",state:"Published",createdAt:"2025-01-26T05:32:44.984680Z",sageScore:3,diffs:[{njs:16,offset:0,notes:32,bombs:8,obstacles:0,nps:.533,length:128,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:60,paritySummary:{errors:0,warns:0,resets:0},maxScore:22195,label:"There's more to explore here",environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.zip",coverURL:"https://eu.cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.jpg",previewURL:"https://eu.cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.mp3"}],curator:{id:4286182,name:"MadChase",avatar:"https://cdn.beatsaver.com/avatar/99feaf0fe97b6c67dde2ae7ba055fab744b0ac61.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286182/playlist"},curatedAt:"2025-01-27T00:06:25.521273Z",createdAt:"2025-01-26T05:32:44.984680Z",updatedAt:"2025-01-30T01:51:28.961316Z",lastPublishedAt:"2025-01-26T23:35:01.057934Z",tags:["accuracy","ambient","video-game-soundtrack"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"d4a5",name:"[FUTURE FUNK PACK] Shiawase No Monosashi (VANTAGE // Short Ver.)",description:'FUTURE FUNK MAP PACK\n2 songs uploaded everyday through August 10th - 14th!\n\n"Shiawase No Monosashi" is performed by Mariya Takeuchi. This version of the song is a short edit I made from VANTAGE //\'s edit. The original length of the song is 5 minutes long\n\nPlease look forward to the upcoming maps!\n\nDM any feedback on Discord\nETAN#8341',uploader:{id:4235140,name:"ETAN",hash:"5cff0b7798cc5a672c855775",avatar:"https://cdn.beatsaver.com/avatar/652a9b5d335007c8668b43aa727c75e84794dbe1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4235140/playlist"},metadata:{bpm:128,duration:171,songName:"Shiawase No Monosashi",songSubName:"(VANTAGE // Short Ver.)",songAuthorName:"Mariya Takeuchi",levelAuthorName:"ETAN"},stats:{plays:0,downloads:0,upvotes:9325,downvotes:95,score:.9876,reviews:2},uploaded:"2020-08-12T18:17:44.285Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d7cb32f23041dec272de3da0ac141dd8f91478ca",key:"d4a5",state:"Published",createdAt:"2020-08-12T18:17:44.285Z",sageScore:7,diffs:[{njs:10,offset:1,notes:168,bombs:16,obstacles:1,nps:1.029,length:348.25,characteristic:"Standard",difficulty:"Easy",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:0,warns:0,resets:0},maxScore:147315,environment:"BigMirrorEnvironment"},{njs:11,offset:1,notes:255,bombs:16,obstacles:1,nps:1.562,length:348.25,characteristic:"Standard",difficulty:"Normal",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:1,warns:1,resets:0},maxScore:227355,environment:"BigMirrorEnvironment"},{njs:12,offset:1,notes:358,bombs:16,obstacles:1,nps:2.193,length:348.25,characteristic:"Standard",difficulty:"Hard",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:0,warns:0,resets:0},maxScore:322115,environment:"BigMirrorEnvironment"},{njs:15,offset:0,notes:557,bombs:16,obstacles:1,nps:3.335,length:356.25,characteristic:"Standard",difficulty:"Expert",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:166.992,paritySummary:{errors:0,warns:0,resets:0},maxScore:505195,environment:"BigMirrorEnvironment"},{njs:19,offset:-.5,notes:778,bombs:16,obstacles:1,nps:4.659,length:356.25,characteristic:"Standard",difficulty:"ExpertPlus",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:166.992,paritySummary:{errors:0,warns:0,resets:0},maxScore:708515,environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.zip",coverURL:"https://eu.cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.jpg",previewURL:"https://eu.cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-08-12T18:17:44.285Z",createdAt:"2020-08-12T18:17:44.285Z",updatedAt:"2020-08-12T18:17:44.285Z",lastPublishedAt:"2020-08-12T18:17:44.285Z",tags:["j-pop","house"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4968d",name:"{Vivify} Jaron - 743⁺Aether*✧ ˳ ⁎ ¹¹¹} ⁺ . ˳",description:"**Originally, this map was going to be my Extra Sensory II map.**\n\nHowever, given the insane density of this song, it demanded rapidly changing visuals that kept up with how dynamic it felt to listen to. I did not have the technical or artistic skill to pull off this song. I tried and failed, for 3 years. Finally, after executing Extra Sensory II this year, I realized it was time to tackle this behemoth of a project. This project took over ~350 hours, and 1000 repository commits. The majority of it was put together over the last 3 months.\n\nI really think that I executed on this vision to a tee, landing every single visual cue that I imagined ever since I heard the song for the first time in 2022. I hope you can feel the electricity of this experience <3\n\n✧\n\n**Special Thanks:**\n- **Frautcres** - Doing extensive technical performance investigations in order to make the map run without a hitch, as well as assisting with technical difficulties\n- **Chaimzy, Astra, HAMCORE, Mawntee, TheBlackParrot, TinyPawb, Klondike, RidgeVR, UGEcko** - Doing loads of playtesting and giving feedback to make the map feel as polished as it does\n- **SKYZA.** - Beautiful ribbon & saber textures\n- **Jaron** - Creating this incredible song, and supporting me over the years as I tried to make visuals that shaped up\n\nvideo: https://youtu.be/qZ1prxep0Wc\nproject source: https://github.com/Swifter1243/aether_map",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:145,duration:274,songName:"743+Aether*✧ . * 111} + , .",songSubName:"",songAuthorName:"Jaron",levelAuthorName:"Swifter"},stats:{plays:0,downloads:0,upvotes:2252,downvotes:15,score:.9876,reviews:34,sentiment:"VERY_POSITIVE"},uploaded:"2025-08-14T16:00:00.354832Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cc66335f2b8bf50fe49591dd925860b2e596018e",state:"Published",createdAt:"2025-08-14T16:13:20.156249Z",sageScore:3,diffs:[{njs:12,offset:-.5,notes:444,bombs:0,obstacles:0,nps:1.698,length:632,characteristic:"Standard",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:261.517,paritySummary:{errors:0,warns:0,resets:0},maxScore:401235,label:"✧",environment:"BillieEnvironment"},{njs:16,offset:-.5,notes:703,bombs:0,obstacles:0,nps:2.688,length:632,characteristic:"Lawless",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:261.517,paritySummary:{errors:0,warns:0,resets:0},maxScore:639515,label:"\\___*",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.zip",coverURL:"https://eu.cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.jpg",previewURL:"https://eu.cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.mp3"}],curator:{id:4285538,name:"Darkrealm7",hash:"5ffa2803f2cdd000075e24ed",avatar:"https://cdn.beatsaver.com/avatar/7b66a32ba61dcfb938aa0d2207911eb08d28a06f.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285538/playlist"},curatedAt:"2025-08-14T21:11:11.210516Z",createdAt:"2025-08-14T04:02:49.366190Z",updatedAt:"2025-08-20T16:41:30.561039Z",lastPublishedAt:"2025-08-20T16:41:30.561039Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1362d",name:"Ghost Choir - Louie Zong (modchart)",description:"This is a relaxing modchart and a technical proof of concept. If you haven't played my modchart Dondante yet, please check it out: https://beatsaver.com/beatmap/123b5\r\n\r\nThe map requires the mods Noodle Extensions and Chroma. If Noodle Extensions is not available yet on ModAssistant, you can get the latest release at https://github.com/Aeroluna/NoodleExtensions/releases/tag/v1.3.5\r\n\r\nTips for a better experience:\r\n- Disable static lights; there are no lights anyway\r\n- Hide the HUD\r\n- Turn the SFX volume down (0 or low value like 0.2)\r\n- Enable bloom post-processing\r\n\r\nPreview: https://youtu.be/XC7RY9C_EHs\r\n\r\nI adapted this from Louie Zong's original animation: https://youtu.be/kXF3VYYa5TI\r\n\r\n",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:67,duration:90,songName:"Ghost Choir",songSubName:"",songAuthorName:"Louie Zong",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:4478,downvotes:42,score:.987,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2021-01-30T12:31:29.825Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"1d373506c0b2b82867411f18696a1ad53d4ea01d",key:"1362d",state:"Published",createdAt:"2021-01-30T12:31:29.825Z",sageScore:2,diffs:[{njs:14,offset:0,notes:138,bombs:0,obstacles:1460,nps:1.684,length:91.5,characteristic:"Standard",difficulty:"Hard",events:5,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:81.94,paritySummary:{errors:4,warns:3,resets:0},maxScore:119715,label:"Oooo",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.zip",coverURL:"https://eu.cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.jpg",previewURL:"https://eu.cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.mp3"}],createdAt:"2021-01-30T12:31:29.825Z",updatedAt:"2021-01-30T12:31:29.825Z",lastPublishedAt:"2021-01-30T12:31:29.825Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"198f3",name:"Spider Dance - Toby Fox (Undertale modchart)",description:"There are countless Undertale maps on Beat Saber, but what if you could actually experience a real boss fight? It's now possible thanks to Noodle Extensions, and I'm proud to present to you the first Undertale modchart: Spider Dance, where you will confront Muffet.\r\n\r\nTips for a better experience:\r\n- Don't use static lights; there shouldn't be any lights\r\n- Hide the HUD in player settings\r\n- Enable \"bloom post-processing\"\r\n- Enable \"screen distortion effects\"\r\n\r\nInstallation instructions:\r\n- You will need Noodle Extensions and Chroma and their dependencies. All are now available on ModAssistant.\r\n- If you read this in a future where the update broke the mods and they haven't been approved on ModAssistant yet, install the basic mods from ModAssistant and get the latest releases of Noodle Extensions, Heck, and Chroma from Aeroluna's GitHub: https://github.com/Aeroluna\r\n\r\nVideo: https://youtu.be/fy8KmUor6fI\r\n\r\nI started this a while ago before Ghost Choir and then abandoned the project. But I finally decided to finish the work, so I hope you'll enjoy it :)\r\nThanks to Reaxt and Cyansnow, who testplayed and made detailed suggestions that helped me improve the quality of this map. I really appreciate it.\r\n\r\nMy social media links (please follow/subscribe): https://linktr.ee/nyri0",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:115,duration:114,songName:"Spider Dance",songSubName:"",songAuthorName:"Toby Fox",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:10995,downvotes:123,score:.9868,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2021-06-25T17:47:40.296Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"09246637fa63ac55aa518718fd1eb4b876960480",key:"198f3",state:"Published",createdAt:"2021-06-25T17:47:40.296Z",sageScore:2,diffs:[{njs:16,offset:0,notes:434,bombs:88,obstacles:1153,nps:4.377,length:190.063,characteristic:"Standard",difficulty:"ExpertPlus",events:5,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:99.163,paritySummary:{errors:13,warns:13,resets:0},maxScore:392035,label:"9999G",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.zip",coverURL:"https://eu.cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.jpg",previewURL:"https://eu.cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-06-25T17:47:40.296Z",createdAt:"2021-06-25T17:47:40.296Z",updatedAt:"2021-06-25T17:47:40.296Z",lastPublishedAt:"2021-06-25T17:47:40.296Z",tags:["electronic","video-game-soundtrack","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"23f6b",name:"acloudyskye & N33T - Nothing Else (Modchart)",description:"9 months ago I created my first chroma map. At this time I didn't think I could make a map that you are about to play\nIn these 9 months, I learned a lot about walls, notes, environment enhancement, etc... but mostly how to properly polish a map.\nI wanted to make something big, something even bigger than SOT(as in scale swifter silly u) and here I am today publishing this map.\nThis map contains 7 different unique environments that connect together with seamless transitions.\nThis map is a big step in the journey of modhcarts just like SOT.\nI hope more people will see this modhcart as a place they can start and learn Noodle Extensions, You can also check the script of the modhcart on my Github. https://github.com/TzurS11/NoodleScript/tree/main/Examples/Scripts\n\nLastly, I wanna thank all the people that helped. even if you are not on this list I appreciate What you've done a lot!\n@GojiCrafter, @tall_chilis_boi, @Swifter, @Mawntee, Stick, kiwii.\n\nShowcase: https://youtu.be/qkSe0gOctEU\n\nbtw HAHA get fucked swifter! I got more environments than in SOT",uploader:{id:4284455,name:"TzurS11",hash:"6040a8135ab13d0006093512",avatar:"https://cdn.beatsaver.com/avatar/87d26d1223ba8840e9dca8d433165f717e7584e1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4284455/playlist"},metadata:{bpm:125,duration:291,songName:"Nothing Else",songSubName:"",songAuthorName:"acloudyskye & N33T",levelAuthorName:"TzurS11"},stats:{plays:0,downloads:0,upvotes:2949,downvotes:25,score:.9867,reviews:3},uploaded:"2022-04-10T19:30:00.565807Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"e45b69a9428505e93f73f1bdc43909d43fc844e3",state:"Published",createdAt:"2022-04-10T20:32:24.193634Z",sageScore:3,diffs:[{njs:16,offset:0,notes:919,bombs:0,obstacles:0,nps:3.298,length:580.5,characteristic:"Standard",difficulty:"ExpertPlus",events:18391,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:278.64,paritySummary:{errors:25,warns:13,resets:0},maxScore:838235,label:"You can hide away the fears you face\n\nRead Warnings!",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.zip",coverURL:"https://eu.cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.jpg",previewURL:"https://eu.cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2022-04-10T20:55:22.272218Z",createdAt:"2022-04-05T14:25:21.240039Z",updatedAt:"2022-08-25T11:32:19.554653Z",lastPublishedAt:"2022-04-10T20:32:58.830331Z",tags:["balanced","electronic","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"32693",name:"Fall Out Boy - The Phoenix",description:"Might be one of my most accessible mapsets yet as a custom-lit full spread of difficulties paired with both a lawless expert+ and one saber difficulties! Made this one for a friend of mine who's a big FoB fan. Enjoy!\n\nFeedback via reviews down below is always appreciated!\n\nPreview: https://youtu.be/2LFQLJd0pOQ\n\nSocials:\nhttps://twitter.com/bytrius\nhttps://www.youtube.com/c/bytrius\nhttps://bsaber.com/members/bytrius/\nhttps://www.twitch.tv/bytrius",uploader:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},metadata:{bpm:138,duration:246,songName:"The Phoenix",songSubName:"",songAuthorName:"Fall Out Boy",levelAuthorName:"Bytrius"},stats:{plays:0,downloads:0,upvotes:5122,downvotes:52,score:.9865,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2023-05-31T23:01:59.709120Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"bf2c367d29b133b66dc27f6f8e20467d0ec3301f",state:"Published",createdAt:"2023-05-31T22:51:42.410637Z",sageScore:5,diffs:[{njs:10,offset:-.95,notes:494,bombs:0,obstacles:44,nps:2.055,length:553,characteristic:"Standard",difficulty:"Easy",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:447235,blStars:2.56,environment:"NiceEnvironment"},{njs:12,offset:.3,notes:545,bombs:0,obstacles:38,nps:2.267,length:553,characteristic:"Standard",difficulty:"Normal",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:494155,blStars:3.04,environment:"NiceEnvironment"},{njs:14,offset:-.2,notes:767,bombs:0,obstacles:6,nps:3.19,length:553,characteristic:"Standard",difficulty:"Hard",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:700075,blStars:4.07,environment:"NiceEnvironment"},{njs:15,offset:-.475,notes:851,bombs:0,obstacles:9,nps:3.539,length:553,characteristic:"Standard",difficulty:"Expert",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:779035,blStars:4.86,environment:"NiceEnvironment"},{njs:17,offset:-.75,notes:1384,bombs:0,obstacles:4,nps:5.756,length:553,characteristic:"Standard",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:1272275,blStars:6.51,environment:"NiceEnvironment"},{njs:16,offset:-.65,notes:816,bombs:0,obstacles:29,nps:3.394,length:553,characteristic:"OneSaber",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:743475,blStars:8.35,environment:"NiceEnvironment"},{njs:17,offset:-.75,notes:1388,bombs:0,obstacles:4,nps:5.773,length:553,characteristic:"Lawless",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:1275955,label:"Double Downs",environment:"NiceEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.zip",coverURL:"https://eu.cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.jpg",previewURL:"https://eu.cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2023-06-01T02:16:21.699148Z",createdAt:"2023-05-16T06:12:18.475582Z",updatedAt:"2024-08-27T09:34:28.073772Z",lastPublishedAt:"2023-05-31T23:01:59.709120Z",tags:["dance-style","pop","punk"],bookmarked:!1,declaredAi:"None",blRanked:!0,blQualified:!1},{id:"1dcf4",name:"DYES IWASAKI - Bad Hatter ft. Lily Mizusaki",description:'Part of my second custom map pack!\n\nGameplay preview:\nhttps://www.youtube.com/watch?v=ZE5enFMVsv8\n\nGet the pack here:\nhttps://bsaber.com/tokyo-neo-swing/\n\nThis time around I took the extra time and made full spreads and chroma lightshows for each of the 6 songs of the album "Tokyo Neo Swing" by DYES IWASAKI & Lily Mizusaki.\n\nHuge thanks to the lovely playtesters MaybeeMae, Cocci, Monstor, Vaser888, and Kansas!\n\nAlso here is my playthrough of the entire pack on Expert Plus:\nhttps://www.youtube.com/watch?v=lgXR4sBl_kk\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/',uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:122,duration:176,songName:"Bad Hatter",songSubName:"(ft. Lily Mizusaki)",songAuthorName:"DYES IWASAKI",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:4470,downvotes:44,score:.9865,reviews:3},uploaded:"2021-11-11T13:06:30.332180Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"ebcf0c8780551bfe0feb96fbc255accad548798b",state:"Published",createdAt:"2021-11-14T11:39:03.473167Z",sageScore:6,diffs:[{njs:12,offset:1,notes:212,bombs:0,obstacles:0,nps:1.249,length:345.167,characteristic:"Standard",difficulty:"Easy",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.754,paritySummary:{errors:46,warns:12,resets:0},maxScore:187795,environment:"FitBeatEnvironment"},{njs:12,offset:.5,notes:320,bombs:0,obstacles:0,nps:1.885,length:345.167,characteristic:"Standard",difficulty:"Normal",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.754,paritySummary:{errors:29,warns:14,resets:0},maxScore:287155,environment:"FitBeatEnvironment"},{njs:14,offset:0,notes:491,bombs:0,obstacles:2,nps:2.89,length:345.5,characteristic:"Standard",difficulty:"Hard",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:4,warns:0,resets:0},maxScore:444475,environment:"FitBeatEnvironment"},{njs:16,offset:-.5,notes:697,bombs:0,obstacles:0,nps:4.102,length:345.5,characteristic:"Standard",difficulty:"Expert",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:0,warns:9,resets:0},maxScore:633995,environment:"FitBeatEnvironment"},{njs:19,offset:.25,notes:924,bombs:0,obstacles:0,nps:5.438,length:345.5,characteristic:"Standard",difficulty:"ExpertPlus",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:0,warns:0,resets:0},maxScore:842835,environment:"FitBeatEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.zip",coverURL:"https://eu.cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.jpg",previewURL:"https://eu.cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.mp3"}],curator:{id:4299228,name:"tan",avatar:"https://cdn.beatsaver.com/avatar/19d0c285757c0eea70e922961581953cfd96769b.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4299228/playlist"},curatedAt:"2021-11-11T13:06:30.332180Z",createdAt:"2021-11-10T18:01:16.390803Z",updatedAt:"2024-11-02T11:19:03.182227Z",lastPublishedAt:"2021-11-14T11:39:08.754762Z",tags:["swing","dance-style","balanced","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"b7aa",name:"Powerwolf - Venom of Venus",description:"Back to my more regular style, Powerwolf is a power-metal band that perform around the themes of werewolves and religion, a strange but interesting mixture.\r\n\r\nEx+ has a no-colours mode for those who wish to play without the custom block colours, but unfortunately I can't fit such an option for all difficulties.\r\n\r\nNormal 1.85 NPS\r\nHard 3.15 NPS\r\nExpert 4.43 NPS\r\nExpert+ 5.11 NPS\r\n\r\nThere is no easy difficulty, as that I needed the slot for the no-colour mode.",uploader:{id:4285369,name:"Cyrix",hash:"5eb6eb9a7abb000006c85add",avatar:"https://cdn.beatsaver.com/avatar/4213c7b05b9778149ae4536dd10842c6ed307ec5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285369/playlist"},metadata:{bpm:164,duration:211,songName:"Venom of Venus",songSubName:"",songAuthorName:"Powerwolf",levelAuthorName:"Cyrix"},stats:{plays:0,downloads:0,upvotes:8e3,downvotes:91,score:.9862,reviews:14,sentiment:"VERY_POSITIVE"},uploaded:"2020-06-29T18:24:10.081Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"f88b43c770dcd85a4ba18368853fbf062d41a09c",key:"b7aa",state:"Published",createdAt:"2020-06-29T18:24:10.081Z",sageScore:7,diffs:[{njs:12,offset:.5,notes:392,bombs:0,obstacles:63,nps:1.948,length:549.938,characteristic:"Standard",difficulty:"Easy",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:44,warns:15,resets:0},maxScore:353395,label:"Normal",environment:"PanicEnvironment"},{njs:13,offset:1,notes:666,bombs:8,obstacles:36,nps:3.31,length:549.938,characteristic:"Standard",difficulty:"Normal",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:1,warns:0,resets:1},maxScore:605475,label:"Hard",environment:"PanicEnvironment"},{njs:17,offset:0,notes:934,bombs:9,obstacles:7,nps:4.642,length:549.938,characteristic:"Standard",difficulty:"Hard",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:0,warns:0,resets:2},maxScore:852035,label:"Ex",environment:"PanicEnvironment"},{njs:20,offset:-.25,notes:1079,bombs:4,obstacles:7,nps:5.353,length:551,characteristic:"Standard",difficulty:"Expert",events:4192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.585,paritySummary:{errors:1,warns:0,resets:2},maxScore:985435,label:"Ex+ No Colour",environment:"PanicEnvironment"},{njs:20,offset:-.25,notes:1079,bombs:4,obstacles:7,nps:5.353,length:551,characteristic:"Standard",difficulty:"ExpertPlus",events:4192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.585,paritySummary:{errors:1,warns:0,resets:2},maxScore:985435,label:"Ex+",environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.zip",coverURL:"https://eu.cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.jpg",previewURL:"https://eu.cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-06-29T18:24:10.081Z",createdAt:"2020-06-29T18:24:10.081Z",updatedAt:"2020-06-29T18:24:10.081Z",lastPublishedAt:"2020-06-29T18:24:10.081Z",tags:["metal","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"210e3",name:"[Modchart] Sarah Cothran - As The World Caves In",description:"This started out as just a simple environment animation test, and then quickly snowballed out into one of my favourite maps I've made so far!\n\nAlso big ups to Fatalution for doing the lighting on this!\nThis is our first collab together, and the first time I've collaborated on a map with someone who shared the same ideas/thought process as myself. \nThis definitely won't be our last collab :)\n\nCheck out their profile and lightshow preview here:\nhttps://beatsaver.com/profile/84945\nhttps://youtu.be/1Fh5jL_UJBc\n\n\nWARNING:\nThis map may cause mild motion sickness! \nIf you feel sick at any point, remember that you can pause and it will stop everything!\n\n(If you have frequent issues with motion sickness in VR, I recommend having a fan on, or keeping smaller carpet with a different texture in your playspace)",uploader:{id:4285959,name:"Mawntee",hash:"5cff0b7698cc5a672c854ca6",avatar:"https://cdn.beatsaver.com/avatar/e373d502d75ed37d9cc60d2aa58b08f8ab6ebc90.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285959/playlist"},metadata:{bpm:124,duration:164,songName:"As The World Caves In",songSubName:"",songAuthorName:"Sarah Cothran",levelAuthorName:"Mawntee & Fatalution"},stats:{plays:0,downloads:0,upvotes:8562,downvotes:100,score:.986,reviews:22,sentiment:"VERY_POSITIVE"},uploaded:"2022-02-02T20:18:54.976546Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d4d847465bff16bc936e8281b5e3c703a4ca1c93",state:"Published",createdAt:"2022-02-02T20:27:55.445283Z",sageScore:4,diffs:[{njs:18,offset:1.961111,notes:259,bombs:20,obstacles:0,nps:1.63,length:328.466,characteristic:"Standard",difficulty:"ExpertPlus",events:31028,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:158.935,paritySummary:{errors:403,warns:36,resets:11},maxScore:231035,label:"Our Final Night Alive",environment:"TimbalandEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.zip",coverURL:"https://eu.cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.jpg",previewURL:"https://eu.cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.mp3"}],curator:{id:4234800,name:"AllieeCute",avatar:"https://cdn.beatsaver.com/avatar/f3788635ba87f3e1144e26501fe02c26b29aaccc.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4234800/playlist"},curatedAt:"2022-02-02T20:18:54.976546Z",createdAt:"2022-02-02T20:07:53.311141Z",updatedAt:"2023-10-16T18:16:00.863418Z",lastPublishedAt:"2023-06-06T14:03:19.315272Z",tags:["accuracy","dance-style"],bookmarked:!1,collaborators:[{id:84945,name:"fatalution",hash:"5cff0b7398cc5a672c84f30a",avatar:"https://cdn.beatsaver.com/avatar/7b7e7792dd5a8b250b5205c3a823d7d4006182f5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/84945/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"352d8",name:"Belle - Lend Me Your Voice [Noodle Extension, Chrom+] (Remastered!!!)",description:'If you are seasick in VR, do not play the "ALL EFFECTS" and "NO rotation (360 °)". For you, difficulty - "NO effects"\n\nIf there are performance problems disable "Mirror" in the graphics settings\n\nSong - https://music.youtube.com/watch?v=nSbhUCM5Z6s',uploader:{id:4284370,name:"hickeychan",hash:"6001ba1539ce5b000682a59f",avatar:"https://cdn.beatsaver.com/avatar/ecb540d442d3dbcd21881c32b050977d282a7438.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284370/playlist"},metadata:{bpm:121,duration:304,songName:"Lend Me Your Voice",songSubName:"",songAuthorName:"Kaho Nakamura",levelAuthorName:"HickeyChan"},stats:{plays:0,downloads:0,upvotes:1156,downvotes:6,score:.9859,reviews:3},uploaded:"2023-08-24T10:14:50.865197Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"be0ab6e5f1b5581a9a053f4a4c144c785696d349",state:"Published",createdAt:"2023-08-24T10:12:42.966966Z",sageScore:1,diffs:[{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"Hard",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"NO effects",environment:"BTSEnvironment"},{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"Expert",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"NO rotation (360 °)",environment:"BTSEnvironment"},{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"ExpertPlus",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"ALL EFFECTS",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.zip",coverURL:"https://eu.cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.jpg",previewURL:"https://eu.cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2023-08-25T06:09:54.756879Z",createdAt:"2023-08-24T10:12:42.966966Z",updatedAt:"2023-09-04T05:38:48.731043Z",lastPublishedAt:"2023-08-24T10:14:50.865197Z",tags:["accuracy","balanced","anime","classical-orchestral"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b8",name:"[Electro Swing Pack] Wolfgang Lohr & The Swinghoppers - Party Like It's 1920",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/ye22W_xrXnk\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:120,duration:187,songName:"Party Like It's 1920",songSubName:"",songAuthorName:"The Swinghoppers & Wolfgang Lohr",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:4194,downvotes:45,score:.9855,reviews:1},uploaded:"2021-07-08T15:25:28.451Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"973bab980b568e41b0a17a772e61377b01ef85ec",key:"1a0b8",state:"Published",createdAt:"2021-07-08T15:25:28.451Z",sageScore:4,diffs:[{njs:16,offset:-.5,notes:556,bombs:0,obstacles:0,nps:3.063,length:363,characteristic:"Standard",difficulty:"Expert",events:2057,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:504275,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:850,bombs:0,obstacles:0,nps:4.683,length:363,characteristic:"Standard",difficulty:"ExpertPlus",events:2057,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:774755,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.zip",coverURL:"https://eu.cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.jpg",previewURL:"https://eu.cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:25:28.451Z",createdAt:"2021-07-08T15:25:28.451Z",updatedAt:"2024-11-02T11:17:34.643709Z",lastPublishedAt:"2021-07-08T15:25:28.451Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1181f",name:"Royal & the Serpent - Overwhelmed",description:"Feeling that finals crunch? Worried about the pandemic? General anxiety with the news, and just feeling overwhelmed? Don't forget to take a step back and take a breath. Maybe by dancing along to this song that perfectly captures all of those feelings! Complete with overwhelming Chroma 2.0 lights! And now the extra details:\n\nBPM: 87\nNPS: Ez - 1.71; N - 2.09; H - 2.75; Ex - 3.19; Ex+ - 4.11\nNotes: Ez - 277; N - 338; H - 444; Ex - 516; Ex+ - 664\nBombs: Ez - 0; N - 0; H - 4; Ex - 4; Ex+ - 4\nWalls: Ez - 136; N - 134; H - 144; Ex - 109; Ex+ - 109\n\nSpecial thanks to qwasyx, Smay, and Cyrix for playtesting!",uploader:{id:4285188,name:"fruhead",hash:"5cff0b7598cc5a672c852683",avatar:"https://cdn.beatsaver.com/avatar/bcfbb8e5ac8665ae28d37b76a402daf0b88a68d0.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285188/playlist"},metadata:{bpm:87,duration:161,songName:"Overwhelmed",songSubName:"",songAuthorName:"Royal & the Serpent",levelAuthorName:"fruhead"},stats:{plays:0,downloads:0,upvotes:7135,downvotes:85,score:.9854,reviews:4},uploaded:"2020-11-29T23:09:47.309Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b748894960a346f1568b9f4876643f1358cfa897",key:"1181f",state:"Published",createdAt:"2020-11-29T23:09:47.309Z",sageScore:6,diffs:[{njs:10,offset:0,notes:277,bombs:0,obstacles:136,nps:1.793,length:224,characteristic:"Standard",difficulty:"Easy",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:43,warns:9,resets:0},maxScore:247595,environment:"PanicEnvironment"},{njs:12,offset:-.3,notes:338,bombs:0,obstacles:134,nps:2.188,length:224,characteristic:"Standard",difficulty:"Normal",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:22,warns:11,resets:0},maxScore:303715,environment:"PanicEnvironment"},{njs:14,offset:.4,notes:444,bombs:4,obstacles:144,nps:2.874,length:224,characteristic:"Standard",difficulty:"Hard",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:14,warns:4,resets:4},maxScore:401235,environment:"PanicEnvironment"},{njs:16,offset:.25,notes:516,bombs:4,obstacles:109,nps:3.34,length:224,characteristic:"Standard",difficulty:"Expert",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:0,warns:0,resets:2},maxScore:467475,environment:"PanicEnvironment"},{njs:18,offset:.1,notes:664,bombs:4,obstacles:109,nps:4.298,length:224,characteristic:"Standard",difficulty:"ExpertPlus",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:0,warns:0,resets:2},maxScore:603635,environment:"PanicEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Expert",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Overwhelmed",environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.zip",coverURL:"https://eu.cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.jpg",previewURL:"https://eu.cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.mp3"}],curator:{id:76372,name:"brightknight",hash:"5f30421b8a13d900061fe595",avatar:"https://cdn.beatsaver.com/avatar/236b93ff0df8c0f0305e52b6d3d01fa3e588b7ec.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/76372/playlist"},curatedAt:"2020-11-29T23:09:47.309Z",createdAt:"2020-11-29T23:09:47.309Z",updatedAt:"2020-11-29T23:09:47.309Z",lastPublishedAt:"2020-11-29T23:09:47.309Z",tags:["balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4980",name:"(Old Version) Paradise - Coldplay",description:"\"Paradise\" is a song by the British rock band Coldplay. The song was released on 12 September 2011. I kinda like this song for relaxing on long car rides and I don't know how it will feel as a beat saber map but I'ma try mapping it anyways. So here it is :)\n\n2022 EDIT: Download the new map here: https://beatsaver.com/maps/28102",uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:70,duration:278,songName:"Paradise",songSubName:"",songAuthorName:"Coldplay",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:6216,downvotes:74,score:.9852,reviews:1},uploaded:"2019-04-30T05:45:51Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b14639af36673a43fe32bc7563619deff438d438",key:"4980",state:"Published",createdAt:"2019-04-30T05:45:51Z",sageScore:6,diffs:[{njs:13,offset:0,notes:1023,bombs:0,obstacles:35,nps:3.816,length:312.75,characteristic:"Standard",difficulty:"Expert",events:4651,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:268.071,paritySummary:{errors:28,warns:29,resets:0},maxScore:933915,environment:"TriangleEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.zip",coverURL:"https://eu.cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.jpg",previewURL:"https://eu.cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2019-04-30T05:45:51Z",createdAt:"2019-04-30T05:45:51Z",updatedAt:"2022-07-22T08:36:01.092595Z",lastPublishedAt:"2019-04-30T05:45:51Z",tags:["alternative","indie"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"bdc7",name:"That's Life - Frank Sinatra",description:"Here is an honest-to-goodness human-mapped version of Frank Sinatra's 1966 hit, That's Life. This song is way too good to just have a crappy beat sage map.\n\nNormal and Hard Standard levels, and Expert Standard, 90, and 360 levels. Note that the expert levels are all essentially the same, just with varying degrees of wobbles.\n\nThanks to Maybeemae for the playtests!\n\nhttps://youtu.be/QXjj2-fgK8U",uploader:{id:78593,name:"techbutterfly",hash:"5cff0b7798cc5a672c8566f7",avatar:"https://cdn.beatsaver.com/avatar/99c0065fcfac5bfcf11adc69a58a8d3251bd748e.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/78593/playlist"},metadata:{bpm:77,duration:187,songName:"That's Life",songSubName:"",songAuthorName:"Frank Sinatra",levelAuthorName:"TechButterfly"},stats:{plays:0,downloads:0,upvotes:3713,downvotes:40,score:.9851,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2020-07-11T22:35:42.033Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"7cca8c1afecd782cfd74f158c312201b780043d8",key:"bdc7",state:"Published",createdAt:"2020-07-11T22:35:42.033Z",sageScore:4,diffs:[{njs:10,offset:-.3,notes:321,bombs:0,obstacles:6,nps:1.768,length:233,characteristic:"Standard",difficulty:"Normal",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:30,warns:41,resets:0},maxScore:288075,environment:"NiceEnvironment"},{njs:12,offset:.3,notes:418,bombs:0,obstacles:8,nps:2.302,length:233,characteristic:"Standard",difficulty:"Hard",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:24,warns:38,resets:0},maxScore:377315,environment:"NiceEnvironment"},{njs:13,offset:.1,notes:492,bombs:0,obstacles:8,nps:2.71,length:233,characteristic:"Standard",difficulty:"Expert",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:24,warns:26,resets:0},maxScore:445395,environment:"NiceEnvironment"},{njs:13,offset:.3,notes:489,bombs:0,obstacles:8,nps:2.693,length:233,characteristic:"90Degree",difficulty:"Expert",events:1192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:25,warns:27,resets:0},maxScore:442635,label:"Expert 90",environment:"GlassDesertEnvironment"},{njs:13,offset:.3,notes:489,bombs:0,obstacles:8,nps:2.693,length:233,characteristic:"360Degree",difficulty:"Expert",events:1166,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:25,warns:26,resets:0},maxScore:442635,label:"Expert360",environment:"GlassDesertEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.zip",coverURL:"https://eu.cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.jpg",previewURL:"https://eu.cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2020-07-11T22:35:42.033Z",createdAt:"2020-07-11T22:35:42.033Z",updatedAt:"2020-07-11T22:35:42.033Z",lastPublishedAt:"2020-07-11T22:35:42.033Z",tags:["pop","jazz","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"3bbb0",name:"[Modchart] Leslie Wai - Paradigm",description:"MAP IS NOT WORKING ON QUEST 1.37+\nMAP IS NOT WORKING ON QUEST 1.37+\nMAP IS NOT WORKING ON QUEST 1.37+\n\nNOTE: If your sabers are in the wrong position after the intro try disabling any room offset/rotation\nNOTE 2: The map is broken on some versions including 1.34 and quest, I am gonna work on report all the issues\nNOTE 3: The map should be playable now on Quest native (just a few visual bugs)\n\nMy biggest project so far!\nenjoy it\n\nMap preview: https://youtu.be/gokZx0QjqZQ\n\nReupload: Thanks for the 429 people that played the map so far! i am reuploading to fix a few bugs:\n- Fix saber positions being wrong for some people\n- Disable left handed option\n- Disable Intro Skip\n\nReupload 2: Thanks for the another 170 plays I hope this is the final reupload:\n- Fix light id errors\n- Fix cinema suggestion not needed\n- Trying another fix for sabers wrong position\n\nReupload 3: And I hope this is the last one, thanks for the 124 new plays!\n- Fix player position bug on quest\n- Fix notes position bug on quest\n- Fix gimmik part on quest\n- Added suggested colors for notes\n- Changed NJS and JD\n- Fix sabers coming from the wrong direction in the intro",uploader:{id:4284535,name:"Elecast",hash:"6069279f5ab13d000609e874",avatar:"https://cdn.beatsaver.com/avatar/4dd111a1ec473c3559cfc73caaac650be56b65a1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284535/playlist"},metadata:{bpm:130,duration:441,songName:"Paradigm",songSubName:"",songAuthorName:"Leslie Wai",levelAuthorName:"Elecast"},stats:{plays:0,downloads:0,upvotes:2734,downvotes:27,score:.9851,reviews:35,sentiment:"VERY_POSITIVE"},uploaded:"2024-04-13T20:59:13.608905Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"a504aafe70cf723f46503568f65813ef616d030f",state:"Published",createdAt:"2024-04-24T23:51:45.788382Z",sageScore:3,diffs:[{njs:17,offset:-.75,notes:1051,bombs:360,obstacles:249,nps:3.038,length:749.5,characteristic:"Standard",difficulty:"ExpertPlus",events:12016,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:345.923,paritySummary:{errors:0,warns:0,resets:0},maxScore:959675,label:"You can't escape",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.zip",coverURL:"https://eu.cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.jpg",previewURL:"https://eu.cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.mp3"}],curator:{id:4284445,name:"Emilia",hash:"5cff0b7898cc5a672c856ed3",avatar:"https://cdn.beatsaver.com/avatar/4284445.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284445/playlist"},curatedAt:"2024-04-13T23:47:05.160104Z",createdAt:"2024-04-12T23:23:24.101391Z",updatedAt:"2024-08-18T18:18:25.185313Z",lastPublishedAt:"2024-04-24T23:51:50.910171Z",tags:["balanced","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0ba",name:"[Electro Swing Pack] Wolfgang Lohr & Maskarade - Hit The Road Jack",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/0ObNR9n_dDs\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:124,duration:159,songName:"Hit The Road Jack",songSubName:"",songAuthorName:"Wolfgang Lohr & Maskarade",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:3787,downvotes:42,score:.9849},uploaded:"2021-07-08T15:26:18.072Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"75f10751d58f6f1ab0bc36e94039a144256adccb",key:"1a0ba",state:"Published",createdAt:"2021-07-08T15:26:18.072Z",sageScore:4,diffs:[{njs:16,offset:-.25,notes:475,bombs:0,obstacles:0,nps:3.089,length:317.75,characteristic:"Standard",difficulty:"Expert",events:1846,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:153.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:429755,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:750,bombs:0,obstacles:0,nps:4.878,length:317.75,characteristic:"Standard",difficulty:"ExpertPlus",events:1846,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:153.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:682755,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.zip",coverURL:"https://eu.cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.jpg",previewURL:"https://eu.cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:26:18.072Z",createdAt:"2021-07-08T15:26:18.072Z",updatedAt:"2024-11-02T11:17:50.904586Z",lastPublishedAt:"2021-07-08T15:26:18.072Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b7",name:"[Electro Swing Pack] Jamie Berry - Lost In The Rhythm (ft. Octavia Rose)",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/4O8l7rq4eHI\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:121,duration:187,songName:"Lost In The Rhythm",songSubName:"(ft. Octavia Rose)",songAuthorName:"Jamie Berry",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:3307,downvotes:36,score:.9847,reviews:1},uploaded:"2021-07-08T15:24:57.679Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"6d006d47880a45a134844f3787f3c184881d4673",key:"1a0b7",state:"Published",createdAt:"2021-07-08T15:24:57.679Z",sageScore:5,diffs:[{njs:16,offset:-.25,notes:591,bombs:0,obstacles:8,nps:3.274,length:364,characteristic:"Standard",difficulty:"Expert",events:3271,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:180.496,paritySummary:{errors:0,warns:0,resets:0},maxScore:536475,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:821,bombs:0,obstacles:8,nps:4.549,length:364,characteristic:"Standard",difficulty:"ExpertPlus",events:3271,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:180.496,paritySummary:{errors:0,warns:0,resets:0},maxScore:748075,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.zip",coverURL:"https://eu.cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.jpg",previewURL:"https://eu.cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:24:57.679Z",createdAt:"2021-07-08T15:24:57.679Z",updatedAt:"2024-11-02T11:17:26.961219Z",lastPublishedAt:"2021-07-08T15:24:57.679Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"77e9",name:"Jingo Jungle [Saga of Tanya the Evil Opening] - AmaLee",description:'AmaLee\'s English cover of "Jingo Jungle", the opening from Saga of Tanya the Evil (Youjo Senki). Original song by MYTH & ROID.',uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:130,duration:226,songName:"Jingo Jungle",songSubName:"",songAuthorName:"AmaLee",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:4125,downvotes:48,score:.9846,reviews:1},uploaded:"2019-12-21T02:44:34.295Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"f90a2e4f8ee7b1f33543cddccb8baea660253d4a",key:"77e9",state:"Published",createdAt:"2019-12-21T02:44:34.295Z",sageScore:5,diffs:[{njs:12,offset:0,notes:581,bombs:104,obstacles:28,nps:2.647,length:475.5,characteristic:"Standard",difficulty:"Hard",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:35,warns:15,resets:10},maxScore:527275,environment:"DefaultEnvironment"},{njs:15,offset:0,notes:950,bombs:78,obstacles:14,nps:4.329,length:475.5,characteristic:"Standard",difficulty:"Expert",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:42,warns:48,resets:8},maxScore:866755,environment:"DefaultEnvironment"},{njs:17,offset:0,notes:1184,bombs:105,obstacles:17,nps:5.395,length:475.5,characteristic:"Standard",difficulty:"ExpertPlus",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:32,warns:43,resets:16},maxScore:1082035,environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.zip",coverURL:"https://eu.cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.jpg",previewURL:"https://eu.cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.mp3"}],createdAt:"2019-12-21T02:44:34.295Z",updatedAt:"2019-12-21T02:44:34.295Z",lastPublishedAt:"2019-12-21T02:44:34.295Z",tags:["pop","anime"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"a438",name:"Wait - M83 (wall map)",description:"I wanted to do something special for this great song, and also see the potential of Noodle Extensions. A few tips for a better experience:\r\n- disable the mirror effect in the game settings\r\n- turn the SFX volume down in the player settings\r\n- hide the HUD in the player settings\r\n\r\nVideo: https://youtu.be/oe6ThhijPy0\r\n\r\nThe map has a lot of walls, so you might not be able to run it on the lower-end hardware. I've included a version with less walls in case it helps.",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:148,duration:336,songName:"Wait",songSubName:"",songAuthorName:"M83",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:4116,downvotes:48,score:.9845,reviews:9,sentiment:"VERY_POSITIVE"},uploaded:"2020-05-08T23:53:02.030Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"0d8921ef06a889cbd9db13afcc43f09a1619b173",key:"a438",state:"Published",createdAt:"2020-05-08T23:53:02.030Z",sageScore:6,diffs:[{njs:8,offset:6,notes:735,bombs:0,obstacles:6684,nps:2.225,length:815,characteristic:"Standard",difficulty:"Easy",events:5,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:330.405,paritySummary:{errors:93,warns:27,resets:0},maxScore:668955,label:"Hard (less lag)",environment:"BigMirrorEnvironment"},{njs:8,offset:6,notes:735,bombs:0,obstacles:10499,nps:2.225,length:815,characteristic:"Standard",difficulty:"Hard",events:5,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:330.405,paritySummary:{errors:93,warns:27,resets:0},maxScore:668955,label:"Hard (original)",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.zip",coverURL:"https://eu.cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.jpg",previewURL:"https://eu.cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-05-08T23:53:02.030Z",createdAt:"2020-05-08T23:53:02.030Z",updatedAt:"2020-05-08T23:53:02.030Z",lastPublishedAt:"2020-05-08T23:53:02.030Z",tags:["rock","indie","techno"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"12ad1",name:"Minnesota - Colors (ft. Jackie Rain) | Chroma RGB",description:"Chroma 2.0 HIGHLY RECOMMENDED!\n\nHad this map sitting in my project folder for some months and finally got to finish it! \nIt features a Chroma RGB lightshow AND Rainbow notes, for the full COLOR experience :)\n\nPreview: https://www.youtube.com/watch?v=8Omzd7IdJt0",uploader:{id:4284201,name:"nitronik.exe",hash:"5cff0b7798cc5a672c855d84",avatar:"https://cdn.beatsaver.com/avatar/ab054640a94777ed7e92d91a505a85f8c5047be5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284201/playlist"},metadata:{bpm:140,duration:202,songName:"Colors",songSubName:"(ft. Jackie Rain)",songAuthorName:"Minnesota",levelAuthorName:"nitronik.exe"},stats:{plays:0,downloads:0,upvotes:4295,downvotes:51,score:.9844,reviews:7,sentiment:"VERY_POSITIVE"},uploaded:"2021-01-13T15:55:44.846Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"03fcb98091e50600d9d777251d765c53384c2735",key:"12ad1",state:"Published",createdAt:"2021-01-13T15:55:44.846Z",sageScore:4,diffs:[{njs:13,offset:.5,notes:395,bombs:0,obstacles:221,nps:2.057,length:448,characteristic:"Standard",difficulty:"Hard",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:356155,environment:"BigMirrorEnvironment"},{njs:16,offset:0,notes:601,bombs:0,obstacles:113,nps:3.13,length:448,characteristic:"Standard",difficulty:"Expert",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:545675,environment:"BigMirrorEnvironment"},{njs:19,offset:-.5,notes:911,bombs:0,obstacles:120,nps:4.745,length:448,characteristic:"Standard",difficulty:"ExpertPlus",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:830875,label:"Colors",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.zip",coverURL:"https://eu.cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.jpg",previewURL:"https://eu.cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.mp3"}],curator:{id:1096,name:"pyrowarfare",hash:"5e99c7df3f476a0006596cdf",avatar:"https://www.gravatar.com/avatar/28fcd25e8adfa72a17daa766767daf781bee89776333a3ed7a4cc84146e6a3e8?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/1096/playlist"},curatedAt:"2021-01-13T15:55:44.846Z",createdAt:"2021-01-13T15:55:44.846Z",updatedAt:"2021-01-13T15:55:44.846Z",lastPublishedAt:"2021-01-13T15:55:44.846Z",tags:["dubstep","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4a2b3",name:"[Vivify] Turret Orchestra (Cara Mia Addio) - Portal 2",description:"Portal •⩊•\n\nWork done:\nMadChase - Vivify and Standard Mapping\nRateGyro - OneSaber Mapping\nXentha - 3d Modeling \n\nAll Lawless: No Vivify difficulties \n\nThis took FAR too long to make too..... hope you enjoy this product of my sufferings as much as I do :)\n\nGo check out @rategyro, they did the mapping for all the Onesaber diffs and HUGE thanks to @Xentha for making a majority of the env used in this map, this would not have been possible without them. \n\nCredits: https://docs.google.com/document/d/1gR8x4iIk_n2i4ScYRPGEyD8OfZNsrDftmy6Z9cC5L_E/edit?usp=sharing",uploader:{id:4286182,name:"MadChase",avatar:"https://cdn.beatsaver.com/avatar/99feaf0fe97b6c67dde2ae7ba055fab744b0ac61.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286182/playlist"},metadata:{bpm:204,duration:120,songName:"Turret Orchestra",songSubName:"(Cara Mia Addio)",songAuthorName:"Portal 2",levelAuthorName:"MadChase, RateGyro, Xentha\r"},stats:{plays:0,downloads:0,upvotes:758,downvotes:3,score:.9844},uploaded:"2025-09-05T19:09:19.619055Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3a2a0fead6eb8a8ab325aa54efdfb84bd4220375",state:"Published",createdAt:"2025-09-06T02:29:05.366Z",sageScore:4,diffs:[{njs:12,offset:0,notes:107,bombs:0,obstacles:0,nps:1.304,length:279,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:91195,label:"Basic Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:149,bombs:0,obstacles:0,nps:1.816,length:279,characteristic:"Standard",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:129835,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:714,bombs:0,obstacles:0,nps:8.701,length:279,characteristic:"Standard",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:649635,label:"Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:131,bombs:0,obstacles:0,nps:1.591,length:279.937,characteristic:"OneSaber",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.334,paritySummary:{errors:0,warns:0,resets:0},maxScore:113275,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:612,bombs:0,obstacles:0,nps:7.433,length:279.937,characteristic:"OneSaber",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.334,paritySummary:{errors:0,warns:0,resets:0},maxScore:555795,label:"Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Just Viv",environment:"GagaEnvironment"},{njs:12,offset:0,notes:111,bombs:0,obstacles:473,nps:1.343,length:281,characteristic:"Lawless",difficulty:"Easy",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.647,paritySummary:{errors:0,warns:0,resets:0},maxScore:94875,label:"Basic Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:130,bombs:0,obstacles:473,nps:1.584,length:279,characteristic:"Lawless",difficulty:"Normal",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:112355,label:"One Saber Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:153,bombs:0,obstacles:473,nps:1.851,length:281,characteristic:"Lawless",difficulty:"Hard",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.647,paritySummary:{errors:0,warns:0,resets:0},maxScore:133515,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:611,bombs:0,obstacles:473,nps:7.446,length:279,characteristic:"Lawless",difficulty:"Expert",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:554875,label:"One Saber Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:734,bombs:0,obstacles:473,nps:8.859,length:281.688,characteristic:"Lawless",difficulty:"ExpertPlus",events:7,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:82.849,paritySummary:{errors:0,warns:0,resets:0},maxScore:668035,label:"Poodles",environment:"GagaEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.zip",coverURL:"https://eu.cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.jpg",previewURL:"https://eu.cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.mp3"}],createdAt:"2025-09-05T18:27:26.937639Z",updatedAt:"2025-09-30T15:48:59.259473Z",lastPublishedAt:"2025-09-06T02:29:10.640787Z",tags:["video-game-soundtrack","balanced","poodle"],bookmarked:!1,collaborators:[{id:103109,name:"Xentha",avatar:"https://cdn.beatsaver.com/avatar/da02df6ec7f6d28e226510b3f8ecb786d24634ca.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/103109/playlist"},{id:4280701,name:"rategyro",hash:"605e50f0cd73ba00060a45e3",avatar:"https://cdn.beatsaver.com/avatar/06d29645455d6652940b240658617d968fc53d91.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!0,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4280701/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"14d64",name:"Try - MitiS Feat. RORY",description:"Twenty-Sixth Upload\n\nThis map means the whole world to me, so I hope everyone enjoys this map. My father passed away on Jan. 23, 2021, in the middle of making this map. I am dedicating this map for him because of how much this songs means to me now. \nPouring my heart and soul into this map took a lot out of me, making it as perfect to my little abilities I have for mapping.\n\nBig shout outs to Lonely and Jamman for lighting this beautiful song and for agreeing to light it, it means the world to me.\nBig shout outs to thelightdesigner for making such amazing and beautiful walls. Thank you for taking the time to make this, it means the world to me.\nBig shout outs to Mawntee for giving me advice on how to make this map feel and shout outs to thelitlewiseowl for modding it, showing me what I can improve in this map. \nBiggest shout outs to everyone that play tested it multiple times. I am sorry for bugging them for multiple play test. \n\nAnd Biggest shoutout to my favorite chillstep/melodic dubstep artist, MitiS and Rory for making this beautiful song. \nYou have no idea how much this song means to me, I thank you so much. Keep up the good work MitiS.\n\n**NOODLES AND CHROMA REQUIRED**\n\nI hope this map can show you the feeling in this song, as well as what it portrays. I tried my best, I hope it turns out great and everyone enjoys it. \nThank you everyone for taking the time to download and play this map. I appreciate it everyone.\n\nFeedback is always welcome!",uploader:{id:4285346,name:"remie",hash:"5f6efd989824150006d740ac",avatar:"https://cdn.beatsaver.com/avatar/736cde47222d5d00f4affea115772681d0e070eb.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4285346/playlist"},metadata:{bpm:132,duration:273,songName:"Try",songSubName:"",songAuthorName:"MitiS Feat. RORY",levelAuthorName:"Remie & Lone"},stats:{plays:0,downloads:0,upvotes:7683,downvotes:102,score:.9843,reviews:36,sentiment:"VERY_POSITIVE"},uploaded:"2021-03-01T13:29:26.471Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"6db3d9da217b41607d250aa7a28c5dc26a082188",key:"14d64",state:"Published",createdAt:"2021-03-01T13:29:26.471Z",sageScore:3,diffs:[{njs:17,offset:-.7,notes:1447,bombs:21,obstacles:77,nps:6.217,length:512.083,characteristic:"Standard",difficulty:"ExpertPlus",events:36825,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:232.765,paritySummary:{errors:0,warns:0,resets:2},maxScore:1323995,label:"EXPERT+",environment:"OriginsEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.zip",coverURL:"https://eu.cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.jpg",previewURL:"https://eu.cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.mp3"}],curator:{id:2381,name:"bearly",hash:"5ea9efbf16c968000636dba4",avatar:"https://cdn.beatsaver.com/avatar/2381.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/2381/playlist"},curatedAt:"2021-03-01T13:29:26.471Z",createdAt:"2021-03-01T13:29:26.471Z",updatedAt:"2021-03-01T13:29:26.471Z",lastPublishedAt:"2021-03-01T13:29:26.471Z",tags:["balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"27a13",name:"Jimmy Eat World - The Middle [Arcs][V3 Lights]",description:" - everything'll be alright, alright? \n\nYes, @Bytrius already has a great map of this song in the 2000's Rock Pack (check it out here https://beatsaver.com/maps/157fa) but I thought I'd try it with my own arc map style and provide some lower difficulties as well. \n\nGameplay video by @onespookyboi: https://youtu.be/SjiqMsMkFuU\nLIghtshow: https://streamable.com/zhomzm\n\nThank you testers!\n@maybeemae\n@swukpuff\n@onespookyboi\n@namaki_mono\nFlaemmchenFlame - https://www.twitch.tv/flaemmchenflame\n",uploader:{id:4321171,name:"tetsubeats",avatar:"https://cdn.beatsaver.com/avatar/532b0f3d23e1e795c5e1404c4a807c0dfbe1adf2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4321171/playlist"},metadata:{bpm:162.2,duration:169,songName:"The Middle",songSubName:"",songAuthorName:"Jimmy Eat World",levelAuthorName:"TetsuBeats"},stats:{plays:0,downloads:0,upvotes:3397,downvotes:39,score:.9842,reviews:1},uploaded:"2022-07-10T05:30:32.964512Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"4b980371b6005cc176aed1b402bd104af56c31a3",state:"Published",createdAt:"2022-07-10T04:29:32.041843Z",sageScore:5,diffs:[{njs:10,offset:-1.1,notes:320,bombs:0,obstacles:0,nps:1.951,length:443.5,characteristic:"Standard",difficulty:"Easy",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:287155,environment:"PyroEnvironment"},{njs:12,offset:-1.5,notes:528,bombs:0,obstacles:0,nps:3.218,length:443.5,characteristic:"Standard",difficulty:"Normal",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:478515,environment:"PyroEnvironment"},{njs:14,offset:.1,notes:629,bombs:0,obstacles:0,nps:3.834,length:443.5,characteristic:"Standard",difficulty:"Hard",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:571435,environment:"PyroEnvironment"},{njs:16.5,offset:-.1,notes:758,bombs:0,obstacles:0,nps:4.62,length:443.5,characteristic:"Standard",difficulty:"Expert",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:690115,environment:"PyroEnvironment"},{njs:17.5,offset:-.3,notes:826,bombs:0,obstacles:0,nps:5.035,length:443.5,characteristic:"Standard",difficulty:"ExpertPlus",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:752675,environment:"PyroEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.zip",coverURL:"https://eu.cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.jpg",previewURL:"https://eu.cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2022-07-10T05:52:53.577094Z",createdAt:"2022-07-10T04:29:32.041843Z",updatedAt:"2022-07-10T14:14:52.319313Z",lastPublishedAt:"2022-07-10T05:30:32.964512Z",tags:["dance-style","balanced","rock","pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"271dc",name:"[Electro Swing Pack Vol. 2] Swingrowers - Butterfly (Wolfgang Lohr Remix)",description:"Electro Swing Pack Volume 2: Electric Boogaloo!\n\nFor the anniversary of my first pack, I am making a sequel.\n10 Electro Swing songs, 3 difficulties each + custom vanilla lights!\n\nGet the pack here:\nhttps://bsaber.com/electro-swing-pack-2/\nhttps://beatsaver.com/playlists/6572\n\nPreview this map:\nhttps://youtu.be/91zWh1dLLV4\n\nPack Preview Playlist:\nhttps://youtube.com/playlist?list=PLrVm0whzsGKL5NYTUIEzDyITjl6WuLSJ4\n\n\nThank you to all the Playtesters!\nAlice, MaybeeMae, Pixelguy, Raaknys, Namaki Mono, DeeDee, and WolfieBeat ❤️\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:126,duration:189,songName:"Butterfly",songSubName:"(Wolfgang Lohr Remix)",songAuthorName:"Swingrowers",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:1900,downvotes:18,score:.9842},uploaded:"2022-07-08T13:00:00.564Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7",state:"Published",createdAt:"2022-06-25T18:10:24.485756Z",sageScore:5,diffs:[{njs:14,offset:0,notes:522,bombs:0,obstacles:9,nps:2.818,length:389,characteristic:"Standard",difficulty:"Hard",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:472995,environment:"PanicEnvironment"},{njs:16,offset:-.5,notes:752,bombs:0,obstacles:9,nps:4.06,length:389,characteristic:"Standard",difficulty:"Expert",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:684595,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:903,bombs:0,obstacles:9,nps:4.875,length:389,characteristic:"Standard",difficulty:"ExpertPlus",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:823515,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.zip",coverURL:"https://eu.cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.jpg",previewURL:"https://eu.cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.mp3"}],curator:{id:4284746,name:"Dee-Dee",avatar:"https://cdn.beatsaver.com/avatar/3853d99b74fe4eb9a3954df5946123f67a95da3d.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!0,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284746/playlist"},curatedAt:"2022-07-09T12:03:07.374428Z",createdAt:"2022-06-25T18:10:24.485756Z",updatedAt:"2024-11-09T20:31:57.830788Z",lastPublishedAt:"2022-07-08T13:00:00.559037Z",tags:["balanced","electronic","swing","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"39624",name:"[Chroma] DNCE - Cake By The Ocean",description:"[Explicit Lyrics]\n[Flashing Lights Warning]\n\nMy first full spread map!\n\nJan 28th 2024: Reupload with fixed lighting\n-----------------------------------------------------\nSong: Cake By The Ocean by DNCE\nhttps://www.youtube.com/watch?v=vWaRiD5ym74\n\nMap Preview (Expert+):\nhttps://www.youtube.com/watch?v=UZyrFB9vKDo\n-----------------------------------------------------\nThank you to @Noveliniel for playtesting this map.\n-----------------------------------------------------\nMessage wunkoo on Discord for any feedback (must be in the BeastSaber discord).\nOr just leave a BeatSaver review",uploader:{id:4302396,name:"Koreami",avatar:"https://cdn.beatsaver.com/avatar/f5542fc9f09f21504d7e82a61b06d494389ba3d3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4302396/playlist"},metadata:{bpm:119,duration:221,songName:"Cake By The Ocean",songSubName:"",songAuthorName:"DNCE",levelAuthorName:"Koreami"},stats:{plays:0,downloads:0,upvotes:2819,downvotes:31,score:.9841,reviews:3},uploaded:"2024-01-27T19:00:00.269841Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"2cb2f496ef6e33a09a56d301923ade73b9a53c3d",state:"Published",createdAt:"2024-01-28T18:55:36.350370Z",sageScore:5,diffs:[{njs:12,offset:-.1,notes:431,bombs:6,obstacles:37,nps:2.021,length:423,characteristic:"Standard",difficulty:"Easy",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:389275,label:"Puddle",environment:"DragonsEnvironment"},{njs:12,offset:-.2,notes:554,bombs:0,obstacles:21,nps:2.598,length:423,characteristic:"Standard",difficulty:"Normal",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:502515,label:"Pond",environment:"DragonsEnvironment"},{njs:13,offset:-.25,notes:677,bombs:0,obstacles:31,nps:3.174,length:423,characteristic:"Standard",difficulty:"Hard",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:615595,label:"Lake",environment:"DragonsEnvironment"},{njs:16,offset:-.7,notes:800,bombs:0,obstacles:33,nps:3.751,length:423,characteristic:"Standard",difficulty:"Expert",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:728755,label:"Sea",environment:"DragonsEnvironment"},{njs:16,offset:-.7,notes:971,bombs:4,obstacles:41,nps:4.553,length:423,characteristic:"Standard",difficulty:"ExpertPlus",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:886075,label:"Ocean",environment:"DragonsEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Normal",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Fluorescent Coral",environment:"DragonsEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.zip",coverURL:"https://eu.cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.jpg",previewURL:"https://eu.cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.mp3"}],curator:{id:169636,name:"Duffelsalat",avatar:"https://cdn.beatsaver.com/avatar/42f17c520f53b67cf400a66f65e49038263042de.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/169636/playlist"},curatedAt:"2024-01-28T15:09:46.809093Z",createdAt:"2024-01-27T18:49:42.362618Z",updatedAt:"2025-05-27T05:59:37.010902Z",lastPublishedAt:"2024-01-28T18:55:43.801969Z",tags:["accuracy","balanced","pop","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"9a0c",name:"Thnks fr th Mmrs - Fall Out Boy",description:"Thnks fr th Mmrs (or Thanks for the Memories) from Fall Out Boy.\nSo far the map that I have put the most work into (and which probably made me age by 3 years). Hope you enjoy it!\n\nThe map has Chroma lighting but can also be played without the Chroma mod.\nExpert+ contains single saber sections and polyrhythm parts. Just so you are warned ;)\n\nBig thanks to Sorukun for playtesting this map and especially to Timeweaver for pointing out all issues it had during its creation!",uploader:{id:21367,name:"hamsta",hash:"5de27451fffaa600066f2842",avatar:"https://www.gravatar.com/avatar/36e8d99105e1e9c1d2173853194691e2b2d5c0552b6e96bfd7a2fd8108310685?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/21367/playlist"},metadata:{bpm:154.791,duration:198,songName:"Thnks fr th Mmrs",songSubName:"",songAuthorName:"Fall Out Boy",levelAuthorName:"Hamsta"},stats:{plays:0,downloads:0,upvotes:10577,downvotes:148,score:.984,reviews:2},uploaded:"2020-04-12T09:50:46.516Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"0e8ef3006db854c67f04fe72322bccea410f69ee",key:"9a0c",state:"Published",createdAt:"2020-04-12T09:50:46.516Z",sageScore:5,diffs:[{njs:14,offset:0,notes:580,bombs:0,obstacles:51,nps:3.092,length:484,characteristic:"Standard",difficulty:"Hard",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:0,warns:0,resets:0},maxScore:526355,environment:"PanicEnvironment"},{njs:14,offset:0,notes:637,bombs:0,obstacles:51,nps:3.395,length:484,characteristic:"Standard",difficulty:"Expert",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:0,warns:0,resets:0},maxScore:578795,environment:"PanicEnvironment"},{njs:16,offset:0,notes:844,bombs:0,obstacles:39,nps:4.499,length:484,characteristic:"Standard",difficulty:"ExpertPlus",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:1,warns:2,resets:0},maxScore:769235,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.zip",coverURL:"https://eu.cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.jpg",previewURL:"https://eu.cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.mp3"}],curator:{id:4299228,name:"tan",avatar:"https://cdn.beatsaver.com/avatar/19d0c285757c0eea70e922961581953cfd96769b.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4299228/playlist"},curatedAt:"2020-04-12T09:50:46.516Z",createdAt:"2020-04-12T09:50:46.516Z",updatedAt:"2020-04-12T09:50:46.516Z",lastPublishedAt:"2020-04-12T09:50:46.516Z",tags:["pop","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"11b7a",name:"Still Alive - Portal",description:"I've wanted to map this song for a while now. And since this one's probably the last Portal song I'll map, I gave it my best. \r\n\r\nP.S. - I'm so glad to be back mapping this month. I had to take a break due to overwhelming stress, but now I'm feeling ready again.\r\nI hope you enjoy.\r\n\r\nPortal on Steam:\r\nhttps://store.steampowered.com/app/400/Portal/",uploader:{id:4284694,name:"Jokidum",hash:"5e15518d47f1600006e912cc",avatar:"https://cdn.beatsaver.com/avatar/da6133c71c7c84b75622f59dd2fce215f8c444f3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4284694/playlist"},metadata:{bpm:120,duration:176,songName:"Still Alive",songSubName:"- Portal",songAuthorName:"Jonathan Coulton",levelAuthorName:"Jokidum"},stats:{plays:0,downloads:0,upvotes:6908,downvotes:92,score:.984,reviews:2},uploaded:"2020-12-04T20:30:44.132Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"8c03b43484b0dd1fc7d8a3104a82f0992a001c6c",key:"11b7a",state:"Published",createdAt:"2020-12-04T20:30:44.132Z",sageScore:4,diffs:[{njs:12,offset:0,notes:490,bombs:0,obstacles:13,nps:2.853,length:343.5,characteristic:"Standard",difficulty:"Expert",events:1060,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:171.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:443555,environment:"TriangleEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Easy",events:1060,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Lightshow",environment:"TriangleEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.zip",coverURL:"https://eu.cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.jpg",previewURL:"https://eu.cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.mp3"}],createdAt:"2020-12-04T20:30:44.132Z",updatedAt:"2020-12-04T20:30:44.132Z",lastPublishedAt:"2020-12-04T20:30:44.132Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"24227",name:"DADDY! DADDY! DO! (TV Size) (2022 Remaster) [Kaguya-sama: Love Is War Season 2 Opening] - Masayuki Suzuki ft. Airi Suzuki ",description:"Just a small remaster of my old daddy daddy do map from 2020, fixed a few parity errors and updated the NJS. There's also 2 additional down maps now. \n\nThanks to https://twitter.com/WicKedBassline for the special request!\n\nDADDY! DADDY! DO! is opening theme for the second season of the Kaguya-sama: Love Is War anime adaptation.\n\nKeep up to date on my maps: https://twitter.com/Joetastic_\nMy mapper's profile: https://bsaber.com/members/joetastic/\nContact me on discord: @Joetastic#2501",uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:138,duration:91,songName:"DADDY! DADDY! DO! (TV Size) (2022 Remaster)",songSubName:"ft. Airi Suzuki",songAuthorName:"Masayuki Suzuki",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:3282,downvotes:38,score:.984,reviews:1},uploaded:"2022-04-09T06:56:40.572610Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17",state:"Published",createdAt:"2022-04-09T06:56:26.910837Z",sageScore:4,diffs:[{njs:12,offset:0,notes:205,bombs:4,obstacles:23,nps:2.352,length:200.5,characteristic:"Standard",difficulty:"Hard",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:181355,environment:"PanicEnvironment"},{njs:15,offset:-.3,notes:306,bombs:4,obstacles:23,nps:3.51,length:200.5,characteristic:"Standard",difficulty:"Expert",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:274275,environment:"PanicEnvironment"},{njs:18,offset:-.6,notes:381,bombs:0,obstacles:23,nps:4.371,length:200.5,characteristic:"Standard",difficulty:"ExpertPlus",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:343275,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.zip",coverURL:"https://eu.cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.jpg",previewURL:"https://eu.cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.mp3"}],curator:{id:4285122,name:"Lasso-Catsidy",avatar:"https://cdn.beatsaver.com/avatar/1daf0e4ecc153a86d14ec7913800a38fd0f0187d.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285122/playlist"},curatedAt:"2022-04-11T06:44:59.068414Z",createdAt:"2022-04-09T06:56:26.910837Z",updatedAt:"2022-04-11T06:44:59.068414Z",lastPublishedAt:"2022-04-09T06:56:40.572610Z",tags:["dance-style","anime","j-pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"291b9",name:"BLOODY STREAM (TV Size) (2022 Remaster) [JoJo's Bizarre Adventure 2nd Opening] - Coda",description:'---------Map uses the new 1.20 Note mechanics (eg: arc and chains) and won\'t work on any versions of Beat Saber below 1.20---------\n\nThanks to https://twitter.com/EuclaseW for the special request!\n\nThis map is a remap of my old Bloody Stream map. Changes include:\n- Parity fixes\n- Additional difficulties\n- Custom colors!\n- Addition of Arcs and Chains!\n\n"BLOODY STREAM" is the second opening of the JoJo\'s Bizarre Adventure by Japanese musician Kazuso Oda under the stage name "Coda".\n\nKeep up to date on my maps: https://twitter.com/Joetastic_\nMy mapper\'s profile: https://bsaber.com/members/joetastic/\nContact me on discord: @Joetastic#2501',uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:132,duration:93,songName:"BLOODY STREAM (TV Size) (2022 Remaster)",songSubName:"",songAuthorName:"Coda",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:4309,downvotes:54,score:.9838},uploaded:"2022-08-21T14:25:59.776857Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"2c6a5186b7e3f4a3b453065ee8ad042d72947102",state:"Published",createdAt:"2022-08-21T14:25:52.329353Z",sageScore:2,diffs:[{njs:12,offset:0,notes:326,bombs:29,obstacles:16,nps:3.659,length:196,characteristic:"Standard",difficulty:"Hard",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:292915,environment:"BigMirrorEnvironment"},{njs:15,offset:-.3,notes:446,bombs:18,obstacles:13,nps:5.006,length:196,characteristic:"Standard",difficulty:"Expert",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:403315,environment:"BigMirrorEnvironment"},{njs:18,offset:-.6,notes:561,bombs:22,obstacles:15,nps:6.297,length:196,characteristic:"Standard",difficulty:"ExpertPlus",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:510715,environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.zip",coverURL:"https://eu.cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.jpg",previewURL:"https://eu.cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.mp3"}],curator:{id:4285122,name:"Lasso-Catsidy",avatar:"https://cdn.beatsaver.com/avatar/1daf0e4ecc153a86d14ec7913800a38fd0f0187d.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285122/playlist"},curatedAt:"2022-09-09T02:00:15.130726Z",createdAt:"2022-08-21T14:25:52.329353Z",updatedAt:"2022-09-09T02:00:15.130726Z",lastPublishedAt:"2022-08-21T14:25:59.776857Z",tags:["dance-style","anime","j-pop","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"2ab5b",name:"Handclap - fitz and the tantrums",description:"twitch : https://www.twitch.tv/emiru_milk\ntwitter : https://twitter.com/EmirTart\ndiscord : https://discord.gg/DHwuND8K7K\nEmiru#9999",uploader:{id:4284894,name:"emiru",hash:"5d3dac6586729100069260cc",avatar:"https://cdn.beatsaver.com/avatar/59d2538aa7b938cbd28629073dc6d9be2357bee9.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284894/playlist"},metadata:{bpm:139.867,duration:196,songName:"Handclap",songSubName:"",songAuthorName:"Fitz and the Tantrums",levelAuthorName:"Emir"},stats:{plays:0,downloads:0,upvotes:5631,downvotes:75,score:.9836,reviews:3},uploaded:"2022-10-08T08:58:23.778044Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3da135c11207f5f4f2dfe7b18a6416931f66936e",state:"Published",createdAt:"2022-10-08T09:11:55.226599Z",sageScore:3,diffs:[{njs:16,offset:0,notes:196,bombs:0,obstacles:58,nps:1.078,length:423.891,characteristic:"Standard",difficulty:"Easy",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.841,paritySummary:{errors:0,warns:0,resets:0},maxScore:173075,environment:"FitBeatEnvironment"},{njs:13,offset:.152,notes:302,bombs:0,obstacles:66,nps:1.655,length:425.39,characteristic:"Standard",difficulty:"Normal",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:182.483,paritySummary:{errors:0,warns:0,resets:0},maxScore:270595,environment:"FitBeatEnvironment"},{njs:14,offset:-.168,notes:546,bombs:0,obstacles:184,nps:2.992,length:425.39,characteristic:"Standard",difficulty:"Hard",events:5221,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:182.483,paritySummary:{errors:0,warns:0,resets:0},maxScore:495075,environment:"FitBeatEnvironment"},{njs:15,offset:-.368,notes:739,bombs:0,obstacles:130,nps:3.894,length:442.374,characteristic:"Standard",difficulty:"Expert",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:0,warns:0,resets:0},maxScore:672635,environment:"FitBeatEnvironment"},{njs:16,offset:-.543,notes:925,bombs:8,obstacles:315,nps:5.057,length:426.389,characteristic:"Standard",difficulty:"ExpertPlus",events:4390,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:182.912,paritySummary:{errors:0,warns:0,resets:8},maxScore:843755,environment:"FitBeatEnvironment"},{njs:12,offset:.526,notes:350,bombs:0,obstacles:34,nps:1.844,length:442.374,characteristic:"Lawless",difficulty:"Easy",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:43,warns:22,resets:0},maxScore:314755,label:"Lawless Tutorial",environment:"FitBeatEnvironment"},{njs:13,offset:.152,notes:657,bombs:0,obstacles:2,nps:3.462,length:442.374,characteristic:"Lawless",difficulty:"Normal",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:623,warns:0,resets:0},maxScore:597195,label:"Down Notes",environment:"FitBeatEnvironment"},{njs:14,offset:-.002,notes:670,bombs:0,obstacles:2,nps:3.531,length:442.374,characteristic:"Lawless",difficulty:"Hard",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:635,warns:16,resets:0},maxScore:609155,label:"Up Notes",environment:"FitBeatEnvironment"},{njs:15,offset:-.29,notes:1050,bombs:0,obstacles:2,nps:5.533,length:442.374,characteristic:"Lawless",difficulty:"Expert",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:0,warns:78,resets:0},maxScore:958755,label:"90°Directions",environment:"FitBeatEnvironment"},{njs:16,offset:-.543,notes:1260,bombs:0,obstacles:246,nps:6.625,length:443.373,characteristic:"Lawless",difficulty:"ExpertPlus",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:190.198,paritySummary:{errors:0,warns:6,resets:0},maxScore:1151955,label:"Dodge Walls",environment:"FitBeatEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.zip",coverURL:"https://eu.cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.jpg",previewURL:"https://eu.cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.mp3"}],curator:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},curatedAt:"2022-10-08T09:19:15.538197Z",createdAt:"2022-10-08T08:57:08.316867Z",updatedAt:"2022-10-08T09:19:15.538197Z",lastPublishedAt:"2022-10-08T09:12:01.774147Z",tags:["dance-style","balanced","rock","pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"212cf",name:"Someone Else's Hat - David Maxim Micic (modchart)",description:"David Maxim Micic is a prog rock genius. I wish I had the courage to map the 8 minutes of Mbinguni Amina but a few minutes of Someone Else's Hat will have to do. I really encourage you to check his stuff, because it's so good: https://open.spotify.com/artist/0wQa1N4q3HmLwxqkpVcYhs?si=aB4m1yonTg2qk5ounpOEUw\n\nThis modchart was an opportunity for me to have fun with environment animations, and push animations to a new level. The first scene is based on the album cover that Yelka made for Who Bit the Moon, and the rest is random ideas that I thought would be cool with this music.\n\nHuge thanks to the playtesters and in particular Mawntee and Aggrogahu, who took time to give detailed feedback. I appreciate.\n\nPreview: https://youtu.be/RX-payaVsKU\n\nThe map should work on Quest too, though it won't look as good due to the difference in how walls look.\n\nIf you like what I create, tell me, I love to hear from you:\n- YouTube: https://youtube.com/c/nyri0\n- Twitter: https://twitter.com/nyri0z\n- Ko-Fi: https://ko-fi.com/nyri0",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:130,duration:207,songName:"Someone Else's Hat",songSubName:"",songAuthorName:"David Maxim Micic",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:3304,downvotes:40,score:.9835,reviews:3},uploaded:"2022-02-04T23:50:20.027446Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3662e733501d7a77850c20f0fcea792ed2187943",state:"Published",createdAt:"2022-02-04T23:05:01.786046Z",sageScore:1,diffs:[{njs:16,offset:0,notes:465,bombs:12,obstacles:1460,nps:2.38,length:423.333,characteristic:"Standard",difficulty:"Expert",events:875,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:195.385,paritySummary:{errors:83,warns:0,resets:0},maxScore:420555,label:"haut-de-forme",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.zip",coverURL:"https://eu.cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.jpg",previewURL:"https://eu.cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2022-02-04T23:50:20.027446Z",createdAt:"2022-02-04T23:05:01.786046Z",updatedAt:"2022-02-04T23:52:36.995020Z",lastPublishedAt:"2022-02-04T23:50:20.027446Z",tags:["balanced","rock"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"2c785",name:"[Arc/Chain] Let's Groove - Earth, Wind & Fire",description:"I've been wanting to do a lower tempo dance map for a while and I knew this would be the perfect song. \n\nThanks to @dolledupchaos for playtesting!",uploader:{id:4232648,name:"ramenator05",hash:"60ecf439686b9f0006a67a41",avatar:"https://cdn.beatsaver.com/avatar/4232648.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4232648/playlist"},metadata:{bpm:124,duration:236,songName:"[Arc/Chain] Let's Groove - Earth Wind & Fire",songSubName:"",songAuthorName:"Earth Wind & Fire",levelAuthorName:"ramenator05"},stats:{plays:0,downloads:0,upvotes:3479,downvotes:43,score:.9834,reviews:3},uploaded:"2022-11-28T23:00:29.688269Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"bf86263deda5f2e09867f3ddad625dfc269709be",state:"Published",createdAt:"2022-11-28T22:59:23.889170Z",sageScore:2,diffs:[{njs:15,offset:.2,notes:550,bombs:0,obstacles:0,nps:2.39,length:480,characteristic:"Standard",difficulty:"Hard",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:500755,environment:"LizzoEnvironment"},{njs:17,offset:-.2,notes:708,bombs:0,obstacles:0,nps:3.076,length:480,characteristic:"Standard",difficulty:"Expert",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:646195,environment:"LizzoEnvironment"},{njs:19,offset:.5,notes:715,bombs:0,obstacles:0,nps:3.107,length:480,characteristic:"Standard",difficulty:"ExpertPlus",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:652635,environment:"LizzoEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.zip",coverURL:"https://eu.cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.jpg",previewURL:"https://eu.cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2022-11-29T21:39:24.794532Z",createdAt:"2022-11-28T22:59:23.889170Z",updatedAt:"2022-11-29T21:39:24.794532Z",lastPublishedAt:"2022-11-28T23:00:29.688269Z",tags:["dance-style","soul","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"21bf8",name:"Marina and the Diamonds - Are You Satisfied?",description:"Thanks, Cryston!\n\nSocials: \nhttps://twitter.com/bytrius\nhttps://www.youtube.com/c/bytrius\nhttps://bsaber.com/members/bytrius/\nhttps://www.twitch.tv/bytrius",uploader:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},metadata:{bpm:124,duration:200,songName:"Are You Satisfied?",songSubName:"",songAuthorName:"Marina and the Diamonds",levelAuthorName:"Bytrius"},stats:{plays:0,downloads:0,upvotes:604,downvotes:2,score:.9832,reviews:1},uploaded:"2022-02-15T21:07:43.593089Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"7fe7f6e0f0f1687b6821891b42f3ae080d6e1270",state:"Published",createdAt:"2022-02-15T20:59:06.806428Z",sageScore:4,diffs:[{njs:15,offset:-.55,notes:459,bombs:4,obstacles:124,nps:2.585,length:367,characteristic:"Standard",difficulty:"Hard",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:177.581,paritySummary:{errors:0,warns:0,resets:2},maxScore:415035,environment:"DefaultEnvironment"},{njs:17,offset:-.725,notes:679,bombs:16,obstacles:122,nps:3.508,length:400,characteristic:"Standard",difficulty:"Expert",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:193.548,paritySummary:{errors:0,warns:0,resets:4},maxScore:617435,environment:"DefaultEnvironment"},{njs:19,offset:.125,notes:944,bombs:24,obstacles:122,nps:4.877,length:400,characteristic:"Standard",difficulty:"ExpertPlus",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:193.548,paritySummary:{errors:0,warns:0,resets:4},maxScore:861235,environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.zip",coverURL:"https://eu.cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.jpg",previewURL:"https://eu.cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2022-02-15T21:07:43.593089Z",createdAt:"2022-02-15T20:59:06.806428Z",updatedAt:"2024-08-27T09:23:17.201003Z",lastPublishedAt:"2022-02-15T21:07:43.593089Z",tags:["dance-style","pop","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"b514",name:"[[Wall Show + Chroma]] GAS GAS GAS | Manuel",description:"This wall map is a bit more intense than my others, you will need a very hefty pc to run and record this. Have Fun!\n\nHere's a playthrough: https://www.youtube.com/watch?v=hlS6r-Usnro\nHere's a playthrough by Nico (HQ Version): https://youtu.be/F_3qRxDdQc0\n\nREQUIREMENTS: \n -Noodle Extensions\n -Chroma/ChromaLite\n(fixed formatting + removed stupid metadata ;)",uploader:{id:73008,name:"thelightdesigner",hash:"5cff0b7798cc5a672c85627a",avatar:"https://cdn.beatsaver.com/avatar/fa1a30d2b4146dd93cb42537759669dcf961cf29.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/73008/playlist"},metadata:{bpm:154,duration:108,songName:"GAS GAS GAS",songSubName:"(Short Ver.)",songAuthorName:"Manuel",levelAuthorName:"KyleT"},stats:{plays:0,downloads:0,upvotes:9158,downvotes:134,score:.9832,reviews:4},uploaded:"2020-06-22T20:02:06.271Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"95e11f39b2898a38e3b5e61d2156ef5f5835f40f",key:"b514",state:"Published",createdAt:"2020-06-22T20:02:06.271Z",sageScore:3,diffs:[{njs:16.5,offset:0,notes:390,bombs:13,obstacles:13898,nps:3.832,length:261.25,characteristic:"Standard",difficulty:"Expert",events:1462,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:101.786,paritySummary:{errors:0,warns:0,resets:2},maxScore:351555,label:"GAS GAS GAS!!!!!",environment:"NiceEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.zip",coverURL:"https://eu.cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.jpg",previewURL:"https://eu.cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.mp3"}],curator:{id:1096,name:"pyrowarfare",hash:"5e99c7df3f476a0006596cdf",avatar:"https://www.gravatar.com/avatar/28fcd25e8adfa72a17daa766767daf781bee89776333a3ed7a4cc84146e6a3e8?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/1096/playlist"},curatedAt:"2020-06-22T20:02:06.271Z",createdAt:"2020-06-22T20:02:06.271Z",updatedAt:"2020-06-22T20:02:06.271Z",lastPublishedAt:"2020-06-22T20:02:06.271Z",tags:["anime","electronic","house"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1}]},function(e,t,n){if(AFRAME.registerComponent("song-info-positioner",{schema:{victory:{default:!1}},update:function(){this.data.victory?this.el.object3D.position.y=-1.2:this.el.object3D.position.y=-1}}),window.AFRAME){const t=["song-info-positioner"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){n(6);if(AFRAME.registerComponent("song-preview-system",{schema:{selectedChallengeId:{type:"string"},selectedChallengeVersion:{type:"string"}},init:function(){this.audio=document.createElement("audio"),this.audio.volume=.5},update:function(e){const t=this.data;console.log("update-song",e,t),t.selectedChallengeId&&e.selectedChallengeId!==t.selectedChallengeId?(this.audio.pause(),this.audio.setAttribute("src","https://cdn.beatsaver.com/"+t.selectedChallengeVersion+".mp3"),this.audio.currentTime=0,this.audio.play()):t.selectedChallengeId||this.audio.pause()}}),window.AFRAME){const t=["song-preview-system"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("song-progress-info",{dependencies:["geometry","material"],schema:{enabled:{default:!1}},init:function(){this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3),this.progress=this.el.getObject3D("mesh"),this.progress.geometry.translate(.285,0,0),this.el.sceneEl.addEventListener("cleargame",()=>{this.progress.scale.x=1e-4})},update:function(e){this.progress.scale.x=1e-4},updateInfo:function(){const e=this.el.sceneEl.components.song.source;if(!e||!e.buffer)return;const t=this.el.sceneEl.components.song.getCurrentTime()/e.buffer.duration;t&&(this.progress.scale.x=t)},tick:function(){this.data.enabled&&this.updateInfo()}}),window.AFRAME){const t=["song-progress-info"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){n(6);const r={once:!0};let i=AFRAME.utils.getUrlParameter("skip");if(i=i?parseInt(i)/1e3:0,AFRAME.registerComponent("song",{schema:{audio:{type:"string"},analyserEl:{type:"selector",default:"#audioAnalyser"},challengeId:{default:""},isBeatsPreloaded:{default:!1},isGameOver:{default:!1},isLoading:{default:!1},isPlaying:{default:!1},isVictory:{default:!1}},init:function(){this.analyserSetter={buffer:!0},this.audioAnalyser=this.data.analyserEl.components.audioanalyser,this.context=this.audioAnalyser.context,this.isAudioPlaying=!1,this.songStartTime=0,this.onSongComplete=this.onSongComplete.bind(this),this.audioAnalyser.gainNode.gain.value=.5,this.el.addEventListener("gamemenurestart",this.onRestart.bind(this)),this.el.addEventListener("wallhitstart",this.onWallHitStart.bind(this)),this.el.addEventListener("wallhitend",this.onWallHitEnd.bind(this))},update:function(e){const t=this.data;if(!e.isLoading&&t.isLoading&&t.audio)this.processAudio();else if(!e.audio&&t.audio&&t.isLoading)this.processAudio();else if(e.isGameOver||!t.isGameOver){if(e.isGameOver&&!t.isGameOver&&(this.audioAnalyser.gainNode.value=.5),!e.isVictory&&t.isVictory)return this.data.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.audioAnalyser.resumeContext();const t=this.audioAnalyser.gainNode.gain;t.cancelScheduledValues(0),t.setValueAtTime(.05,0),this.source=e.detail,this.source.start(),this.el.emit("victory")},r),void this.audioAnalyser.refreshSource();!e.isBeatsPreloaded&&this.data.isBeatsPreloaded&&this.source&&this.startAudio(),!e.challengeId||t.challengeId?(e.isPlaying&&!t.isPlaying&&(this.audioAnalyser.suspendContext(),this.isAudioPlaying=!1),!e.isPlaying&&t.isPlaying&&this.source&&(this.audioAnalyser.resumeContext(),this.isAudioPlaying=!0)):this.stopAudio()}else this.onGameOver()},processAudio:function(){this.el.sceneEl.emit("songprocessstart",null,!1),this.getAudio().then(e=>{this.el.sceneEl.emit("songprocessfinish",null,!1)}).catch(console.error)},getAudio:function(){const e=this.data;return this.source&&this.stopAudio(),this.isAudioPlaying=!1,new Promise(t=>{e.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.source=e.detail,t(this.source)},r),this.analyserSetter.src=this.data.audio,e.analyserEl.setAttribute("audioanalyser",this.analyserSetter)})},stopAudio:function(){this.source?(this.source.onended=null,this.isAudioPlaying&&this.source.stop(),this.source.disconnect(),this.source=null,this.isAudioPlaying=!1):console.warn("[song] Tried to stopAudio, but not playing.")},onSongComplete:function(){this.data.isPlaying&&this.el.emit("songcomplete")},onGameOver:function(){this.isAudioPlaying=!1;const e=this.source.playbackRate;e.setValueAtTime(e.value,this.context.currentTime),e.linearRampToValueAtTime(0,this.context.currentTime+3.5);const t=this.audioAnalyser.gainNode.gain;t.setValueAtTime(t.value,this.context.currentTime),t.linearRampToValueAtTime(0,this.context.currentTime+3.5),setTimeout(()=>{this.data.isGameOver&&this.stopAudio()},3500)},onRestart:function(){this.isAudioPlaying=!1,this.source&&this.source.disconnect();this.audioAnalyser.gainNode.gain.cancelScheduledValues(0),this.data.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.source=e.detail,this.el.sceneEl.emit("songloadfinish",null,!1)},r),this.audioAnalyser.refreshSource()},onWallHitStart:function(){this.audioAnalyser.gainNode.gain.linearRampToValueAtTime(.1,this.context.currentTime+.1)},onWallHitEnd:function(){this.audioAnalyser.gainNode.gain.linearRampToValueAtTime(.5,this.context.currentTime+.1)},startAudio:function(){this.audioAnalyser.gainNode.gain.setValueAtTime(.5,this.context.currentTime),this.songStartTime=this.context.currentTime,this.source.onended=this.onSongComplete,this.source.start(0,i||0),this.isAudioPlaying=!0},getCurrentTime:function(){return this.context.currentTime-this.songStartTime}}),window.AFRAME){const t=["song"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);const a=[{name:"bgcolor",property:"backglow.color"},{name:"leftglow",property:"leftsideglow.color"},{name:"rightglow",property:"rightsideglow.color"}],o=[{id:"off",dur:500,to:"off"},{id:"primary",dur:5,to:"primary"},{id:"primarybright",dur:500,from:"tertiary",to:"primarybright"},{id:"secondary",dur:5,to:"secondary"},{id:"secondarybright",dur:500,from:"tertiary",to:"secondarybright"}],s=["off","secondary","secondary","secondarybright","","primary","primary","primarybright","primarybright"];AFRAME.registerComponent("stage-colors",{schema:{colorScheme:{default:"default"}},init:function(){this.el.addEventListener("cleargame",this.resetColors.bind(this)),this.el.sceneEl.addEventListener("playbuttonclick",this.resetColors.bind(this)),function(e,t){for(let n=0;n<a.length;n++){const r=a[n];for(let n=0;n<o.length;n++){const a=o[n];e.setAttribute(`animation__${r.name}${a.id}`,{property:"systems.materials."+r.property,type:"color",isRawProperty:!0,easing:"linear",dur:a.dur,from:a.from?i.a.schemes[t][a.from]:"",startEvents:`${r.name}${a.id}`,to:i.a.schemes[t][a.to]})}}}(this.el.sceneEl,this.data.colorScheme)},update:function(e){e.colorScheme&&this.data.colorScheme!==e.colorScheme&&function(e,t){for(let n=0;n<a.length;n++){const r=a[n];for(let n=0;n<o.length;n++){const a=o[n],s=`animation__${r.name}${a.id}`;a.from&&e.setAttribute(s,"from",i.a.schemes[t][a.from]),e.setAttribute(s,"to",i.a.schemes[t][a.to])}}}(this.el.sceneEl,this.data.colorScheme)},play:function(){this.el.emit("bgcolorsecondary",null,!1)},setColor:function(e,t){s[t]||(t=5),e.startsWith("curve")?this.el.emit(e+"stageeventcolor",s[t].replace("bright",""),!1):this.el.emit(`${e}color${s[t]}`,null,!1)},setColorInstant:function(e,t){const n=this.el.sceneEl.systems.materials;if("stars"===e){let e;return e=0===t?i.a.schemes[this.data.colorScheme].secondarybright:i.a.schemes[this.data.colorScheme].secondary,void l(n.stars,"color",e)}const r=i.a.schemes[this.data.colorScheme][s[t]];"moon"===e&&l(n.moon,"tint",r)},resetColors:function(){this.el.emit("bgcolorsecondary",null,!1),this.el.emit("curveevenstageeventcolor","off",!1),this.el.emit("curveoddstageeventcolor","off",!1)}});const c=new THREE.Color;function l(e,t,n){c.set(n),e.uniforms?(e.uniforms[t].value.x=c.r,e.uniforms[t].value.y=c.g,e.uniforms[t].value.z=c.b):e[t].set(n)}if(window.AFRAME){const t=["stage-colors"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stage-lasers",{schema:{enabled:{default:!0}},init:function(){this.speed=0,this.lasers=[this.el.children[0].object3D,this.el.children[1].object3D,this.el.children[2].object3D]},pulse:function(e){this.speed=e/8},tick:function(e,t){0!==this.speed&&(t/=1e3,!this.data.enabled&&(this.speed*=.97,Math.abs(this.speed)<.01)?this.speed=0:(this.lasers[0].rotation.z+=this.speed*t,this.lasers[1].rotation.z-=this.speed*t*1.01,this.lasers[2].rotation.z+=this.speed*t*1.02))}}),window.AFRAME){const t=["stage-lasers"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0);if(AFRAME.registerComponent("stars",{schema:{color:{type:"color",default:r.initial.secondary},count:{default:500},radius:{default:300}},init:function(){const e=()=>(Math.random()-.5)*this.data.radius*2,t=new THREE.BufferGeometry;this.material=this.el.sceneEl.systems.materials.stars;const n=[];for(let t=0;t<this.data.count;t++)n.push(e(),e(),4*e());t.setAttribute("position",new THREE.Float32BufferAttribute(n,3)),t.computeBoundingSphere();const r=new THREE.Points(t,this.material);this.el.setObject3D("stars",r)},update:function(){this.material.color.setStyle(this.data.color)}}),window.AFRAME){const t=["stars"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stats-param",{init:function(){"true"===AFRAME.utils.getUrlParameter("stats")&&this.el.setAttribute("stats","")}}),window.AFRAME){const t=["stats-param"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stepback",{init:function(){this.message=document.getElementById("stepback"),this.camera=document.getElementById("camera"),this.lastTime=0,this.limit=-.9,this.throttling=300},tick:function(e,t){if(!(e-this.lastTime<this.throttling)){var n=this.camera.object3D.position,r=this.message.object3D.position;n.z<this.limit?(this.throttling=10,this.message.object3D.visible=!0,this.message.getObject3D("mesh").material.opacity=1-Math.abs(n.z-r.z),r.x=n.x,r.y=n.y):(this.message.object3D.visible=!1,this.throttling=500),this.lastTime=e}}}),window.AFRAME){const t=["stepback"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("sub-object",{schema:{from:{type:"selector"},name:{type:"string"}},init:function(){var e=this.el,t=this.data;t.from.addEventListener("model-loaded",n=>{const r=n.detail.model.getObjectByName(t.name);e.setObject3D("mesh",r.clone()),e.setAttribute("material","shader","flat"),e.emit("subobjectloaded",null,!1)})}}),window.AFRAME){const t=["sub-object"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r={superkeyboard:{wrapCount:30,inputOffsetY:.008,inputOffsetX:.08,img:"keyboard.png",hoverImg:"keyboard-hover.png",layout:[{key:"1",x:.013,y:.03,w:.093,h:.176},{key:"2",x:.106,y:.03,w:.088,h:.176},{key:"3",x:.194,y:.03,w:.077,h:.176},{key:"4",x:.271,y:.03,w:.085,h:.176},{key:"5",x:.356,y:.03,w:.081,h:.176},{key:"6",x:.437,y:.03,w:.081,h:.176},{key:"8",x:.603,y:.03,w:.082,h:.176},{key:"7",x:.519,y:.03,w:.084,h:.176},{key:"9",x:.685,y:.03,w:.076,h:.176},{key:"0",x:.76,y:.03,w:.088,h:.176},{key:"Delete",x:.867,y:.03,w:.124,h:.176},{key:"q",x:.013,y:.213,w:.098,h:.186},{key:"w",x:.111,y:.213,w:.107,h:.186},{key:"e",x:.218,y:.213,w:.096,h:.186},{key:"r",x:.313,y:.213,w:.095,h:.186},{key:"t",x:.408,y:.213,w:.094,h:.186},{key:"y",x:.503,y:.213,w:.099,h:.186},{key:"u",x:.602,y:.213,w:.097,h:.186},{key:"i",x:.701,y:.213,w:.085,h:.186},{key:"o",x:.786,y:.213,w:.099,h:.186},{key:"p",x:.885,y:.213,w:.097,h:.186},{key:"a",x:.063,y:.408,w:.1,h:.182},{key:"s",x:.163,y:.408,w:.097,h:.182},{key:"d",x:.26,y:.408,w:.098,h:.182},{key:"f",x:.358,y:.408,w:.094,h:.182},{key:"g",x:.452,y:.408,w:.1,h:.182},{key:"h",x:.552,y:.408,w:.105,h:.182},{key:"j",x:.657,y:.408,w:.085,h:.182},{key:"k",x:.743,y:.408,w:.105,h:.182},{key:"l",x:.848,y:.408,w:.1,h:.182},{key:"z",x:.107,y:.596,w:.106,h:.197},{key:"x",x:.213,y:.596,w:.1,h:.197},{key:"c",x:.313,y:.596,w:.093,h:.197},{key:"v",x:.406,y:.596,w:.096,h:.197},{key:"b",x:.502,y:.596,w:.093,h:.197},{key:"n",x:.595,y:.596,w:.099,h:.197},{key:"m",x:.694,y:.596,w:.106,h:.197},{key:" ",x:.372,y:.798,w:.249,h:.169},{key:"Insert",x:.017,y:-.001,w:.038,h:.018}]}};if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var i={roboto:17,aileronsemibold:20,dejavu:20.5,exo2bold:20,exo2semibold:20.3,kelsonsans:22.8,monoid:19.5,mozillavr:9.5,sourcecodepro:20.3};function a(e,t){for(var n=0;n<e.length;n++)if(e[n].id===t)return e[n];return null}if(AFRAME.registerComponent("super-keyboard",{schema:{align:{default:"left",oneOf:["left","center","right"]},blinkingSpeed:{type:"int",default:400},filters:{type:"array"},font:{default:"aileronsemibold"},hand:{type:"selector"},imagePath:{default:"."},injectToRaycasterObjects:{default:!0},inputColor:{type:"color",default:"#6699ff"},interval:{type:"int",default:50},keyBgColor:{type:"color",default:"#000"},keyColor:{type:"color",default:"#6699ff"},keyHoverColor:{type:"color",default:"#1A407F"},keyPressColor:{type:"color",default:"#5290F6"},label:{type:"string",default:""},labelColor:{type:"color",default:"#aaa"},maxLength:{type:"int",default:0},model:{default:"basic"},show:{default:!0},multipleInputs:{default:!1},value:{type:"string",default:""},width:{default:.8}},init:function(){this.el.addEventListener("click",this.click.bind(this)),this.changeEventDetail={},this.textInputObject={},this.keys=null,this.focused=!1,this.keyHover=null,this.prevCheckTime=null,this.shift=!1,this.rawValue=this.data.value,this.defaultValue=this.data.value,this.userFilterFunc=null,this.intervalId=0,this.kbImg=document.createElement("a-entity"),this.kbImg.classList.add("keyboardRaycastable"),this.kbImg.classList.add("superKeyboardImage"),this.kbImg.addEventListener("raycaster-intersected",this.hover.bind(this)),this.kbImg.addEventListener("raycaster-intersected-cleared",this.blur.bind(this)),this.el.appendChild(this.kbImg),this.label=document.createElement("a-entity"),this.label.setAttribute("text",{align:"center",font:this.data.font,baseline:"bottom",lineHeight:40,shader:"msdf",negate:!0,value:this.data.label,color:this.data.labelColor,width:this.data.width,wrapCount:30}),this.el.appendChild(this.label),this.textInput=document.createElement("a-entity"),this.textInput.setAttribute("mixin","superKeyboardTextInput"),this.textInput.setAttribute("text",{align:this.data.align,font:this.data.font,lineHeight:35,shader:"msdf",value:this.data.value,color:this.data.inputColor,width:this.data.width}),this.el.appendChild(this.textInput),this.cursor=document.createElement("a-entity"),this.cursor.object3D.position.set(0,0,.001),this.cursor.setAttribute("material",{shader:"flat",color:this.data.inputColor}),this.textInput.appendChild(this.cursor),this.cursorUpdated=!1,this.keyBgColor=new THREE.Color,this.keyHoverColor=new THREE.Color,this.keyPressColor=new THREE.Color;var e=this;document.addEventListener("keydown",(function(t){if("t"===t.key){for(var n="",r="abcdefghijklmopqrstuvQWIEUTGASDLIGKBXACQWETL102394676457",i=Math.floor(20*Math.random()),a=0;a<i;a++)n+=r[Math.floor(Math.random()*r.length)];e.el.setAttribute("super-keyboard",{value:n})}})),document.addEventListener("show",this.open.bind(this)),this.hand=null,this.handListenersSet=!1,this.raycaster=null},update:function(e){var t=r[this.data.model],n=this.data.width,i=this.data.width/2;if(void 0!==t){e&&this.defaultValue===e.defaultValue?this.updateTextInput(this.filter(this.rawValue)):(this.rawValue=this.data.value,this.defaultValue=this.data.value,this.updateTextInput(this.filter(this.data.value))),this.data.width===e.width&&this.data.height===e.height&&this.data.keyColor===e.keyColor||(this.kbImg.setAttribute("geometry",{primitive:"plane",width:n,height:i}),this.kbImg.setAttribute("material",{shader:"flat",src:this.data.imagePath+"/"+t.img,color:this.data.keyColor,transparent:!0})),this.data.label===e.label&&this.data.labelColor===e.labelColor&&this.data.width===e.width||(this.label.setAttribute("text",{value:this.data.label,color:this.data.labelColor,width:this.data.width}),this.label.object3D.position.set(0,.3*n,-.02)),this.data.width===e.width&&this.data.keyBgColor===e.keyBgColor||this.initKeyColorPlane();var a="center"!==this.data.align?t.inputOffsetX*n:0;"right"===this.data.align&&(a*=-1),this.data.font===e.font&&this.data.inputColor===e.inputColor&&this.data.width===e.width&&this.data.align===e.align||this.textInput.setAttribute("text",{font:this.data.font,color:this.data.inputColor,width:n,wrapCount:t.wrapCount,align:this.data.align});for(var o=0;o<t.layout.length;o++){var s=t.layout[o];"Insert"===s.key&&(this.inputRect=s)}this.textInput.object3D.position.set(a,n/4-(this.inputRect.y+this.inputRect.h/2)*n/2+t.inputOffsetY*n,.002),this.data.width!==e.width&&this.cursor.setAttribute("geometry",{primitive:"plane",width:.03*n,height:.01*n}),this.updateCursorPosition(),this.setupHand(),this.keyBgColor.set(this.data.keyBgColor),this.keyHoverColor.set(this.data.keyHoverColor),this.keyPressColor.set(this.data.keyPressColor),this.data.show?this.open():this.close()}else console.error('super-keyboard ERROR: model "'+this.data.model+'" undefined.')},tick:function(e){var t;if(!(this.prevCheckTime&&e-this.prevCheckTime<this.data.interval))if(this.prevCheckTime){if(this.raycaster&&this.focused&&(t=this.raycaster.getIntersection(this.kbImg)))for(var n=t.uv,i=r[this.data.model].layout,a=0;a<i.length;a++){var o=i[a];if(n.x>o.x&&n.x<o.x+o.w&&1-n.y>o.y&&1-n.y<o.y+o.h){this.keyHover!==o&&(this.keyHover=o,this.updateKeyColorPlane(this.keyHover.key,this.keyHoverColor));break}}}else this.prevCheckTime=e},play:function(){this.cursorUpdated&&this.startBlinking()},pause:function(){this.stopBlinking()},initKeyColorPlane:function(){var e=this.keyColorPlane=document.createElement("a-entity");e.classList.add("superKeyboardKeyColorPlane"),e.object3D.position.z=.001,e.object3D.visible=!1,e.setAttribute("geometry",{primitive:"plane"}),e.setAttribute("material",{shader:"flat",color:this.data.keyBgColor,transparent:!0}),e.addEventListener("componentinitialized",(function(e){"material"===e.detail.name&&(this.getObject3D("mesh").material.blending=THREE.AdditiveBlending)})),this.el.appendChild(e)},updateKeyColorPlane:function(e,t){var n=r[this.data.model],i=this.keyColorPlane;if(e){for(var a=0;a<n.layout.length;a++){var o=n.layout[a];if(o.key===e){var s=this.data.width,c=this.data.width/2,l=s/2,u=c/2,h=o.w*s,d=o.h*c;i.object3D.scale.x=h,i.object3D.scale.y=d,i.object3D.position.x=o.x*s-l+h/2,i.object3D.position.y=(1-o.y)*c-u-d/2,i.getObject3D("mesh").material.color.copy(t);break}}i.object3D.visible=!0}else i.object3D.visible=!1},setupHand:function(){if(this.hand&&this.hand.ownRaycaster&&this.hand.removeAttribute("raycaster"),this.data.hand?this.hand=this.data.hand:this.hand=document.querySelector(["[cursor]","[vive-controls]","[tracked-controls]","[gearvr-controls]","[oculus-go-controls]","[oculus-touch-controls]","[windows-motion-controls]","[hand-controls]","[daydream-controls] [cursor] > [raycaster]"].join(",")),this.hand){if(!this.hand.hasLoaded)return void this.hand.addEventListener("loaded",this.setupHand.bind(this));var e=this.hand.components.raycaster,t={};if(e){if(this.hand.ownRaycaster=!1,this.data.injectToRaycasterObjects){var n=e.data.objects.split(",");-1===n.indexOf(".keyboardRaycastable")&&n.push(".keyboardRaycastable"),t.objects=n.join(",").replace(/^,/,""),this.hand.setAttribute("raycaster",t)}}else this.hand.ownRaycaster=!0,t.showLine=this.data.show,t.enabled=this.data.show,this.data.injectToRaycasterObjects&&(t.objects=".keyboardRaycastable"),this.hand.setAttribute("raycaster",t);this.raycaster=this.hand.components.raycaster}else console.error('super-keyboard: no controller found. Add <a-entity> with controller or specify with super-keyboard="hand: #selectorToController".')},filter:function(e){if(""===e)return"";for(var t=0;t<this.data.filters.length;t++)switch(this.data.filters[t]){case"custom":this.userFilterFunc&&(e=this.userFilterFunc(e));break;case"allupper":e=e.toUpperCase();break;case"alllower":e=e.toLowerCase();break;case"title":e=e.split(" ").map((function(e){return e[0].toUpperCase()+e.substr(1)})).join(" ");break;case"numbers":e=e.split("").filter((function(e){return!isNaN(parseInt(e))||"."===e})).join("");break;case"first":e=e[0].toUpperCase()+e.substr(1);break;case"trim":e=e.trim()}return this.data.maxLength>0?e.substr(0,this.data.maxLength):e},click:function(e){if(this.keyHover){switch(this.keyHover.key){case"Enter":this.accept();break;case"Insert":return;case"Delete":this.rawValue=this.rawValue.substr(0,this.rawValue.length-1);var t=this.filter(this.rawValue);this.el.setAttribute("super-keyboard","value",t),this.updateTextInput(t),this.changeEventDetail.value=t,this.el.emit("superkeyboardchange",this.changeEventDetail);break;case"Shift":this.shift=!this.shift,this.keyHover.el.setAttribute("material","color",this.shift?this.data.keyHoverColor:this.data.keyBgColor);break;case"Escape":this.dismiss();break;default:if(this.data.maxLength>0&&this.rawValue.length>this.data.maxLength)break;this.rawValue+=this.shift?this.keyHover.key.toUpperCase():this.keyHover.key;t=this.filter(this.rawValue);this.el.setAttribute("super-keyboard","value",t),this.updateTextInput(t),this.changeEventDetail.value=t,this.el.emit("superkeyboardchange",this.changeEventDetail)}this.updateKeyColorPlane(this.keyHover.key,this.keyPressColor);var n=this;setTimeout((function(){n.updateKeyColorPlane(n.keyHover.key,n.keyHoverColor)}),100),this.updateCursorPosition()}},open:function(){this.el.object3D.visible=!0,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!0,enabled:!0})},close:function(){this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1})},accept:function(){this.el.emit("superkeyboardinput",{value:this.data.value}),this.data.multipleInputs?(this.rawValue="",this.data.value="",this.updateTextInput("")):(this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1}),this.data.show=!1)},dismiss:function(){this.data.value=this.defaultValue,this.updateTextInput(),this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1}),this.el.emit("superkeyboarddismiss"),this.data.show=!1},blur:function(e){this.focused=!1,this.keyHover&&"Shift"!==this.keyHover.key&&this.updateKeyColorPlane(this.keyHover.key,this.keyBgColor),this.keyHover=null},hover:function(e){this.focused=!0},startBlinking:function(){this.stopBlinking(),this.intervalId=window.setInterval(this.blink.bind(this),this.data.blinkingSpeed)},stopBlinking:function(){window.clearInterval(this.intervalId),this.intervalId=0},blink:function(){this.cursor.object3D.visible=!this.cursor.object3D.visible},setCustomFilter:function(e){this.userFilterFunc=e},addCustomModel:function(e,t){e&&(r[e]=t)},updateCursorPosition:function(){var e=this.textInput.components.text.currentFont;if(!e){var t=this;return this.cursor.object3D.visible=!1,void window.setTimeout((function(){t.updateCursorPosition(),t.startBlinking()}),700)}var n=this.data.width,o=r[this.data.model],s=-this.inputRect.h/2*n/2.4+o.inputOffsetY*n,c=this.data.width/this.textInput.components.text.data.wrapCount,l=0,u=i[this.textInput.components.text.data.font];void 0===u&&(u=20);for(var h=0;h<this.data.value.length;h++){var d=a(e.chars,this.data.value.charCodeAt(h));l+=d.width+d.xadvance*(32===d.id?2:1)}"center"===this.data.align?l=l*c*u*.0011/2+.02*n:"left"===this.data.align?(l=l*c*u*.0011+.02*n,l-=n/2):"right"===this.data.align&&(l=-l*c*u*.0011-.02*n,l+=n/2),this.cursor.object3D.position.set(l,s,.001),this.cursorUpdated=!0},updateTextInput:function(e){this.textInputObject.value=e||this.data.value,this.textInput.setAttribute("text",this.textInputObject)}}),window.AFRAME){const t=["super-keyboard"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Color;if(AFRAME.registerComponent("supercurve-color",{init:function(){const e=this.el;e.sceneEl.addEventListener("curveevenstageeventcolor",e=>{e.detail&&"off"!==e.detail?this.setColor("color1",e.detail):this.setColor("color1","primary")}),e.sceneEl.addEventListener("curveoddstageeventcolor",e=>{e.detail&&"off"!==e.detail?this.setColor("color2",e.detail):this.setColor("color2","secondary")})},setColor:function(e,t){const n=this.el.components.material.material.uniforms[e].value,i=this.el.sceneEl.systems.materials.scheme[t];r.set(i),n.x=r.r,n.y=r.g,n.z=r.b}}),window.AFRAME){const t=["supercurve-color"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("supercurve",{schema:{cameraPercent:{type:"number",is:"uniform"},color1:{type:"color",is:"uniform",default:i.a.initial.primary},color2:{type:"color",is:"uniform",default:i.a.initial.secondary},fogColor:{type:"color",is:"uniform",default:i.a.initial.primary},side:{default:"double"},transparent:{default:!0}},fragmentShader:n(168),vertexShader:n(169),update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform"),this.el.sceneEl.systems.materials.registerCurve(this.material)}}),window.AFRAME){const t=[],n=["supercurve"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 vUvs;\nvarying vec3 vWorldPos;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 fogColor;\nuniform float opacity;\n\n#define BLACK vec3(0.0)\n#define YELLOW vec3(250.0 / 255.0, 244.0 / 255.0, 180.0 / 255.0)\n\nvoid main() {\n vec3 col;\n\n // Lines.\n float f1 = clamp(sin(vUvs.x * 12.9 + 1.4) - 0.99, 0.0, 1.0) * 80.0;\n float f2 = clamp(sin(3.1416 + vUvs.x * 12.9 + 1.45) - 0.99, 0.0, 1.0) * 80.0;\n\n // Gradients.\n f1 += sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.4 + 1.4) * 0.1 + 0.1;\n f2 += sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.3 + 5.5) * 0.1 + 0.1;\n float f3 = sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.1 + 10.3) * 0.1 + 0.1;\n\n // Build color.\n col = mix(BLACK, color1, f1);\n col = mix(col, color2, f2);\n col = mix(col, YELLOW, f3);\n\n // Fog.\n float far = 100.0;\n float fog = 1.0 - clamp(length(vWorldPos - cameraPosition) / 400.0, 0.0, 1.0);\n\n col = mix(fogColor, col, fog);\n\n // fade beginning and end\n float alpha = 0.0;\n alpha += smoothstep(0.0, 0.003, vUvs.y);\n alpha -= smoothstep(0.997, 1.0, vUvs.y);\n\n gl_FragColor = vec4(col, alpha * (fog * fog));\n}\n"},function(e,t){e.exports="varying vec2 vUvs;\nvarying vec3 vWorldPos;\n\nvoid main() {\n vWorldPos = (modelMatrix * vec4(position, 1.0)).xyz;\n vUvs = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t,n){n(171),n(172);const r=new THREE.Vector3,i=new THREE.Vector3;if(AFRAME.registerComponent("supercurve",{schema:{debug:{default:!1}},init:function(){this.buffers={},this.curve=null,this.fullLength=null,this.indexes={},this.length=null,this.points=[]},play:function(){this.generateCurve(1500)},generateCurve:function(e){this.length=e,e+=200,this.fullLength=e,this.points.length=0,this.points.push(new THREE.Vector3(0,0,0)),this.points.push(new THREE.Vector3(0,0,-100));let t,n=100;for(let r=2;r<=Math.ceil(e/100)-1;r++)t=this.points[r-1],n+=100,this.points.push(new THREE.Vector3(t.x+(10*Math.random()*2-10),t.y+(10*Math.random()*2-10),-1*n));const r=new THREE.CatmullRomCurve3(this.points),i=e-r.getLength(),a=r.getTangent(1,new THREE.Vector3),o=this.points[this.points.length-1].clone().add(a.multiplyScalar(i));this.points.push(o),this.setCurve(this.points),this.el.emit("supercurvegenerate")},setCurve:function(e){const t=this.buffers,n=(this.data,this.el),a=this.indexes;this.points=e;const o=this.curve=new THREE.CatmullRomCurve3(e),s=o.getLength(),c=o.getSpacedPoints(350),l=s/350,u=new THREE.BufferGeometry;t.position=new Float32Array(2106),t.normal=new Float32Array(2106),t.uvs=new Float32Array(1404),a.position=0,a.normal=0,a.uvs=0;const h=new THREE.Vector3(-1.5,0,-1*l/2),d=new THREE.Vector3(1.5,0,-1*l/2);for(let e=0;e<c.length;e++){const o=e/(c.length-1),s=c[e];if(0===c[e].x&&0===c[e].y&&0===c[e].z?(c[e].set(.001,0,.001),i.y=-1*Math.abs(i.y)):(i.copy(r).cross(c[e]).normalize(),i.y=-1*i.y),this.getPositionRelativeToTangent(o,h,r),t.position[a.position++]=r.x,t.position[a.position++]=r.y,t.position[a.position++]=r.z,t.normal[a.normal++]=i.x,t.normal[a.normal++]=i.y,t.normal[a.normal++]=i.z,t.uvs[a.uvs++]=0,t.uvs[a.uvs++]=o,this.getPositionRelativeToTangent(o,d,r),t.position[a.position++]=r.x,t.position[a.position++]=r.y,t.position[a.position++]=r.z,t.normal[a.normal++]=i.x,t.normal[a.normal++]=i.y,t.normal[a.normal++]=i.z,t.uvs[a.uvs++]=1,t.uvs[a.uvs++]=o,this.data.debug){const e=document.createElement("a-box");e.setAttribute("geometry",{width:.1,height:.1,depth:.1}),e.setAttribute("material",{shader:"flat",color:"#333"}),e.object3D.position.copy(s),e.object3D.position.y+=.1,n.appendChild(e)}}if(u.setAttribute("normal",new THREE.BufferAttribute(t.normal,3)),u.setAttribute("position",new THREE.BufferAttribute(t.position,3)),u.setAttribute("uv",new THREE.BufferAttribute(t.uvs,2)),n.getObject3D("mesh"))n.getObject3D("mesh").geometry=THREE.BufferGeometryUtils.toTrianglesDrawMode(u,THREE.TriangleStripDrawMode);else{const e=new THREE.Mesh(THREE.BufferGeometryUtils.toTrianglesDrawMode(u,THREE.TriangleStripDrawMode));n.setObject3D("mesh",e)}},getPointAt:function(e,t){e=this.songProgressToCurveProgress(e),this.curve.getPointAt(e,t)},getTangentAt:function(e,t){e=this.songProgressToCurveProgress(e),this.curve.getTangentAt(e,t)},getPositionRelativeToTangent:function(){const e=new THREE.Object3D,t=new THREE.Vector3,n=new THREE.Vector3;return function(r,i,a,o){this.curve;return e.parent||this.el.sceneEl.object3D.add(e),r<0?(this.getPointAt(0,e.position),this.getTangentAt(0,n),e.position.addScaledVector(n,r)):r>1?(this.getPointAt(1,e.position),this.getTangentAt(1,n),e.position.addScaledVector(n,r)):(this.getPointAt(r,e.position),this.getTangentAt(r,n)),o?e.lookAt(t.copy(e.position).sub(n)):e.lookAt(t.copy(e.position).add(n)),e.updateMatrixWorld(),a.copy(i),e.localToWorld(a),a}}(),alignToCurve:function(){new THREE.Vector3,new THREE.Vector3;const e=new THREE.Vector3(0,0,-.01),t=new THREE.Vector3;return function(n,r){this.getPositionRelativeToTangent(n,e,t),r.lookAt(t),r.position.y+=.01}}(),songProgressToCurveProgress:function(e){return e*this.length/this.fullLength},curveProgressToSongProgress:function(e){return e*this.fullLength/this.length}}),AFRAME.registerComponent("supercurve-follow",{schema:{enabled:{default:!1},speed:{type:"number"},target:{type:"selector"}},init:function(){this.curveProgress=0,this.songProgress=0},update:function(){this.supercurve=this.data.target.components.supercurve},tick:function(){new THREE.Vector3(0,0,1),new THREE.Vector3;return function(e,t){const n=this.data;this.el;if(!n.enabled||!t)return;if(this.curveProgress>=1)return;const r=this.supercurve,i=r.curve;if(!i)return;this.curveProgress=this.curveProgress||0;const a=n.speed*(t/1e3);if(this.curveProgress+=a/this.supercurve.fullLength,this.data.target.components.material.material.uniforms.cameraPercent.value=this.curveProgress,this.curveProgress>=1)return this.curveProgress=1,void(this.data.target.components.material.material.uniforms.cameraPercent.value=this.curveProgress);i.getPointAt(this.curveProgress,this.el.object3D.position),this.songProgress=r.curveProgressToSongProgress(this.curveProgress),r.alignToCurve(this.songProgress,this.el.object3D)}}()}),window.AFRAME){const t=["supercurve","supercurve-follow"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){const n=THREE.Math,r=THREE.Vector3,i=THREE.Matrix4;function a(){this.type="Curve",this.arcLengthDivisions=200}var o,s,c;Object.assign(a.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e,t){var n;void 0===e&&(e=5),t?(n=t).length=0:n=[];for(var r=0;r<=e;r++)n.push(this.getPoint(r/e));return n},getSpacedPoints:function(e,t){var n;void 0===e&&(e=5),t?(n=t).length=0:n=[];for(var r=0;r<=e;r++)n.push(this.getPointAt(r/e));return n},getLength:(c=[],function(){var e=this.getLengths(void 0,c);return e[e.length-1]}),getLengths:function(e,t){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1,t&&(t.length=0);var n,r,i=t||[],a=this.getPoint(0),o=0;for(i.push(0),r=1;r<=e;r++)o+=(n=this.getPoint(r/e)).distanceTo(a),i.push(o),a=n;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(o>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(a-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(a-1)},getTangent:(o=new THREE.Vector3,s=new THREE.Vector3,function(e,t){var n,r=e-1e-4,i=e+1e-4;return r<0&&(r=0),i>1&&(i=1),this.getPoint(r,o),this.getPoint(i,s),t?(n=t).copy(s).sub(o):n=s.clone().sub(o),n.normalize()}),getTangentAt:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){var a,o,s,c=new r,l=[],u=[],h=[],d=new r,p=new i;for(a=0;a<=e;a++)o=a/e,l[a]=this.getTangentAt(o),l[a].normalize();u[0]=new r,h[0]=new r;var f=Number.MAX_VALUE,m=Math.abs(l[0].x),g=Math.abs(l[0].y),y=Math.abs(l[0].z);for(m<=f&&(f=m,c.set(1,0,0)),g<=f&&(f=g,c.set(0,1,0)),y<=f&&c.set(0,0,1),d.crossVectors(l[0],c).normalize(),u[0].crossVectors(l[0],d),h[0].crossVectors(l[0],u[0]),a=1;a<=e;a++)u[a]=u[a-1].clone(),h[a]=h[a-1].clone(),d.crossVectors(l[a-1],l[a]),d.length()>Number.EPSILON&&(d.normalize(),s=Math.acos(n.clamp(l[a-1].dot(l[a]),-1,1)),u[a].applyMatrix4(p.makeRotationAxis(d,s))),h[a].crossVectors(l[a],u[a]);if(!0===t)for(s=Math.acos(n.clamp(u[0].dot(u[e]),-1,1)),s/=e,l[0].dot(d.crossVectors(u[0],u[e]))>0&&(s=-s),a=1;a<=e;a++)u[a].applyMatrix4(p.makeRotationAxis(l[a],s*a)),h[a].crossVectors(l[a],u[a]);return{tangents:l,normals:u,binormals:h}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),THREE.Curve=a},function(e,t){const n=THREE.Vector3,r=THREE.Curve;function i(){var e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){var c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;i(t,n,c*=o,l*=o)},calc:function(i){var a=i*i;return e+t*i+n*a+r*(a*i)}}}var a=new n,o=new i,s=new i,c=new i;function l(e,t,n,i){r.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=i||.5}l.prototype=Object.create(r.prototype),l.prototype.constructor=l,l.prototype.isCatmullRomCurve3=!0,l.prototype.getPoint=function(e,t){var r,i,l,u,h=t||new n,d=this.points,p=d.length,f=(p-(this.closed?0:1))*e,m=Math.floor(f),g=f-m;if(this.closed?m+=m>0?0:(Math.floor(Math.abs(m)/p)+1)*p:0===g&&m===p-1&&(m=p-2,g=1),this.closed||m>0?r=d[(m-1)%p]:(a.subVectors(d[0],d[1]).add(d[0]),r=a),i=d[m%p],l=d[(m+1)%p],this.closed||m+2<p?u=d[(m+2)%p]:(a.subVectors(d[p-1],d[p-2]).add(d[p-1]),u=a),"centripetal"===this.curveType||"chordal"===this.curveType){var y="chordal"===this.curveType?.5:.25,v=Math.pow(r.distanceToSquared(i),y),b=Math.pow(i.distanceToSquared(l),y),w=Math.pow(l.distanceToSquared(u),y);b<1e-4&&(b=1),v<1e-4&&(v=b),w<1e-4&&(w=b),o.initNonuniformCatmullRom(r.x,i.x,l.x,u.x,v,b,w),s.initNonuniformCatmullRom(r.y,i.y,l.y,u.y,v,b,w),c.initNonuniformCatmullRom(r.z,i.z,l.z,u.z,v,b,w)}else"catmullrom"===this.curveType&&(o.initCatmullRom(r.x,i.x,l.x,u.x,this.tension),s.initCatmullRom(r.y,i.y,l.y,u.y,this.tension),c.initCatmullRom(r.z,i.z,l.z,u.z,this.tension));return h.set(o.calc(g),s.calc(g),c.calc(g)),h},l.prototype.copy=function(e){r.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},l.prototype.toJSON=function(){var e=r.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},l.prototype.fromJSON=function(e){r.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,i=e.points.length;t<i;t++){var a=e.points[t];this.points.push((new n).fromArray(a))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},THREE.CatmullRomCurve3=l},function(e,t,n){if(AFRAME.registerShader("superCutFxShader",{schema:{startTime:{type:"float",is:"uniform"},timeMs:{type:"time",is:"uniform"},color:{type:"color",is:"uniform"}},vertexShader:"\n varying vec2 uvs;\n varying vec3 worldPos;\n void main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",fragmentShader:"\n uniform float startTime;\n uniform float timeMs;\n uniform vec3 color;\n varying vec2 uvs;\n varying vec3 worldPos;\n\n void main() {\n float time = (timeMs - startTime) / 2000.0;\n vec2 p = uvs.xy - 0.5;\n float r = p.x * p.x + p.y * p.y;\n float alpha = 1.0 - smoothstep(time - 0.01, time, r);\n alpha *= smoothstep(time - 0.1, time, r);\n alpha *= 1.0 - time * 5.5;\n gl_FragColor = vec4(color, alpha);\n }\n "}),window.AFRAME){const t=[],n=["superCutFxShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Color;if(AFRAME.registerComponent("supercutfx",{schema:{colorPrimary:{type:"string"},colorSecondary:{type:"string"}},init:function(){this.rigEl=document.getElementById("curveFollowRig"),this.startTime=-1100},createSuperCut:function(e,t){const n=this.el,i=this.el.getObject3D("mesh");i.material.transparent=!0,this.rigEl.object3D.worldToLocal(n.object3D.position.copy(e.position)),n.object3D.position.z-=.25,n.object3D.visible=!0,this.startTime=n.sceneEl.time,r.set("red"===t?this.data.colorPrimary:this.data.colorSecondary);const a=i.material.uniforms.color.value;a.x=r.r,a.y=r.g,a.z=r.b,i.material.uniforms.startTime.value=this.startTime-50,n.play()},tick:function(e){e>this.startTime+1e3&&(this.el.object3D.visible=!1,this.el.pause())}}),window.AFRAME){const t=["supercutfx"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("tail",{schema:{height:{default:.1},segments:{default:10,type:"int"},target:{type:"selector"},width:{default:1}},init:function(){const e=this.data,t=this.geometry=new THREE.PlaneBufferGeometry(e.width,e.height,e.segments,1);t.deleteAttribute("normal"),t.translate(e.width/2,0,0);const n=this.el.sceneEl.systems.materials.handStarTrail,r=new THREE.Mesh(t,n);r.frustumCulled=!1,this.el.setObject3D("mesh",r),this.positions=t.attributes.position.array,this.numVerts=2*e.segments+2,this.geometry=t,this.target=e.target.object3D,this.targetPos=new THREE.Vector3},tick:function(e,t){const n=this.positions,r=this.targetPos;let i,a=this.numVerts/2*3,o=this.data.height/2;for(let e=this.numVerts/2-1;e>0;e--)i=3*e,n[i]=n[i-3],n[i+1]=n[i-2],n[i+2]=n[i-1],i+=a,n[i]=n[i-3],n[i+1]=n[i-2],n[i+2]=n[i-1];this.target.getWorldPosition(r),n[0]=r.x,n[1]=r.y+o,n[2]=r.z-.1,n[a+0]=r.x,n[a+1]=r.y-o,n[a+2]=r.z-.1,this.geometry.attributes.position.needsUpdate=!0}}),window.AFRAME){const t=["tail"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-counter",{dependencies:["text"],schema:{decimals:{default:0},dur:{default:2e3,type:"int"},enabled:{default:!1},emit:{default:!1},prefix:{default:""},suffix:{default:""},value:{default:0,type:"float"}},init:function(){this.currentValue=0,this.hasCompleted=!1,this.textValue={value:""}},update:function(e){this.currentValue=0,this.textValue.value=`${this.data.prefix}${this.decimals(0)}${this.data.suffix}`,this.el.setAttribute("text",this.textValue),this.hasCompleted=!1},tick:function(e,t){this.data.enabled&&!this.hasCompleted&&(this.currentValue+=this.data.value*(t/this.data.dur),this.currentValue>=this.data.value&&(this.currentValue=this.data.value,this.data.emit&&this.el.emit("textcounterdone",null,!1),this.hasCompleted=!0),this.textValue.value=`${this.data.prefix}${this.decimals(this.currentValue)}${this.data.suffix}`,this.el.setAttribute("text",this.textValue))},decimals:function(e){var t=Math.pow(10,this.data.decimals);return(parseInt(e*t)/t).toFixed(this.data.decimals)}}),window.AFRAME){const t=["text-counter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-truncate",{schema:{value:{type:"string"},length:{type:"int",default:10}},update:function(){this.el.setAttribute("text","value",function(e,t){if(!e)return"";if(e.length>=t)return e.substring(0,t-3)+"...";return e}(this.data.value,this.data.length))}}),window.AFRAME){const t=["text-truncate"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-uppercase",{schema:{value:{type:"string"}},update:function(){this.el.setAttribute("text","value",this.data.value.toUpperCase())}}),window.AFRAME){const t=["text-uppercase"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("toggle-pause-play",{schema:{isPlaying:{default:!1}},update:function(){const e=this.data.isPlaying?"pause":"play";parent.postMessage(JSON.stringify({verify:"game-action",action:e}),"*")}}),window.AFRAME){const t=["toggle-pause-play"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerComponent("trail",{schema:{color:{default:"primary"},colorScheme:{default:"default"},enabled:{default:!1},hand:{type:"string"}},init:function(){const e=this.geometry=new THREE.BufferGeometry,t=this.maxPoints=12,n=this.vertices=new Float32Array(36*t),r=this.colors=new Float32Array(48*t);this.bladeColor={alpha:1},this.rigContainer=document.getElementById("rigContainer"),this.bladeEl=this.el.querySelector(".blade"),this.layers=0,this.bladeTrajectory=[{top:new THREE.Vector3(-.5,0,0),center:new THREE.Vector3(0,0,0),bottom:new THREE.Vector3(.5,0,0)},{top:new THREE.Vector3(-.5,.5,0),center:new THREE.Vector3(0,.5,0),bottom:new THREE.Vector3(.5,.5,0)},{top:new THREE.Vector3(-.5,1,0),center:new THREE.Vector3(0,1,0),bottom:new THREE.Vector3(.5,1,0)}],this.newSample=null,e.setAttribute("position",new THREE.BufferAttribute(n,3).setUsage(THREE.DynamicDrawUsage)),e.setAttribute("vertexColor",new THREE.BufferAttribute(r,4).setUsage(THREE.DynamicDrawUsage));const i=new THREE.ShaderMaterial({side:THREE.DoubleSide,vertexColors:THREE.VertexColors,transparent:!0,depthTest:!1,blending:THREE.AdditiveBlending,vertexShader:["varying vec4 vColor;","attribute vec4 vertexColor;","void main() {","vec4 modelViewPosition = modelViewMatrix * vec4(position, 1.0);","vColor = vertexColor;","gl_Position = projectionMatrix * modelViewPosition;","}"].join(""),fragmentShader:["varying vec4 vColor;","uniform float pulse;","void main() {","gl_FragColor = vec4(vColor.xyz, vColor.a + pulse);","}"].join(""),uniforms:{pulse:{value:0}}}),a=this.mesh=new THREE.Mesh(e,i);a.frustumCulled=!1,a.vertices=n,this.rigContainer.setObject3D("trail__"+this.data.hand,a)},update:function(e){if(this.mesh.visible=this.data.enabled,!e.enabled&&this.data.enabled&&(this.enabledTime=this.el.sceneEl.time),e.colorScheme!==this.data.colorScheme){this.bladeColor=new THREE.Color(i.a.schemes[this.data.colorScheme][this.data.color]);this.bladeColor.red=this.bladeColor.r,this.bladeColor.green=this.bladeColor.g,this.bladeColor.blue=this.bladeColor.b}},tock:function(e,t){this.data.enabled&&(!this.mesh.visible&&e>this.enabledTime+250&&(this.mesh.visible=!0),this.mesh.material.uniforms.pulse.value*=.9,this.sampleBladePosition())},pulse:function(){this.mesh.material.uniforms.pulse.value=1},addLayer:function(e){const t=this.bladeColor,n=this.colors,r=this.segments,i=this.vertices;let a=2/r;this.layers>=this.maxLayers&&(this.layers=0);const o=this.layers*e;e=o+e;const s=this.layers*r*18,c=this.layers*r*24;for(let l=0;l<r;++l)i[s+18*l]=l*a-1,i[s+18*l+1]=o,i[s+18*l+2]=0,n[c+24*l]=t.red,n[c+24*l+1]=t.green,n[c+24*l+2]=t.blue,n[c+24*l+3]=t.alpha,i[s+18*l+3]=l*a-1,i[s+18*l+4]=e,i[s+18*l+5]=0,n[c+24*l+4]=t.red,n[c+24*l+5]=t.green,n[c+24*l+6]=t.blue,n[c+24*l+7]=t.alpha,i[s+18*l+6]=l*a-1+a,i[s+18*l+7]=e,i[s+18*l+8]=0,n[c+24*l+8]=t.red,n[c+24*l+9]=t.green,n[c+24*l+10]=t.blue,n[c+24*l+11]=t.alpha,i[s+18*l+9]=l*a-1+a,i[s+18*l+10]=o,i[s+18*l+11]=0,n[c+24*l+12]=t.red,n[c+24*l+13]=t.green,n[c+24*l+14]=t.blue,n[c+24*l+15]=t.alpha,i[s+18*l+12]=l*a-1,i[s+18*l+13]=o,i[s+18*l+14]=0,n[c+24*l+16]=t.red,n[c+24*l+17]=t.green,n[c+24*l+18]=t.blue,n[c+24*l+19]=t.alpha,i[s+18*l+15]=l*a-1+a,i[s+18*l+16]=e,i[s+18*l+17]=0,n[c+24*l+20]=t.red,n[c+24*l+21]=t.green,n[c+24*l+22]=t.blue,n[c+24*l+23]=t.alpha;this.layers++,this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.vertexColor.needsUpdate=!0,this.geometry.attributes.uv.needsUpdate=!0},initGeometry:function(){const e=this.bladeColor,t=this.geometry.attributes.vertexColor.array,n=this.geometry.attributes.position.array,r=this.bladeTrajectory;let i,a,o;for(let s=1;s<r.length;s++){1===s&&(a=i),i=1-(r.length-s)/r.length;const c=r[s];o=r[s-1],n[36*s]=o.center.x,n[36*s+1]=o.center.y,n[36*s+2]=o.center.z,t[48*s]=e.red,t[48*s+1]=e.green,t[48*s+2]=e.blue,t[48*s+3]=.2*a,n[36*s+3]=c.top.x,n[36*s+4]=c.top.y,n[36*s+5]=c.top.z,t[48*s+4]=e.red,t[48*s+5]=e.green,t[48*s+6]=e.blue,t[48*s+7]=i,n[36*s+6]=o.top.x,n[36*s+7]=o.top.y,n[36*s+8]=o.top.z,t[48*s+8]=e.red,t[48*s+9]=e.green,t[48*s+10]=e.blue,t[48*s+11]=a,n[36*s+9]=o.center.x,n[36*s+10]=o.center.y,n[36*s+11]=o.center.z,t[48*s+12]=e.red,t[48*s+13]=e.green,t[48*s+14]=e.blue,t[48*s+15]=.2*a,n[36*s+12]=c.center.x,n[36*s+13]=c.center.y,n[36*s+14]=c.center.z,t[48*s+16]=e.red,t[48*s+17]=e.green,t[48*s+18]=e.blue,t[48*s+19]=.2*i,n[36*s+15]=c.top.x,n[36*s+16]=c.top.y,n[36*s+17]=c.top.z,t[48*s+20]=e.red,t[48*s+21]=e.green,t[48*s+22]=e.blue,t[48*s+23]=i,n[36*s+18]=o.bottom.x,n[36*s+19]=o.bottom.y,n[36*s+20]=o.bottom.z,t[48*s+24]=e.red,t[48*s+25]=e.green,t[48*s+26]=e.blue,t[48*s+27]=0,n[36*s+21]=c.center.x,n[36*s+22]=c.center.y,n[36*s+23]=c.center.z,t[48*s+28]=e.red,t[48*s+29]=e.green,t[48*s+30]=e.blue,t[48*s+31]=.2*i,n[36*s+24]=o.center.x,n[36*s+25]=o.center.y,n[36*s+26]=o.center.z,t[48*s+32]=e.red,t[48*s+33]=e.green,t[48*s+34]=e.blue,t[48*s+35]=.2*a,n[36*s+27]=o.bottom.x,n[36*s+28]=o.bottom.y,n[36*s+29]=o.bottom.z,t[48*s+36]=e.red,t[48*s+37]=e.green,t[48*s+38]=e.blue,t[48*s+39]=0,n[36*s+30]=c.bottom.x,n[36*s+31]=c.bottom.y,n[36*s+32]=c.bottom.z,t[48*s+40]=e.red,t[48*s+41]=e.green,t[48*s+42]=e.blue,t[48*s+43]=0,n[36*s+33]=c.center.x,n[36*s+34]=c.center.y,n[36*s+35]=c.center.z,t[48*s+44]=e.red,t[48*s+45]=e.green,t[48*s+46]=e.blue,t[48*s+47]=.2*i,a=i}this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.vertexColor.needsUpdate=!0},sampleBladePosition:function(){let e;this.bladeTrajectory.length===this.maxPoints?(e=this.newSample=this.bladeTrajectory.shift(),e.top.set(0,-.5,0),e.center.set(0,0,0),e.bottom.set(0,.5,0)):this.newSample?(this.newSample.top.set(0,-.5,0),this.newSample.center.set(0,0,0),this.newSample.bottom.set(0,.5,0),e=this.newSample):e={top:new THREE.Vector3(0,-.5,0),center:new THREE.Vector3(0,0,0),bottom:new THREE.Vector3(0,.5,0)};const t=this.bladeEl.object3D;t.localToWorld(e.top),t.localToWorld(e.center),t.localToWorld(e.bottom),this.rigContainer.object3D.worldToLocal(e.top),this.rigContainer.object3D.worldToLocal(e.center),this.rigContainer.object3D.worldToLocal(e.bottom),this.bladeTrajectory.push(e),this.initGeometry()}}),window.AFRAME){const t=["trail"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("tunnels",{dependencies:["pool_tunnels"],schema:{isPlaying:{default:!1},songDuration:{default:0}},init:function(){this.addTunnel=this.addTunnel.bind(this),this.clearTunnels=this.clearTunnels.bind(this),this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.timeout=0,this.tunnels=[],this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3),this.el.addEventListener("cleargame",this.clearTunnels),this.el.addEventListener("gamemenuexit",this.clearTunnels),this.el.addEventListener("gamemenurestart",this.clearTunnels)},update:function(e){!e.isPlaying&&this.data.isPlaying&&this.requestTunnel(),e.isPlaying&&!this.data.isPlaying&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},play:function(){this.pool=this.el.components.pool__tunnels},requestTunnel:function(){this.timeout=setTimeout(this.addTunnel,Math.floor(3e3+1e4*Math.random()))},addTunnel:function(){const e=this.pool.requestEntity();if(!e)return;e.setAttribute("render-order","tunnel"),e.object3D.visible=!0;const t=this.curveEl.components.supercurve;let n=(this.el.components.song.getCurrentTime()+20)/this.data.songDuration;n>1&&(n=1),t.getPointAt(n,e.object3D.position),t.alignToCurve(n,e.object3D),e.play(),this.tunnels.push(e),this.requestTunnel()},clearTunnels:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null);for(let e=0;e<this.tunnels.length;e++)this.tunnels[e].object3D.visible=!1,this.pool.returnEntity(this.tunnels[e]);this.tunnels.length=0},tick:function(e,t){if(0!=this.tunnels.length)for(let e=0;e<this.tunnels.length;e++){if(!(this.tunnels[e].object3D.position.z>this.curveFollowRig.object3D.position.z+5))return;{const t=this.tunnels.splice(e,1)[0];t.object3D.visible=!1,this.pool.returnEntity(t)}}}}),window.AFRAME){const t=["tunnels"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r=new THREE.Color;if(AFRAME.registerComponent("vertex-colors-buffer",{schema:{baseColor:{type:"color"},itemSize:{default:3}},update:function(e){var t,n,i,a,o=this.data,s=this.el,c=this;if((a=this.el.getObject3D("mesh"))&&a.geometry)if((i=a.geometry).attributes.position){for(i.attributes.color||i.setAttribute("color",new THREE.BufferAttribute(new Float32Array(i.attributes.position.array.length),3)),t=i.attributes.color.array,r.set(o.baseColor),n=0;n<t.length;n+=o.itemSize)t[n]=r.r,t[n+1]=r.g,t[n+2]=r.b;i.attributes.color.needsUpdate=!0}else console.warn("Geometry has no vertices",s);else s.addEventListener("object3dset",(function t(n){"mesh"===n.detail.type&&(s.removeEventListener("object3dset",t),c.update(e))}))}}),window.AFRAME){const t=["vertex-colors-buffer"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("victory-accuracy-ring",{dependencies:["geometry","material"],schema:{accuracy:{default:0}},update:function(){this.el.getObject3D("mesh").material.uniforms.progress.value=0,this.el.setAttribute("animation","to",this.data.accuracy/100),this.el.components.animation.beginAnimation()}}),window.AFRAME){const t=["victory-accuracy-ring"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r={sphericalEnvMap:"",roughness:.8,metalness:.4},i={sphericalEnvMap:"#envmapImg",roughness:.2,metalness:.6};if(AFRAME.registerComponent("victory-rank",{schema:{isVictory:{default:!1},rank:{type:"string"}},update:function(e){const t=this.el,n=this.data.rank;if(e.isVictory&&!this.data.isVictory&&this.el.object3D.scale.set(.001,.001,.001),n)switch(t.setAttribute("text-geometry","value",n),n[0]){case"S":t.setAttribute("material",Object.assign({color:"#F0e077"},i));break;case"A":t.setAttribute("material",Object.assign({color:"#6FF9EA"},i));break;case"B":t.setAttribute("material",Object.assign({color:"#F8d"},i));break;case"C":t.setAttribute("material",Object.assign({color:"#F971C3"},r));break;case"D":t.setAttribute("material",Object.assign({color:"#1E6269"},r));break;case"F":t.setAttribute("material",Object.assign({color:"#e3170a"},r))}}}),window.AFRAME){const t=["victory-rank"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("visible-raycastable",{schema:{default:!0},update:function(){this.el.object3D.visible=this.data,this.data?this.el.setAttribute("raycastable",""):this.el.removeAttribute("raycastable","")}}),window.AFRAME){const t=["visible-raycastable"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0);if(AFRAME.registerShader("wallShader",{schema:{colorTertiary:{type:"color",is:"uniform",default:r.initial.tertiary},environment:{type:"map",is:"uniform",default:"#envmapImg"},hitLeft:{type:"vec3",is:"uniform",default:{x:0,y:9e3,z:0}},hitRight:{type:"vec3",is:"uniform",default:{x:0,y:9e3,z:0}},iTime:{type:"time",is:"uniform"},opacity:{type:"number",is:"uniform"}},vertexShader:n(187),fragmentShader:n(188)}),window.AFRAME){const t=[],n=["wallShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvarying vec3 nrml;\nvarying vec3 worldPos;\n\nvoid main() {\n uvs.xy = uv.xy;\n nrml.xyz = normal.xyz;\n vec4 p = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n worldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n gl_Position = p;\n}\n"},function(e,t){e.exports="uniform float iTime;\nuniform float opacity;\nuniform sampler2D environment;\nuniform vec3 colorTertiary;\nuniform vec3 hitLeft;\nuniform vec3 hitRight;\nvarying vec2 uvs;\nvarying vec3 nrml;\nvarying vec3 worldPos;\n\n#define SEED 19.1252\n#define time (3.0 + iTime) / 1000.0\n\nfloat noise(vec3 uv) {\n return fract(sin(uv.x*123243. + uv.y*424. + uv.z*642. + SEED) * 1524.);\n}\n\nvec4 drawHit(vec3 p, vec3 center, vec3 color) {\n center.z -= 0.1;\n float dist = 1.0 - smoothstep(0.0, 0.3, length(p - center));\n float glitch = noise(floor(p*3.0)) * 0.06 - 0.03;\n float alpha = 1.0 - smoothstep(0.0, 0.01, abs(p.z-center.z + glitch));\n alpha += 1.0 - smoothstep(0.0, 0.01, abs(p.y-center.y + glitch));\n return vec4(color * dist, alpha * dist + alpha);\n}\n\nvoid main() {\n vec2 uv1 = uvs.xy-0.5;\n float alpha = 0.0;\n // border\n alpha += smoothstep(0.44, 0.50, abs(uv1.x));\n alpha += smoothstep(0.44, 0.50, abs(uv1.y));\n alpha += smoothstep(0.486, 0.49, abs(uv1.x));\n alpha += smoothstep(0.486, 0.49, abs(uv1.y));\n alpha = min(1.0, alpha * 0.5);\n\n // weapon collision\n vec4 hit;\n hit = drawHit(worldPos, hitRight, colorTertiary);\n hit += drawHit(worldPos, hitLeft, colorTertiary);\n\n // reflection\n vec3 ray = reflect(normalize(cameraPosition - worldPos + sin(worldPos.z) * 0.1 + cos(worldPos.z * 0.3) * 0.3), nrml);\n float m = 2.0 * sqrt(pow(ray.x, 2.0) + pow(ray.y, 2.0) + pow(ray.z, 2.0));\n vec2 uv = ray.xy / m + 0.5;\n vec3 col = texture2D(environment, uv).rgb * 0.3;\n\n gl_FragColor = vec4(mix(col, colorTertiary, alpha) + hit.rgb, (alpha * 0.2 + 0.8) * opacity + hit.a);\n}\n"},function(e,t,n){"use strict";n.r(t);n(21);if(AFRAME.registerComponent("wall",{dependencies:["material"],init:function(){this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.el.setObject3D("mesh",new THREE.Mesh),this.geometry=null,this.isCeiling=!1,this.isRaycastable=!1,this.localPosition=new THREE.Vector3,this.songPosition=void 0,this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3)},play:function(){this.el.object3D.visible=!0},tick:function(e,t){const n=this.curveFollowRig.components["supercurve-follow"].songProgress;!this.isRaycastable&&n+.01>=this.songPosition&&(this.isRaycastable=!0,this.el.setAttribute("data-wall-active",""),this.isCeiling||(this.el.setAttribute("data-weapon-particles",""),this.el.setAttribute("raycastable-game",""))),n>=this.backPosition+.01&&this.returnToPool()},onGenerate:function(e,t,n,r,i,a){const o=this.el;this.isCeiling=i,this.backPosition=a,this.songPosition=e,this.setWallGeometry(e,t,n,r,i),o.getObject3D("mesh").material.uniforms.opacity.value=0,o.object3D.position.y=-5,o.components.animation__fadein.beginAnimation(),o.components.animation__scalein.beginAnimation()},setWallGeometry:function(){const e=new THREE.Vector3,t=new THREE.Vector3,n=new THREE.Vector3;return function(r,i,a,o,s){const c=this.el.sceneEl.components["beat-system"],l=this.curveEl.components.supercurve,u=r,h=r+o/l.length,d=s?1.5:2.5,p=-1*c.horizontalPositions[i]-a/2+.25;t.x=p-a/2,n.x=p+a/2;const f=(this.geometry=new THREE.BoxBufferGeometry(a,d,1,1,1,30)).attributes.position.array;for(let r=0;r<f.length;r+=3){const i=f[r+2]+.5;l.getPositionRelativeToTangent(u+i*(h-u),f[r]<0?t:n,e),f[r]=e.x,f[r+1]+=e.y+d/2,f[r+2]=e.z}let m=c.verticalPositions.middle+c.size/2;"punch"===c.data.gameMode&&(m-=.1),this.el.getObject3D("mesh").geometry=this.geometry,this.el.getObject3D("mesh").position.y=s?m:.1}}(),returnToPool:function(){this.el.object3D.visible=!1,this.el.removeAttribute("data-weapon-particles"),this.el.removeAttribute("data-wall-active"),this.el.removeAttribute("raycastable-game"),this.isCeiling=!1,this.isRaycastable=!1,this.el.isPlaying&&this.el.sceneEl.components.pool__wall.returnEntity(this.el),this.geometry&&this.geometry.dispose()}}),window.AFRAME){const t=["wall"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r={direction:{x:0,y:-.25,z:-1}},i={direction:{x:0,y:1,z:-1}};if(AFRAME.registerComponent("weapon-particles",{schema:{enabled:{default:!1},gameMode:{default:""},hand:{type:"string"}},init:function(){this.hiddenIntersection={x:999,y:0,z:0},this.intersectedEl=null,this.weaponEnter=this.weaponEnter.bind(this),this.weaponLeave=this.weaponLeave.bind(this)},update:function(e){e.gameMode!==this.data.gameMode&&this.el.setAttribute("raycaster__game","punch"===this.data.gameMode?r:i)},pause:function(){this.el.removeEventListener("mouseenter",this.weaponEnter),this.el.removeEventListener("mouseleave",this.weaponLeave)},play:function(){this.el.addEventListener("mouseenter",this.weaponEnter),this.el.addEventListener("mouseleave",this.weaponLeave)},weaponEnter:function(e){this.data.enabled&&e.target===this.el&&e.detail.intersectedEl.hasAttribute("data-weapon-particles")&&(this.intersectedEl=e.detail.intersectedEl)},weaponLeave:function(e){if(e.detail.target===this.el){if(this.intersectedEl.components.wall||"floor"===this.intersectedEl.id){const e=this.data.hand===RIGHT?"hitRight":"hitLeft";this.intersectedEl.getObject3D("mesh").material.uniforms[e].value=this.hiddenIntersection}this.intersectedEl=null}},tick:function(e,t){if(!this.data.enabled||!this.intersectedEl)return;const n=this.el.components.raycaster__game.getIntersection(this.intersectedEl);if(n&&(this.intersectedEl.components.wall||"floor"===this.intersectedEl.id)){const e="right"===this.data.hand?"hitRight":"hitLeft";this.intersectedEl.getObject3D("mesh").material.uniforms[e].value=n.point}}}),window.AFRAME){const t=["weapon-particles"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){AFRAME.registerComponent("zip-loader",{schema:{difficulties:{type:"array"},isLoading:{default:"false"},version:{type:"string"},directDownload:{type:"string"},bpm:{type:"number"}},init:function(){this.loadingIndicator=document.getElementById("zipLoaderIndicator"),this.cachedZip=null,this.cachedVersion=null,this.message={},this.worker=new Worker("build/zip.js"),this.worker.onmessage=this.onMessage.bind(this),this.worker.onerror=console.error},update:function(e){const t=this.data;e.version&&e.version!==t.version&&this.cachedVersion!==t.version&&(this.message.abort=!0,this.message.difficulties=JSON.stringify(this.data.difficulties),this.message.version=e.version,this.message.directDownload=this.data.directDownload,this.message.bpm=this.data.bpm,this.message.hash=this.data.hash,this.worker.postMessage(this.message)),t.version&&e.version!==t.version&&(this.cachedVersion=null,this.cachedZip=null,this.fetchZip(t.version)),e.isLoading||!this.data.isLoading||this.cachedVersion!==this.data.version||this.cachedZip||this.el.emit("songloaderror")},fetchZip:function(e){this.el.emit("ziploaderstart",null,!1),this.message.abort=!1,this.message.difficulties=JSON.stringify(this.data.difficulties),this.message.version=e,this.message.directDownload=this.data.directDownload,this.message.bpm=this.data.bpm,this.message.hash=this.data.hash,this.worker.postMessage(this.message)},onMessage:function(e){switch(e.data.message){case"error":this.el.emit("songloaderror");break;case"progress":if(e.data.version!==this.data.version)return;this.loadingIndicator.setAttribute("material","progress",e.data.progress);break;case"load":{let t;this.cachedVersion=e.data.version,this.cachedZip=e.data.data;const n=e.data.data.beats;for(t in n)break;if(!t)return this.cachedZip=null,void(e.data.version===this.data.version&&this.el.emit("songloaderror"));e.data.version===this.data.version&&this.el.emit("ziploaderend",e.data.data,!1);break}}}});if(window.AFRAME){const t=["zip-loader"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r={"./index.js":193};function i(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=a,e.exports=i,i.id=192},function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r);n(6);const o=n(28),s={};let c=!1;const l={Easy:"Easy",Expert:"Expert",ExpertPlus:"Expert+",Hard:"Hard",Normal:"Normal"},u={},h={author:"Juancho Pancho",difficulty:"Expert",id:"31",image:"assets/img/molerat.jpg",songDuration:100,songName:"Friday",songLength:100,songSubName:"Rebecca Black"},d="true"===AFRAME.utils.getUrlParameter("skipintro"),p=localStorage.getItem("colorScheme")||"blue";let f=localStorage.getItem("favorites-v2");if(f)try{f=JSON.parse(f)}catch(e){f=[]}else f=[];function m(e){let t=Math.ceil(e.search.results.length/6);e.search.hasPrev=e.search.page>0,e.search.hasNext=e.search.page<t-1,e.search.songNameTexts="",e.search.songSubNameTexts="",e.searchResultsPage.length=0,e.searchResultsPage.__dirty=!0;for(let t=6*e.search.page;t<6*e.search.page+6;t++){const n=e.search.results[t];if(!n)break;e.searchResultsPage.push(n),e.search.songNameTexts+=g(n.metadata.songName,22).toUpperCase()+"\n",e.search.songSubNameTexts+=g(n.metadata.songSubName||n.metadata.songAuthorName||"Unknown Artist",32)+"\n"}for(let t=0;t<e.searchResultsPage.length;t++)e.searchResultsPage[t].index=t;E(e)}function g(e,t){return e?e.length>=t?e.substring(0,t-3)+"...":e:""}AFRAME.registerState({nonBindedStateKeys:["genres"],initialState:{activeHand:localStorage.getItem("hand")||"right",challenge:{audio:"",author:"",difficulty:"",beatmapCharacteristic:"",id:AFRAME.utils.getUrlParameter("challenge"),image:"",isBeatsPreloaded:!1,numBeats:void 0,songDuration:0,songName:"",songNameShort:"",songSubName:"",metadata:{}},colorPrimary:a.a.schemes[p].primary,colorScheme:p,colorSecondary:a.a.schemes[p].secondary,colorSecondaryBright:a.a.schemes[p].secondarybright,colorTertiary:a.a.schemes[p].tertiary,controllerType:"",damage:0,difficultyFilter:"All",difficultyFilterMenuOpen:!1,favorites:f,gameMode:"ride",genre:"",genres:n(194),genreMenuOpen:!1,has3DOFVR:!1,has6DOFVR:!1,hasSongLoadError:!1,hasVR:AFRAME.utils.device.checkHeadsetConnected()||"true"===AFRAME.utils.getUrlParameter("debugvr"),introActive:!d,inVR:"true"===AFRAME.utils.getUrlParameter("debugvr"),isIOS:AFRAME.utils.device.isIOS(),isGameOver:!1,isLoading:!1,isMenuOpening:!d,isPaused:!1,isPlaying:!1,isSearching:!1,isSongProcessing:!1,isVictory:!1,isZipFetching:!1,leaderboard:[],leaderboardFetched:!1,leaderboardQualified:!1,leaderboardNames:"",leaderboardScores:"",mainMenuActive:!1,menuActive:d,menuDifficulties:[],menuDifficultiesIds:[],menuSelectedChallenge:{author:"",difficulty:"",beatmapCharacteristic:"",downloads:"",downloadsText:"",genre:"",id:"",index:-1,image:"",isFavorited:!1,numBeats:void 0,songDuration:0,songInfoText:"",songLength:void 0,numBeats:void 0,songName:"",songSubName:"",version:"",metadata:{}},optionsMenuOpen:!1,playlist:"",playlists:n(195),playlistMenuOpen:!1,playlistTitle:"",score:{accuracy:100,accuracyScore:0,accuracyInt:100,activePanel:!1,beatsHit:0,beatsMissed:0,beatsText:"",combo:0,finalAccuracy:100,maxCombo:0,rank:"",score:0},search:{activePanel:!0,page:0,hasError:!1,hasNext:!1,hasPrev:!1,query:"",queryText:"",results:[],songNameTexts:"",songSubNameTexts:"",url:"",urlPage:0},searchResultsPage:[],speed:10},handlers:{activehandswap:e=>{e.activeHand="right"===e.activeHand?"left":"right",localStorage.setItem("activeHand",e.activeHand)},beathit:(e,t)=>{e.damage>.25&&(e.damage-=.25),e.score.beatsHit++,e.score.combo++,e.score.combo>e.score.maxCombo&&(e.score.maxCombo=e.score.combo),t.score=isNaN(t.score)?100:t.score,e.score.accuracyScore+=t.percent,e.score.score+=Math.floor(t.score),M(e)},beatmiss:e=>{e.score.beatsMissed++,w(e),M(e)},beatwrong:e=>{e.score.beatsMissed++,w(e),M(e)},beatloaderpreloadfinish:e=>{e.menuActive||(e.challenge.isBeatsPreloaded=!0)},colorschemechange:(e,t)=>{e.colorScheme=t,e.colorPrimary=a.a.schemes[t].primary,e.colorSecondary=a.a.schemes[t].secondary,e.colorSecondaryBright=a.a.schemes[t].secondarybright,e.colorTertiary=a.a.schemes[t].tertiary,localStorage.setItem("colorScheme",t)},controllerconnected:(e,t)=>{e.controllerType=t.name,e.has6DOFVR=-1!==["oculus-quest-controls","oculus-touch-controls","vive-controls","windows-motion-controls","generic-tracked-controller-controls"].indexOf(e.controllerType),e.has3DOFVR=-1!==["oculus-go-controls","daydream-controls"].indexOf(e.controllerType)},debugbeatpositioning:e=>{e.gameMode="classic",e.introActive=!1,e.menuActive=!1},debuggameplay:e=>{A(e),Object.assign(e.challenge,e.menuSelectedChallenge),e.menuActive=!1,e.menuSelectedChallenge.id="",e.isSearching=!1,e.isLoading=!1},debuggameover:e=>{e.isGameOver=!0,e.menuActive=!1},debugloading:e=>{h.id="-1",Object.assign(e.menuSelectedChallenge,h),Object.assign(e.challenge,h),e.menuActive=!1,e.isSongProcessing=!0},debugvictory:e=>{Object.assign(e.menuSelectedChallenge,h),Object.assign(e.challenge,h),e.isVictory=!0,e.leaderboardQualified=!0,e.menuActive=!1,e.score.accuracy=74.99,e.score.beatsHit=125,e.score.beatsMissed=125,e.score.maxCombo=123,e.score.rank="A",e.score.score=9001,e.introActive=!1,x(e)},difficultyfilter:(e,t)=>{e.difficultyFilter=t,e.difficultyFilterMenuOpen=!1,e.menuSelectedChallenge.id=""},difficultyfiltermenuclose:e=>{e.difficultyFilterMenuOpen=!1},difficultyfiltermenuopen:e=>{e.difficultyFilterMenuOpen=!0},displayconnected:e=>{if(e.hasVR=!0,!c)try{"getVRDisplays"in navigator&&navigator.getVRDisplays().then(e=>{e.length&&(c=!0)})}catch(e){}},favoritetoggle:e=>{const t=e.menuSelectedChallenge.id,n=s[t];if(n)if(e.menuSelectedChallenge.isFavorited){e.menuSelectedChallenge.isFavorited=!1;for(let n=0;n<e.favorites.length;n++)if(e.favorites[n].id===t)return e.favorites.splice(n,1),void localStorage.setItem("favorites-v2",JSON.stringify(e.favorites))}else{if(e.menuSelectedChallenge.isFavorited=!0,e.favorites.filter(e=>e.id===t).length)return;e.favorites.push(n),localStorage.setItem("favorites-v2",JSON.stringify(e.favorites))}},gamemenuresume:e=>{e.isPaused=!1},gamemenurestart:e=>{A(e),e.challenge.isBeatsPreloaded=!1,e.isGameOver=!1,e.isPaused=!1,e.isLoading=!0,e.isVictory=!1,e.leaderboardQualified=!1},gamemenuexit:e=>{A(e),e.challenge.isBeatsPreloaded=!1,e.isGameOver=!1,e.isPaused=!1,e.isVictory=!1,e.menuActive=!0,e.menuSelectedChallenge.id=e.challenge.id,e.menuSelectedChallenge.difficulty=e.challenge.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=e.challenge.beatmapCharacteristic,e.menuSelectedChallenge.difficultyId=e.challenge.difficultyId,e.challenge.id="",e.leaderboardQualified=!1},gamemode:(e,t)=>{e.gameMode=t},genreclear:e=>{e.genre="",e.menuSelectedChallenge.id=""},genreselect:(e,t)=>{e.genre=t,e.genreMenuOpen=!1,e.menuSelectedChallenge.id="",e.playlist="",e.search.query=""},genremenuclose:e=>{e.genreMenuOpen=!1},genremenuopen:e=>{e.genreMenuOpen=!0},keyboardclose:e=>{e.isSearching=!1},keyboardopen:e=>{e.isSearching=!0,e.menuSelectedChallenge.id=""},leaderboard:(e,t)=>{e.leaderboard.length=0,e.leaderboardFetched=!0,e.leaderboardNames="",e.leaderboardScores="";for(let n=0;n<t.scores.length;n++){let r=t.scores[n];e.leaderboard.push(r),e.leaderboardNames+=`#${n+1} ${g(r.username,18)} (${Math.round(r.accuracy||0)}%)\n`,e.leaderboardScores+=r.score+"\n"}e.leaderboardLoading=!1},leaderboardqualify:e=>{e.has6DOFVR&&(e.leaderboardQualified=!0)},leaderboardscoreadded:(e,t)=>{for(let n=0;n<e.leaderboard.length;n++)if(t.scoreData.score>=e.leaderboard[n].score||n>=e.leaderboard.length-1){e.leaderboard.splice(n,0,t.scoreData);break}e.leaderboardNames="",e.leaderboardScores="";for(let t=0;t<e.leaderboard.length;t++){let n=e.leaderboard[t];e.leaderboardNames+=`${n.username} (${n.accuracy||0}%)\n`,e.leaderboardScores+=n.score+"\n"}},leaderboardsubmit:e=>{e.leaderboardQualified=!1},menuback:e=>{e.difficultyFilterMenuOpen=!1,e.genreMenuOpen=!1,e.isSearching=!1,e.optionsMenuOpen=!1,e.playlistMenuOpen=!1},menuchallengeselect:(e,t)=>{let n=s[t];if(!n)return;Object.assign(e.menuSelectedChallenge,n),e.menuSelectedChallenge.songName=g(n.metadata.songName,24),e.menuDifficulties.length=0,e.menuDifficultiesIds.length=0;const r=JSON.parse(n.metadata.characteristics);for(const t of Object.keys(r))if(!["90Degree","360Degree"].includes(t))for(const n of Object.keys(r[t])){if(null===r[t][n])continue;let i=l[n],a=i;"Standard"!==t&&(a=t+"\n"+a),e.menuDifficulties.unshift({id:t+"-"+n,filename:n+t,difficultyName:i,renderName:a,beatmapCharacteristic:t,difficulty:n})}e.menuDifficulties.sort(b);for(const t of e.menuDifficulties)e.menuDifficultiesIds.push(t.id);const i=e.menuDifficulties[0];e.menuSelectedChallenge.difficulty=i.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=i.beatmapCharacteristic,e.menuSelectedChallenge.difficultyId=i.id,e.menuSelectedChallenge.image=e.menuSelectedChallenge.coverURL,S(e,n),e.challenge.audio="",E(e),e.isSearching=!1;const a=!!e.favorites.filter(e=>e.id===t).length;e.menuSelectedChallenge.isFavorited=a,_(e),e.leaderboardLoading=!0,e.hasSongLoadError=!1,u[t]&&(e.hasSongLoadError=!0)},menuchallengeunselect:e=>{e.menuSelectedChallenge.id="",e.menuSelectedChallenge.difficultyId="",e.menuSelectedChallenge.difficulty="",e.menuSelectedChallenge.beatmapCharacteristic="",_(e)},menudifficultyselect:(e,t)=>{let n;for(const r of e.menuDifficulties)if(r.id===t){n=r;break}e.menuSelectedChallenge.difficultyId=t,e.menuSelectedChallenge.difficulty=n.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=n.beatmapCharacteristic,S(e,e.menuSelectedChallenge),_(e),e.leaderboardLoading=!0},menuopeningend:e=>{e.isMenuOpening=!1},minehit:e=>{w(e)},optionsmenuopen:e=>{e.optionsMenuOpen=!0},pausegame:e=>{e.isPlaying&&(e.isPaused=!0)},playbuttonclick:e=>{if(""===e.menuSelectedChallenge.id)return;if(u[e.menuSelectedChallenge.id])return;let t="frontpage";e.playlist&&(t="playlist"),e.search.query&&(t="search"),e.genre&&(t="genre"),gtag("event","songsource",{event_label:t}),A(e),Object.assign(e.challenge,e.menuSelectedChallenge),gtag("event","difficulty",{event_label:e.challenge.difficulty}),e.menuActive=!1,e.menuSelectedChallenge.id="",e.menuSelectedChallenge.difficulty="",e.menuSelectedChallenge.beatmapCharacteristic="",e.isSearching=!1,e.isLoading=!0,e.loadingText="Loading...",gtag("event","colorscheme",{event_label:e.colorScheme})},playlistclear:(e,t)=>{e.menuSelectedChallenge.id="",e.playlist=""},playlistselect:(e,t)=>{e.genre="",e.menuSelectedChallenge.id="",e.playlist=t.id,e.playlistTitle=t.title,e.playlistMenuOpen=!1,e.search.query=""},playlistmenuclose:e=>{e.playlistMenuOpen=!1},playlistmenuopen:e=>{e.playlistMenuOpen=!0},searcherror:(e,t)=>{e.search.hasError=!0},searchprevpage:e=>{0!==e.search.page&&(e.search.page--,m(e))},searchnextpage:e=>{e.search.page>Math.floor(e.search.results.length/6)||(e.search.page++,m(e),void 0!==e.search.url&&e.search.page+3>Math.floor(e.search.results.length/6)&&(e.search.urlPage=e.search.urlPage+1,fetch(e.search.url.replaceAll("CURRENT_PAGE_INDEX",e.search.urlPage)).then(e=>e.json()).then(t=>{var n=(t.docs||t.maps).map(o);for(e.search.results.push(...n),i=0;i<n.length;i++){let e=n[i];s[e.id]=e}})))},searchresults:(e,t)=>{var n;for(e.search.hasError=!1,e.search.page=0,e.search.url=t.url,e.search.urlPage=t.urlPage,e.search.query=t.query,e.search.queryText=g(t.query,10),e.search.results=t.results||[],n=0;n<e.search.results.length;n++){let t=e.search.results[n];s[t.id]=t}m(e),e.menuSelectedChallenge.id="",e.isSearching&&(e.genre="",e.playlist="")},songcomplete:e=>{if(gtag("event","songcomplete",{event_label:e.gameMode}),"ride"===e.gameMode||!e.inVR)return e.challenge.isBeatsPreloaded=!1,e.isVictory=!1,e.menuActive=!0,void(e.challenge.id="");e.isVictory=!0,e.score.score=isNaN(e.score.score)?0:e.score.score,M(e),e.score.finalAccuracy=e.score.accuracy;const t=parseFloat(e.score.accuracy);e.score.rank=t>=97?"S":t>=90?"A":t>=80?"B":t>=70?"C":t>=60?"D":"F",x(e)},songloadcancel:e=>{e.challenge.isBeatsPreloaded=!1,e.challenge.audio="",e.challenge.id="",e.challenge.version="",e.isZipFetching=!1,e.isLoading=!1,e.isSongProcessing=!1,e.menuActive=!0},songloaderror:e=>{u[e.menuSelectedChallenge.id||e.challenge.id]=!0,e.hasSongLoadError=!0,e.loadingText="Sorry! There was an error loading this song.\nPlease select another song.",e.challenge.id="",e.challenge.isBeatsPreloaded=!1,e.isSongProcessing=!1,e.isZipFetching=!1},songprocessfinish:e=>{e.isSongProcessing=!1,e.isLoading=!1},songprocessstart:e=>{e.isSongProcessing=!0,e.loadingText="Wrapping up..."},"enter-vr":e=>{e.inVR=AFRAME.utils.device.checkHeadsetConnected(),AFRAME.utils.device.isMobile()||(gtag("event","entervr",{}),AFRAME.utils.device.isOculusBrowser()&&gtag("event","oculusbrowser",{}))},"exit-vr":e=>{e.inVR=!1,e.isPlaying&&(e.isPaused=!0)},startgame:e=>{e.introActive=!1,e.menuActive=!0},victoryfake:e=>{e.score.accuracy="74.99",e.score.rank="C"},wallhitstart:e=>{w(e)},ziploaderend:(e,t)=>{e.challenge.audio=t.audio,e.hasSongLoadError=!1,e.menuSelectedChallenge.version="",e.isZipFetching=!1},ziploaderstart:e=>{e.challenge.isBeatsPreloaded=!1,e.isZipFetching=!0}},computeState:e=>{e.isPlaying=!(e.menuActive||e.isLoading||e.isPaused||e.isVictory||e.isGameOver||e.isZipFetching||e.isSongProcessing||!e.challenge.id||e.introActive);const t=e.menuActive||e.isPaused||e.isVictory||e.isGameOver||e.isLoading||e.introActive;e.leftRaycasterActive=t&&"left"===e.activeHand&&e.inVR,e.rightRaycasterActive=t&&"right"===e.activeHand&&e.inVR,e.mainMenuActive=e.menuActive&&!e.genreMenuOpen&&!e.difficultyFilterMenuOpen&&!e.playlistMenuOpen&&!e.optionsMenuOpen&&!e.isSearching,e.score.active="ride"!==e.gameMode&&e.inVR&&(e.isPlaying||e.isPaused)}});const y=["easy","normal","hard","expert","expertPlus"],v=["Standard"];function b(e,t){const n=y.indexOf(e.difficulty),r=y.indexOf(t.difficulty);if(n<r)return-1;if(n>r)return 1;const i=v.indexOf(e.beatmapCharacteristic),a=v.indexOf(t.beatmapCharacteristic);return i>a?-1:i<a?1:0}function w(e){e.isPlaying&&e.inVR&&(e.score.combo=0)}function A(e){e.damage=0,e.score.accuracy=100,e.score.accuracyInt=100,e.score.accuracyScore=0,e.score.beatsHit=0,e.score.beatsMissed=0,e.score.finalAccuracy=100,e.score.combo=0,e.score.maxCombo=0,e.score.score=0}function E(e){e.menuSelectedChallenge.index=-1;for(let t=0;t<e.searchResultsPage.length;t++)if(e.searchResultsPage[t].id===e.menuSelectedChallenge.id){e.menuSelectedChallenge.index=t;break}}function x(e){e.score.beatsText=`${e.score.beatsHit} / ${e.score.beatsMissed+e.score.beatsHit} BEATS`}function _(e){e.leaderboard.length=0,e.leaderboard.__dirty=!0,e.leaderboardNames="",e.leaderboardScores="",e.leaderboardFetched=!1}function S(e,t){let n=JSON.parse(t.metadata.characteristics)[e.menuSelectedChallenge.beatmapCharacteristic][e.menuSelectedChallenge.difficulty];e.menuSelectedChallenge.songInfoText=`Mapped by ${g(t.metadata.levelAuthorName,55)}\n${t.genre&&"Uncategorized"!==t.genre?t.genre+"\n":""}${function(e){e/=60;const t=""+Math.floor(e);var n=Math.round(60*(e-t));return n<10&&(n="0"+n),`${t}:${n}`}(t.metadata.duration)} / ${n.notes} notes\n${n.bombs} bombs | ${n.obstacles} obstacles\nNJS: ${n.njs}`}function M(e){const t=e.score.beatsHit+e.score.beatsMissed;e.score.accuracy=e.score.accuracyScore/(100*t)*100,e.score.accuracy=isNaN(e.score.accuracy)?100:e.score.accuracy,e.score.accuracy=e.score.accuracy.toFixed(2),e.score.accuracyInt=parseInt(e.score.accuracy)}},function(e,t){e.exports=[{name:"Pop",row:1,column:1},{name:"R&B",row:1,column:2},{name:"Rap",row:1,column:3},{name:"Rock",row:1,column:4},{name:"Soundtrack",row:1,column:5},{name:"Video Games",row:1,column:6},{name:"Electronic",row:2,column:1},{name:"Hip Hop",row:2,column:2},{name:"House",row:2,column:3},{name:"J-Pop",row:2,column:4},{name:"K-Pop",row:2,column:5},{name:"Meme",row:2,column:6},{name:"Alternative",row:3,column:1},{name:"Anime",row:3,column:2},{name:"Comedy",row:3,column:3},{name:"Dubstep",row:3,column:5},{name:"Dance",row:3,column:6}]},function(e,t){e.exports=[{name:"favorites",author:"You!",title:"Your Saved Favorites"},{name:"3966",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 1"},{name:"3967",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 2"},{name:"3968",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 3"},{name:"4134",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 4"},{name:"4135",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 5"},{name:"7483",author:"BeastSaber",title:"Maps Of The Weeks"},{name:"4137",author:"BeastSaber",title:"Curator's Picks of 2020"},{name:"4139",author:"BeastSaber",title:"Curator's Picks of 2021"},{name:"11584",author:"BeastSaber",title:"Curator's Picks of 2022"},{name:"4405",author:"BeastSaber",title:"Intro to Dance"},{name:"4138",author:"BeastSaber",title:"Mom's Maps"}]},function(e,t,n){var r=n(18);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0},a=n(201)(r,i);r.locals&&(e.exports=r.locals),e.hot.accept(18,(function(){var t=n(18);if("string"==typeof t&&(t=[[e.i,t,""]]),!function(e,t){var n,r=0;for(n in e){if(!t||e[n]!==t[n])return!1;r++}for(n in t)r--;return 0===r}(r.locals,t.locals))throw new Error("Aborting CSS HMR due to changed css-modules locals.");a(t)})),e.hot.dispose((function(){a()}))},function(e,t){e.exports=function(e){return"string"!=typeof e?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),/["'() \t\n]/.test(e)?'"'+e.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':e)}},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(o=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),a=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(a).concat([i]).join("\n")}var o;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var a=this[i][0];"number"==typeof a&&(r[a]=!0)}for(i=0;i<e.length;i++){var o=e[i];"number"==typeof o[0]&&r[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),t.push(o))}},t}},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAU0AAAGDCAMAAACYzLIyAAACWFBMVEUAAAAAkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8BkP8AkP8AkP8AkP8AkP8Bkf8AkP8AkP8Dkf8BkP8BkP8Bkf8Vj/y44P8Rl///drb/drZx/+n/drZx/+n/drb/drZx/+n/drf/drZw/+pu/upx/+n/drdx/+lWtv//drb/drbL6f9w/+r+drdx/+n/drZw/+pu/utx/+ll9exMsv9x/+lx/+lw/+r/drb/drb/drb8drf+drdx/+nh8v9q+uzR7P9w/+phu//e8f8wpf9s++qJzP8Ek/9w/urZ7v9v/url9P9x/+n9drf/drb9drdDrv9x/+l2w/9uwf9u/eps++px/+mt3P//drY7qv//drZ7xv/2d7ml2P9x/+knov9x/+m+4//W7f+03/9I1/H8drf/drYru/iZ0/+AyP/B5P//drZx/+kXp/tpvv/t9/86yvX/draU0P8gnv/+drbp9v//drZ+g9xx/+mSgdZK2fHF5v9x/+nWe8Py+f8Xp/uQz///drYbnP/3/P+f1f9x/+kVpfsxwPZO3vD/drbfecArjPMwi/IktPncesBx/+lV5e9Wh+dx/+khjfY9iu5+g9ucgNMajvhx/+mDyf8Kmv6+fcmOgte4fcr/dra5fcpGiexOiOkpjPSwfs1J2PEVpfuIgtkpufcouPj/drb/drbteLzSe8MPoPyof89KiesPoPzreLxghuQ8y/Rx/+n/drZx/+kktPnGfMc9zfNLierleb64fctd7O3oeL1x/+n/drZb6vj/////drZx/+lv/exr+vEkKZq9AAAAw3RSTlMAeUKEWG9nmlCMKho2YJMVCkolDyEwOgbfoXqEZ5R3Zm6EN0xPI4xUk7iNROZEH1qcLjacCbRgbT8qYFoVP3zxFepKvO+rD8ygVu0p83EPdTCxOsPCHRng2uCuJcUK1+2poeHt3Q8Zox7Rx+LvmEC+9xazz6cG9cVD8g8i5Lkm+SvN6qX806lINy+sQGRXLzfASDW0XEwhFWf4yFIvLBrmIVRDQjYpYjYlUdjPbF5YThhsU0xJx7rOW1RBKUlCPGTZ+uxEzOy6AABDfElEQVR42uycz05iSRTGZ2zaK9oiyP9HuAlb1oQAoUPYEFkQQowBN8pCEw0rE2NsX6Jfhxeb+nu/W/dUUVywp3smfGaSnhm7+9SvvnOq6lThXwcddNBBBx100EEHHXTQ/1dVKfYL8XXQrhzzxQuiIlNeijP+jxGuCnPkDUUDqv6ykeQ5ybOzUulSqyR1FgmAdSx/INiqAKix6YjPrJJD+fQQFMnL09NyufxNqqx0GiliDLgg+1vQgmAE0MRXUu44NYQB8bF8LtFqUZP8VqkcWVThijOO2CbJ/mto4UAABD/g4+bQqiQkhsMHAqKfgPKCoWQkBcjCSUKFk4JUgm/E9jSG1qwIn12cYEAHQM0P8IygC1psUBgRGwmI7ssSKDnITOac6ZjpHMpEigE2nAuyFtcCraa7HV+sHrQAugEa9LQ3Mg6J0YDonjzzjGWEMsMxfhX6+++vho6FANlgywSyEVomghZ0FWGIAVO64F8GO1IACUAnPxkuj/vYKjEWEAXP3YzJWLI/SaJkFJm+GPob+sq/TLwgC7RGPTAKAuhiMaMqSV1KRb+tDH4OgOAHdCpcETuEEYmhRETBc0djMpYFFgdHyUFms9lcXFmIMJZsCVmgBVvDtsZiRlVWwuIBfFsANPCZ3sgmpIcSEd2DZ14Yk7EEylwQBL3mw9Ws359djR86YXM07U0DCIQB17CtURAIWs6WqgIdWSUWDvBzAxQy6eWEAof4aMQQROgxnvnUMIUxOUvlyiBo9petNdGP18dht92YT67v+vdXnXA01YAJWiSQja1WcsNwor/ELyOBHfh5AFJ+YdgZz/pvd9eT2/lLo90edFut1nA47C4aL/Pr/jj8HkREwbN0VkwFs8hgCmMKliyGYPrWXm+r4YDB/XibPYSjUcy2IGthaxR/LY4pjkyvG2AHfG6AhN99/25yu2wPho/+odz+7Eii4MntWaymgMlLpjImz/Bev7HeUY+tdqPGbHvVaY6QQVwGW7qUQQliICe+gM/lwGYzHN+/fUzmjUWL8vNr+PHQ+R7nWUG2bwXz8rRypIzJWALlfnplpl3eCrRhs0nQgi0IQxQb4AFfDOCMObD20u6uPiP04Rg8GU6S7X6Yyphg+bladdsvtclHfzYGWuAVhDlkUzmgM1aPUZNnMCuAt0s48FM1fNA8o2zfEmZZw2T18tfApAWB1/1btpS9sbVszLwLwoZGTE2ObvazLxYPRq+LAvgrNZT5/lVm+3Y48wZMsPwN+vHjx+vr4+NqOGQL7Wr1+Mr+w/p3ahh+z3Gc5wpnfput0R8C80/UkONkPAXO0kV1i32mhvm9vT4oifM9kNl+wmonct0HMxs8d9cHEa1Ytiuc5c2ls3pxBpi91fogm1oC53nGVzqLZ0jz6ev6oA04UTqd1iyVjwqqZrbWNrUn/auHsPNwxTYoT3yHUls2xBHt/yDWcli1uNarVw/OLErnZmueu1fzWg+ba7P1Uq8/T5v8BMwPcN3/Ro1gh94XdjITx4dp771eNwc07Uxart8aBqJ0FljpdJkzr6zpgFmb1gO2eyXCOYVLx9JrdmZ9djJZDNd/kIaLxu31089xOOpJeOgjUuXYOJpPbetEPMvSCXPSPNfWzFpgtkOGMiu6p0rOIzTYRrYNx/2732Ta4YB3XRjA6bMGCHwwh7UlIIi+12y5HjCcMKcrz4U1e9SYQU6ijPpl7BfiS+grRWwYN27aUXjF+xGNwWe7FhksHHjPAN5ogOBH6dF+1Vc5IEk0F9RrNpzZjeZUeQ5rmjC/SJQZ0qxFt5b0u0GWoIVr75+ub18Wrdfd6Q15/4QXwAfJzwswjo7bQinZSD0Wtw4Onh2rOZHol3oJCtemur1AHU8zJwV6k8CVQAy2IOtGq9m+30ybohn+9DFhu4X5fPnSYA3xxaDb7Q4W7XajsZzXbieT6+uPJ7Z2dFj1Y/A0PSQwADr4GfBOINyoF+RY2BgUT4KzazcnEr1yZF2CGu+ydSJRiiuwb5C+sqnYr7koWTda9Cm9QlsU+NwGpHfT9HJafknJwaiLb9XlfU4m7BjmtCY6r5o0zxeBPugLlOJ69hI3sNY7WMAFWQPtOWELup57RAjswM8LMIaPacMVaZmNhAMVPGFPak4ciMhe80s2uQRNoybUtzJ/QnIBmdfcArKMQs0sMgimpWhhW+D1Ceho/aP3zLjahCEZSAEw+dwPAxJjETyVPecmmCtpzool1bHX7CcXoKzKct6+vyjK+6UqF148crE3NppkQQGLl3f9CsXz8MLcLVCp/2l7uhOvfjCgiAZFJ/EkBgYpSmE88lkg56nsmavbzMmaH6WLPFmDsNckq7lq3pcuJEoqwZKhlCRF2IbdzFcoRj2AcSBjccWX+Hfr2gF8yGAzGi4Y2QimzHgWi/bHv5KntGc2meth7otahxKVM88TXVhzav6Outj08yzHPZ2dpQw+o98rJRMTr1AK3BRlvBcCWgEXKjDKkGIGgR593kSjcQdzBJ7WoTEyah+ewPkUSKN9wyYJK3pBrEEvNM/FysX+PjvMvGSp39jI90rJJUStGGIQaginqLVKxpuYCv8i4v9Vy3yNiwJIohHh2IMRQAVP1/iYPy/Leu9Yp6l+LMyZJ2VTJPqNeZ4Mcho/Si3521T0Inh9Isup7XlPtxP4bkYOQg5BjsB4ZqnpArBLtrfiF0IkGrYc63ACvTnNIRg1uzL3ig634FxjmrPJcep1iNJM7txDmefuw31eZILeSOjYg/ro6mPeja7EXhe1p3GvLonqIUSOqEaVH5sFn+KvEvHo3xVNr9OftFuizfa6arGuYgfBsGgUz1OnPc8uxZmbmPNHL1qHyCLEvz14MqtmlOf2mpmXVtDRf5Ek+8u1VbUZH4QaAhyRtzxz9anKREdti6Z3X9sQDAOqeSIYV6uSmnPG1yFdOOkiFMwTVXNjnhfNt188+CaJnbRIxRDgCEzUjkKapI2m1mRANU+9bdncq2yaW07QtC5Cg3VMPVE1keckfLz9QnPAp8aMDQGOwAj2EdIE0TxvE03tWfNkwSDbaa4rc9ZdNL2LUJtZU31z3hk+Tl5+lvA8HOEawY5PJNNHUxP+lME4s73IzUnP3eONNM1j5SRQ5/pS0Rm+sgKJ3uPPEI7ACPaGWUgbDXiqYFylpxiVwpqdprGkX6olvbOOqc8THVXTHj5aAqk0H0lHYAT7w6QNilTJgmxHMHRhud7oTZwrjxnNWaIhKtZ/kLeHnwuaL+vUqt0EOTKCPWAiTULc5aRJFpXtCMakWbFk+gMIEZpoeeAcit2UM3xYIS1PMoI9YaY3Jr1eIMF4aCLT6Xbzbh3TCDS94e8/grPi3jBFxVzuGMxSvCcETgfNtrtu4pWhrSpgp09rMsJ/N2Zrx3qF6rwnzNruwXSnQY7iTE8TNXayjulZ0yyS3dd+4UMvfDnFeeu3wUSuIFX2pmlGU5c0T0HTOBl4w18s5xP+/LfR9Y7gfLfSiTzxRzMctBvLRrs79OMkqeKnWTW/90h879JDE2Y43xh++7o/GsWfpc8WG0eA9PIrfZ50WZ8DD7/Dh/6kuxEnTZV8tLJ8OM5CvhXrVfabjmB6I7Pc4bf7U9314pItMUZ04RpBNs1KlDZPum8MpP5ETXTpHD61UqSKddfjpxkf8CrI4hbJkllZe/jtn7yvYd4oCqQM6NjqiRuSXims6cmTbshQmtGICeZAW06cmNu9aLbigUQ08/bMmtpYdkTw8rrgGFe9fBDcoQvb79lxJUI0gElYGtFwxZ7EdFr2VMHcUpo/vTTRQloZg7TQjD/xHNDor2T0+tpF61x/9JX5c+FML/ghVZ4786Q7FhswFY0Ox3gSc2VZk6aWucVp8Z72NylNFhSP6XUNNUCTtKaM62XwV9Hrz3QX8GRCfixbjGA0sOOEH3bI8zqlMjCikTfr7B/jSYzt1W/3O51bP01fQ24e6O5mPmFNZBbN2Ph7pYq6MFP3h1HnETgtt3nFnfKcnIBWTRKN1JG+zdSn+kdyKiJzSzsZoHm8Hc1b0CTWRGaRo8S5vuPFdaL+cRbRCAb29DpPZ87ihjwf1APVtMwkoynLaDKq4xQ8tzxzi/cGSZr3oOlrb16DJu3ov1uMibdfFf6EAi9R9I9aKWSiptPQ5ustzUmrTkhgKmNyluLFz2UpFgyPRvCUk0uzPUzOLWhe0Z4lpSm/dbSO6U7QROed3DYRGgKmjF7+oCsl9WOA9AhEvRpQP6Q0ZxFVp01hCmOqaEoyGgRzxniiU09xNsjcRjTHW9M05/gtwLcm61SPwMQHEEX0xTz5uUolNQKV7cmtZz0awIWPI606FKY0pj0aRpTzFMmicHrmFv30By9NtN4dRcFXp9po/FZE9FXXzwOqRIa4ed3PnKg6dQtMfPLZGk1V8FSTC5zuuQUiYriMSbMKGzu3pubr46bt013k7Zd1BNoQ2aDpHEBxL2sCZqW8KRoxucDpnlt3+t4RmnQzRS8yUDVlnXqhCzLCBwsLTxgCt81kAIjNraLLmsO6iMb/EyPyfHI5TqSKa279NPOpLjIQvy3Pszr8EsJ3vFrShrBslJ7J9T0VYnZZsxkAJoxpn1zgzAahe25BM5GWH5rmWd57kZEFTSP+uqVoKpg6fJ8hMvI41SUD2HYdQqI8J/M8C5i+WYnjTOb6O+bWSfMaNFNeZCD+0L7xrnj6k8j26Kg/TmTXtqnuTpQuphYwvThlxVg55jZOMztybMnTXWTQ+JHnpEngtZW9dM6kHSreVHcnyhifdgZMD06VKsHMPbc44BiNswloprrIcMc/Jf1AL4mS8AO1ecOwg1MImWwvBtHUAqYXZ9me66McUIFmb3uaczdNxD8m1tR5Xt22kSb9QM15k8WmzOfvii1RwhRTSz8R+WCmOrrlLpq3dpoVAcrsxChMKi4aPzZ3aRu9qnRSa/2EHfxlE4liWvM8Q6bWnyqZc2rOeqzUFX2NIc8l2w/Q3BD/fco+L/xgM+ectFR9ZbNHrCnzHFO71c8sUubsmJmCwpmOJj5CYNLMKJo4L4kyDPWwBPnMQH9KA+oGrS5bls2ZxZqY2rRz+31oHgbBykszzZUl4jd3+AuJHPGnHABSne5xqSwR18ixOd3UwunYcNPCuT/NR3zgwPieOdlwoU6lM+cJUt3RlHGXzVNb2WnmvqS3JrbSODeSTNmJZttO0x1/Ty3CjjrlX5TRfqW3J25hhaU0T1JYk7R9QlvhLO9Fk16n00UI2yNHZvp3SUh1euvspWnrjw2MSp9ubplXsKrTTsVONBdraAiaznPqJMDhJaVIqvuXIXebBvsr91T46zA+4UM7vLvQHNhp+u9FUsePVA+WjuYAke8o3BFlM23ZwR+I4dFj+EV6mkZPpxVPujzaTO4WqF/+l+QdJBeRZ9lE2Uwfjb1wNoAgBU3fwxmnG6apy2b6lz2QZ/qHqcum72Zs8Hk0B3aaNUdephWtHah9oOk7pf/D3pnsphEEYTi77Sw2MUmARxhprpwRYhAR8gUNB4SQZYEvhgOWQD5ZiiySl8jr5MXSK383RdMzwwx2lkoUJ5HiFF9X9VJdXXXhGv4cliG4Z96e7j8uZXeuPtmAJ6PJV7BbT96URzxLxx02iV6aaRIO/VvS7M7Vcty0pN28h7nQbG63lrM8T5b+ZT+nqQrLaGqaM/lP96QZbg+jeeKb3ogctn7/rG0aBpX8XghLzLWDZqHz5vxJzZuRY9703ACnuBf6v6aXMPa+IA3uLH9sR/Vn7DfvitxvejMOfXUo8DDwXz0L3YOmd+zT5Hr48xf/9nM6rMnzBhioHA+q/5AYUidzDKnsiyHRBA73K2lvjpwzvikXvceLbwY5xDcBwB3fJN5A5pY0+Zvu2PvzvyD2LllhdOiuBjTHPpr+3GLnvVD/9C+5F1JD23LcC5F1j1ySQ5Cy5Dg2Oe8sw7zvLE/3ubNcpLuzxHeDozvuLNOcBXGkd5zUCrxPnz/6fbpO9oBv0vt00Iw8cQpytqAngUPlesweI9eDJiLRXA9MLf41k9gxMZQD5SF1HiUPCUlyrjykVHEWegqnCZxwrri4HLn2vjlyrWw5cirXue/KkXNsIqp0B0IrA9D1/6D5m8ep8jd7OeVv0ncZQzgKDR/SgJzzUQbdcP4xucVx1txi+DmtolchgOh+zr3hpFukPybvvfE1W947/VgdPHGhzkuLpHi3SBNMHMnfZDw79JuMVUFvMmp6Dn9XJgsLOXk6JvXIsah53wvhiUvm90JXytGfzHshOYefkYCqJwToYD+E59lv2ULi6+T12KO9ZbtdmdqAJ1XGesvW/k7esmFo3dtNerCk8WJ6GNjZ5aVBXjb631m+PNA7S4wunXI87ywxtHhyTkI02G46o0h0x+V7A4xnq0nfAC9vD/EGWIxuaXuV4M/kDbCj+AANANN3gf5lCBPnGcwBHQscT6o/S56+9+ndQ7xPV2+qNVA8Txfvqd3v01tW8YQybl3cNVL8NHtY13y1E0i1gkPWTggdtRPUe/9zrU5Zl05Qb/1dtRPu7cIeWH+b7iXd39mhg8rFqOuBt6IEp7Oux6fNuh6NA9T10KP75b1WB2U9vqxLmW+r4lM3is6QvaGfJk5qcxK+VMbsqznTXR6d0Joz57rMi6fmTC+3mjPQRo4u1LFKzhzrgkJH7e01ZxAYw2am5VnSaYjL9WTcWw/p1qhA9HGjHhJTv9h6SONt2sjRNQoivTDKIemK0cF3oowZF3NvtH84lnRgQqiePCsmtbpmO2p1vdqo1XVccK2ubQXqump0jWJdZqkuVVuq4ShrB9Okjo7rX3cnMWenDDigXUcuoh/AqtxmNWh8U2QdOVTBsSTi2iigTJQqGiXqntnSNurI2YdYe4kOcEOe9MlMD4tDshqHgf4ETNDekqvvrHE42bPGobt8ZTQ/OjXV4T+Ngot9f41D4uj+aZNeqro3Lv76myOj/uZr8UOXvOzN4eTEGDLW3/SUVo1adQGUiVV+k/n43F9/c1ePjAWmzV3R7NB13ktcG/bnUHVnEqK7NxVTG9Zf9jcK1sVhURo2iBKVUYZpEl9sYdr0VCNwGGeKusU3U6tucS++nORVtzhDSeroIa7rwsVBEC+A0lu3uGQGq/zTJg1xNV0nvlK6mtrN8TXrMjuozrq51tTOWi69ETW/qZLaPpibMxvCAd5pk3a0dG5lc6/3Hq6IMaTHWVS9d3xW130eps3E3VZr5l6QfoDlAXoRoG+Yr3x+e5JZmWab9CKAH5Ibh8CaNqnGpBMwjBPWc7g+GRXV++7MENnSDmTz0wYjC5j2+WBO+6dj2tzVpTogxomZrdAeLgDJIKIv40a/RYYVTIk2+fVwgZ/TGp8BbQKcqnstDIj2FwrCDOq3SX8hxZGDZAjRM3SjFygnC6a5dDua1cnIOmp2wzTh6J5odstzPMje+wrqk95XFebXkuO5arjN5AWRL5wsmJbLlb20QZF6jCxgump2T+3m6Z62jSH1dUyd2fuyQX3Sl02SFBzRM5y32T+G8D+hYfd7wVT0zS5l1gYzpjmy3nNK4M8UrewwTkydsM78egYqknbvdbt9vRY07EbLbm6iWbVBjzv0DESzTscZuvF1vQZVnqU3Tkyd6JdI+1muqkns8ifpZwmSmqPu0v2aCvtbDVW37JYmSrprdprJlEGQG5+OfTgFE37uWoP8xhm4DtNfxOg5e60GHqDVIem1ii72du91dAnRov/GYGp1lbe1YeoMqwmUwQUMOpVKU9cwt5smkuOSGyei8BIn/k9XH+D6Q+hQfir7AEN95lgCJUgyjqRJ96kSNOwGU3SVF0AtbcTwLvuOPsD9JZThTg4vR9d0AyY1TWw2fcZJo6+hjpvBH2iPagWUER1dzoyAVzS+iYdbelTL+y70jTdB6ibd7V7Qn47iVlAftpeqeziYWl3l2TeENmp4OdFVwNSZRHffvn+7iyazy1F9ZSijeyrLT4WG8B8Bk5om1qBsxhliR4Zm4+7+6YLEqj0cXq1qte3905VVHptd7DXHWo8BaDaQwYDu4dcPrTa+o9VVnn9T9KIn/dO1nBJlVFIFPpCYMVwwYZqVpOn9FOdXtBsQ5lne2dv/xNPbn6PEP3oOu75qPVQjb4O/6o3qyC6+M4ByA/2sBmnD2qELVeYcLLV542hF/Rymmcg44euQ5gp7XO5UmmdZ8YTHYg0xVg44Jb+QtVFqnwxuwlTnqTkzUmVnJhsxgUAbqKN0sZVRXfElS0y9Moti/Gubn8M0ExknfN2QyRLeTnnaqwkTsqvRCwY+q5zddN/4cZaY3kNPmqjltwKotUtQComvHyxl3srPAZYvcPE/JKHZi6/kmJ3wpiV0xAawIsuMI60J2TNaW269mVHQYZUcZau6T1yyv1JAbQOFNsfq7lR+OYYy8iPwhA7JEk6OEyr1czz78Bqn8nUnTmO3qJUpVbh9npHzjBacXDBZAuWqE/7aV+7nzEKpgUKbF+Iynf+C4746mFYYSrDEcaqH3b9hmghZlNLetEwcBzHwVCc7EXfEWVvELJjK8oc6VZsosT3tz/ZGiaAUNVChDUIo/IsMm2i9Ncq3YImj/j5+TiPr7Z2nbJjAuY47lhEHYoIwmvY6oMTRKTe572810HOhDoRHn7QFlNYowdJycgrzNX2m6/d1rES087nJE14jI7oI8vIor0CqSWqUjnNfIQYqgdope2zUhYhAqkJps+zNXDDT+DkNRYWOuAsyjrC8KDuEVeqULqz0mCx/OmISec+gGO63wibXVD+JiDRQguUSw0xhws/T4MRKtJvnG+w2pCDGqziuSWIJjzH2BUh1CQOFcnK+hCCQivkHsTw3TLyMynLn377byRMpXAwbYyfXTv47xNY0SeyGCpZqoLVTymFjoQUbD4VSsryCcm6Y8PO0K9HJ0dWFZ46SRFVIF0FexNbWJFOuO41uOL6+XHTieNR5uLkcDMZ3UWKgnCeGWyDlTLVop7Hmn55Lu+8tEyb8PNVKJFOZV66PEI5ULEYiVYJDkB0TqtUTbCwRdUKyyymXdRZOMPox7ibb1CugONhaaZASpDn/ONW7aB+dZIVJrwHdFGbTtiaKeC6ivDqCUxv+JOdGT7fzUzQNh+iAUK8+TZKHMI7JcCMNEl6DzZrTy0+eZ4NJLiWB0yHVUa+mA10QZVC1dqszaCa2yVgltG0G2+1BEkx7wU0CovfTZQ0hUQicxjeVXygvzwgTOBF/7jV2K92t/pi2hiyWqYK8VyzK2+ovqvBJP8lOHcmWRj7tB+ai/Av/qS1KEmU2OkpiorNFa1Ujwy2dphZ0sMFwGKb08mww8fgMT+dYbCrhnPft7uIWifnJUc7ryibpLHcs5JUULG0qrbUXJ8s9Gj/M61eMqZbaVT1eSJv0GCbCuplg0haF8PYipBtroyQr8AtbPq7jU2aP+3pyD7i9aHSb4aRxgbC+1zC1l+P+O53gybG5FrUL4dnt1I3s9M3d4XtLsEtURPWJvx4DaH5yEWjDxAPnPaS8kZLSC3NnaaCUNklOLudacIIBUQEUBpovS2WY8HICM/taJHj2wzxRsq0QUHKSeHh2vg5UnCnRx2uOFXedxnVvfZQHUEyYOqFmLy+na9F7MwOhFeaEsi/MEihlgEJ3O8e714oU8XuRzyk7suPyxzDQICeeDckShgkv3xen8PZ8eXan8HDcd+lQKZIJiSC9kxFVQG0D7UT7swzWLGGYe8GE8nLytHgO9+I56ViTJVBqkkm04kQlUGKg825uLKlh5uTtNs92RgOd/Jj3juzJEiiFTaYYZwEUBprHDNqIN1nmaJjw9g2eWYBOLmNG0rRKaZZAmcFxXAZaj6P0KB8YSsTBOctcDRNK2zw10OG0mUzPcDDSJDVKeDhFmdlA1ftYCXQepUSJPC+whGbF8USCxnA4X4zdakezy2nAQIIkR2lNlvsqXCIGCqBBZxAlIDmIgbJQlpQnVNZEjxjTYLQYXI/vmxN2cptVB5c3i84oriuOJxZJGyUpUbO/gQKoeOHZ6lxHTpDjG0ESKItlSXkCKMLBViIaorwIfIIkUBIPz8tAARRIp4vBOOxG7Ij+7a4RTZqzwWLUCuA12PcWzBI8tQlAZyZ2dBgxXjO2BpL5o6QGCuWeG0iJiKgVnX8Eywwuk3kRtVKrEcm2BCldAiRI5oqSGqgGCt02BhtDDq8xUR6CJXhqlTdSuHhAV4v8g/WIAiSBshjtABTDTUcbXmOGCDjKQ7CkKmuiL9QNoCmKIh74mCQL1bVkAjWRatGXQ5wjAoBA6R/pQoBKoshDE1y50MdnRZOkQKVyQEpGm3jNwVHSo7IOkXGoTL5IeS8FsTWQPJAo5YAUg32M1EMBUpF8FJSUqFQbiWhGkJc82j2k6Cewargx2CrjA6MtSZaePQGpCKYCqhQEeR+JIw3fcaQYbQy4BPlUSFpMKyVLKkyePQWpcCvFaEOewGj/qfKbPTqmAQAAgRgoggH/TiEhePjhbure/tu1rkJuAwAAAAAAAMCwdwariQRBGL6EiLKQQNjVVxC8zlkGFZfQF1kPQWQPiZeNBz0sngSR1ZfI6/hiW2Pb801PMehMxtUFv44QkkvyUfZ4qPrrxo2zUbfIN3JuvRKf6odTPAlx39H/JrgenXT71D/oq3mkV9PCFhAHgt3fco1m0SfamNUGeDhP79zBJD2vwtcDqX5NBPtmL1OzFKAT6Otz+2FqCrabYLSsIQx63H3IEks6jt2mzaL2fG6pQC0Qf2QHEnKR4gubOMoyWtcN+Rb2gFhSfmO3tYRa/0Yo+3LCX7ZA/OkFMXEgmhwvQhajn3WphkWE/SwD3MU4w4JXuZhVVYvavC20deSpCzBboGfP1cYd6BEDjOKz+By1U+myvgU7ZgP3MUm/qMVsrFbQarFrDYMIczxEB3fqAlQCM/2xIMYmgN8r9v8LRvFZrDBrcQ59PKTqkZxjkpPSi1nUeveBdyFgl4cZoG0PITROH/4yBOLPyXLFYU/maJYzis+ChZkaUbbhcFAF5di6VWZRi1vK1sHDDNCGOoEozWMC8RfL8/L+fBi2dUbxWTB8QlyiMhr67AUzicKUSenhrNMMBqPeqAIJw9lmyenUly3AN1C/I3kcf0pglj+2w1QAGGk9BLEVjVIgBondMtWKhLmwlgU2q7nphq1XmUfvv8umlcHICUatbzbbLXrZGyYvd1grhjvtTwvM9teU4ECbkyqD9a0wlHHrdtsY031rLV9/9odubl3FfBSL6GLv0TrcnYp5Frnb9XjWHAwSZYtZ3KIWvK1h8kKZfME98AaWowQqf+/9Xy+Tafh8QpScmXx0xKiKoMkz1GqXBhHK3yu+LGDeDlsNKdsfnUDMWrh0lVoqFzAGPDyov6wKDAJZULTeyqT/Gxt2cmC2M6Km8gfKPRFtWGoW30qKdjrZq20GgVKLWwyD1oY89CUEjqUCG8uwu9iVgBnikxi0XDJtYeKyXBbdcNl42fbHQ9SiV6iKY7DSUCdUYBBE72C5ACdTKrBUzEx85gjiRGacYUoo15mZt6N7fyKPsrU8y4ZSuxj2GAhBpG780d8/PMRelwvwnJhO/pDYR08mLi/AZrNZrebzhTHyoF0s5iv5we5SEMcpqRWEvh//aHQlMq8RQ+wui0dOW0b+PdzdSGH+VKpqWcZxmdXK7+7uxl/2zsI3qiAI4wSHQFIguBxWipQCpRToXaEUKEEqSJEipViRKwR3De7ursHd3f8tZmZ339y92XePu5Ig4SuQd/Ag4cc3M7uzG0ZoBUa7GczGOH1m4eB4jP8iyQmMNEyMU6f/nKaSjZ//KwZOTp0+8wIpZw60TyGeOGzsoi6DF42FBcpSXKE0W5BKW7R/QdByWDEQ9XnFRh+cdfxTZyMx304ObaHFtWy9NG++rKQP7oBxAzfk78gRsOldBzsz2j6UDNVTFPgvVDJ4onaUVJdaep6890zLJPucVR7oTCN7hOoYMWKc3ttn8JRhsDOZOerzH6RRM1NhwM7pcV1GDyV43EcU0vOMlw6y/kMsE/NWRZzLGcCsQV14Wg/JewvNbB3bdhk3bN5vMu2oEdh1AYAlywzACHxeTQGe7WIfCj8QBycKc9rHgg6VxuRJUqYhRl/u/o6bLdu2Fo+cHov9iNQRv9q1HMHkwPkAcLoByPwkPdmvqsHDTcxoMYkz9pxq68hahmmmnIlmLckgVnwZsCYr0bJr5y+dNmvdzIEbE6c3CvsnmAAXKX6+ABmdmgyj5Wqk6klyHjwHW83Jgd5Qxbmc6z9kKMDkCXwuqUNo1lHQXvyOOrn3JKiGP1qaDz69pA81w5dumwirhRkzFqxLhYb4zBFDhgwZMXPQoNTUBTOazZo4cdq0bUuhdgyG7AfwgJ4IYAnwodF1R/eUzqD4OAVVm8eMeY63HGI3Jwd6k6rWEpTKo6lpOiSfcYH4yAa/X7ly5diVY6RLRvtACBa5ohkMVolW9imlZMeZ8UkDRhJ8oXXzxU2lHVoLWeZv08TMO+TRq8vcATuOzWkNdMyaMs5nOoOUCSUdz/IYENcZ7GGlVY4ea2muZFzmShKVzOcc0bOh7GrWX2eICO/JzSdar5R2OtqP2sSqy9NhI8YCN/MwJ2+IxFqzWh13CSoxTSjz37Kj5O0A/PH16+Pnzp27cePqqreg+45W3XfIomsZK5/vuCbj+UmWDqyJJv1RBJP/NMFDbr179y49fdc10FqjuREyo0MbR82ldw2WG6vM2cQS6rzWHOYuQHXMAPq6NI+6qXMllm88gtY8OH4cSF69Chxfou6y8CNC1boMwnygEy4XMi5l+GWX+UV5dae2lgpf40CC17Fjxx6sjqjc7t2JKOAcnwOarZSRAX+f2c5YWx6nDmSa28wJzQ89KlTWIAx0Wc1VlMOmVKGUWkMskeSeN28ePXr0HnQnQvARoBqkN27cOAyqd/kKiM/EWZG11fnS3ww6VtStMkh+9eph9O7alf4OQRLHzFaovih6yszM7DGciPZLT++VnDw+L896+ZdH/dNap5kYpa7rkCtzJmGgkzVLon9Hc1r0Y5TzOZ1keeL4xbNX3+7ZAyRTglmBQNu2bQtbRKiwsJCYKp++fXv16jnQ69fAlK8LOcmf1cAleXcBvyKuN0H6278f4hdRds8FkpmZSDG/DWoAip7ykSoSJaDMU6iROr7V63AXzqW19PRvXiRxRW9ANWidjHOqXJ6TN5quOXHx4tkDCiWQJJAtQV0jBB+RKSF99OjNnj1vr567eBz1+jVPtSKZxQJ+CdFP8/Ua9w0mSHlrQcASUA5HSwJIoNiuXbtOLPiEVPOBKAE1PDPsVwvgaAfjVsb6EIJD5kwSaZMCfXr0ftLEeT3PxuiaE+c3AMvsDoQSSSLH1qCePcvLy3fvhh964kdgSkQDgfcpCPTA2Q0Xz58APQC572vVjS3LXXGsjotBc4FlP2BJKJEkcuzcuaKid+/eZWVl8GNFRefOyBSJElDNszjHas8ksCfVFBnrfRCnqUOSpnvl3sXEuXlfGvP8xQ0HsrM7pABLQtkVUPYsX7Ly9qTwxy9aH8OTbq/cDVCJaGHbQCArpUO24rmmKYkqGS8W/BR5K5Ev/WfMXpw8klgOzySURLJ32faDzz+Urj516uvXr6dOrS798Hz99rLeRJSAZip/jmR7ilNc2nMLc24d6tQhUYTw9VpLo7OmE+f2nNkUjFnU3mHZUpG8feGLVZOIKPBEoEHgmX2gaMP5E029rrlKxb4zOzunOLlXej/Dsp0i+XTCV5smPFVE2xmeyp4ZMVqV0pxTsA6ZxCmLkF5TcdbkOLdGORqzWwfNklBOYnpWoruBJwBtG8gCnt2y229IC02t8iuUMXs8GdOwRJRHmKSV6BEEaniSPTna7b3KPq4lJ9O0FaGokVFDKWtynFuiHI0ZdFhKlFIXVoJBMd6JZ3b7/mmhgl8B0xizh2G5XaC0Ad1uePYge3K0i1gnczb3oulbhAaBNfXLSfYoPwAw0ZiCpY9BwZ+Kp8I5p2Bq5WGyMZUvmaUPT/KntqdXtDdCc8p997iYNKO3lRNxPUVZs5EFpolyMqZg6ePPZ4Yn4iyaTNFeeZhkTKg9gqU/T6hHYE8d7RmSppMKm9lpRpX0hrqkD458dxgGOmdNCROjXBtTsPSz5xLiiTi7UbRPrTxMNqZg6ceT7EnRbsfJhWVaTG/yvrIm0JziaohS/WfyAiZEORpziazi/jwpfVJxZ5yVg4kZE4y5vvRrvCpdD/Zsk4/RrnBKmk0skb6ICQma3PLgfSivpiRMHeXxG5PTJxV3xpkwzF4IMzFjsj0p2hFnL8bpS5MjXS4350W+O1rQFDA5yhPFScmTcBZUxpndCWasjPmN5ZE9VbRDLWJ3SpqDvPMm3zK0ZQWx0jdac55WRirKy+OMclncFc7JcwoqE+Y9FMwJ3hi/G3nwLIXFEiVPDvaEaHKOnRj57jJDs5Eb5mSGicZMXBcoeRLOIo71BHOmhKkoSnnZU+Gk3FmcVymasv43VzTrumg2DaUV/RTM8IVJt27dmjTpQtg3eWaldEswdeYVe8B0g/xkJGhaccIyPh6aTaPfrUrvLvCnOTWU1r99t5SsmDC33Lq9BNZASlDzl6wMx8JZGAh2SAxn3vhkAVOo9MPTg0d6Vyj1Xo89kK+xceb2i65ESU5l2ea7F7JXrI2q31SV95UMs0MwUOgJc8ttBEkNIxI8ENGwF86uLbgSxV/O++XGhFn6HEB2hiYciLqc8AxIn6+OgTMTKpHCKVc9cdCcGXnvE2jKU6QCgJndARftXe0wt6ykvobqD6Oo5UntJQ+HlreOuxJxnGM5z2SYciEJKLE/jM030gD80AmBrvbEibsiSJ2zK0lzoKu1rGgmRcCcwxVot40l7hkJJJxmBLTgEYmiQ8O23xN/JeI4p3LOMAVLRImNduy0k/rm5yNSXJkeXG3F2WlAPuDE1Dlb0jztS5NbSCtcTQ9BkyuQjUx4pWKJILOygsFgSkpKEJSVFVBAwZ/h2JWoIKE472SDWXoQWAJKAEnnakrwhEgBqAfP7ZbUybvF+bK/KWlChwSboZG3gVIlTbKmdwXaQstH3N5gsw3UjQQPwJSAgj+Zp6xEFOsJxXmZBaZmScdpeOabm9sdvsPTcDx8UzzLJM7SMpM6Odb9afo15GbUMt3NJLc1C71gEktASSCz22tlA1EECpYmnmHvSlTE5qxcnJ86QlvFfH2QBkeTY5T6wTMewRFP3NWf8kqdHOuyk8E0a/4czVlMU1jTUoHCSwCmZokgi4r6OyoCogAU/dnCniN261iPx5x5Os4HQJxLg1WAMYllLoBM7wUaicKHdECaSzzBnhXbV9tSp471KJr13TTnM02/9uY0QXMqWZMWR+W2KEeYimVR/8lpaWlztNLSJiNQaIYST5U9pa8LhTn9rGnifL2AqY1JLNN7jUxOTi4uHo8qLobnkb3Siaeyp4z29SbWjTmZ5ljZs5Q01aujI1+dRzSp886rI7amPcqDhmUoFCqYqlUQCiFQ9KdpiJaHZayzOeOwJsV5qYSpjNlRsSyGqzF5GUp5OTnjixXPjmhPjVPGepQ5HZrjfGnaz38313Je5TjX1twtYVKUA0xgmZYWcp1NLEeg4E/gGfSI9nLHnKH4rElxLmEqY44hlq6zHiCKPMegPb1wdmJzRvXTF/nRlK13e1IoUCWIrClgmihvTyyXV2FxmkCegFNFe/nHypkzx7FmmR2mMiazFDzJnh44yxxz5tgRseGqR9NsKmxsXZouDzmroyWuAqRh0qGEZMn+xHDX0d4V/xBpziBnzgStyTDJmIal5Dke7SlxSnN6h+88QVMspuRBhgl0QKFWRxcsBTlAUc7nuXaelD31xjTsZc7Q8p/Mmj0s1lxdxjD5ANLjzJhxbj/lZc6fopkU70FGgSroljhHDLoL5LM1LKDsiThV6pTmxA2RCHUbCi9rHqlgmMKYwp4GZ6eK9V7mzMlgmq7rCT/Yu5YVJ6IgGtSNj4XgIuILRHCh+MLxAT5Q0YiPAR1QUYni20Ui6qZJQBHRLGYhAReSjbocxvWMW/0zu27n9unOuZfqm86MmWh/QEOf1DlVt6rOzUeL5vqN6iBjLdDMEn3PM4do9sFklrN63kVDr0HBmVD9ZAGix8cgo5qdQZ7vzoCpvgVwDnK9Y4IzPhAJ1T1o3gOagYMMEH2ReF6o3Qu2mxgXOKOB4CSqq0RHaEI0dxCYOpyiGD0Kzm0HEqoDzbXXPSV5wCCDiM48L9IAQtXqls7I5CFQXSd6HFL5iOrGonns6CWAWQjOS0dj6Wwu9Jv2Vjl3n06pjgPOHdrfIDT1QYaf6LPguS53yZv6cG4ZDPNvKdVVNFOif2aem4gCmDqcx8H1DJqfU6pn0bxQHM2HfjTrKdEjCk3Lc/BT0c5EOhGcoPrWYlSv3Tg04yL6G7R6a0GNKMP1LtAE1WcO3XhCaHIrg8ZCq/NjoWSnSwYZlp99olOpSTxXHiudVLlGaVav67LJRJfQTHk+FdAkFa6b4EzRBNUT4dykNYaUIdsHoJnKJhM9Cuvz8oG/4cjq8cvqBWRTAOg4QhN93mJwCtcRnECzA+EMQZMtBBbNNQmakM2te2bzqokUBHIWkU4bnBFn9V2n8NNosrngCk3muc51BGc6Hu5COAPQVEeWftlsiGoiBQUH5yDVX4tw7tqrVZxTbtn82QwMTUR6EpzNn4ImC2d5NF/mDAd1t2zOG9VECgoLTqb6DxFOSkOqbCILTyM0Q4Nz27Q0SgVNFs6h0DzrQ1OCySWbszYJcwrSg9NB9dvm11HT0BmLZofQjIUuLDQhw4ImC6egWas8KYEmj9ORhLg8orNgsSrJRfUG0pCCZv/rSTYPxF9PoakHp431Vj6p2V+n8uS5gqaynHAVaCbjNXw8Ez18XZCoTmlIiyVJQrHO4VlIMvqMZA16FB2+IjoswjnwwultSVIfBs3LPjSraShFTpkDMcOpfjsvHQh2PaU3f1EoxbIZRnS8UIK9m33hr2aa1F8Ngeb57D0gGKdbNCWl/8h+++J2I5vX7gYSPVckzDveqKKZpPTmfbdsVkIfCGeu8dFMknoYmvriTNX97a+Hk02c+1Fy4TSAs6VeIGXRbGmyGS7EFs0bpdG8TGjKfI14WQpN1o4IJVKRU3qLv92Uh5WRpKGWLTgFzU8jZPrTfrm5PTvE+G1qd+SMoEdRYh1N2UroEZqhSQjRztrRk/67QbOmohmycAg03zOaQzkAUCUsutGsBxbvOprBStyDdhCaZU6W1f0WzQZVhyNFcx5dpFA0b5lz5b7yaOIx536gyf1NtSPH/c1/PDbPWTSVuRB1ix+70fyvm0BTmwDrc6EVktMPL2VOn9ugbM7wzPKje2a5MurN3pLWm3PKxqF2DwWMgf/PQoKm4iII2PWoqio3Buf07lKe0+dogYM8wLQ4695DGt8e0kKu9T50D6mm9ZCA5j3VJV1gR67t72+eWPn9TTPK8Pc3Bc13rkR9BGgG7W+2fb33LZPQezdEx6/DvXeg+VBHU98trrrnQtGkzIUM0QfRfJBFE8dF55AcD60s8bGp6p5Zfhv1zHL735hZ3hwgOs8sBU1ldOZ3uLD7qvrFztNfT9o83S57gOg8T596btE87x32sDPwqq8lV2mP4a7HsZK7HryIxLJpx0LvXtDtUuREpaGld62r/XSC95CwJOeWzQqhyexVVg7zC5zVr8uwIzdbdkeuG7wjh70ZhCbvyMkggxtym6khRzcDOPO/COdk72/uIF9GB7IpaFINSQ05NmX4z/Ttt5O9W2x5jh8Gsjn1igHiFhIXnP7OcvvrSth7bz0Ycu8dCR3HSrv3zuTlS1LUEukRCgBD9bdFPBmV5fZkPBixJwM5aOe0tV9tfPWOEgsf07lEOs9J3foI2t8VvxAsLiX9QvvHxC8Uv0UEmKa6rsSiJ/U7giaE8+tb1csm5t/68nnZXMHZ62S9bMCTsSzgZdsXd4rNnva6Vc5ykw+W3C9GFwnCCaq7fJawBhb1WW5dHp8lvIHsC9R8ljYHseUcl0ug3FS7SJshnJbqHg8wbKvj5gGGb5U9q34P8P2cQZ0bwOwL1NOQCCeEQajO/nS2VF9L8BwPf3riqe4DCo7fNH5qvz+9m7s8YRPuMlXuSCE0yWppb4cVOPnuBLb7nxI8tbsTDo7y7gQfnEet399enlCzVydYrz/dneC82AO3Fp/1p3T9nx0uZm8uFuV03usBOL33euz/S/d6mLsoZtKLPf4wd94tTkRRFMduxN6SAUUFEaIRbFFBsBDjig1j7IqR2HvFsvbeC/beRVEQUcQ/FFECfi7vfWXOJDeTlyZ6bBtBWX85572Zt+M9i/yxHgso5HrsTLkpPjcxdAZBxybkoonWkR2lt/VBM7dWmjmzYeBwOXNmhZ45M981c2Z3s2fOnN02zMxJGYqhM6MxcmaompESPnMGA5EQdN5V3Fu6xo/bemhvycR3DJ2ROH/trjAPacS/mIekZ/gEBiJNDIxD0vN7wuch4WAPQY+JTQhbumxrwlE9dnUbdTGr62mFWV2TSmZ1Ecu/OqsLY2egnJkvNQHDugKjuiaY2VLKmHI/19bknMug48u/FZrEwpoysA8Vz5HbEDJHjnhijhxJzZEjln9xjhz+07+cfWaAkswYOYtSzj2Tc+SK0HRfLZZNOXIcUZcHH/zAhzCnxbm70ozDwcUzDoll6IzDrQ3POJyLpVPM5TNA1ZBD/k4faZRVzTiUQXcvm3JeF6IOczYwf5MUPn/zYoPzN7F0luNJefcHcE72x29SxpmlHsb7O3z+ZnhHxh6xbIprJNnA6MGcrtmw4En7EUbDmvamUZVnw06qezasGGcqhnD6w2ExGtZM2GeaGLGN2bBmSjmsKUvWUmLZLHuNlAw1Zw1zi9/vL5lb/G5r0+cWu0ftYtru9Zs8uHjstrEE8vrXHCZFE8yKc4t7ov8vVsWyKVsDpwlzorGJcTpmagPpsmXvSI3M1G58DDR0MJe7n8vppRI0y8LEohnYg7yCa9l0N1rCnPznzE70H817FyPKqxNoVpr3jhYxWBNBF8umq20V5jRZx07U/C6C1lBi6A1zdRGczdUNU3YRoPUKexCCjmWzbNTRBCzNWZJ14GxaT0YpzKhpce0RkK60i4b0ZNRXOgJjip4MWIxvuWV/OpbNSi3VcWFOk3WBs5kdLtEgSIKoC4ZZJX2LhFUzlR0uk2tJ+2/6FtrhUtoWWLKbxGUJcG3ttVg6gbORfqGLol/IcGSQhBDl1yVdoEwWTIvKmuZy2m+6ecq+O9kvhJzLDX2KLKgO34dSBZl1LJ3AWX/31VPZfRWNUqwVx96mcJvUVqg/kwXTPuvGBYrEak87xsKj+wowdc5lo/JmUZ5eqbYxIbOOpRM46+1lOyl72VpbqXFVGZK9qCmqmv1gfzJ/62WZdlVM++7aRc3SpuSuzl42YmlSPlLCRAOw3IMQVqloBXNi6Qy4c8X8ZnUG3n1CjcC9u4Cjbaq2JeDBfm8F1vfp8bcbN+6aqme91tsZSCxFZ2AfCxM5R9Bn+nsQlm+3OeXSyTijGue89WTPmvssT8o+yyfP7jz+doNIgiMjJHWQot/VUA3Trl2vHn/LJeiLkXbN80vOnfEvfv8ipRzttdz+a2CKnIs9yG3OeCFk6ewfqP6ex2lvqGuVYR49+vgxNX+/VCQtx0DFfztf5jeCTBXQ/kSUWuVLulZVQai7GtTvBg12ra7btbF3Px9meWvKcmq3OXEKzzj9WnqkvfYeYDam/frR0aNHH715Q13/bTVJy5EZRoy6G5mXFqtiykCJKHXQn+ea/qIe4CG6UTmkB/j6WWVL9NYi5esIJj0qA5hlrYmLTbc504ViJdJqJyIz6LT3DKZ9hOWpgKqO6nfBu3PuqN5d1FFtWT569ebAixe3r3Q2JAGyeyeW56Uz8YWbV2ZT8eTy9F7P49/sDqYEVFv03PbtVOh/6JDfUT1gLjqqj3z5uSSXo5Lq+3SnvuTnl5voqJ47wHYq25SPI5Zv/UZ/wJTWRNBrNmdC7URkBlP0b+8y2Z6Kp+hP5/r03dyfThxtf7pZL9VWTihfHThAKK/cumxI+hy9zMpVW6ZN2Vko1bE1a0+k0p5hykSNRR8yUDIo96ebIoyi/vRtY7W2Ffen2z56YqlTziyvdt1OxuwWBhPWxB7kMKfEyX+LTTvbs4+1p89zUqDbf7jo9ieSbEuV8UvXFMoDn58TynsdtScVSG916kRsesGh6bFNC9MeE1UeNUCNQZnnyKG6kH6C6PanF5qkraJHFz23hu869Lbr9u3amBqmzLmwpsOcyDo07VT3iEk729Pn2dpqeGqgTJSRKjFE5kggmSShpFr/S9eIZTFK7UkvvilRqEGxHWRStqgBSjy1QS+M+WEMykS5oIk1mSCy5s5VJI0tFxBLDrlhycY891AbM9J9Zr5QLuewZlXmFFlnrdmLtJfwfHKUaukVUEuUmVoNYpBM8tN3YvmKFktGSSzv3WMDKFN66c35Qu1KnMiQRS1QGPQ1G5SAMlFGyppAEEnEUZE0tpzNLGcEWG6nkBtjLp9VKNEck3NY021OZL3Mdae2p+ZJ62dUF9M/eUZAr/lEuZ/J1yReKRXJa69evXnDtlQoO9p8e6lYoX7FFp5SQIVBxyzQRJkpazz/xByZJLuSbMkZn6H2Hs2SjalYRpDyMjnv36UvW9NpTmS9PM6IsSd49olGiacGaokyU4hBMsnHhJL2nedXrlwGylMtiUKjOryDHWoN+sE3qCJKSAkqaSj9IIwEUpFUtqTnkwglsVSbTyDknTI4NoI1Tc71eYdTODhhnGskTk/ZEzy7ENCPH1tb6USXgRJR0jXWJV/04tWjx4SSr4bMYmlduXBLoTmKpcsZ9NDrC/SwDDElTZw48QeJOSqSixZPXbfOojwOlirkHozpzrk769iJpD2DPAmoIkoiqJroM2L6CFIk9YWlj7Kd2nUaCbg06EJpUH1RT9ehsy9ovabXJLq359MSoOSN3LBEyCVMDqbIuTvr2IkEztXgae/smGjv3nSUS1TvBPSYRCRvMEmg1LZc7kDZsEGJpwH6mvkZ7SKtU6IP6LVB2TbIMrMlDKbMuTvrITsR4g6efGdnjsj0ce431o0b9F3pBcmQDKI89WCam03jK6gFev7q1atv3/o81S8M8vjxfoSyLaMEy72xggOmyLkbp9yJJE+2gCFq9JKwvrS6/fI2gbQkfZRedkvhLyq2FwZloJ2Z6Hb6vK72Ox6Qf5DaqzOj1Czlgilhcs5hzdp2ovS+UJ64s7PnjoSVxAe7Wu2JY7d7liSuhv6yYnEYVH1yD/0jUSscpBqUmuXqWMENEzmvdSeKdFo9x7FGaaLmSBeHvDhb80nWuO9MmZXIr121pyWbXdlyYtOqpUvz+6ZXDZR54u3WCSKmRvx+2wNArD+ZsM/udCoIEzmvdSdqE+l+KuyfkFjp6cMHjdSIAFq1CZ4JecnqLyyn5zdlk8lOWt1ZnYwy8ZVn8rOqu6jXQHF8x0x9ddMgg+tP6Kc3J90pUh9MLJ04RwmnsGVz2hLFea6FaDiyJ5c/yFcLcmlLKqkZ8l8L4a8jpsnNawpu5bPi7e5oxB8jNQhNSMojbeqECZw440tUNMHKjKf++ZGgjKG8dKpl6bSqPZlNKo54cwyG4jdJMc3EN1VB9PDmvR6ORCGExrWUzzEprxMmcOL8OTOlUFGzYmc2p5af8jxzyLuaTnlTC/fEkEk3yRbKtgGpEJrVmCOqP4CjNFHy6MpqLLplT+qUJ95uHRov3iIuMIQxVcoBsx6ctHb26084zdlUlWvesX1zdp4u1KzpO5LGk3KVM5cHWtjamChbNMtA3cqf2JFcTUytvNXJ7B7tSYcxcawLmPXg7N3F4ETa/4ZmZa0pxQ7ctli9/K9pWqIMNFl9AnbOmTJrWmLNlDk41nca06YcX/+uR1F6Die4F6X/Cs9ZLQal9qQCiavDrkXCVaImaoASzyyANk9z4sqYSDku2utRH+xF+v410XSWAZT4oi4ekCH1tlKv1B0MiCqgMGhzWRpjIuUCZv17keK5MNFMlHQpZFHiDrU/cbTPGbF6GPHH9jmlfpqoAWoNurIpQLFgRmBMkfL69yKVdsszlWgSyoXKlkDJJBklgcSDhaSolvpYPc/JTA1RBho0aLxJPKdoljAmUt4oTpX25vKctRkJNyg1yS5MEg8TCuHxTiJqgBYbtGV64yzjPksYEzAbUVQvnkU8l/9p345ZEwaiOIBLF1uoECzUfgXB1VnElIBbyRIkOCQu6pAh0KlQOvR7917uHv87H4LGS0wh/w4tnR6/9y6YZ3KTZx45F0tQsuQlVZGoBhUDWqy9WcrB9HTaXc/3mgOa/xYfQ/diCcpqJq/pM4FiQH1cQRfxqaXHwcRpP/GsA5pvY5K0plKPJShrHJxzAzqPw+spfxQl9uBk6XUwUbTryaCbw/KyOmdJypJMiRMuKWsP6IgHlECL8EpKOjTCEpU15okHNDaboszOlx0et4epgoQkUToXy1sLDsSAAnQaJeEFkkkMykYtpSdKZtGhMp2mZbLLvpa5unM7viXbfRml8dw4PjmSLiU94ID4GVCAquLmq2gXnoXM9pUkKBu2lJ4MqkWxd+Rgy4vFJyRBKU64rwEFKEgPZZLN1qG6Rf/+XIT58piU6WqKU4PPvQ1bwpNHADWruNth7Hid3Rok/VPKAX3EZgSkInprJa4/xlIemUY8xwyKb1YMKoJlN0NC0iulHFAGRW0nzUbLcWpsyjYs4cklu4/9j2ifyxlVP85LFJAEZTPVARTtlt3GqbFXBETZhqUsmUVp7ahREaOIF3xsyUZrDWxQm5RDghRyxAIQlDU67QO0EsXbUtqVIl8+a0cSoNxukIpui1PTOqW8VeYVGaGqvOo862C3BsmWwsWBlGK+SkfLCZIl70EpRXXZhGpnTBEv7bYZfgXWtBvNftC/0G0tGQw6kIk2pcLt0D/u5YjaiNRsRMnUzdhAdkXSMZ0ETiYqg24k4CPk5v7d/q9Bt19U9F+d6XafPn369Olza/4AHTMK9clhnYAAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDAwIDE3MSIgd2lkdGg9IjIwMDAiIGhlaWdodD0iMTcxIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0idGV4dEdyYWQiIHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjAlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3R5bGU9InN0b3AtY29sb3I6I2ZhZjQ5OTtzdG9wLW9wYWNpdHk6MSIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSI0NSUiIHN0eWxlPSJzdG9wLWNvbG9yOiNmNjcyYzI7c3RvcC1vcGFjaXR5OjEiIC8+CiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3R5bGU9InN0b3AtY29sb3I6IzZmZjllYTtzdG9wLW9wYWNpdHk6MSIgLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8ZmlsdGVyIGlkPSJnbG93IiB4PSItMTAlIiB5PSItNTAlIiB3aWR0aD0iMTIwJSIgaGVpZ2h0PSIyMDAlIj4KICAgICAgPGZlR2F1c3NpYW5CbHVyIGluPSJTb3VyY2VHcmFwaGljIiBzdGREZXZpYXRpb249IjUiIHJlc3VsdD0iYmx1ciIgLz4KICAgICAgPGZlTWVyZ2U+CiAgICAgICAgPGZlTWVyZ2VOb2RlIGluPSJibHVyIiAvPgogICAgICAgIDxmZU1lcmdlTm9kZSBpbj0iU291cmNlR3JhcGhpYyIgLz4KICAgICAgPC9mZU1lcmdlPgogICAgPC9maWx0ZXI+CiAgPC9kZWZzPgogIDx0ZXh0CiAgICB4PSIxMDAwIgogICAgeT0iMTI1IgogICAgZm9udC1mYW1pbHk9IidUdyBDZW4gTVQnLCAnQ2VudHVyeSBHb3RoaWMnLCBGdXR1cmEsICdUcmVidWNoZXQgTVMnLCBzYW5zLXNlcmlmIgogICAgZm9udC1zaXplPSIxMTAiCiAgICBmb250LXdlaWdodD0iYm9sZCIKICAgIGxldHRlci1zcGFjaW5nPSIxMiIKICAgIHRleHQtYW5jaG9yPSJtaWRkbGUiCiAgICBmaWxsPSJ1cmwoI3RleHRHcmFkKSIKICAgIGZpbHRlcj0idXJsKCNnbG93KSI+dGhyZWUud3M8L3RleHQ+Cjwvc3ZnPgo="},function(e,t,n){var r,i,a={},o=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=r.apply(this,arguments)),i}),s=function(e,t){return t?t.querySelector(e):document.querySelector(e)},c=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var r=s.call(this,e,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),l=null,u=0,h=[],d=n(202);function p(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=a[r.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](r.parts[o]);for(;o<r.parts.length;o++)i.parts.push(b(r.parts[o],t))}else{var s=[];for(o=0;o<r.parts.length;o++)s.push(b(r.parts[o],t));a[r.id]={id:r.id,refs:1,parts:s}}}}function f(e,t){for(var n=[],r={},i=0;i<e.length;i++){var a=e[i],o=t.base?a[0]+t.base:a[0],s={css:a[1],media:a[2],sourceMap:a[3]};r[o]?r[o].parts.push(s):n.push(r[o]={id:o,parts:[s]})}return n}function m(e,t){var n=c(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=h[h.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),h.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=c(e.insertAt.before,n);n.insertBefore(t,i)}}function g(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=h.indexOf(e);t>=0&&h.splice(t,1)}function y(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return v(t,e.attrs),m(e,t),t}function v(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function b(e,t){var n,r,i,a;if(t.transform&&e.css){if(!(a="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=a}if(t.singleton){var o=u++;n=l||(l=y(t)),r=E.bind(null,n,o,!1),i=E.bind(null,n,o,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),m(e,t),t}(t),r=_.bind(null,n,t),i=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=y(t),r=x.bind(null,n),i=function(){g(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=f(e,t);return p(n,t),function(e){for(var r=[],i=0;i<n.length;i++){var o=n[i];(s=a[o.id]).refs--,r.push(s)}e&&p(f(e,t),t);for(i=0;i<r.length;i++){var s;if(0===(s=r[i]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete a[s.id]}}}};var w,A=(w=[],function(e,t){return w[e]=t,w.filter(Boolean).join("\n")});function E(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=A(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function x(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function _(e,t,n){var r=n.css,i=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||a)&&(r=d(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var i,a=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?e:(i=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:r+a.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},function(e,t,n){const r='\x3c!-- https://freesound.org/people/deleted_user_2731495/sounds/183881/ --\x3e\n<audio id="introSong" src="assets/sounds/menu.ogg" loop></audio>\n\n\n\n\n<a-scene\n bind__beat-generator="challengeId: challenge.id; difficulty: challenge.difficulty; beatmapCharacteristic: challenge.beatmapCharacteristic; gameMode: gameMode; has3DOFVR: has3DOFVR; hasSongLoadError: hasSongLoadError; isPlaying: isPlaying; isZipFetching: isZipFetching; menuSelectedChallengeId: menuSelectedChallenge.id; songDuration: challenge.metadata.duration; speed: speed"\n bind__beat-system="gameMode: gameMode; hasVR: hasVR; isLoading: isLoading; isPlaying: isPlaying"\n bind__gameover="isGameOver: isGameOver"\n bind__intro-song="isPlaying: menuActive && !menuSelectedChallenge.id; isSearching: isSearching"\n bind__leaderboard="difficulty: menuSelectedChallenge.difficulty || challenge.difficulty; beatmapCharacteristic: menuSelectedChallenge.beatmapCharacteristic || challenge.beatmapCharacteristic; gameMode: gameMode; inVR: inVR; isVictory: isVictory; menuSelectedChallengeId: menuSelectedChallenge.id; challengeId: challenge.id"\n bind__search="difficultyFilter: difficultyFilter; genre: genre; playlist: playlist; query: search.query"\n bind__song="audio: challenge.audio; challengeId: challenge.id; isLoading: isLoading; isPlaying: isPlaying; isBeatsPreloaded: challenge.isBeatsPreloaded; isGameOver: isGameOver; isVictory: isVictory"\n bind__song-preview-system="selectedChallengeId: menuSelectedChallenge.id; selectedChallengeVersion: menuSelectedChallenge.version"\n bind__stage-colors="colorScheme: colorScheme"\n bind__tunnels="isPlaying: isPlaying; songDuration: challenge.metadata.duration"\n bind__zip-loader="difficulties: menuDifficulties; isLoading: isLoading; version: menuSelectedChallenge.version; directDownload: menuSelectedChallenge.directDownload; bpm: menuSelectedChallenge.metadata.bpm"\n animation__gameover="property: object3D.background; type: color; to: #750000; startEvents: gameover"\n agent-picker\n console-shortcuts\n debug-beat-generator\n debug-beat-positioning\n debug-controller\n debug-intro\n debug-song-time\n debug-state\n hack\n gpu-preloader\n \n leaderboard="apiKey: REDACTED_FIREBASE_KEY; authDomain: threews-prod.firebaseapp.com; databaseURL: https://threews-prod.firebaseio.com; projectId: threews-prod; storageBucket: threews-prod.appspot.com; messagingSenderId: 172125624222"\n loading-screen="backgroundColor: #000"\n pool__beat-arrow-blue="mixin: arrowBlueBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-arrow-red="mixin: arrowRedBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-dot-blue="mixin: dotBlueBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-dot-red="mixin: dotRedBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-mine="mixin: mine; size: 30; container: #beatContainer"\n pool__plume-arrow-blue="mixin: arrowBluePlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-arrow-red="mixin: arrowRedPlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-dot-blue="mixin: dotBluePlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-dot-red="mixin: dotRedPlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-mine="mixin: minePlume; size: 12; container: #beatContainer; dynamic: true"\n pool__beat-broken-blue="mixin: blueBeatBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-red="mixin: redBeatBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-blue-dot="mixin: blueDotBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-red-dot="mixin: redDotBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-broken-blue-dot="mixin: blueDotPunchBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-broken-red-dot="mixin: redDotPunchBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-mine="mixin: mineBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-blue="mixin: blueBeatFX; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-red="mixin: redBeatFX; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-mine="mixin: mineFX; size: 12; container: #rigContainer; dynamic: true"\n pool__punch-fx-blue="mixin: bluePunchFX; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-fx-red="mixin: redPunchFX; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-fx-mine="mixin: yellowPunchFX; size: 12; container: #rigContainer; dynamic: true"\n pool__tunnels="mixin: tunnel; size: 10; container: #tunnelsContainer; dynamic: true"\n pool__wall="mixin: wall; size: 20; container: #wallContainer; dynamic: true"\n proxy-event__cleargame1="event: gamemenuexit; as: cleargame; to: a-scene"\n proxy-event__cleargame2="event: gamemenurestart; as: cleargame; to: a-scene"\n proxy-event__cleargame3="event: songcomplete; as: cleargame; to: a-scene"\n proxy-event__pausegame="event: pausegame; as: textglowoff; to: a-scene"\n proxy-event__resumegame="event: gamemenuresume; as: textglownormal; to: a-scene"\n play-sound__crescendo="sound: #crescendo; event: victory; volume: 0.75"\n render-order="stage, aurora, sideglow, tunnel, curve, curveshadow, beatShadow, score, beats, menu, menuitem, menubutton, menutext, menugenre, cursor, particles, weapon, victory, stepback"\n stats-param\n tunnels\n vr-mode-ui="enterVRButton: #vrButton">\n\n <a-assets timeout="3000">\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/assets.html"> --\x3e\n<a-asset-item id="VigaRegularThree" src="assets/fonts/Viga-Regular-Three.json"></a-asset-item>\n<a-asset-item id="agentGlb" src="https://raw.githubusercontent.com/overstepping/-/main/cz.glb"></a-asset-item>\n\n<a-asset-item id="arrowredObj" src="assets/models/arrowred.obj"></a-asset-item>\n<a-asset-item id="arrowblueObj" src="assets/models/arrowblue.obj"></a-asset-item>\n<a-asset-item id="beatObj" src="assets/models/beat.obj"></a-asset-item>\n<a-asset-item id="laserObj" src="assets/models/laser/laser.obj"></a-asset-item>\n\n<a-asset-item id="tunnelObj" src="assets/models/tunnel.obj"></a-asset-item>\n<a-asset-item id="redBeatObj" src="assets/models/redbeat.obj"></a-asset-item>\n<a-asset-item id="blueBeatObj" src="assets/models/bluebeat.obj"></a-asset-item>\n<a-asset-item id="dotRedObj" src="assets/models/dotred.obj"></a-asset-item>\n<a-asset-item id="dotBlueObj" src="assets/models/dotblue.obj"></a-asset-item>\n<a-asset-item id="backGlowObj" src="assets/models/backglow.obj"></a-asset-item>\n<a-asset-item id="aurorasObj" src="assets/models/auroras.obj"></a-asset-item>\n<a-asset-item id="merkabaObj" src="assets/models/merkaba.obj"></a-asset-item>\n<a-asset-item id="ringsObj" src="assets/models/rings.obj"></a-asset-item>\n<a-asset-item id="homeObj" src="assets/models/home.obj"></a-asset-item>\n<a-asset-item id="homeShadowObj" src="assets/models/homeshadow.obj"></a-asset-item>\n<a-asset-item id="weaponObj" src="assets/models/weapon.obj"></a-asset-item>\n<a-asset-item id="weaponHandleObj" src="assets/models/weaponhandle.obj"></a-asset-item>\n<a-asset-item id="weaponGlowObj" src="assets/models/weaponglow.obj"></a-asset-item>\n<a-asset-item id="beatBrokenObj" src="assets/models/beatbroken.obj"></a-asset-item>\n<a-asset-item id="dotBrokenObj" src="assets/models/dotbroken.obj"></a-asset-item>\n<a-asset-item id="dotPunchBrokenObj" src="assets/models/dotbroken.gltf"></a-asset-item>\n<a-asset-item id="cutfxObj" src="assets/models/cutfx.obj"></a-asset-item>\n<a-asset-item id="punchfxObj" src="assets/models/punchfx.obj"></a-asset-item>\n<a-asset-item id="leftFistObj" src="assets/models/leftfist.obj"></a-asset-item>\n<a-asset-item id="leftFistWeaponObj" src="assets/models/leftfistweapon.obj"></a-asset-item>\n<a-asset-item id="rightFistObj" src="assets/models/rightfist.obj"></a-asset-item>\n<a-asset-item id="rightFistWeaponObj" src="assets/models/rightfistweapon.obj"></a-asset-item>\n<a-asset-item id="plumeObj" src="assets/models/plume.obj"></a-asset-item>\n\n<a-asset-item id="mineObj" src="assets/models/mine.obj"></a-asset-item>\n<a-asset-item id="mineBrokenObj" src="assets/models/minebroken.gltf"></a-asset-item>\n\n\x3c!--\n https://freesound.org/people/juskiddink/sounds/70043/\n https://freesound.org/people/Robinhood76/sounds/337436/\n--\x3e\n<audio id="confirmSound" src="assets/sounds/beatHit.ogg"></audio>\n<audio id="clearSound" src="assets/sounds/clear.ogg"></audio>\n<audio id="hoverSound" src="assets/sounds/hover.ogg"></audio>\n<audio id="victorySound" src="assets/sounds/victory.ogg"></audio>\n<audio id="crescendo" src="assets/sounds/crescendo.ogg"></audio>\n\n\n<audio id="hitSound1" src="assets/sounds/hit1.ogg"></audio>\n<audio id="hitSound1left" src="assets/sounds/hit1left.ogg"></audio>\n<audio id="hitSound1right" src="assets/sounds/hit1right.ogg"></audio>\n\n<audio id="hitSound2" src="assets/sounds/hit2.ogg"></audio>\n<audio id="hitSound2left" src="assets/sounds/hit2left.ogg"></audio>\n<audio id="hitSound2right" src="assets/sounds/hit2right.ogg"></audio>\n\n<audio id="hitSound3" src="assets/sounds/hit3.ogg"></audio>\n<audio id="hitSound3left" src="assets/sounds/hit3left.ogg"></audio>\n<audio id="hitSound3right" src="assets/sounds/hit3right.ogg"></audio>\n\n<audio id="hitSound4" src="assets/sounds/hit4.ogg"></audio>\n<audio id="hitSound4left" src="assets/sounds/hit4left.ogg"></audio>\n<audio id="hitSound4right" src="assets/sounds/hit4right.ogg"></audio>\n\n<audio id="hitSound5" src="assets/sounds/hit5.ogg"></audio>\n<audio id="hitSound5left" src="assets/sounds/hit5left.ogg"></audio>\n<audio id="hitSound5right" src="assets/sounds/hit5right.ogg"></audio>\n\n<audio id="hitSound6" src="assets/sounds/hit6.ogg"></audio>\n<audio id="hitSound6left" src="assets/sounds/hit6left.ogg"></audio>\n<audio id="hitSound6right" src="assets/sounds/hit6right.ogg"></audio>\n\n<audio id="hitSound7" src="assets/sounds/hit7.ogg"></audio>\n<audio id="hitSound7left" src="assets/sounds/hit7left.ogg"></audio>\n<audio id="hitSound7right" src="assets/sounds/hit7right.ogg"></audio>\n\n<audio id="hitSound8" src="assets/sounds/hit8.ogg"></audio>\n<audio id="hitSound8left" src="assets/sounds/hit8left.ogg"></audio>\n<audio id="hitSound8right" src="assets/sounds/hit8right.ogg"></audio>\n\n<audio id="hitSound9" src="assets/sounds/hit9.ogg"></audio>\n<audio id="hitSound9left" src="assets/sounds/hit9left.ogg"></audio>\n<audio id="hitSound9right" src="assets/sounds/hit9right.ogg"></audio>\n\n<audio id="hitSound10" src="assets/sounds/hit10.ogg"></audio>\n<audio id="hitSound10left" src="assets/sounds/hit10left.ogg"></audio>\n<audio id="hitSound10right" src="assets/sounds/hit10right.ogg"></audio>\n\n\n<img id="cursorMeshImg" src="assets/models/laser/laser.png">\n<img id="downIconImg" src="assets/img/downIcon.png">\n<img id="envmapTemplateImg" src="assets/img/envmap.png">\n<img id="envmapImg">\n<img id="favoriteImg" src="assets/img/favorite.png">\n<img id="sliceImg" src="assets/img/slice.png">\n<img id="stepbackImg" src="assets/img/stepback.png">\n<img id="soundboxingImg" src="assets/img/soundboxing.jpg">\n<img id="genresImg" src="assets/img/genres.png">\n<img id="starImg" src="assets/img/star.png">\n<img id="merkabaBloomImg" src="assets/img/merkababloom.png">\n<img id="homeShadowImg" src="assets/img/homeshadow.jpg">\n<img id="backGlowImg" src="assets/img/backglow.png">\n<img id="weaponImg" src="assets/img/weapon.jpg">\n<img id="weapon2Img" src="assets/img/weapon2.jpg">\n<img id="weaponHandleImg" src="assets/img/weaponhandle.png">\n<img id="difficultyImg" src="assets/img/difficulty.png">\n<img id="selectedImg" src="assets/img/selected.png">\n<img id="cutfxImg" src="assets/img/cutfx.png">\n\x3c!--\n<img id="cutFxTemplateImg" src="assets/img/cutfx.png">\n<img id="cutFxImg">\n--\x3e\n<img id="minefxImg" src="assets/img/minefx.png">\n<img id="sideglowImg" src="assets/img/sideglow.png">\n<img id="logoImg" src="assets/img/logo.svg">\n<img id="moonImg" src="assets/img/moon.png">\n<img id="plumeImg" src="assets/img/plume.png">\n<img id="tubeImg" src="assets/img/tube.png">\n<img id="tubeColorImg" src="assets/img/tube.jpg">\n<img id="handStarTrailImg" src="assets/img/handstartrail.png">\n\n<img id="modeRideImg" src="assets/img/moderide.jpg">\n<img id="modeClassicImg" src="assets/img/modeclassic.jpg">\n<img id="modePunchImg" src="assets/img/modepunch.jpg">\n<img id="modeViewerImg" src="assets/img/modeviewer.jpg">\n\n<a-mixin id="slice" slice9="color: #050505; transparent: true; opacity: 0.9; src: #sliceImg; left: 50; right: 52; top: 50; bottom: 52; padding: 0.18"></a-mixin>\n<a-mixin id="font" text="font: assets/fonts/Viga-Regular.json; shader: msdf; letterSpacing: 1"></a-mixin>\n\n<a-mixin id="superKeyboardTextInput" mixin="font"></a-mixin>\n\n<a-mixin id="beat"></a-mixin>\n<a-mixin id="beatBlock"></a-mixin>\n<a-mixin id="beatSign"></a-mixin>\n\n<a-mixin id="arrowBlueBeat" mixin="beat" beat="color: blue; type: arrow"></a-mixin>\n<a-mixin id="arrowRedBeat" mixin="beat" beat="color: red; type: arrow"></a-mixin>\n<a-mixin id="dotBlueBeat" mixin="beat" beat="color: blue; type: dot"></a-mixin>\n<a-mixin id="dotRedBeat" mixin="beat" beat="color: red; type: dot"></a-mixin>\n<a-mixin id="mine" mixin="beat" beat="type: mine"></a-mixin>\n<a-mixin id="beatShadow" mixin="beat" geometry="primitive: plane; width: 0.7; height: 0.6" rotation="-90 0 0" material="src: #minefxImg; shader: flat; color: #000; transparent: true; opacity: 0.2" render-order="beatShadow"></a-mixin>\n\n<a-mixin id="plume" plume obj-model="obj: #plumeObj"></a-mixin>\n<a-mixin id="arrowBluePlume" mixin="plume" plume="type: arrow; color: blue" materials="name: arrowBluePlume"></a-mixin>\n<a-mixin id="arrowRedPlume" mixin="plume" plume="type: arrow; color: red" materials="name: arrowRedPlume"></a-mixin>\n<a-mixin id="dotBluePlume" mixin="plume" plume="type: dot; color: blue" materials="name: dotBluePlume"></a-mixin>\n<a-mixin id="dotRedPlume" mixin="plume" plume="type: dot; color: red" materials="name: dotRedPlume"></a-mixin>\n<a-mixin id="minePlume" mixin="plume" plume="type: mine" materials="name: minePlume"></a-mixin>\n\n<a-mixin\n id="superCut"\n bind__supercutfx="colorPrimary: colorPrimary; colorSecondary: colorSecondary"\n supercutfx\n geometry="primitive: plane; width: 3; height: 3"\n material="shader: superCutFxShader; transparent: true; depthWrite: false"></a-mixin>\n\n<a-mixin\n id="redBeatBroken"\n obj-model="obj: #beatBrokenObj"\n beat-cut-fx="color: red"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueBeatBroken"\n obj-model="obj: #beatBrokenObj"\n beat-cut-fx="color: blue"\n render-order="beats"></a-mixin>\n<a-mixin\n id="redDotBroken"\n obj-model="obj: #dotBrokenObj"\n beat-cut-fx="color: red; type: dot"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueDotBroken"\n obj-model="obj: #dotBrokenObj"\n beat-cut-fx="color: blue; type: dot"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="redDotPunchBroken"\n gltf-model="#dotPunchBrokenObj"\n beat-cut-fx="color: red; type: dot"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueDotPunchBroken"\n gltf-model="#dotPunchBrokenObj"\n beat-cut-fx="color: blue; type: dot"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="redBeatFX"\n bind__material="color: colorPrimary"\n obj-model="obj: #cutfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="blueBeatFX"\n bind__material="color: colorSecondary"\n obj-model="obj: #cutfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="mineBroken"\n gltf-model="#mineBrokenObj"\n beat-cut-fx="type: mine"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="mineFX"\n geometry="primitive: plane; width: 0.6; height: 0.6"\n material="shader: flat; transparent: true; src: #minefxImg; color: #fff568; depthWrite: false"\n render-order="menu"\n animation="property: components.material.material.opacity; from:1; to:0; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="redPunchFX"\n bind__material="color: colorPrimary"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="bluePunchFX"\n bind__material="color: colorSecondary"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n bind__material="color: colorTertiary"\n id="yellowPunchFX"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="wall"\n material="shader: wallShader; transparent: true; side: double; opacity: 0"\n animation__fadein="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; easing: easeInCubic; autoplay: false; dur: 1500"\n animation__scalein="property: object3D.position.y; from: -5; to: 0; easing: easeInOutElastic; autoplay: false; dur: 1500"\n render-order\n wall></a-mixin>\n\n<a-mixin\n id="tunnel"\n obj-model="obj: #tunnelObj"\n materials="name: tunnel"></a-mixin>\n\n<a-mixin\n id="bigMenuButton"\n geometry="primitive: plane; width: 1.15; height: 0.23"\n material="shader: panelShader; brightness: 0.5; borderWidth: 0.05; ratio: 4; borderRadius: 0.6"\n animation__mouseenter1="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave1="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.04 1.04 1.04; startEvents: mouseenter; pauseEvents: mouseleave; dur: 80"\n animation__mouseleave2="property: scale; to: 1 1 1; from: 1.04 1.04 1.04; startEvents: mouseleave; pauseEvents: mouseenter; dur: 80"\n render-order="menubutton"></a-mixin>\n\n<a-mixin id="cancelSoundUI" play-sound__cancel="event: click; sound: #clearSound; volume: 0.5"></a-mixin>\n<a-mixin id="clickSoundUI" play-sound__click="event: click; sound: #confirmSound; volume: 0.25"></a-mixin>\n<a-mixin id="hoverSoundUI" play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"></a-mixin>\n\x3c!-- </require> --\x3e</require>\n </a-assets>\n\n <a-entity id="beatObjTemplate" obj-model="obj: #beatObj" visible="false"></a-entity>\n <a-entity id="redBeatObjTemplate" obj-model="obj: #redBeatObj" visible="false"></a-entity>\n <a-entity id="blueBeatObjTemplate" obj-model="obj: #blueBeatObj" visible="false"></a-entity>\n <a-entity id="dotRedObjTemplate" obj-model="obj: #dotRedObj" visible="false"></a-entity>\n <a-entity id="dotBlueObjTemplate" obj-model="obj: #dotBlueObj" visible="false"></a-entity>\n <a-entity id="mineObjTemplate" obj-model="obj: #mineObj" visible="false"></a-entity>\n <a-entity id="cursorLaser" obj-model="obj: #laserObj" visible="false"></a-entity>\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/loading.html"> --\x3e\n<a-entity\n id="loadingSongInfoContainer"\n bind__animation__scale="enabled: isLoading"\n bind__visible="isLoading"\n animation__scale="property: scale; from: 1 1 1; to: 1.05 1.05 1.05; dir: alternate; loop: true; dur: 1200; easing: easeInOutCubic"\n position="0 1.5 -2">\n\n <a-entity\n id="loadingMenuBackground"\n bind-toggle__raycastable="isLoading"\n render-order="menu"\n geometry="primitive: plane; width: 1.15; height: 1.2"\n material="shader: panelShader; ratio: 1.15; borderRadius: 0.4"\n position="0 0 -0.03"></a-entity>\n\n <a-entity id="loadingSongImage"\n copy-texture="from: #menuSelectedChallengeImage"\n geometry="primitive: plane; buffer: false; skipCache: true; height: 0.3; width: 0.3"\n material="shader: flat; transparent: false"\n position="0 0.24 0"\n render-order="menu"></a-entity>\n\n <a-entity id="loadingSongInfo">\n <a-entity\n position="0 -0.05 0"\n mixin="font"\n bind__text="color: colorSecondary"\n bind__text-truncate="value: challenge.songSubName + \' - \' + challenge.author"\n text="wrapCount: 40; align: center"\n text-truncate="length: 35"\n render-order="menutext"></a-entity>\n\n <a-entity position="0 -0.13 0"\n mixin="font"\n text="align: center; color: #FFF; wrapCount: 21; baseline: top; lineHeight: 36; width: 0.81"\n bind__text="value: challenge.metadata.songName"\n render-order="menutext"></a-entity>\n\n <a-entity\n id="loadingText"\n mixin="font"\n bind__animation__color="enabled: isLoading"\n bind__text="color: colorPrimary; value: loadingText; wrapCount: hasSongLoadError && 24 || 18"\n bind__visible="isLoading"\n text="align: center; wrapCount: 18; width: 0.65"\n render-order="menutext"\n position="0 -0.32 0.001"></a-entity>\n\n <a-entity\n id="zipLoaderIndicator"\n bind__material="color: colorPrimary"\n bind__visible="isZipFetching"\n geometry="primitive: plane; height: 0.1; width: 0.1"\n material="shader: ring; radiusInner: 0.2; radiusOuter: 0.9; progress: 0; transparent: true"\n render-order="menuitem"\n position="0 -0.4 0.002">\n </a-entity>\n\n <a-entity\n id="songProcessingIndicator"\n bind__animation__spin="enabled: isSongProcessing"\n bind__material="color: colorPrimary"\n bind__visible="isSongProcessing"\n animation__spin="property: object3D.rotation.z; from: 0; to: -360; easing: linear; dur: 1000; loop: true"\n geometry="primitive: plane; height: 0.15; width: 0.15"\n material="shader: ring; radiusInner: 0.2; radiusOuter: 0.4; transparent: true; progress: 0.2"\n render-order="menutext"\n position="0 -0.4 0.004"\n visible="false">\n </a-entity>\n\n <a-entity\n id="loadingCancelButton"\n mixin="bigMenuButton"\n bind-toggle__raycastable="isLoading"\n position="0 -0.67 0.01"\n proxy-event="event: click; to: a-scene; as: songloadcancel">\n <a-entity mixin="font" text="align: center; color: #FAFAFA; wrapCount: 20; value: CANCEL" position="0 -0.065 0.001"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/stage.html"> --\x3e\n<a-entity\n id="audioAnalyser"\n audioanalyser="fftSize: 32; enableBeatDetection: false; enableLevels: false; enableWaveform: false; enableVolume: false"></a-entity>\n\n<a-entity id="stage" no-frustum-cull follow-z="target: #curveFollowRig">\n <a-entity\n id="backglow"\n obj-model="obj: #backGlowObj"\n materials="name: backglow"\n render-order="stage"></a-entity>\n\n <a-entity\n id="rings"\n obj-model="obj: #ringsObj"\n materials="name: rings"\n position="0 0 -1500"\n render-order="stage"></a-entity>\n\n <a-entity\n id="auroras"\n class="aurora"\n obj-model="obj: #aurorasObj"\n materials="name: aurora"\n render-order="aurora"></a-entity>\n\n <a-entity\n id="merkaba"\n obj-model="obj: #merkabaObj"\n bind__visible="!isVictory && !isGameOver"\n materials="name: merkaba"\n animation="property: rotation; from: 0 0 0; to: 360 360 360; dur: 50000; easing: linear; loop: true"\n position="0 46 -1500"></a-entity>\n\n <a-entity\n class="merkababloom"\n geometry="primitive: plane; width: 200; height: 200"\n material="shader: flat; src: #merkabaBloomImg; blending: additive; depthTest: false; color: #888"\n position="0 46 -1400"\n render-order="stage"></a-entity>\n\n <a-entity\n class="merkababloom"\n bind__material="color: colorTertiary"\n geometry="primitive: plane; width: 250; height: 250"\n animation="property: object3D.rotation.z; from: 0; to: 360; loop: true; easing: linear; dur: 30000"\n material="shader: flat; src: #merkabaBloomImg; blending: additive; depthTest: false"\n position="0 46 -1380"\n render-order="stage"></a-entity>\n\n <a-entity\n id="moon"\n geometry="primitive: plane; width: 1000; height: 500"\n position="0 1000 -1000"\n rotation="45 0 0"\n materials="name: moon"\n ></a-entity>\n\n <a-entity class="stars" stars render-order="particles"></a-entity>\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/intro.html"> --\x3e\n<a-entity\n id="mainLogo"\n geometry="primitive: plane; width: 9; height: 1.125"\n material="shader: flat; src: #logoImg; transparent: true; depthTest: false; blending: additive; opacity: 0"\n position="0 3.3 -2.5"\n rotation="0 0 0"\n scale="0.8 0.8 0.8"\n bind__visible="introActive || menuActive"\n animation__opacity="property: components.material.material.opacity; from: 0; to: 1; dur: 2000; delay: 1000"\n animation__position="property: object3D.position.y; to: 3.4; dur: 2000; easing: easeInOutQuad; startEvents: startgame"></a-entity>\n\n<a-entity\n id="startButton"\n bind__visible-raycastable="introActive"\n geometry="primitive: plane; width: 1; height: 0.35"\n position="0 1.6 -2.2"\n render-order="menu"\n proxy-event="event: click; to: a-scene, #menu, #mainlogo, #menuTopButtons, #menuBackground; as: startgame"\n delayed-proxy-event="event: click; to: a-scene; as: menuopeningend; delay: 1800"\n mixin="bigMenuButton"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25"\n material="ratio: 3; opacity: 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 500; delay: 3000">\n <a-entity\n id="startButtonLabel"\n mixin="font"\n text="value: BEGIN; color: #f0f0f0; align: center; width: 1; wrapCount: 12; opacity: 0"\n position="0 -0.1 0.01"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; dur: 500; delay: 3500"\n ></a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/menu.html"> --\x3e\n\x3c!-- Macro is a templating function. It is rendered into the HTML below with searchResults(). --\x3e\n\n\n\n<template id="searchResultTemplate">\n <a-entity class="searchResult" bind-item__data-id="item.id" bind-item__data-index="item.index">\n <a-entity class="searchResultBackground" bind-item__active-item="active: menuSelectedChallenge.id === item.id"\n bind-item__animation__mouseenter="enabled: menuSelectedChallenge.id !== item.id"\n bind-item__animation__mouseleave="enabled: menuSelectedChallenge.id !== item.id"\n bind-toggle__raycastable="mainMenuActive || isSearching" bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.4; startEvents: mouseenter; pauseEvents: mouseleave; dur: 75; delay: 1"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 75"\n geometry="primitive: plane; width: 1.1; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0.0; src: #selectedImg" position="0 -0.13 -0.002"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03" render-order="menuitem"></a-entity>\n </a-entity>\n </a-entity>\n</template>\n\n\n\x3c!-- Menu container begins here. --\x3e\n<a-entity id="menu" bind__visible="menuActive" position="0 1.4 -2.3"\n animation__position="property: object3D.position.z; to: -2; dur: 1500; easing: easeInOutCubic; delay: 300; startEvents: startgame">\n\n <a-entity id="menuBackground"\n bind__menu-midsection="active: !!menuSelectedChallenge.id && (mainMenuActive || difficultyFilterMenuOpen) || difficultyFilterMenuOpen; selectedChallenge: menuSelectedChallenge.id"\n bind-toggle__raycastable="menuActive || genreMenuOpen || isSearching || difficultyFilterMenuOpen"\n geometry="primitive: plane; width: 3.4; height: 1.82" material="shader: panelShader; ratio: 1.86; opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n animation__midsectionshow="property: components.material.material.uniforms.midSection.value; from: 0; to: 1; dur: 160; startEvents: showdifficultysection; easing: easeOutCubic"\n animation__midsectionhide="property: components.material.material.uniforms.midSection.value; from: 1: to: 0; dur: 160; startEvents: hidedifficultysection; easing: easeOutCubic"\n render-order="menu" position="0 0 -0.005"></a-entity>\n\n <a-entity id="mainMenu" bind__visible="mainMenuActive && !isMenuOpening || isSearching">\n <a-entity id="searchResultsContainer" position="0 0 0.001" class="menuAnimation"\n bind__menu-slide-animation="isSearching: isSearching; menuSelectedChallengeId: menuSelectedChallenge.id"\n animation__menuleft="property: object3D.position.x; to: -0.79; dur: 200; easing: easeOutCubic; autoplay: false"\n animation__menuright="property: object3D.position.x; from: -0.79; to: 0; dur: 200; easing: easeOutCubic; autoplay: false">\n\n \n\x3c!-- TODO: Sort the layout based on the IDs. --\x3e\n<a-entity id="searchResultList"\n bind-for="for: item; in: searchResultsPage; key: id; template: #searchResultTemplate; updateInPlace: true; pool: 6; delay: 25"\n layout="type: box; columns: 1; marginRow: -0.2; orderAttribute: data-index" search-result-list position="0 0.644 0">\n</a-entity>\n\n\x3c!-- All search result text merged and spaced out. --\x3e\n<a-entity id="searchSongNameTexts" mixin="font" bind__text="value: search.songNameTexts" render-order="menutext"\n text="baseline: top; align: left; color: #FAFAFA; wrapCount: 28; lineHeight: 130" position="0.181 0.51943 0.001">\n</a-entity>\n<a-entity id="searchSongSubNameTexts" mixin="font"\n bind__text="color: colorSecondaryBright; value: search.songSubNameTexts" render-order="menutext"\n text="baseline: top; align: left; wrapCount: 42; lineHeight: 190" position="0.181 0.445 0.001">\n</a-entity>\n\n<a-entity id="searchThumbnailImages" bind__search-thumbnail-atlas="dummyUpdater: search.songSubNameTexts"\n bind__visible="searchResultsPage.length > 0" geometry="primitive: plane; buffer: false; width: 0.2; height: 1.2"\n dynamic-texture-atlas="canvasId: thumbnailAtlasMap; canvasWidth: 64; canvasHeight: 512; numColumns: 1; numRows: 6"\n material="shader: flat; transparent: true" render-order="menubutton" position="-0.45 0.0146 0.002"></a-entity>\n\n<a-mixin id="searchPageButton"\n animation__mouseenter="property: components.slice9.material.opacity; from: 0; to: 0.3; startEvents: mouseenter; pauseEvents: mouseleave; dur: 150"\n animation__mouseleave="property: components.slice9.material.opacity; from: 0.3; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150"\n mixin="slice" raycaster-target="width: 1; height: 0.32" render-order="menubutton"\n slice9="width: 0.8; color: #08bfa2; height: 0.130; padding: 0.03; opacity: 0"></a-mixin>\n\n<a-entity id="searchPrevPage" mixin="searchPageButton" bind__slice9="color: colorPrimary"\n bind__visible-raycastable="search.hasPrev && (mainMenuActive || isSearching)"\n raycaster-target="bindToggle: search.hasNext && menuActive; position: 0 0.08 0" position="-0 0.69 0.01"\n proxy-event="event: click; to: a-scene; as: searchprevpage; captureBubbles: true">\n <a-entity id="prevArrow" bind__material="color: colorPrimary" geometry="primitive: plane; width: 0.12; height: 0.12"\n material="shader: flat; src: #downIconImg; transparent: true" rotation="0 0 180" position="0 0 -0.001"></a-entity>\n</a-entity>\n\n<a-entity id="searchNextPage" mixin="searchPageButton" bind__slice9="color: colorSecondary"\n raycaster-target="bindToggle: search.hasNext && (mainMenuActive || isSearching); position: 0 -0.08 0"\n position="-0 -0.674 0.01" proxy-event="event: click; to: a-scene; as: searchnextpage; captureBubbles: true"\n bind__visible="search.hasNext">\n <a-entity id="nextArrow" bind__material="color: colorSecondary" geometry="primitive: plane; width: 0.12; height: 0.12"\n material="shader: flat; src: #downIconImg; transparent: true" position="0 0 -0.001"></a-entity>\n</a-entity>\n\n </a-entity>\n\n <a-entity id="menuDifficultiesGroup" position="0 0.18 0">\n\n \x3c!-- Top-aligned. --\x3e\n \x3c!-- Uses bind-for and bind-item to render difficulties. --\x3e\n <a-entity id="menuDifficulties" bind-for="for: item; in: menuDifficultiesIds; updateInPlace: true; pool: 10"\n bind__visible="!!menuSelectedChallenge.id"\n layout="type: box; columns: 1; marginRow: -0.2; orderAttribute: data-bind-for-key" position="0 0.34 0"\n menu-difficulty-select>\n \n <template>\n \x3c!-- Item is a string representing the difficulty. --\x3e\n <a-entity class="difficultyOption" bind-item__data-difficulty="item">\n <a-entity class="difficultyBackground"\n bind-item__active-item="active: (menuSelectedChallenge.difficultyId === item)"\n bind-item__animation__mouseenter="enabled: !(menuSelectedChallenge.difficultyId === item)"\n bind-item__animation__mouseleave="enabled: !(menuSelectedChallenge.difficultyId === item)"\n bind-item__difficulty-background="enabled: menuActive && !!menuSelectedChallenge.id && !(menuSelectedChallenge.difficultyId === item) && !difficultyFilterMenuOpen"\n bind__material="color: colorPrimary" geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0.0; src: #difficultyImg" position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; pauseEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 75"\n event-set__mouseleave="visible: true; _delay: 160" render-order="menuitem"></a-entity>\n <a-entity class="difficultyText" mixin="font"\n bind-item__active-text-color="active: (menuSelectedChallenge.difficultyId === item)"\n bind-item__difficulty-text="id: item" active-text-color="color: #fff"\n text="wrapCount: 30; align: center; color: #8d8d8d" position="0 -0.057 0.001" render-order="menutext">\n </a-entity>\n </a-entity>\n </template>\n \n </a-entity>\n </a-entity>\n\n \x3c!-- Selected challenge info. --\x3e\n <a-entity id="menuSelectedChallengePanel" bind__visible="!!menuSelectedChallenge.id"\n position="0.8394583182784089 0 0.001">\n <a-entity id="menuFavoriteButton" bind__animation__mouseenter="to: menuSelectedChallenge.isFavorited && 0.25 || 1"\n bind__animation__mouseleave="to: menuSelectedChallenge.isFavorited && 1 || 0.25"\n bind__material="color: colorTertiary; opacity: menuSelectedChallenge.isFavorited && 1 || 0.25"\n bind__raycastable="menuActive && !!menuSelectedChallenge.id"\n animation__mouseenter="property: components.material.material.opacity; startEvents: mouseenter; dur: 150; easing: easeInOutCubic"\n animation__mouseleave="property: components.material.material.opacity; startEvents: mouseleave; dur: 100; easing: easeInOutCubic"\n geometry="primitive: plane; width: 0.1; height: 0.1"\n material="src: #favoriteImg; shader: flat; transparent: true; opacity: 0.25"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1" position="0.46 0.68 0.001"\n proxy-event="event: click; to: a-scene; as: favoritetoggle" render-order="menuitem"></a-entity>\n\n <a-entity id="menuSelectedChallengeImage"\n bind__menu-selected-challenge-image="coverURL: menuSelectedChallenge.coverURL"\n geometry="primitive: plane; height: 0.4; width: 0.4" material="shader: flat" position="0 0.42 0"></a-entity>\n\n <a-entity id="menuSelectedChallengeInfoContainer" position="0 0.058 0">\n <a-entity id="menuSelectedChallengeSongAuthor" mixin="font"\n bind__text="color: colorSecondaryBright; value: (menuSelectedChallenge.metadata.songSubName || menuSelectedChallenge.metadata.songAuthorName || \'Unknown Artist\')" position="0 0.042 0"\n render-order="menutext" text="wrapCount: 40; lineHeight: 40; width: 1.185; align: center; baseline: center">\n </a-entity>\n <a-entity id="menuSelectedChallengeSongName" mixin="font"\n bind__text="color: colorPrimary; value: menuSelectedChallenge.metadata.songName" position="0 -0.059 0"\n render-order="menutext" text="align: center; wrapCount: 31; baseline: top; lineHeight: 36; width: 1.4">\n </a-entity>\n <a-entity id="menuSelectedChallengeInfo" mixin="font" bind__text="value: menuSelectedChallenge.songInfoText"\n mixin="font" position="0 -0.18 0" render-order="menutext"\n text="align: center; color: #989898; wrapCount: 55; lineHeight: 72; width: 1.5; baseline: top"></a-entity>\n </a-entity>\n\n <a-entity id="playButton"\n bind__visible-raycastable="menuActive && !!menuSelectedChallenge.id && !genreMenuOpen && !difficultyFilterMenuOpen && !isIOS && !hasSongLoadError"\n geometry="primitive: plane; width: 0.7; height: 0.25"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25" position="0 -0.561 0"\n proxy-event="event: click; to: a-scene; as: playbuttonclick"\n material="shader: panelShader; brightness: 0.7; transparent: true; midSection: 0; ratio: 2.8; borderRadius: 0.6; borderWidth: 0.08"\n render-order="menubutton"\n animation__mouseenter1="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave1="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.1 1.1 1.1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave2="property: scale; to: 1 1 1; from: 1.1 1.1 1.1; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 15; value: PLAY" position="0 -0.085 0.01">\n </a-entity>\n </a-entity>\n\n <a-entity id="iOSNotice" bind__visible="mainMenuActive && isIOS" mixin="font" position="0 -0.5 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Sorry, iOS is currently not playable but support is coming soon!">\n </a-entity>\n\n <a-entity id="menuLoadError" bind__visible="hasSongLoadError" mixin="font" position="0 -0.5 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Sorry! There was an error loading this song.">\n </a-entity>\n </a-entity>\n\n <a-entity id="searchError" mixin="font" bind__visible="search.hasError" render-order="menuText"\n text="align: center; value: Sorry, there was an issue fetching search results. Please try again."\n position="0 0 0.01"></a-entity>\n\n <a-entity id="menuNoPlaylists" mixin="font"\n bind__visible="playlist === \'favorites\' && favorites.length === 0 && !menuSelectedChallenge.id"\n render-order="menuText" position="0 0.1 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Add a song to your favorites by clicking the star in the top right of the menu after selected a song.">\n </a-entity>\n\n <a-entity id="searchNoResults" mixin="font"\n bind__visible="!isSearching && search.results.length === 0 && playlist !== \'favorites\'" render-order="menuText"\n text="align: center; value: No search results found. Please try again with another query." position="0 0 0.01">\n </a-entity>\n </a-entity>\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/genreMenu.html"> --\x3e\n<a-entity\n id="genreMenu"\n bind-for="for: genre; in: genres; updateInPlace: true; key: name"\n bind__visible="genreMenuOpen"\n layout="type: box; columns: 6; marginRow: 0.4; marginColumn: 0.4; align: center"\n menu-genre\n position="0 0 0.05">\n <template>\n <a-entity class="genre" bind-item__data-genre="item">\n <a-entity\n mixin="slice"\n slice9="opacity: 0.9; width: 0.35; left: 70; top: 70; height: 0.35; padding: 0.07"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.03 1.03 1.03; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave2="property: scale; from: 1.03 1.03 1.03; to: 1 1 1; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n proxy-event__enter="event: mouseenter; to: CHILDREN; captureBubbles: true"\n proxy-event__leave="event: mouseleave; to: CHILDREN; captureBubbles: true"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n raycaster-target="bindToggle: genreMenuOpen; width: 0.35; height: 0.35"\n render-order__nonrecursive="menubutton">\n <a-entity\n mixin="font"\n bind-item__text="value: item.name"\n text="align: center; width: 1.1; color: #888"\n animation__mouseenter="property: components.text.material.uniforms.color.value; from: #888; to: #FFF; type: color; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.text.material.uniforms.color.value; from: #FFF; to: #888; type: color; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n render-order="menutext"\n position="0 -0.16 0.001"></a-entity>\n <a-entity\n class="genreIcon"\n bind-item__atlas-uvs="totalColumns: 6; totalRows: 3; row: item.row; column: item.column"\n geometry="primitive: plane; width: 0.22; height: 0.22; buffer: false; skipCache: true"\n position="0 0.04 0.002"\n material="shader: flat; src: #genresImg; transparent: true; color: #888"\n render-order="menutext"\n animation__mouseenter="property: components.material.material.color; type: color; from: #888; to: #FFF; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.material.material.color; type: color; from: #FAFAFA; to: #888; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"></a-entity>\n </a-entity>\n </a-entity>\n </template>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/difficultyMenu.html"> --\x3e\n\n\n\n\n<a-entity\n id="difficultyFilterMenu"\n bind__visible="difficultyFilterMenuOpen"\n layout="type: box; columns: 1; marginRow: -0.2"\n difficulty-filter\n position="0 0.5 0">\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="All">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'All\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'All\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'All\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'All\'"\n active-text-color="color: #fff"\n difficulty-text="id: All"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Easy">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Easy\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Easy\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Easy\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Easy\'"\n active-text-color="color: #fff"\n difficulty-text="id: Easy"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Normal">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Normal\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Normal\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Normal\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Normal\'"\n active-text-color="color: #fff"\n difficulty-text="id: Normal"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Hard">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Hard\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Hard\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Hard\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Hard\'"\n active-text-color="color: #fff"\n difficulty-text="id: Hard"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Expert">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Expert\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Expert\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Expert\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Expert\'"\n active-text-color="color: #fff"\n difficulty-text="id: Expert"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Expertplus">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Expertplus\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Expertplus\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Expertplus\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Expertplus\'"\n active-text-color="color: #fff"\n difficulty-text="id: Expertplus"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/optionsMenu.html"> --\x3e\n<a-entity\n id="optionsMenu"\n bind__visible="optionsMenuOpen"\n position="0 0.5 0.01"\n render-order="menutext">\n\n <a-entity id="optionsTitle" mixin="font" text="align: center; value: OPTIONS; width: 2.5"></a-entity>\n\n <a-entity id="colorOptionsContainer" position="0 -0.25 0">\n <a-entity id="colorTitle" mixin="font" text="align: center; value: THEMES; width: 2"></a-entity>\n\n <a-entity id="colorOptions" position="-0.79 -0.175 0.00" layout="type: box; columns: 10; margin: 0.2" materials-color-menu>\n \n <a-entity\n class="colorOption"\n data-color-name="Super Medium"\n data-color-scheme="default"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #f971c3; color2: #6ff9ea; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Star Warrior"\n data-color-scheme="blue"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #1e4482; color2: #c27727; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Galactic Royal"\n data-color-scheme="purple"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #6A39B3; color2: #FAF239; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Space Joker"\n data-color-scheme="green"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #779E37; color2: #6A39B3; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Solar Flare"\n data-color-scheme="yellow"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #C2C04C; color2: #E03A3E; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Trail Blazer"\n data-color-scheme="red"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #E03A3E; color2: #DADADA; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Mint Choco"\n data-color-scheme="rgb"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #34eb89; color2: #34ebd8; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Cheetah SoL"\n data-color-scheme="cheetah"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #c27727; color2: #635c54; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Ash Nova"\n data-color-scheme="black"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #555; color2: #FFF; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n </a-entity>\n\n <a-entity\n id="colorName"\n mixin="font"\n text="align: center; color: #CCC; width: 1"\n position="0 -0.35 0.1"\n render-order="menutext"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/playlistMenu.html"> --\x3e\n<a-entity\n id="playlistMenu"\n bind-for="for: playlist; in: playlists; updateInPlace: true; key: name"\n bind__visible="playlistMenuOpen"\n layout="type: box; columns: 2; marginRow: -0.23; marginColumn: 1.3; align: center"\n menu-playlist\n position="0 0 0.05">\n <template>\n \n <a-entity class="playlist" data-playlist="{{ item.name }}" data-title="{{ item.title }}">\n \n <a-entity\n mixin="slice"\n slice9="opacity: 0.9; width: 1.2; left: 70; top: 70; height: 0.19; padding: 0.07"\n animation__mouseenter="property: scale; from: 1 1 1; to: 1.03 1.03 1.03; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: scale; from: 1.03 1.03 1.03; to: 1 1 1; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n proxy-event__enter="event: mouseenter; to: CHILDREN; captureBubbles: true"\n proxy-event__leave="event: mouseleave; to: CHILDREN; captureBubbles: true"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n raycaster-target="bindToggle: playlistMenuOpen; width: 1.2; height: 0.19"\n render-order__nonrecursive="menubutton">\n <a-entity\n class="playlistTitle"\n mixin="font"\n bind-item__text-uppercase="value: item.title"\n text="align: left; width: 1.3; color: #CCC"\n animation__mouseenter="property: components.text.material.uniforms.color.value; from: #CCC; to: #FFF; type: color; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.text.material.uniforms.color.value; from: #FFF; to: #CCC; type: color; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n render-order="menutext"\n position="0.11 -0.01 0.001"></a-entity>\n\n <a-entity\n class="playlistAuthor"\n mixin="font"\n bind-item__text="value: item.author"\n bind__text="color: colorPrimary"\n text="align: left; width: 1.1"\n render-order="menutext"\n position="0.01 -0.08 0.001"></a-entity>\n </a-entity>\n </a-entity>\n </template>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n</a-entity>\n\n\x3c!-- Search. --\x3e\n<a-entity id="keyboard"\n bind__super-keyboard="hand: activeHand === \'left\' && \'#leftHand\' || \'#rightHand\'; show: isSearching"\n super-keyboard="label: Search on beatsaver.com; inputColor: #fff; labelColor: #f0f0f0; width: 1.5; hand: #rightHand; imagePath: assets/img/keyboard; font: assets/fonts/Viga-Regular.json; align: center; model: superkeyboard; keyColor: #fff; injectToRaycasterObjects: false; filters: allupper; keyHoverColor: #fff"\n position="0.58 1.2 -1.95" keyboard-raycastable="condition: isSearching" search\n proxy-event__dismiss="event: superkeyboarddismiss; to: a-scene; as: keyboardclose"\n proxy-event__accept="event: superkeyboardinput; to: a-scene; as: keyboardclose" render-order="menubutton"\n render-order-recursive>\n</a-entity>\n\n<a-entity id="backButton" mixin="bigMenuTopButton"\n bind__visible-raycastable="genreMenuOpen || isSearching || difficultyFilterMenuOpen || playlistMenuOpen || optionsMenuOpen"\n position="0 2.32 -1.96" play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: menuback">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 20; value: BACK" position="0 -0.07 0.01">\n </a-entity>\n</a-entity>\n\n\x3c!-- Top menu buttons. --\x3e\n<a-mixin id="bigMenuTopButton" mixin="bigMenuButton" geometry="height: 0.17; width: 0.7"></a-mixin>\n<a-mixin id="bigMenuTopButtonFont" mixin="font" text="width: 0.75" position="0 -0.05 0.01"></a-mixin>\n<a-entity id="menuTopButtons"\n animation__position="property: object3D.position.z; to: -1.98; dur: 1500; easing: easeInOutCubic; delay: 300; startEvents: startgame"\n layout="type: line; margin: 0.65" position="-0.95 2.30 -1.96"\n proxy-event="event: startgame; to: #searchButton, #difficultyButton, #genreButton, #playlistButton, #optionButton">\n\n \x3c!-- Playlist menu toggle. --\x3e\n <a-entity id="playlistButtons">\n <a-entity id="playlistButton"\n mixin="bigMenuTopButton"\n bind__menu-playlist-button="isFavorited: menuSelectedChallenge.isFavorited; selectedChallenge: menuSelectedChallenge.id"\n bind__visible-raycastable="mainMenuActive && !playlist"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: playlistmenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: PLAYLISTS" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="clearPlaylistButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="menuActive && !!playlist"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: playlistclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR PLAYLIST"></a-entity>\n </a-entity>\n\n <a-entity\n id="playlistText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: playlistTitle"\n bind__visible="mainMenuActive && !!playlist"\n text="align: center; baseline: bottom; wrapCount: 30; width: 0.7"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \x3c!-- Search toggle. --\x3e\n <a-entity id="searchButtons">\n <a-entity\n id="searchButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !search.query"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: keyboardopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: SEARCH" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="searchClearButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !!search.query"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: searchclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR SEARCH"></a-entity>\n </a-entity>\n\n <a-entity\n id="searchText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: search.queryText"\n bind__visible="mainMenuActive && !!search.query"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \x3c!-- Difficulty menu toggle. --\x3e\n \x3c!-- <a-entity id="difficultyFilter">\n <a-entity id="difficultyButton"\n mixin="bigMenuTopButton"\n material="opacity: 0"\n bind__visible-raycastable="mainMenuActive"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: difficultyfiltermenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: DIFFICULTY" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity\n id="difficultyFilterText"\n mixin="font"\n bind__difficulty-text="difficulty: difficultyFilter"\n bind__text="color: colorPrimary"\n bind__visible="mainMenuActive && difficultyFilter !== \'All\'"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity> --\x3e\n\n \x3c!-- Genre menu toggle. --\x3e\n <a-entity id="genreButtons">\n <a-entity id="genreButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !genre"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: genremenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: GENRES" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="clearGenreButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !!genre"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: genreclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR GENRE"></a-entity>\n </a-entity>\n\n <a-entity\n id="genreText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: genre"\n bind__visible="mainMenuActive && !!genre"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n</a-entity>\n\n\x3c!-- Options menu toggle. --\x3e\n<a-entity id="optionsButtons" position="0 0.45 -1.96">\n <a-entity id="optionButton" mixin="bigMenuButton" bind__visible-raycastable="mainMenuActive" material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: optionsmenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: THEMES"\n bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n</a-entity>\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/modes.html"> --\x3e\n<a-mixin\n id="modeAnimations"\n animation__select="property: object3D.position.z; to: 0.06; dur: 200; easing: easeOutQuad; startEvents: select"\n animation__deselect="property: object3D.position.z; to: 0; dur: 200; easing: easeOutQuad; startEvents: deselect"></a-mixin>\n\n<a-mixin\n id="modeThumbAnimations"\n animation__select="property: components.material.material.color; type: color; to: #FFF; dur: 200; easing: easeOutQuad; startEvents: select"\n animation__deselect="property: components.material.material.color; type: color; to: #888; dur: 200; easing: easeOutQuad; startEvents: deselect"></a-mixin>\n\n<a-mixin\n id="modeBackgroundHover"\n animation__mouseenter="property: components.material.material.uniforms.borderWidth.value; from: 0.002; to: 0.01; startEvents: mouseenter; pauseEvents: mouseleave; easing: linear; dur: 150"\n animation__mouseleave="property: components.material.material.uniforms.borderWidth.value; from: 0.01; to: 0.002; startEvents: mouseleave; pauseEvents: mouseenter; easing: linear; dur: 150"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.3"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n\n ></a-mixin>\n\n<a-mixin\n id="modeBackgroundSelect"\n animation__select="property: components.material.material.uniforms.brightness.value; to: 0.5; startEvents: select; easing: easeOutQuad; dur: 200"\n animation__deselect="property: components.material.material.uniforms.brightness.value; to: 0.1; startEvents: deselect; easing: easeOutQuad; dur: 200"\n animation__select2="property: components.material.material.uniforms.borderWidth.value; to: 0.015; startEvents: select; easing: linear; dur: 200"\n animation__deselect2="property: components.material.material.uniforms.borderWidth.value; to: 0.002; startEvents: deselect; easing: linear; dur: 200"></a-mixin>\n\n\n\n<a-entity\n id="modes"\n bind__menu-mode="colorScheme: colorScheme; hasVR: hasVR"\n bind__position="hasVR && \'-2.56 1.3 -0.7\' || \'-2.56 1 -0.7\'"\n bind__visible="menuActive && !isMenuOpening"\n rotation="0 60 0"\n render-order="menuitem">\n\n <a-entity id="modeIcon"\n geometry="primitive: cylinder; height: 0.01; segmentsHeight: 1; radius: 0.1; segmentsRadial: 3"\n rotation="0 90 90"\n position="-1.275 0.32 0.1"\n materials="name: merkaba"\n animation="property: object3D.position.x; from: -1.275; to: -1.3; dir: alternate; easing: easeOutQuad; loop: true; dur: 900"></a-entity>\n\n <a-entity id="mode2d" bind__visible="!hasVR">\n \n\n<a-entity\n id="moderide2d"\n class="modeItem"\n data-mode="ride"\n data-name="ride2d"\n position="0 0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && !hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: RIDE\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeRideImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Relax and enjoy the ride.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="modeviewer2d"\n class="modeItem"\n data-mode="classic"\n data-name="viewer2d"\n position="0 0 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && !hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: VIEWER\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeViewerImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: View the beat map.\n\nConnect a VR headset\nwith controllers\nto experience\nmore modes!; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n </a-entity>\n\n <a-entity id="modeVR" bind__visible="hasVR">\n \n\n<a-entity\n id="modepunchvr"\n class="modeItem"\n data-mode="punch"\n data-name="punchvr"\n position="0 0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: PUNCH\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modePunchImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Punch the beats, mind\ncolor.\n\nAvoid all things yellow.\n\nPunch harder\n for better score.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="moderidevr"\n class="modeItem"\n data-mode="ride"\n data-name="ridevr"\n position="0 0 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: RIDE\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeRideImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Relax and enjoy the ride.\n\nTake a quick breather.\n\nNo score!; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="modeclassicvr"\n class="modeItem"\n data-mode="classic"\n data-name="classicvr"\n position="0 -0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: CLASSIC\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeClassicImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Cut the beats, mind\ncolor and direction.\n\nAvoid all things yellow.\n\nSwing fast and accurate\nfor better score.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n </a-entity>\n\n <a-entity\n id="loadingTipsContainer"\n bind__visible="menuActive"\n position="0 -1.3 0.1"\n rotation="0 0 0">\n\n <a-entity\n id="loadingTipsBackground"\n bind-toggle__raycastable="menuActive"\n render-order="menu"\n geometry="primitive: plane; width: 1.5; height: 0.3"\n material="shader: panelShader; ratio: 1.15; borderRadius: 0.4"\n render-order="menubutton"\n position="0 0 -0.03"></a-entity>\n\n <a-entity\n id="loadingTipsText"\n mixin="font"\n bind__text="color: colorPrimary"\n text="align: center; wrapCount: 30; width: 1; value: Press down on thumbstick center to open menu while playing."\n render-order="menutext"\n position="0 -0.02 0.001"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/victory.html"> --\x3e\n\x3c!-- Victory. --\x3e\n<a-entity\n id="victoryInfoContainer"\n position="0 1.5 -2"\n bind__visible="isVictory">\n\n <a-entity\n id="victoryAccuracyRing"\n bind__material="color: colorPrimary"k\n bind__victory-accuracy-ring="accuracy: score.finalAccuracy"\n animation="property: components.material.material.uniforms.progress.value; from: 0; easing: easeOutQuad; delay: 500; dur: 2500; autoplay: false"\n geometry="primitive: plane; width: 0.7; height: 0.7"\n material="shader: ring; transparent: true; radiusInner: 0.8; blending: additive; depthWrite: false"\n position="0 0.18 0"\n render-order="victory"></a-entity>\n\n <a-entity\n id="victoryInfoRank"\n class="accuracyTextCounterSubscribe"\n bind__animation="enabled: isVictory"\n bind__victory-rank="isVictory: isVictory; rank: score.rank"\n bind-toggle__raycastable="isVictory"\n scale="0 0 0"\n position="0 -0.034 0"\n animation__rotation="property: object3D.rotation.y; from: 0; to: -360; loop: true; easing: linear; dur: 5000; startEvents: textcounterdone"\n animation__scale="property: scale; from: 0 0 0; to: 1 1 1; loop: false; easing: easeOutQuad; dur: 300; startEvents: textcounterdone"\n play-sound="sound: #victorySound; event: textcounterdone"\n render-order="menuitemtext"\n text-geometry="font: #VigaRegularThree; bevelEnabled: true; bevelSize: 0.01; bevelThickness: 0.01; curveSegments: 7; height: 0.15; size: 0.4"></a-entity>\n\n <a-entity\n id="victoryInfoAccuracy"\n class="accuracyTextCounterSubscribe"\n mixin="font"\n bind__text="color: colorSecondary; opacity: isVictory && 0 || 0; value: score.score + \' POINTS\'"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n text="align: left; wrapCount: 22; baseline: top; width: 0.81"\n position="0.85 0.2 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoBeatsHit"\n class="accuracyTextCounterSubscribe"\n mixin="font"\n bind__text="color: colorSecondary; opacity: isVictory && 0 || 0; value: score.beatsText"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n text="align: left; wrapCount: 22; baseline: top; width: 0.81"\n position="0.85 0.1 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoAccuracy"\n mixin="font"\n bind__text="color: colorTertiary"\n text="value: 0; align: center; wrapCount: 15; baseline: top; width: 2.25"\n bind__text-counter="enabled: isVictory; value: score.finalAccuracy"\n text-counter="suffix: %"\n position="0 -0.47 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoMaxCombo"\n mixin="font"\n bind__text="color: colorSecondary"\n bind__text-counter="enabled: isVictory; value: score.maxCombo"\n text="align: center; wrapCount: 22; baseline: top; width: 1"\n text-counter="prefix: MAX STREAK: ; emit: true"\n proxy-event="event: textcounterdone; to: .accuracyTextCounterSubscribe"\n position="0 -0.58 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryButtons"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25"\n render-order="menubutton">\n <a-entity\n id="victoryRestartButton"\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isVictory"\n bind__material="opacity: isVictory && 0 || 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n position="-0.56 -0.79 0.05"\n proxy-event="event: click; to: a-scene; as: gamemenurestart">\n <a-entity\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButtonText"\n bind__text="opacity: isVictory && 0 || 0"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n render-order="menuitemtext"\n text="opacity: 0; value: PLAY AGAIN"></a-entity>\n </a-entity>\n\n <a-entity\n id="victoryExitButton"\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isVictory"\n bind__material="opacity: isVictory && 0 || 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n position="0.56 -0.79 0.05"\n proxy-event="event: click; to: a-scene; as: gamemenuexit">\n <a-entity\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButtonText"\n bind__text="opacity: isVictory && 0 || 0"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n render-order="menuitemtext"\n text="opacity: 0; value: BACK TO MENU"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/leaderboard.html"> --\x3e\n<a-entity\n id="leaderboard"\n class="accuracyTextCounterSubscribe"\n bind__animation="enabled: isVictory"\n bind__scale="isVictory && \'0 0 0\' || \'1 1 1\'"\n bind__visible="(!!menuSelectedChallenge.id || !!challenge.id) && (menuActive || isPaused || isVictory || isLoading) && !genreMenuOpen && gameMode !== \'ride\'"\n position="2.36 1.5 -1.19"\n rotation="0 -60 0"\n animation="property: scale; from: 0 0 0; to: 1 1 1; easing: easeOutBack; startEvents: textcounterdone"\n render-order="menuitem">\n\n <a-entity\n bind-toggle__raycastable="leaderboardActive"\n id="leaderboardBackground" position="0 0 0"\n geometry="primitive: plane; width: 2; height: 2"\n material="shader: panelShader; ratio: 1.16; brightness: 0.2"></a-entity>\n\n <a-entity\n id="leaderboardChallengeImage"\n bind__menu-selected-challenge-image="coverURL: menuSelectedChallenge.coverURL"\n bind__visible="!isVictory"\n geometry="primitive: plane; height: 0.12; width: 0.12"\n material="shader: flat"\n position="-0.44 0.63 0.001"></a-entity>\n\n <a-entity\n id="leaderboardTitle"\n mixin="font"\n text="align: center; width: 2.5; value: LEADERBOARD"\n position="0.05 0.55 0.001"\n bind__visible="!leaderboardQualified"></a-entity>\n\n <a-entity\n id="leaderboardNames"\n mixin="font"\n bind__text="color: colorSecondary; value: leaderboardNames"\n bind__visible="!leaderboardQualified && !leaderboardEmpty"\n text="baseline: top; width: 1.2; anchor: left; wrapCount: 28; lineHeight: 53;"\n position="-0.7 0.3 0.001"></a-entity>\n\n <a-entity\n id="leaderboardScores"\n mixin="font"\n bind__text="value: leaderboardScores"\n bind__visible="!leaderboardQualified && !leaderboardEmpty"\n text="baseline: top; align: right; width: 1.2; anchor: right; color: #fff; wrapCount: 28; lineHeight: 53;"\n position="0.7 0.3 0.001"></a-entity>\n\n <a-entity\n id="leaderboardEmpty"\n mixin="font"\n bind__visible="leaderboard.length === 0 && !leaderboardQualified && !leaderboardLoading"\n text="align: center; color: #999; baseline: center; width: 2; value: No high scores. Be the first!"\n position="0 0 0.001"></a-entity>\n\n <a-entity\n id="leaderboardKeyboard"\n bind__super-keyboard="hand: activeHand === \'left\' && \'#leftHand\' || \'#rightHand\'; show: leaderboardQualified"\n super-keyboard="inputColor: #fff; hand: #rightHand; imagePath: assets/img/keyboard; font: assets/fonts/Viga-Regular.json; align: center; model: superkeyboard; keyColor: #fff; injectToRaycasterObjects: false; filters: allupper; keyHoverColor: #fff; maxLength: 15; width: 1.5; label: NEW HIGH SCORE!\nENTER THE LEADERBOARD; labelColor: #FAFAFA"\n position="0 -0.08 0.02"\n proxy-event__change="event: superkeyboardchange; to: a-scene; as: leaderboardusername"\n keyboard-raycastable="condition: leaderboardQualified"\n render-order="menutext"\n render-order-recursive>\n </a-entity>\n\n <a-entity id="leaderboardSubmit"\n position="0 -0.67 0.002"\n mixin="bigMenuButton"\n bind__visible-raycastable="leaderboardQualified"\n proxy-event="event: click; to: a-scene; as: leaderboardsubmit">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 26; value: SUBMIT HIGH SCORE" position="0 -0.055 0.01"></a-entity>\n \x3c!--slice9="width: 1.5; height: 0.24"--\x3e\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/news.html"> --\x3e\n\n\n\n\n\n<a-entity\n id="news"\n bind__visible="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n position="2.365374194652176 1.6 -1.1952715561051024"\n rotation="0 -60 0"\n render-order="menuitem">\n\n <a-entity\n id="newsBackground"\n bind-toggle__raycastable="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n geometry="primitive: plane; width: 2.1; height: 1.9"\n material="shader: panelShader; ratio: 1.14; brightness: 0.2"></a-entity>\n\n <a-entity\n id="newsText"\n mixin="font"\n text="align: left; color: #FAFAFA; baseline: center; width: 1.6; wrapCount: 50; value: three.ws\n\nGive your AI a body. three.ws is an open-source, browser-native 3D AI agent platform.\n\nDrop a GLB file, add an LLM brain, register on-chain, and embed anywhere — no plugins, no installs.\n\nVisit three.ws to build your agent."\n position="0 -0.04 0.001"></a-entity>\n</a-entity>\n\n<a-entity\n id="support"\n bind__visible="menuActive && !menuSelectedChallenge.id && !isMenuOpening && inVR"\n position="2.365374194652176 0.25 -1.1952715561051024"\n rotation="-15 -60 0"\n render-order="menuitem">\n\n <a-entity\n id="supportBackground"\n bind-toggle__raycastable="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n geometry="primitive: plane; width: 2.1; height: 0.9"\n material="shader: panelShader; ratio: 1.14; brightness: 0.2"></a-entity>\n\n <a-entity\n id="supportImage"\n geometry="primitive: plane; width: 0.6; height: 0.5"\n material="shader: flat; src: /assets/img/banner.jpg"\n position="-0.5 0 0.001"></a-entity>\n\n <a-entity\n id="supportText"\n mixin="font"\n text="align: left; color: #FAFAFA; baseline: center; width: 1; wrapCount: 30; value: Support three.ws development.\n\nVisit three.ws for more."\n position="0.35 -0.04 0.001"></a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n\n <a-mixin\n id="cursorMesh"\n material="shader: flat; transparent: true; src: #cursorMeshImg; depthTest: false"\n sub-object="from: #cursorLaser; name: glow"></a-mixin>\n\n <a-entity\n id="curve"\n material="shader: supercurve"\n supercurve\n supercurve-color\n render-order="curve"></a-entity>\n\n <a-entity\n id="tunnelsContainer"\n render-order="curve"\n bind__visible="isPlaying || isPaused"></a-entity>\n\n <a-entity\n id="beatContainer"\n beat-hit-sound\n bind__visible="isPlaying"></a-entity>\n\n <a-entity\n id="wallContainer"\n bind__visible="isPlaying"></a-entity>\n\n <a-entity id="curveFollowRig"\n bind__curve-follow-rig-reset="isVictory: isVictory"\n bind__supercurve-follow="enabled: isPlaying; speed: speed"\n supercurve-follow="target: #curve">\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/stageFollow.html"> --\x3e\n<a-entity\n id="tube"\n bind__visible="isPlaying"\n rotation="90 180 0"\n position="0 0 -5"\n geometry="primitive: cylinder; radius: 3; openEnded: true; height: 20"\n materials="name: tube"\n animation="property: components.materials.material.uniforms.opacity.value; from: 1; to: 0; easing: easeInOutCubic; startEvents: pulse"></a-entity>\n\n<a-entity\n id="platformShadow"\n obj-model="obj: #homeShadowObj"\n position="0 0.02 0"\n material="src: #homeShadowImg; shader: flat; blending: multiply; transparent: true;"\n raycastable-game\n render-order="curveshadow"\n stepback></a-entity>\n\n<a-entity\n id="platform"\n obj-model="obj: #homeObj"\n materials="name: home"\n bind__materials="animate: isPlaying"></a-entity>\n\n<a-entity\n id="sideGlows"\n bind__visible="isPlaying || isPaused">\n <a-entity\n id="leftSideGlow"\n geometry="primitive: plane; width: 8; height: 2"\n materials="name: leftsideglow"\n position="-2.1 .5 -3"\n rotation="20 -90 0"\n render-order="sideglow">\n </a-entity>\n <a-entity\n id="rightSideGlow"\n geometry="primitive: plane; width: 8; height: 2"\n materials="name: rightsideglow"\n position="2.1 .5 -3"\n rotation="-20 -90 0"\n render-order="sideglow">\n </a-entity>\n</a-entity>\n\n<a-entity\n id="light"\n light="type: hemisphere; color: #666"\n position="0 10 20"></a-entity>\n\n\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/score.html"> --\x3e\n<a-mixin\n id="scoreText"\n mixin="font"\n text="lineHeight: 40; color: #FAFAFA; letterSpacing: -2; align: center; opacity: 0.7"></a-mixin>\n\n<a-entity\n id="scoreContainer"\n bind__score-texts="isLoading: isLoading"\n bind__visible="score.active"\n render-order="score">\n\n <a-entity\n id="songProgressRing"\n bind__material="color: colorSecondary"\n bind__song-progress-info="enabled: isPlaying || isPaused && challenge.isBeatsPreloaded"\n geometry="primitive: plane; width: 0.57; height: 0.03"\n material="shader: flat"\n position="1.525 0.1 -3.94"\n rotation="-30 0 0">\n </a-entity>\n\n <a-entity id="scoreNumberContainer" position="1.5 0.13 -4">\n <a-entity\n id="combo"\n mixin="scoreText"\n bind__text="color: colorPrimary; value: \'STREAK \' + score.combo"\n text="width: 3.5; align: left; anchor: left"\n rotation="-20 0 0"\n position="-0.025 0.175 0"></a-entity>\n\n <a-entity\n id="accuracy"\n mixin="scoreText"\n bind__text="color: colorSecondary; value: score.accuracyInt + \'%\' + \' / \' + score.score"\n text="width: 3.5; align: left; anchor: left"\n rotation="-20 0 0"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/gameMenu.html"> --\x3e\n<a-mixin\n id="gameMenuButton"\n mixin="bigMenuButton"\n animation__mouseenter="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 70"\n animation__mouseleave="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 70"\n geometry="height: 0.28"></a-mixin>\n\n<a-mixin\n id="gameMenuButtonText"\n mixin="font"\n position="0 -0.08 0.01"\n render-order="menutext"\n text="align: center; wrapCount: 17"></a-mixin>\n\n\x3c!-- Titles. --\x3e\n<a-entity id="inGameMenuTitles" position="0 2.2 -2.3">\n <a-entity mixin="gameMenuButtonText" text="value: GAME OVER; color: #f01978; width: 3.5" bind__visible="isGameOver"></a-entity>\n <a-entity mixin="gameMenuButtonText" text="value: SONG CLEARED; color: #FFF; width: 3.5" bind__visible="isVictory" position="0 0.1 0"></a-entity>\n <a-entity mixin="gameMenuButtonText" bind__text="color: colorPrimary" text="value: PAUSED; width: 3.5" bind__visible="isPaused"></a-entity>\n</a-entity>\n\n<a-entity\n id="gameMenu"\n bind__visible="isPaused || isVictory"\n position="0 1.5 -2"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25">\n\n \x3c!-- Actions. --\x3e\n <a-entity\n id="resumeButton"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isPaused"\n bind__visible="isPaused"\n position="0 0.35 0"\n proxy-event="event: click; to: a-scene; as: gamemenuresume">\n <a-entity mixin="gameMenuButtonText" text="value: RESUME"></a-entity>\n </a-entity>\n\n <a-entity\n id="restartButton"\n mixin="gameMenuButton"\n bind__visible="!isVictory"\n bind-toggle__raycastable="isPaused || isGameOver"\n proxy-event="event: click; to: a-scene; as: gamemenurestart">\n <a-entity mixin="gameMenuButtonText" text="value: RESTART SONG"></a-entity>\n </a-entity>\n\n <a-entity\n id="exitButton"\n mixin="gameMenuButton"\n bind__visible="!isVictory"\n bind-toggle__raycastable="isPaused || isGameOver"\n position="0 -0.35 0"\n proxy-event="event: click; to: a-scene; as: gamemenuexit">\n <a-entity mixin="gameMenuButtonText" text="value: EXIT TO MENU"></a-entity>\n </a-entity>\n\n \x3c!-- Song info. --\x3e\n <a-entity id="gameMenuSongInfoContainer"\n position="0 -1 0.15473"\n rotation="-20 0 0"\n song-info-positioner\n bind__song-info-positioner="victory: isVictory">\n <a-entity id="gameMenuSongBackground"\n bind-toggle__raycastable="isPaused || isVictory"\n render-order="menu"\n geometry="primitive: plane; width: 2.5; height: 0.3"\n material="shader: panelShader; transparent: true; ratio: 4; borderRadius: 0.5; borderWidth: 0.02"\n position="0 0 -0.03"></a-entity>\n\n <a-entity id="gameMenuSongImage"\n copy-texture="from: #menuSelectedChallengeImage"\n geometry="primitive: plane; buffer: false; skipCache: true; height: 0.3; width: 0.3"\n material="shader: flat"\n position="-1 0 0"></a-entity>\n\n <a-entity id="gameMenuSongInfo">\n <a-entity\n id="gameMenuSongName"\n position="0 0.01 0"\n mixin="font" text="align: center; color: #fff; wrapCount: 30; baseline: top; lineHeight: 36; width: 1.2"\n bind__text="value: challenge.metadata.songName"></a-entity>\n <a-entity\n id="gameMenuSongSubName"\n mixin="font"\n position="0 -0.09 0"\n bind__text="color: colorSecondary"\n bind__text-truncate="value: challenge.metadata.songSubName + \' - \' + challenge.metadata.songAuthorName"\n text-truncate="length: 80"\n text="wrapCount: 80; align: center; width: 2.4" bind__text="value: menuSelectedChallenge.songSubName"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n\n \x3c!-- Beat pieces, explosions, fx, and weapon trail. --\x3e\n <a-entity id="rigContainer"></a-entity>\n\n \x3c!-- Supercut FX rings. --\x3e\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n\n \x3c!-- Player. --\x3e\n <a-entity id="cameraRig">\n <a-entity\n id="camera"\n bind__wasd-controls="enabled: !inVr"\n position="0 1.6 0.5"\n camera="far: 10000"\n look-controls\n player-height\n wasd-controls="acceleration: 15"></a-entity>\n \x3c!-- Agent companion seated next to player. The GLB has its origin at\n the feet, so we drop it ~0.45m below camera height; rider has no\n visible floor at the player position, so the lower legs fade out\n and only the seated upper body is visible. --\x3e\n <a-entity\n id="agentCompanion"\n gltf-model="#agentGlb"\n agent-dance\n position="0.7 0.45 0.5"\n rotation="0 165 0"\n scale="0.9 0.9 0.9"></a-entity>\n <a-entity\n id="cameraWallCollider"\n bind__raycaster__wall="enabled: isPlaying && gameMode !== \'ride\'"\n proxy-event__wallhitstart="event: raycaster-intersection; to: a-scene; as: wallhitstart"\n proxy-event__wallhitend="event: raycaster-intersection-cleared; to: a-scene; as: wallhitend"\n follow-position="target: #camera"\n raycaster__wall="objects: [data-wall-active]; interval: 150; direction: 0 -1 0; far: 5"\n visible="false"></a-entity>\n </a-entity>\n\n <a-entity\n id="controllerRig"\n proxy-event="event: recentered; to: #cameraRig; captureBubbles: true; as: recenter">\n \n\n \n <a-entity id="leftHand"\n class="weapon"\n bind__hand-swapper="enabled: rightRaycasterActive"\n bind__haptics-wall="enabled: isPlaying && gameMode === \'classic\'"\n bind__headfist="isPlaying: isPlaying"\n bind__menu-controls="enabled: mainMenuActive"\n bind__pauser="enabled: isPlaying"\n bind__punch="enabled: isPlaying && gameMode === \'punch\'"\n bind__raycaster="enabled: leftRaycasterActive"\n bind__raycaster__game="enabled: isPlaying && (gameMode === \'classic\' || gameMode === \'punch\')"\n bind__blade="enabled: isPlaying && gameMode === \'classic\'"\n bind__weapon-particles="enabled: isPlaying; gameMode: gameMode"\n bind__trail="colorScheme: colorScheme; enabled: isPlaying && gameMode === \'classic\'"\n controller="hand: left"\n data-hand="left"\n haptics="events: mouseenter; dur: 35; force: 0.075"\n haptics__beat="events: beathaptic; dur: 90; force: 0.55"\n haptics__draw="events: drawblade; dur: 750; force: 0.025"\n haptics__plume="events: plumepulse; dur: 35; force: 0.1"\n headfist="hand: left"\n raycaster="objects: [raycastable]; far: 5; showLine: false"\n raycaster__game="objects: [raycastable-game]; far: 1; interval: 71; direction: 0 1 -1"\n weapon="hand: left"\n weapon-particles="hand: left"\n thumb-controls\n thumb-controls-debug="enabled: false; hand: left; controllerType: vive-controls"\n render-order="weapon"\n trail="color: primary; hand: left">\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'">\n <a-entity\n id="leftLaser"\n class="laser"\n bind__material="color: colorPrimary"\n bind__cursor-laser="enabled: activeHand === \'left\' && !isPlaying"\n geometry="primitive: cylinder; height: 1; radius: 0.005"\n material="shader: flat; opacity: 0.25; transparent: true"\n rotation="-90 0 0"></a-entity>\n </a-entity>\n\n \x3c!-- Blade. --\x3e\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'"\n bind__rotation="controllerType.indexOf(\'oculus\') !== -1 && \'135 0 0\' || \'90 0 0\'">\n <a-entity\n class="bladeContainer"\n bind__visible="isPlaying && gameMode === \'classic\'"\n animation="property: scale; from: 0 0 0; to: 1 1 1; dur: 750; easing: linear; startEvents: drawblade"\n scale="0.001 0.001 0.001">\n <a-entity\n class="blade bladeleft"\n obj-model="obj: #weaponObj"\n materials="name: leftWeapon"\n render-order="weapon"\n position="0 -0.43 0">\n <a-entity class="bladeTipHelper" position="0 -0.45 0"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n class="bladeHandle"\n bind__visible="!isPlaying || gameMode === \'classic\'"\n obj-model="obj: #weaponHandleObj"\n materials="name: leftWeaponHandle">\n <a-entity class="bladeHandleHelper"></a-entity>\n </a-entity>\n </a-entity>\n\n \x3c!-- Punch. --\x3e\n <a-entity\n id="leftpunch"\n class="punch"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'punch\'"\n bind__position="has3DOFVR && \'0 0 -0.75\' || \'0 0 0\'"\n rotation="0 0 0">\n <a-entity\n class="punchFist"\n obj-model="obj: #leftFistObj"\n materials="name: leftFist"></a-entity>\n <a-entity\n class="punchBbox"\n geometry="primitive: box; width: 0.2; height: 0.23; depth: 0.15"\n material="shader: flat; opacity: 0.5"\n position="0 0.05 0.1"\n rotation="30 0 0"\n visible="false"></a-entity>\n <a-entity\n obj-model="obj: #leftFistWeaponObj"\n materials="name: leftFistWeapon"></a-entity>\n </a-entity>\n\n \x3c!-- Ride. --\x3e\n <a-entity\n id="leftstar"\n class="handStar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'">\n <a-entity\n class="handStar"\n bind__material="colorPrimary: colorPrimary; colorSecondary: colorSecondary; colorTertiary: colorTertiary"\n geometry="primitive: sphere; radius: 0.1"\n material="shader: handStar"\n animation__pulse="property: components.material.material.uniforms.pulse.value; from: 2; to: 0; dur: 300; startEvents: plumepulse; easing: easeInOutQuad"\n animation__scale="property: scale; from: 2 2 2; to: 1 1 1; dur: 1200; startEvents: plumepulse; easing: easeInOutQuad"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n id="leftCursorMesh"\n mixin="cursorMesh"\n bind__cursor-mesh="active: leftRaycasterActive && !isPlaying"\n bind__material="color: colorPrimary"\n cursor-mesh="cursorEl: #leftHand"\n material\n render-order="cursor"\n scale="1.3 1.3 1.3"></a-entity>\n \n \n <a-entity id="rightHand"\n class="weapon"\n bind__hand-swapper="enabled: leftRaycasterActive"\n bind__haptics-wall="enabled: isPlaying && gameMode === \'classic\'"\n bind__headfist="isPlaying: isPlaying"\n bind__menu-controls="enabled: mainMenuActive"\n bind__pauser="enabled: isPlaying"\n bind__punch="enabled: isPlaying && gameMode === \'punch\'"\n bind__raycaster="enabled: rightRaycasterActive"\n bind__raycaster__game="enabled: isPlaying && (gameMode === \'classic\' || gameMode === \'punch\')"\n bind__blade="enabled: isPlaying && gameMode === \'classic\'"\n bind__weapon-particles="enabled: isPlaying; gameMode: gameMode"\n bind__trail="colorScheme: colorScheme; enabled: isPlaying && gameMode === \'classic\'"\n controller="hand: right"\n data-hand="right"\n haptics="events: mouseenter; dur: 35; force: 0.075"\n haptics__beat="events: beathaptic; dur: 90; force: 0.55"\n haptics__draw="events: drawblade; dur: 750; force: 0.025"\n haptics__plume="events: plumepulse; dur: 35; force: 0.1"\n headfist="hand: right"\n raycaster="objects: [raycastable]; far: 5; showLine: false"\n raycaster__game="objects: [raycastable-game]; far: 1; interval: 70; direction: 0 1 -1"\n weapon="hand: right"\n weapon-particles="hand: right"\n thumb-controls\n thumb-controls-debug="enabled: false; hand: right; controllerType: vive-controls"\n render-order="weapon"\n trail="color: secondary; hand: right">\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'">\n <a-entity\n id="rightLaser"\n class="laser"\n bind__material="color: colorSecondary"\n bind__cursor-laser="enabled: activeHand === \'right\' && !isPlaying"\n geometry="primitive: cylinder; height: 1; radius: 0.005"\n material="shader: flat; opacity: 0.25; transparent: true"\n rotation="-90 0 0"></a-entity>\n </a-entity>\n\n \x3c!-- Blade. --\x3e\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'"\n bind__rotation="controllerType.indexOf(\'oculus\') !== -1 && \'135 0 0\' || \'90 0 0\'">\n <a-entity\n class="bladeContainer"\n bind__visible="isPlaying && gameMode === \'classic\'"\n animation="property: scale; from: 0 0 0; to: 1 1 1; dur: 750; easing: linear; startEvents: drawblade"\n scale="0.001 0.001 0.001">\n <a-entity\n class="blade bladeright"\n obj-model="obj: #weaponObj"\n materials="name: rightWeapon"\n render-order="weapon"\n position="0 -0.43 0">\n <a-entity class="bladeTipHelper" position="0 -0.45 0"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n class="bladeHandle"\n bind__visible="!isPlaying || gameMode === \'classic\'"\n obj-model="obj: #weaponHandleObj"\n materials="name: rightWeaponHandle">\n <a-entity class="bladeHandleHelper"></a-entity>\n </a-entity>\n </a-entity>\n\n \x3c!-- Punch. --\x3e\n <a-entity\n id="rightpunch"\n class="punch"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'punch\'"\n bind__position="has3DOFVR && \'0 0 -0.75\' || \'0 0 0\'"\n rotation="0 0 0">\n <a-entity\n class="punchFist"\n obj-model="obj: #rightFistObj"\n materials="name: rightFist"></a-entity>\n <a-entity\n class="punchBbox"\n geometry="primitive: box; width: 0.2; height: 0.23; depth: 0.15"\n material="shader: flat; opacity: 0.5"\n position="0 0.05 0.1"\n rotation="30 0 0"\n visible="false"></a-entity>\n <a-entity\n obj-model="obj: #rightFistWeaponObj"\n materials="name: rightFistWeapon"></a-entity>\n </a-entity>\n\n \x3c!-- Ride. --\x3e\n <a-entity\n id="rightstar"\n class="handStar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'">\n <a-entity\n class="handStar"\n bind__material="colorPrimary: colorPrimary; colorSecondary: colorSecondary; colorTertiary: colorTertiary"\n geometry="primitive: sphere; radius: 0.1"\n material="shader: handStar"\n animation__pulse="property: components.material.material.uniforms.pulse.value; from: 2; to: 0; dur: 300; startEvents: plumepulse; easing: easeInOutQuad"\n animation__scale="property: scale; from: 2 2 2; to: 1 1 1; dur: 1200; startEvents: plumepulse; easing: easeInOutQuad"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n id="rightCursorMesh"\n mixin="cursorMesh"\n bind__cursor-mesh="active: rightRaycasterActive && !isPlaying"\n bind__material="color: colorSecondary"\n cursor-mesh="cursorEl: #rightHand"\n material\n render-order="cursor"\n scale="1.3 1.3 1.3"></a-entity>\n \n </a-entity>\n\n <a-entity\n id="stepback"\n position="0 1.6 -1.55"\n geometry="primitive: plane; width: 0.25; height: 0.25;"\n material="shader: flat; src: #stepbackImg; transparent: true; opacity: 0"\n render-order="stepback"></a-entity>\n </a-entity>\n\n <a-entity\n id="mouseCursor"\n bind__raycaster="enabled: !inVR"\n cursor="rayOrigin: mouse"\n raycaster="objects: [raycastable]"></a-entity>\n <a-entity\n id="mouseCursorMesh"\n mixin="cursorMesh"\n cursor-mesh="cursorEl: #mouseCursor"\n bind__cursor-mesh="active: menuActive"\n render-order="cursor"></a-entity>\n\n <a-entity\n tail="target: #leftstar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'"></a-entity>\n <a-entity\n tail="target: #rightstar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'"></a-entity>\n</a-scene>\n';document.addEventListener("DOMContentLoaded",(function(){let e=document.getElementById("app");e||(e=document.createElement("div"),e.id="app",document.body.appendChild(e));e.innerHTML=r}));{const t=n(235).DiffDOM;if(e.hot.accept(),e.hot.data&&e.hot.data.oldHtml){const n=e.hot.data.oldHtml,i=new t,a=document.createElement("div");a.innerHTML=n;const o=document.createElement("div");o.innerHTML=r;const s=i.diff(a.querySelector("a-scene"),o.querySelector("a-scene"));i.apply(document.querySelector("a-scene"),s)}e.hot.dispose(e=>{e.oldHtml=r})}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";function r(e,t,n){let i;return"#text"===e.nodeName?i=n.document.createTextNode(e.data):"#comment"===e.nodeName?i=n.document.createComment(e.data):("svg"===e.nodeName||t?(i=n.document.createElementNS("http://www.w3.org/2000/svg",e.nodeName),t=!0):i=n.document.createElement(e.nodeName),e.attributes&&Object.entries(e.attributes).forEach(([e,t])=>i.setAttribute(e,t)),e.childNodes&&e.childNodes.forEach(e=>i.appendChild(r(e,t,n))),n.valueDiffing&&(e.value&&(i.value=e.value),e.checked&&(i.checked=e.checked),e.selected&&(i.selected=e.selected))),i}function i(e,t){for(t=t.slice();t.length>0;){if(!e.childNodes)return!1;const n=t.splice(0,1)[0];e=e.childNodes[n]}return e}function a(e,t,n){let a,o,s,c,l,u=i(e,t[n._const.route]);const h={diff:t,node:u};if(n.preDiffApply(h))return!0;switch(t[n._const.action]){case n._const.addAttribute:if(!u||!u.setAttribute)return!1;u.setAttribute(t[n._const.name],t[n._const.value]);break;case n._const.modifyAttribute:if(!u||!u.setAttribute)return!1;u.setAttribute(t[n._const.name],t[n._const.newValue]),"INPUT"===u.nodeName&&"value"===t[n._const.name]&&(u.value=t[n._const.oldValue]);break;case n._const.removeAttribute:if(!u||!u.removeAttribute)return!1;u.removeAttribute(t[n._const.name]);break;case n._const.modifyTextElement:if(!u||3!==u.nodeType)return!1;n.textDiff(u,u.data,t[n._const.oldValue],t[n._const.newValue]);break;case n._const.modifyValue:if(!u||void 0===u.value)return!1;u.value=t[n._const.newValue];break;case n._const.modifyComment:if(!u||void 0===u.data)return!1;n.textDiff(u,u.data,t[n._const.oldValue],t[n._const.newValue]);break;case n._const.modifyChecked:if(!u||void 0===u.checked)return!1;u.checked=t[n._const.newValue];break;case n._const.modifySelected:if(!u||void 0===u.selected)return!1;u.selected=t[n._const.newValue];break;case n._const.replaceElement:u.parentNode.replaceChild(r(t[n._const.newValue],"http://www.w3.org/2000/svg"===u.namespaceURI,n),u);break;case n._const.relocateGroup:c=Array(...new Array(t.groupLength)).map(()=>u.removeChild(u.childNodes[t[n._const.from]])),c.forEach((e,r)=>{0===r&&(o=u.childNodes[t[n._const.to]]),u.insertBefore(e,o||null)});break;case n._const.removeElement:u.parentNode.removeChild(u);break;case n._const.addElement:s=t[n._const.route].slice(),l=s.splice(s.length-1,1)[0],u=i(e,s),u.insertBefore(r(t[n._const.element],"http://www.w3.org/2000/svg"===u.namespaceURI,n),u.childNodes[l]||null);break;case n._const.removeTextElement:if(!u||3!==u.nodeType)return!1;u.parentNode.removeChild(u);break;case n._const.addTextElement:if(s=t[n._const.route].slice(),l=s.splice(s.length-1,1)[0],a=n.document.createTextNode(t[n._const.value]),u=i(e,s),!u||!u.childNodes)return!1;u.insertBefore(a,u.childNodes[l]||null);break;default:console.log("unknown action")}return h.newNode=a,n.postDiffApply(h),!0}function o(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function s(e,t,n){t.length||(t=[t]),(t=t.slice()).reverse(),t.forEach(t=>{!function(e,t,n){switch(t[n._const.action]){case n._const.addAttribute:t[n._const.action]=n._const.removeAttribute,a(e,t,n);break;case n._const.modifyAttribute:o(t,n._const.oldValue,n._const.newValue),a(e,t,n);break;case n._const.removeAttribute:t[n._const.action]=n._const.addAttribute,a(e,t,n);break;case n._const.modifyTextElement:case n._const.modifyValue:case n._const.modifyComment:case n._const.modifyChecked:case n._const.modifySelected:case n._const.replaceElement:o(t,n._const.oldValue,n._const.newValue),a(e,t,n);break;case n._const.relocateGroup:o(t,n._const.from,n._const.to),a(e,t,n);break;case n._const.removeElement:t[n._const.action]=n._const.addElement,a(e,t,n);break;case n._const.addElement:t[n._const.action]=n._const.removeElement,a(e,t,n);break;case n._const.removeTextElement:t[n._const.action]=n._const.addTextElement,a(e,t,n);break;case n._const.addTextElement:t[n._const.action]=n._const.removeTextElement,a(e,t,n);break;default:console.log("unknown action")}}(e,t,n)})}n.r(t),n.d(t,"DiffDOM",(function(){return _})),n.d(t,"TraceLogger",(function(){return S}));class c{constructor(e={}){Object.entries(e).forEach(([e,t])=>this[e]=t)}toString(){return JSON.stringify(this)}setValue(e,t){return this[e]=t,this}}function l(e){const t=[];return"#text"!==e.nodeName&&"#comment"!==e.nodeName&&(t.push(e.nodeName),e.attributes&&(e.attributes.class&&t.push(`${e.nodeName}.${e.attributes.class.replace(/ /g,".")}`),e.attributes.id&&t.push(`${e.nodeName}#${e.attributes.id}`))),t}function u(e){const t={},n={};return e.forEach(e=>{l(e).forEach(e=>{const r=e in t;r||e in n?r&&(delete t[e],n[e]=!0):t[e]=!0})}),t}function h(e,t){const n=u(e),r=u(t),i={};return Object.keys(n).forEach(e=>{r[e]&&(i[e]=!0)}),i}function d(e){return delete e.outerDone,delete e.innerDone,delete e.valueDone,!e.childNodes||e.childNodes.every(d)}function p(e,t){if(!["nodeName","value","checked","selected","data"].every(n=>e[n]===t[n]))return!1;if(Boolean(e.attributes)!==Boolean(t.attributes))return!1;if(Boolean(e.childNodes)!==Boolean(t.childNodes))return!1;if(e.attributes){const n=Object.keys(e.attributes),r=Object.keys(t.attributes);if(n.length!==r.length)return!1;if(!n.every(n=>e.attributes[n]===t.attributes[n]))return!1}if(e.childNodes){if(e.childNodes.length!==t.childNodes.length)return!1;if(!e.childNodes.every((e,n)=>p(e,t.childNodes[n])))return!1}return!0}function f(e,t,n,r,i){if(!e||!t)return!1;if(e.nodeName!==t.nodeName)return!1;if("#text"===e.nodeName)return!!i||e.data===t.data;if(e.nodeName in n)return!0;if(e.attributes&&t.attributes){if(e.attributes.id){if(e.attributes.id!==t.attributes.id)return!1;if(`${e.nodeName}#${e.attributes.id}`in n)return!0}if(e.attributes.class&&e.attributes.class===t.attributes.class){if(`${e.nodeName}.${e.attributes.class.replace(/ /g,".")}`in n)return!0}}if(r)return!0;const a=e.childNodes?e.childNodes.slice().reverse():[],o=t.childNodes?t.childNodes.slice().reverse():[];if(a.length!==o.length)return!1;if(i)return a.every((e,t)=>e.nodeName===o[t].nodeName);{const e=h(a,o);return a.every((t,n)=>f(t,o[n],e,!0,!0))}}function m(e){return JSON.parse(JSON.stringify(e))}function g(e,t,n,r){let i=0,a=[];const o=e.length,s=t.length,c=Array(...new Array(o+1)).map(()=>[]),u=h(e,t);let d=o===s;d&&e.some((e,n)=>{const r=l(e),i=l(t[n]);return r.length!==i.length?(d=!1,!0):(r.some((e,t)=>{if(e!==i[t])return d=!1,!0}),!d||void 0)});for(let l=0;l<o;l++){const o=e[l];for(let e=0;e<s;e++){const s=t[e];n[l]||r[e]||!f(o,s,u,d)?c[l+1][e+1]=0:(c[l+1][e+1]=c[l][e]?c[l][e]+1:1,c[l+1][e+1]>=i&&(i=c[l+1][e+1],a=[l+1,e+1]))}}return 0!==i&&{oldValue:a[0]-i,newValue:a[1]-i,length:i}}function y(e,t){return Array(...new Array(e)).map(()=>t)}class v{constructor(){this.list=[]}add(e){this.list.push(...e)}forEach(e){this.list.forEach(t=>e(t))}}function b(e,t){let n,r,i=e;for(t=t.slice();t.length>0;){if(!i.childNodes)return!1;r=t.splice(0,1)[0],n=i,i=i.childNodes[r]}return{node:i,parentNode:n,nodeIndex:r}}function w(e,t,n){return t.forEach(t=>{!function(e,t,n){const r=b(e,t[n._const.route]);let i=r.node;const a=r.parentNode,o=r.nodeIndex,s=[],c={diff:t,node:i};if(n.preDiffApply(c))return!0;let l,u,h,d;switch(t[n._const.action]){case n._const.addAttribute:i.attributes||(i.attributes={}),i.attributes[t[n._const.name]]=t[n._const.value],"checked"===t[n._const.name]?i.checked=!0:"selected"===t[n._const.name]?i.selected=!0:"INPUT"===i.nodeName&&"value"===t[n._const.name]&&(i.value=t[n._const.value]);break;case n._const.modifyAttribute:i.attributes[t[n._const.name]]=t[n._const.newValue];break;case n._const.removeAttribute:delete i.attributes[t[n._const.name]],0===Object.keys(i.attributes).length&&delete i.attributes,"checked"===t[n._const.name]?i.checked=!1:"selected"===t[n._const.name]?delete i.selected:"INPUT"===i.nodeName&&"value"===t[n._const.name]&&delete i.value;break;case n._const.modifyTextElement:i.data=t[n._const.newValue];break;case n._const.modifyValue:i.value=t[n._const.newValue];break;case n._const.modifyComment:i.data=t[n._const.newValue];break;case n._const.modifyChecked:i.checked=t[n._const.newValue];break;case n._const.modifySelected:i.selected=t[n._const.newValue];break;case n._const.replaceElement:l=m(t[n._const.newValue]),l.outerDone=!0,l.innerDone=!0,l.valueDone=!0,a.childNodes[o]=l;break;case n._const.relocateGroup:u=i.childNodes.splice(t[n._const.from],t.groupLength).reverse(),u.forEach(e=>i.childNodes.splice(t[n._const.to],0,e)),i.subsets&&i.subsets.forEach(e=>{if(t[n._const.from]<t[n._const.to]&&e.oldValue<=t[n._const.to]&&e.oldValue>t[n._const.from]){e.oldValue-=t.groupLength;const r=e.oldValue+e.length-t[n._const.to];r>0&&(s.push({oldValue:t[n._const.to]+t.groupLength,newValue:e.newValue+e.length-r,length:r}),e.length-=r)}else if(t[n._const.from]>t[n._const.to]&&e.oldValue>t[n._const.to]&&e.oldValue<t[n._const.from]){e.oldValue+=t.groupLength;const r=e.oldValue+e.length-t[n._const.to];r>0&&(s.push({oldValue:t[n._const.to]+t.groupLength,newValue:e.newValue+e.length-r,length:r}),e.length-=r)}else e.oldValue===t[n._const.from]&&(e.oldValue=t[n._const.to])});break;case n._const.removeElement:a.childNodes.splice(o,1),a.subsets&&a.subsets.forEach(e=>{e.oldValue>o?e.oldValue-=1:e.oldValue===o?e.delete=!0:e.oldValue<o&&e.oldValue+e.length>o&&(e.oldValue+e.length-1===o?e.length--:(s.push({newValue:e.newValue+o-e.oldValue,oldValue:o,length:e.length-o+e.oldValue-1}),e.length=o-e.oldValue))}),i=a;break;case n._const.addElement:h=t[n._const.route].slice(),d=h.splice(h.length-1,1)[0],i=b(e,h).node,l=m(t[n._const.element]),l.outerDone=!0,l.innerDone=!0,l.valueDone=!0,i.childNodes||(i.childNodes=[]),d>=i.childNodes.length?i.childNodes.push(l):i.childNodes.splice(d,0,l),i.subsets&&i.subsets.forEach(e=>{if(e.oldValue>=d)e.oldValue+=1;else if(e.oldValue<d&&e.oldValue+e.length>d){const t=e.oldValue+e.length-d;s.push({newValue:e.newValue+e.length-t,oldValue:d+1,length:t}),e.length-=t}});break;case n._const.removeTextElement:a.childNodes.splice(o,1),"TEXTAREA"===a.nodeName&&delete a.value,a.subsets&&a.subsets.forEach(e=>{e.oldValue>o?e.oldValue-=1:e.oldValue===o?e.delete=!0:e.oldValue<o&&e.oldValue+e.length>o&&(e.oldValue+e.length-1===o?e.length--:(s.push({newValue:e.newValue+o-e.oldValue,oldValue:o,length:e.length-o+e.oldValue-1}),e.length=o-e.oldValue))}),i=a;break;case n._const.addTextElement:h=t[n._const.route].slice(),d=h.splice(h.length-1,1)[0],l={},l.nodeName="#text",l.data=t[n._const.value],i=b(e,h).node,i.childNodes||(i.childNodes=[]),d>=i.childNodes.length?i.childNodes.push(l):i.childNodes.splice(d,0,l),"TEXTAREA"===i.nodeName&&(i.value=t[n._const.newValue]),i.subsets&&i.subsets.forEach(e=>{if(e.oldValue>=d&&(e.oldValue+=1),e.oldValue<d&&e.oldValue+e.length>d){const t=e.oldValue+e.length-d;s.push({newValue:e.newValue+e.length-t,oldValue:d+1,length:t}),e.length-=t}});break;default:console.log("unknown action")}i.subsets&&(i.subsets=i.subsets.filter(e=>!e.delete&&e.oldValue!==e.newValue),s.length&&(i.subsets=i.subsets.concat(s))),c.newNode=l,n.postDiffApply(c)}(e,t,n)}),!0}function A(e,t){const n={};if(n.nodeName=e.nodeName,"#text"===n.nodeName||"#comment"===n.nodeName)n.data=e.data;else{if(e.attributes&&e.attributes.length>0){n.attributes={};Array.prototype.slice.call(e.attributes).forEach(e=>n.attributes[e.name]=e.value)}if("TEXTAREA"===n.nodeName)n.value=e.value;else if(e.childNodes&&e.childNodes.length>0){n.childNodes=[];Array.prototype.slice.call(e.childNodes).forEach(e=>n.childNodes.push(A(e,t)))}t.valueDiffing&&(void 0!==e.checked&&e.type&&["radio","checkbox"].includes(e.type.toLowerCase())?n.checked=e.checked:void 0!==e.value&&(n.value=e.value),void 0!==e.selected&&(n.selected=e.selected))}return n}class E{constructor(e,t,n){this.options=n,this.t1=A(e,this.options),this.t2=A(t,this.options),this.diffcount=0,this.foundAll=!1,this.debug&&(this.t1Orig=A(e,this.options),this.t2Orig=A(t,this.options)),this.tracker=new v}init(){return this.findDiffs(this.t1,this.t2)}findDiffs(e,t){let n;do{if(this.options.debug&&(this.diffcount+=1,this.diffcount>this.options.diffcap))throw window.diffError=[this.t1Orig,this.t2Orig],new Error(`surpassed diffcap:${JSON.stringify(this.t1Orig)} -> ${JSON.stringify(this.t2Orig)}`);n=this.findNextDiff(e,t,[]),0===n.length&&(p(e,t)||(this.foundAll?(console.error("Could not find remaining diffs!"),console.log({t1:e,t2:t})):(this.foundAll=!0,d(e),n=this.findNextDiff(e,t,[])))),n.length>0&&(this.foundAll=!1,this.tracker.add(n),w(e,n,this.options))}while(n.length>0);return this.tracker.list}findNextDiff(e,t,n){let r,i;if(this.options.maxDepth&&n.length>this.options.maxDepth)return[];if(!e.outerDone){if(r=this.findOuterDiff(e,t,n),this.filterOuterDiff&&(i=this.filterOuterDiff(e,t,r),i&&(r=i)),r.length>0)return e.outerDone=!0,r;e.outerDone=!0}if(!e.innerDone){if(r=this.findInnerDiff(e,t,n),r.length>0)return r;e.innerDone=!0}if(this.options.valueDiffing&&!e.valueDone){if(r=this.findValueDiff(e,t,n),r.length>0)return e.valueDone=!0,r;e.valueDone=!0}return[]}findOuterDiff(e,t,n){const r=[];let i,a,o,s,l,u;if(e.nodeName!==t.nodeName)return[(new c).setValue(this.options._const.action,this.options._const.replaceElement).setValue(this.options._const.oldValue,m(e)).setValue(this.options._const.newValue,m(t)).setValue(this.options._const.route,n)];if(n.length&&this.options.maxChildCount&&e.childNodes&&t.childNodes&&e.childNodes.length>this.options.maxChildCount&&t.childNodes.length>this.options.maxChildCount){const r=e.childNodes.length<t.childNodes.length?e.childNodes.length:t.childNodes.length;let i=0,a=0;for(;i<this.options.maxChildDiffCount&&a<r;)p(e.childNodes[a],t.childNodes[a])||i++,a++;if(i===this.options.maxChildDiffCount)return[(new c).setValue(this.options._const.action,this.options._const.replaceElement).setValue(this.options._const.oldValue,m(e)).setValue(this.options._const.newValue,m(t)).setValue(this.options._const.route,n)]}if(e.data!==t.data)return"#text"===e.nodeName?[(new c).setValue(this.options._const.action,this.options._const.modifyTextElement).setValue(this.options._const.route,n).setValue(this.options._const.oldValue,e.data).setValue(this.options._const.newValue,t.data)]:[(new c).setValue(this.options._const.action,this.options._const.modifyComment).setValue(this.options._const.route,n).setValue(this.options._const.oldValue,e.data).setValue(this.options._const.newValue,t.data)];for(a=e.attributes?Object.keys(e.attributes).sort():[],o=t.attributes?Object.keys(t.attributes).sort():[],s=a.length,u=0;u<s;u++)i=a[u],l=o.indexOf(i),-1===l?r.push((new c).setValue(this.options._const.action,this.options._const.removeAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.value,e.attributes[i])):(o.splice(l,1),e.attributes[i]!==t.attributes[i]&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.oldValue,e.attributes[i]).setValue(this.options._const.newValue,t.attributes[i])));for(s=o.length,u=0;u<s;u++)i=o[u],r.push((new c).setValue(this.options._const.action,this.options._const.addAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.value,t.attributes[i]));return r}findInnerDiff(e,t,n){const r=e.subsets&&e.subsetsAge--?e.subsets:e.childNodes&&t.childNodes?function(e,t){const n=e.childNodes?e.childNodes:[],r=t.childNodes?t.childNodes:[],i=y(n.length,!1),a=y(r.length,!1),o=[];let s=!0;const c=function(){return arguments[1]},l=e=>{i[s.oldValue+e]=!0,a[s.newValue+e]=!0};for(;s;)if(s=g(n,r,i,a),s){o.push(s);Array(...new Array(s.length)).map(c).forEach(e=>l(e))}return e.subsets=o,e.subsetsAge=100,o}(e,t):[],i=e.childNodes?e.childNodes:[],a=t.childNodes?t.childNodes:[];let o,s=[],l=0;if(r.length>0&&(s=this.attemptGroupRelocation(e,t,r,n),s.length>0))return s;const u=Math.max(i.length,a.length);i.length!==a.length&&(o=!0);for(let e=0;e<u;e+=1){const t=i[e],r=a[e];o&&(t&&!r?"#text"===t.nodeName?(s.push((new c).setValue(this.options._const.action,this.options._const.removeTextElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.value,t.data)),l-=1):(s.push((new c).setValue(this.options._const.action,this.options._const.removeElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.element,m(t))),l-=1):r&&!t&&("#text"===r.nodeName?s.push((new c).setValue(this.options._const.action,this.options._const.addTextElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.value,r.data)):s.push((new c).setValue(this.options._const.action,this.options._const.addElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.element,m(r))))),t&&r&&(s=s.concat(this.findNextDiff(t,r,n.concat(l)))),l+=1}return e.innerDone=!0,s}attemptGroupRelocation(e,t,n,r){const i=function(e,t,n){const r=e.childNodes?y(e.childNodes.length,!0):[],i=t.childNodes?y(t.childNodes.length,!0):[];let a=0;return n.forEach(e=>{const t=e.oldValue+e.length,n=e.newValue+e.length;for(let n=e.oldValue;n<t;n+=1)r[n]=a;for(let t=e.newValue;t<n;t+=1)i[t]=a;a+=1}),{gaps1:r,gaps2:i}}(e,t,n),a=i.gaps1,o=i.gaps2;let s,l,u,h,d,p,g=Math.min(a.length,o.length);const v=[];for(let i=0,y=0;i<g;y+=1,i+=1)if(!0===a[i])if(h=e.childNodes[y],"#text"===h.nodeName){if("#text"===t.childNodes[i].nodeName&&h.data!==t.childNodes[i].data){for(p=y;e.childNodes.length>p+1&&"#text"===e.childNodes[p+1].nodeName;)if(p+=1,t.childNodes[i].data===e.childNodes[p].data){d=!0;break}if(!d)return v.push((new c).setValue(this.options._const.action,this.options._const.modifyTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.oldValue,h.data).setValue(this.options._const.newValue,t.childNodes[i].data)),v}v.push((new c).setValue(this.options._const.action,this.options._const.removeTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.value,h.data)),a.splice(i,1),g=Math.min(a.length,o.length),i-=1}else v.push((new c).setValue(this.options._const.action,this.options._const.removeElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.element,m(h))),a.splice(i,1),g=Math.min(a.length,o.length),i-=1;else if(!0===o[i])h=t.childNodes[i],"#text"===h.nodeName?(v.push((new c).setValue(this.options._const.action,this.options._const.addTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.value,h.data)),a.splice(i,0,!0),g=Math.min(a.length,o.length),y-=1):(v.push((new c).setValue(this.options._const.action,this.options._const.addElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.element,m(h))),a.splice(i,0,!0),g=Math.min(a.length,o.length),y-=1);else if(a[i]!==o[i]){if(v.length>0)return v;if(u=n[a[i]],l=Math.min(u.newValue,e.childNodes.length-u.length),l!==u.oldValue){s=!1;for(let t=0;t<u.length;t+=1)f(e.childNodes[l+t],e.childNodes[u.oldValue+t],[],!1,!0)||(s=!0);if(s)return[(new c).setValue(this.options._const.action,this.options._const.relocateGroup).setValue("groupLength",u.length).setValue(this.options._const.from,u.oldValue).setValue(this.options._const.to,l).setValue(this.options._const.route,r)]}}return v}findValueDiff(e,t,n){const r=[];return e.selected!==t.selected&&r.push((new c).setValue(this.options._const.action,this.options._const.modifySelected).setValue(this.options._const.oldValue,e.selected).setValue(this.options._const.newValue,t.selected).setValue(this.options._const.route,n)),(e.value||t.value)&&e.value!==t.value&&"OPTION"!==e.nodeName&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyValue).setValue(this.options._const.oldValue,e.value||"").setValue(this.options._const.newValue,t.value||"").setValue(this.options._const.route,n)),e.checked!==t.checked&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyChecked).setValue(this.options._const.oldValue,e.checked).setValue(this.options._const.newValue,t.checked).setValue(this.options._const.route,n)),r}}const x={debug:!1,diffcap:10,maxDepth:!1,maxChildCount:50,maxChildDiffCount:3,valueDiffing:!0,textDiff(e,t,n,r){e.data=r},preVirtualDiffApply(){},postVirtualDiffApply(){},preDiffApply(){},postDiffApply(){},filterOuterDiff:null,compress:!1,_const:!1,document:!(!window||!window.document)&&window.document};class _{constructor(e={}){if(this.options=e,Object.entries(x).forEach(([e,t])=>{Object.prototype.hasOwnProperty.call(this.options,e)||(this.options[e]=t)}),!this.options._const){const e=["addAttribute","modifyAttribute","removeAttribute","modifyTextElement","relocateGroup","removeElement","addElement","removeTextElement","addTextElement","replaceElement","modifyValue","modifyChecked","modifySelected","modifyComment","action","route","oldValue","newValue","element","group","from","to","name","value","data","attributes","nodeName","childNodes","checked","selected"];this.options._const={},this.options.compress?e.forEach((e,t)=>this.options._const[e]=t):e.forEach(e=>this.options._const[e]=e)}this.DiffFinder=E}apply(e,t){return function(e,t,n){return t.every(t=>a(e,t,n))}(e,t,this.options)}undo(e,t){return s(e,t,this.options)}diff(e,t){return new this.DiffFinder(e,t,this.options).init()}}class S{constructor(e={}){this.pad="│ ",this.padding="",this.tick=1,this.messages=[];const t=(e,t)=>{const n=e[t];e[t]=(...r)=>{this.fin(t,Array.prototype.slice.call(r));const i=n.apply(e,r);return this.fout(t,i),i}};for(let n in e)"function"==typeof e[n]&&t(e,n);this.log("┌ TRACELOG START")}fin(e,t){this.padding+=this.pad,this.log("├─> entering "+e,t)}fout(e,t){this.log("│<──┘ generated return value",t),this.padding=this.padding.substring(0,this.padding.length-this.pad.length)}format(e,t){return`${function(e){for(e=""+e;e.length<4;)e="0"+e;return e}(t)}> ${this.padding}${e}`}log(){let e=Array.prototype.slice.call(arguments);const t=function(e){return e?"string"==typeof e?e:e instanceof HTMLElement?e.outerHTML||"<empty>":e instanceof Array?`[${e.map(t).join(",")}]`:e.toString()||e.valueOf()||"<unknown>":"<falsey>"};e=e.map(t).join(", "),this.messages.push(this.format(e,this.tick++))}toString(){let e="└───";for(;e.length<=this.padding.length+this.pad.length;)e+="× ";let t=this.padding;return this.padding="",e=this.format(e,this.tick),this.padding=t,`${this.messages.join("\n")}\n${e}`}}},function(e,t,n){"use strict";n.r(t);var r=THREE.ExtrudeGeometry;class i extends r{constructor(e,t={}){const n=t.font;if(void 0===n)super();else{const r=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),super(r,t)}this.type="TextGeometry"}}function a(){}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}),Object.assign(a.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e)}}}});var o,s,c,l,u,h,d,p,f,m={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var e=[],t=0;t<256;t++)e[t]=(t<16?"0":"")+t.toString(16).toUpperCase();return function(){var t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return e[255&t]+e[t>>8&255]+e[t>>16&255]+e[t>>24&255]+"-"+e[255&n]+e[n>>8&255]+"-"+e[n>>16&15|64]+e[n>>24&255]+"-"+e[63&r|128]+e[r>>8&255]+"-"+e[r>>16&255]+e[r>>24&255]+e[255&i]+e[i>>8&255]+e[i>>16&255]+e[i>>24&255]}}(),clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*m.DEG2RAD},radToDeg:function(e){return e*m.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}};function g(e,t){this.x=e||0,this.y=t||0}function y(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function v(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==r?r:1}function b(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}function w(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(g.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(g.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:(o=new g,s=new g,function(e,t){return o.set(e,e),s.set(t,t),this.clamp(o,s)}),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}}),Object.assign(y.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,a,o,s,c,l,u,h,d,p,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new y).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:(p=new b,function(e){var t=this.elements,n=e.elements,r=1/p.setFromMatrixColumn(e,0).length(),i=1/p.setFromMatrixColumn(e,1).length(),a=1/p.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,this}),makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){var h=a*l,d=a*u,p=o*l,f=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=d+p*c,t[5]=h-f*c,t[9]=-o*s,t[2]=f-h*c,t[6]=p+d*c,t[10]=a*s}else if("YXZ"===e.order){var m=s*l,g=s*u,y=c*l,v=c*u;t[0]=m+v*o,t[4]=y*o-g,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=g*o-y,t[6]=v+m*o,t[10]=a*s}else if("ZXY"===e.order){m=s*l,g=s*u,y=c*l,v=c*u;t[0]=m-v*o,t[4]=-a*u,t[8]=y+g*o,t[1]=g+y*o,t[5]=a*l,t[9]=v-m*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){h=a*l,d=a*u,p=o*l,f=o*u;t[0]=s*l,t[4]=p*c-d,t[8]=h*c+f,t[1]=s*u,t[5]=f*c+h,t[9]=d*c-p,t[2]=-c,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var b=a*s,w=a*c,A=o*s,E=o*c;t[0]=s*l,t[4]=E-b*u,t[8]=A*u+w,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=w*u+A,t[10]=b-E*u}else if("XZY"===e.order){b=a*s,w=a*c,A=o*s,E=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=b*u+E,t[5]=a*l,t[9]=w*u-A,t[2]=A*u-w,t[6]=o*l,t[10]=E*u+b}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){var t=this.elements,n=e._x,r=e._y,i=e._z,a=e._w,o=n+n,s=r+r,c=i+i,l=n*o,u=n*s,h=n*c,d=r*s,p=r*c,f=i*c,m=a*o,g=a*s,y=a*c;return t[0]=1-(d+f),t[4]=u-y,t[8]=h+g,t[1]=u+y,t[5]=1-(l+f),t[9]=p-m,t[2]=h-g,t[6]=p+m,t[10]=1-(l+d),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:(u=new b,h=new b,d=new b,function(e,t,n){var r=this.elements;return d.subVectors(e,t),0===d.lengthSq()&&(d.z=1),d.normalize(),u.crossVectors(n,d),0===u.lengthSq()&&(1===Math.abs(n.z)?d.x+=1e-4:d.z+=1e-4,d.normalize(),u.crossVectors(n,d)),u.normalize(),h.crossVectors(d,u),r[0]=u.x,r[4]=h.x,r[8]=d.x,r[1]=u.y,r[5]=h.y,r[9]=d.y,r[2]=u.z,r[6]=h.z,r[10]=d.z,this}),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],y=n[3],v=n[7],b=n[11],w=n[15],A=r[0],E=r[4],x=r[8],_=r[12],S=r[1],M=r[5],T=r[9],R=r[13],k=r[2],C=r[6],O=r[10],P=r[14],I=r[3],N=r[7],L=r[11],D=r[15];return i[0]=a*A+o*S+s*k+c*I,i[4]=a*E+o*M+s*C+c*N,i[8]=a*x+o*T+s*O+c*L,i[12]=a*_+o*R+s*P+c*D,i[1]=l*A+u*S+h*k+d*I,i[5]=l*E+u*M+h*C+d*N,i[9]=l*x+u*T+h*O+d*L,i[13]=l*_+u*R+h*P+d*D,i[2]=p*A+f*S+m*k+g*I,i[6]=p*E+f*M+m*C+g*N,i[10]=p*x+f*T+m*O+g*L,i[14]=p*_+f*R+m*P+g*D,i[3]=y*A+v*S+b*k+w*I,i[7]=y*E+v*M+b*C+w*N,i[11]=y*x+v*T+b*O+w*L,i[15]=y*_+v*R+b*P+w*D,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},applyToBufferAttribute:function(){var e=new b;return function(t){for(var n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.applyMatrix4(this),t.setXYZ(n,e.x,e.y,e.z);return t}}(),determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+i*s*u-r*c*u-i*o*h+n*c*h+r*o*d-n*s*d)+e[7]*(+t*s*d-t*c*h+i*a*h-r*a*d+r*c*l-i*s*l)+e[11]*(+t*c*u-t*o*d-i*a*u+n*a*d+i*o*l-n*c*l)+e[15]*(-r*o*l-t*s*u+t*o*h+r*a*u-n*a*h+n*s*l)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var n=this.elements,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],u=r[6],h=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],y=r[13],v=r[14],b=r[15],w=p*v*h-y*f*h+y*u*m-l*v*m-p*u*b+l*f*b,A=g*f*h-d*v*h-g*u*m+c*v*m+d*u*b-c*f*b,E=d*y*h-g*p*h+g*l*m-c*y*m-d*l*b+c*p*b,x=g*p*u-d*y*u-g*l*f+c*y*f+d*l*v-c*p*v,_=i*w+a*A+o*E+s*x;if(0===_){var S="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(S);return console.warn(S),this.identity()}var M=1/_;return n[0]=w*M,n[1]=(y*f*s-p*v*s-y*o*m+a*v*m+p*o*b-a*f*b)*M,n[2]=(l*v*s-y*u*s+y*o*h-a*v*h-l*o*b+a*u*b)*M,n[3]=(p*u*s-l*f*s-p*o*h+a*f*h+l*o*m-a*u*m)*M,n[4]=A*M,n[5]=(d*v*s-g*f*s+g*o*m-i*v*m-d*o*b+i*f*b)*M,n[6]=(g*u*s-c*v*s-g*o*h+i*v*h+c*o*b-i*u*b)*M,n[7]=(c*f*s-d*u*s+d*o*h-i*f*h-c*o*m+i*u*m)*M,n[8]=E*M,n[9]=(g*p*s-d*y*s-g*a*m+i*y*m+d*a*b-i*p*b)*M,n[10]=(c*y*s-g*l*s+g*a*h-i*y*h-c*a*b+i*l*b)*M,n[11]=(d*l*s-c*p*s-d*a*h+i*p*h+c*a*m-i*l*m)*M,n[12]=x*M,n[13]=(d*y*o-g*p*o+g*a*f-i*y*f-d*a*v+i*p*v)*M,n[14]=(g*l*o-c*y*o-g*a*u+i*y*u+c*a*v-i*l*v)*M,n[15]=(c*p*o-d*l*o+d*a*u-i*p*u-c*a*f+i*l*f)*M,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){return this.makeRotationFromQuaternion(t),this.scale(n),this.setPosition(e),this},decompose:(c=new b,l=new y,function(e,t,n){var r=this.elements,i=c.set(r[0],r[1],r[2]).length(),a=c.set(r[4],r[5],r[6]).length(),o=c.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],l.copy(this);var s=1/i,u=1/a,h=1/o;return l.elements[0]*=s,l.elements[1]*=s,l.elements[2]*=s,l.elements[4]*=u,l.elements[5]*=u,l.elements[6]*=u,l.elements[8]*=h,l.elements[9]*=h,l.elements[10]*=h,t.setFromRotationMatrix(l),n.x=i,n.y=a,n.z=o,this}),makePerspective:function(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),c=2*i/(n-r),l=(t+e)/(t-e),u=(n+r)/(n-r),h=-(a+i)/(a-i),d=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=c,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),c=1/(n-r),l=1/(a-i),u=(t+e)*s,h=(n+r)*c,d=(a+i)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}),Object.assign(v,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,i,a,o){var s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],h=i[a+0],d=i[a+1],p=i[a+2],f=i[a+3];if(u!==f||s!==h||c!==d||l!==p){var m=1-o,g=s*h+c*d+l*p+u*f,y=g>=0?1:-1,v=1-g*g;if(v>Number.EPSILON){var b=Math.sqrt(v),w=Math.atan2(b,g*y);m=Math.sin(m*w)/b,o=Math.sin(o*w)/b}var A=o*y;if(s=s*m+h*A,c=c*m+d*A,l=l*m+p*A,u=u*m+f*A,m===1-o){var E=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=E,c*=E,l*=E,u*=E}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}}),Object.defineProperties(v.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback()}}}),Object.assign(v.prototype,{set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,a=e.order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),h=s(n/2),d=s(r/2),p=s(i/2);return"XYZ"===a?(this._x=h*l*u+c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u-h*d*p):"YXZ"===a?(this._x=h*l*u+c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u+h*d*p):"ZXY"===a?(this._x=h*l*u-c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u-h*d*p):"ZYX"===a?(this._x=h*l*u-c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u+h*d*p):"YZX"===a?(this._x=h*l*u+c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u-h*d*p):"XZY"===a&&(this._x=h*l*u-c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u+h*d*p),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,r=n[0],i=n[4],a=n[8],o=n[1],s=n[5],c=n[9],l=n[2],u=n[6],h=n[10],d=r+s+h;return d>0?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(u-c)*t,this._y=(a-l)*t,this._z=(o-i)*t):r>s&&r>h?(t=2*Math.sqrt(1+r-s-h),this._w=(u-c)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(a+l)/t):s>h?(t=2*Math.sqrt(1+s-r-h),this._w=(a-l)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(c+u)/t):(t=2*Math.sqrt(1+h-r-s),this._w=(o-i)/t,this._x=(a+l)/t,this._y=(c+u)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t=new b;return function(n,r){return void 0===t&&(t=new b),(e=n.dot(r)+1)<1e-6?(e=0,Math.abs(n.x)>Math.abs(n.z)?t.set(-n.y,n.x,0):t.set(0,-n.z,n.y)):t.crossVectors(n,r),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this.onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(n+this._x),this._y=.5*(r+this._y),this._z=.5*(i+this._z),this;var c=Math.atan2(s,o),l=Math.sin((1-t)*c)/s,u=Math.sin(t*c)/s;return this._w=a*l+this._w*u,this._x=n*l+this._x*u,this._y=r*l+this._y*u,this._z=i*l+this._z*u,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(b.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:(f=new v,function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(f.setFromEuler(e))}),applyAxisAngle:function(){var e=new v;return function(t,n){return this.applyQuaternion(e.setFromAxisAngle(t,n))}}(),applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*r-o*n,l=s*n+o*t-i*r,u=s*r+i*n-a*t,h=-i*t-a*n-o*r;return this.x=c*s+h*-i+l*-o-u*-a,this.y=l*s+h*-a+u*-i-c*-o,this.z=u*s+h*-o+c*-a-l*-i,this},project:function(){var e=new y;return function(t){return e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyMatrix4(e)}}(),unproject:function(){var e=new y;return function(t){return e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyMatrix4(e)}}(),transformDirection:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(){var e=new b,t=new b;return function(n,r){return e.set(n,n,n),t.set(r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(){var e=new b;return function(t){return e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e=new b;return function(t){return this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(m.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){var t=Math.sin(e.phi)*e.radius;return this.x=t*Math.sin(e.theta),this.y=Math.cos(e.phi)*e.radius,this.z=t*Math.cos(e.theta),this},setFromCylindrical:function(e){return this.x=e.radius*Math.sin(e.theta),this.y=e.y,this.z=e.radius*Math.cos(e.theta),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}}),Object.assign(w.prototype,{isMatrix3:!0,set:function(e,t,n,r,i,a,o,s,c){var l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToBufferAttribute:function(){var e=new b;return function(t){for(var n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.applyMatrix3(this),t.setXYZ(n,e.x,e.y,e.z);return t}}(),multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],h=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],y=r[1],v=r[4],b=r[7],w=r[2],A=r[5],E=r[8];return i[0]=a*f+o*y+s*w,i[3]=a*m+o*v+s*A,i[6]=a*g+o*b+s*E,i[1]=c*f+l*y+u*w,i[4]=c*m+l*v+u*A,i[7]=c*g+l*b+u*E,i[2]=h*f+d*y+p*w,i[5]=h*m+d*v+p*A,i[8]=h*g+d*b+p*E,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,r=this.elements,i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5],u=n[6],h=n[7],d=n[8],p=d*c-l*h,f=l*u-d*s,m=h*s-c*u,g=i*p+a*f+o*m;if(0===g){var y="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(y);return console.warn(y),this.identity()}var v=1/g;return r[0]=p*v,r[1]=(o*h-d*a)*v,r[2]=(l*a-o*c)*v,r[3]=f*v,r[4]=(d*i-o*u)*v,r[5]=(o*s-l*i)*v,r[6]=m*v,r[7]=(a*u-h*i)*v,r[8]=(c*i-a*s)*v,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,n,r,i,a,o){var s=Math.cos(i),c=Math.sin(i);this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],c=r[4],l=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*c,r[6]=t*o+n*l,r[1]=-n*i+t*s,r[4]=-n*a+t*c,r[7]=-n*o+t*l,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}});var A=0;function E(e,t,n,r,i,a,o,s,c,l){Object.defineProperty(this,"id",{value:A++}),this.uuid=m.generateUUID(),this.name="",this.image=void 0!==e?e:E.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:E.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:1001,this.wrapT=void 0!==r?r:1001,this.magFilter=void 0!==i?i:1006,this.minFilter=void 0!==a?a:1008,this.anisotropy=void 0!==c?c:1,this.format=void 0!==o?o:1023,this.type=void 0!==s?s:1009,this.offset=new g(0,0),this.repeat=new g(1,1),this.center=new g(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new w,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:3e3,this.version=0,this.onUpdate=null}function x(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==r?r:1}function _(e,t,n){this.uuid=m.generateUUID(),this.width=e,this.height=t,this.scissor=new x(0,0,e,t),this.scissorTest=!1,this.viewport=new x(0,0,e,t),void 0===(n=n||{}).minFilter&&(n.minFilter=1006),this.texture=new E(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function S(e,t,n){_.call(this,e,t,n),this.activeCubeFace=0,this.activeMipMapLevel=0}function M(e,t,n,r,i,a,o,s,c,l,u,h){E.call(this,null,a,o,s,c,l,r,i,u,h),this.image={data:e,width:t,height:n},this.magFilter=void 0!==c?c:1003,this.minFilter=void 0!==l?l:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function T(e,t,n,r,i,a,o,s,c,l){e=void 0!==e?e:[],t=void 0!==t?t:301,E.call(this,e,t,n,r,i,a,o,s,c,l),this.flipY=!1}E.DEFAULT_IMAGE=void 0,E.DEFAULT_MAPPING=300,E.prototype=Object.assign(Object.create(a.prototype),{constructor:E,isTexture:!0,clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var r=this.image;void 0===r.uuid&&(r.uuid=m.generateUUID()),t||void 0!==e.images[r.uuid]||(e.images[r.uuid]={uuid:r.uuid,url:function(e){var t;if(e instanceof HTMLCanvasElement)t=e;else{(t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=e.width,t.height=e.height;var n=t.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height)}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}(r)}),n.image=r.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(300===this.mapping){if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}this.flipY&&(e.y=1-e.y)}}}),Object.defineProperty(E.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(x.prototype,{isVector4:!0,set:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,n,r,i,a=e.elements,o=a[0],s=a[4],c=a[8],l=a[1],u=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(Math.abs(s-l)<.01&&Math.abs(c-d)<.01&&Math.abs(h-p)<.01){if(Math.abs(s+l)<.1&&Math.abs(c+d)<.1&&Math.abs(h+p)<.1&&Math.abs(o+u+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(o+1)/2,g=(u+1)/2,y=(f+1)/2,v=(s+l)/4,b=(c+d)/4,w=(h+p)/4;return m>g&&m>y?m<.01?(n=0,r=.707106781,i=.707106781):(r=v/(n=Math.sqrt(m)),i=b/n):g>y?g<.01?(n=.707106781,r=0,i=.707106781):(n=v/(r=Math.sqrt(g)),i=w/r):y<.01?(n=.707106781,r=.707106781,i=0):(n=b/(i=Math.sqrt(y)),r=w/i),this.set(n,r,i,t),this}var A=Math.sqrt((p-h)*(p-h)+(c-d)*(c-d)+(l-s)*(l-s));return Math.abs(A)<.001&&(A=1),this.x=(p-h)/A,this.y=(c-d)/A,this.z=(l-s)/A,this.w=Math.acos((o+u+f-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(){var e,t;return function(n,r){return void 0===e&&(e=new x,t=new x),e.set(n,n,n,n),t.set(r,r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),_.prototype=Object.assign(Object.create(a.prototype),{constructor:_,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),S.prototype=Object.create(_.prototype),S.prototype.constructor=S,S.prototype.isWebGLRenderTargetCube=!0,M.prototype=Object.create(E.prototype),M.prototype.constructor=M,M.prototype.isDataTexture=!0,T.prototype=Object.create(E.prototype),T.prototype.constructor=T,T.prototype.isCubeTexture=!0,Object.defineProperty(T.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});var R=new E,k=new T;function C(){this.seq=[],this.map={}}var O=[],P=[],I=new Float32Array(16),N=new Float32Array(9);function L(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,a=O[i];if(void 0===a&&(a=new Float32Array(i),O[i]=a),0!==t){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function D(e,t){var n=P[t];void 0===n&&(n=new Int32Array(t),P[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocTextureUnit();return n}function F(e,t){e.uniform1f(this.addr,t)}function j(e,t){e.uniform1i(this.addr,t)}function U(e,t){void 0===t.x?e.uniform2fv(this.addr,t):e.uniform2f(this.addr,t.x,t.y)}function B(e,t){void 0!==t.x?e.uniform3f(this.addr,t.x,t.y,t.z):void 0!==t.r?e.uniform3f(this.addr,t.r,t.g,t.b):e.uniform3fv(this.addr,t)}function V(e,t){void 0===t.x?e.uniform4fv(this.addr,t):e.uniform4f(this.addr,t.x,t.y,t.z,t.w)}function z(e,t){e.uniformMatrix2fv(this.addr,!1,t.elements||t)}function H(e,t){void 0===t.elements?e.uniformMatrix3fv(this.addr,!1,t):(N.set(t.elements),e.uniformMatrix3fv(this.addr,!1,N))}function G(e,t){void 0===t.elements?e.uniformMatrix4fv(this.addr,!1,t):(I.set(t.elements),e.uniformMatrix4fv(this.addr,!1,I))}function q(e,t,n){var r=n.allocTextureUnit();e.uniform1i(this.addr,r),n.setTexture2D(t||R,r)}function W(e,t,n){var r=n.allocTextureUnit();e.uniform1i(this.addr,r),n.setTextureCube(t||k,r)}function J(e,t){e.uniform2iv(this.addr,t)}function Z(e,t){e.uniform3iv(this.addr,t)}function X(e,t){e.uniform4iv(this.addr,t)}function Y(e,t){e.uniform1fv(this.addr,t)}function K(e,t){e.uniform1iv(this.addr,t)}function Q(e,t){e.uniform2fv(this.addr,L(t,this.size,2))}function $(e,t){e.uniform3fv(this.addr,L(t,this.size,3))}function ee(e,t){e.uniform4fv(this.addr,L(t,this.size,4))}function te(e,t){e.uniformMatrix2fv(this.addr,!1,L(t,this.size,4))}function ne(e,t){e.uniformMatrix3fv(this.addr,!1,L(t,this.size,9))}function re(e,t){e.uniformMatrix4fv(this.addr,!1,L(t,this.size,16))}function ie(e,t,n){var r=t.length,i=D(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.setTexture2D(t[a]||R,i[a])}function ae(e,t,n){var r=t.length,i=D(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.setTextureCube(t[a]||k,i[a])}function oe(e,t,n){this.id=e,this.addr=n,this.setValue=function(e){switch(e){case 5126:return F;case 35664:return U;case 35665:return B;case 35666:return V;case 35674:return z;case 35675:return H;case 35676:return G;case 35678:case 36198:return q;case 35680:return W;case 5124:case 35670:return j;case 35667:case 35671:return J;case 35668:case 35672:return Z;case 35669:case 35673:return X}}(t.type)}function se(e,t,n){this.id=e,this.addr=n,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Y;case 35664:return Q;case 35665:return $;case 35666:return ee;case 35674:return te;case 35675:return ne;case 35676:return re;case 35678:return ie;case 35680:return ae;case 5124:case 35670:return K;case 35667:case 35671:return J;case 35668:case 35672:return Z;case 35669:case 35673:return X}}(t.type)}function ce(e){this.id=e,C.call(this)}ce.prototype.setValue=function(e,t){for(var n=this.seq,r=0,i=n.length;r!==i;++r){var a=n[r];a.setValue(e,t[a.id])}};var le=/([\w\d_]+)(\])?(\[|\.)?/g;function ue(e,t){e.seq.push(t),e.map[t.id]=t}function he(e,t,n){var r=e.name,i=r.length;for(le.lastIndex=0;;){var a=le.exec(r),o=le.lastIndex,s=a[1],c="]"===a[2],l=a[3];if(c&&(s|=0),void 0===l||"["===l&&o+2===i){ue(n,void 0===l?new oe(s,e,t):new se(s,e,t));break}var u=n.map[s];void 0===u&&ue(n,u=new ce(s)),n=u}}function de(e,t,n){C.call(this),this.renderer=n;for(var r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),i=0;i<r;++i){var a=e.getActiveUniform(t,i),o=a.name;he(a,e.getUniformLocation(t,o),this)}}de.prototype.setValue=function(e,t,n){var r=this.map[t];void 0!==r&&r.setValue(e,n,this.renderer)},de.prototype.setOptional=function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)},de.upload=function(e,t,n,r){for(var i=0,a=t.length;i!==a;++i){var o=t[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,r)}},de.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var a=e[r];a.id in t&&n.push(a)}return n};var pe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function fe(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}Object.assign(fe.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(){function e(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}return function(t,n,r){if(t=m.euclideanModulo(t,1),n=m.clamp(n,0,1),r=m.clamp(r,0,1),0===n)this.r=this.g=this.b=r;else{var i=r<=.5?r*(1+n):r+n-r*n,a=2*r-i;this.r=e(a,i,t+1/3),this.g=e(a,i,t),this.b=e(a,i,t-1/3)}return this}}(),setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(o,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l,u=(l=n[1]).length;if(3===u)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}e&&e.length>0&&(void 0!==(l=pe[e])?this.setHex(l):console.warn("THREE.Color: Unknown color "+e));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(){var e=this.r,t=this.g,n=this.b;return this.r=e*e,this.g=t*t,this.b=n*n,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){var t,n,r=e||{h:0,s:0,l:0},i=this.r,a=this.g,o=this.b,s=Math.max(i,a,o),c=Math.min(i,a,o),l=(c+s)/2;if(c===s)t=0,n=0;else{var u=s-c;switch(n=l<=.5?u/(s+c):u/(2-s-c),s){case i:t=(a-o)/u+(a<o?6:0);break;case a:t=(o-i)/u+2;break;case o:t=(i-a)/u+4}t/=6}return r.h=t,r.s=n,r.l=l,r},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){var r=this.getHSL();return r.h+=e,r.s+=t,r.l+=n,this.setHSL(r.h,r.s,r.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}});var me={common:{diffuse:{value:new fe(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new w},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new g(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new fe(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new w}}},ge={merge:function(e){for(var t={},n=0;n<e.length;n++){var r=this.clone(e[n]);for(var i in r)t[i]=r[i]}return t},clone:function(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}},ye={alphamap_fragment:"#ifdef USE_ALPHAMAP\r\n\r\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\r\n\r\n#endif\r\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\r\n\r\n\tuniform sampler2D alphaMap;\r\n\r\n#endif\r\n",alphatest_fragment:"#ifdef ALPHATEST\r\n\r\n\tif ( diffuseColor.a < ALPHATEST ) discard;\r\n\r\n#endif\r\n",aomap_fragment:"#ifdef USE_AOMAP\r\n\r\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\r\n\r\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\r\n\r\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\r\n\r\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\r\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\r\n\r\n\t#endif\r\n\r\n#endif\r\n",aomap_pars_fragment:"#ifdef USE_AOMAP\r\n\r\n\tuniform sampler2D aoMap;\r\n\tuniform float aoMapIntensity;\r\n\r\n#endif",begin_vertex:"\r\nvec3 transformed = vec3( position );\r\n",beginnormal_vertex:"\r\nvec3 objectNormal = vec3( normal );\r\n",bsdfs:'float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\r\n\r\n\tif( decayExponent > 0.0 ) {\r\n\r\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\r\n\r\n\t\t// based upon Frostbite 3 Moving to Physically-based Rendering\r\n\t\t// page 32, equation 26: E[window1]\r\n\t\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\n\t\t// this is intended to be used on spot and point lights who are represented as luminous intensity\r\n\t\t// but who must be converted to luminous irradiance for surface lighting calculation\r\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\r\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\r\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\r\n\r\n#else\r\n\r\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\r\n\r\n#endif\r\n\r\n\t}\r\n\r\n\treturn 1.0;\r\n\r\n}\r\n\r\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\r\n\r\n\treturn RECIPROCAL_PI * diffuseColor;\r\n\r\n} // validated\r\n\r\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\r\n\r\n\t// Original approximation by Christophe Schlick \'94\r\n\t// float fresnel = pow( 1.0 - dotLH, 5.0 );\r\n\r\n\t// Optimized variant (presented by Epic at SIGGRAPH \'13)\r\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\r\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\r\n\r\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\r\n\r\n} // validated\r\n\r\n// Microfacet Models for Refraction through Rough Surfaces - equation (34)\r\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\r\n// alpha is "roughness squared" in Disney’s reparameterization\r\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\r\n\r\n\t// geometry term (normalized) = G(l)⋅G(v) / 4(n⋅l)(n⋅v)\r\n\t// also see #12151\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\r\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\r\n\r\n\treturn 1.0 / ( gl * gv );\r\n\r\n} // validated\r\n\r\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\r\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\t// dotNL and dotNV are explicitly swapped. This is not a mistake.\r\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\r\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\r\n\r\n\treturn 0.5 / max( gv + gl, EPSILON );\r\n\r\n}\r\n\r\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\r\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\r\n// alpha is "roughness squared" in Disney’s reparameterization\r\nfloat D_GGX( const in float alpha, const in float dotNH ) {\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\r\n\r\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\r\n\r\n}\r\n\r\n// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility\r\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\r\n\r\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\r\n\r\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\r\n\r\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\r\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\r\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\r\n\r\n\tvec3 F = F_Schlick( specularColor, dotLH );\r\n\r\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\r\n\r\n\tfloat D = D_GGX( alpha, dotNH );\r\n\r\n\treturn F * ( G * D );\r\n\r\n} // validated\r\n\r\n// Rect Area Light\r\n\r\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\r\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\r\n// code: https://github.com/selfshadow/ltc_code/\r\n\r\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\r\n\r\n\tconst float LUT_SIZE = 64.0;\r\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\r\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\r\n\r\n\tfloat dotNV = saturate( dot( N, V ) );\r\n\r\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\r\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\r\n\r\n\tuv = uv * LUT_SCALE + LUT_BIAS;\r\n\r\n\treturn uv;\r\n\r\n}\r\n\r\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\r\n\r\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\r\n\t// An approximation of the form factor of a horizon-clipped rectangle.\r\n\r\n\tfloat l = length( f );\r\n\r\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\r\n\r\n}\r\n\r\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\r\n\r\n\tfloat x = dot( v1, v2 );\r\n\r\n\tfloat y = abs( x );\r\n\r\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\r\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\r\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\r\n\tfloat v = a / b;\r\n\r\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\r\n\r\n\treturn cross( v1, v2 ) * theta_sintheta;\r\n\r\n}\r\n\r\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\r\n\r\n\t// bail if point is on back side of plane of light\r\n\t// assumes ccw winding order of light vertices\r\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\r\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\r\n\tvec3 lightNormal = cross( v1, v2 );\r\n\r\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\r\n\r\n\t// construct orthonormal basis around N\r\n\tvec3 T1, T2;\r\n\tT1 = normalize( V - N * dot( V, N ) );\r\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\r\n\r\n\t// compute transform\r\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\r\n\r\n\t// transform rect\r\n\tvec3 coords[ 4 ];\r\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\r\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\r\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\r\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\r\n\r\n\t// project rect onto sphere\r\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\r\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\r\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\r\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\r\n\r\n\t// calculate vector form factor\r\n\tvec3 vectorFormFactor = vec3( 0.0 );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\r\n\r\n\t// adjust for horizon clipping\r\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\r\n\r\n\r\n\r\n\treturn vec3( result );\r\n\r\n}\r\n\r\n// End Rect Area Light\r\n\r\n// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\r\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\r\n\r\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\r\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\r\n\r\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\r\n\r\n\tvec4 r = roughness * c0 + c1;\r\n\r\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\r\n\r\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\r\n\r\n\treturn specularColor * AB.x + AB.y;\r\n\r\n} // validated\r\n\r\n\r\nfloat G_BlinnPhong_Implicit( ) {\r\n\r\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\r\n\treturn 0.25;\r\n\r\n}\r\n\r\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\r\n\r\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\r\n\r\n}\r\n\r\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\r\n\r\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\r\n\r\n\t//float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\r\n\t//float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\r\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\r\n\r\n\tvec3 F = F_Schlick( specularColor, dotLH );\r\n\r\n\tfloat G = G_BlinnPhong_Implicit( );\r\n\r\n\tfloat D = D_BlinnPhong( shininess, dotNH );\r\n\r\n\treturn F * ( G * D );\r\n\r\n} // validated\r\n\r\n// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html\r\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\r\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\r\n}\r\n\r\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\r\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\r\n}\r\n',bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\r\n\r\n\tuniform sampler2D bumpMap;\r\n\tuniform float bumpScale;\r\n\r\n\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\r\n\t// http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\r\n\r\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\r\n\r\n\tvec2 dHdxy_fwd() {\r\n\r\n\t\tvec2 dSTdx = dFdx( vUv );\r\n\t\tvec2 dSTdy = dFdy( vUv );\r\n\r\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\r\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\r\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\r\n\r\n\t\treturn vec2( dBx, dBy );\r\n\r\n\t}\r\n\r\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\r\n\r\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\r\n\r\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\r\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\r\n\t\tvec3 vN = surf_norm;\t\t// normalized\r\n\r\n\t\tvec3 R1 = cross( vSigmaY, vN );\r\n\t\tvec3 R2 = cross( vN, vSigmaX );\r\n\r\n\t\tfloat fDet = dot( vSigmaX, R1 );\r\n\r\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\r\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\r\n\r\n\t}\r\n\r\n#endif\r\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\r\n\r\n\tvec4 plane;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\r\n\r\n\t\tplane = clippingPlanes[ i ];\r\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\r\n\r\n\t}\r\n\r\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\r\n\r\n\t\tbool clipped = true;\r\n\r\n\t\t#pragma unroll_loop\r\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\r\n\r\n\t\t\tplane = clippingPlanes[ i ];\r\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\r\n\r\n\t\t}\r\n\r\n\t\tif ( clipped ) discard;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\r\n\r\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\t\tvarying vec3 vViewPosition;\r\n\t#endif\r\n\r\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\r\n\r\n#endif\r\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\tvarying vec3 vViewPosition;\r\n#endif\r\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\tvViewPosition = - mvPosition.xyz;\r\n#endif\r\n\r\n",color_fragment:"#ifdef USE_COLOR\r\n\r\n\tdiffuseColor.rgb *= vColor;\r\n\r\n#endif",color_pars_fragment:"#ifdef USE_COLOR\r\n\r\n\tvarying vec3 vColor;\r\n\r\n#endif\r\n",color_pars_vertex:"#ifdef USE_COLOR\r\n\r\n\tvarying vec3 vColor;\r\n\r\n#endif",color_vertex:"#ifdef USE_COLOR\r\n\r\n\tvColor.xyz = color.xyz;\r\n\r\n#endif",common:"#define PI 3.14159265359\r\n#define PI2 6.28318530718\r\n#define PI_HALF 1.5707963267949\r\n#define RECIPROCAL_PI 0.31830988618\r\n#define RECIPROCAL_PI2 0.15915494\r\n#define LOG2 1.442695\r\n#define EPSILON 1e-6\r\n\r\n#define saturate(a) clamp( a, 0.0, 1.0 )\r\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\r\n\r\nfloat pow2( const in float x ) { return x*x; }\r\nfloat pow3( const in float x ) { return x*x*x; }\r\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\r\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\r\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\r\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\r\nhighp float rand( const in vec2 uv ) {\r\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\r\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\r\n\treturn fract(sin(sn) * c);\r\n}\r\n\r\nstruct IncidentLight {\r\n\tvec3 color;\r\n\tvec3 direction;\r\n\tbool visible;\r\n};\r\n\r\nstruct ReflectedLight {\r\n\tvec3 directDiffuse;\r\n\tvec3 directSpecular;\r\n\tvec3 indirectDiffuse;\r\n\tvec3 indirectSpecular;\r\n};\r\n\r\nstruct GeometricContext {\r\n\tvec3 position;\r\n\tvec3 normal;\r\n\tvec3 viewDir;\r\n};\r\n\r\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\r\n\r\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\r\n\r\n}\r\n\r\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\r\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\r\n\r\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\r\n\r\n}\r\n\r\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\r\n\r\n\treturn - distance * planeNormal + point;\r\n\r\n}\r\n\r\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\r\n\r\n}\r\n\r\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\r\n\r\n}\r\n\r\nmat3 transposeMat3( const in mat3 m ) {\r\n\r\n\tmat3 tmp;\r\n\r\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\r\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\r\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\r\n\r\n\treturn tmp;\r\n\r\n}\r\n\r\n// https://en.wikipedia.org/wiki/Relative_luminance\r\nfloat linearToRelativeLuminance( const in vec3 color ) {\r\n\r\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\r\n\r\n\treturn dot( weights, color.rgb );\r\n\r\n}\r\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\r\n\r\n#define cubeUV_textureSize (1024.0)\r\n\r\nint getFaceFromDirection(vec3 direction) {\r\n\tvec3 absDirection = abs(direction);\r\n\tint face = -1;\r\n\tif( absDirection.x > absDirection.z ) {\r\n\t\tif(absDirection.x > absDirection.y )\r\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\r\n\t\telse\r\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\r\n\t}\r\n\telse {\r\n\t\tif(absDirection.z > absDirection.y )\r\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\r\n\t\telse\r\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\r\n\t}\r\n\treturn face;\r\n}\r\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\r\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\r\n\r\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\r\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\r\n\tfloat dxRoughness = dFdx(roughness);\r\n\tfloat dyRoughness = dFdy(roughness);\r\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\r\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\r\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\r\n\t// Clamp the value to the max mip level counts. hard coded to 6 mips\r\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\r\n\tfloat mipLevel = 0.5 * log2(d);\r\n\treturn vec2(floor(mipLevel), fract(mipLevel));\r\n}\r\n\r\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\r\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\r\n\r\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\r\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\r\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\r\n\r\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\r\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\r\n\t// float powScale = exp2(roughnessLevel + mipLevel);\r\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\r\n\t// float scale = 1.0 / exp2(roughnessLevel + 2.0 + mipLevel);\r\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\r\n\t// float mipOffset = 0.75*(1.0 - 1.0/exp2(mipLevel))/exp2(roughnessLevel);\r\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\r\n\r\n\tbool bRes = mipLevel == 0.0;\r\n\tscale = bRes && (scale < a) ? a : scale;\r\n\r\n\tvec3 r;\r\n\tvec2 offset;\r\n\tint face = getFaceFromDirection(direction);\r\n\r\n\tfloat rcpPowScale = 1.0 / powScale;\r\n\r\n\tif( face == 0) {\r\n\t\tr = vec3(direction.x, -direction.z, direction.y);\r\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 1) {\r\n\t\tr = vec3(direction.y, direction.x, direction.z);\r\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 2) {\r\n\t\tr = vec3(direction.z, direction.x, direction.y);\r\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 3) {\r\n\t\tr = vec3(direction.x, direction.z, direction.y);\r\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\telse if( face == 4) {\r\n\t\tr = vec3(direction.y, direction.x, -direction.z);\r\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\telse {\r\n\t\tr = vec3(direction.z, -direction.x, direction.y);\r\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\tr = normalize(r);\r\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\r\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\r\n\tvec2 base = offset + vec2( texelOffset );\r\n\treturn base + s * ( scale - 2.0 * texelOffset );\r\n}\r\n\r\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\r\n\r\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\r\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\r\n\tfloat r1 = floor(roughnessVal);\r\n\tfloat r2 = r1 + 1.0;\r\n\tfloat t = fract(roughnessVal);\r\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\r\n\tfloat s = mipInfo.y;\r\n\tfloat level0 = mipInfo.x;\r\n\tfloat level1 = level0 + 1.0;\r\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\r\n\r\n\t// round to nearest mipmap if we are not interpolating.\r\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\r\n\r\n\t// Tri linear interpolation.\r\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\r\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\r\n\r\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\r\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\r\n\r\n\tvec4 result = mix(color10, color20, t);\r\n\r\n\treturn vec4(result.rgb, 1.0);\r\n}\r\n\r\n#endif\r\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\r\n\r\n#ifdef FLIP_SIDED\r\n\r\n\ttransformedNormal = - transformedNormal;\r\n\r\n#endif\r\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\r\n\r\n\tuniform sampler2D displacementMap;\r\n\tuniform float displacementScale;\r\n\tuniform float displacementBias;\r\n\r\n#endif\r\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\r\n\r\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\r\n\r\n#endif\r\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\r\n\r\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\r\n\r\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\r\n\r\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\r\n\r\n#endif\r\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\r\n\r\n\tuniform sampler2D emissiveMap;\r\n\r\n#endif\r\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\r\n",encodings_pars_fragment:"// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/\r\n\r\nvec4 LinearToLinear( in vec4 value ) {\r\n\treturn value;\r\n}\r\n\r\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\r\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\r\n}\r\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\r\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\r\n}\r\n\r\nvec4 sRGBToLinear( in vec4 value ) {\r\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\r\n}\r\nvec4 LinearTosRGB( in vec4 value ) {\r\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\r\n}\r\n\r\nvec4 RGBEToLinear( in vec4 value ) {\r\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\r\n}\r\nvec4 LinearToRGBE( in vec4 value ) {\r\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\r\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\r\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\r\n// return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 );\r\n}\r\n\r\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\r\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\r\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\r\n}\r\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\r\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\r\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\r\n\tM = ceil( M * 255.0 ) / 255.0;\r\n\treturn vec4( value.rgb / ( M * maxRange ), M );\r\n}\r\n\r\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\r\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\r\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\r\n}\r\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\r\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\r\n\tfloat D = max( maxRange / maxRGB, 1.0 );\r\n\tD = min( floor( D ) / 255.0, 1.0 );\r\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\r\n}\r\n\r\n// LogLuv reference: http://graphicrants.blogspot.ca/2009/04/rgbm-color-encoding.html\r\n\r\n// M matrix, for encoding\r\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\r\nvec4 LinearToLogLuv( in vec4 value ) {\r\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\r\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\r\n\tvec4 vResult;\r\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\r\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\r\n\tvResult.w = fract(Le);\r\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\r\n\treturn vResult;\r\n}\r\n\r\n// Inverse M matrix, for decoding\r\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\r\nvec4 LogLuvToLinear( in vec4 value ) {\r\n\tfloat Le = value.z * 255.0 + value.w;\r\n\tvec3 Xp_Y_XYZp;\r\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\r\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\r\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\r\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\r\n\treturn vec4( max(vRGB, 0.0), 1.0 );\r\n}\r\n",envmap_fragment:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\r\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\r\n\r\n\t\t// Transforming Normal Vectors with the Inverse Transformation\r\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t#else\r\n\r\n\t\tvec3 reflectVec = vReflect;\r\n\r\n\t#endif\r\n\r\n\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\r\n\r\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\r\n\r\n\t\tvec2 sampleUV;\r\n\r\n\t\treflectVec = normalize( reflectVec );\r\n\r\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\r\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\r\n\r\n\t#elif defined( ENVMAP_TYPE_SPHERE )\r\n\r\n\t\treflectVec = normalize( reflectVec );\r\n\r\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\r\n\r\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\r\n\r\n\t#else\r\n\r\n\t\tvec4 envColor = vec4( 0.0 );\r\n\r\n\t#endif\r\n\r\n\tenvColor = envMapTexelToLinear( envColor );\r\n\r\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\r\n\r\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\r\n\r\n\t#elif defined( ENVMAP_BLENDING_MIX )\r\n\r\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\r\n\r\n\t#elif defined( ENVMAP_BLENDING_ADD )\r\n\r\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\r\n\tuniform float reflectivity;\r\n\tuniform float envMapIntensity;\r\n#endif\r\n\r\n#ifdef USE_ENVMAP\r\n\r\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\r\n\t\tvarying vec3 vWorldPosition;\r\n\t#endif\r\n\r\n\t#ifdef ENVMAP_TYPE_CUBE\r\n\t\tuniform samplerCube envMap;\r\n\t#else\r\n\t\tuniform sampler2D envMap;\r\n\t#endif\r\n\tuniform float flipEnvMap;\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\r\n\t\tuniform float refractionRatio;\r\n\t#else\r\n\t\tvarying vec3 vReflect;\r\n\t#endif\r\n\r\n#endif\r\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\t\tvarying vec3 vWorldPosition;\r\n\r\n\t#else\r\n\r\n\t\tvarying vec3 vReflect;\r\n\t\tuniform float refractionRatio;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",envmap_vertex:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\r\n\t\tvWorldPosition = worldPosition.xyz;\r\n\r\n\t#else\r\n\r\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\r\n\r\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t#endif\r\n\r\n#endif\r\n",fog_vertex:"\r\n#ifdef USE_FOG\r\nfogDepth = -mvPosition.z;\r\n#endif",fog_pars_vertex:"#ifdef USE_FOG\r\n\r\n varying float fogDepth;\r\n\r\n#endif\r\n",fog_fragment:"#ifdef USE_FOG\r\n\r\n\t#ifdef FOG_EXP2\r\n\r\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\r\n\r\n\t#else\r\n\r\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\r\n\r\n\t#endif\r\n\r\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\r\n\r\n#endif\r\n",fog_pars_fragment:"#ifdef USE_FOG\r\n\r\n\tuniform vec3 fogColor;\r\n\tvarying float fogDepth;\r\n\r\n\t#ifdef FOG_EXP2\r\n\r\n\t\tuniform float fogDensity;\r\n\r\n\t#else\r\n\r\n\t\tuniform float fogNear;\r\n\t\tuniform float fogFar;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",gradientmap_pars_fragment:"#ifdef TOON\r\n\r\n\tuniform sampler2D gradientMap;\r\n\r\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\r\n\r\n\t\t// dotNL will be from -1.0 to 1.0\r\n\t\tfloat dotNL = dot( normal, lightDirection );\r\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\r\n\r\n\t\t#ifdef USE_GRADIENTMAP\r\n\r\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\r\n\r\n\t\t#else\r\n\r\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\r\n\r\n\t\t#endif\r\n\r\n\r\n\t}\r\n\r\n#endif\r\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\r\n\r\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage\r\n\r\n#endif\r\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\r\n\r\n\tuniform sampler2D lightMap;\r\n\tuniform float lightMapIntensity;\r\n\r\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\r\n\r\nGeometricContext geometry;\r\ngeometry.position = mvPosition.xyz;\r\ngeometry.normal = normalize( transformedNormal );\r\ngeometry.viewDir = normalize( -mvPosition.xyz );\r\n\r\nGeometricContext backGeometry;\r\nbackGeometry.position = geometry.position;\r\nbackGeometry.normal = -geometry.normal;\r\nbackGeometry.viewDir = geometry.viewDir;\r\n\r\nvLightFront = vec3( 0.0 );\r\n\r\n#ifdef DOUBLE_SIDED\r\n\tvLightBack = vec3( 0.0 );\r\n#endif\r\n\r\nIncidentLight directLight;\r\nfloat dotNL;\r\nvec3 directLightColor_Diffuse;\r\n\r\n#if NUM_POINT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n\r\n#if NUM_DIR_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if NUM_HEMI_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\r\n\r\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n",lights_pars:"uniform vec3 ambientLightColor;\r\n\r\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\r\n\r\n\tvec3 irradiance = ambientLightColor;\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI;\r\n\r\n\t#endif\r\n\r\n\treturn irradiance;\r\n\r\n}\r\n\r\n#if NUM_DIR_LIGHTS > 0\r\n\r\n\tstruct DirectionalLight {\r\n\t\tvec3 direction;\r\n\t\tvec3 color;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t};\r\n\r\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\r\n\r\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tdirectLight.color = directionalLight.color;\r\n\t\tdirectLight.direction = directionalLight.direction;\r\n\t\tdirectLight.visible = true;\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_POINT_LIGHTS > 0\r\n\r\n\tstruct PointLight {\r\n\t\tvec3 position;\r\n\t\tvec3 color;\r\n\t\tfloat distance;\r\n\t\tfloat decay;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t\tfloat shadowCameraNear;\r\n\t\tfloat shadowCameraFar;\r\n\t};\r\n\r\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\r\n\r\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\r\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tvec3 lVector = pointLight.position - geometry.position;\r\n\t\tdirectLight.direction = normalize( lVector );\r\n\r\n\t\tfloat lightDistance = length( lVector );\r\n\r\n\t\tdirectLight.color = pointLight.color;\r\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\r\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_SPOT_LIGHTS > 0\r\n\r\n\tstruct SpotLight {\r\n\t\tvec3 position;\r\n\t\tvec3 direction;\r\n\t\tvec3 color;\r\n\t\tfloat distance;\r\n\t\tfloat decay;\r\n\t\tfloat coneCos;\r\n\t\tfloat penumbraCos;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t};\r\n\r\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\r\n\r\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\r\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tvec3 lVector = spotLight.position - geometry.position;\r\n\t\tdirectLight.direction = normalize( lVector );\r\n\r\n\t\tfloat lightDistance = length( lVector );\r\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\r\n\r\n\t\tif ( angleCos > spotLight.coneCos ) {\r\n\r\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\r\n\r\n\t\t\tdirectLight.color = spotLight.color;\r\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\r\n\t\t\tdirectLight.visible = true;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tdirectLight.color = vec3( 0.0 );\r\n\t\t\tdirectLight.visible = false;\r\n\r\n\t\t}\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_RECT_AREA_LIGHTS > 0\r\n\r\n\tstruct RectAreaLight {\r\n\t\tvec3 color;\r\n\t\tvec3 position;\r\n\t\tvec3 halfWidth;\r\n\t\tvec3 halfHeight;\r\n\t};\r\n\r\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\r\n\t// BRDF approximation Texture is 64x64\r\n\tuniform sampler2D ltc_1; // RGBA Float\r\n\tuniform sampler2D ltc_2; // RGBA Float\r\n\r\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\r\n\r\n#endif\r\n\r\n\r\n#if NUM_HEMI_LIGHTS > 0\r\n\r\n\tstruct HemisphereLight {\r\n\t\tvec3 direction;\r\n\t\tvec3 skyColor;\r\n\t\tvec3 groundColor;\r\n\t};\r\n\r\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\r\n\r\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\r\n\r\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\r\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\r\n\r\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\r\n\r\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\t\tirradiance *= PI;\r\n\r\n\t\t#endif\r\n\r\n\t\treturn irradiance;\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\r\n\r\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\r\n\r\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\r\n\r\n\t\t\t// TODO: replace with properly filtered cubemaps and access the irradiance LOD level, be it the last LOD level\r\n\t\t\t// of a specular cubemap, or just the default level of a specially created irradiance cubemap.\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\t// force the bias high to get the last LOD level as it is the most blurred.\r\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\r\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec4 envMapColor = vec4( 0.0 );\r\n\r\n\t\t#endif\r\n\r\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\r\n\r\n\t}\r\n\r\n\t// taken from here: http://casual-effects.blogspot.ca/2011/08/plausible-environment-lighting-in-two.html\r\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\r\n\r\n\t\t//float envMapWidth = pow( 2.0, maxMIPLevelScalar );\r\n\t\t//float desiredMIPLevel = log2( envMapWidth * sqrt( 3.0 ) ) - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\r\n\r\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\r\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\r\n\r\n\t\t// clamp to allowable LOD ranges.\r\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\r\n\r\n\t}\r\n\r\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\r\n\r\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\r\n\r\n\t\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\r\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\r\n\r\n\t\t\tvec2 sampleUV;\r\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\r\n\r\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#endif\r\n\r\n\t\treturn envMapColor.rgb * envMapIntensity;\r\n\r\n\t}\r\n\r\n#endif\r\n",lights_phong_fragment:"BlinnPhongMaterial material;\r\nmaterial.diffuseColor = diffuseColor.rgb;\r\nmaterial.specularColor = specular;\r\nmaterial.specularShininess = shininess;\r\nmaterial.specularStrength = specularStrength;\r\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n\r\nstruct BlinnPhongMaterial {\r\n\r\n\tvec3\tdiffuseColor;\r\n\tvec3\tspecularColor;\r\n\tfloat\tspecularShininess;\r\n\tfloat\tspecularStrength;\r\n\r\n};\r\n\r\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t#ifdef TOON\r\n\r\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\r\n\r\n\t#else\r\n\r\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\r\n\t\tvec3 irradiance = dotNL * directLight.color;\r\n\r\n\t#endif\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI; // punctual light\r\n\r\n\t#endif\r\n\r\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\r\n\r\n}\r\n\r\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n}\r\n\r\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\r\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\r\n\r\n#define Material_LightProbeLOD( material )\t(0)\r\n",lights_physical_fragment:"PhysicalMaterial material;\r\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\r\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\r\n#ifdef STANDARD\r\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\r\n#else\r\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\r\n\tmaterial.clearCoat = saturate( clearCoat ); // Burley clearcoat model\r\n\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\r\n#endif\r\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\r\n\r\n\tvec3\tdiffuseColor;\r\n\tfloat\tspecularRoughness;\r\n\tvec3\tspecularColor;\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat clearCoat;\r\n\t\tfloat clearCoatRoughness;\r\n\t#endif\r\n\r\n};\r\n\r\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\r\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\r\n\r\n// Clear coat directional hemishperical reflectance (this approximation should be improved)\r\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\r\n\r\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\r\n\r\n}\r\n\r\n#if NUM_RECT_AREA_LIGHTS > 0\r\n\r\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t\tvec3 normal = geometry.normal;\r\n\t\tvec3 viewDir = geometry.viewDir;\r\n\t\tvec3 position = geometry.position;\r\n\t\tvec3 lightPos = rectAreaLight.position;\r\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\r\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\r\n\t\tvec3 lightColor = rectAreaLight.color;\r\n\t\tfloat roughness = material.specularRoughness;\r\n\r\n\t\tvec3 rectCoords[ 4 ];\r\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight; // counterclockwise\r\n\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\r\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\r\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\r\n\r\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\r\n\r\n\t\tvec4 t1 = texture2D( ltc_1, uv );\r\n\t\tvec4 t2 = texture2D( ltc_2, uv );\r\n\r\n\t\tmat3 mInv = mat3(\r\n\t\t\tvec3( t1.x, 0, t1.y ),\r\n\t\t\tvec3( 0, 1, 0 ),\r\n\t\t\tvec3( t1.z, 0, t1.w )\r\n\t\t);\r\n\r\n\t\t// LTC Fresnel Approximation by Stephen Hill\r\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\r\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\r\n\r\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\r\n\r\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\r\n\r\n\tvec3 irradiance = dotNL * directLight.color;\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI; // punctual light\r\n\r\n\t#endif\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\r\n\t#else\r\n\t\tfloat clearCoatDHR = 0.0;\r\n\t#endif\r\n\r\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\r\n\r\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n\t#ifndef STANDARD\r\n\r\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\r\n\r\n\t#endif\r\n\r\n}\r\n\r\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n}\r\n\r\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\t\tfloat dotNL = dotNV;\r\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\r\n\t#else\r\n\t\tfloat clearCoatDHR = 0.0;\r\n\t#endif\r\n\r\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\r\n\r\n\t#ifndef STANDARD\r\n\r\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\r\n\r\n\t#endif\r\n\r\n}\r\n\r\n#define RE_Direct\t\t\t\tRE_Direct_Physical\r\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\r\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\r\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\r\n\r\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\r\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\r\n\r\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\r\n\r\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\r\n\r\n}\r\n",lights_template:"\r\n\r\nGeometricContext geometry;\r\n\r\ngeometry.position = - vViewPosition;\r\ngeometry.normal = normal;\r\ngeometry.viewDir = normalize( vViewPosition );\r\n\r\nIncidentLight directLight;\r\n\r\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tPointLight pointLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tpointLight = pointLights[ i ];\r\n\r\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tSpotLight spotLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tspotLight = spotLights[ i ];\r\n\r\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tDirectionalLight directionalLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tdirectionalLight = directionalLights[ i ];\r\n\r\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\r\n\r\n\tRectAreaLight rectAreaLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\r\n\r\n\t\trectAreaLight = rectAreaLights[ i ];\r\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if defined( RE_IndirectDiffuse )\r\n\r\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\r\n\r\n\t#ifdef USE_LIGHTMAP\r\n\r\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\r\n\r\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\r\n\r\n\t\t#endif\r\n\r\n\t\tirradiance += lightMapIrradiance;\r\n\r\n\t#endif\r\n\r\n\t#if ( NUM_HEMI_LIGHTS > 0 )\r\n\r\n\t\t#pragma unroll_loop\r\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\r\n\r\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\r\n\r\n\t\t}\r\n\r\n\t#endif\r\n\r\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t// TODO, replace 8 with the real maxMIPLevel\r\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\r\n\r\n\t#endif\r\n\r\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\r\n\r\n#endif\r\n\r\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\r\n\r\n\t// TODO, replace 8 with the real maxMIPLevel\r\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\r\n\r\n\t#ifndef STANDARD\r\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\r\n\t#else\r\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\r\n\t#endif\r\n\r\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\r\n\r\n#endif\r\n",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\r\n\r\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\r\n\r\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\tuniform float logDepthBufFC;\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvarying float vFragDepth;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvarying float vFragDepth;\r\n\r\n\t#endif\r\n\r\n\tuniform float logDepthBufFC;\r\n\r\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvFragDepth = 1.0 + gl_Position.w;\r\n\r\n\t#else\r\n\r\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\r\n\r\n\t\tgl_Position.z *= gl_Position.w;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",map_fragment:"#ifdef USE_MAP\r\n\r\n\tvec4 texelColor = texture2D( map, vUv );\r\n\r\n\ttexelColor = mapTexelToLinear( texelColor );\r\n\tdiffuseColor *= texelColor;\r\n\r\n#endif\r\n",map_pars_fragment:"#ifdef USE_MAP\r\n\r\n\tuniform sampler2D map;\r\n\r\n#endif\r\n",map_particle_fragment:"#ifdef USE_MAP\r\n\r\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\r\n\tvec4 mapTexel = texture2D( map, uv );\r\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\r\n\r\n#endif\r\n",map_particle_pars_fragment:"#ifdef USE_MAP\r\n\r\n\tuniform mat3 uvTransform;\r\n\tuniform sampler2D map;\r\n\r\n#endif\r\n",metalnessmap_fragment:"float metalnessFactor = metalness;\r\n\r\n#ifdef USE_METALNESSMAP\r\n\r\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\r\n\r\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\tmetalnessFactor *= texelMetalness.b;\r\n\r\n#endif\r\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\r\n\r\n\tuniform sampler2D metalnessMap;\r\n\r\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\r\n\r\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\r\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\r\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\r\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\r\n\r\n#endif\r\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\r\n\r\n\t#ifndef USE_MORPHNORMALS\r\n\r\n\tuniform float morphTargetInfluences[ 8 ];\r\n\r\n\t#else\r\n\r\n\tuniform float morphTargetInfluences[ 4 ];\r\n\r\n\t#endif\r\n\r\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\r\n\r\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\r\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\r\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\r\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\r\n\r\n\t#ifndef USE_MORPHNORMALS\r\n\r\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\r\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\r\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\r\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\r\n\r\n\t#endif\r\n\r\n#endif\r\n",normal_fragment:"#ifdef FLAT_SHADED\r\n\r\n\t// Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...\r\n\r\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\r\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\r\n\tvec3 normal = normalize( cross( fdx, fdy ) );\r\n\r\n#else\r\n\r\n\tvec3 normal = normalize( vNormal );\r\n\r\n\t#ifdef DOUBLE_SIDED\r\n\r\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\r\n\r\n\t#endif\r\n\r\n#endif\r\n\r\n#ifdef USE_NORMALMAP\r\n\r\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\r\n\r\n#elif defined( USE_BUMPMAP )\r\n\r\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\r\n\r\n#endif\r\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\r\n\r\n\tuniform sampler2D normalMap;\r\n\tuniform vec2 normalScale;\r\n\r\n\t// Per-Pixel Tangent Space Normal Mapping\r\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\r\n\r\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\r\n\r\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\r\n\r\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\r\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\r\n\t\tvec2 st0 = dFdx( vUv.st );\r\n\t\tvec2 st1 = dFdy( vUv.st );\r\n\r\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\r\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\r\n\t\tvec3 N = normalize( surf_norm );\r\n\r\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\r\n\t\tmapN.xy = normalScale * mapN.xy;\r\n\t\tmat3 tsn = mat3( S, T, N );\r\n\t\treturn normalize( tsn * mapN );\r\n\r\n\t}\r\n\r\n#endif\r\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\r\n\treturn normalize( normal ) * 0.5 + 0.5;\r\n}\r\n\r\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\r\n\treturn 2.0 * rgb.xyz - 1.0;\r\n}\r\n\r\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\r\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\r\n\r\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\r\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\r\n\r\nconst float ShiftRight8 = 1. / 256.;\r\n\r\nvec4 packDepthToRGBA( const in float v ) {\r\n\tvec4 r = vec4( fract( v * PackFactors ), v );\r\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\r\n\treturn r * PackUpscale;\r\n}\r\n\r\nfloat unpackRGBAToDepth( const in vec4 v ) {\r\n\treturn dot( v, UnpackFactors );\r\n}\r\n\r\n// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions\r\n\r\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\r\n\treturn ( viewZ + near ) / ( near - far );\r\n}\r\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\r\n\treturn linearClipZ * ( near - far ) - near;\r\n}\r\n\r\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\r\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\r\n}\r\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\r\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\r\n}\r\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\r\n\r\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\r\n\tgl_FragColor.rgb *= gl_FragColor.a;\r\n\r\n#endif\r\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\r\n\r\ngl_Position = projectionMatrix * mvPosition;\r\n",dithering_fragment:"#if defined( DITHERING )\r\n\r\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\r\n\r\n#endif\r\n",dithering_pars_fragment:"#if defined( DITHERING )\r\n\r\n\t// based on https://www.shadertoy.com/view/MslGR8\r\n\tvec3 dithering( vec3 color ) {\r\n\t\t//Calculate grid position\r\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\r\n\r\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\r\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\r\n\r\n\t\t//modify shift acording to grid position.\r\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\r\n\r\n\t\t//shift the color by dither_shift\r\n\t\treturn color + dither_shift_RGB;\r\n\t}\r\n\r\n#endif\r\n",roughnessmap_fragment:"float roughnessFactor = roughness;\r\n\r\n#ifdef USE_ROUGHNESSMAP\r\n\r\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\r\n\r\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\troughnessFactor *= texelRoughness.g;\r\n\r\n#endif\r\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\r\n\r\n\tuniform sampler2D roughnessMap;\r\n\r\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\r\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\r\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\r\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\r\n\r\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\r\n\r\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\r\n\r\n\t}\r\n\r\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\r\n\r\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\r\n\r\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\r\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\r\n\r\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\r\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\r\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\r\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\r\n\r\n\t\tvec2 f = fract( uv * size + 0.5 );\r\n\r\n\t\tfloat a = mix( lb, lt, f.y );\r\n\t\tfloat b = mix( rb, rt, f.y );\r\n\t\tfloat c = mix( a, b, f.x );\r\n\r\n\t\treturn c;\r\n\r\n\t}\r\n\r\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\r\n\r\n\t\tfloat shadow = 1.0;\r\n\r\n\t\tshadowCoord.xyz /= shadowCoord.w;\r\n\t\tshadowCoord.z += shadowBias;\r\n\r\n\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\r\n\t\t// if ( all( something, something ) ) using this instead\r\n\r\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\r\n\t\tbool inFrustum = all( inFrustumVec );\r\n\r\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\r\n\r\n\t\tbool frustumTest = all( frustumTestVec );\r\n\r\n\t\tif ( frustumTest ) {\r\n\r\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\r\n\r\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\r\n\r\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\r\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\r\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\r\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\r\n\r\n\t\t\tshadow = (\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\r\n\r\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\r\n\r\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\r\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\r\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\r\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\r\n\r\n\t\t\tshadow = (\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#else // no percentage-closer filtering:\r\n\r\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\r\n\r\n\t\t#endif\r\n\r\n\t\t}\r\n\r\n\t\treturn shadow;\r\n\r\n\t}\r\n\r\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\r\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\r\n\t// 2D texture:\r\n\t//\r\n\t// xzXZ\r\n\t// y Y\r\n\t//\r\n\t// Y - Positive y direction\r\n\t// y - Negative y direction\r\n\t// X - Positive x direction\r\n\t// x - Negative x direction\r\n\t// Z - Positive z direction\r\n\t// z - Negative z direction\r\n\t//\r\n\t// Source and test bed:\r\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\r\n\r\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\r\n\r\n\t\t// Number of texels to avoid at the edge of each square\r\n\r\n\t\tvec3 absV = abs( v );\r\n\r\n\t\t// Intersect unit cube\r\n\r\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\r\n\t\tabsV *= scaleToCube;\r\n\r\n\t\t// Apply scale to avoid seams\r\n\r\n\t\t// two texels less per square (one texel will do for NEAREST)\r\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\r\n\r\n\t\t// Unwrap\r\n\r\n\t\t// space: -1 ... 1 range for each square\r\n\t\t//\r\n\t\t// #X##\t\tdim := ( 4 , 2 )\r\n\t\t// # #\t\tcenter := ( 1 , 1 )\r\n\r\n\t\tvec2 planar = v.xy;\r\n\r\n\t\tfloat almostATexel = 1.5 * texelSizeY;\r\n\t\tfloat almostOne = 1.0 - almostATexel;\r\n\r\n\t\tif ( absV.z >= almostOne ) {\r\n\r\n\t\t\tif ( v.z > 0.0 )\r\n\t\t\t\tplanar.x = 4.0 - v.x;\r\n\r\n\t\t} else if ( absV.x >= almostOne ) {\r\n\r\n\t\t\tfloat signX = sign( v.x );\r\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\r\n\r\n\t\t} else if ( absV.y >= almostOne ) {\r\n\r\n\t\t\tfloat signY = sign( v.y );\r\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\r\n\t\t\tplanar.y = v.z * signY - 2.0;\r\n\r\n\t\t}\r\n\r\n\t\t// Transform to UV space\r\n\r\n\t\t// scale := 0.5 / dim\r\n\t\t// translate := ( center + 0.5 ) / dim\r\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\r\n\r\n\t}\r\n\r\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\r\n\r\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\r\n\r\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\r\n\t\t// the vector from the light to the world-space position of the fragment.\r\n\t\tvec3 lightToPosition = shadowCoord.xyz;\r\n\r\n\t\t// dp = normalized distance from light to fragment position\r\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\r\n\t\tdp += shadowBias;\r\n\r\n\t\t// bd3D = base direction 3D\r\n\t\tvec3 bd3D = normalize( lightToPosition );\r\n\r\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\r\n\r\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\r\n\r\n\t\t\treturn (\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#else // no percentage-closer filtering\r\n\r\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\r\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\r\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\r\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\r\n\r\n#endif\r\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\r\n\r\n#endif\r\n",shadowmask_pars_fragment:"float getShadowMask() {\r\n\r\n\tfloat shadow = 1.0;\r\n\r\n\t#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\tDirectionalLight directionalLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tdirectionalLight = directionalLights[ i ];\r\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\tSpotLight spotLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tspotLight = spotLights[ i ];\r\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\tPointLight pointLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tpointLight = pointLights[ i ];\r\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\r\n\r\n\t#endif\r\n\r\n\treturn shadow;\r\n\r\n}\r\n",skinbase_vertex:"#ifdef USE_SKINNING\r\n\r\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\r\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\r\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\r\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\r\n\r\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\r\n\r\n\tuniform mat4 bindMatrix;\r\n\tuniform mat4 bindMatrixInverse;\r\n\r\n\t#ifdef BONE_TEXTURE\r\n\r\n\t\tuniform sampler2D boneTexture;\r\n\t\tuniform int boneTextureSize;\r\n\r\n\t\tmat4 getBoneMatrix( const in float i ) {\r\n\r\n\t\t\tfloat j = i * 4.0;\r\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\r\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\r\n\r\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\r\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\r\n\r\n\t\t\ty = dy * ( y + 0.5 );\r\n\r\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\r\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\r\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\r\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\r\n\r\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\r\n\r\n\t\t\treturn bone;\r\n\r\n\t\t}\r\n\r\n\t#else\r\n\r\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\r\n\r\n\t\tmat4 getBoneMatrix( const in float i ) {\r\n\r\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\r\n\t\t\treturn bone;\r\n\r\n\t\t}\r\n\r\n\t#endif\r\n\r\n#endif\r\n",skinning_vertex:"#ifdef USE_SKINNING\r\n\r\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\r\n\r\n\tvec4 skinned = vec4( 0.0 );\r\n\tskinned += boneMatX * skinVertex * skinWeight.x;\r\n\tskinned += boneMatY * skinVertex * skinWeight.y;\r\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\r\n\tskinned += boneMatW * skinVertex * skinWeight.w;\r\n\r\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\r\n\r\n#endif\r\n",skinnormal_vertex:"#ifdef USE_SKINNING\r\n\r\n\tmat4 skinMatrix = mat4( 0.0 );\r\n\tskinMatrix += skinWeight.x * boneMatX;\r\n\tskinMatrix += skinWeight.y * boneMatY;\r\n\tskinMatrix += skinWeight.z * boneMatZ;\r\n\tskinMatrix += skinWeight.w * boneMatW;\r\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\r\n\r\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\r\n\r\n#endif\r\n",specularmap_fragment:"float specularStrength;\r\n\r\n#ifdef USE_SPECULARMAP\r\n\r\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\r\n\tspecularStrength = texelSpecular.r;\r\n\r\n#else\r\n\r\n\tspecularStrength = 1.0;\r\n\r\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\r\n\r\n\tuniform sampler2D specularMap;\r\n\r\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\r\n\r\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\r\n\r\n#endif\r\n",tonemapping_pars_fragment:"#ifndef saturate\r\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\r\n#endif\r\n\r\nuniform float toneMappingExposure;\r\nuniform float toneMappingWhitePoint;\r\n\r\n// exposure only\r\nvec3 LinearToneMapping( vec3 color ) {\r\n\r\n\treturn toneMappingExposure * color;\r\n\r\n}\r\n\r\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\r\nvec3 ReinhardToneMapping( vec3 color ) {\r\n\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\r\nvec3 Uncharted2ToneMapping( vec3 color ) {\r\n\r\n\t// John Hable's filmic operator from Uncharted 2 video game\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\nvec3 OptimizedCineonToneMapping( vec3 color ) {\r\n\r\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\r\n\tcolor *= toneMappingExposure;\r\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\r\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\r\n\r\n}\r\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvarying vec2 vUv;\r\n\r\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvarying vec2 vUv;\r\n\tuniform mat3 uvTransform;\r\n\r\n#endif\r\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\r\n\r\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tvarying vec2 vUv2;\r\n\r\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tattribute vec2 uv2;\r\n\tvarying vec2 vUv2;\r\n\r\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tvUv2 = uv2;\r\n\r\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\r\n\r\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\r\n\r\n#endif\r\n",cube_frag:"uniform samplerCube tCube;\r\nuniform float tFlip;\r\nuniform float opacity;\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\nvoid main() {\r\n\r\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\r\n\tgl_FragColor.a *= opacity;\r\n\r\n}\r\n",cube_vert:"varying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvWorldPosition = transformDirection( position, modelMatrix );\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n\tgl_Position.z = gl_Position.w; // set z to camera.far\r\n\r\n}\r\n",depth_frag:"#if DEPTH_PACKING == 3200\r\n\r\n\tuniform float opacity;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( 1.0 );\r\n\r\n\t#if DEPTH_PACKING == 3200\r\n\r\n\t\tdiffuseColor.a = opacity;\r\n\r\n\t#endif\r\n\r\n\t#include <map_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\r\n\t#if DEPTH_PACKING == 3200\r\n\r\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\r\n\r\n\t#elif DEPTH_PACKING == 3201\r\n\r\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\r\n\r\n\t#endif\r\n\r\n}\r\n",depth_vert:"#include <common>\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_DISPLACEMENTMAP\r\n\r\n\t\t#include <beginnormal_vertex>\r\n\t\t#include <morphnormal_vertex>\r\n\t\t#include <skinnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n}\r\n",distanceRGBA_frag:"#define DISTANCE\r\n\r\nuniform vec3 referencePosition;\r\nuniform float nearDistance;\r\nuniform float farDistance;\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main () {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( 1.0 );\r\n\r\n\t#include <map_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\tfloat dist = length( vWorldPosition - referencePosition );\r\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\r\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\r\n\r\n\tgl_FragColor = packDepthToRGBA( dist );\r\n\r\n}\r\n",distanceRGBA_vert:"#define DISTANCE\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_DISPLACEMENTMAP\r\n\r\n\t\t#include <beginnormal_vertex>\r\n\t\t#include <morphnormal_vertex>\r\n\t\t#include <skinnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvWorldPosition = worldPosition.xyz;\r\n\r\n}\r\n",equirect_frag:"uniform sampler2D tEquirect;\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvec3 direction = normalize( vWorldPosition );\r\n\r\n\tvec2 sampleUV;\r\n\r\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\r\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\r\n\r\n}\r\n",equirect_vert:"varying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvWorldPosition = transformDirection( position, modelMatrix );\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n}\r\n",linedashed_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\nuniform float dashSize;\r\nuniform float totalSize;\r\n\r\nvarying float vLineDistance;\r\n\r\n#include <common>\r\n#include <color_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\r\n\r\n\t\tdiscard;\r\n\r\n\t}\r\n\r\n\tvec3 outgoingLight = vec3( 0.0 );\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <color_fragment>\r\n\r\n\toutgoingLight = diffuseColor.rgb; // simple shader\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",linedashed_vert:"uniform float scale;\r\nattribute float lineDistance;\r\n\r\nvarying float vLineDistance;\r\n\r\n#include <common>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <color_vertex>\r\n\r\n\tvLineDistance = scale * lineDistance;\r\n\r\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\r\n\tgl_Position = projectionMatrix * mvPosition;\r\n\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshbasic_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\r\n\t// accumulation (baked indirect lighting only)\r\n\t#ifdef USE_LIGHTMAP\r\n\r\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\r\n\r\n\t#else\r\n\r\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\r\n\r\n\t#endif\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\r\n\r\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",meshbasic_vert:"#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_ENVMAP\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshlambert_frag:"uniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform float opacity;\r\n\r\nvarying vec3 vLightFront;\r\n\r\n#ifdef DOUBLE_SIDED\r\n\r\n\tvarying vec3 vLightBack;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <fog_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <shadowmask_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\r\n\r\n\t#include <lightmap_fragment>\r\n\r\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\r\n\r\n\t#ifdef DOUBLE_SIDED\r\n\r\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\r\n\r\n\t#else\r\n\r\n\t\treflectedLight.directDiffuse = vLightFront;\r\n\r\n\t#endif\r\n\r\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshlambert_vert:"#define LAMBERT\r\n\r\nvarying vec3 vLightFront;\r\n\r\n#ifdef DOUBLE_SIDED\r\n\r\n\tvarying vec3 vLightBack;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <lights_lambert_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshphong_frag:"#define PHONG\r\n\r\nuniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform vec3 specular;\r\nuniform float shininess;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <gradientmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <lights_phong_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\t#include <normal_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\t#include <lights_phong_fragment>\r\n\t#include <lights_template>\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshphong_vert:"#define PHONG\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshphysical_frag:"#define PHYSICAL\r\n\r\nuniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform float roughness;\r\nuniform float metalness;\r\nuniform float opacity;\r\n\r\n#ifndef STANDARD\r\n\tuniform float clearCoat;\r\n\tuniform float clearCoatRoughness;\r\n#endif\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <cube_uv_reflection_fragment>\r\n#include <lights_pars>\r\n#include <lights_physical_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <roughnessmap_pars_fragment>\r\n#include <metalnessmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <roughnessmap_fragment>\r\n\t#include <metalnessmap_fragment>\r\n\t#include <normal_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\t#include <lights_physical_fragment>\r\n\t#include <lights_template>\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshphysical_vert:"#define PHYSICAL\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",normal_frag:"#define NORMAL\r\n\r\nuniform float opacity;\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvarying vec3 vViewPosition;\r\n\r\n#endif\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <normal_fragment>\r\n\r\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\r\n\r\n}\r\n",normal_vert:"#define NORMAL\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvarying vec3 vViewPosition;\r\n\r\n#endif\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n#endif\r\n\r\n}\r\n",points_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <color_pars_fragment>\r\n#include <map_particle_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec3 outgoingLight = vec3( 0.0 );\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_particle_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\toutgoingLight = diffuseColor.rgb;\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",points_vert:"uniform float size;\r\nuniform float scale;\r\n\r\n#include <common>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <color_vertex>\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n\t#ifdef USE_SIZEATTENUATION\r\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\r\n\t#else\r\n\t\tgl_PointSize = size;\r\n\t#endif\r\n\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",shadow_frag:"uniform vec3 color;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <shadowmap_pars_fragment>\r\n#include <shadowmask_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\r\n\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",shadow_vert:"#include <fog_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n"},ve={basic:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.fog]),vertexShader:ye.meshbasic_vert,fragmentShader:ye.meshbasic_frag},lambert:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.fog,me.lights,{emissive:{value:new fe(0)}}]),vertexShader:ye.meshlambert_vert,fragmentShader:ye.meshlambert_frag},phong:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.gradientmap,me.fog,me.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:ye.meshphong_vert,fragmentShader:ye.meshphong_frag},standard:{uniforms:ge.merge([me.common,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.roughnessmap,me.metalnessmap,me.fog,me.lights,{emissive:{value:new fe(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:ye.meshphysical_vert,fragmentShader:ye.meshphysical_frag},points:{uniforms:ge.merge([me.points,me.fog]),vertexShader:ye.points_vert,fragmentShader:ye.points_frag},dashed:{uniforms:ge.merge([me.common,me.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ye.linedashed_vert,fragmentShader:ye.linedashed_frag},depth:{uniforms:ge.merge([me.common,me.displacementmap]),vertexShader:ye.depth_vert,fragmentShader:ye.depth_frag},normal:{uniforms:ge.merge([me.common,me.bumpmap,me.normalmap,me.displacementmap,{opacity:{value:1}}]),vertexShader:ye.normal_vert,fragmentShader:ye.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ye.cube_vert,fragmentShader:ye.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ye.equirect_vert,fragmentShader:ye.equirect_frag},distanceRGBA:{uniforms:ge.merge([me.common,me.displacementmap,{referencePosition:{value:new b},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ye.distanceRGBA_vert,fragmentShader:ye.distanceRGBA_frag},shadow:{uniforms:ge.merge([me.lights,me.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:ye.shadow_vert,fragmentShader:ye.shadow_frag}};function be(e,t,n,r,i,a,o,s,c){E.call(this,e,t,n,r,i,a,o,s,c),this.needsUpdate=!0}function we(e,t,n,r,i){var a,o,s,c,l,u,h=new b,d=new v,p=new b;function f(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),n=new Uint16Array([0,1,2,0,2,3]);a=t.createBuffer(),o=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,o),t.bufferData(t.ELEMENT_ARRAY_BUFFER,n,t.STATIC_DRAW),s=function(){var e=t.createProgram(),n=t.createShader(t.VERTEX_SHADER),r=t.createShader(t.FRAGMENT_SHADER);return t.shaderSource(n,["precision "+i.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 center;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvUV = uvOffset + uv * uvScale;","\tvec2 alignedPosition = ( position - center ) * scale;","\tvec2 rotatedPosition;","\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","\tvec4 mvPosition;","\tmvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","\tmvPosition.xy += rotatedPosition;","\tgl_Position = projectionMatrix * mvPosition;","\tfogDepth = - mvPosition.z;","}"].join("\n")),t.shaderSource(r,["precision "+i.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvec4 texture = texture2D( map, vUV );","\tgl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","\tif ( gl_FragColor.a < alphaTest ) discard;","\tif ( fogType > 0 ) {","\t\tfloat fogFactor = 0.0;","\t\tif ( fogType == 1 ) {","\t\t\tfogFactor = smoothstep( fogNear, fogFar, fogDepth );","\t\t} else {","\t\t\tconst float LOG2 = 1.442695;","\t\t\tfogFactor = exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 );","\t\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","\t\t}","\t\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );","\t}","}"].join("\n")),t.compileShader(n),t.compileShader(r),t.attachShader(e,n),t.attachShader(e,r),t.linkProgram(e),e}(),c={position:t.getAttribLocation(s,"position"),uv:t.getAttribLocation(s,"uv")},l={uvOffset:t.getUniformLocation(s,"uvOffset"),uvScale:t.getUniformLocation(s,"uvScale"),rotation:t.getUniformLocation(s,"rotation"),center:t.getUniformLocation(s,"center"),scale:t.getUniformLocation(s,"scale"),color:t.getUniformLocation(s,"color"),map:t.getUniformLocation(s,"map"),opacity:t.getUniformLocation(s,"opacity"),modelViewMatrix:t.getUniformLocation(s,"modelViewMatrix"),projectionMatrix:t.getUniformLocation(s,"projectionMatrix"),fogType:t.getUniformLocation(s,"fogType"),fogDensity:t.getUniformLocation(s,"fogDensity"),fogNear:t.getUniformLocation(s,"fogNear"),fogFar:t.getUniformLocation(s,"fogFar"),fogColor:t.getUniformLocation(s,"fogColor"),fogDepth:t.getUniformLocation(s,"fogDepth"),alphaTest:t.getUniformLocation(s,"alphaTest")};var r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=8,r.height=8;var h=r.getContext("2d");h.fillStyle="white",h.fillRect(0,0,8,8),u=new be(r)}function m(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:t.id-e.id}this.render=function(i,g,y){if(0!==i.length){void 0===s&&f(),n.useProgram(s),n.initAttributes(),n.enableAttribute(c.position),n.enableAttribute(c.uv),n.disableUnusedAttributes(),n.disable(t.CULL_FACE),n.enable(t.BLEND),t.bindBuffer(t.ARRAY_BUFFER,a),t.vertexAttribPointer(c.position,2,t.FLOAT,!1,16,0),t.vertexAttribPointer(c.uv,2,t.FLOAT,!1,16,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,o),t.uniformMatrix4fv(l.projectionMatrix,!1,y.projectionMatrix.elements),n.activeTexture(t.TEXTURE0),t.uniform1i(l.map,0);var v=0,b=0,w=g.fog;w?(t.uniform3f(l.fogColor,w.color.r,w.color.g,w.color.b),w.isFog?(t.uniform1f(l.fogNear,w.near),t.uniform1f(l.fogFar,w.far),t.uniform1i(l.fogType,1),v=1,b=1):w.isFogExp2&&(t.uniform1f(l.fogDensity,w.density),t.uniform1i(l.fogType,2),v=2,b=2)):(t.uniform1i(l.fogType,0),v=0,b=0);for(var A=0,E=i.length;A<E;A++){(S=i[A]).modelViewMatrix.multiplyMatrices(y.matrixWorldInverse,S.matrixWorld),S.z=-S.modelViewMatrix.elements[14]}i.sort(m);var x=[],_=[];for(A=0,E=i.length;A<E;A++){var S,M=(S=i[A]).material;if(!1!==M.visible){S.onBeforeRender(e,g,y,void 0,M,void 0),t.uniform1f(l.alphaTest,M.alphaTest),t.uniformMatrix4fv(l.modelViewMatrix,!1,S.modelViewMatrix.elements),S.matrixWorld.decompose(h,d,p),x[0]=p.x,x[1]=p.y,_[0]=S.center.x-.5,_[1]=S.center.y-.5;var T=0;g.fog&&M.fog&&(T=b),v!==T&&(t.uniform1i(l.fogType,T),v=T),null!==M.map?(t.uniform2f(l.uvOffset,M.map.offset.x,M.map.offset.y),t.uniform2f(l.uvScale,M.map.repeat.x,M.map.repeat.y)):(t.uniform2f(l.uvOffset,0,0),t.uniform2f(l.uvScale,1,1)),t.uniform1f(l.opacity,M.opacity),t.uniform3f(l.color,M.color.r,M.color.g,M.color.b),t.uniform1f(l.rotation,M.rotation),t.uniform2fv(l.center,_),t.uniform2fv(l.scale,x),n.setBlending(M.blending,M.blendEquation,M.blendSrc,M.blendDst,M.blendEquationAlpha,M.blendSrcAlpha,M.blendDstAlpha,M.premultipliedAlpha),n.buffers.depth.setTest(M.depthTest),n.buffers.depth.setMask(M.depthWrite),n.buffers.color.setMask(M.colorWrite),r.setTexture2D(M.map||u,0),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),S.onAfterRender(e,g,y,void 0,M,void 0)}}n.enable(t.CULL_FACE),n.reset()}}}ve.physical={uniforms:ge.merge([ve.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:ye.meshphysical_vert,fragmentShader:ye.meshphysical_frag},be.prototype=Object.create(E.prototype),be.prototype.constructor=be;var Ae,Ee,xe,_e,Se,Me,Te,Re=0;function ke(){Object.defineProperty(this,"id",{value:Re++}),this.uuid=m.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexColors=0,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this.userData={},this.needsUpdate=!0}function Ce(e){ke.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(e)}function Oe(e){ke.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new b,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Pe(e,t){this.min=void 0!==e?e:new b(1/0,1/0,1/0),this.max=void 0!==t?t:new b(-1/0,-1/0,-1/0)}function Ie(e,t){this.center=void 0!==e?e:new b,this.radius=void 0!==t?t:0}function Ne(e,t){this.normal=void 0!==e?e:new b(1,0,0),this.constant=void 0!==t?t:0}function Le(e,t,n,r,i,a){this.planes=[void 0!==e?e:new Ne,void 0!==t?t:new Ne,void 0!==n?n:new Ne,void 0!==r?r:new Ne,void 0!==i?i:new Ne,void 0!==a?a:new Ne]}function De(e,t,n){for(var r=new Le,i=new y,a=new g,o=new g(n,n),s=new b,c=new b,l=new Array(4),u=new Array(4),h={},d={0:1,1:0,2:2},p=[new b(1,0,0),new b(-1,0,0),new b(0,0,1),new b(0,0,-1),new b(0,1,0),new b(0,-1,0)],f=[new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,0,1),new b(0,0,-1)],m=[new x,new x,new x,new x,new x,new x],v=0;4!==v;++v){var w=0!=(1&v),A=0!=(2&v),E=new Ce({depthPacking:3201,morphTargets:w,skinning:A});l[v]=E;var S=new Oe({morphTargets:w,skinning:A});u[v]=S}var M=this;function T(t,n,r,i,a,o){var s=t.geometry,c=null,p=l,f=t.customDepthMaterial;if(r&&(p=u,f=t.customDistanceMaterial),f)c=f;else{var m=!1;n.morphTargets&&(s&&s.isBufferGeometry?m=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:s&&s.isGeometry&&(m=s.morphTargets&&s.morphTargets.length>0)),t.isSkinnedMesh&&!1===n.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t);var g=0;m&&(g|=1),t.isSkinnedMesh&&n.skinning&&(g|=2),c=p[g]}if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var y=c.uuid,v=n.uuid,b=h[y];void 0===b&&(b={},h[y]=b);var w=b[v];void 0===w&&(w=c.clone(),b[v]=w),c=w}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=null!=n.shadowSide?n.shadowSide:d[n.side],c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,r&&c.isMeshDistanceMaterial&&(c.referencePosition.copy(i),c.nearDistance=a,c.farDistance=o),c}function R(n,i,a,o){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&n.castShadow&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var s=t.update(n),l=n.material;if(Array.isArray(l))for(var u=s.groups,h=0,d=u.length;h<d;h++){var p=u[h],f=l[p.materialIndex];if(f&&f.visible){var m=T(n,f,o,c,a.near,a.far);e.renderBufferDirect(a,null,s,m,n,p)}}else if(l.visible){m=T(n,l,o,c,a.near,a.far);e.renderBufferDirect(a,null,s,m,n,null)}}for(var g=n.children,y=0,v=g.length;y<v;y++)R(g[y],i,a,o)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(t,n,l){if(!1!==M.enabled&&(!1!==M.autoUpdate||!1!==M.needsUpdate)&&0!==t.length){var u,h=e.context,d=e.state;d.disable(h.BLEND),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(var g=0,y=t.length;g<y;g++){var v=t[g],b=v.shadow,w=v&&v.isPointLight;if(void 0!==b){var A=b.camera;if(a.copy(b.mapSize),a.min(o),w){var E=a.x,x=a.y;m[0].set(2*E,x,E,x),m[1].set(0,x,E,x),m[2].set(3*E,x,E,x),m[3].set(E,x,E,x),m[4].set(3*E,0,E,x),m[5].set(E,0,E,x),a.x*=4,a.y*=2}if(null===b.map){var S={minFilter:1003,magFilter:1003,format:1023};b.map=new _(a.x,a.y,S),b.map.texture.name=v.name+".shadowMap",A.updateProjectionMatrix()}b.isSpotLightShadow&&b.update(v);var T=b.map,k=b.matrix;c.setFromMatrixPosition(v.matrixWorld),A.position.copy(c),w?(u=6,k.makeTranslation(-c.x,-c.y,-c.z)):(u=1,s.setFromMatrixPosition(v.target.matrixWorld),A.lookAt(s),A.updateMatrixWorld(),k.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),k.multiply(A.projectionMatrix),k.multiply(A.matrixWorldInverse)),e.setRenderTarget(T),e.clear();for(var C=0;C<u;C++){if(w){s.copy(A.position),s.add(p[C]),A.up.copy(f[C]),A.lookAt(s),A.updateMatrixWorld();var O=m[C];d.viewport(O)}i.multiplyMatrices(A.projectionMatrix,A.matrixWorldInverse),r.setFromMatrix(i),R(n,l,A,w)}}else console.warn("THREE.WebGLShadowMap:",v,"has no shadow.")}M.needsUpdate=!1}}}function Fe(e){var t={};return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t[e.uuid]},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var r=t[n.uuid];r&&(e.deleteBuffer(r.buffer),delete t[n.uuid])},update:function(n,r){n.isInterleavedBufferAttribute&&(n=n.data);var i=t[n.uuid];void 0===i?t[n.uuid]=function(t,n){var r=t.array,i=t.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW,a=e.createBuffer();e.bindBuffer(n,a),e.bufferData(n,r,i),t.onUploadCallback();var o=e.FLOAT;return r instanceof Float32Array?o=e.FLOAT:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?o=e.UNSIGNED_SHORT:r instanceof Int16Array?o=e.SHORT:r instanceof Uint32Array?o=e.UNSIGNED_INT:r instanceof Int32Array?o=e.INT:r instanceof Int8Array?o=e.BYTE:r instanceof Uint8Array&&(o=e.UNSIGNED_BYTE),{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}(n,r):i.version<n.version&&(!function(t,n,r){var i=n.array,a=n.updateRange;e.bindBuffer(r,t),!1===n.dynamic?e.bufferData(r,i,e.STATIC_DRAW):-1===a.count?e.bufferSubData(r,0,i):0===a.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(e.bufferSubData(r,a.offset*i.BYTES_PER_ELEMENT,i.subarray(a.offset,a.offset+a.count)),a.count=-1)}(i.buffer,n,r),i.version=n.version)}}}function je(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||je.DefaultOrder}function Ue(){this.mask=1}ke.prototype=Object.assign(Object.create(a.prototype),{constructor:ke,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]="overdraw"===t?Number(n):n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),0!==this.side&&(n.side=this.side),0!==this.vertexColors&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0!==this.rotation&&(n.rotation=this.rotation),1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),a=r(e.images);i.length>0&&(n.textures=i),a.length>0&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.lights=e.lights,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.overdraw=e.overdraw,this.visible=e.visible,this.userData=JSON.parse(JSON.stringify(e.userData)),this.clipShadows=e.clipShadows,this.clipIntersection=e.clipIntersection;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.shadowSide=e.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Ce.prototype=Object.create(ke.prototype),Ce.prototype.constructor=Ce,Ce.prototype.isMeshDepthMaterial=!0,Ce.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},Oe.prototype=Object.create(ke.prototype),Oe.prototype.constructor=Oe,Oe.prototype.isMeshDistanceMaterial=!0,Oe.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this},Object.assign(Pe.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.length;s<c;s+=3){var l=e[s],u=e[s+1],h=e[s+2];l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.count;s<c;s++){var l=e.getX(s),u=e.getY(s),h=e.getZ(s);l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new b;return function(t,n){var r=e.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){var t=e||new b;return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){var t=e||new b;return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(){var e,t,n,r=new b;function i(i){var a=i.geometry;if(void 0!==a)if(a.isGeometry){var o=a.vertices;for(t=0,n=o.length;t<n;t++)r.copy(o[t]),r.applyMatrix4(i.matrixWorld),e.expandByPoint(r)}else if(a.isBufferGeometry){var s=a.attributes.position;if(void 0!==s)for(t=0,n=s.count;t<n;t++)r.fromBufferAttribute(s,t).applyMatrix4(i.matrixWorld),e.expandByPoint(r)}}return function(t){return e=this,t.updateMatrixWorld(!0),t.traverse(i),this}}(),containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return(t||new b).set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:(Ee=new b,function(e){return this.clampPoint(e.center,Ee),Ee.distanceToSquared(e.center)<=e.radius*e.radius}),intersectsPlane:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=e.constant&&n>=e.constant},intersectsTriangle:function(){var e=new b,t=new b,n=new b,r=new b,i=new b,a=new b,o=new b,s=new b,c=new b,l=new b;function u(r){var i,a;for(i=0,a=r.length-3;i<=a;i+=3){o.fromArray(r,i);var s=c.x*Math.abs(o.x)+c.y*Math.abs(o.y)+c.z*Math.abs(o.z),l=e.dot(o),u=t.dot(o),h=n.dot(o);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>s)return!1}return!0}return function(o){if(this.isEmpty())return!1;this.getCenter(s),c.subVectors(this.max,s),e.subVectors(o.a,s),t.subVectors(o.b,s),n.subVectors(o.c,s),r.subVectors(t,e),i.subVectors(n,t),a.subVectors(e,n);var h=[0,-r.z,r.y,0,-i.z,i.y,0,-a.z,a.y,r.z,0,-r.x,i.z,0,-i.x,a.z,0,-a.x,-r.y,r.x,0,-i.y,i.x,0,-a.y,a.x,0];return!!u(h)&&(!!u(h=[1,0,0,0,1,0,0,0,1])&&(l.crossVectors(r,i),u(h=[l.x,l.y,l.z])))}}(),clampPoint:function(e,t){return(t||new b).copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new b;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new b;return function(t){var n=t||new Ie;return this.getCenter(n.center),n.radius=.5*this.getSize(e).length(),n}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:(Ae=[new b,new b,new b,new b,new b,new b,new b,new b],function(e){return this.isEmpty()||(Ae[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ae[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ae[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ae[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ae[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ae[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ae[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ae[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ae)),this}),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(Ie.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:(xe=new Pe,function(e,t){var n=this.center;void 0!==t?n.copy(t):xe.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e),r=t||new b;return r.copy(e),n>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(e){var t=e||new Pe;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),Object.assign(Ne.prototype,{set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new b,t=new b;return function(n,r,i){var a=e.subVectors(i,r).cross(t.subVectors(n,r)).normalize();return this.setFromNormalAndCoplanarPoint(a,n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return(t||new b).copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(){var e=new b;return function(t,n){var r=n||new b,i=t.delta(e),a=this.normal.dot(i);if(0===a)return 0===this.distanceToPoint(t.start)?r.copy(t.start):void 0;var o=-(t.start.dot(this.normal)+this.constant)/a;return o<0||o>1?void 0:r.copy(i).multiplyScalar(o).add(t.start)}}(),intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return(e||new b).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new b,t=new w;return function(n,r){var i=r||t.getNormalMatrix(n),a=this.coplanarPoint(e).applyMatrix4(n),o=this.normal.applyMatrix3(i).normalize();return this.constant=-a.dot(o),this}}(),translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}),Object.assign(Le.prototype,{set:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromMatrix:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],y=n[14],v=n[15];return t[0].setComponents(o-r,u-s,f-h,v-m).normalize(),t[1].setComponents(o+r,u+s,f+h,v+m).normalize(),t[2].setComponents(o+i,u+c,f+d,v+g).normalize(),t[3].setComponents(o-i,u-c,f-d,v-g).normalize(),t[4].setComponents(o-a,u-l,f-p,v-y).normalize(),t[5].setComponents(o+a,u+l,f+p,v+y).normalize(),this},intersectsObject:(Me=new Ie,function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Me.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Me)}),intersectsSprite:function(){var e=new Ie;return function(t){return e.center.set(0,0,0),e.radius=.7071067811865476,e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){if(t[i].distanceToPoint(n)<r)return!1}return!0},intersectsBox:(_e=new b,Se=new b,function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];_e.x=r.normal.x>0?e.min.x:e.max.x,Se.x=r.normal.x>0?e.max.x:e.min.x,_e.y=r.normal.y>0?e.min.y:e.max.y,Se.y=r.normal.y>0?e.max.y:e.min.y,_e.z=r.normal.z>0?e.min.z:e.max.z,Se.z=r.normal.z>0?e.max.z:e.min.z;var i=r.distanceToPoint(_e),a=r.distanceToPoint(Se);if(i<0&&a<0)return!1}return!0}),containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}),je.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],je.DefaultOrder="XYZ",Object.defineProperties(je.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this.onChangeCallback()}}}),Object.assign(je.prototype,{isEuler:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var r=m.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],c=i[1],l=i[5],u=i[9],h=i[2],d=i[6],p=i[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.99999?(this._y=Math.atan2(s,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===t?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(d,p),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,l))):"YZX"===t?(this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===t?(this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(d,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-u,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:function(){var e=new y;return function(t,n,r){return e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,n,r)}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:(Te=new v,function(e){return Te.setFromEuler(this),this.setFromQuaternion(Te,e)}),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new b(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(Ue.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},test:function(e){return 0!=(this.mask&e.mask)}});var Be,Ve,ze,He,Ge=0;function qe(){Object.defineProperty(this,"id",{value:Ge++}),this.uuid=m.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=qe.DefaultUp.clone();var e=new b,t=new je,n=new v,r=new b(1,1,1);t.onChange((function(){n.setFromEuler(t,!1)})),n.onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{enumerable:!0,value:e},rotation:{enumerable:!0,value:t},quaternion:{enumerable:!0,value:n},scale:{enumerable:!0,value:r},modelViewMatrix:{value:new y},normalMatrix:{value:new w}}),this.matrix=new y,this.matrixWorld=new y,this.matrixAutoUpdate=qe.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Ue,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function We(){qe.call(this),this.type="Camera",this.matrixWorldInverse=new y,this.projectionMatrix=new y}function Je(e,t,n,r,i,a){We.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function Ze(e,t,n,r,i,a){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new b,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new fe,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==a?a:0}qe.DefaultUp=new b(0,1,0),qe.DefaultMatrixAutoUpdate=!0,qe.prototype=Object.assign(Object.create(a.prototype),{constructor:qe,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:(He=new v,function(e,t){return He.setFromAxisAngle(e,t),this.quaternion.multiply(He),this}),rotateOnWorldAxis:function(){var e=new v;return function(t,n){return e.setFromAxisAngle(t,n),this.quaternion.premultiply(e),this}}(),rotateX:function(){var e=new b(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new b(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new b(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new b;return function(t,n){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(n)),this}}(),translateX:function(){var e=new b(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new b(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new b(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:(ze=new y,function(e){return e.applyMatrix4(ze.getInverse(this.matrixWorld))}),lookAt:function(){var e=new y,t=new b;return function(n,r,i){n.isVector3?t.copy(n):t.set(n,r,i),this.isCamera?e.lookAt(this.position,t,this.up):e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,e.dispatchEvent({type:"removed"}),this.children.splice(n,1)),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}},getWorldPosition:function(e){var t=e||new b;return this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(Be=new b,Ve=new b,function(e){var t=e||new v;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(Be,t,Ve),t}),getWorldRotation:function(){var e=new v;return function(t){var n=t||new je;return this.getWorldQuaternion(e),n.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new b,t=new v;return function(n){var r=n||new b;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,r),r}}(),getWorldDirection:function(){var e=new v;return function(t){var n=t||new b;return this.getWorldQuaternion(e),n.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},toJSON:function(e){var t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.matrix=this.matrix.toArray(),void 0!==this.geometry){r.geometry=i(e.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if(Array.isArray(o))for(var s=0,c=o.length;s<c;s++){var l=o[s];i(e.shapes,l)}else i(e.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var u=[];for(s=0,c=this.material.length;s<c;s++)u.push(i(e.materials,this.material[s]));r.material=u}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(e).object)}if(t){var h=m(e.geometries),d=m(e.materials),p=m(e.textures),f=m(e.images);o=m(e.shapes);h.length>0&&(n.geometries=h),d.length>0&&(n.materials=d),p.length>0&&(n.textures=p),f.length>0&&(n.images=f),o.length>0&&(n.shapes=o)}return n.object=r,n;function m(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}}),We.prototype=Object.assign(Object.create(qe.prototype),{constructor:We,isCamera:!0,copy:function(e,t){return qe.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this},getWorldDirection:function(){var e=new v;return function(t){var n=t||new b;return this.getWorldQuaternion(e),n.set(0,0,-1).applyQuaternion(e)}}(),updateMatrixWorld:function(e){qe.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Je.prototype=Object.assign(Object.create(We.prototype),{constructor:Je,isOrthographicCamera:!0,copy:function(e,t){return We.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,r,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var c=this.zoom/(this.view.width/this.view.fullWidth),l=this.zoom/(this.view.height/this.view.fullHeight),u=(this.right-this.left)/this.view.width,h=(this.top-this.bottom)/this.view.height;a=(i+=u*(this.view.offsetX/c))+u*(this.view.width/c),s=(o-=h*(this.view.offsetY/l))-h*(this.view.height/l)}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far)},toJSON:function(e){var t=qe.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),Object.assign(Ze.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Xe,Ye=0;function Ke(){Object.defineProperty(this,"id",{value:Ye+=2}),this.uuid=m.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function Qe(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=m.generateUUID(),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function $e(e,t,n){Qe.call(this,new Int8Array(e),t,n)}function et(e,t,n){Qe.call(this,new Uint8Array(e),t,n)}function tt(e,t,n){Qe.call(this,new Uint8ClampedArray(e),t,n)}function nt(e,t,n){Qe.call(this,new Int16Array(e),t,n)}function rt(e,t,n){Qe.call(this,new Uint16Array(e),t,n)}function it(e,t,n){Qe.call(this,new Int32Array(e),t,n)}function at(e,t,n){Qe.call(this,new Uint32Array(e),t,n)}function ot(e,t,n){Qe.call(this,new Float32Array(e),t,n)}function st(e,t,n){Qe.call(this,new Float64Array(e),t,n)}function ct(){this.indices=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function lt(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}Ke.prototype=Object.assign(Object.create(a.prototype),{constructor:Ke,isGeometry:!0,applyMatrix:function(e){for(var t=(new w).getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++){this.vertices[n].applyMatrix4(e)}for(n=0,r=this.faces.length;n<r;n++){var i=this.faces[n];i.normal.applyMatrix3(t).normalize();for(var a=0,o=i.vertexNormals.length;a<o;a++)i.vertexNormals[a].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var e=new y;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new y;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new y;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new y;return function(t,n,r){return e.makeTranslation(t,n,r),this.applyMatrix(e),this}}(),scale:function(){var e=new y;return function(t,n,r){return e.makeScale(t,n,r),this.applyMatrix(e),this}}(),lookAt:(Xe=new qe,function(e){Xe.lookAt(e),Xe.updateMatrix(),this.applyMatrix(Xe.matrix)}),fromBufferGeometry:function(e){var t=this,n=null!==e.index?e.index.array:void 0,r=e.attributes,i=r.position.array,a=void 0!==r.normal?r.normal.array:void 0,o=void 0!==r.color?r.color.array:void 0,s=void 0!==r.uv?r.uv.array:void 0,c=void 0!==r.uv2?r.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var l=[],u=[],h=[],d=0,p=0;d<i.length;d+=3,p+=2)t.vertices.push(new b(i[d],i[d+1],i[d+2])),void 0!==a&&l.push(new b(a[d],a[d+1],a[d+2])),void 0!==o&&t.colors.push(new fe(o[d],o[d+1],o[d+2])),void 0!==s&&u.push(new g(s[p],s[p+1])),void 0!==c&&h.push(new g(c[p],c[p+1]));function f(e,n,r,i){var d=new Ze(e,n,r,void 0!==a?[l[e].clone(),l[n].clone(),l[r].clone()]:[],void 0!==o?[t.colors[e].clone(),t.colors[n].clone(),t.colors[r].clone()]:[],i);t.faces.push(d),void 0!==s&&t.faceVertexUvs[0].push([u[e].clone(),u[n].clone(),u[r].clone()]),void 0!==c&&t.faceVertexUvs[1].push([h[e].clone(),h[n].clone(),h[r].clone()])}var m=e.groups;if(m.length>0)for(d=0;d<m.length;d++)for(var y=m[d],v=y.start,w=(p=v,v+y.count);p<w;p+=3)void 0!==n?f(n[p],n[p+1],n[p+2],y.materialIndex):f(p,p+1,p+2,y.materialIndex);else if(void 0!==n)for(d=0;d<n.length;d+=3)f(n[d],n[d+1],n[d+2]);else for(d=0;d<i.length/3;d+=3)f(d,d+1,d+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,r=new y;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var e=new b,t=new b,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){var t,n,r,i,a,o;for(void 0===e&&(e=!0),o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new b;if(e){var s,c,l,u=new b,h=new b;for(r=0,i=this.faces.length;r<i;r++)a=this.faces[r],s=this.vertices[a.a],c=this.vertices[a.b],l=this.vertices[a.c],u.subVectors(l,c),h.subVectors(s,c),u.cross(h),o[a.a].add(u),o[a.b].add(u),o[a.c].add(u)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)o[(a=this.faces[r]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,n=this.vertices.length;t<n;t++)o[t].normalize();for(r=0,i=this.faces.length;r<i;r++){var d=(a=this.faces[r]).vertexNormals;3===d.length?(d[0].copy(o[a.a]),d[1].copy(o[a.b]),d[2].copy(o[a.c])):(d[0]=o[a.a].clone(),d[1]=o[a.b].clone(),d[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var r=(n=this.faces[e]).vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for((i=this.faces[n]).__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),e=0,t=i.vertexNormals.length;e<t;e++)i.__originalVertexNormals[e]?i.__originalVertexNormals[e].copy(i.vertexNormals[e]):i.__originalVertexNormals[e]=i.vertexNormals[e].clone();var a=new Ke;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)c=new b,l={a:new b,b:new b,c:new b},o.push(c),s.push(l)}var c,l,u=this.morphNormals[e];for(a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],c=u.faceNormals[n],l=u.vertexNormals[n],c.copy(i.normal),l.a.copy(i.vertexNormals[0]),l.b.copy(i.vertexNormals[1]),l.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)(i=this.faces[n]).normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pe),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Ie),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var r,i=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,c=e.faces,l=this.faceVertexUvs[0],u=e.faceVertexUvs[0],h=this.colors,d=e.colors;void 0===n&&(n=0),void 0!==t&&(r=(new w).getNormalMatrix(t));for(var p=0,f=o.length;p<f;p++){var m=o[p].clone();void 0!==t&&m.applyMatrix4(t),a.push(m)}for(p=0,f=d.length;p<f;p++)h.push(d[p].clone());for(p=0,f=c.length;p<f;p++){var g,y,v,b=c[p],A=b.vertexNormals,E=b.vertexColors;(g=new Ze(b.a+i,b.b+i,b.c+i)).normal.copy(b.normal),void 0!==r&&g.normal.applyMatrix3(r).normalize();for(var x=0,_=A.length;x<_;x++)y=A[x].clone(),void 0!==r&&y.applyMatrix3(r).normalize(),g.vertexNormals.push(y);g.color.copy(b.color);for(x=0,_=E.length;x<_;x++)v=E[x],g.vertexColors.push(v.clone());g.materialIndex=b.materialIndex+n,s.push(g)}for(p=0,f=u.length;p<f;p++){var S=u[p],M=[];if(void 0!==S){for(x=0,_=S.length;x<_;x++)M.push(S[x].clone());l.push(M)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,n,r,i,a,o,s,c={},l=[],u=[],h=Math.pow(10,4);for(n=0,r=this.vertices.length;n<r;n++)e=this.vertices[n],void 0===c[t=Math.round(e.x*h)+"_"+Math.round(e.y*h)+"_"+Math.round(e.z*h)]?(c[t]=n,l.push(this.vertices[n]),u[n]=l.length-1):u[n]=u[c[t]];var d=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=u[i.a],i.b=u[i.b],i.c=u[i.c],a=[i.a,i.b,i.c];for(var p=0;p<3;p++)if(a[p]===a[(p+1)%3]){d.push(n);break}}for(n=d.length-1;n>=0;n--){var f=d[n];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var m=this.vertices.length-l.length;return this.vertices=l,m},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new b(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));var r,i,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];a&&a.length===t&&(r=[]),o&&o.length===t&&(i=[]);for(n=0;n<t;n++){var s=e[n]._id;r&&r.push(a[s]),i&&i.push(o[s])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var r=[],i=0;i<this.vertices.length;i++){var a=this.vertices[i];r.push(a.x,a.y,a.z)}var o=[],s=[],c={},l=[],u={},h=[],d={};for(i=0;i<this.faces.length;i++){var p=this.faces[i],f=void 0!==this.faceVertexUvs[0][i],m=p.normal.length()>0,g=p.vertexNormals.length>0,y=1!==p.color.r||1!==p.color.g||1!==p.color.b,v=p.vertexColors.length>0,b=0;if(b=x(b,0,0),b=x(b,1,!0),b=x(b,2,!1),b=x(b,3,f),b=x(b,4,m),b=x(b,5,g),b=x(b,6,y),b=x(b,7,v),o.push(b),o.push(p.a,p.b,p.c),o.push(p.materialIndex),f){var w=this.faceVertexUvs[0][i];o.push(M(w[0]),M(w[1]),M(w[2]))}if(m&&o.push(_(p.normal)),g){var A=p.vertexNormals;o.push(_(A[0]),_(A[1]),_(A[2]))}if(y&&o.push(S(p.color)),v){var E=p.vertexColors;o.push(S(E[0]),S(E[1]),S(E[2]))}}function x(e,t,n){return n?e|1<<t:e&~(1<<t)}function _(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==c[t]||(c[t]=s.length/3,s.push(e.x,e.y,e.z)),c[t]}function S(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==u[t]||(u[t]=l.length,l.push(e.getHex())),u[t]}function M(e){var t=e.x.toString()+e.y.toString();return void 0!==d[t]||(d[t]=h.length/2,h.push(e.x,e.y)),d[t]}return e.data={},e.data.vertices=r,e.data.normals=s,l.length>0&&(e.data.colors=l),h.length>0&&(e.data.uvs=[h]),e.data.faces=o,e},clone:function(){return(new Ke).copy(this)},copy:function(e){var t,n,r,i,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var c=e.colors;for(t=0,n=c.length;t<n;t++)this.colors.push(c[t].clone());var l=e.faces;for(t=0,n=l.length;t<n;t++)this.faces.push(l[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var u=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),r=0,i=u.length;r<i;r++){var h=u[r],d=[];for(a=0,o=h.length;a<o;a++){var p=h[a];d.push(p.clone())}this.faceVertexUvs[t].push(d)}}var f=e.morphTargets;for(t=0,n=f.length;t<n;t++){var m={};if(m.name=f[t].name,void 0!==f[t].vertices)for(m.vertices=[],r=0,i=f[t].vertices.length;r<i;r++)m.vertices.push(f[t].vertices[r].clone());if(void 0!==f[t].normals)for(m.normals=[],r=0,i=f[t].normals.length;r<i;r++)m.normals.push(f[t].normals[r].clone());this.morphTargets.push(m)}var g=e.morphNormals;for(t=0,n=g.length;t<n;t++){var y={};if(void 0!==g[t].vertexNormals)for(y.vertexNormals=[],r=0,i=g[t].vertexNormals.length;r<i;r++){var v=g[t].vertexNormals[r],b={};b.a=v.a.clone(),b.b=v.b.clone(),b.c=v.c.clone(),y.vertexNormals.push(b)}if(void 0!==g[t].faceNormals)for(y.faceNormals=[],r=0,i=g[t].faceNormals.length;r<i;r++)y.faceNormals.push(g[t].faceNormals[r].clone());this.morphNormals.push(y)}var w=e.skinWeights;for(t=0,n=w.length;t<n;t++)this.skinWeights.push(w[t].clone());var A=e.skinIndices;for(t=0,n=A.length;t<n;t++)this.skinIndices.push(A[t].clone());var E=e.lineDistances;for(t=0,n=E.length;t<n;t++)this.lineDistances.push(E[t]);var x=e.boundingBox;null!==x&&(this.boundingBox=x.clone());var _=e.boundingSphere;return null!==_&&(this.boundingSphere=_.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Qe.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Qe.prototype,{isBufferAttribute:!0,setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==e?e.length/this.itemSize:0,this.array=e},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.dynamic=e.dynamic,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new fe),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyIndicesArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];t[n++]=a.a,t[n++]=a.b,t[n++]=a.c}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new g),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new b),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new x),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),$e.prototype=Object.create(Qe.prototype),$e.prototype.constructor=$e,et.prototype=Object.create(Qe.prototype),et.prototype.constructor=et,tt.prototype=Object.create(Qe.prototype),tt.prototype.constructor=tt,nt.prototype=Object.create(Qe.prototype),nt.prototype.constructor=nt,rt.prototype=Object.create(Qe.prototype),rt.prototype.constructor=rt,it.prototype=Object.create(Qe.prototype),it.prototype.constructor=it,at.prototype=Object.create(Qe.prototype),at.prototype.constructor=at,ot.prototype=Object.create(Qe.prototype),ot.prototype.constructor=ot,st.prototype=Object.create(Qe.prototype),st.prototype.constructor=st,Object.assign(ct.prototype,{computeGroups:function(e){for(var t,n=[],r=void 0,i=e.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==r&&(r=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,n.push(t)),t={start:3*a,materialIndex:r})}void 0!==t&&(t.count=3*a-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,r=e.vertices,i=e.faceVertexUvs,a=i[0]&&i[0].length>0,o=i[1]&&i[1].length>0,s=e.morphTargets,c=s.length;if(c>0){t=[];for(var l=0;l<c;l++)t[l]=[];this.morphTargets.position=t}var u,h=e.morphNormals,d=h.length;if(d>0){u=[];for(l=0;l<d;l++)u[l]=[];this.morphTargets.normal=u}var p=e.skinIndices,f=e.skinWeights,m=p.length===r.length,y=f.length===r.length;for(l=0;l<n.length;l++){var v=n[l];this.vertices.push(r[v.a],r[v.b],r[v.c]);var b=v.vertexNormals;if(3===b.length)this.normals.push(b[0],b[1],b[2]);else{var w=v.normal;this.normals.push(w,w,w)}var A,E=v.vertexColors;if(3===E.length)this.colors.push(E[0],E[1],E[2]);else{var x=v.color;this.colors.push(x,x,x)}if(!0===a)void 0!==(A=i[0][l])?this.uvs.push(A[0],A[1],A[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new g,new g,new g));if(!0===o)void 0!==(A=i[1][l])?this.uvs2.push(A[0],A[1],A[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new g,new g,new g));for(var _=0;_<c;_++){var S=s[_].vertices;t[_].push(S[v.a],S[v.b],S[v.c])}for(_=0;_<d;_++){var M=h[_].vertexNormals[l];u[_].push(M.a,M.b,M.c)}m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),y&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}});var ut,ht,dt,pt,ft,mt,gt,yt=1;function vt(){Object.defineProperty(this,"id",{value:yt+=2}),this.uuid=m.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0}}function bt(e,t,n,r,i,a){Ke.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a},this.fromBufferGeometry(new wt(e,t,n,r,i,a)),this.mergeVertices()}function wt(e,t,n,r,i,a){vt.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};var o=this;e=e||1,t=t||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1,a=Math.floor(a)||1;var s=[],c=[],l=[],u=[],h=0,d=0;function p(e,t,n,r,i,a,p,f,m,g,y){var v,w,A=a/m,E=p/g,x=a/2,_=p/2,S=f/2,M=m+1,T=g+1,R=0,k=0,C=new b;for(w=0;w<T;w++){var O=w*E-_;for(v=0;v<M;v++){var P=v*A-x;C[e]=P*r,C[t]=O*i,C[n]=S,c.push(C.x,C.y,C.z),C[e]=0,C[t]=0,C[n]=f>0?1:-1,l.push(C.x,C.y,C.z),u.push(v/m),u.push(1-w/g),R+=1}}for(w=0;w<g;w++)for(v=0;v<m;v++){var I=h+v+M*w,N=h+v+M*(w+1),L=h+(v+1)+M*(w+1),D=h+(v+1)+M*w;s.push(I,N,D),s.push(N,L,D),k+=6}o.addGroup(d,k,y),d+=k,h+=R}p("z","y","x",-1,-1,n,t,e,a,i,0),p("z","y","x",1,-1,n,t,-e,a,i,1),p("x","z","y",1,1,e,n,t,r,a,2),p("x","z","y",1,-1,e,n,-t,r,a,3),p("x","y","z",1,-1,e,t,n,r,i,4),p("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.addAttribute("position",new ot(c,3)),this.addAttribute("normal",new ot(l,3)),this.addAttribute("uv",new ot(u,2))}function At(e,t,n,r){Ke.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new Et(e,t,n,r)),this.mergeVertices()}function Et(e,t,n,r){vt.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};var i,a,o=(e=e||1)/2,s=(t=t||1)/2,c=Math.floor(n)||1,l=Math.floor(r)||1,u=c+1,h=l+1,d=e/c,p=t/l,f=[],m=[],g=[],y=[];for(a=0;a<h;a++){var v=a*p-s;for(i=0;i<u;i++){var b=i*d-o;m.push(b,-v,0),g.push(0,0,1),y.push(i/c),y.push(1-a/l)}}for(a=0;a<l;a++)for(i=0;i<c;i++){var w=i+u*a,A=i+u*(a+1),E=i+1+u*(a+1),x=i+1+u*a;f.push(w,A,x),f.push(A,E,x)}this.setIndex(f),this.addAttribute("position",new ot(m,3)),this.addAttribute("normal",new ot(g,3)),this.addAttribute("uv",new ot(y,2))}function xt(e){ke.call(this),this.type="MeshBasicMaterial",this.color=new fe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(e)}function _t(e){ke.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function St(e,t){this.origin=void 0!==e?e:new b,this.direction=void 0!==t?t:new b}function Mt(e,t){this.start=void 0!==e?e:new b,this.end=void 0!==t?t:new b}function Tt(e,t,n){this.a=void 0!==e?e:new b,this.b=void 0!==t?t:new b,this.c=void 0!==n?n:new b}function Rt(e,t){qe.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new xt({color:16777215*Math.random()}),this.drawMode=0,this.updateMorphTargets()}function kt(e,t,n,r){var i,a,o,s=new fe(0),c=0;function l(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,r)}return{getClearColor:function(){return s},setClearColor:function(e,t){s.set(e),l(s,c=void 0!==t?t:1)},getClearAlpha:function(){return c},setClearAlpha:function(e){l(s,c=e)},render:function(t,r,u,h){var d=r.background;null===d?l(s,c):d&&d.isColor&&(l(d,1),h=!0),(e.autoClear||h)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),d&&d.isCubeTexture?(void 0===o&&((o=new Rt(new wt(1,1,1),new _t({uniforms:ve.cube.uniforms,vertexShader:ve.cube.vertexShader,fragmentShader:ve.cube.fragmentShader,side:1,depthTest:!0,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),o.geometry.removeAttribute("uv"),o.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},n.update(o.geometry)),o.material.uniforms.tCube.value=d,t.push(o,o.geometry,o.material,0,null)):d&&d.isTexture&&(void 0===i&&(i=new Je(-1,1,1,-1,0,1),a=new Rt(new Et(2,2),new xt({depthTest:!1,depthWrite:!1,fog:!1})),n.update(a.geometry)),a.material.map=d,e.renderBufferDirect(i,null,a.geometry,a.material,a,null))}}}function Ct(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program&&t.program&&e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Ot(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Pt(){var e=[],t=0,n=[],r=[];return{opaque:n,transparent:r,init:function(){t=0,n.length=0,r.length=0},push:function(i,a,o,s,c){var l=e[t];void 0===l?(l={id:i.id,object:i,geometry:a,material:o,program:o.program,renderOrder:i.renderOrder,z:s,group:c},e[t]=l):(l.id=i.id,l.object=i,l.geometry=a,l.material=o,l.program=o.program,l.renderOrder=i.renderOrder,l.z=s,l.group=c),(!0===o.transparent?r:n).push(l),t++},sort:function(){n.length>1&&n.sort(Ct),r.length>1&&r.sort(Ot)}}}function It(){var e={};return{get:function(t,n){var r=t.id+","+n.id,i=e[r];return void 0===i&&(i=new Pt,e[r]=i),i},dispose:function(){e={}}}}function Nt(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Lt(e){var t={},n=new Float32Array(8);return{update:function(r,i,a,o){var s=r.morphTargetInfluences,c=s.length,l=t[i.id];if(void 0===l){l=[];for(var u=0;u<c;u++)l[u]=[u,0];t[i.id]=l}var h=a.morphTargets&&i.morphAttributes.position,d=a.morphNormals&&i.morphAttributes.normal;for(u=0;u<c;u++){0!==(p=l[u])[1]&&(h&&i.removeAttribute("morphTarget"+u),d&&i.removeAttribute("morphNormal"+u))}for(u=0;u<c;u++){(p=l[u])[0]=u,p[1]=s[u]}for(l.sort(Nt),u=0;u<8;u++){var p;if(p=l[u]){var f=p[0],m=p[1];if(m){h&&i.addAttribute("morphTarget"+u,h[f]),d&&i.addAttribute("morphNormal"+u,d[f]),n[u]=m;continue}}n[u]=0}o.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function Dt(e,t,n){var r,i,a;this.setMode=function(e){r=e},this.setIndex=function(e){i=e.type,a=e.bytesPerElement},this.render=function(t,o){e.drawElements(r,o,i,t*a),n.calls++,n.vertices+=o,r===e.TRIANGLES?n.faces+=o/3:r===e.POINTS&&(n.points+=o)},this.renderInstances=function(o,s,c){var l=t.get("ANGLE_instanced_arrays");null!==l?(l.drawElementsInstancedANGLE(r,c,i,s*a,o.maxInstancedCount),n.calls++,n.vertices+=c*o.maxInstancedCount,r===e.TRIANGLES?n.faces+=o.maxInstancedCount*c/3:r===e.POINTS&&(n.points+=o.maxInstancedCount*c)):console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function Ft(e,t,n){var r;this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.calls++,n.vertices+=i,r===e.TRIANGLES?n.faces+=i/3:r===e.POINTS&&(n.points+=i)},this.renderInstances=function(i,a,o){var s=t.get("ANGLE_instanced_arrays");if(null!==s){var c=i.attributes.position;c.isInterleavedBufferAttribute?(o=c.data.count,s.drawArraysInstancedANGLE(r,0,o,i.maxInstancedCount)):s.drawArraysInstancedANGLE(r,a,o,i.maxInstancedCount),n.calls++,n.vertices+=o*i.maxInstancedCount,r===e.TRIANGLES?n.faces+=i.maxInstancedCount*o/3:r===e.POINTS&&(n.points+=i.maxInstancedCount*o)}else console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function jt(e,t,n){var r={},i={};function a(e){var o=e.target,s=r[o.id];for(var c in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[c]);o.removeEventListener("dispose",a),delete r[o.id];var l=i[o.id];l&&(t.remove(l),delete i[o.id]),(l=i[s.id])&&(t.remove(l),delete i[s.id]),n.geometries--}return{get:function(e,t){var i=r[t.id];return i||(t.addEventListener("dispose",a),t.isBufferGeometry?i=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new vt).setFromObject(e)),i=t._bufferGeometry),r[t.id]=i,n.geometries++,i)},update:function(n){var r=n.index,i=n.attributes;for(var a in null!==r&&t.update(r,e.ELEMENT_ARRAY_BUFFER),i)t.update(i[a],e.ARRAY_BUFFER);var o=n.morphAttributes;for(var a in o)for(var s=o[a],c=0,l=s.length;c<l;c++)t.update(s[c],e.ARRAY_BUFFER)},getWireframeAttribute:function(n){var r=i[n.id];if(r)return r;var a,o=[],s=n.index,c=n.attributes;if(null!==s)for(var l=0,u=(a=s.array).length;l<u;l+=3){var h=a[l+0],d=a[l+1],p=a[l+2];o.push(h,d,d,p,p,h)}else for(l=0,u=(a=c.position.array).length/3-1;l<u;l+=3){h=l+0,d=l+1,p=l+2;o.push(h,d,d,p,p,h)}return r=new(lt(o)>65535?at:rt)(o,1),t.update(r,e.ELEMENT_ARRAY_BUFFER),i[n.id]=r,r}}}function Ut(e,t){var n={};return{update:function(r){var i=t.frame,a=r.geometry,o=e.get(r,a);return n[o.id]!==i&&(a.isGeometry&&o.updateFromObject(r),e.update(o),n[o.id]=i),o},dispose:function(){n={}}}}function Bt(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),!1===e.getShaderParameter(r,e.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(r)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",t===e.VERTEX_SHADER?"vertex":"fragment",e.getShaderInfoLog(r),function(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}(n)),r}vt.prototype=Object.assign(Object.create(a.prototype),{constructor:vt,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(lt(e)>65535?at:rt)(e,1):this.index=e},addAttribute:function(e,t){return t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(t)):(this.attributes[e]=t,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(e,new Qe(arguments[1],arguments[2])))},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new w).getNormalMatrix(e).applyToBufferAttribute(n),n.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var e=new y;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new y;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new y;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new y;return function(t,n,r){return e.makeTranslation(t,n,r),this.applyMatrix(e),this}}(),scale:function(){var e=new y;return function(t,n,r){return e.makeScale(t,n,r),this.applyMatrix(e),this}}(),lookAt:function(){var e=new qe;return function(t){e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new ot(3*t.vertices.length,3),r=new ot(3*t.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(t.vertices)),this.addAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new ot(t.lineDistances.length,1);this.addAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.addAttribute("position",new ot(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(t=this.attributes.position)&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(t=this.attributes.normal)&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(t=this.attributes.color)&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(t=this.attributes.uv)&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(t=this.attributes.lineDistance)&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new ct).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.addAttribute("position",new Qe(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.addAttribute("normal",new Qe(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.addAttribute("color",new Qe(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new Qe(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new Qe(a,2).copyVector2sArray(e.uvs2))}if(e.indices.length>0){var o=new(lt(e.indices)>65535?Uint32Array:Uint16Array)(3*e.indices.length);this.setIndex(new Qe(o,1).copyIndicesArray(e.indices))}for(var s in this.groups=e.groups,e.morphTargets){for(var c=[],l=e.morphTargets[s],u=0,h=l.length;u<h;u++){var d=l[u],p=new ot(3*d.length,3);c.push(p.copyVector3sArray(d))}this.morphAttributes[s]=c}if(e.skinIndices.length>0){var f=new ot(4*e.skinIndices.length,4);this.addAttribute("skinIndex",f.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var m=new ot(4*e.skinWeights.length,4);this.addAttribute("skinWeight",m.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pe);var e=this.attributes.position;void 0!==e?this.boundingBox.setFromBufferAttribute(e):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var e=new Pe,t=new b;return function(){null===this.boundingSphere&&(this.boundingSphere=new Ie);var n=this.attributes.position;if(n){var r=this.boundingSphere.center;e.setFromBufferAttribute(n),e.getCenter(r);for(var i=0,a=0,o=n.count;a<o;a++)t.x=n.getX(a),t.y=n.getY(a),t.z=n.getZ(a),i=Math.max(i,r.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes,n=this.groups;if(t.position){var r=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new Qe(new Float32Array(r.length),3));else for(var i=t.normal.array,a=0,o=i.length;a<o;a++)i[a]=0;var s,c,l,u=t.normal.array,h=new b,d=new b,p=new b,f=new b,m=new b;if(e){var g=e.array;0===n.length&&this.addGroup(0,g.length);for(var y=0,v=n.length;y<v;++y){var w=n[y],A=w.start;for(a=A,o=A+w.count;a<o;a+=3)s=3*g[a+0],c=3*g[a+1],l=3*g[a+2],h.fromArray(r,s),d.fromArray(r,c),p.fromArray(r,l),f.subVectors(p,d),m.subVectors(h,d),f.cross(m),u[s]+=f.x,u[s+1]+=f.y,u[s+2]+=f.z,u[c]+=f.x,u[c+1]+=f.y,u[c+2]+=f.z,u[l]+=f.x,u[l+1]+=f.y,u[l+2]+=f.z}}else for(a=0,o=r.length;a<o;a+=9)h.fromArray(r,a),d.fromArray(r,a+3),p.fromArray(r,a+6),f.subVectors(p,d),m.subVectors(h,d),f.cross(m),u[a]=f.x,u[a+1]=f.y,u[a+2]=f.z,u[a+3]=f.x,u[a+4]=f.y,u[a+5]=f.z,u[a+6]=f.x,u[a+7]=f.y,u[a+8]=f.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0);var n=this.attributes;for(var r in n)if(void 0!==e.attributes[r])for(var i=n[r].array,a=e.attributes[r],o=a.array,s=0,c=a.itemSize*t;s<o.length;s++,c++)i[c]=o[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){var e=new b;return function(){for(var t=this.attributes.normal,n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.normalize(),t.setXYZ(n,e.x,e.y,e.z)}}(),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new vt,t=this.index.array,n=this.attributes;for(var r in n){for(var i=n[r],a=i.array,o=i.itemSize,s=new a.constructor(t.length*o),c=0,l=0,u=0,h=t.length;u<h;u++){c=t[u]*o;for(var d=0;d<o;d++)s[l++]=a[c++]}e.addAttribute(r,new Qe(s,o))}return e},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;if(null!==r){var i=Array.prototype.slice.call(r.array);e.data.index={type:r.array.constructor.name,array:i}}var a=this.attributes;for(var n in a){var o=a[n];i=Array.prototype.slice.call(o.array);e.data.attributes[n]={itemSize:o.itemSize,type:o.array.constructor.name,array:i,normalized:o.normalized}}var s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),e},clone:function(){return(new vt).copy(this)},copy:function(e){var t,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone());var a=e.attributes;for(t in a){var o=a[t];this.addAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var c=[],l=s[t];for(n=0,r=l.length;n<r;n++)c.push(l[n].clone());this.morphAttributes[t]=c}var u=e.groups;for(n=0,r=u.length;n<r;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var d=e.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=e.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),bt.prototype=Object.create(Ke.prototype),bt.prototype.constructor=bt,wt.prototype=Object.create(vt.prototype),wt.prototype.constructor=wt,At.prototype=Object.create(Ke.prototype),At.prototype.constructor=At,Et.prototype=Object.create(vt.prototype),Et.prototype.constructor=Et,xt.prototype=Object.create(ke.prototype),xt.prototype.constructor=xt,xt.prototype.isMeshBasicMaterial=!0,xt.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},_t.prototype=Object.create(ke.prototype),_t.prototype.constructor=_t,_t.prototype.isShaderMaterial=!0,_t.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ge.clone(e.uniforms),this.defines=e.defines,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},_t.prototype.toJSON=function(e){var t=ke.prototype.toJSON.call(this,e);return t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},Object.assign(St.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return(t||new b).copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(){var e=new b;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var n=t||new b;n.subVectors(e,this.origin);var r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new b;return function(t){var n=e.subVectors(t,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(n).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:(ht=new b,dt=new b,pt=new b,function(e,t,n,r){ht.copy(e).add(t).multiplyScalar(.5),dt.copy(t).sub(e).normalize(),pt.copy(this.origin).sub(ht);var i,a,o,s,c=.5*e.distanceTo(t),l=-this.direction.dot(dt),u=pt.dot(this.direction),h=-pt.dot(dt),d=pt.lengthSq(),p=Math.abs(1-l*l);if(p>0)if(a=l*u-h,s=c*p,(i=l*h-u)>=0)if(a>=-s)if(a<=s){var f=1/p;o=(i*=f)*(i+l*(a*=f)+2*u)+a*(l*i+a+2*h)+d}else a=c,o=-(i=Math.max(0,-(l*a+u)))*i+a*(a+2*h)+d;else a=-c,o=-(i=Math.max(0,-(l*a+u)))*i+a*(a+2*h)+d;else a<=-s?o=-(i=Math.max(0,-(-l*c+u)))*i+(a=i>0?-c:Math.min(Math.max(-c,-h),c))*(a+2*h)+d:a<=s?(i=0,o=(a=Math.min(Math.max(-c,-h),c))*(a+2*h)+d):o=-(i=Math.max(0,-(l*c+u)))*i+(a=i>0?c:Math.min(Math.max(-c,-h),c))*(a+2*h)+d;else a=l>0?-c:c,o=-(i=Math.max(0,-(l*a+u)))*i+a*(a+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(dt).multiplyScalar(a).add(ht),o}),intersectSphere:function(){var e=new b;return function(t,n){e.subVectors(t.center,this.origin);var r=e.dot(this.direction),i=e.dot(e)-r*r,a=t.radius*t.radius;if(i>a)return null;var o=Math.sqrt(a-i),s=r-o,c=r+o;return s<0&&c<0?null:s<0?this.at(c,n):this.at(s,n)}}(),intersectsSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(n=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(n=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),l>=0?(i=(e.min.y-h.y)*l,a=(e.max.y-h.y)*l):(i=(e.max.y-h.y)*l,a=(e.min.y-h.y)*l),n>a||i>r?null:((i>n||n!=n)&&(n=i),(a<r||r!=r)&&(r=a),u>=0?(o=(e.min.z-h.z)*u,s=(e.max.z-h.z)*u):(o=(e.max.z-h.z)*u,s=(e.min.z-h.z)*u),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,t)))},intersectsBox:(ut=new b,function(e){return null!==this.intersectBox(e,ut)}),intersectTriangle:function(){var e=new b,t=new b,n=new b,r=new b;return function(i,a,o,s,c){t.subVectors(a,i),n.subVectors(o,i),r.crossVectors(t,n);var l,u=this.direction.dot(r);if(u>0){if(s)return null;l=1}else{if(!(u<0))return null;l=-1,u=-u}e.subVectors(this.origin,i);var h=l*this.direction.dot(n.crossVectors(e,n));if(h<0)return null;var d=l*this.direction.dot(t.cross(e));if(d<0)return null;if(h+d>u)return null;var p=-l*e.dot(r);return p<0?null:this.at(p/u,c)}}(),applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}),Object.assign(Mt.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return(e||new b).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return(e||new b).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var n=t||new b;return this.delta(n).multiplyScalar(e).add(this.start)},closestPointToPointParameter:(ft=new b,mt=new b,function(e,t){ft.subVectors(e,this.start),mt.subVectors(this.end,this.start);var n=mt.dot(mt),r=mt.dot(ft)/n;return t&&(r=m.clamp(r,0,1)),r}),closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t),i=n||new b;return this.delta(i).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),Object.assign(Tt,{normal:(gt=new b,function(e,t,n,r){var i=r||new b;i.subVectors(n,t),gt.subVectors(e,t),i.cross(gt);var a=i.lengthSq();return a>0?i.multiplyScalar(1/Math.sqrt(a)):i.set(0,0,0)}),barycoordFromPoint:function(){var e=new b,t=new b,n=new b;return function(r,i,a,o,s){e.subVectors(o,i),t.subVectors(a,i),n.subVectors(r,i);var c=e.dot(e),l=e.dot(t),u=e.dot(n),h=t.dot(t),d=t.dot(n),p=c*h-l*l,f=s||new b;if(0===p)return f.set(-2,-1,-1);var m=1/p,g=(h*u-l*d)*m,y=(c*d-l*u)*m;return f.set(1-g-y,y,g)}}(),containsPoint:function(){var e=new b;return function(t,n,r,i){var a=Tt.barycoordFromPoint(t,n,r,i,e);return a.x>=0&&a.y>=0&&a.x+a.y<=1}}()}),Object.assign(Tt.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new b,t=new b;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),midpoint:function(e){return(e||new b).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return Tt.normal(this.a,this.b,this.c,e)},plane:function(e){return(e||new Ne).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return Tt.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return Tt.containsPoint(e,this.a,this.b,this.c)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(){var e=new Ne,t=[new Mt,new Mt,new Mt],n=new b,r=new b;return function(i,a){var o=a||new b,s=1/0;if(e.setFromCoplanarPoints(this.a,this.b,this.c),e.projectPoint(i,n),!0===this.containsPoint(n))o.copy(n);else{t[0].set(this.a,this.b),t[1].set(this.b,this.c),t[2].set(this.c,this.a);for(var c=0;c<t.length;c++){t[c].closestPointToPoint(n,!0,r);var l=n.distanceToSquared(r);l<s&&(s=l,o.copy(r))}}return o}}(),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}),Rt.prototype=Object.assign(Object.create(qe.prototype),{constructor:Rt,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return qe.prototype.copy.call(this,e),this.drawMode=e.drawMode,void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;if(void 0!==s&&s.length>0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=s.length;e<t;e++)n=s[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}},raycast:function(){var e=new y,t=new St,n=new Ie,r=new b,i=new b,a=new b,o=new b,s=new b,c=new b,l=new g,u=new g,h=new g,d=new b,p=new b,f=new b;function m(e,t,n,r,i,a,o){return Tt.barycoordFromPoint(e,t,n,r,d),i.multiplyScalar(d.x),a.multiplyScalar(d.y),o.multiplyScalar(d.z),i.add(a).add(o),i.clone()}function v(e,t,n,r,i,a,o,s){if(null===(1===t.side?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,2!==t.side,s)))return null;f.copy(s),f.applyMatrix4(e.matrixWorld);var c=n.ray.origin.distanceTo(f);return c<n.near||c>n.far?null:{distance:c,point:f.clone(),object:e}}function w(e,t,n,o,s,c,d,f){r.fromBufferAttribute(o,c),i.fromBufferAttribute(o,d),a.fromBufferAttribute(o,f);var g=v(e,e.material,t,n,r,i,a,p);return g&&(s&&(l.fromBufferAttribute(s,c),u.fromBufferAttribute(s,d),h.fromBufferAttribute(s,f),g.uv=m(p,r,i,a,l,u,h)),g.face=new Ze(c,d,f,Tt.normal(r,i,a)),g.faceIndex=c),g}return function(d,f){var g,y=this.geometry,b=this.material,A=this.matrixWorld;if(void 0!==b&&(null===y.boundingSphere&&y.computeBoundingSphere(),n.copy(y.boundingSphere),n.applyMatrix4(A),!1!==d.ray.intersectsSphere(n)&&(e.getInverse(A),t.copy(d.ray).applyMatrix4(e),null===y.boundingBox||!1!==t.intersectsBox(y.boundingBox))))if(y.isBufferGeometry){var E,x,_,S,M,T=y.index,R=y.attributes.position,k=y.attributes.uv;if(null!==T)for(S=0,M=T.count;S<M;S+=3)E=T.getX(S),x=T.getX(S+1),_=T.getX(S+2),(g=w(this,d,t,R,k,E,x,_))&&(g.faceIndex=Math.floor(S/3),f.push(g));else if(void 0!==R)for(S=0,M=R.count;S<M;S+=3)(g=w(this,d,t,R,k,E=S,x=S+1,_=S+2))&&(g.index=E,f.push(g))}else if(y.isGeometry){var C,O,P,I,N=Array.isArray(b),L=y.vertices,D=y.faces,F=y.faceVertexUvs[0];F.length>0&&(I=F);for(var j=0,U=D.length;j<U;j++){var B=D[j],V=N?b[B.materialIndex]:b;if(void 0!==V){if(C=L[B.a],O=L[B.b],P=L[B.c],!0===V.morphTargets){var z=y.morphTargets,H=this.morphTargetInfluences;r.set(0,0,0),i.set(0,0,0),a.set(0,0,0);for(var G=0,q=z.length;G<q;G++){var W=H[G];if(0!==W){var J=z[G].vertices;r.addScaledVector(o.subVectors(J[B.a],C),W),i.addScaledVector(s.subVectors(J[B.b],O),W),a.addScaledVector(c.subVectors(J[B.c],P),W)}}r.add(C),i.add(O),a.add(P),C=r,O=i,P=a}if(g=v(this,V,d,t,C,O,P,p)){if(I&&I[j]){var Z=I[j];l.copy(Z[0]),u.copy(Z[1]),h.copy(Z[2]),g.uv=m(p,C,O,P,l,u,h)}g.face=B,g.faceIndex=j,f.push(g)}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Vt=0;function zt(e){switch(e){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+e)}}function Ht(e,t){var n=zt(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Gt(e,t){var n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Uncharted2";break;case 4:n="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function qt(e){return""!==e}function Wt(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights)}function Jt(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function Zt(e){return e.replace(/^[ \t]*#include +<([\w\d.]+)>/gm,(function(e,t){var n=ye[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Zt(n)}))}function Xt(e){return e.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,(function(e,t,n,r){for(var i="",a=parseInt(t);a<parseInt(n);a++)i+=r.replace(/\[ i \]/g,"[ "+a+" ]");return i}))}function Yt(e,t,n,r,i,a){var o=e.context,s=r.defines,c=i.vertexShader,l=i.fragmentShader,u="SHADOWMAP_TYPE_BASIC";1===a.shadowMapType?u="SHADOWMAP_TYPE_PCF":2===a.shadowMapType&&(u="SHADOWMAP_TYPE_PCF_SOFT");var h="ENVMAP_TYPE_CUBE",d="ENVMAP_MODE_REFLECTION",p="ENVMAP_BLENDING_MULTIPLY";if(a.envMap){switch(r.envMap.mapping){case 301:case 302:h="ENVMAP_TYPE_CUBE";break;case 306:case 307:h="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:h="ENVMAP_TYPE_EQUIREC";break;case 305:h="ENVMAP_TYPE_SPHERE"}switch(r.envMap.mapping){case 302:case 304:d="ENVMAP_MODE_REFRACTION"}switch(r.combine){case 0:p="ENVMAP_BLENDING_MULTIPLY";break;case 1:p="ENVMAP_BLENDING_MIX";break;case 2:p="ENVMAP_BLENDING_ADD"}}var f,m,g,y,v,b=e.gammaFactor>0?e.gammaFactor:1,w=function(e,t,n){return[(e=e||{}).derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(qt).join("\n")}(r.extensions,a,t),A=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),E=o.createProgram();r.isRawShaderMaterial?((f=[A].filter(qt).join("\n")).length>0&&(f+="\n"),(m=[w,A].filter(qt).join("\n")).length>0&&(m+="\n")):(f=["precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,A,a.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+b,"#define MAX_BONES "+a.maxBones,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+d:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.displacementMap&&a.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexColors?"#define USE_COLOR":"",a.flatShading?"#define FLAT_SHADED":"",a.skinning?"#define USE_SKINNING":"",a.useVertexTexture?"#define BONE_TEXTURE":"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals&&!1===a.flatShading?"#define USE_MORPHNORMALS":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+u:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(qt).join("\n"),m=[w,"precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,A,a.alphaTest?"#define ALPHATEST "+a.alphaTest:"","#define GAMMA_FACTOR "+b,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+h:"",a.envMap?"#define "+d:"",a.envMap?"#define "+p:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexColors?"#define USE_COLOR":"",a.gradientMap?"#define USE_GRADIENTMAP":"",a.flatShading?"#define FLAT_SHADED":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+u:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",a.envMap&&t.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",0!==a.toneMapping?"#define TONE_MAPPING":"",0!==a.toneMapping?ye.tonemapping_pars_fragment:"",0!==a.toneMapping?Gt("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.outputEncoding||a.mapEncoding||a.envMapEncoding||a.emissiveMapEncoding?ye.encodings_pars_fragment:"",a.mapEncoding?Ht("mapTexelToLinear",a.mapEncoding):"",a.envMapEncoding?Ht("envMapTexelToLinear",a.envMapEncoding):"",a.emissiveMapEncoding?Ht("emissiveMapTexelToLinear",a.emissiveMapEncoding):"",a.outputEncoding?(g="linearToOutputTexel",y=a.outputEncoding,v=zt(y),"vec4 "+g+"( vec4 value ) { return LinearTo"+v[0]+v[1]+"; }"):"",a.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(qt).join("\n")),c=Jt(c=Wt(c=Zt(c),a),a),l=Jt(l=Wt(l=Zt(l),a),a);var x=f+(c=Xt(c)),_=m+(l=Xt(l)),S=Bt(o,o.VERTEX_SHADER,x),M=Bt(o,o.FRAGMENT_SHADER,_);o.attachShader(E,S),o.attachShader(E,M),void 0!==r.index0AttributeName?o.bindAttribLocation(E,0,r.index0AttributeName):!0===a.morphTargets&&o.bindAttribLocation(E,0,"position"),o.linkProgram(E);var T,R,k=o.getProgramInfoLog(E).trim(),C=o.getShaderInfoLog(S).trim(),O=o.getShaderInfoLog(M).trim(),P=!0,I=!0;return!1===o.getProgramParameter(E,o.LINK_STATUS)?(P=!1,console.error("THREE.WebGLProgram: shader error: ",o.getError(),"gl.VALIDATE_STATUS",o.getProgramParameter(E,o.VALIDATE_STATUS),"gl.getProgramInfoLog",k,C,O)):""!==k?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",k):""!==C&&""!==O||(I=!1),I&&(this.diagnostics={runnable:P,material:r,programLog:k,vertexShader:{log:C,prefix:f},fragmentShader:{log:O,prefix:m}}),o.deleteShader(S),o.deleteShader(M),this.getUniforms=function(){return void 0===T&&(T=new de(o,E,e)),T},this.getAttributes=function(){return void 0===R&&(R=function(e,t){for(var n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),i=0;i<r;i++){var a=e.getActiveAttrib(t,i).name;n[a]=e.getAttribLocation(t,a)}return n}(o,E)),R},this.destroy=function(){o.deleteProgram(E),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=Vt++,this.code=n,this.usedTimes=1,this.program=E,this.vertexShader=S,this.fragmentShader=M,this}function Kt(e,t,n){var r=[],i={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow"},a=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function o(e,t){var n;return e?e.isTexture?n=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=e.texture.encoding):n=3e3,3e3===n&&t&&(n=3007),n}this.getParameters=function(t,r,a,s,c,l,u){var h=i[t.type],d=u.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(n.floatVertexTextures)return 1024;var r=n.maxVertexUniforms,i=Math.floor((r-20)/4),a=Math.min(i,t.length);return a<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+a+"."),0):a}(u):0,p=n.precision;null!==t.precision&&(p=n.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",p,"instead.");var f=e.getRenderTarget();return{shaderID:h,precision:p,supportsVertexTextures:n.vertexTextures,outputEncoding:o(f?f.texture:null,e.gammaOutput),map:!!t.map,mapEncoding:o(t.map,e.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:o(t.envMap,e.gammaInput),envMapCubeUV:!!t.envMap&&(306===t.envMap.mapping||307===t.envMap.mapping),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:o(t.emissiveMap,e.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,combine:t.combine,vertexColors:t.vertexColors,fog:!!s,useFog:t.fog,fogExp:s&&s.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:n.logarithmicDepthBuffer,skinning:t.skinning&&d>0,maxBones:d,useVertexTexture:n.floatVertexTextures,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numClippingPlanes:c,numClipIntersection:l,dithering:t.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.receiveShadow&&a.length>0,shadowMapType:e.shadowMap.type,toneMapping:e.toneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:2===t.side,flipSided:1===t.side,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCode=function(t,n){var r=[];if(n.shaderID?r.push(n.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(var i in t.defines)r.push(i),r.push(t.defines[i]);for(var o=0;o<a.length;o++)r.push(n[a[o]]);return r.push(t.onBeforeCompile.toString()),r.push(e.gammaOutput),r.join()},this.acquireProgram=function(n,i,a,o){for(var s,c=0,l=r.length;c<l;c++){var u=r[c];if(u.code===o){++(s=u).usedTimes;break}}return void 0===s&&(s=new Yt(e,t,o,n,i,a),r.push(s)),s},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=r.indexOf(e);r[t]=r[r.length-1],r.pop(),e.destroy()}},this.programs=r}function Qt(e,t,n,r,i,a,o,s){var c,l="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,u={};function h(e,t){if(e.width>t||e.height>t){var n=t/Math.max(e.width,e.height),r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.width=Math.floor(e.width*n),r.height=Math.floor(e.height*n),r.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,r.width,r.height),console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+r.width+"x"+r.height,e),r}return e}function d(e){return m.isPowerOfTwo(e.width)&&m.isPowerOfTwo(e.height)}function p(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function f(t){return 1003===t||1004===t||1005===t?e.NEAREST:e.LINEAR}function g(t){var n=t.target;n.removeEventListener("dispose",g),function(t){var n=r.get(t);if(t.image&&n.__image__webglTextureCube)e.deleteTexture(n.__image__webglTextureCube);else{if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture)}r.remove(t)}(n),n.isVideoTexture&&delete u[n.id],o.textures--}function y(t){var n=t.target;n.removeEventListener("dispose",y),function(t){var n=r.get(t),i=r.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLRenderTargetCube)for(var a=0;a<6;a++)e.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[a]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);r.remove(t.texture),r.remove(t)}(n),o.textures--}function v(t,f){var y=r.get(t);if(t.isVideoTexture&&function(e){var t=e.id,n=s.frame;u[t]!==n&&(u[t]=n,e.update())}(t),t.version>0&&y.__version!==t.version){var v=t.image;if(void 0===v)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else{if(!1!==v.complete)return void function(t,r,s){void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",g),t.__webglTexture=e.createTexture(),o.textures++);n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_2D,t.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,r.unpackAlignment);var u=h(r.image,i.maxTextureSize);(function(e){return 1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter})(r)&&!1===d(u)&&(u=function(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageBitmap?(void 0===c&&(c=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),c.width=m.floorPowerOfTwo(e.width),c.height=m.floorPowerOfTwo(e.height),c.getContext("2d").drawImage(e,0,0,c.width,c.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+e.width+"x"+e.height+"). Resized to "+c.width+"x"+c.height,e),c):e}(u));var f=d(u),y=a.convert(r.format),v=a.convert(r.type);b(e.TEXTURE_2D,r,f);var w,A=r.mipmaps;if(r.isDepthTexture){var E=e.DEPTH_COMPONENT;if(1015===r.type){if(!l)throw new Error("Float Depth Texture only supported in WebGL2.0");E=e.DEPTH_COMPONENT32F}else l&&(E=e.DEPTH_COMPONENT16);1026===r.format&&E===e.DEPTH_COMPONENT&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,v=a.convert(r.type)),1027===r.format&&(E=e.DEPTH_STENCIL,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,v=a.convert(r.type))),n.texImage2D(e.TEXTURE_2D,0,E,u.width,u.height,0,y,v,null)}else if(r.isDataTexture)if(A.length>0&&f){for(var x=0,_=A.length;x<_;x++)w=A[x],n.texImage2D(e.TEXTURE_2D,x,y,w.width,w.height,0,y,v,w.data);r.generateMipmaps=!1}else n.texImage2D(e.TEXTURE_2D,0,y,u.width,u.height,0,y,v,u.data);else if(r.isCompressedTexture)for(x=0,_=A.length;x<_;x++)w=A[x],1023!==r.format&&1022!==r.format?n.getCompressedTextureFormats().indexOf(y)>-1?n.compressedTexImage2D(e.TEXTURE_2D,x,y,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(e.TEXTURE_2D,x,y,w.width,w.height,0,y,v,w.data);else if(A.length>0&&f){for(x=0,_=A.length;x<_;x++)w=A[x],n.texImage2D(e.TEXTURE_2D,x,y,y,v,w);r.generateMipmaps=!1}else n.texImage2D(e.TEXTURE_2D,0,y,y,v,u);p(r,f)&&e.generateMipmap(e.TEXTURE_2D);t.__version=r.version,r.onUpdate&&r.onUpdate(r)}(y,t,f);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t)}}n.activeTexture(e.TEXTURE0+f),n.bindTexture(e.TEXTURE_2D,y.__webglTexture)}function b(n,o,s){var c;if(s?(e.texParameteri(n,e.TEXTURE_WRAP_S,a.convert(o.wrapS)),e.texParameteri(n,e.TEXTURE_WRAP_T,a.convert(o.wrapT)),e.texParameteri(n,e.TEXTURE_MAG_FILTER,a.convert(o.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,a.convert(o.minFilter))):(e.texParameteri(n,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(n,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),1001===o.wrapS&&1001===o.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",o),e.texParameteri(n,e.TEXTURE_MAG_FILTER,f(o.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,f(o.minFilter)),1003!==o.minFilter&&1006!==o.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",o)),c=t.get("EXT_texture_filter_anisotropic")){if(1015===o.type&&null===t.get("OES_texture_float_linear"))return;if(1016===o.type&&null===t.get("OES_texture_half_float_linear"))return;(o.anisotropy>1||r.get(o).__currentAnisotropy)&&(e.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function w(t,i,o,s){var c=a.convert(i.texture.format),l=a.convert(i.texture.type);n.texImage2D(s,0,c,i.width,i.height,0,c,l,null),e.bindFramebuffer(e.FRAMEBUFFER,t),e.framebufferTexture2D(e.FRAMEBUFFER,o,s,r.get(i.texture).__webglTexture,0),e.bindFramebuffer(e.FRAMEBUFFER,null)}function A(t,n){e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)):n.depthBuffer&&n.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)):e.renderbufferStorage(e.RENDERBUFFER,e.RGBA4,n.width,n.height),e.bindRenderbuffer(e.RENDERBUFFER,null)}function E(t){var n=r.get(t),i=!0===t.isWebGLRenderTargetCube;if(t.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(e.FRAMEBUFFER,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),v(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(1026===n.depthTexture.format)e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,i,0);else{if(1027!==n.depthTexture.format)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,i,0)}}(n.__webglFramebuffer,t)}else if(i){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=e.createRenderbuffer(),A(n.__webglDepthbuffer[a],t)}else e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),A(n.__webglDepthbuffer,t);e.bindFramebuffer(e.FRAMEBUFFER,null)}this.setTexture2D=v,this.setTextureCube=function(t,s){var c=r.get(t);if(6===t.image.length)if(t.version>0&&c.__version!==t.version){c.__image__webglTextureCube||(t.addEventListener("dispose",g),c.__image__webglTextureCube=e.createTexture(),o.textures++),n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_CUBE_MAP,c.__image__webglTextureCube),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var l=t&&t.isCompressedTexture,u=t.image[0]&&t.image[0].isDataTexture,f=[],m=0;m<6;m++)f[m]=l||u?u?t.image[m].image:t.image[m]:h(t.image[m],i.maxCubemapSize);var y=d(f[0]),v=a.convert(t.format),w=a.convert(t.type);b(e.TEXTURE_CUBE_MAP,t,y);for(m=0;m<6;m++)if(l)for(var A,E=f[m].mipmaps,x=0,_=E.length;x<_;x++)A=E[x],1023!==t.format&&1022!==t.format?n.getCompressedTextureFormats().indexOf(v)>-1?n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,x,v,A.width,A.height,0,A.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,x,v,A.width,A.height,0,v,w,A.data);else u?n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,v,f[m].width,f[m].height,0,v,w,f[m].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,v,v,w,f[m]);p(t,y)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),c.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,i){n.activeTexture(e.TEXTURE0+i),n.bindTexture(e.TEXTURE_CUBE_MAP,r.get(t).__webglTexture)},this.setupRenderTarget=function(t){var i=r.get(t),a=r.get(t.texture);t.addEventListener("dispose",y),a.__webglTexture=e.createTexture(),o.textures++;var s=!0===t.isWebGLRenderTargetCube,c=d(t);if(s){i.__webglFramebuffer=[];for(var l=0;l<6;l++)i.__webglFramebuffer[l]=e.createFramebuffer()}else i.__webglFramebuffer=e.createFramebuffer();if(s){n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture),b(e.TEXTURE_CUBE_MAP,t.texture,c);for(l=0;l<6;l++)w(i.__webglFramebuffer[l],t,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+l);p(t.texture,c)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),n.bindTexture(e.TEXTURE_CUBE_MAP,null)}else n.bindTexture(e.TEXTURE_2D,a.__webglTexture),b(e.TEXTURE_2D,t.texture,c),w(i.__webglFramebuffer,t,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),p(t.texture,c)&&e.generateMipmap(e.TEXTURE_2D),n.bindTexture(e.TEXTURE_2D,null);t.depthBuffer&&E(t)},this.updateRenderTargetMipmap=function(t){var i=t.texture;if(p(i,d(t))){var a=t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,o=r.get(i).__webglTexture;n.bindTexture(a,o),e.generateMipmap(a),n.bindTexture(a,null)}}}function $t(){var e={};return{get:function(t){var n=t.uuid,r=e[n];return void 0===r&&(r={},e[n]=r),r},remove:function(t){delete e[t.uuid]},update:function(t,n,r){var i=t.uuid;e[i][n]=r},dispose:function(){e={}}}}function en(e,t,n){var r=new function(){var t=!1,n=new x,r=null,i=new x(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){!0===s&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),!1===i.equals(n)&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},i=new function(){var t=!1,n=null,r=null,i=null;return{setTest:function(t){t?F(e.DEPTH_TEST):j(e.DEPTH_TEST)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}else e.depthFunc(e.LEQUAL);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},a=new function(){var t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(t){t?F(e.STENCIL_TEST):j(e.STENCIL_TEST)},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,o){r===t&&i===n&&a===o||(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){o===t&&s===n&&c===r||(e.stencilOp(t,n,r),o=t,s=n,c=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null}}},o=e.getParameter(e.MAX_VERTEX_ATTRIBS),s=new Uint8Array(o),c=new Uint8Array(o),l=new Uint8Array(o),u={},h=null,d=null,p=null,f=null,m=null,g=null,y=null,v=null,b=null,w=!1,A=null,E=null,_=null,S=null,M=null,T=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),R=!1,k=0,C=e.getParameter(e.VERSION);-1!==C.indexOf("WebGL")?(k=parseFloat(/^WebGL\ ([0-9])/.exec(C)[1]),R=k>=1):-1!==C.indexOf("OpenGL ES")&&(k=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(C)[1]),R=k>=2);var O=null,P={},I=new x,N=new x;function L(t,n,r){var i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(var o=0;o<r;o++)e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i);return a}var D={};function F(t){!0!==u[t]&&(e.enable(t),u[t]=!0)}function j(t){!1!==u[t]&&(e.disable(t),u[t]=!1)}function U(t,r,i,a,o,s,c,l){if(0!==t?F(e.BLEND):j(e.BLEND),5!==t){if(t!==p||l!==w)switch(t){case 2:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE));break;case 3:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR));break;case 4:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.SRC_COLOR));break;default:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA))}f=null,m=null,g=null,y=null,v=null,b=null}else o=o||r,s=s||i,c=c||a,r===f&&o===y||(e.blendEquationSeparate(n.convert(r),n.convert(o)),f=r,y=o),i===m&&a===g&&s===v&&c===b||(e.blendFuncSeparate(n.convert(i),n.convert(a),n.convert(s),n.convert(c)),m=i,g=a,v=s,b=c);p=t,w=l}function B(t){A!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),A=t)}function V(t){0!==t?(F(e.CULL_FACE),t!==E&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):j(e.CULL_FACE),E=t}function z(t,n,r){t?(F(e.POLYGON_OFFSET_FILL),S===n&&M===r||(e.polygonOffset(n,r),S=n,M=r)):j(e.POLYGON_OFFSET_FILL)}function H(t){void 0===t&&(t=e.TEXTURE0+T-1),O!==t&&(e.activeTexture(t),O=t)}return D[e.TEXTURE_2D]=L(e.TEXTURE_2D,e.TEXTURE_2D,1),D[e.TEXTURE_CUBE_MAP]=L(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),r.setClear(0,0,0,1),i.setClear(1),a.setClear(0),F(e.DEPTH_TEST),i.setFunc(3),B(!1),V(1),F(e.CULL_FACE),F(e.BLEND),U(1),{buffers:{color:r,depth:i,stencil:a},initAttributes:function(){for(var e=0,t=s.length;e<t;e++)s[e]=0},enableAttribute:function(n){s[n]=1,0===c[n]&&(e.enableVertexAttribArray(n),c[n]=1),0!==l[n]&&(t.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(n,0),l[n]=0)},enableAttributeAndDivisor:function(n,r){s[n]=1,0===c[n]&&(e.enableVertexAttribArray(n),c[n]=1),l[n]!==r&&(t.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(n,r),l[n]=r)},disableUnusedAttributes:function(){for(var t=0,n=c.length;t!==n;++t)c[t]!==s[t]&&(e.disableVertexAttribArray(t),c[t]=0)},enable:F,disable:j,getCompressedTextureFormats:function(){if(null===h&&(h=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")||t.get("WEBGL_compressed_texture_etc1")||t.get("WEBGL_compressed_texture_astc")))for(var n=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS),r=0;r<n.length;r++)h.push(n[r]);return h},useProgram:function(t){return d!==t&&(e.useProgram(t),d=t,!0)},setBlending:U,setMaterial:function(t,n){2===t.side?j(e.CULL_FACE):F(e.CULL_FACE);var a=1===t.side;n&&(a=!a),B(a),!0===t.transparent?U(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):U(0),i.setFunc(t.depthFunc),i.setTest(t.depthTest),i.setMask(t.depthWrite),r.setMask(t.colorWrite),z(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:B,setCullFace:V,setLineWidth:function(t){t!==_&&(R&&e.lineWidth(t),_=t)},setPolygonOffset:z,setScissorTest:function(t){t?F(e.SCISSOR_TEST):j(e.SCISSOR_TEST)},activeTexture:H,bindTexture:function(t,n){null===O&&H();var r=P[O];void 0===r&&(r={type:void 0,texture:void 0},P[O]=r),r.type===t&&r.texture===n||(e.bindTexture(t,n||D[t]),r.type=t,r.texture=n)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===I.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),I.copy(t))},viewport:function(t){!1===N.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),N.copy(t))},reset:function(){for(var t=0;t<c.length;t++)1===c[t]&&(e.disableVertexAttribArray(t),c[t]=0);u={},h=null,O=null,P={},d=null,p=null,A=null,E=null,r.reset(),i.reset(),a.reset()}}}function tn(e,t,n){var r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var a=void 0!==n.precision?n.precision:"highp",o=i(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);var s=!0===n.logarithmicDepthBuffer,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),l=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),h=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),d=e.getParameter(e.MAX_VERTEX_ATTRIBS),p=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),f=e.getParameter(e.MAX_VARYING_VECTORS),m=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),g=l>0,y=!!t.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:s,maxTextures:c,maxVertexTextures:l,maxTextureSize:u,maxCubemapSize:h,maxAttributes:d,maxVertexUniforms:p,maxVaryings:f,maxFragmentUniforms:m,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y}}function nn(e,t,n,r){We.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function rn(e){nn.call(this),this.cameras=e||[]}function an(e){var t=this,n=null,r=null,i=null,a=new y,o=new y;"undefined"!=typeof window&&"VRFrameData"in window&&(r=new window.VRFrameData);var s=new y,c=new v,l=new b,u=new nn;u.bounds=new x(0,0,.5,1),u.layers.enable(1);var h=new nn;h.bounds=new x(.5,0,.5,1),h.layers.enable(2);var d,p,f=new rn([u,h]);function m(){if(null!==n&&n.isPresenting){var r=n.getEyeParameters("left"),i=r.renderWidth,a=r.renderHeight;p=e.getPixelRatio(),d=e.getSize(),e.setDrawingBufferSize(2*i,a,1)}else t.enabled&&e.setDrawingBufferSize(d.width,d.height,p)}f.layers.enable(1),f.layers.enable(2),"undefined"!=typeof window&&window.addEventListener("vrdisplaypresentchange",m,!1),this.enabled=!1,this.userHeight=1.6,this.getDevice=function(){return n},this.setDevice=function(e){void 0!==e&&(n=e)},this.setPoseTarget=function(e){void 0!==e&&(i=e)},this.getCamera=function(e){if(null===n)return e;n.depthNear=e.near,n.depthFar=e.far,n.getFrameData(r);var d=n.stageParameters;d?a.fromArray(d.sittingToStandingTransform):a.makeTranslation(0,t.userHeight,0);var p=r.pose,m=null!==i?i:e;if(m.matrix.copy(a),m.matrix.decompose(m.position,m.quaternion,m.scale),null!==p.orientation&&(c.fromArray(p.orientation),m.quaternion.multiply(c)),null!==p.position&&(c.setFromRotationMatrix(a),l.fromArray(p.position),l.applyQuaternion(c),m.position.add(l)),m.updateMatrixWorld(),!1===n.isPresenting)return e;u.near=e.near,h.near=e.near,u.far=e.far,h.far=e.far,f.matrixWorld.copy(e.matrixWorld),f.matrixWorldInverse.copy(e.matrixWorldInverse),u.matrixWorldInverse.fromArray(r.leftViewMatrix),h.matrixWorldInverse.fromArray(r.rightViewMatrix),o.getInverse(a),u.matrixWorldInverse.multiply(o),h.matrixWorldInverse.multiply(o);var g=m.parent;null!==g&&(s.getInverse(g.matrixWorld),u.matrixWorldInverse.multiply(s),h.matrixWorldInverse.multiply(s)),u.matrixWorld.getInverse(u.matrixWorldInverse),h.matrixWorld.getInverse(h.matrixWorldInverse),u.projectionMatrix.fromArray(r.leftProjectionMatrix),h.projectionMatrix.fromArray(r.rightProjectionMatrix),f.projectionMatrix.copy(u.projectionMatrix);var y=n.getLayers();if(y.length){var v=y[0];null!==v.leftBounds&&4===v.leftBounds.length&&u.bounds.fromArray(v.leftBounds),null!==v.rightBounds&&4===v.rightBounds.length&&h.bounds.fromArray(v.rightBounds)}return f},this.getStandingMatrix=function(){return a},this.submitFrame=function(){n&&n.isPresenting&&n.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",m)}}function on(e){var t={};return{get:function(n){if(void 0!==t[n])return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":r=e.getExtension("WEBGL_compressed_texture_etc1");break;default:r=e.getExtension(n)}return null===r&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=r,r}}}function sn(){var e=this,t=null,n=0,r=!1,i=!1,a=new Ne,o=new w,s={value:null,needsUpdate:!1};function c(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function l(t,n,r,i){var c=null!==t?t.length:0,l=null;if(0!==c){if(l=s.value,!0!==i||null===l){var u=r+4*c,h=n.matrixWorldInverse;o.getNormalMatrix(h),(null===l||l.length<u)&&(l=new Float32Array(u));for(var d=0,p=r;d!==c;++d,p+=4)a.copy(t[d]).applyMatrix4(h,o),a.normal.toArray(l,p),l[p+3]=a.constant}s.value=l,s.needsUpdate=!0}return e.numPlanes=c,l}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(e,i,a){var o=0!==e.length||i||0!==n||r;return r=i,t=l(e,a,0),n=e.length,o},this.beginShadows=function(){i=!0,l(null)},this.endShadows=function(){i=!1,c()},this.setState=function(e,a,o,u,h,d){if(!r||null===e||0===e.length||i&&!o)i?l(null):c();else{var p=i?0:n,f=4*p,m=h.clippingState||null;s.value=m,m=l(e,u,f,d);for(var g=0;g!==f;++g)m[g]=t[g];h.clippingState=m,this.numIntersection=a?this.numPlanes:0,this.numPlanes+=p}}}function cn(e,t){return{convert:function(n){var r;if(1e3===n)return e.REPEAT;if(1001===n)return e.CLAMP_TO_EDGE;if(1002===n)return e.MIRRORED_REPEAT;if(1003===n)return e.NEAREST;if(1004===n)return e.NEAREST_MIPMAP_NEAREST;if(1005===n)return e.NEAREST_MIPMAP_LINEAR;if(1006===n)return e.LINEAR;if(1007===n)return e.LINEAR_MIPMAP_NEAREST;if(1008===n)return e.LINEAR_MIPMAP_LINEAR;if(1009===n)return e.UNSIGNED_BYTE;if(1017===n)return e.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return e.UNSIGNED_SHORT_5_5_5_1;if(1019===n)return e.UNSIGNED_SHORT_5_6_5;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(1012===n)return e.UNSIGNED_SHORT;if(1013===n)return e.INT;if(1014===n)return e.UNSIGNED_INT;if(1015===n)return e.FLOAT;if(1016===n&&null!==(r=t.get("OES_texture_half_float")))return r.HALF_FLOAT_OES;if(1021===n)return e.ALPHA;if(1022===n)return e.RGB;if(1023===n)return e.RGBA;if(1024===n)return e.LUMINANCE;if(1025===n)return e.LUMINANCE_ALPHA;if(1026===n)return e.DEPTH_COMPONENT;if(1027===n)return e.DEPTH_STENCIL;if(100===n)return e.FUNC_ADD;if(101===n)return e.FUNC_SUBTRACT;if(102===n)return e.FUNC_REVERSE_SUBTRACT;if(200===n)return e.ZERO;if(201===n)return e.ONE;if(202===n)return e.SRC_COLOR;if(203===n)return e.ONE_MINUS_SRC_COLOR;if(204===n)return e.SRC_ALPHA;if(205===n)return e.ONE_MINUS_SRC_ALPHA;if(206===n)return e.DST_ALPHA;if(207===n)return e.ONE_MINUS_DST_ALPHA;if(208===n)return e.DST_COLOR;if(209===n)return e.ONE_MINUS_DST_COLOR;if(210===n)return e.SRC_ALPHA_SATURATE;if((33776===n||33777===n||33778===n||33779===n)&&null!==(r=t.get("WEBGL_compressed_texture_s3tc"))){if(33776===n)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===n)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===n)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===n)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((35840===n||35841===n||35842===n||35843===n)&&null!==(r=t.get("WEBGL_compressed_texture_pvrtc"))){if(35840===n)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n&&null!==(r=t.get("WEBGL_compressed_texture_etc1")))return r.COMPRESSED_RGB_ETC1_WEBGL;if((37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n)&&null!==(r=t.get("WEBGL_compressed_texture_astc")))return n;if((103===n||104===n)&&null!==(r=t.get("EXT_blend_minmax"))){if(103===n)return r.MIN_EXT;if(104===n)return r.MAX_EXT}return 1020===n&&null!==(r=t.get("WEBGL_depth_texture"))?r.UNSIGNED_INT_24_8_WEBGL:0}}}function ln(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new b,color:new fe,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g};break;case"SpotLight":n={position:new b,direction:new b,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g};break;case"PointLight":n={position:new b,color:new fe,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new b,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":n={color:new fe,position:new b,halfWidth:new b,halfHeight:new b}}return e[t.id]=n,n}}}nn.prototype=Object.assign(Object.create(We.prototype),{constructor:nn,isPerspectiveCamera:!0,copy:function(e,t){return We.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*m.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*m.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*m.RAD2DEG*Math.atan(Math.tan(.5*m.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*m.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,t-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var c=this.filmOffset;0!==c&&(i+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far)},toJSON:function(e){var t=qe.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),rn.prototype=Object.assign(Object.create(nn.prototype),{constructor:rn,isArrayCamera:!0});var un,hn,dn,pn,fn,mn,gn,yn,vn=0;function bn(){var e=new ln,t={id:vn++,hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},n=new b,r=new y,i=new y;return{setup:function(a,o,s){for(var c=0,l=0,u=0,h=0,d=0,p=0,f=0,m=0,g=s.matrixWorldInverse,y=0,v=a.length;y<v;y++){var b=a[y],w=b.color,A=b.intensity,E=b.distance,x=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)c+=w.r*A,l+=w.g*A,u+=w.b*A;else if(b.isDirectionalLight){if((S=e.get(b)).color.copy(b.color).multiplyScalar(b.intensity),S.direction.setFromMatrixPosition(b.matrixWorld),n.setFromMatrixPosition(b.target.matrixWorld),S.direction.sub(n),S.direction.transformDirection(g),S.shadow=b.castShadow,b.castShadow){var _=b.shadow;S.shadowBias=_.bias,S.shadowRadius=_.radius,S.shadowMapSize=_.mapSize}t.directionalShadowMap[h]=x,t.directionalShadowMatrix[h]=b.shadow.matrix,t.directional[h]=S,h++}else if(b.isSpotLight){if((S=e.get(b)).position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),S.color.copy(w).multiplyScalar(A),S.distance=E,S.direction.setFromMatrixPosition(b.matrixWorld),n.setFromMatrixPosition(b.target.matrixWorld),S.direction.sub(n),S.direction.transformDirection(g),S.coneCos=Math.cos(b.angle),S.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),S.decay=0===b.distance?0:b.decay,S.shadow=b.castShadow,b.castShadow){_=b.shadow;S.shadowBias=_.bias,S.shadowRadius=_.radius,S.shadowMapSize=_.mapSize}t.spotShadowMap[p]=x,t.spotShadowMatrix[p]=b.shadow.matrix,t.spot[p]=S,p++}else if(b.isRectAreaLight){(S=e.get(b)).color.copy(w).multiplyScalar(A),S.position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),i.identity(),r.copy(b.matrixWorld),r.premultiply(g),i.extractRotation(r),S.halfWidth.set(.5*b.width,0,0),S.halfHeight.set(0,.5*b.height,0),S.halfWidth.applyMatrix4(i),S.halfHeight.applyMatrix4(i),t.rectArea[f]=S,f++}else if(b.isPointLight){if((S=e.get(b)).position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),S.color.copy(b.color).multiplyScalar(b.intensity),S.distance=b.distance,S.decay=0===b.distance?0:b.decay,S.shadow=b.castShadow,b.castShadow){_=b.shadow;S.shadowBias=_.bias,S.shadowRadius=_.radius,S.shadowMapSize=_.mapSize,S.shadowCameraNear=_.camera.near,S.shadowCameraFar=_.camera.far}t.pointShadowMap[d]=x,t.pointShadowMatrix[d]=b.shadow.matrix,t.point[d]=S,d++}else if(b.isHemisphereLight){var S;(S=e.get(b)).direction.setFromMatrixPosition(b.matrixWorld),S.direction.transformDirection(g),S.direction.normalize(),S.skyColor.copy(b.color).multiplyScalar(A),S.groundColor.copy(b.groundColor).multiplyScalar(A),t.hemi[m]=S,m++}}t.ambient[0]=c,t.ambient[1]=l,t.ambient[2]=u,t.directional.length=h,t.spot.length=p,t.rectArea.length=f,t.point.length=d,t.hemi.length=m,t.hash=t.id+","+h+","+d+","+p+","+f+","+m+","+o.length},state:t}}function wn(){var e=new bn,t=[],n=[],r=[];return{init:function(){t.length=0,n.length=0,r.length=0},state:{lightsArray:t,shadowsArray:n,spritesArray:r,lights:e},setupLights:function(r){e.setup(t,n,r)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)},pushSprite:function(e){r.push(e)}}}function An(){var e={};return{get:function(t,n){var r=t.id+","+n.id,i=e[r];return void 0===i&&(i=new wn,e[r]=i),i},dispose:function(){e={}}}}function En(e){console.log("THREE.WebGLRenderer","90");var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==e.context?e.context:null,r=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,o=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,c=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",u=null,h=null;this.domElement=t,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=1,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var d,p,f,g,v,w,A,E,_,S,T,R,k,C,O,P,I,N,L=this,D=!1,F=null,j=null,U=-1,B="",V=null,z=null,H=new x,G=new x,q=null,W=0,J=t.width,Z=t.height,X=1,Y=new x(0,0,J,Z),K=new x(0,0,J,Z),Q=!1,$=new Le,ee=new sn,te=!1,ne=!1,re=new y,ie=new b,ae={geometries:0,textures:0},oe={frame:0,calls:0,vertices:0,faces:0,points:0};function se(){return null===F?X:1}this.info={render:oe,memory:ae,programs:null,autoReset:!0,reset:function(){oe.frame++,oe.calls=0,oe.vertices=0,oe.faces=0,oe.points=0}};try{var ce={alpha:r,depth:i,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l};if(t.addEventListener("webglcontextlost",pe,!1),t.addEventListener("webglcontextrestored",fe,!1),null===(d=n||t.getContext("webgl",ce)||t.getContext("experimental-webgl",ce)))throw null!==t.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===d.getShaderPrecisionFormat&&(d.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){console.error("THREE.WebGLRenderer: "+e.message)}function le(){(p=new on(d)).get("WEBGL_depth_texture"),p.get("OES_texture_float"),p.get("OES_texture_float_linear"),p.get("OES_texture_half_float"),p.get("OES_texture_half_float_linear"),p.get("OES_standard_derivatives"),p.get("OES_element_index_uint"),p.get("ANGLE_instanced_arrays"),N=new cn(d,p),f=new tn(d,p,e),(g=new en(d,p,N)).scissor(G.copy(K).multiplyScalar(X)),g.viewport(H.copy(Y).multiplyScalar(X)),v=new $t,w=new Qt(d,p,g,v,f,N,ae,oe),A=new Fe(d),E=new jt(d,A,ae),_=new Ut(E,oe),C=new Lt(d),S=new Kt(L,p,f),T=new It,R=new An,k=new kt(L,g,E,s),O=new Ft(d,p,oe),P=new Dt(d,p,oe),I=new we(L,d,g,w,f),L.info.programs=S.programs,L.context=d,L.capabilities=f,L.extensions=p,L.properties=v,L.renderLists=T,L.state=g}le();var ue=new an(L);this.vr=ue;var he=new De(L,_,f.maxTextureSize);function pe(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),D=!0}function fe(){console.log("THREE.WebGLRenderer: Context Restored."),D=!1,le()}function ye(e){var t=e.target;t.removeEventListener("dispose",ye),function(e){be(e),v.remove(e)}(t)}function be(e){var t=v.get(e).program;e.program=void 0,void 0!==t&&S.releaseProgram(t)}this.shadowMap=he,this.getContext=function(){return d},this.getContextAttributes=function(){return d.getContextAttributes()},this.forceContextLoss=function(){var e=p.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=p.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return X},this.setPixelRatio=function(e){void 0!==e&&(X=e,this.setSize(J,Z,!1))},this.getSize=function(){return{width:J,height:Z}},this.setSize=function(e,n,r){var i=ue.getDevice();i&&i.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(J=e,Z=n,t.width=e*X,t.height=n*X,!1!==r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(){return{width:J*X,height:Z*X}},this.setDrawingBufferSize=function(e,n,r){J=e,Z=n,X=r,t.width=e*r,t.height=n*r,this.setViewport(0,0,e,n)},this.getCurrentViewport=function(){return H},this.setViewport=function(e,t,n,r){Y.set(e,Z-t-r,n,r),g.viewport(H.copy(Y).multiplyScalar(X))},this.setScissor=function(e,t,n,r){K.set(e,Z-t-r,n,r),g.scissor(G.copy(K).multiplyScalar(X))},this.setScissorTest=function(e){g.setScissorTest(Q=e)},this.getClearColor=function(){return k.getClearColor()},this.setClearColor=function(){k.setClearColor.apply(k,arguments)},this.getClearAlpha=function(){return k.getClearAlpha()},this.setClearAlpha=function(){k.setClearAlpha.apply(k,arguments)},this.clear=function(e,t,n){var r=0;(void 0===e||e)&&(r|=d.COLOR_BUFFER_BIT),(void 0===t||t)&&(r|=d.DEPTH_BUFFER_BIT),(void 0===n||n)&&(r|=d.STENCIL_BUFFER_BIT),d.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(e,t,n,r){this.setRenderTarget(e),this.clear(t,n,r)},this.dispose=function(){t.removeEventListener("webglcontextlost",pe,!1),t.removeEventListener("webglcontextrestored",fe,!1),T.dispose(),R.dispose(),v.dispose(),_.dispose(),ue.dispose(),_e()},this.renderBufferImmediate=function(e,t,n){g.initAttributes();var r=v.get(e);e.hasPositions&&!r.position&&(r.position=d.createBuffer()),e.hasNormals&&!r.normal&&(r.normal=d.createBuffer()),e.hasUvs&&!r.uv&&(r.uv=d.createBuffer()),e.hasColors&&!r.color&&(r.color=d.createBuffer());var i=t.getAttributes();if(e.hasPositions&&(d.bindBuffer(d.ARRAY_BUFFER,r.position),d.bufferData(d.ARRAY_BUFFER,e.positionArray,d.DYNAMIC_DRAW),g.enableAttribute(i.position),d.vertexAttribPointer(i.position,3,d.FLOAT,!1,0,0)),e.hasNormals){if(d.bindBuffer(d.ARRAY_BUFFER,r.normal),!n.isMeshPhongMaterial&&!n.isMeshStandardMaterial&&!n.isMeshNormalMaterial&&!0===n.flatShading)for(var a=0,o=3*e.count;a<o;a+=9){var s=e.normalArray,c=(s[a+0]+s[a+3]+s[a+6])/3,l=(s[a+1]+s[a+4]+s[a+7])/3,u=(s[a+2]+s[a+5]+s[a+8])/3;s[a+0]=c,s[a+1]=l,s[a+2]=u,s[a+3]=c,s[a+4]=l,s[a+5]=u,s[a+6]=c,s[a+7]=l,s[a+8]=u}d.bufferData(d.ARRAY_BUFFER,e.normalArray,d.DYNAMIC_DRAW),g.enableAttribute(i.normal),d.vertexAttribPointer(i.normal,3,d.FLOAT,!1,0,0)}e.hasUvs&&n.map&&(d.bindBuffer(d.ARRAY_BUFFER,r.uv),d.bufferData(d.ARRAY_BUFFER,e.uvArray,d.DYNAMIC_DRAW),g.enableAttribute(i.uv),d.vertexAttribPointer(i.uv,2,d.FLOAT,!1,0,0)),e.hasColors&&0!==n.vertexColors&&(d.bindBuffer(d.ARRAY_BUFFER,r.color),d.bufferData(d.ARRAY_BUFFER,e.colorArray,d.DYNAMIC_DRAW),g.enableAttribute(i.color),d.vertexAttribPointer(i.color,3,d.FLOAT,!1,0,0)),g.disableUnusedAttributes(),d.drawArrays(d.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,r,i,a){var o=i.isMesh&&i.matrixWorld.determinant()<0;g.setMaterial(r,o);var s=Ce(e,t,r,i),c=n.id+"_"+s.id+"_"+(!0===r.wireframe),l=!1;c!==B&&(B=c,l=!0),i.morphTargetInfluences&&(C.update(i,n,r,s),l=!0);var u,h=n.index,f=n.attributes.position,m=1;!0===r.wireframe&&(h=E.getWireframeAttribute(n),m=2);var y=O;null!==h&&(u=A.get(h),(y=P).setIndex(u)),l&&(!function(e,t,n,r){if(n&&n.isInstancedBufferGeometry&&null===p.get("ANGLE_instanced_arrays"))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===r&&(r=0);g.initAttributes();var i=n.attributes,a=t.getAttributes(),o=e.defaultAttributeValues;for(var s in a){var c=a[s];if(c>=0){var l=i[s];if(void 0!==l){var u=l.normalized,h=l.itemSize,f=A.get(l);if(void 0===f)continue;var m=f.buffer,y=f.type,v=f.bytesPerElement;if(l.isInterleavedBufferAttribute){var b=l.data,w=b.stride,E=l.offset;b&&b.isInstancedInterleavedBuffer?(g.enableAttributeAndDivisor(c,b.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=b.meshPerAttribute*b.count)):g.enableAttribute(c),d.bindBuffer(d.ARRAY_BUFFER,m),d.vertexAttribPointer(c,h,y,u,w*v,(r*w+E)*v)}else l.isInstancedBufferAttribute?(g.enableAttributeAndDivisor(c,l.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=l.meshPerAttribute*l.count)):g.enableAttribute(c),d.bindBuffer(d.ARRAY_BUFFER,m),d.vertexAttribPointer(c,h,y,u,0,r*h*v)}else if(void 0!==o){var x=o[s];if(void 0!==x)switch(x.length){case 2:d.vertexAttrib2fv(c,x);break;case 3:d.vertexAttrib3fv(c,x);break;case 4:d.vertexAttrib4fv(c,x);break;default:d.vertexAttrib1fv(c,x)}}}}g.disableUnusedAttributes()}(r,s,n),null!==h&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,u.buffer));var v=1/0;null!==h?v=h.count:void 0!==f&&(v=f.count);var b=n.drawRange.start*m,w=n.drawRange.count*m,x=null!==a?a.start*m:0,_=null!==a?a.count*m:1/0,S=Math.max(b,x),M=Math.min(v,b+w,x+_)-1,T=Math.max(0,M-S+1);if(0!==T){if(i.isMesh)if(!0===r.wireframe)g.setLineWidth(r.wireframeLinewidth*se()),y.setMode(d.LINES);else switch(i.drawMode){case 0:y.setMode(d.TRIANGLES);break;case 1:y.setMode(d.TRIANGLE_STRIP);break;case 2:y.setMode(d.TRIANGLE_FAN)}else if(i.isLine){var R=r.linewidth;void 0===R&&(R=1),g.setLineWidth(R*se()),i.isLineSegments?y.setMode(d.LINES):i.isLineLoop?y.setMode(d.LINE_LOOP):y.setMode(d.LINE_STRIP)}else i.isPoints&&y.setMode(d.POINTS);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&y.renderInstances(n,S,T):y.render(S,T)}},this.compile=function(e,t){(h=R.get(e,t)).init(),e.traverse((function(e){e.isLight&&(h.pushLight(e),e.castShadow&&h.pushShadow(e))})),h.setupLights(t),e.traverse((function(t){if(t.material)if(Array.isArray(t.material))for(var n=0;n<t.material.length;n++)ke(t.material[n],e.fog,t);else ke(t.material,e.fog,t)}))};var Ae,Ee=!1,xe=null;function _e(){Ee=!1}function Se(){var e=ue.getDevice();e&&e.isPresenting?e.requestAnimationFrame(Me):window.requestAnimationFrame(Me)}function Me(e){!1!==Ee&&(xe(e),Se())}function Te(e,t,n,r){for(var i=0,a=e.length;i<a;i++){var o=e[i],s=o.object,c=o.geometry,l=void 0===r?o.material:r,u=o.group;if(n.isArrayCamera){z=n;for(var h=n.cameras,d=0,p=h.length;d<p;d++){var f=h[d];if(s.layers.test(f.layers)){var m=f.bounds,y=m.x*J,v=m.y*Z,b=m.z*J,w=m.w*Z;g.viewport(H.set(y,v,b,w).multiplyScalar(X)),Re(s,t,f,c,l,u)}}}else z=null,Re(s,t,n,c,l,u)}}function Re(e,t,n,r,i,a){if(e.onBeforeRender(L,t,n,r,i,a),h=R.get(t,z||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var o=e.isMesh&&e.matrixWorld.determinant()<0;g.setMaterial(i,o);var s=Ce(n,t.fog,i,e);B="",function(e,t,n){e.render((function(e){L.renderBufferImmediate(e,t,n)}))}(e,s,i)}else L.renderBufferDirect(n,t.fog,r,i,e,a);e.onAfterRender(L,t,n,r,i,a),h=R.get(t,z||n)}function ke(e,t,n){var r=v.get(e),i=h.state.lights,a=h.state.shadowsArray,o=S.getParameters(e,i.state,a,t,ee.numPlanes,ee.numIntersection,n),s=S.getProgramCode(e,o),c=r.program,l=!0;if(void 0===c)e.addEventListener("dispose",ye);else if(c.code!==s)be(e);else if(r.lightsHash!==i.state.hash)v.update(e,"lightsHash",i.state.hash),l=!1;else{if(void 0!==o.shaderID)return;l=!1}if(l){if(o.shaderID){var u=ve[o.shaderID];r.shader={name:e.type,uniforms:ge.clone(u.uniforms),vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}}else r.shader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.onBeforeCompile(r.shader),c=S.acquireProgram(e,r.shader,o,s),r.program=c,e.program=c}var d=c.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var p=0;p<L.maxMorphTargets;p++)d["morphTarget"+p]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(p=0;p<L.maxMorphNormals;p++)d["morphNormal"+p]>=0&&e.numSupportedMorphNormals++}var f=r.shader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(r.numClippingPlanes=ee.numPlanes,r.numIntersection=ee.numIntersection,f.clippingPlanes=ee.uniform),r.fog=t,r.lightsHash=i.state.hash,e.lights&&(f.ambientLightColor.value=i.state.ambient,f.directionalLights.value=i.state.directional,f.spotLights.value=i.state.spot,f.rectAreaLights.value=i.state.rectArea,f.pointLights.value=i.state.point,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var m=r.program.getUniforms(),g=de.seqWithValue(m.seq,f);r.uniformsList=g}function Ce(e,t,n,r){W=0;var i=v.get(n),a=h.state.lights;if(te&&(ne||e!==V)){var o=e===V&&n.id===U;ee.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,i,o)}!1===n.needsUpdate&&(void 0===i.program||n.fog&&i.fog!==t||n.lights&&i.lightsHash!==a.state.hash?n.needsUpdate=!0:void 0===i.numClippingPlanes||i.numClippingPlanes===ee.numPlanes&&i.numIntersection===ee.numIntersection||(n.needsUpdate=!0)),n.needsUpdate&&(ke(n,t,r),n.needsUpdate=!1);var s,c,l=!1,u=!1,p=!1,y=i.program,b=y.getUniforms(),w=i.shader.uniforms;if(g.useProgram(y.program)&&(l=!0,u=!0,p=!0),n.id!==U&&(U=n.id,u=!0),l||e!==V){if(b.setValue(d,"projectionMatrix",e.projectionMatrix),f.logarithmicDepthBuffer&&b.setValue(d,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),V!==(z||e)&&(V=z||e,u=!0,p=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var A=b.map.cameraPosition;void 0!==A&&A.setValue(d,ie.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&b.setValue(d,"viewMatrix",e.matrixWorldInverse)}if(n.skinning){b.setOptional(d,r,"bindMatrix"),b.setOptional(d,r,"bindMatrixInverse");var E=r.skeleton;if(E){var x=E.bones;if(f.floatVertexTextures){if(void 0===E.boneTexture){var _=Math.sqrt(4*x.length);_=m.ceilPowerOfTwo(_),_=Math.max(_,4);var S=new Float32Array(_*_*4);S.set(E.boneMatrices);var T=new M(S,_,_,1023,1015);T.needsUpdate=!0,E.boneMatrices=S,E.boneTexture=T,E.boneTextureSize=_}b.setValue(d,"boneTexture",E.boneTexture),b.setValue(d,"boneTextureSize",E.boneTextureSize)}else b.setOptional(d,E,"boneMatrices")}}return u&&(b.setValue(d,"toneMappingExposure",L.toneMappingExposure),b.setValue(d,"toneMappingWhitePoint",L.toneMappingWhitePoint),n.lights&&(c=p,(s=w).ambientLightColor.needsUpdate=c,s.directionalLights.needsUpdate=c,s.pointLights.needsUpdate=c,s.spotLights.needsUpdate=c,s.rectAreaLights.needsUpdate=c,s.hemisphereLights.needsUpdate=c),t&&n.fog&&function(e,t){e.fogColor.value=t.color,t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}(w,t),n.isMeshBasicMaterial?Oe(w,n):n.isMeshLambertMaterial?(Oe(w,n),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(w,n)):n.isMeshPhongMaterial?(Oe(w,n),n.isMeshToonMaterial?function(e,t){Pe(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(w,n):Pe(w,n)):n.isMeshStandardMaterial?(Oe(w,n),n.isMeshPhysicalMaterial?function(e,t){e.clearCoat.value=t.clearCoat,e.clearCoatRoughness.value=t.clearCoatRoughness,Ie(e,t)}(w,n):Ie(w,n)):n.isMeshDepthMaterial?(Oe(w,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isMeshDistanceMaterial?(Oe(w,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(w,n)):n.isMeshNormalMaterial?(Oe(w,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale);t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale));t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}(w,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(w,n)):n.isPointsMaterial?function(e,t){if(e.diffuse.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size*X,e.scale.value=.5*Z,e.map.value=t.map,null!==t.map){if(!0===t.map.matrixAutoUpdate){var n=t.map.offset,r=t.map.repeat,i=t.map.rotation,a=t.map.center;t.map.matrix.setUvTransform(n.x,n.y,r.x,r.y,i,a.x,a.y)}e.uvTransform.value.copy(t.map.matrix)}}(w,n):n.isShadowMaterial&&(w.color.value=n.color,w.opacity.value=n.opacity),void 0!==w.ltc_1&&(w.ltc_1.value=me.LTC_1),void 0!==w.ltc_2&&(w.ltc_2.value=me.LTC_2),de.upload(d,i.uniformsList,w,L)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(de.upload(d,i.uniformsList,w,L),n.uniformsNeedUpdate=!1),b.setValue(d,"modelViewMatrix",r.modelViewMatrix),b.setValue(d,"normalMatrix",r.normalMatrix),b.setValue(d,"modelMatrix",r.matrixWorld),y}function Oe(e,t){var n;if(e.opacity.value=t.opacity,t.color&&(e.diffuse.value=t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),t.envMap&&(e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap&&t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?n=t.map:t.specularMap?n=t.specularMap:t.displacementMap?n=t.displacementMap:t.normalMap?n=t.normalMap:t.bumpMap?n=t.bumpMap:t.roughnessMap?n=t.roughnessMap:t.metalnessMap?n=t.metalnessMap:t.alphaMap?n=t.alphaMap:t.emissiveMap&&(n=t.emissiveMap),void 0!==n){if(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate){var r=n.offset,i=n.repeat,a=n.rotation,o=n.center;n.matrix.setUvTransform(r.x,r.y,i.x,i.y,a,o.x,o.y)}e.uvTransform.value.copy(n.matrix)}}function Pe(e,t){e.specular.value=t.specular,e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Ie(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}this.animate=function(e){null!==(xe=e)?Ee||(Se(),Ee=!0):_e()},this.render=function(e,t,n,r){if(t&&t.isCamera){if(!D){B="",U=-1,V=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),ue.enabled&&(t=ue.getCamera(t)),(h=R.get(e,t)).init(),e.onBeforeRender(L,e,t,n),re.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),$.setFromMatrix(re),ne=this.localClippingEnabled,te=ee.init(this.clippingPlanes,ne,t),(u=T.get(e,t)).init(),function e(t,n,r){if(!1===t.visible)return;if(t.layers.test(n.layers))if(t.isLight)h.pushLight(t),t.castShadow&&h.pushShadow(t);else if(t.isSprite)t.frustumCulled&&!$.intersectsSprite(t)||h.pushSprite(t);else if(t.isImmediateRenderObject)r&&ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(re),u.push(t,null,t.material,ie.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),!t.frustumCulled||$.intersectsObject(t))){r&&ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(re);var i=_.update(t),a=t.material;if(Array.isArray(a))for(var o=i.groups,s=0,c=o.length;s<c;s++){var l=o[s],d=a[l.materialIndex];d&&d.visible&&u.push(t,i,d,ie.z,l)}else a.visible&&u.push(t,i,a,ie.z,null)}var p=t.children;for(s=0,c=p.length;s<c;s++)e(p[s],n,r)}(e,t,L.sortObjects),!0===L.sortObjects&&u.sort(),te&&ee.beginShadows();var i=h.state.shadowsArray;he.render(i,e,t),h.setupLights(t),te&&ee.endShadows(),this.info.autoReset&&this.info.reset(),void 0===n&&(n=null),this.setRenderTarget(n),k.render(u,e,t,r);var a=u.opaque,o=u.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;a.length&&Te(a,e,t,s),o.length&&Te(o,e,t,s)}else a.length&&Te(a,e,t),o.length&&Te(o,e,t);var c=h.state.spritesArray;I.render(c,e,t),n&&w.updateRenderTargetMipmap(n),g.buffers.depth.setTest(!0),g.buffers.depth.setMask(!0),g.buffers.color.setMask(!0),g.setPolygonOffset(!1),e.onAfterRender(L,e,t),ue.enabled&&ue.submitFrame(),u=null,h=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.allocTextureUnit=function(){var e=W;return e>=f.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+e+" texture units while this GPU supports only "+f.maxTextures),W+=1,e},this.setTexture2D=(Ae=!1,function(e,t){e&&e.isWebGLRenderTarget&&(Ae||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),Ae=!0),e=e.texture),w.setTexture2D(e,t)}),this.setTexture=function(){var e=!1;return function(t,n){e||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),e=!0),w.setTexture2D(t,n)}}(),this.setTextureCube=function(){var e=!1;return function(t,n){t&&t.isWebGLRenderTargetCube&&(e||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?w.setTextureCube(t,n):w.setTextureCubeDynamic(t,n)}}(),this.getRenderTarget=function(){return F},this.setRenderTarget=function(e){F=e,e&&void 0===v.get(e).__webglFramebuffer&&w.setupRenderTarget(e);var t=null,n=!1;if(e){var r=v.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(t=r[e.activeCubeFace],n=!0):t=r,H.copy(e.viewport),G.copy(e.scissor),q=e.scissorTest}else H.copy(Y).multiplyScalar(X),G.copy(K).multiplyScalar(X),q=Q;if(j!==t&&(d.bindFramebuffer(d.FRAMEBUFFER,t),j=t),g.viewport(H),g.scissor(G),g.setScissorTest(q),n){var i=v.get(e.texture);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,i.__webglTexture,e.activeMipMapLevel)}},this.readRenderTargetPixels=function(e,t,n,r,i,a){if(e&&e.isWebGLRenderTarget){var o=v.get(e).__webglFramebuffer;if(o){var s=!1;o!==j&&(d.bindFramebuffer(d.FRAMEBUFFER,o),s=!0);try{var c=e.texture,l=c.format,u=c.type;if(1023!==l&&N.convert(l)!==d.getParameter(d.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(1009===u||N.convert(u)===d.getParameter(d.IMPLEMENTATION_COLOR_READ_TYPE)||1015===u&&(p.get("OES_texture_float")||p.get("WEBGL_color_buffer_float"))||1016===u&&p.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");d.checkFramebufferStatus(d.FRAMEBUFFER)===d.FRAMEBUFFER_COMPLETE?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&d.readPixels(t,n,r,i,N.convert(l),N.convert(u),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&d.bindFramebuffer(d.FRAMEBUFFER,j)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){var r=t.image.width,i=t.image.height,a=N.convert(t.format);this.setTexture2D(t,0),d.copyTexImage2D(d.TEXTURE_2D,n||0,a,e.x,e.y,r,i,0)}}function xn(e,t){this.name="",this.color=new fe(e),this.density=void 0!==t?t:25e-5}function _n(e,t,n){this.name="",this.color=new fe(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function Sn(){qe.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Mn(e){ke.call(this),this.type="SpriteMaterial",this.color=new fe(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Tn(e){qe.call(this),this.type="Sprite",this.material=void 0!==e?e:new Mn,this.center=new g(.5,.5)}function Rn(){qe.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function kn(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new y)}}function Cn(){qe.call(this),this.type="Bone"}function On(e,t){Rt.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new y,this.bindMatrixInverse=new y;var n=new kn(this.initBones());this.bind(n,this.matrixWorld),this.normalizeSkinWeights()}function Pn(e){ke.call(this),this.type="LineBasicMaterial",this.color=new fe(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(e)}function In(e,t,n){if(1===n)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new Nn(e,t);qe.call(this),this.type="Line",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new Pn({color:16777215*Math.random()})}function Nn(e,t){In.call(this,e,t),this.type="LineSegments"}function Ln(e,t){In.call(this,e,t),this.type="LineLoop"}function Dn(e){ke.call(this),this.type="PointsMaterial",this.color=new fe(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(e)}function Fn(e,t){qe.call(this),this.type="Points",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new Dn({color:16777215*Math.random()})}function jn(){qe.call(this),this.type="Group"}function Un(e,t,n,r,i,a,o,s,c){E.call(this,e,t,n,r,i,a,o,s,c),this.generateMipmaps=!1}function Bn(e,t,n,r,i,a,o,s,c,l,u,h){E.call(this,null,a,o,s,c,l,r,i,u,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Vn(e,t,n,r,i,a,o,s,c,l){if(1026!==(l=void 0!==l?l:1026)&&1027!==l)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===l&&(n=1012),void 0===n&&1027===l&&(n=1020),E.call(this,null,r,i,a,o,s,l,n,c),this.image={width:e,height:t},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}function zn(e){vt.call(this),this.type="WireframeGeometry";var t,n,r,i,a,o,s,c,l,u,h=[],d=[0,0],p={},f=["a","b","c"];if(e&&e.isGeometry){var m=e.faces;for(t=0,r=m.length;t<r;t++){var g=m[t];for(n=0;n<3;n++)s=g[f[n]],c=g[f[(n+1)%3]],d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[l=d[0]+","+d[1]]&&(p[l]={index1:d[0],index2:d[1]})}for(l in p)o=p[l],u=e.vertices[o.index1],h.push(u.x,u.y,u.z),u=e.vertices[o.index2],h.push(u.x,u.y,u.z)}else if(e&&e.isBufferGeometry){var y,v,w,A,E,x,_;if(u=new b,null!==e.index){for(y=e.attributes.position,v=e.index,0===(w=e.groups).length&&(w=[{start:0,count:v.count,materialIndex:0}]),i=0,a=w.length;i<a;++i)for(t=E=(A=w[i]).start,r=E+A.count;t<r;t+=3)for(n=0;n<3;n++)s=v.getX(t+n),c=v.getX(t+(n+1)%3),d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[l=d[0]+","+d[1]]&&(p[l]={index1:d[0],index2:d[1]});for(l in p)o=p[l],u.fromBufferAttribute(y,o.index1),h.push(u.x,u.y,u.z),u.fromBufferAttribute(y,o.index2),h.push(u.x,u.y,u.z)}else for(t=0,r=(y=e.attributes.position).count/3;t<r;t++)for(n=0;n<3;n++)x=3*t+n,u.fromBufferAttribute(y,x),h.push(u.x,u.y,u.z),_=3*t+(n+1)%3,u.fromBufferAttribute(y,_),h.push(u.x,u.y,u.z)}this.addAttribute("position",new ot(h,3))}function Hn(e,t,n){Ke.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new Gn(e,t,n)),this.mergeVertices()}function Gn(e,t,n){vt.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r,i,a=[],o=[],s=[],c=[],l=1e-5,u=new b,h=new b,d=new b,p=new b,f=new b,m=t+1;for(r=0;r<=n;r++){var g=r/n;for(i=0;i<=t;i++){var y=i/t;h=e(y,g,h),o.push(h.x,h.y,h.z),y-l>=0?(d=e(y-l,g,d),p.subVectors(h,d)):(d=e(y+l,g,d),p.subVectors(d,h)),g-l>=0?(d=e(y,g-l,d),f.subVectors(h,d)):(d=e(y,g+l,d),f.subVectors(d,h)),u.crossVectors(p,f).normalize(),s.push(u.x,u.y,u.z),c.push(y,g)}}for(r=0;r<n;r++)for(i=0;i<t;i++){var v=r*m+i,w=r*m+i+1,A=(r+1)*m+i+1,E=(r+1)*m+i;a.push(v,w,E),a.push(w,A,E)}this.setIndex(a),this.addAttribute("position",new ot(o,3)),this.addAttribute("normal",new ot(s,3)),this.addAttribute("uv",new ot(c,2))}function qn(e,t,n,r){Ke.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new Wn(e,t,n,r)),this.mergeVertices()}function Wn(e,t,n,r){vt.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},n=n||1;var i=[],a=[];function o(e,t,n,r){var i,a,o=Math.pow(2,r),c=[];for(i=0;i<=o;i++){c[i]=[];var l=e.clone().lerp(n,i/o),u=t.clone().lerp(n,i/o),h=o-i;for(a=0;a<=h;a++)c[i][a]=0===a&&i===o?l:l.clone().lerp(u,a/h)}for(i=0;i<o;i++)for(a=0;a<2*(o-i)-1;a++){var d=Math.floor(a/2);a%2==0?(s(c[i][d+1]),s(c[i+1][d]),s(c[i][d])):(s(c[i][d+1]),s(c[i+1][d+1]),s(c[i+1][d]))}}function s(e){i.push(e.x,e.y,e.z)}function c(t,n){var r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function l(e,t,n,r){r<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=r/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}function h(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}!function(e){for(var n=new b,r=new b,i=new b,a=0;a<t.length;a+=3)c(t[a+0],n),c(t[a+1],r),c(t[a+2],i),o(n,r,i,e)}(r=r||0),function(e){for(var t=new b,n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}(n),function(){for(var e=new b,t=0;t<i.length;t+=3){e.x=i[t+0],e.y=i[t+1],e.z=i[t+2];var n=u(e)/2/Math.PI+.5,r=h(e)/Math.PI+.5;a.push(n,1-r)}(function(){for(var e=new b,t=new b,n=new b,r=new b,o=new g,s=new g,c=new g,h=0,d=0;h<i.length;h+=9,d+=6){e.set(i[h+0],i[h+1],i[h+2]),t.set(i[h+3],i[h+4],i[h+5]),n.set(i[h+6],i[h+7],i[h+8]),o.set(a[d+0],a[d+1]),s.set(a[d+2],a[d+3]),c.set(a[d+4],a[d+5]),r.copy(e).add(t).add(n).divideScalar(3);var p=u(r);l(o,d+0,e,p),l(s,d+2,t,p),l(c,d+4,n,p)}})(),function(){for(var e=0;e<a.length;e+=6){var t=a[e+0],n=a[e+2],r=a[e+4],i=Math.max(t,n,r),o=Math.min(t,n,r);i>.9&&o<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}()}(),this.addAttribute("position",new ot(i,3)),this.addAttribute("normal",new ot(i.slice(),3)),this.addAttribute("uv",new ot(a,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function Jn(e,t){Ke.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Zn(e,t)),this.mergeVertices()}function Zn(e,t){Wn.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Xn(e,t){Ke.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Yn(e,t)),this.mergeVertices()}function Yn(e,t){Wn.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Kn(e,t){Ke.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Qn(e,t)),this.mergeVertices()}function Qn(e,t){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];Wn.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function $n(e,t){Ke.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new er(e,t)),this.mergeVertices()}function er(e,t){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];Wn.call(this,i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function tr(e,t,n,r,i,a){Ke.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new nr(e,t,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function nr(e,t,n,r,i){vt.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},t=t||64,n=n||1,r=r||8,i=i||!1;var a=e.computeFrenetFrames(t,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o,s,c=new b,l=new b,u=new g,h=new b,d=[],p=[],f=[],m=[];function y(i){h=e.getPointAt(i/t,h);var o=a.normals[i],u=a.binormals[i];for(s=0;s<=r;s++){var f=s/r*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);l.x=g*o.x+m*u.x,l.y=g*o.y+m*u.y,l.z=g*o.z+m*u.z,l.normalize(),p.push(l.x,l.y,l.z),c.x=h.x+n*l.x,c.y=h.y+n*l.y,c.z=h.z+n*l.z,d.push(c.x,c.y,c.z)}}!function(){for(o=0;o<t;o++)y(o);y(!1===i?t:0),function(){for(o=0;o<=t;o++)for(s=0;s<=r;s++)u.x=o/t,u.y=s/r,f.push(u.x,u.y)}(),function(){for(s=1;s<=t;s++)for(o=1;o<=r;o++){var e=(r+1)*(s-1)+(o-1),n=(r+1)*s+(o-1),i=(r+1)*s+o,a=(r+1)*(s-1)+o;m.push(e,n,a),m.push(n,i,a)}}()}(),this.setIndex(m),this.addAttribute("position",new ot(d,3)),this.addAttribute("normal",new ot(p,3)),this.addAttribute("uv",new ot(f,2))}function rr(e,t,n,r,i,a,o){Ke.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new ir(e,t,n,r,i,a)),this.mergeVertices()}function ir(e,t,n,r,i,a){vt.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,a=a||3;var o,s,c=[],l=[],u=[],h=[],d=new b,p=new b,f=new b,m=new b,g=new b,y=new b,v=new b;for(o=0;o<=n;++o){var w=o/n*i*Math.PI*2;for(R(w,i,a,e,f),R(w+.01,i,a,e,m),y.subVectors(m,f),v.addVectors(m,f),g.crossVectors(y,v),v.crossVectors(g,y),g.normalize(),v.normalize(),s=0;s<=r;++s){var A=s/r*Math.PI*2,E=-t*Math.cos(A),x=t*Math.sin(A);d.x=f.x+(E*v.x+x*g.x),d.y=f.y+(E*v.y+x*g.y),d.z=f.z+(E*v.z+x*g.z),l.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),u.push(p.x,p.y,p.z),h.push(o/n),h.push(s/r)}}for(s=1;s<=n;s++)for(o=1;o<=r;o++){var _=(r+1)*(s-1)+(o-1),S=(r+1)*s+(o-1),M=(r+1)*s+o,T=(r+1)*(s-1)+o;c.push(_,S,T),c.push(S,M,T)}function R(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,c=Math.cos(s);i.x=r*(2+c)*.5*a,i.y=r*(2+c)*o*.5,i.z=r*Math.sin(s)*.5}this.setIndex(c),this.addAttribute("position",new ot(l,3)),this.addAttribute("normal",new ot(u,3)),this.addAttribute("uv",new ot(h,2))}function ar(e,t,n,r,i){Ke.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new or(e,t,n,r,i)),this.mergeVertices()}function or(e,t,n,r,i){vt.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},e=e||1,t=t||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var a,o,s=[],c=[],l=[],u=[],h=new b,d=new b,p=new b;for(a=0;a<=n;a++)for(o=0;o<=r;o++){var f=o/r*i,m=a/n*Math.PI*2;d.x=(e+t*Math.cos(m))*Math.cos(f),d.y=(e+t*Math.cos(m))*Math.sin(f),d.z=t*Math.sin(m),c.push(d.x,d.y,d.z),h.x=e*Math.cos(f),h.y=e*Math.sin(f),p.subVectors(d,h).normalize(),l.push(p.x,p.y,p.z),u.push(o/r),u.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=r;o++){var g=(r+1)*a+o-1,y=(r+1)*(a-1)+o-1,v=(r+1)*(a-1)+o,w=(r+1)*a+o;s.push(g,y,w),s.push(y,v,w)}this.setIndex(s),this.addAttribute("position",new ot(c,3)),this.addAttribute("normal",new ot(l,3)),this.addAttribute("uv",new ot(u,2))}xn.prototype.isFogExp2=!0,xn.prototype.clone=function(){return new xn(this.color.getHex(),this.density)},xn.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},_n.prototype.isFog=!0,_n.prototype.clone=function(){return new _n(this.color.getHex(),this.near,this.far)},_n.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},Sn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Sn,copy:function(e,t){return qe.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=qe.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}),Mn.prototype=Object.create(ke.prototype),Mn.prototype.constructor=Mn,Mn.prototype.isSpriteMaterial=!0,Mn.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.rotation=e.rotation,this},Tn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Tn,isSprite:!0,raycast:(un=new b,hn=new b,dn=new b,function(e,t){hn.setFromMatrixPosition(this.matrixWorld),e.ray.closestPointToPoint(hn,un),dn.setFromMatrixScale(this.matrixWorld);var n=dn.x*dn.y/4;if(!(hn.distanceToSquared(un)>n)){var r=e.ray.origin.distanceTo(un);r<e.near||r>e.far||t.push({distance:r,point:un.clone(),face:null,object:this})}}),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return qe.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}}),Rn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Rn,copy:function(e){qe.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n<r;n++){var i=t[n];this.addLevel(i.object.clone(),i.distance)}return this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,r=0;r<n.length&&!(t<n[r].distance);r++);n.splice(r,0,{distance:t,object:e}),this.add(e)},getObjectForDistance:function(e){for(var t=this.levels,n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object},raycast:(pn=new b,function(e,t){pn.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(pn);this.getObjectForDistance(n).raycast(e,t)}),update:function(){var e=new b,t=new b;return function(n){var r=this.levels;if(r.length>1){e.setFromMatrixPosition(n.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var i=e.distanceTo(t);r[0].object.visible=!0;for(var a=1,o=r.length;a<o&&i>=r[a].distance;a++)r[a-1].object.visible=!1,r[a].object.visible=!0;for(;a<o;a++)r[a].object.visible=!1}}}(),toJSON:function(e){var t=qe.prototype.toJSON.call(this,e);t.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),Object.assign(kn.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new y;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:(fn=new y,mn=new y,function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=e.length;i<a;i++){var o=e[i]?e[i].matrixWorld:mn;fn.multiplyMatrices(o,t[i]),fn.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)}),clone:function(){return new kn(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}}}),Cn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Cn,isBone:!0}),On.prototype=Object.assign(Object.create(Rt.prototype),{constructor:On,isSkinnedMesh:!0,initBones:function(){var e,t,n,r,i=[];if(this.geometry&&void 0!==this.geometry.bones){for(n=0,r=this.geometry.bones.length;n<r;n++)t=this.geometry.bones[n],e=new Cn,i.push(e),e.name=t.name,e.position.fromArray(t.pos),e.quaternion.fromArray(t.rotq),void 0!==t.scl&&e.scale.fromArray(t.scl);for(n=0,r=this.geometry.bones.length;n<r;n++)-1!==(t=this.geometry.bones[n]).parent&&null!==t.parent&&void 0!==i[t.parent]?i[t.parent].add(i[n]):this.add(i[n])}return this.updateMatrixWorld(!0),i},bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var e,t;if(this.geometry&&this.geometry.isGeometry)for(t=0;t<this.geometry.skinWeights.length;t++){var n=this.geometry.skinWeights[t];(e=1/n.manhattanLength())!==1/0?n.multiplyScalar(e):n.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){var r=new x,i=this.geometry.attributes.skinWeight;for(t=0;t<i.count;t++)r.x=i.getX(t),r.y=i.getY(t),r.z=i.getZ(t),r.w=i.getW(t),(e=1/r.manhattanLength())!==1/0?r.multiplyScalar(e):r.set(1,0,0,0),i.setXYZW(t,r.x,r.y,r.z,r.w)}},updateMatrixWorld:function(e){Rt.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Pn.prototype=Object.create(ke.prototype),Pn.prototype.constructor=Pn,Pn.prototype.isLineBasicMaterial=!0,Pn.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this},In.prototype=Object.assign(Object.create(qe.prototype),{constructor:In,isLine:!0,computeLineDistances:(gn=new b,yn=new b,function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)gn.fromBufferAttribute(t,r-1),yn.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=gn.distanceTo(yn);e.addAttribute("lineDistance",new THREE.Float32BufferAttribute(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for((n=e.lineDistances)[0]=0,r=1,i=a.length;r<i;r++)n[r]=n[r-1],n[r]+=a[r-1].distanceTo(a[r])}return this}),raycast:function(){var e=new y,t=new St,n=new Ie;return function(r,i){var a=r.linePrecision,o=a*a,s=this.geometry,c=this.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),n.copy(s.boundingSphere),n.applyMatrix4(c),!1!==r.ray.intersectsSphere(n)){e.getInverse(c),t.copy(r.ray).applyMatrix4(e);var l=new b,u=new b,h=new b,d=new b,p=this&&this.isLineSegments?2:1;if(s.isBufferGeometry){var f=s.index,m=s.attributes.position.array;if(null!==f)for(var g=f.array,y=0,v=g.length-1;y<v;y+=p){var w=g[y],A=g[y+1];if(l.fromArray(m,3*w),u.fromArray(m,3*A),!(t.distanceSqToSegment(l,u,d,h)>o))d.applyMatrix4(this.matrixWorld),(_=r.ray.origin.distanceTo(d))<r.near||_>r.far||i.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}else for(y=0,v=m.length/3-1;y<v;y+=p){if(l.fromArray(m,3*y),u.fromArray(m,3*y+3),!(t.distanceSqToSegment(l,u,d,h)>o))d.applyMatrix4(this.matrixWorld),(_=r.ray.origin.distanceTo(d))<r.near||_>r.far||i.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else if(s.isGeometry){var E=s.vertices,x=E.length;for(y=0;y<x-1;y+=p){var _;if(!(t.distanceSqToSegment(E[y],E[y+1],d,h)>o))d.applyMatrix4(this.matrixWorld),(_=r.ray.origin.distanceTo(d))<r.near||_>r.far||i.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Nn.prototype=Object.assign(Object.create(In.prototype),{constructor:Nn,isLineSegments:!0,computeLineDistances:function(){var e=new b,t=new b;return function(){var n=this.geometry;if(n.isBufferGeometry)if(null===n.index){for(var r=n.attributes.position,i=[],a=0,o=r.count;a<o;a+=2)e.fromBufferAttribute(r,a),t.fromBufferAttribute(r,a+1),i[a]=0===a?0:i[a-1],i[a+1]=i[a]+e.distanceTo(t);n.addAttribute("lineDistance",new THREE.Float32BufferAttribute(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(n.isGeometry){var s=n.vertices;for(i=n.lineDistances,a=0,o=s.length;a<o;a+=2)e.copy(s[a]),t.copy(s[a+1]),i[a]=0===a?0:i[a-1],i[a+1]=i[a]+e.distanceTo(t)}return this}}()}),Ln.prototype=Object.assign(Object.create(In.prototype),{constructor:Ln,isLineLoop:!0}),Dn.prototype=Object.create(ke.prototype),Dn.prototype.constructor=Dn,Dn.prototype.isPointsMaterial=!0,Dn.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this},Fn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Fn,isPoints:!0,raycast:function(){var e=new y,t=new St,n=new Ie;return function(r,i){var a=this,o=this.geometry,s=this.matrixWorld,c=r.params.Points.threshold;if(null===o.boundingSphere&&o.computeBoundingSphere(),n.copy(o.boundingSphere),n.applyMatrix4(s),n.radius+=c,!1!==r.ray.intersectsSphere(n)){e.getInverse(s),t.copy(r.ray).applyMatrix4(e);var l=c/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,h=new b;if(o.isBufferGeometry){var d=o.index,p=o.attributes.position.array;if(null!==d)for(var f=d.array,m=0,g=f.length;m<g;m++){var y=f[m];h.fromArray(p,3*y),A(h,y)}else{m=0;for(var v=p.length/3;m<v;m++)h.fromArray(p,3*m),A(h,m)}}else{var w=o.vertices;for(m=0,v=w.length;m<v;m++)A(w[m],m)}}function A(e,n){var o=t.distanceSqToPoint(e);if(o<u){var c=t.closestPointToPoint(e);c.applyMatrix4(s);var l=r.ray.origin.distanceTo(c);if(l<r.near||l>r.far)return;i.push({distance:l,distanceToRay:Math.sqrt(o),point:c.clone(),index:n,face:null,object:a})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),jn.prototype=Object.assign(Object.create(qe.prototype),{constructor:jn,isGroup:!0}),Un.prototype=Object.assign(Object.create(E.prototype),{constructor:Un,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Bn.prototype=Object.create(E.prototype),Bn.prototype.constructor=Bn,Bn.prototype.isCompressedTexture=!0,Vn.prototype=Object.create(E.prototype),Vn.prototype.constructor=Vn,Vn.prototype.isDepthTexture=!0,zn.prototype=Object.create(vt.prototype),zn.prototype.constructor=zn,Hn.prototype=Object.create(Ke.prototype),Hn.prototype.constructor=Hn,Gn.prototype=Object.create(vt.prototype),Gn.prototype.constructor=Gn,qn.prototype=Object.create(Ke.prototype),qn.prototype.constructor=qn,Wn.prototype=Object.create(vt.prototype),Wn.prototype.constructor=Wn,Jn.prototype=Object.create(Ke.prototype),Jn.prototype.constructor=Jn,Zn.prototype=Object.create(Wn.prototype),Zn.prototype.constructor=Zn,Xn.prototype=Object.create(Ke.prototype),Xn.prototype.constructor=Xn,Yn.prototype=Object.create(Wn.prototype),Yn.prototype.constructor=Yn,Kn.prototype=Object.create(Ke.prototype),Kn.prototype.constructor=Kn,Qn.prototype=Object.create(Wn.prototype),Qn.prototype.constructor=Qn,$n.prototype=Object.create(Ke.prototype),$n.prototype.constructor=$n,er.prototype=Object.create(Wn.prototype),er.prototype.constructor=er,tr.prototype=Object.create(Ke.prototype),tr.prototype.constructor=tr,nr.prototype=Object.create(vt.prototype),nr.prototype.constructor=nr,rr.prototype=Object.create(Ke.prototype),rr.prototype.constructor=rr,ir.prototype=Object.create(vt.prototype),ir.prototype.constructor=ir,ar.prototype=Object.create(Ke.prototype),ar.prototype.constructor=ar,or.prototype=Object.create(vt.prototype),or.prototype.constructor=or;var sr=function(e,t,n){n=n||2;var r,i,a,o,s,c,l,u=t&&t.length,h=u?t[0]*n:e.length,d=cr(e,0,h,n,!0),p=[];if(!d)return p;if(u&&(d=function(e,t,n,r){var i,a,o,s,c,l=[];for(i=0,a=t.length;i<a;i++)o=t[i]*r,s=i<a-1?t[i+1]*r:e.length,(c=cr(e,o,s,r,!1))===c.next&&(c.steiner=!0),l.push(vr(c));for(l.sort(mr),i=0;i<l.length;i++)gr(l[i],n),n=lr(n,n.next);return n}(e,t,d,n)),e.length>80*n){r=a=e[0],i=o=e[1];for(var f=n;f<h;f+=n)(s=e[f])<r&&(r=s),(c=e[f+1])<i&&(i=c),s>a&&(a=s),c>o&&(o=c);l=0!==(l=Math.max(a-r,o-i))?1/l:0}return ur(d,p,n,r,i,l),p};function cr(e,t,n,r,i){var a,o;if(i===function(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,n,r)>0)for(a=t;a<n;a+=r)o=Mr(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=Mr(a,e[a],e[a+1],o);return o&&Er(o,o.next)&&(Tr(o),o=o.next),o}function lr(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!Er(r,r.next)&&0!==Ar(r.prev,r,r.next))r=r.next;else{if(Tr(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function ur(e,t,n,r,i,a,o){if(e){!o&&a&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=yr(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<l&&(s++,r=r.nextZ);t++);for(c=l;s>0||c>0&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1)}(i)}(e,r,i,a);for(var s,c,l=e;e.prev!==e.next;)if(s=e.prev,c=e.next,a?dr(e,r,i,a):hr(e))t.push(s.i/n),t.push(e.i/n),t.push(c.i/n),Tr(e),e=c.next,l=c.next;else if((e=c)===l){o?1===o?ur(e=pr(e,t,n),t,n,r,i,a,2):2===o&&fr(e,t,n,r,i,a):ur(lr(e),t,n,r,i,a,1);break}}}function hr(e){var t=e.prev,n=e,r=e.next;if(Ar(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(br(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ar(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function dr(e,t,n,r){var i=e.prev,a=e,o=e.next;if(Ar(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,c=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,l=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=yr(s,c,t,n,r),d=yr(l,u,t,n,r),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&br(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ar(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&br(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ar(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function pr(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!Er(i,a)&&xr(i,r,r.next,a)&&_r(i,a)&&_r(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),Tr(r),Tr(r.next),r=e=a),r=r.next}while(r!==e);return r}function fr(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&wr(o,s)){var c=Sr(o,s);return o=lr(o,o.next),c=lr(c,c.next),ur(o,t,n,r,i,a),void ur(c,t,n,r,i,a)}s=s.next}o=o.next}while(o!==e)}function mr(e,t){return e.x-t.x}function gr(e,t){if(t=function(e,t){var n,r=t,i=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var c,l=n,u=n.x,h=n.y,d=1/0;r=n.next;for(;r!==l;)i>=r.x&&r.x>=u&&i!==r.x&&br(a<h?i:o,a,u,h,a<h?o:i,a,r.x,r.y)&&((c=Math.abs(a-r.y)/(i-r.x))<d||c===d&&r.x>n.x)&&_r(r,e)&&(n=r,d=c),r=r.next;return n}(e,t)){var n=Sr(t,e);lr(n,n.next)}}function yr(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function vr(e){var t=e,n=e;do{t.x<n.x&&(n=t),t=t.next}while(t!==e);return n}function br(e,t,n,r,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function wr(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&xr(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&_r(e,t)&&_r(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)}function Ar(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Er(e,t){return e.x===t.x&&e.y===t.y}function xr(e,t,n,r){return!!(Er(e,t)&&Er(n,r)||Er(e,r)&&Er(n,t))||Ar(e,t,n)>0!=Ar(e,t,r)>0&&Ar(n,r,e)>0!=Ar(n,r,t)>0}function _r(e,t){return Ar(e.prev,e,e.next)<0?Ar(e,t,e.next)>=0&&Ar(e,e.prev,t)>=0:Ar(e,t,e.prev)<0||Ar(e,e.next,t)<0}function Sr(e,t){var n=new Rr(e.i,e.x,e.y),r=new Rr(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Mr(e,t,n,r){var i=new Rr(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Tr(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Rr(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var kr={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n},isClockWise:function(e){return kr.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];Cr(e),Or(n,e);var a=e.length;t.forEach(Cr);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,Or(n,t[o]);var s=sr(n,r);for(o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}};function Cr(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Or(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function Pr(e,t){Ke.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new Ir(e,t)),this.mergeVertices()}function Ir(e,t){void 0!==e&&(vt.call(this),this.type="ExtrudeBufferGeometry",e=Array.isArray(e)?e:[e],this.addShapeList(e,t),this.computeVertexNormals())}function Nr(e,t){Ke.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new Lr(e,t)),this.mergeVertices()}function Lr(e,t){var n=(t=t||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Ke;var r=n.generateShapes(e,t.size,t.curveSegments);t.amount=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),Ir.call(this,r,t),this.type="TextBufferGeometry"}function Dr(e,t,n,r,i,a,o){Ke.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new Fr(e,t,n,r,i,a,o)),this.mergeVertices()}function Fr(e,t,n,r,i,a,o){vt.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI;var s,c,l=(a=void 0!==a?a:0)+(o=void 0!==o?o:Math.PI),u=0,h=[],d=new b,p=new b,f=[],m=[],g=[],y=[];for(c=0;c<=n;c++){var v=[],w=c/n;for(s=0;s<=t;s++){var A=s/t;d.x=-e*Math.cos(r+A*i)*Math.sin(a+w*o),d.y=e*Math.cos(a+w*o),d.z=e*Math.sin(r+A*i)*Math.sin(a+w*o),m.push(d.x,d.y,d.z),p.set(d.x,d.y,d.z).normalize(),g.push(p.x,p.y,p.z),y.push(A,1-w),v.push(u++)}h.push(v)}for(c=0;c<n;c++)for(s=0;s<t;s++){var E=h[c][s+1],x=h[c][s],_=h[c+1][s],S=h[c+1][s+1];(0!==c||a>0)&&f.push(E,x,S),(c!==n-1||l<Math.PI)&&f.push(x,_,S)}this.setIndex(f),this.addAttribute("position",new ot(m,3)),this.addAttribute("normal",new ot(g,3)),this.addAttribute("uv",new ot(y,2))}function jr(e,t,n,r,i,a){Ke.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new Ur(e,t,n,r,i,a)),this.mergeVertices()}function Ur(e,t,n,r,i,a){vt.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},e=e||.5,t=t||1,i=void 0!==i?i:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var o,s,c,l=[],u=[],h=[],d=[],p=e,f=(t-e)/(r=void 0!==r?Math.max(1,r):1),m=new b,y=new g;for(s=0;s<=r;s++){for(c=0;c<=n;c++)o=i+c/n*a,m.x=p*Math.cos(o),m.y=p*Math.sin(o),u.push(m.x,m.y,m.z),h.push(0,0,1),y.x=(m.x/t+1)/2,y.y=(m.y/t+1)/2,d.push(y.x,y.y);p+=f}for(s=0;s<r;s++){var v=s*(n+1);for(c=0;c<n;c++){var w=o=c+v,A=o+n+1,E=o+n+2,x=o+1;l.push(w,A,x),l.push(A,E,x)}}this.setIndex(l),this.addAttribute("position",new ot(u,3)),this.addAttribute("normal",new ot(h,3)),this.addAttribute("uv",new ot(d,2))}function Br(e,t,n,r){Ke.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new Vr(e,t,n,r)),this.mergeVertices()}function Vr(e,t,n,r){vt.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t)||12,n=n||0,r=r||2*Math.PI,r=m.clamp(r,0,2*Math.PI);var i,a,o,s=[],c=[],l=[],u=1/t,h=new b,d=new g;for(a=0;a<=t;a++){var p=n+a*u*r,f=Math.sin(p),y=Math.cos(p);for(o=0;o<=e.length-1;o++)h.x=e[o].x*f,h.y=e[o].y,h.z=e[o].x*y,c.push(h.x,h.y,h.z),d.x=a/t,d.y=o/(e.length-1),l.push(d.x,d.y)}for(a=0;a<t;a++)for(o=0;o<e.length-1;o++){var v=i=o+a*e.length,w=i+e.length,A=i+e.length+1,E=i+1;s.push(v,w,E),s.push(w,A,E)}if(this.setIndex(s),this.addAttribute("position",new ot(c,3)),this.addAttribute("uv",new ot(l,2)),this.computeVertexNormals(),r===2*Math.PI){var x=this.attributes.normal.array,_=new b,S=new b,M=new b;for(i=t*e.length*3,a=0,o=0;a<e.length;a++,o+=3)_.x=x[o+0],_.y=x[o+1],_.z=x[o+2],S.x=x[i+o+0],S.y=x[i+o+1],S.z=x[i+o+2],M.addVectors(_,S).normalize(),x[o+0]=x[i+o+0]=M.x,x[o+1]=x[i+o+1]=M.y,x[o+2]=x[i+o+2]=M.z}}function zr(e,t){Ke.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new Hr(e,t)),this.mergeVertices()}function Hr(e,t){vt.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var n=[],r=[],i=[],a=[],o=0,s=0;if(!1===Array.isArray(e))l(e);else for(var c=0;c<e.length;c++)l(e[c]),this.addGroup(o,s,c),o+=s,s=0;function l(e){var o,c,l,u=r.length/3,h=e.extractPoints(t),d=h.shape,p=h.holes;if(!1===kr.isClockWise(d))for(d=d.reverse(),o=0,c=p.length;o<c;o++)l=p[o],!0===kr.isClockWise(l)&&(p[o]=l.reverse());var f=kr.triangulateShape(d,p);for(o=0,c=p.length;o<c;o++)l=p[o],d=d.concat(l);for(o=0,c=d.length;o<c;o++){var m=d[o];r.push(m.x,m.y,0),i.push(0,0,1),a.push(m.x,m.y)}for(o=0,c=f.length;o<c;o++){var g=f[o],y=g[0]+u,v=g[1]+u,b=g[2]+u;n.push(y,v,b),s+=3}}this.setIndex(n),this.addAttribute("position",new ot(r,3)),this.addAttribute("normal",new ot(i,3)),this.addAttribute("uv",new ot(a,2))}function Gr(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}function qr(e,t){vt.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,r,i,a,o=[],s=Math.cos(m.DEG2RAD*t),c=[0,0],l={},u=["a","b","c"];e.isBufferGeometry?(a=new Ke).fromBufferGeometry(e):a=e.clone(),a.mergeVertices(),a.computeFaceNormals();for(var h=a.vertices,d=a.faces,p=0,f=d.length;p<f;p++)for(var g=d[p],y=0;y<3;y++)n=g[u[y]],r=g[u[(y+1)%3]],c[0]=Math.min(n,r),c[1]=Math.max(n,r),void 0===l[i=c[0]+","+c[1]]?l[i]={index1:c[0],index2:c[1],face1:p,face2:void 0}:l[i].face2=p;for(i in l){var v=l[i];if(void 0===v.face2||d[v.face1].normal.dot(d[v.face2].normal)<=s){var b=h[v.index1];o.push(b.x,b.y,b.z),b=h[v.index2],o.push(b.x,b.y,b.z)}}this.addAttribute("position",new ot(o,3))}function Wr(e,t,n,r,i,a,o,s){Ke.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new Jr(e,t,n,r,i,a,o,s)),this.mergeVertices()}function Jr(e,t,n,r,i,a,o,s){vt.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};var c=this;e=void 0!==e?e:1,t=void 0!==t?t:1,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,a=void 0!==a&&a,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var l=[],u=[],h=[],d=[],p=0,f=[],m=n/2,y=0;function v(n){var i,a,f,v=new g,w=new b,A=0,E=!0===n?e:t,x=!0===n?1:-1;for(a=p,i=1;i<=r;i++)u.push(0,m*x,0),h.push(0,x,0),d.push(.5,.5),p++;for(f=p,i=0;i<=r;i++){var _=i/r*s+o,S=Math.cos(_),M=Math.sin(_);w.x=E*M,w.y=m*x,w.z=E*S,u.push(w.x,w.y,w.z),h.push(0,x,0),v.x=.5*S+.5,v.y=.5*M*x+.5,d.push(v.x,v.y),p++}for(i=0;i<r;i++){var T=a+i,R=f+i;!0===n?l.push(R,R+1,T):l.push(R+1,R,T),A+=3}c.addGroup(y,A,!0===n?1:2),y+=A}!function(){var a,g,v=new b,w=new b,A=0,E=(t-e)/n;for(g=0;g<=i;g++){var x=[],_=g/i,S=_*(t-e)+e;for(a=0;a<=r;a++){var M=a/r,T=M*s+o,R=Math.sin(T),k=Math.cos(T);w.x=S*R,w.y=-_*n+m,w.z=S*k,u.push(w.x,w.y,w.z),v.set(R,E,k).normalize(),h.push(v.x,v.y,v.z),d.push(M,1-_),x.push(p++)}f.push(x)}for(a=0;a<r;a++)for(g=0;g<i;g++){var C=f[g][a],O=f[g+1][a],P=f[g+1][a+1],I=f[g][a+1];l.push(C,O,I),l.push(O,P,I),A+=6}c.addGroup(y,A,0),y+=A}(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.addAttribute("position",new ot(u,3)),this.addAttribute("normal",new ot(h,3)),this.addAttribute("uv",new ot(d,2))}function Zr(e,t,n,r,i,a,o){Wr.call(this,0,e,t,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function Xr(e,t,n,r,i,a,o){Jr.call(this,0,e,t,n,r,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function Yr(e,t,n,r){Ke.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Kr(e,t,n,r)),this.mergeVertices()}function Kr(e,t,n,r){vt.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,a,o=[],s=[],c=[],l=[],u=new b,h=new g;for(s.push(0,0,0),c.push(0,0,1),l.push(.5,.5),a=0,i=3;a<=t;a++,i+=3){var d=n+a/t*r;u.x=e*Math.cos(d),u.y=e*Math.sin(d),s.push(u.x,u.y,u.z),c.push(0,0,1),h.x=(s[i]/e+1)/2,h.y=(s[i+1]/e+1)/2,l.push(h.x,h.y)}for(i=1;i<=t;i++)o.push(i,i+1,0);this.setIndex(o),this.addAttribute("position",new ot(s,3)),this.addAttribute("normal",new ot(c,3)),this.addAttribute("uv",new ot(l,2))}Pr.prototype=Object.create(Ke.prototype),Pr.prototype.constructor=Pr,Ir.prototype=Object.create(vt.prototype),Ir.prototype.constructor=Ir,Ir.prototype.getArrays=function(){var e=this.getAttribute("position"),t=e?Array.prototype.slice.call(e.array):[],n=this.getAttribute("uv"),r=n?Array.prototype.slice.call(n.array):[],i=this.index;return{position:t,uv:r,index:i?Array.prototype.slice.call(i.array):[]}},Ir.prototype.addShapeList=function(e,t){var n=e.length;t.arrays=this.getArrays();for(var r=0;r<n;r++){var i=e[r];this.addShape(i,t)}this.setIndex(t.arrays.index),this.addAttribute("position",new ot(t.arrays.position,3)),this.addAttribute("uv",new ot(t.arrays.uv,2))},Ir.prototype.addShape=function(e,t){var n,r,i,a,o,s,c,l,u=t.arrays?t.arrays:this.getArrays(),h=u.position,d=u.index,p=u.uv,f=[],m=void 0!==t.amount?t.amount:100,y=void 0!==t.bevelThickness?t.bevelThickness:6,v=void 0!==t.bevelSize?t.bevelSize:y-2,w=void 0!==t.bevelSegments?t.bevelSegments:3,A=void 0===t.bevelEnabled||t.bevelEnabled,E=void 0!==t.curveSegments?t.curveSegments:12,x=void 0!==t.steps?t.steps:1,_=t.extrudePath,S=!1,M=void 0!==t.UVGenerator?t.UVGenerator:Pr.WorldUVGenerator;_&&(n=_.getSpacedPoints(x),S=!0,A=!1,r=void 0!==t.frames?t.frames:_.computeFrenetFrames(x,!1),i=new b,a=new b,o=new b),A||(w=0,y=0,v=0);var T=this,R=e.extractPoints(E),k=R.shape,C=R.holes;if(!kr.isClockWise(k))for(k=k.reverse(),c=0,l=C.length;c<l;c++)s=C[c],kr.isClockWise(s)&&(C[c]=s.reverse());var O=kr.triangulateShape(k,C),P=k;for(c=0,l=C.length;c<l;c++)s=C[c],k=k.concat(s);function I(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var N,L,D,F,j,U,B=k.length,V=O.length;function z(e,t,n){var r,i,a,o=e.x-t.x,s=e.y-t.y,c=n.x-e.x,l=n.y-e.y,u=o*o+s*s,h=o*l-s*c;if(Math.abs(h)>Number.EPSILON){var d=Math.sqrt(u),p=Math.sqrt(c*c+l*l),f=t.x-s/d,m=t.y+o/d,y=((n.x-l/p-f)*l-(n.y+c/p-m)*c)/(o*l-s*c),v=(r=f+o*y-e.x)*r+(i=m+s*y-e.y)*i;if(v<=2)return new g(r,i);a=Math.sqrt(v/2)}else{var b=!1;o>Number.EPSILON?c>Number.EPSILON&&(b=!0):o<-Number.EPSILON?c<-Number.EPSILON&&(b=!0):Math.sign(s)===Math.sign(l)&&(b=!0),b?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new g(r/a,i/a)}for(var H=[],G=0,q=P.length,W=q-1,J=G+1;G<q;G++,W++,J++)W===q&&(W=0),J===q&&(J=0),H[G]=z(P[G],P[W],P[J]);var Z,X,Y=[],K=H.concat();for(c=0,l=C.length;c<l;c++){for(s=C[c],Z=[],G=0,W=(q=s.length)-1,J=G+1;G<q;G++,W++,J++)W===q&&(W=0),J===q&&(J=0),Z[G]=z(s[G],s[W],s[J]);Y.push(Z),K=K.concat(Z)}for(N=0;N<w;N++){for(D=N/w,F=y*Math.cos(D*Math.PI/2),L=v*Math.sin(D*Math.PI/2),G=0,q=P.length;G<q;G++)$((j=I(P[G],H[G],L)).x,j.y,-F);for(c=0,l=C.length;c<l;c++)for(s=C[c],Z=Y[c],G=0,q=s.length;G<q;G++)$((j=I(s[G],Z[G],L)).x,j.y,-F)}for(L=v,G=0;G<B;G++)j=A?I(k[G],K[G],L):k[G],S?(a.copy(r.normals[0]).multiplyScalar(j.x),i.copy(r.binormals[0]).multiplyScalar(j.y),o.copy(n[0]).add(a).add(i),$(o.x,o.y,o.z)):$(j.x,j.y,0);for(X=1;X<=x;X++)for(G=0;G<B;G++)j=A?I(k[G],K[G],L):k[G],S?(a.copy(r.normals[X]).multiplyScalar(j.x),i.copy(r.binormals[X]).multiplyScalar(j.y),o.copy(n[X]).add(a).add(i),$(o.x,o.y,o.z)):$(j.x,j.y,m/x*X);for(N=w-1;N>=0;N--){for(D=N/w,F=y*Math.cos(D*Math.PI/2),L=v*Math.sin(D*Math.PI/2),G=0,q=P.length;G<q;G++)$((j=I(P[G],H[G],L)).x,j.y,m+F);for(c=0,l=C.length;c<l;c++)for(s=C[c],Z=Y[c],G=0,q=s.length;G<q;G++)j=I(s[G],Z[G],L),S?$(j.x,j.y+n[x-1].y,n[x-1].x+F):$(j.x,j.y,m+F)}function Q(e,t){var n,r;for(G=e.length;--G>=0;){n=G,(r=G-1)<0&&(r=e.length-1);var i=0,a=x+2*w;for(i=0;i<a;i++){var o=B*i,s=B*(i+1);te(t+n+o,t+r+o,t+r+s,t+n+s)}}}function $(e,t,n){f.push(e),f.push(t),f.push(n)}function ee(e,t,n){ne(e),ne(t),ne(n);var r=h.length/3,i=M.generateTopUV(T,h,r-3,r-2,r-1);re(i[0]),re(i[1]),re(i[2])}function te(e,t,n,r){ne(e),ne(t),ne(r),ne(t),ne(n),ne(r);var i=h.length/3,a=M.generateSideWallUV(T,h,i-6,i-3,i-2,i-1);re(a[0]),re(a[1]),re(a[3]),re(a[1]),re(a[2]),re(a[3])}function ne(e){d.push(h.length/3),h.push(f[3*e+0]),h.push(f[3*e+1]),h.push(f[3*e+2])}function re(e){p.push(e.x),p.push(e.y)}!function(){var e=h.length/3;if(A){var n=0,r=B*n;for(G=0;G<V;G++)ee((U=O[G])[2]+r,U[1]+r,U[0]+r);for(r=B*(n=x+2*w),G=0;G<V;G++)ee((U=O[G])[0]+r,U[1]+r,U[2]+r)}else{for(G=0;G<V;G++)ee((U=O[G])[2],U[1],U[0]);for(G=0;G<V;G++)ee((U=O[G])[0]+B*x,U[1]+B*x,U[2]+B*x)}T.addGroup(e,h.length/3-e,void 0!==t.material?t.material:0)}(),function(){var e=h.length/3,n=0;for(Q(P,n),n+=P.length,c=0,l=C.length;c<l;c++)Q(s=C[c],n),n+=s.length;T.addGroup(e,h.length/3-e,void 0!==t.extrudeMaterial?t.extrudeMaterial:1)}(),t.arrays||(this.setIndex(d),this.addAttribute("position",new ot(h,3)),this.addAttribute("uv",new ot(p,2)))},Pr.WorldUVGenerator={generateTopUV:function(e,t,n,r,i){var a=t[3*n],o=t[3*n+1],s=t[3*r],c=t[3*r+1],l=t[3*i],u=t[3*i+1];return[new g(a,o),new g(s,c),new g(l,u)]},generateSideWallUV:function(e,t,n,r,i,a){var o=t[3*n],s=t[3*n+1],c=t[3*n+2],l=t[3*r],u=t[3*r+1],h=t[3*r+2],d=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*a],y=t[3*a+1],v=t[3*a+2];return Math.abs(s-u)<.01?[new g(o,1-c),new g(l,1-h),new g(d,1-f),new g(m,1-v)]:[new g(s,1-c),new g(u,1-h),new g(p,1-f),new g(y,1-v)]}},Nr.prototype=Object.create(Ke.prototype),Nr.prototype.constructor=Nr,Lr.prototype=Object.create(Ir.prototype),Lr.prototype.constructor=Lr,Dr.prototype=Object.create(Ke.prototype),Dr.prototype.constructor=Dr,Fr.prototype=Object.create(vt.prototype),Fr.prototype.constructor=Fr,jr.prototype=Object.create(Ke.prototype),jr.prototype.constructor=jr,Ur.prototype=Object.create(vt.prototype),Ur.prototype.constructor=Ur,Br.prototype=Object.create(Ke.prototype),Br.prototype.constructor=Br,Vr.prototype=Object.create(vt.prototype),Vr.prototype.constructor=Vr,zr.prototype=Object.create(Ke.prototype),zr.prototype.constructor=zr,zr.prototype.toJSON=function(){var e=Ke.prototype.toJSON.call(this);return Gr(this.parameters.shapes,e)},Hr.prototype=Object.create(vt.prototype),Hr.prototype.constructor=Hr,Hr.prototype.toJSON=function(){var e=vt.prototype.toJSON.call(this);return Gr(this.parameters.shapes,e)},qr.prototype=Object.create(vt.prototype),qr.prototype.constructor=qr,Wr.prototype=Object.create(Ke.prototype),Wr.prototype.constructor=Wr,Jr.prototype=Object.create(vt.prototype),Jr.prototype.constructor=Jr,Zr.prototype=Object.create(Wr.prototype),Zr.prototype.constructor=Zr,Xr.prototype=Object.create(Jr.prototype),Xr.prototype.constructor=Xr,Yr.prototype=Object.create(Ke.prototype),Yr.prototype.constructor=Yr,Kr.prototype=Object.create(vt.prototype),Kr.prototype.constructor=Kr;var Qr=Object.freeze({WireframeGeometry:zn,ParametricGeometry:Hn,ParametricBufferGeometry:Gn,TetrahedronGeometry:Jn,TetrahedronBufferGeometry:Zn,OctahedronGeometry:Xn,OctahedronBufferGeometry:Yn,IcosahedronGeometry:Kn,IcosahedronBufferGeometry:Qn,DodecahedronGeometry:$n,DodecahedronBufferGeometry:er,PolyhedronGeometry:qn,PolyhedronBufferGeometry:Wn,TubeGeometry:tr,TubeBufferGeometry:nr,TorusKnotGeometry:rr,TorusKnotBufferGeometry:ir,TorusGeometry:ar,TorusBufferGeometry:or,TextGeometry:Nr,TextBufferGeometry:Lr,SphereGeometry:Dr,SphereBufferGeometry:Fr,RingGeometry:jr,RingBufferGeometry:Ur,PlaneGeometry:At,PlaneBufferGeometry:Et,LatheGeometry:Br,LatheBufferGeometry:Vr,ShapeGeometry:zr,ShapeBufferGeometry:Hr,ExtrudeGeometry:Pr,ExtrudeBufferGeometry:Ir,EdgesGeometry:qr,ConeGeometry:Zr,ConeBufferGeometry:Xr,CylinderGeometry:Wr,CylinderBufferGeometry:Jr,CircleGeometry:Yr,CircleBufferGeometry:Kr,BoxGeometry:bt,BoxBufferGeometry:wt});function $r(e){ke.call(this),this.type="ShadowMaterial",this.color=new fe(0),this.opacity=1,this.lights=!0,this.transparent=!0,this.setValues(e)}function ei(e){_t.call(this,e),this.type="RawShaderMaterial"}function ti(e){ke.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new fe(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ni(e){ti.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(e)}function ri(e){ke.call(this),this.type="MeshPhongMaterial",this.color=new fe(16777215),this.specular=new fe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ii(e){ri.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function ai(e){ke.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function oi(e){ke.call(this),this.type="MeshLambertMaterial",this.color=new fe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function si(e){Pn.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}$r.prototype=Object.create(ke.prototype),$r.prototype.constructor=$r,$r.prototype.isShadowMaterial=!0,ei.prototype=Object.create(_t.prototype),ei.prototype.constructor=ei,ei.prototype.isRawShaderMaterial=!0,ti.prototype=Object.create(ke.prototype),ti.prototype.constructor=ti,ti.prototype.isMeshStandardMaterial=!0,ti.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ni.prototype=Object.create(ti.prototype),ni.prototype.constructor=ni,ni.prototype.isMeshPhysicalMaterial=!0,ni.prototype.copy=function(e){return ti.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},ri.prototype=Object.create(ke.prototype),ri.prototype.constructor=ri,ri.prototype.isMeshPhongMaterial=!0,ri.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ii.prototype=Object.create(ri.prototype),ii.prototype.constructor=ii,ii.prototype.isMeshToonMaterial=!0,ii.prototype.copy=function(e){return ri.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},ai.prototype=Object.create(ke.prototype),ai.prototype.constructor=ai,ai.prototype.isMeshNormalMaterial=!0,ai.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},oi.prototype=Object.create(ke.prototype),oi.prototype.constructor=oi,oi.prototype.isMeshLambertMaterial=!0,oi.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},si.prototype=Object.create(Pn.prototype),si.prototype.constructor=si,si.prototype.isLineDashedMaterial=!0,si.prototype.copy=function(e){return Pn.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var ci=Object.freeze({ShadowMaterial:$r,SpriteMaterial:Mn,RawShaderMaterial:ei,ShaderMaterial:_t,PointsMaterial:Dn,MeshPhysicalMaterial:ni,MeshStandardMaterial:ti,MeshPhongMaterial:ri,MeshToonMaterial:ii,MeshNormalMaterial:ai,MeshLambertMaterial:oi,MeshDepthMaterial:Ce,MeshDistanceMaterial:Oe,MeshBasicMaterial:xt,LineDashedMaterial:si,LineBasicMaterial:Pn,Material:ke}),li={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function ui(e,t,n){var r=this,i=!1,a=0,o=0,s=void 0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===i&&void 0!==r.onStart&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this}}var hi=new ui,di={};function pi(e){this.manager=void 0!==e?e:hi}function fi(e){this.manager=void 0!==e?e:hi,this._parser=null}function mi(e){this.manager=void 0!==e?e:hi}function gi(e){this.manager=void 0!==e?e:hi}function yi(e){this.manager=void 0!==e?e:hi}function vi(){this.type="Curve",this.arcLengthDivisions=200}function bi(e,t,n,r,i,a,o,s){vi.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function wi(e,t,n,r,i,a){bi.call(this,e,t,n,n,r,i,a),this.type="ArcCurve"}function Ai(){var e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){var c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;i(t,n,c*=o,l*=o)},calc:function(i){var a=i*i;return e+t*i+n*a+r*(a*i)}}}Object.assign(pi.prototype,{load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=li.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;if(void 0===di[e]){var o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],c=!!o[2],l=o[3];l=window.decodeURIComponent(l),c&&(l=window.atob(l));try{var u,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var d=new Uint8Array(l.length),p=0;p<l.length;p++)d[p]=l.charCodeAt(p);u="blob"===h?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var f=new DOMParser;u=f.parseFromString(l,s);break;case"json":u=JSON.parse(l);break;default:u=l}window.setTimeout((function(){t&&t(u),i.manager.itemEnd(e)}),0)}catch(t){window.setTimeout((function(){r&&r(t),i.manager.itemEnd(e),i.manager.itemError(e)}),0)}}else{di[e]=[],di[e].push({onLoad:t,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var g in m.open("GET",e,!0),m.addEventListener("load",(function(t){var n=this.response;li.add(e,n);var r=di[e];if(delete di[e],200===this.status){for(var a=0,o=r.length;a<o;a++){(s=r[a]).onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else if(0===this.status){console.warn("THREE.FileLoader: HTTP Status 0 received.");for(a=0,o=r.length;a<o;a++){(s=r[a]).onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else{for(a=0,o=r.length;a<o;a++){var s;(s=r[a]).onError&&s.onError(t)}i.manager.itemEnd(e),i.manager.itemError(e)}}),!1),m.addEventListener("progress",(function(t){for(var n=di[e],r=0,i=n.length;r<i;r++){var a=n[r];a.onProgress&&a.onProgress(t)}}),!1),m.addEventListener("error",(function(t){var n=di[e];delete di[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemEnd(e),i.manager.itemError(e)}),!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return i.manager.itemStart(e),m}di[e].push({onLoad:t,onProgress:n,onError:r})},setPath:function(e){return this.path=e,this},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),Object.assign(function(e){this.manager=void 0!==e?e:hi,this._parser=null}.prototype,{load:function(e,t,n,r){var i=this,a=[],o=new Bn;o.image=a;var s=new pi(this.manager);function c(c){s.load(e[c],(function(e){var n=i._parser(e,!0);a[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(l+=1)&&(1===n.mipmapCount&&(o.minFilter=1006),o.format=n.format,o.needsUpdate=!0,t&&t(o))}),n,r)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var l=0,u=0,h=e.length;u<h;++u)c(u);else s.load(e,(function(e){var n=i._parser(e,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){a[s]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),a[s].format=n.format,a[s].width=n.width,a[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=1006),o.format=n.format,o.needsUpdate=!0,t&&t(o)}),n,r);return o},setPath:function(e){return this.path=e,this}}),Object.assign(fi.prototype,{load:function(e,t,n,r){var i=this,a=new M,o=new pi(this.manager);return o.setResponseType("arraybuffer"),o.load(e,(function(e){var n=i._parser(e);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:1001,a.wrapT=void 0!==n.wrapT?n.wrapT:1001,a.magFilter=void 0!==n.magFilter?n.magFilter:1006,a.minFilter=void 0!==n.minFilter?n.minFilter:1008,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps),1===n.mipmapCount&&(a.minFilter=1006),a.needsUpdate=!0,t&&t(a,n))}),n,r),a}}),Object.assign(mi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=li.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");return o.addEventListener("load",(function(){li.add(e,this),t&&t(this),i.manager.itemEnd(e)}),!1),o.addEventListener("error",(function(t){r&&r(t),i.manager.itemEnd(e),i.manager.itemError(e)}),!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(gi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){var i=new T,a=new mi(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(n){a.load(e[n],(function(e){i.images[n]=e,6===++o&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(var c=0;c<e.length;++c)s(c);return i},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(yi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){var i=new E,a=new mi(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(n){i.image=n;var r=e.search(/\.(jpg|jpeg)$/)>0||0===e.search(/^data\:image\/jpeg/);i.format=r?1022:1023,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(vi.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,r=[],i=this.getPoint(0),a=0;for(r.push(0),n=1;n<=e;n++)a+=(t=this.getPoint(n/e)).distanceTo(i),r.push(a),i=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(o>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(a-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(a-1)},getTangent:function(e){var t=e-1e-4,n=e+1e-4;t<0&&(t=0),n>1&&(n=1);var r=this.getPoint(t);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,r,i,a=new b,o=[],s=[],c=[],l=new b,u=new y;for(n=0;n<=e;n++)r=n/e,o[n]=this.getTangentAt(r),o[n].normalize();s[0]=new b,c[0]=new b;var h=Number.MAX_VALUE,d=Math.abs(o[0].x),p=Math.abs(o[0].y),f=Math.abs(o[0].z);for(d<=h&&(h=d,a.set(1,0,0)),p<=h&&(h=p,a.set(0,1,0)),f<=h&&a.set(0,0,1),l.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],l),c[0].crossVectors(o[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),l.crossVectors(o[n-1],o[n]),l.length()>Number.EPSILON&&(l.normalize(),i=Math.acos(m.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(l,i))),c[n].crossVectors(o[n],s[n]);if(!0===t)for(i=Math.acos(m.clamp(s[0].dot(s[e]),-1,1)),i/=e,o[0].dot(l.crossVectors(s[0],s[e]))>0&&(i=-i),n=1;n<=e;n++)s[n].applyMatrix4(u.makeRotationAxis(o[n],i*n)),c[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),bi.prototype=Object.create(vi.prototype),bi.prototype.constructor=bi,bi.prototype.isEllipseCurve=!0,bi.prototype.getPoint=function(e,t){for(var n=t||new g,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);var o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var l=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,d=c-this.aY;s=h*l-d*u+this.aX,c=h*u+d*l+this.aY}return n.set(s,c)},bi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},bi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},bi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},wi.prototype=Object.create(bi.prototype),wi.prototype.constructor=wi,wi.prototype.isArcCurve=!0;var Ei=new b,xi=new Ai,_i=new Ai,Si=new Ai;function Mi(e,t,n,r){vi.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=r||.5}function Ti(e,t,n,r,i){var a=.5*(r-t),o=.5*(i-n),s=e*e;return(2*n-2*r+a+o)*(e*s)+(-3*n+3*r-2*a-o)*s+a*e+n}function Ri(e,t,n,r){return function(e,t){var n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function ki(e,t,n,r,i){return function(e,t){var n=1-e;return n*n*n*t}(e,t)+function(e,t){var n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}function Ci(e,t,n,r){vi.call(this),this.type="CubicBezierCurve",this.v0=e||new g,this.v1=t||new g,this.v2=n||new g,this.v3=r||new g}function Oi(e,t,n,r){vi.call(this),this.type="CubicBezierCurve3",this.v0=e||new b,this.v1=t||new b,this.v2=n||new b,this.v3=r||new b}function Pi(e,t){vi.call(this),this.type="LineCurve",this.v1=e||new g,this.v2=t||new g}function Ii(e,t){vi.call(this),this.type="LineCurve3",this.v1=e||new b,this.v2=t||new b}function Ni(e,t,n){vi.call(this),this.type="QuadraticBezierCurve",this.v0=e||new g,this.v1=t||new g,this.v2=n||new g}function Li(e,t,n){vi.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new b,this.v1=t||new b,this.v2=n||new b}function Di(e){vi.call(this),this.type="SplineCurve",this.points=e||[]}Mi.prototype=Object.create(vi.prototype),Mi.prototype.constructor=Mi,Mi.prototype.isCatmullRomCurve3=!0,Mi.prototype.getPoint=function(e,t){var n,r,i,a,o=t||new b,s=this.points,c=s.length,l=(c-(this.closed?0:1))*e,u=Math.floor(l),h=l-u;if(this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/s.length)+1)*s.length:0===h&&u===c-1&&(u=c-2,h=1),this.closed||u>0?n=s[(u-1)%c]:(Ei.subVectors(s[0],s[1]).add(s[0]),n=Ei),r=s[u%c],i=s[(u+1)%c],this.closed||u+2<c?a=s[(u+2)%c]:(Ei.subVectors(s[c-1],s[c-2]).add(s[c-1]),a=Ei),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(n.distanceToSquared(r),d),f=Math.pow(r.distanceToSquared(i),d),m=Math.pow(i.distanceToSquared(a),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),xi.initNonuniformCatmullRom(n.x,r.x,i.x,a.x,p,f,m),_i.initNonuniformCatmullRom(n.y,r.y,i.y,a.y,p,f,m),Si.initNonuniformCatmullRom(n.z,r.z,i.z,a.z,p,f,m)}else"catmullrom"===this.curveType&&(xi.initCatmullRom(n.x,r.x,i.x,a.x,this.tension),_i.initCatmullRom(n.y,r.y,i.y,a.y,this.tension),Si.initCatmullRom(n.z,r.z,i.z,a.z,this.tension));return o.set(xi.calc(h),_i.calc(h),Si.calc(h)),o},Mi.prototype.copy=function(e){vi.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Mi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},Mi.prototype.fromJSON=function(e){vi.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new b).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Ci.prototype=Object.create(vi.prototype),Ci.prototype.constructor=Ci,Ci.prototype.isCubicBezierCurve=!0,Ci.prototype.getPoint=function(e,t){var n=t||new g,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(ki(e,r.x,i.x,a.x,o.x),ki(e,r.y,i.y,a.y,o.y)),n},Ci.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Ci.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Ci.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Oi.prototype=Object.create(vi.prototype),Oi.prototype.constructor=Oi,Oi.prototype.isCubicBezierCurve3=!0,Oi.prototype.getPoint=function(e,t){var n=t||new b,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(ki(e,r.x,i.x,a.x,o.x),ki(e,r.y,i.y,a.y,o.y),ki(e,r.z,i.z,a.z,o.z)),n},Oi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Oi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Oi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Pi.prototype=Object.create(vi.prototype),Pi.prototype.constructor=Pi,Pi.prototype.isLineCurve=!0,Pi.prototype.getPoint=function(e,t){var n=t||new g;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Pi.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Pi.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Pi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Pi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Pi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Ii.prototype=Object.create(vi.prototype),Ii.prototype.constructor=Ii,Ii.prototype.isLineCurve3=!0,Ii.prototype.getPoint=function(e,t){var n=t||new b;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Ii.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Ii.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Ii.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Ii.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Ni.prototype=Object.create(vi.prototype),Ni.prototype.constructor=Ni,Ni.prototype.isQuadraticBezierCurve=!0,Ni.prototype.getPoint=function(e,t){var n=t||new g,r=this.v0,i=this.v1,a=this.v2;return n.set(Ri(e,r.x,i.x,a.x),Ri(e,r.y,i.y,a.y)),n},Ni.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Ni.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Ni.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Li.prototype=Object.create(vi.prototype),Li.prototype.constructor=Li,Li.prototype.isQuadraticBezierCurve3=!0,Li.prototype.getPoint=function(e,t){var n=t||new b,r=this.v0,i=this.v1,a=this.v2;return n.set(Ri(e,r.x,i.x,a.x),Ri(e,r.y,i.y,a.y),Ri(e,r.z,i.z,a.z)),n},Li.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Li.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Li.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Di.prototype=Object.create(vi.prototype),Di.prototype.constructor=Di,Di.prototype.isSplineCurve=!0,Di.prototype.getPoint=function(e,t){var n=t||new g,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],c=r[a],l=r[a>r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(Ti(o,s.x,c.x,l.x,u.x),Ti(o,s.y,c.y,l.y,u.y)),n},Di.prototype.copy=function(e){vi.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},Di.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},Di.prototype.fromJSON=function(e){vi.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new g).fromArray(r))}return this};var Fi=Object.freeze({ArcCurve:wi,CatmullRomCurve3:Mi,CubicBezierCurve:Ci,CubicBezierCurve3:Oi,EllipseCurve:bi,LineCurve:Pi,LineCurve3:Ii,QuadraticBezierCurve:Ni,QuadraticBezierCurve3:Li,SplineCurve:Di});function ji(){vi.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Ui(e){ji.call(this),this.type="Path",this.currentPoint=new g,e&&this.setFromPoints(e)}function Bi(e){Ui.call(this,e),this.uuid=m.generateUUID(),this.type="Shape",this.holes=[]}function Vi(e,t){qe.call(this),this.type="Light",this.color=new fe(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function zi(e,t,n){Vi.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(qe.DefaultUp),this.updateMatrix(),this.groundColor=new fe(t)}function Hi(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new g(512,512),this.map=null,this.matrix=new y}function Gi(){Hi.call(this,new nn(50,1,.5,500))}function qi(e,t,n,r,i,a){Vi.call(this,e,t),this.type="SpotLight",this.position.copy(qe.DefaultUp),this.updateMatrix(),this.target=new qe,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new Gi}function Wi(e,t,n,r){Vi.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new Hi(new nn(90,1,.5,500))}function Ji(){Hi.call(this,new Je(-5,5,5,-5,.5,500))}function Zi(e,t){Vi.call(this,e,t),this.type="DirectionalLight",this.position.copy(qe.DefaultUp),this.updateMatrix(),this.target=new qe,this.shadow=new Ji}function Xi(e,t){Vi.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function Yi(e,t,n,r){Vi.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function Ki(e,t,n,r){ca.call(this,e,t,n,r)}function Qi(e,t,n){ca.call(this,e,t,n)}function $i(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function ea(e,t,n,r){$i.call(this,e,t,n,r)}function ta(e,t,n,r){ca.call(this,e,t,n,r)}function na(e,t,n,r){ca.call(this,e,t,n,r)}function ra(e,t,n,r){ca.call(this,e,t,n,r)}function ia(e,t,n,r){$i.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function aa(e,t,n,r){$i.call(this,e,t,n,r)}function oa(e,t,n,r){$i.call(this,e,t,n,r)}ji.prototype=Object.assign(Object.create(vi.prototype),{constructor:ji,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Pi(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?2*e:a&&a.isLineCurve?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),c=0;c<s.length;c++){var l=s[c];t&&t.equals(l)||(n.push(l),t=l)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){vi.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=vi.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){vi.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Fi[r.type]).fromJSON(r))}return this}}),Ui.prototype=Object.assign(Object.create(ji.prototype),{constructor:Ui,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y)},moveTo:function(e,t){this.currentPoint.set(e,t)},lineTo:function(e,t){var n=new Pi(this.currentPoint.clone(),new g(e,t));this.curves.push(n),this.currentPoint.set(e,t)},quadraticCurveTo:function(e,t,n,r){var i=new Ni(this.currentPoint.clone(),new g(e,t),new g(n,r));this.curves.push(i),this.currentPoint.set(n,r)},bezierCurveTo:function(e,t,n,r,i,a){var o=new Ci(this.currentPoint.clone(),new g(e,t),new g(n,r),new g(i,a));this.curves.push(o),this.currentPoint.set(i,a)},splineThru:function(e){var t=new Di([this.currentPoint.clone()].concat(e));this.curves.push(t),this.currentPoint.copy(e[e.length-1])},arc:function(e,t,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;this.absarc(e+o,t+s,n,r,i,a)},absarc:function(e,t,n,r,i,a){this.absellipse(e,t,n,n,r,i,a)},ellipse:function(e,t,n,r,i,a,o,s){var c=this.currentPoint.x,l=this.currentPoint.y;this.absellipse(e+c,t+l,n,r,i,a,o,s)},absellipse:function(e,t,n,r,i,a,o,s){var c=new bi(e,t,n,r,i,a,o,s);if(this.curves.length>0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var u=c.getPoint(1);this.currentPoint.copy(u)},copy:function(e){return ji.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=ji.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return ji.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Bi.prototype=Object.assign(Object.create(Ui.prototype),{constructor:Bi,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Ui.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=Ui.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){Ui.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new Ui).fromJSON(r))}return this}}),Vi.prototype=Object.assign(Object.create(qe.prototype),{constructor:Vi,isLight:!0,copy:function(e){return qe.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=qe.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),zi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:zi,isHemisphereLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(Hi.prototype,{copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),Gi.prototype=Object.assign(Object.create(Hi.prototype),{constructor:Gi,isSpotLightShadow:!0,update:function(e){var t=this.camera,n=2*m.RAD2DEG*e.angle,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix())}}),qi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:qi,isSpotLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Wi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Wi,isPointLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Ji.prototype=Object.assign(Object.create(Hi.prototype),{constructor:Ji}),Zi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Zi,isDirectionalLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Xi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Xi,isAmbientLight:!0}),Yi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Yi,isRectAreaLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=Vi.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),Ki.prototype=Object.assign(Object.create(ca.prototype),{constructor:Ki,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Qi.prototype=Object.assign(Object.create(ca.prototype),{constructor:Qi,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Object.assign($i.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var a;n:{r:if(!(e<r)){for(var o=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===o)break;if(i=r,e<(r=t[++n]))break t}a=t.length;break n}if(e>=i)break e;var s=t[1];e<s&&(n=2,i=s);for(o=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===o)break;if(r=i,e>=(i=t[--n-1]))break t}a=n,n=0}for(;n<a;){var c=n+a>>>1;e<t[c]?a=c:n=c+1}if(r=t[n],void 0===(i=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,a=0;a!==r;++a)t[a]=n[i+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),
+//!\ DECLARE ALIAS AFTER assign prototype !
+Object.assign($i.prototype,{beforeStart_:$i.prototype.copySampleValue_,afterEnd_:$i.prototype.copySampleValue_}),ea.prototype=Object.assign(Object.create($i.prototype),{constructor:ea,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=(n-t)/(r-t),l=s+o;s!==l;s+=4)v.slerpFlat(i,0,a,s-o,a,s,c);return i}}),ta.prototype=Object.assign(Object.create(ca.prototype),{constructor:ta,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new ea(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),na.prototype=Object.assign(Object.create(ca.prototype),{constructor:na,ValueTypeName:"color"}),ra.prototype=Object.assign(Object.create(ca.prototype),{constructor:ra,ValueTypeName:"number"}),ia.prototype=Object.assign(Object.create($i.prototype),{constructor:ia,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(e,t,n){var r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:i=e,o=2*t-n;break;case 2402:o=t+r[i=r.length-2]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:a=e,s=2*n-t;break;case 2402:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}var c=.5*(n-t),l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=a*l},interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(n-t)/(r-t),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,y=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,v=(-1-d)*m+(1.5+d)*f+.5*p,b=d*m-d*f,w=0;w!==o;++w)i[w]=g*a[l+w]+y*a[c+w]+v*a[s+w]+b*a[u+w];return i}}),aa.prototype=Object.assign(Object.create($i.prototype),{constructor:aa,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(n-t)/(r-t),u=1-l,h=0;h!==o;++h)i[h]=a[c+h]*u+a[s+h]*l;return i}}),oa.prototype=Object.assign(Object.create($i.prototype),{constructor:oa,interpolate_:function(e){return this.copySampleValue_(e-1)}});var sa={arraySlice:function(e,t,n){return sa.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),r=0;r!==t;++r)n[r]=r;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*t,c=0;c!==t;++c)i[o++]=e[s+c];return i},flattenJSON:function(e,t,n,r){for(var i=1,a=e[0];void 0!==a&&void 0===a[r];)a=e[i++];if(void 0!==a){var o=a[r];if(void 0!==o)if(Array.isArray(o))do{void 0!==(o=a[r])&&(t.push(a.time),n.push.apply(n,o)),a=e[i++]}while(void 0!==a);else if(void 0!==o.toArray)do{void 0!==(o=a[r])&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++]}while(void 0!==a);else do{void 0!==(o=a[r])&&(t.push(a.time),n.push(o)),a=e[i++]}while(void 0!==a)}}};function ca(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=sa.convertArray(t,this.TimeBufferType),this.values=sa.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation),this.validate(),this.optimize()}function la(e,t,n,r){ca.call(this,e,t,n,r)}function ua(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=m.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function ha(e){this.manager=void 0!==e?e:hi,this.textures={}}function da(e){this.manager=void 0!==e?e:hi}Object.assign(ca,{parse:function(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=ca._getTrackTypeForValueTypeName(e.type);if(void 0===e.times){var n=[],r=[];sa.flattenJSON(e.keys,n,r,"value"),e.times=n,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)},toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:sa.convertArray(e.times,Array),values:sa.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t},_getTrackTypeForValueTypeName:function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ra;case"vector":case"vector2":case"vector3":case"vector4":return la;case"color":return na;case"quaternion":return ta;case"bool":case"boolean":return Qi;case"string":return Ki}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}}),Object.assign(ca.prototype,{constructor:ca,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(e){return new oa(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new aa(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new ia(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0!==t)this.createInterpolant=t;else{var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}console.warn("THREE.KeyframeTrack:",n)}},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<e;)++i;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==i||a!==r){i>=a&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=sa.arraySlice(n,i,a),this.values=sa.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==r&&sa.isTypedArray(r)){o=0;for(var c=r.length;o!==c;++o){var l=r[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),e=!1;break}}}return e},optimize:function(){for(var e=this.times,t=this.values,n=this.getValueSize(),r=2302===this.getInterpolation(),i=1,a=e.length-1,o=1;o<a;++o){var s=!1,c=e[o];if(c!==e[o+1]&&(1!==o||c!==c[0]))if(r)s=!0;else for(var l=o*n,u=l-n,h=l+n,d=0;d!==n;++d){var p=t[l+d];if(p!==t[u+d]||p!==t[h+d]){s=!0;break}}if(s){if(o!==i){e[i]=e[o];var f=o*n,m=i*n;for(d=0;d!==n;++d)t[m+d]=t[f+d]}++i}}if(a>0){e[i]=e[a];for(f=a*n,m=i*n,d=0;d!==n;++d)t[m+d]=t[f+d];++i}return i!==e.length&&(this.times=sa.arraySlice(e,0,i),this.values=sa.arraySlice(t,0,i*n)),this}}),la.prototype=Object.assign(Object.create(ca.prototype),{constructor:la,ValueTypeName:"vector"}),Object.assign(ua,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(ca.parse(n[i]).scale(r));return new ua(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t},i=0,a=n.length;i!==a;++i)t.push(ca.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,a=[],o=0;o<i;o++){var s=[],c=[];s.push((o+i-1)%i,o,(o+1)%i),c.push(0,1,0);var l=sa.getKeyframeOrder(s);s=sa.sortedArray(s,1,l),c=sa.sortedArray(c,1,l),r||0!==s[0]||(s.push(i),c.push(c[0])),a.push(new ra(".morphTargetInfluences["+t[o].name+"]",s,c).scale(1/n))}return new ua(e,-1,a)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var r=e;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],c=s.name.match(i);if(c&&c.length>1){var l=r[h=c[1]];l||(r[h]=l=[]),l.push(s)}}var u=[];for(var h in r)u.push(ua.CreateFromMorphTargetSequence(h,r[h],t,n));return u},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var a=[],o=[];sa.flattenJSON(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],c=0;c<s.length;c++){var l=s[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var u={},h=0;h<l.length;h++)if(l[h].morphTargets)for(var d=0;d<l[h].morphTargets.length;d++)u[l[h].morphTargets[d]]=-1;for(var p in u){var f=[],m=[];for(d=0;d!==l[h].morphTargets.length;++d){var g=l[h];f.push(g.time),m.push(g.morphTarget===p?1:0)}r.push(new ra(".morphTargetInfluence["+p+"]",f,m))}a=u.length*(o||1)}else{var y=".bones["+t[c].name+"]";n(la,y+".position",l,"pos",r),n(ta,y+".quaternion",l,"rot",r),n(la,y+".scale",l,"scl",r)}}return 0===r.length?null:new ua(i,a,r)}}),Object.assign(ua.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}this.duration=e},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}}),Object.assign(ha.prototype,{load:function(e,t,n,r){var i=this;new pi(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),n,r)},setTextures:function(e){this.textures=e},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=new ci[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearCoat&&(r.clearCoat=e.clearCoat),void 0!==e.clearCoatRoughness&&(r.clearCoatRoughness=e.clearCoatRoughness),void 0!==e.uniforms&&(r.uniforms=e.uniforms),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.vertexColors&&(r.vertexColors=e.vertexColors),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.side&&(r.side=e.side),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap),r.transparent=!0),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalScale){var i=e.normalScale;!1===Array.isArray(i)&&(i=[i,i]),r.normalScale=(new g).fromArray(i)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),r}}),Object.assign(da.prototype,{load:function(e,t,n,r){var i=this;new pi(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),n,r)},parse:function(e){var t=new vt,n=e.data.index;if(void 0!==n){var r=new ya[n.type](n.array);t.setIndex(new Qe(r,1))}var i=e.data.attributes;for(var a in i){var o=i[a];r=new ya[o.type](o.array);t.addAttribute(a,new Qe(r,o.itemSize,o.normalized))}var s=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==s)for(var c=0,l=s.length;c!==l;++c){var u=s[c];t.addGroup(u.start,u.count,u.materialIndex)}var h=e.data.boundingSphere;if(void 0!==h){var d=new b;void 0!==h.center&&d.fromArray(h.center),t.boundingSphere=new Ie(d,h.radius)}return t}});var pa,fa,ma,ga,ya={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function va(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}va.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=this.handlers,n=0,r=t.length;n<r;n+=2){var i=t[n],a=t[n+1];if(i.test(e))return a}return null}},Object.assign(va.prototype,{crossOrigin:void 0,initMaterials:function(e,t,n){for(var r=[],i=0;i<e.length;++i)r[i]=this.createMaterial(e[i],t,n);return r},createMaterial:(pa={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},fa=new fe,ma=new yi,ga=new ha,function(e,t,n){var r={};function i(e,i,a,o,s){var c,l=t+e,u=va.Handlers.get(l);null!==u?c=u.load(l):(ma.setCrossOrigin(n),c=ma.load(l)),void 0!==i&&(c.repeat.fromArray(i),1!==i[0]&&(c.wrapS=1e3),1!==i[1]&&(c.wrapT=1e3)),void 0!==a&&c.offset.fromArray(a),void 0!==o&&("repeat"===o[0]&&(c.wrapS=1e3),"mirror"===o[0]&&(c.wrapS=1002),"repeat"===o[1]&&(c.wrapT=1e3),"mirror"===o[1]&&(c.wrapT=1002)),void 0!==s&&(c.anisotropy=s);var h=m.generateUUID();return r[h]=c,h}var a={uuid:m.generateUUID(),type:"MeshLambertMaterial"};for(var o in e){var s=e[o];switch(o){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":a.name=s;break;case"blending":a.blending=pa[s];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",o,"is no longer supported.");break;case"colorDiffuse":a.color=fa.fromArray(s).getHex();break;case"colorSpecular":a.specular=fa.fromArray(s).getHex();break;case"colorEmissive":a.emissive=fa.fromArray(s).getHex();break;case"specularCoef":a.shininess=s;break;case"shading":"basic"===s.toLowerCase()&&(a.type="MeshBasicMaterial"),"phong"===s.toLowerCase()&&(a.type="MeshPhongMaterial"),"standard"===s.toLowerCase()&&(a.type="MeshStandardMaterial");break;case"mapDiffuse":a.map=i(s,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":a.emissiveMap=i(s,e.mapEmissiveRepeat,e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":a.lightMap=i(s,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":a.aoMap=i(s,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,e.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":a.bumpMap=i(s,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case"mapBumpScale":a.bumpScale=s;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":a.normalMap=i(s,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);break;case"mapNormalFactor":a.normalScale=[s,s];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":a.specularMap=i(s,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":a.metalnessMap=i(s,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":a.roughnessMap=i(s,e.mapRoughnessRepeat,e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":a.alphaMap=i(s,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":a.side=1;break;case"doubleSided":a.side=2;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),a.opacity=s;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":a[o]=s;break;case"vertexColors":!0===s&&(a.vertexColors=2),"face"===s&&(a.vertexColors=1);break;default:console.error("THREE.Loader.createMaterial: Unsupported",o,s)}}return"MeshBasicMaterial"===a.type&&delete a.emissive,"MeshPhongMaterial"!==a.type&&delete a.specular,a.opacity<1&&(a.transparent=!0),ga.setTextures(r),ga.parse(a)})});var ba=function(e){var t=e.split("/");return 1===t.length?"./":(t.pop(),t.join("/")+"/")};function wa(e){"boolean"==typeof e&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),e=void 0),this.manager=void 0!==e?e:hi,this.withCredentials=!1}Object.assign(wa.prototype,{load:function(e,t,n,r){var i=this,a=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:ba(e),o=new pi(this.manager);o.setWithCredentials(this.withCredentials),o.load(e,(function(n){var r=JSON.parse(n),o=r.metadata;if(void 0!==o){var s=o.type;if(void 0!==s){if("object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.ObjectLoader instead.");if("scene"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.SceneLoader instead.")}}var c=i.parse(r,a);t(c.geometry,c.materials)}),n,r)},setTexturePath:function(e){this.texturePath=e},parse:function(e,t){void 0!==e.data&&(e=e.data),void 0!==e.scale?e.scale=1/e.scale:e.scale=1;var n=new Ke;return function(e,t){function n(e,t){return e&1<<t}var r,i,a,o,s,c,l,u,h,d,p,f,m,y,v,w,A,E,x,_,S,M,T,R,k,C=e.faces,O=e.vertices,P=e.normals,I=e.colors,N=e.scale,L=0;if(void 0!==e.uvs){for(r=0;r<e.uvs.length;r++)e.uvs[r].length&&L++;for(r=0;r<L;r++)t.faceVertexUvs[r]=[]}for(o=0,s=O.length;o<s;)(E=new b).x=O[o++]*N,E.y=O[o++]*N,E.z=O[o++]*N,t.vertices.push(E);for(o=0,s=C.length;o<s;)if(p=n(d=C[o++],0),f=n(d,1),m=n(d,3),y=n(d,4),v=n(d,5),w=n(d,6),A=n(d,7),p){if((_=new Ze).a=C[o],_.b=C[o+1],_.c=C[o+3],(S=new Ze).a=C[o+1],S.b=C[o+2],S.c=C[o+3],o+=4,f&&(h=C[o++],_.materialIndex=h,S.materialIndex=h),a=t.faces.length,m)for(r=0;r<L;r++)for(R=e.uvs[r],t.faceVertexUvs[r][a]=[],t.faceVertexUvs[r][a+1]=[],i=0;i<4;i++)k=new g(R[2*(u=C[o++])],R[2*u+1]),2!==i&&t.faceVertexUvs[r][a].push(k),0!==i&&t.faceVertexUvs[r][a+1].push(k);if(y&&(l=3*C[o++],_.normal.set(P[l++],P[l++],P[l]),S.normal.copy(_.normal)),v)for(r=0;r<4;r++)l=3*C[o++],T=new b(P[l++],P[l++],P[l]),2!==r&&_.vertexNormals.push(T),0!==r&&S.vertexNormals.push(T);if(w&&(M=I[c=C[o++]],_.color.setHex(M),S.color.setHex(M)),A)for(r=0;r<4;r++)M=I[c=C[o++]],2!==r&&_.vertexColors.push(new fe(M)),0!==r&&S.vertexColors.push(new fe(M));t.faces.push(_),t.faces.push(S)}else{if((x=new Ze).a=C[o++],x.b=C[o++],x.c=C[o++],f&&(h=C[o++],x.materialIndex=h),a=t.faces.length,m)for(r=0;r<L;r++)for(R=e.uvs[r],t.faceVertexUvs[r][a]=[],i=0;i<3;i++)k=new g(R[2*(u=C[o++])],R[2*u+1]),t.faceVertexUvs[r][a].push(k);if(y&&(l=3*C[o++],x.normal.set(P[l++],P[l++],P[l])),v)for(r=0;r<3;r++)l=3*C[o++],T=new b(P[l++],P[l++],P[l]),x.vertexNormals.push(T);if(w&&(c=C[o++],x.color.setHex(I[c])),A)for(r=0;r<3;r++)c=C[o++],x.vertexColors.push(new fe(I[c]));t.faces.push(x)}}(e,n),function(e,t){var n=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var r=0,i=e.skinWeights.length;r<i;r+=n){var a=e.skinWeights[r],o=n>1?e.skinWeights[r+1]:0,s=n>2?e.skinWeights[r+2]:0,c=n>3?e.skinWeights[r+3]:0;t.skinWeights.push(new x(a,o,s,c))}if(e.skinIndices)for(r=0,i=e.skinIndices.length;r<i;r+=n){var l=e.skinIndices[r],u=n>1?e.skinIndices[r+1]:0,h=n>2?e.skinIndices[r+2]:0,d=n>3?e.skinIndices[r+3]:0;t.skinIndices.push(new x(l,u,h,d))}t.bones=e.bones,t.bones&&t.bones.length>0&&(t.skinWeights.length!==t.skinIndices.length||t.skinIndices.length!==t.vertices.length)&&console.warn("When skinning, number of vertices ("+t.vertices.length+"), skinIndices ("+t.skinIndices.length+"), and skinWeights ("+t.skinWeights.length+") should match.")}(e,n),function(e,t){var n=e.scale;if(void 0!==e.morphTargets)for(var r=0,i=e.morphTargets.length;r<i;r++){t.morphTargets[r]={},t.morphTargets[r].name=e.morphTargets[r].name,t.morphTargets[r].vertices=[];for(var a=t.morphTargets[r].vertices,o=e.morphTargets[r].vertices,s=0,c=o.length;s<c;s+=3){var l=new b;l.x=o[s]*n,l.y=o[s+1]*n,l.z=o[s+2]*n,a.push(l)}}if(void 0!==e.morphColors&&e.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');var u=t.faces,h=e.morphColors[0].colors;for(r=0,i=u.length;r<i;r++)u[r].color.fromArray(h,3*r)}}(e,n),function(e,t){var n=[],r=[];void 0!==e.animation&&r.push(e.animation),void 0!==e.animations&&(e.animations.length?r=r.concat(e.animations):r.push(e.animations));for(var i=0;i<r.length;i++){var a=ua.parseAnimation(r[i],t.bones);a&&n.push(a)}if(t.morphTargets){var o=ua.CreateClipsFromMorphTargetSequences(t.morphTargets,10);n=n.concat(o)}n.length>0&&(t.animations=n)}(e,n),n.computeFaceNormals(),n.computeBoundingSphere(),void 0===e.materials||0===e.materials.length?{geometry:n}:{geometry:n,materials:va.prototype.initMaterials(e.materials,t,this.crossOrigin)}}}),Object.assign(function(e){this.manager=void 0!==e?e:hi,this.texturePath=""}.prototype,{load:function(e,t,n,r){""===this.texturePath&&(this.texturePath=e.substring(0,e.lastIndexOf("/")+1));var i=this;new pi(i.manager).load(e,(function(n){var a=null;try{a=JSON.parse(n)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}var o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?i.parse(a,t):console.error("THREE.ObjectLoader: Can't load "+e+". Use THREE.JSONLoader instead.")}),n,r)},setTexturePath:function(e){this.texturePath=e},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){var n=this.parseShape(e.shapes),r=this.parseGeometries(e.geometries,n),i=this.parseImages(e.images,(function(){void 0!==t&&t(s)})),a=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,r,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var i=(new Bi).fromJSON(e[n]);t[i.uuid]=i}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var r=new wa,i=new da,a=0,o=e.length;a<o;a++){var s,c=e[a];switch(c.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new Qr[c.type](c.width,c.height,c.widthSegments,c.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new Qr[c.type](c.width,c.height,c.depth,c.widthSegments,c.heightSegments,c.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new Qr[c.type](c.radius,c.segments,c.thetaStart,c.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new Qr[c.type](c.radiusTop,c.radiusBottom,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new Qr[c.type](c.radius,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new Qr[c.type](c.radius,c.widthSegments,c.heightSegments,c.phiStart,c.phiLength,c.thetaStart,c.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new Qr[c.type](c.radius,c.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new Qr[c.type](c.innerRadius,c.outerRadius,c.thetaSegments,c.phiSegments,c.thetaStart,c.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new Qr[c.type](c.radius,c.tube,c.radialSegments,c.tubularSegments,c.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new Qr[c.type](c.radius,c.tube,c.tubularSegments,c.radialSegments,c.p,c.q);break;case"LatheGeometry":case"LatheBufferGeometry":s=new Qr[c.type](c.points,c.segments,c.phiStart,c.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new Qr[c.type](c.vertices,c.indices,c.radius,c.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":var l=[];for(a=0,o=c.shapes.length;a<o;a++){var u=t[c.shapes[a]];l.push(u)}s=new Qr[c.type](l,c.curveSegments);break;case"BufferGeometry":s=i.parse(c);break;case"Geometry":s=r.parse(c,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+c.type+'"');continue}s.uuid=c.uuid,void 0!==c.name&&(s.name=c.name),n[c.uuid]=s}return n},parseMaterials:function(e,t){var n={};if(void 0!==e){var r=new ha;r.setTextures(t);for(var i=0,a=e.length;i<a;i++){var o=e[i];if("MultiMaterial"===o.type){for(var s=[],c=0;c<o.materials.length;c++)s.push(r.parse(o.materials[c]));n[o.uuid]=s}else n[o.uuid]=r.parse(o)}}return n},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var r=ua.parse(e[n]);t.push(r)}return t},parseImages:function(e,t){var n=this,r={};function i(e){return n.manager.itemStart(e),a.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemEnd(e),n.manager.itemError(e)}))}if(void 0!==e&&e.length>0){var a=new mi(new ui(t));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=e.length;o<s;o++){var c=e[o],l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:n.texturePath+c.url;r[c.uuid]=i(l)}}return r},parseTextures:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var r={};if(void 0!==e)for(var i=0,a=e.length;i<a;i++){var o=e[i];void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===t[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);var s=new E(t[o.image]);s.needsUpdate=!0,s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),void 0!==o.mapping&&(s.mapping=n(o.mapping,Ea)),void 0!==o.offset&&s.offset.fromArray(o.offset),void 0!==o.repeat&&s.repeat.fromArray(o.repeat),void 0!==o.center&&s.center.fromArray(o.center),void 0!==o.rotation&&(s.rotation=o.rotation),void 0!==o.wrap&&(s.wrapS=n(o.wrap[0],xa),s.wrapT=n(o.wrap[1],xa)),void 0!==o.minFilter&&(s.minFilter=n(o.minFilter,_a)),void 0!==o.magFilter&&(s.magFilter=n(o.magFilter,_a)),void 0!==o.anisotropy&&(s.anisotropy=o.anisotropy),void 0!==o.flipY&&(s.flipY=o.flipY),r[o.uuid]=s}return r},parseObject:function(e,t,n){var r;function i(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function a(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var a=e[r];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),t.push(n[a])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":r=new Sn,void 0!==e.background&&Number.isInteger(e.background)&&(r.background=new fe(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?r.fog=new _n(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(r.fog=new xn(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":r=new nn(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(r.focus=e.focus),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.filmGauge&&(r.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(r.filmOffset=e.filmOffset),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new Je(e.left,e.right,e.top,e.bottom,e.near,e.far);break;case"AmbientLight":r=new Xi(e.color,e.intensity);break;case"DirectionalLight":r=new Zi(e.color,e.intensity);break;case"PointLight":r=new Wi(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new Yi(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new qi(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":r=new zi(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=i(e.geometry),s=a(e.material);r=o.bones&&o.bones.length>0?new On(o,s):new Rt(o,s);break;case"LOD":r=new Rn;break;case"Line":r=new In(i(e.geometry),a(e.material),e.mode);break;case"LineLoop":r=new Ln(i(e.geometry),a(e.material));break;case"LineSegments":r=new Nn(i(e.geometry),a(e.material));break;case"PointCloud":case"Points":r=new Fn(i(e.geometry),a(e.material));break;case"Sprite":r=new Tn(a(e.material));break;case"Group":r=new jn;break;default:r=new qe}if(r.uuid=e.uuid,void 0!==e.name&&(r.name=e.name),void 0!==e.matrix?(r.matrix.fromArray(e.matrix),r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==e.position&&r.position.fromArray(e.position),void 0!==e.rotation&&r.rotation.fromArray(e.rotation),void 0!==e.quaternion&&r.quaternion.fromArray(e.quaternion),void 0!==e.scale&&r.scale.fromArray(e.scale)),void 0!==e.castShadow&&(r.castShadow=e.castShadow),void 0!==e.receiveShadow&&(r.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(r.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(r.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&r.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(r.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.children)for(var c=e.children,l=0;l<c.length;l++)r.add(this.parseObject(c[l],t,n));if("LOD"===e.type)for(var u=e.levels,h=0;h<u.length;h++){var d=u[h],p=r.getObjectByProperty("uuid",d.object);void 0!==p&&r.addLevel(p,d.distance)}return r}});var Aa,Ea={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},xa={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},_a={NearestFilter:1003,NearestMipMapNearestFilter:1004,NearestMipMapLinearFilter:1005,LinearFilter:1006,LinearMipMapNearestFilter:1007,LinearMipMapLinearFilter:1008};function Sa(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==e?e:hi,this.options=void 0}function Ma(){this.type="ShapePath",this.subPaths=[],this.currentPath=null}function Ta(e){this.type="Font",this.data=e}function Ra(e,t,n,r,i,a){var o=a.glyphs[e]||a.glyphs["?"];if(o){var s,c,l,u,h,d,p,f,m=new Ma;if(o.o)for(var g=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),y=0,v=g.length;y<v;){switch(g[y++]){case"m":s=g[y++]*n+r,c=g[y++]*n+i,m.moveTo(s,c);break;case"l":s=g[y++]*n+r,c=g[y++]*n+i,m.lineTo(s,c);break;case"q":l=g[y++]*n+r,u=g[y++]*n+i,h=g[y++]*n+r,d=g[y++]*n+i,m.quadraticCurveTo(h,d,l,u);break;case"b":l=g[y++]*n+r,u=g[y++]*n+i,h=g[y++]*n+r,d=g[y++]*n+i,p=g[y++]*n+r,f=g[y++]*n+i,m.bezierCurveTo(h,d,p,f,l,u)}}return{offsetX:o.ha*n,path:m}}}Sa.prototype={constructor:Sa,setOptions:function(e){return this.options=e,this},load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e);var i=this,a=li.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;fetch(e).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,i.options)})).then((function(n){li.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemEnd(e),i.manager.itemError(e)}))},setCrossOrigin:function(){return this},setPath:function(e){return this.path=e,this}},Object.assign(Ma.prototype,{moveTo:function(e,t){this.currentPath=new Ui,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t)},lineTo:function(e,t){this.currentPath.lineTo(e,t)},quadraticCurveTo:function(e,t,n,r){this.currentPath.quadraticCurveTo(e,t,n,r)},bezierCurveTo:function(e,t,n,r,i,a){this.currentPath.bezierCurveTo(e,t,n,r,i,a)},splineThru:function(e){this.currentPath.splineThru(e)},toShapes:function(e,t){function n(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n],a=new Bi;a.curves=i.curves,t.push(a)}return t}function r(e,t){for(var n=t.length,r=!1,i=n-1,a=0;a<n;i=a++){var o=t[i],s=t[a],c=s.x-o.x,l=s.y-o.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(o=t[a],c=-c,s=t[i],l=-l),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var u=l*(e.x-o.x)-c*(e.y-o.y);if(0===u)return!0;if(u<0)continue;r=!r}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return r}var i=kr.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);var o,s,c,l=[];if(1===a.length)return s=a[0],(c=new Bi).curves=s.curves,l.push(c),l;var u=!i(a[0].getPoints());u=e?!u:u;var h,d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var y=0,v=a.length;y<v;y++)o=i(h=(s=a[y]).getPoints()),(o=e?!o:o)?(!u&&f[g]&&g++,f[g]={s:new Bi,p:h},f[g].s.curves=s.curves,u&&g++,m[g]=[]):m[g].push({h:s,p:h[0]});if(!f[0])return n(a);if(f.length>1){for(var b=!1,w=[],A=0,E=f.length;A<E;A++)p[A]=[];for(A=0,E=f.length;A<E;A++)for(var x=m[A],_=0;_<x.length;_++){for(var S=x[_],M=!0,T=0;T<f.length;T++)r(S.p,f[T].p)&&(A!==T&&w.push({froms:A,tos:T,hole:_}),M?(M=!1,p[T].push(S)):b=!0);M&&p[A].push(S)}w.length>0&&(b||(m=p))}y=0;for(var R=f.length;y<R;y++){c=f[y].s,l.push(c);for(var k=0,C=(d=m[y]).length;k<C;k++)c.holes.push(d[k].h)}return l}}),Object.assign(Ta.prototype,{isFont:!0,generateShapes:function(e,t,n){void 0===t&&(t=100),void 0===n&&(n=4);for(var r=[],i=function(e,t,n,r){for(var i=String(e).split(""),a=t/r.resolution,o=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*a,s=[],c=0,l=0,u=0;u<i.length;u++){var h=i[u];if("\n"===h)c=0,l-=o;else{var d=Ra(h,n,a,c,l,r);c+=d.offsetX,s.push(d.path)}}return s}(e,t,n,this.data),a=0,o=i.length;a<o;a++)Array.prototype.push.apply(r,i[a].toShapes());return r}}),Object.assign(function(e){this.manager=void 0!==e?e:hi}.prototype,{load:function(e,t,n,r){var i=this,a=new pi(this.manager);a.setPath(this.path),a.load(e,(function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var r=i.parse(n);t&&t(r)}),n,r)},parse:function(e){return new Ta(e)},setPath:function(e){return this.path=e,this}});var ka,Ca,Oa,Pa,Ia,Na,La,Da,Fa,ja,Ua=function(){return void 0===Aa&&(Aa=new(window.AudioContext||window.webkitAudioContext)),Aa};function Ba(e){this.manager=void 0!==e?e:hi}function Va(e,t,n){qe.call(this),this.type="CubeCamera";var r=new nn(90,1,e,t);r.up.set(0,-1,0),r.lookAt(new b(1,0,0)),this.add(r);var i=new nn(90,1,e,t);i.up.set(0,-1,0),i.lookAt(new b(-1,0,0)),this.add(i);var a=new nn(90,1,e,t);a.up.set(0,0,1),a.lookAt(new b(0,1,0)),this.add(a);var o=new nn(90,1,e,t);o.up.set(0,0,-1),o.lookAt(new b(0,-1,0)),this.add(o);var s=new nn(90,1,e,t);s.up.set(0,-1,0),s.lookAt(new b(0,0,1)),this.add(s);var c=new nn(90,1,e,t);c.up.set(0,-1,0),c.lookAt(new b(0,0,-1)),this.add(c);var l={format:1022,magFilter:1006,minFilter:1006};this.renderTarget=new S(n,n,l),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,l=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,n.activeCubeFace=0,e.render(t,r,n),n.activeCubeFace=1,e.render(t,i,n),n.activeCubeFace=2,e.render(t,a,n),n.activeCubeFace=3,e.render(t,o,n),n.activeCubeFace=4,e.render(t,s,n),n.texture.generateMipmaps=l,n.activeCubeFace=5,e.render(t,c,n),e.setRenderTarget(null)},this.clear=function(e,t,n,r){for(var i=this.renderTarget,a=0;a<6;a++)i.activeCubeFace=a,e.setRenderTarget(i),e.clear(t,n,r);e.setRenderTarget(null)}}function za(){qe.call(this),this.type="AudioListener",this.context=Ua(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function Ha(e){qe.call(this),this.type="Audio",this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Ga(e){Ha.call(this,e),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function qa(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function Wa(e,t,n){this.binding=e,this.valueSize=n;var r,i=Float64Array;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":i=Array,r=this._select;break;default:r=this._lerp}this.buffer=new i(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Object.assign(Ba.prototype,{load:function(e,t,n,r){var i=new pi(this.manager);i.setResponseType("arraybuffer"),i.load(e,(function(e){Ua().decodeAudioData(e,(function(e){t(e)}))}),n,r)}}),Object.assign(function(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new nn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new nn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}.prototype,{update:(Fa=new y,ja=new y,function(e){if(ka!==this||Ca!==e.focus||Oa!==e.fov||Pa!==e.aspect*this.aspect||Ia!==e.near||Na!==e.far||La!==e.zoom||Da!==this.eyeSep){ka=this,Ca=e.focus,Oa=e.fov,Pa=e.aspect*this.aspect,Ia=e.near,Na=e.far,La=e.zoom;var t,n,r=e.projectionMatrix.clone(),i=(Da=this.eyeSep/2)*Ia/Ca,a=Ia*Math.tan(m.DEG2RAD*Oa*.5)/La;ja.elements[12]=-Da,Fa.elements[12]=Da,t=-a*Pa+i,n=a*Pa+i,r.elements[0]=2*Ia/(n-t),r.elements[8]=(n+t)/(n-t),this.cameraL.projectionMatrix.copy(r),t=-a*Pa-i,n=a*Pa-i,r.elements[0]=2*Ia/(n-t),r.elements[8]=(n+t)/(n-t),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(ja),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Fa)})}),Va.prototype=Object.create(qe.prototype),Va.prototype.constructor=Va,za.prototype=Object.assign(Object.create(qe.prototype),{constructor:za,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(e){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){this.gain.gain.value=e},updateMatrixWorld:function(){var e=new b,t=new v,n=new b,r=new b;return function(i){qe.prototype.updateMatrixWorld.call(this,i);var a=this.context.listener,o=this.up;this.matrixWorld.decompose(e,t,n),r.set(0,0,-1).applyQuaternion(t),a.positionX?(a.positionX.setValueAtTime(e.x,this.context.currentTime),a.positionY.setValueAtTime(e.y,this.context.currentTime),a.positionZ.setValueAtTime(e.z,this.context.currentTime),a.forwardX.setValueAtTime(r.x,this.context.currentTime),a.forwardY.setValueAtTime(r.y,this.context.currentTime),a.forwardZ.setValueAtTime(r.z,this.context.currentTime),a.upX.setValueAtTime(o.x,this.context.currentTime),a.upY.setValueAtTime(o.y,this.context.currentTime),a.upZ.setValueAtTime(o.z,this.context.currentTime)):(a.setPosition(e.x,e.y,e.z),a.setOrientation(r.x,r.y,r.z,o.x,o.y,o.z))}}()}),Ha.prototype=Object.assign(Object.create(qe.prototype),{constructor:Ha,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.onended=this.onEnded.bind(this),e.playbackRate.setValueAtTime(this.playbackRate,this.startTime),this.startTime=this.context.currentTime,e.start(this.startTime,this.offset),this.isPlaying=!0,this.source=e,this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this.source.stop(),this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.value=e,this}}),Ga.prototype=Object.assign(Object.create(Ha.prototype),{constructor:Ga,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){this.panner.refDistance=e},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){this.panner.rolloffFactor=e},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){this.panner.distanceModel=e},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){this.panner.maxDistance=e},updateMatrixWorld:function(){var e=new b;return function(t){qe.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}()}),Object.assign(qa.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(Wa.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)n[i+o]=n[o];a=t}else{var s=t/(a+=t);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},apply:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,i<1){var o=3*t;this._mixBufferRegion(n,r,o,1-i,t)}for(var s=t,c=t+t;s!==c;++s)if(n[s]!==n[s+t]){a.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=3*n;e.getValue(t,r);for(var i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,r,i){if(r>=.5)for(var a=0;a!==i;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,r){v.slerpFlat(e,t,e,t,e,n,r)},_lerp:function(e,t,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*r}}});var Ja,Za,Xa,Ya,Ka,Qa,$a,eo,to,no,ro,io;function ao(e,t,n){var r=n||oo.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function oo(e,t,n){this.path=t,this.parsedPath=n||oo.parseTrackName(t),this.node=oo.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function so(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var r=t.tracks,i=r.length,a=new Array(i),o={endingStart:2400,endingEnd:2400},s=0;s!==i;++s){var c=r[s].createInterpolant(null);a[s]=c,c.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function co(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function lo(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function uo(){vt.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function ho(e,t,n,r){this.uuid=m.generateUUID(),this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}function po(e,t){this.uuid=m.generateUUID(),this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function fo(e,t,n){po.call(this,e,t),this.meshPerAttribute=n||1}function mo(e,t,n){Qe.call(this,e,t),this.meshPerAttribute=n||1}function go(e,t){return e.distance-t.distance}function yo(e,t,n,r){if(!1!==e.visible&&(e.raycast(t,n),!0===r))for(var i=e.children,a=0,o=i.length;a<o;a++)yo(i[a],t,n,!0)}function vo(e,t){this.min=void 0!==e?e:new g(1/0,1/0),this.max=void 0!==t?t:new g(-1/0,-1/0)}function bo(e){qe.call(this),this.material=e,this.render=function(){}}function wo(e,t,n,r){this.object=e,this.size=void 0!==t?t:1;var i=void 0!==n?n:16711680,a=void 0!==r?r:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=3*s.faces.length:s&&s.isBufferGeometry&&(o=s.attributes.normal.count);var c=new vt,l=new ot(2*o*3,3);c.addAttribute("position",l),Nn.call(this,c,new Pn({color:i,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function Ao(e,t){qe.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new vt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1;i<32;i++,a++){var o=i/32*Math.PI*2,s=a/32*Math.PI*2;r.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.addAttribute("position",new ot(r,3));var c=new Pn({fog:!1});this.cone=new Nn(n,c),this.add(this.cone),this.update()}function Eo(e){for(var t=function e(t){var n=[];t&&t.isBone&&n.push(t);for(var r=0;r<t.children.length;r++)n.push.apply(n,e(t.children[r]));return n}(e),n=new vt,r=[],i=[],a=new fe(0,0,1),o=new fe(0,1,0),s=0;s<t.length;s++){var c=t[s];c.parent&&c.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.addAttribute("position",new ot(r,3)),n.addAttribute("color",new ot(i,3));var l=new Pn({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});Nn.call(this,n,l),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function xo(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new Fr(t,4,2),i=new xt({wireframe:!0,fog:!1});Rt.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function _o(e,t){qe.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;var n=new Pn({fog:!1}),r=new vt;r.addAttribute("position",new Qe(new Float32Array(15),3)),this.line=new In(r,n),this.add(this.line),this.update()}function So(e,t,n){qe.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new Yn(t);r.rotateY(.5*Math.PI),this.material=new xt({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=2);var i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.addAttribute("color",new Qe(a,3)),this.add(new Rt(r,this.material)),this.update()}function Mo(e,t,n,r){e=e||10,t=t||10,n=new fe(void 0!==n?n:4473924),r=new fe(void 0!==r?r:8947848);for(var i=t/2,a=e/t,o=e/2,s=[],c=[],l=0,u=0,h=-o;l<=t;l++,h+=a){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var d=l===i?n:r;d.toArray(c,u),u+=3,d.toArray(c,u),u+=3,d.toArray(c,u),u+=3,d.toArray(c,u),u+=3}var p=new vt;p.addAttribute("position",new ot(s,3)),p.addAttribute("color",new ot(c,3));var f=new Pn({vertexColors:2});Nn.call(this,p,f)}function To(e,t,n,r,i,a){e=e||10,t=t||16,n=n||8,r=r||64,i=new fe(void 0!==i?i:4473924),a=new fe(void 0!==a?a:8947848);var o,s,c,l,u,h,d,p=[],f=[];for(l=0;l<=t;l++)c=l/t*(2*Math.PI),o=Math.sin(c)*e,s=Math.cos(c)*e,p.push(0,0,0),p.push(o,0,s),d=1&l?i:a,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(l=0;l<=n;l++)for(d=1&l?i:a,h=e-e/n*l,u=0;u<r;u++)c=u/r*(2*Math.PI),o=Math.sin(c)*h,s=Math.cos(c)*h,p.push(o,0,s),f.push(d.r,d.g,d.b),c=(u+1)/r*(2*Math.PI),o=Math.sin(c)*h,s=Math.cos(c)*h,p.push(o,0,s),f.push(d.r,d.g,d.b);var m=new vt;m.addAttribute("position",new ot(p,3)),m.addAttribute("color",new ot(f,3));var g=new Pn({vertexColors:2});Nn.call(this,m,g)}function Ro(e,t,n,r){this.object=e,this.size=void 0!==t?t:1;var i=void 0!==n?n:16776960,a=void 0!==r?r:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new vt,l=new ot(2*o*3,3);c.addAttribute("position",l),Nn.call(this,c,new Pn({color:i,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function ko(e,t,n){qe.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var r=new vt;r.addAttribute("position",new ot([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new Pn({fog:!1});this.lightPlane=new In(r,i),this.add(this.lightPlane),(r=new vt).addAttribute("position",new ot([0,0,0,0,0,1],3)),this.targetLine=new In(r,i),this.add(this.targetLine),this.update()}function Co(e){var t=new vt,n=new Pn({color:16777215,vertexColors:1}),r=[],i=[],a={},o=new fe(16755200),s=new fe(16711680),c=new fe(43775),l=new fe(16777215),u=new fe(3355443);function h(e,t,n){d(e,n),d(t,n)}function d(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(r.length/3-1)}h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",c),h("u2","u3",c),h("u3","u1",c),h("c","t",l),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u),t.addAttribute("position",new ot(r,3)),t.addAttribute("color",new ot(i,3)),Nn.call(this,t,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function Oo(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new vt;i.setIndex(new Qe(n,1)),i.addAttribute("position",new Qe(r,3)),Nn.call(this,i,new Pn({color:t})),this.matrixAutoUpdate=!1,this.update()}function Po(e,t){this.type="Box3Helper",this.box=e;var n=void 0!==t?t:16776960,r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new vt;i.setIndex(new Qe(r,1)),i.addAttribute("position",new ot([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),Nn.call(this,i,new Pn({color:n})),this.geometry.computeBoundingSphere()}function Io(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var r=void 0!==n?n:16776960,i=new vt;i.addAttribute("position",new ot([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),In.call(this,i,new Pn({color:r}));var a=new vt;a.addAttribute("position",new ot([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new Rt(a,new xt({color:r,opacity:.2,transparent:!0,depthWrite:!1})))}function No(e,t,n,r,i,a){qe.call(this),void 0===r&&(r=16776960),void 0===n&&(n=1),void 0===i&&(i=.2*n),void 0===a&&(a=.2*i),void 0===to&&((to=new vt).addAttribute("position",new ot([0,0,0,0,1,0],3)),(no=new Jr(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new In(to,new Pn({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Rt(no,new xt({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}function Lo(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new vt;n.addAttribute("position",new ot(t,3)),n.addAttribute("color",new ot([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new Pn({vertexColors:2});Nn.call(this,n,r)}Object.assign(ao.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(oo,{Composite:ao,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new oo.Composite(e,t,n):new oo(e,t,n)},sanitizeNodeName:(eo=new RegExp("[\\[\\]\\.:\\/]","g"),function(e){return e.replace(/\s/g,"_").replace(eo,"")}),parseTrackName:(Ja="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Za=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Xa=/(WCOD+)?/.source.replace("WCOD",Ja),Ya=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ka=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Qa=new RegExp("^"+Za+Xa+Ya+Ka+"$"),$a=["material","materials","bones"],function(e){var t=Qa.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==$a.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}),findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function(e){for(var n=0;n<e.length;n++){var i=e[n];if(i.name===t||i.uuid===t)return i;var a=r(i.children);if(a)return a}return null},i=r(e.children);if(i)return i}return null}}),Object.assign(oo.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=oo.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[r];if(void 0!==s){var c=this.Versioning.None;void 0!==e.needsUpdate?(c=this.Versioning.NeedsUpdate,this.targetObject=e):void 0!==e.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=e);var l=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(e.geometry.morphAttributes.position[o].name===i){i=o;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(o=0;o<this.node.geometry.morphTargets.length;o++)if(e.geometry.morphTargets[o].name===i){i=o;break}}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][c]}else{var u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),
+//!\ DECLARE ALIAS AFTER assign prototype !
+Object.assign(oo.prototype,{_getValue_unbound:oo.prototype.getValue,_setValue_unbound:oo.prototype.setValue}),Object.assign(function(){this.uuid=m.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,c=void 0,l=0,u=arguments.length;l!==u;++l){var h=arguments[l],d=h.uuid,p=r[d];if(void 0===p){p=t++,r[d]=p,e.push(h);for(var f=0,m=s;f!==m;++f)o[f].push(new oo(h,i[f],a[f]))}else if(p<n){c=e[p];var g=--n,y=e[g];r[y.uuid]=p,e[p]=y,r[d]=g,e[g]=h;for(f=0,m=s;f!==m;++f){var v=o[f],b=v[g],w=v[p];v[p]=b,void 0===w&&(w=new oo(h,i[f],a[f])),v[g]=w}}else e[p]!==c&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],c=s.uuid,l=n[c];if(void 0!==l&&l>=t){var u=t++,h=e[u];n[h.uuid]=l,e[l]=h,n[c]=u,e[u]=s;for(var d=0,p=i;d!==p;++d){var f=r[d],m=f[u],g=f[l];f[l]=m,f[u]=g}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o],l=c.uuid,u=r[l];if(void 0!==u)if(delete r[l],u<n){var h=--n,d=e[h],p=e[v=--t];r[d.uuid]=u,e[u]=d,r[p.uuid]=h,e[h]=p,e.pop();for(var f=0,m=a;f!==m;++f){var g=(b=i[f])[h],y=b[v];b[u]=g,b[h]=y,b.pop()}}else{var v;r[(p=e[v=--t]).uuid]=u,e[u]=p,e.pop();for(f=0,m=a;f!==m;++f){var b;(b=i[f])[u]=b[v],b.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=new Array(c);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(var h=l,d=s.length;h!==d;++h){var p=s[h];u[h]=new oo(p,e,t)}return u},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}}),Object.assign(so.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,a=i/r,o=r/i;e.warp(1,a,t),this.warp(o,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var r=this._mixer,i=r.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=i,s[1]=i+n,c[0]=e/o,c[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var a=(e-i)*n;if(a<0||0===n)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var c=this._interpolants,l=this._propertyBindings,u=0,h=c.length;u!==h;++u)c[u].evaluate(o),l[u].accumulate(r,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e;if(0===e)return t;var n=this._clip.duration,r=this.loop,i=this._loopCount;if(2200===r){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=n)t=n;else{if(!(t<0))break e;t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{var a=2202===r;if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),t>=n||t<0){var o=Math.floor(t/n);t-=n*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?n:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(0===s){var c=e<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}if(a&&1==(1&i))return this.time=t,n-t}return this.time=t,t},_setEndings:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(e,t,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}),co.prototype=Object.assign(Object.create(a.prototype),{constructor:co,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];void 0===l&&(l={},c[s]=l);for(var u=0;u!==i;++u){var h=r[u],d=h.name,p=l[d];if(void 0!==p)a[u]=p;else{if(void 0!==(p=a[u])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=t&&t._propertyBindings[u].binding.parsedPath;++(p=new Wa(oo.create(n,d,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),a[u]=p}o[u].resultBuffer=p.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var r=this._actions,i=this._actionsByClip,a=i[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;var i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,c=s[s.length-1],l=e._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_addInactiveBinding:function(e,t,n){var r=this._bindingsByRootAndName,i=r[t],a=this._bindings;void 0===i&&(i={},r[t]=i),i[n]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete o[i];e:{for(var l in o)break e;delete a[r]}},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&((n=new aa(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?ua.findByName(n,e):e,a=null!==i?i.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var c=o.actionByRoot[r];if(void 0!==c)return c;s=o.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var l=new so(this,i,t);return this._bindAction(l,s),this._addInactiveAction(l,a,r),l},existingAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?ua.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,r=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var i=0;i!==t;++i)e[i].reset();for(i=0;i!==r;++i)n[i].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o){t[o]._update(r,e,i,a)}var s=this._bindings,c=this._nActiveBindings;for(o=0;o!==c;++o)s[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var l=c._cacheIndex,u=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,u._cacheIndex=l,t[l]=u,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var a=this._bindingsByRootAndName[t];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),lo.prototype.clone=function(){return new lo(void 0===this.value.clone?this.value:this.value.clone())},uo.prototype=Object.assign(Object.create(vt.prototype),{constructor:uo,isInstancedBufferGeometry:!0,copy:function(e){return vt.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),Object.defineProperties(ho.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(ho.prototype,{isInterleavedBufferAttribute:!0,setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}}),Object.defineProperty(po.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(po.prototype,{isInterleavedBuffer:!0,setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==e?e.length/this.stride:0,this.array=e},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.dynamic=e.dynamic,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}}),fo.prototype=Object.assign(Object.create(po.prototype),{constructor:fo,isInstancedInterleavedBuffer:!0,copy:function(e){return po.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),mo.prototype=Object.assign(Object.create(Qe.prototype),{constructor:mo,isInstancedBufferAttribute:!0,copy:function(e){return Qe.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(function(e,t,n,r){this.ray=new St(e,t),this.near=n||0,this.far=r||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize()):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var r=n||[];return yo(e,this,r,t),r.sort(go),r},intersectObjects:function(e,t,n){var r=n||[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=e.length;i<a;i++)yo(e[i],this,r,t);return r.sort(go),r}}),Object.assign(function(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}),Object.assign(function(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(e){return this.radius=e.length(),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e.x,e.z),this.phi=Math.acos(m.clamp(e.y/this.radius,-1,1))),this}}),Object.assign(function(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.radius=Math.sqrt(e.x*e.x+e.z*e.z),this.theta=Math.atan2(e.x,e.z),this.y=e.y,this}}),Object.assign(vo.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new g;return function(t,n){var r=e.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){var t=e||new g;return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){var t=e||new g;return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return(t||new g).set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return(t||new g).copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new g;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),bo.prototype=Object.create(qe.prototype),bo.prototype.constructor=bo,bo.prototype.isImmediateRenderObject=!0,wo.prototype=Object.create(Nn.prototype),wo.prototype.constructor=wo,wo.prototype.update=function(){var e=new b,t=new b,n=new w;return function(){var r=["a","b","c"];this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);var i=this.object.matrixWorld,a=this.geometry.attributes.position,o=this.object.geometry;if(o&&o.isGeometry)for(var s=o.vertices,c=o.faces,l=0,u=0,h=c.length;u<h;u++)for(var d=c[u],p=0,f=d.vertexNormals.length;p<f;p++){var m=s[d[r[p]]],g=d.vertexNormals[p];e.copy(m).applyMatrix4(i),t.copy(g).applyMatrix3(n).normalize().multiplyScalar(this.size).add(e),a.setXYZ(l,e.x,e.y,e.z),l+=1,a.setXYZ(l,t.x,t.y,t.z),l+=1}else if(o&&o.isBufferGeometry){var y=o.attributes.position,v=o.attributes.normal;for(l=0,p=0,f=y.count;p<f;p++)e.set(y.getX(p),y.getY(p),y.getZ(p)).applyMatrix4(i),t.set(v.getX(p),v.getY(p),v.getZ(p)),t.applyMatrix3(n).normalize().multiplyScalar(this.size).add(e),a.setXYZ(l,e.x,e.y,e.z),l+=1,a.setXYZ(l,t.x,t.y,t.z),l+=1}a.needsUpdate=!0}}(),Ao.prototype=Object.create(qe.prototype),Ao.prototype.constructor=Ao,Ao.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Ao.prototype.update=function(){var e=new b,t=new b;return function(){this.light.updateMatrixWorld();var n=this.light.distance?this.light.distance:1e3,r=n*Math.tan(this.light.angle);this.cone.scale.set(r,r,n),e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t.sub(e)),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}(),Eo.prototype=Object.create(Nn.prototype),Eo.prototype.constructor=Eo,Eo.prototype.updateMatrixWorld=function(){var e=new b,t=new y,n=new y;return function(r){var i=this.bones,a=this.geometry,o=a.getAttribute("position");n.getInverse(this.root.matrixWorld);for(var s=0,c=0;s<i.length;s++){var l=i[s];l.parent&&l.parent.isBone&&(t.multiplyMatrices(n,l.matrixWorld),e.setFromMatrixPosition(t),o.setXYZ(c,e.x,e.y,e.z),t.multiplyMatrices(n,l.parent.matrixWorld),e.setFromMatrixPosition(t),o.setXYZ(c+1,e.x,e.y,e.z),c+=2)}a.getAttribute("position").needsUpdate=!0,qe.prototype.updateMatrixWorld.call(this,r)}}(),xo.prototype=Object.create(Rt.prototype),xo.prototype.constructor=xo,xo.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},xo.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},_o.prototype=Object.create(qe.prototype),_o.prototype.constructor=_o,_o.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},_o.prototype.update=function(){var e=.5*this.light.width,t=.5*this.light.height,n=this.line.geometry.attributes.position,r=n.array;r[0]=e,r[1]=-t,r[2]=0,r[3]=e,r[4]=t,r[5]=0,r[6]=-e,r[7]=t,r[8]=0,r[9]=-e,r[10]=-t,r[11]=0,r[12]=e,r[13]=-t,r[14]=0,n.needsUpdate=!0,void 0!==this.color?this.line.material.color.set(this.color):this.line.material.color.copy(this.light.color)},So.prototype=Object.create(qe.prototype),So.prototype.constructor=So,So.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},So.prototype.update=function(){var e=new b,t=new fe,n=new fe;return function(){var r=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var i=r.geometry.getAttribute("color");t.copy(this.light.color),n.copy(this.light.groundColor);for(var a=0,o=i.count;a<o;a++){var s=a<o/2?t:n;i.setXYZ(a,s.r,s.g,s.b)}i.needsUpdate=!0}r.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate())}}(),Mo.prototype=Object.create(Nn.prototype),Mo.prototype.constructor=Mo,To.prototype=Object.create(Nn.prototype),To.prototype.constructor=To,Ro.prototype=Object.create(Nn.prototype),Ro.prototype.constructor=Ro,Ro.prototype.update=function(){var e=new b,t=new b,n=new w;return function(){this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);for(var r=this.object.matrixWorld,i=this.geometry.attributes.position,a=this.object.geometry,o=a.vertices,s=a.faces,c=0,l=0,u=s.length;l<u;l++){var h=s[l],d=h.normal;e.copy(o[h.a]).add(o[h.b]).add(o[h.c]).divideScalar(3).applyMatrix4(r),t.copy(d).applyMatrix3(n).normalize().multiplyScalar(this.size).add(e),i.setXYZ(c,e.x,e.y,e.z),c+=1,i.setXYZ(c,t.x,t.y,t.z),c+=1}i.needsUpdate=!0}}(),ko.prototype=Object.create(qe.prototype),ko.prototype.constructor=ko,ko.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},ko.prototype.update=function(){var e=new b,t=new b,n=new b;return function(){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),n.subVectors(t,e),this.lightPlane.lookAt(n),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(n),this.targetLine.scale.z=n.length()}}(),Co.prototype=Object.create(Nn.prototype),Co.prototype.constructor=Co,Co.prototype.update=function(){var e,t,n=new b,r=new We;function i(i,a,o,s){n.set(a,o,s).unproject(r);var c=t[i];if(void 0!==c)for(var l=e.getAttribute("position"),u=0,h=c.length;u<h;u++)l.setXYZ(c[u],n.x,n.y,n.z)}return function(){e=this.geometry,t=this.pointMap;r.projectionMatrix.copy(this.camera.projectionMatrix),i("c",0,0,-1),i("t",0,0,1),i("n1",-1,-1,-1),i("n2",1,-1,-1),i("n3",-1,1,-1),i("n4",1,1,-1),i("f1",-1,-1,1),i("f2",1,-1,1),i("f3",-1,1,1),i("f4",1,1,1),i("u1",.7,1.1,-1),i("u2",-.7,1.1,-1),i("u3",0,2,-1),i("cf1",-1,0,1),i("cf2",1,0,1),i("cf3",0,-1,1),i("cf4",0,1,1),i("cn1",-1,0,-1),i("cn2",1,0,-1),i("cn3",0,-1,-1),i("cn4",0,1,-1),e.getAttribute("position").needsUpdate=!0}}(),Oo.prototype=Object.create(Nn.prototype),Oo.prototype.constructor=Oo,Oo.prototype.update=function(){var e=new Pe;return function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&e.setFromObject(this.object),!e.isEmpty()){var n=e.min,r=e.max,i=this.geometry.attributes.position,a=i.array;a[0]=r.x,a[1]=r.y,a[2]=r.z,a[3]=n.x,a[4]=r.y,a[5]=r.z,a[6]=n.x,a[7]=n.y,a[8]=r.z,a[9]=r.x,a[10]=n.y,a[11]=r.z,a[12]=r.x,a[13]=r.y,a[14]=n.z,a[15]=n.x,a[16]=r.y,a[17]=n.z,a[18]=n.x,a[19]=n.y,a[20]=n.z,a[21]=r.x,a[22]=n.y,a[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),Oo.prototype.setFromObject=function(e){return this.object=e,this.update(),this},Po.prototype=Object.create(Nn.prototype),Po.prototype.constructor=Po,Po.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),qe.prototype.updateMatrixWorld.call(this,e))},Io.prototype=Object.create(In.prototype),Io.prototype.constructor=Io,Io.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.lookAt(this.plane.normal),qe.prototype.updateMatrixWorld.call(this,e)},No.prototype=Object.create(qe.prototype),No.prototype.constructor=No,No.prototype.setDirection=(io=new b,function(e){e.y>.99999?this.quaternion.set(0,0,0,1):e.y<-.99999?this.quaternion.set(1,0,0,0):(io.set(e.z,0,-e.x).normalize(),ro=Math.acos(e.y),this.quaternion.setFromAxisAngle(io,ro))}),No.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},No.prototype.setColor=function(e){this.line.material.color.copy(e),this.cone.material.color.copy(e)},Lo.prototype=Object.create(Nn.prototype),Lo.prototype.constructor=Lo;function Do(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Mi.call(this,e),this.type="catmullrom"}vi.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(vi.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(ji.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new Ke,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new b(i.x,i.y,i.z||0))}return t}}),Object.assign(Ui.prototype,{fromPoints:function(e){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),Object.create(Mi.prototype),Object.create(Mi.prototype),Do.prototype=Object.create(Mi.prototype),Object.assign(Do.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Mo.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Eo.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(va.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),ba(e)}}),Object.assign(vo.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Pe.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Mt.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(m,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),m.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),m.ceilPowerOfTwo(e)}}),Object.assign(w.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(e){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(y.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){var e;return function(){return void 0===e&&(e=new b),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),e.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(e){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)}}),Ne.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},v.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(St.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(Bi.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Pr(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new zr(this,e)}}),Object.assign(g.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(b.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(x.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Ke.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}}),Object.assign(qe.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)}}),Object.defineProperties(qe.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(Rn.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(kn.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Object.defineProperty(vi.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),nn.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Vi.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Qe.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}}}),Object.assign(vt.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(vt.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(lo.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(ke.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new fe}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}}}),Object.defineProperties(ri.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(_t.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(En.prototype,{getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")}}),Object.defineProperties(En.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(De.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(_.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(an.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}}}),Ha.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new Ba).load(e,(function(e){t.setBuffer(e)})),this},qa.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Va.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)};class Fo{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const n=[],r=function(e,t,n){const r=Array.from(e),i=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[];let s=0,c=0;for(let e=0;e<r.length;e++){const t=r[e];if("\n"===t)s=0,c-=a;else{const e=jo(t,i,s,c,n);s+=e.offsetX,o.push(e.path)}}return o}(e,t,this.data);for(let e=0,t=r.length;e<t;e++)Array.prototype.push.apply(n,r[e].toShapes());return n}}function jo(e,t,n,r,i){const a=i.glyphs[e]||i.glyphs["?"];if(!a)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".");const o=new Ma;let s,c,l,u,h,d,p,f;if(a.o){const e=a._cachedOutline||(a._cachedOutline=a.o.split(" "));for(let i=0,a=e.length;i<a;){switch(e[i++]){case"m":s=e[i++]*t+n,c=e[i++]*t+r,o.moveTo(s,c);break;case"l":s=e[i++]*t+n,c=e[i++]*t+r,o.lineTo(s,c);break;case"q":l=e[i++]*t+n,u=e[i++]*t+r,h=e[i++]*t+n,d=e[i++]*t+r,o.quadraticCurveTo(h,d,l,u);break;case"b":l=e[i++]*t+n,u=e[i++]*t+r,h=e[i++]*t+n,d=e[i++]*t+r,p=e[i++]*t+n,f=e[i++]*t+r,o.bezierCurveTo(h,d,p,f,l,u)}}}return{offsetX:a.ha*t,path:o}}Fo.prototype.isFont=!0;var Uo=(0,AFRAME.utils.debug)("aframe-text-component:error"),Bo=new class extends va{constructor(e){super(e)}load(e,t,n,r){const i=this,a=new pi(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(e){let n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}const r=i.parse(n);t&&t(r)}),n,r)}parse(e){return new Fo(e)}};if(AFRAME.registerComponent("text-geometry",{schema:{bevelEnabled:{default:!1},bevelSize:{default:8,min:0},bevelThickness:{default:12,min:0},curveSegments:{default:12,min:0},font:{type:"asset",default:"https://rawgit.com/ngokevin/kframe/master/components/text-geometry/lib/helvetiker_regular.typeface.json"},height:{default:.05,min:0},size:{default:.5,min:0},style:{default:"normal",oneOf:["normal","italics"]},weight:{default:"normal",oneOf:["normal","bold"]},value:{default:""}},update:function(e){const t=this.data,n=this.el;if(!t.value)return;let r=n.getObject3D("mesh");r||(r=new THREE.Mesh,n.setObject3D("mesh",r)),t.font.constructor===String?Bo.load(t.font,(function(e){const n=AFRAME.utils.clone(t);n.font=e,r.geometry=new i(t.value,n),r.geometry.translate(-.18,0,-.07)})):t.font.constructor===Object?(r.geometry=new i(t.value,t),r.geometry.translate(-.18,0,-.07)):Uo("Must provide `font` (typeface.json) or `fontPath` (string) to text component.")}}),window.AFRAME){const t=["text-geometry"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{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,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}}]);
\ No newline at end of file
diff --git a/rider/build/zip.js b/rider/build/zip.js
new file mode 100644
index 000000000..7a8441721
--- /dev/null
+++ b/rider/build/zip.js
@@ -0,0 +1,8 @@
+!function(e){var t=this.webpackHotUpdate;this.webpackHotUpdate=function(e,n){!function(e,t){if(!w[e]||!v[e])return;for(var n in v[e]=!1,t)Object.prototype.hasOwnProperty.call(t,n)&&(p[n]=t[n]);0==--b&&0===y&&x()}(e,n),t&&t(e,n)};var n,r=!0,i="0eb3afe3ce20db27d2ce",o={},a=[],s=[];function l(e){var t=R[e];if(!t)return O;var r=function(r){return t.hot.active?(R[r]?-1===R[r].parents.indexOf(e)&&R[r].parents.push(e):(a=[e],n=r),-1===t.children.indexOf(r)&&t.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+e),a=[]),O(r)},i=function(e){return{configurable:!0,enumerable:!0,get:function(){return O[e]},set:function(t){O[e]=t}}};for(var o in O)Object.prototype.hasOwnProperty.call(O,o)&&"e"!==o&&"t"!==o&&Object.defineProperty(r,o,i(o));return r.e=function(e){return"ready"===h&&c("prepare"),y++,O.e(e).then(t,(function(e){throw t(),e}));function t(){y--,"prepare"===h&&(m[e]||S(e),0===y&&0===b&&x())}},r.t=function(e,t){return 1&t&&(e=r(e)),O.t(e,-2&t)},r}function u(t){var r={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:n!==t,active:!0,accept:function(e,t){if(void 0===e)r._selfAccepted=!0;else if("function"==typeof e)r._selfAccepted=e;else if("object"==typeof e)for(var n=0;n<e.length;n++)r._acceptedDependencies[e[n]]=t||function(){};else r._acceptedDependencies[e]=t||function(){}},decline:function(e){if(void 0===e)r._selfDeclined=!0;else if("object"==typeof e)for(var t=0;t<e.length;t++)r._declinedDependencies[e[t]]=!0;else r._declinedDependencies[e]=!0},dispose:function(e){r._disposeHandlers.push(e)},addDisposeHandler:function(e){r._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=r._disposeHandlers.indexOf(e);t>=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;t<f.length;t++)f[t].call(null,e)}var d,p,_,g,b=0,y=0,m={},v={},w={};function E(e){return+e+""===e?+e:e}function k(e){if("idle"!==h)throw new Error("check() is only allowed in idle status");return r=e,c("check"),(t=1e4,t=t||1e4,new Promise((function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,o=O.p+""+i+".hot-update.json";r.open("GET",o,!0),r.timeout=t,r.send(null)}catch(e){return n(e)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+o+" timed out."));else if(404===r.status)e();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+o+" failed."));else{try{var t=JSON.parse(r.responseText)}catch(e){return void n(e)}e(t)}}}))).then((function(e){if(!e)return c(L()?"ready":"idle"),null;v={},m={},w=e.c,_=e.h,c("prepare");var t=new Promise((function(e,t){d={resolve:e,reject:t}}));p={};return S(1),"prepare"===h&&0===y&&0===b&&x(),t}));var t}function S(e){w[e]?(v[e]=!0,b++,function(e){var t=document.createElement("script");t.charset="utf-8",t.src=O.p+""+e+"."+i+".hot-update.js",document.head.appendChild(t)}(e)):m[e]=!0}function x(){c("ready");var e=d;if(d=null,e)if(r)Promise.resolve().then((function(){return T(r)})).then((function(t){e.resolve(t)}),(function(t){e.reject(t)}));else{var t=[];for(var n in p)Object.prototype.hasOwnProperty.call(p,n)&&t.push(E(n));e.resolve(t)}}function T(t){if("ready"!==h)throw new Error("apply() is only allowed in ready status");return function t(r){var s,l,u,f,h;function d(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){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<f.parents.length;s++){var l=f.parents[s],u=R[l];if(u){if(u.hot._declinedDependencies[o])return{type:"declined",chain:a.concat([l]),moduleId:o,parentId:l};-1===t.indexOf(l)&&(u.hot._acceptedDependencies[o]?(n[l]||(n[l]=[]),b(n[l],[o])):(delete n[l],t.push(l),r.push({chain:a.concat([l]),id:l})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}L();var y={},m=[],v={},k=function(){console.warn("[HMR] unexpected require("+x.moduleId+") to disposed module")};for(var S in p)if(Object.prototype.hasOwnProperty.call(p,S)){var x;h=E(S),x=p[S]?d(h):{type:"disposed",moduleId:S};var T=!1,A=!1,I=!1,U="";switch(x.chain&&(U="\nUpdate propagation: "+x.chain.join(" -> ")),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;l<m.length;l++)h=m[l],R[h]&&R[h].hot._selfAccepted&&v[h]!==k&&!R[h].hot._selfInvalidated&&D.push({module:h,parents:R[h].parents.slice(),errorHandler:R[h].hot._selfAccepted});c("dispose"),Object.keys(w).forEach((function(e){!1===w[e]&&function(e){delete installedChunks[e]}(e)}));var M,N,B=m.slice();for(;B.length>0;)if(h=B.pop(),f=R[h]){var P={},F=f.hot._disposeHandlers;for(u=0;u<F.length;u++)(s=F[u])(P);for(o[h]=P,f.hot.active=!1,delete R[h],delete y[h],u=0;u<f.children.length;u++){var C=R[f.children[u]];C&&((z=C.parents.indexOf(h))>=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<N.length;u++)M=N[u],(z=f.children.indexOf(M))>=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<N.length;l++)if(M=N[l],s=f.hot._acceptedDependencies[M]){if(-1!==j.indexOf(s))continue;j.push(s)}for(l=0;l<j.length;l++){s=j[l];try{s(N)}catch(e){r.onErrored&&r.onErrored({type:"accept-errored",moduleId:h,dependencyId:N[l],error:e}),r.ignoreErrored||Z||(Z=e)}}}for(l=0;l<D.length;l++){var H=D[l];h=H.module,a=H.parents,n=h;try{O(h)}catch(e){if("function"==typeof H.errorHandler)try{H.errorHandler(e)}catch(t){r.onErrored&&r.onErrored({type:"self-accept-error-handler-errored",moduleId:h,error:t,originalError:e}),r.ignoreErrored||Z||(Z=t),Z||(Z=e)}else r.onErrored&&r.onErrored({type:"self-accept-errored",moduleId:h,error:e}),r.ignoreErrored||Z||(Z=e)}}if(Z)return c("fail"),Promise.reject(Z);if(g)return t(r).then((function(e){return m.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e}));return c("idle"),new Promise((function(e){e(m)}))}(t=t||{})}function L(){if(g)return p||(p={}),g.forEach(A),g=void 0,!0}function A(t){Object.prototype.hasOwnProperty.call(p,t)||(p[t]=e[t])}var R={};function O(t){if(R[t])return R[t].exports;var n=R[t]={i:t,l:!1,exports:{},hot:u(t),parents:(s=a,a=[],s),children:[]};return e[t].call(n.exports,n,n.exports,l(t)),n.l=!0,n.exports}O.m=e,O.c=R,O.d=function(e,t,n){O.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},O.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},O.t=function(e,t){if(1&t&&(e=O(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(O.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)O.d(n,r,function(t){return e[t]}.bind(null,r));return n},O.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return O.d(t,"a",t),t},O.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},O.p="",O.h=function(){return i},l(204)(O.s=204)}([,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(e){
+/*!
+ * The buffer module from node.js, for the browser.
+ *
+ * @author Feross Aboukhadijeh <http://feross.org>
+ * @license MIT
+ */
+var r=n(205),i=n(206),o=n(29);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}return u(this,e,t,n)}function u(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=c(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(t,n),i=(e=s(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(l.isBuffer(t)){var n=0|d(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):c(e,t);if("Buffer"===t.type&&o(t.data))return c(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function h(e,t){if(f(t),e=s(e,t<0?0:0|d(t)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function c(e,t){var n=t.length<0?0:0|d(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return C(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Z(e).length;default:if(r)return C(e).length;t=(""+t).toLowerCase(),r=!0}}function _(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return L(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return x(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=n;o<s;o++)if(u(e,o)===u(t,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===l)return f*a}else-1!==f&&(o-=o-f),f=-1}else for(n+l>s&&(n=s-l),o=n;o>=0;o--){for(var h=!0,c=0;c<l;c++)if(u(e,o+c)!==u(t,c)){h=!1;break}if(h)return o}return-1}function m(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function v(e,t,n,r){return j(C(t,e.length-n),e,n,r)}function w(e,t,n,r){return j(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function E(e,t,n,r){return w(e,t,n,r)}function k(e,t,n,r){return j(Z(t),e,n,r)}function S(e,t,n,r){return j(function(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function x(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,l,u=e[i],f=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=n)switch(h){case 1:u<128&&(f=u);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&u)<<6|63&o)>127&&(f=l);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(f=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(f=l)}null===f?(f=65533,h=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=l,t.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},t.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,n){return u(null,e,t,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,n){return function(e,t,n,r){return f(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},l.allocUnsafe=function(e){return h(null,e)},l.allocUnsafeSlow=function(e){return h(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=l.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!l.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},l.byteLength=p,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):_.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,n,r,i){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(r,i),f=e.slice(t,n),h=0;h<s;++h)if(u[h]!==f[h]){o=u[h],a=f[h];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return b(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return b(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return m(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function A(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function R(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=F(e[o]);return i}function O(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function I(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function U(e,t,n,r,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function z(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function D(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function M(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,r,o){return o||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,o){return o||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=l.prototype;else{var i=t-e;n=new l(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},l.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},l.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||U(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},l.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||U(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);U(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);U(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var a=l.isBuffer(e)?e:C(new l(e,r).toString()),s=a.length;for(o=0;o<n-t;++o)this[o+t]=a[o%s]}return this};var P=/[^+\/0-9A-Za-z-_]/g;function F(e){return e<16?"0"+e.toString(16):e.toString(16)}function C(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(P,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(1))},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l,u=[],f=!1,h=-1;function c(){f&&l&&(f=!1,l.length?u=l.concat(u):h=-1,u.length&&d())}function d(){if(!f){var e=s(c);f=!0;for(var t=u.length;t;){for(l=u,u=[];++h<t;)l&&l[h].run();h=-1,t=u.length}l=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function _(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new p(e,t)),1!==u.length||f||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=_,i.addListener=_,i.once=_,i.off=_,i.removeListener=_,i.removeAllListeners=_,i.emit=_,i.prependListener=_,i.prependOnceListener=_,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){"use strict";var r=n(12),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=h;var o=n(10);o.inherits=n(4);var a=n(30),s=n(20);o.inherits(h,a);for(var l=i(s.prototype),u=0;u<l.length;u++){var f=l[u];h.prototype[f]||(h.prototype[f]=s.prototype[f])}function h(e){if(!(this instanceof h))return new h(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",c)}function c(){this.allowHalfOpen||this._writableState.ended||r.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),h.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},,,,function(e,t,n){(t=e.exports=n(30)).Stream=t,t.Readable=t,t.Writable=n(20),t.Duplex=n(5),t.Transform=n(34),t.PassThrough=n(216)},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(2).Buffer)},,function(e,t,n){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,i)}));default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick((function(){e.apply(null,o)}))}}}:e.exports=t}).call(this,n(3))},function(e,t,n){var r=n(2),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),o(i,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){var t,n,r,i,o,a;for(r=0,t=0,n=e.length;t<n;t++)r+=e[t].length;for(a=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,n,r,i){for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,o))},t.setTyped(r)},,,,,function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,o,a,s;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=u(e))>0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,s=l,console&&console.warn&&console.warn(s)}return e}function h(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,o(this.listener,this.target,e))}function c(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):_(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function _(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");l=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)o(l,this,t);else{var u=l.length,f=_(l,u);for(n=0;n<u;++n)o(f[n],this,t)}return!0},s.prototype.addListener=function(e,t){return f(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return f(this,e,t,!0)},s.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.on(e,c(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.prependListener(e,c(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,o,a;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";(function(t,r,i){var o=n(12);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,l=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:o.nextTick;y.WritableState=b;var u=n(10);u.inherits=n(4);var f={deprecate:n(215)},h=n(31),c=n(13).Buffer,d=i.Uint8Array||function(){};var p,_=n(32);function g(){}function b(e,t){s=s||n(5),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(u||0===u)?u:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===e.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(o.nextTick(i,r),o.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),S(e,t))}(e,n,r,t,i);else{var a=E(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||w(e,n),r?l(v,e,n,a,i):v(e,n,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(s=s||n(5),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new b(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),h.call(this)}function m(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function v(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),S(e,t)}function w(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var s=0,l=!0;n;)i[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;i.allBuffers=l,m(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,f=n.encoding,h=n.callback;if(m(e,t,!1,t.objectMode?1:u.length,u,f,h),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var n=E(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}u.inherits(y,h),b.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(b.prototype,"buffer",{get:f.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof b)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,n){var r,i=this._writableState,a=!1,s=!i.objectMode&&(r=e,c.isBuffer(r)||r instanceof d);return s&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=g),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),o.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(r,a),i=!1),i}(this,i,e,n))&&(i.pendingcb++,a=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,n));return t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var l=t.length<t.highWaterMark;l||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else m(e,t,!1,s,r,i,o);return l}(this,i,s,e,t,n)),a},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||w(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?o.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=_.destroy,y.prototype._undestroy=_.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(3),n(213).setImmediate,n(1))},,,,,,,,,function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(t,r){var i=n(12);e.exports=m;var o,a=n(29);m.ReadableState=y;n(19).EventEmitter;var s=function(e,t){return e.listeners(t).length},l=n(31),u=n(13).Buffer,f=t.Uint8Array||function(){};var h=n(10);h.inherits=n(4);var c=n(210),d=void 0;d=c&&c.debuglog?c.debuglog("stream"):function(){};var p,_=n(211),g=n(32);h.inherits(m,l);var b=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var r=t instanceof(o=o||n(5));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new _,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=n(33).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function m(e){if(o=o||n(5),!(this instanceof m))return new m(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),l.call(this)}function v(e,t,n,r,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,k(e)}(e,a)):(i||(o=function(e,t){var n;r=t,u.isBuffer(r)||r instanceof f||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):x(e,a)):w(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function w(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&k(e)),x(e,t)}Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),m.prototype.destroy=g.destroy,m.prototype._undestroy=g.undestroy,m.prototype._destroy=function(e,t){this.push(null),t(e)},m.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=u.from(e,t),t=""),n=!0),v(this,e,t,!1,n)},m.prototype.unshift=function(e){return v(this,e,null,!0,!1)},m.prototype.isPaused=function(){return!1===this._readableState.flowing},m.prototype.setEncoding=function(e){return p||(p=n(33).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(S,e):S(e))}function S(e){d("emit readable"),e.emit("readable"),R(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(T,e,t))}function T(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(d("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function L(e){d("readable nexttick read 0"),e.read(0)}function A(e,t){t.reading||(d("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),R(e),t.flowing&&!t.reading&&e.read(0)}function R(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function O(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;e-=i.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=u.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0===(e-=a)){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function I(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(U,t,e))}function U(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function z(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}m.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):k(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&I(this),null;var r,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",i=!0),t.ended||t.reading?d("reading or ended",i=!1):i&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(n,t))),null===(r=e>0?O(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&I(this)),null!==r&&this.emit("data",r),r},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,t);var l=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?f:m;function u(t,r){d("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,d("cleanup"),e.removeListener("close",b),e.removeListener("finish",y),e.removeListener("drain",h),e.removeListener("error",g),e.removeListener("unpipe",u),n.removeListener("end",f),n.removeListener("end",m),n.removeListener("data",_),c=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||h())}function f(){d("onend"),e.end()}o.endEmitted?i.nextTick(l):n.once("end",l),e.on("unpipe",u);var h=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,R(e))}}(n);e.on("drain",h);var c=!1;var p=!1;function _(t){d("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==z(o.pipes,e))&&!c&&(d("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function g(t){d("onerror",t),m(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function b(){e.removeListener("finish",y),m()}function y(){d("onfinish"),e.removeListener("close",b),m()}function m(){d("unpipe"),n.unpipe(e)}return n.on("data",_),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",g),e.once("close",b),e.once("finish",y),e.emit("pipe",n),o.flowing||(d("pipe resume"),n.resume()),e},m.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var a=z(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},m.prototype.on=function(e,t){var n=l.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&k(this):i.nextTick(L,this))}return n},m.prototype.addListener=m.prototype.on,m.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(A,e,t))}(this,e)),this},m.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},m.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(d("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(d("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<b.length;o++)e.on(b[o],this.emit.bind(this,b[o]));return this._read=function(t){d("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),m._fromList=O}).call(this,n(1),n(3))},function(e,t,n){e.exports=n(19).EventEmitter},function(e,t,n){"use strict";var r=n(12);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";var r=n(13).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=h,t=3;break;default:return this.write=c,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function f(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function c(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=a(t[r]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=a(t[r]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=a(t[r]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=a;var r=n(5),i=n(10);function o(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);r.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush((function(t,n){l(e,t,n)})):l(this,null,null)}function l(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=n(4),i.inherits(a,r),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,(function(e){t(e),n.emit("close")}))}},function(e,t,n){var r=n(36),i=Array.prototype.slice,o=Object.prototype.hasOwnProperty,a=e.exports=f;function s(e,t){return r.isUndefined(t)?""+t:r.isNumber(t)&&!isFinite(t)||r.isFunction(t)||r.isRegExp(t)?t.toString():t}function l(e,t){return r.isString(e)?e.length<t?e:e.slice(0,t):e}function u(e,t,n,r,i){throw new a.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:i})}function f(e,t){e||u(e,!0,t,"==",a.ok)}function h(e,t){if(e===t)return!0;if(r.isBuffer(e)&&r.isBuffer(t)){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return r.isDate(e)&&r.isDate(t)?e.getTime()===t.getTime():r.isRegExp(e)&&r.isRegExp(t)?e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase:r.isObject(e)||r.isObject(t)?function(e,t){if(r.isNullOrUndefined(e)||r.isNullOrUndefined(t))return!1;if(e.prototype!==t.prototype)return!1;if(r.isPrimitive(e)||r.isPrimitive(t))return e===t;var n=c(e),o=c(t);if(n&&!o||!n&&o)return!1;if(n)return e=i.call(e),t=i.call(t),h(e,t);var a,s,l=_(e),u=_(t);if(l.length!=u.length)return!1;for(l.sort(),u.sort(),s=l.length-1;s>=0;s--)if(l[s]!=u[s])return!1;for(s=l.length-1;s>=0;s--)if(a=l[s],!h(e[a],t[a]))return!1;return!0}(e,t):e==t}function c(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function d(e,t){return!(!e||!t)&&("[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t||!0===t.call({},e))}function p(e,t,n,i){var o;r.isString(n)&&(i=n,n=null);try{t()}catch(e){o=e}if(i=(n&&n.name?" ("+n.name+").":".")+(i?" "+i:"."),e&&!o&&u(o,n,"Missing expected exception"+i),!e&&d(o,n)&&u(o,n,"Got unwanted exception"+i),e&&o&&n&&!d(o,n)||!e&&o)throw o}a.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return l(JSON.stringify(e.actual,s),128)+" "+e.operator+" "+l(JSON.stringify(e.expected,s),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||u;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,i=t.name,o=r.indexOf("\n"+i);if(o>=0){var a=r.indexOf("\n",o+1);r=r.substring(a+1)}this.stack=r}}},r.inherits(a.AssertionError,Error),a.fail=u,a.ok=f,a.equal=function(e,t,n){e!=t&&u(e,t,n,"==",a.equal)},a.notEqual=function(e,t,n){e==t&&u(e,t,n,"!=",a.notEqual)},a.deepEqual=function(e,t,n){h(e,t)||u(e,t,n,"deepEqual",a.deepEqual)},a.notDeepEqual=function(e,t,n){h(e,t)&&u(e,t,n,"notDeepEqual",a.notDeepEqual)},a.strictEqual=function(e,t,n){e!==t&&u(e,t,n,"===",a.strictEqual)},a.notStrictEqual=function(e,t,n){e===t&&u(e,t,n,"!==",a.notStrictEqual)},a.throws=function(e,t,n){p.apply(this,[!0].concat(i.call(arguments)))},a.doesNotThrow=function(e,t){p.apply(this,[!1].concat(i.call(arguments)))},a.ifError=function(e){if(e)throw e};var _=Object.keys||function(e){var t=[];for(var n in e)o.call(e,n)&&t.push(n);return t}},function(e,t,n){(function(e){var r=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},i=/%[sdj%]/g;t.format=function(e){if(!b(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(s(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,o=r.length,a=String(e).replace(i,(function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),l=r[n];n<o;l=r[++n])_(l)||!v(l)?a+=" "+l:a+=" "+s(l);return a},t.deprecate=function(n,r){if(void 0!==e&&!0===e.noDeprecation)return n;if(void 0===e)return function(){return t.deprecate(n,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(r);e.traceDeprecation?console.trace(r):console.error(r),i=!0}return n.apply(this,arguments)}};var o,a={};function s(e,n){var r={seen:[],stylize:u};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),p(n)?r.showHidden=n:n&&t._extend(r,n),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),f(r,e,r.depth)}function l(e,t){var n=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.colors[n][1]+"m":e}function u(e,t){return e}function f(e,n,r){if(e.customInspect&&n&&k(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return b(i)||(i=f(e,i,r)),i}var o=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(g(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(_(t))return e.stylize("null","null")}(e,n);if(o)return o;var a=Object.keys(n),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),E(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(n);if(0===a.length){if(k(n)){var l=n.name?": "+n.name:"";return e.stylize("[Function"+l+"]","special")}if(m(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(w(n))return e.stylize(Date.prototype.toString.call(n),"date");if(E(n))return h(n)}var u,v="",S=!1,x=["{","}"];(d(n)&&(S=!0,x=["[","]"]),k(n))&&(v=" [Function"+(n.name?": "+n.name:"")+"]");return m(n)&&(v=" "+RegExp.prototype.toString.call(n)),w(n)&&(v=" "+Date.prototype.toUTCString.call(n)),E(n)&&(v=" "+h(n)),0!==a.length||S&&0!=n.length?r<0?m(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),u=S?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a<s;++a)A(t,String(a))?o.push(c(e,t,n,r,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(c(e,t,n,r,i,!0))})),o}(e,n,r,s,a):a.map((function(t){return c(e,n,r,s,t,S)})),e.seen.pop(),function(e,t,n){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(u,v,x)):x[0]+v+x[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,n,r,i,o){var a,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),A(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=_(n)?f(e,l.value,null):f(e,l.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function d(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function _(e){return null===e}function g(e){return"number"==typeof e}function b(e){return"string"==typeof e}function y(e){return void 0===e}function m(e){return v(e)&&"[object RegExp]"===S(e)}function v(e){return"object"==typeof e&&null!==e}function w(e){return v(e)&&"[object Date]"===S(e)}function E(e){return v(e)&&("[object Error]"===S(e)||e instanceof Error)}function k(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function x(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(y(o)&&(o=e.env.NODE_DEBUG||""),n=n.toUpperCase(),!a[n])if(new RegExp("\\b"+n+"\\b","i").test(o)){var r=e.pid;a[n]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",n,r,e)}}else a[n]=function(){};return a[n]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=p,t.isNull=_,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=b,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=m,t.isObject=v,t.isDate=w,t.isError=E,t.isFunction=k,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(226);var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function L(){var e=new Date,t=[x(e.getHours()),x(e.getMinutes()),x(e.getSeconds())].join(":");return[e.getDate(),T[e.getMonth()],t].join(" ")}function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",L(),t.format.apply(t,arguments))},t.inherits=n(4),t._extend=function(e,t){if(!t||!v(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(R&&e[R]){var t;if("function"!=typeof(t=e[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,r){e?n(e):t(r)}));try{e.apply(this,i)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),R&&Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,r(e))},t.promisify.custom=R,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function n(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var i=n.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};t.apply(this,n).then((function(t){e.nextTick(a,null,t)}),(function(t){e.nextTick(O,t,a)}))}return Object.setPrototypeOf(n,Object.getPrototypeOf(t)),Object.defineProperties(n,r(t)),n}}).call(this,n(3))},function(e,t,n){"use strict";e.exports=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(i=i+t[r++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},function(e,t,n){"use strict";var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();e.exports=function(e,t,n,i){var o=r,a=i+n;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},function(e,t,n){"use strict";function r(e,t){return e.readUInt32LE(t)+4294967296*e.readUInt32LE(t+4)}function i(e){var t=arguments;return new Error(e.replace(/{(\d+)}/g,(function(e,n){var r=t[+n+1];return void 0===r?e:r})))}t.readEOCDRecord=function(e,t){e.read(-65557,(function(n,o){if(n)return t(n);if(o.length<22)return t(i("expected at least 22 bytes for End Of Central Directory got {0}",o.length));var a={},s=o.lastIndexOf("PK");if(-1===s)return t(i("End Of Central Directory not found"));var l=o.slice(s);if(0!==l.readUInt16LE(4))return t(i("spanned zip files are not supported"));a.entryCount=l.readUInt16LE(10),a.cdSize=l.readUInt32LE(12),a.cdOffset=l.readUInt32LE(16);var u=l.readUInt16LE(20);a.comment=l.toString("utf-8",22,22+u),console.assert(a.comment.length===u,"expected "+u+" bytes for zip file comment got "+a.comment.length),65535===a.entryCount||4294967295===a.cdSize||4294967295===a.cdOffset?function(e,t,n){!function(e,t,n){e.read(t-20,t,(function(e,t){if(e)return n(e);if(t.length<20)return n(i("expected at least 20 bytes for Zip64 End Of Central Directory Locator got {0}",t.length));if(117853008!==t.readUInt32LE(0))return n(i("Zip64 End Of Central Directory Locator not found"));var o=r(t,8);if(1!==t.readUInt32LE(16))return n(i("spanned zip files are not supported"));n(null,o)}))}(e,t,(function(t,o){if(t)return n(t);e.read(o,o+56,(function(e,t){if(e)return n(e);if(t.length<56)return n(i("expected at least 56 bytes for Zip64 End Of Central Directory got {0}",t.length));var o={};if(101075792!==t.readUInt32LE(0))return n(i("Zip64 End Of Central Directory not found"));o.entryCount=r(t,32),o.cdSize=r(t,40),o.cdOffset=r(t,48),n(null,o)}))}))}(e,s,(function(e,n){n&&(n.comment=a.comment),t(e,n)})):t(null,a)}))},t.readUInt64LE=r,t.E=i,t.cp437ToUnicode=function(e){var t,n=[0,9786,9787,9829,9830,9827,9824,8226,9688,9675,9689,9794,9792,9834,9835,9788,9658,9668,8597,8252,182,167,9644,8616,8593,8595,8594,8592,8735,8596,9650,9660,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,8962,199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,186,191,8976,172,189,188,161,171,187,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,945,223,915,960,931,963,181,964,934,920,937,948,8734,966,949,8745,8801,177,8805,8804,8992,8993,247,8776,176,8729,183,8730,8319,178,9632,160],r=new Array(e.length),i=r.length;for(t=0;t<i;t++)r[t]=n[e[t]];var o="";for(t=0;t<i;t+=32767)o+=String.fromCharCode.apply(null,r.slice(t,t+32767));return o}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){(function(e){self;var t=n(207);addEventListener("message",(function(n){JSON.parse(n.data.difficulties);const r=n.data.version,i=n.data.hash,[o]=r.split("-");t(n.data.directDownload,(function(t,o){if(t)return console.error(t);o.readEntries((function(t,a){if(t)return console.error(t);const s={audio:void 0,beats:{}},l={};a.forEach((function(t){const a=[];o.readEntryData(t,!1,(function(o,u){if(o)return console.error(o);u.on("data",(function(e){a.push(e)})),u.on("end",(function(){if(t.name.endsWith(".egg")||t.name.endsWith(".ogg")){var o=new Blob(a),u=URL.createObjectURL(o);s.audio=u}else{var f=t.name;if(!f.toLowerCase().endsWith(".dat"))return;var h=e.concat(a).toString("utf8"),c=JSON.parse(h);"info.dat"===f.toLowerCase()?s.info=c:(c._beatsPerMinute=n.data.bpm,l[f]=c)}if(void 0!==s.audio&&void 0!==s.info){for(const e of s.info._difficultyBeatmapSets){const t=e._beatmapCharacteristicName;for(const n of e._difficultyBeatmaps){const e=n._difficulty,r=n._beatmapFilename;if(void 0===l[r])return;const i=t+"-"+e;void 0===s.beats[i]&&(s.beats[i]=l[r])}}postMessage({message:"load",data:s,version:r,hash:i})}}))}))}))}))}))}))}).call(this,n(2).Buffer)},function(e,t,n){!function(e){"use strict";var t="undefined"!=typeof Uint8Array?Uint8Array:Array,n="+".charCodeAt(0),r="/".charCodeAt(0),i="0".charCodeAt(0),o="a".charCodeAt(0),a="A".charCodeAt(0),s="-".charCodeAt(0),l="_".charCodeAt(0);function u(e){var t=e.charCodeAt(0);return t===n||t===s?62:t===r||t===l?63:t<i?-1:t<i+10?t-i+26+26:t<a+26?t-a:t<o+26?t-o+26:void 0}e.toByteArray=function(e){var n,r,i,o,a,s;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=e.length;a="="===e.charAt(l-2)?2:"="===e.charAt(l-1)?1:0,s=new t(3*e.length/4-a),i=a>0?e.length-4:e.length;var f=0;function h(e){s[f++]=e}for(n=0,r=0;n<i;n+=4,r+=3)h((16711680&(o=u(e.charAt(n))<<18|u(e.charAt(n+1))<<12|u(e.charAt(n+2))<<6|u(e.charAt(n+3))))>>16),h((65280&o)>>8),h(255&o);return 2===a?h(255&(o=u(e.charAt(n))<<2|u(e.charAt(n+1))>>4)):1===a&&(h((o=u(e.charAt(n))<<10|u(e.charAt(n+1))<<4|u(e.charAt(n+2))>>2)>>8&255),h(255&o)),s},e.fromByteArray=function(e){var t,n,r,i,o=e.length%3,a="";function s(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,r=e.length-o;t<r;t+=3)n=(e[t]<<16)+(e[t+1]<<8)+e[t+2],a+=s((i=n)>>18&63)+s(i>>12&63)+s(i>>6&63)+s(63&i);switch(o){case 1:a+=s((n=e[e.length-1])>>2),a+=s(n<<4&63),a+="==";break;case 2:a+=s((n=(e[e.length-2]<<8)+e[e.length-1])>>10),a+=s(n>>4&63),a+=s(n<<2&63),a+="="}return a}}(t)},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,u=l>>1,f=-7,h=n?i-1:0,c=n?-1:1,d=e[t+h];for(h+=c,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+h],h+=c,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+e[t+h],h+=c,f-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=u}return(d?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,l,u=8*o-i-1,f=(1<<u)-1,h=f>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?c/l:c*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=f?(s=0,a=f):a+h>=1?(s=(t*l-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[n+d]=255&a,d+=p,a/=256,u-=8);e[n+d-p]|=128*_}},function(e,t,n){"use strict";var r=n(208),i=n(217),o=n(39);function a(e,t){try{var n=new r(e);o.readEOCDRecord(n,(function(e,r){t(e,e?null:new i(n,r))}))}catch(e){t(e)}}e.exports=function(e,t){if("string"==typeof e){var n=new XMLHttpRequest;n.addEventListener("readystatechange",(function(){4===this.readyState&&(200===this.status?a(this.response,t):t(o.E("network error: {0} {1}",this.status,this.statusText)))}));try{n.open("GET",e),n.responseType="blob",n.send()}catch(e){t(e)}}else a(e,t)}},function(e,t,n){"use strict";(function(t){var r=n(209);function i(e){if(!(this instanceof i))return new i(e);if(!(e instanceof Blob||-1!==["[object Blob]","[object File]"].indexOf(Object.prototype.toString.call(e))))throw new TypeError('"blob" argument must be an instance of Blob or File');this._blob=e}e.exports=i,i.prototype.read=function(e,n,r){if("function"==typeof e?r=e:"function"==typeof n&&(r=n,n=this._blob.size),"function"!=typeof r)throw new TypeError('"callback" argument must be a function');e=~~e,n=void 0===n?this._blob.size:~~n;var i=new FileReader;i.addEventListener("loadend",(function e(){this.removeEventListener("loadend",e),r(this.error,this.result?t.from(this.result):null)})),i.readAsArrayBuffer(this._blob.slice(e,n))},i.prototype.createReadStream=function(e){return new r(this._blob,e)}}).call(this,n(2).Buffer)},function(e,t,n){"use strict";(function(t){var r=n(9).Readable;function i(e,n){n||(n={}),void 0===n.highWaterMark&&(n.highWaterMark=65536),r.call(this,n);var i=~~n.start,o=void 0===n.end?e.size:~~n.end;this._blob=e.slice(i,o),this._end=this._blob.size,this._pos=0,this._reader=new FileReader;var a=this;this._loadendListener=function(){this.error?a.destroy(this.error):(a._pos+=this.result.byteLength,a.push(t.from(this.result)))},this._reader.addEventListener("loadend",this._loadendListener),this.on("end",(function(){this.destroy()}))}e.exports=i,i.prototype=Object.create(r.prototype),i.prototype.constructor=i,Object.defineProperties(i.prototype,{readableLength:{get:function(){return this._readableState.length}},ended:{get:function(){return this._pos>=this._end}}}),i.prototype._read=function(e){this.destroyed||(this.ended?this.push(null):this._reader.readAsArrayBuffer(this._blob.slice(this._pos,this._pos+e)))},i.prototype._destroy=function(e,t){t(e),this._reader.readyState===FileReader.LOADING&&this._reader.abort(),this._reader.removeEventListener("loadend",this._loadendListener),this._reader=null}}).call(this,n(2).Buffer)},function(e,t){},function(e,t,n){"use strict";var r=n(13).Buffer,i=n(212);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,i,o=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=o,i=s,t.copy(n,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(214),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(1))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,o,a,s,l=1,u={},f=!1,h=e.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(e);c=c&&c.setTimeout?c:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(e){var t=h.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),c.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return u[l]=i,r(l),l++},c.clearImmediate=d}function d(e){delete u[e]}function p(e){if(f)setTimeout(p,0,e);else{var t=u[e];if(t){f=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{d(e),f=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(1),n(3))},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(1))},function(e,t,n){"use strict";e.exports=o;var r=n(34),i=n(10);function o(e){if(!(this instanceof o))return new o(e);r.call(this,e)}i.inherits=n(4),i.inherits(o,r),o.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){"use strict";(function(t){var r=n(218),i=n(219).createInflateRaw,o=n(9).Transform,a=n(39),s=a.E,l=a.readUInt64LE,u=a.cp437ToUnicode;function f(e,t){this.entries=[],this.entryCount=t.entryCount,this.comment=t.comment,this._cdSize=t.cdSize,this._cdOffset=t.cdOffset,this._reader=e}function h(){this.extraFields=[]}e.exports=f,f.prototype.readEntries=function(e){var n,i,o=this;n=e,i=!1,e=function(e,t){i||(i=!0,n(e,t))};var a=this._reader.createReadStream({start:this._cdOffset,end:this._cdOffset+this._cdSize});function f(e){a.destroy(e),a.read()}a.on("error",e),a.on("end",(function(){e(o.entries.length===o.entryCount?null:s("expected {0} entries got {1}",o.entryCount,o.entries.length),o.entries)})),a.on("readable",(function(){for(;this.readableLength>0;){if(this.readableLength<46){if(this.ended)return f(s("expected at least 46 bytes for Central File Header got {0}",this.readableLength));break}var e=this.read(46),n=new h;if(33639248!==e.readUInt32LE(0))return f(s("invalide Central File Header signature"));n.versionMadeBy=e.readUInt16LE(4),n.versionNeededToExtract=e.readUInt16LE(6),n.generalPurposeBitFlag=e.readUInt16LE(8),n.compressionMethod=e.readUInt16LE(10),n.lastModTime=e.readUInt16LE(12),n.lastModDate=e.readUInt16LE(14),n.crc32=e.readUInt32LE(16),n.compressedSize=e.readUInt32LE(20),n.uncompressedSize=e.readUInt32LE(24);var i=e.readUInt16LE(28),a=e.readUInt16LE(30),c=e.readUInt16LE(32);n.internalAttributes=e.readUInt16LE(36),n.externalAttributes=e.readUInt32LE(38),n.localHeaderOffset=e.readUInt32LE(42);var d=i+a+c;if(this.readableLength<d){if(this.ended)return f(s("expected at least {0} bytes for variable fields in Central File Header got {1}",d,this.readableLength));this.unshift(e);break}var p=this.read(d);n.name=p.slice(0,i);for(var _=p.slice(i,i+a),g=0,b=_.length-3;g<b;){var y=_.readUInt16LE(g),m=_.readUInt16LE(g+=2),v=t.from(_.slice(g+=2,g+=m));n.extraFields.push({headerId:y,dataSize:m,data:v})}if(n.comment=p.slice(i+a),2048==(2048&n.generalPurposeBitFlag)?(n.name=n.name.toString(),n.comment=n.comment.toString()):(n.name=u(n.name),n.comment=u(n.comment)),["name","comment"].forEach((function(e){var t,o;"name"===e?(t=28789,o=p.slice(0,i)):(t=25461,o=p.slice(i+a)),n.extraFields.filter((function(e){return e.headerId===t})).forEach((function(t){var i=t.data;if(i.length>6){var a=1===i.readUInt8(0),s=r.unsigned(o)===i.readUInt32LE(1),l=i.toString("utf8",5);a&&s&&l.length>0&&(n[e]=l)}}))})),4294967295===n.compressedSize||4294967295===n.uncompressedSize||4294967295===n.localHeaderOffset){var w=n.extraFields.filter((function(e){return 1===e.headerId}))[0];if(!w)return f(s("Zip64 Extended Information Extra Field not found"));var E=0,k=["uncompressedSize","compressedSize","localHeaderOffset"];for(var S in k){var x=k[S];if(4294967295===n[x])try{n[x]=l(w.data,E),E+=8}catch(e){return f(s("invalid Zip64 Extended Information Extra Field: {0} not found",x))}}}o.entries.push(n)}this.read(0)}))},f.prototype.readEntryData=function(e,t,n){if(e.encrypted)n(s("encrypted files are not supported"));else if(0===e.compressionMethod||8===e.compressionMethod){var a=this;this._reader.read(e.localHeaderOffset,e.localHeaderOffset+30,(function(l,u){if(l)return n(l);if(u.length<30)return n(s("expected at least 30 bytes for Local File Header got {1}",u.length));if(67324752!==u.readUInt32LE(0))return n(s("invalid Local File Header signature"));var f=u.readUInt16LE(26),h=u.readUInt16LE(28),c=e.localHeaderOffset+30+f+h,d=a._reader.createReadStream({start:c,end:c+e.compressedSize});if(8===e.compressionMethod){var p=i();d=d.on("error",(function(e){p.destroy(e)})).pipe(p)}if(t){var _,g=new o({transform:function(e,t,n){_=r(e,_),n(null,e)},flush:function(t){t(_.readUInt32BE(0)===e.crc32?null:s("corrupted file: crc check fails"))}});d=d.on("error",(function(e){g.destroy(e)})).pipe(g)}n(null,d)}))}else n(s("compression method is not supported"))},Object.defineProperties(h.prototype,{encrypted:{get:function(){return 1==(1&this.generalPurposeBitFlag)}},lastModDateTime:{get:function(){return new Date(1980+(this.lastModDate>>9&127),(this.lastModDate>>5&15)-1,31&this.lastModDate,this.lastModTime>>11&31,this.lastModTime>>5&63,2*(31&this.lastModTime))}}})}).call(this,n(2).Buffer)},function(e,t,n){var r=n(2).Buffer,i=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function o(e){if(r.isBuffer(e))return e;var t="function"==typeof r.alloc&&"function"==typeof r.from;if("number"==typeof e)return t?r.alloc(e):new r(e);if("string"==typeof e)return t?r.from(e):new r(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function a(e){var t=o(4);return t.writeInt32BE(e,0),t}function s(e,t){e=o(e),r.isBuffer(t)&&(t=t.readUInt32BE(0));for(var n=-1^~~t,a=0;a<e.length;a++)n=i[255&(n^e[a])]^n>>>8;return-1^n}function l(){return a(s.apply(null,arguments))}"undefined"!=typeof Int32Array&&(i=new Int32Array(i)),l.signed=function(){return s.apply(null,arguments)},l.unsigned=function(){return s.apply(null,arguments)>>>0},e.exports=l},function(e,t,n){"use strict";(function(e){var r=n(2).Buffer,i=n(220).Transform,o=n(225),a=n(36),s=n(35).ok,l=n(2).kMaxLength,u="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION;for(var f=Object.keys(o),h=0;h<f.length;h++){var c=f[h];c.match(/^Z/)&&Object.defineProperty(t,c,{enumerable:!0,value:o[c],writable:!1})}for(var d={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},p=Object.keys(d),_=0;_<p.length;_++){var g=p[_];d[d[g]]=g}function b(e,t,n){var i=[],o=0;function a(){for(var t;null!==(t=e.read());)i.push(t),o+=t.length;e.once("readable",a)}function s(){var t,a=null;o>=l?a=new RangeError(u):t=r.concat(i,o),i=[],e.close(),n(a,t)}e.on("error",(function(t){e.removeListener("end",s),e.removeListener("readable",a),n(t)})),e.on("end",s),e.end(t),a()}function y(e,t){if("string"==typeof t&&(t=r.from(t)),!r.isBuffer(t))throw new TypeError("Not a string or buffer");var n=e._finishFlushFlag;return e._processChunk(t,n)}function m(e){if(!(this instanceof m))return new m(e);L.call(this,e,o.DEFLATE)}function v(e){if(!(this instanceof v))return new v(e);L.call(this,e,o.INFLATE)}function w(e){if(!(this instanceof w))return new w(e);L.call(this,e,o.GZIP)}function E(e){if(!(this instanceof E))return new E(e);L.call(this,e,o.GUNZIP)}function k(e){if(!(this instanceof k))return new k(e);L.call(this,e,o.DEFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);L.call(this,e,o.INFLATERAW)}function x(e){if(!(this instanceof x))return new x(e);L.call(this,e,o.UNZIP)}function T(e){return e===o.Z_NO_FLUSH||e===o.Z_PARTIAL_FLUSH||e===o.Z_SYNC_FLUSH||e===o.Z_FULL_FLUSH||e===o.Z_FINISH||e===o.Z_BLOCK}function L(e,n){var a=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,i.call(this,e),e.flush&&!T(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!T(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||o.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:o.Z_FINISH,e.chunkSize&&(e.chunkSize<t.Z_MIN_CHUNK||e.chunkSize>t.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<t.Z_MIN_WINDOWBITS||e.windowBits>t.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<t.Z_MIN_LEVEL||e.level>t.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<t.Z_MIN_MEMLEVEL||e.memLevel>t.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!r.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new o.Zlib(n);var s=this;this._hadError=!1,this._handle.onerror=function(e,n){A(s),s._hadError=!0;var r=new Error(e);r.errno=n,r.code=t.codes[n],s.emit("error",r)};var l=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(l=e.level);var u=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(u=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,l,e.memLevel||t.Z_DEFAULT_MEMLEVEL,u,e.dictionary),this._buffer=r.allocUnsafe(this._chunkSize),this._offset=0,this._level=l,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!a._handle},configurable:!0,enumerable:!0})}function A(t,n){n&&e.nextTick(n),t._handle&&(t._handle.close(),t._handle=null)}function R(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(d),writable:!1}),t.Deflate=m,t.Inflate=v,t.Gzip=w,t.Gunzip=E,t.DeflateRaw=k,t.InflateRaw=S,t.Unzip=x,t.createDeflate=function(e){return new m(e)},t.createInflate=function(e){return new v(e)},t.createDeflateRaw=function(e){return new k(e)},t.createInflateRaw=function(e){return new S(e)},t.createGzip=function(e){return new w(e)},t.createGunzip=function(e){return new E(e)},t.createUnzip=function(e){return new x(e)},t.deflate=function(e,t,n){return"function"==typeof t&&(n=t,t={}),b(new m(t),e,n)},t.deflateSync=function(e,t){return y(new m(t),e)},t.gzip=function(e,t,n){return"function"==typeof t&&(n=t,t={}),b(new w(t),e,n)},t.gzipSync=function(e,t){return y(new w(t),e)},t.deflateRaw=function(e,t,n){return"function"==typeof t&&(n=t,t={}),b(new k(t),e,n)},t.deflateRawSync=function(e,t){return y(new k(t),e)},t.unzip=function(e,t,n){return"function"==typeof t&&(n=t,t={}),b(new x(t),e,n)},t.unzipSync=function(e,t){return y(new x(t),e)},t.inflate=function(e,t,n){return"function"==typeof t&&(n=t,t={}),b(new v(t),e,n)},t.inflateSync=function(e,t){return y(new v(t),e)},t.gunzip=function(e,t,n){return"function"==typeof t&&(n=t,t={}),b(new E(t),e,n)},t.gunzipSync=function(e,t){return y(new E(t),e)},t.inflateRaw=function(e,t,n){return"function"==typeof t&&(n=t,t={}),b(new S(t),e,n)},t.inflateRawSync=function(e,t){return y(new S(t),e)},a.inherits(L,i),L.prototype.params=function(n,r,i){if(n<t.Z_MIN_LEVEL||n>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+n);if(r!=t.Z_FILTERED&&r!=t.Z_HUFFMAN_ONLY&&r!=t.Z_RLE&&r!=t.Z_FIXED&&r!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+r);if(this._level!==n||this._strategy!==r){var a=this;this.flush(o.Z_SYNC_FLUSH,(function(){s(a._handle,"zlib binding closed"),a._handle.params(n,r),a._hadError||(a._level=n,a._strategy=r,i&&i())}))}else e.nextTick(i)},L.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},L.prototype._flush=function(e){this._transform(r.alloc(0),"",e)},L.prototype.flush=function(t,n){var i=this,a=this._writableState;("function"==typeof t||void 0===t&&!n)&&(n=t,t=o.Z_FULL_FLUSH),a.ended?n&&e.nextTick(n):a.ending?n&&this.once("end",n):a.needDrain?n&&this.once("drain",(function(){return i.flush(t,n)})):(this._flushFlag=t,this.write(r.alloc(0),"",n))},L.prototype.close=function(t){A(this,t),e.nextTick(R,this)},L.prototype._transform=function(e,t,n){var i,a=this._writableState,s=(a.ending||a.ended)&&(!e||a.length===e.length);return null===e||r.isBuffer(e)?this._handle?(s?i=this._finishFlushFlag:(i=this._flushFlag,e.length>=a.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH)),void this._processChunk(e,i,n)):n(new Error("zlib binding closed")):n(new Error("invalid input"))},L.prototype._processChunk=function(e,t,n){var i=e&&e.length,o=this._chunkSize-this._offset,a=0,f=this,h="function"==typeof n;if(!h){var c,d=[],p=0;this.on("error",(function(e){c=e})),s(this._handle,"zlib binding closed");do{var _=this._handle.writeSync(t,e,a,i,this._buffer,this._offset,o)}while(!this._hadError&&y(_[0],_[1]));if(this._hadError)throw c;if(p>=l)throw A(this),new RangeError(u);var g=r.concat(d,p);return A(this),g}s(this._handle,"zlib binding closed");var b=this._handle.write(t,e,a,i,this._buffer,this._offset,o);function y(l,u){if(this&&(this.buffer=null,this.callback=null),!f._hadError){var c=o-u;if(s(c>=0,"have should not go down"),c>0){var _=f._buffer.slice(f._offset,f._offset+c);f._offset+=c,h?f.push(_):(d.push(_),p+=_.length)}if((0===u||f._offset>=f._chunkSize)&&(o=f._chunkSize,f._offset=0,f._buffer=r.allocUnsafe(f._chunkSize)),0===u){if(a+=i-l,i=l,!h)return!0;var g=f._handle.write(t,e,a,i,f._buffer,f._offset,f._chunkSize);return g.callback=y,void(g.buffer=e)}if(!h)return!1;n()}}b.buffer=e,b.callback=y},a.inherits(m,L),a.inherits(v,L),a.inherits(w,L),a.inherits(E,L),a.inherits(k,L),a.inherits(S,L),a.inherits(x,L)}).call(this,n(3))},function(e,t,n){e.exports=i;var r=n(19).EventEmitter;function i(){r.call(this)}n(4)(i,r),i.Readable=n(9),i.Writable=n(221),i.Duplex=n(222),i.Transform=n(223),i.PassThrough=n(224),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",l));var a=!1;function s(){a||(a=!0,e.end())}function l(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(f(),0===r.listenerCount(this,"error"))throw e}function f(){n.removeListener("data",i),e.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",l),n.removeListener("error",u),e.removeListener("error",u),n.removeListener("end",f),n.removeListener("close",f),e.removeListener("close",f)}return n.on("error",u),e.on("error",u),n.on("end",f),n.on("close",f),e.on("close",f),e.emit("pipe",n),e}},function(e,t,n){e.exports=n(20)},function(e,t,n){e.exports=n(5)},function(e,t,n){e.exports=n(9).Transform},function(e,t,n){e.exports=n(9).PassThrough},function(e,t,n){"use strict";(function(e,r){var i=n(35),o=n(227),a=n(228),s=n(231),l=n(234);for(var u in l)t[u]=l[u];t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7;function f(e){if("number"!=typeof e||e<t.DEFLATE||e>t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}f.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,i(this.init_done,"close before init"),i(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?a.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||s.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},f.prototype.write=function(e,t,n,r,i,o,a){return this._write(!0,e,t,n,r,i,o,a)},f.prototype.writeSync=function(e,t,n,r,i,o,a){return this._write(!1,e,t,n,r,i,o,a)},f.prototype._write=function(n,o,a,s,l,u,f,h){if(i.equal(arguments.length,8),i(this.init_done,"write before init"),i(this.mode!==t.NONE,"already finalized"),i.equal(!1,this.write_in_progress,"write already in progress"),i.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,i.equal(!1,void 0===o,"must provide flush value"),this.write_in_progress=!0,o!==t.Z_NO_FLUSH&&o!==t.Z_PARTIAL_FLUSH&&o!==t.Z_SYNC_FLUSH&&o!==t.Z_FULL_FLUSH&&o!==t.Z_FINISH&&o!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==a&&(a=e.alloc(0),l=0,s=0),this.strm.avail_in=l,this.strm.input=a,this.strm.next_in=s,this.strm.avail_out=h,this.strm.output=u,this.strm.next_out=f,this.flush=o,!n)return this._process(),this._checkError()?this._afterSync():void 0;var c=this;return r.nextTick((function(){c._process(),c._after()})),this},f.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},f.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=a.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},f.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},f.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},f.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},f.prototype.init=function(e,n,r,o,a){i(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(e>=8&&e<=15,"invalid windowBits"),i(n>=-1&&n<=9,"invalid compression level"),i(r>=1&&r<=9,"invalid memlevel"),i(o===t.Z_FILTERED||o===t.Z_HUFFMAN_ONLY||o===t.Z_RLE||o===t.Z_FIXED||o===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(n,e,r,o,a),this._setDictionary()},f.prototype.params=function(){throw new Error("deflateParams Not supported")},f.prototype.reset=function(){this._reset(),this._setDictionary()},f.prototype._init=function(e,n,r,i,l){switch(this.level=e,this.windowBits=n,this.memLevel=r,this.strategy=i,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new o,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=a.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=l,this.write_in_progress=!1,this.init_done=!0},f.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=a.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},f.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=a.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=f}).call(this,n(2).Buffer,n(3))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t,n){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,n){"use strict";var r,i=n(14),o=n(229),a=n(37),s=n(38),l=n(230);function u(e,t){return e.msg=l[t],t}function f(e){return(e<<1)-(e>4?9:0)}function h(e){for(var t=e.length;--t>=0;)e[t]=0}function c(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function d(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,c(e.strm)}function p(e,t){e.pending_buf[e.pending++]=t}function _(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function g(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,u=e.window,f=e.w_mask,h=e.prev,c=e.strstart+258,d=u[o+a-1],p=u[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(n=t)+a]===p&&u[n+a-1]===d&&u[n]===u[o]&&u[++n]===u[o+1]){o+=2,n++;do{}while(u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&o<c);if(r=258-(c-o),o=c-258,r>a){if(e.match_start=t,a=r,r>=s)break;d=u[o+a-1],p=u[o+a]}}}while((t=h[t&f])>l&&0!=--i);return a<=e.lookahead?a:e.lookahead}function b(e){var t,n,r,o,l,u,f,h,c,d,p=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-262)){i.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=n=e.hash_size;do{r=e.head[--t],e.head[t]=r>=p?r-p:0}while(--n);t=n=p;do{r=e.prev[--t],e.prev[t]=r>=p?r-p:0}while(--n);o+=p}if(0===e.strm.avail_in)break;if(u=e.strm,f=e.window,h=e.strstart+e.lookahead,c=o,d=void 0,(d=u.avail_in)>c&&(d=c),n=0===d?0:(u.avail_in-=d,i.arraySet(f,u.input,u.next_in,d,h),1===u.state.wrap?u.adler=a(u.adler,f,d,h):2===u.state.wrap&&(u.adler=s(u.adler,f,d,h)),u.next_in+=d,u.total_in+=d,d),e.lookahead+=n,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+3-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function y(e,t){for(var n,r;;){if(e.lookahead<262){if(b(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-262&&(e.match_length=g(e,n)),e.match_length>=3)if(r=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}function m(e,t){for(var n,r,i;;){if(e.lookahead<262){if(b(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-262&&(e.match_length=g(e,n),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(d(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=o._tr_tally(e,0,e.window[e.strstart-1]))&&d(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}function v(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function w(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),h(this.dyn_ltree),h(this.dyn_dtree),h(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),h(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),h(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function E(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=0,o._tr_init(t),0):u(e,-2)}function k(e){var t,n=E(e);return 0===n&&((t=e.state).window_size=2*t.w_size,h(t.head),t.max_lazy_match=r[t.level].max_lazy,t.good_match=r[t.level].good_length,t.nice_match=r[t.level].nice_length,t.max_chain_length=r[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),n}function S(e,t,n,r,o,a){if(!e)return-2;var s=1;if(-1===t&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),o<1||o>9||8!==n||r<8||r>15||t<0||t>9||a<0||a>4)return u(e,-2);8===r&&(r=9);var l=new w;return e.state=l,l.strm=e,l.wrap=s,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=o+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new i.Buf8(2*l.w_size),l.head=new i.Buf16(l.hash_size),l.prev=new i.Buf16(l.w_size),l.lit_bufsize=1<<o+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new i.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=a,l.method=n,k(e)}r=[new v(0,0,0,0,(function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(b(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,d(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(d(e,!1),e.strm.avail_out),1)})),new v(4,4,8,4,y),new v(4,5,16,8,y),new v(4,6,32,32,y),new v(4,4,16,16,m),new v(8,16,32,32,m),new v(8,16,128,128,m),new v(8,32,128,256,m),new v(32,128,258,1024,m),new v(32,258,258,4096,m)],t.deflateInit=function(e,t){return S(e,t,8,15,8,0)},t.deflateInit2=S,t.deflateReset=k,t.deflateResetKeep=E,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?-2:(e.state.gzhead=t,0):-2},t.deflate=function(e,t){var n,i,a,l;if(!e||!e.state||t>5||t<0)return e?u(e,-2):-2;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&4!==t)return u(e,0===e.avail_out?-5:-2);if(i.strm=e,n=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,p(i,31),p(i,139),p(i,8),i.gzhead?(p(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),p(i,255&i.gzhead.time),p(i,i.gzhead.time>>8&255),p(i,i.gzhead.time>>16&255),p(i,i.gzhead.time>>24&255),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(p(i,255&i.gzhead.extra.length),p(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(p(i,0),p(i,0),p(i,0),p(i,0),p(i,0),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,3),i.status=113);else{var g=8+(i.w_bits-8<<4)<<8;g|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(g|=32),g+=31-g%31,i.status=113,_(i,g),0!==i.strstart&&(_(i,e.adler>>>16),_(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),c(e),a=i.pending,i.pending!==i.pending_buf_size));)p(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),c(e),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,p(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),c(e),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,p(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&c(e),i.pending+2<=i.pending_buf_size&&(p(i,255&e.adler),p(i,e.adler>>8&255),e.adler=0,i.status=113)):i.status=113),0!==i.pending){if(c(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&f(t)<=f(n)&&4!==t)return u(e,-5);if(666===i.status&&0!==e.avail_in)return u(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var y=2===i.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(b(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var n,r,i,a,s=e.window;;){if(e.lookahead<=258){if(b(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(r=s[i=e.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){a=e.strstart+258;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<a);e.match_length=258-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}(i,t):r[i.level].func(i,t);if(3!==y&&4!==y||(i.status=666),1===y||3===y)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===y&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(h(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),c(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(p(i,255&e.adler),p(i,e.adler>>8&255),p(i,e.adler>>16&255),p(i,e.adler>>24&255),p(i,255&e.total_in),p(i,e.total_in>>8&255),p(i,e.total_in>>16&255),p(i,e.total_in>>24&255)):(_(i,e.adler>>>16),_(i,65535&e.adler)),c(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?u(e,-2):(e.state=null,113===t?u(e,-3):0):-2},t.deflateSetDictionary=function(e,t){var n,r,o,s,l,u,f,c,d=t.length;if(!e||!e.state)return-2;if(2===(s=(n=e.state).wrap)||1===s&&42!==n.status||n.lookahead)return-2;for(1===s&&(e.adler=a(e.adler,t,d,0)),n.wrap=0,d>=n.w_size&&(0===s&&(h(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new i.Buf8(n.w_size),i.arraySet(c,t,d-n.w_size,n.w_size,0),t=c,d=n.w_size),l=e.avail_in,u=e.next_in,f=e.input,e.avail_in=d,e.next_in=0,e.input=t,b(n);n.lookahead>=3;){r=n.strstart,o=n.lookahead-2;do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+3-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++}while(--o);n.strstart=r,n.lookahead=2,b(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=u,e.input=f,e.avail_in=l,n.wrap=s,0},t.deflateInfo="pako deflate (from Nodeca project)"},function(e,t,n){"use strict";var r=n(14);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var o=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],a=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],l=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=new Array(576);i(u);var f=new Array(60);i(f);var h=new Array(512);i(h);var c=new Array(256);i(c);var d=new Array(29);i(d);var p,_,g,b=new Array(30);function y(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function m(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function v(e){return e<256?h[e]:h[256+(e>>>7)]}function w(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function E(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,w(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function k(e,t,n){E(e,n[2*t],n[2*t+1])}function S(e,t){var n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}function x(e,t,n){var r,i,o=new Array(16),a=0;for(r=1;r<=15;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=S(o[s]++,s))}}function T(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function L(e){e.bi_valid>8?w(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function A(e,t,n,r){var i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]}function R(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&A(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!A(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function O(e,t,n){var r,i,s,l,u=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*u]<<8|e.pending_buf[e.d_buf+2*u+1],i=e.pending_buf[e.l_buf+u],u++,0===r?k(e,i,t):(k(e,(s=c[i])+256+1,t),0!==(l=o[s])&&E(e,i-=d[s],l),k(e,s=v(--r),n),0!==(l=a[s])&&E(e,r-=b[s],l))}while(u<e.last_lit);k(e,256,t)}function I(e,t){var n,r,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,l=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<l;n++)0!==o[2*n]?(e.heap[++e.heap_len]=u=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=u,n=e.heap_len>>1;n>=1;n--)R(e,o,n);i=l;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],R(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,R(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,o,a,s,l=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,h=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,_=0;for(o=0;o<=15;o++)e.bl_count[o]=0;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)(o=l[2*l[2*(r=e.heap[n])+1]+1]+1)>p&&(o=p,_++),l[2*r+1]=o,r>u||(e.bl_count[o]++,a=0,r>=d&&(a=c[r-d]),s=l[2*r],e.opt_len+=s*(o+a),h&&(e.static_len+=s*(f[2*r+1]+a)));if(0!==_){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,_-=2}while(_>0);for(o=p;0!==o;o--)for(r=e.bl_count[o];0!==r;)(i=e.heap[--n])>u||(l[2*i+1]!==o&&(e.opt_len+=(o-l[2*i+1])*l[2*i],l[2*i+1]=o),r--)}}(e,t),x(o,u,e.bl_count)}function U(e,t,n){var r,i,o=-1,a=t[1],s=0,l=7,u=4;for(0===a&&(l=138,u=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<l&&i===a||(s<u?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(l=138,u=3):i===a?(l=6,u=3):(l=7,u=4))}function z(e,t,n){var r,i,o=-1,a=t[1],s=0,l=7,u=4;for(0===a&&(l=138,u=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<l&&i===a)){if(s<u)do{k(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(k(e,i,e.bl_tree),s--),k(e,16,e.bl_tree),E(e,s-3,2)):s<=10?(k(e,17,e.bl_tree),E(e,s-3,3)):(k(e,18,e.bl_tree),E(e,s-11,7));s=0,o=i,0===a?(l=138,u=3):i===a?(l=6,u=3):(l=7,u=4)}}i(b);var D=!1;function M(e,t,n,i){E(e,0+(i?1:0),3),function(e,t,n,i){L(e),i&&(w(e,n),w(e,~n)),r.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}t._tr_init=function(e){D||(!function(){var e,t,n,r,i,l=new Array(16);for(n=0,r=0;r<28;r++)for(d[r]=n,e=0;e<1<<o[r];e++)c[n++]=r;for(c[n-1]=r,i=0,r=0;r<16;r++)for(b[r]=i,e=0;e<1<<a[r];e++)h[i++]=r;for(i>>=7;r<30;r++)for(b[r]=i<<7,e=0;e<1<<a[r]-7;e++)h[256+i++]=r;for(t=0;t<=15;t++)l[t]=0;for(e=0;e<=143;)u[2*e+1]=8,e++,l[8]++;for(;e<=255;)u[2*e+1]=9,e++,l[9]++;for(;e<=279;)u[2*e+1]=7,e++,l[7]++;for(;e<=287;)u[2*e+1]=8,e++,l[8]++;for(x(u,287,l),e=0;e<30;e++)f[2*e+1]=5,f[2*e]=S(e,5);p=new y(u,o,257,286,15),_=new y(f,a,0,30,15),g=new y(new Array(0),s,0,19,7)}(),D=!0),e.l_desc=new m(e.dyn_ltree,p),e.d_desc=new m(e.dyn_dtree,_),e.bl_desc=new m(e.bl_tree,g),e.bi_buf=0,e.bi_valid=0,T(e)},t._tr_stored_block=M,t._tr_flush_block=function(e,t,n,r){var i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),I(e,e.l_desc),I(e,e.d_desc),a=function(e){var t;for(U(e,e.dyn_ltree,e.l_desc.max_code),U(e,e.dyn_dtree,e.d_desc.max_code),I(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*l[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==t?M(e,t,n,r):4===e.strategy||o===i?(E(e,2+(r?1:0),3),O(e,u,f)):(E(e,4+(r?1:0),3),function(e,t,n,r){var i;for(E(e,t-257,5),E(e,n-1,5),E(e,r-4,4),i=0;i<r;i++)E(e,e.bl_tree[2*l[i]+1],3);z(e,e.dyn_ltree,t-1),z(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),O(e,e.dyn_ltree,e.dyn_dtree)),T(e),r&&L(e)},t._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(c[n]+256+1)]++,e.dyn_dtree[2*v(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){E(e,2,3),k(e,256,u),function(e){16===e.bi_valid?(w(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,n){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,t,n){"use strict";var r=n(14),i=n(37),o=n(38),a=n(232),s=n(233);function l(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(852),t.distcode=t.distdyn=new r.Buf32(592),t.sane=1,t.back=-1,0):-2}function h(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,f(e)):-2}function c(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,h(e))):-2}function d(e,t){var n,r;return e?(r=new u,e.state=r,r.window=null,0!==(n=c(e,t))&&(e.state=null),n):-2}var p,_,g=!0;function b(e){if(g){var t;for(p=new r.Buf32(512),_=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,p,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,_,0,e.work,{bits:5}),g=!1}e.lencode=p,e.lenbits=9,e.distcode=_,e.distbits=5}function y(e,t,n,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new r.Buf8(a.wsize)),i>=a.wsize?(r.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),r.arraySet(a.window,t,n-i,o,a.wnext),(i-=o)?(r.arraySet(a.window,t,n-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}t.inflateReset=h,t.inflateReset2=c,t.inflateResetKeep=f,t.inflateInit=function(e){return d(e,15)},t.inflateInit2=d,t.inflate=function(e,t){var n,u,f,h,c,d,p,_,g,m,v,w,E,k,S,x,T,L,A,R,O,I,U,z,D=0,M=new r.Buf8(4),N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return-2;12===(n=e.state).mode&&(n.mode=13),c=e.next_out,f=e.output,p=e.avail_out,h=e.next_in,u=e.input,d=e.avail_in,_=n.hold,g=n.bits,m=d,v=p,I=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;g<16;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}if(2&n.wrap&&35615===_){n.check=0,M[0]=255&_,M[1]=_>>>8&255,n.check=o(n.check,M,2,0),_=0,g=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&_)<<8)+(_>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&_)){e.msg="unknown compression method",n.mode=30;break}if(g-=4,O=8+(15&(_>>>=4)),0===n.wbits)n.wbits=O;else if(O>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<O,e.adler=n.check=1,n.mode=512&_?10:12,_=0,g=0;break;case 2:for(;g<16;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}if(n.flags=_,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=_>>8&1),512&n.flags&&(M[0]=255&_,M[1]=_>>>8&255,n.check=o(n.check,M,2,0)),_=0,g=0,n.mode=3;case 3:for(;g<32;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}n.head&&(n.head.time=_),512&n.flags&&(M[0]=255&_,M[1]=_>>>8&255,M[2]=_>>>16&255,M[3]=_>>>24&255,n.check=o(n.check,M,4,0)),_=0,g=0,n.mode=4;case 4:for(;g<16;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}n.head&&(n.head.xflags=255&_,n.head.os=_>>8),512&n.flags&&(M[0]=255&_,M[1]=_>>>8&255,n.check=o(n.check,M,2,0)),_=0,g=0,n.mode=5;case 5:if(1024&n.flags){for(;g<16;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}n.length=_,n.head&&(n.head.extra_len=_),512&n.flags&&(M[0]=255&_,M[1]=_>>>8&255,n.check=o(n.check,M,2,0)),_=0,g=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((w=n.length)>d&&(w=d),w&&(n.head&&(O=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,u,h,w,O)),512&n.flags&&(n.check=o(n.check,u,w,h)),d-=w,h+=w,n.length-=w),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===d)break e;w=0;do{O=u[h+w++],n.head&&O&&n.length<65536&&(n.head.name+=String.fromCharCode(O))}while(O&&w<d);if(512&n.flags&&(n.check=o(n.check,u,w,h)),d-=w,h+=w,O)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===d)break e;w=0;do{O=u[h+w++],n.head&&O&&n.length<65536&&(n.head.comment+=String.fromCharCode(O))}while(O&&w<d);if(512&n.flags&&(n.check=o(n.check,u,w,h)),d-=w,h+=w,O)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;g<16;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}if(_!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}_=0,g=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;g<32;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}e.adler=n.check=l(_),_=0,g=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=c,e.avail_out=p,e.next_in=h,e.avail_in=d,n.hold=_,n.bits=g,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){_>>>=7&g,g-=7&g,n.mode=27;break}for(;g<3;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}switch(n.last=1&_,g-=1,3&(_>>>=1)){case 0:n.mode=14;break;case 1:if(b(n),n.mode=20,6===t){_>>>=2,g-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}_>>>=2,g-=2;break;case 14:for(_>>>=7&g,g-=7&g;g<32;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}if((65535&_)!=(_>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&_,_=0,g=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(w=n.length){if(w>d&&(w=d),w>p&&(w=p),0===w)break e;r.arraySet(f,u,h,w,c),d-=w,h+=w,p-=w,c+=w,n.length-=w;break}n.mode=12;break;case 17:for(;g<14;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}if(n.nlen=257+(31&_),_>>>=5,g-=5,n.ndist=1+(31&_),_>>>=5,g-=5,n.ncode=4+(15&_),_>>>=4,g-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;g<3;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}n.lens[N[n.have++]]=7&_,_>>>=3,g-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,U={bits:n.lenbits},I=s(0,n.lens,0,19,n.lencode,0,n.work,U),n.lenbits=U.bits,I){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;x=(D=n.lencode[_&(1<<n.lenbits)-1])>>>16&255,T=65535&D,!((S=D>>>24)<=g);){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}if(T<16)_>>>=S,g-=S,n.lens[n.have++]=T;else{if(16===T){for(z=S+2;g<z;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}if(_>>>=S,g-=S,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}O=n.lens[n.have-1],w=3+(3&_),_>>>=2,g-=2}else if(17===T){for(z=S+3;g<z;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}g-=S,O=0,w=3+(7&(_>>>=S)),_>>>=3,g-=3}else{for(z=S+7;g<z;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}g-=S,O=0,w=11+(127&(_>>>=S)),_>>>=7,g-=7}if(n.have+w>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;w--;)n.lens[n.have++]=O}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,U={bits:n.lenbits},I=s(1,n.lens,0,n.nlen,n.lencode,0,n.work,U),n.lenbits=U.bits,I){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,U={bits:n.distbits},I=s(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,U),n.distbits=U.bits,I){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(d>=6&&p>=258){e.next_out=c,e.avail_out=p,e.next_in=h,e.avail_in=d,n.hold=_,n.bits=g,a(e,v),c=e.next_out,f=e.output,p=e.avail_out,h=e.next_in,u=e.input,d=e.avail_in,_=n.hold,g=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;x=(D=n.lencode[_&(1<<n.lenbits)-1])>>>16&255,T=65535&D,!((S=D>>>24)<=g);){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}if(x&&0==(240&x)){for(L=S,A=x,R=T;x=(D=n.lencode[R+((_&(1<<L+A)-1)>>L)])>>>16&255,T=65535&D,!(L+(S=D>>>24)<=g);){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}_>>>=L,g-=L,n.back+=L}if(_>>>=S,g-=S,n.back+=S,n.length=T,0===x){n.mode=26;break}if(32&x){n.back=-1,n.mode=12;break}if(64&x){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&x,n.mode=22;case 22:if(n.extra){for(z=n.extra;g<z;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}n.length+=_&(1<<n.extra)-1,_>>>=n.extra,g-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;x=(D=n.distcode[_&(1<<n.distbits)-1])>>>16&255,T=65535&D,!((S=D>>>24)<=g);){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}if(0==(240&x)){for(L=S,A=x,R=T;x=(D=n.distcode[R+((_&(1<<L+A)-1)>>L)])>>>16&255,T=65535&D,!(L+(S=D>>>24)<=g);){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}_>>>=L,g-=L,n.back+=L}if(_>>>=S,g-=S,n.back+=S,64&x){e.msg="invalid distance code",n.mode=30;break}n.offset=T,n.extra=15&x,n.mode=24;case 24:if(n.extra){for(z=n.extra;g<z;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}n.offset+=_&(1<<n.extra)-1,_>>>=n.extra,g-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===p)break e;if(w=v-p,n.offset>w){if((w=n.offset-w)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}w>n.wnext?(w-=n.wnext,E=n.wsize-w):E=n.wnext-w,w>n.length&&(w=n.length),k=n.window}else k=f,E=c-n.offset,w=n.length;w>p&&(w=p),p-=w,n.length-=w;do{f[c++]=k[E++]}while(--w);0===n.length&&(n.mode=21);break;case 26:if(0===p)break e;f[c++]=n.length,p--,n.mode=21;break;case 27:if(n.wrap){for(;g<32;){if(0===d)break e;d--,_|=u[h++]<<g,g+=8}if(v-=p,e.total_out+=v,n.total+=v,v&&(e.adler=n.check=n.flags?o(n.check,f,v,c-v):i(n.check,f,v,c-v)),v=p,(n.flags?_:l(_))!==n.check){e.msg="incorrect data check",n.mode=30;break}_=0,g=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;g<32;){if(0===d)break e;d--,_+=u[h++]<<g,g+=8}if(_!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}_=0,g=0}n.mode=29;case 29:I=1;break e;case 30:I=-3;break e;case 31:return-4;case 32:default:return-2}return e.next_out=c,e.avail_out=p,e.next_in=h,e.avail_in=d,n.hold=_,n.bits=g,(n.wsize||v!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&y(e,e.output,e.next_out,v-e.avail_out)?(n.mode=31,-4):(m-=e.avail_in,v-=e.avail_out,e.total_in+=m,e.total_out+=v,n.total+=v,n.wrap&&v&&(e.adler=n.check=n.flags?o(n.check,f,v,e.next_out-v):i(n.check,f,v,e.next_out-v)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0===m&&0===v||4===t)&&0===I&&(I=-5),I)},t.inflateEnd=function(e){if(!e||!e.state)return-2;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?-2:(n.head=t,t.done=!1,0):-2},t.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?-2:11===n.mode&&i(1,t,r,0)!==n.check?-3:y(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,0):-2},t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o,a,s,l,u,f,h,c,d,p,_,g,b,y,m,v,w,E,k,S,x,T;n=e.state,r=e.next_in,x=e.input,i=r+(e.avail_in-5),o=e.next_out,T=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),l=n.dmax,u=n.wsize,f=n.whave,h=n.wnext,c=n.window,d=n.hold,p=n.bits,_=n.lencode,g=n.distcode,b=(1<<n.lenbits)-1,y=(1<<n.distbits)-1;e:do{p<15&&(d+=x[r++]<<p,p+=8,d+=x[r++]<<p,p+=8),m=_[d&b];t:for(;;){if(d>>>=v=m>>>24,p-=v,0===(v=m>>>16&255))T[o++]=65535&m;else{if(!(16&v)){if(0==(64&v)){m=_[(65535&m)+(d&(1<<v)-1)];continue t}if(32&v){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}w=65535&m,(v&=15)&&(p<v&&(d+=x[r++]<<p,p+=8),w+=d&(1<<v)-1,d>>>=v,p-=v),p<15&&(d+=x[r++]<<p,p+=8,d+=x[r++]<<p,p+=8),m=g[d&y];n:for(;;){if(d>>>=v=m>>>24,p-=v,!(16&(v=m>>>16&255))){if(0==(64&v)){m=g[(65535&m)+(d&(1<<v)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(E=65535&m,p<(v&=15)&&(d+=x[r++]<<p,(p+=8)<v&&(d+=x[r++]<<p,p+=8)),(E+=d&(1<<v)-1)>l){e.msg="invalid distance too far back",n.mode=30;break e}if(d>>>=v,p-=v,E>(v=o-a)){if((v=E-v)>f&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(k=0,S=c,0===h){if(k+=u-v,v<w){w-=v;do{T[o++]=c[k++]}while(--v);k=o-E,S=T}}else if(h<v){if(k+=u+h-v,(v-=h)<w){w-=v;do{T[o++]=c[k++]}while(--v);if(k=0,h<w){w-=v=h;do{T[o++]=c[k++]}while(--v);k=o-E,S=T}}}else if(k+=h-v,v<w){w-=v;do{T[o++]=c[k++]}while(--v);k=o-E,S=T}for(;w>2;)T[o++]=S[k++],T[o++]=S[k++],T[o++]=S[k++],w-=3;w&&(T[o++]=S[k++],w>1&&(T[o++]=S[k++]))}else{k=o-E;do{T[o++]=T[k++],T[o++]=T[k++],T[o++]=T[k++],w-=3}while(w>2);w&&(T[o++]=T[k++],w>1&&(T[o++]=T[k++]))}break}}break}}while(r<i&&o<s);r-=w=p>>3,d&=(1<<(p-=w<<3))-1,e.next_in=r,e.next_out=o,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=o<s?s-o+257:257-(o-s),n.hold=d,n.bits=p}},function(e,t,n){"use strict";var r=n(14),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,n,l,u,f,h,c){var d,p,_,g,b,y,m,v,w,E=c.bits,k=0,S=0,x=0,T=0,L=0,A=0,R=0,O=0,I=0,U=0,z=null,D=0,M=new r.Buf16(16),N=new r.Buf16(16),B=null,P=0;for(k=0;k<=15;k++)M[k]=0;for(S=0;S<l;S++)M[t[n+S]]++;for(L=E,T=15;T>=1&&0===M[T];T--);if(L>T&&(L=T),0===T)return u[f++]=20971520,u[f++]=20971520,c.bits=1,0;for(x=1;x<T&&0===M[x];x++);for(L<x&&(L=x),O=1,k=1;k<=15;k++)if(O<<=1,(O-=M[k])<0)return-1;if(O>0&&(0===e||1!==T))return-1;for(N[1]=0,k=1;k<15;k++)N[k+1]=N[k]+M[k];for(S=0;S<l;S++)0!==t[n+S]&&(h[N[t[n+S]]++]=S);if(0===e?(z=B=h,y=19):1===e?(z=i,D-=257,B=o,P-=257,y=256):(z=a,B=s,y=-1),U=0,S=0,k=x,b=f,A=L,R=0,_=-1,g=(I=1<<L)-1,1===e&&I>852||2===e&&I>592)return 1;for(;;){m=k-R,h[S]<y?(v=0,w=h[S]):h[S]>y?(v=B[P+h[S]],w=z[D+h[S]]):(v=96,w=0),d=1<<k-R,x=p=1<<A;do{u[b+(U>>R)+(p-=d)]=m<<24|v<<16|w|0}while(0!==p);for(d=1<<k-1;U&d;)d>>=1;if(0!==d?(U&=d-1,U+=d):U=0,S++,0==--M[k]){if(k===T)break;k=t[n+h[S]]}if(k>L&&(U&g)!==_){for(0===R&&(R=L),b+=x,O=1<<(A=k-R);A+R<T&&!((O-=M[A+R])<=0);)A++,O<<=1;if(I+=1<<A,1===e&&I>852||2===e&&I>592)return 1;u[_=U&g]=L<<24|A<<16|b-f|0}}return 0!==U&&(u[b+U]=k-R<<24|64<<16|0),c.bits=L,0}},function(e,t,n){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}}]);
\ No newline at end of file