PageSourceSearch

https://towntrek.web.app/static/js/11.496a71c7.chunk.js

js towntrek.web.app collected 2026-10-03 12:38:28 UTC 7,201 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkeventzee=self.webpackChunkeventzee||[]).push([[11],{66011:(t,e,i)=>{i.r(e),i.d(e,{default:()=>p});var a=i(32747);i(77382),i(64808),i(57280);const s=a.A;class r{constructor(t,e){this.logger=t,this.onUserChanged=e,this.ready=void 0,this.user=void 0,this.facebookLinkCredentials=void 0,this.signInWithGoogle=async()=>{await this.ready;var t=new s.auth.GoogleAuthProvider;if(s.auth().useDeviceLanguage(),window.innerWidth<=768)return s.auth().signInWithRedirect(t),null;{await s.auth().signInWithPopup(t);const e=await this.getCurrentUser();if(!e)throw new Error("SignIn with Google failed");return e}},this.linkWithFacebook=async t=>{var e;if(await this.ready,!this.facebookLinkCredentials)throw new Error("Could not link Facebook account.");const{email:i,token:a}=this.facebookLinkCredentials;this.logger.log(`login ${i} and link with Facebook`);const r=await s.auth().signInWithEmailAndPassword(i,t),n=s.auth.FacebookAuthProvider.credential(a);await(null===(e=r.user)||void 0===e?void 0:e.linkWithCredential(n));const o=await this.getCurrentUser();if(!o)throw new Error("Login failed");return this.facebookLinkCredentials=null,o},this.continueWithFacebook=async()=>{await this.ready;const t=new s.auth.FacebookAuthProvider;t.addScope("public_profile,email"),s.auth().useDeviceLanguage();try{await s.auth().signInWithPopup(t)}catch(i){if("auth/account-exists-with-different-credential"===i.code){const t=i.credential.accessToken,e=i.email;throw this.facebookLinkCredentials={email:e,token:t},new Error("email already registered")}throw i}const e=await this.getCurrentUser();if(!e)throw new Error("SignIn with Facebook failed");return e},this.continueWithFacebookToken=async t=>{const e=s.auth.FacebookAuthProvider.credential(t);try{await s.auth().signInWithCredential(e)}catch(a){if("auth/account-exists-with-different-credential"===a.code){const t=a.credential.accessToken,e=a.email;throw this.facebookLinkCredentials={email:e,token:t},new Error("email already registered")}throw a}const i=await this.getCurrentUser();if(!i)throw new Error("SignIn with Facebook failed");return i},this.loginWithCustomToken=async t=>{await this.ready,this.logger.log(`loginWithCustomToken ${t}`),await s.auth().signInWithCustomToken(t);const e=await this.getCurrentUser();if(!e)throw new Error("SignIn with custom token failed");return e},this.login=async(t,e,i)=>{await this.ready,this.logger.log(`login ${t}`),await s.auth().signInWithEmailAndPassword(t,e);const a=await this.getCurrentUser();if(!a)throw new Error("SignIn failed");return a},this.logout=async()=>{await this.ready,await s.auth().signOut(),this.user=null},this.recover=async t=>{this.logger.log(`recover ${t}`),await this.ready,await s.auth().sendPasswordResetEmail(t)},this.signup=async(t,e)=>{await this.ready,this.logger.log(`signup ${t}`),await s.auth().createUserWithEmailAndPassword(t,e);const i=await this.getCurrentUser();if(!i)throw new Error("SignUp failed");return i},this.guestSignup=async()=>{await this.ready,this.logger.log("guest signup"),await s.auth().signInAnonymously();const t=await this.getCurrentUser();if(!t)throw new Error("Guest SignUp failed");return t},this.guestLink=async(t,e)=>{var i;const a=s.auth.EmailAuthProvider.credential(t,e),r=s.auth().currentUser;if(!r)throw new Error("Guest Link failed: no current user");const n=await r.linkWithCredential(a);this.logger.log(`Guest ${null===n||void 0===n||null===(i=n.user)||void 0===i?void 0:i.uid} link ok to ${t}`);const o=await this.getCurrentUser();if(!o)throw new Error("Guest SignUp failed");return o},this.getCurrentUser=async()=>{await this.ready;const t=s.auth().currentUser;return this.user=this.createAuthenticatedUserObject(t),this.user},this.user=null,this.facebookLinkCredentials=null,this.ready=this.init()}
1async init(){await s.auth().setPersistence(s.auth.Auth.Persistence.LOCAL);try{await s.auth().getRedirectResult()}catch(e){console.error(e)}let t=!0;await new Promise((e=>{s.auth().onIdTokenChanged((i=>{this.logger.log("idTokenChanged "+(null===i||void 0===i?void 0:i.uid)),this.user=this.createAuthenticatedUserObject(i),this.onUserChanged&&this.onUserChanged(),t&&(t=!1,e())}))}))}validateEmail(t){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)?null:"Invalid email"}validatePassword(t){return t.length<6?"Password too short":null}createAuthenticatedUserObject(t){if(!t)return null;const e=t.email||"unknown email",i=t.isAnonymous,a={id:t.uid,email:e,guest:i};for(const s of t.providerData)"facebook.com"===(null===s||void 0===s?void 0:s.providerId)&&(a.facebook={id:s.uid,photoUrl:s.photoURL||void 0,displayName:s.displayName||void 0});return a}}var n=i(31621),o=i.n(n);const h=a.A,c=class{constructor(t,e){this.logger=t,this.storage=e,this.ready=void 0,this.cachedDeviceId=void 0,this.getDeviceId=async()=>{if(this.cachedDeviceId)return this.cachedDeviceId;let t=await this.storage.getItem("deviceId");return t||(t=o()(),await this.storage.setItem("deviceId",t)),this.cachedDeviceId=t,t},this.functions={shop:{}},this.callAPI=async(t,e)=>{await this.ready,this.logger.log(`Calling Firebase API endpoint ${t} with params ${JSON.stringify(e,null,2)}`);const i=await this.getDeviceId(),a=h.functions().httpsCallable("logic"),s={endpoint:t,params:{...e,deviceId:i}};for(const o in s.params)if(s.params[o]&&s.params[o]instanceof Date)try{s.params[o].toISOString()}catch(r){console.log("Deleting date param."),delete s.params[o]}try{const e=await a(s);return this.logger.log(`Got endpoint ${t} result.`),e?e.data:null}catch(n){this.logger.error(`Call to endpoint ${t} failed`),this.logger.warn(n)}},this.ready=this.init()}
1async init(){}};i(35081);const l=a.A,u=class{constructor(){this.subscriptions=void 0,this.subscribe=async(t,e)=>{const i=o()(),a=`_pusher/${t.replace(/\./g,",")}`;this.subscriptions[i]={path:a,callback:i=>{const a=i.val();e(t,a)}};return l.database().ref(a).on("value",this.subscriptions[i].callback),i},this.unsubscribe=async t=>{if(!this.subscriptions[t])return;const{path:e,callback:i}=this.subscriptions[t];l.database().ref(e).off("value",i),delete this.subscriptions[t]},this.subscriptions={}}},d=a.A,g=class{constructor(){this.defaultAnalytics=void 0,this.defaultAnalytics=d.analytics()}logEvent(t,e){this.defaultAnalytics.logEvent(t,e)}logError(t){this.defaultAnalytics.logEvent(d.analytics.EventName.EXCEPTION,t)}setUserProperties(t){this.defaultAnalytics.setUserProperties(t)}},w={apiKey:"AIzaSyDpFj1QLokAP8bVD9l0kzu9vYjM3Y9eDG4",authDomain:"mydowntownapp.firebaseapp.com",projectId:"mydowntownapp",storageBucket:"mydowntownapp.firebasestorage.app",messagingSenderId:"951553941142",appId:"1:951553941142:web:760fb0981ffc49c5aeacb7",measurementId:"G-F0M6XC40NC"},p=class{constructor(t,e,i){let s;this.logger=t,this.storage=e,this.onUserChanged=i,this.api=void 0,this.auth=void 0,this.push=void 0,this.analytics=void 0,this.ready=void 0,s=w,a.A.initializeApp(s),this.api=new c(this.logger,this.storage),this.auth=new r(this.logger,this.onUserChanged),this.push=new u,this.analytics=new g,this.ready=this.init()}
1async init(){}}}}]);
2//# sourceMappingURL=11.496a71c7.chunk.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.