PageSourceSearch

https://www.vrcarena.com/chunk-5QPWMAHC.js

js vrcarena.com collected 2026-09-25 18:45:22 UTC 18,146 bytes, 2 lines download raw bytes

1import{a as Le,b as Se}from"/chunk-KMUYTXQ4.js";import{a as Re}from"/chunk-PD77CKRG.js";import{a as Ee}from"/chunk-7KU44OLK.js";import{a as De}from"/chunk-BBVFD5SS.js";import{a as be}from"/chunk-PNBV22OJ.js";import{a as U}from"/chunk-LUDSDHAJ.js";import{fa as N}from"/chunk-L7SHSVHB.js";import{a as I,b as D}from"/chunk-SYG5O24C.js";import{a as pe}from"/chunk-TFEB5E6W.js";import{c as S,d as G,e as q,f as M,h as T,j as x,k as $,m as he,o as ve,p as we,s as ye,t as Ce,u as E,x as Ie}from"/chunk-H23NAM2G.js";import{v as C}from"/chunk-564LLHND.js";import{$e as ue,Ca as L,Ea as ae,Se as ce,Ye as le,Yf as ge,bf as de,ef as me,hd as j,kd as H,lf as fe,pf as K,ue as se}from"/chunk-4G6JPET5.js";import{S as Ke,a as He}from"/chunk-RGYMHTZY.js";import{a as b}from"/chunk-PSDBGZLN.js";import{a as re}from"/chunk-P4BZ4TJK.js";import{c as V,f as h}from"/chunk-EMJN6GDS.js";var Pe=V(Y=>{"use strict";"use client";var $e=He();Object.defineProperty(Y,"__esModule",{value:!0});Y.default=void 0;var Qe=$e(Ke()),Ye=b(),Or=Y.default=(0,Qe.default)((0,Ye.jsx)("path",{d:"M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m-9-2V7H4v3H1v2h3v3h2v-3h3v-2zm9 4c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"PersonAdd")});var te=V(k=>{"use strict";var Je=k&&k.__awaiter||function(e,n,r,o){function i(t){return t instanceof r?t:new r(function(c){c(t)})}return new(r||(r=Promise))(function(t,c){function l(d){try{s(o.next(d))}catch(v){c(v)}}function f(d){try{s(o.throw(d))}catch(v){c(v)}}function s(d){d.done?t(d.value):i(d.value).then(l,f)}s((o=o.apply(e,n||[])).next())})},Ze=k&&k.__generator||function(e,n){var r={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(s){return function(d){return f([s,d])}}function f(s){if(o)throw new TypeError("Generator is already executing.");for(;c&&(c=0,s[0]&&(r=0)),r;)try{if(o=1,i&&(t=s[0]&2?i.return:s[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,s[1])).done)return t;switch(i=0,t&&(s=[s[0]&2,t.value]),s[0]){case 0:case 1:t=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(t=r.trys,!(t=t.length>0&&t[t.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!t||s[1]>t[0]&&s[1]<t[3])){r.label=s[1];break}if(s[0]===6&&r.label<t[1]){r.label=t[1],t=s;break}if(t&&r.label<t[2]){r.label=t[2],r.ops.push(s);break}t[2]&&r.ops.pop(),r.trys.pop();continue}s=n.call(e,r)}catch(d){s=[6,d],i=0}finally{o=t=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}};Object.defineProperty(k,"__esModule",{value:!0});k.ReCaptchaInstance=void 0;var er=function(){function e(n,r,o){this.siteKey=n,this.recaptchaID=r,this.recaptcha=o,this.styleContainer=null}return e.prototype.execute=function(n){return Je(this,void 0,void 0,function(){var r;return Ze(this,function(o){switch(o.label){case 0:return this.recaptcha.enterprise?[4,this.recaptcha.enterprise.execute(this.recaptchaID,{action:n})]:[3,2];case 1:return r=o.sent(),[3,4];case 2:return[4,this.recaptcha.execute(this.recaptchaID,{action:n})];case 3:r=o.sent(),o.label=4;case 4:return[2,r]}})})},e.prototype.getSiteKey=function(){return this.siteKey},e.prototype.hideBadge=function(){this.styleContainer===null&&(this.styleContainer=document.createElement("style"),this.styleContainer.innerHTML=".grecaptcha-badge{visibility:hidden !important;}",document.head.appendChild(this.styleContainer))},e.prototype.showBadge=function(){this.styleContainer!==null&&(document.head.removeChild(this.styleContainer),this.styleContainer=null)},e}();k.ReCaptchaInstance=er});var Oe=V(P=>{"use strict";var ne=P&&P.__assign||function(){return ne=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ne.apply(this,arguments)};Object.defineProperty(P,"__esModule",{value:!0});P.getInstance=P.load=void 0;var rr=te(),A;(function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"})(A||(A={}));var _e=function(){function e(){}return e.load=function(n,r){if(r===void 0&&(r={}),typeof document>"u")return Promise.reject(new Error("This is a library for the browser!"));if(e.getLoadingState()===A.LOADED)return e.instance.getSiteKey()===n?Promise.resolve(e.instance):Promise.reject(new Error("reCAPTCHA already loaded with different site key!"));if(e.getLoadingState()===A.LOADING)return n!==e.instanceSiteKey?Promise.reject(new Error("reCAPTCHA already loaded with different site key!")):new Promise(function(i,t){e.successfulLoadingConsumers.push(function(c){return i(c)}),e.errorLoadingRunnable.push(function(c){return t(c)})});e.instanceSiteKey=n,e.setLoadingState(A.LOADING);var o=new e;return new Promise(function(i,t){o.loadScript(n,r.useRecaptchaNet||!1,r.useEnterprise||!1,r.renderParameters?r.renderParameters:{},r.customUrl).then(function(){e.setLoadingState(A.LOADED);var c=o.doExplicitRender(grecaptcha,n,r.explicitRenderParameters?r.explicitRenderParameters:{},r.useEnterprise||!1),l=new rr.ReCaptchaInstance(n,c,grecaptcha);
1e.successfulLoadingConsumers.forEach(function(f){return f(l)}),e.successfulLoadingConsumers=[],r.autoHideBadge&&l.hideBadge(),e.instance=l,i(l)}).catch(function(c){e.errorLoadingRunnable.forEach(function(l){return l(c)}),e.errorLoadingRunnable=[],t(c)})})},e.getInstance=function(){return e.instance},e.setLoadingState=function(n){e.loadingState=n},e.getLoadingState=function(){return e.loadingState===null?A.NOT_LOADED:e.loadingState},e.prototype.loadScript=function(n,r,o,i,t){var c=this;r===void 0&&(r=!1),o===void 0&&(o=!1),i===void 0&&(i={}),t===void 0&&(t="");var l=document.createElement("script");l.setAttribute("recaptcha-v3-script",""),l.setAttribute("async",""),l.setAttribute("defer","");var f="https://www.google.com/recaptcha/api.js";r?o?f="https://recaptcha.net/recaptcha/enterprise.js":f="https://recaptcha.net/recaptcha/api.js":o&&(f="https://www.google.com/recaptcha/enterprise.js"),t&&(f=t),i.render&&(i.render=void 0);var s=this.buildQueryString(i);return l.src=f+"?render=explicit"+s,new Promise(function(d,v){l.addEventListener("load",c.waitForScriptToLoad(function(){d(l)},o),!1),l.onerror=function(y){e.setLoadingState(A.NOT_LOADED),v(y)},document.head.appendChild(l)})},e.prototype.buildQueryString=function(n){var r=Object.keys(n);return r.length<1?"":"&"+Object.keys(n).filter(function(o){return!!n[o]}).map(function(o){return o+"="+n[o]}).join("&")},e.prototype.waitForScriptToLoad=function(n,r){var o=this;return function(){window.grecaptcha===void 0?setTimeout(function(){o.waitForScriptToLoad(n,r)},e.SCRIPT_LOAD_DELAY):r?window.grecaptcha.enterprise.ready(function(){n()}):window.grecaptcha.ready(function(){n()})}},e.prototype.doExplicitRender=function(n,r,o,i){var t=ne({sitekey:r},o);return o.container?i?n.enterprise.render(o.container,t):n.render(o.container,t):i?n.enterprise.render(t):n.render(t)},e.loadingState=null,e.instance=null,e.instanceSiteKey=null,e.successfulLoadingConsumers=[],e.errorLoadingRunnable=[],e.SCRIPT_LOAD_DELAY=25,e}();P.load=_e.load;P.getInstance=_e.getInstance});var Ue=V(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.ReCaptchaInstance=F.getInstance=F.load=void 0;var We=Oe();Object.defineProperty(F,"load",{enumerable:!0,get:function(){return We.load}});Object.defineProperty(F,"getInstance",{enumerable:!0,get:function(){return We.getInstance}});var tr=te();Object.defineProperty(F,"ReCaptchaInstance",{enumerable:!0,get:function(){return tr.ReCaptchaInstance}})});var O=h(re());var g=h(b()),Ge=L({button:{backgroundColor:"#7289da !important","&:hover":{backgroundColor:"#445282 !important"}}}),ke=!1;var qe=e=>{if(e instanceof Q)switch(e.errorCode){case"BadCode":return 1;case"AlreadyConnected":return 2;default:return 0}return 0};var Q=class extends Error{constructor(n){super(),this.errorCode=n}},Ae=({code:e,onSuccess:n,onFail:r})=>{let[o,i]=(0,O.useState)(null),[t,c]=(0,O.useState)(!1),[l,f]=(0,O.useState)(!1),[s,d]=(0,O.useState)(null),{push:v}=De(),y=Ge();if((0,O.useEffect)(()=>{if(!e||ke)return;async function W(){try{i(null),c(!0),f(!1);let{data:u}=await Ie("loginWithDiscord",{code:e});if(u.errorCode!==void 0)throw new Q(u.errorCode);let{token:_,discordUser:m,hasAlreadySignedUp:B}=u,{user:R}=await $(E,_);try{await ve(R,m.email)}catch(ee){console.error(ee)}if(ke=!0,B){console.debug("User has already signed up, redirecting to homepage..."),v(ae);return}d(m),i(null),c(!1),f(!0)}catch(u){console.error(u),S(u),i(qe(u)),c(!1)}}W()},[e]),o!==null)switch(o){case 1:return(0,g.jsxs)(be,{children:["The code that Discord gave you looks invalid or expired. Please try again to get a new code.",(0,g.jsx)(U,{children:(0,g.jsx)(C,{onClick:r,children:"Restart Login"})})]});case 2:return(0,g.jsxs)(I,{children:["Someone has already connected their VRCArena account with that Discord account. Only one account can be linked together.",(0,g.jsx)("br",{}),(0,g.jsx)("br",{}),"If you have lost access to an old account that was already linked, please contact us via our Discord server or email ",se,"."]});default:return(0,g.jsx)(I,{errorCode:o,onRetry:r,children:"Failed to get your details from Discord"})}return t?(0,g.jsx)(D,{message:"Loading your Discord details..."}):l?s?(0,g.jsx)(Le,{discordUser:s,onDone:n}):(0,g.jsx)(D,{message:"You have logged in successfully, redirecting..."}):(0,g.jsxs)("div",{children:[(0,g.jsx)(C,{size:"large",icon:(0,g.jsx)(fe,{}),className:y.button,url:ce,children:"Login with Discord"}),(0,g.jsx)("br",{}),(0,g.jsx)(Ee,{children:"Opens Discord in a new tab"})]})};var w=h(re());var Ve=h(Pe());var Fe=h(b()),ze=L({root:{display:"flex",alignItems:"center",justifyContent:"center"}}),Xe=({children:e})=>{let n=ze();return(0,Fe.jsx)("div",{className:n.root,children:e})},z=Xe;var X=h(re());var Te=h(Ue());function Me(e){return typeof e!="string"?!1:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}var p=h(b()),nr=L({root:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",margin:"2rem 0"},buttons:{display:"flex",flexDirection:"column"},form:{width:"100%",marginBottom:"2rem",display:"flex",justifyContent:"center"},loginButton:{margin:"0.25rem 0 !important"},loginWithEmailForm:{width:"500px",marginBottom:"2rem",maxWidth:"100%",[H]:{width:"100%"}},spacer:{height:"1rem"},discord:{backgroundColor:"#7289da !important","&:hover":{backgroundColor:"#445282 !important"}},email:{},google:{color:"#000 !important",backgroundColor:"#ffffff !important","&:hover":{backgroundColor:"#C2C2C2 !important"}},twitter:{backgroundColor:"#55acee !important","&:hover":{backgroundColor:"#4790c7 !important"}}});var or="6LcpGo0sAAAAAKsXC-rGtXaEqhPVeT0S4XFaSH11",ir="signup",ar=async()=>await(await(0,Te.load)(or)).execute(ir),sr=e=>{switch(e){case 2:return"recaptcha failed";case 11:return"invalid email";case 12:return"invalid password (must have more than 6 characters)";case 13:return"weak password";case 14:return"email already in use";case 0:default:return`unknown error (code ${e})`}},cr=({onSuccess:e})=>{let[n,r]=(0,X.useState)(!1),[o,i]=(0,X.useState)(""),[t,c]=(0,X.useState)(""),l=nr(),[f,s,d,v]=Re("signupWithEmail"),y=async()=>{try{if(!o||!t||!Me(o))return;console.debug("signing in with email and password...",{email:o}),r(!0);let u=await ar();if(r(!1),!u)throw new Error("Need a recaptcha token");let{code:_,token:m}=await v({email:o,password:t,recaptchaToken:u});if(_){console.warn("Got a signup error code:",_);return}if(!m)throw new Error("Need an auth token");let B=await $(E,m);console.debug("signup success",{email:o,user:B}),e()}catch(u){console.error(u),S(u),r(!1)}},W=u=>{u.key=="Enter"&&(console.debug("user pressed enter, submitting..."),y())};return(0,p.jsxs)("form",{className:l.loginWithEmailForm,children:[(0,p.jsx)(N,{fullWidth:!0,value:o,onChange:u=>i(u.target.value),label:"Email",autoFocus:!0,onKeyDown:W}),(0,p.jsx)(N,{topMargin:!0,fullWidth:!0,value:t,onChange:u=>c(u.target.value),label:"Password",type:"password",onKeyDown:W}),(0,p.jsx)(U,{children:(0,p.jsxs)("div",{children:[(0,p.jsx)("br",{}),(0,p.jsx)(z,{children:(0,p.jsx)(C,{onClick:y,isDisabled:n,icon:(0,p.jsx)(K,{}),children:"Sign Up"})})]})}),n&&(0,p.jsx)(D,{message:"Signing up..."}),s!==null?(0,p.jsx)(I,{errorCode:s,children:"Failed to sign up"}):null,d!==null&&d.code!==void 0?(0,p.jsxs)(I,{children:["Failed to sign up: ",sr(d.code)]}):null]})},xe=cr;async function Ne(e){let r=(await ye(E,e)).user;return console.debug("Signed in with provider",{provider:e,user:r}),r}var a=h(b()),Z=L({root:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",margin:"2rem 0"},buttons:{display:"flex",flexDirection:"column"},form:{width:"100%",marginBottom:"2rem",display:"flex",justifyContent:"center"},loginButton:{margin:"0.25rem 0 !important"},loginWithEmailForm:{width:"500px",marginBottom:"2rem",maxWidth:"100%",[H]:{width:"100%"}},discord:{backgroundColor:"#7289da !important","&:hover":{backgroundColor:"#445282 !important"}},email:{},google:{color:"#000 !important",backgroundColor:"#ffffff !important","&:hover":{backgroundColor:"#b0b0b0 !important"}},twitter:{backgroundColor:"#55acee !important","&:hover":{backgroundColor:"#3d7bab !important"}},signUpButton:{marginTop:"1rem !important"},cancelButton:{marginTop:"2rem !important"}}),lr=({providerId:e,onSuccess:n})=>{let[r,o]=(0,w.useState)(null);return(0,w.useEffect)(()=>{(async()=>{try{let i;switch(e){case M.PROVIDER_ID:i=new M;break;case T.PROVIDER_ID:i=new T;break;case x.PROVIDER_ID:i=new x;break;default:throw new Error(`Unknown provider ID: ${e}`)}let t=await Ne(i);n()}catch(i){if(i instanceof G){let t=i.code;o(t)}else console.error(i),S(i)}})()},[]),r!==null?(0,a.jsxs)(I,{children:["Failed to login: ",ie(r)]}):(0,a.jsx)(D,{message:"Showing popup..."})},ie=e=>{switch(e){case q.INVALID_EMAIL:return"invalid email";case q.INVALID_PASSWORD:return"invalid password";case"auth/missing-password":return"missing password";case"auth/user-not-found":return"email has never signed up here";case q.MISSING_AUTH_DOMAIN:return"needs config";default:return`Error ${e}`}};var Be=e=>e instanceof G?e.code:"unknown",ur=({onSuccess:e})=>{let[n,r]=(0,w.useState)(!1),[o,i]=(0,w.useState)(null),[t,c]=(0,w.useState)(""),[l,f]=(0,w.useState)(""),s=Z(),[d,v]=(0,w.useState)(0),[y,W]=(0,w.useState)(null);if(d===1)return(0,a.jsxs)("div",{children:[(0,a.jsx)(pe,{variant:"h2",children:"Two-Factor Authentication"}),(0,a.jsx)("p",{children:"Enter the code from your MFA app:"}),(0,a.jsx)(Se,{onCode:async B=>{try{if(console.debug("submitting totp..."),r(!0),!y)throw new Error("No resolver");let R=y.hints.find(je=>je.factorId==="totp");if(!R)throw new Error("No factor");console.debug("totp assertion...");let ee=Ce.assertionForSignIn(R.uid,B);console.debug("resolving sign in..."),await y.resolveSignIn(ee),console.debug("user signed in!"),e()}catch(R){console.error("Failed to login:",R),S(R),r(!1),i(Be(R))}},isDisabled:n}),n&&(0,a.jsx)(D,{message:"Using your MFA code..."}),o!==null?(0,a.jsxs)(I,{children:["Failed to use your MFA code:"," ",ie(o)]}):null]});let u=async()=>{try{if(!t||!l)return;console.debug("signing in with email and password...",{email:t}),r(!0);let m=await he(E,t,l);console.debug("signin success",{email:t,user:m}),r(!1),e()}catch(m){if(m instanceof G&&m.code==="auth/multi-factor-auth-required"){r(!1),W(we(E,m)),v(1);return}console.error(m),S(m),r(!1),i(Be(m))}},_=m=>{m.key=="Enter"&&(console.debug("user pressed enter, submitting..."),u())};return(0,a.jsxs)("form",{className:s.loginWithEmailForm,children:[(0,a.jsx)(N,{fullWidth:!0,value:t,onChange:m=>c(m.target.value),label:"Email",autoFocus:!0,onKeyDown:_}
1),(0,a.jsx)(N,{topMargin:!0,fullWidth:!0,value:l,onChange:m=>f(m.target.value),label:"Password",type:"password",onKeyDown:_}),(0,a.jsx)(U,{children:(0,a.jsxs)("div",{children:[(0,a.jsx)("br",{}),(0,a.jsx)(z,{children:(0,a.jsx)(C,{onClick:u,isDisabled:n,icon:(0,a.jsx)(K,{}),children:"Login"})}),(0,a.jsx)("br",{}),"Reset your password ",(0,a.jsx)(ge,{to:j.resetPassword,children:"here"}),"."]})}),n&&(0,a.jsx)(D,{message:"Logging in..."}),o!==null?(0,a.jsxs)(I,{children:["Failed to login: ",ie(o)]}):null]})},J=({label:e,className:n,providerId:r,icon:o,onClick:i,isSignUp:t})=>{let c=Z();return(0,a.jsxs)(C,{size:"large",icon:o,switchIconSide:!0,onClick:i,className:`${c.loginButton} ${n}`,children:[t?"Signup":"Login"," with ",e]})},oe="discord",dr=({selectedProviderId:e,setSelectedProviderId:n,reset:r,onSuccess:o,isSignUp:i=!1})=>{let t=Z();if(e!=null)switch(e){case oe:return(0,a.jsx)("div",{className:t.form,children:(0,a.jsx)(Ae,{code:"",onFail:r,onSuccess:o})});case T.PROVIDER_ID:case x.PROVIDER_ID:return(0,a.jsx)("div",{className:t.form,children:(0,a.jsx)(lr,{providerId:e,onSuccess:o})});case M.PROVIDER_ID:return(0,a.jsx)("div",{className:t.form,children:i?(0,a.jsx)(xe,{onSuccess:o}):(0,a.jsx)(ur,{onSuccess:o})})}return(0,a.jsxs)("div",{className:t.buttons,children:[(0,a.jsx)(J,{isSignUp:i,label:"email",providerId:M.PROVIDER_ID,icon:(0,a.jsx)(le,{}),className:t.email,onClick:()=>n(M.PROVIDER_ID)}),(0,a.jsx)(J,{isSignUp:i,label:"Discord",providerId:oe,icon:(0,a.jsx)(me,{}),className:t.discord,onClick:()=>n(oe)}),(0,a.jsx)(J,{isSignUp:i,label:"Google",providerId:T.PROVIDER_ID,icon:(0,a.jsx)(de,{}),className:t.google,onClick:()=>n(T.PROVIDER_ID)}),(0,a.jsx)(J,{isSignUp:i,label:"Twitter/X",providerId:x.PROVIDER_ID,icon:(0,a.jsx)(ue,{}),className:t.twitter,onClick:()=>n(x.PROVIDER_ID)}),(0,a.jsx)(C,{size:"large",url:i?j.login:j.signUp,className:t.signUpButton,icon:(0,a.jsx)(Ve.default,{}),switchIconSide:!0,children:i?"Login":"Sign Up"})]})},mr=({onSuccess:e,isSignUp:n=!1})=>{let r=Z(),[o,i]=(0,w.useState)(null),t=()=>i(null);return(0,a.jsxs)("div",{className:r.root,children:[(0,a.jsx)(dr,{onSuccess:e,isSignUp:n,reset:t,selectedProviderId:o,setSelectedProviderId:i}),o!==null&&(0,a.jsxs)(C,{onClick:t,color:"secondary",className:r.cancelButton,children:["Cancel ",n?"Signup":"Login"]})]})},Ut=mr;export{Ae as a,Ut as b};
2//# sourceMappingURL=/chunk-5QPWMAHC.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.