summaryrefslogtreecommitdiff
path: root/frontend-old/node_modules/@firebase/app
diff options
context:
space:
mode:
authoraltaf-creator <dev@altafcreator.com>2025-11-09 11:15:19 +0800
committeraltaf-creator <dev@altafcreator.com>2025-11-09 11:15:19 +0800
commit8eff962cab608341a6f2fedc640a0e32d96f26e2 (patch)
tree05534d1a720ddc3691d346c69b4972555820a061 /frontend-old/node_modules/@firebase/app
pain
Diffstat (limited to 'frontend-old/node_modules/@firebase/app')
-rw-r--r--frontend-old/node_modules/@firebase/app/README.md5
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app-public.d.ts477
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app.d.ts572
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/api.d.ts235
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/constants.d.ts26
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/errors.d.ts67
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/firebaseApp.d.ts46
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/firebaseServerApp.d.ts36
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/global_index.d.ts939
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/heartbeatService.d.ts89
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/index.d.ts9
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/indexeddb.d.ts20
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/internal.d.ts108
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/logger.d.ts18
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/platformLoggerService.d.ts23
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/public-types.d.ts241
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/registerCoreComponents.d.ts17
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/tsdoc-metadata.json11
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/src/types.d.ts55
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/test/setup.d.ts17
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/app/test/util.d.ts26
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/src/api.d.ts235
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/src/constants.d.ts26
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/src/errors.d.ts67
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/src/firebaseApp.d.ts46
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/src/firebaseServerApp.d.ts36
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/src/heartbeatService.d.ts89
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/src/index.d.ts9
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/src/indexeddb.d.ts20
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/src/internal.d.ts108
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/src/logger.d.ts18
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/src/platformLoggerService.d.ts23
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/src/public-types.d.ts241
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/src/registerCoreComponents.d.ts17
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/src/types.d.ts55
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/test/setup.d.ts17
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/app/test/util.d.ts26
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/index.esm.js1237
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/index.esm.js.map1
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/esm/package.json1
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/index.cjs.js1265
-rw-r--r--frontend-old/node_modules/@firebase/app/dist/index.cjs.js.map1
-rw-r--r--frontend-old/node_modules/@firebase/app/package.json75
43 files changed, 6650 insertions, 0 deletions
diff --git a/frontend-old/node_modules/@firebase/app/README.md b/frontend-old/node_modules/@firebase/app/README.md
new file mode 100644
index 0000000..e311103
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/README.md
@@ -0,0 +1,5 @@
+# @firebase/app
+
+This package coordinates the communication between the different Firebase components
+
+**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.**
diff --git a/frontend-old/node_modules/@firebase/app/dist/app-public.d.ts b/frontend-old/node_modules/@firebase/app/dist/app-public.d.ts
new file mode 100644
index 0000000..b70882e
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app-public.d.ts
@@ -0,0 +1,477 @@
+/**
+ * Firebase App
+ *
+ * @remarks This package coordinates the communication between the different Firebase components
+ * @packageDocumentation
+ */
+
+import { Component } from '@firebase/component';
+import { ComponentContainer } from '@firebase/component';
+import { FirebaseError } from '@firebase/util';
+import { LogCallback } from '@firebase/logger';
+import { LogLevelString } from '@firebase/logger';
+import { LogOptions } from '@firebase/logger';
+import { Name } from '@firebase/component';
+import { Provider } from '@firebase/component';
+
+/* Excluded from this release type: _addComponent */
+
+/* Excluded from this release type: _addOrOverwriteComponent */
+
+/* Excluded from this release type: _apps */
+
+/* Excluded from this release type: _clearComponents */
+
+/* Excluded from this release type: _components */
+
+/* Excluded from this release type: _DEFAULT_ENTRY_NAME */
+
+/**
+ * Renders this app unusable and frees the resources of all associated
+ * services.
+ *
+ * @example
+ * ```javascript
+ * deleteApp(app)
+ * .then(function() {
+ * console.log("App deleted successfully");
+ * })
+ * .catch(function(error) {
+ * console.log("Error deleting app:", error);
+ * });
+ * ```
+ *
+ * @public
+ */
+export declare function deleteApp(app: FirebaseApp): Promise<void>;
+
+/**
+ * A {@link @firebase/app#FirebaseApp} holds the initialization information for a collection of
+ * services.
+ *
+ * Do not call this constructor directly. Instead, use
+ * {@link (initializeApp:1) | initializeApp()} to create an app.
+ *
+ * @public
+ */
+export declare interface FirebaseApp {
+ /**
+ * The (read-only) name for this app.
+ *
+ * The default app's name is `"[DEFAULT]"`.
+ *
+ * @example
+ * ```javascript
+ * // The default app's name is "[DEFAULT]"
+ * const app = initializeApp(defaultAppConfig);
+ * console.log(app.name); // "[DEFAULT]"
+ * ```
+ *
+ * @example
+ * ```javascript
+ * // A named app's name is what you provide to initializeApp()
+ * const otherApp = initializeApp(otherAppConfig, "other");
+ * console.log(otherApp.name); // "other"
+ * ```
+ */
+ readonly name: string;
+ /**
+ * The (read-only) configuration options for this app. These are the original
+ * parameters given in {@link (initializeApp:1) | initializeApp()}.
+ *
+ * @example
+ * ```javascript
+ * const app = initializeApp(config);
+ * console.log(app.options.databaseURL === config.databaseURL); // true
+ * ```
+ */
+ readonly options: FirebaseOptions;
+ /**
+ * The settable config flag for GDPR opt-in/opt-out
+ */
+ automaticDataCollectionEnabled: boolean;
+}
+
+/* Excluded from this release type: _FirebaseAppInternal */
+
+/**
+ * @public
+ *
+ * Configuration options given to {@link (initializeApp:1) | initializeApp()}
+ */
+export declare interface FirebaseAppSettings {
+ /**
+ * custom name for the Firebase App.
+ * The default value is `"[DEFAULT]"`.
+ */
+ name?: string;
+ /**
+ * The settable config flag for GDPR opt-in/opt-out. Defaults to true.
+ */
+ automaticDataCollectionEnabled?: boolean;
+}
+export { FirebaseError }
+
+/**
+ * @public
+ *
+ * Firebase configuration object. Contains a set of parameters required by
+ * services in order to successfully communicate with Firebase server APIs
+ * and to associate client data with your Firebase project and
+ * Firebase application. Typically this object is populated by the Firebase
+ * console at project setup. See also:
+ * {@link https://firebase.google.com/docs/web/setup#config-object | Learn about the Firebase config object}.
+ */
+export declare interface FirebaseOptions {
+ /**
+ * An encrypted string used when calling certain APIs that don't need to
+ * access private user data
+ * (example value: `AIzaSyDOCAbC123dEf456GhI789jKl012-MnO`).
+ */
+ apiKey?: string;
+ /**
+ * Auth domain for the project ID.
+ */
+ authDomain?: string;
+ /**
+ * Default Realtime Database URL.
+ */
+ databaseURL?: string;
+ /**
+ * The unique identifier for the project across all of Firebase and
+ * Google Cloud.
+ */
+ projectId?: string;
+ /**
+ * The default Cloud Storage bucket name.
+ */
+ storageBucket?: string;
+ /**
+ * Unique numerical value used to identify each sender that can send
+ * Firebase Cloud Messaging messages to client apps.
+ */
+ messagingSenderId?: string;
+ /**
+ * Unique identifier for the app.
+ */
+ appId?: string;
+ /**
+ * An ID automatically created when you enable Analytics in your
+ * Firebase project and register a web app. In versions 7.20.0
+ * and higher, this parameter is optional.
+ */
+ measurementId?: string;
+}
+
+/**
+ * A {@link @firebase/app#FirebaseServerApp} holds the initialization information
+ * for a collection of services running in server environments.
+ *
+ * Do not call this constructor directly. Instead, use
+ * {@link (initializeServerApp:1) | initializeServerApp()} to create
+ * an app.
+ *
+ * @public
+ */
+export declare interface FirebaseServerApp extends FirebaseApp {
+ /**
+ * There is no `getApp()` operation for `FirebaseServerApp`, so the name is not relevant for
+ * applications. However, it may be used internally, and is declared here so that
+ * `FirebaseServerApp` conforms to the `FirebaseApp` interface.
+ */
+ name: string;
+ /**
+ * The (read-only) configuration settings for this server app. These are the original
+ * parameters given in {@link (initializeServerApp:1) | initializeServerApp()}.
+ *
+ * @example
+ * ```javascript
+ * const app = initializeServerApp(settings);
+ * console.log(app.settings.authIdToken === options.authIdToken); // true
+ * ```
+ */
+ readonly settings: FirebaseServerAppSettings;
+}
+
+/**
+ * @public
+ *
+ * Configuration options given to {@link (initializeServerApp:1) | initializeServerApp()}
+ */
+export declare interface FirebaseServerAppSettings extends Omit<FirebaseAppSettings, 'name'> {
+ /**
+ * An optional Auth ID token used to resume a signed in user session from a client
+ * runtime environment.
+ *
+ * Invoking `getAuth` with a `FirebaseServerApp` configured with a validated `authIdToken`
+ * causes an automatic attempt to sign in the user that the `authIdToken` represents. The token
+ * needs to have been recently minted for this operation to succeed.
+ *
+ * If the token fails local verification due to expiration or parsing errors, then a console error
+ * is logged at the time of initialization of the `FirebaseServerApp` instance.
+ *
+ * If the Auth service has failed to validate the token when the Auth SDK is initialized, then an
+ * warning is logged to the console and the Auth SDK will not sign in a user on initialization.
+ *
+ * If a user is successfully signed in, then the Auth instance's `onAuthStateChanged` callback
+ * is invoked with the `User` object as per standard Auth flows. However, `User` objects
+ * created via an `authIdToken` do not have a refresh token. Attempted `refreshToken`
+ * operations fail.
+ */
+ authIdToken?: string;
+ /**
+ * An optional App Check token. If provided, the Firebase SDKs that use App Check will utilize
+ * this App Check token in place of requiring an instance of App Check to be initialized.
+ *
+ * If the token fails local verification due to expiration or parsing errors, then a console error
+ * is logged at the time of initialization of the `FirebaseServerApp` instance.
+ */
+ appCheckToken?: string;
+ /**
+ * An optional object. If provided, the Firebase SDK uses a `FinalizationRegistry`
+ * object to monitor the garbage collection status of the provided object. The
+ * Firebase SDK releases its reference on the `FirebaseServerApp` instance when the
+ * provided `releaseOnDeref` object is garbage collected.
+ *
+ * You can use this field to reduce memory management overhead for your application.
+ * If provided, an app running in a SSR pass does not need to perform
+ * `FirebaseServerApp` cleanup, so long as the reference object is deleted (by falling out of
+ * SSR scope, for instance.)
+ *
+ * If an object is not provided then the application must clean up the `FirebaseServerApp`
+ * instance by invoking `deleteApp`.
+ *
+ * If the application provides an object in this parameter, but the application is
+ * executed in a JavaScript engine that predates the support of `FinalizationRegistry`
+ * (introduced in node v14.6.0, for instance), then an error is thrown at `FirebaseServerApp`
+ * initialization.
+ */
+ releaseOnDeref?: object;
+}
+
+/* Excluded from this release type: _FirebaseService */
+
+/**
+ * Retrieves a {@link @firebase/app#FirebaseApp} instance.
+ *
+ * When called with no arguments, the default app is returned. When an app name
+ * is provided, the app corresponding to that name is returned.
+ *
+ * An exception is thrown if the app being retrieved has not yet been
+ * initialized.
+ *
+ * @example
+ * ```javascript
+ * // Return the default app
+ * const app = getApp();
+ * ```
+ *
+ * @example
+ * ```javascript
+ * // Return a named app
+ * const otherApp = getApp("otherApp");
+ * ```
+ *
+ * @param name - Optional name of the app to return. If no name is
+ * provided, the default is `"[DEFAULT]"`.
+ *
+ * @returns The app corresponding to the provided app name.
+ * If no app name is provided, the default app is returned.
+ *
+ * @public
+ */
+export declare function getApp(name?: string): FirebaseApp;
+
+/**
+ * A (read-only) array of all initialized apps.
+ * @public
+ */
+export declare function getApps(): FirebaseApp[];
+
+/* Excluded from this release type: _getProvider */
+
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseApp} instance.
+ *
+ * See
+ * {@link
+ * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app
+ * | Add Firebase to your app} and
+ * {@link
+ * https://firebase.google.com/docs/web/setup#multiple-projects
+ * | Initialize multiple projects} for detailed documentation.
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize default app
+ * // Retrieve your own options values by adding a web app on
+ * // https://console.firebase.google.com
+ * initializeApp({
+ * apiKey: "AIza....", // Auth / General Use
+ * authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
+ * databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
+ * storageBucket: "YOUR_APP.appspot.com", // Storage
+ * messagingSenderId: "123456789" // Cloud Messaging
+ * });
+ * ```
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize another app
+ * const otherApp = initializeApp({
+ * databaseURL: "https://<OTHER_DATABASE_NAME>.firebaseio.com",
+ * storageBucket: "<OTHER_STORAGE_BUCKET>.appspot.com"
+ * }, "otherApp");
+ * ```
+ *
+ * @param options - Options to configure the app's services.
+ * @param name - Optional name of the app to initialize. If no name
+ * is provided, the default is `"[DEFAULT]"`.
+ *
+ * @returns The initialized app.
+ *
+ * @throws If the optional `name` parameter is malformed or empty.
+ *
+ * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.
+ *
+ * @public
+ */
+export declare function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;
+
+/**
+ * Creates and initializes a FirebaseApp instance.
+ *
+ * @param options - Options to configure the app's services.
+ * @param config - FirebaseApp Configuration
+ *
+ * @throws If {@link FirebaseAppSettings.name} is defined but the value is malformed or empty.
+ *
+ * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.
+ * @public
+ */
+export declare function initializeApp(options: FirebaseOptions, config?: FirebaseAppSettings): FirebaseApp;
+
+/**
+ * Creates and initializes a FirebaseApp instance.
+ *
+ * @public
+ */
+export declare function initializeApp(): FirebaseApp;
+
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.
+ *
+ * The `FirebaseServerApp` is similar to `FirebaseApp`, but is intended for execution in
+ * server side rendering environments only. Initialization will fail if invoked from a
+ * browser environment.
+ *
+ * See
+ * {@link
+ * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app
+ * | Add Firebase to your app} and
+ * {@link
+ * https://firebase.google.com/docs/web/setup#multiple-projects
+ * | Initialize multiple projects} for detailed documentation.
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize an instance of `FirebaseServerApp`.
+ * // Retrieve your own options values by adding a web app on
+ * // https://console.firebase.google.com
+ * initializeServerApp({
+ * apiKey: "AIza....", // Auth / General Use
+ * authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
+ * databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
+ * storageBucket: "YOUR_APP.appspot.com", // Storage
+ * messagingSenderId: "123456789" // Cloud Messaging
+ * },
+ * {
+ * authIdToken: "Your Auth ID Token"
+ * });
+ * ```
+ *
+ * @param options - `Firebase.AppOptions` to configure the app's services, or a
+ * a `FirebaseApp` instance which contains the `AppOptions` within.
+ * @param config - Optional `FirebaseServerApp` settings.
+ *
+ * @returns The initialized `FirebaseServerApp`.
+ *
+ * @throws If invoked in an unsupported non-server environment such as a browser.
+ *
+ * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't
+ * provide Finalization Registry support.
+ *
+ * @public
+ */
+export declare function initializeServerApp(options: FirebaseOptions | FirebaseApp, config?: FirebaseServerAppSettings): FirebaseServerApp;
+
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.
+ *
+ * @param config - Optional `FirebaseServerApp` settings.
+ *
+ * @returns The initialized `FirebaseServerApp`.
+ *
+ * @throws If invoked in an unsupported non-server environment such as a browser.
+ * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't
+ * provide Finalization Registry support.
+ * @throws If the `FIREBASE_OPTIONS` environment variable does not contain a valid project
+ * configuration required for auto-initialization.
+ *
+ * @public
+ */
+export declare function initializeServerApp(config?: FirebaseServerAppSettings): FirebaseServerApp;
+
+/* Excluded from this release type: _isFirebaseApp */
+
+/* Excluded from this release type: _isFirebaseServerApp */
+
+/* Excluded from this release type: _isFirebaseServerAppSettings */
+
+/**
+ * Sets log handler for all Firebase SDKs.
+ * @param logCallback - An optional custom log handler that executes user code whenever
+ * the Firebase SDK makes a logging call.
+ *
+ * @public
+ */
+export declare function onLog(logCallback: LogCallback | null, options?: LogOptions): void;
+
+/* Excluded from this release type: _registerComponent */
+
+/**
+ * Registers a library's name and version for platform logging purposes.
+ * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)
+ * @param version - Current version of that library.
+ * @param variant - Bundle variant, e.g., node, rn, etc.
+ *
+ * @public
+ */
+export declare function registerVersion(libraryKeyOrName: string, version: string, variant?: string): void;
+
+/* Excluded from this release type: _removeServiceInstance */
+
+/**
+ * The current SDK version.
+ *
+ * @public
+ */
+export declare const SDK_VERSION: string;
+
+/* Excluded from this release type: _serverApps */
+
+/**
+ * Sets log level for all Firebase SDKs.
+ *
+ * All of the log types above the current log level are captured (i.e. if
+ * you set the log level to `info`, errors are logged, but `debug` and
+ * `verbose` logs are not).
+ *
+ * @public
+ */
+export declare function setLogLevel(logLevel: LogLevelString): void;
+
+export { }
diff --git a/frontend-old/node_modules/@firebase/app/dist/app.d.ts b/frontend-old/node_modules/@firebase/app/dist/app.d.ts
new file mode 100644
index 0000000..0a72e27
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app.d.ts
@@ -0,0 +1,572 @@
+/**
+ * Firebase App
+ *
+ * @remarks This package coordinates the communication between the different Firebase components
+ * @packageDocumentation
+ */
+
+import { Component } from '@firebase/component';
+import { ComponentContainer } from '@firebase/component';
+import { FirebaseError } from '@firebase/util';
+import { LogCallback } from '@firebase/logger';
+import { LogLevelString } from '@firebase/logger';
+import { LogOptions } from '@firebase/logger';
+import { Name } from '@firebase/component';
+import { Provider } from '@firebase/component';
+
+/**
+ * @param component - the component being added to this app's container
+ *
+ * @internal
+ */
+export declare function _addComponent<T extends Name>(app: FirebaseApp, component: Component<T>): void;
+
+/**
+ *
+ * @internal
+ */
+export declare function _addOrOverwriteComponent(app: FirebaseApp, component: Component): void;
+
+/**
+ * @internal
+ */
+export declare const _apps: Map<string, FirebaseApp>;
+
+/**
+ * Test only
+ *
+ * @internal
+ */
+export declare function _clearComponents(): void;
+
+/**
+ * Registered components.
+ *
+ * @internal
+ */
+export declare const _components: Map<string, Component<any>>;
+
+/**
+ * The default app name
+ *
+ * @internal
+ */
+export declare const _DEFAULT_ENTRY_NAME = "[DEFAULT]";
+
+/**
+ * Renders this app unusable and frees the resources of all associated
+ * services.
+ *
+ * @example
+ * ```javascript
+ * deleteApp(app)
+ * .then(function() {
+ * console.log("App deleted successfully");
+ * })
+ * .catch(function(error) {
+ * console.log("Error deleting app:", error);
+ * });
+ * ```
+ *
+ * @public
+ */
+export declare function deleteApp(app: FirebaseApp): Promise<void>;
+
+/**
+ * A {@link @firebase/app#FirebaseApp} holds the initialization information for a collection of
+ * services.
+ *
+ * Do not call this constructor directly. Instead, use
+ * {@link (initializeApp:1) | initializeApp()} to create an app.
+ *
+ * @public
+ */
+export declare interface FirebaseApp {
+ /**
+ * The (read-only) name for this app.
+ *
+ * The default app's name is `"[DEFAULT]"`.
+ *
+ * @example
+ * ```javascript
+ * // The default app's name is "[DEFAULT]"
+ * const app = initializeApp(defaultAppConfig);
+ * console.log(app.name); // "[DEFAULT]"
+ * ```
+ *
+ * @example
+ * ```javascript
+ * // A named app's name is what you provide to initializeApp()
+ * const otherApp = initializeApp(otherAppConfig, "other");
+ * console.log(otherApp.name); // "other"
+ * ```
+ */
+ readonly name: string;
+ /**
+ * The (read-only) configuration options for this app. These are the original
+ * parameters given in {@link (initializeApp:1) | initializeApp()}.
+ *
+ * @example
+ * ```javascript
+ * const app = initializeApp(config);
+ * console.log(app.options.databaseURL === config.databaseURL); // true
+ * ```
+ */
+ readonly options: FirebaseOptions;
+ /**
+ * The settable config flag for GDPR opt-in/opt-out
+ */
+ automaticDataCollectionEnabled: boolean;
+}
+
+/**
+ * @internal
+ */
+export declare interface _FirebaseAppInternal extends FirebaseApp {
+ container: ComponentContainer;
+ isDeleted: boolean;
+ checkDestroyed(): void;
+}
+
+/**
+ * @public
+ *
+ * Configuration options given to {@link (initializeApp:1) | initializeApp()}
+ */
+export declare interface FirebaseAppSettings {
+ /**
+ * custom name for the Firebase App.
+ * The default value is `"[DEFAULT]"`.
+ */
+ name?: string;
+ /**
+ * The settable config flag for GDPR opt-in/opt-out. Defaults to true.
+ */
+ automaticDataCollectionEnabled?: boolean;
+}
+export { FirebaseError }
+
+/**
+ * @public
+ *
+ * Firebase configuration object. Contains a set of parameters required by
+ * services in order to successfully communicate with Firebase server APIs
+ * and to associate client data with your Firebase project and
+ * Firebase application. Typically this object is populated by the Firebase
+ * console at project setup. See also:
+ * {@link https://firebase.google.com/docs/web/setup#config-object | Learn about the Firebase config object}.
+ */
+export declare interface FirebaseOptions {
+ /**
+ * An encrypted string used when calling certain APIs that don't need to
+ * access private user data
+ * (example value: `AIzaSyDOCAbC123dEf456GhI789jKl012-MnO`).
+ */
+ apiKey?: string;
+ /**
+ * Auth domain for the project ID.
+ */
+ authDomain?: string;
+ /**
+ * Default Realtime Database URL.
+ */
+ databaseURL?: string;
+ /**
+ * The unique identifier for the project across all of Firebase and
+ * Google Cloud.
+ */
+ projectId?: string;
+ /**
+ * The default Cloud Storage bucket name.
+ */
+ storageBucket?: string;
+ /**
+ * Unique numerical value used to identify each sender that can send
+ * Firebase Cloud Messaging messages to client apps.
+ */
+ messagingSenderId?: string;
+ /**
+ * Unique identifier for the app.
+ */
+ appId?: string;
+ /**
+ * An ID automatically created when you enable Analytics in your
+ * Firebase project and register a web app. In versions 7.20.0
+ * and higher, this parameter is optional.
+ */
+ measurementId?: string;
+}
+
+/**
+ * A {@link @firebase/app#FirebaseServerApp} holds the initialization information
+ * for a collection of services running in server environments.
+ *
+ * Do not call this constructor directly. Instead, use
+ * {@link (initializeServerApp:1) | initializeServerApp()} to create
+ * an app.
+ *
+ * @public
+ */
+export declare interface FirebaseServerApp extends FirebaseApp {
+ /**
+ * There is no `getApp()` operation for `FirebaseServerApp`, so the name is not relevant for
+ * applications. However, it may be used internally, and is declared here so that
+ * `FirebaseServerApp` conforms to the `FirebaseApp` interface.
+ */
+ name: string;
+ /**
+ * The (read-only) configuration settings for this server app. These are the original
+ * parameters given in {@link (initializeServerApp:1) | initializeServerApp()}.
+ *
+ * @example
+ * ```javascript
+ * const app = initializeServerApp(settings);
+ * console.log(app.settings.authIdToken === options.authIdToken); // true
+ * ```
+ */
+ readonly settings: FirebaseServerAppSettings;
+}
+
+/**
+ * @public
+ *
+ * Configuration options given to {@link (initializeServerApp:1) | initializeServerApp()}
+ */
+export declare interface FirebaseServerAppSettings extends Omit<FirebaseAppSettings, 'name'> {
+ /**
+ * An optional Auth ID token used to resume a signed in user session from a client
+ * runtime environment.
+ *
+ * Invoking `getAuth` with a `FirebaseServerApp` configured with a validated `authIdToken`
+ * causes an automatic attempt to sign in the user that the `authIdToken` represents. The token
+ * needs to have been recently minted for this operation to succeed.
+ *
+ * If the token fails local verification due to expiration or parsing errors, then a console error
+ * is logged at the time of initialization of the `FirebaseServerApp` instance.
+ *
+ * If the Auth service has failed to validate the token when the Auth SDK is initialized, then an
+ * warning is logged to the console and the Auth SDK will not sign in a user on initialization.
+ *
+ * If a user is successfully signed in, then the Auth instance's `onAuthStateChanged` callback
+ * is invoked with the `User` object as per standard Auth flows. However, `User` objects
+ * created via an `authIdToken` do not have a refresh token. Attempted `refreshToken`
+ * operations fail.
+ */
+ authIdToken?: string;
+ /**
+ * An optional App Check token. If provided, the Firebase SDKs that use App Check will utilize
+ * this App Check token in place of requiring an instance of App Check to be initialized.
+ *
+ * If the token fails local verification due to expiration or parsing errors, then a console error
+ * is logged at the time of initialization of the `FirebaseServerApp` instance.
+ */
+ appCheckToken?: string;
+ /**
+ * An optional object. If provided, the Firebase SDK uses a `FinalizationRegistry`
+ * object to monitor the garbage collection status of the provided object. The
+ * Firebase SDK releases its reference on the `FirebaseServerApp` instance when the
+ * provided `releaseOnDeref` object is garbage collected.
+ *
+ * You can use this field to reduce memory management overhead for your application.
+ * If provided, an app running in a SSR pass does not need to perform
+ * `FirebaseServerApp` cleanup, so long as the reference object is deleted (by falling out of
+ * SSR scope, for instance.)
+ *
+ * If an object is not provided then the application must clean up the `FirebaseServerApp`
+ * instance by invoking `deleteApp`.
+ *
+ * If the application provides an object in this parameter, but the application is
+ * executed in a JavaScript engine that predates the support of `FinalizationRegistry`
+ * (introduced in node v14.6.0, for instance), then an error is thrown at `FirebaseServerApp`
+ * initialization.
+ */
+ releaseOnDeref?: object;
+}
+
+/**
+ * @internal
+ */
+export declare interface _FirebaseService {
+ app: FirebaseApp;
+ /**
+ * Delete the service and free it's resources - called from
+ * {@link @firebase/app#deleteApp | deleteApp()}
+ */
+ _delete(): Promise<void>;
+}
+
+/**
+ * Retrieves a {@link @firebase/app#FirebaseApp} instance.
+ *
+ * When called with no arguments, the default app is returned. When an app name
+ * is provided, the app corresponding to that name is returned.
+ *
+ * An exception is thrown if the app being retrieved has not yet been
+ * initialized.
+ *
+ * @example
+ * ```javascript
+ * // Return the default app
+ * const app = getApp();
+ * ```
+ *
+ * @example
+ * ```javascript
+ * // Return a named app
+ * const otherApp = getApp("otherApp");
+ * ```
+ *
+ * @param name - Optional name of the app to return. If no name is
+ * provided, the default is `"[DEFAULT]"`.
+ *
+ * @returns The app corresponding to the provided app name.
+ * If no app name is provided, the default app is returned.
+ *
+ * @public
+ */
+export declare function getApp(name?: string): FirebaseApp;
+
+/**
+ * A (read-only) array of all initialized apps.
+ * @public
+ */
+export declare function getApps(): FirebaseApp[];
+
+/**
+ *
+ * @param app - FirebaseApp instance
+ * @param name - service name
+ *
+ * @returns the provider for the service with the matching name
+ *
+ * @internal
+ */
+export declare function _getProvider<T extends Name>(app: FirebaseApp, name: T): Provider<T>;
+
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseApp} instance.
+ *
+ * See
+ * {@link
+ * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app
+ * | Add Firebase to your app} and
+ * {@link
+ * https://firebase.google.com/docs/web/setup#multiple-projects
+ * | Initialize multiple projects} for detailed documentation.
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize default app
+ * // Retrieve your own options values by adding a web app on
+ * // https://console.firebase.google.com
+ * initializeApp({
+ * apiKey: "AIza....", // Auth / General Use
+ * authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
+ * databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
+ * storageBucket: "YOUR_APP.appspot.com", // Storage
+ * messagingSenderId: "123456789" // Cloud Messaging
+ * });
+ * ```
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize another app
+ * const otherApp = initializeApp({
+ * databaseURL: "https://<OTHER_DATABASE_NAME>.firebaseio.com",
+ * storageBucket: "<OTHER_STORAGE_BUCKET>.appspot.com"
+ * }, "otherApp");
+ * ```
+ *
+ * @param options - Options to configure the app's services.
+ * @param name - Optional name of the app to initialize. If no name
+ * is provided, the default is `"[DEFAULT]"`.
+ *
+ * @returns The initialized app.
+ *
+ * @throws If the optional `name` parameter is malformed or empty.
+ *
+ * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.
+ *
+ * @public
+ */
+export declare function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;
+
+/**
+ * Creates and initializes a FirebaseApp instance.
+ *
+ * @param options - Options to configure the app's services.
+ * @param config - FirebaseApp Configuration
+ *
+ * @throws If {@link FirebaseAppSettings.name} is defined but the value is malformed or empty.
+ *
+ * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.
+ * @public
+ */
+export declare function initializeApp(options: FirebaseOptions, config?: FirebaseAppSettings): FirebaseApp;
+
+/**
+ * Creates and initializes a FirebaseApp instance.
+ *
+ * @public
+ */
+export declare function initializeApp(): FirebaseApp;
+
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.
+ *
+ * The `FirebaseServerApp` is similar to `FirebaseApp`, but is intended for execution in
+ * server side rendering environments only. Initialization will fail if invoked from a
+ * browser environment.
+ *
+ * See
+ * {@link
+ * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app
+ * | Add Firebase to your app} and
+ * {@link
+ * https://firebase.google.com/docs/web/setup#multiple-projects
+ * | Initialize multiple projects} for detailed documentation.
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize an instance of `FirebaseServerApp`.
+ * // Retrieve your own options values by adding a web app on
+ * // https://console.firebase.google.com
+ * initializeServerApp({
+ * apiKey: "AIza....", // Auth / General Use
+ * authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
+ * databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
+ * storageBucket: "YOUR_APP.appspot.com", // Storage
+ * messagingSenderId: "123456789" // Cloud Messaging
+ * },
+ * {
+ * authIdToken: "Your Auth ID Token"
+ * });
+ * ```
+ *
+ * @param options - `Firebase.AppOptions` to configure the app's services, or a
+ * a `FirebaseApp` instance which contains the `AppOptions` within.
+ * @param config - Optional `FirebaseServerApp` settings.
+ *
+ * @returns The initialized `FirebaseServerApp`.
+ *
+ * @throws If invoked in an unsupported non-server environment such as a browser.
+ *
+ * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't
+ * provide Finalization Registry support.
+ *
+ * @public
+ */
+export declare function initializeServerApp(options: FirebaseOptions | FirebaseApp, config?: FirebaseServerAppSettings): FirebaseServerApp;
+
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.
+ *
+ * @param config - Optional `FirebaseServerApp` settings.
+ *
+ * @returns The initialized `FirebaseServerApp`.
+ *
+ * @throws If invoked in an unsupported non-server environment such as a browser.
+ * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't
+ * provide Finalization Registry support.
+ * @throws If the `FIREBASE_OPTIONS` environment variable does not contain a valid project
+ * configuration required for auto-initialization.
+ *
+ * @public
+ */
+export declare function initializeServerApp(config?: FirebaseServerAppSettings): FirebaseServerApp;
+
+/**
+ *
+ * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.
+ *
+ * @returns true if the provide object is of type FirebaseApp.
+ *
+ * @internal
+ */
+export declare function _isFirebaseApp(obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings): obj is FirebaseApp;
+
+/**
+ *
+ * @param obj - an object of type FirebaseApp.
+ *
+ * @returns true if the provided object is of type FirebaseServerAppImpl.
+ *
+ * @internal
+ */
+export declare function _isFirebaseServerApp(obj: FirebaseApp | FirebaseServerApp | null | undefined): obj is FirebaseServerApp;
+
+/**
+ *
+ * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.
+ *
+ * @returns true if the provided object is of type FirebaseServerAppImpl.
+ *
+ * @internal
+ */
+export declare function _isFirebaseServerAppSettings(obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings): obj is FirebaseServerAppSettings;
+
+/**
+ * Sets log handler for all Firebase SDKs.
+ * @param logCallback - An optional custom log handler that executes user code whenever
+ * the Firebase SDK makes a logging call.
+ *
+ * @public
+ */
+export declare function onLog(logCallback: LogCallback | null, options?: LogOptions): void;
+
+/**
+ *
+ * @param component - the component to register
+ * @returns whether or not the component is registered successfully
+ *
+ * @internal
+ */
+export declare function _registerComponent<T extends Name>(component: Component<T>): boolean;
+
+/**
+ * Registers a library's name and version for platform logging purposes.
+ * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)
+ * @param version - Current version of that library.
+ * @param variant - Bundle variant, e.g., node, rn, etc.
+ *
+ * @public
+ */
+export declare function registerVersion(libraryKeyOrName: string, version: string, variant?: string): void;
+
+/**
+ *
+ * @param app - FirebaseApp instance
+ * @param name - service name
+ * @param instanceIdentifier - service instance identifier in case the service supports multiple instances
+ *
+ * @internal
+ */
+export declare function _removeServiceInstance<T extends Name>(app: FirebaseApp, name: T, instanceIdentifier?: string): void;
+
+/**
+ * The current SDK version.
+ *
+ * @public
+ */
+export declare const SDK_VERSION: string;
+
+/**
+ * @internal
+ */
+export declare const _serverApps: Map<string, FirebaseServerApp>;
+
+/**
+ * Sets log level for all Firebase SDKs.
+ *
+ * All of the log types above the current log level are captured (i.e. if
+ * you set the log level to `info`, errors are logged, but `debug` and
+ * `verbose` logs are not).
+ *
+ * @public
+ */
+export declare function setLogLevel(logLevel: LogLevelString): void;
+
+export { }
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/api.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/api.d.ts
new file mode 100644
index 0000000..2bfbdd9
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/api.d.ts
@@ -0,0 +1,235 @@
+/**
+ * @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.
+ */
+import { FirebaseApp, FirebaseServerApp, FirebaseOptions, FirebaseAppSettings, FirebaseServerAppSettings } from './public-types';
+import { LogLevelString, LogCallback, LogOptions } from '@firebase/logger';
+export { FirebaseError } from '@firebase/util';
+/**
+ * The current SDK version.
+ *
+ * @public
+ */
+export declare const SDK_VERSION: string;
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseApp} instance.
+ *
+ * See
+ * {@link
+ * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app
+ * | Add Firebase to your app} and
+ * {@link
+ * https://firebase.google.com/docs/web/setup#multiple-projects
+ * | Initialize multiple projects} for detailed documentation.
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize default app
+ * // Retrieve your own options values by adding a web app on
+ * // https://console.firebase.google.com
+ * initializeApp({
+ * apiKey: "AIza....", // Auth / General Use
+ * authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
+ * databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
+ * storageBucket: "YOUR_APP.appspot.com", // Storage
+ * messagingSenderId: "123456789" // Cloud Messaging
+ * });
+ * ```
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize another app
+ * const otherApp = initializeApp({
+ * databaseURL: "https://<OTHER_DATABASE_NAME>.firebaseio.com",
+ * storageBucket: "<OTHER_STORAGE_BUCKET>.appspot.com"
+ * }, "otherApp");
+ * ```
+ *
+ * @param options - Options to configure the app's services.
+ * @param name - Optional name of the app to initialize. If no name
+ * is provided, the default is `"[DEFAULT]"`.
+ *
+ * @returns The initialized app.
+ *
+ * @throws If the optional `name` parameter is malformed or empty.
+ *
+ * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.
+ *
+ * @public
+ */
+export declare function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;
+/**
+ * Creates and initializes a FirebaseApp instance.
+ *
+ * @param options - Options to configure the app's services.
+ * @param config - FirebaseApp Configuration
+ *
+ * @throws If {@link FirebaseAppSettings.name} is defined but the value is malformed or empty.
+ *
+ * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.
+ * @public
+ */
+export declare function initializeApp(options: FirebaseOptions, config?: FirebaseAppSettings): FirebaseApp;
+/**
+ * Creates and initializes a FirebaseApp instance.
+ *
+ * @public
+ */
+export declare function initializeApp(): FirebaseApp;
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.
+ *
+ * The `FirebaseServerApp` is similar to `FirebaseApp`, but is intended for execution in
+ * server side rendering environments only. Initialization will fail if invoked from a
+ * browser environment.
+ *
+ * See
+ * {@link
+ * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app
+ * | Add Firebase to your app} and
+ * {@link
+ * https://firebase.google.com/docs/web/setup#multiple-projects
+ * | Initialize multiple projects} for detailed documentation.
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize an instance of `FirebaseServerApp`.
+ * // Retrieve your own options values by adding a web app on
+ * // https://console.firebase.google.com
+ * initializeServerApp({
+ * apiKey: "AIza....", // Auth / General Use
+ * authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
+ * databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
+ * storageBucket: "YOUR_APP.appspot.com", // Storage
+ * messagingSenderId: "123456789" // Cloud Messaging
+ * },
+ * {
+ * authIdToken: "Your Auth ID Token"
+ * });
+ * ```
+ *
+ * @param options - `Firebase.AppOptions` to configure the app's services, or a
+ * a `FirebaseApp` instance which contains the `AppOptions` within.
+ * @param config - Optional `FirebaseServerApp` settings.
+ *
+ * @returns The initialized `FirebaseServerApp`.
+ *
+ * @throws If invoked in an unsupported non-server environment such as a browser.
+ *
+ * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't
+ * provide Finalization Registry support.
+ *
+ * @public
+ */
+export declare function initializeServerApp(options: FirebaseOptions | FirebaseApp, config?: FirebaseServerAppSettings): FirebaseServerApp;
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.
+ *
+ * @param config - Optional `FirebaseServerApp` settings.
+ *
+ * @returns The initialized `FirebaseServerApp`.
+ *
+ * @throws If invoked in an unsupported non-server environment such as a browser.
+ * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't
+ * provide Finalization Registry support.
+ * @throws If the `FIREBASE_OPTIONS` environment variable does not contain a valid project
+ * configuration required for auto-initialization.
+ *
+ * @public
+ */
+export declare function initializeServerApp(config?: FirebaseServerAppSettings): FirebaseServerApp;
+/**
+ * Retrieves a {@link @firebase/app#FirebaseApp} instance.
+ *
+ * When called with no arguments, the default app is returned. When an app name
+ * is provided, the app corresponding to that name is returned.
+ *
+ * An exception is thrown if the app being retrieved has not yet been
+ * initialized.
+ *
+ * @example
+ * ```javascript
+ * // Return the default app
+ * const app = getApp();
+ * ```
+ *
+ * @example
+ * ```javascript
+ * // Return a named app
+ * const otherApp = getApp("otherApp");
+ * ```
+ *
+ * @param name - Optional name of the app to return. If no name is
+ * provided, the default is `"[DEFAULT]"`.
+ *
+ * @returns The app corresponding to the provided app name.
+ * If no app name is provided, the default app is returned.
+ *
+ * @public
+ */
+export declare function getApp(name?: string): FirebaseApp;
+/**
+ * A (read-only) array of all initialized apps.
+ * @public
+ */
+export declare function getApps(): FirebaseApp[];
+/**
+ * Renders this app unusable and frees the resources of all associated
+ * services.
+ *
+ * @example
+ * ```javascript
+ * deleteApp(app)
+ * .then(function() {
+ * console.log("App deleted successfully");
+ * })
+ * .catch(function(error) {
+ * console.log("Error deleting app:", error);
+ * });
+ * ```
+ *
+ * @public
+ */
+export declare function deleteApp(app: FirebaseApp): Promise<void>;
+/**
+ * Registers a library's name and version for platform logging purposes.
+ * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)
+ * @param version - Current version of that library.
+ * @param variant - Bundle variant, e.g., node, rn, etc.
+ *
+ * @public
+ */
+export declare function registerVersion(libraryKeyOrName: string, version: string, variant?: string): void;
+/**
+ * Sets log handler for all Firebase SDKs.
+ * @param logCallback - An optional custom log handler that executes user code whenever
+ * the Firebase SDK makes a logging call.
+ *
+ * @public
+ */
+export declare function onLog(logCallback: LogCallback | null, options?: LogOptions): void;
+/**
+ * Sets log level for all Firebase SDKs.
+ *
+ * All of the log types above the current log level are captured (i.e. if
+ * you set the log level to `info`, errors are logged, but `debug` and
+ * `verbose` logs are not).
+ *
+ * @public
+ */
+export declare function setLogLevel(logLevel: LogLevelString): void;
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/constants.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/constants.d.ts
new file mode 100644
index 0000000..6f340a0
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/constants.d.ts
@@ -0,0 +1,26 @@
+/**
+ * @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.
+ */
+/**
+ * The default app name
+ *
+ * @internal
+ */
+export declare const DEFAULT_ENTRY_NAME = "[DEFAULT]";
+export declare const PLATFORM_LOG_STRING: {
+ readonly [x: string]: "fire-core" | "fire-core-compat" | "fire-analytics" | "fire-analytics-compat" | "fire-app-check" | "fire-app-check-compat" | "fire-auth" | "fire-auth-compat" | "fire-rtdb" | "fire-data-connect" | "fire-rtdb-compat" | "fire-fn" | "fire-fn-compat" | "fire-iid" | "fire-iid-compat" | "fire-fcm" | "fire-fcm-compat" | "fire-perf" | "fire-perf-compat" | "fire-rc" | "fire-rc-compat" | "fire-gcs" | "fire-gcs-compat" | "fire-fst" | "fire-fst-compat" | "fire-vertex" | "fire-js" | "fire-js-all";
+ readonly 'fire-js': "fire-js";
+};
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/errors.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/errors.d.ts
new file mode 100644
index 0000000..eb938a2
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/errors.d.ts
@@ -0,0 +1,67 @@
+/**
+ * @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.
+ */
+import { ErrorFactory } from '@firebase/util';
+export declare const enum AppError {
+ NO_APP = "no-app",
+ BAD_APP_NAME = "bad-app-name",
+ DUPLICATE_APP = "duplicate-app",
+ APP_DELETED = "app-deleted",
+ SERVER_APP_DELETED = "server-app-deleted",
+ NO_OPTIONS = "no-options",
+ INVALID_APP_ARGUMENT = "invalid-app-argument",
+ INVALID_LOG_ARGUMENT = "invalid-log-argument",
+ IDB_OPEN = "idb-open",
+ IDB_GET = "idb-get",
+ IDB_WRITE = "idb-set",
+ IDB_DELETE = "idb-delete",
+ FINALIZATION_REGISTRY_NOT_SUPPORTED = "finalization-registry-not-supported",
+ INVALID_SERVER_APP_ENVIRONMENT = "invalid-server-app-environment"
+}
+interface ErrorParams {
+ [AppError.NO_APP]: {
+ appName: string;
+ };
+ [AppError.BAD_APP_NAME]: {
+ appName: string;
+ };
+ [AppError.DUPLICATE_APP]: {
+ appName: string;
+ };
+ [AppError.APP_DELETED]: {
+ appName: string;
+ };
+ [AppError.INVALID_APP_ARGUMENT]: {
+ appName: string;
+ };
+ [AppError.IDB_OPEN]: {
+ originalErrorMessage?: string;
+ };
+ [AppError.IDB_GET]: {
+ originalErrorMessage?: string;
+ };
+ [AppError.IDB_WRITE]: {
+ originalErrorMessage?: string;
+ };
+ [AppError.IDB_DELETE]: {
+ originalErrorMessage?: string;
+ };
+ [AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED]: {
+ appName?: string;
+ };
+}
+export declare const ERROR_FACTORY: ErrorFactory<AppError, ErrorParams>;
+export {};
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/firebaseApp.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/firebaseApp.d.ts
new file mode 100644
index 0000000..66643e0
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/firebaseApp.d.ts
@@ -0,0 +1,46 @@
+/**
+ * @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.
+ */
+import { FirebaseApp, FirebaseOptions, FirebaseAppSettings } from './public-types';
+import { ComponentContainer } from '@firebase/component';
+export declare class FirebaseAppImpl implements FirebaseApp {
+ protected readonly _options: FirebaseOptions;
+ protected readonly _name: string;
+ /**
+ * Original config values passed in as a constructor parameter.
+ * It is only used to compare with another config object to support idempotent initializeApp().
+ *
+ * Updating automaticDataCollectionEnabled on the App instance will not change its value in _config.
+ */
+ private readonly _config;
+ private _automaticDataCollectionEnabled;
+ protected _isDeleted: boolean;
+ private readonly _container;
+ constructor(options: FirebaseOptions, config: Required<FirebaseAppSettings>, container: ComponentContainer);
+ get automaticDataCollectionEnabled(): boolean;
+ set automaticDataCollectionEnabled(val: boolean);
+ get name(): string;
+ get options(): FirebaseOptions;
+ get config(): Required<FirebaseAppSettings>;
+ get container(): ComponentContainer;
+ get isDeleted(): boolean;
+ set isDeleted(val: boolean);
+ /**
+ * This function will throw an Error if the App has already been deleted -
+ * use before performing API actions on the App.
+ */
+ protected checkDestroyed(): void;
+}
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/firebaseServerApp.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/firebaseServerApp.d.ts
new file mode 100644
index 0000000..7465fa0
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/firebaseServerApp.d.ts
@@ -0,0 +1,36 @@
+/**
+ * @license
+ * Copyright 2023 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.
+ */
+import { FirebaseServerApp, FirebaseServerAppSettings, FirebaseOptions } from './public-types';
+import { ComponentContainer } from '@firebase/component';
+import { FirebaseAppImpl } from './firebaseApp';
+export declare class FirebaseServerAppImpl extends FirebaseAppImpl implements FirebaseServerApp {
+ private readonly _serverConfig;
+ private _finalizationRegistry;
+ private _refCount;
+ constructor(options: FirebaseOptions | FirebaseAppImpl, serverConfig: FirebaseServerAppSettings, name: string, container: ComponentContainer);
+ toJSON(): undefined;
+ get refCount(): number;
+ incRefCount(obj: object | undefined): void;
+ decRefCount(): number;
+ private automaticCleanup;
+ get settings(): FirebaseServerAppSettings;
+ /**
+ * This function will throw an Error if the App has already been deleted -
+ * use before performing API actions on the App.
+ */
+ protected checkDestroyed(): void;
+}
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/global_index.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/global_index.d.ts
new file mode 100644
index 0000000..854685d
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/global_index.d.ts
@@ -0,0 +1,939 @@
+/**
+ * @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.
+ */
+
+/**
+ * Provider for instance for service name T, e.g. 'auth', 'auth-internal'
+ * NameServiceMapping[T] is an alias for the type of the instance
+ */
+declare class Provider<T extends Name> {
+ private readonly name;
+ private readonly container;
+ private component;
+ private readonly instances;
+ private readonly instancesDeferred;
+ private readonly instancesOptions;
+ private onInitCallbacks;
+ constructor(name: T, container: ComponentContainer);
+ /**
+ * @param identifier A provider can provide multiple instances of a service
+ * if this.component.multipleInstances is true.
+ */
+ get(identifier?: string): Promise<NameServiceMapping[T]>;
+ /**
+ *
+ * @param options.identifier A provider can provide multiple instances of a service
+ * if this.component.multipleInstances is true.
+ * @param options.optional If optional is false or not provided, the method throws an error when
+ * the service is not immediately available.
+ * If optional is true, the method returns null if the service is not immediately available.
+ */
+ getImmediate(options: {
+ identifier?: string;
+ optional: true;
+ }): NameServiceMapping[T] | null;
+ getImmediate(options?: {
+ identifier?: string;
+ optional?: false;
+ }): NameServiceMapping[T];
+ getComponent(): Component<T> | null;
+ setComponent(component: Component<T>): void;
+ clearInstance(identifier?: string): void;
+ delete(): Promise<void>;
+ isComponentSet(): boolean;
+ isInitialized(identifier?: string): boolean;
+ getOptions(identifier?: string): Record<string, unknown>;
+ initialize(opts?: InitializeOptions): NameServiceMapping[T];
+ /**
+ *
+ * @param callback - a function that will be invoked after the provider has been initialized by calling provider.initialize().
+ * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.
+ *
+ * @param identifier An optional instance identifier
+ * @returns a function to unregister the callback
+ */
+ onInit(callback: OnInitCallBack<T>, identifier?: string): () => void;
+ /**
+ * Invoke onInit callbacks synchronously
+ * @param instance the service instance`
+ */
+ private invokeOnInitCallbacks;
+ private getOrInitializeService;
+ private normalizeInstanceIdentifier;
+ private shouldAutoInitialize;
+}
+
+/**
+ * @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.
+ */
+
+/**
+ * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`
+ */
+declare class ComponentContainer {
+ private readonly name;
+ private readonly providers;
+ constructor(name: string);
+ /**
+ *
+ * @param component Component being added
+ * @param overwrite When a component with the same name has already been registered,
+ * if overwrite is true: overwrite the existing component with the new component and create a new
+ * provider with the new component. It can be useful in tests where you want to use different mocks
+ * for different tests.
+ * if overwrite is false: throw an exception
+ */
+ addComponent<T extends Name>(component: Component<T>): void;
+ addOrOverwriteComponent<T extends Name>(component: Component<T>): void;
+ /**
+ * getProvider provides a type safe interface where it can only be called with a field name
+ * present in NameServiceMapping interface.
+ *
+ * Firebase SDKs providing services should extend NameServiceMapping interface to register
+ * themselves.
+ */
+ getProvider<T extends Name>(name: T): Provider<T>;
+ getProviders(): Array<Provider<Name>>;
+}
+
+/**
+ * @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.
+ */
+
+declare const enum InstantiationMode {
+ LAZY = "LAZY",// Currently most components are LAZY in JS SDK
+ EAGER = "EAGER",// EAGER components are initialized immediately upon registration
+ EXPLICIT = "EXPLICIT"
+}
+/**
+ * PUBLIC: A public component provides a set of public APIs to customers. A service namespace will be patched
+ * onto `firebase` namespace. Assume the component name is `test`, customers will be able
+ * to get the service by calling `firebase.test()` or `app.test()` where `app` is a `FirebaseApp` instance.
+ *
+ * PRIVATE: A private component provides a set of private APIs that are used internally by other
+ * Firebase SDKs. No service namespace is created in `firebase` namespace and customers have no way to get them.
+ */
+declare const enum ComponentType {
+ PUBLIC = "PUBLIC",
+ PRIVATE = "PRIVATE",
+ VERSION = "VERSION"
+}
+interface InstanceFactoryOptions {
+ instanceIdentifier?: string;
+ options?: {};
+}
+type InitializeOptions = InstanceFactoryOptions;
+/**
+ * Factory to create an instance of type T, given a ComponentContainer.
+ * ComponentContainer is the IOC container that provides {@link Provider}
+ * for dependencies.
+ *
+ * NOTE: The container only provides {@link Provider} rather than the actual instances of dependencies.
+ * It is useful for lazily loaded dependencies and optional dependencies.
+ */
+type InstanceFactory<T extends Name> = (container: ComponentContainer, options: InstanceFactoryOptions) => NameServiceMapping[T];
+type onInstanceCreatedCallback<T extends Name> = (container: ComponentContainer, instanceIdentifier: string, instance: NameServiceMapping[T]) => void;
+interface Dictionary {
+ [key: string]: unknown;
+}
+/**
+ * This interface will be extended by Firebase SDKs to provide service name and service type mapping.
+ * It is used as a generic constraint to ensure type safety.
+ */
+interface NameServiceMapping {
+}
+type Name = keyof NameServiceMapping;
+type OnInitCallBack<T extends Name> = (instance: NameServiceMapping[T], identifier: string) => void;
+
+/**
+ * @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.
+ */
+
+/**
+ * Component for service name T, e.g. `auth`, `auth-internal`
+ */
+declare class Component<T extends Name = Name> {
+ readonly name: T;
+ readonly instanceFactory: InstanceFactory<T>;
+ readonly type: ComponentType;
+ multipleInstances: boolean;
+ /**
+ * Properties to be added to the service namespace
+ */
+ serviceProps: Dictionary;
+ instantiationMode: InstantiationMode;
+ onInstanceCreated: onInstanceCreatedCallback<T> | null;
+ /**
+ *
+ * @param name The public service name, e.g. app, auth, firestore, database
+ * @param instanceFactory Service factory responsible for creating the public interface
+ * @param type whether the service provided by the component is public or private
+ */
+ constructor(name: T, instanceFactory: InstanceFactory<T>, type: ComponentType);
+ setInstantiationMode(mode: InstantiationMode): this;
+ setMultipleInstances(multipleInstances: boolean): this;
+ setServiceProps(props: Dictionary): this;
+ setInstanceCreatedCallback(callback: onInstanceCreatedCallback<T>): this;
+}
+
+/**
+ * @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.
+ */
+interface VersionService {
+ library: string;
+ version: string;
+}
+interface PlatformLoggerService {
+ getPlatformInfoString(): string;
+}
+interface HeartbeatService {
+ /**
+ * Called to report a heartbeat. The function will generate
+ * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it
+ * to IndexedDB.
+ * Note that we only store one heartbeat per day. So if a heartbeat for today is
+ * already logged, subsequent calls to this function in the same day will be ignored.
+ */
+ triggerHeartbeat(): Promise<void>;
+ /**
+ * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.
+ * It also clears all heartbeats from memory as well as in IndexedDB.
+ */
+ getHeartbeatsHeader(): Promise<string>;
+}
+
+/**
+ * @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.
+ */
+
+/**
+ * A {@link @firebase/app#FirebaseApp} holds the initialization information for a collection of
+ * services.
+ *
+ * Do not call this constructor directly. Instead, use
+ * {@link (initializeApp:1) | initializeApp()} to create an app.
+ *
+ * @public
+ */
+interface FirebaseApp {
+ /**
+ * The (read-only) name for this app.
+ *
+ * The default app's name is `"[DEFAULT]"`.
+ *
+ * @example
+ * ```javascript
+ * // The default app's name is "[DEFAULT]"
+ * const app = initializeApp(defaultAppConfig);
+ * console.log(app.name); // "[DEFAULT]"
+ * ```
+ *
+ * @example
+ * ```javascript
+ * // A named app's name is what you provide to initializeApp()
+ * const otherApp = initializeApp(otherAppConfig, "other");
+ * console.log(otherApp.name); // "other"
+ * ```
+ */
+ readonly name: string;
+ /**
+ * The (read-only) configuration options for this app. These are the original
+ * parameters given in {@link (initializeApp:1) | initializeApp()}.
+ *
+ * @example
+ * ```javascript
+ * const app = initializeApp(config);
+ * console.log(app.options.databaseURL === config.databaseURL); // true
+ * ```
+ */
+ readonly options: FirebaseOptions;
+ /**
+ * The settable config flag for GDPR opt-in/opt-out
+ */
+ automaticDataCollectionEnabled: boolean;
+}
+/**
+ * A {@link @firebase/app#FirebaseServerApp} holds the initialization information
+ * for a collection of services running in server environments.
+ *
+ * Do not call this constructor directly. Instead, use
+ * {@link (initializeServerApp:1) | initializeServerApp()} to create
+ * an app.
+ *
+ * @public
+ */
+interface FirebaseServerApp extends FirebaseApp {
+ /**
+ * There is no `getApp()` operation for `FirebaseServerApp`, so the name is not relevant for
+ * applications. However, it may be used internally, and is declared here so that
+ * `FirebaseServerApp` conforms to the `FirebaseApp` interface.
+ */
+ name: string;
+ /**
+ * The (read-only) configuration settings for this server app. These are the original
+ * parameters given in {@link (initializeServerApp:1) | initializeServerApp()}.
+ *
+ * @example
+ * ```javascript
+ * const app = initializeServerApp(settings);
+ * console.log(app.settings.authIdToken === options.authIdToken); // true
+ * ```
+ */
+ readonly settings: FirebaseServerAppSettings;
+}
+/**
+ * @public
+ *
+ * Firebase configuration object. Contains a set of parameters required by
+ * services in order to successfully communicate with Firebase server APIs
+ * and to associate client data with your Firebase project and
+ * Firebase application. Typically this object is populated by the Firebase
+ * console at project setup. See also:
+ * {@link https://firebase.google.com/docs/web/setup#config-object | Learn about the Firebase config object}.
+ */
+interface FirebaseOptions {
+ /**
+ * An encrypted string used when calling certain APIs that don't need to
+ * access private user data
+ * (example value: `AIzaSyDOCAbC123dEf456GhI789jKl012-MnO`).
+ */
+ apiKey?: string;
+ /**
+ * Auth domain for the project ID.
+ */
+ authDomain?: string;
+ /**
+ * Default Realtime Database URL.
+ */
+ databaseURL?: string;
+ /**
+ * The unique identifier for the project across all of Firebase and
+ * Google Cloud.
+ */
+ projectId?: string;
+ /**
+ * The default Cloud Storage bucket name.
+ */
+ storageBucket?: string;
+ /**
+ * Unique numerical value used to identify each sender that can send
+ * Firebase Cloud Messaging messages to client apps.
+ */
+ messagingSenderId?: string;
+ /**
+ * Unique identifier for the app.
+ */
+ appId?: string;
+ /**
+ * An ID automatically created when you enable Analytics in your
+ * Firebase project and register a web app. In versions 7.20.0
+ * and higher, this parameter is optional.
+ */
+ measurementId?: string;
+}
+/**
+ * @public
+ *
+ * Configuration options given to {@link (initializeApp:1) | initializeApp()}
+ */
+interface FirebaseAppSettings {
+ /**
+ * custom name for the Firebase App.
+ * The default value is `"[DEFAULT]"`.
+ */
+ name?: string;
+ /**
+ * The settable config flag for GDPR opt-in/opt-out. Defaults to true.
+ */
+ automaticDataCollectionEnabled?: boolean;
+}
+/**
+ * @public
+ *
+ * Configuration options given to {@link (initializeServerApp:1) | initializeServerApp()}
+ */
+interface FirebaseServerAppSettings extends Omit<FirebaseAppSettings, 'name'> {
+ /**
+ * An optional Auth ID token used to resume a signed in user session from a client
+ * runtime environment.
+ *
+ * Invoking `getAuth` with a `FirebaseServerApp` configured with a validated `authIdToken`
+ * causes an automatic attempt to sign in the user that the `authIdToken` represents. The token
+ * needs to have been recently minted for this operation to succeed.
+ *
+ * If the token fails local verification due to expiration or parsing errors, then a console error
+ * is logged at the time of initialization of the `FirebaseServerApp` instance.
+ *
+ * If the Auth service has failed to validate the token when the Auth SDK is initialized, then an
+ * warning is logged to the console and the Auth SDK will not sign in a user on initialization.
+ *
+ * If a user is successfully signed in, then the Auth instance's `onAuthStateChanged` callback
+ * is invoked with the `User` object as per standard Auth flows. However, `User` objects
+ * created via an `authIdToken` do not have a refresh token. Attempted `refreshToken`
+ * operations fail.
+ */
+ authIdToken?: string;
+ /**
+ * An optional App Check token. If provided, the Firebase SDKs that use App Check will utilize
+ * this App Check token in place of requiring an instance of App Check to be initialized.
+ *
+ * If the token fails local verification due to expiration or parsing errors, then a console error
+ * is logged at the time of initialization of the `FirebaseServerApp` instance.
+ */
+ appCheckToken?: string;
+ /**
+ * An optional object. If provided, the Firebase SDK uses a `FinalizationRegistry`
+ * object to monitor the garbage collection status of the provided object. The
+ * Firebase SDK releases its reference on the `FirebaseServerApp` instance when the
+ * provided `releaseOnDeref` object is garbage collected.
+ *
+ * You can use this field to reduce memory management overhead for your application.
+ * If provided, an app running in a SSR pass does not need to perform
+ * `FirebaseServerApp` cleanup, so long as the reference object is deleted (by falling out of
+ * SSR scope, for instance.)
+ *
+ * If an object is not provided then the application must clean up the `FirebaseServerApp`
+ * instance by invoking `deleteApp`.
+ *
+ * If the application provides an object in this parameter, but the application is
+ * executed in a JavaScript engine that predates the support of `FinalizationRegistry`
+ * (introduced in node v14.6.0, for instance), then an error is thrown at `FirebaseServerApp`
+ * initialization.
+ */
+ releaseOnDeref?: object;
+}
+/**
+ * @internal
+ */
+interface _FirebaseService {
+ app: FirebaseApp;
+ /**
+ * Delete the service and free it's resources - called from
+ * {@link @firebase/app#deleteApp | deleteApp()}
+ */
+ _delete(): Promise<void>;
+}
+/**
+ * @internal
+ */
+interface _FirebaseAppInternal extends FirebaseApp {
+ container: ComponentContainer;
+ isDeleted: boolean;
+ checkDestroyed(): void;
+}
+declare module '@firebase/component' {
+ interface NameServiceMapping {
+ 'app': FirebaseApp;
+ 'app-version': VersionService;
+ 'heartbeat': HeartbeatService;
+ 'platform-logger': PlatformLoggerService;
+ }
+}
+
+/**
+ * @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.
+ */
+type LogLevelString = 'debug' | 'verbose' | 'info' | 'warn' | 'error' | 'silent';
+interface LogOptions {
+ level: LogLevelString;
+}
+type LogCallback = (callbackParams: LogCallbackParams) => void;
+interface LogCallbackParams {
+ level: LogLevelString;
+ message: string;
+ args: unknown[];
+ type: string;
+}
+
+/**
+ * An object that can be injected into the environment as __FIREBASE_DEFAULTS__,
+ * either as a property of globalThis, a shell environment variable, or a
+ * cookie.
+ *
+ * This object can be used to automatically configure and initialize
+ * a Firebase app as well as any emulators.
+ *
+ * @public
+ */
+interface FirebaseDefaults {
+ config?: Record<string, string>;
+ emulatorHosts?: Record<string, string>;
+ _authTokenSyncURL?: string;
+ _authIdTokenMaxAge?: number;
+ /**
+ * Override Firebase's runtime environment detection and
+ * force the SDK to act as if it were in the specified environment.
+ */
+ forceEnvironment?: 'browser' | 'node';
+ [key: string]: unknown;
+}
+declare global {
+ var __FIREBASE_DEFAULTS__: FirebaseDefaults | undefined;
+}
+
+declare class FirebaseError extends Error {
+ /** The error code for this error. */
+ readonly code: string;
+ /** Custom data for this error. */
+ customData?: Record<string, unknown> | undefined;
+ /** The custom name for all FirebaseErrors. */
+ readonly name: string;
+ constructor(
+ /** The error code for this error. */
+ code: string, message: string,
+ /** Custom data for this error. */
+ customData?: Record<string, unknown> | undefined);
+}
+
+/**
+ * @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.
+ */
+
+/**
+ * The current SDK version.
+ *
+ * @public
+ */
+declare const SDK_VERSION: string;
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseApp} instance.
+ *
+ * See
+ * {@link
+ * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app
+ * | Add Firebase to your app} and
+ * {@link
+ * https://firebase.google.com/docs/web/setup#multiple-projects
+ * | Initialize multiple projects} for detailed documentation.
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize default app
+ * // Retrieve your own options values by adding a web app on
+ * // https://console.firebase.google.com
+ * initializeApp({
+ * apiKey: "AIza....", // Auth / General Use
+ * authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
+ * databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
+ * storageBucket: "YOUR_APP.appspot.com", // Storage
+ * messagingSenderId: "123456789" // Cloud Messaging
+ * });
+ * ```
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize another app
+ * const otherApp = initializeApp({
+ * databaseURL: "https://<OTHER_DATABASE_NAME>.firebaseio.com",
+ * storageBucket: "<OTHER_STORAGE_BUCKET>.appspot.com"
+ * }, "otherApp");
+ * ```
+ *
+ * @param options - Options to configure the app's services.
+ * @param name - Optional name of the app to initialize. If no name
+ * is provided, the default is `"[DEFAULT]"`.
+ *
+ * @returns The initialized app.
+ *
+ * @throws If the optional `name` parameter is malformed or empty.
+ *
+ * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.
+ *
+ * @public
+ */
+declare function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;
+/**
+ * Creates and initializes a FirebaseApp instance.
+ *
+ * @param options - Options to configure the app's services.
+ * @param config - FirebaseApp Configuration
+ *
+ * @throws If {@link FirebaseAppSettings.name} is defined but the value is malformed or empty.
+ *
+ * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.
+ * @public
+ */
+declare function initializeApp(options: FirebaseOptions, config?: FirebaseAppSettings): FirebaseApp;
+/**
+ * Creates and initializes a FirebaseApp instance.
+ *
+ * @public
+ */
+declare function initializeApp(): FirebaseApp;
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.
+ *
+ * The `FirebaseServerApp` is similar to `FirebaseApp`, but is intended for execution in
+ * server side rendering environments only. Initialization will fail if invoked from a
+ * browser environment.
+ *
+ * See
+ * {@link
+ * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app
+ * | Add Firebase to your app} and
+ * {@link
+ * https://firebase.google.com/docs/web/setup#multiple-projects
+ * | Initialize multiple projects} for detailed documentation.
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize an instance of `FirebaseServerApp`.
+ * // Retrieve your own options values by adding a web app on
+ * // https://console.firebase.google.com
+ * initializeServerApp({
+ * apiKey: "AIza....", // Auth / General Use
+ * authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
+ * databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
+ * storageBucket: "YOUR_APP.appspot.com", // Storage
+ * messagingSenderId: "123456789" // Cloud Messaging
+ * },
+ * {
+ * authIdToken: "Your Auth ID Token"
+ * });
+ * ```
+ *
+ * @param options - `Firebase.AppOptions` to configure the app's services, or a
+ * a `FirebaseApp` instance which contains the `AppOptions` within.
+ * @param config - Optional `FirebaseServerApp` settings.
+ *
+ * @returns The initialized `FirebaseServerApp`.
+ *
+ * @throws If invoked in an unsupported non-server environment such as a browser.
+ *
+ * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't
+ * provide Finalization Registry support.
+ *
+ * @public
+ */
+declare function initializeServerApp(options: FirebaseOptions | FirebaseApp, config?: FirebaseServerAppSettings): FirebaseServerApp;
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.
+ *
+ * @param config - Optional `FirebaseServerApp` settings.
+ *
+ * @returns The initialized `FirebaseServerApp`.
+ *
+ * @throws If invoked in an unsupported non-server environment such as a browser.
+ * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't
+ * provide Finalization Registry support.
+ * @throws If the `FIREBASE_OPTIONS` environment variable does not contain a valid project
+ * configuration required for auto-initialization.
+ *
+ * @public
+ */
+declare function initializeServerApp(config?: FirebaseServerAppSettings): FirebaseServerApp;
+/**
+ * Retrieves a {@link @firebase/app#FirebaseApp} instance.
+ *
+ * When called with no arguments, the default app is returned. When an app name
+ * is provided, the app corresponding to that name is returned.
+ *
+ * An exception is thrown if the app being retrieved has not yet been
+ * initialized.
+ *
+ * @example
+ * ```javascript
+ * // Return the default app
+ * const app = getApp();
+ * ```
+ *
+ * @example
+ * ```javascript
+ * // Return a named app
+ * const otherApp = getApp("otherApp");
+ * ```
+ *
+ * @param name - Optional name of the app to return. If no name is
+ * provided, the default is `"[DEFAULT]"`.
+ *
+ * @returns The app corresponding to the provided app name.
+ * If no app name is provided, the default app is returned.
+ *
+ * @public
+ */
+declare function getApp(name?: string): FirebaseApp;
+/**
+ * A (read-only) array of all initialized apps.
+ * @public
+ */
+declare function getApps(): FirebaseApp[];
+/**
+ * Renders this app unusable and frees the resources of all associated
+ * services.
+ *
+ * @example
+ * ```javascript
+ * deleteApp(app)
+ * .then(function() {
+ * console.log("App deleted successfully");
+ * })
+ * .catch(function(error) {
+ * console.log("Error deleting app:", error);
+ * });
+ * ```
+ *
+ * @public
+ */
+declare function deleteApp(app: FirebaseApp): Promise<void>;
+/**
+ * Registers a library's name and version for platform logging purposes.
+ * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)
+ * @param version - Current version of that library.
+ * @param variant - Bundle variant, e.g., node, rn, etc.
+ *
+ * @public
+ */
+declare function registerVersion(libraryKeyOrName: string, version: string, variant?: string): void;
+/**
+ * Sets log handler for all Firebase SDKs.
+ * @param logCallback - An optional custom log handler that executes user code whenever
+ * the Firebase SDK makes a logging call.
+ *
+ * @public
+ */
+declare function onLog(logCallback: LogCallback | null, options?: LogOptions): void;
+/**
+ * Sets log level for all Firebase SDKs.
+ *
+ * All of the log types above the current log level are captured (i.e. if
+ * you set the log level to `info`, errors are logged, but `debug` and
+ * `verbose` logs are not).
+ *
+ * @public
+ */
+declare function setLogLevel(logLevel: LogLevelString): void;
+
+/**
+ * @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.
+ */
+/**
+ * The default app name
+ *
+ * @internal
+ */
+declare const DEFAULT_ENTRY_NAME = "[DEFAULT]";
+
+/**
+ * @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.
+ */
+
+/**
+ * @internal
+ */
+declare const _apps: Map<string, FirebaseApp>;
+/**
+ * @internal
+ */
+declare const _serverApps: Map<string, FirebaseServerApp>;
+/**
+ * Registered components.
+ *
+ * @internal
+ */
+declare const _components: Map<string, Component<any>>;
+/**
+ * @param component - the component being added to this app's container
+ *
+ * @internal
+ */
+declare function _addComponent<T extends Name>(app: FirebaseApp, component: Component<T>): void;
+/**
+ *
+ * @internal
+ */
+declare function _addOrOverwriteComponent(app: FirebaseApp, component: Component): void;
+/**
+ *
+ * @param component - the component to register
+ * @returns whether or not the component is registered successfully
+ *
+ * @internal
+ */
+declare function _registerComponent<T extends Name>(component: Component<T>): boolean;
+/**
+ *
+ * @param app - FirebaseApp instance
+ * @param name - service name
+ *
+ * @returns the provider for the service with the matching name
+ *
+ * @internal
+ */
+declare function _getProvider<T extends Name>(app: FirebaseApp, name: T): Provider<T>;
+/**
+ *
+ * @param app - FirebaseApp instance
+ * @param name - service name
+ * @param instanceIdentifier - service instance identifier in case the service supports multiple instances
+ *
+ * @internal
+ */
+declare function _removeServiceInstance<T extends Name>(app: FirebaseApp, name: T, instanceIdentifier?: string): void;
+/**
+ *
+ * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.
+ *
+ * @returns true if the provide object is of type FirebaseApp.
+ *
+ * @internal
+ */
+declare function _isFirebaseApp(obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings): obj is FirebaseApp;
+/**
+ *
+ * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.
+ *
+ * @returns true if the provided object is of type FirebaseServerAppImpl.
+ *
+ * @internal
+ */
+declare function _isFirebaseServerAppSettings(obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings): obj is FirebaseServerAppSettings;
+/**
+ *
+ * @param obj - an object of type FirebaseApp.
+ *
+ * @returns true if the provided object is of type FirebaseServerAppImpl.
+ *
+ * @internal
+ */
+declare function _isFirebaseServerApp(obj: FirebaseApp | FirebaseServerApp | null | undefined): obj is FirebaseServerApp;
+/**
+ * Test only
+ *
+ * @internal
+ */
+declare function _clearComponents(): void;
+
+export { FirebaseApp, FirebaseAppSettings, FirebaseError, FirebaseOptions, FirebaseServerApp, FirebaseServerAppSettings, SDK_VERSION, DEFAULT_ENTRY_NAME as _DEFAULT_ENTRY_NAME, _FirebaseAppInternal, _FirebaseService, _addComponent, _addOrOverwriteComponent, _apps, _clearComponents, _components, _getProvider, _isFirebaseApp, _isFirebaseServerApp, _isFirebaseServerAppSettings, _registerComponent, _removeServiceInstance, _serverApps, deleteApp, getApp, getApps, initializeApp, initializeServerApp, onLog, registerVersion, setLogLevel };
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/heartbeatService.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/heartbeatService.d.ts
new file mode 100644
index 0000000..31df9a2
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/heartbeatService.d.ts
@@ -0,0 +1,89 @@
+/**
+ * @license
+ * Copyright 2021 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.
+ */
+import { ComponentContainer } from '@firebase/component';
+import { FirebaseApp } from './public-types';
+import { HeartbeatsByUserAgent, HeartbeatService, HeartbeatsInIndexedDB, HeartbeatStorage, SingleDateHeartbeat } from './types';
+export declare const MAX_NUM_STORED_HEARTBEATS = 30;
+export declare class HeartbeatServiceImpl implements HeartbeatService {
+ private readonly container;
+ /**
+ * The persistence layer for heartbeats
+ * Leave public for easier testing.
+ */
+ _storage: HeartbeatStorageImpl;
+ /**
+ * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate
+ * the header string.
+ * Stores one record per date. This will be consolidated into the standard
+ * format of one record per user agent string before being sent as a header.
+ * Populated from indexedDB when the controller is instantiated and should
+ * be kept in sync with indexedDB.
+ * Leave public for easier testing.
+ */
+ _heartbeatsCache: HeartbeatsInIndexedDB | null;
+ /**
+ * the initialization promise for populating heartbeatCache.
+ * If getHeartbeatsHeader() is called before the promise resolves
+ * (heartbeatsCache == null), it should wait for this promise
+ * Leave public for easier testing.
+ */
+ _heartbeatsCachePromise: Promise<HeartbeatsInIndexedDB>;
+ constructor(container: ComponentContainer);
+ /**
+ * Called to report a heartbeat. The function will generate
+ * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it
+ * to IndexedDB.
+ * Note that we only store one heartbeat per day. So if a heartbeat for today is
+ * already logged, subsequent calls to this function in the same day will be ignored.
+ */
+ triggerHeartbeat(): Promise<void>;
+ /**
+ * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.
+ * It also clears all heartbeats from memory as well as in IndexedDB.
+ *
+ * NOTE: Consuming product SDKs should not send the header if this method
+ * returns an empty string.
+ */
+ getHeartbeatsHeader(): Promise<string>;
+}
+export declare function extractHeartbeatsForHeader(heartbeatsCache: SingleDateHeartbeat[], maxSize?: number): {
+ heartbeatsToSend: HeartbeatsByUserAgent[];
+ unsentEntries: SingleDateHeartbeat[];
+};
+export declare class HeartbeatStorageImpl implements HeartbeatStorage {
+ app: FirebaseApp;
+ private _canUseIndexedDBPromise;
+ constructor(app: FirebaseApp);
+ runIndexedDBEnvironmentCheck(): Promise<boolean>;
+ /**
+ * Read all heartbeats.
+ */
+ read(): Promise<HeartbeatsInIndexedDB>;
+ overwrite(heartbeatsObject: HeartbeatsInIndexedDB): Promise<void>;
+ add(heartbeatsObject: HeartbeatsInIndexedDB): Promise<void>;
+}
+/**
+ * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped
+ * in a platform logging header JSON object, stringified, and converted
+ * to base 64.
+ */
+export declare function countBytes(heartbeatsCache: HeartbeatsByUserAgent[]): number;
+/**
+ * Returns the index of the heartbeat with the earliest date.
+ * If the heartbeats array is empty, -1 is returned.
+ */
+export declare function getEarliestHeartbeatIdx(heartbeats: SingleDateHeartbeat[]): number;
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/index.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/index.d.ts
new file mode 100644
index 0000000..d84d443
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/index.d.ts
@@ -0,0 +1,9 @@
+/**
+ * Firebase App
+ *
+ * @remarks This package coordinates the communication between the different Firebase components
+ * @packageDocumentation
+ */
+export * from './api';
+export * from './internal';
+export * from './public-types';
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/indexeddb.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/indexeddb.d.ts
new file mode 100644
index 0000000..d1292fe
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/indexeddb.d.ts
@@ -0,0 +1,20 @@
+/**
+ * @license
+ * Copyright 2021 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.
+ */
+import { FirebaseApp } from './public-types';
+import { HeartbeatsInIndexedDB } from './types';
+export declare function readHeartbeatsFromIndexedDB(app: FirebaseApp): Promise<HeartbeatsInIndexedDB | undefined>;
+export declare function writeHeartbeatsToIndexedDB(app: FirebaseApp, heartbeatObject: HeartbeatsInIndexedDB): Promise<void>;
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/internal.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/internal.d.ts
new file mode 100644
index 0000000..1543059
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/internal.d.ts
@@ -0,0 +1,108 @@
+/**
+ * @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.
+ */
+import { FirebaseApp, FirebaseAppSettings, FirebaseServerAppSettings, FirebaseOptions, FirebaseServerApp } from './public-types';
+import { Component, Provider, Name } from '@firebase/component';
+import { DEFAULT_ENTRY_NAME } from './constants';
+/**
+ * @internal
+ */
+export declare const _apps: Map<string, FirebaseApp>;
+/**
+ * @internal
+ */
+export declare const _serverApps: Map<string, FirebaseServerApp>;
+/**
+ * Registered components.
+ *
+ * @internal
+ */
+export declare const _components: Map<string, Component<any>>;
+/**
+ * @param component - the component being added to this app's container
+ *
+ * @internal
+ */
+export declare function _addComponent<T extends Name>(app: FirebaseApp, component: Component<T>): void;
+/**
+ *
+ * @internal
+ */
+export declare function _addOrOverwriteComponent(app: FirebaseApp, component: Component): void;
+/**
+ *
+ * @param component - the component to register
+ * @returns whether or not the component is registered successfully
+ *
+ * @internal
+ */
+export declare function _registerComponent<T extends Name>(component: Component<T>): boolean;
+/**
+ *
+ * @param app - FirebaseApp instance
+ * @param name - service name
+ *
+ * @returns the provider for the service with the matching name
+ *
+ * @internal
+ */
+export declare function _getProvider<T extends Name>(app: FirebaseApp, name: T): Provider<T>;
+/**
+ *
+ * @param app - FirebaseApp instance
+ * @param name - service name
+ * @param instanceIdentifier - service instance identifier in case the service supports multiple instances
+ *
+ * @internal
+ */
+export declare function _removeServiceInstance<T extends Name>(app: FirebaseApp, name: T, instanceIdentifier?: string): void;
+/**
+ *
+ * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.
+ *
+ * @returns true if the provide object is of type FirebaseApp.
+ *
+ * @internal
+ */
+export declare function _isFirebaseApp(obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings): obj is FirebaseApp;
+/**
+ *
+ * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.
+ *
+ * @returns true if the provided object is of type FirebaseServerAppImpl.
+ *
+ * @internal
+ */
+export declare function _isFirebaseServerAppSettings(obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings): obj is FirebaseServerAppSettings;
+/**
+ *
+ * @param obj - an object of type FirebaseApp.
+ *
+ * @returns true if the provided object is of type FirebaseServerAppImpl.
+ *
+ * @internal
+ */
+export declare function _isFirebaseServerApp(obj: FirebaseApp | FirebaseServerApp | null | undefined): obj is FirebaseServerApp;
+/**
+ * Test only
+ *
+ * @internal
+ */
+export declare function _clearComponents(): void;
+/**
+ * Exported in order to be used in app-compat package
+ */
+export { DEFAULT_ENTRY_NAME as _DEFAULT_ENTRY_NAME };
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/logger.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/logger.d.ts
new file mode 100644
index 0000000..4a4edbd
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/logger.d.ts
@@ -0,0 +1,18 @@
+/**
+ * @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.
+ */
+import { Logger } from '@firebase/logger';
+export declare const logger: Logger;
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/platformLoggerService.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/platformLoggerService.d.ts
new file mode 100644
index 0000000..0f63767
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/platformLoggerService.d.ts
@@ -0,0 +1,23 @@
+/**
+ * @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.
+ */
+import { ComponentContainer } from '@firebase/component';
+import { PlatformLoggerService } from './types';
+export declare class PlatformLoggerServiceImpl implements PlatformLoggerService {
+ private readonly container;
+ constructor(container: ComponentContainer);
+ getPlatformInfoString(): string;
+}
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/public-types.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/public-types.d.ts
new file mode 100644
index 0000000..abead17
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/public-types.d.ts
@@ -0,0 +1,241 @@
+/**
+ * @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.
+ */
+import { ComponentContainer } from '@firebase/component';
+import { PlatformLoggerService, VersionService, HeartbeatService } from './types';
+/**
+ * A {@link @firebase/app#FirebaseApp} holds the initialization information for a collection of
+ * services.
+ *
+ * Do not call this constructor directly. Instead, use
+ * {@link (initializeApp:1) | initializeApp()} to create an app.
+ *
+ * @public
+ */
+export interface FirebaseApp {
+ /**
+ * The (read-only) name for this app.
+ *
+ * The default app's name is `"[DEFAULT]"`.
+ *
+ * @example
+ * ```javascript
+ * // The default app's name is "[DEFAULT]"
+ * const app = initializeApp(defaultAppConfig);
+ * console.log(app.name); // "[DEFAULT]"
+ * ```
+ *
+ * @example
+ * ```javascript
+ * // A named app's name is what you provide to initializeApp()
+ * const otherApp = initializeApp(otherAppConfig, "other");
+ * console.log(otherApp.name); // "other"
+ * ```
+ */
+ readonly name: string;
+ /**
+ * The (read-only) configuration options for this app. These are the original
+ * parameters given in {@link (initializeApp:1) | initializeApp()}.
+ *
+ * @example
+ * ```javascript
+ * const app = initializeApp(config);
+ * console.log(app.options.databaseURL === config.databaseURL); // true
+ * ```
+ */
+ readonly options: FirebaseOptions;
+ /**
+ * The settable config flag for GDPR opt-in/opt-out
+ */
+ automaticDataCollectionEnabled: boolean;
+}
+/**
+ * A {@link @firebase/app#FirebaseServerApp} holds the initialization information
+ * for a collection of services running in server environments.
+ *
+ * Do not call this constructor directly. Instead, use
+ * {@link (initializeServerApp:1) | initializeServerApp()} to create
+ * an app.
+ *
+ * @public
+ */
+export interface FirebaseServerApp extends FirebaseApp {
+ /**
+ * There is no `getApp()` operation for `FirebaseServerApp`, so the name is not relevant for
+ * applications. However, it may be used internally, and is declared here so that
+ * `FirebaseServerApp` conforms to the `FirebaseApp` interface.
+ */
+ name: string;
+ /**
+ * The (read-only) configuration settings for this server app. These are the original
+ * parameters given in {@link (initializeServerApp:1) | initializeServerApp()}.
+ *
+ * @example
+ * ```javascript
+ * const app = initializeServerApp(settings);
+ * console.log(app.settings.authIdToken === options.authIdToken); // true
+ * ```
+ */
+ readonly settings: FirebaseServerAppSettings;
+}
+/**
+ * @public
+ *
+ * Firebase configuration object. Contains a set of parameters required by
+ * services in order to successfully communicate with Firebase server APIs
+ * and to associate client data with your Firebase project and
+ * Firebase application. Typically this object is populated by the Firebase
+ * console at project setup. See also:
+ * {@link https://firebase.google.com/docs/web/setup#config-object | Learn about the Firebase config object}.
+ */
+export interface FirebaseOptions {
+ /**
+ * An encrypted string used when calling certain APIs that don't need to
+ * access private user data
+ * (example value: `AIzaSyDOCAbC123dEf456GhI789jKl012-MnO`).
+ */
+ apiKey?: string;
+ /**
+ * Auth domain for the project ID.
+ */
+ authDomain?: string;
+ /**
+ * Default Realtime Database URL.
+ */
+ databaseURL?: string;
+ /**
+ * The unique identifier for the project across all of Firebase and
+ * Google Cloud.
+ */
+ projectId?: string;
+ /**
+ * The default Cloud Storage bucket name.
+ */
+ storageBucket?: string;
+ /**
+ * Unique numerical value used to identify each sender that can send
+ * Firebase Cloud Messaging messages to client apps.
+ */
+ messagingSenderId?: string;
+ /**
+ * Unique identifier for the app.
+ */
+ appId?: string;
+ /**
+ * An ID automatically created when you enable Analytics in your
+ * Firebase project and register a web app. In versions 7.20.0
+ * and higher, this parameter is optional.
+ */
+ measurementId?: string;
+}
+/**
+ * @public
+ *
+ * Configuration options given to {@link (initializeApp:1) | initializeApp()}
+ */
+export interface FirebaseAppSettings {
+ /**
+ * custom name for the Firebase App.
+ * The default value is `"[DEFAULT]"`.
+ */
+ name?: string;
+ /**
+ * The settable config flag for GDPR opt-in/opt-out. Defaults to true.
+ */
+ automaticDataCollectionEnabled?: boolean;
+}
+/**
+ * @public
+ *
+ * Configuration options given to {@link (initializeServerApp:1) | initializeServerApp()}
+ */
+export interface FirebaseServerAppSettings extends Omit<FirebaseAppSettings, 'name'> {
+ /**
+ * An optional Auth ID token used to resume a signed in user session from a client
+ * runtime environment.
+ *
+ * Invoking `getAuth` with a `FirebaseServerApp` configured with a validated `authIdToken`
+ * causes an automatic attempt to sign in the user that the `authIdToken` represents. The token
+ * needs to have been recently minted for this operation to succeed.
+ *
+ * If the token fails local verification due to expiration or parsing errors, then a console error
+ * is logged at the time of initialization of the `FirebaseServerApp` instance.
+ *
+ * If the Auth service has failed to validate the token when the Auth SDK is initialized, then an
+ * warning is logged to the console and the Auth SDK will not sign in a user on initialization.
+ *
+ * If a user is successfully signed in, then the Auth instance's `onAuthStateChanged` callback
+ * is invoked with the `User` object as per standard Auth flows. However, `User` objects
+ * created via an `authIdToken` do not have a refresh token. Attempted `refreshToken`
+ * operations fail.
+ */
+ authIdToken?: string;
+ /**
+ * An optional App Check token. If provided, the Firebase SDKs that use App Check will utilize
+ * this App Check token in place of requiring an instance of App Check to be initialized.
+ *
+ * If the token fails local verification due to expiration or parsing errors, then a console error
+ * is logged at the time of initialization of the `FirebaseServerApp` instance.
+ */
+ appCheckToken?: string;
+ /**
+ * An optional object. If provided, the Firebase SDK uses a `FinalizationRegistry`
+ * object to monitor the garbage collection status of the provided object. The
+ * Firebase SDK releases its reference on the `FirebaseServerApp` instance when the
+ * provided `releaseOnDeref` object is garbage collected.
+ *
+ * You can use this field to reduce memory management overhead for your application.
+ * If provided, an app running in a SSR pass does not need to perform
+ * `FirebaseServerApp` cleanup, so long as the reference object is deleted (by falling out of
+ * SSR scope, for instance.)
+ *
+ * If an object is not provided then the application must clean up the `FirebaseServerApp`
+ * instance by invoking `deleteApp`.
+ *
+ * If the application provides an object in this parameter, but the application is
+ * executed in a JavaScript engine that predates the support of `FinalizationRegistry`
+ * (introduced in node v14.6.0, for instance), then an error is thrown at `FirebaseServerApp`
+ * initialization.
+ */
+ releaseOnDeref?: object;
+}
+/**
+ * @internal
+ */
+export interface _FirebaseService {
+ app: FirebaseApp;
+ /**
+ * Delete the service and free it's resources - called from
+ * {@link @firebase/app#deleteApp | deleteApp()}
+ */
+ _delete(): Promise<void>;
+}
+/**
+ * @internal
+ */
+export interface _FirebaseAppInternal extends FirebaseApp {
+ container: ComponentContainer;
+ isDeleted: boolean;
+ checkDestroyed(): void;
+}
+declare module '@firebase/component' {
+ interface NameServiceMapping {
+ 'app': FirebaseApp;
+ 'app-version': VersionService;
+ 'heartbeat': HeartbeatService;
+ 'platform-logger': PlatformLoggerService;
+ }
+}
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/registerCoreComponents.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/registerCoreComponents.d.ts
new file mode 100644
index 0000000..45612e1
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/registerCoreComponents.d.ts
@@ -0,0 +1,17 @@
+/**
+ * @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.
+ */
+export declare function registerCoreComponents(variant?: string): void;
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/tsdoc-metadata.json b/frontend-old/node_modules/@firebase/app/dist/app/src/tsdoc-metadata.json
new file mode 100644
index 0000000..6af1f6a
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/tsdoc-metadata.json
@@ -0,0 +1,11 @@
+// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
+// It should be published with your NPM package. It should not be tracked by Git.
+{
+ "tsdocVersion": "0.12",
+ "toolPackages": [
+ {
+ "packageName": "@microsoft/api-extractor",
+ "packageVersion": "0.1.2"
+ }
+ ]
+}
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/src/types.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/src/types.d.ts
new file mode 100644
index 0000000..82bd0e1
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/src/types.d.ts
@@ -0,0 +1,55 @@
+/**
+ * @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.
+ */
+export interface VersionService {
+ library: string;
+ version: string;
+}
+export interface PlatformLoggerService {
+ getPlatformInfoString(): string;
+}
+export interface HeartbeatService {
+ /**
+ * Called to report a heartbeat. The function will generate
+ * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it
+ * to IndexedDB.
+ * Note that we only store one heartbeat per day. So if a heartbeat for today is
+ * already logged, subsequent calls to this function in the same day will be ignored.
+ */
+ triggerHeartbeat(): Promise<void>;
+ /**
+ * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.
+ * It also clears all heartbeats from memory as well as in IndexedDB.
+ */
+ getHeartbeatsHeader(): Promise<string>;
+}
+export interface HeartbeatsByUserAgent {
+ agent: string;
+ dates: string[];
+}
+export interface SingleDateHeartbeat {
+ agent: string;
+ date: string;
+}
+export interface HeartbeatStorage {
+ overwrite(heartbeats: HeartbeatsInIndexedDB): Promise<void>;
+ add(heartbeats: HeartbeatsInIndexedDB): Promise<void>;
+ read(): Promise<HeartbeatsInIndexedDB>;
+}
+export interface HeartbeatsInIndexedDB {
+ lastSentHeartbeatDate?: string;
+ heartbeats: SingleDateHeartbeat[];
+}
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/test/setup.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/test/setup.d.ts
new file mode 100644
index 0000000..1c93d90
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/test/setup.d.ts
@@ -0,0 +1,17 @@
+/**
+ * @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.
+ */
+export {};
diff --git a/frontend-old/node_modules/@firebase/app/dist/app/test/util.d.ts b/frontend-old/node_modules/@firebase/app/dist/app/test/util.d.ts
new file mode 100644
index 0000000..118ecfd
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/app/test/util.d.ts
@@ -0,0 +1,26 @@
+/**
+ * @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.
+ */
+import { FirebaseApp, _FirebaseService } from '../src/public-types';
+import { ComponentType, Component } from '@firebase/component';
+export declare class TestService implements _FirebaseService {
+ private app_;
+ instanceIdentifier?: string | undefined;
+ constructor(app_: FirebaseApp, instanceIdentifier?: string | undefined);
+ get app(): FirebaseApp;
+ _delete(): Promise<void>;
+}
+export declare function createTestComponent(name: string, multiInstances?: boolean, type?: ComponentType): Component;
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/src/api.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/api.d.ts
new file mode 100644
index 0000000..2bfbdd9
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/api.d.ts
@@ -0,0 +1,235 @@
+/**
+ * @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.
+ */
+import { FirebaseApp, FirebaseServerApp, FirebaseOptions, FirebaseAppSettings, FirebaseServerAppSettings } from './public-types';
+import { LogLevelString, LogCallback, LogOptions } from '@firebase/logger';
+export { FirebaseError } from '@firebase/util';
+/**
+ * The current SDK version.
+ *
+ * @public
+ */
+export declare const SDK_VERSION: string;
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseApp} instance.
+ *
+ * See
+ * {@link
+ * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app
+ * | Add Firebase to your app} and
+ * {@link
+ * https://firebase.google.com/docs/web/setup#multiple-projects
+ * | Initialize multiple projects} for detailed documentation.
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize default app
+ * // Retrieve your own options values by adding a web app on
+ * // https://console.firebase.google.com
+ * initializeApp({
+ * apiKey: "AIza....", // Auth / General Use
+ * authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
+ * databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
+ * storageBucket: "YOUR_APP.appspot.com", // Storage
+ * messagingSenderId: "123456789" // Cloud Messaging
+ * });
+ * ```
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize another app
+ * const otherApp = initializeApp({
+ * databaseURL: "https://<OTHER_DATABASE_NAME>.firebaseio.com",
+ * storageBucket: "<OTHER_STORAGE_BUCKET>.appspot.com"
+ * }, "otherApp");
+ * ```
+ *
+ * @param options - Options to configure the app's services.
+ * @param name - Optional name of the app to initialize. If no name
+ * is provided, the default is `"[DEFAULT]"`.
+ *
+ * @returns The initialized app.
+ *
+ * @throws If the optional `name` parameter is malformed or empty.
+ *
+ * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.
+ *
+ * @public
+ */
+export declare function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;
+/**
+ * Creates and initializes a FirebaseApp instance.
+ *
+ * @param options - Options to configure the app's services.
+ * @param config - FirebaseApp Configuration
+ *
+ * @throws If {@link FirebaseAppSettings.name} is defined but the value is malformed or empty.
+ *
+ * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.
+ * @public
+ */
+export declare function initializeApp(options: FirebaseOptions, config?: FirebaseAppSettings): FirebaseApp;
+/**
+ * Creates and initializes a FirebaseApp instance.
+ *
+ * @public
+ */
+export declare function initializeApp(): FirebaseApp;
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.
+ *
+ * The `FirebaseServerApp` is similar to `FirebaseApp`, but is intended for execution in
+ * server side rendering environments only. Initialization will fail if invoked from a
+ * browser environment.
+ *
+ * See
+ * {@link
+ * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app
+ * | Add Firebase to your app} and
+ * {@link
+ * https://firebase.google.com/docs/web/setup#multiple-projects
+ * | Initialize multiple projects} for detailed documentation.
+ *
+ * @example
+ * ```javascript
+ *
+ * // Initialize an instance of `FirebaseServerApp`.
+ * // Retrieve your own options values by adding a web app on
+ * // https://console.firebase.google.com
+ * initializeServerApp({
+ * apiKey: "AIza....", // Auth / General Use
+ * authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
+ * databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
+ * storageBucket: "YOUR_APP.appspot.com", // Storage
+ * messagingSenderId: "123456789" // Cloud Messaging
+ * },
+ * {
+ * authIdToken: "Your Auth ID Token"
+ * });
+ * ```
+ *
+ * @param options - `Firebase.AppOptions` to configure the app's services, or a
+ * a `FirebaseApp` instance which contains the `AppOptions` within.
+ * @param config - Optional `FirebaseServerApp` settings.
+ *
+ * @returns The initialized `FirebaseServerApp`.
+ *
+ * @throws If invoked in an unsupported non-server environment such as a browser.
+ *
+ * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't
+ * provide Finalization Registry support.
+ *
+ * @public
+ */
+export declare function initializeServerApp(options: FirebaseOptions | FirebaseApp, config?: FirebaseServerAppSettings): FirebaseServerApp;
+/**
+ * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.
+ *
+ * @param config - Optional `FirebaseServerApp` settings.
+ *
+ * @returns The initialized `FirebaseServerApp`.
+ *
+ * @throws If invoked in an unsupported non-server environment such as a browser.
+ * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't
+ * provide Finalization Registry support.
+ * @throws If the `FIREBASE_OPTIONS` environment variable does not contain a valid project
+ * configuration required for auto-initialization.
+ *
+ * @public
+ */
+export declare function initializeServerApp(config?: FirebaseServerAppSettings): FirebaseServerApp;
+/**
+ * Retrieves a {@link @firebase/app#FirebaseApp} instance.
+ *
+ * When called with no arguments, the default app is returned. When an app name
+ * is provided, the app corresponding to that name is returned.
+ *
+ * An exception is thrown if the app being retrieved has not yet been
+ * initialized.
+ *
+ * @example
+ * ```javascript
+ * // Return the default app
+ * const app = getApp();
+ * ```
+ *
+ * @example
+ * ```javascript
+ * // Return a named app
+ * const otherApp = getApp("otherApp");
+ * ```
+ *
+ * @param name - Optional name of the app to return. If no name is
+ * provided, the default is `"[DEFAULT]"`.
+ *
+ * @returns The app corresponding to the provided app name.
+ * If no app name is provided, the default app is returned.
+ *
+ * @public
+ */
+export declare function getApp(name?: string): FirebaseApp;
+/**
+ * A (read-only) array of all initialized apps.
+ * @public
+ */
+export declare function getApps(): FirebaseApp[];
+/**
+ * Renders this app unusable and frees the resources of all associated
+ * services.
+ *
+ * @example
+ * ```javascript
+ * deleteApp(app)
+ * .then(function() {
+ * console.log("App deleted successfully");
+ * })
+ * .catch(function(error) {
+ * console.log("Error deleting app:", error);
+ * });
+ * ```
+ *
+ * @public
+ */
+export declare function deleteApp(app: FirebaseApp): Promise<void>;
+/**
+ * Registers a library's name and version for platform logging purposes.
+ * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)
+ * @param version - Current version of that library.
+ * @param variant - Bundle variant, e.g., node, rn, etc.
+ *
+ * @public
+ */
+export declare function registerVersion(libraryKeyOrName: string, version: string, variant?: string): void;
+/**
+ * Sets log handler for all Firebase SDKs.
+ * @param logCallback - An optional custom log handler that executes user code whenever
+ * the Firebase SDK makes a logging call.
+ *
+ * @public
+ */
+export declare function onLog(logCallback: LogCallback | null, options?: LogOptions): void;
+/**
+ * Sets log level for all Firebase SDKs.
+ *
+ * All of the log types above the current log level are captured (i.e. if
+ * you set the log level to `info`, errors are logged, but `debug` and
+ * `verbose` logs are not).
+ *
+ * @public
+ */
+export declare function setLogLevel(logLevel: LogLevelString): void;
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/src/constants.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/constants.d.ts
new file mode 100644
index 0000000..6f340a0
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/constants.d.ts
@@ -0,0 +1,26 @@
+/**
+ * @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.
+ */
+/**
+ * The default app name
+ *
+ * @internal
+ */
+export declare const DEFAULT_ENTRY_NAME = "[DEFAULT]";
+export declare const PLATFORM_LOG_STRING: {
+ readonly [x: string]: "fire-core" | "fire-core-compat" | "fire-analytics" | "fire-analytics-compat" | "fire-app-check" | "fire-app-check-compat" | "fire-auth" | "fire-auth-compat" | "fire-rtdb" | "fire-data-connect" | "fire-rtdb-compat" | "fire-fn" | "fire-fn-compat" | "fire-iid" | "fire-iid-compat" | "fire-fcm" | "fire-fcm-compat" | "fire-perf" | "fire-perf-compat" | "fire-rc" | "fire-rc-compat" | "fire-gcs" | "fire-gcs-compat" | "fire-fst" | "fire-fst-compat" | "fire-vertex" | "fire-js" | "fire-js-all";
+ readonly 'fire-js': "fire-js";
+};
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/src/errors.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/errors.d.ts
new file mode 100644
index 0000000..eb938a2
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/errors.d.ts
@@ -0,0 +1,67 @@
+/**
+ * @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.
+ */
+import { ErrorFactory } from '@firebase/util';
+export declare const enum AppError {
+ NO_APP = "no-app",
+ BAD_APP_NAME = "bad-app-name",
+ DUPLICATE_APP = "duplicate-app",
+ APP_DELETED = "app-deleted",
+ SERVER_APP_DELETED = "server-app-deleted",
+ NO_OPTIONS = "no-options",
+ INVALID_APP_ARGUMENT = "invalid-app-argument",
+ INVALID_LOG_ARGUMENT = "invalid-log-argument",
+ IDB_OPEN = "idb-open",
+ IDB_GET = "idb-get",
+ IDB_WRITE = "idb-set",
+ IDB_DELETE = "idb-delete",
+ FINALIZATION_REGISTRY_NOT_SUPPORTED = "finalization-registry-not-supported",
+ INVALID_SERVER_APP_ENVIRONMENT = "invalid-server-app-environment"
+}
+interface ErrorParams {
+ [AppError.NO_APP]: {
+ appName: string;
+ };
+ [AppError.BAD_APP_NAME]: {
+ appName: string;
+ };
+ [AppError.DUPLICATE_APP]: {
+ appName: string;
+ };
+ [AppError.APP_DELETED]: {
+ appName: string;
+ };
+ [AppError.INVALID_APP_ARGUMENT]: {
+ appName: string;
+ };
+ [AppError.IDB_OPEN]: {
+ originalErrorMessage?: string;
+ };
+ [AppError.IDB_GET]: {
+ originalErrorMessage?: string;
+ };
+ [AppError.IDB_WRITE]: {
+ originalErrorMessage?: string;
+ };
+ [AppError.IDB_DELETE]: {
+ originalErrorMessage?: string;
+ };
+ [AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED]: {
+ appName?: string;
+ };
+}
+export declare const ERROR_FACTORY: ErrorFactory<AppError, ErrorParams>;
+export {};
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/src/firebaseApp.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/firebaseApp.d.ts
new file mode 100644
index 0000000..66643e0
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/firebaseApp.d.ts
@@ -0,0 +1,46 @@
+/**
+ * @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.
+ */
+import { FirebaseApp, FirebaseOptions, FirebaseAppSettings } from './public-types';
+import { ComponentContainer } from '@firebase/component';
+export declare class FirebaseAppImpl implements FirebaseApp {
+ protected readonly _options: FirebaseOptions;
+ protected readonly _name: string;
+ /**
+ * Original config values passed in as a constructor parameter.
+ * It is only used to compare with another config object to support idempotent initializeApp().
+ *
+ * Updating automaticDataCollectionEnabled on the App instance will not change its value in _config.
+ */
+ private readonly _config;
+ private _automaticDataCollectionEnabled;
+ protected _isDeleted: boolean;
+ private readonly _container;
+ constructor(options: FirebaseOptions, config: Required<FirebaseAppSettings>, container: ComponentContainer);
+ get automaticDataCollectionEnabled(): boolean;
+ set automaticDataCollectionEnabled(val: boolean);
+ get name(): string;
+ get options(): FirebaseOptions;
+ get config(): Required<FirebaseAppSettings>;
+ get container(): ComponentContainer;
+ get isDeleted(): boolean;
+ set isDeleted(val: boolean);
+ /**
+ * This function will throw an Error if the App has already been deleted -
+ * use before performing API actions on the App.
+ */
+ protected checkDestroyed(): void;
+}
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/src/firebaseServerApp.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/firebaseServerApp.d.ts
new file mode 100644
index 0000000..7465fa0
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/firebaseServerApp.d.ts
@@ -0,0 +1,36 @@
+/**
+ * @license
+ * Copyright 2023 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.
+ */
+import { FirebaseServerApp, FirebaseServerAppSettings, FirebaseOptions } from './public-types';
+import { ComponentContainer } from '@firebase/component';
+import { FirebaseAppImpl } from './firebaseApp';
+export declare class FirebaseServerAppImpl extends FirebaseAppImpl implements FirebaseServerApp {
+ private readonly _serverConfig;
+ private _finalizationRegistry;
+ private _refCount;
+ constructor(options: FirebaseOptions | FirebaseAppImpl, serverConfig: FirebaseServerAppSettings, name: string, container: ComponentContainer);
+ toJSON(): undefined;
+ get refCount(): number;
+ incRefCount(obj: object | undefined): void;
+ decRefCount(): number;
+ private automaticCleanup;
+ get settings(): FirebaseServerAppSettings;
+ /**
+ * This function will throw an Error if the App has already been deleted -
+ * use before performing API actions on the App.
+ */
+ protected checkDestroyed(): void;
+}
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/src/heartbeatService.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/heartbeatService.d.ts
new file mode 100644
index 0000000..31df9a2
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/heartbeatService.d.ts
@@ -0,0 +1,89 @@
+/**
+ * @license
+ * Copyright 2021 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.
+ */
+import { ComponentContainer } from '@firebase/component';
+import { FirebaseApp } from './public-types';
+import { HeartbeatsByUserAgent, HeartbeatService, HeartbeatsInIndexedDB, HeartbeatStorage, SingleDateHeartbeat } from './types';
+export declare const MAX_NUM_STORED_HEARTBEATS = 30;
+export declare class HeartbeatServiceImpl implements HeartbeatService {
+ private readonly container;
+ /**
+ * The persistence layer for heartbeats
+ * Leave public for easier testing.
+ */
+ _storage: HeartbeatStorageImpl;
+ /**
+ * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate
+ * the header string.
+ * Stores one record per date. This will be consolidated into the standard
+ * format of one record per user agent string before being sent as a header.
+ * Populated from indexedDB when the controller is instantiated and should
+ * be kept in sync with indexedDB.
+ * Leave public for easier testing.
+ */
+ _heartbeatsCache: HeartbeatsInIndexedDB | null;
+ /**
+ * the initialization promise for populating heartbeatCache.
+ * If getHeartbeatsHeader() is called before the promise resolves
+ * (heartbeatsCache == null), it should wait for this promise
+ * Leave public for easier testing.
+ */
+ _heartbeatsCachePromise: Promise<HeartbeatsInIndexedDB>;
+ constructor(container: ComponentContainer);
+ /**
+ * Called to report a heartbeat. The function will generate
+ * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it
+ * to IndexedDB.
+ * Note that we only store one heartbeat per day. So if a heartbeat for today is
+ * already logged, subsequent calls to this function in the same day will be ignored.
+ */
+ triggerHeartbeat(): Promise<void>;
+ /**
+ * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.
+ * It also clears all heartbeats from memory as well as in IndexedDB.
+ *
+ * NOTE: Consuming product SDKs should not send the header if this method
+ * returns an empty string.
+ */
+ getHeartbeatsHeader(): Promise<string>;
+}
+export declare function extractHeartbeatsForHeader(heartbeatsCache: SingleDateHeartbeat[], maxSize?: number): {
+ heartbeatsToSend: HeartbeatsByUserAgent[];
+ unsentEntries: SingleDateHeartbeat[];
+};
+export declare class HeartbeatStorageImpl implements HeartbeatStorage {
+ app: FirebaseApp;
+ private _canUseIndexedDBPromise;
+ constructor(app: FirebaseApp);
+ runIndexedDBEnvironmentCheck(): Promise<boolean>;
+ /**
+ * Read all heartbeats.
+ */
+ read(): Promise<HeartbeatsInIndexedDB>;
+ overwrite(heartbeatsObject: HeartbeatsInIndexedDB): Promise<void>;
+ add(heartbeatsObject: HeartbeatsInIndexedDB): Promise<void>;
+}
+/**
+ * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped
+ * in a platform logging header JSON object, stringified, and converted
+ * to base 64.
+ */
+export declare function countBytes(heartbeatsCache: HeartbeatsByUserAgent[]): number;
+/**
+ * Returns the index of the heartbeat with the earliest date.
+ * If the heartbeats array is empty, -1 is returned.
+ */
+export declare function getEarliestHeartbeatIdx(heartbeats: SingleDateHeartbeat[]): number;
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/src/index.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/index.d.ts
new file mode 100644
index 0000000..d84d443
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/index.d.ts
@@ -0,0 +1,9 @@
+/**
+ * Firebase App
+ *
+ * @remarks This package coordinates the communication between the different Firebase components
+ * @packageDocumentation
+ */
+export * from './api';
+export * from './internal';
+export * from './public-types';
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/src/indexeddb.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/indexeddb.d.ts
new file mode 100644
index 0000000..d1292fe
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/indexeddb.d.ts
@@ -0,0 +1,20 @@
+/**
+ * @license
+ * Copyright 2021 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.
+ */
+import { FirebaseApp } from './public-types';
+import { HeartbeatsInIndexedDB } from './types';
+export declare function readHeartbeatsFromIndexedDB(app: FirebaseApp): Promise<HeartbeatsInIndexedDB | undefined>;
+export declare function writeHeartbeatsToIndexedDB(app: FirebaseApp, heartbeatObject: HeartbeatsInIndexedDB): Promise<void>;
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/src/internal.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/internal.d.ts
new file mode 100644
index 0000000..1543059
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/internal.d.ts
@@ -0,0 +1,108 @@
+/**
+ * @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.
+ */
+import { FirebaseApp, FirebaseAppSettings, FirebaseServerAppSettings, FirebaseOptions, FirebaseServerApp } from './public-types';
+import { Component, Provider, Name } from '@firebase/component';
+import { DEFAULT_ENTRY_NAME } from './constants';
+/**
+ * @internal
+ */
+export declare const _apps: Map<string, FirebaseApp>;
+/**
+ * @internal
+ */
+export declare const _serverApps: Map<string, FirebaseServerApp>;
+/**
+ * Registered components.
+ *
+ * @internal
+ */
+export declare const _components: Map<string, Component<any>>;
+/**
+ * @param component - the component being added to this app's container
+ *
+ * @internal
+ */
+export declare function _addComponent<T extends Name>(app: FirebaseApp, component: Component<T>): void;
+/**
+ *
+ * @internal
+ */
+export declare function _addOrOverwriteComponent(app: FirebaseApp, component: Component): void;
+/**
+ *
+ * @param component - the component to register
+ * @returns whether or not the component is registered successfully
+ *
+ * @internal
+ */
+export declare function _registerComponent<T extends Name>(component: Component<T>): boolean;
+/**
+ *
+ * @param app - FirebaseApp instance
+ * @param name - service name
+ *
+ * @returns the provider for the service with the matching name
+ *
+ * @internal
+ */
+export declare function _getProvider<T extends Name>(app: FirebaseApp, name: T): Provider<T>;
+/**
+ *
+ * @param app - FirebaseApp instance
+ * @param name - service name
+ * @param instanceIdentifier - service instance identifier in case the service supports multiple instances
+ *
+ * @internal
+ */
+export declare function _removeServiceInstance<T extends Name>(app: FirebaseApp, name: T, instanceIdentifier?: string): void;
+/**
+ *
+ * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.
+ *
+ * @returns true if the provide object is of type FirebaseApp.
+ *
+ * @internal
+ */
+export declare function _isFirebaseApp(obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings): obj is FirebaseApp;
+/**
+ *
+ * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.
+ *
+ * @returns true if the provided object is of type FirebaseServerAppImpl.
+ *
+ * @internal
+ */
+export declare function _isFirebaseServerAppSettings(obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings): obj is FirebaseServerAppSettings;
+/**
+ *
+ * @param obj - an object of type FirebaseApp.
+ *
+ * @returns true if the provided object is of type FirebaseServerAppImpl.
+ *
+ * @internal
+ */
+export declare function _isFirebaseServerApp(obj: FirebaseApp | FirebaseServerApp | null | undefined): obj is FirebaseServerApp;
+/**
+ * Test only
+ *
+ * @internal
+ */
+export declare function _clearComponents(): void;
+/**
+ * Exported in order to be used in app-compat package
+ */
+export { DEFAULT_ENTRY_NAME as _DEFAULT_ENTRY_NAME };
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/src/logger.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/logger.d.ts
new file mode 100644
index 0000000..4a4edbd
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/logger.d.ts
@@ -0,0 +1,18 @@
+/**
+ * @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.
+ */
+import { Logger } from '@firebase/logger';
+export declare const logger: Logger;
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/src/platformLoggerService.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/platformLoggerService.d.ts
new file mode 100644
index 0000000..0f63767
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/platformLoggerService.d.ts
@@ -0,0 +1,23 @@
+/**
+ * @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.
+ */
+import { ComponentContainer } from '@firebase/component';
+import { PlatformLoggerService } from './types';
+export declare class PlatformLoggerServiceImpl implements PlatformLoggerService {
+ private readonly container;
+ constructor(container: ComponentContainer);
+ getPlatformInfoString(): string;
+}
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/src/public-types.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/public-types.d.ts
new file mode 100644
index 0000000..abead17
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/public-types.d.ts
@@ -0,0 +1,241 @@
+/**
+ * @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.
+ */
+import { ComponentContainer } from '@firebase/component';
+import { PlatformLoggerService, VersionService, HeartbeatService } from './types';
+/**
+ * A {@link @firebase/app#FirebaseApp} holds the initialization information for a collection of
+ * services.
+ *
+ * Do not call this constructor directly. Instead, use
+ * {@link (initializeApp:1) | initializeApp()} to create an app.
+ *
+ * @public
+ */
+export interface FirebaseApp {
+ /**
+ * The (read-only) name for this app.
+ *
+ * The default app's name is `"[DEFAULT]"`.
+ *
+ * @example
+ * ```javascript
+ * // The default app's name is "[DEFAULT]"
+ * const app = initializeApp(defaultAppConfig);
+ * console.log(app.name); // "[DEFAULT]"
+ * ```
+ *
+ * @example
+ * ```javascript
+ * // A named app's name is what you provide to initializeApp()
+ * const otherApp = initializeApp(otherAppConfig, "other");
+ * console.log(otherApp.name); // "other"
+ * ```
+ */
+ readonly name: string;
+ /**
+ * The (read-only) configuration options for this app. These are the original
+ * parameters given in {@link (initializeApp:1) | initializeApp()}.
+ *
+ * @example
+ * ```javascript
+ * const app = initializeApp(config);
+ * console.log(app.options.databaseURL === config.databaseURL); // true
+ * ```
+ */
+ readonly options: FirebaseOptions;
+ /**
+ * The settable config flag for GDPR opt-in/opt-out
+ */
+ automaticDataCollectionEnabled: boolean;
+}
+/**
+ * A {@link @firebase/app#FirebaseServerApp} holds the initialization information
+ * for a collection of services running in server environments.
+ *
+ * Do not call this constructor directly. Instead, use
+ * {@link (initializeServerApp:1) | initializeServerApp()} to create
+ * an app.
+ *
+ * @public
+ */
+export interface FirebaseServerApp extends FirebaseApp {
+ /**
+ * There is no `getApp()` operation for `FirebaseServerApp`, so the name is not relevant for
+ * applications. However, it may be used internally, and is declared here so that
+ * `FirebaseServerApp` conforms to the `FirebaseApp` interface.
+ */
+ name: string;
+ /**
+ * The (read-only) configuration settings for this server app. These are the original
+ * parameters given in {@link (initializeServerApp:1) | initializeServerApp()}.
+ *
+ * @example
+ * ```javascript
+ * const app = initializeServerApp(settings);
+ * console.log(app.settings.authIdToken === options.authIdToken); // true
+ * ```
+ */
+ readonly settings: FirebaseServerAppSettings;
+}
+/**
+ * @public
+ *
+ * Firebase configuration object. Contains a set of parameters required by
+ * services in order to successfully communicate with Firebase server APIs
+ * and to associate client data with your Firebase project and
+ * Firebase application. Typically this object is populated by the Firebase
+ * console at project setup. See also:
+ * {@link https://firebase.google.com/docs/web/setup#config-object | Learn about the Firebase config object}.
+ */
+export interface FirebaseOptions {
+ /**
+ * An encrypted string used when calling certain APIs that don't need to
+ * access private user data
+ * (example value: `AIzaSyDOCAbC123dEf456GhI789jKl012-MnO`).
+ */
+ apiKey?: string;
+ /**
+ * Auth domain for the project ID.
+ */
+ authDomain?: string;
+ /**
+ * Default Realtime Database URL.
+ */
+ databaseURL?: string;
+ /**
+ * The unique identifier for the project across all of Firebase and
+ * Google Cloud.
+ */
+ projectId?: string;
+ /**
+ * The default Cloud Storage bucket name.
+ */
+ storageBucket?: string;
+ /**
+ * Unique numerical value used to identify each sender that can send
+ * Firebase Cloud Messaging messages to client apps.
+ */
+ messagingSenderId?: string;
+ /**
+ * Unique identifier for the app.
+ */
+ appId?: string;
+ /**
+ * An ID automatically created when you enable Analytics in your
+ * Firebase project and register a web app. In versions 7.20.0
+ * and higher, this parameter is optional.
+ */
+ measurementId?: string;
+}
+/**
+ * @public
+ *
+ * Configuration options given to {@link (initializeApp:1) | initializeApp()}
+ */
+export interface FirebaseAppSettings {
+ /**
+ * custom name for the Firebase App.
+ * The default value is `"[DEFAULT]"`.
+ */
+ name?: string;
+ /**
+ * The settable config flag for GDPR opt-in/opt-out. Defaults to true.
+ */
+ automaticDataCollectionEnabled?: boolean;
+}
+/**
+ * @public
+ *
+ * Configuration options given to {@link (initializeServerApp:1) | initializeServerApp()}
+ */
+export interface FirebaseServerAppSettings extends Omit<FirebaseAppSettings, 'name'> {
+ /**
+ * An optional Auth ID token used to resume a signed in user session from a client
+ * runtime environment.
+ *
+ * Invoking `getAuth` with a `FirebaseServerApp` configured with a validated `authIdToken`
+ * causes an automatic attempt to sign in the user that the `authIdToken` represents. The token
+ * needs to have been recently minted for this operation to succeed.
+ *
+ * If the token fails local verification due to expiration or parsing errors, then a console error
+ * is logged at the time of initialization of the `FirebaseServerApp` instance.
+ *
+ * If the Auth service has failed to validate the token when the Auth SDK is initialized, then an
+ * warning is logged to the console and the Auth SDK will not sign in a user on initialization.
+ *
+ * If a user is successfully signed in, then the Auth instance's `onAuthStateChanged` callback
+ * is invoked with the `User` object as per standard Auth flows. However, `User` objects
+ * created via an `authIdToken` do not have a refresh token. Attempted `refreshToken`
+ * operations fail.
+ */
+ authIdToken?: string;
+ /**
+ * An optional App Check token. If provided, the Firebase SDKs that use App Check will utilize
+ * this App Check token in place of requiring an instance of App Check to be initialized.
+ *
+ * If the token fails local verification due to expiration or parsing errors, then a console error
+ * is logged at the time of initialization of the `FirebaseServerApp` instance.
+ */
+ appCheckToken?: string;
+ /**
+ * An optional object. If provided, the Firebase SDK uses a `FinalizationRegistry`
+ * object to monitor the garbage collection status of the provided object. The
+ * Firebase SDK releases its reference on the `FirebaseServerApp` instance when the
+ * provided `releaseOnDeref` object is garbage collected.
+ *
+ * You can use this field to reduce memory management overhead for your application.
+ * If provided, an app running in a SSR pass does not need to perform
+ * `FirebaseServerApp` cleanup, so long as the reference object is deleted (by falling out of
+ * SSR scope, for instance.)
+ *
+ * If an object is not provided then the application must clean up the `FirebaseServerApp`
+ * instance by invoking `deleteApp`.
+ *
+ * If the application provides an object in this parameter, but the application is
+ * executed in a JavaScript engine that predates the support of `FinalizationRegistry`
+ * (introduced in node v14.6.0, for instance), then an error is thrown at `FirebaseServerApp`
+ * initialization.
+ */
+ releaseOnDeref?: object;
+}
+/**
+ * @internal
+ */
+export interface _FirebaseService {
+ app: FirebaseApp;
+ /**
+ * Delete the service and free it's resources - called from
+ * {@link @firebase/app#deleteApp | deleteApp()}
+ */
+ _delete(): Promise<void>;
+}
+/**
+ * @internal
+ */
+export interface _FirebaseAppInternal extends FirebaseApp {
+ container: ComponentContainer;
+ isDeleted: boolean;
+ checkDestroyed(): void;
+}
+declare module '@firebase/component' {
+ interface NameServiceMapping {
+ 'app': FirebaseApp;
+ 'app-version': VersionService;
+ 'heartbeat': HeartbeatService;
+ 'platform-logger': PlatformLoggerService;
+ }
+}
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/src/registerCoreComponents.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/registerCoreComponents.d.ts
new file mode 100644
index 0000000..45612e1
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/registerCoreComponents.d.ts
@@ -0,0 +1,17 @@
+/**
+ * @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.
+ */
+export declare function registerCoreComponents(variant?: string): void;
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/src/types.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/types.d.ts
new file mode 100644
index 0000000..82bd0e1
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/src/types.d.ts
@@ -0,0 +1,55 @@
+/**
+ * @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.
+ */
+export interface VersionService {
+ library: string;
+ version: string;
+}
+export interface PlatformLoggerService {
+ getPlatformInfoString(): string;
+}
+export interface HeartbeatService {
+ /**
+ * Called to report a heartbeat. The function will generate
+ * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it
+ * to IndexedDB.
+ * Note that we only store one heartbeat per day. So if a heartbeat for today is
+ * already logged, subsequent calls to this function in the same day will be ignored.
+ */
+ triggerHeartbeat(): Promise<void>;
+ /**
+ * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.
+ * It also clears all heartbeats from memory as well as in IndexedDB.
+ */
+ getHeartbeatsHeader(): Promise<string>;
+}
+export interface HeartbeatsByUserAgent {
+ agent: string;
+ dates: string[];
+}
+export interface SingleDateHeartbeat {
+ agent: string;
+ date: string;
+}
+export interface HeartbeatStorage {
+ overwrite(heartbeats: HeartbeatsInIndexedDB): Promise<void>;
+ add(heartbeats: HeartbeatsInIndexedDB): Promise<void>;
+ read(): Promise<HeartbeatsInIndexedDB>;
+}
+export interface HeartbeatsInIndexedDB {
+ lastSentHeartbeatDate?: string;
+ heartbeats: SingleDateHeartbeat[];
+}
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/test/setup.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/test/setup.d.ts
new file mode 100644
index 0000000..1c93d90
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/test/setup.d.ts
@@ -0,0 +1,17 @@
+/**
+ * @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.
+ */
+export {};
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/app/test/util.d.ts b/frontend-old/node_modules/@firebase/app/dist/esm/app/test/util.d.ts
new file mode 100644
index 0000000..118ecfd
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/app/test/util.d.ts
@@ -0,0 +1,26 @@
+/**
+ * @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.
+ */
+import { FirebaseApp, _FirebaseService } from '../src/public-types';
+import { ComponentType, Component } from '@firebase/component';
+export declare class TestService implements _FirebaseService {
+ private app_;
+ instanceIdentifier?: string | undefined;
+ constructor(app_: FirebaseApp, instanceIdentifier?: string | undefined);
+ get app(): FirebaseApp;
+ _delete(): Promise<void>;
+}
+export declare function createTestComponent(name: string, multiInstances?: boolean, type?: ComponentType): Component;
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/index.esm.js b/frontend-old/node_modules/@firebase/app/dist/esm/index.esm.js
new file mode 100644
index 0000000..9d86b18
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/index.esm.js
@@ -0,0 +1,1237 @@
+import { Component, ComponentContainer } from '@firebase/component';
+import { Logger, setUserLogHandler, setLogLevel as setLogLevel$1 } from '@firebase/logger';
+import { ErrorFactory, base64Decode, getDefaultAppConfig, deepEqual, isBrowser, isWebWorker, FirebaseError, base64urlEncodeWithoutPadding, isIndexedDBAvailable, validateIndexedDBOpenable } from '@firebase/util';
+export { FirebaseError } from '@firebase/util';
+import { openDB } from 'idb';
+
+/**
+ * @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.
+ */
+class PlatformLoggerServiceImpl {
+ constructor(container) {
+ this.container = container;
+ }
+ // In initial implementation, this will be called by installations on
+ // auth token refresh, and installations will send this string.
+ getPlatformInfoString() {
+ const providers = this.container.getProviders();
+ // Loop through providers and get library/version pairs from any that are
+ // version components.
+ return providers
+ .map(provider => {
+ if (isVersionServiceProvider(provider)) {
+ const service = provider.getImmediate();
+ return `${service.library}/${service.version}`;
+ }
+ else {
+ return null;
+ }
+ })
+ .filter(logString => logString)
+ .join(' ');
+ }
+}
+/**
+ *
+ * @param provider check if this provider provides a VersionService
+ *
+ * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
+ * provides VersionService. The provider is not necessarily a 'app-version'
+ * provider.
+ */
+function isVersionServiceProvider(provider) {
+ const component = provider.getComponent();
+ return component?.type === "VERSION" /* ComponentType.VERSION */;
+}
+
+const name$q = "@firebase/app";
+const version$1 = "0.14.5";
+
+/**
+ * @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.
+ */
+const logger = new Logger('@firebase/app');
+
+const name$p = "@firebase/app-compat";
+
+const name$o = "@firebase/analytics-compat";
+
+const name$n = "@firebase/analytics";
+
+const name$m = "@firebase/app-check-compat";
+
+const name$l = "@firebase/app-check";
+
+const name$k = "@firebase/auth";
+
+const name$j = "@firebase/auth-compat";
+
+const name$i = "@firebase/database";
+
+const name$h = "@firebase/data-connect";
+
+const name$g = "@firebase/database-compat";
+
+const name$f = "@firebase/functions";
+
+const name$e = "@firebase/functions-compat";
+
+const name$d = "@firebase/installations";
+
+const name$c = "@firebase/installations-compat";
+
+const name$b = "@firebase/messaging";
+
+const name$a = "@firebase/messaging-compat";
+
+const name$9 = "@firebase/performance";
+
+const name$8 = "@firebase/performance-compat";
+
+const name$7 = "@firebase/remote-config";
+
+const name$6 = "@firebase/remote-config-compat";
+
+const name$5 = "@firebase/storage";
+
+const name$4 = "@firebase/storage-compat";
+
+const name$3 = "@firebase/firestore";
+
+const name$2 = "@firebase/ai";
+
+const name$1 = "@firebase/firestore-compat";
+
+const name = "firebase";
+const version = "12.5.0";
+
+/**
+ * @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.
+ */
+/**
+ * The default app name
+ *
+ * @internal
+ */
+const DEFAULT_ENTRY_NAME = '[DEFAULT]';
+const PLATFORM_LOG_STRING = {
+ [name$q]: 'fire-core',
+ [name$p]: 'fire-core-compat',
+ [name$n]: 'fire-analytics',
+ [name$o]: 'fire-analytics-compat',
+ [name$l]: 'fire-app-check',
+ [name$m]: 'fire-app-check-compat',
+ [name$k]: 'fire-auth',
+ [name$j]: 'fire-auth-compat',
+ [name$i]: 'fire-rtdb',
+ [name$h]: 'fire-data-connect',
+ [name$g]: 'fire-rtdb-compat',
+ [name$f]: 'fire-fn',
+ [name$e]: 'fire-fn-compat',
+ [name$d]: 'fire-iid',
+ [name$c]: 'fire-iid-compat',
+ [name$b]: 'fire-fcm',
+ [name$a]: 'fire-fcm-compat',
+ [name$9]: 'fire-perf',
+ [name$8]: 'fire-perf-compat',
+ [name$7]: 'fire-rc',
+ [name$6]: 'fire-rc-compat',
+ [name$5]: 'fire-gcs',
+ [name$4]: 'fire-gcs-compat',
+ [name$3]: 'fire-fst',
+ [name$1]: 'fire-fst-compat',
+ [name$2]: 'fire-vertex',
+ 'fire-js': 'fire-js', // Platform identifier for JS SDK.
+ [name]: 'fire-js-all'
+};
+
+/**
+ * @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.
+ */
+/**
+ * @internal
+ */
+const _apps = new Map();
+/**
+ * @internal
+ */
+const _serverApps = new Map();
+/**
+ * Registered components.
+ *
+ * @internal
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+const _components = new Map();
+/**
+ * @param component - the component being added to this app's container
+ *
+ * @internal
+ */
+function _addComponent(app, component) {
+ try {
+ app.container.addComponent(component);
+ }
+ catch (e) {
+ logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);
+ }
+}
+/**
+ *
+ * @internal
+ */
+function _addOrOverwriteComponent(app, component) {
+ app.container.addOrOverwriteComponent(component);
+}
+/**
+ *
+ * @param component - the component to register
+ * @returns whether or not the component is registered successfully
+ *
+ * @internal
+ */
+function _registerComponent(component) {
+ const componentName = component.name;
+ if (_components.has(componentName)) {
+ logger.debug(`There were multiple attempts to register component ${componentName}.`);
+ return false;
+ }
+ _components.set(componentName, component);
+ // add the component to existing app instances
+ for (const app of _apps.values()) {
+ _addComponent(app, component);
+ }
+ for (const serverApp of _serverApps.values()) {
+ _addComponent(serverApp, component);
+ }
+ return true;
+}
+/**
+ *
+ * @param app - FirebaseApp instance
+ * @param name - service name
+ *
+ * @returns the provider for the service with the matching name
+ *
+ * @internal
+ */
+function _getProvider(app, name) {
+ const heartbeatController = app.container
+ .getProvider('heartbeat')
+ .getImmediate({ optional: true });
+ if (heartbeatController) {
+ void heartbeatController.triggerHeartbeat();
+ }
+ return app.container.getProvider(name);
+}
+/**
+ *
+ * @param app - FirebaseApp instance
+ * @param name - service name
+ * @param instanceIdentifier - service instance identifier in case the service supports multiple instances
+ *
+ * @internal
+ */
+function _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {
+ _getProvider(app, name).clearInstance(instanceIdentifier);
+}
+/**
+ *
+ * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.
+ *
+ * @returns true if the provide object is of type FirebaseApp.
+ *
+ * @internal
+ */
+function _isFirebaseApp(obj) {
+ return obj.options !== undefined;
+}
+/**
+ *
+ * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.
+ *
+ * @returns true if the provided object is of type FirebaseServerAppImpl.
+ *
+ * @internal
+ */
+function _isFirebaseServerAppSettings(obj) {
+ if (_isFirebaseApp(obj)) {
+ return false;
+ }
+ return ('authIdToken' in obj ||
+ 'appCheckToken' in obj ||
+ 'releaseOnDeref' in obj ||
+ 'automaticDataCollectionEnabled' in obj);
+}
+/**
+ *
+ * @param obj - an object of type FirebaseApp.
+ *
+ * @returns true if the provided object is of type FirebaseServerAppImpl.
+ *
+ * @internal
+ */
+function _isFirebaseServerApp(obj) {
+ if (obj === null || obj === undefined) {
+ return false;
+ }
+ return obj.settings !== undefined;
+}
+/**
+ * Test only
+ *
+ * @internal
+ */
+function _clearComponents() {
+ _components.clear();
+}
+
+/**
+ * @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.
+ */
+const ERRORS = {
+ ["no-app" /* AppError.NO_APP */]: "No Firebase App '{$appName}' has been created - " +
+ 'call initializeApp() first',
+ ["bad-app-name" /* AppError.BAD_APP_NAME */]: "Illegal App name: '{$appName}'",
+ ["duplicate-app" /* AppError.DUPLICATE_APP */]: "Firebase App named '{$appName}' already exists with different options or config",
+ ["app-deleted" /* AppError.APP_DELETED */]: "Firebase App named '{$appName}' already deleted",
+ ["server-app-deleted" /* AppError.SERVER_APP_DELETED */]: 'Firebase Server App has been deleted',
+ ["no-options" /* AppError.NO_OPTIONS */]: 'Need to provide options, when not being deployed to hosting via source.',
+ ["invalid-app-argument" /* AppError.INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +
+ 'Firebase App instance.',
+ ["invalid-log-argument" /* AppError.INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',
+ ["idb-open" /* AppError.IDB_OPEN */]: 'Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.',
+ ["idb-get" /* AppError.IDB_GET */]: 'Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.',
+ ["idb-set" /* AppError.IDB_WRITE */]: 'Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.',
+ ["idb-delete" /* AppError.IDB_DELETE */]: 'Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.',
+ ["finalization-registry-not-supported" /* AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED */]: 'FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.',
+ ["invalid-server-app-environment" /* AppError.INVALID_SERVER_APP_ENVIRONMENT */]: 'FirebaseServerApp is not for use in browser environments.'
+};
+const ERROR_FACTORY = new ErrorFactory('app', 'Firebase', ERRORS);
+
+/**
+ * @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.
+ */
+class FirebaseAppImpl {
+ constructor(options, config, container) {
+ this._isDeleted = false;
+ this._options = { ...options };
+ this._config = { ...config };
+ this._name = config.name;
+ this._automaticDataCollectionEnabled =
+ config.automaticDataCollectionEnabled;
+ this._container = container;
+ this.container.addComponent(new Component('app', () => this, "PUBLIC" /* ComponentType.PUBLIC */));
+ }
+ get automaticDataCollectionEnabled() {
+ this.checkDestroyed();
+ return this._automaticDataCollectionEnabled;
+ }
+ set automaticDataCollectionEnabled(val) {
+ this.checkDestroyed();
+ this._automaticDataCollectionEnabled = val;
+ }
+ get name() {
+ this.checkDestroyed();
+ return this._name;
+ }
+ get options() {
+ this.checkDestroyed();
+ return this._options;
+ }
+ get config() {
+ this.checkDestroyed();
+ return this._config;
+ }
+ get container() {
+ return this._container;
+ }
+ get isDeleted() {
+ return this._isDeleted;
+ }
+ set isDeleted(val) {
+ this._isDeleted = val;
+ }
+ /**
+ * This function will throw an Error if the App has already been deleted -
+ * use before performing API actions on the App.
+ */
+ checkDestroyed() {
+ if (this.isDeleted) {
+ throw ERROR_FACTORY.create("app-deleted" /* AppError.APP_DELETED */, { appName: this._name });
+ }
+ }
+}
+
+/**
+ * @license
+ * Copyright 2023 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.
+ */
+// Parse the token and check to see if the `exp` claim is in the future.
+// Reports an error to the console if the token or claim could not be parsed, or if `exp` is in
+// the past.
+function validateTokenTTL(base64Token, tokenName) {
+ const secondPart = base64Decode(base64Token.split('.')[1]);
+ if (secondPart === null) {
+ console.error(`FirebaseServerApp ${tokenName} is invalid: second part could not be parsed.`);
+ return;
+ }
+ const expClaim = JSON.parse(secondPart).exp;
+ if (expClaim === undefined) {
+ console.error(`FirebaseServerApp ${tokenName} is invalid: expiration claim could not be parsed`);
+ return;
+ }
+ const exp = JSON.parse(secondPart).exp * 1000;
+ const now = new Date().getTime();
+ const diff = exp - now;
+ if (diff <= 0) {
+ console.error(`FirebaseServerApp ${tokenName} is invalid: the token has expired.`);
+ }
+}
+class FirebaseServerAppImpl extends FirebaseAppImpl {
+ constructor(options, serverConfig, name, container) {
+ // Build configuration parameters for the FirebaseAppImpl base class.
+ const automaticDataCollectionEnabled = serverConfig.automaticDataCollectionEnabled !== undefined
+ ? serverConfig.automaticDataCollectionEnabled
+ : true;
+ // Create the FirebaseAppSettings object for the FirebaseAppImp constructor.
+ const config = {
+ name,
+ automaticDataCollectionEnabled
+ };
+ if (options.apiKey !== undefined) {
+ // Construct the parent FirebaseAppImp object.
+ super(options, config, container);
+ }
+ else {
+ const appImpl = options;
+ super(appImpl.options, config, container);
+ }
+ // Now construct the data for the FirebaseServerAppImpl.
+ this._serverConfig = {
+ automaticDataCollectionEnabled,
+ ...serverConfig
+ };
+ // Ensure that the current time is within the `authIdtoken` window of validity.
+ if (this._serverConfig.authIdToken) {
+ validateTokenTTL(this._serverConfig.authIdToken, 'authIdToken');
+ }
+ // Ensure that the current time is within the `appCheckToken` window of validity.
+ if (this._serverConfig.appCheckToken) {
+ validateTokenTTL(this._serverConfig.appCheckToken, 'appCheckToken');
+ }
+ this._finalizationRegistry = null;
+ if (typeof FinalizationRegistry !== 'undefined') {
+ this._finalizationRegistry = new FinalizationRegistry(() => {
+ this.automaticCleanup();
+ });
+ }
+ this._refCount = 0;
+ this.incRefCount(this._serverConfig.releaseOnDeref);
+ // Do not retain a hard reference to the dref object, otherwise the FinalizationRegistry
+ // will never trigger.
+ this._serverConfig.releaseOnDeref = undefined;
+ serverConfig.releaseOnDeref = undefined;
+ registerVersion(name$q, version$1, 'serverapp');
+ }
+ toJSON() {
+ return undefined;
+ }
+ get refCount() {
+ return this._refCount;
+ }
+ // Increment the reference count of this server app. If an object is provided, register it
+ // with the finalization registry.
+ incRefCount(obj) {
+ if (this.isDeleted) {
+ return;
+ }
+ this._refCount++;
+ if (obj !== undefined && this._finalizationRegistry !== null) {
+ this._finalizationRegistry.register(obj, this);
+ }
+ }
+ // Decrement the reference count.
+ decRefCount() {
+ if (this.isDeleted) {
+ return 0;
+ }
+ return --this._refCount;
+ }
+ // Invoked by the FinalizationRegistry callback to note that this app should go through its
+ // reference counts and delete itself if no reference count remain. The coordinating logic that
+ // handles this is in deleteApp(...).
+ automaticCleanup() {
+ void deleteApp(this);
+ }
+ get settings() {
+ this.checkDestroyed();
+ return this._serverConfig;
+ }
+ /**
+ * This function will throw an Error if the App has already been deleted -
+ * use before performing API actions on the App.
+ */
+ checkDestroyed() {
+ if (this.isDeleted) {
+ throw ERROR_FACTORY.create("server-app-deleted" /* AppError.SERVER_APP_DELETED */);
+ }
+ }
+}
+
+/**
+ * @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.
+ */
+/**
+ * The current SDK version.
+ *
+ * @public
+ */
+const SDK_VERSION = version;
+function initializeApp(_options, rawConfig = {}) {
+ let options = _options;
+ if (typeof rawConfig !== 'object') {
+ const name = rawConfig;
+ rawConfig = { name };
+ }
+ const config = {
+ name: DEFAULT_ENTRY_NAME,
+ automaticDataCollectionEnabled: true,
+ ...rawConfig
+ };
+ const name = config.name;
+ if (typeof name !== 'string' || !name) {
+ throw ERROR_FACTORY.create("bad-app-name" /* AppError.BAD_APP_NAME */, {
+ appName: String(name)
+ });
+ }
+ options || (options = getDefaultAppConfig());
+ if (!options) {
+ throw ERROR_FACTORY.create("no-options" /* AppError.NO_OPTIONS */);
+ }
+ const existingApp = _apps.get(name);
+ if (existingApp) {
+ // return the existing app if options and config deep equal the ones in the existing app.
+ if (deepEqual(options, existingApp.options) &&
+ deepEqual(config, existingApp.config)) {
+ return existingApp;
+ }
+ else {
+ throw ERROR_FACTORY.create("duplicate-app" /* AppError.DUPLICATE_APP */, { appName: name });
+ }
+ }
+ const container = new ComponentContainer(name);
+ for (const component of _components.values()) {
+ container.addComponent(component);
+ }
+ const newApp = new FirebaseAppImpl(options, config, container);
+ _apps.set(name, newApp);
+ return newApp;
+}
+function initializeServerApp(_options, _serverAppConfig = {}) {
+ if (isBrowser() && !isWebWorker()) {
+ // FirebaseServerApp isn't designed to be run in browsers.
+ throw ERROR_FACTORY.create("invalid-server-app-environment" /* AppError.INVALID_SERVER_APP_ENVIRONMENT */);
+ }
+ let firebaseOptions;
+ let serverAppSettings = _serverAppConfig || {};
+ if (_options) {
+ if (_isFirebaseApp(_options)) {
+ firebaseOptions = _options.options;
+ }
+ else if (_isFirebaseServerAppSettings(_options)) {
+ serverAppSettings = _options;
+ }
+ else {
+ firebaseOptions = _options;
+ }
+ }
+ if (serverAppSettings.automaticDataCollectionEnabled === undefined) {
+ serverAppSettings.automaticDataCollectionEnabled = true;
+ }
+ firebaseOptions || (firebaseOptions = getDefaultAppConfig());
+ if (!firebaseOptions) {
+ throw ERROR_FACTORY.create("no-options" /* AppError.NO_OPTIONS */);
+ }
+ // Build an app name based on a hash of the configuration options.
+ const nameObj = {
+ ...serverAppSettings,
+ ...firebaseOptions
+ };
+ // However, Do not mangle the name based on releaseOnDeref, since it will vary between the
+ // construction of FirebaseServerApp instances. For example, if the object is the request headers.
+ if (nameObj.releaseOnDeref !== undefined) {
+ delete nameObj.releaseOnDeref;
+ }
+ const hashCode = (s) => {
+ return [...s].reduce((hash, c) => (Math.imul(31, hash) + c.charCodeAt(0)) | 0, 0);
+ };
+ if (serverAppSettings.releaseOnDeref !== undefined) {
+ if (typeof FinalizationRegistry === 'undefined') {
+ throw ERROR_FACTORY.create("finalization-registry-not-supported" /* AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED */, {});
+ }
+ }
+ const nameString = '' + hashCode(JSON.stringify(nameObj));
+ const existingApp = _serverApps.get(nameString);
+ if (existingApp) {
+ existingApp.incRefCount(serverAppSettings.releaseOnDeref);
+ return existingApp;
+ }
+ const container = new ComponentContainer(nameString);
+ for (const component of _components.values()) {
+ container.addComponent(component);
+ }
+ const newApp = new FirebaseServerAppImpl(firebaseOptions, serverAppSettings, nameString, container);
+ _serverApps.set(nameString, newApp);
+ return newApp;
+}
+/**
+ * Retrieves a {@link @firebase/app#FirebaseApp} instance.
+ *
+ * When called with no arguments, the default app is returned. When an app name
+ * is provided, the app corresponding to that name is returned.
+ *
+ * An exception is thrown if the app being retrieved has not yet been
+ * initialized.
+ *
+ * @example
+ * ```javascript
+ * // Return the default app
+ * const app = getApp();
+ * ```
+ *
+ * @example
+ * ```javascript
+ * // Return a named app
+ * const otherApp = getApp("otherApp");
+ * ```
+ *
+ * @param name - Optional name of the app to return. If no name is
+ * provided, the default is `"[DEFAULT]"`.
+ *
+ * @returns The app corresponding to the provided app name.
+ * If no app name is provided, the default app is returned.
+ *
+ * @public
+ */
+function getApp(name = DEFAULT_ENTRY_NAME) {
+ const app = _apps.get(name);
+ if (!app && name === DEFAULT_ENTRY_NAME && getDefaultAppConfig()) {
+ return initializeApp();
+ }
+ if (!app) {
+ throw ERROR_FACTORY.create("no-app" /* AppError.NO_APP */, { appName: name });
+ }
+ return app;
+}
+/**
+ * A (read-only) array of all initialized apps.
+ * @public
+ */
+function getApps() {
+ return Array.from(_apps.values());
+}
+/**
+ * Renders this app unusable and frees the resources of all associated
+ * services.
+ *
+ * @example
+ * ```javascript
+ * deleteApp(app)
+ * .then(function() {
+ * console.log("App deleted successfully");
+ * })
+ * .catch(function(error) {
+ * console.log("Error deleting app:", error);
+ * });
+ * ```
+ *
+ * @public
+ */
+async function deleteApp(app) {
+ let cleanupProviders = false;
+ const name = app.name;
+ if (_apps.has(name)) {
+ cleanupProviders = true;
+ _apps.delete(name);
+ }
+ else if (_serverApps.has(name)) {
+ const firebaseServerApp = app;
+ if (firebaseServerApp.decRefCount() <= 0) {
+ _serverApps.delete(name);
+ cleanupProviders = true;
+ }
+ }
+ if (cleanupProviders) {
+ await Promise.all(app.container
+ .getProviders()
+ .map(provider => provider.delete()));
+ app.isDeleted = true;
+ }
+}
+/**
+ * Registers a library's name and version for platform logging purposes.
+ * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)
+ * @param version - Current version of that library.
+ * @param variant - Bundle variant, e.g., node, rn, etc.
+ *
+ * @public
+ */
+function registerVersion(libraryKeyOrName, version, variant) {
+ // TODO: We can use this check to whitelist strings when/if we set up
+ // a good whitelist system.
+ let library = PLATFORM_LOG_STRING[libraryKeyOrName] ?? libraryKeyOrName;
+ if (variant) {
+ library += `-${variant}`;
+ }
+ const libraryMismatch = library.match(/\s|\//);
+ const versionMismatch = version.match(/\s|\//);
+ if (libraryMismatch || versionMismatch) {
+ const warning = [
+ `Unable to register library "${library}" with version "${version}":`
+ ];
+ if (libraryMismatch) {
+ warning.push(`library name "${library}" contains illegal characters (whitespace or "/")`);
+ }
+ if (libraryMismatch && versionMismatch) {
+ warning.push('and');
+ }
+ if (versionMismatch) {
+ warning.push(`version name "${version}" contains illegal characters (whitespace or "/")`);
+ }
+ logger.warn(warning.join(' '));
+ return;
+ }
+ _registerComponent(new Component(`${library}-version`, () => ({ library, version }), "VERSION" /* ComponentType.VERSION */));
+}
+/**
+ * Sets log handler for all Firebase SDKs.
+ * @param logCallback - An optional custom log handler that executes user code whenever
+ * the Firebase SDK makes a logging call.
+ *
+ * @public
+ */
+function onLog(logCallback, options) {
+ if (logCallback !== null && typeof logCallback !== 'function') {
+ throw ERROR_FACTORY.create("invalid-log-argument" /* AppError.INVALID_LOG_ARGUMENT */);
+ }
+ setUserLogHandler(logCallback, options);
+}
+/**
+ * Sets log level for all Firebase SDKs.
+ *
+ * All of the log types above the current log level are captured (i.e. if
+ * you set the log level to `info`, errors are logged, but `debug` and
+ * `verbose` logs are not).
+ *
+ * @public
+ */
+function setLogLevel(logLevel) {
+ setLogLevel$1(logLevel);
+}
+
+/**
+ * @license
+ * Copyright 2021 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.
+ */
+const DB_NAME = 'firebase-heartbeat-database';
+const DB_VERSION = 1;
+const STORE_NAME = 'firebase-heartbeat-store';
+let dbPromise = null;
+function getDbPromise() {
+ if (!dbPromise) {
+ dbPromise = openDB(DB_NAME, DB_VERSION, {
+ upgrade: (db, oldVersion) => {
+ // We don't use 'break' in this switch statement, the fall-through
+ // behavior is what we want, because if there are multiple versions between
+ // the old version and the current version, we want ALL the migrations
+ // that correspond to those versions to run, not only the last one.
+ // eslint-disable-next-line default-case
+ switch (oldVersion) {
+ case 0:
+ try {
+ db.createObjectStore(STORE_NAME);
+ }
+ catch (e) {
+ // Safari/iOS browsers throw occasional exceptions on
+ // db.createObjectStore() that may be a bug. Avoid blocking
+ // the rest of the app functionality.
+ console.warn(e);
+ }
+ }
+ }
+ }).catch(e => {
+ throw ERROR_FACTORY.create("idb-open" /* AppError.IDB_OPEN */, {
+ originalErrorMessage: e.message
+ });
+ });
+ }
+ return dbPromise;
+}
+async function readHeartbeatsFromIndexedDB(app) {
+ try {
+ const db = await getDbPromise();
+ const tx = db.transaction(STORE_NAME);
+ const result = await tx.objectStore(STORE_NAME).get(computeKey(app));
+ // We already have the value but tx.done can throw,
+ // so we need to await it here to catch errors
+ await tx.done;
+ return result;
+ }
+ catch (e) {
+ if (e instanceof FirebaseError) {
+ logger.warn(e.message);
+ }
+ else {
+ const idbGetError = ERROR_FACTORY.create("idb-get" /* AppError.IDB_GET */, {
+ originalErrorMessage: e?.message
+ });
+ logger.warn(idbGetError.message);
+ }
+ }
+}
+async function writeHeartbeatsToIndexedDB(app, heartbeatObject) {
+ try {
+ const db = await getDbPromise();
+ const tx = db.transaction(STORE_NAME, 'readwrite');
+ const objectStore = tx.objectStore(STORE_NAME);
+ await objectStore.put(heartbeatObject, computeKey(app));
+ await tx.done;
+ }
+ catch (e) {
+ if (e instanceof FirebaseError) {
+ logger.warn(e.message);
+ }
+ else {
+ const idbGetError = ERROR_FACTORY.create("idb-set" /* AppError.IDB_WRITE */, {
+ originalErrorMessage: e?.message
+ });
+ logger.warn(idbGetError.message);
+ }
+ }
+}
+function computeKey(app) {
+ return `${app.name}!${app.options.appId}`;
+}
+
+/**
+ * @license
+ * Copyright 2021 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.
+ */
+const MAX_HEADER_BYTES = 1024;
+const MAX_NUM_STORED_HEARTBEATS = 30;
+class HeartbeatServiceImpl {
+ constructor(container) {
+ this.container = container;
+ /**
+ * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate
+ * the header string.
+ * Stores one record per date. This will be consolidated into the standard
+ * format of one record per user agent string before being sent as a header.
+ * Populated from indexedDB when the controller is instantiated and should
+ * be kept in sync with indexedDB.
+ * Leave public for easier testing.
+ */
+ this._heartbeatsCache = null;
+ const app = this.container.getProvider('app').getImmediate();
+ this._storage = new HeartbeatStorageImpl(app);
+ this._heartbeatsCachePromise = this._storage.read().then(result => {
+ this._heartbeatsCache = result;
+ return result;
+ });
+ }
+ /**
+ * Called to report a heartbeat. The function will generate
+ * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it
+ * to IndexedDB.
+ * Note that we only store one heartbeat per day. So if a heartbeat for today is
+ * already logged, subsequent calls to this function in the same day will be ignored.
+ */
+ async triggerHeartbeat() {
+ try {
+ const platformLogger = this.container
+ .getProvider('platform-logger')
+ .getImmediate();
+ // This is the "Firebase user agent" string from the platform logger
+ // service, not the browser user agent.
+ const agent = platformLogger.getPlatformInfoString();
+ const date = getUTCDateString();
+ if (this._heartbeatsCache?.heartbeats == null) {
+ this._heartbeatsCache = await this._heartbeatsCachePromise;
+ // If we failed to construct a heartbeats cache, then return immediately.
+ if (this._heartbeatsCache?.heartbeats == null) {
+ return;
+ }
+ }
+ // Do not store a heartbeat if one is already stored for this day
+ // or if a header has already been sent today.
+ if (this._heartbeatsCache.lastSentHeartbeatDate === date ||
+ this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {
+ return;
+ }
+ else {
+ // There is no entry for this date. Create one.
+ this._heartbeatsCache.heartbeats.push({ date, agent });
+ // If the number of stored heartbeats exceeds the maximum number of stored heartbeats, remove the heartbeat with the earliest date.
+ // Since this is executed each time a heartbeat is pushed, the limit can only be exceeded by one, so only one needs to be removed.
+ if (this._heartbeatsCache.heartbeats.length > MAX_NUM_STORED_HEARTBEATS) {
+ const earliestHeartbeatIdx = getEarliestHeartbeatIdx(this._heartbeatsCache.heartbeats);
+ this._heartbeatsCache.heartbeats.splice(earliestHeartbeatIdx, 1);
+ }
+ }
+ return this._storage.overwrite(this._heartbeatsCache);
+ }
+ catch (e) {
+ logger.warn(e);
+ }
+ }
+ /**
+ * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.
+ * It also clears all heartbeats from memory as well as in IndexedDB.
+ *
+ * NOTE: Consuming product SDKs should not send the header if this method
+ * returns an empty string.
+ */
+ async getHeartbeatsHeader() {
+ try {
+ if (this._heartbeatsCache === null) {
+ await this._heartbeatsCachePromise;
+ }
+ // If it's still null or the array is empty, there is no data to send.
+ if (this._heartbeatsCache?.heartbeats == null ||
+ this._heartbeatsCache.heartbeats.length === 0) {
+ return '';
+ }
+ const date = getUTCDateString();
+ // Extract as many heartbeats from the cache as will fit under the size limit.
+ const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);
+ const headerString = base64urlEncodeWithoutPadding(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));
+ // Store last sent date to prevent another being logged/sent for the same day.
+ this._heartbeatsCache.lastSentHeartbeatDate = date;
+ if (unsentEntries.length > 0) {
+ // Store any unsent entries if they exist.
+ this._heartbeatsCache.heartbeats = unsentEntries;
+ // This seems more likely than emptying the array (below) to lead to some odd state
+ // since the cache isn't empty and this will be called again on the next request,
+ // and is probably safest if we await it.
+ await this._storage.overwrite(this._heartbeatsCache);
+ }
+ else {
+ this._heartbeatsCache.heartbeats = [];
+ // Do not wait for this, to reduce latency.
+ void this._storage.overwrite(this._heartbeatsCache);
+ }
+ return headerString;
+ }
+ catch (e) {
+ logger.warn(e);
+ return '';
+ }
+ }
+}
+function getUTCDateString() {
+ const today = new Date();
+ // Returns date format 'YYYY-MM-DD'
+ return today.toISOString().substring(0, 10);
+}
+function extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {
+ // Heartbeats grouped by user agent in the standard format to be sent in
+ // the header.
+ const heartbeatsToSend = [];
+ // Single date format heartbeats that are not sent.
+ let unsentEntries = heartbeatsCache.slice();
+ for (const singleDateHeartbeat of heartbeatsCache) {
+ // Look for an existing entry with the same user agent.
+ const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);
+ if (!heartbeatEntry) {
+ // If no entry for this user agent exists, create one.
+ heartbeatsToSend.push({
+ agent: singleDateHeartbeat.agent,
+ dates: [singleDateHeartbeat.date]
+ });
+ if (countBytes(heartbeatsToSend) > maxSize) {
+ // If the header would exceed max size, remove the added heartbeat
+ // entry and stop adding to the header.
+ heartbeatsToSend.pop();
+ break;
+ }
+ }
+ else {
+ heartbeatEntry.dates.push(singleDateHeartbeat.date);
+ // If the header would exceed max size, remove the added date
+ // and stop adding to the header.
+ if (countBytes(heartbeatsToSend) > maxSize) {
+ heartbeatEntry.dates.pop();
+ break;
+ }
+ }
+ // Pop unsent entry from queue. (Skipped if adding the entry exceeded
+ // quota and the loop breaks early.)
+ unsentEntries = unsentEntries.slice(1);
+ }
+ return {
+ heartbeatsToSend,
+ unsentEntries
+ };
+}
+class HeartbeatStorageImpl {
+ constructor(app) {
+ this.app = app;
+ this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();
+ }
+ async runIndexedDBEnvironmentCheck() {
+ if (!isIndexedDBAvailable()) {
+ return false;
+ }
+ else {
+ return validateIndexedDBOpenable()
+ .then(() => true)
+ .catch(() => false);
+ }
+ }
+ /**
+ * Read all heartbeats.
+ */
+ async read() {
+ const canUseIndexedDB = await this._canUseIndexedDBPromise;
+ if (!canUseIndexedDB) {
+ return { heartbeats: [] };
+ }
+ else {
+ const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);
+ if (idbHeartbeatObject?.heartbeats) {
+ return idbHeartbeatObject;
+ }
+ else {
+ return { heartbeats: [] };
+ }
+ }
+ }
+ // overwrite the storage with the provided heartbeats
+ async overwrite(heartbeatsObject) {
+ const canUseIndexedDB = await this._canUseIndexedDBPromise;
+ if (!canUseIndexedDB) {
+ return;
+ }
+ else {
+ const existingHeartbeatsObject = await this.read();
+ return writeHeartbeatsToIndexedDB(this.app, {
+ lastSentHeartbeatDate: heartbeatsObject.lastSentHeartbeatDate ??
+ existingHeartbeatsObject.lastSentHeartbeatDate,
+ heartbeats: heartbeatsObject.heartbeats
+ });
+ }
+ }
+ // add heartbeats
+ async add(heartbeatsObject) {
+ const canUseIndexedDB = await this._canUseIndexedDBPromise;
+ if (!canUseIndexedDB) {
+ return;
+ }
+ else {
+ const existingHeartbeatsObject = await this.read();
+ return writeHeartbeatsToIndexedDB(this.app, {
+ lastSentHeartbeatDate: heartbeatsObject.lastSentHeartbeatDate ??
+ existingHeartbeatsObject.lastSentHeartbeatDate,
+ heartbeats: [
+ ...existingHeartbeatsObject.heartbeats,
+ ...heartbeatsObject.heartbeats
+ ]
+ });
+ }
+ }
+}
+/**
+ * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped
+ * in a platform logging header JSON object, stringified, and converted
+ * to base 64.
+ */
+function countBytes(heartbeatsCache) {
+ // base64 has a restricted set of characters, all of which should be 1 byte.
+ return base64urlEncodeWithoutPadding(
+ // heartbeatsCache wrapper properties
+ JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;
+}
+/**
+ * Returns the index of the heartbeat with the earliest date.
+ * If the heartbeats array is empty, -1 is returned.
+ */
+function getEarliestHeartbeatIdx(heartbeats) {
+ if (heartbeats.length === 0) {
+ return -1;
+ }
+ let earliestHeartbeatIdx = 0;
+ let earliestHeartbeatDate = heartbeats[0].date;
+ for (let i = 1; i < heartbeats.length; i++) {
+ if (heartbeats[i].date < earliestHeartbeatDate) {
+ earliestHeartbeatDate = heartbeats[i].date;
+ earliestHeartbeatIdx = i;
+ }
+ }
+ return earliestHeartbeatIdx;
+}
+
+/**
+ * @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 registerCoreComponents(variant) {
+ _registerComponent(new Component('platform-logger', container => new PlatformLoggerServiceImpl(container), "PRIVATE" /* ComponentType.PRIVATE */));
+ _registerComponent(new Component('heartbeat', container => new HeartbeatServiceImpl(container), "PRIVATE" /* ComponentType.PRIVATE */));
+ // Register `app` package.
+ registerVersion(name$q, version$1, variant);
+ // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation
+ registerVersion(name$q, version$1, 'esm2020');
+ // Register platform SDK identifier (no version).
+ registerVersion('fire-js', '');
+}
+
+/**
+ * Firebase App
+ *
+ * @remarks This package coordinates the communication between the different Firebase components
+ * @packageDocumentation
+ */
+registerCoreComponents('');
+
+export { SDK_VERSION, DEFAULT_ENTRY_NAME as _DEFAULT_ENTRY_NAME, _addComponent, _addOrOverwriteComponent, _apps, _clearComponents, _components, _getProvider, _isFirebaseApp, _isFirebaseServerApp, _isFirebaseServerAppSettings, _registerComponent, _removeServiceInstance, _serverApps, deleteApp, getApp, getApps, initializeApp, initializeServerApp, onLog, registerVersion, setLogLevel };
+//# sourceMappingURL=index.esm.js.map
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/index.esm.js.map b/frontend-old/node_modules/@firebase/app/dist/esm/index.esm.js.map
new file mode 100644
index 0000000..4a0b840
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/index.esm.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.esm.js","sources":["../../src/platformLoggerService.ts","../../src/logger.ts","../../src/constants.ts","../../src/internal.ts","../../src/errors.ts","../../src/firebaseApp.ts","../../src/firebaseServerApp.ts","../../src/api.ts","../../src/indexeddb.ts","../../src/heartbeatService.ts","../../src/registerCoreComponents.ts","../../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ComponentContainer,\n ComponentType,\n Provider,\n Name\n} from '@firebase/component';\nimport { PlatformLoggerService, VersionService } from './types';\n\nexport class PlatformLoggerServiceImpl implements PlatformLoggerService {\n constructor(private readonly container: ComponentContainer) {}\n // In initial implementation, this will be called by installations on\n // auth token refresh, and installations will send this string.\n getPlatformInfoString(): string {\n const providers = this.container.getProviders();\n // Loop through providers and get library/version pairs from any that are\n // version components.\n return providers\n .map(provider => {\n if (isVersionServiceProvider(provider)) {\n const service = provider.getImmediate() as VersionService;\n return `${service.library}/${service.version}`;\n } else {\n return null;\n }\n })\n .filter(logString => logString)\n .join(' ');\n }\n}\n/**\n *\n * @param provider check if this provider provides a VersionService\n *\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\n * provides VersionService. The provider is not necessarily a 'app-version'\n * provider.\n */\nfunction isVersionServiceProvider(provider: Provider<Name>): boolean {\n const component = provider.getComponent();\n return component?.type === ComponentType.VERSION;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Logger } from '@firebase/logger';\n\nexport const logger = new Logger('@firebase/app');\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { name as appName } from '../package.json';\nimport { name as appCompatName } from '../../app-compat/package.json';\nimport { name as analyticsCompatName } from '../../../packages/analytics-compat/package.json';\nimport { name as analyticsName } from '../../../packages/analytics/package.json';\nimport { name as appCheckCompatName } from '../../../packages/app-check-compat/package.json';\nimport { name as appCheckName } from '../../../packages/app-check/package.json';\nimport { name as authName } from '../../../packages/auth/package.json';\nimport { name as authCompatName } from '../../../packages/auth-compat/package.json';\nimport { name as databaseName } from '../../../packages/database/package.json';\nimport { name as dataconnectName } from '../../../packages/data-connect/package.json';\nimport { name as databaseCompatName } from '../../../packages/database-compat/package.json';\nimport { name as functionsName } from '../../../packages/functions/package.json';\nimport { name as functionsCompatName } from '../../../packages/functions-compat/package.json';\nimport { name as installationsName } from '../../../packages/installations/package.json';\nimport { name as installationsCompatName } from '../../../packages/installations-compat/package.json';\nimport { name as messagingName } from '../../../packages/messaging/package.json';\nimport { name as messagingCompatName } from '../../../packages/messaging-compat/package.json';\nimport { name as performanceName } from '../../../packages/performance/package.json';\nimport { name as performanceCompatName } from '../../../packages/performance-compat/package.json';\nimport { name as remoteConfigName } from '../../../packages/remote-config/package.json';\nimport { name as remoteConfigCompatName } from '../../../packages/remote-config-compat/package.json';\nimport { name as storageName } from '../../../packages/storage/package.json';\nimport { name as storageCompatName } from '../../../packages/storage-compat/package.json';\nimport { name as firestoreName } from '../../../packages/firestore/package.json';\nimport { name as aiName } from '../../../packages/ai/package.json';\nimport { name as firestoreCompatName } from '../../../packages/firestore-compat/package.json';\nimport { name as packageName } from '../../../packages/firebase/package.json';\n\n/**\n * The default app name\n *\n * @internal\n */\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n\nexport const PLATFORM_LOG_STRING = {\n [appName]: 'fire-core',\n [appCompatName]: 'fire-core-compat',\n [analyticsName]: 'fire-analytics',\n [analyticsCompatName]: 'fire-analytics-compat',\n [appCheckName]: 'fire-app-check',\n [appCheckCompatName]: 'fire-app-check-compat',\n [authName]: 'fire-auth',\n [authCompatName]: 'fire-auth-compat',\n [databaseName]: 'fire-rtdb',\n [dataconnectName]: 'fire-data-connect',\n [databaseCompatName]: 'fire-rtdb-compat',\n [functionsName]: 'fire-fn',\n [functionsCompatName]: 'fire-fn-compat',\n [installationsName]: 'fire-iid',\n [installationsCompatName]: 'fire-iid-compat',\n [messagingName]: 'fire-fcm',\n [messagingCompatName]: 'fire-fcm-compat',\n [performanceName]: 'fire-perf',\n [performanceCompatName]: 'fire-perf-compat',\n [remoteConfigName]: 'fire-rc',\n [remoteConfigCompatName]: 'fire-rc-compat',\n [storageName]: 'fire-gcs',\n [storageCompatName]: 'fire-gcs-compat',\n [firestoreName]: 'fire-fst',\n [firestoreCompatName]: 'fire-fst-compat',\n [aiName]: 'fire-vertex',\n 'fire-js': 'fire-js', // Platform identifier for JS SDK.\n [packageName]: 'fire-js-all'\n} as const;\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseAppSettings,\n FirebaseServerAppSettings,\n FirebaseOptions,\n FirebaseServerApp\n} from './public-types';\nimport { Component, Provider, Name } from '@firebase/component';\nimport { logger } from './logger';\nimport { DEFAULT_ENTRY_NAME } from './constants';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { FirebaseServerAppImpl } from './firebaseServerApp';\n\n/**\n * @internal\n */\nexport const _apps = new Map<string, FirebaseApp>();\n\n/**\n * @internal\n */\nexport const _serverApps = new Map<string, FirebaseServerApp>();\n\n/**\n * Registered components.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const _components = new Map<string, Component<any>>();\n\n/**\n * @param component - the component being added to this app's container\n *\n * @internal\n */\nexport function _addComponent<T extends Name>(\n app: FirebaseApp,\n component: Component<T>\n): void {\n try {\n (app as FirebaseAppImpl).container.addComponent(component);\n } catch (e) {\n logger.debug(\n `Component ${component.name} failed to register with FirebaseApp ${app.name}`,\n e\n );\n }\n}\n\n/**\n *\n * @internal\n */\nexport function _addOrOverwriteComponent(\n app: FirebaseApp,\n component: Component\n): void {\n (app as FirebaseAppImpl).container.addOrOverwriteComponent(component);\n}\n\n/**\n *\n * @param component - the component to register\n * @returns whether or not the component is registered successfully\n *\n * @internal\n */\nexport function _registerComponent<T extends Name>(\n component: Component<T>\n): boolean {\n const componentName = component.name;\n if (_components.has(componentName)) {\n logger.debug(\n `There were multiple attempts to register component ${componentName}.`\n );\n\n return false;\n }\n\n _components.set(componentName, component);\n\n // add the component to existing app instances\n for (const app of _apps.values()) {\n _addComponent(app as FirebaseAppImpl, component);\n }\n\n for (const serverApp of _serverApps.values()) {\n _addComponent(serverApp as FirebaseServerAppImpl, component);\n }\n\n return true;\n}\n\n/**\n *\n * @param app - FirebaseApp instance\n * @param name - service name\n *\n * @returns the provider for the service with the matching name\n *\n * @internal\n */\nexport function _getProvider<T extends Name>(\n app: FirebaseApp,\n name: T\n): Provider<T> {\n const heartbeatController = (app as FirebaseAppImpl).container\n .getProvider('heartbeat')\n .getImmediate({ optional: true });\n if (heartbeatController) {\n void heartbeatController.triggerHeartbeat();\n }\n return (app as FirebaseAppImpl).container.getProvider(name);\n}\n\n/**\n *\n * @param app - FirebaseApp instance\n * @param name - service name\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\n *\n * @internal\n */\nexport function _removeServiceInstance<T extends Name>(\n app: FirebaseApp,\n name: T,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n): void {\n _getProvider(app, name).clearInstance(instanceIdentifier);\n}\n\n/**\n *\n * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.\n *\n * @returns true if the provide object is of type FirebaseApp.\n *\n * @internal\n */\nexport function _isFirebaseApp(\n obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings\n): obj is FirebaseApp {\n return (obj as FirebaseApp).options !== undefined;\n}\n\n/**\n *\n * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.\n *\n * @returns true if the provided object is of type FirebaseServerAppImpl.\n *\n * @internal\n */\nexport function _isFirebaseServerAppSettings(\n obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings\n): obj is FirebaseServerAppSettings {\n if (_isFirebaseApp(obj)) {\n return false;\n }\n return (\n 'authIdToken' in obj ||\n 'appCheckToken' in obj ||\n 'releaseOnDeref' in obj ||\n 'automaticDataCollectionEnabled' in obj\n );\n}\n\n/**\n *\n * @param obj - an object of type FirebaseApp.\n *\n * @returns true if the provided object is of type FirebaseServerAppImpl.\n *\n * @internal\n */\nexport function _isFirebaseServerApp(\n obj: FirebaseApp | FirebaseServerApp | null | undefined\n): obj is FirebaseServerApp {\n if (obj === null || obj === undefined) {\n return false;\n }\n return (obj as FirebaseServerApp).settings !== undefined;\n}\n\n/**\n * Test only\n *\n * @internal\n */\nexport function _clearComponents(): void {\n _components.clear();\n}\n\n/**\n * Exported in order to be used in app-compat package\n */\nexport { DEFAULT_ENTRY_NAME as _DEFAULT_ENTRY_NAME };\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n SERVER_APP_DELETED = 'server-app-deleted',\n NO_OPTIONS = 'no-options',\n INVALID_APP_ARGUMENT = 'invalid-app-argument',\n INVALID_LOG_ARGUMENT = 'invalid-log-argument',\n IDB_OPEN = 'idb-open',\n IDB_GET = 'idb-get',\n IDB_WRITE = 'idb-set',\n IDB_DELETE = 'idb-delete',\n FINALIZATION_REGISTRY_NOT_SUPPORTED = 'finalization-registry-not-supported',\n INVALID_SERVER_APP_ENVIRONMENT = 'invalid-server-app-environment'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$appName}' has been created - \" +\n 'call initializeApp() first',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$appName}'\",\n [AppError.DUPLICATE_APP]:\n \"Firebase App named '{$appName}' already exists with different options or config\",\n [AppError.APP_DELETED]: \"Firebase App named '{$appName}' already deleted\",\n [AppError.SERVER_APP_DELETED]: 'Firebase Server App has been deleted',\n [AppError.NO_OPTIONS]:\n 'Need to provide options, when not being deployed to hosting via source.',\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$appName}() takes either no argument or a ' +\n 'Firebase App instance.',\n [AppError.INVALID_LOG_ARGUMENT]:\n 'First argument to `onLog` must be null or a function.',\n [AppError.IDB_OPEN]:\n 'Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.',\n [AppError.IDB_GET]:\n 'Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.',\n [AppError.IDB_WRITE]:\n 'Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.',\n [AppError.IDB_DELETE]:\n 'Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.',\n [AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED]:\n 'FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.',\n [AppError.INVALID_SERVER_APP_ENVIRONMENT]:\n 'FirebaseServerApp is not for use in browser environments.'\n};\n\ninterface ErrorParams {\n [AppError.NO_APP]: { appName: string };\n [AppError.BAD_APP_NAME]: { appName: string };\n [AppError.DUPLICATE_APP]: { appName: string };\n [AppError.APP_DELETED]: { appName: string };\n [AppError.INVALID_APP_ARGUMENT]: { appName: string };\n [AppError.IDB_OPEN]: { originalErrorMessage?: string };\n [AppError.IDB_GET]: { originalErrorMessage?: string };\n [AppError.IDB_WRITE]: { originalErrorMessage?: string };\n [AppError.IDB_DELETE]: { originalErrorMessage?: string };\n [AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED]: { appName?: string };\n}\n\nexport const ERROR_FACTORY = new ErrorFactory<AppError, ErrorParams>(\n 'app',\n 'Firebase',\n ERRORS\n);\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppSettings\n} from './public-types';\nimport {\n ComponentContainer,\n Component,\n ComponentType\n} from '@firebase/component';\nimport { ERROR_FACTORY, AppError } from './errors';\n\nexport class FirebaseAppImpl implements FirebaseApp {\n protected readonly _options: FirebaseOptions;\n protected readonly _name: string;\n /**\n * Original config values passed in as a constructor parameter.\n * It is only used to compare with another config object to support idempotent initializeApp().\n *\n * Updating automaticDataCollectionEnabled on the App instance will not change its value in _config.\n */\n private readonly _config: Required<FirebaseAppSettings>;\n private _automaticDataCollectionEnabled: boolean;\n protected _isDeleted = false;\n private readonly _container: ComponentContainer;\n\n constructor(\n options: FirebaseOptions,\n config: Required<FirebaseAppSettings>,\n container: ComponentContainer\n ) {\n this._options = { ...options };\n this._config = { ...config };\n this._name = config.name;\n this._automaticDataCollectionEnabled =\n config.automaticDataCollectionEnabled;\n this._container = container;\n this.container.addComponent(\n new Component('app', () => this, ComponentType.PUBLIC)\n );\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed();\n return this._automaticDataCollectionEnabled;\n }\n\n set automaticDataCollectionEnabled(val: boolean) {\n this.checkDestroyed();\n this._automaticDataCollectionEnabled = val;\n }\n\n get name(): string {\n this.checkDestroyed();\n return this._name;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed();\n return this._options;\n }\n\n get config(): Required<FirebaseAppSettings> {\n this.checkDestroyed();\n return this._config;\n }\n\n get container(): ComponentContainer {\n return this._container;\n }\n\n get isDeleted(): boolean {\n return this._isDeleted;\n }\n\n set isDeleted(val: boolean) {\n this._isDeleted = val;\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n protected checkDestroyed(): void {\n if (this.isDeleted) {\n throw ERROR_FACTORY.create(AppError.APP_DELETED, { appName: this._name });\n }\n }\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseAppSettings,\n FirebaseServerApp,\n FirebaseServerAppSettings,\n FirebaseOptions\n} from './public-types';\nimport { deleteApp, registerVersion } from './api';\nimport { ComponentContainer } from '@firebase/component';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { ERROR_FACTORY, AppError } from './errors';\nimport { name as packageName, version } from '../package.json';\nimport { base64Decode } from '@firebase/util';\n\n// Parse the token and check to see if the `exp` claim is in the future.\n// Reports an error to the console if the token or claim could not be parsed, or if `exp` is in\n// the past.\nfunction validateTokenTTL(base64Token: string, tokenName: string): void {\n const secondPart = base64Decode(base64Token.split('.')[1]);\n if (secondPart === null) {\n console.error(\n `FirebaseServerApp ${tokenName} is invalid: second part could not be parsed.`\n );\n return;\n }\n const expClaim = JSON.parse(secondPart).exp;\n if (expClaim === undefined) {\n console.error(\n `FirebaseServerApp ${tokenName} is invalid: expiration claim could not be parsed`\n );\n return;\n }\n const exp = JSON.parse(secondPart).exp * 1000;\n const now = new Date().getTime();\n const diff = exp - now;\n if (diff <= 0) {\n console.error(\n `FirebaseServerApp ${tokenName} is invalid: the token has expired.`\n );\n }\n}\n\nexport class FirebaseServerAppImpl\n extends FirebaseAppImpl\n implements FirebaseServerApp\n{\n private readonly _serverConfig: FirebaseServerAppSettings;\n private _finalizationRegistry: FinalizationRegistry<object> | null;\n private _refCount: number;\n\n constructor(\n options: FirebaseOptions | FirebaseAppImpl,\n serverConfig: FirebaseServerAppSettings,\n name: string,\n container: ComponentContainer\n ) {\n // Build configuration parameters for the FirebaseAppImpl base class.\n const automaticDataCollectionEnabled =\n serverConfig.automaticDataCollectionEnabled !== undefined\n ? serverConfig.automaticDataCollectionEnabled\n : true;\n\n // Create the FirebaseAppSettings object for the FirebaseAppImp constructor.\n const config: Required<FirebaseAppSettings> = {\n name,\n automaticDataCollectionEnabled\n };\n\n if ((options as FirebaseOptions).apiKey !== undefined) {\n // Construct the parent FirebaseAppImp object.\n super(options as FirebaseOptions, config, container);\n } else {\n const appImpl: FirebaseAppImpl = options as FirebaseAppImpl;\n super(appImpl.options, config, container);\n }\n\n // Now construct the data for the FirebaseServerAppImpl.\n this._serverConfig = {\n automaticDataCollectionEnabled,\n ...serverConfig\n };\n\n // Ensure that the current time is within the `authIdtoken` window of validity.\n if (this._serverConfig.authIdToken) {\n validateTokenTTL(this._serverConfig.authIdToken, 'authIdToken');\n }\n\n // Ensure that the current time is within the `appCheckToken` window of validity.\n if (this._serverConfig.appCheckToken) {\n validateTokenTTL(this._serverConfig.appCheckToken, 'appCheckToken');\n }\n\n this._finalizationRegistry = null;\n if (typeof FinalizationRegistry !== 'undefined') {\n this._finalizationRegistry = new FinalizationRegistry(() => {\n this.automaticCleanup();\n });\n }\n\n this._refCount = 0;\n this.incRefCount(this._serverConfig.releaseOnDeref);\n\n // Do not retain a hard reference to the dref object, otherwise the FinalizationRegistry\n // will never trigger.\n this._serverConfig.releaseOnDeref = undefined;\n serverConfig.releaseOnDeref = undefined;\n\n registerVersion(packageName, version, 'serverapp');\n }\n\n toJSON(): undefined {\n return undefined;\n }\n\n get refCount(): number {\n return this._refCount;\n }\n\n // Increment the reference count of this server app. If an object is provided, register it\n // with the finalization registry.\n incRefCount(obj: object | undefined): void {\n if (this.isDeleted) {\n return;\n }\n this._refCount++;\n if (obj !== undefined && this._finalizationRegistry !== null) {\n this._finalizationRegistry.register(obj, this);\n }\n }\n\n // Decrement the reference count.\n decRefCount(): number {\n if (this.isDeleted) {\n return 0;\n }\n return --this._refCount;\n }\n\n // Invoked by the FinalizationRegistry callback to note that this app should go through its\n // reference counts and delete itself if no reference count remain. The coordinating logic that\n // handles this is in deleteApp(...).\n private automaticCleanup(): void {\n void deleteApp(this);\n }\n\n get settings(): FirebaseServerAppSettings {\n this.checkDestroyed();\n return this._serverConfig;\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n protected checkDestroyed(): void {\n if (this.isDeleted) {\n throw ERROR_FACTORY.create(AppError.SERVER_APP_DELETED);\n }\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseServerApp,\n FirebaseOptions,\n FirebaseAppSettings,\n FirebaseServerAppSettings\n} from './public-types';\nimport { DEFAULT_ENTRY_NAME, PLATFORM_LOG_STRING } from './constants';\nimport { ERROR_FACTORY, AppError } from './errors';\nimport {\n ComponentContainer,\n Component,\n Name,\n ComponentType\n} from '@firebase/component';\nimport { version } from '../../firebase/package.json';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { FirebaseServerAppImpl } from './firebaseServerApp';\nimport {\n _apps,\n _components,\n _isFirebaseApp,\n _isFirebaseServerAppSettings,\n _registerComponent,\n _serverApps\n} from './internal';\nimport { logger } from './logger';\nimport {\n LogLevelString,\n setLogLevel as setLogLevelImpl,\n LogCallback,\n LogOptions,\n setUserLogHandler\n} from '@firebase/logger';\nimport {\n deepEqual,\n getDefaultAppConfig,\n isBrowser,\n isWebWorker\n} from '@firebase/util';\n\nexport { FirebaseError } from '@firebase/util';\n\n/**\n * The current SDK version.\n *\n * @public\n */\nexport const SDK_VERSION = version;\n\n/**\n * Creates and initializes a {@link @firebase/app#FirebaseApp} instance.\n *\n * See\n * {@link\n * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app\n * | Add Firebase to your app} and\n * {@link\n * https://firebase.google.com/docs/web/setup#multiple-projects\n * | Initialize multiple projects} for detailed documentation.\n *\n * @example\n * ```javascript\n *\n * // Initialize default app\n * // Retrieve your own options values by adding a web app on\n * // https://console.firebase.google.com\n * initializeApp({\n * apiKey: \"AIza....\", // Auth / General Use\n * authDomain: \"YOUR_APP.firebaseapp.com\", // Auth with popup/redirect\n * databaseURL: \"https://YOUR_APP.firebaseio.com\", // Realtime Database\n * storageBucket: \"YOUR_APP.appspot.com\", // Storage\n * messagingSenderId: \"123456789\" // Cloud Messaging\n * });\n * ```\n *\n * @example\n * ```javascript\n *\n * // Initialize another app\n * const otherApp = initializeApp({\n * databaseURL: \"https://<OTHER_DATABASE_NAME>.firebaseio.com\",\n * storageBucket: \"<OTHER_STORAGE_BUCKET>.appspot.com\"\n * }, \"otherApp\");\n * ```\n *\n * @param options - Options to configure the app's services.\n * @param name - Optional name of the app to initialize. If no name\n * is provided, the default is `\"[DEFAULT]\"`.\n *\n * @returns The initialized app.\n *\n * @throws If the optional `name` parameter is malformed or empty.\n *\n * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.\n *\n * @public\n */\nexport function initializeApp(\n options: FirebaseOptions,\n name?: string\n): FirebaseApp;\n/**\n * Creates and initializes a FirebaseApp instance.\n *\n * @param options - Options to configure the app's services.\n * @param config - FirebaseApp Configuration\n *\n * @throws If {@link FirebaseAppSettings.name} is defined but the value is malformed or empty.\n *\n * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.\n * @public\n */\nexport function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppSettings\n): FirebaseApp;\n/**\n * Creates and initializes a FirebaseApp instance.\n *\n * @public\n */\nexport function initializeApp(): FirebaseApp;\nexport function initializeApp(\n _options?: FirebaseOptions,\n rawConfig = {}\n): FirebaseApp {\n let options = _options;\n\n if (typeof rawConfig !== 'object') {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config: Required<FirebaseAppSettings> = {\n name: DEFAULT_ENTRY_NAME,\n automaticDataCollectionEnabled: true,\n ...rawConfig\n };\n const name = config.name;\n\n if (typeof name !== 'string' || !name) {\n throw ERROR_FACTORY.create(AppError.BAD_APP_NAME, {\n appName: String(name)\n });\n }\n\n options ||= getDefaultAppConfig();\n\n if (!options) {\n throw ERROR_FACTORY.create(AppError.NO_OPTIONS);\n }\n\n const existingApp = _apps.get(name) as FirebaseAppImpl;\n if (existingApp) {\n // return the existing app if options and config deep equal the ones in the existing app.\n if (\n deepEqual(options, existingApp.options) &&\n deepEqual(config, existingApp.config)\n ) {\n return existingApp;\n } else {\n throw ERROR_FACTORY.create(AppError.DUPLICATE_APP, { appName: name });\n }\n }\n\n const container = new ComponentContainer(name);\n for (const component of _components.values()) {\n container.addComponent(component);\n }\n\n const newApp = new FirebaseAppImpl(options, config, container);\n\n _apps.set(name, newApp);\n\n return newApp;\n}\n\n/**\n * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.\n *\n * The `FirebaseServerApp` is similar to `FirebaseApp`, but is intended for execution in\n * server side rendering environments only. Initialization will fail if invoked from a\n * browser environment.\n *\n * See\n * {@link\n * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app\n * | Add Firebase to your app} and\n * {@link\n * https://firebase.google.com/docs/web/setup#multiple-projects\n * | Initialize multiple projects} for detailed documentation.\n *\n * @example\n * ```javascript\n *\n * // Initialize an instance of `FirebaseServerApp`.\n * // Retrieve your own options values by adding a web app on\n * // https://console.firebase.google.com\n * initializeServerApp({\n * apiKey: \"AIza....\", // Auth / General Use\n * authDomain: \"YOUR_APP.firebaseapp.com\", // Auth with popup/redirect\n * databaseURL: \"https://YOUR_APP.firebaseio.com\", // Realtime Database\n * storageBucket: \"YOUR_APP.appspot.com\", // Storage\n * messagingSenderId: \"123456789\" // Cloud Messaging\n * },\n * {\n * authIdToken: \"Your Auth ID Token\"\n * });\n * ```\n *\n * @param options - `Firebase.AppOptions` to configure the app's services, or a\n * a `FirebaseApp` instance which contains the `AppOptions` within.\n * @param config - Optional `FirebaseServerApp` settings.\n *\n * @returns The initialized `FirebaseServerApp`.\n *\n * @throws If invoked in an unsupported non-server environment such as a browser.\n *\n * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't\n * provide Finalization Registry support.\n *\n * @public\n */\nexport function initializeServerApp(\n options: FirebaseOptions | FirebaseApp,\n config?: FirebaseServerAppSettings\n): FirebaseServerApp;\n\n/**\n * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.\n *\n * @param config - Optional `FirebaseServerApp` settings.\n *\n * @returns The initialized `FirebaseServerApp`.\n *\n * @throws If invoked in an unsupported non-server environment such as a browser.\n * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't\n * provide Finalization Registry support.\n * @throws If the `FIREBASE_OPTIONS` environment variable does not contain a valid project\n * configuration required for auto-initialization.\n *\n * @public\n */\nexport function initializeServerApp(\n config?: FirebaseServerAppSettings\n): FirebaseServerApp;\nexport function initializeServerApp(\n _options?: FirebaseApp | FirebaseServerAppSettings | FirebaseOptions,\n _serverAppConfig: FirebaseServerAppSettings = {}\n): FirebaseServerApp {\n if (isBrowser() && !isWebWorker()) {\n // FirebaseServerApp isn't designed to be run in browsers.\n throw ERROR_FACTORY.create(AppError.INVALID_SERVER_APP_ENVIRONMENT);\n }\n\n let firebaseOptions: FirebaseOptions | undefined;\n let serverAppSettings: FirebaseServerAppSettings = _serverAppConfig || {};\n\n if (_options) {\n if (_isFirebaseApp(_options)) {\n firebaseOptions = _options.options;\n } else if (_isFirebaseServerAppSettings(_options)) {\n serverAppSettings = _options;\n } else {\n firebaseOptions = _options;\n }\n }\n\n if (serverAppSettings.automaticDataCollectionEnabled === undefined) {\n serverAppSettings.automaticDataCollectionEnabled = true;\n }\n\n firebaseOptions ||= getDefaultAppConfig();\n if (!firebaseOptions) {\n throw ERROR_FACTORY.create(AppError.NO_OPTIONS);\n }\n\n // Build an app name based on a hash of the configuration options.\n const nameObj = {\n ...serverAppSettings,\n ...firebaseOptions\n };\n\n // However, Do not mangle the name based on releaseOnDeref, since it will vary between the\n // construction of FirebaseServerApp instances. For example, if the object is the request headers.\n if (nameObj.releaseOnDeref !== undefined) {\n delete nameObj.releaseOnDeref;\n }\n\n const hashCode = (s: string): number => {\n return [...s].reduce(\n (hash, c) => (Math.imul(31, hash) + c.charCodeAt(0)) | 0,\n 0\n );\n };\n\n if (serverAppSettings.releaseOnDeref !== undefined) {\n if (typeof FinalizationRegistry === 'undefined') {\n throw ERROR_FACTORY.create(\n AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED,\n {}\n );\n }\n }\n\n const nameString = '' + hashCode(JSON.stringify(nameObj));\n const existingApp = _serverApps.get(nameString) as FirebaseServerApp;\n if (existingApp) {\n (existingApp as FirebaseServerAppImpl).incRefCount(\n serverAppSettings.releaseOnDeref\n );\n return existingApp;\n }\n\n const container = new ComponentContainer(nameString);\n for (const component of _components.values()) {\n container.addComponent(component);\n }\n\n const newApp = new FirebaseServerAppImpl(\n firebaseOptions,\n serverAppSettings,\n nameString,\n container\n );\n\n _serverApps.set(nameString, newApp);\n\n return newApp;\n}\n\n/**\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\n *\n * When called with no arguments, the default app is returned. When an app name\n * is provided, the app corresponding to that name is returned.\n *\n * An exception is thrown if the app being retrieved has not yet been\n * initialized.\n *\n * @example\n * ```javascript\n * // Return the default app\n * const app = getApp();\n * ```\n *\n * @example\n * ```javascript\n * // Return a named app\n * const otherApp = getApp(\"otherApp\");\n * ```\n *\n * @param name - Optional name of the app to return. If no name is\n * provided, the default is `\"[DEFAULT]\"`.\n *\n * @returns The app corresponding to the provided app name.\n * If no app name is provided, the default app is returned.\n *\n * @public\n */\nexport function getApp(name: string = DEFAULT_ENTRY_NAME): FirebaseApp {\n const app = _apps.get(name);\n if (!app && name === DEFAULT_ENTRY_NAME && getDefaultAppConfig()) {\n return initializeApp();\n }\n if (!app) {\n throw ERROR_FACTORY.create(AppError.NO_APP, { appName: name });\n }\n\n return app;\n}\n\n/**\n * A (read-only) array of all initialized apps.\n * @public\n */\nexport function getApps(): FirebaseApp[] {\n return Array.from(_apps.values());\n}\n\n/**\n * Renders this app unusable and frees the resources of all associated\n * services.\n *\n * @example\n * ```javascript\n * deleteApp(app)\n * .then(function() {\n * console.log(\"App deleted successfully\");\n * })\n * .catch(function(error) {\n * console.log(\"Error deleting app:\", error);\n * });\n * ```\n *\n * @public\n */\nexport async function deleteApp(app: FirebaseApp): Promise<void> {\n let cleanupProviders = false;\n const name = app.name;\n if (_apps.has(name)) {\n cleanupProviders = true;\n _apps.delete(name);\n } else if (_serverApps.has(name)) {\n const firebaseServerApp = app as FirebaseServerAppImpl;\n if (firebaseServerApp.decRefCount() <= 0) {\n _serverApps.delete(name);\n cleanupProviders = true;\n }\n }\n\n if (cleanupProviders) {\n await Promise.all(\n (app as FirebaseAppImpl).container\n .getProviders()\n .map(provider => provider.delete())\n );\n (app as FirebaseAppImpl).isDeleted = true;\n }\n}\n\n/**\n * Registers a library's name and version for platform logging purposes.\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\n * @param version - Current version of that library.\n * @param variant - Bundle variant, e.g., node, rn, etc.\n *\n * @public\n */\nexport function registerVersion(\n libraryKeyOrName: string,\n version: string,\n variant?: string\n): void {\n // TODO: We can use this check to whitelist strings when/if we set up\n // a good whitelist system.\n let library = PLATFORM_LOG_STRING[libraryKeyOrName] ?? libraryKeyOrName;\n if (variant) {\n library += `-${variant}`;\n }\n const libraryMismatch = library.match(/\\s|\\//);\n const versionMismatch = version.match(/\\s|\\//);\n if (libraryMismatch || versionMismatch) {\n const warning = [\n `Unable to register library \"${library}\" with version \"${version}\":`\n ];\n if (libraryMismatch) {\n warning.push(\n `library name \"${library}\" contains illegal characters (whitespace or \"/\")`\n );\n }\n if (libraryMismatch && versionMismatch) {\n warning.push('and');\n }\n if (versionMismatch) {\n warning.push(\n `version name \"${version}\" contains illegal characters (whitespace or \"/\")`\n );\n }\n logger.warn(warning.join(' '));\n return;\n }\n _registerComponent(\n new Component(\n `${library}-version` as Name,\n () => ({ library, version }),\n ComponentType.VERSION\n )\n );\n}\n\n/**\n * Sets log handler for all Firebase SDKs.\n * @param logCallback - An optional custom log handler that executes user code whenever\n * the Firebase SDK makes a logging call.\n *\n * @public\n */\nexport function onLog(\n logCallback: LogCallback | null,\n options?: LogOptions\n): void {\n if (logCallback !== null && typeof logCallback !== 'function') {\n throw ERROR_FACTORY.create(AppError.INVALID_LOG_ARGUMENT);\n }\n setUserLogHandler(logCallback, options);\n}\n\n/**\n * Sets log level for all Firebase SDKs.\n *\n * All of the log types above the current log level are captured (i.e. if\n * you set the log level to `info`, errors are logged, but `debug` and\n * `verbose` logs are not).\n *\n * @public\n */\nexport function setLogLevel(logLevel: LogLevelString): void {\n setLogLevelImpl(logLevel);\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseError } from '@firebase/util';\nimport { DBSchema, openDB, IDBPDatabase } from 'idb';\nimport { AppError, ERROR_FACTORY } from './errors';\nimport { FirebaseApp } from './public-types';\nimport { HeartbeatsInIndexedDB } from './types';\nimport { logger } from './logger';\n\nconst DB_NAME = 'firebase-heartbeat-database';\nconst DB_VERSION = 1;\nconst STORE_NAME = 'firebase-heartbeat-store';\n\ninterface AppDB extends DBSchema {\n 'firebase-heartbeat-store': {\n key: string;\n value: HeartbeatsInIndexedDB;\n };\n}\n\nlet dbPromise: Promise<IDBPDatabase<AppDB>> | null = null;\nfunction getDbPromise(): Promise<IDBPDatabase<AppDB>> {\n if (!dbPromise) {\n dbPromise = openDB<AppDB>(DB_NAME, DB_VERSION, {\n upgrade: (db, oldVersion) => {\n // We don't use 'break' in this switch statement, the fall-through\n // behavior is what we want, because if there are multiple versions between\n // the old version and the current version, we want ALL the migrations\n // that correspond to those versions to run, not only the last one.\n // eslint-disable-next-line default-case\n switch (oldVersion) {\n case 0:\n try {\n db.createObjectStore(STORE_NAME);\n } catch (e) {\n // Safari/iOS browsers throw occasional exceptions on\n // db.createObjectStore() that may be a bug. Avoid blocking\n // the rest of the app functionality.\n console.warn(e);\n }\n }\n }\n }).catch(e => {\n throw ERROR_FACTORY.create(AppError.IDB_OPEN, {\n originalErrorMessage: e.message\n });\n });\n }\n return dbPromise;\n}\n\nexport async function readHeartbeatsFromIndexedDB(\n app: FirebaseApp\n): Promise<HeartbeatsInIndexedDB | undefined> {\n try {\n const db = await getDbPromise();\n const tx = db.transaction(STORE_NAME);\n const result = await tx.objectStore(STORE_NAME).get(computeKey(app));\n // We already have the value but tx.done can throw,\n // so we need to await it here to catch errors\n await tx.done;\n return result;\n } catch (e) {\n if (e instanceof FirebaseError) {\n logger.warn(e.message);\n } else {\n const idbGetError = ERROR_FACTORY.create(AppError.IDB_GET, {\n originalErrorMessage: (e as Error)?.message\n });\n logger.warn(idbGetError.message);\n }\n }\n}\n\nexport async function writeHeartbeatsToIndexedDB(\n app: FirebaseApp,\n heartbeatObject: HeartbeatsInIndexedDB\n): Promise<void> {\n try {\n const db = await getDbPromise();\n const tx = db.transaction(STORE_NAME, 'readwrite');\n const objectStore = tx.objectStore(STORE_NAME);\n await objectStore.put(heartbeatObject, computeKey(app));\n await tx.done;\n } catch (e) {\n if (e instanceof FirebaseError) {\n logger.warn(e.message);\n } else {\n const idbGetError = ERROR_FACTORY.create(AppError.IDB_WRITE, {\n originalErrorMessage: (e as Error)?.message\n });\n logger.warn(idbGetError.message);\n }\n }\n}\n\nfunction computeKey(app: FirebaseApp): string {\n return `${app.name}!${app.options.appId}`;\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ComponentContainer } from '@firebase/component';\nimport {\n base64urlEncodeWithoutPadding,\n isIndexedDBAvailable,\n validateIndexedDBOpenable\n} from '@firebase/util';\nimport {\n readHeartbeatsFromIndexedDB,\n writeHeartbeatsToIndexedDB\n} from './indexeddb';\nimport { FirebaseApp } from './public-types';\nimport {\n HeartbeatsByUserAgent,\n HeartbeatService,\n HeartbeatsInIndexedDB,\n HeartbeatStorage,\n SingleDateHeartbeat\n} from './types';\nimport { logger } from './logger';\n\nconst MAX_HEADER_BYTES = 1024;\nexport const MAX_NUM_STORED_HEARTBEATS = 30;\n\nexport class HeartbeatServiceImpl implements HeartbeatService {\n /**\n * The persistence layer for heartbeats\n * Leave public for easier testing.\n */\n _storage: HeartbeatStorageImpl;\n\n /**\n * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\n * the header string.\n * Stores one record per date. This will be consolidated into the standard\n * format of one record per user agent string before being sent as a header.\n * Populated from indexedDB when the controller is instantiated and should\n * be kept in sync with indexedDB.\n * Leave public for easier testing.\n */\n _heartbeatsCache: HeartbeatsInIndexedDB | null = null;\n\n /**\n * the initialization promise for populating heartbeatCache.\n * If getHeartbeatsHeader() is called before the promise resolves\n * (heartbeatsCache == null), it should wait for this promise\n * Leave public for easier testing.\n */\n _heartbeatsCachePromise: Promise<HeartbeatsInIndexedDB>;\n constructor(private readonly container: ComponentContainer) {\n const app = this.container.getProvider('app').getImmediate();\n this._storage = new HeartbeatStorageImpl(app);\n this._heartbeatsCachePromise = this._storage.read().then(result => {\n this._heartbeatsCache = result;\n return result;\n });\n }\n\n /**\n * Called to report a heartbeat. The function will generate\n * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\n * to IndexedDB.\n * Note that we only store one heartbeat per day. So if a heartbeat for today is\n * already logged, subsequent calls to this function in the same day will be ignored.\n */\n async triggerHeartbeat(): Promise<void> {\n try {\n const platformLogger = this.container\n .getProvider('platform-logger')\n .getImmediate();\n\n // This is the \"Firebase user agent\" string from the platform logger\n // service, not the browser user agent.\n const agent = platformLogger.getPlatformInfoString();\n const date = getUTCDateString();\n if (this._heartbeatsCache?.heartbeats == null) {\n this._heartbeatsCache = await this._heartbeatsCachePromise;\n // If we failed to construct a heartbeats cache, then return immediately.\n if (this._heartbeatsCache?.heartbeats == null) {\n return;\n }\n }\n // Do not store a heartbeat if one is already stored for this day\n // or if a header has already been sent today.\n if (\n this._heartbeatsCache.lastSentHeartbeatDate === date ||\n this._heartbeatsCache.heartbeats.some(\n singleDateHeartbeat => singleDateHeartbeat.date === date\n )\n ) {\n return;\n } else {\n // There is no entry for this date. Create one.\n this._heartbeatsCache.heartbeats.push({ date, agent });\n\n // If the number of stored heartbeats exceeds the maximum number of stored heartbeats, remove the heartbeat with the earliest date.\n // Since this is executed each time a heartbeat is pushed, the limit can only be exceeded by one, so only one needs to be removed.\n if (\n this._heartbeatsCache.heartbeats.length > MAX_NUM_STORED_HEARTBEATS\n ) {\n const earliestHeartbeatIdx = getEarliestHeartbeatIdx(\n this._heartbeatsCache.heartbeats\n );\n this._heartbeatsCache.heartbeats.splice(earliestHeartbeatIdx, 1);\n }\n }\n\n return this._storage.overwrite(this._heartbeatsCache);\n } catch (e) {\n logger.warn(e);\n }\n }\n\n /**\n * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\n * It also clears all heartbeats from memory as well as in IndexedDB.\n *\n * NOTE: Consuming product SDKs should not send the header if this method\n * returns an empty string.\n */\n async getHeartbeatsHeader(): Promise<string> {\n try {\n if (this._heartbeatsCache === null) {\n await this._heartbeatsCachePromise;\n }\n // If it's still null or the array is empty, there is no data to send.\n if (\n this._heartbeatsCache?.heartbeats == null ||\n this._heartbeatsCache.heartbeats.length === 0\n ) {\n return '';\n }\n const date = getUTCDateString();\n // Extract as many heartbeats from the cache as will fit under the size limit.\n const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(\n this._heartbeatsCache.heartbeats\n );\n const headerString = base64urlEncodeWithoutPadding(\n JSON.stringify({ version: 2, heartbeats: heartbeatsToSend })\n );\n // Store last sent date to prevent another being logged/sent for the same day.\n this._heartbeatsCache.lastSentHeartbeatDate = date;\n if (unsentEntries.length > 0) {\n // Store any unsent entries if they exist.\n this._heartbeatsCache.heartbeats = unsentEntries;\n // This seems more likely than emptying the array (below) to lead to some odd state\n // since the cache isn't empty and this will be called again on the next request,\n // and is probably safest if we await it.\n await this._storage.overwrite(this._heartbeatsCache);\n } else {\n this._heartbeatsCache.heartbeats = [];\n // Do not wait for this, to reduce latency.\n void this._storage.overwrite(this._heartbeatsCache);\n }\n return headerString;\n } catch (e) {\n logger.warn(e);\n return '';\n }\n }\n}\n\nfunction getUTCDateString(): string {\n const today = new Date();\n // Returns date format 'YYYY-MM-DD'\n return today.toISOString().substring(0, 10);\n}\n\nexport function extractHeartbeatsForHeader(\n heartbeatsCache: SingleDateHeartbeat[],\n maxSize = MAX_HEADER_BYTES\n): {\n heartbeatsToSend: HeartbeatsByUserAgent[];\n unsentEntries: SingleDateHeartbeat[];\n} {\n // Heartbeats grouped by user agent in the standard format to be sent in\n // the header.\n const heartbeatsToSend: HeartbeatsByUserAgent[] = [];\n // Single date format heartbeats that are not sent.\n let unsentEntries = heartbeatsCache.slice();\n for (const singleDateHeartbeat of heartbeatsCache) {\n // Look for an existing entry with the same user agent.\n const heartbeatEntry = heartbeatsToSend.find(\n hb => hb.agent === singleDateHeartbeat.agent\n );\n if (!heartbeatEntry) {\n // If no entry for this user agent exists, create one.\n heartbeatsToSend.push({\n agent: singleDateHeartbeat.agent,\n dates: [singleDateHeartbeat.date]\n });\n if (countBytes(heartbeatsToSend) > maxSize) {\n // If the header would exceed max size, remove the added heartbeat\n // entry and stop adding to the header.\n heartbeatsToSend.pop();\n break;\n }\n } else {\n heartbeatEntry.dates.push(singleDateHeartbeat.date);\n // If the header would exceed max size, remove the added date\n // and stop adding to the header.\n if (countBytes(heartbeatsToSend) > maxSize) {\n heartbeatEntry.dates.pop();\n break;\n }\n }\n // Pop unsent entry from queue. (Skipped if adding the entry exceeded\n // quota and the loop breaks early.)\n unsentEntries = unsentEntries.slice(1);\n }\n return {\n heartbeatsToSend,\n unsentEntries\n };\n}\n\nexport class HeartbeatStorageImpl implements HeartbeatStorage {\n private _canUseIndexedDBPromise: Promise<boolean>;\n constructor(public app: FirebaseApp) {\n this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\n }\n async runIndexedDBEnvironmentCheck(): Promise<boolean> {\n if (!isIndexedDBAvailable()) {\n return false;\n } else {\n return validateIndexedDBOpenable()\n .then(() => true)\n .catch(() => false);\n }\n }\n /**\n * Read all heartbeats.\n */\n async read(): Promise<HeartbeatsInIndexedDB> {\n const canUseIndexedDB = await this._canUseIndexedDBPromise;\n if (!canUseIndexedDB) {\n return { heartbeats: [] };\n } else {\n const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\n if (idbHeartbeatObject?.heartbeats) {\n return idbHeartbeatObject;\n } else {\n return { heartbeats: [] };\n }\n }\n }\n // overwrite the storage with the provided heartbeats\n async overwrite(heartbeatsObject: HeartbeatsInIndexedDB): Promise<void> {\n const canUseIndexedDB = await this._canUseIndexedDBPromise;\n if (!canUseIndexedDB) {\n return;\n } else {\n const existingHeartbeatsObject = await this.read();\n return writeHeartbeatsToIndexedDB(this.app, {\n lastSentHeartbeatDate:\n heartbeatsObject.lastSentHeartbeatDate ??\n existingHeartbeatsObject.lastSentHeartbeatDate,\n heartbeats: heartbeatsObject.heartbeats\n });\n }\n }\n // add heartbeats\n async add(heartbeatsObject: HeartbeatsInIndexedDB): Promise<void> {\n const canUseIndexedDB = await this._canUseIndexedDBPromise;\n if (!canUseIndexedDB) {\n return;\n } else {\n const existingHeartbeatsObject = await this.read();\n return writeHeartbeatsToIndexedDB(this.app, {\n lastSentHeartbeatDate:\n heartbeatsObject.lastSentHeartbeatDate ??\n existingHeartbeatsObject.lastSentHeartbeatDate,\n heartbeats: [\n ...existingHeartbeatsObject.heartbeats,\n ...heartbeatsObject.heartbeats\n ]\n });\n }\n }\n}\n\n/**\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\n * in a platform logging header JSON object, stringified, and converted\n * to base 64.\n */\nexport function countBytes(heartbeatsCache: HeartbeatsByUserAgent[]): number {\n // base64 has a restricted set of characters, all of which should be 1 byte.\n return base64urlEncodeWithoutPadding(\n // heartbeatsCache wrapper properties\n JSON.stringify({ version: 2, heartbeats: heartbeatsCache })\n ).length;\n}\n\n/**\n * Returns the index of the heartbeat with the earliest date.\n * If the heartbeats array is empty, -1 is returned.\n */\nexport function getEarliestHeartbeatIdx(\n heartbeats: SingleDateHeartbeat[]\n): number {\n if (heartbeats.length === 0) {\n return -1;\n }\n\n let earliestHeartbeatIdx = 0;\n let earliestHeartbeatDate = heartbeats[0].date;\n\n for (let i = 1; i < heartbeats.length; i++) {\n if (heartbeats[i].date < earliestHeartbeatDate) {\n earliestHeartbeatDate = heartbeats[i].date;\n earliestHeartbeatIdx = i;\n }\n }\n\n return earliestHeartbeatIdx;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Component, ComponentType } from '@firebase/component';\nimport { PlatformLoggerServiceImpl } from './platformLoggerService';\nimport { name, version } from '../package.json';\nimport { _registerComponent } from './internal';\nimport { registerVersion } from './api';\nimport { HeartbeatServiceImpl } from './heartbeatService';\n\nexport function registerCoreComponents(variant?: string): void {\n _registerComponent(\n new Component(\n 'platform-logger',\n container => new PlatformLoggerServiceImpl(container),\n ComponentType.PRIVATE\n )\n );\n _registerComponent(\n new Component(\n 'heartbeat',\n container => new HeartbeatServiceImpl(container),\n ComponentType.PRIVATE\n )\n );\n\n // Register `app` package.\n registerVersion(name, version, variant);\n // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation\n registerVersion(name, version, '__BUILD_TARGET__');\n // Register platform SDK identifier (no version).\n registerVersion('fire-js', '');\n}\n","/**\n * Firebase App\n *\n * @remarks This package coordinates the communication between the different Firebase components\n * @packageDocumentation\n */\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { registerCoreComponents } from './registerCoreComponents';\n\nexport * from './api';\nexport * from './internal';\nexport * from './public-types';\n\nregisterCoreComponents('__RUNTIME_ENV__');\n"],"names":["appName","appCompatName","analyticsName","analyticsCompatName","appCheckName","appCheckCompatName","authName","authCompatName","databaseName","dataconnectName","databaseCompatName","functionsName","functionsCompatName","installationsName","installationsCompatName","messagingName","messagingCompatName","performanceName","performanceCompatName","remoteConfigName","remoteConfigCompatName","storageName","storageCompatName","firestoreName","firestoreCompatName","aiName","packageName","version","setLogLevelImpl","name"],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;AAeG;MAUU,yBAAyB,CAAA;AACpC,IAAA,WAAA,CAA6B,SAA6B,EAAA;QAA7B,IAAS,CAAA,SAAA,GAAT,SAAS,CAAoB;KAAI;;;IAG9D,qBAAqB,GAAA;QACnB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;;;AAGhD,QAAA,OAAO,SAAS;aACb,GAAG,CAAC,QAAQ,IAAG;AACd,YAAA,IAAI,wBAAwB,CAAC,QAAQ,CAAC,EAAE;AACtC,gBAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,YAAY,EAAoB,CAAC;gBAC1D,OAAO,CAAA,EAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAA,CAAE,CAAC;aAChD;iBAAM;AACL,gBAAA,OAAO,IAAI,CAAC;aACb;AACH,SAAC,CAAC;AACD,aAAA,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC;aAC9B,IAAI,CAAC,GAAG,CAAC,CAAC;KACd;AACF,CAAA;AACD;;;;;;;AAOG;AACH,SAAS,wBAAwB,CAAC,QAAwB,EAAA;AACxD,IAAA,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC;AAC1C,IAAA,OAAO,SAAS,EAAE,IAAI,KAAA,SAAA,6BAA2B;AACnD;;;;;ACzDA;;;;;;;;;;;;;;;AAeG;AAII,MAAM,MAAM,GAAG,IA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AAO,CAAC,CAAC;;AAExC,IAAA,eAAe,CAACE,MAAI,EAAEF,SAAO,EAAE,SAAkB,CAAC,CAAC;;AAEnD,IAAA,eAAe,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AACjC;;AC9CA;;;;;AAKG;AAyBH,sBAAsB,CAAC,EAAiB,CAAC;;;;"} \ No newline at end of file
diff --git a/frontend-old/node_modules/@firebase/app/dist/esm/package.json b/frontend-old/node_modules/@firebase/app/dist/esm/package.json
new file mode 100644
index 0000000..7c34deb
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/esm/package.json
@@ -0,0 +1 @@
+{"type":"module"} \ No newline at end of file
diff --git a/frontend-old/node_modules/@firebase/app/dist/index.cjs.js b/frontend-old/node_modules/@firebase/app/dist/index.cjs.js
new file mode 100644
index 0000000..0c3b977
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/index.cjs.js
@@ -0,0 +1,1265 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var component = require('@firebase/component');
+var logger$1 = require('@firebase/logger');
+var util = require('@firebase/util');
+var idb = require('idb');
+
+/**
+ * @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.
+ */
+class PlatformLoggerServiceImpl {
+ constructor(container) {
+ this.container = container;
+ }
+ // In initial implementation, this will be called by installations on
+ // auth token refresh, and installations will send this string.
+ getPlatformInfoString() {
+ const providers = this.container.getProviders();
+ // Loop through providers and get library/version pairs from any that are
+ // version components.
+ return providers
+ .map(provider => {
+ if (isVersionServiceProvider(provider)) {
+ const service = provider.getImmediate();
+ return `${service.library}/${service.version}`;
+ }
+ else {
+ return null;
+ }
+ })
+ .filter(logString => logString)
+ .join(' ');
+ }
+}
+/**
+ *
+ * @param provider check if this provider provides a VersionService
+ *
+ * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
+ * provides VersionService. The provider is not necessarily a 'app-version'
+ * provider.
+ */
+function isVersionServiceProvider(provider) {
+ const component = provider.getComponent();
+ return component?.type === "VERSION" /* ComponentType.VERSION */;
+}
+
+const name$q = "@firebase/app";
+const version$1 = "0.14.5";
+
+/**
+ * @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.
+ */
+const logger = new logger$1.Logger('@firebase/app');
+
+const name$p = "@firebase/app-compat";
+
+const name$o = "@firebase/analytics-compat";
+
+const name$n = "@firebase/analytics";
+
+const name$m = "@firebase/app-check-compat";
+
+const name$l = "@firebase/app-check";
+
+const name$k = "@firebase/auth";
+
+const name$j = "@firebase/auth-compat";
+
+const name$i = "@firebase/database";
+
+const name$h = "@firebase/data-connect";
+
+const name$g = "@firebase/database-compat";
+
+const name$f = "@firebase/functions";
+
+const name$e = "@firebase/functions-compat";
+
+const name$d = "@firebase/installations";
+
+const name$c = "@firebase/installations-compat";
+
+const name$b = "@firebase/messaging";
+
+const name$a = "@firebase/messaging-compat";
+
+const name$9 = "@firebase/performance";
+
+const name$8 = "@firebase/performance-compat";
+
+const name$7 = "@firebase/remote-config";
+
+const name$6 = "@firebase/remote-config-compat";
+
+const name$5 = "@firebase/storage";
+
+const name$4 = "@firebase/storage-compat";
+
+const name$3 = "@firebase/firestore";
+
+const name$2 = "@firebase/ai";
+
+const name$1 = "@firebase/firestore-compat";
+
+const name = "firebase";
+const version = "12.5.0";
+
+/**
+ * @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.
+ */
+/**
+ * The default app name
+ *
+ * @internal
+ */
+const DEFAULT_ENTRY_NAME = '[DEFAULT]';
+const PLATFORM_LOG_STRING = {
+ [name$q]: 'fire-core',
+ [name$p]: 'fire-core-compat',
+ [name$n]: 'fire-analytics',
+ [name$o]: 'fire-analytics-compat',
+ [name$l]: 'fire-app-check',
+ [name$m]: 'fire-app-check-compat',
+ [name$k]: 'fire-auth',
+ [name$j]: 'fire-auth-compat',
+ [name$i]: 'fire-rtdb',
+ [name$h]: 'fire-data-connect',
+ [name$g]: 'fire-rtdb-compat',
+ [name$f]: 'fire-fn',
+ [name$e]: 'fire-fn-compat',
+ [name$d]: 'fire-iid',
+ [name$c]: 'fire-iid-compat',
+ [name$b]: 'fire-fcm',
+ [name$a]: 'fire-fcm-compat',
+ [name$9]: 'fire-perf',
+ [name$8]: 'fire-perf-compat',
+ [name$7]: 'fire-rc',
+ [name$6]: 'fire-rc-compat',
+ [name$5]: 'fire-gcs',
+ [name$4]: 'fire-gcs-compat',
+ [name$3]: 'fire-fst',
+ [name$1]: 'fire-fst-compat',
+ [name$2]: 'fire-vertex',
+ 'fire-js': 'fire-js', // Platform identifier for JS SDK.
+ [name]: 'fire-js-all'
+};
+
+/**
+ * @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.
+ */
+/**
+ * @internal
+ */
+const _apps = new Map();
+/**
+ * @internal
+ */
+const _serverApps = new Map();
+/**
+ * Registered components.
+ *
+ * @internal
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+const _components = new Map();
+/**
+ * @param component - the component being added to this app's container
+ *
+ * @internal
+ */
+function _addComponent(app, component) {
+ try {
+ app.container.addComponent(component);
+ }
+ catch (e) {
+ logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);
+ }
+}
+/**
+ *
+ * @internal
+ */
+function _addOrOverwriteComponent(app, component) {
+ app.container.addOrOverwriteComponent(component);
+}
+/**
+ *
+ * @param component - the component to register
+ * @returns whether or not the component is registered successfully
+ *
+ * @internal
+ */
+function _registerComponent(component) {
+ const componentName = component.name;
+ if (_components.has(componentName)) {
+ logger.debug(`There were multiple attempts to register component ${componentName}.`);
+ return false;
+ }
+ _components.set(componentName, component);
+ // add the component to existing app instances
+ for (const app of _apps.values()) {
+ _addComponent(app, component);
+ }
+ for (const serverApp of _serverApps.values()) {
+ _addComponent(serverApp, component);
+ }
+ return true;
+}
+/**
+ *
+ * @param app - FirebaseApp instance
+ * @param name - service name
+ *
+ * @returns the provider for the service with the matching name
+ *
+ * @internal
+ */
+function _getProvider(app, name) {
+ const heartbeatController = app.container
+ .getProvider('heartbeat')
+ .getImmediate({ optional: true });
+ if (heartbeatController) {
+ void heartbeatController.triggerHeartbeat();
+ }
+ return app.container.getProvider(name);
+}
+/**
+ *
+ * @param app - FirebaseApp instance
+ * @param name - service name
+ * @param instanceIdentifier - service instance identifier in case the service supports multiple instances
+ *
+ * @internal
+ */
+function _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {
+ _getProvider(app, name).clearInstance(instanceIdentifier);
+}
+/**
+ *
+ * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.
+ *
+ * @returns true if the provide object is of type FirebaseApp.
+ *
+ * @internal
+ */
+function _isFirebaseApp(obj) {
+ return obj.options !== undefined;
+}
+/**
+ *
+ * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.
+ *
+ * @returns true if the provided object is of type FirebaseServerAppImpl.
+ *
+ * @internal
+ */
+function _isFirebaseServerAppSettings(obj) {
+ if (_isFirebaseApp(obj)) {
+ return false;
+ }
+ return ('authIdToken' in obj ||
+ 'appCheckToken' in obj ||
+ 'releaseOnDeref' in obj ||
+ 'automaticDataCollectionEnabled' in obj);
+}
+/**
+ *
+ * @param obj - an object of type FirebaseApp.
+ *
+ * @returns true if the provided object is of type FirebaseServerAppImpl.
+ *
+ * @internal
+ */
+function _isFirebaseServerApp(obj) {
+ if (obj === null || obj === undefined) {
+ return false;
+ }
+ return obj.settings !== undefined;
+}
+/**
+ * Test only
+ *
+ * @internal
+ */
+function _clearComponents() {
+ _components.clear();
+}
+
+/**
+ * @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.
+ */
+const ERRORS = {
+ ["no-app" /* AppError.NO_APP */]: "No Firebase App '{$appName}' has been created - " +
+ 'call initializeApp() first',
+ ["bad-app-name" /* AppError.BAD_APP_NAME */]: "Illegal App name: '{$appName}'",
+ ["duplicate-app" /* AppError.DUPLICATE_APP */]: "Firebase App named '{$appName}' already exists with different options or config",
+ ["app-deleted" /* AppError.APP_DELETED */]: "Firebase App named '{$appName}' already deleted",
+ ["server-app-deleted" /* AppError.SERVER_APP_DELETED */]: 'Firebase Server App has been deleted',
+ ["no-options" /* AppError.NO_OPTIONS */]: 'Need to provide options, when not being deployed to hosting via source.',
+ ["invalid-app-argument" /* AppError.INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +
+ 'Firebase App instance.',
+ ["invalid-log-argument" /* AppError.INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',
+ ["idb-open" /* AppError.IDB_OPEN */]: 'Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.',
+ ["idb-get" /* AppError.IDB_GET */]: 'Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.',
+ ["idb-set" /* AppError.IDB_WRITE */]: 'Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.',
+ ["idb-delete" /* AppError.IDB_DELETE */]: 'Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.',
+ ["finalization-registry-not-supported" /* AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED */]: 'FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.',
+ ["invalid-server-app-environment" /* AppError.INVALID_SERVER_APP_ENVIRONMENT */]: 'FirebaseServerApp is not for use in browser environments.'
+};
+const ERROR_FACTORY = new util.ErrorFactory('app', 'Firebase', ERRORS);
+
+/**
+ * @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.
+ */
+class FirebaseAppImpl {
+ constructor(options, config, container) {
+ this._isDeleted = false;
+ this._options = { ...options };
+ this._config = { ...config };
+ this._name = config.name;
+ this._automaticDataCollectionEnabled =
+ config.automaticDataCollectionEnabled;
+ this._container = container;
+ this.container.addComponent(new component.Component('app', () => this, "PUBLIC" /* ComponentType.PUBLIC */));
+ }
+ get automaticDataCollectionEnabled() {
+ this.checkDestroyed();
+ return this._automaticDataCollectionEnabled;
+ }
+ set automaticDataCollectionEnabled(val) {
+ this.checkDestroyed();
+ this._automaticDataCollectionEnabled = val;
+ }
+ get name() {
+ this.checkDestroyed();
+ return this._name;
+ }
+ get options() {
+ this.checkDestroyed();
+ return this._options;
+ }
+ get config() {
+ this.checkDestroyed();
+ return this._config;
+ }
+ get container() {
+ return this._container;
+ }
+ get isDeleted() {
+ return this._isDeleted;
+ }
+ set isDeleted(val) {
+ this._isDeleted = val;
+ }
+ /**
+ * This function will throw an Error if the App has already been deleted -
+ * use before performing API actions on the App.
+ */
+ checkDestroyed() {
+ if (this.isDeleted) {
+ throw ERROR_FACTORY.create("app-deleted" /* AppError.APP_DELETED */, { appName: this._name });
+ }
+ }
+}
+
+/**
+ * @license
+ * Copyright 2023 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.
+ */
+// Parse the token and check to see if the `exp` claim is in the future.
+// Reports an error to the console if the token or claim could not be parsed, or if `exp` is in
+// the past.
+function validateTokenTTL(base64Token, tokenName) {
+ const secondPart = util.base64Decode(base64Token.split('.')[1]);
+ if (secondPart === null) {
+ console.error(`FirebaseServerApp ${tokenName} is invalid: second part could not be parsed.`);
+ return;
+ }
+ const expClaim = JSON.parse(secondPart).exp;
+ if (expClaim === undefined) {
+ console.error(`FirebaseServerApp ${tokenName} is invalid: expiration claim could not be parsed`);
+ return;
+ }
+ const exp = JSON.parse(secondPart).exp * 1000;
+ const now = new Date().getTime();
+ const diff = exp - now;
+ if (diff <= 0) {
+ console.error(`FirebaseServerApp ${tokenName} is invalid: the token has expired.`);
+ }
+}
+class FirebaseServerAppImpl extends FirebaseAppImpl {
+ constructor(options, serverConfig, name, container) {
+ // Build configuration parameters for the FirebaseAppImpl base class.
+ const automaticDataCollectionEnabled = serverConfig.automaticDataCollectionEnabled !== undefined
+ ? serverConfig.automaticDataCollectionEnabled
+ : true;
+ // Create the FirebaseAppSettings object for the FirebaseAppImp constructor.
+ const config = {
+ name,
+ automaticDataCollectionEnabled
+ };
+ if (options.apiKey !== undefined) {
+ // Construct the parent FirebaseAppImp object.
+ super(options, config, container);
+ }
+ else {
+ const appImpl = options;
+ super(appImpl.options, config, container);
+ }
+ // Now construct the data for the FirebaseServerAppImpl.
+ this._serverConfig = {
+ automaticDataCollectionEnabled,
+ ...serverConfig
+ };
+ // Ensure that the current time is within the `authIdtoken` window of validity.
+ if (this._serverConfig.authIdToken) {
+ validateTokenTTL(this._serverConfig.authIdToken, 'authIdToken');
+ }
+ // Ensure that the current time is within the `appCheckToken` window of validity.
+ if (this._serverConfig.appCheckToken) {
+ validateTokenTTL(this._serverConfig.appCheckToken, 'appCheckToken');
+ }
+ this._finalizationRegistry = null;
+ if (typeof FinalizationRegistry !== 'undefined') {
+ this._finalizationRegistry = new FinalizationRegistry(() => {
+ this.automaticCleanup();
+ });
+ }
+ this._refCount = 0;
+ this.incRefCount(this._serverConfig.releaseOnDeref);
+ // Do not retain a hard reference to the dref object, otherwise the FinalizationRegistry
+ // will never trigger.
+ this._serverConfig.releaseOnDeref = undefined;
+ serverConfig.releaseOnDeref = undefined;
+ registerVersion(name$q, version$1, 'serverapp');
+ }
+ toJSON() {
+ return undefined;
+ }
+ get refCount() {
+ return this._refCount;
+ }
+ // Increment the reference count of this server app. If an object is provided, register it
+ // with the finalization registry.
+ incRefCount(obj) {
+ if (this.isDeleted) {
+ return;
+ }
+ this._refCount++;
+ if (obj !== undefined && this._finalizationRegistry !== null) {
+ this._finalizationRegistry.register(obj, this);
+ }
+ }
+ // Decrement the reference count.
+ decRefCount() {
+ if (this.isDeleted) {
+ return 0;
+ }
+ return --this._refCount;
+ }
+ // Invoked by the FinalizationRegistry callback to note that this app should go through its
+ // reference counts and delete itself if no reference count remain. The coordinating logic that
+ // handles this is in deleteApp(...).
+ automaticCleanup() {
+ void deleteApp(this);
+ }
+ get settings() {
+ this.checkDestroyed();
+ return this._serverConfig;
+ }
+ /**
+ * This function will throw an Error if the App has already been deleted -
+ * use before performing API actions on the App.
+ */
+ checkDestroyed() {
+ if (this.isDeleted) {
+ throw ERROR_FACTORY.create("server-app-deleted" /* AppError.SERVER_APP_DELETED */);
+ }
+ }
+}
+
+/**
+ * @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.
+ */
+/**
+ * The current SDK version.
+ *
+ * @public
+ */
+const SDK_VERSION = version;
+function initializeApp(_options, rawConfig = {}) {
+ let options = _options;
+ if (typeof rawConfig !== 'object') {
+ const name = rawConfig;
+ rawConfig = { name };
+ }
+ const config = {
+ name: DEFAULT_ENTRY_NAME,
+ automaticDataCollectionEnabled: true,
+ ...rawConfig
+ };
+ const name = config.name;
+ if (typeof name !== 'string' || !name) {
+ throw ERROR_FACTORY.create("bad-app-name" /* AppError.BAD_APP_NAME */, {
+ appName: String(name)
+ });
+ }
+ options || (options = util.getDefaultAppConfig());
+ if (!options) {
+ throw ERROR_FACTORY.create("no-options" /* AppError.NO_OPTIONS */);
+ }
+ const existingApp = _apps.get(name);
+ if (existingApp) {
+ // return the existing app if options and config deep equal the ones in the existing app.
+ if (util.deepEqual(options, existingApp.options) &&
+ util.deepEqual(config, existingApp.config)) {
+ return existingApp;
+ }
+ else {
+ throw ERROR_FACTORY.create("duplicate-app" /* AppError.DUPLICATE_APP */, { appName: name });
+ }
+ }
+ const container = new component.ComponentContainer(name);
+ for (const component of _components.values()) {
+ container.addComponent(component);
+ }
+ const newApp = new FirebaseAppImpl(options, config, container);
+ _apps.set(name, newApp);
+ return newApp;
+}
+function initializeServerApp(_options, _serverAppConfig = {}) {
+ if (util.isBrowser() && !util.isWebWorker()) {
+ // FirebaseServerApp isn't designed to be run in browsers.
+ throw ERROR_FACTORY.create("invalid-server-app-environment" /* AppError.INVALID_SERVER_APP_ENVIRONMENT */);
+ }
+ let firebaseOptions;
+ let serverAppSettings = _serverAppConfig || {};
+ if (_options) {
+ if (_isFirebaseApp(_options)) {
+ firebaseOptions = _options.options;
+ }
+ else if (_isFirebaseServerAppSettings(_options)) {
+ serverAppSettings = _options;
+ }
+ else {
+ firebaseOptions = _options;
+ }
+ }
+ if (serverAppSettings.automaticDataCollectionEnabled === undefined) {
+ serverAppSettings.automaticDataCollectionEnabled = true;
+ }
+ firebaseOptions || (firebaseOptions = util.getDefaultAppConfig());
+ if (!firebaseOptions) {
+ throw ERROR_FACTORY.create("no-options" /* AppError.NO_OPTIONS */);
+ }
+ // Build an app name based on a hash of the configuration options.
+ const nameObj = {
+ ...serverAppSettings,
+ ...firebaseOptions
+ };
+ // However, Do not mangle the name based on releaseOnDeref, since it will vary between the
+ // construction of FirebaseServerApp instances. For example, if the object is the request headers.
+ if (nameObj.releaseOnDeref !== undefined) {
+ delete nameObj.releaseOnDeref;
+ }
+ const hashCode = (s) => {
+ return [...s].reduce((hash, c) => (Math.imul(31, hash) + c.charCodeAt(0)) | 0, 0);
+ };
+ if (serverAppSettings.releaseOnDeref !== undefined) {
+ if (typeof FinalizationRegistry === 'undefined') {
+ throw ERROR_FACTORY.create("finalization-registry-not-supported" /* AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED */, {});
+ }
+ }
+ const nameString = '' + hashCode(JSON.stringify(nameObj));
+ const existingApp = _serverApps.get(nameString);
+ if (existingApp) {
+ existingApp.incRefCount(serverAppSettings.releaseOnDeref);
+ return existingApp;
+ }
+ const container = new component.ComponentContainer(nameString);
+ for (const component of _components.values()) {
+ container.addComponent(component);
+ }
+ const newApp = new FirebaseServerAppImpl(firebaseOptions, serverAppSettings, nameString, container);
+ _serverApps.set(nameString, newApp);
+ return newApp;
+}
+/**
+ * Retrieves a {@link @firebase/app#FirebaseApp} instance.
+ *
+ * When called with no arguments, the default app is returned. When an app name
+ * is provided, the app corresponding to that name is returned.
+ *
+ * An exception is thrown if the app being retrieved has not yet been
+ * initialized.
+ *
+ * @example
+ * ```javascript
+ * // Return the default app
+ * const app = getApp();
+ * ```
+ *
+ * @example
+ * ```javascript
+ * // Return a named app
+ * const otherApp = getApp("otherApp");
+ * ```
+ *
+ * @param name - Optional name of the app to return. If no name is
+ * provided, the default is `"[DEFAULT]"`.
+ *
+ * @returns The app corresponding to the provided app name.
+ * If no app name is provided, the default app is returned.
+ *
+ * @public
+ */
+function getApp(name = DEFAULT_ENTRY_NAME) {
+ const app = _apps.get(name);
+ if (!app && name === DEFAULT_ENTRY_NAME && util.getDefaultAppConfig()) {
+ return initializeApp();
+ }
+ if (!app) {
+ throw ERROR_FACTORY.create("no-app" /* AppError.NO_APP */, { appName: name });
+ }
+ return app;
+}
+/**
+ * A (read-only) array of all initialized apps.
+ * @public
+ */
+function getApps() {
+ return Array.from(_apps.values());
+}
+/**
+ * Renders this app unusable and frees the resources of all associated
+ * services.
+ *
+ * @example
+ * ```javascript
+ * deleteApp(app)
+ * .then(function() {
+ * console.log("App deleted successfully");
+ * })
+ * .catch(function(error) {
+ * console.log("Error deleting app:", error);
+ * });
+ * ```
+ *
+ * @public
+ */
+async function deleteApp(app) {
+ let cleanupProviders = false;
+ const name = app.name;
+ if (_apps.has(name)) {
+ cleanupProviders = true;
+ _apps.delete(name);
+ }
+ else if (_serverApps.has(name)) {
+ const firebaseServerApp = app;
+ if (firebaseServerApp.decRefCount() <= 0) {
+ _serverApps.delete(name);
+ cleanupProviders = true;
+ }
+ }
+ if (cleanupProviders) {
+ await Promise.all(app.container
+ .getProviders()
+ .map(provider => provider.delete()));
+ app.isDeleted = true;
+ }
+}
+/**
+ * Registers a library's name and version for platform logging purposes.
+ * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)
+ * @param version - Current version of that library.
+ * @param variant - Bundle variant, e.g., node, rn, etc.
+ *
+ * @public
+ */
+function registerVersion(libraryKeyOrName, version, variant) {
+ // TODO: We can use this check to whitelist strings when/if we set up
+ // a good whitelist system.
+ let library = PLATFORM_LOG_STRING[libraryKeyOrName] ?? libraryKeyOrName;
+ if (variant) {
+ library += `-${variant}`;
+ }
+ const libraryMismatch = library.match(/\s|\//);
+ const versionMismatch = version.match(/\s|\//);
+ if (libraryMismatch || versionMismatch) {
+ const warning = [
+ `Unable to register library "${library}" with version "${version}":`
+ ];
+ if (libraryMismatch) {
+ warning.push(`library name "${library}" contains illegal characters (whitespace or "/")`);
+ }
+ if (libraryMismatch && versionMismatch) {
+ warning.push('and');
+ }
+ if (versionMismatch) {
+ warning.push(`version name "${version}" contains illegal characters (whitespace or "/")`);
+ }
+ logger.warn(warning.join(' '));
+ return;
+ }
+ _registerComponent(new component.Component(`${library}-version`, () => ({ library, version }), "VERSION" /* ComponentType.VERSION */));
+}
+/**
+ * Sets log handler for all Firebase SDKs.
+ * @param logCallback - An optional custom log handler that executes user code whenever
+ * the Firebase SDK makes a logging call.
+ *
+ * @public
+ */
+function onLog(logCallback, options) {
+ if (logCallback !== null && typeof logCallback !== 'function') {
+ throw ERROR_FACTORY.create("invalid-log-argument" /* AppError.INVALID_LOG_ARGUMENT */);
+ }
+ logger$1.setUserLogHandler(logCallback, options);
+}
+/**
+ * Sets log level for all Firebase SDKs.
+ *
+ * All of the log types above the current log level are captured (i.e. if
+ * you set the log level to `info`, errors are logged, but `debug` and
+ * `verbose` logs are not).
+ *
+ * @public
+ */
+function setLogLevel(logLevel) {
+ logger$1.setLogLevel(logLevel);
+}
+
+/**
+ * @license
+ * Copyright 2021 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.
+ */
+const DB_NAME = 'firebase-heartbeat-database';
+const DB_VERSION = 1;
+const STORE_NAME = 'firebase-heartbeat-store';
+let dbPromise = null;
+function getDbPromise() {
+ if (!dbPromise) {
+ dbPromise = idb.openDB(DB_NAME, DB_VERSION, {
+ upgrade: (db, oldVersion) => {
+ // We don't use 'break' in this switch statement, the fall-through
+ // behavior is what we want, because if there are multiple versions between
+ // the old version and the current version, we want ALL the migrations
+ // that correspond to those versions to run, not only the last one.
+ // eslint-disable-next-line default-case
+ switch (oldVersion) {
+ case 0:
+ try {
+ db.createObjectStore(STORE_NAME);
+ }
+ catch (e) {
+ // Safari/iOS browsers throw occasional exceptions on
+ // db.createObjectStore() that may be a bug. Avoid blocking
+ // the rest of the app functionality.
+ console.warn(e);
+ }
+ }
+ }
+ }).catch(e => {
+ throw ERROR_FACTORY.create("idb-open" /* AppError.IDB_OPEN */, {
+ originalErrorMessage: e.message
+ });
+ });
+ }
+ return dbPromise;
+}
+async function readHeartbeatsFromIndexedDB(app) {
+ try {
+ const db = await getDbPromise();
+ const tx = db.transaction(STORE_NAME);
+ const result = await tx.objectStore(STORE_NAME).get(computeKey(app));
+ // We already have the value but tx.done can throw,
+ // so we need to await it here to catch errors
+ await tx.done;
+ return result;
+ }
+ catch (e) {
+ if (e instanceof util.FirebaseError) {
+ logger.warn(e.message);
+ }
+ else {
+ const idbGetError = ERROR_FACTORY.create("idb-get" /* AppError.IDB_GET */, {
+ originalErrorMessage: e?.message
+ });
+ logger.warn(idbGetError.message);
+ }
+ }
+}
+async function writeHeartbeatsToIndexedDB(app, heartbeatObject) {
+ try {
+ const db = await getDbPromise();
+ const tx = db.transaction(STORE_NAME, 'readwrite');
+ const objectStore = tx.objectStore(STORE_NAME);
+ await objectStore.put(heartbeatObject, computeKey(app));
+ await tx.done;
+ }
+ catch (e) {
+ if (e instanceof util.FirebaseError) {
+ logger.warn(e.message);
+ }
+ else {
+ const idbGetError = ERROR_FACTORY.create("idb-set" /* AppError.IDB_WRITE */, {
+ originalErrorMessage: e?.message
+ });
+ logger.warn(idbGetError.message);
+ }
+ }
+}
+function computeKey(app) {
+ return `${app.name}!${app.options.appId}`;
+}
+
+/**
+ * @license
+ * Copyright 2021 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.
+ */
+const MAX_HEADER_BYTES = 1024;
+const MAX_NUM_STORED_HEARTBEATS = 30;
+class HeartbeatServiceImpl {
+ constructor(container) {
+ this.container = container;
+ /**
+ * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate
+ * the header string.
+ * Stores one record per date. This will be consolidated into the standard
+ * format of one record per user agent string before being sent as a header.
+ * Populated from indexedDB when the controller is instantiated and should
+ * be kept in sync with indexedDB.
+ * Leave public for easier testing.
+ */
+ this._heartbeatsCache = null;
+ const app = this.container.getProvider('app').getImmediate();
+ this._storage = new HeartbeatStorageImpl(app);
+ this._heartbeatsCachePromise = this._storage.read().then(result => {
+ this._heartbeatsCache = result;
+ return result;
+ });
+ }
+ /**
+ * Called to report a heartbeat. The function will generate
+ * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it
+ * to IndexedDB.
+ * Note that we only store one heartbeat per day. So if a heartbeat for today is
+ * already logged, subsequent calls to this function in the same day will be ignored.
+ */
+ async triggerHeartbeat() {
+ try {
+ const platformLogger = this.container
+ .getProvider('platform-logger')
+ .getImmediate();
+ // This is the "Firebase user agent" string from the platform logger
+ // service, not the browser user agent.
+ const agent = platformLogger.getPlatformInfoString();
+ const date = getUTCDateString();
+ if (this._heartbeatsCache?.heartbeats == null) {
+ this._heartbeatsCache = await this._heartbeatsCachePromise;
+ // If we failed to construct a heartbeats cache, then return immediately.
+ if (this._heartbeatsCache?.heartbeats == null) {
+ return;
+ }
+ }
+ // Do not store a heartbeat if one is already stored for this day
+ // or if a header has already been sent today.
+ if (this._heartbeatsCache.lastSentHeartbeatDate === date ||
+ this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {
+ return;
+ }
+ else {
+ // There is no entry for this date. Create one.
+ this._heartbeatsCache.heartbeats.push({ date, agent });
+ // If the number of stored heartbeats exceeds the maximum number of stored heartbeats, remove the heartbeat with the earliest date.
+ // Since this is executed each time a heartbeat is pushed, the limit can only be exceeded by one, so only one needs to be removed.
+ if (this._heartbeatsCache.heartbeats.length > MAX_NUM_STORED_HEARTBEATS) {
+ const earliestHeartbeatIdx = getEarliestHeartbeatIdx(this._heartbeatsCache.heartbeats);
+ this._heartbeatsCache.heartbeats.splice(earliestHeartbeatIdx, 1);
+ }
+ }
+ return this._storage.overwrite(this._heartbeatsCache);
+ }
+ catch (e) {
+ logger.warn(e);
+ }
+ }
+ /**
+ * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.
+ * It also clears all heartbeats from memory as well as in IndexedDB.
+ *
+ * NOTE: Consuming product SDKs should not send the header if this method
+ * returns an empty string.
+ */
+ async getHeartbeatsHeader() {
+ try {
+ if (this._heartbeatsCache === null) {
+ await this._heartbeatsCachePromise;
+ }
+ // If it's still null or the array is empty, there is no data to send.
+ if (this._heartbeatsCache?.heartbeats == null ||
+ this._heartbeatsCache.heartbeats.length === 0) {
+ return '';
+ }
+ const date = getUTCDateString();
+ // Extract as many heartbeats from the cache as will fit under the size limit.
+ const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);
+ const headerString = util.base64urlEncodeWithoutPadding(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));
+ // Store last sent date to prevent another being logged/sent for the same day.
+ this._heartbeatsCache.lastSentHeartbeatDate = date;
+ if (unsentEntries.length > 0) {
+ // Store any unsent entries if they exist.
+ this._heartbeatsCache.heartbeats = unsentEntries;
+ // This seems more likely than emptying the array (below) to lead to some odd state
+ // since the cache isn't empty and this will be called again on the next request,
+ // and is probably safest if we await it.
+ await this._storage.overwrite(this._heartbeatsCache);
+ }
+ else {
+ this._heartbeatsCache.heartbeats = [];
+ // Do not wait for this, to reduce latency.
+ void this._storage.overwrite(this._heartbeatsCache);
+ }
+ return headerString;
+ }
+ catch (e) {
+ logger.warn(e);
+ return '';
+ }
+ }
+}
+function getUTCDateString() {
+ const today = new Date();
+ // Returns date format 'YYYY-MM-DD'
+ return today.toISOString().substring(0, 10);
+}
+function extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {
+ // Heartbeats grouped by user agent in the standard format to be sent in
+ // the header.
+ const heartbeatsToSend = [];
+ // Single date format heartbeats that are not sent.
+ let unsentEntries = heartbeatsCache.slice();
+ for (const singleDateHeartbeat of heartbeatsCache) {
+ // Look for an existing entry with the same user agent.
+ const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);
+ if (!heartbeatEntry) {
+ // If no entry for this user agent exists, create one.
+ heartbeatsToSend.push({
+ agent: singleDateHeartbeat.agent,
+ dates: [singleDateHeartbeat.date]
+ });
+ if (countBytes(heartbeatsToSend) > maxSize) {
+ // If the header would exceed max size, remove the added heartbeat
+ // entry and stop adding to the header.
+ heartbeatsToSend.pop();
+ break;
+ }
+ }
+ else {
+ heartbeatEntry.dates.push(singleDateHeartbeat.date);
+ // If the header would exceed max size, remove the added date
+ // and stop adding to the header.
+ if (countBytes(heartbeatsToSend) > maxSize) {
+ heartbeatEntry.dates.pop();
+ break;
+ }
+ }
+ // Pop unsent entry from queue. (Skipped if adding the entry exceeded
+ // quota and the loop breaks early.)
+ unsentEntries = unsentEntries.slice(1);
+ }
+ return {
+ heartbeatsToSend,
+ unsentEntries
+ };
+}
+class HeartbeatStorageImpl {
+ constructor(app) {
+ this.app = app;
+ this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();
+ }
+ async runIndexedDBEnvironmentCheck() {
+ if (!util.isIndexedDBAvailable()) {
+ return false;
+ }
+ else {
+ return util.validateIndexedDBOpenable()
+ .then(() => true)
+ .catch(() => false);
+ }
+ }
+ /**
+ * Read all heartbeats.
+ */
+ async read() {
+ const canUseIndexedDB = await this._canUseIndexedDBPromise;
+ if (!canUseIndexedDB) {
+ return { heartbeats: [] };
+ }
+ else {
+ const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);
+ if (idbHeartbeatObject?.heartbeats) {
+ return idbHeartbeatObject;
+ }
+ else {
+ return { heartbeats: [] };
+ }
+ }
+ }
+ // overwrite the storage with the provided heartbeats
+ async overwrite(heartbeatsObject) {
+ const canUseIndexedDB = await this._canUseIndexedDBPromise;
+ if (!canUseIndexedDB) {
+ return;
+ }
+ else {
+ const existingHeartbeatsObject = await this.read();
+ return writeHeartbeatsToIndexedDB(this.app, {
+ lastSentHeartbeatDate: heartbeatsObject.lastSentHeartbeatDate ??
+ existingHeartbeatsObject.lastSentHeartbeatDate,
+ heartbeats: heartbeatsObject.heartbeats
+ });
+ }
+ }
+ // add heartbeats
+ async add(heartbeatsObject) {
+ const canUseIndexedDB = await this._canUseIndexedDBPromise;
+ if (!canUseIndexedDB) {
+ return;
+ }
+ else {
+ const existingHeartbeatsObject = await this.read();
+ return writeHeartbeatsToIndexedDB(this.app, {
+ lastSentHeartbeatDate: heartbeatsObject.lastSentHeartbeatDate ??
+ existingHeartbeatsObject.lastSentHeartbeatDate,
+ heartbeats: [
+ ...existingHeartbeatsObject.heartbeats,
+ ...heartbeatsObject.heartbeats
+ ]
+ });
+ }
+ }
+}
+/**
+ * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped
+ * in a platform logging header JSON object, stringified, and converted
+ * to base 64.
+ */
+function countBytes(heartbeatsCache) {
+ // base64 has a restricted set of characters, all of which should be 1 byte.
+ return util.base64urlEncodeWithoutPadding(
+ // heartbeatsCache wrapper properties
+ JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;
+}
+/**
+ * Returns the index of the heartbeat with the earliest date.
+ * If the heartbeats array is empty, -1 is returned.
+ */
+function getEarliestHeartbeatIdx(heartbeats) {
+ if (heartbeats.length === 0) {
+ return -1;
+ }
+ let earliestHeartbeatIdx = 0;
+ let earliestHeartbeatDate = heartbeats[0].date;
+ for (let i = 1; i < heartbeats.length; i++) {
+ if (heartbeats[i].date < earliestHeartbeatDate) {
+ earliestHeartbeatDate = heartbeats[i].date;
+ earliestHeartbeatIdx = i;
+ }
+ }
+ return earliestHeartbeatIdx;
+}
+
+/**
+ * @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 registerCoreComponents(variant) {
+ _registerComponent(new component.Component('platform-logger', container => new PlatformLoggerServiceImpl(container), "PRIVATE" /* ComponentType.PRIVATE */));
+ _registerComponent(new component.Component('heartbeat', container => new HeartbeatServiceImpl(container), "PRIVATE" /* ComponentType.PRIVATE */));
+ // Register `app` package.
+ registerVersion(name$q, version$1, variant);
+ // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation
+ registerVersion(name$q, version$1, 'cjs2020');
+ // Register platform SDK identifier (no version).
+ registerVersion('fire-js', '');
+}
+
+/**
+ * Firebase App
+ *
+ * @remarks This package coordinates the communication between the different Firebase components
+ * @packageDocumentation
+ */
+registerCoreComponents('node');
+
+Object.defineProperty(exports, 'FirebaseError', {
+ enumerable: true,
+ get: function () { return util.FirebaseError; }
+});
+exports.SDK_VERSION = SDK_VERSION;
+exports._DEFAULT_ENTRY_NAME = DEFAULT_ENTRY_NAME;
+exports._addComponent = _addComponent;
+exports._addOrOverwriteComponent = _addOrOverwriteComponent;
+exports._apps = _apps;
+exports._clearComponents = _clearComponents;
+exports._components = _components;
+exports._getProvider = _getProvider;
+exports._isFirebaseApp = _isFirebaseApp;
+exports._isFirebaseServerApp = _isFirebaseServerApp;
+exports._isFirebaseServerAppSettings = _isFirebaseServerAppSettings;
+exports._registerComponent = _registerComponent;
+exports._removeServiceInstance = _removeServiceInstance;
+exports._serverApps = _serverApps;
+exports.deleteApp = deleteApp;
+exports.getApp = getApp;
+exports.getApps = getApps;
+exports.initializeApp = initializeApp;
+exports.initializeServerApp = initializeServerApp;
+exports.onLog = onLog;
+exports.registerVersion = registerVersion;
+exports.setLogLevel = setLogLevel;
+//# sourceMappingURL=index.cjs.js.map
diff --git a/frontend-old/node_modules/@firebase/app/dist/index.cjs.js.map b/frontend-old/node_modules/@firebase/app/dist/index.cjs.js.map
new file mode 100644
index 0000000..656bf1b
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/dist/index.cjs.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.cjs.js","sources":["../src/platformLoggerService.ts","../src/logger.ts","../src/constants.ts","../src/internal.ts","../src/errors.ts","../src/firebaseApp.ts","../src/firebaseServerApp.ts","../src/api.ts","../src/indexeddb.ts","../src/heartbeatService.ts","../src/registerCoreComponents.ts","../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ComponentContainer,\n ComponentType,\n Provider,\n Name\n} from '@firebase/component';\nimport { PlatformLoggerService, VersionService } from './types';\n\nexport class PlatformLoggerServiceImpl implements PlatformLoggerService {\n constructor(private readonly container: ComponentContainer) {}\n // In initial implementation, this will be called by installations on\n // auth token refresh, and installations will send this string.\n getPlatformInfoString(): string {\n const providers = this.container.getProviders();\n // Loop through providers and get library/version pairs from any that are\n // version components.\n return providers\n .map(provider => {\n if (isVersionServiceProvider(provider)) {\n const service = provider.getImmediate() as VersionService;\n return `${service.library}/${service.version}`;\n } else {\n return null;\n }\n })\n .filter(logString => logString)\n .join(' ');\n }\n}\n/**\n *\n * @param provider check if this provider provides a VersionService\n *\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\n * provides VersionService. The provider is not necessarily a 'app-version'\n * provider.\n */\nfunction isVersionServiceProvider(provider: Provider<Name>): boolean {\n const component = provider.getComponent();\n return component?.type === ComponentType.VERSION;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Logger } from '@firebase/logger';\n\nexport const logger = new Logger('@firebase/app');\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { name as appName } from '../package.json';\nimport { name as appCompatName } from '../../app-compat/package.json';\nimport { name as analyticsCompatName } from '../../../packages/analytics-compat/package.json';\nimport { name as analyticsName } from '../../../packages/analytics/package.json';\nimport { name as appCheckCompatName } from '../../../packages/app-check-compat/package.json';\nimport { name as appCheckName } from '../../../packages/app-check/package.json';\nimport { name as authName } from '../../../packages/auth/package.json';\nimport { name as authCompatName } from '../../../packages/auth-compat/package.json';\nimport { name as databaseName } from '../../../packages/database/package.json';\nimport { name as dataconnectName } from '../../../packages/data-connect/package.json';\nimport { name as databaseCompatName } from '../../../packages/database-compat/package.json';\nimport { name as functionsName } from '../../../packages/functions/package.json';\nimport { name as functionsCompatName } from '../../../packages/functions-compat/package.json';\nimport { name as installationsName } from '../../../packages/installations/package.json';\nimport { name as installationsCompatName } from '../../../packages/installations-compat/package.json';\nimport { name as messagingName } from '../../../packages/messaging/package.json';\nimport { name as messagingCompatName } from '../../../packages/messaging-compat/package.json';\nimport { name as performanceName } from '../../../packages/performance/package.json';\nimport { name as performanceCompatName } from '../../../packages/performance-compat/package.json';\nimport { name as remoteConfigName } from '../../../packages/remote-config/package.json';\nimport { name as remoteConfigCompatName } from '../../../packages/remote-config-compat/package.json';\nimport { name as storageName } from '../../../packages/storage/package.json';\nimport { name as storageCompatName } from '../../../packages/storage-compat/package.json';\nimport { name as firestoreName } from '../../../packages/firestore/package.json';\nimport { name as aiName } from '../../../packages/ai/package.json';\nimport { name as firestoreCompatName } from '../../../packages/firestore-compat/package.json';\nimport { name as packageName } from '../../../packages/firebase/package.json';\n\n/**\n * The default app name\n *\n * @internal\n */\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n\nexport const PLATFORM_LOG_STRING = {\n [appName]: 'fire-core',\n [appCompatName]: 'fire-core-compat',\n [analyticsName]: 'fire-analytics',\n [analyticsCompatName]: 'fire-analytics-compat',\n [appCheckName]: 'fire-app-check',\n [appCheckCompatName]: 'fire-app-check-compat',\n [authName]: 'fire-auth',\n [authCompatName]: 'fire-auth-compat',\n [databaseName]: 'fire-rtdb',\n [dataconnectName]: 'fire-data-connect',\n [databaseCompatName]: 'fire-rtdb-compat',\n [functionsName]: 'fire-fn',\n [functionsCompatName]: 'fire-fn-compat',\n [installationsName]: 'fire-iid',\n [installationsCompatName]: 'fire-iid-compat',\n [messagingName]: 'fire-fcm',\n [messagingCompatName]: 'fire-fcm-compat',\n [performanceName]: 'fire-perf',\n [performanceCompatName]: 'fire-perf-compat',\n [remoteConfigName]: 'fire-rc',\n [remoteConfigCompatName]: 'fire-rc-compat',\n [storageName]: 'fire-gcs',\n [storageCompatName]: 'fire-gcs-compat',\n [firestoreName]: 'fire-fst',\n [firestoreCompatName]: 'fire-fst-compat',\n [aiName]: 'fire-vertex',\n 'fire-js': 'fire-js', // Platform identifier for JS SDK.\n [packageName]: 'fire-js-all'\n} as const;\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseAppSettings,\n FirebaseServerAppSettings,\n FirebaseOptions,\n FirebaseServerApp\n} from './public-types';\nimport { Component, Provider, Name } from '@firebase/component';\nimport { logger } from './logger';\nimport { DEFAULT_ENTRY_NAME } from './constants';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { FirebaseServerAppImpl } from './firebaseServerApp';\n\n/**\n * @internal\n */\nexport const _apps = new Map<string, FirebaseApp>();\n\n/**\n * @internal\n */\nexport const _serverApps = new Map<string, FirebaseServerApp>();\n\n/**\n * Registered components.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const _components = new Map<string, Component<any>>();\n\n/**\n * @param component - the component being added to this app's container\n *\n * @internal\n */\nexport function _addComponent<T extends Name>(\n app: FirebaseApp,\n component: Component<T>\n): void {\n try {\n (app as FirebaseAppImpl).container.addComponent(component);\n } catch (e) {\n logger.debug(\n `Component ${component.name} failed to register with FirebaseApp ${app.name}`,\n e\n );\n }\n}\n\n/**\n *\n * @internal\n */\nexport function _addOrOverwriteComponent(\n app: FirebaseApp,\n component: Component\n): void {\n (app as FirebaseAppImpl).container.addOrOverwriteComponent(component);\n}\n\n/**\n *\n * @param component - the component to register\n * @returns whether or not the component is registered successfully\n *\n * @internal\n */\nexport function _registerComponent<T extends Name>(\n component: Component<T>\n): boolean {\n const componentName = component.name;\n if (_components.has(componentName)) {\n logger.debug(\n `There were multiple attempts to register component ${componentName}.`\n );\n\n return false;\n }\n\n _components.set(componentName, component);\n\n // add the component to existing app instances\n for (const app of _apps.values()) {\n _addComponent(app as FirebaseAppImpl, component);\n }\n\n for (const serverApp of _serverApps.values()) {\n _addComponent(serverApp as FirebaseServerAppImpl, component);\n }\n\n return true;\n}\n\n/**\n *\n * @param app - FirebaseApp instance\n * @param name - service name\n *\n * @returns the provider for the service with the matching name\n *\n * @internal\n */\nexport function _getProvider<T extends Name>(\n app: FirebaseApp,\n name: T\n): Provider<T> {\n const heartbeatController = (app as FirebaseAppImpl).container\n .getProvider('heartbeat')\n .getImmediate({ optional: true });\n if (heartbeatController) {\n void heartbeatController.triggerHeartbeat();\n }\n return (app as FirebaseAppImpl).container.getProvider(name);\n}\n\n/**\n *\n * @param app - FirebaseApp instance\n * @param name - service name\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\n *\n * @internal\n */\nexport function _removeServiceInstance<T extends Name>(\n app: FirebaseApp,\n name: T,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n): void {\n _getProvider(app, name).clearInstance(instanceIdentifier);\n}\n\n/**\n *\n * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.\n *\n * @returns true if the provide object is of type FirebaseApp.\n *\n * @internal\n */\nexport function _isFirebaseApp(\n obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings\n): obj is FirebaseApp {\n return (obj as FirebaseApp).options !== undefined;\n}\n\n/**\n *\n * @param obj - an object of type FirebaseApp, FirebaseOptions or FirebaseAppSettings.\n *\n * @returns true if the provided object is of type FirebaseServerAppImpl.\n *\n * @internal\n */\nexport function _isFirebaseServerAppSettings(\n obj: FirebaseApp | FirebaseOptions | FirebaseAppSettings\n): obj is FirebaseServerAppSettings {\n if (_isFirebaseApp(obj)) {\n return false;\n }\n return (\n 'authIdToken' in obj ||\n 'appCheckToken' in obj ||\n 'releaseOnDeref' in obj ||\n 'automaticDataCollectionEnabled' in obj\n );\n}\n\n/**\n *\n * @param obj - an object of type FirebaseApp.\n *\n * @returns true if the provided object is of type FirebaseServerAppImpl.\n *\n * @internal\n */\nexport function _isFirebaseServerApp(\n obj: FirebaseApp | FirebaseServerApp | null | undefined\n): obj is FirebaseServerApp {\n if (obj === null || obj === undefined) {\n return false;\n }\n return (obj as FirebaseServerApp).settings !== undefined;\n}\n\n/**\n * Test only\n *\n * @internal\n */\nexport function _clearComponents(): void {\n _components.clear();\n}\n\n/**\n * Exported in order to be used in app-compat package\n */\nexport { DEFAULT_ENTRY_NAME as _DEFAULT_ENTRY_NAME };\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n SERVER_APP_DELETED = 'server-app-deleted',\n NO_OPTIONS = 'no-options',\n INVALID_APP_ARGUMENT = 'invalid-app-argument',\n INVALID_LOG_ARGUMENT = 'invalid-log-argument',\n IDB_OPEN = 'idb-open',\n IDB_GET = 'idb-get',\n IDB_WRITE = 'idb-set',\n IDB_DELETE = 'idb-delete',\n FINALIZATION_REGISTRY_NOT_SUPPORTED = 'finalization-registry-not-supported',\n INVALID_SERVER_APP_ENVIRONMENT = 'invalid-server-app-environment'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$appName}' has been created - \" +\n 'call initializeApp() first',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$appName}'\",\n [AppError.DUPLICATE_APP]:\n \"Firebase App named '{$appName}' already exists with different options or config\",\n [AppError.APP_DELETED]: \"Firebase App named '{$appName}' already deleted\",\n [AppError.SERVER_APP_DELETED]: 'Firebase Server App has been deleted',\n [AppError.NO_OPTIONS]:\n 'Need to provide options, when not being deployed to hosting via source.',\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$appName}() takes either no argument or a ' +\n 'Firebase App instance.',\n [AppError.INVALID_LOG_ARGUMENT]:\n 'First argument to `onLog` must be null or a function.',\n [AppError.IDB_OPEN]:\n 'Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.',\n [AppError.IDB_GET]:\n 'Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.',\n [AppError.IDB_WRITE]:\n 'Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.',\n [AppError.IDB_DELETE]:\n 'Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.',\n [AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED]:\n 'FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.',\n [AppError.INVALID_SERVER_APP_ENVIRONMENT]:\n 'FirebaseServerApp is not for use in browser environments.'\n};\n\ninterface ErrorParams {\n [AppError.NO_APP]: { appName: string };\n [AppError.BAD_APP_NAME]: { appName: string };\n [AppError.DUPLICATE_APP]: { appName: string };\n [AppError.APP_DELETED]: { appName: string };\n [AppError.INVALID_APP_ARGUMENT]: { appName: string };\n [AppError.IDB_OPEN]: { originalErrorMessage?: string };\n [AppError.IDB_GET]: { originalErrorMessage?: string };\n [AppError.IDB_WRITE]: { originalErrorMessage?: string };\n [AppError.IDB_DELETE]: { originalErrorMessage?: string };\n [AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED]: { appName?: string };\n}\n\nexport const ERROR_FACTORY = new ErrorFactory<AppError, ErrorParams>(\n 'app',\n 'Firebase',\n ERRORS\n);\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppSettings\n} from './public-types';\nimport {\n ComponentContainer,\n Component,\n ComponentType\n} from '@firebase/component';\nimport { ERROR_FACTORY, AppError } from './errors';\n\nexport class FirebaseAppImpl implements FirebaseApp {\n protected readonly _options: FirebaseOptions;\n protected readonly _name: string;\n /**\n * Original config values passed in as a constructor parameter.\n * It is only used to compare with another config object to support idempotent initializeApp().\n *\n * Updating automaticDataCollectionEnabled on the App instance will not change its value in _config.\n */\n private readonly _config: Required<FirebaseAppSettings>;\n private _automaticDataCollectionEnabled: boolean;\n protected _isDeleted = false;\n private readonly _container: ComponentContainer;\n\n constructor(\n options: FirebaseOptions,\n config: Required<FirebaseAppSettings>,\n container: ComponentContainer\n ) {\n this._options = { ...options };\n this._config = { ...config };\n this._name = config.name;\n this._automaticDataCollectionEnabled =\n config.automaticDataCollectionEnabled;\n this._container = container;\n this.container.addComponent(\n new Component('app', () => this, ComponentType.PUBLIC)\n );\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed();\n return this._automaticDataCollectionEnabled;\n }\n\n set automaticDataCollectionEnabled(val: boolean) {\n this.checkDestroyed();\n this._automaticDataCollectionEnabled = val;\n }\n\n get name(): string {\n this.checkDestroyed();\n return this._name;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed();\n return this._options;\n }\n\n get config(): Required<FirebaseAppSettings> {\n this.checkDestroyed();\n return this._config;\n }\n\n get container(): ComponentContainer {\n return this._container;\n }\n\n get isDeleted(): boolean {\n return this._isDeleted;\n }\n\n set isDeleted(val: boolean) {\n this._isDeleted = val;\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n protected checkDestroyed(): void {\n if (this.isDeleted) {\n throw ERROR_FACTORY.create(AppError.APP_DELETED, { appName: this._name });\n }\n }\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseAppSettings,\n FirebaseServerApp,\n FirebaseServerAppSettings,\n FirebaseOptions\n} from './public-types';\nimport { deleteApp, registerVersion } from './api';\nimport { ComponentContainer } from '@firebase/component';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { ERROR_FACTORY, AppError } from './errors';\nimport { name as packageName, version } from '../package.json';\nimport { base64Decode } from '@firebase/util';\n\n// Parse the token and check to see if the `exp` claim is in the future.\n// Reports an error to the console if the token or claim could not be parsed, or if `exp` is in\n// the past.\nfunction validateTokenTTL(base64Token: string, tokenName: string): void {\n const secondPart = base64Decode(base64Token.split('.')[1]);\n if (secondPart === null) {\n console.error(\n `FirebaseServerApp ${tokenName} is invalid: second part could not be parsed.`\n );\n return;\n }\n const expClaim = JSON.parse(secondPart).exp;\n if (expClaim === undefined) {\n console.error(\n `FirebaseServerApp ${tokenName} is invalid: expiration claim could not be parsed`\n );\n return;\n }\n const exp = JSON.parse(secondPart).exp * 1000;\n const now = new Date().getTime();\n const diff = exp - now;\n if (diff <= 0) {\n console.error(\n `FirebaseServerApp ${tokenName} is invalid: the token has expired.`\n );\n }\n}\n\nexport class FirebaseServerAppImpl\n extends FirebaseAppImpl\n implements FirebaseServerApp\n{\n private readonly _serverConfig: FirebaseServerAppSettings;\n private _finalizationRegistry: FinalizationRegistry<object> | null;\n private _refCount: number;\n\n constructor(\n options: FirebaseOptions | FirebaseAppImpl,\n serverConfig: FirebaseServerAppSettings,\n name: string,\n container: ComponentContainer\n ) {\n // Build configuration parameters for the FirebaseAppImpl base class.\n const automaticDataCollectionEnabled =\n serverConfig.automaticDataCollectionEnabled !== undefined\n ? serverConfig.automaticDataCollectionEnabled\n : true;\n\n // Create the FirebaseAppSettings object for the FirebaseAppImp constructor.\n const config: Required<FirebaseAppSettings> = {\n name,\n automaticDataCollectionEnabled\n };\n\n if ((options as FirebaseOptions).apiKey !== undefined) {\n // Construct the parent FirebaseAppImp object.\n super(options as FirebaseOptions, config, container);\n } else {\n const appImpl: FirebaseAppImpl = options as FirebaseAppImpl;\n super(appImpl.options, config, container);\n }\n\n // Now construct the data for the FirebaseServerAppImpl.\n this._serverConfig = {\n automaticDataCollectionEnabled,\n ...serverConfig\n };\n\n // Ensure that the current time is within the `authIdtoken` window of validity.\n if (this._serverConfig.authIdToken) {\n validateTokenTTL(this._serverConfig.authIdToken, 'authIdToken');\n }\n\n // Ensure that the current time is within the `appCheckToken` window of validity.\n if (this._serverConfig.appCheckToken) {\n validateTokenTTL(this._serverConfig.appCheckToken, 'appCheckToken');\n }\n\n this._finalizationRegistry = null;\n if (typeof FinalizationRegistry !== 'undefined') {\n this._finalizationRegistry = new FinalizationRegistry(() => {\n this.automaticCleanup();\n });\n }\n\n this._refCount = 0;\n this.incRefCount(this._serverConfig.releaseOnDeref);\n\n // Do not retain a hard reference to the dref object, otherwise the FinalizationRegistry\n // will never trigger.\n this._serverConfig.releaseOnDeref = undefined;\n serverConfig.releaseOnDeref = undefined;\n\n registerVersion(packageName, version, 'serverapp');\n }\n\n toJSON(): undefined {\n return undefined;\n }\n\n get refCount(): number {\n return this._refCount;\n }\n\n // Increment the reference count of this server app. If an object is provided, register it\n // with the finalization registry.\n incRefCount(obj: object | undefined): void {\n if (this.isDeleted) {\n return;\n }\n this._refCount++;\n if (obj !== undefined && this._finalizationRegistry !== null) {\n this._finalizationRegistry.register(obj, this);\n }\n }\n\n // Decrement the reference count.\n decRefCount(): number {\n if (this.isDeleted) {\n return 0;\n }\n return --this._refCount;\n }\n\n // Invoked by the FinalizationRegistry callback to note that this app should go through its\n // reference counts and delete itself if no reference count remain. The coordinating logic that\n // handles this is in deleteApp(...).\n private automaticCleanup(): void {\n void deleteApp(this);\n }\n\n get settings(): FirebaseServerAppSettings {\n this.checkDestroyed();\n return this._serverConfig;\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n protected checkDestroyed(): void {\n if (this.isDeleted) {\n throw ERROR_FACTORY.create(AppError.SERVER_APP_DELETED);\n }\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseServerApp,\n FirebaseOptions,\n FirebaseAppSettings,\n FirebaseServerAppSettings\n} from './public-types';\nimport { DEFAULT_ENTRY_NAME, PLATFORM_LOG_STRING } from './constants';\nimport { ERROR_FACTORY, AppError } from './errors';\nimport {\n ComponentContainer,\n Component,\n Name,\n ComponentType\n} from '@firebase/component';\nimport { version } from '../../firebase/package.json';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { FirebaseServerAppImpl } from './firebaseServerApp';\nimport {\n _apps,\n _components,\n _isFirebaseApp,\n _isFirebaseServerAppSettings,\n _registerComponent,\n _serverApps\n} from './internal';\nimport { logger } from './logger';\nimport {\n LogLevelString,\n setLogLevel as setLogLevelImpl,\n LogCallback,\n LogOptions,\n setUserLogHandler\n} from '@firebase/logger';\nimport {\n deepEqual,\n getDefaultAppConfig,\n isBrowser,\n isWebWorker\n} from '@firebase/util';\n\nexport { FirebaseError } from '@firebase/util';\n\n/**\n * The current SDK version.\n *\n * @public\n */\nexport const SDK_VERSION = version;\n\n/**\n * Creates and initializes a {@link @firebase/app#FirebaseApp} instance.\n *\n * See\n * {@link\n * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app\n * | Add Firebase to your app} and\n * {@link\n * https://firebase.google.com/docs/web/setup#multiple-projects\n * | Initialize multiple projects} for detailed documentation.\n *\n * @example\n * ```javascript\n *\n * // Initialize default app\n * // Retrieve your own options values by adding a web app on\n * // https://console.firebase.google.com\n * initializeApp({\n * apiKey: \"AIza....\", // Auth / General Use\n * authDomain: \"YOUR_APP.firebaseapp.com\", // Auth with popup/redirect\n * databaseURL: \"https://YOUR_APP.firebaseio.com\", // Realtime Database\n * storageBucket: \"YOUR_APP.appspot.com\", // Storage\n * messagingSenderId: \"123456789\" // Cloud Messaging\n * });\n * ```\n *\n * @example\n * ```javascript\n *\n * // Initialize another app\n * const otherApp = initializeApp({\n * databaseURL: \"https://<OTHER_DATABASE_NAME>.firebaseio.com\",\n * storageBucket: \"<OTHER_STORAGE_BUCKET>.appspot.com\"\n * }, \"otherApp\");\n * ```\n *\n * @param options - Options to configure the app's services.\n * @param name - Optional name of the app to initialize. If no name\n * is provided, the default is `\"[DEFAULT]\"`.\n *\n * @returns The initialized app.\n *\n * @throws If the optional `name` parameter is malformed or empty.\n *\n * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.\n *\n * @public\n */\nexport function initializeApp(\n options: FirebaseOptions,\n name?: string\n): FirebaseApp;\n/**\n * Creates and initializes a FirebaseApp instance.\n *\n * @param options - Options to configure the app's services.\n * @param config - FirebaseApp Configuration\n *\n * @throws If {@link FirebaseAppSettings.name} is defined but the value is malformed or empty.\n *\n * @throws If a `FirebaseApp` already exists with the same name but with a different configuration.\n * @public\n */\nexport function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppSettings\n): FirebaseApp;\n/**\n * Creates and initializes a FirebaseApp instance.\n *\n * @public\n */\nexport function initializeApp(): FirebaseApp;\nexport function initializeApp(\n _options?: FirebaseOptions,\n rawConfig = {}\n): FirebaseApp {\n let options = _options;\n\n if (typeof rawConfig !== 'object') {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config: Required<FirebaseAppSettings> = {\n name: DEFAULT_ENTRY_NAME,\n automaticDataCollectionEnabled: true,\n ...rawConfig\n };\n const name = config.name;\n\n if (typeof name !== 'string' || !name) {\n throw ERROR_FACTORY.create(AppError.BAD_APP_NAME, {\n appName: String(name)\n });\n }\n\n options ||= getDefaultAppConfig();\n\n if (!options) {\n throw ERROR_FACTORY.create(AppError.NO_OPTIONS);\n }\n\n const existingApp = _apps.get(name) as FirebaseAppImpl;\n if (existingApp) {\n // return the existing app if options and config deep equal the ones in the existing app.\n if (\n deepEqual(options, existingApp.options) &&\n deepEqual(config, existingApp.config)\n ) {\n return existingApp;\n } else {\n throw ERROR_FACTORY.create(AppError.DUPLICATE_APP, { appName: name });\n }\n }\n\n const container = new ComponentContainer(name);\n for (const component of _components.values()) {\n container.addComponent(component);\n }\n\n const newApp = new FirebaseAppImpl(options, config, container);\n\n _apps.set(name, newApp);\n\n return newApp;\n}\n\n/**\n * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.\n *\n * The `FirebaseServerApp` is similar to `FirebaseApp`, but is intended for execution in\n * server side rendering environments only. Initialization will fail if invoked from a\n * browser environment.\n *\n * See\n * {@link\n * https://firebase.google.com/docs/web/setup#add_firebase_to_your_app\n * | Add Firebase to your app} and\n * {@link\n * https://firebase.google.com/docs/web/setup#multiple-projects\n * | Initialize multiple projects} for detailed documentation.\n *\n * @example\n * ```javascript\n *\n * // Initialize an instance of `FirebaseServerApp`.\n * // Retrieve your own options values by adding a web app on\n * // https://console.firebase.google.com\n * initializeServerApp({\n * apiKey: \"AIza....\", // Auth / General Use\n * authDomain: \"YOUR_APP.firebaseapp.com\", // Auth with popup/redirect\n * databaseURL: \"https://YOUR_APP.firebaseio.com\", // Realtime Database\n * storageBucket: \"YOUR_APP.appspot.com\", // Storage\n * messagingSenderId: \"123456789\" // Cloud Messaging\n * },\n * {\n * authIdToken: \"Your Auth ID Token\"\n * });\n * ```\n *\n * @param options - `Firebase.AppOptions` to configure the app's services, or a\n * a `FirebaseApp` instance which contains the `AppOptions` within.\n * @param config - Optional `FirebaseServerApp` settings.\n *\n * @returns The initialized `FirebaseServerApp`.\n *\n * @throws If invoked in an unsupported non-server environment such as a browser.\n *\n * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't\n * provide Finalization Registry support.\n *\n * @public\n */\nexport function initializeServerApp(\n options: FirebaseOptions | FirebaseApp,\n config?: FirebaseServerAppSettings\n): FirebaseServerApp;\n\n/**\n * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.\n *\n * @param config - Optional `FirebaseServerApp` settings.\n *\n * @returns The initialized `FirebaseServerApp`.\n *\n * @throws If invoked in an unsupported non-server environment such as a browser.\n * @throws If {@link FirebaseServerAppSettings.releaseOnDeref} is defined but the runtime doesn't\n * provide Finalization Registry support.\n * @throws If the `FIREBASE_OPTIONS` environment variable does not contain a valid project\n * configuration required for auto-initialization.\n *\n * @public\n */\nexport function initializeServerApp(\n config?: FirebaseServerAppSettings\n): FirebaseServerApp;\nexport function initializeServerApp(\n _options?: FirebaseApp | FirebaseServerAppSettings | FirebaseOptions,\n _serverAppConfig: FirebaseServerAppSettings = {}\n): FirebaseServerApp {\n if (isBrowser() && !isWebWorker()) {\n // FirebaseServerApp isn't designed to be run in browsers.\n throw ERROR_FACTORY.create(AppError.INVALID_SERVER_APP_ENVIRONMENT);\n }\n\n let firebaseOptions: FirebaseOptions | undefined;\n let serverAppSettings: FirebaseServerAppSettings = _serverAppConfig || {};\n\n if (_options) {\n if (_isFirebaseApp(_options)) {\n firebaseOptions = _options.options;\n } else if (_isFirebaseServerAppSettings(_options)) {\n serverAppSettings = _options;\n } else {\n firebaseOptions = _options;\n }\n }\n\n if (serverAppSettings.automaticDataCollectionEnabled === undefined) {\n serverAppSettings.automaticDataCollectionEnabled = true;\n }\n\n firebaseOptions ||= getDefaultAppConfig();\n if (!firebaseOptions) {\n throw ERROR_FACTORY.create(AppError.NO_OPTIONS);\n }\n\n // Build an app name based on a hash of the configuration options.\n const nameObj = {\n ...serverAppSettings,\n ...firebaseOptions\n };\n\n // However, Do not mangle the name based on releaseOnDeref, since it will vary between the\n // construction of FirebaseServerApp instances. For example, if the object is the request headers.\n if (nameObj.releaseOnDeref !== undefined) {\n delete nameObj.releaseOnDeref;\n }\n\n const hashCode = (s: string): number => {\n return [...s].reduce(\n (hash, c) => (Math.imul(31, hash) + c.charCodeAt(0)) | 0,\n 0\n );\n };\n\n if (serverAppSettings.releaseOnDeref !== undefined) {\n if (typeof FinalizationRegistry === 'undefined') {\n throw ERROR_FACTORY.create(\n AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED,\n {}\n );\n }\n }\n\n const nameString = '' + hashCode(JSON.stringify(nameObj));\n const existingApp = _serverApps.get(nameString) as FirebaseServerApp;\n if (existingApp) {\n (existingApp as FirebaseServerAppImpl).incRefCount(\n serverAppSettings.releaseOnDeref\n );\n return existingApp;\n }\n\n const container = new ComponentContainer(nameString);\n for (const component of _components.values()) {\n container.addComponent(component);\n }\n\n const newApp = new FirebaseServerAppImpl(\n firebaseOptions,\n serverAppSettings,\n nameString,\n container\n );\n\n _serverApps.set(nameString, newApp);\n\n return newApp;\n}\n\n/**\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\n *\n * When called with no arguments, the default app is returned. When an app name\n * is provided, the app corresponding to that name is returned.\n *\n * An exception is thrown if the app being retrieved has not yet been\n * initialized.\n *\n * @example\n * ```javascript\n * // Return the default app\n * const app = getApp();\n * ```\n *\n * @example\n * ```javascript\n * // Return a named app\n * const otherApp = getApp(\"otherApp\");\n * ```\n *\n * @param name - Optional name of the app to return. If no name is\n * provided, the default is `\"[DEFAULT]\"`.\n *\n * @returns The app corresponding to the provided app name.\n * If no app name is provided, the default app is returned.\n *\n * @public\n */\nexport function getApp(name: string = DEFAULT_ENTRY_NAME): FirebaseApp {\n const app = _apps.get(name);\n if (!app && name === DEFAULT_ENTRY_NAME && getDefaultAppConfig()) {\n return initializeApp();\n }\n if (!app) {\n throw ERROR_FACTORY.create(AppError.NO_APP, { appName: name });\n }\n\n return app;\n}\n\n/**\n * A (read-only) array of all initialized apps.\n * @public\n */\nexport function getApps(): FirebaseApp[] {\n return Array.from(_apps.values());\n}\n\n/**\n * Renders this app unusable and frees the resources of all associated\n * services.\n *\n * @example\n * ```javascript\n * deleteApp(app)\n * .then(function() {\n * console.log(\"App deleted successfully\");\n * })\n * .catch(function(error) {\n * console.log(\"Error deleting app:\", error);\n * });\n * ```\n *\n * @public\n */\nexport async function deleteApp(app: FirebaseApp): Promise<void> {\n let cleanupProviders = false;\n const name = app.name;\n if (_apps.has(name)) {\n cleanupProviders = true;\n _apps.delete(name);\n } else if (_serverApps.has(name)) {\n const firebaseServerApp = app as FirebaseServerAppImpl;\n if (firebaseServerApp.decRefCount() <= 0) {\n _serverApps.delete(name);\n cleanupProviders = true;\n }\n }\n\n if (cleanupProviders) {\n await Promise.all(\n (app as FirebaseAppImpl).container\n .getProviders()\n .map(provider => provider.delete())\n );\n (app as FirebaseAppImpl).isDeleted = true;\n }\n}\n\n/**\n * Registers a library's name and version for platform logging purposes.\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\n * @param version - Current version of that library.\n * @param variant - Bundle variant, e.g., node, rn, etc.\n *\n * @public\n */\nexport function registerVersion(\n libraryKeyOrName: string,\n version: string,\n variant?: string\n): void {\n // TODO: We can use this check to whitelist strings when/if we set up\n // a good whitelist system.\n let library = PLATFORM_LOG_STRING[libraryKeyOrName] ?? libraryKeyOrName;\n if (variant) {\n library += `-${variant}`;\n }\n const libraryMismatch = library.match(/\\s|\\//);\n const versionMismatch = version.match(/\\s|\\//);\n if (libraryMismatch || versionMismatch) {\n const warning = [\n `Unable to register library \"${library}\" with version \"${version}\":`\n ];\n if (libraryMismatch) {\n warning.push(\n `library name \"${library}\" contains illegal characters (whitespace or \"/\")`\n );\n }\n if (libraryMismatch && versionMismatch) {\n warning.push('and');\n }\n if (versionMismatch) {\n warning.push(\n `version name \"${version}\" contains illegal characters (whitespace or \"/\")`\n );\n }\n logger.warn(warning.join(' '));\n return;\n }\n _registerComponent(\n new Component(\n `${library}-version` as Name,\n () => ({ library, version }),\n ComponentType.VERSION\n )\n );\n}\n\n/**\n * Sets log handler for all Firebase SDKs.\n * @param logCallback - An optional custom log handler that executes user code whenever\n * the Firebase SDK makes a logging call.\n *\n * @public\n */\nexport function onLog(\n logCallback: LogCallback | null,\n options?: LogOptions\n): void {\n if (logCallback !== null && typeof logCallback !== 'function') {\n throw ERROR_FACTORY.create(AppError.INVALID_LOG_ARGUMENT);\n }\n setUserLogHandler(logCallback, options);\n}\n\n/**\n * Sets log level for all Firebase SDKs.\n *\n * All of the log types above the current log level are captured (i.e. if\n * you set the log level to `info`, errors are logged, but `debug` and\n * `verbose` logs are not).\n *\n * @public\n */\nexport function setLogLevel(logLevel: LogLevelString): void {\n setLogLevelImpl(logLevel);\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseError } from '@firebase/util';\nimport { DBSchema, openDB, IDBPDatabase } from 'idb';\nimport { AppError, ERROR_FACTORY } from './errors';\nimport { FirebaseApp } from './public-types';\nimport { HeartbeatsInIndexedDB } from './types';\nimport { logger } from './logger';\n\nconst DB_NAME = 'firebase-heartbeat-database';\nconst DB_VERSION = 1;\nconst STORE_NAME = 'firebase-heartbeat-store';\n\ninterface AppDB extends DBSchema {\n 'firebase-heartbeat-store': {\n key: string;\n value: HeartbeatsInIndexedDB;\n };\n}\n\nlet dbPromise: Promise<IDBPDatabase<AppDB>> | null = null;\nfunction getDbPromise(): Promise<IDBPDatabase<AppDB>> {\n if (!dbPromise) {\n dbPromise = openDB<AppDB>(DB_NAME, DB_VERSION, {\n upgrade: (db, oldVersion) => {\n // We don't use 'break' in this switch statement, the fall-through\n // behavior is what we want, because if there are multiple versions between\n // the old version and the current version, we want ALL the migrations\n // that correspond to those versions to run, not only the last one.\n // eslint-disable-next-line default-case\n switch (oldVersion) {\n case 0:\n try {\n db.createObjectStore(STORE_NAME);\n } catch (e) {\n // Safari/iOS browsers throw occasional exceptions on\n // db.createObjectStore() that may be a bug. Avoid blocking\n // the rest of the app functionality.\n console.warn(e);\n }\n }\n }\n }).catch(e => {\n throw ERROR_FACTORY.create(AppError.IDB_OPEN, {\n originalErrorMessage: e.message\n });\n });\n }\n return dbPromise;\n}\n\nexport async function readHeartbeatsFromIndexedDB(\n app: FirebaseApp\n): Promise<HeartbeatsInIndexedDB | undefined> {\n try {\n const db = await getDbPromise();\n const tx = db.transaction(STORE_NAME);\n const result = await tx.objectStore(STORE_NAME).get(computeKey(app));\n // We already have the value but tx.done can throw,\n // so we need to await it here to catch errors\n await tx.done;\n return result;\n } catch (e) {\n if (e instanceof FirebaseError) {\n logger.warn(e.message);\n } else {\n const idbGetError = ERROR_FACTORY.create(AppError.IDB_GET, {\n originalErrorMessage: (e as Error)?.message\n });\n logger.warn(idbGetError.message);\n }\n }\n}\n\nexport async function writeHeartbeatsToIndexedDB(\n app: FirebaseApp,\n heartbeatObject: HeartbeatsInIndexedDB\n): Promise<void> {\n try {\n const db = await getDbPromise();\n const tx = db.transaction(STORE_NAME, 'readwrite');\n const objectStore = tx.objectStore(STORE_NAME);\n await objectStore.put(heartbeatObject, computeKey(app));\n await tx.done;\n } catch (e) {\n if (e instanceof FirebaseError) {\n logger.warn(e.message);\n } else {\n const idbGetError = ERROR_FACTORY.create(AppError.IDB_WRITE, {\n originalErrorMessage: (e as Error)?.message\n });\n logger.warn(idbGetError.message);\n }\n }\n}\n\nfunction computeKey(app: FirebaseApp): string {\n return `${app.name}!${app.options.appId}`;\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ComponentContainer } from '@firebase/component';\nimport {\n base64urlEncodeWithoutPadding,\n isIndexedDBAvailable,\n validateIndexedDBOpenable\n} from '@firebase/util';\nimport {\n readHeartbeatsFromIndexedDB,\n writeHeartbeatsToIndexedDB\n} from './indexeddb';\nimport { FirebaseApp } from './public-types';\nimport {\n HeartbeatsByUserAgent,\n HeartbeatService,\n HeartbeatsInIndexedDB,\n HeartbeatStorage,\n SingleDateHeartbeat\n} from './types';\nimport { logger } from './logger';\n\nconst MAX_HEADER_BYTES = 1024;\nexport const MAX_NUM_STORED_HEARTBEATS = 30;\n\nexport class HeartbeatServiceImpl implements HeartbeatService {\n /**\n * The persistence layer for heartbeats\n * Leave public for easier testing.\n */\n _storage: HeartbeatStorageImpl;\n\n /**\n * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\n * the header string.\n * Stores one record per date. This will be consolidated into the standard\n * format of one record per user agent string before being sent as a header.\n * Populated from indexedDB when the controller is instantiated and should\n * be kept in sync with indexedDB.\n * Leave public for easier testing.\n */\n _heartbeatsCache: HeartbeatsInIndexedDB | null = null;\n\n /**\n * the initialization promise for populating heartbeatCache.\n * If getHeartbeatsHeader() is called before the promise resolves\n * (heartbeatsCache == null), it should wait for this promise\n * Leave public for easier testing.\n */\n _heartbeatsCachePromise: Promise<HeartbeatsInIndexedDB>;\n constructor(private readonly container: ComponentContainer) {\n const app = this.container.getProvider('app').getImmediate();\n this._storage = new HeartbeatStorageImpl(app);\n this._heartbeatsCachePromise = this._storage.read().then(result => {\n this._heartbeatsCache = result;\n return result;\n });\n }\n\n /**\n * Called to report a heartbeat. The function will generate\n * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\n * to IndexedDB.\n * Note that we only store one heartbeat per day. So if a heartbeat for today is\n * already logged, subsequent calls to this function in the same day will be ignored.\n */\n async triggerHeartbeat(): Promise<void> {\n try {\n const platformLogger = this.container\n .getProvider('platform-logger')\n .getImmediate();\n\n // This is the \"Firebase user agent\" string from the platform logger\n // service, not the browser user agent.\n const agent = platformLogger.getPlatformInfoString();\n const date = getUTCDateString();\n if (this._heartbeatsCache?.heartbeats == null) {\n this._heartbeatsCache = await this._heartbeatsCachePromise;\n // If we failed to construct a heartbeats cache, then return immediately.\n if (this._heartbeatsCache?.heartbeats == null) {\n return;\n }\n }\n // Do not store a heartbeat if one is already stored for this day\n // or if a header has already been sent today.\n if (\n this._heartbeatsCache.lastSentHeartbeatDate === date ||\n this._heartbeatsCache.heartbeats.some(\n singleDateHeartbeat => singleDateHeartbeat.date === date\n )\n ) {\n return;\n } else {\n // There is no entry for this date. Create one.\n this._heartbeatsCache.heartbeats.push({ date, agent });\n\n // If the number of stored heartbeats exceeds the maximum number of stored heartbeats, remove the heartbeat with the earliest date.\n // Since this is executed each time a heartbeat is pushed, the limit can only be exceeded by one, so only one needs to be removed.\n if (\n this._heartbeatsCache.heartbeats.length > MAX_NUM_STORED_HEARTBEATS\n ) {\n const earliestHeartbeatIdx = getEarliestHeartbeatIdx(\n this._heartbeatsCache.heartbeats\n );\n this._heartbeatsCache.heartbeats.splice(earliestHeartbeatIdx, 1);\n }\n }\n\n return this._storage.overwrite(this._heartbeatsCache);\n } catch (e) {\n logger.warn(e);\n }\n }\n\n /**\n * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\n * It also clears all heartbeats from memory as well as in IndexedDB.\n *\n * NOTE: Consuming product SDKs should not send the header if this method\n * returns an empty string.\n */\n async getHeartbeatsHeader(): Promise<string> {\n try {\n if (this._heartbeatsCache === null) {\n await this._heartbeatsCachePromise;\n }\n // If it's still null or the array is empty, there is no data to send.\n if (\n this._heartbeatsCache?.heartbeats == null ||\n this._heartbeatsCache.heartbeats.length === 0\n ) {\n return '';\n }\n const date = getUTCDateString();\n // Extract as many heartbeats from the cache as will fit under the size limit.\n const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(\n this._heartbeatsCache.heartbeats\n );\n const headerString = base64urlEncodeWithoutPadding(\n JSON.stringify({ version: 2, heartbeats: heartbeatsToSend })\n );\n // Store last sent date to prevent another being logged/sent for the same day.\n this._heartbeatsCache.lastSentHeartbeatDate = date;\n if (unsentEntries.length > 0) {\n // Store any unsent entries if they exist.\n this._heartbeatsCache.heartbeats = unsentEntries;\n // This seems more likely than emptying the array (below) to lead to some odd state\n // since the cache isn't empty and this will be called again on the next request,\n // and is probably safest if we await it.\n await this._storage.overwrite(this._heartbeatsCache);\n } else {\n this._heartbeatsCache.heartbeats = [];\n // Do not wait for this, to reduce latency.\n void this._storage.overwrite(this._heartbeatsCache);\n }\n return headerString;\n } catch (e) {\n logger.warn(e);\n return '';\n }\n }\n}\n\nfunction getUTCDateString(): string {\n const today = new Date();\n // Returns date format 'YYYY-MM-DD'\n return today.toISOString().substring(0, 10);\n}\n\nexport function extractHeartbeatsForHeader(\n heartbeatsCache: SingleDateHeartbeat[],\n maxSize = MAX_HEADER_BYTES\n): {\n heartbeatsToSend: HeartbeatsByUserAgent[];\n unsentEntries: SingleDateHeartbeat[];\n} {\n // Heartbeats grouped by user agent in the standard format to be sent in\n // the header.\n const heartbeatsToSend: HeartbeatsByUserAgent[] = [];\n // Single date format heartbeats that are not sent.\n let unsentEntries = heartbeatsCache.slice();\n for (const singleDateHeartbeat of heartbeatsCache) {\n // Look for an existing entry with the same user agent.\n const heartbeatEntry = heartbeatsToSend.find(\n hb => hb.agent === singleDateHeartbeat.agent\n );\n if (!heartbeatEntry) {\n // If no entry for this user agent exists, create one.\n heartbeatsToSend.push({\n agent: singleDateHeartbeat.agent,\n dates: [singleDateHeartbeat.date]\n });\n if (countBytes(heartbeatsToSend) > maxSize) {\n // If the header would exceed max size, remove the added heartbeat\n // entry and stop adding to the header.\n heartbeatsToSend.pop();\n break;\n }\n } else {\n heartbeatEntry.dates.push(singleDateHeartbeat.date);\n // If the header would exceed max size, remove the added date\n // and stop adding to the header.\n if (countBytes(heartbeatsToSend) > maxSize) {\n heartbeatEntry.dates.pop();\n break;\n }\n }\n // Pop unsent entry from queue. (Skipped if adding the entry exceeded\n // quota and the loop breaks early.)\n unsentEntries = unsentEntries.slice(1);\n }\n return {\n heartbeatsToSend,\n unsentEntries\n };\n}\n\nexport class HeartbeatStorageImpl implements HeartbeatStorage {\n private _canUseIndexedDBPromise: Promise<boolean>;\n constructor(public app: FirebaseApp) {\n this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\n }\n async runIndexedDBEnvironmentCheck(): Promise<boolean> {\n if (!isIndexedDBAvailable()) {\n return false;\n } else {\n return validateIndexedDBOpenable()\n .then(() => true)\n .catch(() => false);\n }\n }\n /**\n * Read all heartbeats.\n */\n async read(): Promise<HeartbeatsInIndexedDB> {\n const canUseIndexedDB = await this._canUseIndexedDBPromise;\n if (!canUseIndexedDB) {\n return { heartbeats: [] };\n } else {\n const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\n if (idbHeartbeatObject?.heartbeats) {\n return idbHeartbeatObject;\n } else {\n return { heartbeats: [] };\n }\n }\n }\n // overwrite the storage with the provided heartbeats\n async overwrite(heartbeatsObject: HeartbeatsInIndexedDB): Promise<void> {\n const canUseIndexedDB = await this._canUseIndexedDBPromise;\n if (!canUseIndexedDB) {\n return;\n } else {\n const existingHeartbeatsObject = await this.read();\n return writeHeartbeatsToIndexedDB(this.app, {\n lastSentHeartbeatDate:\n heartbeatsObject.lastSentHeartbeatDate ??\n existingHeartbeatsObject.lastSentHeartbeatDate,\n heartbeats: heartbeatsObject.heartbeats\n });\n }\n }\n // add heartbeats\n async add(heartbeatsObject: HeartbeatsInIndexedDB): Promise<void> {\n const canUseIndexedDB = await this._canUseIndexedDBPromise;\n if (!canUseIndexedDB) {\n return;\n } else {\n const existingHeartbeatsObject = await this.read();\n return writeHeartbeatsToIndexedDB(this.app, {\n lastSentHeartbeatDate:\n heartbeatsObject.lastSentHeartbeatDate ??\n existingHeartbeatsObject.lastSentHeartbeatDate,\n heartbeats: [\n ...existingHeartbeatsObject.heartbeats,\n ...heartbeatsObject.heartbeats\n ]\n });\n }\n }\n}\n\n/**\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\n * in a platform logging header JSON object, stringified, and converted\n * to base 64.\n */\nexport function countBytes(heartbeatsCache: HeartbeatsByUserAgent[]): number {\n // base64 has a restricted set of characters, all of which should be 1 byte.\n return base64urlEncodeWithoutPadding(\n // heartbeatsCache wrapper properties\n JSON.stringify({ version: 2, heartbeats: heartbeatsCache })\n ).length;\n}\n\n/**\n * Returns the index of the heartbeat with the earliest date.\n * If the heartbeats array is empty, -1 is returned.\n */\nexport function getEarliestHeartbeatIdx(\n heartbeats: SingleDateHeartbeat[]\n): number {\n if (heartbeats.length === 0) {\n return -1;\n }\n\n let earliestHeartbeatIdx = 0;\n let earliestHeartbeatDate = heartbeats[0].date;\n\n for (let i = 1; i < heartbeats.length; i++) {\n if (heartbeats[i].date < earliestHeartbeatDate) {\n earliestHeartbeatDate = heartbeats[i].date;\n earliestHeartbeatIdx = i;\n }\n }\n\n return earliestHeartbeatIdx;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Component, ComponentType } from '@firebase/component';\nimport { PlatformLoggerServiceImpl } from './platformLoggerService';\nimport { name, version } from '../package.json';\nimport { _registerComponent } from './internal';\nimport { registerVersion } from './api';\nimport { HeartbeatServiceImpl } from './heartbeatService';\n\nexport function registerCoreComponents(variant?: string): void {\n _registerComponent(\n new Component(\n 'platform-logger',\n container => new PlatformLoggerServiceImpl(container),\n ComponentType.PRIVATE\n )\n );\n _registerComponent(\n new Component(\n 'heartbeat',\n container => new HeartbeatServiceImpl(container),\n ComponentType.PRIVATE\n )\n );\n\n // Register `app` package.\n registerVersion(name, version, variant);\n // BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation\n registerVersion(name, version, '__BUILD_TARGET__');\n // Register platform SDK identifier (no version).\n registerVersion('fire-js', '');\n}\n","/**\n * Firebase App\n *\n * @remarks This package coordinates the communication between the different Firebase components\n * @packageDocumentation\n */\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { registerCoreComponents } from './registerCoreComponents';\n\nexport * from './api';\nexport * from './internal';\nexport * from './public-types';\n\nregisterCoreComponents('__RUNTIME_ENV__');\n"],"names":["Logger","appName","appCompatName","analyticsName","analyticsCompatName","appCheckName","appCheckCompatName","authName","authCompatName","databaseName","dataconnectName","databaseCompatName","functionsName","functionsCompatName","installationsName","installationsCompatName","messagingName","messagingCompatName","performanceName","performanceCompatName","remoteConfigName","remoteConfigCompatName","storageName","storageCompatName","firestoreName","firestoreCompatName","aiName","packageName","ErrorFactory","Component","base64Decode","version","getDefaultAppConfig","deepEqual","ComponentContainer","isBrowser","isWebWorker","setUserLogHandler","setLogLevelImpl","openDB","FirebaseError","base64urlEncodeWithoutPadding","isIndexedDBAvailable","validateIndexedDBOpenable","name"],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;MAUU,yBAAyB,CAAA;AACpC,IAAA,WAAA,CAA6B,SAA6B,EAAA;QAA7B,IAAS,CAA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C;KACX;IAED,IAAI,oBAAoB,GAAG,CAAC,CAAC;IAC7B,IAAI,qBAAqB,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAE/C,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC1C,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,qBAAqB,EAAE;AAC9C,YAAA,qBAAqB,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC3C,oBAAoB,GAAG,CAAC,CAAC;SAC1B;KACF;AAED,IAAA,OAAO,oBAAoB,CAAC;AAC9B;;AC5UA;;;;;;;;;;;;;;;AAeG;AASG,SAAU,sBAAsB,CAAC,OAAgB,EAAA;AACrD,IAAA,kBAAkB,CAChB,IAAIZ,mBAAS,CACX,iBAAiB,EACjB,SAAS,IAAI,IAAI,yBAAyB,CAAC,SAAS,CAAC,EAAA,SAAA,6BAEtD,CACF,CAAC;AACF,IAAA,kBAAkB,CAChB,IAAIA,mBAAS,CACX,WAAW,EACX,SAAS,IAAI,IAAI,oBAAoB,CAAC,SAAS,CAAC,EAAA,SAAA,6BAEjD,CACF,CAAC;;AAGF,IAAA,eAAe,CAACe,MAAI,EAAEb,SAAO,EAAE,OAAO,CAAC,CAAC;;AAExC,IAAA,eAAe,CAACa,MAAI,EAAEb,SAAO,EAAE,SAAkB,CAAC,CAAC;;AAEnD,IAAA,eAAe,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AACjC;;AC9CA;;;;;AAKG;AAyBH,sBAAsB,CAAC,MAAiB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file
diff --git a/frontend-old/node_modules/@firebase/app/package.json b/frontend-old/node_modules/@firebase/app/package.json
new file mode 100644
index 0000000..0bcf976
--- /dev/null
+++ b/frontend-old/node_modules/@firebase/app/package.json
@@ -0,0 +1,75 @@
+{
+ "name": "@firebase/app",
+ "version": "0.14.5",
+ "description": "The primary entrypoint to the Firebase JS SDK",
+ "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
+ "main": "dist/index.cjs.js",
+ "browser": "dist/esm/index.esm.js",
+ "module": "dist/esm/index.esm.js",
+ "react-native": "dist/index.cjs.js",
+ "exports": {
+ ".": {
+ "types": "./dist/app-public.d.ts",
+ "require": "./dist/index.cjs.js",
+ "react-native": "./dist/index.cjs.js",
+ "default": "./dist/esm/index.esm.js"
+ },
+ "./package.json": "./package.json"
+ },
+ "files": [
+ "dist"
+ ],
+ "scripts": {
+ "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
+ "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
+ "build": "rollup -c && yarn api-report",
+ "build:release": "rollup -c rollup.config.release.js && yarn api-report && yarn typings:public",
+ "build:deps": "lerna run --scope @firebase/app --include-dependencies build",
+ "dev": "rollup -c -w",
+ "test": "run-p --npm-path npm lint test:all",
+ "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
+ "test:all": "run-p --npm-path npm test:browser test:node",
+ "test:browser": "karma start",
+ "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.ts --config ../../config/mocharc.node.js",
+ "trusted-type-check": "tsec -p tsconfig.json --noEmit",
+ "api-report": "api-extractor run --local --verbose",
+ "doc": "api-documenter markdown --input temp --output docs",
+ "build:doc": "yarn build && yarn doc",
+ "typings:public": "node ../../scripts/build/use_typings.js ./dist/app-public.d.ts",
+ "typings:internal": "node ../../scripts/build/use_typings.js ./dist/app.d.ts"
+ },
+ "dependencies": {
+ "@firebase/util": "1.13.0",
+ "@firebase/logger": "0.5.0",
+ "@firebase/component": "0.7.0",
+ "idb": "7.1.1",
+ "tslib": "^2.1.0"
+ },
+ "license": "Apache-2.0",
+ "devDependencies": {
+ "@rollup/plugin-json": "6.1.0",
+ "rollup": "2.79.2",
+ "rollup-plugin-replace": "2.2.0",
+ "rollup-plugin-typescript2": "0.36.0",
+ "rollup-plugin-dts": "5.3.1",
+ "typescript": "5.5.4"
+ },
+ "repository": {
+ "directory": "packages/app",
+ "type": "git",
+ "url": "git+https://github.com/firebase/firebase-js-sdk.git"
+ },
+ "bugs": {
+ "url": "https://github.com/firebase/firebase-js-sdk/issues"
+ },
+ "typings": "./dist/app-public.d.ts",
+ "nyc": {
+ "extension": [
+ ".ts"
+ ],
+ "reportDir": "./coverage/node"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ }
+}